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 package mybusinessplaceactions
52
53 import (
54 "bytes"
55 "context"
56 "encoding/json"
57 "errors"
58 "fmt"
59 "io"
60 "net/http"
61 "net/url"
62 "strconv"
63 "strings"
64
65 googleapi "google.golang.org/api/googleapi"
66 internal "google.golang.org/api/internal"
67 gensupport "google.golang.org/api/internal/gensupport"
68 option "google.golang.org/api/option"
69 internaloption "google.golang.org/api/option/internaloption"
70 htransport "google.golang.org/api/transport/http"
71 )
72
73
74
75 var _ = bytes.NewBuffer
76 var _ = strconv.Itoa
77 var _ = fmt.Sprintf
78 var _ = json.NewDecoder
79 var _ = io.Copy
80 var _ = url.Parse
81 var _ = gensupport.MarshalJSON
82 var _ = googleapi.Version
83 var _ = errors.New
84 var _ = strings.Replace
85 var _ = context.Canceled
86 var _ = internaloption.WithDefaultEndpoint
87 var _ = internal.Version
88
89 const apiId = "mybusinessplaceactions:v1"
90 const apiName = "mybusinessplaceactions"
91 const apiVersion = "v1"
92 const basePath = "https://mybusinessplaceactions.googleapis.com/"
93 const basePathTemplate = "https://mybusinessplaceactions.UNIVERSE_DOMAIN/"
94 const mtlsBasePath = "https://mybusinessplaceactions.mtls.googleapis.com/"
95
96
97 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
98 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
99 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
100 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
101 opts = append(opts, internaloption.EnableNewAuthLibrary())
102 client, endpoint, err := htransport.NewClient(ctx, opts...)
103 if err != nil {
104 return nil, err
105 }
106 s, err := New(client)
107 if err != nil {
108 return nil, err
109 }
110 if endpoint != "" {
111 s.BasePath = endpoint
112 }
113 return s, nil
114 }
115
116
117
118
119
120
121 func New(client *http.Client) (*Service, error) {
122 if client == nil {
123 return nil, errors.New("client is nil")
124 }
125 s := &Service{client: client, BasePath: basePath}
126 s.Locations = NewLocationsService(s)
127 s.PlaceActionTypeMetadata = NewPlaceActionTypeMetadataService(s)
128 return s, nil
129 }
130
131 type Service struct {
132 client *http.Client
133 BasePath string
134 UserAgent string
135
136 Locations *LocationsService
137
138 PlaceActionTypeMetadata *PlaceActionTypeMetadataService
139 }
140
141 func (s *Service) userAgent() string {
142 if s.UserAgent == "" {
143 return googleapi.UserAgent
144 }
145 return googleapi.UserAgent + " " + s.UserAgent
146 }
147
148 func NewLocationsService(s *Service) *LocationsService {
149 rs := &LocationsService{s: s}
150 rs.PlaceActionLinks = NewLocationsPlaceActionLinksService(s)
151 return rs
152 }
153
154 type LocationsService struct {
155 s *Service
156
157 PlaceActionLinks *LocationsPlaceActionLinksService
158 }
159
160 func NewLocationsPlaceActionLinksService(s *Service) *LocationsPlaceActionLinksService {
161 rs := &LocationsPlaceActionLinksService{s: s}
162 return rs
163 }
164
165 type LocationsPlaceActionLinksService struct {
166 s *Service
167 }
168
169 func NewPlaceActionTypeMetadataService(s *Service) *PlaceActionTypeMetadataService {
170 rs := &PlaceActionTypeMetadataService{s: s}
171 return rs
172 }
173
174 type PlaceActionTypeMetadataService struct {
175 s *Service
176 }
177
178
179
180
181
182 type Empty struct {
183
184 googleapi.ServerResponse `json:"-"`
185 }
186
187
188
189 type ListPlaceActionLinksResponse struct {
190
191
192
193 NextPageToken string `json:"nextPageToken,omitempty"`
194
195 PlaceActionLinks []*PlaceActionLink `json:"placeActionLinks,omitempty"`
196
197
198 googleapi.ServerResponse `json:"-"`
199
200
201
202
203
204 ForceSendFields []string `json:"-"`
205
206
207
208
209 NullFields []string `json:"-"`
210 }
211
212 func (s *ListPlaceActionLinksResponse) MarshalJSON() ([]byte, error) {
213 type NoMethod ListPlaceActionLinksResponse
214 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
215 }
216
217
218
219 type ListPlaceActionTypeMetadataResponse struct {
220
221
222
223
224 NextPageToken string `json:"nextPageToken,omitempty"`
225
226
227 PlaceActionTypeMetadata []*PlaceActionTypeMetadata `json:"placeActionTypeMetadata,omitempty"`
228
229
230 googleapi.ServerResponse `json:"-"`
231
232
233
234
235
236 ForceSendFields []string `json:"-"`
237
238
239
240
241 NullFields []string `json:"-"`
242 }
243
244 func (s *ListPlaceActionTypeMetadataResponse) MarshalJSON() ([]byte, error) {
245 type NoMethod ListPlaceActionTypeMetadataResponse
246 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
247 }
248
249
250 type PlaceActionLink struct {
251
252 CreateTime string `json:"createTime,omitempty"`
253
254
255 IsEditable bool `json:"isEditable,omitempty"`
256
257
258
259
260
261 IsPreferred bool `json:"isPreferred,omitempty"`
262
263
264
265
266
267
268
269 Name string `json:"name,omitempty"`
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284 PlaceActionType string `json:"placeActionType,omitempty"`
285
286
287
288
289
290
291
292
293 ProviderType string `json:"providerType,omitempty"`
294
295
296 UpdateTime string `json:"updateTime,omitempty"`
297
298
299
300 Uri string `json:"uri,omitempty"`
301
302
303 googleapi.ServerResponse `json:"-"`
304
305
306
307
308
309 ForceSendFields []string `json:"-"`
310
311
312
313
314 NullFields []string `json:"-"`
315 }
316
317 func (s *PlaceActionLink) MarshalJSON() ([]byte, error) {
318 type NoMethod PlaceActionLink
319 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
320 }
321
322
323 type PlaceActionTypeMetadata struct {
324
325
326 DisplayName string `json:"displayName,omitempty"`
327
328
329
330
331
332
333
334
335
336
337
338
339
340 PlaceActionType string `json:"placeActionType,omitempty"`
341
342
343
344
345
346 ForceSendFields []string `json:"-"`
347
348
349
350
351 NullFields []string `json:"-"`
352 }
353
354 func (s *PlaceActionTypeMetadata) MarshalJSON() ([]byte, error) {
355 type NoMethod PlaceActionTypeMetadata
356 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
357 }
358
359 type LocationsPlaceActionLinksCreateCall struct {
360 s *Service
361 parent string
362 placeactionlink *PlaceActionLink
363 urlParams_ gensupport.URLParams
364 ctx_ context.Context
365 header_ http.Header
366 }
367
368
369
370
371
372
373
374
375 func (r *LocationsPlaceActionLinksService) Create(parent string, placeactionlink *PlaceActionLink) *LocationsPlaceActionLinksCreateCall {
376 c := &LocationsPlaceActionLinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
377 c.parent = parent
378 c.placeactionlink = placeactionlink
379 return c
380 }
381
382
383
384
385 func (c *LocationsPlaceActionLinksCreateCall) Fields(s ...googleapi.Field) *LocationsPlaceActionLinksCreateCall {
386 c.urlParams_.Set("fields", googleapi.CombineFields(s))
387 return c
388 }
389
390
391 func (c *LocationsPlaceActionLinksCreateCall) Context(ctx context.Context) *LocationsPlaceActionLinksCreateCall {
392 c.ctx_ = ctx
393 return c
394 }
395
396
397
398 func (c *LocationsPlaceActionLinksCreateCall) Header() http.Header {
399 if c.header_ == nil {
400 c.header_ = make(http.Header)
401 }
402 return c.header_
403 }
404
405 func (c *LocationsPlaceActionLinksCreateCall) doRequest(alt string) (*http.Response, error) {
406 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
407 var body io.Reader = nil
408 body, err := googleapi.WithoutDataWrapper.JSONReader(c.placeactionlink)
409 if err != nil {
410 return nil, err
411 }
412 c.urlParams_.Set("alt", alt)
413 c.urlParams_.Set("prettyPrint", "false")
414 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/placeActionLinks")
415 urls += "?" + c.urlParams_.Encode()
416 req, err := http.NewRequest("POST", urls, body)
417 if err != nil {
418 return nil, err
419 }
420 req.Header = reqHeaders
421 googleapi.Expand(req.URL, map[string]string{
422 "parent": c.parent,
423 })
424 return gensupport.SendRequest(c.ctx_, c.s.client, req)
425 }
426
427
428
429
430
431
432
433 func (c *LocationsPlaceActionLinksCreateCall) Do(opts ...googleapi.CallOption) (*PlaceActionLink, error) {
434 gensupport.SetOptions(c.urlParams_, opts...)
435 res, err := c.doRequest("json")
436 if res != nil && res.StatusCode == http.StatusNotModified {
437 if res.Body != nil {
438 res.Body.Close()
439 }
440 return nil, gensupport.WrapError(&googleapi.Error{
441 Code: res.StatusCode,
442 Header: res.Header,
443 })
444 }
445 if err != nil {
446 return nil, err
447 }
448 defer googleapi.CloseBody(res)
449 if err := googleapi.CheckResponse(res); err != nil {
450 return nil, gensupport.WrapError(err)
451 }
452 ret := &PlaceActionLink{
453 ServerResponse: googleapi.ServerResponse{
454 Header: res.Header,
455 HTTPStatusCode: res.StatusCode,
456 },
457 }
458 target := &ret
459 if err := gensupport.DecodeResponse(target, res); err != nil {
460 return nil, err
461 }
462 return ret, nil
463 }
464
465 type LocationsPlaceActionLinksDeleteCall struct {
466 s *Service
467 name string
468 urlParams_ gensupport.URLParams
469 ctx_ context.Context
470 header_ http.Header
471 }
472
473
474
475
476
477 func (r *LocationsPlaceActionLinksService) Delete(name string) *LocationsPlaceActionLinksDeleteCall {
478 c := &LocationsPlaceActionLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
479 c.name = name
480 return c
481 }
482
483
484
485
486 func (c *LocationsPlaceActionLinksDeleteCall) Fields(s ...googleapi.Field) *LocationsPlaceActionLinksDeleteCall {
487 c.urlParams_.Set("fields", googleapi.CombineFields(s))
488 return c
489 }
490
491
492 func (c *LocationsPlaceActionLinksDeleteCall) Context(ctx context.Context) *LocationsPlaceActionLinksDeleteCall {
493 c.ctx_ = ctx
494 return c
495 }
496
497
498
499 func (c *LocationsPlaceActionLinksDeleteCall) Header() http.Header {
500 if c.header_ == nil {
501 c.header_ = make(http.Header)
502 }
503 return c.header_
504 }
505
506 func (c *LocationsPlaceActionLinksDeleteCall) doRequest(alt string) (*http.Response, error) {
507 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
508 var body io.Reader = nil
509 c.urlParams_.Set("alt", alt)
510 c.urlParams_.Set("prettyPrint", "false")
511 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
512 urls += "?" + c.urlParams_.Encode()
513 req, err := http.NewRequest("DELETE", urls, body)
514 if err != nil {
515 return nil, err
516 }
517 req.Header = reqHeaders
518 googleapi.Expand(req.URL, map[string]string{
519 "name": c.name,
520 })
521 return gensupport.SendRequest(c.ctx_, c.s.client, req)
522 }
523
524
525
526
527
528
529 func (c *LocationsPlaceActionLinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
530 gensupport.SetOptions(c.urlParams_, opts...)
531 res, err := c.doRequest("json")
532 if res != nil && res.StatusCode == http.StatusNotModified {
533 if res.Body != nil {
534 res.Body.Close()
535 }
536 return nil, gensupport.WrapError(&googleapi.Error{
537 Code: res.StatusCode,
538 Header: res.Header,
539 })
540 }
541 if err != nil {
542 return nil, err
543 }
544 defer googleapi.CloseBody(res)
545 if err := googleapi.CheckResponse(res); err != nil {
546 return nil, gensupport.WrapError(err)
547 }
548 ret := &Empty{
549 ServerResponse: googleapi.ServerResponse{
550 Header: res.Header,
551 HTTPStatusCode: res.StatusCode,
552 },
553 }
554 target := &ret
555 if err := gensupport.DecodeResponse(target, res); err != nil {
556 return nil, err
557 }
558 return ret, nil
559 }
560
561 type LocationsPlaceActionLinksGetCall struct {
562 s *Service
563 name string
564 urlParams_ gensupport.URLParams
565 ifNoneMatch_ string
566 ctx_ context.Context
567 header_ http.Header
568 }
569
570
571
572
573 func (r *LocationsPlaceActionLinksService) Get(name string) *LocationsPlaceActionLinksGetCall {
574 c := &LocationsPlaceActionLinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
575 c.name = name
576 return c
577 }
578
579
580
581
582 func (c *LocationsPlaceActionLinksGetCall) Fields(s ...googleapi.Field) *LocationsPlaceActionLinksGetCall {
583 c.urlParams_.Set("fields", googleapi.CombineFields(s))
584 return c
585 }
586
587
588
589
590 func (c *LocationsPlaceActionLinksGetCall) IfNoneMatch(entityTag string) *LocationsPlaceActionLinksGetCall {
591 c.ifNoneMatch_ = entityTag
592 return c
593 }
594
595
596 func (c *LocationsPlaceActionLinksGetCall) Context(ctx context.Context) *LocationsPlaceActionLinksGetCall {
597 c.ctx_ = ctx
598 return c
599 }
600
601
602
603 func (c *LocationsPlaceActionLinksGetCall) Header() http.Header {
604 if c.header_ == nil {
605 c.header_ = make(http.Header)
606 }
607 return c.header_
608 }
609
610 func (c *LocationsPlaceActionLinksGetCall) doRequest(alt string) (*http.Response, error) {
611 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
612 if c.ifNoneMatch_ != "" {
613 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
614 }
615 var body io.Reader = nil
616 c.urlParams_.Set("alt", alt)
617 c.urlParams_.Set("prettyPrint", "false")
618 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
619 urls += "?" + c.urlParams_.Encode()
620 req, err := http.NewRequest("GET", urls, body)
621 if err != nil {
622 return nil, err
623 }
624 req.Header = reqHeaders
625 googleapi.Expand(req.URL, map[string]string{
626 "name": c.name,
627 })
628 return gensupport.SendRequest(c.ctx_, c.s.client, req)
629 }
630
631
632
633
634
635
636
637 func (c *LocationsPlaceActionLinksGetCall) Do(opts ...googleapi.CallOption) (*PlaceActionLink, error) {
638 gensupport.SetOptions(c.urlParams_, opts...)
639 res, err := c.doRequest("json")
640 if res != nil && res.StatusCode == http.StatusNotModified {
641 if res.Body != nil {
642 res.Body.Close()
643 }
644 return nil, gensupport.WrapError(&googleapi.Error{
645 Code: res.StatusCode,
646 Header: res.Header,
647 })
648 }
649 if err != nil {
650 return nil, err
651 }
652 defer googleapi.CloseBody(res)
653 if err := googleapi.CheckResponse(res); err != nil {
654 return nil, gensupport.WrapError(err)
655 }
656 ret := &PlaceActionLink{
657 ServerResponse: googleapi.ServerResponse{
658 Header: res.Header,
659 HTTPStatusCode: res.StatusCode,
660 },
661 }
662 target := &ret
663 if err := gensupport.DecodeResponse(target, res); err != nil {
664 return nil, err
665 }
666 return ret, nil
667 }
668
669 type LocationsPlaceActionLinksListCall struct {
670 s *Service
671 parent string
672 urlParams_ gensupport.URLParams
673 ifNoneMatch_ string
674 ctx_ context.Context
675 header_ http.Header
676 }
677
678
679
680
681
682 func (r *LocationsPlaceActionLinksService) List(parent string) *LocationsPlaceActionLinksListCall {
683 c := &LocationsPlaceActionLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
684 c.parent = parent
685 return c
686 }
687
688
689
690
691
692 func (c *LocationsPlaceActionLinksListCall) Filter(filter string) *LocationsPlaceActionLinksListCall {
693 c.urlParams_.Set("filter", filter)
694 return c
695 }
696
697
698
699 func (c *LocationsPlaceActionLinksListCall) PageSize(pageSize int64) *LocationsPlaceActionLinksListCall {
700 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
701 return c
702 }
703
704
705
706 func (c *LocationsPlaceActionLinksListCall) PageToken(pageToken string) *LocationsPlaceActionLinksListCall {
707 c.urlParams_.Set("pageToken", pageToken)
708 return c
709 }
710
711
712
713
714 func (c *LocationsPlaceActionLinksListCall) Fields(s ...googleapi.Field) *LocationsPlaceActionLinksListCall {
715 c.urlParams_.Set("fields", googleapi.CombineFields(s))
716 return c
717 }
718
719
720
721
722 func (c *LocationsPlaceActionLinksListCall) IfNoneMatch(entityTag string) *LocationsPlaceActionLinksListCall {
723 c.ifNoneMatch_ = entityTag
724 return c
725 }
726
727
728 func (c *LocationsPlaceActionLinksListCall) Context(ctx context.Context) *LocationsPlaceActionLinksListCall {
729 c.ctx_ = ctx
730 return c
731 }
732
733
734
735 func (c *LocationsPlaceActionLinksListCall) Header() http.Header {
736 if c.header_ == nil {
737 c.header_ = make(http.Header)
738 }
739 return c.header_
740 }
741
742 func (c *LocationsPlaceActionLinksListCall) doRequest(alt string) (*http.Response, error) {
743 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
744 if c.ifNoneMatch_ != "" {
745 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
746 }
747 var body io.Reader = nil
748 c.urlParams_.Set("alt", alt)
749 c.urlParams_.Set("prettyPrint", "false")
750 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/placeActionLinks")
751 urls += "?" + c.urlParams_.Encode()
752 req, err := http.NewRequest("GET", urls, body)
753 if err != nil {
754 return nil, err
755 }
756 req.Header = reqHeaders
757 googleapi.Expand(req.URL, map[string]string{
758 "parent": c.parent,
759 })
760 return gensupport.SendRequest(c.ctx_, c.s.client, req)
761 }
762
763
764
765
766
767
768
769 func (c *LocationsPlaceActionLinksListCall) Do(opts ...googleapi.CallOption) (*ListPlaceActionLinksResponse, error) {
770 gensupport.SetOptions(c.urlParams_, opts...)
771 res, err := c.doRequest("json")
772 if res != nil && res.StatusCode == http.StatusNotModified {
773 if res.Body != nil {
774 res.Body.Close()
775 }
776 return nil, gensupport.WrapError(&googleapi.Error{
777 Code: res.StatusCode,
778 Header: res.Header,
779 })
780 }
781 if err != nil {
782 return nil, err
783 }
784 defer googleapi.CloseBody(res)
785 if err := googleapi.CheckResponse(res); err != nil {
786 return nil, gensupport.WrapError(err)
787 }
788 ret := &ListPlaceActionLinksResponse{
789 ServerResponse: googleapi.ServerResponse{
790 Header: res.Header,
791 HTTPStatusCode: res.StatusCode,
792 },
793 }
794 target := &ret
795 if err := gensupport.DecodeResponse(target, res); err != nil {
796 return nil, err
797 }
798 return ret, nil
799 }
800
801
802
803
804 func (c *LocationsPlaceActionLinksListCall) Pages(ctx context.Context, f func(*ListPlaceActionLinksResponse) error) error {
805 c.ctx_ = ctx
806 defer c.PageToken(c.urlParams_.Get("pageToken"))
807 for {
808 x, err := c.Do()
809 if err != nil {
810 return err
811 }
812 if err := f(x); err != nil {
813 return err
814 }
815 if x.NextPageToken == "" {
816 return nil
817 }
818 c.PageToken(x.NextPageToken)
819 }
820 }
821
822 type LocationsPlaceActionLinksPatchCall struct {
823 s *Service
824 name string
825 placeactionlink *PlaceActionLink
826 urlParams_ gensupport.URLParams
827 ctx_ context.Context
828 header_ http.Header
829 }
830
831
832
833
834
835
836
837
838
839
840 func (r *LocationsPlaceActionLinksService) Patch(name string, placeactionlink *PlaceActionLink) *LocationsPlaceActionLinksPatchCall {
841 c := &LocationsPlaceActionLinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
842 c.name = name
843 c.placeactionlink = placeactionlink
844 return c
845 }
846
847
848
849
850
851
852 func (c *LocationsPlaceActionLinksPatchCall) UpdateMask(updateMask string) *LocationsPlaceActionLinksPatchCall {
853 c.urlParams_.Set("updateMask", updateMask)
854 return c
855 }
856
857
858
859
860 func (c *LocationsPlaceActionLinksPatchCall) Fields(s ...googleapi.Field) *LocationsPlaceActionLinksPatchCall {
861 c.urlParams_.Set("fields", googleapi.CombineFields(s))
862 return c
863 }
864
865
866 func (c *LocationsPlaceActionLinksPatchCall) Context(ctx context.Context) *LocationsPlaceActionLinksPatchCall {
867 c.ctx_ = ctx
868 return c
869 }
870
871
872
873 func (c *LocationsPlaceActionLinksPatchCall) Header() http.Header {
874 if c.header_ == nil {
875 c.header_ = make(http.Header)
876 }
877 return c.header_
878 }
879
880 func (c *LocationsPlaceActionLinksPatchCall) doRequest(alt string) (*http.Response, error) {
881 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
882 var body io.Reader = nil
883 body, err := googleapi.WithoutDataWrapper.JSONReader(c.placeactionlink)
884 if err != nil {
885 return nil, err
886 }
887 c.urlParams_.Set("alt", alt)
888 c.urlParams_.Set("prettyPrint", "false")
889 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
890 urls += "?" + c.urlParams_.Encode()
891 req, err := http.NewRequest("PATCH", urls, body)
892 if err != nil {
893 return nil, err
894 }
895 req.Header = reqHeaders
896 googleapi.Expand(req.URL, map[string]string{
897 "name": c.name,
898 })
899 return gensupport.SendRequest(c.ctx_, c.s.client, req)
900 }
901
902
903
904
905
906
907
908 func (c *LocationsPlaceActionLinksPatchCall) Do(opts ...googleapi.CallOption) (*PlaceActionLink, error) {
909 gensupport.SetOptions(c.urlParams_, opts...)
910 res, err := c.doRequest("json")
911 if res != nil && res.StatusCode == http.StatusNotModified {
912 if res.Body != nil {
913 res.Body.Close()
914 }
915 return nil, gensupport.WrapError(&googleapi.Error{
916 Code: res.StatusCode,
917 Header: res.Header,
918 })
919 }
920 if err != nil {
921 return nil, err
922 }
923 defer googleapi.CloseBody(res)
924 if err := googleapi.CheckResponse(res); err != nil {
925 return nil, gensupport.WrapError(err)
926 }
927 ret := &PlaceActionLink{
928 ServerResponse: googleapi.ServerResponse{
929 Header: res.Header,
930 HTTPStatusCode: res.StatusCode,
931 },
932 }
933 target := &ret
934 if err := gensupport.DecodeResponse(target, res); err != nil {
935 return nil, err
936 }
937 return ret, nil
938 }
939
940 type PlaceActionTypeMetadataListCall struct {
941 s *Service
942 urlParams_ gensupport.URLParams
943 ifNoneMatch_ string
944 ctx_ context.Context
945 header_ http.Header
946 }
947
948
949
950 func (r *PlaceActionTypeMetadataService) List() *PlaceActionTypeMetadataListCall {
951 c := &PlaceActionTypeMetadataListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
952 return c
953 }
954
955
956
957
958
959
960
961
962 func (c *PlaceActionTypeMetadataListCall) Filter(filter string) *PlaceActionTypeMetadataListCall {
963 c.urlParams_.Set("filter", filter)
964 return c
965 }
966
967
968
969
970 func (c *PlaceActionTypeMetadataListCall) LanguageCode(languageCode string) *PlaceActionTypeMetadataListCall {
971 c.urlParams_.Set("languageCode", languageCode)
972 return c
973 }
974
975
976
977 func (c *PlaceActionTypeMetadataListCall) PageSize(pageSize int64) *PlaceActionTypeMetadataListCall {
978 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
979 return c
980 }
981
982
983
984
985
986 func (c *PlaceActionTypeMetadataListCall) PageToken(pageToken string) *PlaceActionTypeMetadataListCall {
987 c.urlParams_.Set("pageToken", pageToken)
988 return c
989 }
990
991
992
993
994 func (c *PlaceActionTypeMetadataListCall) Fields(s ...googleapi.Field) *PlaceActionTypeMetadataListCall {
995 c.urlParams_.Set("fields", googleapi.CombineFields(s))
996 return c
997 }
998
999
1000
1001
1002 func (c *PlaceActionTypeMetadataListCall) IfNoneMatch(entityTag string) *PlaceActionTypeMetadataListCall {
1003 c.ifNoneMatch_ = entityTag
1004 return c
1005 }
1006
1007
1008 func (c *PlaceActionTypeMetadataListCall) Context(ctx context.Context) *PlaceActionTypeMetadataListCall {
1009 c.ctx_ = ctx
1010 return c
1011 }
1012
1013
1014
1015 func (c *PlaceActionTypeMetadataListCall) Header() http.Header {
1016 if c.header_ == nil {
1017 c.header_ = make(http.Header)
1018 }
1019 return c.header_
1020 }
1021
1022 func (c *PlaceActionTypeMetadataListCall) doRequest(alt string) (*http.Response, error) {
1023 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1024 if c.ifNoneMatch_ != "" {
1025 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1026 }
1027 var body io.Reader = nil
1028 c.urlParams_.Set("alt", alt)
1029 c.urlParams_.Set("prettyPrint", "false")
1030 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/placeActionTypeMetadata")
1031 urls += "?" + c.urlParams_.Encode()
1032 req, err := http.NewRequest("GET", urls, body)
1033 if err != nil {
1034 return nil, err
1035 }
1036 req.Header = reqHeaders
1037 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1038 }
1039
1040
1041
1042
1043
1044
1045
1046 func (c *PlaceActionTypeMetadataListCall) Do(opts ...googleapi.CallOption) (*ListPlaceActionTypeMetadataResponse, error) {
1047 gensupport.SetOptions(c.urlParams_, opts...)
1048 res, err := c.doRequest("json")
1049 if res != nil && res.StatusCode == http.StatusNotModified {
1050 if res.Body != nil {
1051 res.Body.Close()
1052 }
1053 return nil, gensupport.WrapError(&googleapi.Error{
1054 Code: res.StatusCode,
1055 Header: res.Header,
1056 })
1057 }
1058 if err != nil {
1059 return nil, err
1060 }
1061 defer googleapi.CloseBody(res)
1062 if err := googleapi.CheckResponse(res); err != nil {
1063 return nil, gensupport.WrapError(err)
1064 }
1065 ret := &ListPlaceActionTypeMetadataResponse{
1066 ServerResponse: googleapi.ServerResponse{
1067 Header: res.Header,
1068 HTTPStatusCode: res.StatusCode,
1069 },
1070 }
1071 target := &ret
1072 if err := gensupport.DecodeResponse(target, res); err != nil {
1073 return nil, err
1074 }
1075 return ret, nil
1076 }
1077
1078
1079
1080
1081 func (c *PlaceActionTypeMetadataListCall) Pages(ctx context.Context, f func(*ListPlaceActionTypeMetadataResponse) error) error {
1082 c.ctx_ = ctx
1083 defer c.PageToken(c.urlParams_.Get("pageToken"))
1084 for {
1085 x, err := c.Do()
1086 if err != nil {
1087 return err
1088 }
1089 if err := f(x); err != nil {
1090 return err
1091 }
1092 if x.NextPageToken == "" {
1093 return nil
1094 }
1095 c.PageToken(x.NextPageToken)
1096 }
1097 }
1098
View as plain text