Documentation ¶
Overview ¶
Package streetviewpublish is an experimental, auto-generated package for the streetviewpublish API.
The Street View Publish API allows your application to publish 360 photos to Google Maps, along with image metadata that specifies the position, orientation, and connectivity of each photo. With this API, any app can offer an interface for positioning, connecting, and uploading user-generated Street View images.
Index ¶
- func DefaultAuthScopes() []string
- type PhotoIterator
- type StreetViewPublishCallOptions
- type StreetViewPublishClient
- func (c *StreetViewPublishClient) BatchDeletePhotos(ctx context.Context, req *publishpb.BatchDeletePhotosRequest, ...) (*publishpb.BatchDeletePhotosResponse, error)
- func (c *StreetViewPublishClient) BatchGetPhotos(ctx context.Context, req *publishpb.BatchGetPhotosRequest, ...) (*publishpb.BatchGetPhotosResponse, error)
- func (c *StreetViewPublishClient) BatchUpdatePhotos(ctx context.Context, req *publishpb.BatchUpdatePhotosRequest, ...) (*publishpb.BatchUpdatePhotosResponse, error)
- func (c *StreetViewPublishClient) Close() error
- func (c *StreetViewPublishClient) Connection() *grpc.ClientConn
- func (c *StreetViewPublishClient) CreatePhoto(ctx context.Context, req *publishpb.CreatePhotoRequest, opts ...gax.CallOption) (*publishpb.Photo, error)
- func (c *StreetViewPublishClient) DeletePhoto(ctx context.Context, req *publishpb.DeletePhotoRequest, opts ...gax.CallOption) error
- func (c *StreetViewPublishClient) GetPhoto(ctx context.Context, req *publishpb.GetPhotoRequest, opts ...gax.CallOption) (*publishpb.Photo, error)
- func (c *StreetViewPublishClient) ListPhotos(ctx context.Context, req *publishpb.ListPhotosRequest, opts ...gax.CallOption) *PhotoIterator
- func (c *StreetViewPublishClient) SetGoogleClientInfo(keyval ...string)
- func (c *StreetViewPublishClient) StartUpload(ctx context.Context, req *emptypb.Empty, opts ...gax.CallOption) (*publishpb.UploadRef, error)
- func (c *StreetViewPublishClient) UpdatePhoto(ctx context.Context, req *publishpb.UpdatePhotoRequest, opts ...gax.CallOption) (*publishpb.Photo, error)
Examples ¶
- NewStreetViewPublishClient
- StreetViewPublishClient.BatchDeletePhotos
- StreetViewPublishClient.BatchGetPhotos
- StreetViewPublishClient.BatchUpdatePhotos
- StreetViewPublishClient.CreatePhoto
- StreetViewPublishClient.DeletePhoto
- StreetViewPublishClient.GetPhoto
- StreetViewPublishClient.ListPhotos
- StreetViewPublishClient.StartUpload
- StreetViewPublishClient.UpdatePhoto
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAuthScopes ¶
func DefaultAuthScopes() []string
Types ¶
type PhotoIterator ¶
type PhotoIterator struct { // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*publishpb.Photo, nextPageToken string, err error) // contains filtered or unexported fields }
PhotoIterator manages a stream of *publishpb.Photo.
func (*PhotoIterator) Next ¶
func (it *PhotoIterator) Next() (*publishpb.Photo, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*PhotoIterator) PageInfo ¶
func (it *PhotoIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type StreetViewPublishCallOptions ¶
type StreetViewPublishCallOptions struct { StartUpload []gax.CallOption CreatePhoto []gax.CallOption GetPhoto []gax.CallOption BatchGetPhotos []gax.CallOption ListPhotos []gax.CallOption UpdatePhoto []gax.CallOption BatchUpdatePhotos []gax.CallOption DeletePhoto []gax.CallOption BatchDeletePhotos []gax.CallOption }
StreetViewPublishCallOptions contains the retry settings for each method of StreetViewPublishClient.
type StreetViewPublishClient ¶
type StreetViewPublishClient struct { // The call options for this service. CallOptions *StreetViewPublishCallOptions // contains filtered or unexported fields }
StreetViewPublishClient is a client for interacting with Street View Publish API.
func NewStreetViewPublishClient ¶
func NewStreetViewPublishClient(ctx context.Context, opts ...option.ClientOption) (*StreetViewPublishClient, error)
NewStreetViewPublishClient creates a new street view publish service client.
Publishes and connects user-contributed photos on Street View.
Example ¶
ctx := context.Background() c, err := streetviewpublish.NewStreetViewPublishClient(ctx) if err != nil { // TODO: Handle error. } // TODO: Use client. _ = c
Output:
func (*StreetViewPublishClient) BatchDeletePhotos ¶
func (c *StreetViewPublishClient) BatchDeletePhotos(ctx context.Context, req *publishpb.BatchDeletePhotosRequest, opts ...gax.CallOption) (*publishpb.BatchDeletePhotosResponse, error)
BatchDeletePhotos deletes a list of photos and their metadata.
Note that if `photos.batchDelete` fails, either critical fields are missing or there was an authentication error. Even if `photos.batchDelete` succeeds, there may have been failures for single photos in the batch. These failures will be specified in `BatchDeletePhotosResponse.status`. See `photo.update` for specific failures that will occur per photo.
Example ¶
ctx := context.Background() c, err := streetviewpublish.NewStreetViewPublishClient(ctx) if err != nil { // TODO: Handle error. } req := &publishpb.BatchDeletePhotosRequest{ // TODO: Fill request struct fields. } resp, err := c.BatchDeletePhotos(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Output:
func (*StreetViewPublishClient) BatchGetPhotos ¶
func (c *StreetViewPublishClient) BatchGetPhotos(ctx context.Context, req *publishpb.BatchGetPhotosRequest, opts ...gax.CallOption) (*publishpb.BatchGetPhotosResponse, error)
BatchGetPhotos gets the metadata of the specified `Photo` batch.
Note that if `photos.batchGet` fails, either critical fields are missing or there was an authentication error. Even if `photos.batchGet` succeeds, there may have been failures for single photos in the batch. These failures will be specified in `BatchGetPhotosResponse.results.status`. See `photo.get` for specific failures that will occur per photo.
Example ¶
ctx := context.Background() c, err := streetviewpublish.NewStreetViewPublishClient(ctx) if err != nil { // TODO: Handle error. } req := &publishpb.BatchGetPhotosRequest{ // TODO: Fill request struct fields. } resp, err := c.BatchGetPhotos(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Output:
func (*StreetViewPublishClient) BatchUpdatePhotos ¶
func (c *StreetViewPublishClient) BatchUpdatePhotos(ctx context.Context, req *publishpb.BatchUpdatePhotosRequest, opts ...gax.CallOption) (*publishpb.BatchUpdatePhotosResponse, error)
BatchUpdatePhotos updates the metadata of photos, such as pose, place association, etc. Changing the pixels of a photo is not supported.
Note that if `photos.batchUpdate` fails, either critical fields are missing or there was an authentication error. Even if `photos.batchUpdate` succeeds, there may have been failures for single photos in the batch. These failures will be specified in `BatchUpdatePhotosResponse.results.status`. See `UpdatePhoto` for specific failures that will occur per photo.
Example ¶
ctx := context.Background() c, err := streetviewpublish.NewStreetViewPublishClient(ctx) if err != nil { // TODO: Handle error. } req := &publishpb.BatchUpdatePhotosRequest{ // TODO: Fill request struct fields. } resp, err := c.BatchUpdatePhotos(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Output:
func (*StreetViewPublishClient) Close ¶
func (c *StreetViewPublishClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*StreetViewPublishClient) Connection ¶
func (c *StreetViewPublishClient) Connection() *grpc.ClientConn
Connection returns the client's connection to the API service.
func (*StreetViewPublishClient) CreatePhoto ¶
func (c *StreetViewPublishClient) CreatePhoto(ctx context.Context, req *publishpb.CreatePhotoRequest, opts ...gax.CallOption) (*publishpb.Photo, error)
CreatePhoto after the client finishes uploading the photo with the returned `UploadRef`, `photo.create` publishes the uploaded photo to Street View on Google Maps.
This method returns the following error codes:
* `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the upload reference does not exist.
Example ¶
ctx := context.Background() c, err := streetviewpublish.NewStreetViewPublishClient(ctx) if err != nil { // TODO: Handle error. } req := &publishpb.CreatePhotoRequest{ // TODO: Fill request struct fields. } resp, err := c.CreatePhoto(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Output:
func (*StreetViewPublishClient) DeletePhoto ¶
func (c *StreetViewPublishClient) DeletePhoto(ctx context.Context, req *publishpb.DeletePhotoRequest, opts ...gax.CallOption) error
DeletePhoto deletes a photo and its metadata.
This method returns the following error codes:
* `PERMISSION_DENIED` if the requesting user did not create the requested photo. * `NOT_FOUND` if the photo ID does not exist.
Example ¶
ctx := context.Background() c, err := streetviewpublish.NewStreetViewPublishClient(ctx) if err != nil { // TODO: Handle error. } req := &publishpb.DeletePhotoRequest{ // TODO: Fill request struct fields. } err = c.DeletePhoto(ctx, req) if err != nil { // TODO: Handle error. }
Output:
func (*StreetViewPublishClient) GetPhoto ¶
func (c *StreetViewPublishClient) GetPhoto(ctx context.Context, req *publishpb.GetPhotoRequest, opts ...gax.CallOption) (*publishpb.Photo, error)
GetPhoto gets the metadata of the specified `Photo`.
This method returns the following error codes:
* `PERMISSION_DENIED` if the requesting user did not create the requested photo. * `NOT_FOUND` if the requested photo does not exist.
Example ¶
ctx := context.Background() c, err := streetviewpublish.NewStreetViewPublishClient(ctx) if err != nil { // TODO: Handle error. } req := &publishpb.GetPhotoRequest{ // TODO: Fill request struct fields. } resp, err := c.GetPhoto(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Output:
func (*StreetViewPublishClient) ListPhotos ¶
func (c *StreetViewPublishClient) ListPhotos(ctx context.Context, req *publishpb.ListPhotosRequest, opts ...gax.CallOption) *PhotoIterator
ListPhotos lists all the photos that belong to the user.
Example ¶
ctx := context.Background() c, err := streetviewpublish.NewStreetViewPublishClient(ctx) if err != nil { // TODO: Handle error. } req := &publishpb.ListPhotosRequest{ // TODO: Fill request struct fields. } it := c.ListPhotos(ctx, req) for { resp, err := it.Next() if err != nil { // TODO: Handle error. break } // TODO: Use resp. _ = resp }
Output:
func (*StreetViewPublishClient) SetGoogleClientInfo ¶
func (c *StreetViewPublishClient) SetGoogleClientInfo(keyval ...string)
SetGoogleClientInfo sets the name and version of the application in the `x-goog-api-client` header passed on each request. Intended for use by Google-written clients.
func (*StreetViewPublishClient) StartUpload ¶
func (c *StreetViewPublishClient) StartUpload(ctx context.Context, req *emptypb.Empty, opts ...gax.CallOption) (*publishpb.UploadRef, error)
StartUpload creates an upload session to start uploading photo data. The upload URL of the returned `UploadRef` is used to upload the data for the photo.
After the upload is complete, the `UploadRef` is used with `StreetViewPublishService:CreatePhoto()` to create the `Photo` object entry.
Example ¶
ctx := context.Background() c, err := streetviewpublish.NewStreetViewPublishClient(ctx) if err != nil { // TODO: Handle error. } req := &emptypb.Empty{ // TODO: Fill request struct fields. } resp, err := c.StartUpload(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Output:
func (*StreetViewPublishClient) UpdatePhoto ¶
func (c *StreetViewPublishClient) UpdatePhoto(ctx context.Context, req *publishpb.UpdatePhotoRequest, opts ...gax.CallOption) (*publishpb.Photo, error)
UpdatePhoto updates the metadata of a photo, such as pose, place association, etc. Changing the pixels of a photo is not supported.
This method returns the following error codes:
* `PERMISSION_DENIED` if the requesting user did not create the requested photo. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the photo ID does not exist.
Example ¶
ctx := context.Background() c, err := streetviewpublish.NewStreetViewPublishClient(ctx) if err != nil { // TODO: Handle error. } req := &publishpb.UpdatePhotoRequest{ // TODO: Fill request struct fields. } resp, err := c.UpdatePhoto(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Output: