...

Source file src/google.golang.org/api/solar/v1/solar-gen.go

Documentation: google.golang.org/api/solar/v1

     1  // Copyright 2024 Google LLC.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Code generated file. DO NOT EDIT.
     6  
     7  // Package solar provides access to the Solar API.
     8  //
     9  // For product documentation, see: https://developers.google.com/maps/documentation/solar
    10  //
    11  // # Library status
    12  //
    13  // These client libraries are officially supported by Google. However, this
    14  // library is considered complete and is in maintenance mode. This means
    15  // that we will address critical bugs and security issues but will not add
    16  // any new features.
    17  //
    18  // When possible, we recommend using our newer
    19  // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
    20  // that are still actively being worked and iterated on.
    21  //
    22  // # Creating a client
    23  //
    24  // Usage example:
    25  //
    26  //	import "google.golang.org/api/solar/v1"
    27  //	...
    28  //	ctx := context.Background()
    29  //	solarService, err := solar.NewService(ctx)
    30  //
    31  // In this example, Google Application Default Credentials are used for
    32  // authentication. For information on how to create and obtain Application
    33  // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
    34  //
    35  // # Other authentication options
    36  //
    37  // To use an API key for authentication (note: some APIs do not support API
    38  // keys), use [google.golang.org/api/option.WithAPIKey]:
    39  //
    40  //	solarService, err := solar.NewService(ctx, option.WithAPIKey("AIza..."))
    41  //
    42  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
    43  // flow, use [google.golang.org/api/option.WithTokenSource]:
    44  //
    45  //	config := &oauth2.Config{...}
    46  //	// ...
    47  //	token, err := config.Exchange(ctx, ...)
    48  //	solarService, err := solar.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    49  //
    50  // See [google.golang.org/api/option.ClientOption] for details on options.
    51  package solar // import "google.golang.org/api/solar/v1"
    52  
    53  import (
    54  	"bytes"
    55  	"context"
    56  	"encoding/json"
    57  	"errors"
    58  	"fmt"
    59  	"io"
    60  	"net/http"
    61  	"net/url"
    62  	"strconv"
    63  	"strings"
    64  
    65  	googleapi "google.golang.org/api/googleapi"
    66  	internal "google.golang.org/api/internal"
    67  	gensupport "google.golang.org/api/internal/gensupport"
    68  	option "google.golang.org/api/option"
    69  	internaloption "google.golang.org/api/option/internaloption"
    70  	htransport "google.golang.org/api/transport/http"
    71  )
    72  
    73  // Always reference these packages, just in case the auto-generated code
    74  // below doesn't.
    75  var _ = bytes.NewBuffer
    76  var _ = strconv.Itoa
    77  var _ = fmt.Sprintf
    78  var _ = json.NewDecoder
    79  var _ = io.Copy
    80  var _ = url.Parse
    81  var _ = gensupport.MarshalJSON
    82  var _ = googleapi.Version
    83  var _ = errors.New
    84  var _ = strings.Replace
    85  var _ = context.Canceled
    86  var _ = internaloption.WithDefaultEndpoint
    87  var _ = internal.Version
    88  
    89  const apiId = "solar:v1"
    90  const apiName = "solar"
    91  const apiVersion = "v1"
    92  const basePath = "https://solar.googleapis.com/"
    93  const basePathTemplate = "https://solar.UNIVERSE_DOMAIN/"
    94  const mtlsBasePath = "https://solar.mtls.googleapis.com/"
    95  
    96  // OAuth2 scopes used by this API.
    97  const (
    98  	// See, edit, configure, and delete your Google Cloud data and see the email
    99  	// address for your Google Account.
   100  	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
   101  )
   102  
   103  // NewService creates a new Service.
   104  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
   105  	scopesOption := internaloption.WithDefaultScopes(
   106  		"https://www.googleapis.com/auth/cloud-platform",
   107  	)
   108  	// NOTE: prepend, so we don't override user-specified scopes.
   109  	opts = append([]option.ClientOption{scopesOption}, opts...)
   110  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   111  	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
   112  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   113  	opts = append(opts, internaloption.EnableNewAuthLibrary())
   114  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   115  	if err != nil {
   116  		return nil, err
   117  	}
   118  	s, err := New(client)
   119  	if err != nil {
   120  		return nil, err
   121  	}
   122  	if endpoint != "" {
   123  		s.BasePath = endpoint
   124  	}
   125  	return s, nil
   126  }
   127  
   128  // New creates a new Service. It uses the provided http.Client for requests.
   129  //
   130  // Deprecated: please use NewService instead.
   131  // To provide a custom HTTP client, use option.WithHTTPClient.
   132  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   133  func New(client *http.Client) (*Service, error) {
   134  	if client == nil {
   135  		return nil, errors.New("client is nil")
   136  	}
   137  	s := &Service{client: client, BasePath: basePath}
   138  	s.BuildingInsights = NewBuildingInsightsService(s)
   139  	s.DataLayers = NewDataLayersService(s)
   140  	s.GeoTiff = NewGeoTiffService(s)
   141  	return s, nil
   142  }
   143  
   144  type Service struct {
   145  	client    *http.Client
   146  	BasePath  string // API endpoint base URL
   147  	UserAgent string // optional additional User-Agent fragment
   148  
   149  	BuildingInsights *BuildingInsightsService
   150  
   151  	DataLayers *DataLayersService
   152  
   153  	GeoTiff *GeoTiffService
   154  }
   155  
   156  func (s *Service) userAgent() string {
   157  	if s.UserAgent == "" {
   158  		return googleapi.UserAgent
   159  	}
   160  	return googleapi.UserAgent + " " + s.UserAgent
   161  }
   162  
   163  func NewBuildingInsightsService(s *Service) *BuildingInsightsService {
   164  	rs := &BuildingInsightsService{s: s}
   165  	return rs
   166  }
   167  
   168  type BuildingInsightsService struct {
   169  	s *Service
   170  }
   171  
   172  func NewDataLayersService(s *Service) *DataLayersService {
   173  	rs := &DataLayersService{s: s}
   174  	return rs
   175  }
   176  
   177  type DataLayersService struct {
   178  	s *Service
   179  }
   180  
   181  func NewGeoTiffService(s *Service) *GeoTiffService {
   182  	rs := &GeoTiffService{s: s}
   183  	return rs
   184  }
   185  
   186  type GeoTiffService struct {
   187  	s *Service
   188  }
   189  
   190  // BuildingInsights: Response message for `Solar.FindClosestBuildingInsights`.
   191  // Information about the location, dimensions, and solar potential of a
   192  // building.
   193  type BuildingInsights struct {
   194  	// AdministrativeArea: Administrative area 1 (e.g., in the US, the state) that
   195  	// contains this building. For example, in the US, the abbreviation might be
   196  	// "MA" or "CA."
   197  	AdministrativeArea string `json:"administrativeArea,omitempty"`
   198  	// BoundingBox: The bounding box of the building.
   199  	BoundingBox *LatLngBox `json:"boundingBox,omitempty"`
   200  	// Center: A point near the center of the building.
   201  	Center *LatLng `json:"center,omitempty"`
   202  	// ImageryDate: Date that the underlying imagery was acquired. This is
   203  	// approximate.
   204  	ImageryDate *Date `json:"imageryDate,omitempty"`
   205  	// ImageryProcessedDate: When processing was completed on this imagery.
   206  	ImageryProcessedDate *Date `json:"imageryProcessedDate,omitempty"`
   207  	// ImageryQuality: The quality of the imagery used to compute the data for this
   208  	// building.
   209  	//
   210  	// Possible values:
   211  	//   "IMAGERY_QUALITY_UNSPECIFIED" - No quality is known.
   212  	//   "HIGH" - The underlying imagery and DSM data were processed at 0.1
   213  	// m/pixel.
   214  	//   "MEDIUM" - The underlying imagery and DSM data were processed at 0.25
   215  	// m/pixel.
   216  	//   "LOW" - The underlying imagery and DSM data were processed at 0.5 m/pixel.
   217  	ImageryQuality string `json:"imageryQuality,omitempty"`
   218  	// Name: The resource name for the building, of the format `building/`.
   219  	Name string `json:"name,omitempty"`
   220  	// PostalCode: Postal code (e.g., US zip code) this building is contained by.
   221  	PostalCode string `json:"postalCode,omitempty"`
   222  	// RegionCode: Region code for the country (or region) this building is in.
   223  	RegionCode string `json:"regionCode,omitempty"`
   224  	// SolarPotential: Solar potential of the building.
   225  	SolarPotential *SolarPotential `json:"solarPotential,omitempty"`
   226  	// StatisticalArea: Statistical area (e.g., US census tract) this building is
   227  	// in.
   228  	StatisticalArea string `json:"statisticalArea,omitempty"`
   229  
   230  	// ServerResponse contains the HTTP response code and headers from the server.
   231  	googleapi.ServerResponse `json:"-"`
   232  	// ForceSendFields is a list of field names (e.g. "AdministrativeArea") to
   233  	// unconditionally include in API requests. By default, fields with empty or
   234  	// default values are omitted from API requests. See
   235  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   236  	// details.
   237  	ForceSendFields []string `json:"-"`
   238  	// NullFields is a list of field names (e.g. "AdministrativeArea") to include
   239  	// in API requests with the JSON null value. By default, fields with empty
   240  	// values are omitted from API requests. See
   241  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   242  	NullFields []string `json:"-"`
   243  }
   244  
   245  func (s *BuildingInsights) MarshalJSON() ([]byte, error) {
   246  	type NoMethod BuildingInsights
   247  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   248  }
   249  
   250  // CashPurchaseSavings: Cost and benefit of an outright purchase of a
   251  // particular configuration of solar panels with a particular electricity
   252  // usage.
   253  type CashPurchaseSavings struct {
   254  	// OutOfPocketCost: Initial cost before tax incentives: the amount that must be
   255  	// paid out-of-pocket. Contrast with `upfront_cost`, which is after tax
   256  	// incentives.
   257  	OutOfPocketCost *Money `json:"outOfPocketCost,omitempty"`
   258  	// PaybackYears: Number of years until payback occurs. A negative value means
   259  	// payback never occurs within the lifetime period.
   260  	PaybackYears float64 `json:"paybackYears,omitempty"`
   261  	// RebateValue: The value of all tax rebates.
   262  	RebateValue *Money `json:"rebateValue,omitempty"`
   263  	// Savings: How much is saved (or not) over the lifetime period.
   264  	Savings *SavingsOverTime `json:"savings,omitempty"`
   265  	// UpfrontCost: Initial cost after tax incentives: it's the amount that must be
   266  	// paid during first year. Contrast with `out_of_pocket_cost`, which is before
   267  	// tax incentives.
   268  	UpfrontCost *Money `json:"upfrontCost,omitempty"`
   269  	// ForceSendFields is a list of field names (e.g. "OutOfPocketCost") to
   270  	// unconditionally include in API requests. By default, fields with empty or
   271  	// default values are omitted from API requests. See
   272  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   273  	// details.
   274  	ForceSendFields []string `json:"-"`
   275  	// NullFields is a list of field names (e.g. "OutOfPocketCost") to include in
   276  	// API requests with the JSON null value. By default, fields with empty values
   277  	// are omitted from API requests. See
   278  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   279  	NullFields []string `json:"-"`
   280  }
   281  
   282  func (s *CashPurchaseSavings) MarshalJSON() ([]byte, error) {
   283  	type NoMethod CashPurchaseSavings
   284  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   285  }
   286  
   287  func (s *CashPurchaseSavings) UnmarshalJSON(data []byte) error {
   288  	type NoMethod CashPurchaseSavings
   289  	var s1 struct {
   290  		PaybackYears gensupport.JSONFloat64 `json:"paybackYears"`
   291  		*NoMethod
   292  	}
   293  	s1.NoMethod = (*NoMethod)(s)
   294  	if err := json.Unmarshal(data, &s1); err != nil {
   295  		return err
   296  	}
   297  	s.PaybackYears = float64(s1.PaybackYears)
   298  	return nil
   299  }
   300  
   301  // DataLayers: Information about the solar potential of a region. The actual
   302  // data are contained in a number of GeoTIFF files covering the requested
   303  // region, for which this message contains URLs: Each string in the
   304  // `DataLayers` message contains a URL from which the corresponding GeoTIFF can
   305  // be fetched. These URLs are valid for a few hours after they've been
   306  // generated. Most of the GeoTIFF files are at a resolution of 0.1m/pixel, but
   307  // the monthly flux file is at 0.5m/pixel, and the hourly shade files are at
   308  // 1m/pixel. If a `pixel_size_meters` value was specified in the
   309  // `GetDataLayersRequest`, then the minimum resolution in the GeoTIFF files
   310  // will be that value.
   311  type DataLayers struct {
   312  	// AnnualFluxUrl: The URL for the annual flux map (annual sunlight on roofs) of
   313  	// the region. Values are kWh/kW/year. This is *unmasked flux*: flux is
   314  	// computed for every location, not just building rooftops. Invalid locations
   315  	// are stored as -9999: locations outside our coverage area will be invalid,
   316  	// and a few locations inside the coverage area, where we were unable to
   317  	// calculate flux, will also be invalid.
   318  	AnnualFluxUrl string `json:"annualFluxUrl,omitempty"`
   319  	// DsmUrl: The URL for an image of the DSM (Digital Surface Model) of the
   320  	// region. Values are in meters above EGM96 geoid (i.e., sea level). Invalid
   321  	// locations (where we don't have data) are stored as -9999.
   322  	DsmUrl string `json:"dsmUrl,omitempty"`
   323  	// HourlyShadeUrls: Twelve URLs for hourly shade, corresponding to
   324  	// January...December, in order. Each GeoTIFF will contain 24 bands,
   325  	// corresponding to the 24 hours of the day. Each pixel is a 32 bit integer,
   326  	// corresponding to the (up to) 31 days of that month; a 1 bit means that the
   327  	// corresponding location is able to see the sun at that day, of that hour, of
   328  	// that month. Invalid locations are stored as -9999 (since this is negative,
   329  	// it has bit 31 set, and no valid value could have bit 31 set as that would
   330  	// correspond to the 32nd day of the month). An example may be useful. If you
   331  	// want to know whether a point (at pixel location (x, y)) saw sun at 4pm on
   332  	// the 22nd of June you would: 1. fetch the sixth URL in this list
   333  	// (corresponding to June). 1. look up the 17th channel (corresponding to 4pm).
   334  	// 1. read the 32-bit value at (x, y). 1. read bit 21 of the value
   335  	// (corresponding to the 22nd of the month). 1. if that bit is a 1, then that
   336  	// spot saw the sun at 4pm 22 June. More formally: Given `month` (1-12), `day`
   337  	// (1...month max; February has 28 days) and `hour` (0-23), the shade/sun for
   338  	// that month/day/hour at a position `(x, y)` is the bit ```
   339  	// (hourly_shade[month - 1])(x, y)[hour] & (1 << (day - 1)) ``` where `(x, y)`
   340  	// is spatial indexing, `[month - 1]` refers to fetching the `month - 1`st URL
   341  	// (indexing from zero), `[hour]` is indexing into the channels, and a final
   342  	// non-zero result means "sunny". There are no leap days, and DST doesn't exist
   343  	// (all days are 24 hours long; noon is always "standard time" noon).
   344  	HourlyShadeUrls []string `json:"hourlyShadeUrls,omitempty"`
   345  	// ImageryDate: When the source imagery (from which all the other data are
   346  	// derived) in this region was taken. It is necessarily somewhat approximate,
   347  	// as the images may have been taken over more than one day.
   348  	ImageryDate *Date `json:"imageryDate,omitempty"`
   349  	// ImageryProcessedDate: When processing was completed on this imagery.
   350  	ImageryProcessedDate *Date `json:"imageryProcessedDate,omitempty"`
   351  	// ImageryQuality: The quality of the result's imagery.
   352  	//
   353  	// Possible values:
   354  	//   "IMAGERY_QUALITY_UNSPECIFIED" - No quality is known.
   355  	//   "HIGH" - The underlying imagery and DSM data were processed at 0.1
   356  	// m/pixel.
   357  	//   "MEDIUM" - The underlying imagery and DSM data were processed at 0.25
   358  	// m/pixel.
   359  	//   "LOW" - The underlying imagery and DSM data were processed at 0.5 m/pixel.
   360  	ImageryQuality string `json:"imageryQuality,omitempty"`
   361  	// MaskUrl: The URL for the building mask image: one bit per pixel saying
   362  	// whether that pixel is considered to be part of a rooftop or not.
   363  	MaskUrl string `json:"maskUrl,omitempty"`
   364  	// MonthlyFluxUrl: The URL for the monthly flux map (sunlight on roofs, broken
   365  	// down by month) of the region. Values are kWh/kW/year. The GeoTIFF pointed to
   366  	// by this URL will contain twelve bands, corresponding to January...December,
   367  	// in order.
   368  	MonthlyFluxUrl string `json:"monthlyFluxUrl,omitempty"`
   369  	// RgbUrl: The URL for an image of RGB data (aerial photo) of the region.
   370  	RgbUrl string `json:"rgbUrl,omitempty"`
   371  
   372  	// ServerResponse contains the HTTP response code and headers from the server.
   373  	googleapi.ServerResponse `json:"-"`
   374  	// ForceSendFields is a list of field names (e.g. "AnnualFluxUrl") to
   375  	// unconditionally include in API requests. By default, fields with empty or
   376  	// default values are omitted from API requests. See
   377  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   378  	// details.
   379  	ForceSendFields []string `json:"-"`
   380  	// NullFields is a list of field names (e.g. "AnnualFluxUrl") to include in API
   381  	// requests with the JSON null value. By default, fields with empty values are
   382  	// omitted from API requests. See
   383  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   384  	NullFields []string `json:"-"`
   385  }
   386  
   387  func (s *DataLayers) MarshalJSON() ([]byte, error) {
   388  	type NoMethod DataLayers
   389  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   390  }
   391  
   392  // Date: Represents a whole or partial calendar date, such as a birthday. The
   393  // time of day and time zone are either specified elsewhere or are
   394  // insignificant. The date is relative to the Gregorian Calendar. This can
   395  // represent one of the following: * A full date, with non-zero year, month,
   396  // and day values. * A month and day, with a zero year (for example, an
   397  // anniversary). * A year on its own, with a zero month and a zero day. * A
   398  // year and month, with a zero day (for example, a credit card expiration
   399  // date). Related types: * google.type.TimeOfDay * google.type.DateTime *
   400  // google.protobuf.Timestamp
   401  type Date struct {
   402  	// Day: Day of a month. Must be from 1 to 31 and valid for the year and month,
   403  	// or 0 to specify a year by itself or a year and month where the day isn't
   404  	// significant.
   405  	Day int64 `json:"day,omitempty"`
   406  	// Month: Month of a year. Must be from 1 to 12, or 0 to specify a year without
   407  	// a month and day.
   408  	Month int64 `json:"month,omitempty"`
   409  	// Year: Year of the date. Must be from 1 to 9999, or 0 to specify a date
   410  	// without a year.
   411  	Year int64 `json:"year,omitempty"`
   412  	// ForceSendFields is a list of field names (e.g. "Day") to unconditionally
   413  	// include in API requests. By default, fields with empty or default values are
   414  	// omitted from API requests. See
   415  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   416  	// details.
   417  	ForceSendFields []string `json:"-"`
   418  	// NullFields is a list of field names (e.g. "Day") to include in API requests
   419  	// with the JSON null value. By default, fields with empty values are omitted
   420  	// from API requests. See
   421  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   422  	NullFields []string `json:"-"`
   423  }
   424  
   425  func (s *Date) MarshalJSON() ([]byte, error) {
   426  	type NoMethod Date
   427  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   428  }
   429  
   430  // FinancedPurchaseSavings: Cost and benefit of using a loan to buy a
   431  // particular configuration of solar panels with a particular electricity
   432  // usage.
   433  type FinancedPurchaseSavings struct {
   434  	// AnnualLoanPayment: Annual loan payments.
   435  	AnnualLoanPayment *Money `json:"annualLoanPayment,omitempty"`
   436  	// LoanInterestRate: The interest rate on loans assumed in this set of
   437  	// calculations.
   438  	LoanInterestRate float64 `json:"loanInterestRate,omitempty"`
   439  	// RebateValue: The value of all tax rebates (including Federal Investment Tax
   440  	// Credit (ITC)).
   441  	RebateValue *Money `json:"rebateValue,omitempty"`
   442  	// Savings: How much is saved (or not) over the lifetime period.
   443  	Savings *SavingsOverTime `json:"savings,omitempty"`
   444  	// ForceSendFields is a list of field names (e.g. "AnnualLoanPayment") to
   445  	// unconditionally include in API requests. By default, fields with empty or
   446  	// default values are omitted from API requests. See
   447  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   448  	// details.
   449  	ForceSendFields []string `json:"-"`
   450  	// NullFields is a list of field names (e.g. "AnnualLoanPayment") to include in
   451  	// API requests with the JSON null value. By default, fields with empty values
   452  	// are omitted from API requests. See
   453  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   454  	NullFields []string `json:"-"`
   455  }
   456  
   457  func (s *FinancedPurchaseSavings) MarshalJSON() ([]byte, error) {
   458  	type NoMethod FinancedPurchaseSavings
   459  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   460  }
   461  
   462  func (s *FinancedPurchaseSavings) UnmarshalJSON(data []byte) error {
   463  	type NoMethod FinancedPurchaseSavings
   464  	var s1 struct {
   465  		LoanInterestRate gensupport.JSONFloat64 `json:"loanInterestRate"`
   466  		*NoMethod
   467  	}
   468  	s1.NoMethod = (*NoMethod)(s)
   469  	if err := json.Unmarshal(data, &s1); err != nil {
   470  		return err
   471  	}
   472  	s.LoanInterestRate = float64(s1.LoanInterestRate)
   473  	return nil
   474  }
   475  
   476  // FinancialAnalysis: Analysis of the cost and benefits of the optimum solar
   477  // layout for a particular electric bill size.
   478  type FinancialAnalysis struct {
   479  	// AverageKwhPerMonth: How much electricity the house uses in an average month,
   480  	// based on the bill size and the local electricity rates.
   481  	AverageKwhPerMonth float64 `json:"averageKwhPerMonth,omitempty"`
   482  	// CashPurchaseSavings: Cost and benefit of buying the solar panels with cash.
   483  	CashPurchaseSavings *CashPurchaseSavings `json:"cashPurchaseSavings,omitempty"`
   484  	// DefaultBill: Whether this is the bill size selected to be the default bill
   485  	// for the area this building is in. Exactly one `FinancialAnalysis` in
   486  	// `BuildingSolarPotential` should have `default_bill` set.
   487  	DefaultBill bool `json:"defaultBill,omitempty"`
   488  	// FinancedPurchaseSavings: Cost and benefit of buying the solar panels by
   489  	// financing the purchase.
   490  	FinancedPurchaseSavings *FinancedPurchaseSavings `json:"financedPurchaseSavings,omitempty"`
   491  	// FinancialDetails: Financial information that applies regardless of the
   492  	// financing method used.
   493  	FinancialDetails *FinancialDetails `json:"financialDetails,omitempty"`
   494  	// LeasingSavings: Cost and benefit of leasing the solar panels.
   495  	LeasingSavings *LeasingSavings `json:"leasingSavings,omitempty"`
   496  	// MonthlyBill: The monthly electric bill this analysis assumes.
   497  	MonthlyBill *Money `json:"monthlyBill,omitempty"`
   498  	// PanelConfigIndex: Index in solar_panel_configs of the optimum solar layout
   499  	// for this bill size. This can be -1 indicating that there is no layout. In
   500  	// this case, the remaining submessages will be omitted.
   501  	PanelConfigIndex int64 `json:"panelConfigIndex,omitempty"`
   502  	// ForceSendFields is a list of field names (e.g. "AverageKwhPerMonth") to
   503  	// unconditionally include in API requests. By default, fields with empty or
   504  	// default values are omitted from API requests. See
   505  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   506  	// details.
   507  	ForceSendFields []string `json:"-"`
   508  	// NullFields is a list of field names (e.g. "AverageKwhPerMonth") to include
   509  	// in API requests with the JSON null value. By default, fields with empty
   510  	// values are omitted from API requests. See
   511  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   512  	NullFields []string `json:"-"`
   513  }
   514  
   515  func (s *FinancialAnalysis) MarshalJSON() ([]byte, error) {
   516  	type NoMethod FinancialAnalysis
   517  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   518  }
   519  
   520  func (s *FinancialAnalysis) UnmarshalJSON(data []byte) error {
   521  	type NoMethod FinancialAnalysis
   522  	var s1 struct {
   523  		AverageKwhPerMonth gensupport.JSONFloat64 `json:"averageKwhPerMonth"`
   524  		*NoMethod
   525  	}
   526  	s1.NoMethod = (*NoMethod)(s)
   527  	if err := json.Unmarshal(data, &s1); err != nil {
   528  		return err
   529  	}
   530  	s.AverageKwhPerMonth = float64(s1.AverageKwhPerMonth)
   531  	return nil
   532  }
   533  
   534  // FinancialDetails: Details of a financial analysis. Some of these details are
   535  // already stored at higher levels (e.g., out of pocket cost). Total money
   536  // amounts are over a lifetime period defined by the panel_lifetime_years field
   537  // in SolarPotential. Note: The out of pocket cost of purchasing the panels is
   538  // given in the out_of_pocket_cost field in CashPurchaseSavings.
   539  type FinancialDetails struct {
   540  	// CostOfElectricityWithoutSolar: Total cost of electricity the user would have
   541  	// paid over the lifetime period if they didn't install solar.
   542  	CostOfElectricityWithoutSolar *Money `json:"costOfElectricityWithoutSolar,omitempty"`
   543  	// FederalIncentive: Amount of money available from federal incentives; this
   544  	// applies if the user buys (with or without a loan) the panels.
   545  	FederalIncentive *Money `json:"federalIncentive,omitempty"`
   546  	// InitialAcKwhPerYear: How many AC kWh we think the solar panels will generate
   547  	// in their first year.
   548  	InitialAcKwhPerYear float64 `json:"initialAcKwhPerYear,omitempty"`
   549  	// LifetimeSrecTotal: Amount of money the user will receive from Solar
   550  	// Renewable Energy Credits over the panel lifetime; this applies if the user
   551  	// buys (with or without a loan) the panels.
   552  	LifetimeSrecTotal *Money `json:"lifetimeSrecTotal,omitempty"`
   553  	// NetMeteringAllowed: Whether net metering is allowed.
   554  	NetMeteringAllowed bool `json:"netMeteringAllowed,omitempty"`
   555  	// PercentageExportedToGrid: The percentage (0-100) of solar electricity
   556  	// production we assumed was exported to the grid, based on the first quarter
   557  	// of production. This affects the calculations if net metering is not allowed.
   558  	PercentageExportedToGrid float64 `json:"percentageExportedToGrid,omitempty"`
   559  	// RemainingLifetimeUtilityBill: Utility bill for electricity not produced by
   560  	// solar, for the lifetime of the panels.
   561  	RemainingLifetimeUtilityBill *Money `json:"remainingLifetimeUtilityBill,omitempty"`
   562  	// SolarPercentage: Percentage (0-100) of the user's power supplied by solar.
   563  	// Valid for the first year but approximately correct for future years.
   564  	SolarPercentage float64 `json:"solarPercentage,omitempty"`
   565  	// StateIncentive: Amount of money available from state incentives; this
   566  	// applies if the user buys (with or without a loan) the panels.
   567  	StateIncentive *Money `json:"stateIncentive,omitempty"`
   568  	// UtilityIncentive: Amount of money available from utility incentives; this
   569  	// applies if the user buys (with or without a loan) the panels.
   570  	UtilityIncentive *Money `json:"utilityIncentive,omitempty"`
   571  	// ForceSendFields is a list of field names (e.g.
   572  	// "CostOfElectricityWithoutSolar") to unconditionally include in API requests.
   573  	// By default, fields with empty or default values are omitted from API
   574  	// requests. See https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields
   575  	// for more details.
   576  	ForceSendFields []string `json:"-"`
   577  	// NullFields is a list of field names (e.g. "CostOfElectricityWithoutSolar")
   578  	// to include in API requests with the JSON null value. By default, fields with
   579  	// empty values are omitted from API requests. See
   580  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   581  	NullFields []string `json:"-"`
   582  }
   583  
   584  func (s *FinancialDetails) MarshalJSON() ([]byte, error) {
   585  	type NoMethod FinancialDetails
   586  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   587  }
   588  
   589  func (s *FinancialDetails) UnmarshalJSON(data []byte) error {
   590  	type NoMethod FinancialDetails
   591  	var s1 struct {
   592  		InitialAcKwhPerYear      gensupport.JSONFloat64 `json:"initialAcKwhPerYear"`
   593  		PercentageExportedToGrid gensupport.JSONFloat64 `json:"percentageExportedToGrid"`
   594  		SolarPercentage          gensupport.JSONFloat64 `json:"solarPercentage"`
   595  		*NoMethod
   596  	}
   597  	s1.NoMethod = (*NoMethod)(s)
   598  	if err := json.Unmarshal(data, &s1); err != nil {
   599  		return err
   600  	}
   601  	s.InitialAcKwhPerYear = float64(s1.InitialAcKwhPerYear)
   602  	s.PercentageExportedToGrid = float64(s1.PercentageExportedToGrid)
   603  	s.SolarPercentage = float64(s1.SolarPercentage)
   604  	return nil
   605  }
   606  
   607  // HttpBody: Message that represents an arbitrary HTTP body. It should only be
   608  // used for payload formats that can't be represented as JSON, such as raw
   609  // binary or an HTML page. This message can be used both in streaming and
   610  // non-streaming API methods in the request as well as the response. It can be
   611  // used as a top-level request field, which is convenient if one wants to
   612  // extract parameters from either the URL or HTTP template into the request
   613  // fields and also want access to the raw HTTP body. Example: message
   614  // GetResourceRequest { // A unique request id. string request_id = 1; // The
   615  // raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; }
   616  // service ResourceService { rpc GetResource(GetResourceRequest) returns
   617  // (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns
   618  // (google.protobuf.Empty); } Example with streaming methods: service
   619  // CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream
   620  // google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns
   621  // (stream google.api.HttpBody); } Use of this type only changes how the
   622  // request and response bodies are handled, all other features will continue to
   623  // work unchanged.
   624  type HttpBody struct {
   625  	// ContentType: The HTTP Content-Type header value specifying the content type
   626  	// of the body.
   627  	ContentType string `json:"contentType,omitempty"`
   628  	// Data: The HTTP request/response body as raw binary.
   629  	Data string `json:"data,omitempty"`
   630  	// Extensions: Application specific response metadata. Must be set in the first
   631  	// response for streaming APIs.
   632  	Extensions []googleapi.RawMessage `json:"extensions,omitempty"`
   633  
   634  	// ServerResponse contains the HTTP response code and headers from the server.
   635  	googleapi.ServerResponse `json:"-"`
   636  	// ForceSendFields is a list of field names (e.g. "ContentType") to
   637  	// unconditionally include in API requests. By default, fields with empty or
   638  	// default values are omitted from API requests. See
   639  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   640  	// details.
   641  	ForceSendFields []string `json:"-"`
   642  	// NullFields is a list of field names (e.g. "ContentType") to include in API
   643  	// requests with the JSON null value. By default, fields with empty values are
   644  	// omitted from API requests. See
   645  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   646  	NullFields []string `json:"-"`
   647  }
   648  
   649  func (s *HttpBody) MarshalJSON() ([]byte, error) {
   650  	type NoMethod HttpBody
   651  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   652  }
   653  
   654  // LatLng: An object that represents a latitude/longitude pair. This is
   655  // expressed as a pair of doubles to represent degrees latitude and degrees
   656  // longitude. Unless specified otherwise, this object must conform to the WGS84
   657  // standard. Values must be within normalized ranges.
   658  type LatLng struct {
   659  	// Latitude: The latitude in degrees. It must be in the range [-90.0, +90.0].
   660  	Latitude float64 `json:"latitude,omitempty"`
   661  	// Longitude: The longitude in degrees. It must be in the range [-180.0,
   662  	// +180.0].
   663  	Longitude float64 `json:"longitude,omitempty"`
   664  	// ForceSendFields is a list of field names (e.g. "Latitude") to
   665  	// unconditionally include in API requests. By default, fields with empty or
   666  	// default values are omitted from API requests. See
   667  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   668  	// details.
   669  	ForceSendFields []string `json:"-"`
   670  	// NullFields is a list of field names (e.g. "Latitude") to include in API
   671  	// requests with the JSON null value. By default, fields with empty values are
   672  	// omitted from API requests. See
   673  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   674  	NullFields []string `json:"-"`
   675  }
   676  
   677  func (s *LatLng) MarshalJSON() ([]byte, error) {
   678  	type NoMethod LatLng
   679  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   680  }
   681  
   682  func (s *LatLng) UnmarshalJSON(data []byte) error {
   683  	type NoMethod LatLng
   684  	var s1 struct {
   685  		Latitude  gensupport.JSONFloat64 `json:"latitude"`
   686  		Longitude gensupport.JSONFloat64 `json:"longitude"`
   687  		*NoMethod
   688  	}
   689  	s1.NoMethod = (*NoMethod)(s)
   690  	if err := json.Unmarshal(data, &s1); err != nil {
   691  		return err
   692  	}
   693  	s.Latitude = float64(s1.Latitude)
   694  	s.Longitude = float64(s1.Longitude)
   695  	return nil
   696  }
   697  
   698  // LatLngBox: A bounding box in lat/lng coordinates.
   699  type LatLngBox struct {
   700  	// Ne: The northeast corner of the box.
   701  	Ne *LatLng `json:"ne,omitempty"`
   702  	// Sw: The southwest corner of the box.
   703  	Sw *LatLng `json:"sw,omitempty"`
   704  	// ForceSendFields is a list of field names (e.g. "Ne") to unconditionally
   705  	// include in API requests. By default, fields with empty or default values are
   706  	// omitted from API requests. See
   707  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   708  	// details.
   709  	ForceSendFields []string `json:"-"`
   710  	// NullFields is a list of field names (e.g. "Ne") to include in API requests
   711  	// with the JSON null value. By default, fields with empty values are omitted
   712  	// from API requests. See
   713  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   714  	NullFields []string `json:"-"`
   715  }
   716  
   717  func (s *LatLngBox) MarshalJSON() ([]byte, error) {
   718  	type NoMethod LatLngBox
   719  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   720  }
   721  
   722  // LeasingSavings: Cost and benefit of leasing a particular configuration of
   723  // solar panels with a particular electricity usage.
   724  type LeasingSavings struct {
   725  	// AnnualLeasingCost: Estimated annual leasing cost.
   726  	AnnualLeasingCost *Money `json:"annualLeasingCost,omitempty"`
   727  	// LeasesAllowed: Whether leases are allowed in this juristiction (leases are
   728  	// not allowed in some states). If this field is false, then the values in this
   729  	// message should probably be ignored.
   730  	LeasesAllowed bool `json:"leasesAllowed,omitempty"`
   731  	// LeasesSupported: Whether leases are supported in this juristiction by the
   732  	// financial calculation engine. If this field is false, then the values in
   733  	// this message should probably be ignored. This is independent of
   734  	// `leases_allowed`: in some areas leases are allowed, but under conditions
   735  	// that aren't handled by the financial models.
   736  	LeasesSupported bool `json:"leasesSupported,omitempty"`
   737  	// Savings: How much is saved (or not) over the lifetime period.
   738  	Savings *SavingsOverTime `json:"savings,omitempty"`
   739  	// ForceSendFields is a list of field names (e.g. "AnnualLeasingCost") to
   740  	// unconditionally include in API requests. By default, fields with empty or
   741  	// default values are omitted from API requests. See
   742  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   743  	// details.
   744  	ForceSendFields []string `json:"-"`
   745  	// NullFields is a list of field names (e.g. "AnnualLeasingCost") to include in
   746  	// API requests with the JSON null value. By default, fields with empty values
   747  	// are omitted from API requests. See
   748  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   749  	NullFields []string `json:"-"`
   750  }
   751  
   752  func (s *LeasingSavings) MarshalJSON() ([]byte, error) {
   753  	type NoMethod LeasingSavings
   754  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   755  }
   756  
   757  // Money: Represents an amount of money with its currency type.
   758  type Money struct {
   759  	// CurrencyCode: The three-letter currency code defined in ISO 4217.
   760  	CurrencyCode string `json:"currencyCode,omitempty"`
   761  	// Nanos: Number of nano (10^-9) units of the amount. The value must be between
   762  	// -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos`
   763  	// must be positive or zero. If `units` is zero, `nanos` can be positive, zero,
   764  	// or negative. If `units` is negative, `nanos` must be negative or zero. For
   765  	// example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.
   766  	Nanos int64 `json:"nanos,omitempty"`
   767  	// Units: The whole units of the amount. For example if `currencyCode` is
   768  	// "USD", then 1 unit is one US dollar.
   769  	Units int64 `json:"units,omitempty,string"`
   770  	// ForceSendFields is a list of field names (e.g. "CurrencyCode") to
   771  	// unconditionally include in API requests. By default, fields with empty or
   772  	// default values are omitted from API requests. See
   773  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   774  	// details.
   775  	ForceSendFields []string `json:"-"`
   776  	// NullFields is a list of field names (e.g. "CurrencyCode") to include in API
   777  	// requests with the JSON null value. By default, fields with empty values are
   778  	// omitted from API requests. See
   779  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   780  	NullFields []string `json:"-"`
   781  }
   782  
   783  func (s *Money) MarshalJSON() ([]byte, error) {
   784  	type NoMethod Money
   785  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   786  }
   787  
   788  // RoofSegmentSizeAndSunshineStats: Information about the size and sunniness
   789  // quantiles of a roof segment.
   790  type RoofSegmentSizeAndSunshineStats struct {
   791  	// AzimuthDegrees: Compass direction the roof segment is pointing in. 0 =
   792  	// North, 90 = East, 180 = South. For a "flat" roof segment (`pitch_degrees`
   793  	// very near 0), azimuth is not well defined, so for consistency, we define it
   794  	// arbitrarily to be 0 (North).
   795  	AzimuthDegrees float64 `json:"azimuthDegrees,omitempty"`
   796  	// BoundingBox: The bounding box of the roof segment.
   797  	BoundingBox *LatLngBox `json:"boundingBox,omitempty"`
   798  	// Center: A point near the center of the roof segment.
   799  	Center *LatLng `json:"center,omitempty"`
   800  	// PitchDegrees: Angle of the roof segment relative to the theoretical ground
   801  	// plane. 0 = parallel to the ground, 90 = perpendicular to the ground.
   802  	PitchDegrees float64 `json:"pitchDegrees,omitempty"`
   803  	// PlaneHeightAtCenterMeters: The height of the roof segment plane, in meters
   804  	// above sea level, at the point designated by `center`. Together with the
   805  	// pitch, azimuth, and center location, this fully defines the roof segment
   806  	// plane.
   807  	PlaneHeightAtCenterMeters float64 `json:"planeHeightAtCenterMeters,omitempty"`
   808  	// Stats: Total size and sunlight quantiles for the roof segment.
   809  	Stats *SizeAndSunshineStats `json:"stats,omitempty"`
   810  	// ForceSendFields is a list of field names (e.g. "AzimuthDegrees") to
   811  	// unconditionally include in API requests. By default, fields with empty or
   812  	// default values are omitted from API requests. See
   813  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   814  	// details.
   815  	ForceSendFields []string `json:"-"`
   816  	// NullFields is a list of field names (e.g. "AzimuthDegrees") to include in
   817  	// API requests with the JSON null value. By default, fields with empty values
   818  	// are omitted from API requests. See
   819  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   820  	NullFields []string `json:"-"`
   821  }
   822  
   823  func (s *RoofSegmentSizeAndSunshineStats) MarshalJSON() ([]byte, error) {
   824  	type NoMethod RoofSegmentSizeAndSunshineStats
   825  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   826  }
   827  
   828  func (s *RoofSegmentSizeAndSunshineStats) UnmarshalJSON(data []byte) error {
   829  	type NoMethod RoofSegmentSizeAndSunshineStats
   830  	var s1 struct {
   831  		AzimuthDegrees            gensupport.JSONFloat64 `json:"azimuthDegrees"`
   832  		PitchDegrees              gensupport.JSONFloat64 `json:"pitchDegrees"`
   833  		PlaneHeightAtCenterMeters gensupport.JSONFloat64 `json:"planeHeightAtCenterMeters"`
   834  		*NoMethod
   835  	}
   836  	s1.NoMethod = (*NoMethod)(s)
   837  	if err := json.Unmarshal(data, &s1); err != nil {
   838  		return err
   839  	}
   840  	s.AzimuthDegrees = float64(s1.AzimuthDegrees)
   841  	s.PitchDegrees = float64(s1.PitchDegrees)
   842  	s.PlaneHeightAtCenterMeters = float64(s1.PlaneHeightAtCenterMeters)
   843  	return nil
   844  }
   845  
   846  // RoofSegmentSummary: Information about a roof segment on the building, with
   847  // some number of panels placed on it.
   848  type RoofSegmentSummary struct {
   849  	// AzimuthDegrees: Compass direction the roof segment is pointing in. 0 =
   850  	// North, 90 = East, 180 = South. For a "flat" roof segment (`pitch_degrees`
   851  	// very near 0), azimuth is not well defined, so for consistency, we define it
   852  	// arbitrarily to be 0 (North).
   853  	AzimuthDegrees float64 `json:"azimuthDegrees,omitempty"`
   854  	// PanelsCount: The total number of panels on this segment.
   855  	PanelsCount int64 `json:"panelsCount,omitempty"`
   856  	// PitchDegrees: Angle of the roof segment relative to the theoretical ground
   857  	// plane. 0 = parallel to the ground, 90 = perpendicular to the ground.
   858  	PitchDegrees float64 `json:"pitchDegrees,omitempty"`
   859  	// SegmentIndex: Index in roof_segment_stats of the corresponding
   860  	// `RoofSegmentSizeAndSunshineStats`.
   861  	SegmentIndex int64 `json:"segmentIndex,omitempty"`
   862  	// YearlyEnergyDcKwh: How much sunlight energy this part of the layout captures
   863  	// over the course of a year, in DC kWh, assuming the panels described above.
   864  	YearlyEnergyDcKwh float64 `json:"yearlyEnergyDcKwh,omitempty"`
   865  	// ForceSendFields is a list of field names (e.g. "AzimuthDegrees") to
   866  	// unconditionally include in API requests. By default, fields with empty or
   867  	// default values are omitted from API requests. See
   868  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   869  	// details.
   870  	ForceSendFields []string `json:"-"`
   871  	// NullFields is a list of field names (e.g. "AzimuthDegrees") to include in
   872  	// API requests with the JSON null value. By default, fields with empty values
   873  	// are omitted from API requests. See
   874  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   875  	NullFields []string `json:"-"`
   876  }
   877  
   878  func (s *RoofSegmentSummary) MarshalJSON() ([]byte, error) {
   879  	type NoMethod RoofSegmentSummary
   880  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   881  }
   882  
   883  func (s *RoofSegmentSummary) UnmarshalJSON(data []byte) error {
   884  	type NoMethod RoofSegmentSummary
   885  	var s1 struct {
   886  		AzimuthDegrees    gensupport.JSONFloat64 `json:"azimuthDegrees"`
   887  		PitchDegrees      gensupport.JSONFloat64 `json:"pitchDegrees"`
   888  		YearlyEnergyDcKwh gensupport.JSONFloat64 `json:"yearlyEnergyDcKwh"`
   889  		*NoMethod
   890  	}
   891  	s1.NoMethod = (*NoMethod)(s)
   892  	if err := json.Unmarshal(data, &s1); err != nil {
   893  		return err
   894  	}
   895  	s.AzimuthDegrees = float64(s1.AzimuthDegrees)
   896  	s.PitchDegrees = float64(s1.PitchDegrees)
   897  	s.YearlyEnergyDcKwh = float64(s1.YearlyEnergyDcKwh)
   898  	return nil
   899  }
   900  
   901  // SavingsOverTime: Financial information that's shared between different
   902  // financing methods.
   903  type SavingsOverTime struct {
   904  	// FinanciallyViable: Indicates whether this scenario is financially viable.
   905  	// Will be false for scenarios with poor financial viability (e.g.,
   906  	// money-losing).
   907  	FinanciallyViable bool `json:"financiallyViable,omitempty"`
   908  	// PresentValueOfSavingsLifetime: Using the assumed discount rate, what is the
   909  	// present value of the cumulative lifetime savings?
   910  	PresentValueOfSavingsLifetime *Money `json:"presentValueOfSavingsLifetime,omitempty"`
   911  	// PresentValueOfSavingsYear20: Using the assumed discount rate, what is the
   912  	// present value of the cumulative 20-year savings?
   913  	PresentValueOfSavingsYear20 *Money `json:"presentValueOfSavingsYear20,omitempty"`
   914  	// SavingsLifetime: Savings in the entire panel lifetime.
   915  	SavingsLifetime *Money `json:"savingsLifetime,omitempty"`
   916  	// SavingsYear1: Savings in the first year after panel installation.
   917  	SavingsYear1 *Money `json:"savingsYear1,omitempty"`
   918  	// SavingsYear20: Savings in the first twenty years after panel installation.
   919  	SavingsYear20 *Money `json:"savingsYear20,omitempty"`
   920  	// ForceSendFields is a list of field names (e.g. "FinanciallyViable") to
   921  	// unconditionally include in API requests. By default, fields with empty or
   922  	// default values are omitted from API requests. See
   923  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   924  	// details.
   925  	ForceSendFields []string `json:"-"`
   926  	// NullFields is a list of field names (e.g. "FinanciallyViable") to include in
   927  	// API requests with the JSON null value. By default, fields with empty values
   928  	// are omitted from API requests. See
   929  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   930  	NullFields []string `json:"-"`
   931  }
   932  
   933  func (s *SavingsOverTime) MarshalJSON() ([]byte, error) {
   934  	type NoMethod SavingsOverTime
   935  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   936  }
   937  
   938  // SizeAndSunshineStats: Size and sunniness quantiles of a roof, or part of a
   939  // roof.
   940  type SizeAndSunshineStats struct {
   941  	// AreaMeters2: The area of the roof or roof segment, in m^2. This is the roof
   942  	// area (accounting for tilt), not the ground footprint area.
   943  	AreaMeters2 float64 `json:"areaMeters2,omitempty"`
   944  	// GroundAreaMeters2: The ground footprint area covered by the roof or roof
   945  	// segment, in m^2.
   946  	GroundAreaMeters2 float64 `json:"groundAreaMeters2,omitempty"`
   947  	// SunshineQuantiles: Quantiles of the pointwise sunniness across the area. If
   948  	// there are N values here, this represents the (N-1)-iles. For example, if
   949  	// there are 5 values, then they would be the quartiles (min, 25%, 50%, 75%,
   950  	// max). Values are in annual kWh/kW like max_sunshine_hours_per_year.
   951  	SunshineQuantiles []float64 `json:"sunshineQuantiles,omitempty"`
   952  	// ForceSendFields is a list of field names (e.g. "AreaMeters2") to
   953  	// unconditionally include in API requests. By default, fields with empty or
   954  	// default values are omitted from API requests. See
   955  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   956  	// details.
   957  	ForceSendFields []string `json:"-"`
   958  	// NullFields is a list of field names (e.g. "AreaMeters2") to include in API
   959  	// requests with the JSON null value. By default, fields with empty values are
   960  	// omitted from API requests. See
   961  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   962  	NullFields []string `json:"-"`
   963  }
   964  
   965  func (s *SizeAndSunshineStats) MarshalJSON() ([]byte, error) {
   966  	type NoMethod SizeAndSunshineStats
   967  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   968  }
   969  
   970  func (s *SizeAndSunshineStats) UnmarshalJSON(data []byte) error {
   971  	type NoMethod SizeAndSunshineStats
   972  	var s1 struct {
   973  		AreaMeters2       gensupport.JSONFloat64   `json:"areaMeters2"`
   974  		GroundAreaMeters2 gensupport.JSONFloat64   `json:"groundAreaMeters2"`
   975  		SunshineQuantiles []gensupport.JSONFloat64 `json:"sunshineQuantiles"`
   976  		*NoMethod
   977  	}
   978  	s1.NoMethod = (*NoMethod)(s)
   979  	if err := json.Unmarshal(data, &s1); err != nil {
   980  		return err
   981  	}
   982  	s.AreaMeters2 = float64(s1.AreaMeters2)
   983  	s.GroundAreaMeters2 = float64(s1.GroundAreaMeters2)
   984  	s.SunshineQuantiles = make([]float64, len(s1.SunshineQuantiles))
   985  	for i := range s1.SunshineQuantiles {
   986  		s.SunshineQuantiles[i] = float64(s1.SunshineQuantiles[i])
   987  	}
   988  	return nil
   989  }
   990  
   991  // SolarPanel: SolarPanel describes the position, orientation, and production
   992  // of a single solar panel. See the panel_height_meters, panel_width_meters,
   993  // and panel_capacity_watts fields in SolarPotential for information on the
   994  // parameters of the panel.
   995  type SolarPanel struct {
   996  	// Center: The centre of the panel.
   997  	Center *LatLng `json:"center,omitempty"`
   998  	// Orientation: The orientation of the panel.
   999  	//
  1000  	// Possible values:
  1001  	//   "SOLAR_PANEL_ORIENTATION_UNSPECIFIED" - No panel orientation is known.
  1002  	//   "LANDSCAPE" - A `LANDSCAPE` panel has its long edge perpendicular to the
  1003  	// azimuth direction of the roof segment that it is placed on.
  1004  	//   "PORTRAIT" - A `PORTRAIT` panel has its long edge parallel to the azimuth
  1005  	// direction of the roof segment that it is placed on.
  1006  	Orientation string `json:"orientation,omitempty"`
  1007  	// SegmentIndex: Index in roof_segment_stats of the
  1008  	// `RoofSegmentSizeAndSunshineStats` which corresponds to the roof segment that
  1009  	// this panel is placed on.
  1010  	SegmentIndex int64 `json:"segmentIndex,omitempty"`
  1011  	// YearlyEnergyDcKwh: How much sunlight energy this layout captures over the
  1012  	// course of a year, in DC kWh.
  1013  	YearlyEnergyDcKwh float64 `json:"yearlyEnergyDcKwh,omitempty"`
  1014  	// ForceSendFields is a list of field names (e.g. "Center") to unconditionally
  1015  	// include in API requests. By default, fields with empty or default values are
  1016  	// omitted from API requests. See
  1017  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1018  	// details.
  1019  	ForceSendFields []string `json:"-"`
  1020  	// NullFields is a list of field names (e.g. "Center") to include in API
  1021  	// requests with the JSON null value. By default, fields with empty values are
  1022  	// omitted from API requests. See
  1023  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1024  	NullFields []string `json:"-"`
  1025  }
  1026  
  1027  func (s *SolarPanel) MarshalJSON() ([]byte, error) {
  1028  	type NoMethod SolarPanel
  1029  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1030  }
  1031  
  1032  func (s *SolarPanel) UnmarshalJSON(data []byte) error {
  1033  	type NoMethod SolarPanel
  1034  	var s1 struct {
  1035  		YearlyEnergyDcKwh gensupport.JSONFloat64 `json:"yearlyEnergyDcKwh"`
  1036  		*NoMethod
  1037  	}
  1038  	s1.NoMethod = (*NoMethod)(s)
  1039  	if err := json.Unmarshal(data, &s1); err != nil {
  1040  		return err
  1041  	}
  1042  	s.YearlyEnergyDcKwh = float64(s1.YearlyEnergyDcKwh)
  1043  	return nil
  1044  }
  1045  
  1046  // SolarPanelConfig: SolarPanelConfig describes a particular placement of solar
  1047  // panels on the roof.
  1048  type SolarPanelConfig struct {
  1049  	// PanelsCount: Total number of panels. Note that this is redundant to (the sum
  1050  	// of) the corresponding fields in roof_segment_summaries.
  1051  	PanelsCount int64 `json:"panelsCount,omitempty"`
  1052  	// RoofSegmentSummaries: Information about the production of each roof segment
  1053  	// that is carrying at least one panel in this layout.
  1054  	// `roof_segment_summaries[i]` describes the i-th roof segment, including its
  1055  	// size, expected production and orientation.
  1056  	RoofSegmentSummaries []*RoofSegmentSummary `json:"roofSegmentSummaries,omitempty"`
  1057  	// YearlyEnergyDcKwh: How much sunlight energy this layout captures over the
  1058  	// course of a year, in DC kWh, assuming the panels described above.
  1059  	YearlyEnergyDcKwh float64 `json:"yearlyEnergyDcKwh,omitempty"`
  1060  	// ForceSendFields is a list of field names (e.g. "PanelsCount") to
  1061  	// unconditionally include in API requests. By default, fields with empty or
  1062  	// default values are omitted from API requests. See
  1063  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1064  	// details.
  1065  	ForceSendFields []string `json:"-"`
  1066  	// NullFields is a list of field names (e.g. "PanelsCount") to include in API
  1067  	// requests with the JSON null value. By default, fields with empty values are
  1068  	// omitted from API requests. See
  1069  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1070  	NullFields []string `json:"-"`
  1071  }
  1072  
  1073  func (s *SolarPanelConfig) MarshalJSON() ([]byte, error) {
  1074  	type NoMethod SolarPanelConfig
  1075  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1076  }
  1077  
  1078  func (s *SolarPanelConfig) UnmarshalJSON(data []byte) error {
  1079  	type NoMethod SolarPanelConfig
  1080  	var s1 struct {
  1081  		YearlyEnergyDcKwh gensupport.JSONFloat64 `json:"yearlyEnergyDcKwh"`
  1082  		*NoMethod
  1083  	}
  1084  	s1.NoMethod = (*NoMethod)(s)
  1085  	if err := json.Unmarshal(data, &s1); err != nil {
  1086  		return err
  1087  	}
  1088  	s.YearlyEnergyDcKwh = float64(s1.YearlyEnergyDcKwh)
  1089  	return nil
  1090  }
  1091  
  1092  // SolarPotential: Information about the solar potential of a building. A
  1093  // number of fields in this are defined in terms of "panels". The fields
  1094  // panel_capacity_watts, panel_height_meters, and panel_width_meters describe
  1095  // the parameters of the model of panel used in these calculations.
  1096  type SolarPotential struct {
  1097  	// BuildingStats: Size and sunlight quantiles for the entire building,
  1098  	// including parts of the roof that were not assigned to some roof segment.
  1099  	// Because the orientations of these parts are not well characterised, the roof
  1100  	// area estimate is unreliable, but the ground area estimate is reliable. It
  1101  	// may be that a more reliable whole building roof area can be obtained by
  1102  	// scaling the roof area from whole_roof_stats by the ratio of the ground areas
  1103  	// of `building_stats` and `whole_roof_stats`.
  1104  	BuildingStats *SizeAndSunshineStats `json:"buildingStats,omitempty"`
  1105  	// CarbonOffsetFactorKgPerMwh: Equivalent amount of CO2 produced per MWh of
  1106  	// grid electricity. This is a measure of the carbon intensity of grid
  1107  	// electricity displaced by solar electricity.
  1108  	CarbonOffsetFactorKgPerMwh float64 `json:"carbonOffsetFactorKgPerMwh,omitempty"`
  1109  	// FinancialAnalyses: A FinancialAnalysis gives the savings from going solar
  1110  	// assuming a given monthly bill and a given electricity provider. They are in
  1111  	// order of increasing order of monthly bill amount. This field will be empty
  1112  	// for buildings in areas for which the Solar API does not have enough
  1113  	// information to perform financial computations.
  1114  	FinancialAnalyses []*FinancialAnalysis `json:"financialAnalyses,omitempty"`
  1115  	// MaxArrayAreaMeters2: Size, in square meters, of the maximum array.
  1116  	MaxArrayAreaMeters2 float64 `json:"maxArrayAreaMeters2,omitempty"`
  1117  	// MaxArrayPanelsCount: Size of the maximum array - that is, the maximum number
  1118  	// of panels that can fit on the roof.
  1119  	MaxArrayPanelsCount int64 `json:"maxArrayPanelsCount,omitempty"`
  1120  	// MaxSunshineHoursPerYear: Maximum number of sunshine hours received per year,
  1121  	// by any point on the roof. Sunshine hours are a measure of the total amount
  1122  	// of insolation (energy) received per year. 1 sunshine hour = 1 kWh per kW
  1123  	// (where kW refers to kW of capacity under Standard Testing Conditions).
  1124  	MaxSunshineHoursPerYear float64 `json:"maxSunshineHoursPerYear,omitempty"`
  1125  	// PanelCapacityWatts: Capacity, in watts, of the panel used in the
  1126  	// calculations.
  1127  	PanelCapacityWatts float64 `json:"panelCapacityWatts,omitempty"`
  1128  	// PanelHeightMeters: Height, in meters in portrait orientation, of the panel
  1129  	// used in the calculations.
  1130  	PanelHeightMeters float64 `json:"panelHeightMeters,omitempty"`
  1131  	// PanelLifetimeYears: The expected lifetime, in years, of the solar panels.
  1132  	// This is used in the financial calculations.
  1133  	PanelLifetimeYears int64 `json:"panelLifetimeYears,omitempty"`
  1134  	// PanelWidthMeters: Width, in meters in portrait orientation, of the panel
  1135  	// used in the calculations.
  1136  	PanelWidthMeters float64 `json:"panelWidthMeters,omitempty"`
  1137  	// RoofSegmentStats: Size and sunlight quantiles for each roof segment.
  1138  	RoofSegmentStats []*RoofSegmentSizeAndSunshineStats `json:"roofSegmentStats,omitempty"`
  1139  	// SolarPanelConfigs: Each SolarPanelConfig describes a different arrangement
  1140  	// of solar panels on the roof. They are in order of increasing number of
  1141  	// panels. The `SolarPanelConfig` with panels_count=N is based on the first N
  1142  	// panels in the `solar_panels` list. This field is only populated if at least
  1143  	// 4 panels can fit on a roof.
  1144  	SolarPanelConfigs []*SolarPanelConfig `json:"solarPanelConfigs,omitempty"`
  1145  	// SolarPanels: Each SolarPanel describes a single solar panel. They are listed
  1146  	// in the order that the panel layout algorithm placed this. This is usually,
  1147  	// though not always, in decreasing order of annual energy production.
  1148  	SolarPanels []*SolarPanel `json:"solarPanels,omitempty"`
  1149  	// WholeRoofStats: Total size and sunlight quantiles for the part of the roof
  1150  	// that was assigned to some roof segment. Despite the name, this may not
  1151  	// include the entire building. See building_stats.
  1152  	WholeRoofStats *SizeAndSunshineStats `json:"wholeRoofStats,omitempty"`
  1153  	// ForceSendFields is a list of field names (e.g. "BuildingStats") to
  1154  	// unconditionally include in API requests. By default, fields with empty or
  1155  	// default values are omitted from API requests. See
  1156  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1157  	// details.
  1158  	ForceSendFields []string `json:"-"`
  1159  	// NullFields is a list of field names (e.g. "BuildingStats") to include in API
  1160  	// requests with the JSON null value. By default, fields with empty values are
  1161  	// omitted from API requests. See
  1162  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1163  	NullFields []string `json:"-"`
  1164  }
  1165  
  1166  func (s *SolarPotential) MarshalJSON() ([]byte, error) {
  1167  	type NoMethod SolarPotential
  1168  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1169  }
  1170  
  1171  func (s *SolarPotential) UnmarshalJSON(data []byte) error {
  1172  	type NoMethod SolarPotential
  1173  	var s1 struct {
  1174  		CarbonOffsetFactorKgPerMwh gensupport.JSONFloat64 `json:"carbonOffsetFactorKgPerMwh"`
  1175  		MaxArrayAreaMeters2        gensupport.JSONFloat64 `json:"maxArrayAreaMeters2"`
  1176  		MaxSunshineHoursPerYear    gensupport.JSONFloat64 `json:"maxSunshineHoursPerYear"`
  1177  		PanelCapacityWatts         gensupport.JSONFloat64 `json:"panelCapacityWatts"`
  1178  		PanelHeightMeters          gensupport.JSONFloat64 `json:"panelHeightMeters"`
  1179  		PanelWidthMeters           gensupport.JSONFloat64 `json:"panelWidthMeters"`
  1180  		*NoMethod
  1181  	}
  1182  	s1.NoMethod = (*NoMethod)(s)
  1183  	if err := json.Unmarshal(data, &s1); err != nil {
  1184  		return err
  1185  	}
  1186  	s.CarbonOffsetFactorKgPerMwh = float64(s1.CarbonOffsetFactorKgPerMwh)
  1187  	s.MaxArrayAreaMeters2 = float64(s1.MaxArrayAreaMeters2)
  1188  	s.MaxSunshineHoursPerYear = float64(s1.MaxSunshineHoursPerYear)
  1189  	s.PanelCapacityWatts = float64(s1.PanelCapacityWatts)
  1190  	s.PanelHeightMeters = float64(s1.PanelHeightMeters)
  1191  	s.PanelWidthMeters = float64(s1.PanelWidthMeters)
  1192  	return nil
  1193  }
  1194  
  1195  type BuildingInsightsFindClosestCall struct {
  1196  	s            *Service
  1197  	urlParams_   gensupport.URLParams
  1198  	ifNoneMatch_ string
  1199  	ctx_         context.Context
  1200  	header_      http.Header
  1201  }
  1202  
  1203  // FindClosest: Locates the closest building to a query point. Returns an error
  1204  // with code `NOT_FOUND` if there are no buildings within approximately 50m of
  1205  // the query point.
  1206  func (r *BuildingInsightsService) FindClosest() *BuildingInsightsFindClosestCall {
  1207  	c := &BuildingInsightsFindClosestCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1208  	return c
  1209  }
  1210  
  1211  // LocationLatitude sets the optional parameter "location.latitude": The
  1212  // latitude in degrees. It must be in the range [-90.0, +90.0].
  1213  func (c *BuildingInsightsFindClosestCall) LocationLatitude(locationLatitude float64) *BuildingInsightsFindClosestCall {
  1214  	c.urlParams_.Set("location.latitude", fmt.Sprint(locationLatitude))
  1215  	return c
  1216  }
  1217  
  1218  // LocationLongitude sets the optional parameter "location.longitude": The
  1219  // longitude in degrees. It must be in the range [-180.0, +180.0].
  1220  func (c *BuildingInsightsFindClosestCall) LocationLongitude(locationLongitude float64) *BuildingInsightsFindClosestCall {
  1221  	c.urlParams_.Set("location.longitude", fmt.Sprint(locationLongitude))
  1222  	return c
  1223  }
  1224  
  1225  // RequiredQuality sets the optional parameter "requiredQuality": The minimum
  1226  // quality level allowed in the results. No result with lower quality than this
  1227  // will be returned. Not specifying this is equivalent to restricting to HIGH
  1228  // quality only.
  1229  //
  1230  // Possible values:
  1231  //
  1232  //	"IMAGERY_QUALITY_UNSPECIFIED" - No quality is known.
  1233  //	"HIGH" - The underlying imagery and DSM data were processed at 0.1
  1234  //
  1235  // m/pixel.
  1236  //
  1237  //	"MEDIUM" - The underlying imagery and DSM data were processed at 0.25
  1238  //
  1239  // m/pixel.
  1240  //
  1241  //	"LOW" - The underlying imagery and DSM data were processed at 0.5 m/pixel.
  1242  func (c *BuildingInsightsFindClosestCall) RequiredQuality(requiredQuality string) *BuildingInsightsFindClosestCall {
  1243  	c.urlParams_.Set("requiredQuality", requiredQuality)
  1244  	return c
  1245  }
  1246  
  1247  // Fields allows partial responses to be retrieved. See
  1248  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1249  // details.
  1250  func (c *BuildingInsightsFindClosestCall) Fields(s ...googleapi.Field) *BuildingInsightsFindClosestCall {
  1251  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1252  	return c
  1253  }
  1254  
  1255  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1256  // object's ETag matches the given value. This is useful for getting updates
  1257  // only after the object has changed since the last request.
  1258  func (c *BuildingInsightsFindClosestCall) IfNoneMatch(entityTag string) *BuildingInsightsFindClosestCall {
  1259  	c.ifNoneMatch_ = entityTag
  1260  	return c
  1261  }
  1262  
  1263  // Context sets the context to be used in this call's Do method.
  1264  func (c *BuildingInsightsFindClosestCall) Context(ctx context.Context) *BuildingInsightsFindClosestCall {
  1265  	c.ctx_ = ctx
  1266  	return c
  1267  }
  1268  
  1269  // Header returns a http.Header that can be modified by the caller to add
  1270  // headers to the request.
  1271  func (c *BuildingInsightsFindClosestCall) Header() http.Header {
  1272  	if c.header_ == nil {
  1273  		c.header_ = make(http.Header)
  1274  	}
  1275  	return c.header_
  1276  }
  1277  
  1278  func (c *BuildingInsightsFindClosestCall) doRequest(alt string) (*http.Response, error) {
  1279  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1280  	if c.ifNoneMatch_ != "" {
  1281  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1282  	}
  1283  	var body io.Reader = nil
  1284  	c.urlParams_.Set("alt", alt)
  1285  	c.urlParams_.Set("prettyPrint", "false")
  1286  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/buildingInsights:findClosest")
  1287  	urls += "?" + c.urlParams_.Encode()
  1288  	req, err := http.NewRequest("GET", urls, body)
  1289  	if err != nil {
  1290  		return nil, err
  1291  	}
  1292  	req.Header = reqHeaders
  1293  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1294  }
  1295  
  1296  // Do executes the "solar.buildingInsights.findClosest" call.
  1297  // Any non-2xx status code is an error. Response headers are in either
  1298  // *BuildingInsights.ServerResponse.Header or (if a response was returned at
  1299  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1300  // check whether the returned error was because http.StatusNotModified was
  1301  // returned.
  1302  func (c *BuildingInsightsFindClosestCall) Do(opts ...googleapi.CallOption) (*BuildingInsights, error) {
  1303  	gensupport.SetOptions(c.urlParams_, opts...)
  1304  	res, err := c.doRequest("json")
  1305  	if res != nil && res.StatusCode == http.StatusNotModified {
  1306  		if res.Body != nil {
  1307  			res.Body.Close()
  1308  		}
  1309  		return nil, gensupport.WrapError(&googleapi.Error{
  1310  			Code:   res.StatusCode,
  1311  			Header: res.Header,
  1312  		})
  1313  	}
  1314  	if err != nil {
  1315  		return nil, err
  1316  	}
  1317  	defer googleapi.CloseBody(res)
  1318  	if err := googleapi.CheckResponse(res); err != nil {
  1319  		return nil, gensupport.WrapError(err)
  1320  	}
  1321  	ret := &BuildingInsights{
  1322  		ServerResponse: googleapi.ServerResponse{
  1323  			Header:         res.Header,
  1324  			HTTPStatusCode: res.StatusCode,
  1325  		},
  1326  	}
  1327  	target := &ret
  1328  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1329  		return nil, err
  1330  	}
  1331  	return ret, nil
  1332  }
  1333  
  1334  type DataLayersGetCall struct {
  1335  	s            *Service
  1336  	urlParams_   gensupport.URLParams
  1337  	ifNoneMatch_ string
  1338  	ctx_         context.Context
  1339  	header_      http.Header
  1340  }
  1341  
  1342  // Get: Gets solar information for a region surrounding a location. Returns an
  1343  // error with code `NOT_FOUND` if the location is outside the coverage area.
  1344  func (r *DataLayersService) Get() *DataLayersGetCall {
  1345  	c := &DataLayersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1346  	return c
  1347  }
  1348  
  1349  // ExactQualityRequired sets the optional parameter "exactQualityRequired":
  1350  // Whether to require exact quality of the imagery. If set to false, the
  1351  // `required_quality` field is interpreted as the minimum required quality,
  1352  // such that HIGH quality imagery may be returned when `required_quality` is
  1353  // set to MEDIUM. If set to true, `required_quality` is interpreted as the
  1354  // exact required quality and only `MEDIUM` quality imagery is returned if
  1355  // `required_quality` is set to `MEDIUM`.
  1356  func (c *DataLayersGetCall) ExactQualityRequired(exactQualityRequired bool) *DataLayersGetCall {
  1357  	c.urlParams_.Set("exactQualityRequired", fmt.Sprint(exactQualityRequired))
  1358  	return c
  1359  }
  1360  
  1361  // LocationLatitude sets the optional parameter "location.latitude": The
  1362  // latitude in degrees. It must be in the range [-90.0, +90.0].
  1363  func (c *DataLayersGetCall) LocationLatitude(locationLatitude float64) *DataLayersGetCall {
  1364  	c.urlParams_.Set("location.latitude", fmt.Sprint(locationLatitude))
  1365  	return c
  1366  }
  1367  
  1368  // LocationLongitude sets the optional parameter "location.longitude": The
  1369  // longitude in degrees. It must be in the range [-180.0, +180.0].
  1370  func (c *DataLayersGetCall) LocationLongitude(locationLongitude float64) *DataLayersGetCall {
  1371  	c.urlParams_.Set("location.longitude", fmt.Sprint(locationLongitude))
  1372  	return c
  1373  }
  1374  
  1375  // PixelSizeMeters sets the optional parameter "pixelSizeMeters": The minimum
  1376  // scale, in meters per pixel, of the data to return. Values of 0.1 (the
  1377  // default, if this field is not set explicitly), 0.25, 0.5, and 1.0 are
  1378  // supported. Imagery components whose normal resolution is less than
  1379  // `pixel_size_meters` will be returned at the resolution specified by
  1380  // `pixel_size_meters`; imagery components whose normal resolution is equal to
  1381  // or greater than `pixel_size_meters` will be returned at that normal
  1382  // resolution.
  1383  func (c *DataLayersGetCall) PixelSizeMeters(pixelSizeMeters float64) *DataLayersGetCall {
  1384  	c.urlParams_.Set("pixelSizeMeters", fmt.Sprint(pixelSizeMeters))
  1385  	return c
  1386  }
  1387  
  1388  // RadiusMeters sets the optional parameter "radiusMeters": Required. The
  1389  // radius, in meters, defining the region surrounding that centre point for
  1390  // which data should be returned. The limitations on this value are: * Any
  1391  // value up to 100m can always be specified. * Values over 100m can be
  1392  // specified, as long as `radius_meters` <= `pixel_size_meters * 1000`. *
  1393  // However, for values over 175m, the `DataLayerView` in the request must not
  1394  // include monthly flux or hourly shade.
  1395  func (c *DataLayersGetCall) RadiusMeters(radiusMeters float64) *DataLayersGetCall {
  1396  	c.urlParams_.Set("radiusMeters", fmt.Sprint(radiusMeters))
  1397  	return c
  1398  }
  1399  
  1400  // RequiredQuality sets the optional parameter "requiredQuality": The minimum
  1401  // quality level allowed in the results. No result with lower quality than this
  1402  // will be returned. Not specifying this is equivalent to restricting to HIGH
  1403  // quality only.
  1404  //
  1405  // Possible values:
  1406  //
  1407  //	"IMAGERY_QUALITY_UNSPECIFIED" - No quality is known.
  1408  //	"HIGH" - The underlying imagery and DSM data were processed at 0.1
  1409  //
  1410  // m/pixel.
  1411  //
  1412  //	"MEDIUM" - The underlying imagery and DSM data were processed at 0.25
  1413  //
  1414  // m/pixel.
  1415  //
  1416  //	"LOW" - The underlying imagery and DSM data were processed at 0.5 m/pixel.
  1417  func (c *DataLayersGetCall) RequiredQuality(requiredQuality string) *DataLayersGetCall {
  1418  	c.urlParams_.Set("requiredQuality", requiredQuality)
  1419  	return c
  1420  }
  1421  
  1422  // View sets the optional parameter "view": The desired subset of the data to
  1423  // return.
  1424  //
  1425  // Possible values:
  1426  //
  1427  //	"DATA_LAYER_VIEW_UNSPECIFIED" - Equivalent to FULL.
  1428  //	"DSM_LAYER" - Get the DSM only.
  1429  //	"IMAGERY_LAYERS" - Get the DSM, RGB, and mask.
  1430  //	"IMAGERY_AND_ANNUAL_FLUX_LAYERS" - Get the DSM, RGB, mask, and annual
  1431  //
  1432  // flux.
  1433  //
  1434  //	"IMAGERY_AND_ALL_FLUX_LAYERS" - Get the DSM, RGB, mask, annual flux, and
  1435  //
  1436  // monthly flux.
  1437  //
  1438  //	"FULL_LAYERS" - Get all data.
  1439  func (c *DataLayersGetCall) View(view string) *DataLayersGetCall {
  1440  	c.urlParams_.Set("view", view)
  1441  	return c
  1442  }
  1443  
  1444  // Fields allows partial responses to be retrieved. See
  1445  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1446  // details.
  1447  func (c *DataLayersGetCall) Fields(s ...googleapi.Field) *DataLayersGetCall {
  1448  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1449  	return c
  1450  }
  1451  
  1452  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1453  // object's ETag matches the given value. This is useful for getting updates
  1454  // only after the object has changed since the last request.
  1455  func (c *DataLayersGetCall) IfNoneMatch(entityTag string) *DataLayersGetCall {
  1456  	c.ifNoneMatch_ = entityTag
  1457  	return c
  1458  }
  1459  
  1460  // Context sets the context to be used in this call's Do method.
  1461  func (c *DataLayersGetCall) Context(ctx context.Context) *DataLayersGetCall {
  1462  	c.ctx_ = ctx
  1463  	return c
  1464  }
  1465  
  1466  // Header returns a http.Header that can be modified by the caller to add
  1467  // headers to the request.
  1468  func (c *DataLayersGetCall) Header() http.Header {
  1469  	if c.header_ == nil {
  1470  		c.header_ = make(http.Header)
  1471  	}
  1472  	return c.header_
  1473  }
  1474  
  1475  func (c *DataLayersGetCall) doRequest(alt string) (*http.Response, error) {
  1476  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1477  	if c.ifNoneMatch_ != "" {
  1478  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1479  	}
  1480  	var body io.Reader = nil
  1481  	c.urlParams_.Set("alt", alt)
  1482  	c.urlParams_.Set("prettyPrint", "false")
  1483  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/dataLayers:get")
  1484  	urls += "?" + c.urlParams_.Encode()
  1485  	req, err := http.NewRequest("GET", urls, body)
  1486  	if err != nil {
  1487  		return nil, err
  1488  	}
  1489  	req.Header = reqHeaders
  1490  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1491  }
  1492  
  1493  // Do executes the "solar.dataLayers.get" call.
  1494  // Any non-2xx status code is an error. Response headers are in either
  1495  // *DataLayers.ServerResponse.Header or (if a response was returned at all) in
  1496  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1497  // whether the returned error was because http.StatusNotModified was returned.
  1498  func (c *DataLayersGetCall) Do(opts ...googleapi.CallOption) (*DataLayers, error) {
  1499  	gensupport.SetOptions(c.urlParams_, opts...)
  1500  	res, err := c.doRequest("json")
  1501  	if res != nil && res.StatusCode == http.StatusNotModified {
  1502  		if res.Body != nil {
  1503  			res.Body.Close()
  1504  		}
  1505  		return nil, gensupport.WrapError(&googleapi.Error{
  1506  			Code:   res.StatusCode,
  1507  			Header: res.Header,
  1508  		})
  1509  	}
  1510  	if err != nil {
  1511  		return nil, err
  1512  	}
  1513  	defer googleapi.CloseBody(res)
  1514  	if err := googleapi.CheckResponse(res); err != nil {
  1515  		return nil, gensupport.WrapError(err)
  1516  	}
  1517  	ret := &DataLayers{
  1518  		ServerResponse: googleapi.ServerResponse{
  1519  			Header:         res.Header,
  1520  			HTTPStatusCode: res.StatusCode,
  1521  		},
  1522  	}
  1523  	target := &ret
  1524  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1525  		return nil, err
  1526  	}
  1527  	return ret, nil
  1528  }
  1529  
  1530  type GeoTiffGetCall struct {
  1531  	s            *Service
  1532  	urlParams_   gensupport.URLParams
  1533  	ifNoneMatch_ string
  1534  	ctx_         context.Context
  1535  	header_      http.Header
  1536  }
  1537  
  1538  // Get: Returns an image by its ID.
  1539  func (r *GeoTiffService) Get() *GeoTiffGetCall {
  1540  	c := &GeoTiffGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1541  	return c
  1542  }
  1543  
  1544  // Id sets the optional parameter "id": Required. The ID of the asset being
  1545  // requested.
  1546  func (c *GeoTiffGetCall) Id(id string) *GeoTiffGetCall {
  1547  	c.urlParams_.Set("id", id)
  1548  	return c
  1549  }
  1550  
  1551  // Fields allows partial responses to be retrieved. See
  1552  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1553  // details.
  1554  func (c *GeoTiffGetCall) Fields(s ...googleapi.Field) *GeoTiffGetCall {
  1555  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1556  	return c
  1557  }
  1558  
  1559  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1560  // object's ETag matches the given value. This is useful for getting updates
  1561  // only after the object has changed since the last request.
  1562  func (c *GeoTiffGetCall) IfNoneMatch(entityTag string) *GeoTiffGetCall {
  1563  	c.ifNoneMatch_ = entityTag
  1564  	return c
  1565  }
  1566  
  1567  // Context sets the context to be used in this call's Do method.
  1568  func (c *GeoTiffGetCall) Context(ctx context.Context) *GeoTiffGetCall {
  1569  	c.ctx_ = ctx
  1570  	return c
  1571  }
  1572  
  1573  // Header returns a http.Header that can be modified by the caller to add
  1574  // headers to the request.
  1575  func (c *GeoTiffGetCall) Header() http.Header {
  1576  	if c.header_ == nil {
  1577  		c.header_ = make(http.Header)
  1578  	}
  1579  	return c.header_
  1580  }
  1581  
  1582  func (c *GeoTiffGetCall) doRequest(alt string) (*http.Response, error) {
  1583  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1584  	if c.ifNoneMatch_ != "" {
  1585  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1586  	}
  1587  	var body io.Reader = nil
  1588  	c.urlParams_.Set("alt", alt)
  1589  	c.urlParams_.Set("prettyPrint", "false")
  1590  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/geoTiff:get")
  1591  	urls += "?" + c.urlParams_.Encode()
  1592  	req, err := http.NewRequest("GET", urls, body)
  1593  	if err != nil {
  1594  		return nil, err
  1595  	}
  1596  	req.Header = reqHeaders
  1597  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1598  }
  1599  
  1600  // Do executes the "solar.geoTiff.get" call.
  1601  // Any non-2xx status code is an error. Response headers are in either
  1602  // *HttpBody.ServerResponse.Header or (if a response was returned at all) in
  1603  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1604  // whether the returned error was because http.StatusNotModified was returned.
  1605  func (c *GeoTiffGetCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) {
  1606  	gensupport.SetOptions(c.urlParams_, opts...)
  1607  	res, err := c.doRequest("json")
  1608  	if res != nil && res.StatusCode == http.StatusNotModified {
  1609  		if res.Body != nil {
  1610  			res.Body.Close()
  1611  		}
  1612  		return nil, gensupport.WrapError(&googleapi.Error{
  1613  			Code:   res.StatusCode,
  1614  			Header: res.Header,
  1615  		})
  1616  	}
  1617  	if err != nil {
  1618  		return nil, err
  1619  	}
  1620  	defer googleapi.CloseBody(res)
  1621  	if err := googleapi.CheckResponse(res); err != nil {
  1622  		return nil, gensupport.WrapError(err)
  1623  	}
  1624  	ret := &HttpBody{
  1625  		ServerResponse: googleapi.ServerResponse{
  1626  			Header:         res.Header,
  1627  			HTTPStatusCode: res.StatusCode,
  1628  		},
  1629  	}
  1630  	target := &ret
  1631  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1632  		return nil, err
  1633  	}
  1634  	return ret, nil
  1635  }
  1636  

View as plain text