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 package dataportability
57
58 import (
59 "bytes"
60 "context"
61 "encoding/json"
62 "errors"
63 "fmt"
64 "io"
65 "net/http"
66 "net/url"
67 "strconv"
68 "strings"
69
70 googleapi "google.golang.org/api/googleapi"
71 internal "google.golang.org/api/internal"
72 gensupport "google.golang.org/api/internal/gensupport"
73 option "google.golang.org/api/option"
74 internaloption "google.golang.org/api/option/internaloption"
75 htransport "google.golang.org/api/transport/http"
76 )
77
78
79
80 var _ = bytes.NewBuffer
81 var _ = strconv.Itoa
82 var _ = fmt.Sprintf
83 var _ = json.NewDecoder
84 var _ = io.Copy
85 var _ = url.Parse
86 var _ = gensupport.MarshalJSON
87 var _ = googleapi.Version
88 var _ = errors.New
89 var _ = strings.Replace
90 var _ = context.Canceled
91 var _ = internaloption.WithDefaultEndpoint
92 var _ = internal.Version
93
94 const apiId = "dataportability:v1beta"
95 const apiName = "dataportability"
96 const apiVersion = "v1beta"
97 const basePath = "https://dataportability.googleapis.com/"
98 const basePathTemplate = "https://dataportability.UNIVERSE_DOMAIN/"
99 const mtlsBasePath = "https://dataportability.mtls.googleapis.com/"
100
101
102 const (
103
104
105 DataportabilityBusinessmessagingConversationsScope = "https://www.googleapis.com/auth/dataportability.businessmessaging.conversations"
106
107
108 DataportabilityChromeAutofillScope = "https://www.googleapis.com/auth/dataportability.chrome.autofill"
109
110
111 DataportabilityChromeBookmarksScope = "https://www.googleapis.com/auth/dataportability.chrome.bookmarks"
112
113
114 DataportabilityChromeDictionaryScope = "https://www.googleapis.com/auth/dataportability.chrome.dictionary"
115
116
117 DataportabilityChromeExtensionsScope = "https://www.googleapis.com/auth/dataportability.chrome.extensions"
118
119
120 DataportabilityChromeHistoryScope = "https://www.googleapis.com/auth/dataportability.chrome.history"
121
122
123 DataportabilityChromeReadingListScope = "https://www.googleapis.com/auth/dataportability.chrome.reading_list"
124
125
126 DataportabilityChromeSettingsScope = "https://www.googleapis.com/auth/dataportability.chrome.settings"
127
128
129 DataportabilityDiscoverFollowsScope = "https://www.googleapis.com/auth/dataportability.discover.follows"
130
131
132 DataportabilityDiscoverLikesScope = "https://www.googleapis.com/auth/dataportability.discover.likes"
133
134
135 DataportabilityDiscoverNotInterestedScope = "https://www.googleapis.com/auth/dataportability.discover.not_interested"
136
137
138 DataportabilityMapsAliasedPlacesScope = "https://www.googleapis.com/auth/dataportability.maps.aliased_places"
139
140
141 DataportabilityMapsCommuteRoutesScope = "https://www.googleapis.com/auth/dataportability.maps.commute_routes"
142
143
144 DataportabilityMapsCommuteSettingsScope = "https://www.googleapis.com/auth/dataportability.maps.commute_settings"
145
146
147 DataportabilityMapsEvProfileScope = "https://www.googleapis.com/auth/dataportability.maps.ev_profile"
148
149
150
151 DataportabilityMapsFactualContributionsScope = "https://www.googleapis.com/auth/dataportability.maps.factual_contributions"
152
153
154 DataportabilityMapsOfferingContributionsScope = "https://www.googleapis.com/auth/dataportability.maps.offering_contributions"
155
156
157 DataportabilityMapsPhotosVideosScope = "https://www.googleapis.com/auth/dataportability.maps.photos_videos"
158
159
160 DataportabilityMapsQuestionsAnswersScope = "https://www.googleapis.com/auth/dataportability.maps.questions_answers"
161
162
163 DataportabilityMapsReviewsScope = "https://www.googleapis.com/auth/dataportability.maps.reviews"
164
165
166 DataportabilityMapsStarredPlacesScope = "https://www.googleapis.com/auth/dataportability.maps.starred_places"
167
168
169 DataportabilityMyactivityMapsScope = "https://www.googleapis.com/auth/dataportability.myactivity.maps"
170
171
172 DataportabilityMyactivityMyadcenterScope = "https://www.googleapis.com/auth/dataportability.myactivity.myadcenter"
173
174
175 DataportabilityMyactivityPlayScope = "https://www.googleapis.com/auth/dataportability.myactivity.play"
176
177
178 DataportabilityMyactivitySearchScope = "https://www.googleapis.com/auth/dataportability.myactivity.search"
179
180
181 DataportabilityMyactivityShoppingScope = "https://www.googleapis.com/auth/dataportability.myactivity.shopping"
182
183
184 DataportabilityMyactivityYoutubeScope = "https://www.googleapis.com/auth/dataportability.myactivity.youtube"
185
186
187 DataportabilityMymapsMapsScope = "https://www.googleapis.com/auth/dataportability.mymaps.maps"
188
189
190 DataportabilityOrderReservePurchasesReservationsScope = "https://www.googleapis.com/auth/dataportability.order_reserve.purchases_reservations"
191
192
193
194 DataportabilityPlayDevicesScope = "https://www.googleapis.com/auth/dataportability.play.devices"
195
196
197
198 DataportabilityPlayGroupingScope = "https://www.googleapis.com/auth/dataportability.play.grouping"
199
200
201 DataportabilityPlayInstallsScope = "https://www.googleapis.com/auth/dataportability.play.installs"
202
203
204
205 DataportabilityPlayLibraryScope = "https://www.googleapis.com/auth/dataportability.play.library"
206
207
208 DataportabilityPlayPlaypointsScope = "https://www.googleapis.com/auth/dataportability.play.playpoints"
209
210
211 DataportabilityPlayPromotionsScope = "https://www.googleapis.com/auth/dataportability.play.promotions"
212
213
214 DataportabilityPlayPurchasesScope = "https://www.googleapis.com/auth/dataportability.play.purchases"
215
216
217 DataportabilityPlayRedemptionsScope = "https://www.googleapis.com/auth/dataportability.play.redemptions"
218
219
220 DataportabilityPlaySubscriptionsScope = "https://www.googleapis.com/auth/dataportability.play.subscriptions"
221
222
223 DataportabilityPlayUsersettingsScope = "https://www.googleapis.com/auth/dataportability.play.usersettings"
224
225
226
227 DataportabilitySavedCollectionsScope = "https://www.googleapis.com/auth/dataportability.saved.collections"
228
229
230 DataportabilitySearchUgcMediaReviewsAndStarsScope = "https://www.googleapis.com/auth/dataportability.search_ugc.media.reviews_and_stars"
231
232
233
234 DataportabilitySearchUgcMediaStreamingVideoProvidersScope = "https://www.googleapis.com/auth/dataportability.search_ugc.media.streaming_video_providers"
235
236
237
238 DataportabilitySearchUgcMediaThumbsScope = "https://www.googleapis.com/auth/dataportability.search_ugc.media.thumbs"
239
240
241
242 DataportabilitySearchUgcMediaWatchedScope = "https://www.googleapis.com/auth/dataportability.search_ugc.media.watched"
243
244
245 DataportabilitySearchnotificationsSettingsScope = "https://www.googleapis.com/auth/dataportability.searchnotifications.settings"
246
247
248 DataportabilitySearchnotificationsSubscriptionsScope = "https://www.googleapis.com/auth/dataportability.searchnotifications.subscriptions"
249
250
251 DataportabilityShoppingAddressesScope = "https://www.googleapis.com/auth/dataportability.shopping.addresses"
252
253
254
255 DataportabilityShoppingReviewsScope = "https://www.googleapis.com/auth/dataportability.shopping.reviews"
256
257
258 DataportabilityStreetviewImageryScope = "https://www.googleapis.com/auth/dataportability.streetview.imagery"
259
260
261 DataportabilityYoutubeChannelScope = "https://www.googleapis.com/auth/dataportability.youtube.channel"
262
263
264 DataportabilityYoutubeCommentsScope = "https://www.googleapis.com/auth/dataportability.youtube.comments"
265
266
267 DataportabilityYoutubeLiveChatScope = "https://www.googleapis.com/auth/dataportability.youtube.live_chat"
268
269
270
271 DataportabilityYoutubeMusicScope = "https://www.googleapis.com/auth/dataportability.youtube.music"
272
273
274 DataportabilityYoutubePlayableScope = "https://www.googleapis.com/auth/dataportability.youtube.playable"
275
276
277 DataportabilityYoutubePostsScope = "https://www.googleapis.com/auth/dataportability.youtube.posts"
278
279
280 DataportabilityYoutubePrivatePlaylistsScope = "https://www.googleapis.com/auth/dataportability.youtube.private_playlists"
281
282
283 DataportabilityYoutubePrivateVideosScope = "https://www.googleapis.com/auth/dataportability.youtube.private_videos"
284
285
286 DataportabilityYoutubePublicPlaylistsScope = "https://www.googleapis.com/auth/dataportability.youtube.public_playlists"
287
288
289 DataportabilityYoutubePublicVideosScope = "https://www.googleapis.com/auth/dataportability.youtube.public_videos"
290
291
292 DataportabilityYoutubeShoppingScope = "https://www.googleapis.com/auth/dataportability.youtube.shopping"
293
294
295 DataportabilityYoutubeSubscriptionsScope = "https://www.googleapis.com/auth/dataportability.youtube.subscriptions"
296
297
298 DataportabilityYoutubeUnlistedPlaylistsScope = "https://www.googleapis.com/auth/dataportability.youtube.unlisted_playlists"
299
300
301 DataportabilityYoutubeUnlistedVideosScope = "https://www.googleapis.com/auth/dataportability.youtube.unlisted_videos"
302 )
303
304
305 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
306 scopesOption := internaloption.WithDefaultScopes(
307 "https://www.googleapis.com/auth/dataportability.businessmessaging.conversations",
308 "https://www.googleapis.com/auth/dataportability.chrome.autofill",
309 "https://www.googleapis.com/auth/dataportability.chrome.bookmarks",
310 "https://www.googleapis.com/auth/dataportability.chrome.dictionary",
311 "https://www.googleapis.com/auth/dataportability.chrome.extensions",
312 "https://www.googleapis.com/auth/dataportability.chrome.history",
313 "https://www.googleapis.com/auth/dataportability.chrome.reading_list",
314 "https://www.googleapis.com/auth/dataportability.chrome.settings",
315 "https://www.googleapis.com/auth/dataportability.discover.follows",
316 "https://www.googleapis.com/auth/dataportability.discover.likes",
317 "https://www.googleapis.com/auth/dataportability.discover.not_interested",
318 "https://www.googleapis.com/auth/dataportability.maps.aliased_places",
319 "https://www.googleapis.com/auth/dataportability.maps.commute_routes",
320 "https://www.googleapis.com/auth/dataportability.maps.commute_settings",
321 "https://www.googleapis.com/auth/dataportability.maps.ev_profile",
322 "https://www.googleapis.com/auth/dataportability.maps.factual_contributions",
323 "https://www.googleapis.com/auth/dataportability.maps.offering_contributions",
324 "https://www.googleapis.com/auth/dataportability.maps.photos_videos",
325 "https://www.googleapis.com/auth/dataportability.maps.questions_answers",
326 "https://www.googleapis.com/auth/dataportability.maps.reviews",
327 "https://www.googleapis.com/auth/dataportability.maps.starred_places",
328 "https://www.googleapis.com/auth/dataportability.myactivity.maps",
329 "https://www.googleapis.com/auth/dataportability.myactivity.myadcenter",
330 "https://www.googleapis.com/auth/dataportability.myactivity.play",
331 "https://www.googleapis.com/auth/dataportability.myactivity.search",
332 "https://www.googleapis.com/auth/dataportability.myactivity.shopping",
333 "https://www.googleapis.com/auth/dataportability.myactivity.youtube",
334 "https://www.googleapis.com/auth/dataportability.mymaps.maps",
335 "https://www.googleapis.com/auth/dataportability.order_reserve.purchases_reservations",
336 "https://www.googleapis.com/auth/dataportability.play.devices",
337 "https://www.googleapis.com/auth/dataportability.play.grouping",
338 "https://www.googleapis.com/auth/dataportability.play.installs",
339 "https://www.googleapis.com/auth/dataportability.play.library",
340 "https://www.googleapis.com/auth/dataportability.play.playpoints",
341 "https://www.googleapis.com/auth/dataportability.play.promotions",
342 "https://www.googleapis.com/auth/dataportability.play.purchases",
343 "https://www.googleapis.com/auth/dataportability.play.redemptions",
344 "https://www.googleapis.com/auth/dataportability.play.subscriptions",
345 "https://www.googleapis.com/auth/dataportability.play.usersettings",
346 "https://www.googleapis.com/auth/dataportability.saved.collections",
347 "https://www.googleapis.com/auth/dataportability.search_ugc.media.reviews_and_stars",
348 "https://www.googleapis.com/auth/dataportability.search_ugc.media.streaming_video_providers",
349 "https://www.googleapis.com/auth/dataportability.search_ugc.media.thumbs",
350 "https://www.googleapis.com/auth/dataportability.search_ugc.media.watched",
351 "https://www.googleapis.com/auth/dataportability.searchnotifications.settings",
352 "https://www.googleapis.com/auth/dataportability.searchnotifications.subscriptions",
353 "https://www.googleapis.com/auth/dataportability.shopping.addresses",
354 "https://www.googleapis.com/auth/dataportability.shopping.reviews",
355 "https://www.googleapis.com/auth/dataportability.streetview.imagery",
356 "https://www.googleapis.com/auth/dataportability.youtube.channel",
357 "https://www.googleapis.com/auth/dataportability.youtube.comments",
358 "https://www.googleapis.com/auth/dataportability.youtube.live_chat",
359 "https://www.googleapis.com/auth/dataportability.youtube.music",
360 "https://www.googleapis.com/auth/dataportability.youtube.playable",
361 "https://www.googleapis.com/auth/dataportability.youtube.posts",
362 "https://www.googleapis.com/auth/dataportability.youtube.private_playlists",
363 "https://www.googleapis.com/auth/dataportability.youtube.private_videos",
364 "https://www.googleapis.com/auth/dataportability.youtube.public_playlists",
365 "https://www.googleapis.com/auth/dataportability.youtube.public_videos",
366 "https://www.googleapis.com/auth/dataportability.youtube.shopping",
367 "https://www.googleapis.com/auth/dataportability.youtube.subscriptions",
368 "https://www.googleapis.com/auth/dataportability.youtube.unlisted_playlists",
369 "https://www.googleapis.com/auth/dataportability.youtube.unlisted_videos",
370 )
371
372 opts = append([]option.ClientOption{scopesOption}, opts...)
373 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
374 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
375 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
376 opts = append(opts, internaloption.EnableNewAuthLibrary())
377 client, endpoint, err := htransport.NewClient(ctx, opts...)
378 if err != nil {
379 return nil, err
380 }
381 s, err := New(client)
382 if err != nil {
383 return nil, err
384 }
385 if endpoint != "" {
386 s.BasePath = endpoint
387 }
388 return s, nil
389 }
390
391
392
393
394
395
396 func New(client *http.Client) (*Service, error) {
397 if client == nil {
398 return nil, errors.New("client is nil")
399 }
400 s := &Service{client: client, BasePath: basePath}
401 s.ArchiveJobs = NewArchiveJobsService(s)
402 s.Authorization = NewAuthorizationService(s)
403 s.PortabilityArchive = NewPortabilityArchiveService(s)
404 return s, nil
405 }
406
407 type Service struct {
408 client *http.Client
409 BasePath string
410 UserAgent string
411
412 ArchiveJobs *ArchiveJobsService
413
414 Authorization *AuthorizationService
415
416 PortabilityArchive *PortabilityArchiveService
417 }
418
419 func (s *Service) userAgent() string {
420 if s.UserAgent == "" {
421 return googleapi.UserAgent
422 }
423 return googleapi.UserAgent + " " + s.UserAgent
424 }
425
426 func NewArchiveJobsService(s *Service) *ArchiveJobsService {
427 rs := &ArchiveJobsService{s: s}
428 return rs
429 }
430
431 type ArchiveJobsService struct {
432 s *Service
433 }
434
435 func NewAuthorizationService(s *Service) *AuthorizationService {
436 rs := &AuthorizationService{s: s}
437 return rs
438 }
439
440 type AuthorizationService struct {
441 s *Service
442 }
443
444 func NewPortabilityArchiveService(s *Service) *PortabilityArchiveService {
445 rs := &PortabilityArchiveService{s: s}
446 return rs
447 }
448
449 type PortabilityArchiveService struct {
450 s *Service
451 }
452
453
454
455
456
457 type Empty struct {
458
459 googleapi.ServerResponse `json:"-"`
460 }
461
462
463 type InitiatePortabilityArchiveRequest struct {
464
465
466 Resources []string `json:"resources,omitempty"`
467
468
469
470
471
472 ForceSendFields []string `json:"-"`
473
474
475
476
477 NullFields []string `json:"-"`
478 }
479
480 func (s *InitiatePortabilityArchiveRequest) MarshalJSON() ([]byte, error) {
481 type NoMethod InitiatePortabilityArchiveRequest
482 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
483 }
484
485
486 type InitiatePortabilityArchiveResponse struct {
487
488
489 ArchiveJobId string `json:"archiveJobId,omitempty"`
490
491
492 googleapi.ServerResponse `json:"-"`
493
494
495
496
497
498 ForceSendFields []string `json:"-"`
499
500
501
502
503 NullFields []string `json:"-"`
504 }
505
506 func (s *InitiatePortabilityArchiveResponse) MarshalJSON() ([]byte, error) {
507 type NoMethod InitiatePortabilityArchiveResponse
508 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
509 }
510
511
512 type PortabilityArchiveState struct {
513
514
515
516 Name string `json:"name,omitempty"`
517
518
519
520
521
522
523
524
525 State string `json:"state,omitempty"`
526
527
528 Urls []string `json:"urls,omitempty"`
529
530
531 googleapi.ServerResponse `json:"-"`
532
533
534
535
536
537 ForceSendFields []string `json:"-"`
538
539
540
541
542 NullFields []string `json:"-"`
543 }
544
545 func (s *PortabilityArchiveState) MarshalJSON() ([]byte, error) {
546 type NoMethod PortabilityArchiveState
547 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
548 }
549
550
551 type ResetAuthorizationRequest struct {
552 }
553
554
555
556 type RetryPortabilityArchiveRequest struct {
557 }
558
559
560
561 type RetryPortabilityArchiveResponse struct {
562
563
564 ArchiveJobId string `json:"archiveJobId,omitempty"`
565
566
567 googleapi.ServerResponse `json:"-"`
568
569
570
571
572
573 ForceSendFields []string `json:"-"`
574
575
576
577
578 NullFields []string `json:"-"`
579 }
580
581 func (s *RetryPortabilityArchiveResponse) MarshalJSON() ([]byte, error) {
582 type NoMethod RetryPortabilityArchiveResponse
583 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
584 }
585
586 type ArchiveJobsGetPortabilityArchiveStateCall struct {
587 s *Service
588 name string
589 urlParams_ gensupport.URLParams
590 ifNoneMatch_ string
591 ctx_ context.Context
592 header_ http.Header
593 }
594
595
596
597
598
599
600
601
602 func (r *ArchiveJobsService) GetPortabilityArchiveState(name string) *ArchiveJobsGetPortabilityArchiveStateCall {
603 c := &ArchiveJobsGetPortabilityArchiveStateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
604 c.name = name
605 return c
606 }
607
608
609
610
611 func (c *ArchiveJobsGetPortabilityArchiveStateCall) Fields(s ...googleapi.Field) *ArchiveJobsGetPortabilityArchiveStateCall {
612 c.urlParams_.Set("fields", googleapi.CombineFields(s))
613 return c
614 }
615
616
617
618
619 func (c *ArchiveJobsGetPortabilityArchiveStateCall) IfNoneMatch(entityTag string) *ArchiveJobsGetPortabilityArchiveStateCall {
620 c.ifNoneMatch_ = entityTag
621 return c
622 }
623
624
625 func (c *ArchiveJobsGetPortabilityArchiveStateCall) Context(ctx context.Context) *ArchiveJobsGetPortabilityArchiveStateCall {
626 c.ctx_ = ctx
627 return c
628 }
629
630
631
632 func (c *ArchiveJobsGetPortabilityArchiveStateCall) Header() http.Header {
633 if c.header_ == nil {
634 c.header_ = make(http.Header)
635 }
636 return c.header_
637 }
638
639 func (c *ArchiveJobsGetPortabilityArchiveStateCall) doRequest(alt string) (*http.Response, error) {
640 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
641 if c.ifNoneMatch_ != "" {
642 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
643 }
644 var body io.Reader = nil
645 c.urlParams_.Set("alt", alt)
646 c.urlParams_.Set("prettyPrint", "false")
647 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
648 urls += "?" + c.urlParams_.Encode()
649 req, err := http.NewRequest("GET", urls, body)
650 if err != nil {
651 return nil, err
652 }
653 req.Header = reqHeaders
654 googleapi.Expand(req.URL, map[string]string{
655 "name": c.name,
656 })
657 return gensupport.SendRequest(c.ctx_, c.s.client, req)
658 }
659
660
661
662
663
664
665
666 func (c *ArchiveJobsGetPortabilityArchiveStateCall) Do(opts ...googleapi.CallOption) (*PortabilityArchiveState, error) {
667 gensupport.SetOptions(c.urlParams_, opts...)
668 res, err := c.doRequest("json")
669 if res != nil && res.StatusCode == http.StatusNotModified {
670 if res.Body != nil {
671 res.Body.Close()
672 }
673 return nil, gensupport.WrapError(&googleapi.Error{
674 Code: res.StatusCode,
675 Header: res.Header,
676 })
677 }
678 if err != nil {
679 return nil, err
680 }
681 defer googleapi.CloseBody(res)
682 if err := googleapi.CheckResponse(res); err != nil {
683 return nil, gensupport.WrapError(err)
684 }
685 ret := &PortabilityArchiveState{
686 ServerResponse: googleapi.ServerResponse{
687 Header: res.Header,
688 HTTPStatusCode: res.StatusCode,
689 },
690 }
691 target := &ret
692 if err := gensupport.DecodeResponse(target, res); err != nil {
693 return nil, err
694 }
695 return ret, nil
696 }
697
698 type ArchiveJobsRetryCall struct {
699 s *Service
700 name string
701 retryportabilityarchiverequest *RetryPortabilityArchiveRequest
702 urlParams_ gensupport.URLParams
703 ctx_ context.Context
704 header_ http.Header
705 }
706
707
708
709
710
711
712 func (r *ArchiveJobsService) Retry(name string, retryportabilityarchiverequest *RetryPortabilityArchiveRequest) *ArchiveJobsRetryCall {
713 c := &ArchiveJobsRetryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
714 c.name = name
715 c.retryportabilityarchiverequest = retryportabilityarchiverequest
716 return c
717 }
718
719
720
721
722 func (c *ArchiveJobsRetryCall) Fields(s ...googleapi.Field) *ArchiveJobsRetryCall {
723 c.urlParams_.Set("fields", googleapi.CombineFields(s))
724 return c
725 }
726
727
728 func (c *ArchiveJobsRetryCall) Context(ctx context.Context) *ArchiveJobsRetryCall {
729 c.ctx_ = ctx
730 return c
731 }
732
733
734
735 func (c *ArchiveJobsRetryCall) Header() http.Header {
736 if c.header_ == nil {
737 c.header_ = make(http.Header)
738 }
739 return c.header_
740 }
741
742 func (c *ArchiveJobsRetryCall) doRequest(alt string) (*http.Response, error) {
743 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
744 var body io.Reader = nil
745 body, err := googleapi.WithoutDataWrapper.JSONReader(c.retryportabilityarchiverequest)
746 if err != nil {
747 return nil, err
748 }
749 c.urlParams_.Set("alt", alt)
750 c.urlParams_.Set("prettyPrint", "false")
751 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}:retry")
752 urls += "?" + c.urlParams_.Encode()
753 req, err := http.NewRequest("POST", urls, body)
754 if err != nil {
755 return nil, err
756 }
757 req.Header = reqHeaders
758 googleapi.Expand(req.URL, map[string]string{
759 "name": c.name,
760 })
761 return gensupport.SendRequest(c.ctx_, c.s.client, req)
762 }
763
764
765
766
767
768
769
770 func (c *ArchiveJobsRetryCall) Do(opts ...googleapi.CallOption) (*RetryPortabilityArchiveResponse, error) {
771 gensupport.SetOptions(c.urlParams_, opts...)
772 res, err := c.doRequest("json")
773 if res != nil && res.StatusCode == http.StatusNotModified {
774 if res.Body != nil {
775 res.Body.Close()
776 }
777 return nil, gensupport.WrapError(&googleapi.Error{
778 Code: res.StatusCode,
779 Header: res.Header,
780 })
781 }
782 if err != nil {
783 return nil, err
784 }
785 defer googleapi.CloseBody(res)
786 if err := googleapi.CheckResponse(res); err != nil {
787 return nil, gensupport.WrapError(err)
788 }
789 ret := &RetryPortabilityArchiveResponse{
790 ServerResponse: googleapi.ServerResponse{
791 Header: res.Header,
792 HTTPStatusCode: res.StatusCode,
793 },
794 }
795 target := &ret
796 if err := gensupport.DecodeResponse(target, res); err != nil {
797 return nil, err
798 }
799 return ret, nil
800 }
801
802 type AuthorizationResetCall struct {
803 s *Service
804 resetauthorizationrequest *ResetAuthorizationRequest
805 urlParams_ gensupport.URLParams
806 ctx_ context.Context
807 header_ http.Header
808 }
809
810
811
812
813
814
815 func (r *AuthorizationService) Reset(resetauthorizationrequest *ResetAuthorizationRequest) *AuthorizationResetCall {
816 c := &AuthorizationResetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
817 c.resetauthorizationrequest = resetauthorizationrequest
818 return c
819 }
820
821
822
823
824 func (c *AuthorizationResetCall) Fields(s ...googleapi.Field) *AuthorizationResetCall {
825 c.urlParams_.Set("fields", googleapi.CombineFields(s))
826 return c
827 }
828
829
830 func (c *AuthorizationResetCall) Context(ctx context.Context) *AuthorizationResetCall {
831 c.ctx_ = ctx
832 return c
833 }
834
835
836
837 func (c *AuthorizationResetCall) Header() http.Header {
838 if c.header_ == nil {
839 c.header_ = make(http.Header)
840 }
841 return c.header_
842 }
843
844 func (c *AuthorizationResetCall) doRequest(alt string) (*http.Response, error) {
845 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
846 var body io.Reader = nil
847 body, err := googleapi.WithoutDataWrapper.JSONReader(c.resetauthorizationrequest)
848 if err != nil {
849 return nil, err
850 }
851 c.urlParams_.Set("alt", alt)
852 c.urlParams_.Set("prettyPrint", "false")
853 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/authorization:reset")
854 urls += "?" + c.urlParams_.Encode()
855 req, err := http.NewRequest("POST", urls, body)
856 if err != nil {
857 return nil, err
858 }
859 req.Header = reqHeaders
860 return gensupport.SendRequest(c.ctx_, c.s.client, req)
861 }
862
863
864
865
866
867
868 func (c *AuthorizationResetCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
869 gensupport.SetOptions(c.urlParams_, opts...)
870 res, err := c.doRequest("json")
871 if res != nil && res.StatusCode == http.StatusNotModified {
872 if res.Body != nil {
873 res.Body.Close()
874 }
875 return nil, gensupport.WrapError(&googleapi.Error{
876 Code: res.StatusCode,
877 Header: res.Header,
878 })
879 }
880 if err != nil {
881 return nil, err
882 }
883 defer googleapi.CloseBody(res)
884 if err := googleapi.CheckResponse(res); err != nil {
885 return nil, gensupport.WrapError(err)
886 }
887 ret := &Empty{
888 ServerResponse: googleapi.ServerResponse{
889 Header: res.Header,
890 HTTPStatusCode: res.StatusCode,
891 },
892 }
893 target := &ret
894 if err := gensupport.DecodeResponse(target, res); err != nil {
895 return nil, err
896 }
897 return ret, nil
898 }
899
900 type PortabilityArchiveInitiateCall struct {
901 s *Service
902 initiateportabilityarchiverequest *InitiatePortabilityArchiveRequest
903 urlParams_ gensupport.URLParams
904 ctx_ context.Context
905 header_ http.Header
906 }
907
908
909 func (r *PortabilityArchiveService) Initiate(initiateportabilityarchiverequest *InitiatePortabilityArchiveRequest) *PortabilityArchiveInitiateCall {
910 c := &PortabilityArchiveInitiateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
911 c.initiateportabilityarchiverequest = initiateportabilityarchiverequest
912 return c
913 }
914
915
916
917
918 func (c *PortabilityArchiveInitiateCall) Fields(s ...googleapi.Field) *PortabilityArchiveInitiateCall {
919 c.urlParams_.Set("fields", googleapi.CombineFields(s))
920 return c
921 }
922
923
924 func (c *PortabilityArchiveInitiateCall) Context(ctx context.Context) *PortabilityArchiveInitiateCall {
925 c.ctx_ = ctx
926 return c
927 }
928
929
930
931 func (c *PortabilityArchiveInitiateCall) Header() http.Header {
932 if c.header_ == nil {
933 c.header_ = make(http.Header)
934 }
935 return c.header_
936 }
937
938 func (c *PortabilityArchiveInitiateCall) doRequest(alt string) (*http.Response, error) {
939 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
940 var body io.Reader = nil
941 body, err := googleapi.WithoutDataWrapper.JSONReader(c.initiateportabilityarchiverequest)
942 if err != nil {
943 return nil, err
944 }
945 c.urlParams_.Set("alt", alt)
946 c.urlParams_.Set("prettyPrint", "false")
947 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/portabilityArchive:initiate")
948 urls += "?" + c.urlParams_.Encode()
949 req, err := http.NewRequest("POST", urls, body)
950 if err != nil {
951 return nil, err
952 }
953 req.Header = reqHeaders
954 return gensupport.SendRequest(c.ctx_, c.s.client, req)
955 }
956
957
958
959
960
961
962
963 func (c *PortabilityArchiveInitiateCall) Do(opts ...googleapi.CallOption) (*InitiatePortabilityArchiveResponse, error) {
964 gensupport.SetOptions(c.urlParams_, opts...)
965 res, err := c.doRequest("json")
966 if res != nil && res.StatusCode == http.StatusNotModified {
967 if res.Body != nil {
968 res.Body.Close()
969 }
970 return nil, gensupport.WrapError(&googleapi.Error{
971 Code: res.StatusCode,
972 Header: res.Header,
973 })
974 }
975 if err != nil {
976 return nil, err
977 }
978 defer googleapi.CloseBody(res)
979 if err := googleapi.CheckResponse(res); err != nil {
980 return nil, gensupport.WrapError(err)
981 }
982 ret := &InitiatePortabilityArchiveResponse{
983 ServerResponse: googleapi.ServerResponse{
984 Header: res.Header,
985 HTTPStatusCode: res.StatusCode,
986 },
987 }
988 target := &ret
989 if err := gensupport.DecodeResponse(target, res); err != nil {
990 return nil, err
991 }
992 return ret, nil
993 }
994
View as plain text