Documentation
¶
Index ¶
- type Album
- type AlbumPosition
- type AlbumPositionType
- type AlbumShareInfo
- type AlbumsListOptions
- type AlbumsService
- type EnrichmentItem
- type Field
- type HttpAlbumsService
- func (s HttpAlbumsService) AddEnrichment(albumId string, enrichment NewEnrichmentItem, ctx context.Context) (*EnrichmentItem, error)
- func (s HttpAlbumsService) BatchAddMediaItems(albumId string, mediaItemIds []string, ctx context.Context) error
- func (s HttpAlbumsService) BatchAddMediaItemsAll(albumId string, mediaItemIds []string, ctx context.Context) error
- func (s HttpAlbumsService) BatchRemoveMediaItems(albumId string, mediaItemIds []string, ctx context.Context) error
- func (s HttpAlbumsService) BatchRemoveMediaItemsAll(albumId string, mediaItemIds []string, ctx context.Context) error
- func (s HttpAlbumsService) Create(title string, ctx context.Context) (*Album, error)
- func (s HttpAlbumsService) Get(id string, ctx context.Context) (*Album, error)
- func (s HttpAlbumsService) List(options *AlbumsListOptions, pageToken string, ctx context.Context) (result []Album, nextPageToken string, err error)
- func (s HttpAlbumsService) ListAll(options *AlbumsListOptions, ctx context.Context) ([]Album, error)
- func (s HttpAlbumsService) ListAllAsync(options *AlbumsListOptions, ctx context.Context) (<-chan Album, <-chan error)
- func (s HttpAlbumsService) Patch(album Album, updateMask []Field, ctx context.Context) (*Album, error)
- func (s HttpAlbumsService) Share(id string, options SharedAlbumOptions, ctx context.Context) (*AlbumShareInfo, error)
- func (s HttpAlbumsService) Unshare(id string, ctx context.Context) error
- type LatLng
- type Location
- type LocationEnrichment
- type MapEnrichment
- type NewEnrichmentItem
- type SharedAlbumOptions
- type SharedAlbumRequestOptions
- type TextEnrichment
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Album ¶
type Album struct {
ID string `json:"id,omitempty"`
Title string `json:"title"`
ProductURL string `json:"productUrl,omitempty"`
IsWriteable bool `json:"isWriteable,omitempty"`
MediaItemsCount string `json:"mediaItemsCount,omitempty"`
CoverPhotoBaseURL string `json:"coverPhotoBaseUrl,omitempty"`
CoverPhotoMediaItemID string `json:"coverPhotoMediaItemId,omitempty"`
}
type AlbumPosition ¶
type AlbumPosition struct {
Position AlbumPositionType `json:"position"`
RelativeMediaItemId string `json:"relativeMediaItemId,omitempty"`
RelativeEnrichmentItemId string `json:"relativeEnrichmentItemId,omitempty"`
}
type AlbumPositionType ¶
type AlbumPositionType string
const ( AlbumPositionTypeUnspecified AlbumPositionType = "POSITION_TYPE_UNSPECIFIED" AlbumPositionTypeFirstInAlbum AlbumPositionType = "FIRST_IN_ALBUM" AlbumPositionTypeLastInAlbum AlbumPositionType = "LAST_IN_ALBUM" AlbumPositionTypeAfterMediaItem AlbumPositionType = "AFTER_MEDIA_ITEM" AlbumPositionTypeAfterEnrichmentItem AlbumPositionType = "AFTER_ENRICHMENT_ITEM" )
type AlbumShareInfo ¶
type AlbumShareInfo struct {
}
type AlbumsListOptions ¶
type AlbumsService ¶
type AlbumsService interface {
AddEnrichment(albumId string, enrichment NewEnrichmentItem, ctx context.Context) (*EnrichmentItem, error)
BatchAddMediaItems(albumId string, mediaItemIds []string, ctx context.Context) error
BatchAddMediaItemsAll(albumId string, mediaItemIds []string, ctx context.Context) error
BatchRemoveMediaItems(albumId string, mediaItemIds []string, ctx context.Context) error
BatchRemoveMediaItemsAll(albumId string, mediaItemIds []string, ctx context.Context) error
Create(title string, ctx context.Context) (*Album, error)
Get(id string, ctx context.Context) (*Album, error)
List(options *AlbumsListOptions, pageToken string, ctx context.Context) (result []Album, nextPageToken string, err error)
ListAll(options *AlbumsListOptions, ctx context.Context) ([]Album, error)
ListAllAsync(options *AlbumsListOptions, ctx context.Context) (<-chan Album, <-chan error)
Patch(album Album, fieldMask []Field, ctx context.Context) (*Album, error)
}
Interface for https://developers.google.com/photos/library/reference/rest/v1/albums resource
type EnrichmentItem ¶
type EnrichmentItem struct {
Id string `json:"id"`
}
type HttpAlbumsService ¶
type HttpAlbumsService struct {
// contains filtered or unexported fields
}
func NewHttpAlbumsService ¶
func NewHttpAlbumsService(authenticatedClient *http.Client) HttpAlbumsService
func (HttpAlbumsService) AddEnrichment ¶
func (s HttpAlbumsService) AddEnrichment(albumId string, enrichment NewEnrichmentItem, ctx context.Context) (*EnrichmentItem, error)
Adds enrichment item to album specified by id
Doc: https://developers.google.com/photos/library/reference/rest/v1/albums/addEnrichment
func (HttpAlbumsService) BatchAddMediaItems ¶
func (s HttpAlbumsService) BatchAddMediaItems(albumId string, mediaItemIds []string, ctx context.Context) error
Adds multiple media items (max 50) to album specified by id
Doc: https://developers.google.com/photos/library/reference/rest/v1/albums/batchAddMediaItems
func (HttpAlbumsService) BatchAddMediaItemsAll ¶
func (s HttpAlbumsService) BatchAddMediaItemsAll(albumId string, mediaItemIds []string, ctx context.Context) error
Adds multiple media items (no limit) using multiple BatchAddMediaItems requests
func (HttpAlbumsService) BatchRemoveMediaItems ¶
func (s HttpAlbumsService) BatchRemoveMediaItems(albumId string, mediaItemIds []string, ctx context.Context) error
Removes multiple media items (max 50) from album specified by id
Doc: https://developers.google.com/photos/library/reference/rest/v1/albums/batchRemoveMediaItems
func (HttpAlbumsService) BatchRemoveMediaItemsAll ¶
func (s HttpAlbumsService) BatchRemoveMediaItemsAll(albumId string, mediaItemIds []string, ctx context.Context) error
Removes multiple media items (no limit) using multiple BatchRemoveMediaItems requests
func (HttpAlbumsService) Create ¶
Create new album
Doc: https://developers.google.com/photos/library/reference/rest/v1/albums/create
func (HttpAlbumsService) Get ¶
Fetch album by id
Doc: https://developers.google.com/photos/library/reference/rest/v1/albums/get
func (HttpAlbumsService) List ¶
func (s HttpAlbumsService) List(options *AlbumsListOptions, pageToken string, ctx context.Context) (result []Album, nextPageToken string, err error)
Lists all albums
Doc: https://developers.google.com/photos/library/reference/rest/v1/albums/list
func (HttpAlbumsService) ListAll ¶
func (s HttpAlbumsService) ListAll(options *AlbumsListOptions, ctx context.Context) ([]Album, error)
Synchronous wrapper for ListAllAsync
func (HttpAlbumsService) ListAllAsync ¶
func (s HttpAlbumsService) ListAllAsync(options *AlbumsListOptions, ctx context.Context) (<-chan Album, <-chan error)
Asynchronous wrapper for List that takes care of pagination. Returned channel has buffer size of 50
func (HttpAlbumsService) Patch ¶ added in v0.2.0
func (s HttpAlbumsService) Patch(album Album, updateMask []Field, ctx context.Context) (*Album, error)
Patches album. updateMask argument can be used to update only selected fields. Currently only id, title and coverPhotoMediaItemId are read
Doc: https://developers.google.com/photos/library/reference/rest/v1/albums/patch
func (HttpAlbumsService) Share ¶
func (s HttpAlbumsService) Share(id string, options SharedAlbumOptions, ctx context.Context) (*AlbumShareInfo, error)
Shares album specified by id
Doc: https://developers.google.com/photos/library/reference/rest/v1/albums/share
func (HttpAlbumsService) Unshare ¶
func (s HttpAlbumsService) Unshare(id string, ctx context.Context) error
Unshares album specified by id
Doc: https://developers.google.com/photos/library/reference/rest/v1/albums/unshare
type LocationEnrichment ¶
type LocationEnrichment struct {
Location Location `json:"location"`
}
type MapEnrichment ¶
type NewEnrichmentItem ¶
type NewEnrichmentItem struct {
TextEnrichment TextEnrichment `json:"textEnrichment,omitempty"`
LocationEnrichment LocationEnrichment `json:"locationEnrichment, omitempty"`
MapEnrichment MapEnrichment `json:"mapEnrichment,omitempty"`
}
type SharedAlbumOptions ¶
type SharedAlbumOptions struct {
}
type SharedAlbumRequestOptions ¶
type SharedAlbumRequestOptions struct {
}
type TextEnrichment ¶
type TextEnrichment struct {
Text string `json:"text"`
}