Street View Publish API v1 - Package cloud.google.com/go/streetview/publish/apiv1 (v0.2.6) Stay organized with collections Save and categorize content based on your preferences.
Beta
This library is covered by thePre-GA Offerings Terms of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see thelaunch stage descriptions.
Note: To get more information about this package, such as access to older versions, viewthis package on pkg.go.dev.Package publish is an auto-generated package for theStreet View Publish API.
Publishes 360 photos to Google Maps, along with position, orientation, andconnectivity metadata. Apps can offer an interface for positioning,connecting, and uploading user-generated Street View images.
NOTE:Thispackageisinbeta.Itisnotstable,andmaybesubjecttochanges.
General documentation
For information that is relevant for all client libraries please referencehttps://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on thispage includes:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage
To get started with this package, create a client.
// go get cloud.google.com/go/streetview/publish/apiv1@latestctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=publish.NewStreetViewPublishClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()
The client will use your default application credentials. Clients should be reused instead of created as needed.The methods of Client are safe for concurrent use by multiple goroutines.The returned client must be Closed when it is done being used.
Using the Client
The following is an example of making an API call with the newly created client, mentioned above.
req:=&publishpb.BatchDeletePhotosRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/streetview/publish/apiv1/publishpb#BatchDeletePhotosRequest.}resp,err:=c.BatchDeletePhotos(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp
Use of Context
The ctx passed to NewStreetViewPublishClient is used for authentication requests andfor creating the underlying connection, but is not used for subsequent calls.Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
Functions
func DefaultAuthScopes
funcDefaultAuthScopes()[]stringDefaultAuthScopes reports the default set of authentication scopes to use with this package.
CreatePhotoSequenceOperation
typeCreatePhotoSequenceOperationstruct{// contains filtered or unexported fields}CreatePhotoSequenceOperation manages a long-running operation from CreatePhotoSequence.
func (*CreatePhotoSequenceOperation) Done
func(op*CreatePhotoSequenceOperation)Done()boolDone reports whether the long-running operation has completed.
func (*CreatePhotoSequenceOperation) Metadata
func(op*CreatePhotoSequenceOperation)Metadata()(*emptypb.Empty,error)Metadata returns metadata associated with the long-running operation.Metadata itself does not contact the server, but Poll does.To get the latest metadata, call this method after a successful call to Poll.If the metadata is not available, the returned metadata and error are both nil.
func (*CreatePhotoSequenceOperation) Name
func(op*CreatePhotoSequenceOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreatePhotoSequenceOperation) Poll
func(op*CreatePhotoSequenceOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*publishpb.PhotoSequence,error)Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe operation has completed with failure, the error is returned and op.Done will return true.If Poll succeeds and the operation has completed successfully,op.Done will return true, and the response of the operation is returned.If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreatePhotoSequenceOperation) Wait
func(op*CreatePhotoSequenceOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*publishpb.PhotoSequence,error)Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
GetPhotoSequenceOperation
typeGetPhotoSequenceOperationstruct{// contains filtered or unexported fields}GetPhotoSequenceOperation manages a long-running operation from GetPhotoSequence.
func (*GetPhotoSequenceOperation) Done
func(op*GetPhotoSequenceOperation)Done()boolDone reports whether the long-running operation has completed.
func (*GetPhotoSequenceOperation) Metadata
func(op*GetPhotoSequenceOperation)Metadata()(*emptypb.Empty,error)Metadata returns metadata associated with the long-running operation.Metadata itself does not contact the server, but Poll does.To get the latest metadata, call this method after a successful call to Poll.If the metadata is not available, the returned metadata and error are both nil.
func (*GetPhotoSequenceOperation) Name
func(op*GetPhotoSequenceOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*GetPhotoSequenceOperation) Poll
func(op*GetPhotoSequenceOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*publishpb.PhotoSequence,error)Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe operation has completed with failure, the error is returned and op.Done will return true.If Poll succeeds and the operation has completed successfully,op.Done will return true, and the response of the operation is returned.If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*GetPhotoSequenceOperation) Wait
func(op*GetPhotoSequenceOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*publishpb.PhotoSequence,error)Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
OperationIterator
typeOperationIteratorstruct{// Response is the raw response for the current page.// It must be cast to the RPC response type.// Calling Next() or InternalFetch() updates this value.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*longrunningpb.Operation,nextPageTokenstring,errerror)// contains filtered or unexported fields}OperationIterator manages a stream of *longrunningpb.Operation.
func (*OperationIterator) All
func(it*OperationIterator)All()iter.Seq2[*longrunningpb.Operation,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*OperationIterator) Next
func(it*OperationIterator)Next()(*longrunningpb.Operation,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*OperationIterator) PageInfo
func(it*OperationIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
PhotoIterator
typePhotoIteratorstruct{// Response is the raw response for the current page.// It must be cast to the RPC response type.// Calling Next() or InternalFetch() updates this value.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*publishpb.Photo,nextPageTokenstring,errerror)// contains filtered or unexported fields}PhotoIterator manages a stream of *publishpb.Photo.
func (*PhotoIterator) All
func(it*PhotoIterator)All()iter.Seq2[*publishpb.Photo,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
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 moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*PhotoIterator) PageInfo
func(it*PhotoIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
StreetViewPublishCallOptions
typeStreetViewPublishCallOptionsstruct{StartUpload[]gax.CallOptionCreatePhoto[]gax.CallOptionGetPhoto[]gax.CallOptionBatchGetPhotos[]gax.CallOptionListPhotos[]gax.CallOptionUpdatePhoto[]gax.CallOptionBatchUpdatePhotos[]gax.CallOptionDeletePhoto[]gax.CallOptionBatchDeletePhotos[]gax.CallOptionStartPhotoSequenceUpload[]gax.CallOptionCreatePhotoSequence[]gax.CallOptionGetPhotoSequence[]gax.CallOptionListPhotoSequences[]gax.CallOptionDeletePhotoSequence[]gax.CallOption}StreetViewPublishCallOptions contains the retry settings for each method of StreetViewPublishClient.
StreetViewPublishClient
typeStreetViewPublishClientstruct{// The call options for this service.CallOptions*StreetViewPublishCallOptions// LROClient is used internally to handle long-running operations.// It is exposed so that its CallOptions can be modified if required.// Users should not Close this client.LROClient*lroauto.OperationsClient// contains filtered or unexported fields}StreetViewPublishClient is a client for interacting with Street View Publish API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Publishes and connects user-contributed photos on Street View.
func NewStreetViewPublishClient
funcNewStreetViewPublishClient(ctxcontext.Context,opts...option.ClientOption)(*StreetViewPublishClient,error)NewStreetViewPublishClient creates a new street view publish service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
Publishes and connects user-contributed photos on Street View.
Example
packagemainimport("context"publish"cloud.google.com/go/streetview/publish/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=publish.NewStreetViewPublishClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewStreetViewPublishRESTClient
funcNewStreetViewPublishRESTClient(ctxcontext.Context,opts...option.ClientOption)(*StreetViewPublishClient,error)NewStreetViewPublishRESTClient creates a new street view publish service rest client.
Publishes and connects user-contributed photos on Street View.
Example
packagemainimport("context"publish"cloud.google.com/go/streetview/publish/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=publish.NewStreetViewPublishRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*StreetViewPublishClient) BatchDeletePhotos
func(c*StreetViewPublishClient)BatchDeletePhotos(ctxcontext.Context,req*publishpb.BatchDeletePhotosRequest,opts...gax.CallOption)(*publishpb.BatchDeletePhotosResponse,error)BatchDeletePhotos deletes a list of [Photos][google.streetview.publish.v1.Photo (athttp://google.streetview.publish.v1.Photo)] and theirmetadata.
Note that ifBatchDeletePhotosfails, either critical fields are missing or there is an authenticationerror. Even ifBatchDeletePhotossucceeds, individual photos in the batch may have failures.These failures are specified in eachPhotoResponse.statusinBatchDeletePhotosResponse.results.SeeDeletePhotofor specific failures that can occur per photo.
Example
packagemainimport("context"publish"cloud.google.com/go/streetview/publish/apiv1"publishpb"cloud.google.com/go/streetview/publish/apiv1/publishpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=publish.NewStreetViewPublishClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&publishpb.BatchDeletePhotosRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/streetview/publish/apiv1/publishpb#BatchDeletePhotosRequest.}resp,err:=c.BatchDeletePhotos(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*StreetViewPublishClient) BatchGetPhotos
func(c*StreetViewPublishClient)BatchGetPhotos(ctxcontext.Context,req*publishpb.BatchGetPhotosRequest,opts...gax.CallOption)(*publishpb.BatchGetPhotosResponse,error)BatchGetPhotos gets the metadata of the specified[Photo][google.streetview.publish.v1.Photo (athttp://google.streetview.publish.v1.Photo)] batch.
Note that ifBatchGetPhotosfails, either critical fields are missing or there is an authenticationerror. Even ifBatchGetPhotossucceeds, individual photos in the batch may have failures.These failures are specified in eachPhotoResponse.statusinBatchGetPhotosResponse.results.SeeGetPhotofor specific failures that can occur per photo.
Example
packagemainimport("context"publish"cloud.google.com/go/streetview/publish/apiv1"publishpb"cloud.google.com/go/streetview/publish/apiv1/publishpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=publish.NewStreetViewPublishClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&publishpb.BatchGetPhotosRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/streetview/publish/apiv1/publishpb#BatchGetPhotosRequest.}resp,err:=c.BatchGetPhotos(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*StreetViewPublishClient) BatchUpdatePhotos
func(c*StreetViewPublishClient)BatchUpdatePhotos(ctxcontext.Context,req*publishpb.BatchUpdatePhotosRequest,opts...gax.CallOption)(*publishpb.BatchUpdatePhotosResponse,error)BatchUpdatePhotos updates the metadata of [Photos][google.streetview.publish.v1.Photo (athttp://google.streetview.publish.v1.Photo)], suchas pose, place association, connections, etc. Changing the pixels of photosis not supported.
Note that ifBatchUpdatePhotosfails, either critical fields are missing or there is an authenticationerror. Even ifBatchUpdatePhotossucceeds, individual photos in the batch may have failures.These failures are specified in eachPhotoResponse.statusinBatchUpdatePhotosResponse.results.SeeUpdatePhotofor specific failures that can occur per photo.
Only the fields specified inupdateMaskfield are used. If updateMask is not present, the update applies to allfields.
The number ofUpdatePhotoRequestmessages in aBatchUpdatePhotosRequestmust not exceed 20.
Note: To updatePose.altitude,Pose.latLngPair has to befilled as well. Otherwise, the request will fail.
Example
packagemainimport("context"publish"cloud.google.com/go/streetview/publish/apiv1"publishpb"cloud.google.com/go/streetview/publish/apiv1/publishpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=publish.NewStreetViewPublishClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&publishpb.BatchUpdatePhotosRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/streetview/publish/apiv1/publishpb#BatchUpdatePhotosRequest.}resp,err:=c.BatchUpdatePhotos(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*StreetViewPublishClient) Close
func(c*StreetViewPublishClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*StreetViewPublishClient) Connection (deprecated)
func(c*StreetViewPublishClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*StreetViewPublishClient) CreatePhoto
func(c*StreetViewPublishClient)CreatePhoto(ctxcontext.Context,req*publishpb.CreatePhotoRequest,opts...gax.CallOption)(*publishpb.Photo,error)CreatePhoto after the client finishes uploading the photo with the returnedUploadRef,CreatePhotopublishes the uploaded [Photo][google.streetview.publish.v1.Photo (athttp://google.streetview.publish.v1.Photo)] toStreet View on Google Maps.
Currently, the only way to set heading, pitch, and roll in CreatePhoto isthrough the Photo Sphere XMPmetadata (athttps://developers.google.com/streetview/spherical-metadata) inthe photo bytes. CreatePhoto ignores the pose.heading, pose.pitch,pose.roll, pose.altitude, and pose.level fields in Pose.
This method returns the following error codes:
google.rpc.Code.INVALID_ARGUMENT ifthe request is malformed or if the uploaded photo is not a 360 photo.google.rpc.Code.NOT_FOUND if the uploadreference does not exist.google.rpc.Code.RESOURCE_EXHAUSTEDif the account has reached the storage limit.Example
packagemainimport("context"publish"cloud.google.com/go/streetview/publish/apiv1"publishpb"cloud.google.com/go/streetview/publish/apiv1/publishpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=publish.NewStreetViewPublishClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&publishpb.CreatePhotoRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/streetview/publish/apiv1/publishpb#CreatePhotoRequest.}resp,err:=c.CreatePhoto(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*StreetViewPublishClient) CreatePhotoSequence
func(c*StreetViewPublishClient)CreatePhotoSequence(ctxcontext.Context,req*publishpb.CreatePhotoSequenceRequest,opts...gax.CallOption)(*CreatePhotoSequenceOperation,error)CreatePhotoSequence after the client finishes uploading thePhotoSequence with thereturned UploadRef,CreatePhotoSequenceextracts a sequence of 360 photos from a video or Extensible DeviceMetadata (XDM,http://www.xdm.org/ (athttp://www.xdm.org/)) to be published to Street View onGoogle Maps.
CreatePhotoSequence returns an Operation,with the PhotoSequence Id setin the Operation.name field.
This method returns the following error codes:
google.rpc.Code.INVALID_ARGUMENT ifthe request is malformed.google.rpc.Code.NOT_FOUND if the uploadreference does not exist.Example
packagemainimport("context"publish"cloud.google.com/go/streetview/publish/apiv1"publishpb"cloud.google.com/go/streetview/publish/apiv1/publishpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=publish.NewStreetViewPublishClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&publishpb.CreatePhotoSequenceRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/streetview/publish/apiv1/publishpb#CreatePhotoSequenceRequest.}op,err:=c.CreatePhotoSequence(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*StreetViewPublishClient) CreatePhotoSequenceOperation
func(c*StreetViewPublishClient)CreatePhotoSequenceOperation(namestring)*CreatePhotoSequenceOperationCreatePhotoSequenceOperation returns a new CreatePhotoSequenceOperation from a given name.The name must be that of a previously created CreatePhotoSequenceOperation, possibly from a different process.
func (*StreetViewPublishClient) DeletePhoto
func(c*StreetViewPublishClient)DeletePhoto(ctxcontext.Context,req*publishpb.DeletePhotoRequest,opts...gax.CallOption)errorDeletePhoto deletes a [Photo][google.streetview.publish.v1.Photo (athttp://google.streetview.publish.v1.Photo)] and its metadata.
This method returns the following error codes:
google.rpc.Code.PERMISSION_DENIED ifthe requesting user did not create the requested photo.google.rpc.Code.NOT_FOUND if the photo IDdoes not exist.Example
packagemainimport("context"publish"cloud.google.com/go/streetview/publish/apiv1"publishpb"cloud.google.com/go/streetview/publish/apiv1/publishpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=publish.NewStreetViewPublishClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&publishpb.DeletePhotoRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/streetview/publish/apiv1/publishpb#DeletePhotoRequest.}err=c.DeletePhoto(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*StreetViewPublishClient) DeletePhotoSequence
func(c*StreetViewPublishClient)DeletePhotoSequence(ctxcontext.Context,req*publishpb.DeletePhotoSequenceRequest,opts...gax.CallOption)errorDeletePhotoSequence deletes a PhotoSequence andits metadata.
This method returns the following error codes:
google.rpc.Code.PERMISSION_DENIED ifthe requesting user did not create the requested photo sequence.google.rpc.Code.NOT_FOUND if the photosequence ID does not exist.google.rpc.Code.FAILED_PRECONDITION if the photo sequence ID is notyet finished processing.Example
packagemainimport("context"publish"cloud.google.com/go/streetview/publish/apiv1"publishpb"cloud.google.com/go/streetview/publish/apiv1/publishpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=publish.NewStreetViewPublishClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&publishpb.DeletePhotoSequenceRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/streetview/publish/apiv1/publishpb#DeletePhotoSequenceRequest.}err=c.DeletePhotoSequence(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*StreetViewPublishClient) GetPhoto
func(c*StreetViewPublishClient)GetPhoto(ctxcontext.Context,req*publishpb.GetPhotoRequest,opts...gax.CallOption)(*publishpb.Photo,error)GetPhoto gets the metadata of the specified[Photo][google.streetview.publish.v1.Photo (athttp://google.streetview.publish.v1.Photo)].
This method returns the following error codes:
google.rpc.Code.PERMISSION_DENIED ifthe requesting user did not create the requested[Photo][google.streetview.publish.v1.Photo (at http://google.streetview.publish.v1.Photo)].google.rpc.Code.NOT_FOUND if the requested[Photo][google.streetview.publish.v1.Photo (at http://google.streetview.publish.v1.Photo)] does not exist.google.rpc.Code.UNAVAILABLE if therequested [Photo][google.streetview.publish.v1.Photo (at http://google.streetview.publish.v1.Photo)] is still beingindexed.Example
packagemainimport("context"publish"cloud.google.com/go/streetview/publish/apiv1"publishpb"cloud.google.com/go/streetview/publish/apiv1/publishpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=publish.NewStreetViewPublishClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&publishpb.GetPhotoRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/streetview/publish/apiv1/publishpb#GetPhotoRequest.}resp,err:=c.GetPhoto(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*StreetViewPublishClient) GetPhotoSequence
func(c*StreetViewPublishClient)GetPhotoSequence(ctxcontext.Context,req*publishpb.GetPhotoSequenceRequest,opts...gax.CallOption)(*GetPhotoSequenceOperation,error)GetPhotoSequence gets the metadata of the specifiedPhotoSequence via theOperation interface.
This method returns the following three types of responses:
Operation.done = false, if the processing ofPhotoSequence is notfinished yet.Operation.done = true and Operation.error is populated, if there wasan error in processing.Operation.done = true and Operation.response is poulated, whichcontains a PhotoSequencemessage.This method returns the following error codes:
google.rpc.Code.PERMISSION_DENIED ifthe requesting user did not create the requestedPhotoSequence.google.rpc.Code.NOT_FOUND if the requestedPhotoSequence does not exist.Example
packagemainimport("context"publish"cloud.google.com/go/streetview/publish/apiv1"publishpb"cloud.google.com/go/streetview/publish/apiv1/publishpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=publish.NewStreetViewPublishClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&publishpb.GetPhotoSequenceRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/streetview/publish/apiv1/publishpb#GetPhotoSequenceRequest.}op,err:=c.GetPhotoSequence(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*StreetViewPublishClient) GetPhotoSequenceOperation
func(c*StreetViewPublishClient)GetPhotoSequenceOperation(namestring)*GetPhotoSequenceOperationGetPhotoSequenceOperation returns a new GetPhotoSequenceOperation from a given name.The name must be that of a previously created GetPhotoSequenceOperation, possibly from a different process.
func (*StreetViewPublishClient) ListPhotoSequences
func(c*StreetViewPublishClient)ListPhotoSequences(ctxcontext.Context,req*publishpb.ListPhotoSequencesRequest,opts...gax.CallOption)*OperationIteratorListPhotoSequences lists all the PhotoSequencesthat belong to the user, in descending CreatePhotoSequence timestamp order.
Examples
packagemainimport("context"publish"cloud.google.com/go/streetview/publish/apiv1"publishpb"cloud.google.com/go/streetview/publish/apiv1/publishpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=publish.NewStreetViewPublishClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&publishpb.ListPhotoSequencesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/streetview/publish/apiv1/publishpb#ListPhotoSequencesRequest.}it:=c.ListPhotoSequences(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*publishpb.ListPhotoSequencesResponse)}}all
packagemainimport("context"publish"cloud.google.com/go/streetview/publish/apiv1"publishpb"cloud.google.com/go/streetview/publish/apiv1/publishpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=publish.NewStreetViewPublishClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&publishpb.ListPhotoSequencesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/streetview/publish/apiv1/publishpb#ListPhotoSequencesRequest.}forresp,err:=rangec.ListPhotoSequences(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*StreetViewPublishClient) ListPhotos
func(c*StreetViewPublishClient)ListPhotos(ctxcontext.Context,req*publishpb.ListPhotosRequest,opts...gax.CallOption)*PhotoIteratorListPhotos lists all the [Photos][google.streetview.publish.v1.Photo (athttp://google.streetview.publish.v1.Photo)] that belong tothe user.
Note: Recently created photos that are stillbeing indexed are not returned in the response.
Examples
packagemainimport("context"publish"cloud.google.com/go/streetview/publish/apiv1"publishpb"cloud.google.com/go/streetview/publish/apiv1/publishpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=publish.NewStreetViewPublishClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&publishpb.ListPhotosRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/streetview/publish/apiv1/publishpb#ListPhotosRequest.}it:=c.ListPhotos(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*publishpb.ListPhotosResponse)}}all
packagemainimport("context"publish"cloud.google.com/go/streetview/publish/apiv1"publishpb"cloud.google.com/go/streetview/publish/apiv1/publishpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=publish.NewStreetViewPublishClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&publishpb.ListPhotosRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/streetview/publish/apiv1/publishpb#ListPhotosRequest.}forresp,err:=rangec.ListPhotos(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*StreetViewPublishClient) StartPhotoSequenceUpload
func(c*StreetViewPublishClient)StartPhotoSequenceUpload(ctxcontext.Context,req*emptypb.Empty,opts...gax.CallOption)(*publishpb.UploadRef,error)StartPhotoSequenceUpload creates an upload session to start uploading photo sequence data.The upload URL of the returnedUploadRef is used to upload thedata for the photoSequence.
After the upload is complete, theUploadRef is used withCreatePhotoSequenceto create the PhotoSequenceobject entry.
Example
packagemainimport("context"publish"cloud.google.com/go/streetview/publish/apiv1"emptypb"google.golang.org/protobuf/types/known/emptypb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=publish.NewStreetViewPublishClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&emptypb.Empty{// TODO: Fill request struct fields.// See https://pkg.go.dev/google.golang.org/protobuf/types/known/emptypb#Empty.}resp,err:=c.StartPhotoSequenceUpload(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*StreetViewPublishClient) StartUpload
func(c*StreetViewPublishClient)StartUpload(ctxcontext.Context,req*emptypb.Empty,opts...gax.CallOption)(*publishpb.UploadRef,error)StartUpload creates an upload session to start uploading photo bytes. The method usesthe upload URL of the returnedUploadRef to upload the bytes forthe [Photo][google.streetview.publish.v1.Photo (athttp://google.streetview.publish.v1.Photo)].
In addition to the photo requirements shown inhttps://support.google.com/maps/answer/7012050?ref_topic=6275604 (athttps://support.google.com/maps/answer/7012050?ref_topic=6275604),the photo must meet the following requirements:
Photo Sphere XMP metadata must be included in the photo metadata. Seehttps://developers.google.com/streetview/spherical-metadata (at https://developers.google.com/streetview/spherical-metadata) for therequired fields.The pixel size of the photo must meet the size requirements listed inhttps://support.google.com/maps/answer/7012050?ref_topic=6275604 (at https://support.google.com/maps/answer/7012050?ref_topic=6275604), andthe photo must be a full 360 horizontally.After the upload completes, the method usesUploadRef withCreatePhototo create the [Photo][google.streetview.publish.v1.Photo (athttp://google.streetview.publish.v1.Photo)] object entry.
Example
packagemainimport("context"publish"cloud.google.com/go/streetview/publish/apiv1"emptypb"google.golang.org/protobuf/types/known/emptypb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=publish.NewStreetViewPublishClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&emptypb.Empty{// TODO: Fill request struct fields.// See https://pkg.go.dev/google.golang.org/protobuf/types/known/emptypb#Empty.}resp,err:=c.StartUpload(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*StreetViewPublishClient) UpdatePhoto
func(c*StreetViewPublishClient)UpdatePhoto(ctxcontext.Context,req*publishpb.UpdatePhotoRequest,opts...gax.CallOption)(*publishpb.Photo,error)UpdatePhoto updates the metadata of a [Photo][google.streetview.publish.v1.Photo (athttp://google.streetview.publish.v1.Photo)], suchas pose, place association, connections, etc. Changing the pixels of aphoto is not supported.
Only the fields specified in theupdateMaskfield are used. If updateMask is not present, the update applies to allfields.
This method returns the following error codes:
google.rpc.Code.PERMISSION_DENIED ifthe requesting user did not create the requested photo.google.rpc.Code.INVALID_ARGUMENT ifthe request is malformed.google.rpc.Code.NOT_FOUND if the requestedphoto does not exist.google.rpc.Code.UNAVAILABLE if therequested [Photo][google.streetview.publish.v1.Photo (at http://google.streetview.publish.v1.Photo)] is still beingindexed.Example
packagemainimport("context"publish"cloud.google.com/go/streetview/publish/apiv1"publishpb"cloud.google.com/go/streetview/publish/apiv1/publishpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=publish.NewStreetViewPublishClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&publishpb.UpdatePhotoRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/streetview/publish/apiv1/publishpb#UpdatePhotoRequest.}resp,err:=c.UpdatePhoto(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-30 UTC.