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 streetviewpublish
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 = "streetviewpublish:v1"
90 const apiName = "streetviewpublish"
91 const apiVersion = "v1"
92 const basePath = "https://streetviewpublish.googleapis.com/"
93 const basePathTemplate = "https://streetviewpublish.UNIVERSE_DOMAIN/"
94 const mtlsBasePath = "https://streetviewpublish.mtls.googleapis.com/"
95
96
97 const (
98
99 StreetviewpublishScope = "https://www.googleapis.com/auth/streetviewpublish"
100 )
101
102
103 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
104 scopesOption := internaloption.WithDefaultScopes(
105 "https://www.googleapis.com/auth/streetviewpublish",
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.Photo = NewPhotoService(s)
138 s.PhotoSequence = NewPhotoSequenceService(s)
139 s.PhotoSequences = NewPhotoSequencesService(s)
140 s.Photos = NewPhotosService(s)
141 return s, nil
142 }
143
144 type Service struct {
145 client *http.Client
146 BasePath string
147 UserAgent string
148
149 Photo *PhotoService
150
151 PhotoSequence *PhotoSequenceService
152
153 PhotoSequences *PhotoSequencesService
154
155 Photos *PhotosService
156 }
157
158 func (s *Service) userAgent() string {
159 if s.UserAgent == "" {
160 return googleapi.UserAgent
161 }
162 return googleapi.UserAgent + " " + s.UserAgent
163 }
164
165 func NewPhotoService(s *Service) *PhotoService {
166 rs := &PhotoService{s: s}
167 return rs
168 }
169
170 type PhotoService struct {
171 s *Service
172 }
173
174 func NewPhotoSequenceService(s *Service) *PhotoSequenceService {
175 rs := &PhotoSequenceService{s: s}
176 return rs
177 }
178
179 type PhotoSequenceService struct {
180 s *Service
181 }
182
183 func NewPhotoSequencesService(s *Service) *PhotoSequencesService {
184 rs := &PhotoSequencesService{s: s}
185 return rs
186 }
187
188 type PhotoSequencesService struct {
189 s *Service
190 }
191
192 func NewPhotosService(s *Service) *PhotosService {
193 rs := &PhotosService{s: s}
194 return rs
195 }
196
197 type PhotosService struct {
198 s *Service
199 }
200
201
202 type BatchDeletePhotosRequest struct {
203
204
205 PhotoIds []string `json:"photoIds,omitempty"`
206
207
208
209
210
211 ForceSendFields []string `json:"-"`
212
213
214
215
216 NullFields []string `json:"-"`
217 }
218
219 func (s *BatchDeletePhotosRequest) MarshalJSON() ([]byte, error) {
220 type NoMethod BatchDeletePhotosRequest
221 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
222 }
223
224
225 type BatchDeletePhotosResponse struct {
226
227
228 Status []*Status `json:"status,omitempty"`
229
230
231 googleapi.ServerResponse `json:"-"`
232
233
234
235
236
237 ForceSendFields []string `json:"-"`
238
239
240
241
242 NullFields []string `json:"-"`
243 }
244
245 func (s *BatchDeletePhotosResponse) MarshalJSON() ([]byte, error) {
246 type NoMethod BatchDeletePhotosResponse
247 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
248 }
249
250
251 type BatchGetPhotosResponse struct {
252
253
254 Results []*PhotoResponse `json:"results,omitempty"`
255
256
257 googleapi.ServerResponse `json:"-"`
258
259
260
261
262
263 ForceSendFields []string `json:"-"`
264
265
266
267
268 NullFields []string `json:"-"`
269 }
270
271 func (s *BatchGetPhotosResponse) MarshalJSON() ([]byte, error) {
272 type NoMethod BatchGetPhotosResponse
273 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
274 }
275
276
277
278 type BatchUpdatePhotosRequest struct {
279
280 UpdatePhotoRequests []*UpdatePhotoRequest `json:"updatePhotoRequests,omitempty"`
281
282
283
284
285
286 ForceSendFields []string `json:"-"`
287
288
289
290
291 NullFields []string `json:"-"`
292 }
293
294 func (s *BatchUpdatePhotosRequest) MarshalJSON() ([]byte, error) {
295 type NoMethod BatchUpdatePhotosRequest
296 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
297 }
298
299
300
301 type BatchUpdatePhotosResponse struct {
302
303
304 Results []*PhotoResponse `json:"results,omitempty"`
305
306
307 googleapi.ServerResponse `json:"-"`
308
309
310
311
312
313 ForceSendFields []string `json:"-"`
314
315
316
317
318 NullFields []string `json:"-"`
319 }
320
321 func (s *BatchUpdatePhotosResponse) MarshalJSON() ([]byte, error) {
322 type NoMethod BatchUpdatePhotosResponse
323 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
324 }
325
326
327
328 type Connection struct {
329
330
331 Target *PhotoId `json:"target,omitempty"`
332
333
334
335
336
337 ForceSendFields []string `json:"-"`
338
339
340
341
342 NullFields []string `json:"-"`
343 }
344
345 func (s *Connection) MarshalJSON() ([]byte, error) {
346 type NoMethod Connection
347 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
348 }
349
350
351
352
353
354 type Empty struct {
355
356 googleapi.ServerResponse `json:"-"`
357 }
358
359
360
361
362 type GpsDataGapFailureDetails struct {
363
364 GapDuration string `json:"gapDuration,omitempty"`
365
366
367 GapStartTime string `json:"gapStartTime,omitempty"`
368
369
370
371
372
373 ForceSendFields []string `json:"-"`
374
375
376
377
378 NullFields []string `json:"-"`
379 }
380
381 func (s *GpsDataGapFailureDetails) MarshalJSON() ([]byte, error) {
382 type NoMethod GpsDataGapFailureDetails
383 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
384 }
385
386
387 type Imu struct {
388
389
390 AccelMpsps []*Measurement3d `json:"accelMpsps,omitempty"`
391
392
393 GyroRps []*Measurement3d `json:"gyroRps,omitempty"`
394
395
396 MagUt []*Measurement3d `json:"magUt,omitempty"`
397
398
399
400
401
402 ForceSendFields []string `json:"-"`
403
404
405
406
407 NullFields []string `json:"-"`
408 }
409
410 func (s *Imu) MarshalJSON() ([]byte, error) {
411 type NoMethod Imu
412 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
413 }
414
415
416
417
418 type ImuDataGapFailureDetails struct {
419
420 GapDuration string `json:"gapDuration,omitempty"`
421
422
423 GapStartTime string `json:"gapStartTime,omitempty"`
424
425
426
427
428
429 ForceSendFields []string `json:"-"`
430
431
432
433
434 NullFields []string `json:"-"`
435 }
436
437 func (s *ImuDataGapFailureDetails) MarshalJSON() ([]byte, error) {
438 type NoMethod ImuDataGapFailureDetails
439 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
440 }
441
442
443
444 type InsufficientGpsFailureDetails struct {
445
446 GpsPointsFound int64 `json:"gpsPointsFound,omitempty"`
447
448
449
450
451
452 ForceSendFields []string `json:"-"`
453
454
455
456
457 NullFields []string `json:"-"`
458 }
459
460 func (s *InsufficientGpsFailureDetails) MarshalJSON() ([]byte, error) {
461 type NoMethod InsufficientGpsFailureDetails
462 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
463 }
464
465
466
467
468
469 type LatLng struct {
470
471 Latitude float64 `json:"latitude,omitempty"`
472
473
474 Longitude float64 `json:"longitude,omitempty"`
475
476
477
478
479
480 ForceSendFields []string `json:"-"`
481
482
483
484
485 NullFields []string `json:"-"`
486 }
487
488 func (s *LatLng) MarshalJSON() ([]byte, error) {
489 type NoMethod LatLng
490 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
491 }
492
493 func (s *LatLng) UnmarshalJSON(data []byte) error {
494 type NoMethod LatLng
495 var s1 struct {
496 Latitude gensupport.JSONFloat64 `json:"latitude"`
497 Longitude gensupport.JSONFloat64 `json:"longitude"`
498 *NoMethod
499 }
500 s1.NoMethod = (*NoMethod)(s)
501 if err := json.Unmarshal(data, &s1); err != nil {
502 return err
503 }
504 s.Latitude = float64(s1.Latitude)
505 s.Longitude = float64(s1.Longitude)
506 return nil
507 }
508
509
510 type LatLngBounds struct {
511
512 Northeast *LatLng `json:"northeast,omitempty"`
513
514 Southwest *LatLng `json:"southwest,omitempty"`
515
516
517
518
519
520 ForceSendFields []string `json:"-"`
521
522
523
524
525 NullFields []string `json:"-"`
526 }
527
528 func (s *LatLngBounds) MarshalJSON() ([]byte, error) {
529 type NoMethod LatLngBounds
530 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
531 }
532
533
534 type Level struct {
535
536
537
538 Name string `json:"name,omitempty"`
539
540
541
542 Number float64 `json:"number,omitempty"`
543
544
545
546
547
548 ForceSendFields []string `json:"-"`
549
550
551
552
553 NullFields []string `json:"-"`
554 }
555
556 func (s *Level) MarshalJSON() ([]byte, error) {
557 type NoMethod Level
558 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
559 }
560
561 func (s *Level) UnmarshalJSON(data []byte) error {
562 type NoMethod Level
563 var s1 struct {
564 Number gensupport.JSONFloat64 `json:"number"`
565 *NoMethod
566 }
567 s1.NoMethod = (*NoMethod)(s)
568 if err := json.Unmarshal(data, &s1); err != nil {
569 return err
570 }
571 s.Number = float64(s1.Number)
572 return nil
573 }
574
575
576
577 type ListPhotoSequencesResponse struct {
578
579
580 NextPageToken string `json:"nextPageToken,omitempty"`
581
582
583
584
585
586
587
588 PhotoSequences []*Operation `json:"photoSequences,omitempty"`
589
590
591 googleapi.ServerResponse `json:"-"`
592
593
594
595
596
597 ForceSendFields []string `json:"-"`
598
599
600
601
602 NullFields []string `json:"-"`
603 }
604
605 func (s *ListPhotoSequencesResponse) MarshalJSON() ([]byte, error) {
606 type NoMethod ListPhotoSequencesResponse
607 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
608 }
609
610
611 type ListPhotosResponse struct {
612
613
614 NextPageToken string `json:"nextPageToken,omitempty"`
615
616
617 Photos []*Photo `json:"photos,omitempty"`
618
619
620 googleapi.ServerResponse `json:"-"`
621
622
623
624
625
626 ForceSendFields []string `json:"-"`
627
628
629
630
631 NullFields []string `json:"-"`
632 }
633
634 func (s *ListPhotosResponse) MarshalJSON() ([]byte, error) {
635 type NoMethod ListPhotosResponse
636 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
637 }
638
639
640 type Measurement3d struct {
641
642 CaptureTime string `json:"captureTime,omitempty"`
643
644 X float64 `json:"x,omitempty"`
645
646 Y float64 `json:"y,omitempty"`
647
648 Z float64 `json:"z,omitempty"`
649
650
651
652
653
654 ForceSendFields []string `json:"-"`
655
656
657
658
659 NullFields []string `json:"-"`
660 }
661
662 func (s *Measurement3d) MarshalJSON() ([]byte, error) {
663 type NoMethod Measurement3d
664 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
665 }
666
667 func (s *Measurement3d) UnmarshalJSON(data []byte) error {
668 type NoMethod Measurement3d
669 var s1 struct {
670 X gensupport.JSONFloat64 `json:"x"`
671 Y gensupport.JSONFloat64 `json:"y"`
672 Z gensupport.JSONFloat64 `json:"z"`
673 *NoMethod
674 }
675 s1.NoMethod = (*NoMethod)(s)
676 if err := json.Unmarshal(data, &s1); err != nil {
677 return err
678 }
679 s.X = float64(s1.X)
680 s.Y = float64(s1.Y)
681 s.Z = float64(s1.Z)
682 return nil
683 }
684
685
686
687 type NoOverlapGpsFailureDetails struct {
688
689 GpsEndTime string `json:"gpsEndTime,omitempty"`
690
691 GpsStartTime string `json:"gpsStartTime,omitempty"`
692
693 VideoEndTime string `json:"videoEndTime,omitempty"`
694
695 VideoStartTime string `json:"videoStartTime,omitempty"`
696
697
698
699
700
701 ForceSendFields []string `json:"-"`
702
703
704
705
706 NullFields []string `json:"-"`
707 }
708
709 func (s *NoOverlapGpsFailureDetails) MarshalJSON() ([]byte, error) {
710 type NoMethod NoOverlapGpsFailureDetails
711 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
712 }
713
714
715
716
717 type NotOutdoorsFailureDetails struct {
718
719
720 StartTime string `json:"startTime,omitempty"`
721
722
723
724
725
726 ForceSendFields []string `json:"-"`
727
728
729
730
731 NullFields []string `json:"-"`
732 }
733
734 func (s *NotOutdoorsFailureDetails) MarshalJSON() ([]byte, error) {
735 type NoMethod NotOutdoorsFailureDetails
736 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
737 }
738
739
740
741 type Operation struct {
742
743
744
745 Done bool `json:"done,omitempty"`
746
747 Error *Status `json:"error,omitempty"`
748
749
750
751
752 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
753
754
755
756 Name string `json:"name,omitempty"`
757
758
759
760
761
762
763
764 Response googleapi.RawMessage `json:"response,omitempty"`
765
766
767 googleapi.ServerResponse `json:"-"`
768
769
770
771
772
773 ForceSendFields []string `json:"-"`
774
775
776
777
778 NullFields []string `json:"-"`
779 }
780
781 func (s *Operation) MarshalJSON() ([]byte, error) {
782 type NoMethod Operation
783 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
784 }
785
786
787 type Photo struct {
788
789
790
791 CaptureTime string `json:"captureTime,omitempty"`
792
793
794 Connections []*Connection `json:"connections,omitempty"`
795
796
797
798 DownloadUrl string `json:"downloadUrl,omitempty"`
799
800
801
802
803
804
805
806 MapsPublishStatus string `json:"mapsPublishStatus,omitempty"`
807
808
809
810 PhotoId *PhotoId `json:"photoId,omitempty"`
811
812 Places []*Place `json:"places,omitempty"`
813
814 Pose *Pose `json:"pose,omitempty"`
815
816 ShareLink string `json:"shareLink,omitempty"`
817
818
819 ThumbnailUrl string `json:"thumbnailUrl,omitempty"`
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835 TransferStatus string `json:"transferStatus,omitempty"`
836
837
838 UploadReference *UploadRef `json:"uploadReference,omitempty"`
839
840 UploadTime string `json:"uploadTime,omitempty"`
841
842 ViewCount int64 `json:"viewCount,omitempty,string"`
843
844
845 googleapi.ServerResponse `json:"-"`
846
847
848
849
850
851 ForceSendFields []string `json:"-"`
852
853
854
855
856 NullFields []string `json:"-"`
857 }
858
859 func (s *Photo) MarshalJSON() ([]byte, error) {
860 type NoMethod Photo
861 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
862 }
863
864
865 type PhotoId struct {
866
867 Id string `json:"id,omitempty"`
868
869
870
871
872
873 ForceSendFields []string `json:"-"`
874
875
876
877
878 NullFields []string `json:"-"`
879 }
880
881 func (s *PhotoId) MarshalJSON() ([]byte, error) {
882 type NoMethod PhotoId
883 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
884 }
885
886
887
888 type PhotoResponse struct {
889
890 Photo *Photo `json:"photo,omitempty"`
891
892
893 Status *Status `json:"status,omitempty"`
894
895
896
897
898
899 ForceSendFields []string `json:"-"`
900
901
902
903
904 NullFields []string `json:"-"`
905 }
906
907 func (s *PhotoResponse) MarshalJSON() ([]byte, error) {
908 type NoMethod PhotoResponse
909 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
910 }
911
912
913 type PhotoSequence struct {
914
915
916
917
918 CaptureTimeOverride string `json:"captureTimeOverride,omitempty"`
919
920
921 DistanceMeters float64 `json:"distanceMeters,omitempty"`
922
923
924 FailureDetails *ProcessingFailureDetails `json:"failureDetails,omitempty"`
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964 FailureReason string `json:"failureReason,omitempty"`
965
966
967
968 Filename string `json:"filename,omitempty"`
969
970
971
972
973
974
975
976
977 GpsSource string `json:"gpsSource,omitempty"`
978
979
980 Id string `json:"id,omitempty"`
981
982
983
984
985 Imu *Imu `json:"imu,omitempty"`
986
987 Photos []*Photo `json:"photos,omitempty"`
988
989
990
991
992
993
994
995
996
997
998
999 ProcessingState string `json:"processingState,omitempty"`
1000
1001
1002
1003
1004
1005
1006
1007 RawGpsTimeline []*Pose `json:"rawGpsTimeline,omitempty"`
1008
1009
1010 SequenceBounds *LatLngBounds `json:"sequenceBounds,omitempty"`
1011
1012
1013
1014 UploadReference *UploadRef `json:"uploadReference,omitempty"`
1015
1016
1017 UploadTime string `json:"uploadTime,omitempty"`
1018
1019
1020 ViewCount int64 `json:"viewCount,omitempty,string"`
1021
1022
1023
1024
1025
1026 ForceSendFields []string `json:"-"`
1027
1028
1029
1030
1031 NullFields []string `json:"-"`
1032 }
1033
1034 func (s *PhotoSequence) MarshalJSON() ([]byte, error) {
1035 type NoMethod PhotoSequence
1036 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1037 }
1038
1039 func (s *PhotoSequence) UnmarshalJSON(data []byte) error {
1040 type NoMethod PhotoSequence
1041 var s1 struct {
1042 DistanceMeters gensupport.JSONFloat64 `json:"distanceMeters"`
1043 *NoMethod
1044 }
1045 s1.NoMethod = (*NoMethod)(s)
1046 if err := json.Unmarshal(data, &s1); err != nil {
1047 return err
1048 }
1049 s.DistanceMeters = float64(s1.DistanceMeters)
1050 return nil
1051 }
1052
1053
1054 type Place struct {
1055
1056
1057
1058 LanguageCode string `json:"languageCode,omitempty"`
1059
1060 Name string `json:"name,omitempty"`
1061
1062
1063 PlaceId string `json:"placeId,omitempty"`
1064
1065
1066
1067
1068
1069 ForceSendFields []string `json:"-"`
1070
1071
1072
1073
1074 NullFields []string `json:"-"`
1075 }
1076
1077 func (s *Place) MarshalJSON() ([]byte, error) {
1078 type NoMethod Place
1079 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1080 }
1081
1082
1083 type Pose struct {
1084
1085
1086
1087
1088
1089
1090 AccuracyMeters float64 `json:"accuracyMeters,omitempty"`
1091
1092
1093 Altitude float64 `json:"altitude,omitempty"`
1094
1095 GpsRecordTimestampUnixEpoch string `json:"gpsRecordTimestampUnixEpoch,omitempty"`
1096
1097
1098
1099
1100
1101 Heading float64 `json:"heading,omitempty"`
1102
1103
1104
1105
1106
1107 LatLngPair *LatLng `json:"latLngPair,omitempty"`
1108
1109
1110 Level *Level `json:"level,omitempty"`
1111
1112
1113
1114 Pitch float64 `json:"pitch,omitempty"`
1115
1116
1117 Roll float64 `json:"roll,omitempty"`
1118
1119
1120
1121
1122
1123 ForceSendFields []string `json:"-"`
1124
1125
1126
1127
1128 NullFields []string `json:"-"`
1129 }
1130
1131 func (s *Pose) MarshalJSON() ([]byte, error) {
1132 type NoMethod Pose
1133 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1134 }
1135
1136 func (s *Pose) UnmarshalJSON(data []byte) error {
1137 type NoMethod Pose
1138 var s1 struct {
1139 AccuracyMeters gensupport.JSONFloat64 `json:"accuracyMeters"`
1140 Altitude gensupport.JSONFloat64 `json:"altitude"`
1141 Heading gensupport.JSONFloat64 `json:"heading"`
1142 Pitch gensupport.JSONFloat64 `json:"pitch"`
1143 Roll gensupport.JSONFloat64 `json:"roll"`
1144 *NoMethod
1145 }
1146 s1.NoMethod = (*NoMethod)(s)
1147 if err := json.Unmarshal(data, &s1); err != nil {
1148 return err
1149 }
1150 s.AccuracyMeters = float64(s1.AccuracyMeters)
1151 s.Altitude = float64(s1.Altitude)
1152 s.Heading = float64(s1.Heading)
1153 s.Pitch = float64(s1.Pitch)
1154 s.Roll = float64(s1.Roll)
1155 return nil
1156 }
1157
1158
1159
1160
1161
1162 type ProcessingFailureDetails struct {
1163
1164 GpsDataGapDetails *GpsDataGapFailureDetails `json:"gpsDataGapDetails,omitempty"`
1165
1166 ImuDataGapDetails *ImuDataGapFailureDetails `json:"imuDataGapDetails,omitempty"`
1167
1168 InsufficientGpsDetails *InsufficientGpsFailureDetails `json:"insufficientGpsDetails,omitempty"`
1169
1170 NoOverlapGpsDetails *NoOverlapGpsFailureDetails `json:"noOverlapGpsDetails,omitempty"`
1171
1172 NotOutdoorsDetails *NotOutdoorsFailureDetails `json:"notOutdoorsDetails,omitempty"`
1173
1174
1175
1176
1177
1178 ForceSendFields []string `json:"-"`
1179
1180
1181
1182
1183 NullFields []string `json:"-"`
1184 }
1185
1186 func (s *ProcessingFailureDetails) MarshalJSON() ([]byte, error) {
1187 type NoMethod ProcessingFailureDetails
1188 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1189 }
1190
1191
1192
1193
1194
1195
1196
1197 type Status struct {
1198
1199 Code int64 `json:"code,omitempty"`
1200
1201
1202 Details []googleapi.RawMessage `json:"details,omitempty"`
1203
1204
1205
1206 Message string `json:"message,omitempty"`
1207
1208
1209
1210
1211
1212 ForceSendFields []string `json:"-"`
1213
1214
1215
1216
1217 NullFields []string `json:"-"`
1218 }
1219
1220 func (s *Status) MarshalJSON() ([]byte, error) {
1221 type NoMethod Status
1222 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1223 }
1224
1225
1226
1227 type UpdatePhotoRequest struct {
1228
1229 Photo *Photo `json:"photo,omitempty"`
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240 UpdateMask string `json:"updateMask,omitempty"`
1241
1242
1243
1244
1245
1246 ForceSendFields []string `json:"-"`
1247
1248
1249
1250
1251 NullFields []string `json:"-"`
1252 }
1253
1254 func (s *UpdatePhotoRequest) MarshalJSON() ([]byte, error) {
1255 type NoMethod UpdatePhotoRequest
1256 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1257 }
1258
1259
1260 type UploadRef struct {
1261
1262
1263
1264
1265 UploadUrl string `json:"uploadUrl,omitempty"`
1266
1267
1268 googleapi.ServerResponse `json:"-"`
1269
1270
1271
1272
1273
1274 ForceSendFields []string `json:"-"`
1275
1276
1277
1278
1279 NullFields []string `json:"-"`
1280 }
1281
1282 func (s *UploadRef) MarshalJSON() ([]byte, error) {
1283 type NoMethod UploadRef
1284 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1285 }
1286
1287 type PhotoCreateCall struct {
1288 s *Service
1289 photo *Photo
1290 urlParams_ gensupport.URLParams
1291 ctx_ context.Context
1292 header_ http.Header
1293 }
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307 func (r *PhotoService) Create(photo *Photo) *PhotoCreateCall {
1308 c := &PhotoCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1309 c.photo = photo
1310 return c
1311 }
1312
1313
1314
1315
1316 func (c *PhotoCreateCall) Fields(s ...googleapi.Field) *PhotoCreateCall {
1317 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1318 return c
1319 }
1320
1321
1322 func (c *PhotoCreateCall) Context(ctx context.Context) *PhotoCreateCall {
1323 c.ctx_ = ctx
1324 return c
1325 }
1326
1327
1328
1329 func (c *PhotoCreateCall) Header() http.Header {
1330 if c.header_ == nil {
1331 c.header_ = make(http.Header)
1332 }
1333 return c.header_
1334 }
1335
1336 func (c *PhotoCreateCall) doRequest(alt string) (*http.Response, error) {
1337 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1338 var body io.Reader = nil
1339 body, err := googleapi.WithoutDataWrapper.JSONReader(c.photo)
1340 if err != nil {
1341 return nil, err
1342 }
1343 c.urlParams_.Set("alt", alt)
1344 c.urlParams_.Set("prettyPrint", "false")
1345 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photo")
1346 urls += "?" + c.urlParams_.Encode()
1347 req, err := http.NewRequest("POST", urls, body)
1348 if err != nil {
1349 return nil, err
1350 }
1351 req.Header = reqHeaders
1352 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1353 }
1354
1355
1356
1357
1358
1359
1360 func (c *PhotoCreateCall) Do(opts ...googleapi.CallOption) (*Photo, error) {
1361 gensupport.SetOptions(c.urlParams_, opts...)
1362 res, err := c.doRequest("json")
1363 if res != nil && res.StatusCode == http.StatusNotModified {
1364 if res.Body != nil {
1365 res.Body.Close()
1366 }
1367 return nil, gensupport.WrapError(&googleapi.Error{
1368 Code: res.StatusCode,
1369 Header: res.Header,
1370 })
1371 }
1372 if err != nil {
1373 return nil, err
1374 }
1375 defer googleapi.CloseBody(res)
1376 if err := googleapi.CheckResponse(res); err != nil {
1377 return nil, gensupport.WrapError(err)
1378 }
1379 ret := &Photo{
1380 ServerResponse: googleapi.ServerResponse{
1381 Header: res.Header,
1382 HTTPStatusCode: res.StatusCode,
1383 },
1384 }
1385 target := &ret
1386 if err := gensupport.DecodeResponse(target, res); err != nil {
1387 return nil, err
1388 }
1389 return ret, nil
1390 }
1391
1392 type PhotoDeleteCall struct {
1393 s *Service
1394 photoId string
1395 urlParams_ gensupport.URLParams
1396 ctx_ context.Context
1397 header_ http.Header
1398 }
1399
1400
1401
1402
1403
1404
1405
1406 func (r *PhotoService) Delete(photoId string) *PhotoDeleteCall {
1407 c := &PhotoDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1408 c.photoId = photoId
1409 return c
1410 }
1411
1412
1413
1414
1415 func (c *PhotoDeleteCall) Fields(s ...googleapi.Field) *PhotoDeleteCall {
1416 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1417 return c
1418 }
1419
1420
1421 func (c *PhotoDeleteCall) Context(ctx context.Context) *PhotoDeleteCall {
1422 c.ctx_ = ctx
1423 return c
1424 }
1425
1426
1427
1428 func (c *PhotoDeleteCall) Header() http.Header {
1429 if c.header_ == nil {
1430 c.header_ = make(http.Header)
1431 }
1432 return c.header_
1433 }
1434
1435 func (c *PhotoDeleteCall) doRequest(alt string) (*http.Response, error) {
1436 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1437 var body io.Reader = nil
1438 c.urlParams_.Set("alt", alt)
1439 c.urlParams_.Set("prettyPrint", "false")
1440 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photo/{photoId}")
1441 urls += "?" + c.urlParams_.Encode()
1442 req, err := http.NewRequest("DELETE", urls, body)
1443 if err != nil {
1444 return nil, err
1445 }
1446 req.Header = reqHeaders
1447 googleapi.Expand(req.URL, map[string]string{
1448 "photoId": c.photoId,
1449 })
1450 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1451 }
1452
1453
1454
1455
1456
1457
1458 func (c *PhotoDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
1459 gensupport.SetOptions(c.urlParams_, opts...)
1460 res, err := c.doRequest("json")
1461 if res != nil && res.StatusCode == http.StatusNotModified {
1462 if res.Body != nil {
1463 res.Body.Close()
1464 }
1465 return nil, gensupport.WrapError(&googleapi.Error{
1466 Code: res.StatusCode,
1467 Header: res.Header,
1468 })
1469 }
1470 if err != nil {
1471 return nil, err
1472 }
1473 defer googleapi.CloseBody(res)
1474 if err := googleapi.CheckResponse(res); err != nil {
1475 return nil, gensupport.WrapError(err)
1476 }
1477 ret := &Empty{
1478 ServerResponse: googleapi.ServerResponse{
1479 Header: res.Header,
1480 HTTPStatusCode: res.StatusCode,
1481 },
1482 }
1483 target := &ret
1484 if err := gensupport.DecodeResponse(target, res); err != nil {
1485 return nil, err
1486 }
1487 return ret, nil
1488 }
1489
1490 type PhotoGetCall struct {
1491 s *Service
1492 photoId string
1493 urlParams_ gensupport.URLParams
1494 ifNoneMatch_ string
1495 ctx_ context.Context
1496 header_ http.Header
1497 }
1498
1499
1500
1501
1502
1503
1504
1505
1506 func (r *PhotoService) Get(photoId string) *PhotoGetCall {
1507 c := &PhotoGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1508 c.photoId = photoId
1509 return c
1510 }
1511
1512
1513
1514
1515
1516
1517 func (c *PhotoGetCall) LanguageCode(languageCode string) *PhotoGetCall {
1518 c.urlParams_.Set("languageCode", languageCode)
1519 return c
1520 }
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534 func (c *PhotoGetCall) View(view string) *PhotoGetCall {
1535 c.urlParams_.Set("view", view)
1536 return c
1537 }
1538
1539
1540
1541
1542 func (c *PhotoGetCall) Fields(s ...googleapi.Field) *PhotoGetCall {
1543 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1544 return c
1545 }
1546
1547
1548
1549
1550 func (c *PhotoGetCall) IfNoneMatch(entityTag string) *PhotoGetCall {
1551 c.ifNoneMatch_ = entityTag
1552 return c
1553 }
1554
1555
1556 func (c *PhotoGetCall) Context(ctx context.Context) *PhotoGetCall {
1557 c.ctx_ = ctx
1558 return c
1559 }
1560
1561
1562
1563 func (c *PhotoGetCall) Header() http.Header {
1564 if c.header_ == nil {
1565 c.header_ = make(http.Header)
1566 }
1567 return c.header_
1568 }
1569
1570 func (c *PhotoGetCall) doRequest(alt string) (*http.Response, error) {
1571 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1572 if c.ifNoneMatch_ != "" {
1573 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1574 }
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, "v1/photo/{photoId}")
1579 urls += "?" + c.urlParams_.Encode()
1580 req, err := http.NewRequest("GET", urls, body)
1581 if err != nil {
1582 return nil, err
1583 }
1584 req.Header = reqHeaders
1585 googleapi.Expand(req.URL, map[string]string{
1586 "photoId": c.photoId,
1587 })
1588 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1589 }
1590
1591
1592
1593
1594
1595
1596 func (c *PhotoGetCall) Do(opts ...googleapi.CallOption) (*Photo, error) {
1597 gensupport.SetOptions(c.urlParams_, opts...)
1598 res, err := c.doRequest("json")
1599 if res != nil && res.StatusCode == http.StatusNotModified {
1600 if res.Body != nil {
1601 res.Body.Close()
1602 }
1603 return nil, gensupport.WrapError(&googleapi.Error{
1604 Code: res.StatusCode,
1605 Header: res.Header,
1606 })
1607 }
1608 if err != nil {
1609 return nil, err
1610 }
1611 defer googleapi.CloseBody(res)
1612 if err := googleapi.CheckResponse(res); err != nil {
1613 return nil, gensupport.WrapError(err)
1614 }
1615 ret := &Photo{
1616 ServerResponse: googleapi.ServerResponse{
1617 Header: res.Header,
1618 HTTPStatusCode: res.StatusCode,
1619 },
1620 }
1621 target := &ret
1622 if err := gensupport.DecodeResponse(target, res); err != nil {
1623 return nil, err
1624 }
1625 return ret, nil
1626 }
1627
1628 type PhotoStartUploadCall struct {
1629 s *Service
1630 empty *Empty
1631 urlParams_ gensupport.URLParams
1632 ctx_ context.Context
1633 header_ http.Header
1634 }
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647 func (r *PhotoService) StartUpload(empty *Empty) *PhotoStartUploadCall {
1648 c := &PhotoStartUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1649 c.empty = empty
1650 return c
1651 }
1652
1653
1654
1655
1656 func (c *PhotoStartUploadCall) Fields(s ...googleapi.Field) *PhotoStartUploadCall {
1657 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1658 return c
1659 }
1660
1661
1662 func (c *PhotoStartUploadCall) Context(ctx context.Context) *PhotoStartUploadCall {
1663 c.ctx_ = ctx
1664 return c
1665 }
1666
1667
1668
1669 func (c *PhotoStartUploadCall) Header() http.Header {
1670 if c.header_ == nil {
1671 c.header_ = make(http.Header)
1672 }
1673 return c.header_
1674 }
1675
1676 func (c *PhotoStartUploadCall) doRequest(alt string) (*http.Response, error) {
1677 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1678 var body io.Reader = nil
1679 body, err := googleapi.WithoutDataWrapper.JSONReader(c.empty)
1680 if err != nil {
1681 return nil, err
1682 }
1683 c.urlParams_.Set("alt", alt)
1684 c.urlParams_.Set("prettyPrint", "false")
1685 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photo:startUpload")
1686 urls += "?" + c.urlParams_.Encode()
1687 req, err := http.NewRequest("POST", urls, body)
1688 if err != nil {
1689 return nil, err
1690 }
1691 req.Header = reqHeaders
1692 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1693 }
1694
1695
1696
1697
1698
1699
1700 func (c *PhotoStartUploadCall) Do(opts ...googleapi.CallOption) (*UploadRef, error) {
1701 gensupport.SetOptions(c.urlParams_, opts...)
1702 res, err := c.doRequest("json")
1703 if res != nil && res.StatusCode == http.StatusNotModified {
1704 if res.Body != nil {
1705 res.Body.Close()
1706 }
1707 return nil, gensupport.WrapError(&googleapi.Error{
1708 Code: res.StatusCode,
1709 Header: res.Header,
1710 })
1711 }
1712 if err != nil {
1713 return nil, err
1714 }
1715 defer googleapi.CloseBody(res)
1716 if err := googleapi.CheckResponse(res); err != nil {
1717 return nil, gensupport.WrapError(err)
1718 }
1719 ret := &UploadRef{
1720 ServerResponse: googleapi.ServerResponse{
1721 Header: res.Header,
1722 HTTPStatusCode: res.StatusCode,
1723 },
1724 }
1725 target := &ret
1726 if err := gensupport.DecodeResponse(target, res); err != nil {
1727 return nil, err
1728 }
1729 return ret, nil
1730 }
1731
1732 type PhotoUpdateCall struct {
1733 s *Service
1734 id string
1735 photo *Photo
1736 urlParams_ gensupport.URLParams
1737 ctx_ context.Context
1738 header_ http.Header
1739 }
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752 func (r *PhotoService) Update(id string, photo *Photo) *PhotoUpdateCall {
1753 c := &PhotoUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1754 c.id = id
1755 c.photo = photo
1756 return c
1757 }
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770 func (c *PhotoUpdateCall) UpdateMask(updateMask string) *PhotoUpdateCall {
1771 c.urlParams_.Set("updateMask", updateMask)
1772 return c
1773 }
1774
1775
1776
1777
1778 func (c *PhotoUpdateCall) Fields(s ...googleapi.Field) *PhotoUpdateCall {
1779 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1780 return c
1781 }
1782
1783
1784 func (c *PhotoUpdateCall) Context(ctx context.Context) *PhotoUpdateCall {
1785 c.ctx_ = ctx
1786 return c
1787 }
1788
1789
1790
1791 func (c *PhotoUpdateCall) Header() http.Header {
1792 if c.header_ == nil {
1793 c.header_ = make(http.Header)
1794 }
1795 return c.header_
1796 }
1797
1798 func (c *PhotoUpdateCall) doRequest(alt string) (*http.Response, error) {
1799 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1800 var body io.Reader = nil
1801 body, err := googleapi.WithoutDataWrapper.JSONReader(c.photo)
1802 if err != nil {
1803 return nil, err
1804 }
1805 c.urlParams_.Set("alt", alt)
1806 c.urlParams_.Set("prettyPrint", "false")
1807 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photo/{id}")
1808 urls += "?" + c.urlParams_.Encode()
1809 req, err := http.NewRequest("PUT", urls, body)
1810 if err != nil {
1811 return nil, err
1812 }
1813 req.Header = reqHeaders
1814 googleapi.Expand(req.URL, map[string]string{
1815 "id": c.id,
1816 })
1817 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1818 }
1819
1820
1821
1822
1823
1824
1825 func (c *PhotoUpdateCall) Do(opts ...googleapi.CallOption) (*Photo, error) {
1826 gensupport.SetOptions(c.urlParams_, opts...)
1827 res, err := c.doRequest("json")
1828 if res != nil && res.StatusCode == http.StatusNotModified {
1829 if res.Body != nil {
1830 res.Body.Close()
1831 }
1832 return nil, gensupport.WrapError(&googleapi.Error{
1833 Code: res.StatusCode,
1834 Header: res.Header,
1835 })
1836 }
1837 if err != nil {
1838 return nil, err
1839 }
1840 defer googleapi.CloseBody(res)
1841 if err := googleapi.CheckResponse(res); err != nil {
1842 return nil, gensupport.WrapError(err)
1843 }
1844 ret := &Photo{
1845 ServerResponse: googleapi.ServerResponse{
1846 Header: res.Header,
1847 HTTPStatusCode: res.StatusCode,
1848 },
1849 }
1850 target := &ret
1851 if err := gensupport.DecodeResponse(target, res); err != nil {
1852 return nil, err
1853 }
1854 return ret, nil
1855 }
1856
1857 type PhotoSequenceCreateCall struct {
1858 s *Service
1859 photosequence *PhotoSequence
1860 urlParams_ gensupport.URLParams
1861 ctx_ context.Context
1862 header_ http.Header
1863 }
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873 func (r *PhotoSequenceService) Create(photosequence *PhotoSequence) *PhotoSequenceCreateCall {
1874 c := &PhotoSequenceCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1875 c.photosequence = photosequence
1876 return c
1877 }
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890 func (c *PhotoSequenceCreateCall) InputType(inputType string) *PhotoSequenceCreateCall {
1891 c.urlParams_.Set("inputType", inputType)
1892 return c
1893 }
1894
1895
1896
1897
1898 func (c *PhotoSequenceCreateCall) Fields(s ...googleapi.Field) *PhotoSequenceCreateCall {
1899 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1900 return c
1901 }
1902
1903
1904 func (c *PhotoSequenceCreateCall) Context(ctx context.Context) *PhotoSequenceCreateCall {
1905 c.ctx_ = ctx
1906 return c
1907 }
1908
1909
1910
1911 func (c *PhotoSequenceCreateCall) Header() http.Header {
1912 if c.header_ == nil {
1913 c.header_ = make(http.Header)
1914 }
1915 return c.header_
1916 }
1917
1918 func (c *PhotoSequenceCreateCall) doRequest(alt string) (*http.Response, error) {
1919 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1920 var body io.Reader = nil
1921 body, err := googleapi.WithoutDataWrapper.JSONReader(c.photosequence)
1922 if err != nil {
1923 return nil, err
1924 }
1925 c.urlParams_.Set("alt", alt)
1926 c.urlParams_.Set("prettyPrint", "false")
1927 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photoSequence")
1928 urls += "?" + c.urlParams_.Encode()
1929 req, err := http.NewRequest("POST", urls, body)
1930 if err != nil {
1931 return nil, err
1932 }
1933 req.Header = reqHeaders
1934 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1935 }
1936
1937
1938
1939
1940
1941
1942 func (c *PhotoSequenceCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
1943 gensupport.SetOptions(c.urlParams_, opts...)
1944 res, err := c.doRequest("json")
1945 if res != nil && res.StatusCode == http.StatusNotModified {
1946 if res.Body != nil {
1947 res.Body.Close()
1948 }
1949 return nil, gensupport.WrapError(&googleapi.Error{
1950 Code: res.StatusCode,
1951 Header: res.Header,
1952 })
1953 }
1954 if err != nil {
1955 return nil, err
1956 }
1957 defer googleapi.CloseBody(res)
1958 if err := googleapi.CheckResponse(res); err != nil {
1959 return nil, gensupport.WrapError(err)
1960 }
1961 ret := &Operation{
1962 ServerResponse: googleapi.ServerResponse{
1963 Header: res.Header,
1964 HTTPStatusCode: res.StatusCode,
1965 },
1966 }
1967 target := &ret
1968 if err := gensupport.DecodeResponse(target, res); err != nil {
1969 return nil, err
1970 }
1971 return ret, nil
1972 }
1973
1974 type PhotoSequenceDeleteCall struct {
1975 s *Service
1976 sequenceId string
1977 urlParams_ gensupport.URLParams
1978 ctx_ context.Context
1979 header_ http.Header
1980 }
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990 func (r *PhotoSequenceService) Delete(sequenceId string) *PhotoSequenceDeleteCall {
1991 c := &PhotoSequenceDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1992 c.sequenceId = sequenceId
1993 return c
1994 }
1995
1996
1997
1998
1999 func (c *PhotoSequenceDeleteCall) Fields(s ...googleapi.Field) *PhotoSequenceDeleteCall {
2000 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2001 return c
2002 }
2003
2004
2005 func (c *PhotoSequenceDeleteCall) Context(ctx context.Context) *PhotoSequenceDeleteCall {
2006 c.ctx_ = ctx
2007 return c
2008 }
2009
2010
2011
2012 func (c *PhotoSequenceDeleteCall) Header() http.Header {
2013 if c.header_ == nil {
2014 c.header_ = make(http.Header)
2015 }
2016 return c.header_
2017 }
2018
2019 func (c *PhotoSequenceDeleteCall) doRequest(alt string) (*http.Response, error) {
2020 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2021 var body io.Reader = nil
2022 c.urlParams_.Set("alt", alt)
2023 c.urlParams_.Set("prettyPrint", "false")
2024 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photoSequence/{sequenceId}")
2025 urls += "?" + c.urlParams_.Encode()
2026 req, err := http.NewRequest("DELETE", urls, body)
2027 if err != nil {
2028 return nil, err
2029 }
2030 req.Header = reqHeaders
2031 googleapi.Expand(req.URL, map[string]string{
2032 "sequenceId": c.sequenceId,
2033 })
2034 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2035 }
2036
2037
2038
2039
2040
2041
2042 func (c *PhotoSequenceDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
2043 gensupport.SetOptions(c.urlParams_, opts...)
2044 res, err := c.doRequest("json")
2045 if res != nil && res.StatusCode == http.StatusNotModified {
2046 if res.Body != nil {
2047 res.Body.Close()
2048 }
2049 return nil, gensupport.WrapError(&googleapi.Error{
2050 Code: res.StatusCode,
2051 Header: res.Header,
2052 })
2053 }
2054 if err != nil {
2055 return nil, err
2056 }
2057 defer googleapi.CloseBody(res)
2058 if err := googleapi.CheckResponse(res); err != nil {
2059 return nil, gensupport.WrapError(err)
2060 }
2061 ret := &Empty{
2062 ServerResponse: googleapi.ServerResponse{
2063 Header: res.Header,
2064 HTTPStatusCode: res.StatusCode,
2065 },
2066 }
2067 target := &ret
2068 if err := gensupport.DecodeResponse(target, res); err != nil {
2069 return nil, err
2070 }
2071 return ret, nil
2072 }
2073
2074 type PhotoSequenceGetCall struct {
2075 s *Service
2076 sequenceId string
2077 urlParams_ gensupport.URLParams
2078 ifNoneMatch_ string
2079 ctx_ context.Context
2080 header_ http.Header
2081 }
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095 func (r *PhotoSequenceService) Get(sequenceId string) *PhotoSequenceGetCall {
2096 c := &PhotoSequenceGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2097 c.sequenceId = sequenceId
2098 return c
2099 }
2100
2101
2102
2103
2104 func (c *PhotoSequenceGetCall) Filter(filter string) *PhotoSequenceGetCall {
2105 c.urlParams_.Set("filter", filter)
2106 return c
2107 }
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122 func (c *PhotoSequenceGetCall) View(view string) *PhotoSequenceGetCall {
2123 c.urlParams_.Set("view", view)
2124 return c
2125 }
2126
2127
2128
2129
2130 func (c *PhotoSequenceGetCall) Fields(s ...googleapi.Field) *PhotoSequenceGetCall {
2131 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2132 return c
2133 }
2134
2135
2136
2137
2138 func (c *PhotoSequenceGetCall) IfNoneMatch(entityTag string) *PhotoSequenceGetCall {
2139 c.ifNoneMatch_ = entityTag
2140 return c
2141 }
2142
2143
2144 func (c *PhotoSequenceGetCall) Context(ctx context.Context) *PhotoSequenceGetCall {
2145 c.ctx_ = ctx
2146 return c
2147 }
2148
2149
2150
2151 func (c *PhotoSequenceGetCall) Header() http.Header {
2152 if c.header_ == nil {
2153 c.header_ = make(http.Header)
2154 }
2155 return c.header_
2156 }
2157
2158 func (c *PhotoSequenceGetCall) doRequest(alt string) (*http.Response, error) {
2159 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2160 if c.ifNoneMatch_ != "" {
2161 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2162 }
2163 var body io.Reader = nil
2164 c.urlParams_.Set("alt", alt)
2165 c.urlParams_.Set("prettyPrint", "false")
2166 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photoSequence/{sequenceId}")
2167 urls += "?" + c.urlParams_.Encode()
2168 req, err := http.NewRequest("GET", urls, body)
2169 if err != nil {
2170 return nil, err
2171 }
2172 req.Header = reqHeaders
2173 googleapi.Expand(req.URL, map[string]string{
2174 "sequenceId": c.sequenceId,
2175 })
2176 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2177 }
2178
2179
2180
2181
2182
2183
2184 func (c *PhotoSequenceGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2185 gensupport.SetOptions(c.urlParams_, opts...)
2186 res, err := c.doRequest("json")
2187 if res != nil && res.StatusCode == http.StatusNotModified {
2188 if res.Body != nil {
2189 res.Body.Close()
2190 }
2191 return nil, gensupport.WrapError(&googleapi.Error{
2192 Code: res.StatusCode,
2193 Header: res.Header,
2194 })
2195 }
2196 if err != nil {
2197 return nil, err
2198 }
2199 defer googleapi.CloseBody(res)
2200 if err := googleapi.CheckResponse(res); err != nil {
2201 return nil, gensupport.WrapError(err)
2202 }
2203 ret := &Operation{
2204 ServerResponse: googleapi.ServerResponse{
2205 Header: res.Header,
2206 HTTPStatusCode: res.StatusCode,
2207 },
2208 }
2209 target := &ret
2210 if err := gensupport.DecodeResponse(target, res); err != nil {
2211 return nil, err
2212 }
2213 return ret, nil
2214 }
2215
2216 type PhotoSequenceStartUploadCall struct {
2217 s *Service
2218 empty *Empty
2219 urlParams_ gensupport.URLParams
2220 ctx_ context.Context
2221 header_ http.Header
2222 }
2223
2224
2225
2226
2227
2228 func (r *PhotoSequenceService) StartUpload(empty *Empty) *PhotoSequenceStartUploadCall {
2229 c := &PhotoSequenceStartUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2230 c.empty = empty
2231 return c
2232 }
2233
2234
2235
2236
2237 func (c *PhotoSequenceStartUploadCall) Fields(s ...googleapi.Field) *PhotoSequenceStartUploadCall {
2238 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2239 return c
2240 }
2241
2242
2243 func (c *PhotoSequenceStartUploadCall) Context(ctx context.Context) *PhotoSequenceStartUploadCall {
2244 c.ctx_ = ctx
2245 return c
2246 }
2247
2248
2249
2250 func (c *PhotoSequenceStartUploadCall) Header() http.Header {
2251 if c.header_ == nil {
2252 c.header_ = make(http.Header)
2253 }
2254 return c.header_
2255 }
2256
2257 func (c *PhotoSequenceStartUploadCall) doRequest(alt string) (*http.Response, error) {
2258 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2259 var body io.Reader = nil
2260 body, err := googleapi.WithoutDataWrapper.JSONReader(c.empty)
2261 if err != nil {
2262 return nil, err
2263 }
2264 c.urlParams_.Set("alt", alt)
2265 c.urlParams_.Set("prettyPrint", "false")
2266 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photoSequence:startUpload")
2267 urls += "?" + c.urlParams_.Encode()
2268 req, err := http.NewRequest("POST", urls, body)
2269 if err != nil {
2270 return nil, err
2271 }
2272 req.Header = reqHeaders
2273 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2274 }
2275
2276
2277
2278
2279
2280
2281 func (c *PhotoSequenceStartUploadCall) Do(opts ...googleapi.CallOption) (*UploadRef, error) {
2282 gensupport.SetOptions(c.urlParams_, opts...)
2283 res, err := c.doRequest("json")
2284 if res != nil && res.StatusCode == http.StatusNotModified {
2285 if res.Body != nil {
2286 res.Body.Close()
2287 }
2288 return nil, gensupport.WrapError(&googleapi.Error{
2289 Code: res.StatusCode,
2290 Header: res.Header,
2291 })
2292 }
2293 if err != nil {
2294 return nil, err
2295 }
2296 defer googleapi.CloseBody(res)
2297 if err := googleapi.CheckResponse(res); err != nil {
2298 return nil, gensupport.WrapError(err)
2299 }
2300 ret := &UploadRef{
2301 ServerResponse: googleapi.ServerResponse{
2302 Header: res.Header,
2303 HTTPStatusCode: res.StatusCode,
2304 },
2305 }
2306 target := &ret
2307 if err := gensupport.DecodeResponse(target, res); err != nil {
2308 return nil, err
2309 }
2310 return ret, nil
2311 }
2312
2313 type PhotoSequencesListCall struct {
2314 s *Service
2315 urlParams_ gensupport.URLParams
2316 ifNoneMatch_ string
2317 ctx_ context.Context
2318 header_ http.Header
2319 }
2320
2321
2322
2323 func (r *PhotoSequencesService) List() *PhotoSequencesListCall {
2324 c := &PhotoSequencesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2325 return c
2326 }
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336 func (c *PhotoSequencesListCall) Filter(filter string) *PhotoSequencesListCall {
2337 c.urlParams_.Set("filter", filter)
2338 return c
2339 }
2340
2341
2342
2343
2344
2345
2346
2347 func (c *PhotoSequencesListCall) PageSize(pageSize int64) *PhotoSequencesListCall {
2348 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2349 return c
2350 }
2351
2352
2353
2354 func (c *PhotoSequencesListCall) PageToken(pageToken string) *PhotoSequencesListCall {
2355 c.urlParams_.Set("pageToken", pageToken)
2356 return c
2357 }
2358
2359
2360
2361
2362 func (c *PhotoSequencesListCall) Fields(s ...googleapi.Field) *PhotoSequencesListCall {
2363 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2364 return c
2365 }
2366
2367
2368
2369
2370 func (c *PhotoSequencesListCall) IfNoneMatch(entityTag string) *PhotoSequencesListCall {
2371 c.ifNoneMatch_ = entityTag
2372 return c
2373 }
2374
2375
2376 func (c *PhotoSequencesListCall) Context(ctx context.Context) *PhotoSequencesListCall {
2377 c.ctx_ = ctx
2378 return c
2379 }
2380
2381
2382
2383 func (c *PhotoSequencesListCall) Header() http.Header {
2384 if c.header_ == nil {
2385 c.header_ = make(http.Header)
2386 }
2387 return c.header_
2388 }
2389
2390 func (c *PhotoSequencesListCall) doRequest(alt string) (*http.Response, error) {
2391 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2392 if c.ifNoneMatch_ != "" {
2393 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2394 }
2395 var body io.Reader = nil
2396 c.urlParams_.Set("alt", alt)
2397 c.urlParams_.Set("prettyPrint", "false")
2398 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photoSequences")
2399 urls += "?" + c.urlParams_.Encode()
2400 req, err := http.NewRequest("GET", urls, body)
2401 if err != nil {
2402 return nil, err
2403 }
2404 req.Header = reqHeaders
2405 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2406 }
2407
2408
2409
2410
2411
2412
2413
2414 func (c *PhotoSequencesListCall) Do(opts ...googleapi.CallOption) (*ListPhotoSequencesResponse, error) {
2415 gensupport.SetOptions(c.urlParams_, opts...)
2416 res, err := c.doRequest("json")
2417 if res != nil && res.StatusCode == http.StatusNotModified {
2418 if res.Body != nil {
2419 res.Body.Close()
2420 }
2421 return nil, gensupport.WrapError(&googleapi.Error{
2422 Code: res.StatusCode,
2423 Header: res.Header,
2424 })
2425 }
2426 if err != nil {
2427 return nil, err
2428 }
2429 defer googleapi.CloseBody(res)
2430 if err := googleapi.CheckResponse(res); err != nil {
2431 return nil, gensupport.WrapError(err)
2432 }
2433 ret := &ListPhotoSequencesResponse{
2434 ServerResponse: googleapi.ServerResponse{
2435 Header: res.Header,
2436 HTTPStatusCode: res.StatusCode,
2437 },
2438 }
2439 target := &ret
2440 if err := gensupport.DecodeResponse(target, res); err != nil {
2441 return nil, err
2442 }
2443 return ret, nil
2444 }
2445
2446
2447
2448
2449 func (c *PhotoSequencesListCall) Pages(ctx context.Context, f func(*ListPhotoSequencesResponse) error) error {
2450 c.ctx_ = ctx
2451 defer c.PageToken(c.urlParams_.Get("pageToken"))
2452 for {
2453 x, err := c.Do()
2454 if err != nil {
2455 return err
2456 }
2457 if err := f(x); err != nil {
2458 return err
2459 }
2460 if x.NextPageToken == "" {
2461 return nil
2462 }
2463 c.PageToken(x.NextPageToken)
2464 }
2465 }
2466
2467 type PhotosBatchDeleteCall struct {
2468 s *Service
2469 batchdeletephotosrequest *BatchDeletePhotosRequest
2470 urlParams_ gensupport.URLParams
2471 ctx_ context.Context
2472 header_ http.Header
2473 }
2474
2475
2476
2477
2478
2479
2480
2481 func (r *PhotosService) BatchDelete(batchdeletephotosrequest *BatchDeletePhotosRequest) *PhotosBatchDeleteCall {
2482 c := &PhotosBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2483 c.batchdeletephotosrequest = batchdeletephotosrequest
2484 return c
2485 }
2486
2487
2488
2489
2490 func (c *PhotosBatchDeleteCall) Fields(s ...googleapi.Field) *PhotosBatchDeleteCall {
2491 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2492 return c
2493 }
2494
2495
2496 func (c *PhotosBatchDeleteCall) Context(ctx context.Context) *PhotosBatchDeleteCall {
2497 c.ctx_ = ctx
2498 return c
2499 }
2500
2501
2502
2503 func (c *PhotosBatchDeleteCall) Header() http.Header {
2504 if c.header_ == nil {
2505 c.header_ = make(http.Header)
2506 }
2507 return c.header_
2508 }
2509
2510 func (c *PhotosBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
2511 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2512 var body io.Reader = nil
2513 body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchdeletephotosrequest)
2514 if err != nil {
2515 return nil, err
2516 }
2517 c.urlParams_.Set("alt", alt)
2518 c.urlParams_.Set("prettyPrint", "false")
2519 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photos:batchDelete")
2520 urls += "?" + c.urlParams_.Encode()
2521 req, err := http.NewRequest("POST", urls, body)
2522 if err != nil {
2523 return nil, err
2524 }
2525 req.Header = reqHeaders
2526 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2527 }
2528
2529
2530
2531
2532
2533
2534
2535 func (c *PhotosBatchDeleteCall) Do(opts ...googleapi.CallOption) (*BatchDeletePhotosResponse, error) {
2536 gensupport.SetOptions(c.urlParams_, opts...)
2537 res, err := c.doRequest("json")
2538 if res != nil && res.StatusCode == http.StatusNotModified {
2539 if res.Body != nil {
2540 res.Body.Close()
2541 }
2542 return nil, gensupport.WrapError(&googleapi.Error{
2543 Code: res.StatusCode,
2544 Header: res.Header,
2545 })
2546 }
2547 if err != nil {
2548 return nil, err
2549 }
2550 defer googleapi.CloseBody(res)
2551 if err := googleapi.CheckResponse(res); err != nil {
2552 return nil, gensupport.WrapError(err)
2553 }
2554 ret := &BatchDeletePhotosResponse{
2555 ServerResponse: googleapi.ServerResponse{
2556 Header: res.Header,
2557 HTTPStatusCode: res.StatusCode,
2558 },
2559 }
2560 target := &ret
2561 if err := gensupport.DecodeResponse(target, res); err != nil {
2562 return nil, err
2563 }
2564 return ret, nil
2565 }
2566
2567 type PhotosBatchGetCall struct {
2568 s *Service
2569 urlParams_ gensupport.URLParams
2570 ifNoneMatch_ string
2571 ctx_ context.Context
2572 header_ http.Header
2573 }
2574
2575
2576
2577
2578
2579
2580
2581 func (r *PhotosService) BatchGet() *PhotosBatchGetCall {
2582 c := &PhotosBatchGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2583 return c
2584 }
2585
2586
2587
2588
2589
2590
2591 func (c *PhotosBatchGetCall) LanguageCode(languageCode string) *PhotosBatchGetCall {
2592 c.urlParams_.Set("languageCode", languageCode)
2593 return c
2594 }
2595
2596
2597
2598
2599 func (c *PhotosBatchGetCall) PhotoIds(photoIds ...string) *PhotosBatchGetCall {
2600 c.urlParams_.SetMulti("photoIds", append([]string{}, photoIds...))
2601 return c
2602 }
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616 func (c *PhotosBatchGetCall) View(view string) *PhotosBatchGetCall {
2617 c.urlParams_.Set("view", view)
2618 return c
2619 }
2620
2621
2622
2623
2624 func (c *PhotosBatchGetCall) Fields(s ...googleapi.Field) *PhotosBatchGetCall {
2625 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2626 return c
2627 }
2628
2629
2630
2631
2632 func (c *PhotosBatchGetCall) IfNoneMatch(entityTag string) *PhotosBatchGetCall {
2633 c.ifNoneMatch_ = entityTag
2634 return c
2635 }
2636
2637
2638 func (c *PhotosBatchGetCall) Context(ctx context.Context) *PhotosBatchGetCall {
2639 c.ctx_ = ctx
2640 return c
2641 }
2642
2643
2644
2645 func (c *PhotosBatchGetCall) Header() http.Header {
2646 if c.header_ == nil {
2647 c.header_ = make(http.Header)
2648 }
2649 return c.header_
2650 }
2651
2652 func (c *PhotosBatchGetCall) doRequest(alt string) (*http.Response, error) {
2653 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2654 if c.ifNoneMatch_ != "" {
2655 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2656 }
2657 var body io.Reader = nil
2658 c.urlParams_.Set("alt", alt)
2659 c.urlParams_.Set("prettyPrint", "false")
2660 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photos:batchGet")
2661 urls += "?" + c.urlParams_.Encode()
2662 req, err := http.NewRequest("GET", urls, body)
2663 if err != nil {
2664 return nil, err
2665 }
2666 req.Header = reqHeaders
2667 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2668 }
2669
2670
2671
2672
2673
2674
2675
2676 func (c *PhotosBatchGetCall) Do(opts ...googleapi.CallOption) (*BatchGetPhotosResponse, error) {
2677 gensupport.SetOptions(c.urlParams_, opts...)
2678 res, err := c.doRequest("json")
2679 if res != nil && res.StatusCode == http.StatusNotModified {
2680 if res.Body != nil {
2681 res.Body.Close()
2682 }
2683 return nil, gensupport.WrapError(&googleapi.Error{
2684 Code: res.StatusCode,
2685 Header: res.Header,
2686 })
2687 }
2688 if err != nil {
2689 return nil, err
2690 }
2691 defer googleapi.CloseBody(res)
2692 if err := googleapi.CheckResponse(res); err != nil {
2693 return nil, gensupport.WrapError(err)
2694 }
2695 ret := &BatchGetPhotosResponse{
2696 ServerResponse: googleapi.ServerResponse{
2697 Header: res.Header,
2698 HTTPStatusCode: res.StatusCode,
2699 },
2700 }
2701 target := &ret
2702 if err := gensupport.DecodeResponse(target, res); err != nil {
2703 return nil, err
2704 }
2705 return ret, nil
2706 }
2707
2708 type PhotosBatchUpdateCall struct {
2709 s *Service
2710 batchupdatephotosrequest *BatchUpdatePhotosRequest
2711 urlParams_ gensupport.URLParams
2712 ctx_ context.Context
2713 header_ http.Header
2714 }
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728 func (r *PhotosService) BatchUpdate(batchupdatephotosrequest *BatchUpdatePhotosRequest) *PhotosBatchUpdateCall {
2729 c := &PhotosBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2730 c.batchupdatephotosrequest = batchupdatephotosrequest
2731 return c
2732 }
2733
2734
2735
2736
2737 func (c *PhotosBatchUpdateCall) Fields(s ...googleapi.Field) *PhotosBatchUpdateCall {
2738 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2739 return c
2740 }
2741
2742
2743 func (c *PhotosBatchUpdateCall) Context(ctx context.Context) *PhotosBatchUpdateCall {
2744 c.ctx_ = ctx
2745 return c
2746 }
2747
2748
2749
2750 func (c *PhotosBatchUpdateCall) Header() http.Header {
2751 if c.header_ == nil {
2752 c.header_ = make(http.Header)
2753 }
2754 return c.header_
2755 }
2756
2757 func (c *PhotosBatchUpdateCall) doRequest(alt string) (*http.Response, error) {
2758 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2759 var body io.Reader = nil
2760 body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchupdatephotosrequest)
2761 if err != nil {
2762 return nil, err
2763 }
2764 c.urlParams_.Set("alt", alt)
2765 c.urlParams_.Set("prettyPrint", "false")
2766 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photos:batchUpdate")
2767 urls += "?" + c.urlParams_.Encode()
2768 req, err := http.NewRequest("POST", urls, body)
2769 if err != nil {
2770 return nil, err
2771 }
2772 req.Header = reqHeaders
2773 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2774 }
2775
2776
2777
2778
2779
2780
2781
2782 func (c *PhotosBatchUpdateCall) Do(opts ...googleapi.CallOption) (*BatchUpdatePhotosResponse, error) {
2783 gensupport.SetOptions(c.urlParams_, opts...)
2784 res, err := c.doRequest("json")
2785 if res != nil && res.StatusCode == http.StatusNotModified {
2786 if res.Body != nil {
2787 res.Body.Close()
2788 }
2789 return nil, gensupport.WrapError(&googleapi.Error{
2790 Code: res.StatusCode,
2791 Header: res.Header,
2792 })
2793 }
2794 if err != nil {
2795 return nil, err
2796 }
2797 defer googleapi.CloseBody(res)
2798 if err := googleapi.CheckResponse(res); err != nil {
2799 return nil, gensupport.WrapError(err)
2800 }
2801 ret := &BatchUpdatePhotosResponse{
2802 ServerResponse: googleapi.ServerResponse{
2803 Header: res.Header,
2804 HTTPStatusCode: res.StatusCode,
2805 },
2806 }
2807 target := &ret
2808 if err := gensupport.DecodeResponse(target, res); err != nil {
2809 return nil, err
2810 }
2811 return ret, nil
2812 }
2813
2814 type PhotosListCall struct {
2815 s *Service
2816 urlParams_ gensupport.URLParams
2817 ifNoneMatch_ string
2818 ctx_ context.Context
2819 header_ http.Header
2820 }
2821
2822
2823
2824 func (r *PhotosService) List() *PhotosListCall {
2825 c := &PhotosListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2826 return c
2827 }
2828
2829
2830
2831
2832
2833 func (c *PhotosListCall) Filter(filter string) *PhotosListCall {
2834 c.urlParams_.Set("filter", filter)
2835 return c
2836 }
2837
2838
2839
2840
2841
2842
2843 func (c *PhotosListCall) LanguageCode(languageCode string) *PhotosListCall {
2844 c.urlParams_.Set("languageCode", languageCode)
2845 return c
2846 }
2847
2848
2849
2850
2851
2852
2853 func (c *PhotosListCall) PageSize(pageSize int64) *PhotosListCall {
2854 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2855 return c
2856 }
2857
2858
2859
2860 func (c *PhotosListCall) PageToken(pageToken string) *PhotosListCall {
2861 c.urlParams_.Set("pageToken", pageToken)
2862 return c
2863 }
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877 func (c *PhotosListCall) View(view string) *PhotosListCall {
2878 c.urlParams_.Set("view", view)
2879 return c
2880 }
2881
2882
2883
2884
2885 func (c *PhotosListCall) Fields(s ...googleapi.Field) *PhotosListCall {
2886 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2887 return c
2888 }
2889
2890
2891
2892
2893 func (c *PhotosListCall) IfNoneMatch(entityTag string) *PhotosListCall {
2894 c.ifNoneMatch_ = entityTag
2895 return c
2896 }
2897
2898
2899 func (c *PhotosListCall) Context(ctx context.Context) *PhotosListCall {
2900 c.ctx_ = ctx
2901 return c
2902 }
2903
2904
2905
2906 func (c *PhotosListCall) Header() http.Header {
2907 if c.header_ == nil {
2908 c.header_ = make(http.Header)
2909 }
2910 return c.header_
2911 }
2912
2913 func (c *PhotosListCall) doRequest(alt string) (*http.Response, error) {
2914 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2915 if c.ifNoneMatch_ != "" {
2916 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2917 }
2918 var body io.Reader = nil
2919 c.urlParams_.Set("alt", alt)
2920 c.urlParams_.Set("prettyPrint", "false")
2921 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photos")
2922 urls += "?" + c.urlParams_.Encode()
2923 req, err := http.NewRequest("GET", urls, body)
2924 if err != nil {
2925 return nil, err
2926 }
2927 req.Header = reqHeaders
2928 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2929 }
2930
2931
2932
2933
2934
2935
2936
2937 func (c *PhotosListCall) Do(opts ...googleapi.CallOption) (*ListPhotosResponse, error) {
2938 gensupport.SetOptions(c.urlParams_, opts...)
2939 res, err := c.doRequest("json")
2940 if res != nil && res.StatusCode == http.StatusNotModified {
2941 if res.Body != nil {
2942 res.Body.Close()
2943 }
2944 return nil, gensupport.WrapError(&googleapi.Error{
2945 Code: res.StatusCode,
2946 Header: res.Header,
2947 })
2948 }
2949 if err != nil {
2950 return nil, err
2951 }
2952 defer googleapi.CloseBody(res)
2953 if err := googleapi.CheckResponse(res); err != nil {
2954 return nil, gensupport.WrapError(err)
2955 }
2956 ret := &ListPhotosResponse{
2957 ServerResponse: googleapi.ServerResponse{
2958 Header: res.Header,
2959 HTTPStatusCode: res.StatusCode,
2960 },
2961 }
2962 target := &ret
2963 if err := gensupport.DecodeResponse(target, res); err != nil {
2964 return nil, err
2965 }
2966 return ret, nil
2967 }
2968
2969
2970
2971
2972 func (c *PhotosListCall) Pages(ctx context.Context, f func(*ListPhotosResponse) error) error {
2973 c.ctx_ = ctx
2974 defer c.PageToken(c.urlParams_.Get("pageToken"))
2975 for {
2976 x, err := c.Do()
2977 if err != nil {
2978 return err
2979 }
2980 if err := f(x); err != nil {
2981 return err
2982 }
2983 if x.NextPageToken == "" {
2984 return nil
2985 }
2986 c.PageToken(x.NextPageToken)
2987 }
2988 }
2989
View as plain text