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 contactcenteraiplatform
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 = "contactcenteraiplatform:v1alpha1"
90 const apiName = "contactcenteraiplatform"
91 const apiVersion = "v1alpha1"
92 const basePath = "https://contactcenteraiplatform.googleapis.com/"
93 const basePathTemplate = "https://contactcenteraiplatform.UNIVERSE_DOMAIN/"
94 const mtlsBasePath = "https://contactcenteraiplatform.mtls.googleapis.com/"
95
96
97 const (
98
99
100 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
101 )
102
103
104 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
105 scopesOption := internaloption.WithDefaultScopes(
106 "https://www.googleapis.com/auth/cloud-platform",
107 )
108
109 opts = append([]option.ClientOption{scopesOption}, opts...)
110 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
111 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
112 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
113 opts = append(opts, internaloption.EnableNewAuthLibrary())
114 client, endpoint, err := htransport.NewClient(ctx, opts...)
115 if err != nil {
116 return nil, err
117 }
118 s, err := New(client)
119 if err != nil {
120 return nil, err
121 }
122 if endpoint != "" {
123 s.BasePath = endpoint
124 }
125 return s, nil
126 }
127
128
129
130
131
132
133 func New(client *http.Client) (*Service, error) {
134 if client == nil {
135 return nil, errors.New("client is nil")
136 }
137 s := &Service{client: client, BasePath: basePath}
138 s.Projects = NewProjectsService(s)
139 return s, nil
140 }
141
142 type Service struct {
143 client *http.Client
144 BasePath string
145 UserAgent string
146
147 Projects *ProjectsService
148 }
149
150 func (s *Service) userAgent() string {
151 if s.UserAgent == "" {
152 return googleapi.UserAgent
153 }
154 return googleapi.UserAgent + " " + s.UserAgent
155 }
156
157 func NewProjectsService(s *Service) *ProjectsService {
158 rs := &ProjectsService{s: s}
159 rs.Locations = NewProjectsLocationsService(s)
160 return rs
161 }
162
163 type ProjectsService struct {
164 s *Service
165
166 Locations *ProjectsLocationsService
167 }
168
169 func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
170 rs := &ProjectsLocationsService{s: s}
171 rs.ContactCenters = NewProjectsLocationsContactCentersService(s)
172 rs.Operations = NewProjectsLocationsOperationsService(s)
173 return rs
174 }
175
176 type ProjectsLocationsService struct {
177 s *Service
178
179 ContactCenters *ProjectsLocationsContactCentersService
180
181 Operations *ProjectsLocationsOperationsService
182 }
183
184 func NewProjectsLocationsContactCentersService(s *Service) *ProjectsLocationsContactCentersService {
185 rs := &ProjectsLocationsContactCentersService{s: s}
186 return rs
187 }
188
189 type ProjectsLocationsContactCentersService struct {
190 s *Service
191 }
192
193 func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
194 rs := &ProjectsLocationsOperationsService{s: s}
195 return rs
196 }
197
198 type ProjectsLocationsOperationsService struct {
199 s *Service
200 }
201
202
203 type AdminUser struct {
204
205 FamilyName string `json:"familyName,omitempty"`
206
207 GivenName string `json:"givenName,omitempty"`
208
209
210
211
212
213 ForceSendFields []string `json:"-"`
214
215
216
217
218 NullFields []string `json:"-"`
219 }
220
221 func (s *AdminUser) MarshalJSON() ([]byte, error) {
222 type NoMethod AdminUser
223 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
224 }
225
226
227 type CancelOperationRequest struct {
228 }
229
230
231 type ContactCenter struct {
232
233
234 AdminUser *AdminUser `json:"adminUser,omitempty"`
235
236
237 CcaipManagedUsers bool `json:"ccaipManagedUsers,omitempty"`
238
239 CreateTime string `json:"createTime,omitempty"`
240
241
242 CustomerDomainPrefix string `json:"customerDomainPrefix,omitempty"`
243
244 DisplayName string `json:"displayName,omitempty"`
245
246 Early *Early `json:"early,omitempty"`
247
248
249 InstanceConfig *InstanceConfig `json:"instanceConfig,omitempty"`
250
251
252 KmsKey string `json:"kmsKey,omitempty"`
253
254 Labels map[string]string `json:"labels,omitempty"`
255
256 Name string `json:"name,omitempty"`
257
258 Normal *Normal `json:"normal,omitempty"`
259
260
261
262
263
264
265 PrivateComponents []string `json:"privateComponents,omitempty"`
266
267 SamlParams *SAMLParams `json:"samlParams,omitempty"`
268
269
270
271
272
273
274
275
276
277
278
279
280 State string `json:"state,omitempty"`
281
282 UpdateTime string `json:"updateTime,omitempty"`
283
284 Uris *URIs `json:"uris,omitempty"`
285
286 UserEmail string `json:"userEmail,omitempty"`
287
288
289 googleapi.ServerResponse `json:"-"`
290
291
292
293
294
295 ForceSendFields []string `json:"-"`
296
297
298
299
300 NullFields []string `json:"-"`
301 }
302
303 func (s *ContactCenter) MarshalJSON() ([]byte, error) {
304 type NoMethod ContactCenter
305 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
306 }
307
308
309 type ContactCenterQuota struct {
310
311
312 ContactCenterCountLimit int64 `json:"contactCenterCountLimit,omitempty"`
313
314
315 ContactCenterCountSum int64 `json:"contactCenterCountSum,omitempty"`
316
317 Quotas []*Quota `json:"quotas,omitempty"`
318
319
320 googleapi.ServerResponse `json:"-"`
321
322
323
324
325
326 ForceSendFields []string `json:"-"`
327
328
329
330
331 NullFields []string `json:"-"`
332 }
333
334 func (s *ContactCenterQuota) MarshalJSON() ([]byte, error) {
335 type NoMethod ContactCenterQuota
336 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
337 }
338
339
340 type Early struct {
341 }
342
343
344
345
346
347 type Empty struct {
348
349 googleapi.ServerResponse `json:"-"`
350 }
351
352
353
354 type GoogleCloudCommonOperationMetadata struct {
355
356 ApiVersion string `json:"apiVersion,omitempty"`
357
358
359
360
361 CancelRequested bool `json:"cancelRequested,omitempty"`
362
363 CreateTime string `json:"createTime,omitempty"`
364
365 EndTime string `json:"endTime,omitempty"`
366
367 StatusDetail string `json:"statusDetail,omitempty"`
368
369
370 Target string `json:"target,omitempty"`
371
372 Verb string `json:"verb,omitempty"`
373
374
375
376
377
378 ForceSendFields []string `json:"-"`
379
380
381
382
383 NullFields []string `json:"-"`
384 }
385
386 func (s *GoogleCloudCommonOperationMetadata) MarshalJSON() ([]byte, error) {
387 type NoMethod GoogleCloudCommonOperationMetadata
388 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
389 }
390
391
392 type InstanceConfig struct {
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411 InstanceSize string `json:"instanceSize,omitempty"`
412
413
414
415
416
417 ForceSendFields []string `json:"-"`
418
419
420
421
422 NullFields []string `json:"-"`
423 }
424
425 func (s *InstanceConfig) MarshalJSON() ([]byte, error) {
426 type NoMethod InstanceConfig
427 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
428 }
429
430
431 type ListContactCentersResponse struct {
432
433 ContactCenters []*ContactCenter `json:"contactCenters,omitempty"`
434
435
436 NextPageToken string `json:"nextPageToken,omitempty"`
437
438 Unreachable []string `json:"unreachable,omitempty"`
439
440
441 googleapi.ServerResponse `json:"-"`
442
443
444
445
446
447 ForceSendFields []string `json:"-"`
448
449
450
451
452 NullFields []string `json:"-"`
453 }
454
455 func (s *ListContactCentersResponse) MarshalJSON() ([]byte, error) {
456 type NoMethod ListContactCentersResponse
457 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
458 }
459
460
461 type ListLocationsResponse struct {
462
463
464 Locations []*Location `json:"locations,omitempty"`
465
466 NextPageToken string `json:"nextPageToken,omitempty"`
467
468
469 googleapi.ServerResponse `json:"-"`
470
471
472
473
474
475 ForceSendFields []string `json:"-"`
476
477
478
479
480 NullFields []string `json:"-"`
481 }
482
483 func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
484 type NoMethod ListLocationsResponse
485 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
486 }
487
488
489 type ListOperationsResponse struct {
490
491 NextPageToken string `json:"nextPageToken,omitempty"`
492
493
494 Operations []*Operation `json:"operations,omitempty"`
495
496
497 googleapi.ServerResponse `json:"-"`
498
499
500
501
502
503 ForceSendFields []string `json:"-"`
504
505
506
507
508 NullFields []string `json:"-"`
509 }
510
511 func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
512 type NoMethod ListOperationsResponse
513 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
514 }
515
516
517 type Location struct {
518
519
520 DisplayName string `json:"displayName,omitempty"`
521
522
523 Labels map[string]string `json:"labels,omitempty"`
524
525 LocationId string `json:"locationId,omitempty"`
526
527
528 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
529
530
531
532 Name string `json:"name,omitempty"`
533
534
535 googleapi.ServerResponse `json:"-"`
536
537
538
539
540
541 ForceSendFields []string `json:"-"`
542
543
544
545
546 NullFields []string `json:"-"`
547 }
548
549 func (s *Location) MarshalJSON() ([]byte, error) {
550 type NoMethod Location
551 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
552 }
553
554
555
556 type Normal struct {
557 }
558
559
560
561 type Operation struct {
562
563
564
565 Done bool `json:"done,omitempty"`
566
567 Error *Status `json:"error,omitempty"`
568
569
570
571
572 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
573
574
575
576 Name string `json:"name,omitempty"`
577
578
579
580
581
582
583
584 Response googleapi.RawMessage `json:"response,omitempty"`
585
586
587 googleapi.ServerResponse `json:"-"`
588
589
590
591
592
593 ForceSendFields []string `json:"-"`
594
595
596
597
598 NullFields []string `json:"-"`
599 }
600
601 func (s *Operation) MarshalJSON() ([]byte, error) {
602 type NoMethod Operation
603 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
604 }
605
606
607 type OperationMetadata struct {
608
609 ApiVersion string `json:"apiVersion,omitempty"`
610
611 ContactCenter *ContactCenter `json:"contactCenter,omitempty"`
612
613 CreateTime string `json:"createTime,omitempty"`
614
615 EndTime string `json:"endTime,omitempty"`
616
617
618
619
620 RequestedCancellation bool `json:"requestedCancellation,omitempty"`
621
622 StatusMessage string `json:"statusMessage,omitempty"`
623
624
625 Target string `json:"target,omitempty"`
626
627 Verb string `json:"verb,omitempty"`
628
629
630
631
632
633 ForceSendFields []string `json:"-"`
634
635
636
637
638 NullFields []string `json:"-"`
639 }
640
641 func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
642 type NoMethod OperationMetadata
643 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
644 }
645
646
647 type Quota struct {
648
649
650 ContactCenterCountLimit int64 `json:"contactCenterCountLimit,omitempty"`
651
652
653 ContactCenterCountSum int64 `json:"contactCenterCountSum,omitempty"`
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672 ContactCenterInstanceSize string `json:"contactCenterInstanceSize,omitempty"`
673
674
675
676
677
678 ForceSendFields []string `json:"-"`
679
680
681
682
683 NullFields []string `json:"-"`
684 }
685
686 func (s *Quota) MarshalJSON() ([]byte, error) {
687 type NoMethod Quota
688 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
689 }
690
691
692 type SAMLParams struct {
693
694 Certificate string `json:"certificate,omitempty"`
695
696 EmailMapping string `json:"emailMapping,omitempty"`
697
698 EntityId string `json:"entityId,omitempty"`
699
700 SsoUri string `json:"ssoUri,omitempty"`
701
702 UserEmail string `json:"userEmail,omitempty"`
703
704
705
706
707
708 ForceSendFields []string `json:"-"`
709
710
711
712
713 NullFields []string `json:"-"`
714 }
715
716 func (s *SAMLParams) MarshalJSON() ([]byte, error) {
717 type NoMethod SAMLParams
718 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
719 }
720
721
722
723
724
725
726
727 type Status struct {
728
729 Code int64 `json:"code,omitempty"`
730
731
732 Details []googleapi.RawMessage `json:"details,omitempty"`
733
734
735
736 Message string `json:"message,omitempty"`
737
738
739
740
741
742 ForceSendFields []string `json:"-"`
743
744
745
746
747 NullFields []string `json:"-"`
748 }
749
750 func (s *Status) MarshalJSON() ([]byte, error) {
751 type NoMethod Status
752 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
753 }
754
755
756 type URIs struct {
757
758 ChatBotUri string `json:"chatBotUri,omitempty"`
759
760 MediaUri string `json:"mediaUri,omitempty"`
761
762 RootUri string `json:"rootUri,omitempty"`
763
764
765 VirtualAgentStreamingServiceUri string `json:"virtualAgentStreamingServiceUri,omitempty"`
766
767
768
769
770
771 ForceSendFields []string `json:"-"`
772
773
774
775
776 NullFields []string `json:"-"`
777 }
778
779 func (s *URIs) MarshalJSON() ([]byte, error) {
780 type NoMethod URIs
781 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
782 }
783
784 type ProjectsLocationsGetCall struct {
785 s *Service
786 name string
787 urlParams_ gensupport.URLParams
788 ifNoneMatch_ string
789 ctx_ context.Context
790 header_ http.Header
791 }
792
793
794
795
796 func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
797 c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
798 c.name = name
799 return c
800 }
801
802
803
804
805 func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
806 c.urlParams_.Set("fields", googleapi.CombineFields(s))
807 return c
808 }
809
810
811
812
813 func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
814 c.ifNoneMatch_ = entityTag
815 return c
816 }
817
818
819 func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
820 c.ctx_ = ctx
821 return c
822 }
823
824
825
826 func (c *ProjectsLocationsGetCall) Header() http.Header {
827 if c.header_ == nil {
828 c.header_ = make(http.Header)
829 }
830 return c.header_
831 }
832
833 func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
834 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
835 if c.ifNoneMatch_ != "" {
836 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
837 }
838 var body io.Reader = nil
839 c.urlParams_.Set("alt", alt)
840 c.urlParams_.Set("prettyPrint", "false")
841 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
842 urls += "?" + c.urlParams_.Encode()
843 req, err := http.NewRequest("GET", urls, body)
844 if err != nil {
845 return nil, err
846 }
847 req.Header = reqHeaders
848 googleapi.Expand(req.URL, map[string]string{
849 "name": c.name,
850 })
851 return gensupport.SendRequest(c.ctx_, c.s.client, req)
852 }
853
854
855
856
857
858
859 func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
860 gensupport.SetOptions(c.urlParams_, opts...)
861 res, err := c.doRequest("json")
862 if res != nil && res.StatusCode == http.StatusNotModified {
863 if res.Body != nil {
864 res.Body.Close()
865 }
866 return nil, gensupport.WrapError(&googleapi.Error{
867 Code: res.StatusCode,
868 Header: res.Header,
869 })
870 }
871 if err != nil {
872 return nil, err
873 }
874 defer googleapi.CloseBody(res)
875 if err := googleapi.CheckResponse(res); err != nil {
876 return nil, gensupport.WrapError(err)
877 }
878 ret := &Location{
879 ServerResponse: googleapi.ServerResponse{
880 Header: res.Header,
881 HTTPStatusCode: res.StatusCode,
882 },
883 }
884 target := &ret
885 if err := gensupport.DecodeResponse(target, res); err != nil {
886 return nil, err
887 }
888 return ret, nil
889 }
890
891 type ProjectsLocationsListCall struct {
892 s *Service
893 name string
894 urlParams_ gensupport.URLParams
895 ifNoneMatch_ string
896 ctx_ context.Context
897 header_ http.Header
898 }
899
900
901
902
903 func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
904 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
905 c.name = name
906 return c
907 }
908
909
910
911
912
913 func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
914 c.urlParams_.Set("filter", filter)
915 return c
916 }
917
918
919
920 func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
921 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
922 return c
923 }
924
925
926
927
928 func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
929 c.urlParams_.Set("pageToken", pageToken)
930 return c
931 }
932
933
934
935
936 func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
937 c.urlParams_.Set("fields", googleapi.CombineFields(s))
938 return c
939 }
940
941
942
943
944 func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
945 c.ifNoneMatch_ = entityTag
946 return c
947 }
948
949
950 func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
951 c.ctx_ = ctx
952 return c
953 }
954
955
956
957 func (c *ProjectsLocationsListCall) Header() http.Header {
958 if c.header_ == nil {
959 c.header_ = make(http.Header)
960 }
961 return c.header_
962 }
963
964 func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
965 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
966 if c.ifNoneMatch_ != "" {
967 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
968 }
969 var body io.Reader = nil
970 c.urlParams_.Set("alt", alt)
971 c.urlParams_.Set("prettyPrint", "false")
972 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}/locations")
973 urls += "?" + c.urlParams_.Encode()
974 req, err := http.NewRequest("GET", urls, body)
975 if err != nil {
976 return nil, err
977 }
978 req.Header = reqHeaders
979 googleapi.Expand(req.URL, map[string]string{
980 "name": c.name,
981 })
982 return gensupport.SendRequest(c.ctx_, c.s.client, req)
983 }
984
985
986
987
988
989
990
991 func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
992 gensupport.SetOptions(c.urlParams_, opts...)
993 res, err := c.doRequest("json")
994 if res != nil && res.StatusCode == http.StatusNotModified {
995 if res.Body != nil {
996 res.Body.Close()
997 }
998 return nil, gensupport.WrapError(&googleapi.Error{
999 Code: res.StatusCode,
1000 Header: res.Header,
1001 })
1002 }
1003 if err != nil {
1004 return nil, err
1005 }
1006 defer googleapi.CloseBody(res)
1007 if err := googleapi.CheckResponse(res); err != nil {
1008 return nil, gensupport.WrapError(err)
1009 }
1010 ret := &ListLocationsResponse{
1011 ServerResponse: googleapi.ServerResponse{
1012 Header: res.Header,
1013 HTTPStatusCode: res.StatusCode,
1014 },
1015 }
1016 target := &ret
1017 if err := gensupport.DecodeResponse(target, res); err != nil {
1018 return nil, err
1019 }
1020 return ret, nil
1021 }
1022
1023
1024
1025
1026 func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
1027 c.ctx_ = ctx
1028 defer c.PageToken(c.urlParams_.Get("pageToken"))
1029 for {
1030 x, err := c.Do()
1031 if err != nil {
1032 return err
1033 }
1034 if err := f(x); err != nil {
1035 return err
1036 }
1037 if x.NextPageToken == "" {
1038 return nil
1039 }
1040 c.PageToken(x.NextPageToken)
1041 }
1042 }
1043
1044 type ProjectsLocationsQueryContactCenterQuotaCall struct {
1045 s *Service
1046 parent string
1047 urlParams_ gensupport.URLParams
1048 ifNoneMatch_ string
1049 ctx_ context.Context
1050 header_ http.Header
1051 }
1052
1053
1054
1055
1056
1057
1058 func (r *ProjectsLocationsService) QueryContactCenterQuota(parent string) *ProjectsLocationsQueryContactCenterQuotaCall {
1059 c := &ProjectsLocationsQueryContactCenterQuotaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1060 c.parent = parent
1061 return c
1062 }
1063
1064
1065
1066
1067 func (c *ProjectsLocationsQueryContactCenterQuotaCall) Fields(s ...googleapi.Field) *ProjectsLocationsQueryContactCenterQuotaCall {
1068 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1069 return c
1070 }
1071
1072
1073
1074
1075 func (c *ProjectsLocationsQueryContactCenterQuotaCall) IfNoneMatch(entityTag string) *ProjectsLocationsQueryContactCenterQuotaCall {
1076 c.ifNoneMatch_ = entityTag
1077 return c
1078 }
1079
1080
1081 func (c *ProjectsLocationsQueryContactCenterQuotaCall) Context(ctx context.Context) *ProjectsLocationsQueryContactCenterQuotaCall {
1082 c.ctx_ = ctx
1083 return c
1084 }
1085
1086
1087
1088 func (c *ProjectsLocationsQueryContactCenterQuotaCall) Header() http.Header {
1089 if c.header_ == nil {
1090 c.header_ = make(http.Header)
1091 }
1092 return c.header_
1093 }
1094
1095 func (c *ProjectsLocationsQueryContactCenterQuotaCall) doRequest(alt string) (*http.Response, error) {
1096 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1097 if c.ifNoneMatch_ != "" {
1098 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1099 }
1100 var body io.Reader = nil
1101 c.urlParams_.Set("alt", alt)
1102 c.urlParams_.Set("prettyPrint", "false")
1103 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}:queryContactCenterQuota")
1104 urls += "?" + c.urlParams_.Encode()
1105 req, err := http.NewRequest("GET", urls, body)
1106 if err != nil {
1107 return nil, err
1108 }
1109 req.Header = reqHeaders
1110 googleapi.Expand(req.URL, map[string]string{
1111 "parent": c.parent,
1112 })
1113 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1114 }
1115
1116
1117
1118
1119
1120
1121
1122 func (c *ProjectsLocationsQueryContactCenterQuotaCall) Do(opts ...googleapi.CallOption) (*ContactCenterQuota, error) {
1123 gensupport.SetOptions(c.urlParams_, opts...)
1124 res, err := c.doRequest("json")
1125 if res != nil && res.StatusCode == http.StatusNotModified {
1126 if res.Body != nil {
1127 res.Body.Close()
1128 }
1129 return nil, gensupport.WrapError(&googleapi.Error{
1130 Code: res.StatusCode,
1131 Header: res.Header,
1132 })
1133 }
1134 if err != nil {
1135 return nil, err
1136 }
1137 defer googleapi.CloseBody(res)
1138 if err := googleapi.CheckResponse(res); err != nil {
1139 return nil, gensupport.WrapError(err)
1140 }
1141 ret := &ContactCenterQuota{
1142 ServerResponse: googleapi.ServerResponse{
1143 Header: res.Header,
1144 HTTPStatusCode: res.StatusCode,
1145 },
1146 }
1147 target := &ret
1148 if err := gensupport.DecodeResponse(target, res); err != nil {
1149 return nil, err
1150 }
1151 return ret, nil
1152 }
1153
1154 type ProjectsLocationsContactCentersCreateCall struct {
1155 s *Service
1156 parent string
1157 contactcenter *ContactCenter
1158 urlParams_ gensupport.URLParams
1159 ctx_ context.Context
1160 header_ http.Header
1161 }
1162
1163
1164
1165
1166 func (r *ProjectsLocationsContactCentersService) Create(parent string, contactcenter *ContactCenter) *ProjectsLocationsContactCentersCreateCall {
1167 c := &ProjectsLocationsContactCentersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1168 c.parent = parent
1169 c.contactcenter = contactcenter
1170 return c
1171 }
1172
1173
1174
1175
1176 func (c *ProjectsLocationsContactCentersCreateCall) ContactCenterId(contactCenterId string) *ProjectsLocationsContactCentersCreateCall {
1177 c.urlParams_.Set("contactCenterId", contactCenterId)
1178 return c
1179 }
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192 func (c *ProjectsLocationsContactCentersCreateCall) RequestId(requestId string) *ProjectsLocationsContactCentersCreateCall {
1193 c.urlParams_.Set("requestId", requestId)
1194 return c
1195 }
1196
1197
1198
1199
1200 func (c *ProjectsLocationsContactCentersCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsContactCentersCreateCall {
1201 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1202 return c
1203 }
1204
1205
1206 func (c *ProjectsLocationsContactCentersCreateCall) Context(ctx context.Context) *ProjectsLocationsContactCentersCreateCall {
1207 c.ctx_ = ctx
1208 return c
1209 }
1210
1211
1212
1213 func (c *ProjectsLocationsContactCentersCreateCall) Header() http.Header {
1214 if c.header_ == nil {
1215 c.header_ = make(http.Header)
1216 }
1217 return c.header_
1218 }
1219
1220 func (c *ProjectsLocationsContactCentersCreateCall) doRequest(alt string) (*http.Response, error) {
1221 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1222 var body io.Reader = nil
1223 body, err := googleapi.WithoutDataWrapper.JSONReader(c.contactcenter)
1224 if err != nil {
1225 return nil, err
1226 }
1227 c.urlParams_.Set("alt", alt)
1228 c.urlParams_.Set("prettyPrint", "false")
1229 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/contactCenters")
1230 urls += "?" + c.urlParams_.Encode()
1231 req, err := http.NewRequest("POST", urls, body)
1232 if err != nil {
1233 return nil, err
1234 }
1235 req.Header = reqHeaders
1236 googleapi.Expand(req.URL, map[string]string{
1237 "parent": c.parent,
1238 })
1239 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1240 }
1241
1242
1243
1244
1245
1246
1247 func (c *ProjectsLocationsContactCentersCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
1248 gensupport.SetOptions(c.urlParams_, opts...)
1249 res, err := c.doRequest("json")
1250 if res != nil && res.StatusCode == http.StatusNotModified {
1251 if res.Body != nil {
1252 res.Body.Close()
1253 }
1254 return nil, gensupport.WrapError(&googleapi.Error{
1255 Code: res.StatusCode,
1256 Header: res.Header,
1257 })
1258 }
1259 if err != nil {
1260 return nil, err
1261 }
1262 defer googleapi.CloseBody(res)
1263 if err := googleapi.CheckResponse(res); err != nil {
1264 return nil, gensupport.WrapError(err)
1265 }
1266 ret := &Operation{
1267 ServerResponse: googleapi.ServerResponse{
1268 Header: res.Header,
1269 HTTPStatusCode: res.StatusCode,
1270 },
1271 }
1272 target := &ret
1273 if err := gensupport.DecodeResponse(target, res); err != nil {
1274 return nil, err
1275 }
1276 return ret, nil
1277 }
1278
1279 type ProjectsLocationsContactCentersDeleteCall struct {
1280 s *Service
1281 name string
1282 urlParams_ gensupport.URLParams
1283 ctx_ context.Context
1284 header_ http.Header
1285 }
1286
1287
1288
1289
1290 func (r *ProjectsLocationsContactCentersService) Delete(name string) *ProjectsLocationsContactCentersDeleteCall {
1291 c := &ProjectsLocationsContactCentersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1292 c.name = name
1293 return c
1294 }
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307 func (c *ProjectsLocationsContactCentersDeleteCall) RequestId(requestId string) *ProjectsLocationsContactCentersDeleteCall {
1308 c.urlParams_.Set("requestId", requestId)
1309 return c
1310 }
1311
1312
1313
1314
1315 func (c *ProjectsLocationsContactCentersDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsContactCentersDeleteCall {
1316 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1317 return c
1318 }
1319
1320
1321 func (c *ProjectsLocationsContactCentersDeleteCall) Context(ctx context.Context) *ProjectsLocationsContactCentersDeleteCall {
1322 c.ctx_ = ctx
1323 return c
1324 }
1325
1326
1327
1328 func (c *ProjectsLocationsContactCentersDeleteCall) Header() http.Header {
1329 if c.header_ == nil {
1330 c.header_ = make(http.Header)
1331 }
1332 return c.header_
1333 }
1334
1335 func (c *ProjectsLocationsContactCentersDeleteCall) doRequest(alt string) (*http.Response, error) {
1336 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1337 var body io.Reader = nil
1338 c.urlParams_.Set("alt", alt)
1339 c.urlParams_.Set("prettyPrint", "false")
1340 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
1341 urls += "?" + c.urlParams_.Encode()
1342 req, err := http.NewRequest("DELETE", urls, body)
1343 if err != nil {
1344 return nil, err
1345 }
1346 req.Header = reqHeaders
1347 googleapi.Expand(req.URL, map[string]string{
1348 "name": c.name,
1349 })
1350 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1351 }
1352
1353
1354
1355
1356
1357
1358 func (c *ProjectsLocationsContactCentersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
1359 gensupport.SetOptions(c.urlParams_, opts...)
1360 res, err := c.doRequest("json")
1361 if res != nil && res.StatusCode == http.StatusNotModified {
1362 if res.Body != nil {
1363 res.Body.Close()
1364 }
1365 return nil, gensupport.WrapError(&googleapi.Error{
1366 Code: res.StatusCode,
1367 Header: res.Header,
1368 })
1369 }
1370 if err != nil {
1371 return nil, err
1372 }
1373 defer googleapi.CloseBody(res)
1374 if err := googleapi.CheckResponse(res); err != nil {
1375 return nil, gensupport.WrapError(err)
1376 }
1377 ret := &Operation{
1378 ServerResponse: googleapi.ServerResponse{
1379 Header: res.Header,
1380 HTTPStatusCode: res.StatusCode,
1381 },
1382 }
1383 target := &ret
1384 if err := gensupport.DecodeResponse(target, res); err != nil {
1385 return nil, err
1386 }
1387 return ret, nil
1388 }
1389
1390 type ProjectsLocationsContactCentersGetCall struct {
1391 s *Service
1392 name string
1393 urlParams_ gensupport.URLParams
1394 ifNoneMatch_ string
1395 ctx_ context.Context
1396 header_ http.Header
1397 }
1398
1399
1400
1401
1402 func (r *ProjectsLocationsContactCentersService) Get(name string) *ProjectsLocationsContactCentersGetCall {
1403 c := &ProjectsLocationsContactCentersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1404 c.name = name
1405 return c
1406 }
1407
1408
1409
1410
1411 func (c *ProjectsLocationsContactCentersGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsContactCentersGetCall {
1412 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1413 return c
1414 }
1415
1416
1417
1418
1419 func (c *ProjectsLocationsContactCentersGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsContactCentersGetCall {
1420 c.ifNoneMatch_ = entityTag
1421 return c
1422 }
1423
1424
1425 func (c *ProjectsLocationsContactCentersGetCall) Context(ctx context.Context) *ProjectsLocationsContactCentersGetCall {
1426 c.ctx_ = ctx
1427 return c
1428 }
1429
1430
1431
1432 func (c *ProjectsLocationsContactCentersGetCall) Header() http.Header {
1433 if c.header_ == nil {
1434 c.header_ = make(http.Header)
1435 }
1436 return c.header_
1437 }
1438
1439 func (c *ProjectsLocationsContactCentersGetCall) doRequest(alt string) (*http.Response, error) {
1440 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1441 if c.ifNoneMatch_ != "" {
1442 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1443 }
1444 var body io.Reader = nil
1445 c.urlParams_.Set("alt", alt)
1446 c.urlParams_.Set("prettyPrint", "false")
1447 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
1448 urls += "?" + c.urlParams_.Encode()
1449 req, err := http.NewRequest("GET", urls, body)
1450 if err != nil {
1451 return nil, err
1452 }
1453 req.Header = reqHeaders
1454 googleapi.Expand(req.URL, map[string]string{
1455 "name": c.name,
1456 })
1457 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1458 }
1459
1460
1461
1462
1463
1464
1465 func (c *ProjectsLocationsContactCentersGetCall) Do(opts ...googleapi.CallOption) (*ContactCenter, error) {
1466 gensupport.SetOptions(c.urlParams_, opts...)
1467 res, err := c.doRequest("json")
1468 if res != nil && res.StatusCode == http.StatusNotModified {
1469 if res.Body != nil {
1470 res.Body.Close()
1471 }
1472 return nil, gensupport.WrapError(&googleapi.Error{
1473 Code: res.StatusCode,
1474 Header: res.Header,
1475 })
1476 }
1477 if err != nil {
1478 return nil, err
1479 }
1480 defer googleapi.CloseBody(res)
1481 if err := googleapi.CheckResponse(res); err != nil {
1482 return nil, gensupport.WrapError(err)
1483 }
1484 ret := &ContactCenter{
1485 ServerResponse: googleapi.ServerResponse{
1486 Header: res.Header,
1487 HTTPStatusCode: res.StatusCode,
1488 },
1489 }
1490 target := &ret
1491 if err := gensupport.DecodeResponse(target, res); err != nil {
1492 return nil, err
1493 }
1494 return ret, nil
1495 }
1496
1497 type ProjectsLocationsContactCentersListCall struct {
1498 s *Service
1499 parent string
1500 urlParams_ gensupport.URLParams
1501 ifNoneMatch_ string
1502 ctx_ context.Context
1503 header_ http.Header
1504 }
1505
1506
1507
1508
1509 func (r *ProjectsLocationsContactCentersService) List(parent string) *ProjectsLocationsContactCentersListCall {
1510 c := &ProjectsLocationsContactCentersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1511 c.parent = parent
1512 return c
1513 }
1514
1515
1516 func (c *ProjectsLocationsContactCentersListCall) Filter(filter string) *ProjectsLocationsContactCentersListCall {
1517 c.urlParams_.Set("filter", filter)
1518 return c
1519 }
1520
1521
1522
1523 func (c *ProjectsLocationsContactCentersListCall) OrderBy(orderBy string) *ProjectsLocationsContactCentersListCall {
1524 c.urlParams_.Set("orderBy", orderBy)
1525 return c
1526 }
1527
1528
1529
1530
1531 func (c *ProjectsLocationsContactCentersListCall) PageSize(pageSize int64) *ProjectsLocationsContactCentersListCall {
1532 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1533 return c
1534 }
1535
1536
1537
1538 func (c *ProjectsLocationsContactCentersListCall) PageToken(pageToken string) *ProjectsLocationsContactCentersListCall {
1539 c.urlParams_.Set("pageToken", pageToken)
1540 return c
1541 }
1542
1543
1544
1545
1546 func (c *ProjectsLocationsContactCentersListCall) Fields(s ...googleapi.Field) *ProjectsLocationsContactCentersListCall {
1547 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1548 return c
1549 }
1550
1551
1552
1553
1554 func (c *ProjectsLocationsContactCentersListCall) IfNoneMatch(entityTag string) *ProjectsLocationsContactCentersListCall {
1555 c.ifNoneMatch_ = entityTag
1556 return c
1557 }
1558
1559
1560 func (c *ProjectsLocationsContactCentersListCall) Context(ctx context.Context) *ProjectsLocationsContactCentersListCall {
1561 c.ctx_ = ctx
1562 return c
1563 }
1564
1565
1566
1567 func (c *ProjectsLocationsContactCentersListCall) Header() http.Header {
1568 if c.header_ == nil {
1569 c.header_ = make(http.Header)
1570 }
1571 return c.header_
1572 }
1573
1574 func (c *ProjectsLocationsContactCentersListCall) doRequest(alt string) (*http.Response, error) {
1575 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1576 if c.ifNoneMatch_ != "" {
1577 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1578 }
1579 var body io.Reader = nil
1580 c.urlParams_.Set("alt", alt)
1581 c.urlParams_.Set("prettyPrint", "false")
1582 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/contactCenters")
1583 urls += "?" + c.urlParams_.Encode()
1584 req, err := http.NewRequest("GET", urls, body)
1585 if err != nil {
1586 return nil, err
1587 }
1588 req.Header = reqHeaders
1589 googleapi.Expand(req.URL, map[string]string{
1590 "parent": c.parent,
1591 })
1592 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1593 }
1594
1595
1596
1597
1598
1599
1600
1601 func (c *ProjectsLocationsContactCentersListCall) Do(opts ...googleapi.CallOption) (*ListContactCentersResponse, error) {
1602 gensupport.SetOptions(c.urlParams_, opts...)
1603 res, err := c.doRequest("json")
1604 if res != nil && res.StatusCode == http.StatusNotModified {
1605 if res.Body != nil {
1606 res.Body.Close()
1607 }
1608 return nil, gensupport.WrapError(&googleapi.Error{
1609 Code: res.StatusCode,
1610 Header: res.Header,
1611 })
1612 }
1613 if err != nil {
1614 return nil, err
1615 }
1616 defer googleapi.CloseBody(res)
1617 if err := googleapi.CheckResponse(res); err != nil {
1618 return nil, gensupport.WrapError(err)
1619 }
1620 ret := &ListContactCentersResponse{
1621 ServerResponse: googleapi.ServerResponse{
1622 Header: res.Header,
1623 HTTPStatusCode: res.StatusCode,
1624 },
1625 }
1626 target := &ret
1627 if err := gensupport.DecodeResponse(target, res); err != nil {
1628 return nil, err
1629 }
1630 return ret, nil
1631 }
1632
1633
1634
1635
1636 func (c *ProjectsLocationsContactCentersListCall) Pages(ctx context.Context, f func(*ListContactCentersResponse) error) error {
1637 c.ctx_ = ctx
1638 defer c.PageToken(c.urlParams_.Get("pageToken"))
1639 for {
1640 x, err := c.Do()
1641 if err != nil {
1642 return err
1643 }
1644 if err := f(x); err != nil {
1645 return err
1646 }
1647 if x.NextPageToken == "" {
1648 return nil
1649 }
1650 c.PageToken(x.NextPageToken)
1651 }
1652 }
1653
1654 type ProjectsLocationsContactCentersPatchCall struct {
1655 s *Service
1656 name string
1657 contactcenter *ContactCenter
1658 urlParams_ gensupport.URLParams
1659 ctx_ context.Context
1660 header_ http.Header
1661 }
1662
1663
1664
1665
1666 func (r *ProjectsLocationsContactCentersService) Patch(name string, contactcenter *ContactCenter) *ProjectsLocationsContactCentersPatchCall {
1667 c := &ProjectsLocationsContactCentersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1668 c.name = name
1669 c.contactcenter = contactcenter
1670 return c
1671 }
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684 func (c *ProjectsLocationsContactCentersPatchCall) RequestId(requestId string) *ProjectsLocationsContactCentersPatchCall {
1685 c.urlParams_.Set("requestId", requestId)
1686 return c
1687 }
1688
1689
1690
1691
1692
1693
1694
1695 func (c *ProjectsLocationsContactCentersPatchCall) UpdateMask(updateMask string) *ProjectsLocationsContactCentersPatchCall {
1696 c.urlParams_.Set("updateMask", updateMask)
1697 return c
1698 }
1699
1700
1701
1702
1703 func (c *ProjectsLocationsContactCentersPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsContactCentersPatchCall {
1704 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1705 return c
1706 }
1707
1708
1709 func (c *ProjectsLocationsContactCentersPatchCall) Context(ctx context.Context) *ProjectsLocationsContactCentersPatchCall {
1710 c.ctx_ = ctx
1711 return c
1712 }
1713
1714
1715
1716 func (c *ProjectsLocationsContactCentersPatchCall) Header() http.Header {
1717 if c.header_ == nil {
1718 c.header_ = make(http.Header)
1719 }
1720 return c.header_
1721 }
1722
1723 func (c *ProjectsLocationsContactCentersPatchCall) doRequest(alt string) (*http.Response, error) {
1724 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1725 var body io.Reader = nil
1726 body, err := googleapi.WithoutDataWrapper.JSONReader(c.contactcenter)
1727 if err != nil {
1728 return nil, err
1729 }
1730 c.urlParams_.Set("alt", alt)
1731 c.urlParams_.Set("prettyPrint", "false")
1732 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
1733 urls += "?" + c.urlParams_.Encode()
1734 req, err := http.NewRequest("PATCH", urls, body)
1735 if err != nil {
1736 return nil, err
1737 }
1738 req.Header = reqHeaders
1739 googleapi.Expand(req.URL, map[string]string{
1740 "name": c.name,
1741 })
1742 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1743 }
1744
1745
1746
1747
1748
1749
1750 func (c *ProjectsLocationsContactCentersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
1751 gensupport.SetOptions(c.urlParams_, opts...)
1752 res, err := c.doRequest("json")
1753 if res != nil && res.StatusCode == http.StatusNotModified {
1754 if res.Body != nil {
1755 res.Body.Close()
1756 }
1757 return nil, gensupport.WrapError(&googleapi.Error{
1758 Code: res.StatusCode,
1759 Header: res.Header,
1760 })
1761 }
1762 if err != nil {
1763 return nil, err
1764 }
1765 defer googleapi.CloseBody(res)
1766 if err := googleapi.CheckResponse(res); err != nil {
1767 return nil, gensupport.WrapError(err)
1768 }
1769 ret := &Operation{
1770 ServerResponse: googleapi.ServerResponse{
1771 Header: res.Header,
1772 HTTPStatusCode: res.StatusCode,
1773 },
1774 }
1775 target := &ret
1776 if err := gensupport.DecodeResponse(target, res); err != nil {
1777 return nil, err
1778 }
1779 return ret, nil
1780 }
1781
1782 type ProjectsLocationsOperationsCancelCall struct {
1783 s *Service
1784 name string
1785 canceloperationrequest *CancelOperationRequest
1786 urlParams_ gensupport.URLParams
1787 ctx_ context.Context
1788 header_ http.Header
1789 }
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802 func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall {
1803 c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1804 c.name = name
1805 c.canceloperationrequest = canceloperationrequest
1806 return c
1807 }
1808
1809
1810
1811
1812 func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
1813 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1814 return c
1815 }
1816
1817
1818 func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
1819 c.ctx_ = ctx
1820 return c
1821 }
1822
1823
1824
1825 func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
1826 if c.header_ == nil {
1827 c.header_ = make(http.Header)
1828 }
1829 return c.header_
1830 }
1831
1832 func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
1833 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1834 var body io.Reader = nil
1835 body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
1836 if err != nil {
1837 return nil, err
1838 }
1839 c.urlParams_.Set("alt", alt)
1840 c.urlParams_.Set("prettyPrint", "false")
1841 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}:cancel")
1842 urls += "?" + c.urlParams_.Encode()
1843 req, err := http.NewRequest("POST", urls, body)
1844 if err != nil {
1845 return nil, err
1846 }
1847 req.Header = reqHeaders
1848 googleapi.Expand(req.URL, map[string]string{
1849 "name": c.name,
1850 })
1851 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1852 }
1853
1854
1855
1856
1857
1858
1859 func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
1860 gensupport.SetOptions(c.urlParams_, opts...)
1861 res, err := c.doRequest("json")
1862 if res != nil && res.StatusCode == http.StatusNotModified {
1863 if res.Body != nil {
1864 res.Body.Close()
1865 }
1866 return nil, gensupport.WrapError(&googleapi.Error{
1867 Code: res.StatusCode,
1868 Header: res.Header,
1869 })
1870 }
1871 if err != nil {
1872 return nil, err
1873 }
1874 defer googleapi.CloseBody(res)
1875 if err := googleapi.CheckResponse(res); err != nil {
1876 return nil, gensupport.WrapError(err)
1877 }
1878 ret := &Empty{
1879 ServerResponse: googleapi.ServerResponse{
1880 Header: res.Header,
1881 HTTPStatusCode: res.StatusCode,
1882 },
1883 }
1884 target := &ret
1885 if err := gensupport.DecodeResponse(target, res); err != nil {
1886 return nil, err
1887 }
1888 return ret, nil
1889 }
1890
1891 type ProjectsLocationsOperationsDeleteCall struct {
1892 s *Service
1893 name string
1894 urlParams_ gensupport.URLParams
1895 ctx_ context.Context
1896 header_ http.Header
1897 }
1898
1899
1900
1901
1902
1903
1904
1905 func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
1906 c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1907 c.name = name
1908 return c
1909 }
1910
1911
1912
1913
1914 func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
1915 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1916 return c
1917 }
1918
1919
1920 func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
1921 c.ctx_ = ctx
1922 return c
1923 }
1924
1925
1926
1927 func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
1928 if c.header_ == nil {
1929 c.header_ = make(http.Header)
1930 }
1931 return c.header_
1932 }
1933
1934 func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
1935 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1936 var body io.Reader = nil
1937 c.urlParams_.Set("alt", alt)
1938 c.urlParams_.Set("prettyPrint", "false")
1939 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
1940 urls += "?" + c.urlParams_.Encode()
1941 req, err := http.NewRequest("DELETE", urls, body)
1942 if err != nil {
1943 return nil, err
1944 }
1945 req.Header = reqHeaders
1946 googleapi.Expand(req.URL, map[string]string{
1947 "name": c.name,
1948 })
1949 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1950 }
1951
1952
1953
1954
1955
1956
1957 func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
1958 gensupport.SetOptions(c.urlParams_, opts...)
1959 res, err := c.doRequest("json")
1960 if res != nil && res.StatusCode == http.StatusNotModified {
1961 if res.Body != nil {
1962 res.Body.Close()
1963 }
1964 return nil, gensupport.WrapError(&googleapi.Error{
1965 Code: res.StatusCode,
1966 Header: res.Header,
1967 })
1968 }
1969 if err != nil {
1970 return nil, err
1971 }
1972 defer googleapi.CloseBody(res)
1973 if err := googleapi.CheckResponse(res); err != nil {
1974 return nil, gensupport.WrapError(err)
1975 }
1976 ret := &Empty{
1977 ServerResponse: googleapi.ServerResponse{
1978 Header: res.Header,
1979 HTTPStatusCode: res.StatusCode,
1980 },
1981 }
1982 target := &ret
1983 if err := gensupport.DecodeResponse(target, res); err != nil {
1984 return nil, err
1985 }
1986 return ret, nil
1987 }
1988
1989 type ProjectsLocationsOperationsGetCall struct {
1990 s *Service
1991 name string
1992 urlParams_ gensupport.URLParams
1993 ifNoneMatch_ string
1994 ctx_ context.Context
1995 header_ http.Header
1996 }
1997
1998
1999
2000
2001
2002
2003 func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
2004 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2005 c.name = name
2006 return c
2007 }
2008
2009
2010
2011
2012 func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
2013 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2014 return c
2015 }
2016
2017
2018
2019
2020 func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
2021 c.ifNoneMatch_ = entityTag
2022 return c
2023 }
2024
2025
2026 func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
2027 c.ctx_ = ctx
2028 return c
2029 }
2030
2031
2032
2033 func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
2034 if c.header_ == nil {
2035 c.header_ = make(http.Header)
2036 }
2037 return c.header_
2038 }
2039
2040 func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
2041 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2042 if c.ifNoneMatch_ != "" {
2043 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2044 }
2045 var body io.Reader = nil
2046 c.urlParams_.Set("alt", alt)
2047 c.urlParams_.Set("prettyPrint", "false")
2048 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
2049 urls += "?" + c.urlParams_.Encode()
2050 req, err := http.NewRequest("GET", urls, body)
2051 if err != nil {
2052 return nil, err
2053 }
2054 req.Header = reqHeaders
2055 googleapi.Expand(req.URL, map[string]string{
2056 "name": c.name,
2057 })
2058 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2059 }
2060
2061
2062
2063
2064
2065
2066 func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2067 gensupport.SetOptions(c.urlParams_, opts...)
2068 res, err := c.doRequest("json")
2069 if res != nil && res.StatusCode == http.StatusNotModified {
2070 if res.Body != nil {
2071 res.Body.Close()
2072 }
2073 return nil, gensupport.WrapError(&googleapi.Error{
2074 Code: res.StatusCode,
2075 Header: res.Header,
2076 })
2077 }
2078 if err != nil {
2079 return nil, err
2080 }
2081 defer googleapi.CloseBody(res)
2082 if err := googleapi.CheckResponse(res); err != nil {
2083 return nil, gensupport.WrapError(err)
2084 }
2085 ret := &Operation{
2086 ServerResponse: googleapi.ServerResponse{
2087 Header: res.Header,
2088 HTTPStatusCode: res.StatusCode,
2089 },
2090 }
2091 target := &ret
2092 if err := gensupport.DecodeResponse(target, res); err != nil {
2093 return nil, err
2094 }
2095 return ret, nil
2096 }
2097
2098 type ProjectsLocationsOperationsListCall struct {
2099 s *Service
2100 name string
2101 urlParams_ gensupport.URLParams
2102 ifNoneMatch_ string
2103 ctx_ context.Context
2104 header_ http.Header
2105 }
2106
2107
2108
2109
2110
2111 func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
2112 c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2113 c.name = name
2114 return c
2115 }
2116
2117
2118 func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
2119 c.urlParams_.Set("filter", filter)
2120 return c
2121 }
2122
2123
2124
2125 func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
2126 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2127 return c
2128 }
2129
2130
2131
2132 func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
2133 c.urlParams_.Set("pageToken", pageToken)
2134 return c
2135 }
2136
2137
2138
2139
2140 func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
2141 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2142 return c
2143 }
2144
2145
2146
2147
2148 func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
2149 c.ifNoneMatch_ = entityTag
2150 return c
2151 }
2152
2153
2154 func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
2155 c.ctx_ = ctx
2156 return c
2157 }
2158
2159
2160
2161 func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
2162 if c.header_ == nil {
2163 c.header_ = make(http.Header)
2164 }
2165 return c.header_
2166 }
2167
2168 func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
2169 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2170 if c.ifNoneMatch_ != "" {
2171 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2172 }
2173 var body io.Reader = nil
2174 c.urlParams_.Set("alt", alt)
2175 c.urlParams_.Set("prettyPrint", "false")
2176 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}/operations")
2177 urls += "?" + c.urlParams_.Encode()
2178 req, err := http.NewRequest("GET", urls, body)
2179 if err != nil {
2180 return nil, err
2181 }
2182 req.Header = reqHeaders
2183 googleapi.Expand(req.URL, map[string]string{
2184 "name": c.name,
2185 })
2186 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2187 }
2188
2189
2190
2191
2192
2193
2194
2195 func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
2196 gensupport.SetOptions(c.urlParams_, opts...)
2197 res, err := c.doRequest("json")
2198 if res != nil && res.StatusCode == http.StatusNotModified {
2199 if res.Body != nil {
2200 res.Body.Close()
2201 }
2202 return nil, gensupport.WrapError(&googleapi.Error{
2203 Code: res.StatusCode,
2204 Header: res.Header,
2205 })
2206 }
2207 if err != nil {
2208 return nil, err
2209 }
2210 defer googleapi.CloseBody(res)
2211 if err := googleapi.CheckResponse(res); err != nil {
2212 return nil, gensupport.WrapError(err)
2213 }
2214 ret := &ListOperationsResponse{
2215 ServerResponse: googleapi.ServerResponse{
2216 Header: res.Header,
2217 HTTPStatusCode: res.StatusCode,
2218 },
2219 }
2220 target := &ret
2221 if err := gensupport.DecodeResponse(target, res); err != nil {
2222 return nil, err
2223 }
2224 return ret, nil
2225 }
2226
2227
2228
2229
2230 func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
2231 c.ctx_ = ctx
2232 defer c.PageToken(c.urlParams_.Get("pageToken"))
2233 for {
2234 x, err := c.Do()
2235 if err != nil {
2236 return err
2237 }
2238 if err := f(x); err != nil {
2239 return err
2240 }
2241 if x.NextPageToken == "" {
2242 return nil
2243 }
2244 c.PageToken(x.NextPageToken)
2245 }
2246 }
2247
View as plain text