forked from googleapis/google-api-go-client
/
places-gen.go
2696 lines (2355 loc) · 115 KB
/
places-gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2023 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated file. DO NOT EDIT.
// Package places provides access to the Places API (New).
//
// For product documentation, see: https://mapsplatform.google.com/maps-products/#places-section
//
// # Library status
//
// These client libraries are officially supported by Google. However, this
// library is considered complete and is in maintenance mode. This means
// that we will address critical bugs and security issues but will not add
// any new features.
//
// When possible, we recommend using our newer
// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
// that are still actively being worked and iterated on.
//
// # Creating a client
//
// Usage example:
//
// import "google.golang.org/api/places/v1"
// ...
// ctx := context.Background()
// placesService, err := places.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for
// authentication. For information on how to create and obtain Application
// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// # Other authentication options
//
// By default, all available scopes (see "Constants") are used to authenticate.
// To restrict scopes, use [google.golang.org/api/option.WithScopes]:
//
// placesService, err := places.NewService(ctx, option.WithScopes(places.MapsPlatformPlacesTextsearchScope))
//
// To use an API key for authentication (note: some APIs do not support API
// keys), use [google.golang.org/api/option.WithAPIKey]:
//
// placesService, err := places.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
// flow, use [google.golang.org/api/option.WithTokenSource]:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// placesService, err := places.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See [google.golang.org/api/option.ClientOption] for details on options.
package places // import "google.golang.org/api/places/v1"
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
googleapi "google.golang.org/api/googleapi"
internal "github.com/RunCanopy/google-api-go-client/internal"
gensupport "github.com/RunCanopy/google-api-go-client/internal/gensupport"
option "google.golang.org/api/option"
internaloption "google.golang.org/api/option/internaloption"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
var _ = internaloption.WithDefaultEndpoint
var _ = internal.Version
const apiId = "places:v1"
const apiName = "places"
const apiVersion = "v1"
const basePath = "https://places.googleapis.com/"
const mtlsBasePath = "https://places.mtls.googleapis.com/"
// OAuth2 scopes used by this API.
const (
// See, edit, configure, and delete your Google Cloud data and see the
// email address for your Google Account.
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
// Private Service: https://www.googleapis.com/auth/maps-platform.places
MapsPlatformPlacesScope = "https://www.googleapis.com/auth/maps-platform.places"
// Private Service:
// https://www.googleapis.com/auth/maps-platform.places.details
MapsPlatformPlacesDetailsScope = "https://www.googleapis.com/auth/maps-platform.places.details"
// Private Service:
// https://www.googleapis.com/auth/maps-platform.places.nearbysearch
MapsPlatformPlacesNearbysearchScope = "https://www.googleapis.com/auth/maps-platform.places.nearbysearch"
// Private Service:
// https://www.googleapis.com/auth/maps-platform.places.textsearch
MapsPlatformPlacesTextsearchScope = "https://www.googleapis.com/auth/maps-platform.places.textsearch"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := internaloption.WithDefaultScopes(
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/maps-platform.places",
"https://www.googleapis.com/auth/maps-platform.places.details",
"https://www.googleapis.com/auth/maps-platform.places.nearbysearch",
"https://www.googleapis.com/auth/maps-platform.places.textsearch",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Places = NewPlacesService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Places *PlacesService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewPlacesService(s *Service) *PlacesService {
rs := &PlacesService{s: s}
rs.Photos = NewPlacesPhotosService(s)
return rs
}
type PlacesService struct {
s *Service
Photos *PlacesPhotosService
}
func NewPlacesPhotosService(s *Service) *PlacesPhotosService {
rs := &PlacesPhotosService{s: s}
return rs
}
type PlacesPhotosService struct {
s *Service
}
// GoogleGeoTypeViewport: A latitude-longitude viewport, represented as
// two diagonally opposite `low` and `high` points. A viewport is
// considered a closed region, i.e. it includes its boundary. The
// latitude bounds must range between -90 to 90 degrees inclusive, and
// the longitude bounds must range between -180 to 180 degrees
// inclusive. Various cases include: - If `low` = `high`, the viewport
// consists of that single point. - If `low.longitude` >
// `high.longitude`, the longitude range is inverted (the viewport
// crosses the 180 degree longitude line). - If `low.longitude` = -180
// degrees and `high.longitude` = 180 degrees, the viewport includes all
// longitudes. - If `low.longitude` = 180 degrees and `high.longitude` =
// -180 degrees, the longitude range is empty. - If `low.latitude` >
// `high.latitude`, the latitude range is empty. Both `low` and `high`
// must be populated, and the represented box cannot be empty (as
// specified by the definitions above). An empty viewport will result in
// an error. For example, this viewport fully encloses New York City: {
// "low": { "latitude": 40.477398, "longitude": -74.259087 }, "high": {
// "latitude": 40.91618, "longitude": -73.70018 } }
type GoogleGeoTypeViewport struct {
// High: Required. The high point of the viewport.
High *GoogleTypeLatLng `json:"high,omitempty"`
// Low: Required. The low point of the viewport.
Low *GoogleTypeLatLng `json:"low,omitempty"`
// ForceSendFields is a list of field names (e.g. "High") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "High") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleGeoTypeViewport) MarshalJSON() ([]byte, error) {
type NoMethod GoogleGeoTypeViewport
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleMapsPlacesV1AuthorAttribution: Information about the author of
// the UGC data. Used in Photo, and Review.
type GoogleMapsPlacesV1AuthorAttribution struct {
// DisplayName: Name of the author of the Photo or Review.
DisplayName string `json:"displayName,omitempty"`
// PhotoUri: Profile photo URI of the author of the Photo or Review.
PhotoUri string `json:"photoUri,omitempty"`
// Uri: URI of the author of the Photo or Review.
Uri string `json:"uri,omitempty"`
// ForceSendFields is a list of field names (e.g. "DisplayName") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DisplayName") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleMapsPlacesV1AuthorAttribution) MarshalJSON() ([]byte, error) {
type NoMethod GoogleMapsPlacesV1AuthorAttribution
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleMapsPlacesV1Circle: Circle with a LatLng as center and radius.
type GoogleMapsPlacesV1Circle struct {
// Center: Required. Center latitude and longitude. The range of
// latitude must be within [-90.0, 90.0]. The range of the longitude
// must be within [-180.0, 180.0].
Center *GoogleTypeLatLng `json:"center,omitempty"`
// Radius: Required. Radius measured in meters. The radius must be
// within [0.0, 50000.0].
Radius float64 `json:"radius,omitempty"`
// ForceSendFields is a list of field names (e.g. "Center") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Center") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleMapsPlacesV1Circle) MarshalJSON() ([]byte, error) {
type NoMethod GoogleMapsPlacesV1Circle
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *GoogleMapsPlacesV1Circle) UnmarshalJSON(data []byte) error {
type NoMethod GoogleMapsPlacesV1Circle
var s1 struct {
Radius gensupport.JSONFloat64 `json:"radius"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.Radius = float64(s1.Radius)
return nil
}
// GoogleMapsPlacesV1EVChargeOptions: Information about the EV Charge
// Station hosted in Place. Terminology follows
// https://afdc.energy.gov/fuels/electricity_infrastructure.html One
// port could charge one car at a time. One port has one or more
// connectors. One station has one or more ports.
type GoogleMapsPlacesV1EVChargeOptions struct {
// ConnectorAggregation: A list of EV charging connector aggregations
// that contain connectors of the same type and same charge rate.
ConnectorAggregation []*GoogleMapsPlacesV1EVChargeOptionsConnectorAggregation `json:"connectorAggregation,omitempty"`
// ConnectorCount: Number of connectors at this station. However,
// because some ports can have multiple connectors but only be able to
// charge one car at a time (e.g.) the number of connectors may be
// greater than the total number of cars which can charge
// simultaneously.
ConnectorCount int64 `json:"connectorCount,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "ConnectorAggregation") to unconditionally include in API requests.
// By default, fields with empty or default values are omitted from API
// requests. However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ConnectorAggregation") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *GoogleMapsPlacesV1EVChargeOptions) MarshalJSON() ([]byte, error) {
type NoMethod GoogleMapsPlacesV1EVChargeOptions
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleMapsPlacesV1EVChargeOptionsConnectorAggregation: EV charging
// information grouped by [type, max_charge_rate_kw]. Shows EV charge
// aggregation of connectors that have the same type and max charge rate
// in kw.
type GoogleMapsPlacesV1EVChargeOptionsConnectorAggregation struct {
// AvailabilityLastUpdateTime: The timestamp when the connector
// availability information in this aggregation was last updated.
AvailabilityLastUpdateTime string `json:"availabilityLastUpdateTime,omitempty"`
// AvailableCount: Number of connectors in this aggregation that are
// currently available.
AvailableCount int64 `json:"availableCount,omitempty"`
// Count: Number of connectors in this aggregation.
Count int64 `json:"count,omitempty"`
// MaxChargeRateKw: The static max charging rate in kw of each connector
// in the aggregation.
MaxChargeRateKw float64 `json:"maxChargeRateKw,omitempty"`
// OutOfServiceCount: Number of connectors in this aggregation that are
// currently out of service.
OutOfServiceCount int64 `json:"outOfServiceCount,omitempty"`
// Type: The connector type of this aggregation.
//
// Possible values:
// "EV_CONNECTOR_TYPE_UNSPECIFIED" - Unspecified connector.
// "EV_CONNECTOR_TYPE_OTHER" - Other connector types.
// "EV_CONNECTOR_TYPE_J1772" - J1772 type 1 connector.
// "EV_CONNECTOR_TYPE_TYPE_2" - IEC 62196 type 2 connector. Often
// referred to as MENNEKES.
// "EV_CONNECTOR_TYPE_CHADEMO" - CHAdeMO type connector.
// "EV_CONNECTOR_TYPE_CCS_COMBO_1" - Combined Charging System (AC and
// DC). Based on SAE. Type-1 J-1772 connector
// "EV_CONNECTOR_TYPE_CCS_COMBO_2" - Combined Charging System (AC and
// DC). Based on Type-2 Mennekes connector
// "EV_CONNECTOR_TYPE_TESLA" - The generic TESLA connector. This is
// NACS in the North America but can be non-NACS in other parts of the
// world (e.g. CCS Combo 2 (CCS2) or GB/T). This value is less
// representative of an actual connector type, and more represents the
// ability to charge a Tesla brand vehicle at a Tesla owned charging
// station.
// "EV_CONNECTOR_TYPE_UNSPECIFIED_GB_T" - GB/T type corresponds to the
// GB/T standard in China. This type covers all GB_T types.
// "EV_CONNECTOR_TYPE_UNSPECIFIED_WALL_OUTLET" - Unspecified wall
// outlet.
Type string `json:"type,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "AvailabilityLastUpdateTime") to unconditionally include in API
// requests. By default, fields with empty or default values are omitted
// from API requests. However, any non-pointer, non-interface field
// appearing in ForceSendFields will be sent to the server regardless of
// whether the field is empty or not. This may be used to include empty
// fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g.
// "AvailabilityLastUpdateTime") to include in API requests with the
// JSON null value. By default, fields with empty values are omitted
// from API requests. However, any field with an empty value appearing
// in NullFields will be sent to the server as null. It is an error if a
// field in this list has a non-empty value. This may be used to include
// null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleMapsPlacesV1EVChargeOptionsConnectorAggregation) MarshalJSON() ([]byte, error) {
type NoMethod GoogleMapsPlacesV1EVChargeOptionsConnectorAggregation
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *GoogleMapsPlacesV1EVChargeOptionsConnectorAggregation) UnmarshalJSON(data []byte) error {
type NoMethod GoogleMapsPlacesV1EVChargeOptionsConnectorAggregation
var s1 struct {
MaxChargeRateKw gensupport.JSONFloat64 `json:"maxChargeRateKw"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.MaxChargeRateKw = float64(s1.MaxChargeRateKw)
return nil
}
// GoogleMapsPlacesV1FuelOptions: The most recent information about fuel
// options in a gas station. This information is updated regularly.
type GoogleMapsPlacesV1FuelOptions struct {
// FuelPrices: The last known fuel price for each type of fuel this
// station has. There is one entry per fuel type this station has. Order
// is not important.
FuelPrices []*GoogleMapsPlacesV1FuelOptionsFuelPrice `json:"fuelPrices,omitempty"`
// ForceSendFields is a list of field names (e.g. "FuelPrices") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "FuelPrices") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleMapsPlacesV1FuelOptions) MarshalJSON() ([]byte, error) {
type NoMethod GoogleMapsPlacesV1FuelOptions
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleMapsPlacesV1FuelOptionsFuelPrice: Fuel price information for a
// given type.
type GoogleMapsPlacesV1FuelOptionsFuelPrice struct {
// Price: The price of the fuel.
Price *GoogleTypeMoney `json:"price,omitempty"`
// Type: The type of fuel.
//
// Possible values:
// "FUEL_TYPE_UNSPECIFIED" - Unspecified fuel type.
// "DIESEL" - Diesel fuel.
// "REGULAR_UNLEADED" - Regular unleaded.
// "MIDGRADE" - Midgrade.
// "PREMIUM" - Premium.
// "SP91" - SP 91.
// "SP91_E10" - SP 91 E10.
// "SP92" - SP 92.
// "SP95" - SP 95.
// "SP95_E10" - SP95 E10.
// "SP98" - SP 98.
// "SP99" - SP 99.
// "SP100" - SP 100.
// "LPG" - LPG.
// "E80" - E 80.
// "E85" - E 85.
// "METHANE" - Methane.
// "BIO_DIESEL" - Bio-diesel.
// "TRUCK_DIESEL" - Truck diesel.
Type string `json:"type,omitempty"`
// UpdateTime: The time the fuel price was last updated.
UpdateTime string `json:"updateTime,omitempty"`
// ForceSendFields is a list of field names (e.g. "Price") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Price") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleMapsPlacesV1FuelOptionsFuelPrice) MarshalJSON() ([]byte, error) {
type NoMethod GoogleMapsPlacesV1FuelOptionsFuelPrice
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleMapsPlacesV1Photo: Information about a photo of a place.
type GoogleMapsPlacesV1Photo struct {
// AuthorAttributions: This photo's authors.
AuthorAttributions []*GoogleMapsPlacesV1AuthorAttribution `json:"authorAttributions,omitempty"`
// HeightPx: The maximum available height, in pixels.
HeightPx int64 `json:"heightPx,omitempty"`
// Name: Identifier. A reference representing this place photo which may
// be used to look up this place photo again (a.k.a. the API "resource"
// name: places/{place_id}/photos/{photo}).
Name string `json:"name,omitempty"`
// WidthPx: The maximum available width, in pixels.
WidthPx int64 `json:"widthPx,omitempty"`
// ForceSendFields is a list of field names (e.g. "AuthorAttributions")
// to unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AuthorAttributions") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *GoogleMapsPlacesV1Photo) MarshalJSON() ([]byte, error) {
type NoMethod GoogleMapsPlacesV1Photo
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleMapsPlacesV1PhotoMedia: A photo media from Places API.
type GoogleMapsPlacesV1PhotoMedia struct {
// Name: The resource name of a photo media in the format:
// `places/place_id/photos/photo_reference/media`.
Name string `json:"name,omitempty"`
// PhotoUri: A short-lived uri that can be used to render the photo.
PhotoUri string `json:"photoUri,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Name") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Name") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleMapsPlacesV1PhotoMedia) MarshalJSON() ([]byte, error) {
type NoMethod GoogleMapsPlacesV1PhotoMedia
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleMapsPlacesV1Place: All the information representing a Place.
type GoogleMapsPlacesV1Place struct {
// AccessibilityOptions: Information about the accessibility options a
// place offers.
AccessibilityOptions *GoogleMapsPlacesV1PlaceAccessibilityOptions `json:"accessibilityOptions,omitempty"`
// AddressComponents: Repeated components for each locality level. Note
// the following facts about the address_components[] array: - The array
// of address components may contain more components than the
// formatted_address. - The array does not necessarily include all the
// political entities that contain an address, apart from those included
// in the formatted_address. To retrieve all the political entities that
// contain a specific address, you should use reverse geocoding, passing
// the latitude/longitude of the address as a parameter to the request.
// - The format of the response is not guaranteed to remain the same
// between requests. In particular, the number of address_components
// varies based on the address requested and can change over time for
// the same address. A component can change position in the array. The
// type of the component can change. A particular component may be
// missing in a later response.
AddressComponents []*GoogleMapsPlacesV1PlaceAddressComponent `json:"addressComponents,omitempty"`
// AdrFormatAddress: The place's address in adr microformat:
// http://microformats.org/wiki/adr.
AdrFormatAddress string `json:"adrFormatAddress,omitempty"`
// AllowsDogs: Place allows dogs.
AllowsDogs bool `json:"allowsDogs,omitempty"`
// Attributions: A set of data provider that must be shown with this
// result.
Attributions []*GoogleMapsPlacesV1PlaceAttribution `json:"attributions,omitempty"`
// BusinessStatus: The business status for the place.
//
// Possible values:
// "BUSINESS_STATUS_UNSPECIFIED" - Default value. This value is
// unused.
// "OPERATIONAL" - The establishment is operational, not necessarily
// open now.
// "CLOSED_TEMPORARILY" - The establishment is temporarily closed.
// "CLOSED_PERMANENTLY" - The establishment is permanently closed.
BusinessStatus string `json:"businessStatus,omitempty"`
// CurbsidePickup: Specifies if the business supports curbside pickup.
CurbsidePickup bool `json:"curbsidePickup,omitempty"`
// CurrentOpeningHours: The hours of operation for the next seven days
// (including today). The time period starts at midnight on the date of
// the request and ends at 11:59 pm six days later. This field includes
// the special_days subfield of all hours, set for dates that have
// exceptional hours.
CurrentOpeningHours *GoogleMapsPlacesV1PlaceOpeningHours `json:"currentOpeningHours,omitempty"`
// CurrentSecondaryOpeningHours: Contains an array of entries for the
// next seven days including information about secondary hours of a
// business. Secondary hours are different from a business's main hours.
// For example, a restaurant can specify drive through hours or delivery
// hours as its secondary hours. This field populates the type subfield,
// which draws from a predefined list of opening hours types (such as
// DRIVE_THROUGH, PICKUP, or TAKEOUT) based on the types of the place.
// This field includes the special_days subfield of all hours, set for
// dates that have exceptional hours.
CurrentSecondaryOpeningHours []*GoogleMapsPlacesV1PlaceOpeningHours `json:"currentSecondaryOpeningHours,omitempty"`
// Delivery: Specifies if the business supports delivery.
Delivery bool `json:"delivery,omitempty"`
// DineIn: Specifies if the business supports indoor or outdoor seating
// options.
DineIn bool `json:"dineIn,omitempty"`
// DisplayName: The localized name of the place, suitable as a short
// human-readable description. For example, "Google Sydney",
// "Starbucks", "Pyrmont", etc.
DisplayName *GoogleTypeLocalizedText `json:"displayName,omitempty"`
// EditorialSummary: Contains a summary of the place. A summary is
// comprised of a textual overview, and also includes the language code
// for these if applicable. Summary text must be presented as-is and can
// not be modified or altered.
EditorialSummary *GoogleTypeLocalizedText `json:"editorialSummary,omitempty"`
// EvChargeOptions: Information of ev charging options.
EvChargeOptions *GoogleMapsPlacesV1EVChargeOptions `json:"evChargeOptions,omitempty"`
// FormattedAddress: A full, human-readable address for this place.
FormattedAddress string `json:"formattedAddress,omitempty"`
// FuelOptions: The most recent information about fuel options in a gas
// station. This information is updated regularly.
FuelOptions *GoogleMapsPlacesV1FuelOptions `json:"fuelOptions,omitempty"`
// GoodForChildren: Place is good for children.
GoodForChildren bool `json:"goodForChildren,omitempty"`
// GoodForGroups: Place accommodates groups.
GoodForGroups bool `json:"goodForGroups,omitempty"`
// GoodForWatchingSports: Place is suitable for watching sports.
GoodForWatchingSports bool `json:"goodForWatchingSports,omitempty"`
// GoogleMapsUri: A URL providing more information about this place.
GoogleMapsUri string `json:"googleMapsUri,omitempty"`
// IconBackgroundColor: Background color for icon_mask in hex format,
// e.g. #909CE1.
IconBackgroundColor string `json:"iconBackgroundColor,omitempty"`
// IconMaskBaseUri: A truncated URL to an icon mask. User can access
// different icon type by appending type suffix to the end (eg, ".svg"
// or ".png").
IconMaskBaseUri string `json:"iconMaskBaseUri,omitempty"`
// Id: The unique identifier of a place.
Id string `json:"id,omitempty"`
// InternationalPhoneNumber: A human-readable phone number for the
// place, in international format.
InternationalPhoneNumber string `json:"internationalPhoneNumber,omitempty"`
// LiveMusic: Place provides live music.
LiveMusic bool `json:"liveMusic,omitempty"`
// Location: The position of this place.
Location *GoogleTypeLatLng `json:"location,omitempty"`
// MenuForChildren: Place has a children's menu.
MenuForChildren bool `json:"menuForChildren,omitempty"`
// Name: An ID representing this place which may be used to look up this
// place again (a.k.a. the API "resource" name: places/place_id).
Name string `json:"name,omitempty"`
// NationalPhoneNumber: A human-readable phone number for the place, in
// national format.
NationalPhoneNumber string `json:"nationalPhoneNumber,omitempty"`
// OutdoorSeating: Place provides outdoor seating.
OutdoorSeating bool `json:"outdoorSeating,omitempty"`
// ParkingOptions: Options of parking provided by the place.
ParkingOptions *GoogleMapsPlacesV1PlaceParkingOptions `json:"parkingOptions,omitempty"`
// PaymentOptions: Payment options the place accepts. If a payment
// option data is not available, the payment option field will be unset.
PaymentOptions *GoogleMapsPlacesV1PlacePaymentOptions `json:"paymentOptions,omitempty"`
// Photos: Information (including references) about photos of this
// place.
Photos []*GoogleMapsPlacesV1Photo `json:"photos,omitempty"`
// PlusCode: Plus code of the place location lat/long.
PlusCode *GoogleMapsPlacesV1PlacePlusCode `json:"plusCode,omitempty"`
// PriceLevel: Price level of the place.
//
// Possible values:
// "PRICE_LEVEL_UNSPECIFIED" - Place price level is unspecified or
// unknown.
// "PRICE_LEVEL_FREE" - Place provides free services.
// "PRICE_LEVEL_INEXPENSIVE" - Place provides inexpensive services.
// "PRICE_LEVEL_MODERATE" - Place provides moderately priced services.
// "PRICE_LEVEL_EXPENSIVE" - Place provides expensive services.
// "PRICE_LEVEL_VERY_EXPENSIVE" - Place provides very expensive
// service s.
PriceLevel string `json:"priceLevel,omitempty"`
// PrimaryType: The primary type of the given result. This type must one
// of the Places API supported types. For example, "restaurant", "cafe",
// "airport", etc. A place can only have a single primary type. For the
// complete list of possible values, see Table A and Table B at
// https://developers.google.com/maps/documentation/places/web-service/place-types
PrimaryType string `json:"primaryType,omitempty"`
// PrimaryTypeDisplayName: The display name of the primary type,
// localized to the request language if applicable. For the complete
// list of possible values, see Table A and Table B at
// https://developers.google.com/maps/documentation/places/web-service/place-types
PrimaryTypeDisplayName *GoogleTypeLocalizedText `json:"primaryTypeDisplayName,omitempty"`
// Rating: A rating between 1.0 and 5.0, based on user reviews of this
// place.
Rating float64 `json:"rating,omitempty"`
// RegularOpeningHours: The regular hours of operation.
RegularOpeningHours *GoogleMapsPlacesV1PlaceOpeningHours `json:"regularOpeningHours,omitempty"`
// RegularSecondaryOpeningHours: Contains an array of entries for
// information about regular secondary hours of a business. Secondary
// hours are different from a business's main hours. For example, a
// restaurant can specify drive through hours or delivery hours as its
// secondary hours. This field populates the type subfield, which draws
// from a predefined list of opening hours types (such as DRIVE_THROUGH,
// PICKUP, or TAKEOUT) based on the types of the place.
RegularSecondaryOpeningHours []*GoogleMapsPlacesV1PlaceOpeningHours `json:"regularSecondaryOpeningHours,omitempty"`
// Reservable: Specifies if the place supports reservations.
Reservable bool `json:"reservable,omitempty"`
// Restroom: Place has restroom.
Restroom bool `json:"restroom,omitempty"`
// Reviews: List of reviews about this place, sorted by relevance.
Reviews []*GoogleMapsPlacesV1Review `json:"reviews,omitempty"`
// ServesBeer: Specifies if the place serves beer.
ServesBeer bool `json:"servesBeer,omitempty"`
// ServesBreakfast: Specifies if the place serves breakfast.
ServesBreakfast bool `json:"servesBreakfast,omitempty"`
// ServesBrunch: Specifies if the place serves brunch.
ServesBrunch bool `json:"servesBrunch,omitempty"`
// ServesCocktails: Place serves cocktails.
ServesCocktails bool `json:"servesCocktails,omitempty"`
// ServesCoffee: Place serves coffee.
ServesCoffee bool `json:"servesCoffee,omitempty"`
// ServesDessert: Place serves dessert.
ServesDessert bool `json:"servesDessert,omitempty"`
// ServesDinner: Specifies if the place serves dinner.
ServesDinner bool `json:"servesDinner,omitempty"`
// ServesLunch: Specifies if the place serves lunch.
ServesLunch bool `json:"servesLunch,omitempty"`
// ServesVegetarianFood: Specifies if the place serves vegetarian food.
ServesVegetarianFood bool `json:"servesVegetarianFood,omitempty"`
// ServesWine: Specifies if the place serves wine.
ServesWine bool `json:"servesWine,omitempty"`
// ShortFormattedAddress: A short, human-readable address for this
// place.
ShortFormattedAddress string `json:"shortFormattedAddress,omitempty"`
// SubDestinations: A list of sub destinations related to the place.
SubDestinations []*GoogleMapsPlacesV1PlaceSubDestination `json:"subDestinations,omitempty"`
// Takeout: Specifies if the business supports takeout.
Takeout bool `json:"takeout,omitempty"`
// Types: A set of type tags for this result. For example, "political"
// and "locality". For the complete list of possible values, see Table A
// and Table B at
// https://developers.google.com/maps/documentation/places/web-service/place-types
Types []string `json:"types,omitempty"`
// UserRatingCount: The total number of reviews (with or without text)
// for this place.
UserRatingCount int64 `json:"userRatingCount,omitempty"`
// UtcOffsetMinutes: Number of minutes this place's timezone is
// currently offset from UTC. This is expressed in minutes to support
// timezones that are offset by fractions of an hour, e.g. X hours and
// 15 minutes.
UtcOffsetMinutes int64 `json:"utcOffsetMinutes,omitempty"`
// Viewport: A viewport suitable for displaying the place on an
// average-sized map.
Viewport *GoogleGeoTypeViewport `json:"viewport,omitempty"`
// WebsiteUri: The authoritative website for this place, e.g. a
// business' homepage. Note that for places that are part of a chain
// (e.g. an IKEA store), this will usually be the website for the
// individual store, not the overall chain.
WebsiteUri string `json:"websiteUri,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g.
// "AccessibilityOptions") to unconditionally include in API requests.
// By default, fields with empty or default values are omitted from API
// requests. However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AccessibilityOptions") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *GoogleMapsPlacesV1Place) MarshalJSON() ([]byte, error) {
type NoMethod GoogleMapsPlacesV1Place
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *GoogleMapsPlacesV1Place) UnmarshalJSON(data []byte) error {
type NoMethod GoogleMapsPlacesV1Place
var s1 struct {
Rating gensupport.JSONFloat64 `json:"rating"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.Rating = float64(s1.Rating)
return nil
}
// GoogleMapsPlacesV1PlaceAccessibilityOptions: Information about the
// accessibility options a place offers.
type GoogleMapsPlacesV1PlaceAccessibilityOptions struct {
// WheelchairAccessibleEntrance: Places has wheelchair accessible
// entrance.
WheelchairAccessibleEntrance bool `json:"wheelchairAccessibleEntrance,omitempty"`
// WheelchairAccessibleParking: Place offers wheelchair accessible
// parking.
WheelchairAccessibleParking bool `json:"wheelchairAccessibleParking,omitempty"`
// WheelchairAccessibleRestroom: Place has wheelchair accessible
// restroom.
WheelchairAccessibleRestroom bool `json:"wheelchairAccessibleRestroom,omitempty"`
// WheelchairAccessibleSeating: Place has wheelchair accessible seating.
WheelchairAccessibleSeating bool `json:"wheelchairAccessibleSeating,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "WheelchairAccessibleEntrance") to unconditionally include in API
// requests. By default, fields with empty or default values are omitted
// from API requests. However, any non-pointer, non-interface field
// appearing in ForceSendFields will be sent to the server regardless of
// whether the field is empty or not. This may be used to include empty
// fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g.
// "WheelchairAccessibleEntrance") to include in API requests with the
// JSON null value. By default, fields with empty values are omitted
// from API requests. However, any field with an empty value appearing
// in NullFields will be sent to the server as null. It is an error if a
// field in this list has a non-empty value. This may be used to include
// null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleMapsPlacesV1PlaceAccessibilityOptions) MarshalJSON() ([]byte, error) {
type NoMethod GoogleMapsPlacesV1PlaceAccessibilityOptions
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleMapsPlacesV1PlaceAddressComponent: The structured components
// that form the formatted address, if this information is available.
type GoogleMapsPlacesV1PlaceAddressComponent struct {
// LanguageCode: The language used to format this components, in CLDR
// notation.
LanguageCode string `json:"languageCode,omitempty"`
// LongText: The full text description or name of the address component.
// For example, an address component for the country Australia may have
// a long_name of "Australia".
LongText string `json:"longText,omitempty"`
// ShortText: An abbreviated textual name for the address component, if
// available. For example, an address component for the country of
// Australia may have a short_name of "AU".
ShortText string `json:"shortText,omitempty"`
// Types: An array indicating the type(s) of the address component.
Types []string `json:"types,omitempty"`