photoslibrary

package
v0.0.0-...-a08bad1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2019 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

Package photoslibrary provides access to the Photos Library API.

See https://developers.google.com/photos/

Usage example:

import "google.golang.org/api/photoslibrary/v1"
...
photoslibraryService, err := photoslibrary.New(oauthHttpClient)

Index

Constants

View Source
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"
)

OAuth2 scopes used by this API.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddEnrichmentToAlbumRequest

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:"-"`
}

AddEnrichmentToAlbumRequest: Request to add an enrichment to a specific album at a specific position.

func (*AddEnrichmentToAlbumRequest) MarshalJSON

func (s *AddEnrichmentToAlbumRequest) MarshalJSON() ([]byte, error)

type AddEnrichmentToAlbumResponse

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 (*AddEnrichmentToAlbumResponse) MarshalJSON

func (s *AddEnrichmentToAlbumResponse) MarshalJSON() ([]byte, error)

type Album

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:"totalMediaItems,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:"-"`
}

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.

func (*Album) MarshalJSON

func (s *Album) MarshalJSON() ([]byte, error)

type AlbumPosition

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:"-"`
}

AlbumPosition: Specifies a position in an album.

func (*AlbumPosition) MarshalJSON

func (s *AlbumPosition) MarshalJSON() ([]byte, error)

type AlbumsAddEnrichmentCall

type AlbumsAddEnrichmentCall struct {
	// contains filtered or unexported fields
}

func (*AlbumsAddEnrichmentCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*AlbumsAddEnrichmentCall) Do

Do executes the "photoslibrary.albums.addEnrichment" call. Exactly one of *AddEnrichmentToAlbumResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *AddEnrichmentToAlbumResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*AlbumsAddEnrichmentCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*AlbumsAddEnrichmentCall) Header

func (c *AlbumsAddEnrichmentCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type AlbumsCreateCall

type AlbumsCreateCall struct {
	// contains filtered or unexported fields
}

func (*AlbumsCreateCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*AlbumsCreateCall) Do

func (c *AlbumsCreateCall) Do(opts ...googleapi.CallOption) (*Album, error)

Do executes the "photoslibrary.albums.create" call. Exactly one of *Album or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Album.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*AlbumsCreateCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*AlbumsCreateCall) Header

func (c *AlbumsCreateCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type AlbumsGetCall

type AlbumsGetCall struct {
	// contains filtered or unexported fields
}

func (*AlbumsGetCall) Context

func (c *AlbumsGetCall) Context(ctx context.Context) *AlbumsGetCall

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*AlbumsGetCall) Do

func (c *AlbumsGetCall) Do(opts ...googleapi.CallOption) (*Album, error)

Do executes the "photoslibrary.albums.get" call. Exactly one of *Album or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Album.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*AlbumsGetCall) Fields

func (c *AlbumsGetCall) Fields(s ...googleapi.Field) *AlbumsGetCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*AlbumsGetCall) Header

func (c *AlbumsGetCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*AlbumsGetCall) IfNoneMatch

func (c *AlbumsGetCall) IfNoneMatch(entityTag string) *AlbumsGetCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

type AlbumsListCall

type AlbumsListCall struct {
	// contains filtered or unexported fields
}

func (*AlbumsListCall) Context

func (c *AlbumsListCall) Context(ctx context.Context) *AlbumsListCall

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*AlbumsListCall) Do

Do executes the "photoslibrary.albums.list" call. Exactly one of *ListAlbumsResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *ListAlbumsResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*AlbumsListCall) Fields

func (c *AlbumsListCall) Fields(s ...googleapi.Field) *AlbumsListCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*AlbumsListCall) Header

func (c *AlbumsListCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*AlbumsListCall) IfNoneMatch

func (c *AlbumsListCall) IfNoneMatch(entityTag string) *AlbumsListCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

func (*AlbumsListCall) PageSize

func (c *AlbumsListCall) PageSize(pageSize int64) *AlbumsListCall

PageSize sets the optional parameter "pageSize": Maximum number of albums to return in the response. The default number of albums to return at a time is 20. The maximum page size is 50.

func (*AlbumsListCall) PageToken

func (c *AlbumsListCall) PageToken(pageToken string) *AlbumsListCall

PageToken sets the optional parameter "pageToken": A continuation token to get the next page of the results. Adding this to the request will return the rows after the pageToken. The pageToken should be the value returned in the nextPageToken parameter in the response to the listAlbums request.

func (*AlbumsListCall) Pages

func (c *AlbumsListCall) Pages(ctx context.Context, f func(*ListAlbumsResponse) error) error

Pages invokes f for each page of results. A non-nil error returned from f will halt the iteration. The provided context supersedes any context provided to the Context method.

type AlbumsService

type AlbumsService struct {
	// contains filtered or unexported fields
}

func NewAlbumsService

func NewAlbumsService(s *Service) *AlbumsService

func (*AlbumsService) AddEnrichment

func (r *AlbumsService) AddEnrichment(albumId string, addenrichmenttoalbumrequest *AddEnrichmentToAlbumRequest) *AlbumsAddEnrichmentCall

AddEnrichment: Adds an enrichment to a specified position in a defined album.

func (*AlbumsService) Create

func (r *AlbumsService) Create(createalbumrequest *CreateAlbumRequest) *AlbumsCreateCall

Create: Creates an album in a user's Google Photos library.

func (*AlbumsService) Get

func (r *AlbumsService) Get(albumId string) *AlbumsGetCall

Get: Returns the album specified by the given album id.

func (*AlbumsService) List

func (r *AlbumsService) List() *AlbumsListCall

List: Lists all albums shown to a user in the 'Albums' tab of the Google Photos app.

func (*AlbumsService) Share

func (r *AlbumsService) Share(albumId string, sharealbumrequest *ShareAlbumRequest) *AlbumsShareCall

Share: Marks an album as 'shared' and accessible to other users. This action can only be performed on albums which were created by the developer via the API.

type AlbumsShareCall

type AlbumsShareCall struct {
	// contains filtered or unexported fields
}

func (*AlbumsShareCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*AlbumsShareCall) Do

Do executes the "photoslibrary.albums.share" call. Exactly one of *ShareAlbumResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *ShareAlbumResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*AlbumsShareCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*AlbumsShareCall) Header

func (c *AlbumsShareCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type BatchCreateMediaItemsRequest

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:"-"`
}

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.

func (*BatchCreateMediaItemsRequest) MarshalJSON

func (s *BatchCreateMediaItemsRequest) MarshalJSON() ([]byte, error)

type BatchCreateMediaItemsResponse

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 (*BatchCreateMediaItemsResponse) MarshalJSON

func (s *BatchCreateMediaItemsResponse) MarshalJSON() ([]byte, error)

type ContentFilter

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:"-"`
}

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>.

func (*ContentFilter) MarshalJSON

func (s *ContentFilter) MarshalJSON() ([]byte, error)

type ContributorInfo

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:"-"`
}

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.

func (*ContributorInfo) MarshalJSON

func (s *ContributorInfo) MarshalJSON() ([]byte, error)

type CreateAlbumRequest

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:"-"`
}

CreateAlbumRequest: Request to create an album in Google Photos.

func (*CreateAlbumRequest) MarshalJSON

func (s *CreateAlbumRequest) MarshalJSON() ([]byte, error)

type 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:"-"`
}

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.

func (*Date) MarshalJSON

func (s *Date) MarshalJSON() ([]byte, error)

type DateFilter

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:"-"`
}

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.

func (*DateFilter) MarshalJSON

func (s *DateFilter) MarshalJSON() ([]byte, error)

type DateRange

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:"-"`
}

DateRange: Defines a range of dates. Both dates must be of the same format (see Date definition for more).

func (*DateRange) MarshalJSON

func (s *DateRange) MarshalJSON() ([]byte, error)

type EnrichmentItem

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:"-"`
}

EnrichmentItem: An enrichment item.

func (*EnrichmentItem) MarshalJSON

func (s *EnrichmentItem) MarshalJSON() ([]byte, error)

type Filters

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:"-"`
}

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.

func (*Filters) MarshalJSON

func (s *Filters) MarshalJSON() ([]byte, error)

type JoinSharedAlbumRequest

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:"-"`
}

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.

func (*JoinSharedAlbumRequest) MarshalJSON

func (s *JoinSharedAlbumRequest) MarshalJSON() ([]byte, error)

type JoinSharedAlbumResponse

type JoinSharedAlbumResponse struct {
	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`
}

JoinSharedAlbumResponse: Response to successfully joining the shared album on behalf of the user.

type LatLng

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:"-"`
}

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.

func (*LatLng) MarshalJSON

func (s *LatLng) MarshalJSON() ([]byte, error)

func (*LatLng) UnmarshalJSON

func (s *LatLng) UnmarshalJSON(data []byte) error

type ListAlbumsResponse

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 (*ListAlbumsResponse) MarshalJSON

func (s *ListAlbumsResponse) MarshalJSON() ([]byte, error)

type ListSharedAlbumsResponse

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:"-"`
}

func (*ListSharedAlbumsResponse) MarshalJSON

func (s *ListSharedAlbumsResponse) MarshalJSON() ([]byte, error)

type Location

type Location struct {
	// Latlng: Position of the location on the map.
	Latlng *LatLng `json:"latlng,omitempty"`

	// LocationName: Name of the location to be displayed.
	LocationName string `json:"locationName,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Latlng") 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. "Latlng") 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:"-"`
}

Location: Represents a physical location.

func (*Location) MarshalJSON

func (s *Location) MarshalJSON() ([]byte, error)

type LocationEnrichment

type LocationEnrichment struct {
	// Location: Location for this enrichment item.
	Location *Location `json:"location,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Location") 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. "Location") 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:"-"`
}

LocationEnrichment: An enrichment containing a single location.

func (*LocationEnrichment) MarshalJSON

func (s *LocationEnrichment) MarshalJSON() ([]byte, error)

type MapEnrichment

type MapEnrichment struct {
	// Destination: Destination location for this enrichemt item.
	Destination *Location `json:"destination,omitempty"`

	// Origin: Origin location for this enrichment item.
	Origin *Location `json:"origin,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Destination") 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. "Destination") 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:"-"`
}

MapEnrichment: An enrichment containing a map, showing origin and destination locations.

func (*MapEnrichment) MarshalJSON

func (s *MapEnrichment) MarshalJSON() ([]byte, error)

type MediaItem

type MediaItem struct {
	// BaseUrl: A URL to the media item's bytes. This should not be used as
	// is.
	// For example, '=w2048-h1024' will set the dimensions of a media item
	// of type
	// photo to have a width of 2048 px and height of 1024 px.
	BaseUrl string `json:"baseUrl,omitempty"`

	// ContributorInfo: Information about the user who created this media
	// item.
	ContributorInfo *ContributorInfo `json:"contributorInfo,omitempty"`

	// Description: Description of the media item. This is shown to the user
	// in the item's
	// info section in the Google Photos app.
	Description string `json:"description,omitempty"`

	// Id: Identifier for the media item. This is a persistent identifier
	// that can be
	// used between sessions to identify this media item.
	Id string `json:"id,omitempty"`

	// MediaMetadata: Metadata related to the media item, for example the
	// height, width or
	// creation time.
	MediaMetadata *MediaMetadata `json:"mediaMetadata,omitempty"`

	// MimeType: MIME type of the media item.
	MimeType string `json:"mimeType,omitempty"`

	// ProductUrl: Google Photos URL for the media item. This link will only
	// be available to
	// the user if they're signed in.
	ProductUrl string `json:"productUrl,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "BaseUrl") 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. "BaseUrl") 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:"-"`
}

MediaItem: Representation of a media item (e.g. photo, video etc.) in Google Photos.

func (*MediaItem) MarshalJSON

func (s *MediaItem) MarshalJSON() ([]byte, error)

type MediaItemsBatchCreateCall

type MediaItemsBatchCreateCall struct {
	// contains filtered or unexported fields
}

func (*MediaItemsBatchCreateCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*MediaItemsBatchCreateCall) Do

Do executes the "photoslibrary.mediaItems.batchCreate" call. Exactly one of *BatchCreateMediaItemsResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *BatchCreateMediaItemsResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*MediaItemsBatchCreateCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*MediaItemsBatchCreateCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type MediaItemsGetCall

type MediaItemsGetCall struct {
	// contains filtered or unexported fields
}

func (*MediaItemsGetCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*MediaItemsGetCall) Do

Do executes the "photoslibrary.mediaItems.get" call. Exactly one of *MediaItem or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *MediaItem.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*MediaItemsGetCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*MediaItemsGetCall) Header

func (c *MediaItemsGetCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*MediaItemsGetCall) IfNoneMatch

func (c *MediaItemsGetCall) IfNoneMatch(entityTag string) *MediaItemsGetCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

type MediaItemsSearchCall

type MediaItemsSearchCall struct {
	// contains filtered or unexported fields
}

func (*MediaItemsSearchCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*MediaItemsSearchCall) Do

Do executes the "photoslibrary.mediaItems.search" call. Exactly one of *SearchMediaItemsResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *SearchMediaItemsResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*MediaItemsSearchCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*MediaItemsSearchCall) Header

func (c *MediaItemsSearchCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*MediaItemsSearchCall) Pages

Pages invokes f for each page of results. A non-nil error returned from f will halt the iteration. The provided context supersedes any context provided to the Context method.

type MediaItemsService

type MediaItemsService struct {
	// contains filtered or unexported fields
}

func NewMediaItemsService

func NewMediaItemsService(s *Service) *MediaItemsService

func (*MediaItemsService) BatchCreate

func (r *MediaItemsService) BatchCreate(batchcreatemediaitemsrequest *BatchCreateMediaItemsRequest) *MediaItemsBatchCreateCall

BatchCreate: Creates one or more media items in a user's Google Photos library. If an album id is specified, the media item(s) are also added to the album. By default the media item(s) will be added to the end of the library or album.

If an album id and position are both defined, then the media items will be added to the album at the specified position.

If multiple media items are given, they will be inserted at the specified position.

func (*MediaItemsService) Get

func (r *MediaItemsService) Get(mediaItemId string) *MediaItemsGetCall

Get: Returns the media item specified based on a given media item id.

func (*MediaItemsService) Search

func (r *MediaItemsService) Search(searchmediaitemsrequest *SearchMediaItemsRequest) *MediaItemsSearchCall

Search: Searches for media items in a user's Google Photos library. If no filters are set, then all media items in the user's library will be returned.

If an album is set, all media items in the specified album will be returned.

If filters are specified, anything that matches the filters from the user's library will be listed.

If an album and filters are set, then this will result in an error.

type MediaMetadata

type MediaMetadata struct {
	// CreationTime: Time when the media item was first created (not when it
	// was uploaded to
	// Google Photos).
	CreationTime string `json:"creationTime,omitempty"`

	// Height: Original height (in pixels) of the media item.
	Height int64 `json:"height,omitempty,string"`

	// Photo: Metadata for a photo media type.
	Photo *Photo `json:"photo,omitempty"`

	// Video: Metadata for a video media type.
	Video *Video `json:"video,omitempty"`

	// Width: Original width (in pixels) of the media item.
	Width int64 `json:"width,omitempty,string"`

	// ForceSendFields is a list of field names (e.g. "CreationTime") 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. "CreationTime") 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:"-"`
}

MediaMetadata: Metadata for a media item.

func (*MediaMetadata) MarshalJSON

func (s *MediaMetadata) MarshalJSON() ([]byte, error)

type MediaTypeFilter

type MediaTypeFilter struct {
	// MediaTypes: The types of media items to be included. This field
	// should only be
	// populated with one media type, multiple media types will result in an
	// error
	// response.
	//
	// Possible values:
	//   "ALL_MEDIA" - Treated as if no filters are applied. All media types
	// are included.
	//   "VIDEO" - All media items that are considered videos.
	// This also includes movies the user has created using the Google
	// Photos app.
	//   "PHOTO" - All media items that are considered photos. This includes
	// .bmp, .gif, .ico,
	// .jpg (and other spellings), .tiff, .webp as well as special photo
	// types
	// such as iOS live photos, Android motion photos, panoramas,
	// photospheres.
	MediaTypes []string `json:"mediaTypes,omitempty"`

	// ForceSendFields is a list of field names (e.g. "MediaTypes") 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. "MediaTypes") 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:"-"`
}

MediaTypeFilter: This filter defines the type of media items to be returned, for example videos or photos. All the specified media types are treated as an OR with each other.

func (*MediaTypeFilter) MarshalJSON

func (s *MediaTypeFilter) MarshalJSON() ([]byte, error)

type NewEnrichmentItem

type NewEnrichmentItem struct {
	// LocationEnrichment: Location to be added to the album.
	LocationEnrichment *LocationEnrichment `json:"locationEnrichment,omitempty"`

	// MapEnrichment: Map to be added to the album.
	MapEnrichment *MapEnrichment `json:"mapEnrichment,omitempty"`

	// TextEnrichment: Text to be added to the album.
	TextEnrichment *TextEnrichment `json:"textEnrichment,omitempty"`

	// ForceSendFields is a list of field names (e.g. "LocationEnrichment")
	// 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. "LocationEnrichment") 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:"-"`
}

NewEnrichmentItem: A new enrichment item to be added to an album, used by the AddEnrichmentToAlbum call.

func (*NewEnrichmentItem) MarshalJSON

func (s *NewEnrichmentItem) MarshalJSON() ([]byte, error)

type NewMediaItem

type NewMediaItem struct {
	// Description: Description of the media item. This will be shown to the
	// user in the item's
	// info section in the Google Photos app.
	// This string should not be more than 1000 characters.
	Description string `json:"description,omitempty"`

	// SimpleMediaItem: A new media item that has been uploaded via the
	// included uploadToken.
	SimpleMediaItem *SimpleMediaItem `json:"simpleMediaItem,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Description") 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. "Description") 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:"-"`
}

NewMediaItem: New media item that will be created in a user's Google Photos account.

func (*NewMediaItem) MarshalJSON

func (s *NewMediaItem) MarshalJSON() ([]byte, error)

type NewMediaItemResult

type NewMediaItemResult struct {
	// MediaItem: Media item created with the upload token. It is populated
	// if no errors
	// occurred and the media item was created successfully.
	MediaItem *MediaItem `json:"mediaItem,omitempty"`

	// Status: If an error occurred during the creation of this media item,
	// this field
	// will be populated with information related to the error. Details of
	// this
	// status can be found down below.
	Status *Status `json:"status,omitempty"`

	// UploadToken: The upload token used to create this new media item.
	UploadToken string `json:"uploadToken,omitempty"`

	// ForceSendFields is a list of field names (e.g. "MediaItem") 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. "MediaItem") 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:"-"`
}

NewMediaItemResult: Result of creating a new media item.

func (*NewMediaItemResult) MarshalJSON

func (s *NewMediaItemResult) MarshalJSON() ([]byte, error)

type Photo

type Photo struct {
	// ApertureFNumber: Apeture f number of the photo.
	ApertureFNumber float64 `json:"apertureFNumber,omitempty"`

	// CameraMake: Brand of the camera which took the photo.
	CameraMake string `json:"cameraMake,omitempty"`

	// CameraModel: Model of the camera which took the photo.
	CameraModel string `json:"cameraModel,omitempty"`

	// ExposureTime: Exposure time of the photo.
	ExposureTime string `json:"exposureTime,omitempty"`

	// FocalLength: Focal length of the photo.
	FocalLength float64 `json:"focalLength,omitempty"`

	// IsoEquivalent: ISO of the photo.
	IsoEquivalent int64 `json:"isoEquivalent,omitempty"`

	// ForceSendFields is a list of field names (e.g. "ApertureFNumber") 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. "ApertureFNumber") 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:"-"`
}

Photo: Metadata that is specific to a photo, for example, ISO, focal length and exposure time. Some of these fields may be null or not included.

func (*Photo) MarshalJSON

func (s *Photo) MarshalJSON() ([]byte, error)

func (*Photo) UnmarshalJSON

func (s *Photo) UnmarshalJSON(data []byte) error

type SearchMediaItemsRequest

type SearchMediaItemsRequest struct {
	// AlbumId: Identifier of an album. If populated will list all media
	// items in
	// specified album. Cannot be set in conjunction with any filters.
	AlbumId string `json:"albumId,omitempty"`

	// Filters: Filters to apply to the request. Cannot be set in conjuction
	// with an
	// albumId.
	Filters *Filters `json:"filters,omitempty"`

	// PageSize: Maximum number of media items to return in the response.
	// The default number
	// of media items to return at a time is 100. The maximum page size is
	// 500.
	PageSize int64 `json:"pageSize,omitempty"`

	// PageToken: A continuation token to get the next page of the results.
	// Adding this to
	// the request will return the rows after the pageToken. The pageToken
	// should
	// be the value returned in the nextPageToken parameter in the response
	// to the
	// searchMediaItems request.
	PageToken string `json:"pageToken,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:"-"`
}

SearchMediaItemsRequest: Request to search for media items in a user's library.

If the album id is specified, this call will return the list of media items in the album. If neither filters nor album id are specified, this call will return all media items in a user's Google Photos library.

If filters are specified, this call will return all media items in the user's library which fulfills the criteria based upon the filters.

Filters and album id must not both be set, as this will result in an invalid request.

func (*SearchMediaItemsRequest) MarshalJSON

func (s *SearchMediaItemsRequest) MarshalJSON() ([]byte, error)

type SearchMediaItemsResponse

type SearchMediaItemsResponse struct {
	// MediaItems: [Output only] List of media items that match the search
	// parameters.
	MediaItems []*MediaItem `json:"mediaItems,omitempty"`

	// NextPageToken: [Output only] Token to use to get the next set of
	// media items. Its presence
	// is the only reliable indicator of more media items being available in
	// the
	// next 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. "MediaItems") 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. "MediaItems") 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 (*SearchMediaItemsResponse) MarshalJSON

func (s *SearchMediaItemsResponse) MarshalJSON() ([]byte, error)

type Service

type Service struct {
	BasePath  string // API endpoint base URL
	UserAgent string // optional additional User-Agent fragment

	Albums *AlbumsService

	MediaItems *MediaItemsService

	SharedAlbums *SharedAlbumsService
	// contains filtered or unexported fields
}

func New

func New(client *http.Client) (*Service, error)

type ShareAlbumRequest

type ShareAlbumRequest struct {
	// SharedAlbumOptions: Options to be set when converting the album to a
	// shared album.
	SharedAlbumOptions *SharedAlbumOptions `json:"sharedAlbumOptions,omitempty"`

	// ForceSendFields is a list of field names (e.g. "SharedAlbumOptions")
	// 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. "SharedAlbumOptions") 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:"-"`
}

ShareAlbumRequest: Request to make an album shared in Google Photos.

func (*ShareAlbumRequest) MarshalJSON

func (s *ShareAlbumRequest) MarshalJSON() ([]byte, error)

type ShareAlbumResponse

type ShareAlbumResponse struct {
	// ShareInfo: [Output only] Information about the shared album.
	ShareInfo *ShareInfo `json:"shareInfo,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "ShareInfo") 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. "ShareInfo") 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 (*ShareAlbumResponse) MarshalJSON

func (s *ShareAlbumResponse) MarshalJSON() ([]byte, error)

type ShareInfo

type ShareInfo struct {
	// ShareToken: A token which can be used to join this shared album on
	// behalf of other
	// users via the API.
	ShareToken string `json:"shareToken,omitempty"`

	// ShareableUrl: A link to the album that's now shared on the Google
	// Photos website and app.
	// Anyone with the link can access this shared album and see all of the
	// items
	// present in the album.
	ShareableUrl string `json:"shareableUrl,omitempty"`

	// SharedAlbumOptions: Options set for the shared album.
	SharedAlbumOptions *SharedAlbumOptions `json:"sharedAlbumOptions,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:"-"`
}

ShareInfo: Information about albums that are shared. Note that this information is only included if the album was created by you and you have the sharing scope.

func (*ShareInfo) MarshalJSON

func (s *ShareInfo) MarshalJSON() ([]byte, error)

type SharedAlbumOptions

type SharedAlbumOptions struct {
	// IsCollaborative: True if the shared album allows collaborators (users
	// who have joined
	// the album) to add media items to it. Defaults to false.
	IsCollaborative bool `json:"isCollaborative,omitempty"`

	// IsCommentable: True if the shared album allows the owner and the
	// collaborators (users
	// who have joined the album) to add comments to the album. Defaults to
	// false.
	IsCommentable bool `json:"isCommentable,omitempty"`

	// ForceSendFields is a list of field names (e.g. "IsCollaborative") 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. "IsCollaborative") 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:"-"`
}

SharedAlbumOptions: Options that control the sharing of an album.

func (*SharedAlbumOptions) MarshalJSON

func (s *SharedAlbumOptions) MarshalJSON() ([]byte, error)

type SharedAlbumsJoinCall

type SharedAlbumsJoinCall struct {
	// contains filtered or unexported fields
}

func (*SharedAlbumsJoinCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*SharedAlbumsJoinCall) Do

Do executes the "photoslibrary.sharedAlbums.join" call. Exactly one of *JoinSharedAlbumResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *JoinSharedAlbumResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*SharedAlbumsJoinCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*SharedAlbumsJoinCall) Header

func (c *SharedAlbumsJoinCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type SharedAlbumsListCall

type SharedAlbumsListCall struct {
	// contains filtered or unexported fields
}

func (*SharedAlbumsListCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*SharedAlbumsListCall) Do

Do executes the "photoslibrary.sharedAlbums.list" call. Exactly one of *ListSharedAlbumsResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *ListSharedAlbumsResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*SharedAlbumsListCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*SharedAlbumsListCall) Header

func (c *SharedAlbumsListCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*SharedAlbumsListCall) IfNoneMatch

func (c *SharedAlbumsListCall) IfNoneMatch(entityTag string) *SharedAlbumsListCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

func (*SharedAlbumsListCall) PageSize

func (c *SharedAlbumsListCall) PageSize(pageSize int64) *SharedAlbumsListCall

PageSize sets the optional parameter "pageSize": Maximum number of albums to return in the response. The default number of albums to return at a time is 20. The maximum page size is 50.

func (*SharedAlbumsListCall) PageToken

func (c *SharedAlbumsListCall) PageToken(pageToken string) *SharedAlbumsListCall

PageToken sets the optional parameter "pageToken": A continuation token to get the next page of the results. Adding this to the request will return the rows after the pageToken. The pageToken should be the value returned in the nextPageToken parameter in the response to the listSharedAlbums request.

func (*SharedAlbumsListCall) Pages

Pages invokes f for each page of results. A non-nil error returned from f will halt the iteration. The provided context supersedes any context provided to the Context method.

type SharedAlbumsService

type SharedAlbumsService struct {
	// contains filtered or unexported fields
}

func NewSharedAlbumsService

func NewSharedAlbumsService(s *Service) *SharedAlbumsService

func (*SharedAlbumsService) Join

func (r *SharedAlbumsService) Join(joinsharedalbumrequest *JoinSharedAlbumRequest) *SharedAlbumsJoinCall

Join: Joins a shared album on behalf of the Google Photos user.

func (*SharedAlbumsService) List

List: Lists all shared albums shown to a user in the 'Sharing' tab of the Google Photos app.

type SimpleMediaItem

type SimpleMediaItem struct {
	// UploadToken: Token identifying the media bytes which have been
	// uploaded to Google.
	UploadToken string `json:"uploadToken,omitempty"`

	// ForceSendFields is a list of field names (e.g. "UploadToken") 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. "UploadToken") 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:"-"`
}

SimpleMediaItem: A simple media item to be created in Google Photos via an upload token.

func (*SimpleMediaItem) MarshalJSON

func (s *SimpleMediaItem) MarshalJSON() ([]byte, error)

type Status

type Status struct {
	// Code: The status code, which should be an enum value of
	// google.rpc.Code.
	Code int64 `json:"code,omitempty"`

	// Details: A list of messages that carry the error details.  There is a
	// common set of
	// message types for APIs to use.
	Details []googleapi.RawMessage `json:"details,omitempty"`

	// Message: A developer-facing error message, which should be in
	// English. Any
	// user-facing error message should be localized and sent in
	// the
	// google.rpc.Status.details field, or localized by the client.
	Message string `json:"message,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Code") 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. "Code") 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:"-"`
}

Status: The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). The error model is designed to be:

- Simple to use and understand for most users - Flexible enough to meet unexpected needs

Overview

The `Status` message contains three pieces of data: error code, error message, and error details. The error code should be an enum value of google.rpc.Code, but it may accept additional error codes if needed. The error message should be a developer-facing English message that helps developers *understand* and *resolve* the error. If a localized user-facing error message is needed, put the localized message in the error details or localize it in the client. The optional error details may contain arbitrary information about the error. There is a predefined set of error detail types in the package `google.rpc` that can be used for common error conditions.

Language mapping

The `Status` message is the logical representation of the error model, but it is not necessarily the actual wire format. When the `Status` message is exposed in different client libraries and different wire protocols, it can be mapped differently. For example, it will likely be mapped to some exceptions in Java, but more likely mapped to some error codes in C.

Other uses

The error model and the `Status` message can be used in a variety of environments, either with or without APIs, to provide a consistent developer experience across different environments.

Example uses of this error model include:

- Partial errors. If a service needs to return partial errors to the client,

it may embed the `Status` in the normal response to indicate the

partial

errors.

- Workflow errors. A typical workflow has multiple steps. Each step may

have a `Status` message for error reporting.

- Batch operations. If a client uses batch request and batch response, the

`Status` message should be used directly inside batch response,

one for

each error sub-response.

- Asynchronous operations. If an API call embeds asynchronous operation

results in its response, the status of those operations should

be

represented directly using the `Status` message.

- Logging. If some API errors are stored in logs, the message `Status` could

be used directly after any stripping needed for security/privacy

reasons.

func (*Status) MarshalJSON

func (s *Status) MarshalJSON() ([]byte, error)

type TextEnrichment

type TextEnrichment struct {
	// Text: Text for this text enrichment item.
	Text string `json:"text,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Text") 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. "Text") 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:"-"`
}

TextEnrichment: An enrichment containing text.

func (*TextEnrichment) MarshalJSON

func (s *TextEnrichment) MarshalJSON() ([]byte, error)

type Video

type Video struct {
	// CameraMake: Brand of the camera which took the video.
	CameraMake string `json:"cameraMake,omitempty"`

	// CameraModel: Model of the camera which took the video.
	CameraModel string `json:"cameraModel,omitempty"`

	// Fps: Frame rate of the video.
	Fps float64 `json:"fps,omitempty"`

	// Status: Processing status of the video.
	//
	// Possible values:
	//   "UNSPECIFIED" - Video processing status is unknown.
	//   "PROCESSING" - Video is currently being processed. The user will
	// see an icon for this
	// video in the Google Photos app, however, it will not be playable yet.
	//   "READY" - Video is now ready for viewing.
	//   "FAILED" - Something has gone wrong and the video has failed to
	// process.
	Status string `json:"status,omitempty"`

	// ForceSendFields is a list of field names (e.g. "CameraMake") 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. "CameraMake") 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:"-"`
}

Video: Metadata that is specific to a video, for example, fps and processing status. Some of these fields may be null or not included.

func (*Video) MarshalJSON

func (s *Video) MarshalJSON() ([]byte, error)

func (*Video) UnmarshalJSON

func (s *Video) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL