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