// Package streetviewpublish provides access to the Street View Publish API. // // See https://developers.google.com/streetview/publish/ // // Usage example: // // import "google.golang.org/api/streetviewpublish/v1" // ... // streetviewpublishService, err := streetviewpublish.New(oauthHttpClient) package streetviewpublish // import "google.golang.org/api/streetviewpublish/v1" import ( "bytes" "encoding/json" "errors" "fmt" context "golang.org/x/net/context" ctxhttp "golang.org/x/net/context/ctxhttp" gensupport "google.golang.org/api/gensupport" googleapi "google.golang.org/api/googleapi" "io" "net/http" "net/url" "strconv" "strings" ) // Always reference these packages, just in case the auto-generated code // below doesn't. var _ = bytes.NewBuffer var _ = strconv.Itoa var _ = fmt.Sprintf var _ = json.NewDecoder var _ = io.Copy var _ = url.Parse var _ = gensupport.MarshalJSON var _ = googleapi.Version var _ = errors.New var _ = strings.Replace var _ = context.Canceled var _ = ctxhttp.Do const apiId = "streetviewpublish:v1" const apiName = "streetviewpublish" const apiVersion = "v1" const basePath = "https://streetviewpublish.googleapis.com/" // OAuth2 scopes used by this API. const ( // Publish and manage your 360 photos on Google Street View StreetviewpublishScope = "https://www.googleapis.com/auth/streetviewpublish" ) func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } s := &Service{client: client, BasePath: basePath} s.Photo = NewPhotoService(s) s.Photos = NewPhotosService(s) return s, nil } type Service struct { client *http.Client BasePath string // API endpoint base URL UserAgent string // optional additional User-Agent fragment Photo *PhotoService Photos *PhotosService } func (s *Service) userAgent() string { if s.UserAgent == "" { return googleapi.UserAgent } return googleapi.UserAgent + " " + s.UserAgent } func NewPhotoService(s *Service) *PhotoService { rs := &PhotoService{s: s} return rs } type PhotoService struct { s *Service } func NewPhotosService(s *Service) *PhotosService { rs := &PhotosService{s: s} return rs } type PhotosService struct { s *Service } // BatchDeletePhotosRequest: Request to delete multiple Photos. type BatchDeletePhotosRequest struct { // PhotoIds: Required. IDs of the Photos. For HTTP // GET requests, the URL query parameter should // be // `photoIds=&photoIds=&...`. PhotoIds []string `json:"photoIds,omitempty"` // ForceSendFields is a list of field names (e.g. "PhotoIds") 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. "PhotoIds") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *BatchDeletePhotosRequest) MarshalJSON() ([]byte, error) { type noMethod BatchDeletePhotosRequest raw := noMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // BatchDeletePhotosResponse: Response to batch delete of one or // more // Photos. type BatchDeletePhotosResponse struct { // Status: The status for the operation to delete a single // Photo in the batch request. Status []*Status `json:"status,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "Status") 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. "Status") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *BatchDeletePhotosResponse) MarshalJSON() ([]byte, error) { type noMethod BatchDeletePhotosResponse raw := noMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // BatchGetPhotosResponse: Response to batch get of Photos. type BatchGetPhotosResponse struct { // Results: List of results for each individual // Photo requested, in the same order as // the requests in // BatchGetPhotos. Results []*PhotoResponse `json:"results,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "Results") 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. "Results") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *BatchGetPhotosResponse) MarshalJSON() ([]byte, error) { type noMethod BatchGetPhotosResponse raw := noMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // BatchUpdatePhotosRequest: Request to update the metadata of // photos. // Updating the pixels of photos is not supported. type BatchUpdatePhotosRequest struct { // UpdatePhotoRequests: Required. List of // UpdatePhotoRequests. UpdatePhotoRequests []*UpdatePhotoRequest `json:"updatePhotoRequests,omitempty"` // ForceSendFields is a list of field names (e.g. "UpdatePhotoRequests") // 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. "UpdatePhotoRequests") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` } func (s *BatchUpdatePhotosRequest) MarshalJSON() ([]byte, error) { type noMethod BatchUpdatePhotosRequest raw := noMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // BatchUpdatePhotosResponse: Response to batch update of metadata of // one or more // Photos. type BatchUpdatePhotosResponse struct { // Results: List of results for each individual // Photo updated, in the same order as // the request. Results []*PhotoResponse `json:"results,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "Results") 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. "Results") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *BatchUpdatePhotosResponse) MarshalJSON() ([]byte, error) { type noMethod BatchUpdatePhotosResponse raw := noMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // Connection: A connection is the link from a source photo to a // destination photo. type Connection struct { // Target: Required. The destination of the connection from the // containing photo to // another photo. Target *PhotoId `json:"target,omitempty"` // ForceSendFields is a list of field names (e.g. "Target") 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. "Target") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *Connection) MarshalJSON() ([]byte, error) { type noMethod Connection raw := noMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // Empty: A generic empty message that you can re-use to avoid defining // duplicated // empty messages in your APIs. A typical example is to use it as the // request // or the response type of an API method. For instance: // // service Foo { // rpc Bar(google.protobuf.Empty) returns // (google.protobuf.Empty); // } // // The JSON representation for `Empty` is empty JSON object `{}`. type Empty struct { // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` } // LatLng: An object representing a latitude/longitude pair. This is // expressed as a pair // of doubles representing degrees latitude and degrees longitude. // Unless // specified otherwise, this must conform to the // WGS84 // st // andard. Values must be within normalized ranges. // // Example of normalization code in Python: // // def NormalizeLongitude(longitude): // """Wraps decimal degrees longitude to [-180.0, 180.0].""" // q, r = divmod(longitude, 360.0) // if r > 180.0 or (r == 180.0 and q <= -1.0): // return r - 360.0 // return r // // def NormalizeLatLng(latitude, longitude): // """Wraps decimal degrees latitude and longitude to // [-90.0, 90.0] and [-180.0, 180.0], respectively.""" // r = latitude % 360.0 // if r <= 90.0: // return r, NormalizeLongitude(longitude) // elif r >= 270.0: // return r - 360, NormalizeLongitude(longitude) // else: // return 180 - r, NormalizeLongitude(longitude + 180.0) // // assert 180.0 == NormalizeLongitude(180.0) // assert -180.0 == NormalizeLongitude(-180.0) // assert -179.0 == NormalizeLongitude(181.0) // assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0) // assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0) // assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0) // assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0) // assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0) // assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0) // assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0) // assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0) // assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0) // assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0) type LatLng struct { // Latitude: The latitude in degrees. It must be in the range [-90.0, // +90.0]. Latitude float64 `json:"latitude,omitempty"` // Longitude: The longitude in degrees. It must be in the range [-180.0, // +180.0]. Longitude float64 `json:"longitude,omitempty"` // ForceSendFields is a list of field names (e.g. "Latitude") to // unconditionally include in API requests. By default, fields with // empty values are omitted from API requests. However, any non-pointer, // non-interface field appearing in ForceSendFields will be sent to the // server regardless of whether the field is empty or not. This may be // used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Latitude") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *LatLng) MarshalJSON() ([]byte, error) { type noMethod LatLng raw := noMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } func (s *LatLng) UnmarshalJSON(data []byte) error { type noMethod LatLng var s1 struct { Latitude gensupport.JSONFloat64 `json:"latitude"` Longitude gensupport.JSONFloat64 `json:"longitude"` *noMethod } s1.noMethod = (*noMethod)(s) if err := json.Unmarshal(data, &s1); err != nil { return err } s.Latitude = float64(s1.Latitude) s.Longitude = float64(s1.Longitude) return nil } // Level: Level information containing level number and its // corresponding name. type Level struct { // Name: Required. A name assigned to this Level, restricted to 3 // characters. // Consider how the elevator buttons would be labeled for this level if // there // was an elevator. Name string `json:"name,omitempty"` // Number: Floor number, used for ordering. 0 indicates the ground // level, 1 indicates // the first level above ground level, -1 indicates the first level // under // ground level. Non-integer values are OK. Number float64 `json:"number,omitempty"` // ForceSendFields is a list of field names (e.g. "Name") 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. "Name") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *Level) MarshalJSON() ([]byte, error) { type noMethod Level raw := noMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } func (s *Level) UnmarshalJSON(data []byte) error { type noMethod Level var s1 struct { Number gensupport.JSONFloat64 `json:"number"` *noMethod } s1.noMethod = (*noMethod)(s) if err := json.Unmarshal(data, &s1); err != nil { return err } s.Number = float64(s1.Number) return nil } // ListPhotosResponse: Response to list all photos that belong to a // user. type ListPhotosResponse struct { // NextPageToken: Token to retrieve the next page of results, or empty // if there are no more // results in the list. NextPageToken string `json:"nextPageToken,omitempty"` // Photos: List of photos. The maximum number of items returned is based // on the // pageSize field // in the request. Photos []*Photo `json:"photos,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 (s *ListPhotosResponse) MarshalJSON() ([]byte, error) { type noMethod ListPhotosResponse raw := noMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // Photo: Photo is used to store 360 photos along with photo metadata. type Photo struct { // CaptureTime: Absolute time when the photo was captured. // When the photo has no exif timestamp, this is used to set a timestamp // in // the photo metadata. CaptureTime string `json:"captureTime,omitempty"` // Connections: Connections to other photos. A connection represents the // link from this // photo to another photo. Connections []*Connection `json:"connections,omitempty"` // DownloadUrl: Output only. The download URL for the photo bytes. This // field is set only // when // GetPhotoRequest.view // is set to // PhotoView.INCLUDE_DOWNLOAD_URL. DownloadUrl string `json:"downloadUrl,omitempty"` // PhotoId: Required when updating photo. Output only when creating // photo. // Identifier for the photo, which is unique among all photos in // Google. PhotoId *PhotoId `json:"photoId,omitempty"` // Places: Places where this photo belongs. Places []*Place `json:"places,omitempty"` // Pose: Pose of the photo. Pose *Pose `json:"pose,omitempty"` // ShareLink: Output only. The share link for the photo. ShareLink string `json:"shareLink,omitempty"` // ThumbnailUrl: Output only. The thumbnail URL for showing a preview of // the given photo. ThumbnailUrl string `json:"thumbnailUrl,omitempty"` // UploadReference: Required when creating photo. Input only. The // resource URL where the photo // bytes are uploaded to. UploadReference *UploadRef `json:"uploadReference,omitempty"` // ViewCount: Output only. View count of the photo. ViewCount int64 `json:"viewCount,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. "CaptureTime") 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. "CaptureTime") to include // in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. However, any field with // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *Photo) MarshalJSON() ([]byte, error) { type noMethod Photo raw := noMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // PhotoId: Identifier for a Photo. type PhotoId struct { // Id: Required. A base64 encoded identifier. Id string `json:"id,omitempty"` // ForceSendFields is a list of field names (e.g. "Id") to // unconditionally include in API requests. By default, fields with // empty values are omitted from API requests. However, any non-pointer, // non-interface field appearing in ForceSendFields will be sent to the // server regardless of whether the field is empty or not. This may be // used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Id") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *PhotoId) MarshalJSON() ([]byte, error) { type noMethod PhotoId raw := noMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // PhotoResponse: Response payload for a single // Photo // in batch operations including // BatchGetPhotos // and // BatchUpdatePhotos. type PhotoResponse struct { // Photo: The Photo resource, if the request // was successful. Photo *Photo `json:"photo,omitempty"` // Status: The status for the operation to get or update a single photo // in the batch // request. Status *Status `json:"status,omitempty"` // ForceSendFields is a list of field names (e.g. "Photo") 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. "Photo") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *PhotoResponse) MarshalJSON() ([]byte, error) { type noMethod PhotoResponse raw := noMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // Place: Place metadata for an entity. type Place struct { // PlaceId: Required. Place identifier, as described // in // https://developers.google.com/places/place-id. PlaceId string `json:"placeId,omitempty"` // ForceSendFields is a list of field names (e.g. "PlaceId") 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. "PlaceId") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *Place) MarshalJSON() ([]byte, error) { type noMethod Place raw := noMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // Pose: Raw pose measurement for an entity. type Pose struct { // Altitude: Altitude of the pose in meters above ground level (as // defined by WGS84). // NaN indicates an unmeasured quantity. Altitude float64 `json:"altitude,omitempty"` // Heading: Compass heading, measured at the center of the photo in // degrees clockwise // from North. Value must be >=0 and <360. // NaN indicates an unmeasured quantity. Heading float64 `json:"heading,omitempty"` // LatLngPair: Latitude and longitude pair of the pose, as explained // here: // https://cloud.google.com/datastore/docs/reference/rest/Shared.Ty // pes/LatLng // When creating a Photo, if the // latitude and longitude pair are not provided here, the geolocation // from the // exif header will be used. If the latitude and longitude pair is // not // provided and cannot be found in the exif header, the create photo // process // will fail. LatLngPair *LatLng `json:"latLngPair,omitempty"` // Level: Level (the floor in a building) used to configure vertical // navigation. Level *Level `json:"level,omitempty"` // Pitch: Pitch, measured at the center of the photo in degrees. Value // must be >=-90 // and <= 90. A value of -90 means looking directly down, and a value of // 90 // means looking directly up. // NaN indicates an unmeasured quantity. Pitch float64 `json:"pitch,omitempty"` // Roll: Roll, measured in degrees. Value must be >= 0 and <360. A value // of 0 // means level with the horizon. // NaN indicates an unmeasured quantity. Roll float64 `json:"roll,omitempty"` // ForceSendFields is a list of field names (e.g. "Altitude") 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. "Altitude") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *Pose) MarshalJSON() ([]byte, error) { type noMethod Pose raw := noMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } func (s *Pose) UnmarshalJSON(data []byte) error { type noMethod Pose var s1 struct { Altitude gensupport.JSONFloat64 `json:"altitude"` Heading gensupport.JSONFloat64 `json:"heading"` Pitch gensupport.JSONFloat64 `json:"pitch"` Roll gensupport.JSONFloat64 `json:"roll"` *noMethod } s1.noMethod = (*noMethod)(s) if err := json.Unmarshal(data, &s1); err != nil { return err } s.Altitude = float64(s1.Altitude) s.Heading = float64(s1.Heading) s.Pitch = float64(s1.Pitch) s.Roll = float64(s1.Roll) return nil } // 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. 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:"-"` } func (s *Status) MarshalJSON() ([]byte, error) { type noMethod Status raw := noMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // UpdatePhotoRequest: Request to update the metadata of a // Photo. Updating the pixels of a photo // is not supported. type UpdatePhotoRequest struct { // Photo: Required. Photo object containing the // new metadata. Only the fields specified in // updateMask // field are used. If `updateMask` is not present, the update applies to // all // fields.