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 places provides access to the Places API (New). 8 // 9 // For product documentation, see: https://mapsplatform.google.com/maps-products/#places-section 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/places/v1" 27 // ... 28 // ctx := context.Background() 29 // placesService, err := places.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 // By default, all available scopes (see "Constants") are used to authenticate. 38 // To restrict scopes, use [google.golang.org/api/option.WithScopes]: 39 // 40 // placesService, err := places.NewService(ctx, option.WithScopes(places.MapsPlatformPlacesTextsearchScope)) 41 // 42 // To use an API key for authentication (note: some APIs do not support API 43 // keys), use [google.golang.org/api/option.WithAPIKey]: 44 // 45 // placesService, err := places.NewService(ctx, option.WithAPIKey("AIza...")) 46 // 47 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth 48 // flow, use [google.golang.org/api/option.WithTokenSource]: 49 // 50 // config := &oauth2.Config{...} 51 // // ... 52 // token, err := config.Exchange(ctx, ...) 53 // placesService, err := places.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 54 // 55 // See [google.golang.org/api/option.ClientOption] for details on options. 56 package places // import "google.golang.org/api/places/v1" 57 58 import ( 59 "bytes" 60 "context" 61 "encoding/json" 62 "errors" 63 "fmt" 64 "io" 65 "net/http" 66 "net/url" 67 "strconv" 68 "strings" 69 70 googleapi "google.golang.org/api/googleapi" 71 internal "google.golang.org/api/internal" 72 gensupport "google.golang.org/api/internal/gensupport" 73 option "google.golang.org/api/option" 74 internaloption "google.golang.org/api/option/internaloption" 75 htransport "google.golang.org/api/transport/http" 76 ) 77 78 // Always reference these packages, just in case the auto-generated code 79 // below doesn't. 80 var _ = bytes.NewBuffer 81 var _ = strconv.Itoa 82 var _ = fmt.Sprintf 83 var _ = json.NewDecoder 84 var _ = io.Copy 85 var _ = url.Parse 86 var _ = gensupport.MarshalJSON 87 var _ = googleapi.Version 88 var _ = errors.New 89 var _ = strings.Replace 90 var _ = context.Canceled 91 var _ = internaloption.WithDefaultEndpoint 92 var _ = internal.Version 93 94 const apiId = "places:v1" 95 const apiName = "places" 96 const apiVersion = "v1" 97 const basePath = "https://places.googleapis.com/" 98 const basePathTemplate = "https://places.UNIVERSE_DOMAIN/" 99 const mtlsBasePath = "https://places.mtls.googleapis.com/" 100 101 // OAuth2 scopes used by this API. 102 const ( 103 // See, edit, configure, and delete your Google Cloud data and see the email 104 // address for your Google Account. 105 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 106 107 // Private Service: https://www.googleapis.com/auth/maps-platform.places 108 MapsPlatformPlacesScope = "https://www.googleapis.com/auth/maps-platform.places" 109 110 // Private Service: 111 // https://www.googleapis.com/auth/maps-platform.places.autocomplete 112 MapsPlatformPlacesAutocompleteScope = "https://www.googleapis.com/auth/maps-platform.places.autocomplete" 113 114 // Private Service: 115 // https://www.googleapis.com/auth/maps-platform.places.details 116 MapsPlatformPlacesDetailsScope = "https://www.googleapis.com/auth/maps-platform.places.details" 117 118 // Private Service: 119 // https://www.googleapis.com/auth/maps-platform.places.nearbysearch 120 MapsPlatformPlacesNearbysearchScope = "https://www.googleapis.com/auth/maps-platform.places.nearbysearch" 121 122 // Private Service: 123 // https://www.googleapis.com/auth/maps-platform.places.textsearch 124 MapsPlatformPlacesTextsearchScope = "https://www.googleapis.com/auth/maps-platform.places.textsearch" 125 ) 126 127 // NewService creates a new Service. 128 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 129 scopesOption := internaloption.WithDefaultScopes( 130 "https://www.googleapis.com/auth/cloud-platform", 131 "https://www.googleapis.com/auth/maps-platform.places", 132 "https://www.googleapis.com/auth/maps-platform.places.autocomplete", 133 "https://www.googleapis.com/auth/maps-platform.places.details", 134 "https://www.googleapis.com/auth/maps-platform.places.nearbysearch", 135 "https://www.googleapis.com/auth/maps-platform.places.textsearch", 136 ) 137 // NOTE: prepend, so we don't override user-specified scopes. 138 opts = append([]option.ClientOption{scopesOption}, opts...) 139 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 140 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) 141 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 142 opts = append(opts, internaloption.EnableNewAuthLibrary()) 143 client, endpoint, err := htransport.NewClient(ctx, opts...) 144 if err != nil { 145 return nil, err 146 } 147 s, err := New(client) 148 if err != nil { 149 return nil, err 150 } 151 if endpoint != "" { 152 s.BasePath = endpoint 153 } 154 return s, nil 155 } 156 157 // New creates a new Service. It uses the provided http.Client for requests. 158 // 159 // Deprecated: please use NewService instead. 160 // To provide a custom HTTP client, use option.WithHTTPClient. 161 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 162 func New(client *http.Client) (*Service, error) { 163 if client == nil { 164 return nil, errors.New("client is nil") 165 } 166 s := &Service{client: client, BasePath: basePath} 167 s.Places = NewPlacesService(s) 168 return s, nil 169 } 170 171 type Service struct { 172 client *http.Client 173 BasePath string // API endpoint base URL 174 UserAgent string // optional additional User-Agent fragment 175 176 Places *PlacesService 177 } 178 179 func (s *Service) userAgent() string { 180 if s.UserAgent == "" { 181 return googleapi.UserAgent 182 } 183 return googleapi.UserAgent + " " + s.UserAgent 184 } 185 186 func NewPlacesService(s *Service) *PlacesService { 187 rs := &PlacesService{s: s} 188 rs.Photos = NewPlacesPhotosService(s) 189 return rs 190 } 191 192 type PlacesService struct { 193 s *Service 194 195 Photos *PlacesPhotosService 196 } 197 198 func NewPlacesPhotosService(s *Service) *PlacesPhotosService { 199 rs := &PlacesPhotosService{s: s} 200 return rs 201 } 202 203 type PlacesPhotosService struct { 204 s *Service 205 } 206 207 // GoogleGeoTypeViewport: A latitude-longitude viewport, represented as two 208 // diagonally opposite `low` and `high` points. A viewport is considered a 209 // closed region, i.e. it includes its boundary. The latitude bounds must range 210 // between -90 to 90 degrees inclusive, and the longitude bounds must range 211 // between -180 to 180 degrees inclusive. Various cases include: - If `low` = 212 // `high`, the viewport consists of that single point. - If `low.longitude` > 213 // `high.longitude`, the longitude range is inverted (the viewport crosses the 214 // 180 degree longitude line). - If `low.longitude` = -180 degrees and 215 // `high.longitude` = 180 degrees, the viewport includes all longitudes. - If 216 // `low.longitude` = 180 degrees and `high.longitude` = -180 degrees, the 217 // longitude range is empty. - If `low.latitude` > `high.latitude`, the 218 // latitude range is empty. Both `low` and `high` must be populated, and the 219 // represented box cannot be empty (as specified by the definitions above). An 220 // empty viewport will result in an error. For example, this viewport fully 221 // encloses New York City: { "low": { "latitude": 40.477398, "longitude": 222 // -74.259087 }, "high": { "latitude": 40.91618, "longitude": -73.70018 } } 223 type GoogleGeoTypeViewport struct { 224 // High: Required. The high point of the viewport. 225 High *GoogleTypeLatLng `json:"high,omitempty"` 226 // Low: Required. The low point of the viewport. 227 Low *GoogleTypeLatLng `json:"low,omitempty"` 228 // ForceSendFields is a list of field names (e.g. "High") to unconditionally 229 // include in API requests. By default, fields with empty or default values are 230 // omitted from API requests. See 231 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 232 // details. 233 ForceSendFields []string `json:"-"` 234 // NullFields is a list of field names (e.g. "High") to include in API requests 235 // with the JSON null value. By default, fields with empty values are omitted 236 // from API requests. See 237 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 238 NullFields []string `json:"-"` 239 } 240 241 func (s *GoogleGeoTypeViewport) MarshalJSON() ([]byte, error) { 242 type NoMethod GoogleGeoTypeViewport 243 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 244 } 245 246 // GoogleMapsPlacesV1AuthorAttribution: Information about the author of the UGC 247 // data. Used in Photo, and Review. 248 type GoogleMapsPlacesV1AuthorAttribution struct { 249 // DisplayName: Name of the author of the Photo or Review. 250 DisplayName string `json:"displayName,omitempty"` 251 // PhotoUri: Profile photo URI of the author of the Photo or Review. 252 PhotoUri string `json:"photoUri,omitempty"` 253 // Uri: URI of the author of the Photo or Review. 254 Uri string `json:"uri,omitempty"` 255 // ForceSendFields is a list of field names (e.g. "DisplayName") to 256 // unconditionally include in API requests. By default, fields with empty or 257 // default values are omitted from API requests. See 258 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 259 // details. 260 ForceSendFields []string `json:"-"` 261 // NullFields is a list of field names (e.g. "DisplayName") to include in API 262 // requests with the JSON null value. By default, fields with empty values are 263 // omitted from API requests. See 264 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 265 NullFields []string `json:"-"` 266 } 267 268 func (s *GoogleMapsPlacesV1AuthorAttribution) MarshalJSON() ([]byte, error) { 269 type NoMethod GoogleMapsPlacesV1AuthorAttribution 270 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 271 } 272 273 // GoogleMapsPlacesV1AutocompletePlacesRequest: Request proto for 274 // AutocompletePlaces. 275 type GoogleMapsPlacesV1AutocompletePlacesRequest struct { 276 // IncludeQueryPredictions: Optional. If true, the response will include both 277 // Place and query predictions. Otherwise the response will only return Place 278 // predictions. 279 IncludeQueryPredictions bool `json:"includeQueryPredictions,omitempty"` 280 // IncludedPrimaryTypes: Optional. Included primary Place type (for example, 281 // "restaurant" or "gas_station") from 282 // https://developers.google.com/maps/documentation/places/web-service/place-types. 283 // A Place is only returned if its primary type is included in this list. Up to 284 // 5 values can be specified. If no types are specified, all Place types are 285 // returned. 286 IncludedPrimaryTypes []string `json:"includedPrimaryTypes,omitempty"` 287 // IncludedRegionCodes: Optional. Only include results in the specified 288 // regions, specified as up to 15 CLDR two-character region codes. An empty set 289 // will not restrict the results. If both `location_restriction` and 290 // `included_region_codes` are set, the results will be located in the area of 291 // intersection. 292 IncludedRegionCodes []string `json:"includedRegionCodes,omitempty"` 293 // Input: Required. The text string on which to search. 294 Input string `json:"input,omitempty"` 295 // InputOffset: Optional. A zero-based Unicode character offset of `input` 296 // indicating the cursor position in `input`. The cursor position may influence 297 // what predictions are returned. If empty, defaults to the length of `input`. 298 InputOffset int64 `json:"inputOffset,omitempty"` 299 // LanguageCode: Optional. The language in which to return results. Defaults to 300 // en-US. The results may be in mixed languages if the language used in `input` 301 // is different from `language_code` or if the returned Place does not have a 302 // translation from the local language to `language_code`. 303 LanguageCode string `json:"languageCode,omitempty"` 304 // LocationBias: Optional. Bias results to a specified location. At most one of 305 // `location_bias` or `location_restriction` should be set. If neither are set, 306 // the results will be biased by IP address, meaning the IP address will be 307 // mapped to an imprecise location and used as a biasing signal. 308 LocationBias *GoogleMapsPlacesV1AutocompletePlacesRequestLocationBias `json:"locationBias,omitempty"` 309 // LocationRestriction: Optional. Restrict results to a specified location. At 310 // most one of `location_bias` or `location_restriction` should be set. If 311 // neither are set, the results will be biased by IP address, meaning the IP 312 // address will be mapped to an imprecise location and used as a biasing 313 // signal. 314 LocationRestriction *GoogleMapsPlacesV1AutocompletePlacesRequestLocationRestriction `json:"locationRestriction,omitempty"` 315 // Origin: Optional. The origin point from which to calculate geodesic distance 316 // to the destination (returned as `distance_meters`). If this value is 317 // omitted, geodesic distance will not be returned. 318 Origin *GoogleTypeLatLng `json:"origin,omitempty"` 319 // RegionCode: Optional. The region code, specified as a CLDR two-character 320 // region code. This affects address formatting, result ranking, and may 321 // influence what results are returned. This does not restrict results to the 322 // specified region. To restrict results to a region, use 323 // `region_code_restriction`. 324 RegionCode string `json:"regionCode,omitempty"` 325 // SessionToken: Optional. A string which identifies an Autocomplete session 326 // for billing purposes. Must be a URL and filename safe base64 string with at 327 // most 36 ASCII characters in length. Otherwise an INVALID_ARGUMENT error is 328 // returned. The session begins when the user starts typing a query, and 329 // concludes when they select a place and a call to Place Details or Address 330 // Validation is made. Each session can have multiple queries, followed by one 331 // Place Details or Address Validation request. The credentials used for each 332 // request within a session must belong to the same Google Cloud Console 333 // project. Once a session has concluded, the token is no longer valid; your 334 // app must generate a fresh token for each session. If the `session_token` 335 // parameter is omitted, or if you reuse a session token, the session is 336 // charged as if no session token was provided (each request is billed 337 // separately). We recommend the following guidelines: * Use session tokens for 338 // all Place Autocomplete calls. * Generate a fresh token for each session. 339 // Using a version 4 UUID is recommended. * Ensure that the credentials used 340 // for all Place Autocomplete, Place Details, and Address Validation requests 341 // within a session belong to the same Cloud Console project. * Be sure to pass 342 // a unique session token for each new session. Using the same token for more 343 // than one session will result in each request being billed individually. 344 SessionToken string `json:"sessionToken,omitempty"` 345 // ForceSendFields is a list of field names (e.g. "IncludeQueryPredictions") to 346 // unconditionally include in API requests. By default, fields with empty or 347 // default values are omitted from API requests. See 348 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 349 // details. 350 ForceSendFields []string `json:"-"` 351 // NullFields is a list of field names (e.g. "IncludeQueryPredictions") to 352 // include in API requests with the JSON null value. By default, fields with 353 // empty values are omitted from API requests. See 354 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 355 NullFields []string `json:"-"` 356 } 357 358 func (s *GoogleMapsPlacesV1AutocompletePlacesRequest) MarshalJSON() ([]byte, error) { 359 type NoMethod GoogleMapsPlacesV1AutocompletePlacesRequest 360 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 361 } 362 363 // GoogleMapsPlacesV1AutocompletePlacesRequestLocationBias: The region to 364 // search. The results may be biased around the specified region. 365 type GoogleMapsPlacesV1AutocompletePlacesRequestLocationBias struct { 366 // Circle: A circle defined by a center point and radius. 367 Circle *GoogleMapsPlacesV1Circle `json:"circle,omitempty"` 368 // Rectangle: A viewport defined by a northeast and a southwest corner. 369 Rectangle *GoogleGeoTypeViewport `json:"rectangle,omitempty"` 370 // ForceSendFields is a list of field names (e.g. "Circle") to unconditionally 371 // include in API requests. By default, fields with empty or default values are 372 // omitted from API requests. See 373 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 374 // details. 375 ForceSendFields []string `json:"-"` 376 // NullFields is a list of field names (e.g. "Circle") to include in API 377 // requests with the JSON null value. By default, fields with empty values are 378 // omitted from API requests. See 379 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 380 NullFields []string `json:"-"` 381 } 382 383 func (s *GoogleMapsPlacesV1AutocompletePlacesRequestLocationBias) MarshalJSON() ([]byte, error) { 384 type NoMethod GoogleMapsPlacesV1AutocompletePlacesRequestLocationBias 385 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 386 } 387 388 // GoogleMapsPlacesV1AutocompletePlacesRequestLocationRestriction: The region 389 // to search. The results will be restricted to the specified region. 390 type GoogleMapsPlacesV1AutocompletePlacesRequestLocationRestriction struct { 391 // Circle: A circle defined by a center point and radius. 392 Circle *GoogleMapsPlacesV1Circle `json:"circle,omitempty"` 393 // Rectangle: A viewport defined by a northeast and a southwest corner. 394 Rectangle *GoogleGeoTypeViewport `json:"rectangle,omitempty"` 395 // ForceSendFields is a list of field names (e.g. "Circle") to unconditionally 396 // include in API requests. By default, fields with empty or default values are 397 // omitted from API requests. See 398 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 399 // details. 400 ForceSendFields []string `json:"-"` 401 // NullFields is a list of field names (e.g. "Circle") to include in API 402 // requests with the JSON null value. By default, fields with empty values are 403 // omitted from API requests. See 404 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 405 NullFields []string `json:"-"` 406 } 407 408 func (s *GoogleMapsPlacesV1AutocompletePlacesRequestLocationRestriction) MarshalJSON() ([]byte, error) { 409 type NoMethod GoogleMapsPlacesV1AutocompletePlacesRequestLocationRestriction 410 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 411 } 412 413 // GoogleMapsPlacesV1AutocompletePlacesResponse: Response proto for 414 // AutocompletePlaces. 415 type GoogleMapsPlacesV1AutocompletePlacesResponse struct { 416 // Suggestions: Contains a list of suggestions, ordered in descending order of 417 // relevance. 418 Suggestions []*GoogleMapsPlacesV1AutocompletePlacesResponseSuggestion `json:"suggestions,omitempty"` 419 420 // ServerResponse contains the HTTP response code and headers from the server. 421 googleapi.ServerResponse `json:"-"` 422 // ForceSendFields is a list of field names (e.g. "Suggestions") to 423 // unconditionally include in API requests. By default, fields with empty or 424 // default values are omitted from API requests. See 425 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 426 // details. 427 ForceSendFields []string `json:"-"` 428 // NullFields is a list of field names (e.g. "Suggestions") to include in API 429 // requests with the JSON null value. By default, fields with empty values are 430 // omitted from API requests. See 431 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 432 NullFields []string `json:"-"` 433 } 434 435 func (s *GoogleMapsPlacesV1AutocompletePlacesResponse) MarshalJSON() ([]byte, error) { 436 type NoMethod GoogleMapsPlacesV1AutocompletePlacesResponse 437 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 438 } 439 440 // GoogleMapsPlacesV1AutocompletePlacesResponseSuggestion: An Autocomplete 441 // suggestion result. 442 type GoogleMapsPlacesV1AutocompletePlacesResponseSuggestion struct { 443 // PlacePrediction: A prediction for a Place. 444 PlacePrediction *GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionPlacePrediction `json:"placePrediction,omitempty"` 445 // QueryPrediction: A prediction for a query. 446 QueryPrediction *GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionQueryPrediction `json:"queryPrediction,omitempty"` 447 // ForceSendFields is a list of field names (e.g. "PlacePrediction") to 448 // unconditionally include in API requests. By default, fields with empty or 449 // default values are omitted from API requests. See 450 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 451 // details. 452 ForceSendFields []string `json:"-"` 453 // NullFields is a list of field names (e.g. "PlacePrediction") to include in 454 // API requests with the JSON null value. By default, fields with empty values 455 // are omitted from API requests. See 456 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 457 NullFields []string `json:"-"` 458 } 459 460 func (s *GoogleMapsPlacesV1AutocompletePlacesResponseSuggestion) MarshalJSON() ([]byte, error) { 461 type NoMethod GoogleMapsPlacesV1AutocompletePlacesResponseSuggestion 462 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 463 } 464 465 // GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionFormattableText: Text 466 // representing a Place or query prediction. The text may be used as is or 467 // formatted. 468 type GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionFormattableText struct { 469 // Matches: A list of string ranges identifying where the input request matched 470 // in `text`. The ranges can be used to format specific parts of `text`. The 471 // substrings may not be exact matches of `input` if the matching was 472 // determined by criteria other than string matching (for example, spell 473 // corrections or transliterations). These values are Unicode character offsets 474 // of `text`. The ranges are guaranteed to be ordered in increasing offset 475 // values. 476 Matches []*GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionStringRange `json:"matches,omitempty"` 477 // Text: Text that may be used as is or formatted with `matches`. 478 Text string `json:"text,omitempty"` 479 // ForceSendFields is a list of field names (e.g. "Matches") to unconditionally 480 // include in API requests. By default, fields with empty or default values are 481 // omitted from API requests. See 482 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 483 // details. 484 ForceSendFields []string `json:"-"` 485 // NullFields is a list of field names (e.g. "Matches") to include in API 486 // requests with the JSON null value. By default, fields with empty values are 487 // omitted from API requests. See 488 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 489 NullFields []string `json:"-"` 490 } 491 492 func (s *GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionFormattableText) MarshalJSON() ([]byte, error) { 493 type NoMethod GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionFormattableText 494 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 495 } 496 497 // GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionPlacePrediction: 498 // Prediction results for a Place Autocomplete prediction. 499 type GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionPlacePrediction struct { 500 // DistanceMeters: The length of the geodesic in meters from `origin` if 501 // `origin` is specified. Certain predictions such as routes may not populate 502 // this field. 503 DistanceMeters int64 `json:"distanceMeters,omitempty"` 504 // Place: The resource name of the suggested Place. This name can be used in 505 // other APIs that accept Place names. 506 Place string `json:"place,omitempty"` 507 // PlaceId: The unique identifier of the suggested Place. This identifier can 508 // be used in other APIs that accept Place IDs. 509 PlaceId string `json:"placeId,omitempty"` 510 // StructuredFormat: A breakdown of the Place prediction into main text 511 // containing the name of the Place and secondary text containing additional 512 // disambiguating features (such as a city or region). `structured_format` is 513 // recommended for developers who wish to show two separate, but related, UI 514 // elements. Developers who wish to show a single UI element may want to use 515 // `text` instead. They are two different ways to represent a Place prediction. 516 // Users should not try to parse `structured_format` into `text` or vice versa. 517 StructuredFormat *GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionStructuredFormat `json:"structuredFormat,omitempty"` 518 // Text: Contains the human-readable name for the returned result. For 519 // establishment results, this is usually the business name and address. `text` 520 // is recommended for developers who wish to show a single UI element. 521 // Developers who wish to show two separate, but related, UI elements may want 522 // to use `structured_format` instead. They are two different ways to represent 523 // a Place prediction. Users should not try to parse `structured_format` into 524 // `text` or vice versa. This text may be different from the `display_name` 525 // returned by GetPlace. May be in mixed languages if the request `input` and 526 // `language_code` are in different languages or if the Place does not have a 527 // translation from the local language to `language_code`. 528 Text *GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionFormattableText `json:"text,omitempty"` 529 // Types: List of types that apply to this Place from Table A or Table B in 530 // https://developers.google.com/maps/documentation/places/web-service/place-types. 531 // A type is a categorization of a Place. Places with shared types will share 532 // similar characteristics. 533 Types []string `json:"types,omitempty"` 534 // ForceSendFields is a list of field names (e.g. "DistanceMeters") to 535 // unconditionally include in API requests. By default, fields with empty or 536 // default values are omitted from API requests. See 537 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 538 // details. 539 ForceSendFields []string `json:"-"` 540 // NullFields is a list of field names (e.g. "DistanceMeters") to include in 541 // API requests with the JSON null value. By default, fields with empty values 542 // are omitted from API requests. See 543 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 544 NullFields []string `json:"-"` 545 } 546 547 func (s *GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionPlacePrediction) MarshalJSON() ([]byte, error) { 548 type NoMethod GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionPlacePrediction 549 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 550 } 551 552 // GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionQueryPrediction: 553 // Prediction results for a Query Autocomplete prediction. 554 type GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionQueryPrediction struct { 555 // StructuredFormat: A breakdown of the query prediction into main text 556 // containing the query and secondary text containing additional disambiguating 557 // features (such as a city or region). `structured_format` is recommended for 558 // developers who wish to show two separate, but related, UI elements. 559 // Developers who wish to show a single UI element may want to use `text` 560 // instead. They are two different ways to represent a query prediction. Users 561 // should not try to parse `structured_format` into `text` or vice versa. 562 StructuredFormat *GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionStructuredFormat `json:"structuredFormat,omitempty"` 563 // Text: The predicted text. This text does not represent a Place, but rather a 564 // text query that could be used in a search endpoint (for example, Text 565 // Search). `text` is recommended for developers who wish to show a single UI 566 // element. Developers who wish to show two separate, but related, UI elements 567 // may want to use `structured_format` instead. They are two different ways to 568 // represent a query prediction. Users should not try to parse 569 // `structured_format` into `text` or vice versa. May be in mixed languages if 570 // the request `input` and `language_code` are in different languages or if 571 // part of the query does not have a translation from the local language to 572 // `language_code`. 573 Text *GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionFormattableText `json:"text,omitempty"` 574 // ForceSendFields is a list of field names (e.g. "StructuredFormat") to 575 // unconditionally include in API requests. By default, fields with empty or 576 // default values are omitted from API requests. See 577 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 578 // details. 579 ForceSendFields []string `json:"-"` 580 // NullFields is a list of field names (e.g. "StructuredFormat") to include in 581 // API requests with the JSON null value. By default, fields with empty values 582 // are omitted from API requests. See 583 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 584 NullFields []string `json:"-"` 585 } 586 587 func (s *GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionQueryPrediction) MarshalJSON() ([]byte, error) { 588 type NoMethod GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionQueryPrediction 589 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 590 } 591 592 // GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionStringRange: 593 // Identifies a substring within a given text. 594 type GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionStringRange struct { 595 // EndOffset: Zero-based offset of the last Unicode character (exclusive). 596 EndOffset int64 `json:"endOffset,omitempty"` 597 // StartOffset: Zero-based offset of the first Unicode character of the string 598 // (inclusive). 599 StartOffset int64 `json:"startOffset,omitempty"` 600 // ForceSendFields is a list of field names (e.g. "EndOffset") to 601 // unconditionally include in API requests. By default, fields with empty or 602 // default values are omitted from API requests. See 603 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 604 // details. 605 ForceSendFields []string `json:"-"` 606 // NullFields is a list of field names (e.g. "EndOffset") to include in API 607 // requests with the JSON null value. By default, fields with empty values are 608 // omitted from API requests. See 609 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 610 NullFields []string `json:"-"` 611 } 612 613 func (s *GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionStringRange) MarshalJSON() ([]byte, error) { 614 type NoMethod GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionStringRange 615 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 616 } 617 618 // GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionStructuredFormat: 619 // Contains a breakdown of a Place or query prediction into main text and 620 // secondary text. For Place predictions, the main text contains the specific 621 // name of the Place. For query predictions, the main text contains the query. 622 // The secondary text contains additional disambiguating features (such as a 623 // city or region) to further identify the Place or refine the query. 624 type GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionStructuredFormat struct { 625 // MainText: Represents the name of the Place or query. 626 MainText *GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionFormattableText `json:"mainText,omitempty"` 627 // SecondaryText: Represents additional disambiguating features (such as a city 628 // or region) to further identify the Place or refine the query. 629 SecondaryText *GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionFormattableText `json:"secondaryText,omitempty"` 630 // ForceSendFields is a list of field names (e.g. "MainText") to 631 // unconditionally include in API requests. By default, fields with empty or 632 // default values are omitted from API requests. See 633 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 634 // details. 635 ForceSendFields []string `json:"-"` 636 // NullFields is a list of field names (e.g. "MainText") to include in API 637 // requests with the JSON null value. By default, fields with empty values are 638 // omitted from API requests. See 639 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 640 NullFields []string `json:"-"` 641 } 642 643 func (s *GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionStructuredFormat) MarshalJSON() ([]byte, error) { 644 type NoMethod GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionStructuredFormat 645 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 646 } 647 648 // GoogleMapsPlacesV1Circle: Circle with a LatLng as center and radius. 649 type GoogleMapsPlacesV1Circle struct { 650 // Center: Required. Center latitude and longitude. The range of latitude must 651 // be within [-90.0, 90.0]. The range of the longitude must be within [-180.0, 652 // 180.0]. 653 Center *GoogleTypeLatLng `json:"center,omitempty"` 654 // Radius: Required. Radius measured in meters. The radius must be within [0.0, 655 // 50000.0]. 656 Radius float64 `json:"radius,omitempty"` 657 // ForceSendFields is a list of field names (e.g. "Center") to unconditionally 658 // include in API requests. By default, fields with empty or default values are 659 // omitted from API requests. See 660 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 661 // details. 662 ForceSendFields []string `json:"-"` 663 // NullFields is a list of field names (e.g. "Center") to include in API 664 // requests with the JSON null value. By default, fields with empty values are 665 // omitted from API requests. See 666 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 667 NullFields []string `json:"-"` 668 } 669 670 func (s *GoogleMapsPlacesV1Circle) MarshalJSON() ([]byte, error) { 671 type NoMethod GoogleMapsPlacesV1Circle 672 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 673 } 674 675 func (s *GoogleMapsPlacesV1Circle) UnmarshalJSON(data []byte) error { 676 type NoMethod GoogleMapsPlacesV1Circle 677 var s1 struct { 678 Radius gensupport.JSONFloat64 `json:"radius"` 679 *NoMethod 680 } 681 s1.NoMethod = (*NoMethod)(s) 682 if err := json.Unmarshal(data, &s1); err != nil { 683 return err 684 } 685 s.Radius = float64(s1.Radius) 686 return nil 687 } 688 689 // GoogleMapsPlacesV1ContentBlock: A block of content that can be served 690 // individually. 691 type GoogleMapsPlacesV1ContentBlock struct { 692 // Content: Content related to the topic. 693 Content *GoogleTypeLocalizedText `json:"content,omitempty"` 694 // References: Experimental: See 695 // https://developers.google.com/maps/documentation/places/web-service/experimental/places-generative 696 // for more details. References that are related to this block of content. 697 References *GoogleMapsPlacesV1References `json:"references,omitempty"` 698 // Topic: The topic of the content, for example "overview" or "restaurant". 699 Topic string `json:"topic,omitempty"` 700 // ForceSendFields is a list of field names (e.g. "Content") to unconditionally 701 // include in API requests. By default, fields with empty or default values are 702 // omitted from API requests. See 703 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 704 // details. 705 ForceSendFields []string `json:"-"` 706 // NullFields is a list of field names (e.g. "Content") to include in API 707 // requests with the JSON null value. By default, fields with empty values are 708 // omitted from API requests. See 709 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 710 NullFields []string `json:"-"` 711 } 712 713 func (s *GoogleMapsPlacesV1ContentBlock) MarshalJSON() ([]byte, error) { 714 type NoMethod GoogleMapsPlacesV1ContentBlock 715 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 716 } 717 718 // GoogleMapsPlacesV1ContextualContent: Experimental: See 719 // https://developers.google.com/maps/documentation/places/web-service/experimental/places-generative 720 // for more details. Content that is contextual to the place query. 721 type GoogleMapsPlacesV1ContextualContent struct { 722 // Justifications: Experimental: See 723 // https://developers.google.com/maps/documentation/places/web-service/experimental/places-generative 724 // for more details. Justifications for the place. 725 Justifications []*GoogleMapsPlacesV1ContextualContentJustification `json:"justifications,omitempty"` 726 // Photos: Information (including references) about photos of this place, 727 // contexual to the place query. 728 Photos []*GoogleMapsPlacesV1Photo `json:"photos,omitempty"` 729 // Reviews: List of reviews about this place, contexual to the place query. 730 Reviews []*GoogleMapsPlacesV1Review `json:"reviews,omitempty"` 731 // ForceSendFields is a list of field names (e.g. "Justifications") to 732 // unconditionally include in API requests. By default, fields with empty or 733 // default values are omitted from API requests. See 734 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 735 // details. 736 ForceSendFields []string `json:"-"` 737 // NullFields is a list of field names (e.g. "Justifications") to include in 738 // API requests with the JSON null value. By default, fields with empty values 739 // are omitted from API requests. See 740 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 741 NullFields []string `json:"-"` 742 } 743 744 func (s *GoogleMapsPlacesV1ContextualContent) MarshalJSON() ([]byte, error) { 745 type NoMethod GoogleMapsPlacesV1ContextualContent 746 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 747 } 748 749 // GoogleMapsPlacesV1ContextualContentJustification: Experimental: See 750 // https://developers.google.com/maps/documentation/places/web-service/experimental/places-generative 751 // for more details. Justifications for the place. Justifications answers the 752 // question of why a place could interest an end user. 753 type GoogleMapsPlacesV1ContextualContentJustification struct { 754 // BusinessAvailabilityAttributesJustification: Experimental: See 755 // https://developers.google.com/maps/documentation/places/web-service/experimental/places-generative 756 // for more details. 757 BusinessAvailabilityAttributesJustification *GoogleMapsPlacesV1ContextualContentJustificationBusinessAvailabilityAttributesJustification `json:"businessAvailabilityAttributesJustification,omitempty"` 758 // ReviewJustification: Experimental: See 759 // https://developers.google.com/maps/documentation/places/web-service/experimental/places-generative 760 // for more details. 761 ReviewJustification *GoogleMapsPlacesV1ContextualContentJustificationReviewJustification `json:"reviewJustification,omitempty"` 762 // ForceSendFields is a list of field names (e.g. 763 // "BusinessAvailabilityAttributesJustification") to unconditionally include in 764 // API requests. By default, fields with empty or default values are omitted 765 // from API requests. See 766 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 767 // details. 768 ForceSendFields []string `json:"-"` 769 // NullFields is a list of field names (e.g. 770 // "BusinessAvailabilityAttributesJustification") to include in API requests 771 // with the JSON null value. By default, fields with empty values are omitted 772 // from API requests. See 773 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 774 NullFields []string `json:"-"` 775 } 776 777 func (s *GoogleMapsPlacesV1ContextualContentJustification) MarshalJSON() ([]byte, error) { 778 type NoMethod GoogleMapsPlacesV1ContextualContentJustification 779 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 780 } 781 782 // GoogleMapsPlacesV1ContextualContentJustificationBusinessAvailabilityAttribute 783 // sJustification: Experimental: See 784 // https://developers.google.com/maps/documentation/places/web-service/experimental/places-generative 785 // for more details. BusinessAvailabilityAttributes justifications. This shows 786 // some attributes a business has that could interest an end user. 787 type GoogleMapsPlacesV1ContextualContentJustificationBusinessAvailabilityAttributesJustification struct { 788 // Delivery: If a place provides delivery. 789 Delivery bool `json:"delivery,omitempty"` 790 // DineIn: If a place provides dine-in. 791 DineIn bool `json:"dineIn,omitempty"` 792 // Takeout: If a place provides takeout. 793 Takeout bool `json:"takeout,omitempty"` 794 // ForceSendFields is a list of field names (e.g. "Delivery") to 795 // unconditionally include in API requests. By default, fields with empty or 796 // default values are omitted from API requests. See 797 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 798 // details. 799 ForceSendFields []string `json:"-"` 800 // NullFields is a list of field names (e.g. "Delivery") to include in API 801 // requests with the JSON null value. By default, fields with empty values are 802 // omitted from API requests. See 803 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 804 NullFields []string `json:"-"` 805 } 806 807 func (s *GoogleMapsPlacesV1ContextualContentJustificationBusinessAvailabilityAttributesJustification) MarshalJSON() ([]byte, error) { 808 type NoMethod GoogleMapsPlacesV1ContextualContentJustificationBusinessAvailabilityAttributesJustification 809 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 810 } 811 812 // GoogleMapsPlacesV1ContextualContentJustificationReviewJustification: 813 // Experimental: See 814 // https://developers.google.com/maps/documentation/places/web-service/experimental/places-generative 815 // for more details. User review justifications. This highlights a section of 816 // the user review that would interest an end user. For instance, if the search 817 // query is "firewood pizza", the review justification highlights the text 818 // relevant to the search query. 819 type GoogleMapsPlacesV1ContextualContentJustificationReviewJustification struct { 820 HighlightedText *GoogleMapsPlacesV1ContextualContentJustificationReviewJustificationHighlightedText `json:"highlightedText,omitempty"` 821 // Review: The review that the highlighted text is generated from. 822 Review *GoogleMapsPlacesV1Review `json:"review,omitempty"` 823 // ForceSendFields is a list of field names (e.g. "HighlightedText") to 824 // unconditionally include in API requests. By default, fields with empty or 825 // default values are omitted from API requests. See 826 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 827 // details. 828 ForceSendFields []string `json:"-"` 829 // NullFields is a list of field names (e.g. "HighlightedText") to include in 830 // API requests with the JSON null value. By default, fields with empty values 831 // are omitted from API requests. See 832 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 833 NullFields []string `json:"-"` 834 } 835 836 func (s *GoogleMapsPlacesV1ContextualContentJustificationReviewJustification) MarshalJSON() ([]byte, error) { 837 type NoMethod GoogleMapsPlacesV1ContextualContentJustificationReviewJustification 838 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 839 } 840 841 // GoogleMapsPlacesV1ContextualContentJustificationReviewJustificationHighlighte 842 // dText: The text highlighted by the justification. This is a subset of the 843 // review itself. The exact word to highlight is marked by the 844 // HighlightedTextRange. There could be several words in the text being 845 // highlighted. 846 type GoogleMapsPlacesV1ContextualContentJustificationReviewJustificationHighlightedText struct { 847 // HighlightedTextRanges: The list of the ranges of the highlighted text. 848 HighlightedTextRanges []*GoogleMapsPlacesV1ContextualContentJustificationReviewJustificationHighlightedTextHighlightedTextRange `json:"highlightedTextRanges,omitempty"` 849 Text string `json:"text,omitempty"` 850 // ForceSendFields is a list of field names (e.g. "HighlightedTextRanges") to 851 // unconditionally include in API requests. By default, fields with empty or 852 // default values are omitted from API requests. See 853 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 854 // details. 855 ForceSendFields []string `json:"-"` 856 // NullFields is a list of field names (e.g. "HighlightedTextRanges") to 857 // include in API requests with the JSON null value. By default, fields with 858 // empty values are omitted from API requests. See 859 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 860 NullFields []string `json:"-"` 861 } 862 863 func (s *GoogleMapsPlacesV1ContextualContentJustificationReviewJustificationHighlightedText) MarshalJSON() ([]byte, error) { 864 type NoMethod GoogleMapsPlacesV1ContextualContentJustificationReviewJustificationHighlightedText 865 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 866 } 867 868 // GoogleMapsPlacesV1ContextualContentJustificationReviewJustificationHighlighte 869 // dTextHighlightedTextRange: The range of highlighted text. 870 type GoogleMapsPlacesV1ContextualContentJustificationReviewJustificationHighlightedTextHighlightedTextRange struct { 871 EndIndex int64 `json:"endIndex,omitempty"` 872 StartIndex int64 `json:"startIndex,omitempty"` 873 // ForceSendFields is a list of field names (e.g. "EndIndex") to 874 // unconditionally include in API requests. By default, fields with empty or 875 // default values are omitted from API requests. See 876 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 877 // details. 878 ForceSendFields []string `json:"-"` 879 // NullFields is a list of field names (e.g. "EndIndex") to include in API 880 // requests with the JSON null value. By default, fields with empty values are 881 // omitted from API requests. See 882 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 883 NullFields []string `json:"-"` 884 } 885 886 func (s *GoogleMapsPlacesV1ContextualContentJustificationReviewJustificationHighlightedTextHighlightedTextRange) MarshalJSON() ([]byte, error) { 887 type NoMethod GoogleMapsPlacesV1ContextualContentJustificationReviewJustificationHighlightedTextHighlightedTextRange 888 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 889 } 890 891 // GoogleMapsPlacesV1EVChargeOptions: Information about the EV Charge Station 892 // hosted in Place. Terminology follows 893 // https://afdc.energy.gov/fuels/electricity_infrastructure.html One port could 894 // charge one car at a time. One port has one or more connectors. One station 895 // has one or more ports. 896 type GoogleMapsPlacesV1EVChargeOptions struct { 897 // ConnectorAggregation: A list of EV charging connector aggregations that 898 // contain connectors of the same type and same charge rate. 899 ConnectorAggregation []*GoogleMapsPlacesV1EVChargeOptionsConnectorAggregation `json:"connectorAggregation,omitempty"` 900 // ConnectorCount: Number of connectors at this station. However, because some 901 // ports can have multiple connectors but only be able to charge one car at a 902 // time (e.g.) the number of connectors may be greater than the total number of 903 // cars which can charge simultaneously. 904 ConnectorCount int64 `json:"connectorCount,omitempty"` 905 // ForceSendFields is a list of field names (e.g. "ConnectorAggregation") to 906 // unconditionally include in API requests. By default, fields with empty or 907 // default values are omitted from API requests. See 908 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 909 // details. 910 ForceSendFields []string `json:"-"` 911 // NullFields is a list of field names (e.g. "ConnectorAggregation") to include 912 // in API requests with the JSON null value. By default, fields with empty 913 // values are omitted from API requests. See 914 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 915 NullFields []string `json:"-"` 916 } 917 918 func (s *GoogleMapsPlacesV1EVChargeOptions) MarshalJSON() ([]byte, error) { 919 type NoMethod GoogleMapsPlacesV1EVChargeOptions 920 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 921 } 922 923 // GoogleMapsPlacesV1EVChargeOptionsConnectorAggregation: EV charging 924 // information grouped by [type, max_charge_rate_kw]. Shows EV charge 925 // aggregation of connectors that have the same type and max charge rate in kw. 926 type GoogleMapsPlacesV1EVChargeOptionsConnectorAggregation struct { 927 // AvailabilityLastUpdateTime: The timestamp when the connector availability 928 // information in this aggregation was last updated. 929 AvailabilityLastUpdateTime string `json:"availabilityLastUpdateTime,omitempty"` 930 // AvailableCount: Number of connectors in this aggregation that are currently 931 // available. 932 AvailableCount int64 `json:"availableCount,omitempty"` 933 // Count: Number of connectors in this aggregation. 934 Count int64 `json:"count,omitempty"` 935 // MaxChargeRateKw: The static max charging rate in kw of each connector in the 936 // aggregation. 937 MaxChargeRateKw float64 `json:"maxChargeRateKw,omitempty"` 938 // OutOfServiceCount: Number of connectors in this aggregation that are 939 // currently out of service. 940 OutOfServiceCount int64 `json:"outOfServiceCount,omitempty"` 941 // Type: The connector type of this aggregation. 942 // 943 // Possible values: 944 // "EV_CONNECTOR_TYPE_UNSPECIFIED" - Unspecified connector. 945 // "EV_CONNECTOR_TYPE_OTHER" - Other connector types. 946 // "EV_CONNECTOR_TYPE_J1772" - J1772 type 1 connector. 947 // "EV_CONNECTOR_TYPE_TYPE_2" - IEC 62196 type 2 connector. Often referred to 948 // as MENNEKES. 949 // "EV_CONNECTOR_TYPE_CHADEMO" - CHAdeMO type connector. 950 // "EV_CONNECTOR_TYPE_CCS_COMBO_1" - Combined Charging System (AC and DC). 951 // Based on SAE. Type-1 J-1772 connector 952 // "EV_CONNECTOR_TYPE_CCS_COMBO_2" - Combined Charging System (AC and DC). 953 // Based on Type-2 Mennekes connector 954 // "EV_CONNECTOR_TYPE_TESLA" - The generic TESLA connector. This is NACS in 955 // the North America but can be non-NACS in other parts of the world (e.g. CCS 956 // Combo 2 (CCS2) or GB/T). This value is less representative of an actual 957 // connector type, and more represents the ability to charge a Tesla brand 958 // vehicle at a Tesla owned charging station. 959 // "EV_CONNECTOR_TYPE_UNSPECIFIED_GB_T" - GB/T type corresponds to the GB/T 960 // standard in China. This type covers all GB_T types. 961 // "EV_CONNECTOR_TYPE_UNSPECIFIED_WALL_OUTLET" - Unspecified wall outlet. 962 Type string `json:"type,omitempty"` 963 // ForceSendFields is a list of field names (e.g. "AvailabilityLastUpdateTime") 964 // to unconditionally include in API requests. By default, fields with empty or 965 // default values are omitted from API requests. See 966 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 967 // details. 968 ForceSendFields []string `json:"-"` 969 // NullFields is a list of field names (e.g. "AvailabilityLastUpdateTime") to 970 // include in API requests with the JSON null value. By default, fields with 971 // empty values are omitted from API requests. See 972 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 973 NullFields []string `json:"-"` 974 } 975 976 func (s *GoogleMapsPlacesV1EVChargeOptionsConnectorAggregation) MarshalJSON() ([]byte, error) { 977 type NoMethod GoogleMapsPlacesV1EVChargeOptionsConnectorAggregation 978 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 979 } 980 981 func (s *GoogleMapsPlacesV1EVChargeOptionsConnectorAggregation) UnmarshalJSON(data []byte) error { 982 type NoMethod GoogleMapsPlacesV1EVChargeOptionsConnectorAggregation 983 var s1 struct { 984 MaxChargeRateKw gensupport.JSONFloat64 `json:"maxChargeRateKw"` 985 *NoMethod 986 } 987 s1.NoMethod = (*NoMethod)(s) 988 if err := json.Unmarshal(data, &s1); err != nil { 989 return err 990 } 991 s.MaxChargeRateKw = float64(s1.MaxChargeRateKw) 992 return nil 993 } 994 995 // GoogleMapsPlacesV1FuelOptions: The most recent information about fuel 996 // options in a gas station. This information is updated regularly. 997 type GoogleMapsPlacesV1FuelOptions struct { 998 // FuelPrices: The last known fuel price for each type of fuel this station 999 // has. There is one entry per fuel type this station has. Order is not 1000 // important. 1001 FuelPrices []*GoogleMapsPlacesV1FuelOptionsFuelPrice `json:"fuelPrices,omitempty"` 1002 // ForceSendFields is a list of field names (e.g. "FuelPrices") to 1003 // unconditionally include in API requests. By default, fields with empty or 1004 // default values are omitted from API requests. See 1005 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1006 // details. 1007 ForceSendFields []string `json:"-"` 1008 // NullFields is a list of field names (e.g. "FuelPrices") to include in API 1009 // requests with the JSON null value. By default, fields with empty values are 1010 // omitted from API requests. See 1011 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1012 NullFields []string `json:"-"` 1013 } 1014 1015 func (s *GoogleMapsPlacesV1FuelOptions) MarshalJSON() ([]byte, error) { 1016 type NoMethod GoogleMapsPlacesV1FuelOptions 1017 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1018 } 1019 1020 // GoogleMapsPlacesV1FuelOptionsFuelPrice: Fuel price information for a given 1021 // type. 1022 type GoogleMapsPlacesV1FuelOptionsFuelPrice struct { 1023 // Price: The price of the fuel. 1024 Price *GoogleTypeMoney `json:"price,omitempty"` 1025 // Type: The type of fuel. 1026 // 1027 // Possible values: 1028 // "FUEL_TYPE_UNSPECIFIED" - Unspecified fuel type. 1029 // "DIESEL" - Diesel fuel. 1030 // "REGULAR_UNLEADED" - Regular unleaded. 1031 // "MIDGRADE" - Midgrade. 1032 // "PREMIUM" - Premium. 1033 // "SP91" - SP 91. 1034 // "SP91_E10" - SP 91 E10. 1035 // "SP92" - SP 92. 1036 // "SP95" - SP 95. 1037 // "SP95_E10" - SP95 E10. 1038 // "SP98" - SP 98. 1039 // "SP99" - SP 99. 1040 // "SP100" - SP 100. 1041 // "LPG" - LPG. 1042 // "E80" - E 80. 1043 // "E85" - E 85. 1044 // "METHANE" - Methane. 1045 // "BIO_DIESEL" - Bio-diesel. 1046 // "TRUCK_DIESEL" - Truck diesel. 1047 Type string `json:"type,omitempty"` 1048 // UpdateTime: The time the fuel price was last updated. 1049 UpdateTime string `json:"updateTime,omitempty"` 1050 // ForceSendFields is a list of field names (e.g. "Price") to unconditionally 1051 // include in API requests. By default, fields with empty or default values are 1052 // omitted from API requests. See 1053 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1054 // details. 1055 ForceSendFields []string `json:"-"` 1056 // NullFields is a list of field names (e.g. "Price") to include in API 1057 // requests with the JSON null value. By default, fields with empty values are 1058 // omitted from API requests. See 1059 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1060 NullFields []string `json:"-"` 1061 } 1062 1063 func (s *GoogleMapsPlacesV1FuelOptionsFuelPrice) MarshalJSON() ([]byte, error) { 1064 type NoMethod GoogleMapsPlacesV1FuelOptionsFuelPrice 1065 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1066 } 1067 1068 // GoogleMapsPlacesV1Photo: Information about a photo of a place. 1069 type GoogleMapsPlacesV1Photo struct { 1070 // AuthorAttributions: This photo's authors. 1071 AuthorAttributions []*GoogleMapsPlacesV1AuthorAttribution `json:"authorAttributions,omitempty"` 1072 // HeightPx: The maximum available height, in pixels. 1073 HeightPx int64 `json:"heightPx,omitempty"` 1074 // Name: Identifier. A reference representing this place photo which may be 1075 // used to look up this place photo again (also called the API "resource" name: 1076 // `places/{place_id}/photos/{photo}`). 1077 Name string `json:"name,omitempty"` 1078 // WidthPx: The maximum available width, in pixels. 1079 WidthPx int64 `json:"widthPx,omitempty"` 1080 // ForceSendFields is a list of field names (e.g. "AuthorAttributions") to 1081 // unconditionally include in API requests. By default, fields with empty or 1082 // default values are omitted from API requests. See 1083 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1084 // details. 1085 ForceSendFields []string `json:"-"` 1086 // NullFields is a list of field names (e.g. "AuthorAttributions") to include 1087 // in API requests with the JSON null value. By default, fields with empty 1088 // values are omitted from API requests. See 1089 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1090 NullFields []string `json:"-"` 1091 } 1092 1093 func (s *GoogleMapsPlacesV1Photo) MarshalJSON() ([]byte, error) { 1094 type NoMethod GoogleMapsPlacesV1Photo 1095 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1096 } 1097 1098 // GoogleMapsPlacesV1PhotoMedia: A photo media from Places API. 1099 type GoogleMapsPlacesV1PhotoMedia struct { 1100 // Name: The resource name of a photo media in the format: 1101 // `places/{place_id}/photos/{photo_reference}/media`. 1102 Name string `json:"name,omitempty"` 1103 // PhotoUri: A short-lived uri that can be used to render the photo. 1104 PhotoUri string `json:"photoUri,omitempty"` 1105 1106 // ServerResponse contains the HTTP response code and headers from the server. 1107 googleapi.ServerResponse `json:"-"` 1108 // ForceSendFields is a list of field names (e.g. "Name") to unconditionally 1109 // include in API requests. By default, fields with empty or default values are 1110 // omitted from API requests. See 1111 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1112 // details. 1113 ForceSendFields []string `json:"-"` 1114 // NullFields is a list of field names (e.g. "Name") to include in API requests 1115 // with the JSON null value. By default, fields with empty values are omitted 1116 // from API requests. See 1117 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1118 NullFields []string `json:"-"` 1119 } 1120 1121 func (s *GoogleMapsPlacesV1PhotoMedia) MarshalJSON() ([]byte, error) { 1122 type NoMethod GoogleMapsPlacesV1PhotoMedia 1123 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1124 } 1125 1126 // GoogleMapsPlacesV1Place: All the information representing a Place. 1127 type GoogleMapsPlacesV1Place struct { 1128 // AccessibilityOptions: Information about the accessibility options a place 1129 // offers. 1130 AccessibilityOptions *GoogleMapsPlacesV1PlaceAccessibilityOptions `json:"accessibilityOptions,omitempty"` 1131 // AddressComponents: Repeated components for each locality level. Note the 1132 // following facts about the address_components[] array: - The array of address 1133 // components may contain more components than the formatted_address. - The 1134 // array does not necessarily include all the political entities that contain 1135 // an address, apart from those included in the formatted_address. To retrieve 1136 // all the political entities that contain a specific address, you should use 1137 // reverse geocoding, passing the latitude/longitude of the address as a 1138 // parameter to the request. - The format of the response is not guaranteed to 1139 // remain the same between requests. In particular, the number of 1140 // address_components varies based on the address requested and can change over 1141 // time for the same address. A component can change position in the array. The 1142 // type of the component can change. A particular component may be missing in a 1143 // later response. 1144 AddressComponents []*GoogleMapsPlacesV1PlaceAddressComponent `json:"addressComponents,omitempty"` 1145 // AdrFormatAddress: The place's address in adr microformat: 1146 // http://microformats.org/wiki/adr. 1147 AdrFormatAddress string `json:"adrFormatAddress,omitempty"` 1148 // AllowsDogs: Place allows dogs. 1149 AllowsDogs bool `json:"allowsDogs,omitempty"` 1150 // AreaSummary: Experimental: See 1151 // https://developers.google.com/maps/documentation/places/web-service/experimental/places-generative 1152 // for more details. AI-generated summary of the area that the place is in. 1153 AreaSummary *GoogleMapsPlacesV1PlaceAreaSummary `json:"areaSummary,omitempty"` 1154 // Attributions: A set of data provider that must be shown with this result. 1155 Attributions []*GoogleMapsPlacesV1PlaceAttribution `json:"attributions,omitempty"` 1156 // BusinessStatus: The business status for the place. 1157 // 1158 // Possible values: 1159 // "BUSINESS_STATUS_UNSPECIFIED" - Default value. This value is unused. 1160 // "OPERATIONAL" - The establishment is operational, not necessarily open 1161 // now. 1162 // "CLOSED_TEMPORARILY" - The establishment is temporarily closed. 1163 // "CLOSED_PERMANENTLY" - The establishment is permanently closed. 1164 BusinessStatus string `json:"businessStatus,omitempty"` 1165 // CurbsidePickup: Specifies if the business supports curbside pickup. 1166 CurbsidePickup bool `json:"curbsidePickup,omitempty"` 1167 // CurrentOpeningHours: The hours of operation for the next seven days 1168 // (including today). The time period starts at midnight on the date of the 1169 // request and ends at 11:59 pm six days later. This field includes the 1170 // special_days subfield of all hours, set for dates that have exceptional 1171 // hours. 1172 CurrentOpeningHours *GoogleMapsPlacesV1PlaceOpeningHours `json:"currentOpeningHours,omitempty"` 1173 // CurrentSecondaryOpeningHours: Contains an array of entries for the next 1174 // seven days including information about secondary hours of a business. 1175 // Secondary hours are different from a business's main hours. For example, a 1176 // restaurant can specify drive through hours or delivery hours as its 1177 // secondary hours. This field populates the type subfield, which draws from a 1178 // predefined list of opening hours types (such as DRIVE_THROUGH, PICKUP, or 1179 // TAKEOUT) based on the types of the place. This field includes the 1180 // special_days subfield of all hours, set for dates that have exceptional 1181 // hours. 1182 CurrentSecondaryOpeningHours []*GoogleMapsPlacesV1PlaceOpeningHours `json:"currentSecondaryOpeningHours,omitempty"` 1183 // Delivery: Specifies if the business supports delivery. 1184 Delivery bool `json:"delivery,omitempty"` 1185 // DineIn: Specifies if the business supports indoor or outdoor seating 1186 // options. 1187 DineIn bool `json:"dineIn,omitempty"` 1188 // DisplayName: The localized name of the place, suitable as a short 1189 // human-readable description. For example, "Google Sydney", "Starbucks", 1190 // "Pyrmont", etc. 1191 DisplayName *GoogleTypeLocalizedText `json:"displayName,omitempty"` 1192 // EditorialSummary: Contains a summary of the place. A summary is comprised of 1193 // a textual overview, and also includes the language code for these if 1194 // applicable. Summary text must be presented as-is and can not be modified or 1195 // altered. 1196 EditorialSummary *GoogleTypeLocalizedText `json:"editorialSummary,omitempty"` 1197 // EvChargeOptions: Information of ev charging options. 1198 EvChargeOptions *GoogleMapsPlacesV1EVChargeOptions `json:"evChargeOptions,omitempty"` 1199 // FormattedAddress: A full, human-readable address for this place. 1200 FormattedAddress string `json:"formattedAddress,omitempty"` 1201 // FuelOptions: The most recent information about fuel options in a gas 1202 // station. This information is updated regularly. 1203 FuelOptions *GoogleMapsPlacesV1FuelOptions `json:"fuelOptions,omitempty"` 1204 // GenerativeSummary: Experimental: See 1205 // https://developers.google.com/maps/documentation/places/web-service/experimental/places-generative 1206 // for more details. AI-generated summary of the place. 1207 GenerativeSummary *GoogleMapsPlacesV1PlaceGenerativeSummary `json:"generativeSummary,omitempty"` 1208 // GoodForChildren: Place is good for children. 1209 GoodForChildren bool `json:"goodForChildren,omitempty"` 1210 // GoodForGroups: Place accommodates groups. 1211 GoodForGroups bool `json:"goodForGroups,omitempty"` 1212 // GoodForWatchingSports: Place is suitable for watching sports. 1213 GoodForWatchingSports bool `json:"goodForWatchingSports,omitempty"` 1214 // GoogleMapsUri: A URL providing more information about this place. 1215 GoogleMapsUri string `json:"googleMapsUri,omitempty"` 1216 // IconBackgroundColor: Background color for icon_mask in hex format, e.g. 1217 // #909CE1. 1218 IconBackgroundColor string `json:"iconBackgroundColor,omitempty"` 1219 // IconMaskBaseUri: A truncated URL to an icon mask. User can access different 1220 // icon type by appending type suffix to the end (eg, ".svg" or ".png"). 1221 IconMaskBaseUri string `json:"iconMaskBaseUri,omitempty"` 1222 // Id: The unique identifier of a place. 1223 Id string `json:"id,omitempty"` 1224 // InternationalPhoneNumber: A human-readable phone number for the place, in 1225 // international format. 1226 InternationalPhoneNumber string `json:"internationalPhoneNumber,omitempty"` 1227 // LiveMusic: Place provides live music. 1228 LiveMusic bool `json:"liveMusic,omitempty"` 1229 // Location: The position of this place. 1230 Location *GoogleTypeLatLng `json:"location,omitempty"` 1231 // MenuForChildren: Place has a children's menu. 1232 MenuForChildren bool `json:"menuForChildren,omitempty"` 1233 // Name: This Place's resource name, in `places/{place_id}` format. Can be used 1234 // to look up the Place. 1235 Name string `json:"name,omitempty"` 1236 // NationalPhoneNumber: A human-readable phone number for the place, in 1237 // national format. 1238 NationalPhoneNumber string `json:"nationalPhoneNumber,omitempty"` 1239 // OutdoorSeating: Place provides outdoor seating. 1240 OutdoorSeating bool `json:"outdoorSeating,omitempty"` 1241 // ParkingOptions: Options of parking provided by the place. 1242 ParkingOptions *GoogleMapsPlacesV1PlaceParkingOptions `json:"parkingOptions,omitempty"` 1243 // PaymentOptions: Payment options the place accepts. If a payment option data 1244 // is not available, the payment option field will be unset. 1245 PaymentOptions *GoogleMapsPlacesV1PlacePaymentOptions `json:"paymentOptions,omitempty"` 1246 // Photos: Information (including references) about photos of this place. A 1247 // maximum of 10 photos can be returned. 1248 Photos []*GoogleMapsPlacesV1Photo `json:"photos,omitempty"` 1249 // PlusCode: Plus code of the place location lat/long. 1250 PlusCode *GoogleMapsPlacesV1PlacePlusCode `json:"plusCode,omitempty"` 1251 // PriceLevel: Price level of the place. 1252 // 1253 // Possible values: 1254 // "PRICE_LEVEL_UNSPECIFIED" - Place price level is unspecified or unknown. 1255 // "PRICE_LEVEL_FREE" - Place provides free services. 1256 // "PRICE_LEVEL_INEXPENSIVE" - Place provides inexpensive services. 1257 // "PRICE_LEVEL_MODERATE" - Place provides moderately priced services. 1258 // "PRICE_LEVEL_EXPENSIVE" - Place provides expensive services. 1259 // "PRICE_LEVEL_VERY_EXPENSIVE" - Place provides very expensive services. 1260 PriceLevel string `json:"priceLevel,omitempty"` 1261 // PrimaryType: The primary type of the given result. This type must one of the 1262 // Places API supported types. For example, "restaurant", "cafe", "airport", 1263 // etc. A place can only have a single primary type. For the complete list of 1264 // possible values, see Table A and Table B at 1265 // https://developers.google.com/maps/documentation/places/web-service/place-types 1266 PrimaryType string `json:"primaryType,omitempty"` 1267 // PrimaryTypeDisplayName: The display name of the primary type, localized to 1268 // the request language if applicable. For the complete list of possible 1269 // values, see Table A and Table B at 1270 // https://developers.google.com/maps/documentation/places/web-service/place-types 1271 PrimaryTypeDisplayName *GoogleTypeLocalizedText `json:"primaryTypeDisplayName,omitempty"` 1272 // Rating: A rating between 1.0 and 5.0, based on user reviews of this place. 1273 Rating float64 `json:"rating,omitempty"` 1274 // RegularOpeningHours: The regular hours of operation. 1275 RegularOpeningHours *GoogleMapsPlacesV1PlaceOpeningHours `json:"regularOpeningHours,omitempty"` 1276 // RegularSecondaryOpeningHours: Contains an array of entries for information 1277 // about regular secondary hours of a business. Secondary hours are different 1278 // from a business's main hours. For example, a restaurant can specify drive 1279 // through hours or delivery hours as its secondary hours. This field populates 1280 // the type subfield, which draws from a predefined list of opening hours types 1281 // (such as DRIVE_THROUGH, PICKUP, or TAKEOUT) based on the types of the place. 1282 RegularSecondaryOpeningHours []*GoogleMapsPlacesV1PlaceOpeningHours `json:"regularSecondaryOpeningHours,omitempty"` 1283 // Reservable: Specifies if the place supports reservations. 1284 Reservable bool `json:"reservable,omitempty"` 1285 // Restroom: Place has restroom. 1286 Restroom bool `json:"restroom,omitempty"` 1287 // Reviews: List of reviews about this place, sorted by relevance. A maximum of 1288 // 5 reviews can be returned. 1289 Reviews []*GoogleMapsPlacesV1Review `json:"reviews,omitempty"` 1290 // ServesBeer: Specifies if the place serves beer. 1291 ServesBeer bool `json:"servesBeer,omitempty"` 1292 // ServesBreakfast: Specifies if the place serves breakfast. 1293 ServesBreakfast bool `json:"servesBreakfast,omitempty"` 1294 // ServesBrunch: Specifies if the place serves brunch. 1295 ServesBrunch bool `json:"servesBrunch,omitempty"` 1296 // ServesCocktails: Place serves cocktails. 1297 ServesCocktails bool `json:"servesCocktails,omitempty"` 1298 // ServesCoffee: Place serves coffee. 1299 ServesCoffee bool `json:"servesCoffee,omitempty"` 1300 // ServesDessert: Place serves dessert. 1301 ServesDessert bool `json:"servesDessert,omitempty"` 1302 // ServesDinner: Specifies if the place serves dinner. 1303 ServesDinner bool `json:"servesDinner,omitempty"` 1304 // ServesLunch: Specifies if the place serves lunch. 1305 ServesLunch bool `json:"servesLunch,omitempty"` 1306 // ServesVegetarianFood: Specifies if the place serves vegetarian food. 1307 ServesVegetarianFood bool `json:"servesVegetarianFood,omitempty"` 1308 // ServesWine: Specifies if the place serves wine. 1309 ServesWine bool `json:"servesWine,omitempty"` 1310 // ShortFormattedAddress: A short, human-readable address for this place. 1311 ShortFormattedAddress string `json:"shortFormattedAddress,omitempty"` 1312 // SubDestinations: A list of sub destinations related to the place. 1313 SubDestinations []*GoogleMapsPlacesV1PlaceSubDestination `json:"subDestinations,omitempty"` 1314 // Takeout: Specifies if the business supports takeout. 1315 Takeout bool `json:"takeout,omitempty"` 1316 // Types: A set of type tags for this result. For example, "political" and 1317 // "locality". For the complete list of possible values, see Table A and Table 1318 // B at 1319 // https://developers.google.com/maps/documentation/places/web-service/place-types 1320 Types []string `json:"types,omitempty"` 1321 // UserRatingCount: The total number of reviews (with or without text) for this 1322 // place. 1323 UserRatingCount int64 `json:"userRatingCount,omitempty"` 1324 // UtcOffsetMinutes: Number of minutes this place's timezone is currently 1325 // offset from UTC. This is expressed in minutes to support timezones that are 1326 // offset by fractions of an hour, e.g. X hours and 15 minutes. 1327 UtcOffsetMinutes int64 `json:"utcOffsetMinutes,omitempty"` 1328 // Viewport: A viewport suitable for displaying the place on an average-sized 1329 // map. 1330 Viewport *GoogleGeoTypeViewport `json:"viewport,omitempty"` 1331 // WebsiteUri: The authoritative website for this place, e.g. a business' 1332 // homepage. Note that for places that are part of a chain (e.g. an IKEA 1333 // store), this will usually be the website for the individual store, not the 1334 // overall chain. 1335 WebsiteUri string `json:"websiteUri,omitempty"` 1336 1337 // ServerResponse contains the HTTP response code and headers from the server. 1338 googleapi.ServerResponse `json:"-"` 1339 // ForceSendFields is a list of field names (e.g. "AccessibilityOptions") to 1340 // unconditionally include in API requests. By default, fields with empty or 1341 // default values are omitted from API requests. See 1342 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1343 // details. 1344 ForceSendFields []string `json:"-"` 1345 // NullFields is a list of field names (e.g. "AccessibilityOptions") to include 1346 // in API requests with the JSON null value. By default, fields with empty 1347 // values are omitted from API requests. See 1348 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1349 NullFields []string `json:"-"` 1350 } 1351 1352 func (s *GoogleMapsPlacesV1Place) MarshalJSON() ([]byte, error) { 1353 type NoMethod GoogleMapsPlacesV1Place 1354 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1355 } 1356 1357 func (s *GoogleMapsPlacesV1Place) UnmarshalJSON(data []byte) error { 1358 type NoMethod GoogleMapsPlacesV1Place 1359 var s1 struct { 1360 Rating gensupport.JSONFloat64 `json:"rating"` 1361 *NoMethod 1362 } 1363 s1.NoMethod = (*NoMethod)(s) 1364 if err := json.Unmarshal(data, &s1); err != nil { 1365 return err 1366 } 1367 s.Rating = float64(s1.Rating) 1368 return nil 1369 } 1370 1371 // GoogleMapsPlacesV1PlaceAccessibilityOptions: Information about the 1372 // accessibility options a place offers. 1373 type GoogleMapsPlacesV1PlaceAccessibilityOptions struct { 1374 // WheelchairAccessibleEntrance: Places has wheelchair accessible entrance. 1375 WheelchairAccessibleEntrance bool `json:"wheelchairAccessibleEntrance,omitempty"` 1376 // WheelchairAccessibleParking: Place offers wheelchair accessible parking. 1377 WheelchairAccessibleParking bool `json:"wheelchairAccessibleParking,omitempty"` 1378 // WheelchairAccessibleRestroom: Place has wheelchair accessible restroom. 1379 WheelchairAccessibleRestroom bool `json:"wheelchairAccessibleRestroom,omitempty"` 1380 // WheelchairAccessibleSeating: Place has wheelchair accessible seating. 1381 WheelchairAccessibleSeating bool `json:"wheelchairAccessibleSeating,omitempty"` 1382 // ForceSendFields is a list of field names (e.g. 1383 // "WheelchairAccessibleEntrance") to unconditionally include in API requests. 1384 // By default, fields with empty or default values are omitted from API 1385 // requests. See https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields 1386 // for more details. 1387 ForceSendFields []string `json:"-"` 1388 // NullFields is a list of field names (e.g. "WheelchairAccessibleEntrance") to 1389 // include in API requests with the JSON null value. By default, fields with 1390 // empty values are omitted from API requests. See 1391 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1392 NullFields []string `json:"-"` 1393 } 1394 1395 func (s *GoogleMapsPlacesV1PlaceAccessibilityOptions) MarshalJSON() ([]byte, error) { 1396 type NoMethod GoogleMapsPlacesV1PlaceAccessibilityOptions 1397 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1398 } 1399 1400 // GoogleMapsPlacesV1PlaceAddressComponent: The structured components that form 1401 // the formatted address, if this information is available. 1402 type GoogleMapsPlacesV1PlaceAddressComponent struct { 1403 // LanguageCode: The language used to format this components, in CLDR notation. 1404 LanguageCode string `json:"languageCode,omitempty"` 1405 // LongText: The full text description or name of the address component. For 1406 // example, an address component for the country Australia may have a long_name 1407 // of "Australia". 1408 LongText string `json:"longText,omitempty"` 1409 // ShortText: An abbreviated textual name for the address component, if 1410 // available. For example, an address component for the country of Australia 1411 // may have a short_name of "AU". 1412 ShortText string `json:"shortText,omitempty"` 1413 // Types: An array indicating the type(s) of the address component. 1414 Types []string `json:"types,omitempty"` 1415 // ForceSendFields is a list of field names (e.g. "LanguageCode") to 1416 // unconditionally include in API requests. By default, fields with empty or 1417 // default values are omitted from API requests. See 1418 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1419 // details. 1420 ForceSendFields []string `json:"-"` 1421 // NullFields is a list of field names (e.g. "LanguageCode") to include in API 1422 // requests with the JSON null value. By default, fields with empty values are 1423 // omitted from API requests. See 1424 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1425 NullFields []string `json:"-"` 1426 } 1427 1428 func (s *GoogleMapsPlacesV1PlaceAddressComponent) MarshalJSON() ([]byte, error) { 1429 type NoMethod GoogleMapsPlacesV1PlaceAddressComponent 1430 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1431 } 1432 1433 // GoogleMapsPlacesV1PlaceAreaSummary: Experimental: See 1434 // https://developers.google.com/maps/documentation/places/web-service/experimental/places-generative 1435 // for more details. AI-generated summary of the area that the place is in. 1436 type GoogleMapsPlacesV1PlaceAreaSummary struct { 1437 // ContentBlocks: Content blocks that compose the area summary. Each block has 1438 // a separate topic about the area. 1439 ContentBlocks []*GoogleMapsPlacesV1ContentBlock `json:"contentBlocks,omitempty"` 1440 // ForceSendFields is a list of field names (e.g. "ContentBlocks") to 1441 // unconditionally include in API requests. By default, fields with empty or 1442 // default values are omitted from API requests. See 1443 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1444 // details. 1445 ForceSendFields []string `json:"-"` 1446 // NullFields is a list of field names (e.g. "ContentBlocks") to include in API 1447 // requests with the JSON null value. By default, fields with empty values are 1448 // omitted from API requests. See 1449 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1450 NullFields []string `json:"-"` 1451 } 1452 1453 func (s *GoogleMapsPlacesV1PlaceAreaSummary) MarshalJSON() ([]byte, error) { 1454 type NoMethod GoogleMapsPlacesV1PlaceAreaSummary 1455 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1456 } 1457 1458 // GoogleMapsPlacesV1PlaceAttribution: Information about data providers of this 1459 // place. 1460 type GoogleMapsPlacesV1PlaceAttribution struct { 1461 // Provider: Name of the Place's data provider. 1462 Provider string `json:"provider,omitempty"` 1463 // ProviderUri: URI to the Place's data provider. 1464 ProviderUri string `json:"providerUri,omitempty"` 1465 // ForceSendFields is a list of field names (e.g. "Provider") to 1466 // unconditionally include in API requests. By default, fields with empty or 1467 // default values are omitted from API requests. See 1468 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1469 // details. 1470 ForceSendFields []string `json:"-"` 1471 // NullFields is a list of field names (e.g. "Provider") to include in API 1472 // requests with the JSON null value. By default, fields with empty values are 1473 // omitted from API requests. See 1474 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1475 NullFields []string `json:"-"` 1476 } 1477 1478 func (s *GoogleMapsPlacesV1PlaceAttribution) MarshalJSON() ([]byte, error) { 1479 type NoMethod GoogleMapsPlacesV1PlaceAttribution 1480 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1481 } 1482 1483 // GoogleMapsPlacesV1PlaceGenerativeSummary: Experimental: See 1484 // https://developers.google.com/maps/documentation/places/web-service/experimental/places-generative 1485 // for more details. AI-generated summary of the place. 1486 type GoogleMapsPlacesV1PlaceGenerativeSummary struct { 1487 // Description: The detailed description of the place. 1488 Description *GoogleTypeLocalizedText `json:"description,omitempty"` 1489 // Overview: The overview of the place. 1490 Overview *GoogleTypeLocalizedText `json:"overview,omitempty"` 1491 // References: References that are used to generate the summary description. 1492 References *GoogleMapsPlacesV1References `json:"references,omitempty"` 1493 // ForceSendFields is a list of field names (e.g. "Description") to 1494 // unconditionally include in API requests. By default, fields with empty or 1495 // default values are omitted from API requests. See 1496 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1497 // details. 1498 ForceSendFields []string `json:"-"` 1499 // NullFields is a list of field names (e.g. "Description") to include in API 1500 // requests with the JSON null value. By default, fields with empty values are 1501 // omitted from API requests. See 1502 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1503 NullFields []string `json:"-"` 1504 } 1505 1506 func (s *GoogleMapsPlacesV1PlaceGenerativeSummary) MarshalJSON() ([]byte, error) { 1507 type NoMethod GoogleMapsPlacesV1PlaceGenerativeSummary 1508 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1509 } 1510 1511 // GoogleMapsPlacesV1PlaceOpeningHours: Information about business hour of the 1512 // place. 1513 type GoogleMapsPlacesV1PlaceOpeningHours struct { 1514 // OpenNow: Is this place open right now? Always present unless we lack 1515 // time-of-day or timezone data for these opening hours. 1516 OpenNow bool `json:"openNow,omitempty"` 1517 // Periods: The periods that this place is open during the week. The periods 1518 // are in chronological order, starting with Sunday in the place-local 1519 // timezone. An empty (but not absent) value indicates a place that is never 1520 // open, e.g. because it is closed temporarily for renovations. 1521 Periods []*GoogleMapsPlacesV1PlaceOpeningHoursPeriod `json:"periods,omitempty"` 1522 // SecondaryHoursType: A type string used to identify the type of secondary 1523 // hours. 1524 // 1525 // Possible values: 1526 // "SECONDARY_HOURS_TYPE_UNSPECIFIED" - Default value when secondary hour 1527 // type is not specified. 1528 // "DRIVE_THROUGH" - The drive-through hour for banks, restaurants, or 1529 // pharmacies. 1530 // "HAPPY_HOUR" - The happy hour. 1531 // "DELIVERY" - The delivery hour. 1532 // "TAKEOUT" - The takeout hour. 1533 // "KITCHEN" - The kitchen hour. 1534 // "BREAKFAST" - The breakfast hour. 1535 // "LUNCH" - The lunch hour. 1536 // "DINNER" - The dinner hour. 1537 // "BRUNCH" - The brunch hour. 1538 // "PICKUP" - The pickup hour. 1539 // "ACCESS" - The access hours for storage places. 1540 // "SENIOR_HOURS" - The special hours for seniors. 1541 // "ONLINE_SERVICE_HOURS" - The online service hours. 1542 SecondaryHoursType string `json:"secondaryHoursType,omitempty"` 1543 // SpecialDays: Structured information for special days that fall within the 1544 // period that the returned opening hours cover. Special days are days that 1545 // could impact the business hours of a place, e.g. Christmas day. Set for 1546 // current_opening_hours and current_secondary_opening_hours if there are 1547 // exceptional hours. 1548 SpecialDays []*GoogleMapsPlacesV1PlaceOpeningHoursSpecialDay `json:"specialDays,omitempty"` 1549 // WeekdayDescriptions: Localized strings describing the opening hours of this 1550 // place, one string for each day of the week. Will be empty if the hours are 1551 // unknown or could not be converted to localized text. Example: "Sun: 1552 // 18:00–06:00" 1553 WeekdayDescriptions []string `json:"weekdayDescriptions,omitempty"` 1554 // ForceSendFields is a list of field names (e.g. "OpenNow") to unconditionally 1555 // include in API requests. By default, fields with empty or default values are 1556 // omitted from API requests. See 1557 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1558 // details. 1559 ForceSendFields []string `json:"-"` 1560 // NullFields is a list of field names (e.g. "OpenNow") to include in API 1561 // requests with the JSON null value. By default, fields with empty values are 1562 // omitted from API requests. See 1563 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1564 NullFields []string `json:"-"` 1565 } 1566 1567 func (s *GoogleMapsPlacesV1PlaceOpeningHours) MarshalJSON() ([]byte, error) { 1568 type NoMethod GoogleMapsPlacesV1PlaceOpeningHours 1569 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1570 } 1571 1572 // GoogleMapsPlacesV1PlaceOpeningHoursPeriod: A period the place remains in 1573 // open_now status. 1574 type GoogleMapsPlacesV1PlaceOpeningHoursPeriod struct { 1575 // Close: The time that the place starts to be closed. 1576 Close *GoogleMapsPlacesV1PlaceOpeningHoursPeriodPoint `json:"close,omitempty"` 1577 // Open: The time that the place starts to be open. 1578 Open *GoogleMapsPlacesV1PlaceOpeningHoursPeriodPoint `json:"open,omitempty"` 1579 // ForceSendFields is a list of field names (e.g. "Close") to unconditionally 1580 // include in API requests. By default, fields with empty or default values are 1581 // omitted from API requests. See 1582 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1583 // details. 1584 ForceSendFields []string `json:"-"` 1585 // NullFields is a list of field names (e.g. "Close") to include in API 1586 // requests with the JSON null value. By default, fields with empty values are 1587 // omitted from API requests. See 1588 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1589 NullFields []string `json:"-"` 1590 } 1591 1592 func (s *GoogleMapsPlacesV1PlaceOpeningHoursPeriod) MarshalJSON() ([]byte, error) { 1593 type NoMethod GoogleMapsPlacesV1PlaceOpeningHoursPeriod 1594 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1595 } 1596 1597 // GoogleMapsPlacesV1PlaceOpeningHoursPeriodPoint: Status changing points. 1598 type GoogleMapsPlacesV1PlaceOpeningHoursPeriodPoint struct { 1599 // Date: Date in the local timezone for the place. 1600 Date *GoogleTypeDate `json:"date,omitempty"` 1601 // Day: A day of the week, as an integer in the range 0-6. 0 is Sunday, 1 is 1602 // Monday, etc. 1603 Day int64 `json:"day,omitempty"` 1604 // Hour: The hour in 2 digits. Ranges from 00 to 23. 1605 Hour int64 `json:"hour,omitempty"` 1606 // Minute: The minute in 2 digits. Ranges from 00 to 59. 1607 Minute int64 `json:"minute,omitempty"` 1608 // Truncated: Whether or not this endpoint was truncated. Truncation occurs 1609 // when the real hours are outside the times we are willing to return hours 1610 // between, so we truncate the hours back to these boundaries. This ensures 1611 // that at most 24 * 7 hours from midnight of the day of the request are 1612 // returned. 1613 Truncated bool `json:"truncated,omitempty"` 1614 // ForceSendFields is a list of field names (e.g. "Date") to unconditionally 1615 // include in API requests. By default, fields with empty or default values are 1616 // omitted from API requests. See 1617 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1618 // details. 1619 ForceSendFields []string `json:"-"` 1620 // NullFields is a list of field names (e.g. "Date") to include in API requests 1621 // with the JSON null value. By default, fields with empty values are omitted 1622 // from API requests. See 1623 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1624 NullFields []string `json:"-"` 1625 } 1626 1627 func (s *GoogleMapsPlacesV1PlaceOpeningHoursPeriodPoint) MarshalJSON() ([]byte, error) { 1628 type NoMethod GoogleMapsPlacesV1PlaceOpeningHoursPeriodPoint 1629 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1630 } 1631 1632 // GoogleMapsPlacesV1PlaceOpeningHoursSpecialDay: Structured information for 1633 // special days that fall within the period that the returned opening hours 1634 // cover. Special days are days that could impact the business hours of a 1635 // place, e.g. Christmas day. 1636 type GoogleMapsPlacesV1PlaceOpeningHoursSpecialDay struct { 1637 // Date: The date of this special day. 1638 Date *GoogleTypeDate `json:"date,omitempty"` 1639 // ForceSendFields is a list of field names (e.g. "Date") to unconditionally 1640 // include in API requests. By default, fields with empty or default values are 1641 // omitted from API requests. See 1642 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1643 // details. 1644 ForceSendFields []string `json:"-"` 1645 // NullFields is a list of field names (e.g. "Date") to include in API requests 1646 // with the JSON null value. By default, fields with empty values are omitted 1647 // from API requests. See 1648 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1649 NullFields []string `json:"-"` 1650 } 1651 1652 func (s *GoogleMapsPlacesV1PlaceOpeningHoursSpecialDay) MarshalJSON() ([]byte, error) { 1653 type NoMethod GoogleMapsPlacesV1PlaceOpeningHoursSpecialDay 1654 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1655 } 1656 1657 // GoogleMapsPlacesV1PlaceParkingOptions: Information about parking options for 1658 // the place. A parking lot could support more than one option at the same 1659 // time. 1660 type GoogleMapsPlacesV1PlaceParkingOptions struct { 1661 // FreeGarageParking: Place offers free garage parking. 1662 FreeGarageParking bool `json:"freeGarageParking,omitempty"` 1663 // FreeParkingLot: Place offers free parking lots. 1664 FreeParkingLot bool `json:"freeParkingLot,omitempty"` 1665 // FreeStreetParking: Place offers free street parking. 1666 FreeStreetParking bool `json:"freeStreetParking,omitempty"` 1667 // PaidGarageParking: Place offers paid garage parking. 1668 PaidGarageParking bool `json:"paidGarageParking,omitempty"` 1669 // PaidParkingLot: Place offers paid parking lots. 1670 PaidParkingLot bool `json:"paidParkingLot,omitempty"` 1671 // PaidStreetParking: Place offers paid street parking. 1672 PaidStreetParking bool `json:"paidStreetParking,omitempty"` 1673 // ValetParking: Place offers valet parking. 1674 ValetParking bool `json:"valetParking,omitempty"` 1675 // ForceSendFields is a list of field names (e.g. "FreeGarageParking") to 1676 // unconditionally include in API requests. By default, fields with empty or 1677 // default values are omitted from API requests. See 1678 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1679 // details. 1680 ForceSendFields []string `json:"-"` 1681 // NullFields is a list of field names (e.g. "FreeGarageParking") to include in 1682 // API requests with the JSON null value. By default, fields with empty values 1683 // are omitted from API requests. See 1684 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1685 NullFields []string `json:"-"` 1686 } 1687 1688 func (s *GoogleMapsPlacesV1PlaceParkingOptions) MarshalJSON() ([]byte, error) { 1689 type NoMethod GoogleMapsPlacesV1PlaceParkingOptions 1690 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1691 } 1692 1693 // GoogleMapsPlacesV1PlacePaymentOptions: Payment options the place accepts. 1694 type GoogleMapsPlacesV1PlacePaymentOptions struct { 1695 // AcceptsCashOnly: Place accepts cash only as payment. Places with this 1696 // attribute may still accept other payment methods. 1697 AcceptsCashOnly bool `json:"acceptsCashOnly,omitempty"` 1698 // AcceptsCreditCards: Place accepts credit cards as payment. 1699 AcceptsCreditCards bool `json:"acceptsCreditCards,omitempty"` 1700 // AcceptsDebitCards: Place accepts debit cards as payment. 1701 AcceptsDebitCards bool `json:"acceptsDebitCards,omitempty"` 1702 // AcceptsNfc: Place accepts NFC payments. 1703 AcceptsNfc bool `json:"acceptsNfc,omitempty"` 1704 // ForceSendFields is a list of field names (e.g. "AcceptsCashOnly") to 1705 // unconditionally include in API requests. By default, fields with empty or 1706 // default values are omitted from API requests. See 1707 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1708 // details. 1709 ForceSendFields []string `json:"-"` 1710 // NullFields is a list of field names (e.g. "AcceptsCashOnly") to include in 1711 // API requests with the JSON null value. By default, fields with empty values 1712 // are omitted from API requests. See 1713 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1714 NullFields []string `json:"-"` 1715 } 1716 1717 func (s *GoogleMapsPlacesV1PlacePaymentOptions) MarshalJSON() ([]byte, error) { 1718 type NoMethod GoogleMapsPlacesV1PlacePaymentOptions 1719 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1720 } 1721 1722 // GoogleMapsPlacesV1PlacePlusCode: Plus code (http://plus.codes) is a location 1723 // reference with two formats: global code defining a 14mx14m (1/8000th of a 1724 // degree) or smaller rectangle, and compound code, replacing the prefix with a 1725 // reference location. 1726 type GoogleMapsPlacesV1PlacePlusCode struct { 1727 // CompoundCode: Place's compound code, such as "33GV+HQ, Ramberg, Norway", 1728 // containing the suffix of the global code and replacing the prefix with a 1729 // formatted name of a reference entity. 1730 CompoundCode string `json:"compoundCode,omitempty"` 1731 // GlobalCode: Place's global (full) code, such as "9FWM33GV+HQ", representing 1732 // an 1/8000 by 1/8000 degree area (~14 by 14 meters). 1733 GlobalCode string `json:"globalCode,omitempty"` 1734 // ForceSendFields is a list of field names (e.g. "CompoundCode") to 1735 // unconditionally include in API requests. By default, fields with empty or 1736 // default values are omitted from API requests. See 1737 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1738 // details. 1739 ForceSendFields []string `json:"-"` 1740 // NullFields is a list of field names (e.g. "CompoundCode") to include in API 1741 // requests with the JSON null value. By default, fields with empty values are 1742 // omitted from API requests. See 1743 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1744 NullFields []string `json:"-"` 1745 } 1746 1747 func (s *GoogleMapsPlacesV1PlacePlusCode) MarshalJSON() ([]byte, error) { 1748 type NoMethod GoogleMapsPlacesV1PlacePlusCode 1749 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1750 } 1751 1752 // GoogleMapsPlacesV1PlaceSubDestination: Place resource name and id of sub 1753 // destinations that relate to the place. For example, different terminals are 1754 // different destinations of an airport. 1755 type GoogleMapsPlacesV1PlaceSubDestination struct { 1756 // Id: The place id of the sub destination. 1757 Id string `json:"id,omitempty"` 1758 // Name: The resource name of the sub destination. 1759 Name string `json:"name,omitempty"` 1760 // ForceSendFields is a list of field names (e.g. "Id") to unconditionally 1761 // include in API requests. By default, fields with empty or default values are 1762 // omitted from API requests. See 1763 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1764 // details. 1765 ForceSendFields []string `json:"-"` 1766 // NullFields is a list of field names (e.g. "Id") to include in API requests 1767 // with the JSON null value. By default, fields with empty values are omitted 1768 // from API requests. See 1769 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1770 NullFields []string `json:"-"` 1771 } 1772 1773 func (s *GoogleMapsPlacesV1PlaceSubDestination) MarshalJSON() ([]byte, error) { 1774 type NoMethod GoogleMapsPlacesV1PlaceSubDestination 1775 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1776 } 1777 1778 // GoogleMapsPlacesV1References: Experimental: See 1779 // https://developers.google.com/maps/documentation/places/web-service/experimental/places-generative 1780 // for more details. Reference that the generative content is related to. 1781 type GoogleMapsPlacesV1References struct { 1782 // Places: The list of resource names of the referenced places. This name can 1783 // be used in other APIs that accept Place resource names. 1784 Places []string `json:"places,omitempty"` 1785 // Reviews: Reviews that serve as references. 1786 Reviews []*GoogleMapsPlacesV1Review `json:"reviews,omitempty"` 1787 // ForceSendFields is a list of field names (e.g. "Places") to unconditionally 1788 // include in API requests. By default, fields with empty or default values are 1789 // omitted from API requests. See 1790 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1791 // details. 1792 ForceSendFields []string `json:"-"` 1793 // NullFields is a list of field names (e.g. "Places") to include in API 1794 // requests with the JSON null value. By default, fields with empty values are 1795 // omitted from API requests. See 1796 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1797 NullFields []string `json:"-"` 1798 } 1799 1800 func (s *GoogleMapsPlacesV1References) MarshalJSON() ([]byte, error) { 1801 type NoMethod GoogleMapsPlacesV1References 1802 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1803 } 1804 1805 // GoogleMapsPlacesV1Review: Information about a review of a place. 1806 type GoogleMapsPlacesV1Review struct { 1807 // AuthorAttribution: This review's author. 1808 AuthorAttribution *GoogleMapsPlacesV1AuthorAttribution `json:"authorAttribution,omitempty"` 1809 // Name: A reference representing this place review which may be used to look 1810 // up this place review again (also called the API "resource" name: 1811 // `places/{place_id}/reviews/{review}`). 1812 Name string `json:"name,omitempty"` 1813 // OriginalText: The review text in its original language. 1814 OriginalText *GoogleTypeLocalizedText `json:"originalText,omitempty"` 1815 // PublishTime: Timestamp for the review. 1816 PublishTime string `json:"publishTime,omitempty"` 1817 // Rating: A number between 1.0 and 5.0, also called the number of stars. 1818 Rating float64 `json:"rating,omitempty"` 1819 // RelativePublishTimeDescription: A string of formatted recent time, 1820 // expressing the review time relative to the current time in a form 1821 // appropriate for the language and country. 1822 RelativePublishTimeDescription string `json:"relativePublishTimeDescription,omitempty"` 1823 // Text: The localized text of the review. 1824 Text *GoogleTypeLocalizedText `json:"text,omitempty"` 1825 // ForceSendFields is a list of field names (e.g. "AuthorAttribution") to 1826 // unconditionally include in API requests. By default, fields with empty or 1827 // default values are omitted from API requests. See 1828 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1829 // details. 1830 ForceSendFields []string `json:"-"` 1831 // NullFields is a list of field names (e.g. "AuthorAttribution") to include in 1832 // API requests with the JSON null value. By default, fields with empty values 1833 // are omitted from API requests. See 1834 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1835 NullFields []string `json:"-"` 1836 } 1837 1838 func (s *GoogleMapsPlacesV1Review) MarshalJSON() ([]byte, error) { 1839 type NoMethod GoogleMapsPlacesV1Review 1840 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1841 } 1842 1843 func (s *GoogleMapsPlacesV1Review) UnmarshalJSON(data []byte) error { 1844 type NoMethod GoogleMapsPlacesV1Review 1845 var s1 struct { 1846 Rating gensupport.JSONFloat64 `json:"rating"` 1847 *NoMethod 1848 } 1849 s1.NoMethod = (*NoMethod)(s) 1850 if err := json.Unmarshal(data, &s1); err != nil { 1851 return err 1852 } 1853 s.Rating = float64(s1.Rating) 1854 return nil 1855 } 1856 1857 // GoogleMapsPlacesV1SearchNearbyRequest: Request proto for Search Nearby. 1858 type GoogleMapsPlacesV1SearchNearbyRequest struct { 1859 // ExcludedPrimaryTypes: Excluded primary Place type (e.g. "restaurant" or 1860 // "gas_station") from 1861 // https://developers.google.com/maps/documentation/places/web-service/place-types. 1862 // Up to 50 types from Table A 1863 // (https://developers.google.com/maps/documentation/places/web-service/place-types#table-a) 1864 // may be specified. If there are any conflicting primary types, i.e. a type 1865 // appears in both included_primary_types and excluded_primary_types, an 1866 // INVALID_ARGUMENT error is returned. If a Place type is specified with 1867 // multiple type restrictions, only places that satisfy all of the restrictions 1868 // are returned. For example, if we have {included_types = ["restaurant"], 1869 // excluded_primary_types = ["restaurant"]}, the returned places provide 1870 // "restaurant" related services but do not operate primarily as "restaurants". 1871 ExcludedPrimaryTypes []string `json:"excludedPrimaryTypes,omitempty"` 1872 // ExcludedTypes: Excluded Place type (eg, "restaurant" or "gas_station") from 1873 // https://developers.google.com/maps/documentation/places/web-service/place-types. 1874 // Up to 50 types from Table A 1875 // (https://developers.google.com/maps/documentation/places/web-service/place-types#table-a) 1876 // may be specified. If the client provides both included_types (e.g. 1877 // restaurant) and excluded_types (e.g. cafe), then the response should include 1878 // places that are restaurant but not cafe. The response includes places that 1879 // match at least one of the included_types and none of the excluded_types. If 1880 // there are any conflicting types, i.e. a type appears in both included_types 1881 // and excluded_types, an INVALID_ARGUMENT error is returned. If a Place type 1882 // is specified with multiple type restrictions, only places that satisfy all 1883 // of the restrictions are returned. For example, if we have {included_types = 1884 // ["restaurant"], excluded_primary_types = ["restaurant"]}, the returned 1885 // places provide "restaurant" related services but do not operate primarily as 1886 // "restaurants". 1887 ExcludedTypes []string `json:"excludedTypes,omitempty"` 1888 // IncludedPrimaryTypes: Included primary Place type (e.g. "restaurant" or 1889 // "gas_station") from 1890 // https://developers.google.com/maps/documentation/places/web-service/place-types. 1891 // A place can only have a single primary type from the supported types table 1892 // associated with it. Up to 50 types from Table A 1893 // (https://developers.google.com/maps/documentation/places/web-service/place-types#table-a) 1894 // may be specified. If there are any conflicting primary types, i.e. a type 1895 // appears in both included_primary_types and excluded_primary_types, an 1896 // INVALID_ARGUMENT error is returned. If a Place type is specified with 1897 // multiple type restrictions, only places that satisfy all of the restrictions 1898 // are returned. For example, if we have {included_types = ["restaurant"], 1899 // excluded_primary_types = ["restaurant"]}, the returned places provide 1900 // "restaurant" related services but do not operate primarily as "restaurants". 1901 IncludedPrimaryTypes []string `json:"includedPrimaryTypes,omitempty"` 1902 // IncludedTypes: Included Place type (eg, "restaurant" or "gas_station") from 1903 // https://developers.google.com/maps/documentation/places/web-service/place-types. 1904 // Up to 50 types from Table A 1905 // (https://developers.google.com/maps/documentation/places/web-service/place-types#table-a) 1906 // may be specified. If there are any conflicting types, i.e. a type appears in 1907 // both included_types and excluded_types, an INVALID_ARGUMENT error is 1908 // returned. If a Place type is specified with multiple type restrictions, only 1909 // places that satisfy all of the restrictions are returned. For example, if we 1910 // have {included_types = ["restaurant"], excluded_primary_types = 1911 // ["restaurant"]}, the returned places provide "restaurant" related services 1912 // but do not operate primarily as "restaurants". 1913 IncludedTypes []string `json:"includedTypes,omitempty"` 1914 // LanguageCode: Place details will be displayed with the preferred language if 1915 // available. If the language code is unspecified or unrecognized, place 1916 // details of any language may be returned, with a preference for English if 1917 // such details exist. Current list of supported languages: 1918 // https://developers.google.com/maps/faq#languagesupport. 1919 LanguageCode string `json:"languageCode,omitempty"` 1920 // LocationRestriction: Required. The region to search. 1921 LocationRestriction *GoogleMapsPlacesV1SearchNearbyRequestLocationRestriction `json:"locationRestriction,omitempty"` 1922 // MaxResultCount: Maximum number of results to return. It must be between 1 1923 // and 20 (default), inclusively. If the number is unset, it falls back to the 1924 // upper limit. If the number is set to negative or exceeds the upper limit, an 1925 // INVALID_ARGUMENT error is returned. 1926 MaxResultCount int64 `json:"maxResultCount,omitempty"` 1927 // RankPreference: How results will be ranked in the response. 1928 // 1929 // Possible values: 1930 // "RANK_PREFERENCE_UNSPECIFIED" - RankPreference value not set. Will use 1931 // rank by POPULARITY by default. 1932 // "DISTANCE" - Ranks results by distance. 1933 // "POPULARITY" - Ranks results by popularity. 1934 RankPreference string `json:"rankPreference,omitempty"` 1935 // RegionCode: The Unicode country/region code (CLDR) of the location where the 1936 // request is coming from. This parameter is used to display the place details, 1937 // like region-specific place name, if available. The parameter can affect 1938 // results based on applicable law. For more information, see 1939 // https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html. 1940 // Note that 3-digit region codes are not currently supported. 1941 RegionCode string `json:"regionCode,omitempty"` 1942 // ForceSendFields is a list of field names (e.g. "ExcludedPrimaryTypes") to 1943 // unconditionally include in API requests. By default, fields with empty or 1944 // default values are omitted from API requests. See 1945 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1946 // details. 1947 ForceSendFields []string `json:"-"` 1948 // NullFields is a list of field names (e.g. "ExcludedPrimaryTypes") to include 1949 // in API requests with the JSON null value. By default, fields with empty 1950 // values are omitted from API requests. See 1951 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1952 NullFields []string `json:"-"` 1953 } 1954 1955 func (s *GoogleMapsPlacesV1SearchNearbyRequest) MarshalJSON() ([]byte, error) { 1956 type NoMethod GoogleMapsPlacesV1SearchNearbyRequest 1957 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1958 } 1959 1960 // GoogleMapsPlacesV1SearchNearbyRequestLocationRestriction: The region to 1961 // search. 1962 type GoogleMapsPlacesV1SearchNearbyRequestLocationRestriction struct { 1963 // Circle: A circle defined by center point and radius. 1964 Circle *GoogleMapsPlacesV1Circle `json:"circle,omitempty"` 1965 // ForceSendFields is a list of field names (e.g. "Circle") to unconditionally 1966 // include in API requests. By default, fields with empty or default values are 1967 // omitted from API requests. See 1968 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1969 // details. 1970 ForceSendFields []string `json:"-"` 1971 // NullFields is a list of field names (e.g. "Circle") to include in API 1972 // requests with the JSON null value. By default, fields with empty values are 1973 // omitted from API requests. See 1974 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1975 NullFields []string `json:"-"` 1976 } 1977 1978 func (s *GoogleMapsPlacesV1SearchNearbyRequestLocationRestriction) MarshalJSON() ([]byte, error) { 1979 type NoMethod GoogleMapsPlacesV1SearchNearbyRequestLocationRestriction 1980 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1981 } 1982 1983 // GoogleMapsPlacesV1SearchNearbyResponse: Response proto for Search Nearby. 1984 type GoogleMapsPlacesV1SearchNearbyResponse struct { 1985 // Places: A list of places that meets user's requirements like places types, 1986 // number of places and specific location restriction. 1987 Places []*GoogleMapsPlacesV1Place `json:"places,omitempty"` 1988 1989 // ServerResponse contains the HTTP response code and headers from the server. 1990 googleapi.ServerResponse `json:"-"` 1991 // ForceSendFields is a list of field names (e.g. "Places") to unconditionally 1992 // include in API requests. By default, fields with empty or default values are 1993 // omitted from API requests. See 1994 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1995 // details. 1996 ForceSendFields []string `json:"-"` 1997 // NullFields is a list of field names (e.g. "Places") to include in API 1998 // requests with the JSON null value. By default, fields with empty values are 1999 // omitted from API requests. See 2000 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2001 NullFields []string `json:"-"` 2002 } 2003 2004 func (s *GoogleMapsPlacesV1SearchNearbyResponse) MarshalJSON() ([]byte, error) { 2005 type NoMethod GoogleMapsPlacesV1SearchNearbyResponse 2006 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2007 } 2008 2009 // GoogleMapsPlacesV1SearchTextRequest: Request proto for SearchText. 2010 type GoogleMapsPlacesV1SearchTextRequest struct { 2011 // EvOptions: Optional. Set the searchable EV options of a place search 2012 // request. 2013 EvOptions *GoogleMapsPlacesV1SearchTextRequestEVOptions `json:"evOptions,omitempty"` 2014 // IncludedType: The requested place type. Full list of types supported: 2015 // https://developers.google.com/maps/documentation/places/web-service/place-types. 2016 // Only support one included type. 2017 IncludedType string `json:"includedType,omitempty"` 2018 // LanguageCode: Place details will be displayed with the preferred language if 2019 // available. If the language code is unspecified or unrecognized, place 2020 // details of any language may be returned, with a preference for English if 2021 // such details exist. Current list of supported languages: 2022 // https://developers.google.com/maps/faq#languagesupport. 2023 LanguageCode string `json:"languageCode,omitempty"` 2024 // LocationBias: The region to search. This location serves as a bias which 2025 // means results around given location might be returned. Cannot be set along 2026 // with location_restriction. 2027 LocationBias *GoogleMapsPlacesV1SearchTextRequestLocationBias `json:"locationBias,omitempty"` 2028 // LocationRestriction: The region to search. This location serves as a 2029 // restriction which means results outside given location will not be returned. 2030 // Cannot be set along with location_bias. 2031 LocationRestriction *GoogleMapsPlacesV1SearchTextRequestLocationRestriction `json:"locationRestriction,omitempty"` 2032 // MaxResultCount: Deprecated: Use `page_size` instead. The maximum number of 2033 // results per page that can be returned. If the number of available results is 2034 // larger than `max_result_count`, a `next_page_token` is returned which can be 2035 // passed to `page_token` to get the next page of results in subsequent 2036 // requests. If 0 or no value is provided, a default of 20 is used. The maximum 2037 // value is 20; values above 20 will be coerced to 20. Negative values will 2038 // return an INVALID_ARGUMENT error. If both `max_result_count` and `page_size` 2039 // are specified, `max_result_count` will be ignored. 2040 MaxResultCount int64 `json:"maxResultCount,omitempty"` 2041 // MinRating: Filter out results whose average user rating is strictly less 2042 // than this limit. A valid value must be a float between 0 and 5 (inclusively) 2043 // at a 0.5 cadence i.e. [0, 0.5, 1.0, ... , 5.0] inclusively. The input rating 2044 // will round up to the nearest 0.5(ceiling). For instance, a rating of 0.6 2045 // will eliminate all results with a less than 1.0 rating. 2046 MinRating float64 `json:"minRating,omitempty"` 2047 // OpenNow: Used to restrict the search to places that are currently open. The 2048 // default is false. 2049 OpenNow bool `json:"openNow,omitempty"` 2050 // PageSize: Optional. The maximum number of results per page that can be 2051 // returned. If the number of available results is larger than `page_size`, a 2052 // `next_page_token` is returned which can be passed to `page_token` to get the 2053 // next page of results in subsequent requests. If 0 or no value is provided, a 2054 // default of 20 is used. The maximum value is 20; values above 20 will be set 2055 // to 20. Negative values will return an INVALID_ARGUMENT error. If both 2056 // `max_result_count` and `page_size` are specified, `max_result_count` will be 2057 // ignored. 2058 PageSize int64 `json:"pageSize,omitempty"` 2059 // PageToken: Optional. A page token, received from a previous TextSearch call. 2060 // Provide this to retrieve the subsequent page. When paginating, all 2061 // parameters other than `page_token`, `page_size`, and `max_result_count` 2062 // provided to TextSearch must match the initial call that provided the page 2063 // token. Otherwise an INVALID_ARGUMENT error is returned. 2064 PageToken string `json:"pageToken,omitempty"` 2065 // PriceLevels: Used to restrict the search to places that are marked as 2066 // certain price levels. Users can choose any combinations of price levels. 2067 // Default to select all price levels. 2068 // 2069 // Possible values: 2070 // "PRICE_LEVEL_UNSPECIFIED" - Place price level is unspecified or unknown. 2071 // "PRICE_LEVEL_FREE" - Place provides free services. 2072 // "PRICE_LEVEL_INEXPENSIVE" - Place provides inexpensive services. 2073 // "PRICE_LEVEL_MODERATE" - Place provides moderately priced services. 2074 // "PRICE_LEVEL_EXPENSIVE" - Place provides expensive services. 2075 // "PRICE_LEVEL_VERY_EXPENSIVE" - Place provides very expensive services. 2076 PriceLevels []string `json:"priceLevels,omitempty"` 2077 // RankPreference: How results will be ranked in the response. 2078 // 2079 // Possible values: 2080 // "RANK_PREFERENCE_UNSPECIFIED" - For a categorical query such as 2081 // "Restaurants in New York City", RELEVANCE is the default. For 2082 // non-categorical queries such as "Mountain View, CA" we recommend that you 2083 // leave rankPreference unset. 2084 // "DISTANCE" - Ranks results by distance. 2085 // "RELEVANCE" - Ranks results by relevance. Sort order determined by normal 2086 // ranking stack. 2087 RankPreference string `json:"rankPreference,omitempty"` 2088 // RegionCode: The Unicode country/region code (CLDR) of the location where the 2089 // request is coming from. This parameter is used to display the place details, 2090 // like region-specific place name, if available. The parameter can affect 2091 // results based on applicable law. For more information, see 2092 // https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html. 2093 // Note that 3-digit region codes are not currently supported. 2094 RegionCode string `json:"regionCode,omitempty"` 2095 // StrictTypeFiltering: Used to set strict type filtering for included_type. If 2096 // set to true, only results of the same type will be returned. Default to 2097 // false. 2098 StrictTypeFiltering bool `json:"strictTypeFiltering,omitempty"` 2099 // TextQuery: Required. The text query for textual search. 2100 TextQuery string `json:"textQuery,omitempty"` 2101 // ForceSendFields is a list of field names (e.g. "EvOptions") to 2102 // unconditionally include in API requests. By default, fields with empty or 2103 // default values are omitted from API requests. See 2104 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2105 // details. 2106 ForceSendFields []string `json:"-"` 2107 // NullFields is a list of field names (e.g. "EvOptions") to include in API 2108 // requests with the JSON null value. By default, fields with empty values are 2109 // omitted from API requests. See 2110 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2111 NullFields []string `json:"-"` 2112 } 2113 2114 func (s *GoogleMapsPlacesV1SearchTextRequest) MarshalJSON() ([]byte, error) { 2115 type NoMethod GoogleMapsPlacesV1SearchTextRequest 2116 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2117 } 2118 2119 func (s *GoogleMapsPlacesV1SearchTextRequest) UnmarshalJSON(data []byte) error { 2120 type NoMethod GoogleMapsPlacesV1SearchTextRequest 2121 var s1 struct { 2122 MinRating gensupport.JSONFloat64 `json:"minRating"` 2123 *NoMethod 2124 } 2125 s1.NoMethod = (*NoMethod)(s) 2126 if err := json.Unmarshal(data, &s1); err != nil { 2127 return err 2128 } 2129 s.MinRating = float64(s1.MinRating) 2130 return nil 2131 } 2132 2133 // GoogleMapsPlacesV1SearchTextRequestEVOptions: Searchable EV options of a 2134 // place search request. 2135 type GoogleMapsPlacesV1SearchTextRequestEVOptions struct { 2136 // ConnectorTypes: Optional. The list of preferred EV connector types. A place 2137 // that does not support any of the listed connector types is filtered out. 2138 // 2139 // Possible values: 2140 // "EV_CONNECTOR_TYPE_UNSPECIFIED" - Unspecified connector. 2141 // "EV_CONNECTOR_TYPE_OTHER" - Other connector types. 2142 // "EV_CONNECTOR_TYPE_J1772" - J1772 type 1 connector. 2143 // "EV_CONNECTOR_TYPE_TYPE_2" - IEC 62196 type 2 connector. Often referred to 2144 // as MENNEKES. 2145 // "EV_CONNECTOR_TYPE_CHADEMO" - CHAdeMO type connector. 2146 // "EV_CONNECTOR_TYPE_CCS_COMBO_1" - Combined Charging System (AC and DC). 2147 // Based on SAE. Type-1 J-1772 connector 2148 // "EV_CONNECTOR_TYPE_CCS_COMBO_2" - Combined Charging System (AC and DC). 2149 // Based on Type-2 Mennekes connector 2150 // "EV_CONNECTOR_TYPE_TESLA" - The generic TESLA connector. This is NACS in 2151 // the North America but can be non-NACS in other parts of the world (e.g. CCS 2152 // Combo 2 (CCS2) or GB/T). This value is less representative of an actual 2153 // connector type, and more represents the ability to charge a Tesla brand 2154 // vehicle at a Tesla owned charging station. 2155 // "EV_CONNECTOR_TYPE_UNSPECIFIED_GB_T" - GB/T type corresponds to the GB/T 2156 // standard in China. This type covers all GB_T types. 2157 // "EV_CONNECTOR_TYPE_UNSPECIFIED_WALL_OUTLET" - Unspecified wall outlet. 2158 ConnectorTypes []string `json:"connectorTypes,omitempty"` 2159 // MinimumChargingRateKw: Optional. Minimum required charging rate in 2160 // kilowatts. A place with a charging rate less than the specified rate is 2161 // filtered out. 2162 MinimumChargingRateKw float64 `json:"minimumChargingRateKw,omitempty"` 2163 // ForceSendFields is a list of field names (e.g. "ConnectorTypes") to 2164 // unconditionally include in API requests. By default, fields with empty or 2165 // default values are omitted from API requests. See 2166 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2167 // details. 2168 ForceSendFields []string `json:"-"` 2169 // NullFields is a list of field names (e.g. "ConnectorTypes") to include in 2170 // API requests with the JSON null value. By default, fields with empty values 2171 // are omitted from API requests. See 2172 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2173 NullFields []string `json:"-"` 2174 } 2175 2176 func (s *GoogleMapsPlacesV1SearchTextRequestEVOptions) MarshalJSON() ([]byte, error) { 2177 type NoMethod GoogleMapsPlacesV1SearchTextRequestEVOptions 2178 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2179 } 2180 2181 func (s *GoogleMapsPlacesV1SearchTextRequestEVOptions) UnmarshalJSON(data []byte) error { 2182 type NoMethod GoogleMapsPlacesV1SearchTextRequestEVOptions 2183 var s1 struct { 2184 MinimumChargingRateKw gensupport.JSONFloat64 `json:"minimumChargingRateKw"` 2185 *NoMethod 2186 } 2187 s1.NoMethod = (*NoMethod)(s) 2188 if err := json.Unmarshal(data, &s1); err != nil { 2189 return err 2190 } 2191 s.MinimumChargingRateKw = float64(s1.MinimumChargingRateKw) 2192 return nil 2193 } 2194 2195 // GoogleMapsPlacesV1SearchTextRequestLocationBias: The region to search. This 2196 // location serves as a bias which means results around given location might be 2197 // returned. 2198 type GoogleMapsPlacesV1SearchTextRequestLocationBias struct { 2199 // Circle: A circle defined by center point and radius. 2200 Circle *GoogleMapsPlacesV1Circle `json:"circle,omitempty"` 2201 // Rectangle: A rectangle box defined by northeast and southwest corner. 2202 // `rectangle.high()` must be the northeast point of the rectangle viewport. 2203 // `rectangle.low()` must be the southwest point of the rectangle viewport. 2204 // `rectangle.low().latitude()` cannot be greater than 2205 // `rectangle.high().latitude()`. This will result in an empty latitude range. 2206 // A rectangle viewport cannot be wider than 180 degrees. 2207 Rectangle *GoogleGeoTypeViewport `json:"rectangle,omitempty"` 2208 // ForceSendFields is a list of field names (e.g. "Circle") to unconditionally 2209 // include in API requests. By default, fields with empty or default values are 2210 // omitted from API requests. See 2211 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2212 // details. 2213 ForceSendFields []string `json:"-"` 2214 // NullFields is a list of field names (e.g. "Circle") to include in API 2215 // requests with the JSON null value. By default, fields with empty values are 2216 // omitted from API requests. See 2217 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2218 NullFields []string `json:"-"` 2219 } 2220 2221 func (s *GoogleMapsPlacesV1SearchTextRequestLocationBias) MarshalJSON() ([]byte, error) { 2222 type NoMethod GoogleMapsPlacesV1SearchTextRequestLocationBias 2223 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2224 } 2225 2226 // GoogleMapsPlacesV1SearchTextRequestLocationRestriction: The region to 2227 // search. This location serves as a restriction which means results outside 2228 // given location will not be returned. 2229 type GoogleMapsPlacesV1SearchTextRequestLocationRestriction struct { 2230 // Rectangle: A rectangle box defined by northeast and southwest corner. 2231 // `rectangle.high()` must be the northeast point of the rectangle viewport. 2232 // `rectangle.low()` must be the southwest point of the rectangle viewport. 2233 // `rectangle.low().latitude()` cannot be greater than 2234 // `rectangle.high().latitude()`. This will result in an empty latitude range. 2235 // A rectangle viewport cannot be wider than 180 degrees. 2236 Rectangle *GoogleGeoTypeViewport `json:"rectangle,omitempty"` 2237 // ForceSendFields is a list of field names (e.g. "Rectangle") to 2238 // unconditionally include in API requests. By default, fields with empty or 2239 // default values are omitted from API requests. See 2240 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2241 // details. 2242 ForceSendFields []string `json:"-"` 2243 // NullFields is a list of field names (e.g. "Rectangle") to include in API 2244 // requests with the JSON null value. By default, fields with empty values are 2245 // omitted from API requests. See 2246 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2247 NullFields []string `json:"-"` 2248 } 2249 2250 func (s *GoogleMapsPlacesV1SearchTextRequestLocationRestriction) MarshalJSON() ([]byte, error) { 2251 type NoMethod GoogleMapsPlacesV1SearchTextRequestLocationRestriction 2252 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2253 } 2254 2255 // GoogleMapsPlacesV1SearchTextResponse: Response proto for SearchText. 2256 type GoogleMapsPlacesV1SearchTextResponse struct { 2257 // ContextualContents: Experimental: See 2258 // https://developers.google.com/maps/documentation/places/web-service/experimental/places-generative 2259 // for more details. A list of contextual contents where each entry associates 2260 // to the corresponding place in the same index in the places field. The 2261 // contents that are relevant to the `text_query` in the request are preferred. 2262 // If the contextual content is not available for one of the places, it will 2263 // return non-contextual content. It will be empty only when the content is 2264 // unavailable for this place. This list should have as many entries as the 2265 // list of places if requested. 2266 ContextualContents []*GoogleMapsPlacesV1ContextualContent `json:"contextualContents,omitempty"` 2267 // NextPageToken: A token that can be sent as `page_token` to retrieve the next 2268 // page. If this field is omitted or empty, there are no subsequent pages. 2269 NextPageToken string `json:"nextPageToken,omitempty"` 2270 // Places: A list of places that meet the user's text search criteria. 2271 Places []*GoogleMapsPlacesV1Place `json:"places,omitempty"` 2272 2273 // ServerResponse contains the HTTP response code and headers from the server. 2274 googleapi.ServerResponse `json:"-"` 2275 // ForceSendFields is a list of field names (e.g. "ContextualContents") to 2276 // unconditionally include in API requests. By default, fields with empty or 2277 // default values are omitted from API requests. See 2278 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2279 // details. 2280 ForceSendFields []string `json:"-"` 2281 // NullFields is a list of field names (e.g. "ContextualContents") to include 2282 // in API requests with the JSON null value. By default, fields with empty 2283 // values are omitted from API requests. See 2284 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2285 NullFields []string `json:"-"` 2286 } 2287 2288 func (s *GoogleMapsPlacesV1SearchTextResponse) MarshalJSON() ([]byte, error) { 2289 type NoMethod GoogleMapsPlacesV1SearchTextResponse 2290 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2291 } 2292 2293 // GoogleTypeDate: Represents a whole or partial calendar date, such as a 2294 // birthday. The time of day and time zone are either specified elsewhere or 2295 // are insignificant. The date is relative to the Gregorian Calendar. This can 2296 // represent one of the following: * A full date, with non-zero year, month, 2297 // and day values. * A month and day, with a zero year (for example, an 2298 // anniversary). * A year on its own, with a zero month and a zero day. * A 2299 // year and month, with a zero day (for example, a credit card expiration 2300 // date). Related types: * google.type.TimeOfDay * google.type.DateTime * 2301 // google.protobuf.Timestamp 2302 type GoogleTypeDate struct { 2303 // Day: Day of a month. Must be from 1 to 31 and valid for the year and month, 2304 // or 0 to specify a year by itself or a year and month where the day isn't 2305 // significant. 2306 Day int64 `json:"day,omitempty"` 2307 // Month: Month of a year. Must be from 1 to 12, or 0 to specify a year without 2308 // a month and day. 2309 Month int64 `json:"month,omitempty"` 2310 // Year: Year of the date. Must be from 1 to 9999, or 0 to specify a date 2311 // without a year. 2312 Year int64 `json:"year,omitempty"` 2313 // ForceSendFields is a list of field names (e.g. "Day") to unconditionally 2314 // include in API requests. By default, fields with empty or default values are 2315 // omitted from API requests. See 2316 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2317 // details. 2318 ForceSendFields []string `json:"-"` 2319 // NullFields is a list of field names (e.g. "Day") to include in API requests 2320 // with the JSON null value. By default, fields with empty values are omitted 2321 // from API requests. See 2322 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2323 NullFields []string `json:"-"` 2324 } 2325 2326 func (s *GoogleTypeDate) MarshalJSON() ([]byte, error) { 2327 type NoMethod GoogleTypeDate 2328 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2329 } 2330 2331 // GoogleTypeLatLng: An object that represents a latitude/longitude pair. This 2332 // is expressed as a pair of doubles to represent degrees latitude and degrees 2333 // longitude. Unless specified otherwise, this object must conform to the WGS84 2334 // standard. Values must be within normalized ranges. 2335 type GoogleTypeLatLng struct { 2336 // Latitude: The latitude in degrees. It must be in the range [-90.0, +90.0]. 2337 Latitude float64 `json:"latitude,omitempty"` 2338 // Longitude: The longitude in degrees. It must be in the range [-180.0, 2339 // +180.0]. 2340 Longitude float64 `json:"longitude,omitempty"` 2341 // ForceSendFields is a list of field names (e.g. "Latitude") to 2342 // unconditionally include in API requests. By default, fields with empty or 2343 // default values are omitted from API requests. See 2344 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2345 // details. 2346 ForceSendFields []string `json:"-"` 2347 // NullFields is a list of field names (e.g. "Latitude") to include in API 2348 // requests with the JSON null value. By default, fields with empty values are 2349 // omitted from API requests. See 2350 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2351 NullFields []string `json:"-"` 2352 } 2353 2354 func (s *GoogleTypeLatLng) MarshalJSON() ([]byte, error) { 2355 type NoMethod GoogleTypeLatLng 2356 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2357 } 2358 2359 func (s *GoogleTypeLatLng) UnmarshalJSON(data []byte) error { 2360 type NoMethod GoogleTypeLatLng 2361 var s1 struct { 2362 Latitude gensupport.JSONFloat64 `json:"latitude"` 2363 Longitude gensupport.JSONFloat64 `json:"longitude"` 2364 *NoMethod 2365 } 2366 s1.NoMethod = (*NoMethod)(s) 2367 if err := json.Unmarshal(data, &s1); err != nil { 2368 return err 2369 } 2370 s.Latitude = float64(s1.Latitude) 2371 s.Longitude = float64(s1.Longitude) 2372 return nil 2373 } 2374 2375 // GoogleTypeLocalizedText: Localized variant of a text in a particular 2376 // language. 2377 type GoogleTypeLocalizedText struct { 2378 // LanguageCode: The text's BCP-47 language code, such as "en-US" or "sr-Latn". 2379 // For more information, see 2380 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 2381 LanguageCode string `json:"languageCode,omitempty"` 2382 // Text: Localized string in the language corresponding to language_code below. 2383 Text string `json:"text,omitempty"` 2384 // ForceSendFields is a list of field names (e.g. "LanguageCode") to 2385 // unconditionally include in API requests. By default, fields with empty or 2386 // default values are omitted from API requests. See 2387 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2388 // details. 2389 ForceSendFields []string `json:"-"` 2390 // NullFields is a list of field names (e.g. "LanguageCode") to include in API 2391 // requests with the JSON null value. By default, fields with empty values are 2392 // omitted from API requests. See 2393 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2394 NullFields []string `json:"-"` 2395 } 2396 2397 func (s *GoogleTypeLocalizedText) MarshalJSON() ([]byte, error) { 2398 type NoMethod GoogleTypeLocalizedText 2399 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2400 } 2401 2402 // GoogleTypeMoney: Represents an amount of money with its currency type. 2403 type GoogleTypeMoney struct { 2404 // CurrencyCode: The three-letter currency code defined in ISO 4217. 2405 CurrencyCode string `json:"currencyCode,omitempty"` 2406 // Nanos: Number of nano (10^-9) units of the amount. The value must be between 2407 // -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` 2408 // must be positive or zero. If `units` is zero, `nanos` can be positive, zero, 2409 // or negative. If `units` is negative, `nanos` must be negative or zero. For 2410 // example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. 2411 Nanos int64 `json:"nanos,omitempty"` 2412 // Units: The whole units of the amount. For example if `currencyCode` is 2413 // "USD", then 1 unit is one US dollar. 2414 Units int64 `json:"units,omitempty,string"` 2415 // ForceSendFields is a list of field names (e.g. "CurrencyCode") to 2416 // unconditionally include in API requests. By default, fields with empty or 2417 // default values are omitted from API requests. See 2418 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2419 // details. 2420 ForceSendFields []string `json:"-"` 2421 // NullFields is a list of field names (e.g. "CurrencyCode") to include in API 2422 // requests with the JSON null value. By default, fields with empty values are 2423 // omitted from API requests. See 2424 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2425 NullFields []string `json:"-"` 2426 } 2427 2428 func (s *GoogleTypeMoney) MarshalJSON() ([]byte, error) { 2429 type NoMethod GoogleTypeMoney 2430 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2431 } 2432 2433 type PlacesAutocompleteCall struct { 2434 s *Service 2435 googlemapsplacesv1autocompleteplacesrequest *GoogleMapsPlacesV1AutocompletePlacesRequest 2436 urlParams_ gensupport.URLParams 2437 ctx_ context.Context 2438 header_ http.Header 2439 } 2440 2441 // Autocomplete: Returns predictions for the given input. 2442 func (r *PlacesService) Autocomplete(googlemapsplacesv1autocompleteplacesrequest *GoogleMapsPlacesV1AutocompletePlacesRequest) *PlacesAutocompleteCall { 2443 c := &PlacesAutocompleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2444 c.googlemapsplacesv1autocompleteplacesrequest = googlemapsplacesv1autocompleteplacesrequest 2445 return c 2446 } 2447 2448 // Fields allows partial responses to be retrieved. See 2449 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2450 // details. 2451 func (c *PlacesAutocompleteCall) Fields(s ...googleapi.Field) *PlacesAutocompleteCall { 2452 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2453 return c 2454 } 2455 2456 // Context sets the context to be used in this call's Do method. 2457 func (c *PlacesAutocompleteCall) Context(ctx context.Context) *PlacesAutocompleteCall { 2458 c.ctx_ = ctx 2459 return c 2460 } 2461 2462 // Header returns a http.Header that can be modified by the caller to add 2463 // headers to the request. 2464 func (c *PlacesAutocompleteCall) Header() http.Header { 2465 if c.header_ == nil { 2466 c.header_ = make(http.Header) 2467 } 2468 return c.header_ 2469 } 2470 2471 func (c *PlacesAutocompleteCall) doRequest(alt string) (*http.Response, error) { 2472 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2473 var body io.Reader = nil 2474 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlemapsplacesv1autocompleteplacesrequest) 2475 if err != nil { 2476 return nil, err 2477 } 2478 c.urlParams_.Set("alt", alt) 2479 c.urlParams_.Set("prettyPrint", "false") 2480 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/places:autocomplete") 2481 urls += "?" + c.urlParams_.Encode() 2482 req, err := http.NewRequest("POST", urls, body) 2483 if err != nil { 2484 return nil, err 2485 } 2486 req.Header = reqHeaders 2487 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2488 } 2489 2490 // Do executes the "places.places.autocomplete" call. 2491 // Any non-2xx status code is an error. Response headers are in either 2492 // *GoogleMapsPlacesV1AutocompletePlacesResponse.ServerResponse.Header or (if a 2493 // response was returned at all) in error.(*googleapi.Error).Header. Use 2494 // googleapi.IsNotModified to check whether the returned error was because 2495 // http.StatusNotModified was returned. 2496 func (c *PlacesAutocompleteCall) Do(opts ...googleapi.CallOption) (*GoogleMapsPlacesV1AutocompletePlacesResponse, error) { 2497 gensupport.SetOptions(c.urlParams_, opts...) 2498 res, err := c.doRequest("json") 2499 if res != nil && res.StatusCode == http.StatusNotModified { 2500 if res.Body != nil { 2501 res.Body.Close() 2502 } 2503 return nil, gensupport.WrapError(&googleapi.Error{ 2504 Code: res.StatusCode, 2505 Header: res.Header, 2506 }) 2507 } 2508 if err != nil { 2509 return nil, err 2510 } 2511 defer googleapi.CloseBody(res) 2512 if err := googleapi.CheckResponse(res); err != nil { 2513 return nil, gensupport.WrapError(err) 2514 } 2515 ret := &GoogleMapsPlacesV1AutocompletePlacesResponse{ 2516 ServerResponse: googleapi.ServerResponse{ 2517 Header: res.Header, 2518 HTTPStatusCode: res.StatusCode, 2519 }, 2520 } 2521 target := &ret 2522 if err := gensupport.DecodeResponse(target, res); err != nil { 2523 return nil, err 2524 } 2525 return ret, nil 2526 } 2527 2528 type PlacesGetCall struct { 2529 s *Service 2530 name string 2531 urlParams_ gensupport.URLParams 2532 ifNoneMatch_ string 2533 ctx_ context.Context 2534 header_ http.Header 2535 } 2536 2537 // Get: Get the details of a place based on its resource name, which is a 2538 // string in the `places/{place_id}` format. 2539 // 2540 // - name: The resource name of a place, in the `places/{place_id}` format. 2541 func (r *PlacesService) Get(name string) *PlacesGetCall { 2542 c := &PlacesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2543 c.name = name 2544 return c 2545 } 2546 2547 // LanguageCode sets the optional parameter "languageCode": Place details will 2548 // be displayed with the preferred language if available. Current list of 2549 // supported languages: https://developers.google.com/maps/faq#languagesupport. 2550 func (c *PlacesGetCall) LanguageCode(languageCode string) *PlacesGetCall { 2551 c.urlParams_.Set("languageCode", languageCode) 2552 return c 2553 } 2554 2555 // RegionCode sets the optional parameter "regionCode": The Unicode 2556 // country/region code (CLDR) of the location where the request is coming from. 2557 // This parameter is used to display the place details, like region-specific 2558 // place name, if available. The parameter can affect results based on 2559 // applicable law. For more information, see 2560 // https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html. 2561 // Note that 3-digit region codes are not currently supported. 2562 func (c *PlacesGetCall) RegionCode(regionCode string) *PlacesGetCall { 2563 c.urlParams_.Set("regionCode", regionCode) 2564 return c 2565 } 2566 2567 // SessionToken sets the optional parameter "sessionToken": A string which 2568 // identifies an Autocomplete session for billing purposes. Must be a URL and 2569 // filename safe base64 string with at most 36 ASCII characters in length. 2570 // Otherwise an INVALID_ARGUMENT error is returned. The session begins when the 2571 // user starts typing a query, and concludes when they select a place and a 2572 // call to Place Details or Address Validation is made. Each session can have 2573 // multiple queries, followed by one Place Details or Address Validation 2574 // request. The credentials used for each request within a session must belong 2575 // to the same Google Cloud Console project. Once a session has concluded, the 2576 // token is no longer valid; your app must generate a fresh token for each 2577 // session. If the `session_token` parameter is omitted, or if you reuse a 2578 // session token, the session is charged as if no session token was provided 2579 // (each request is billed separately). We recommend the following guidelines: 2580 // * Use session tokens for all Place Autocomplete calls. * Generate a fresh 2581 // token for each session. Using a version 4 UUID is recommended. * Ensure that 2582 // the credentials used for all Place Autocomplete, Place Details, and Address 2583 // Validation requests within a session belong to the same Cloud Console 2584 // project. * Be sure to pass a unique session token for each new session. 2585 // Using the same token for more than one session will result in each request 2586 // being billed individually. 2587 func (c *PlacesGetCall) SessionToken(sessionToken string) *PlacesGetCall { 2588 c.urlParams_.Set("sessionToken", sessionToken) 2589 return c 2590 } 2591 2592 // Fields allows partial responses to be retrieved. See 2593 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2594 // details. 2595 func (c *PlacesGetCall) Fields(s ...googleapi.Field) *PlacesGetCall { 2596 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2597 return c 2598 } 2599 2600 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2601 // object's ETag matches the given value. This is useful for getting updates 2602 // only after the object has changed since the last request. 2603 func (c *PlacesGetCall) IfNoneMatch(entityTag string) *PlacesGetCall { 2604 c.ifNoneMatch_ = entityTag 2605 return c 2606 } 2607 2608 // Context sets the context to be used in this call's Do method. 2609 func (c *PlacesGetCall) Context(ctx context.Context) *PlacesGetCall { 2610 c.ctx_ = ctx 2611 return c 2612 } 2613 2614 // Header returns a http.Header that can be modified by the caller to add 2615 // headers to the request. 2616 func (c *PlacesGetCall) Header() http.Header { 2617 if c.header_ == nil { 2618 c.header_ = make(http.Header) 2619 } 2620 return c.header_ 2621 } 2622 2623 func (c *PlacesGetCall) doRequest(alt string) (*http.Response, error) { 2624 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2625 if c.ifNoneMatch_ != "" { 2626 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2627 } 2628 var body io.Reader = nil 2629 c.urlParams_.Set("alt", alt) 2630 c.urlParams_.Set("prettyPrint", "false") 2631 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 2632 urls += "?" + c.urlParams_.Encode() 2633 req, err := http.NewRequest("GET", urls, body) 2634 if err != nil { 2635 return nil, err 2636 } 2637 req.Header = reqHeaders 2638 googleapi.Expand(req.URL, map[string]string{ 2639 "name": c.name, 2640 }) 2641 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2642 } 2643 2644 // Do executes the "places.places.get" call. 2645 // Any non-2xx status code is an error. Response headers are in either 2646 // *GoogleMapsPlacesV1Place.ServerResponse.Header or (if a response was 2647 // returned at all) in error.(*googleapi.Error).Header. Use 2648 // googleapi.IsNotModified to check whether the returned error was because 2649 // http.StatusNotModified was returned. 2650 func (c *PlacesGetCall) Do(opts ...googleapi.CallOption) (*GoogleMapsPlacesV1Place, error) { 2651 gensupport.SetOptions(c.urlParams_, opts...) 2652 res, err := c.doRequest("json") 2653 if res != nil && res.StatusCode == http.StatusNotModified { 2654 if res.Body != nil { 2655 res.Body.Close() 2656 } 2657 return nil, gensupport.WrapError(&googleapi.Error{ 2658 Code: res.StatusCode, 2659 Header: res.Header, 2660 }) 2661 } 2662 if err != nil { 2663 return nil, err 2664 } 2665 defer googleapi.CloseBody(res) 2666 if err := googleapi.CheckResponse(res); err != nil { 2667 return nil, gensupport.WrapError(err) 2668 } 2669 ret := &GoogleMapsPlacesV1Place{ 2670 ServerResponse: googleapi.ServerResponse{ 2671 Header: res.Header, 2672 HTTPStatusCode: res.StatusCode, 2673 }, 2674 } 2675 target := &ret 2676 if err := gensupport.DecodeResponse(target, res); err != nil { 2677 return nil, err 2678 } 2679 return ret, nil 2680 } 2681 2682 type PlacesSearchNearbyCall struct { 2683 s *Service 2684 googlemapsplacesv1searchnearbyrequest *GoogleMapsPlacesV1SearchNearbyRequest 2685 urlParams_ gensupport.URLParams 2686 ctx_ context.Context 2687 header_ http.Header 2688 } 2689 2690 // SearchNearby: Search for places near locations. 2691 func (r *PlacesService) SearchNearby(googlemapsplacesv1searchnearbyrequest *GoogleMapsPlacesV1SearchNearbyRequest) *PlacesSearchNearbyCall { 2692 c := &PlacesSearchNearbyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2693 c.googlemapsplacesv1searchnearbyrequest = googlemapsplacesv1searchnearbyrequest 2694 return c 2695 } 2696 2697 // Fields allows partial responses to be retrieved. See 2698 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2699 // details. 2700 func (c *PlacesSearchNearbyCall) Fields(s ...googleapi.Field) *PlacesSearchNearbyCall { 2701 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2702 return c 2703 } 2704 2705 // Context sets the context to be used in this call's Do method. 2706 func (c *PlacesSearchNearbyCall) Context(ctx context.Context) *PlacesSearchNearbyCall { 2707 c.ctx_ = ctx 2708 return c 2709 } 2710 2711 // Header returns a http.Header that can be modified by the caller to add 2712 // headers to the request. 2713 func (c *PlacesSearchNearbyCall) Header() http.Header { 2714 if c.header_ == nil { 2715 c.header_ = make(http.Header) 2716 } 2717 return c.header_ 2718 } 2719 2720 func (c *PlacesSearchNearbyCall) doRequest(alt string) (*http.Response, error) { 2721 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2722 var body io.Reader = nil 2723 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlemapsplacesv1searchnearbyrequest) 2724 if err != nil { 2725 return nil, err 2726 } 2727 c.urlParams_.Set("alt", alt) 2728 c.urlParams_.Set("prettyPrint", "false") 2729 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/places:searchNearby") 2730 urls += "?" + c.urlParams_.Encode() 2731 req, err := http.NewRequest("POST", urls, body) 2732 if err != nil { 2733 return nil, err 2734 } 2735 req.Header = reqHeaders 2736 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2737 } 2738 2739 // Do executes the "places.places.searchNearby" call. 2740 // Any non-2xx status code is an error. Response headers are in either 2741 // *GoogleMapsPlacesV1SearchNearbyResponse.ServerResponse.Header or (if a 2742 // response was returned at all) in error.(*googleapi.Error).Header. Use 2743 // googleapi.IsNotModified to check whether the returned error was because 2744 // http.StatusNotModified was returned. 2745 func (c *PlacesSearchNearbyCall) Do(opts ...googleapi.CallOption) (*GoogleMapsPlacesV1SearchNearbyResponse, error) { 2746 gensupport.SetOptions(c.urlParams_, opts...) 2747 res, err := c.doRequest("json") 2748 if res != nil && res.StatusCode == http.StatusNotModified { 2749 if res.Body != nil { 2750 res.Body.Close() 2751 } 2752 return nil, gensupport.WrapError(&googleapi.Error{ 2753 Code: res.StatusCode, 2754 Header: res.Header, 2755 }) 2756 } 2757 if err != nil { 2758 return nil, err 2759 } 2760 defer googleapi.CloseBody(res) 2761 if err := googleapi.CheckResponse(res); err != nil { 2762 return nil, gensupport.WrapError(err) 2763 } 2764 ret := &GoogleMapsPlacesV1SearchNearbyResponse{ 2765 ServerResponse: googleapi.ServerResponse{ 2766 Header: res.Header, 2767 HTTPStatusCode: res.StatusCode, 2768 }, 2769 } 2770 target := &ret 2771 if err := gensupport.DecodeResponse(target, res); err != nil { 2772 return nil, err 2773 } 2774 return ret, nil 2775 } 2776 2777 type PlacesSearchTextCall struct { 2778 s *Service 2779 googlemapsplacesv1searchtextrequest *GoogleMapsPlacesV1SearchTextRequest 2780 urlParams_ gensupport.URLParams 2781 ctx_ context.Context 2782 header_ http.Header 2783 } 2784 2785 // SearchText: Text query based place search. 2786 func (r *PlacesService) SearchText(googlemapsplacesv1searchtextrequest *GoogleMapsPlacesV1SearchTextRequest) *PlacesSearchTextCall { 2787 c := &PlacesSearchTextCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2788 c.googlemapsplacesv1searchtextrequest = googlemapsplacesv1searchtextrequest 2789 return c 2790 } 2791 2792 // Fields allows partial responses to be retrieved. See 2793 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2794 // details. 2795 func (c *PlacesSearchTextCall) Fields(s ...googleapi.Field) *PlacesSearchTextCall { 2796 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2797 return c 2798 } 2799 2800 // Context sets the context to be used in this call's Do method. 2801 func (c *PlacesSearchTextCall) Context(ctx context.Context) *PlacesSearchTextCall { 2802 c.ctx_ = ctx 2803 return c 2804 } 2805 2806 // Header returns a http.Header that can be modified by the caller to add 2807 // headers to the request. 2808 func (c *PlacesSearchTextCall) Header() http.Header { 2809 if c.header_ == nil { 2810 c.header_ = make(http.Header) 2811 } 2812 return c.header_ 2813 } 2814 2815 func (c *PlacesSearchTextCall) doRequest(alt string) (*http.Response, error) { 2816 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2817 var body io.Reader = nil 2818 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlemapsplacesv1searchtextrequest) 2819 if err != nil { 2820 return nil, err 2821 } 2822 c.urlParams_.Set("alt", alt) 2823 c.urlParams_.Set("prettyPrint", "false") 2824 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/places:searchText") 2825 urls += "?" + c.urlParams_.Encode() 2826 req, err := http.NewRequest("POST", urls, body) 2827 if err != nil { 2828 return nil, err 2829 } 2830 req.Header = reqHeaders 2831 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2832 } 2833 2834 // Do executes the "places.places.searchText" call. 2835 // Any non-2xx status code is an error. Response headers are in either 2836 // *GoogleMapsPlacesV1SearchTextResponse.ServerResponse.Header or (if a 2837 // response was returned at all) in error.(*googleapi.Error).Header. Use 2838 // googleapi.IsNotModified to check whether the returned error was because 2839 // http.StatusNotModified was returned. 2840 func (c *PlacesSearchTextCall) Do(opts ...googleapi.CallOption) (*GoogleMapsPlacesV1SearchTextResponse, error) { 2841 gensupport.SetOptions(c.urlParams_, opts...) 2842 res, err := c.doRequest("json") 2843 if res != nil && res.StatusCode == http.StatusNotModified { 2844 if res.Body != nil { 2845 res.Body.Close() 2846 } 2847 return nil, gensupport.WrapError(&googleapi.Error{ 2848 Code: res.StatusCode, 2849 Header: res.Header, 2850 }) 2851 } 2852 if err != nil { 2853 return nil, err 2854 } 2855 defer googleapi.CloseBody(res) 2856 if err := googleapi.CheckResponse(res); err != nil { 2857 return nil, gensupport.WrapError(err) 2858 } 2859 ret := &GoogleMapsPlacesV1SearchTextResponse{ 2860 ServerResponse: googleapi.ServerResponse{ 2861 Header: res.Header, 2862 HTTPStatusCode: res.StatusCode, 2863 }, 2864 } 2865 target := &ret 2866 if err := gensupport.DecodeResponse(target, res); err != nil { 2867 return nil, err 2868 } 2869 return ret, nil 2870 } 2871 2872 // Pages invokes f for each page of results. 2873 // A non-nil error returned from f will halt the iteration. 2874 // The provided context supersedes any context provided to the Context method. 2875 func (c *PlacesSearchTextCall) Pages(ctx context.Context, f func(*GoogleMapsPlacesV1SearchTextResponse) error) error { 2876 c.ctx_ = ctx 2877 defer func(pt string) { c.googlemapsplacesv1searchtextrequest.PageToken = pt }(c.googlemapsplacesv1searchtextrequest.PageToken) 2878 for { 2879 x, err := c.Do() 2880 if err != nil { 2881 return err 2882 } 2883 if err := f(x); err != nil { 2884 return err 2885 } 2886 if x.NextPageToken == "" { 2887 return nil 2888 } 2889 c.googlemapsplacesv1searchtextrequest.PageToken = x.NextPageToken 2890 } 2891 } 2892 2893 type PlacesPhotosGetMediaCall struct { 2894 s *Service 2895 name string 2896 urlParams_ gensupport.URLParams 2897 ifNoneMatch_ string 2898 ctx_ context.Context 2899 header_ http.Header 2900 } 2901 2902 // GetMedia: Get a photo media with a photo reference string. 2903 // 2904 // - name: The resource name of a photo media in the format: 2905 // `places/{place_id}/photos/{photo_reference}/media`. The resource name of a 2906 // photo as returned in a Place object's `photos.name` field comes with the 2907 // format `places/{place_id}/photos/{photo_reference}`. You need to append 2908 // `/media` at the end of the photo resource to get the photo media resource 2909 // name. 2910 func (r *PlacesPhotosService) GetMedia(name string) *PlacesPhotosGetMediaCall { 2911 c := &PlacesPhotosGetMediaCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2912 c.name = name 2913 return c 2914 } 2915 2916 // MaxHeightPx sets the optional parameter "maxHeightPx": Specifies the maximum 2917 // desired height, in pixels, of the image. If the image is smaller than the 2918 // values specified, the original image will be returned. If the image is 2919 // larger in either dimension, it will be scaled to match the smaller of the 2920 // two dimensions, restricted to its original aspect ratio. Both the 2921 // max_height_px and max_width_px properties accept an integer between 1 and 2922 // 4800, inclusively. If the value is not within the allowed range, an 2923 // INVALID_ARGUMENT error will be returned. At least one of max_height_px or 2924 // max_width_px needs to be specified. If neither max_height_px nor 2925 // max_width_px is specified, an INVALID_ARGUMENT error will be returned. 2926 func (c *PlacesPhotosGetMediaCall) MaxHeightPx(maxHeightPx int64) *PlacesPhotosGetMediaCall { 2927 c.urlParams_.Set("maxHeightPx", fmt.Sprint(maxHeightPx)) 2928 return c 2929 } 2930 2931 // MaxWidthPx sets the optional parameter "maxWidthPx": Specifies the maximum 2932 // desired width, in pixels, of the image. If the image is smaller than the 2933 // values specified, the original image will be returned. If the image is 2934 // larger in either dimension, it will be scaled to match the smaller of the 2935 // two dimensions, restricted to its original aspect ratio. Both the 2936 // max_height_px and max_width_px properties accept an integer between 1 and 2937 // 4800, inclusively. If the value is not within the allowed range, an 2938 // INVALID_ARGUMENT error will be returned. At least one of max_height_px or 2939 // max_width_px needs to be specified. If neither max_height_px nor 2940 // max_width_px is specified, an INVALID_ARGUMENT error will be returned. 2941 func (c *PlacesPhotosGetMediaCall) MaxWidthPx(maxWidthPx int64) *PlacesPhotosGetMediaCall { 2942 c.urlParams_.Set("maxWidthPx", fmt.Sprint(maxWidthPx)) 2943 return c 2944 } 2945 2946 // SkipHttpRedirect sets the optional parameter "skipHttpRedirect": If set, 2947 // skip the default HTTP redirect behavior and render a text format (for 2948 // example, in JSON format for HTTP use case) response. If not set, an HTTP 2949 // redirect will be issued to redirect the call to the image media. This option 2950 // is ignored for non-HTTP requests. 2951 func (c *PlacesPhotosGetMediaCall) SkipHttpRedirect(skipHttpRedirect bool) *PlacesPhotosGetMediaCall { 2952 c.urlParams_.Set("skipHttpRedirect", fmt.Sprint(skipHttpRedirect)) 2953 return c 2954 } 2955 2956 // Fields allows partial responses to be retrieved. See 2957 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2958 // details. 2959 func (c *PlacesPhotosGetMediaCall) Fields(s ...googleapi.Field) *PlacesPhotosGetMediaCall { 2960 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2961 return c 2962 } 2963 2964 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2965 // object's ETag matches the given value. This is useful for getting updates 2966 // only after the object has changed since the last request. 2967 func (c *PlacesPhotosGetMediaCall) IfNoneMatch(entityTag string) *PlacesPhotosGetMediaCall { 2968 c.ifNoneMatch_ = entityTag 2969 return c 2970 } 2971 2972 // Context sets the context to be used in this call's Do method. 2973 func (c *PlacesPhotosGetMediaCall) Context(ctx context.Context) *PlacesPhotosGetMediaCall { 2974 c.ctx_ = ctx 2975 return c 2976 } 2977 2978 // Header returns a http.Header that can be modified by the caller to add 2979 // headers to the request. 2980 func (c *PlacesPhotosGetMediaCall) Header() http.Header { 2981 if c.header_ == nil { 2982 c.header_ = make(http.Header) 2983 } 2984 return c.header_ 2985 } 2986 2987 func (c *PlacesPhotosGetMediaCall) doRequest(alt string) (*http.Response, error) { 2988 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2989 if c.ifNoneMatch_ != "" { 2990 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2991 } 2992 var body io.Reader = nil 2993 c.urlParams_.Set("alt", alt) 2994 c.urlParams_.Set("prettyPrint", "false") 2995 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 2996 urls += "?" + c.urlParams_.Encode() 2997 req, err := http.NewRequest("GET", urls, body) 2998 if err != nil { 2999 return nil, err 3000 } 3001 req.Header = reqHeaders 3002 googleapi.Expand(req.URL, map[string]string{ 3003 "name": c.name, 3004 }) 3005 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3006 } 3007 3008 // Do executes the "places.places.photos.getMedia" call. 3009 // Any non-2xx status code is an error. Response headers are in either 3010 // *GoogleMapsPlacesV1PhotoMedia.ServerResponse.Header or (if a response was 3011 // returned at all) in error.(*googleapi.Error).Header. Use 3012 // googleapi.IsNotModified to check whether the returned error was because 3013 // http.StatusNotModified was returned. 3014 func (c *PlacesPhotosGetMediaCall) Do(opts ...googleapi.CallOption) (*GoogleMapsPlacesV1PhotoMedia, error) { 3015 gensupport.SetOptions(c.urlParams_, opts...) 3016 res, err := c.doRequest("json") 3017 if res != nil && res.StatusCode == http.StatusNotModified { 3018 if res.Body != nil { 3019 res.Body.Close() 3020 } 3021 return nil, gensupport.WrapError(&googleapi.Error{ 3022 Code: res.StatusCode, 3023 Header: res.Header, 3024 }) 3025 } 3026 if err != nil { 3027 return nil, err 3028 } 3029 defer googleapi.CloseBody(res) 3030 if err := googleapi.CheckResponse(res); err != nil { 3031 return nil, gensupport.WrapError(err) 3032 } 3033 ret := &GoogleMapsPlacesV1PhotoMedia{ 3034 ServerResponse: googleapi.ServerResponse{ 3035 Header: res.Header, 3036 HTTPStatusCode: res.StatusCode, 3037 }, 3038 } 3039 target := &ret 3040 if err := gensupport.DecodeResponse(target, res); err != nil { 3041 return nil, err 3042 } 3043 return ret, nil 3044 } 3045