-
Notifications
You must be signed in to change notification settings - Fork 8
/
photoslibrary.go
3527 lines (3159 loc) · 129 KB
/
photoslibrary.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
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
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2018 Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// NOTE: This is not auto-generated code anymore, has been modified to implement several fixes / features,
// see CHANGELOG.md for more details.
// Package photoslibrary provides access to the Photos Library API.
//
// See https://developers.google.com/photos/
//
// Usage example:
//
// import "github.com/gphotosuploader/googlemirror/api/photoslibrary/v1"
// ...
// photoslibraryService, err := photoslibrary.New(oauthHttpClient)
package photoslibrary // import "github.com/gphotosuploader/googlemirror/api/photoslibrary/v1"
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
googleapi "google.golang.org/api/googleapi"
gensupport "github.com/gphotosuploader/googlemirror/api/photoslibrary/v1/internal/gensupport"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
const apiId = "photoslibrary:v1"
const apiName = "photoslibrary"
const apiVersion = "v1"
const basePath = "https://photoslibrary.googleapis.com/"
// OAuth2 scopes used by this API.
const (
// View the photos, videos and albums in your Google Photos
DrivePhotosReadonlyScope = "https://www.googleapis.com/auth/drive.photos.readonly"
// View and manage your Google Photos library
PhotoslibraryScope = "https://www.googleapis.com/auth/photoslibrary"
// Add to your Google Photos library
PhotoslibraryAppendonlyScope = "https://www.googleapis.com/auth/photoslibrary.appendonly"
// View your Google Photos library
PhotoslibraryReadonlyScope = "https://www.googleapis.com/auth/photoslibrary.readonly"
// Manage photos added by this app
PhotoslibraryReadonlyAppcreateddataScope = "https://www.googleapis.com/auth/photoslibrary.readonly.appcreateddata"
// Manage and add to shared albums on your behalf
PhotoslibrarySharingScope = "https://www.googleapis.com/auth/photoslibrary.sharing"
)
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Albums = NewAlbumsService(s)
s.MediaItems = NewMediaItemsService(s)
s.SharedAlbums = NewSharedAlbumsService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Albums *AlbumsService
MediaItems *MediaItemsService
SharedAlbums *SharedAlbumsService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewAlbumsService(s *Service) *AlbumsService {
rs := &AlbumsService{s: s}
return rs
}
type AlbumsService struct {
s *Service
}
func NewMediaItemsService(s *Service) *MediaItemsService {
rs := &MediaItemsService{s: s}
return rs
}
type MediaItemsService struct {
s *Service
}
func NewSharedAlbumsService(s *Service) *SharedAlbumsService {
rs := &SharedAlbumsService{s: s}
return rs
}
type SharedAlbumsService struct {
s *Service
}
// AddEnrichmentToAlbumRequest: Request to add an enrichment to a
// specific album at a specific position.
type AddEnrichmentToAlbumRequest struct {
// AlbumPosition: The position where the enrichment will be inserted.
AlbumPosition *AlbumPosition `json:"albumPosition,omitempty"`
// NewEnrichmentItem: The enrichment to be added.
NewEnrichmentItem *NewEnrichmentItem `json:"newEnrichmentItem,omitempty"`
// ForceSendFields is a list of field names (e.g. "AlbumPosition") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AlbumPosition") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *AddEnrichmentToAlbumRequest) MarshalJSON() ([]byte, error) {
type NoMethod AddEnrichmentToAlbumRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type AddEnrichmentToAlbumResponse struct {
// EnrichmentItem: [Output only] Enrichment which was added.
EnrichmentItem *EnrichmentItem `json:"enrichmentItem,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "EnrichmentItem") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "EnrichmentItem") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *AddEnrichmentToAlbumResponse) MarshalJSON() ([]byte, error) {
type NoMethod AddEnrichmentToAlbumResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Album: Representation of an album in Google Photos.
// Albums are a container for media items. They contain an
// additional
// shareInfo property if they have been shared by the application.
type Album struct {
// CoverPhotoBaseUrl: [Output only] A URL to the cover photo's bytes.
// This should not be used as
// is. Parameters should be appended to this URL before use. For
// example,
// '=w2048-h1024' will set the dimensions of the cover photo to have a
// width
// of 2048 px and height of 1024 px.
CoverPhotoBaseUrl string `json:"coverPhotoBaseUrl,omitempty"`
// Id: [Ouput only] Identifier for the album. This is a persistent
// identifier that
// can be used between sessions to identify this album.
Id string `json:"id,omitempty"`
// IsWriteable: [Output only] True if media items can be created in the
// album.
// This field is based on the scopes granted and permissions of the
// album. If
// the scopes are changed or permissions of the album are changed, this
// field
// will be updated.
IsWriteable bool `json:"isWriteable,omitempty"`
// ProductUrl: [Output only] Google Photos URL for the album. The user
// needs to be signed
// in to their Google Photos account to access this link.
ProductUrl string `json:"productUrl,omitempty"`
// ShareInfo: [Output only] Information related to shared albums.
// This field is only populated if the album is a shared album,
// the
// developer created the album and the user has granted
// photoslibrary.sharing
// scope.
ShareInfo *ShareInfo `json:"shareInfo,omitempty"`
// Title: Name of the album displayed to the user in their Google Photos
// account.
// This string should not be more than 500 characters.
Title string `json:"title,omitempty"`
// TotalMediaItems: [Output only] The number of media items in the album
TotalMediaItems int64 `json:"mediaItemsCount,omitempty,string"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "CoverPhotoBaseUrl")
// to unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "CoverPhotoBaseUrl") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *Album) MarshalJSON() ([]byte, error) {
type NoMethod Album
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AlbumPosition: Specifies a position in an album.
type AlbumPosition struct {
// Position: Type of position, for a media or enrichment item.
//
// Possible values:
// "POSITION_TYPE_UNSPECIFIED" - Default value if this enum is not
// set.
// "FIRST_IN_ALBUM" - At the beginning of the album.
// "LAST_IN_ALBUM" - At the end of the album.
// "AFTER_MEDIA_ITEM" - After a media item.
// "AFTER_ENRICHMENT_ITEM" - After an enrichment item.
Position string `json:"position,omitempty"`
// RelativeEnrichmentItemId: The enrichment item to which the position
// is relative to.
// Only used when position type is AFTER_ENRICHMENT_ITEM.
RelativeEnrichmentItemId string `json:"relativeEnrichmentItemId,omitempty"`
// RelativeMediaItemId: The media item to which the position is relative
// to.
// Only used when position type is AFTER_MEDIA_ITEM.
RelativeMediaItemId string `json:"relativeMediaItemId,omitempty"`
// ForceSendFields is a list of field names (e.g. "Position") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Position") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *AlbumPosition) MarshalJSON() ([]byte, error) {
type NoMethod AlbumPosition
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BatchCreateMediaItemsRequest: Request to create one or more media
// items in a user's Google Photos library.
// If an <code>albumid</code> is specified, the media items are also
// added to
// that album. <code>albumPosition</code> is optional and can only be
// specified
// if an <code>albumId</code> is set.
type BatchCreateMediaItemsRequest struct {
// AlbumId: Identifier of the album where the media item(s) will be
// added. They will
// also be added to the user's library. This is an optional field.
AlbumId string `json:"albumId,omitempty"`
// AlbumPosition: Position in the album where the media item(s) will be
// added. If not
// specified, the media item(s) will be added to the end of the album
// (as per
// the default value which is LAST_IN_ALBUM).
// The request will fail if this field is present but no album_id
// is
// specified.
AlbumPosition *AlbumPosition `json:"albumPosition,omitempty"`
// NewMediaItems: List of media items to be created.
NewMediaItems []*NewMediaItem `json:"newMediaItems,omitempty"`
// ForceSendFields is a list of field names (e.g. "AlbumId") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AlbumId") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *BatchCreateMediaItemsRequest) MarshalJSON() ([]byte, error) {
type NoMethod BatchCreateMediaItemsRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type BatchCreateMediaItemsResponse struct {
// NewMediaItemResults: [Output only] List of media items which were
// created.
NewMediaItemResults []*NewMediaItemResult `json:"newMediaItemResults,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "NewMediaItemResults")
// to unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "NewMediaItemResults") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *BatchCreateMediaItemsResponse) MarshalJSON() ([]byte, error) {
type NoMethod BatchCreateMediaItemsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AlbumBatchAddMediaItemsRequest: Request to add one or more existing media
// items to an existing Album.
type AlbumBatchAddMediaItemsRequest struct {
// MediaItemIds: List of media items to be add to the album above.
MediaItemIds []string `json:"mediaItemIds,omitempty"`
// ForceSendFields is a list of field names (e.g. "AlbumId") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AlbumId") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *AlbumBatchAddMediaItemsRequest) MarshalJSON() ([]byte, error) {
type NoMethod AlbumBatchAddMediaItemsRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type AlbumBatchAddMediaItemsResponse struct {
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "NewMediaItemResults")
// to unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "NewMediaItemResults") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *AlbumBatchAddMediaItemsResponse) MarshalJSON() ([]byte, error) {
type NoMethod AlbumBatchAddMediaItemsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ContentFilter: This filter is used to define which results to return
// based on the contents
// of the media item.
//
// It is possible to specify a list of categories to include, and/or a
// list of
// categories to exclude. Within each list, the categories are combined
// with an
// OR. For example, if the content filter looks like:
//
// included_content_categories: [c1, c2, c3]
//
// It would get media items that contain (c1 OR c2 OR c3).
//
// And if the content filter looks like:
//
// excluded_content_categories: [c1, c2, c3]
//
// It would get media items that contain NOT (c1 OR c2 OR c3).
// You can also include some categories while excluding others, as in
// this
// proto:
//
// included_content_categories: [c1, c2],
// excluded_content_category: [c3, c4]
//
// It would get media items that contain (c1 OR c2) AND NOT (c3 OR
// c4).
//
// A category that appears in <code>includedContentategories</code> must
// not
// appear in <code>excludedContentCategories</code>.
type ContentFilter struct {
// ExcludedContentCategories: The set of categories that must NOT be
// present in the media items in the
// result. The items in the set are ORed. There is a maximum of
// 10
// excludedContentCategories per request.
//
// Possible values:
// "NONE" - Default content category. This category is ignored if any
// other category is
// also listed.
// "LANDSCAPES" - Media items containing landscapes.
// "RECEIPTS" - Media items containing receipts.
// "CITYSCAPES" - Media items containing cityscapes.
// "LANDMARKS" - Media items containing landmarks.
// "SELFIES" - Media items that are selfies.
// "PEOPLE" - Media items containing people.
// "PETS" - Media items containing pets.
// "WEDDINGS" - Media items from weddings.
// "BIRTHDAYS" - Media items from birthdays.
// "DOCUMENTS" - Media items containing documents.
// "TRAVEL" - Media items taken during travel.
// "ANIMALS" - Media items containing animals.
// "FOOD" - Media items containing food.
// "SPORT" - Media items from sporting events.
// "NIGHT" - Media items taken at night.
// "PERFORMANCES" - Media items from performances.
// "WHITEBOARDS" - Media items containing whiteboards.
// "SCREENSHOTS" - Media items that are screenshots.
// "UTILITY" - Media items that are considered to be 'utility.
// Including, but not limited
// to documents, screenshots, whiteboards etc.
ExcludedContentCategories []string `json:"excludedContentCategories,omitempty"`
// IncludedContentCategories: The set of categories that must be present
// in the media items in the
// result. The items in the set are ORed. There is a maximum of
// 10
// includedContentCategories per request.
//
// Possible values:
// "NONE" - Default content category. This category is ignored if any
// other category is
// also listed.
// "LANDSCAPES" - Media items containing landscapes.
// "RECEIPTS" - Media items containing receipts.
// "CITYSCAPES" - Media items containing cityscapes.
// "LANDMARKS" - Media items containing landmarks.
// "SELFIES" - Media items that are selfies.
// "PEOPLE" - Media items containing people.
// "PETS" - Media items containing pets.
// "WEDDINGS" - Media items from weddings.
// "BIRTHDAYS" - Media items from birthdays.
// "DOCUMENTS" - Media items containing documents.
// "TRAVEL" - Media items taken during travel.
// "ANIMALS" - Media items containing animals.
// "FOOD" - Media items containing food.
// "SPORT" - Media items from sporting events.
// "NIGHT" - Media items taken at night.
// "PERFORMANCES" - Media items from performances.
// "WHITEBOARDS" - Media items containing whiteboards.
// "SCREENSHOTS" - Media items that are screenshots.
// "UTILITY" - Media items that are considered to be 'utility.
// Including, but not limited
// to documents, screenshots, whiteboards etc.
IncludedContentCategories []string `json:"includedContentCategories,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "ExcludedContentCategories") to unconditionally include in API
// requests. By default, fields with empty values are omitted from API
// requests. However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g.
// "ExcludedContentCategories") to include in API requests with the JSON
// null value. By default, fields with empty values are omitted from API
// requests. However, any field with an empty value appearing in
// NullFields will be sent to the server as null. It is an error if a
// field in this list has a non-empty value. This may be used to include
// null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ContentFilter) MarshalJSON() ([]byte, error) {
type NoMethod ContentFilter
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ContributorInfo: Information about a user who contributed the media
// item. Note that this
// information is only included if the album containing the media item
// is
// shared, was created by you and you have the sharing scope.
type ContributorInfo struct {
// DisplayName: Display name of the contributor.
DisplayName string `json:"displayName,omitempty"`
// ProfilePictureBaseUrl: URL to the profile picture of the contributor.
ProfilePictureBaseUrl string `json:"profilePictureBaseUrl,omitempty"`
// ForceSendFields is a list of field names (e.g. "DisplayName") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DisplayName") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ContributorInfo) MarshalJSON() ([]byte, error) {
type NoMethod ContributorInfo
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CreateAlbumRequest: Request to create an album in Google Photos.
type CreateAlbumRequest struct {
// Album: The album to be created.
Album *Album `json:"album,omitempty"`
// ForceSendFields is a list of field names (e.g. "Album") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Album") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *CreateAlbumRequest) MarshalJSON() ([]byte, error) {
type NoMethod CreateAlbumRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Date: Represents a whole calendar date. The day may be 0 to represent
// a year and month where the day is not significant, e.g. a whole
// calendar month. The month may be 0 to represent a a day and a year
// where the month is not signficant, e.g. when you want to specify the
// same day in every month of a year or a specific year. The year may be
// 0 to represent a month and day independent of year, e.g. anniversary
// date.
type Date struct {
// Day: Day of month. Must be from 1 to 31 and valid for the year and
// month, or 0
// if specifying a year/month where the day is not significant.
Day int64 `json:"day,omitempty"`
// Month: Month of year. Must be from 1 to 12, or 0 if specifying a date
// without a
// month.
Month int64 `json:"month,omitempty"`
// Year: Year of date. Must be from 1 to 9999, or 0 if specifying a date
// without
// a year.
Year int64 `json:"year,omitempty"`
// ForceSendFields is a list of field names (e.g. "Day") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Day") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Date) MarshalJSON() ([]byte, error) {
type NoMethod Date
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// DateFilter: This filter defines the allowed dates or date ranges for
// the media returned.
// It is possible to pick a set of specific dates and a set of date
// ranges.
type DateFilter struct {
// Dates: List of dates that the media items must have been created on.
// There is a
// maximum of 5 dates that can be included per request.
Dates []*Date `json:"dates,omitempty"`
// Ranges: List of dates ranges that the media items must have been
// created in. There
// is a maximum of 5 dates ranges that can be included per request.
Ranges []*DateRange `json:"ranges,omitempty"`
// ForceSendFields is a list of field names (e.g. "Dates") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Dates") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *DateFilter) MarshalJSON() ([]byte, error) {
type NoMethod DateFilter
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// DateRange: Defines a range of dates. Both dates must be of the same
// format (see Date
// definition for more).
type DateRange struct {
// EndDate: The end date (included as part of the range) in the same
// format as the
// start date.
EndDate *Date `json:"endDate,omitempty"`
// StartDate: The start date (included as part of the range) in one of
// the formats
// described.
StartDate *Date `json:"startDate,omitempty"`
// ForceSendFields is a list of field names (e.g. "EndDate") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "EndDate") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *DateRange) MarshalJSON() ([]byte, error) {
type NoMethod DateRange
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// EnrichmentItem: An enrichment item.
type EnrichmentItem struct {
// Id: Identifier of the enrichment item.
Id string `json:"id,omitempty"`
// ForceSendFields is a list of field names (e.g. "Id") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Id") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *EnrichmentItem) MarshalJSON() ([]byte, error) {
type NoMethod EnrichmentItem
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Filters: Filters that can be applied to a media item search.
// If multiple filter options are specified, they are treated as AND
// with each
// other.
type Filters struct {
// ContentFilter: Filters the media items based on their content.
ContentFilter *ContentFilter `json:"contentFilter,omitempty"`
// DateFilter: Filters the media items based on their creation date.
DateFilter *DateFilter `json:"dateFilter,omitempty"`
// IncludeArchivedMedia: If set, the results will include media items
// that the user has archived.
// Defaults to false (archived media items are not included).
IncludeArchivedMedia bool `json:"includeArchivedMedia,omitempty"`
// MediaTypeFilter: Filters the media items based on the type of media.
MediaTypeFilter *MediaTypeFilter `json:"mediaTypeFilter,omitempty"`
// ForceSendFields is a list of field names (e.g. "ContentFilter") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ContentFilter") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Filters) MarshalJSON() ([]byte, error) {
type NoMethod Filters
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// JoinSharedAlbumRequest: Request to join a shared album on behalf of
// the user. This uses a shareToken
// which can be acquired via the shareAlbum or listSharedAlbums calls.
type JoinSharedAlbumRequest struct {
// ShareToken: Token indicating the shared album to join on behalf of
// the user.
ShareToken string `json:"shareToken,omitempty"`
// ForceSendFields is a list of field names (e.g. "ShareToken") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ShareToken") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *JoinSharedAlbumRequest) MarshalJSON() ([]byte, error) {
type NoMethod JoinSharedAlbumRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// JoinSharedAlbumResponse: Response to successfully joining the shared
// album on behalf of the user.
type JoinSharedAlbumResponse struct {
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
}
// LatLng: An object representing a latitude/longitude pair. This is
// expressed as a pair
// of doubles representing degrees latitude and degrees longitude.
// Unless
// specified otherwise, this must conform to the
// <a
// href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
// st
// andard</a>. Values must be within normalized ranges.
type LatLng struct {
// Latitude: The latitude in degrees. It must be in the range [-90.0,
// +90.0].
Latitude float64 `json:"latitude,omitempty"`
// Longitude: The longitude in degrees. It must be in the range [-180.0,
// +180.0].
Longitude float64 `json:"longitude,omitempty"`
// ForceSendFields is a list of field names (e.g. "Latitude") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Latitude") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *LatLng) MarshalJSON() ([]byte, error) {
type NoMethod LatLng
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *LatLng) UnmarshalJSON(data []byte) error {
type NoMethod LatLng
var s1 struct {
Latitude gensupport.JSONFloat64 `json:"latitude"`
Longitude gensupport.JSONFloat64 `json:"longitude"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.Latitude = float64(s1.Latitude)
s.Longitude = float64(s1.Longitude)
return nil
}
type ListAlbumsResponse struct {
// Albums: [Output only] List of albums that were created by the user.
Albums []*Album `json:"albums,omitempty"`
// NextPageToken: [Output only] Token to use to get the next set of
// albums. Populated if
// there are more albums to retrieve for this request.
NextPageToken string `json:"nextPageToken,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Albums") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Albums") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ListAlbumsResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListAlbumsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type ListSharedAlbumsResponse struct {
// NextPageToken: [Output only] Token to use to get the next set of
// shared albums. Populated
// if there are more shared albums to retrieve for this request.
NextPageToken string `json:"nextPageToken,omitempty"`
// SharedAlbums: [Output only] List of shared albums that were
// requested.
SharedAlbums []*Album `json:"sharedAlbums,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "NextPageToken") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "NextPageToken") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}