Debian Codegraph @

streetviewpublish/v1/streetviewpublish-gen.go

raw symbols SCIP
1 // Copyright 2026 Google LLC.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 // Code generated file. DO NOT EDIT.
6
7 // Package streetviewpublish provides access to the Street View Publish API.
8 //
9 // For product documentation, see: https://developers.google.com/streetview/publish/
10 //
11 // # Library status
12 //
13 // These client libraries are officially supported by Google. However, this
14 // library is considered complete and is in maintenance mode. This means
15 // that we will address critical bugs and security issues but will not add
16 // any new features.
17 //
18 // When possible, we recommend using our newer
19 // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
20 // that are still actively being worked and iterated on.
21 //
22 // # Creating a client
23 //
24 // Usage example:
25 //
26 // import "google.golang.org/api/streetviewpublish/v1"
27 // ...
28 // ctx := context.Background()
29 // streetviewpublishService, err := streetviewpublish.NewService(ctx)
30 //
31 // In this example, Google Application Default Credentials are used for
32 // authentication. For information on how to create and obtain Application
33 // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
34 //
35 // # Other authentication options
36 //
37 // To use an API key for authentication (note: some APIs do not support API
38 // keys), use [google.golang.org/api/option.WithAPIKey]:
39 //
40 // streetviewpublishService, err := streetviewpublish.NewService(ctx, option.WithAPIKey("AIza..."))
41 //
42 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
43 // flow, use [google.golang.org/api/option.WithTokenSource]:
44 //
45 // config := &oauth2.Config{...}
46 // // ...
47 // token, err := config.Exchange(ctx, ...)
48 // streetviewpublishService, err := streetviewpublish.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
49 //
50 // See [google.golang.org/api/option.ClientOption] for details on options.
51 package streetviewpublish // import "google.golang.org/api/streetviewpublish/v1"
52
53 import (
54 "bytes"
55 "context"
56 "encoding/json"
57 "errors"
58 "fmt"
59 "io"
60 "log/slog"
61 "net/http"
62 "net/url"
63 "strconv"
64 "strings"
65
66 "github.com/googleapis/gax-go/v2/internallog"
67 googleapi "google.golang.org/api/googleapi"
68 internal "google.golang.org/api/internal"
69 gensupport "google.golang.org/api/internal/gensupport"
70 option "google.golang.org/api/option"
71 internaloption "google.golang.org/api/option/internaloption"
72 htransport "google.golang.org/api/transport/http"
73 )
74
75 // Always reference these packages, just in case the auto-generated code
76 // below doesn't.
77 var _ = bytes.NewBuffer
78 var _ = strconv.Itoa
79 var _ = fmt.Sprintf
80 var _ = json.NewDecoder
81 var _ = io.Copy
82 var _ = url.Parse
83 var _ = gensupport.MarshalJSON
84 var _ = googleapi.Version
85 var _ = errors.New
86 var _ = strings.Replace
87 var _ = context.Canceled
88 var _ = internaloption.WithDefaultEndpoint
89 var _ = internal.Version
90 var _ = internallog.New
91
92 const apiId = "streetviewpublish:v1"
93 const apiName = "streetviewpublish"
94 const apiVersion = "v1"
95 const basePath = "https://streetviewpublish.googleapis.com/"
96 const basePathTemplate = "https://streetviewpublish.UNIVERSE_DOMAIN/"
97 const mtlsBasePath = "https://streetviewpublish.mtls.googleapis.com/"
98
99 // OAuth2 scopes used by this API.
100 const (
101 // Publish and manage your 360 photos on Google Street View
102 StreetviewpublishScope = "https://www.googleapis.com/auth/streetviewpublish"
103 )
104
105 // NewService creates a new Service.
106 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
107 scopesOption := internaloption.WithDefaultScopes(
108 "https://www.googleapis.com/auth/streetviewpublish",
109 )
110 // NOTE: prepend, so we don't override user-specified scopes.
111 opts = append([]option.ClientOption{scopesOption}, opts...)
112 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
113 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
114 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
115 opts = append(opts, internaloption.EnableNewAuthLibrary())
116 client, endpoint, err := htransport.NewClient(ctx, opts...)
117 if err != nil {
118 return nil, err
119 }
120 s := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)}
121 s.Photo = NewPhotoService(s)
122 s.PhotoSequence = NewPhotoSequenceService(s)
123 s.PhotoSequences = NewPhotoSequencesService(s)
124 s.Photos = NewPhotosService(s)
125 if endpoint != "" {
126 s.BasePath = endpoint
127 }
128 return s, nil
129 }
130
131 // New creates a new Service. It uses the provided http.Client for requests.
132 //
133 // Deprecated: please use NewService instead.
134 // To provide a custom HTTP client, use option.WithHTTPClient.
135 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
136 func New(client *http.Client) (*Service, error) {
137 if client == nil {
138 return nil, errors.New("client is nil")
139 }
140 return NewService(context.TODO(), option.WithHTTPClient(client))
141 }
142
143 type Service struct {
144 client *http.Client
145 logger *slog.Logger
146 BasePath string // API endpoint base URL
147 UserAgent string // optional additional User-Agent fragment
148
149 Photo *PhotoService
150
151 PhotoSequence *PhotoSequenceService
152
153 PhotoSequences *PhotoSequencesService
154
155 Photos *PhotosService
156 }
157
158 func (s *Service) userAgent() string {
159 if s.UserAgent == "" {
160 return googleapi.UserAgent
161 }
162 return googleapi.UserAgent + " " + s.UserAgent
163 }
164
165 func NewPhotoService(s *Service) *PhotoService {
166 rs := &PhotoService{s: s}
167 return rs
168 }
169
170 type PhotoService struct {
171 s *Service
172 }
173
174 func NewPhotoSequenceService(s *Service) *PhotoSequenceService {
175 rs := &PhotoSequenceService{s: s}
176 return rs
177 }
178
179 type PhotoSequenceService struct {
180 s *Service
181 }
182
183 func NewPhotoSequencesService(s *Service) *PhotoSequencesService {
184 rs := &PhotoSequencesService{s: s}
185 return rs
186 }
187
188 type PhotoSequencesService struct {
189 s *Service
190 }
191
192 func NewPhotosService(s *Service) *PhotosService {
193 rs := &PhotosService{s: s}
194 return rs
195 }
196
197 type PhotosService struct {
198 s *Service
199 }
200
201 // BatchDeletePhotosRequest: Request to delete multiple Photos.
202 type BatchDeletePhotosRequest struct {
203 // PhotoIds: Required. IDs of the Photos. HTTP GET requests require the
204 // following syntax for the URL query parameter: `photoIds=&photoIds=&...`.
205 PhotoIds []string `json:"photoIds,omitempty"`
206 // ForceSendFields is a list of field names (e.g. "PhotoIds") to
207 // unconditionally include in API requests. By default, fields with empty or
208 // default values are omitted from API requests. See
209 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
210 // details.
211 ForceSendFields []string `json:"-"`
212 // NullFields is a list of field names (e.g. "PhotoIds") to include in API
213 // requests with the JSON null value. By default, fields with empty values are
214 // omitted from API requests. See
215 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
216 NullFields []string `json:"-"`
217 }
218
219 func (s BatchDeletePhotosRequest) MarshalJSON() ([]byte, error) {
220 type NoMethod BatchDeletePhotosRequest
221 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
222 }
223
224 // BatchDeletePhotosResponse: Response to batch delete of one or more Photos.
225 type BatchDeletePhotosResponse struct {
226 // Status: The status for the operation to delete a single Photo in the batch
227 // request.
228 Status []*Status `json:"status,omitempty"`
229
230 // ServerResponse contains the HTTP response code and headers from the server.
231 googleapi.ServerResponse `json:"-"`
232 // ForceSendFields is a list of field names (e.g. "Status") to unconditionally
233 // include in API requests. By default, fields with empty or default values are
234 // omitted from API requests. See
235 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
236 // details.
237 ForceSendFields []string `json:"-"`
238 // NullFields is a list of field names (e.g. "Status") to include in API
239 // requests with the JSON null value. By default, fields with empty values are
240 // omitted from API requests. See
241 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
242 NullFields []string `json:"-"`
243 }
244
245 func (s BatchDeletePhotosResponse) MarshalJSON() ([]byte, error) {
246 type NoMethod BatchDeletePhotosResponse
247 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
248 }
249
250 // BatchGetPhotosResponse: Response to batch get of Photos.
251 type BatchGetPhotosResponse struct {
252 // Results: List of results for each individual Photo requested, in the same
253 // order as the requests in BatchGetPhotos.
254 Results []*PhotoResponse `json:"results,omitempty"`
255
256 // ServerResponse contains the HTTP response code and headers from the server.
257 googleapi.ServerResponse `json:"-"`
258 // ForceSendFields is a list of field names (e.g. "Results") to unconditionally
259 // include in API requests. By default, fields with empty or default values are
260 // omitted from API requests. See
261 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
262 // details.
263 ForceSendFields []string `json:"-"`
264 // NullFields is a list of field names (e.g. "Results") to include in API
265 // requests with the JSON null value. By default, fields with empty values are
266 // omitted from API requests. See
267 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
268 NullFields []string `json:"-"`
269 }
270
271 func (s BatchGetPhotosResponse) MarshalJSON() ([]byte, error) {
272 type NoMethod BatchGetPhotosResponse
273 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
274 }
275
276 // BatchUpdatePhotosRequest: Request to update the metadata of photos. Updating
277 // the pixels of photos is not supported.
278 type BatchUpdatePhotosRequest struct {
279 // UpdatePhotoRequests: Required. List of UpdatePhotoRequests.
280 UpdatePhotoRequests []*UpdatePhotoRequest `json:"updatePhotoRequests,omitempty"`
281 // ForceSendFields is a list of field names (e.g. "UpdatePhotoRequests") to
282 // unconditionally include in API requests. By default, fields with empty or
283 // default values are omitted from API requests. See
284 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
285 // details.
286 ForceSendFields []string `json:"-"`
287 // NullFields is a list of field names (e.g. "UpdatePhotoRequests") to include
288 // in API requests with the JSON null value. By default, fields with empty
289 // values are omitted from API requests. See
290 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
291 NullFields []string `json:"-"`
292 }
293
294 func (s BatchUpdatePhotosRequest) MarshalJSON() ([]byte, error) {
295 type NoMethod BatchUpdatePhotosRequest
296 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
297 }
298
299 // BatchUpdatePhotosResponse: Response to batch update of metadata of one or
300 // more Photos.
301 type BatchUpdatePhotosResponse struct {
302 // Results: List of results for each individual Photo updated, in the same
303 // order as the request.
304 Results []*PhotoResponse `json:"results,omitempty"`
305
306 // ServerResponse contains the HTTP response code and headers from the server.
307 googleapi.ServerResponse `json:"-"`
308 // ForceSendFields is a list of field names (e.g. "Results") to unconditionally
309 // include in API requests. By default, fields with empty or default values are
310 // omitted from API requests. See
311 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
312 // details.
313 ForceSendFields []string `json:"-"`
314 // NullFields is a list of field names (e.g. "Results") to include in API
315 // requests with the JSON null value. By default, fields with empty values are
316 // omitted from API requests. See
317 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
318 NullFields []string `json:"-"`
319 }
320
321 func (s BatchUpdatePhotosResponse) MarshalJSON() ([]byte, error) {
322 type NoMethod BatchUpdatePhotosResponse
323 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
324 }
325
326 // Connection: A connection is the link from a source photo to a destination
327 // photo.
328 type Connection struct {
329 // Target: Required. The destination of the connection from the containing
330 // photo to another photo.
331 Target *PhotoId `json:"target,omitempty"`
332 // ForceSendFields is a list of field names (e.g. "Target") to unconditionally
333 // include in API requests. By default, fields with empty or default values are
334 // omitted from API requests. See
335 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
336 // details.
337 ForceSendFields []string `json:"-"`
338 // NullFields is a list of field names (e.g. "Target") to include in API
339 // requests with the JSON null value. By default, fields with empty values are
340 // omitted from API requests. See
341 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
342 NullFields []string `json:"-"`
343 }
344
345 func (s Connection) MarshalJSON() ([]byte, error) {
346 type NoMethod Connection
347 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
348 }
349
350 // Empty: A generic empty message that you can re-use to avoid defining
351 // duplicated empty messages in your APIs. A typical example is to use it as
352 // the request or the response type of an API method. For instance: service Foo
353 // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
354 type Empty struct {
355 // ServerResponse contains the HTTP response code and headers from the server.
356 googleapi.ServerResponse `json:"-"`
357 }
358
359 // GpsDataGapFailureDetails: Details related to
360 // ProcessingFailureReason#GPS_DATA_GAP. If there are multiple GPS data gaps,
361 // only the one with the largest duration is reported here.
362 type GpsDataGapFailureDetails struct {
363 // GapDuration: The duration of the gap in GPS data that was found.
364 GapDuration string `json:"gapDuration,omitempty"`
365 // GapStartTime: Relative time (from the start of the video stream) when the
366 // gap started.
367 GapStartTime string `json:"gapStartTime,omitempty"`
368 // ForceSendFields is a list of field names (e.g. "GapDuration") to
369 // unconditionally include in API requests. By default, fields with empty or
370 // default values are omitted from API requests. See
371 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
372 // details.
373 ForceSendFields []string `json:"-"`
374 // NullFields is a list of field names (e.g. "GapDuration") to include in API
375 // requests with the JSON null value. By default, fields with empty values are
376 // omitted from API requests. See
377 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
378 NullFields []string `json:"-"`
379 }
380
381 func (s GpsDataGapFailureDetails) MarshalJSON() ([]byte, error) {
382 type NoMethod GpsDataGapFailureDetails
383 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
384 }
385
386 // Imu: IMU data from the device sensors.
387 type Imu struct {
388 // AccelMpsps: The accelerometer measurements in meters/sec^2 with increasing
389 // timestamps from devices.
390 AccelMpsps []*Measurement3d `json:"accelMpsps,omitempty"`
391 // GyroRps: The gyroscope measurements in radians/sec with increasing
392 // timestamps from devices.
393 GyroRps []*Measurement3d `json:"gyroRps,omitempty"`
394 // MagUt: The magnetometer measurements of the magnetic field in microtesla
395 // (uT) with increasing timestamps from devices.
396 MagUt []*Measurement3d `json:"magUt,omitempty"`
397 // ForceSendFields is a list of field names (e.g. "AccelMpsps") to
398 // unconditionally include in API requests. By default, fields with empty or
399 // default values are omitted from API requests. See
400 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
401 // details.
402 ForceSendFields []string `json:"-"`
403 // NullFields is a list of field names (e.g. "AccelMpsps") to include in API
404 // requests with the JSON null value. By default, fields with empty values are
405 // omitted from API requests. See
406 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
407 NullFields []string `json:"-"`
408 }
409
410 func (s Imu) MarshalJSON() ([]byte, error) {
411 type NoMethod Imu
412 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
413 }
414
415 // ImuDataGapFailureDetails: Details related to
416 // ProcessingFailureReason#IMU_DATA_GAP. If there are multiple IMU data gaps,
417 // only the one with the largest duration is reported here.
418 type ImuDataGapFailureDetails struct {
419 // GapDuration: The duration of the gap in IMU data that was found.
420 GapDuration string `json:"gapDuration,omitempty"`
421 // GapStartTime: Relative time (from the start of the video stream) when the
422 // gap started.
423 GapStartTime string `json:"gapStartTime,omitempty"`
424 // ForceSendFields is a list of field names (e.g. "GapDuration") to
425 // unconditionally include in API requests. By default, fields with empty or
426 // default values are omitted from API requests. See
427 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
428 // details.
429 ForceSendFields []string `json:"-"`
430 // NullFields is a list of field names (e.g. "GapDuration") to include in API
431 // requests with the JSON null value. By default, fields with empty values are
432 // omitted from API requests. See
433 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
434 NullFields []string `json:"-"`
435 }
436
437 func (s ImuDataGapFailureDetails) MarshalJSON() ([]byte, error) {
438 type NoMethod ImuDataGapFailureDetails
439 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
440 }
441
442 // InsufficientGpsFailureDetails: Details related to
443 // ProcessingFailureReason#INSUFFICIENT_GPS.
444 type InsufficientGpsFailureDetails struct {
445 // GpsPointsFound: The number of GPS points that were found in the video.
446 GpsPointsFound int64 `json:"gpsPointsFound,omitempty"`
447 // ForceSendFields is a list of field names (e.g. "GpsPointsFound") to
448 // unconditionally include in API requests. By default, fields with empty or
449 // default values are omitted from API requests. See
450 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
451 // details.
452 ForceSendFields []string `json:"-"`
453 // NullFields is a list of field names (e.g. "GpsPointsFound") to include in
454 // API requests with the JSON null value. By default, fields with empty values
455 // are omitted from API requests. See
456 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
457 NullFields []string `json:"-"`
458 }
459
460 func (s InsufficientGpsFailureDetails) MarshalJSON() ([]byte, error) {
461 type NoMethod InsufficientGpsFailureDetails
462 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
463 }
464
465 // LatLng: An object that represents a latitude/longitude pair. This is
466 // expressed as a pair of doubles to represent degrees latitude and degrees
467 // longitude. Unless specified otherwise, this object must conform to the WGS84
468 // standard. Values must be within normalized ranges.
469 type LatLng struct {
470 // Latitude: The latitude in degrees. It must be in the range [-90.0, +90.0].
471 Latitude float64 `json:"latitude,omitempty"`
472 // Longitude: The longitude in degrees. It must be in the range [-180.0,
473 // +180.0].
474 Longitude float64 `json:"longitude,omitempty"`
475 // ForceSendFields is a list of field names (e.g. "Latitude") to
476 // unconditionally include in API requests. By default, fields with empty or
477 // default values are omitted from API requests. See
478 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
479 // details.
480 ForceSendFields []string `json:"-"`
481 // NullFields is a list of field names (e.g. "Latitude") to include in API
482 // requests with the JSON null value. By default, fields with empty values are
483 // omitted from API requests. See
484 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
485 NullFields []string `json:"-"`
486 }
487
488 func (s LatLng) MarshalJSON() ([]byte, error) {
489 type NoMethod LatLng
490 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
491 }
492
493 func (s *LatLng) UnmarshalJSON(data []byte) error {
494 type NoMethod LatLng
495 var s1 struct {
496 Latitude gensupport.JSONFloat64 `json:"latitude"`
497 Longitude gensupport.JSONFloat64 `json:"longitude"`
498 *NoMethod
499 }
500 s1.NoMethod = (*NoMethod)(s)
501 if err := json.Unmarshal(data, &s1); err != nil {
502 return err
503 }
504 s.Latitude = float64(s1.Latitude)
505 s.Longitude = float64(s1.Longitude)
506 return nil
507 }
508
509 // LatLngBounds: A rectangle in geographical coordinates.
510 type LatLngBounds struct {
511 // Northeast: The northeast corner of these bounds.
512 Northeast *LatLng `json:"northeast,omitempty"`
513 // Southwest: The southwest corner of these bounds.
514 Southwest *LatLng `json:"southwest,omitempty"`
515 // ForceSendFields is a list of field names (e.g. "Northeast") to
516 // unconditionally include in API requests. By default, fields with empty or
517 // default values are omitted from API requests. See
518 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
519 // details.
520 ForceSendFields []string `json:"-"`
521 // NullFields is a list of field names (e.g. "Northeast") to include in API
522 // requests with the JSON null value. By default, fields with empty values are
523 // omitted from API requests. See
524 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
525 NullFields []string `json:"-"`
526 }
527
528 func (s LatLngBounds) MarshalJSON() ([]byte, error) {
529 type NoMethod LatLngBounds
530 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
531 }
532
533 // Level: Level information containing level number and its corresponding name.
534 type Level struct {
535 // Name: Required. A name assigned to this Level, restricted to 3 characters.
536 // Consider how the elevator buttons would be labeled for this level if there
537 // was an elevator.
538 Name string `json:"name,omitempty"`
539 // Number: Optional. Floor number, used for ordering. 0 indicates the ground
540 // level, 1 indicates the first level above ground level, -1 indicates the
541 // first level under ground level. Non-integer values are OK.
542 Number float64 `json:"number,omitempty"`
543 // ForceSendFields is a list of field names (e.g. "Name") to unconditionally
544 // include in API requests. By default, fields with empty or default values are
545 // omitted from API requests. See
546 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
547 // details.
548 ForceSendFields []string `json:"-"`
549 // NullFields is a list of field names (e.g. "Name") to include in API requests
550 // with the JSON null value. By default, fields with empty values are omitted
551 // from API requests. See
552 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
553 NullFields []string `json:"-"`
554 }
555
556 func (s Level) MarshalJSON() ([]byte, error) {
557 type NoMethod Level
558 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
559 }
560
561 func (s *Level) UnmarshalJSON(data []byte) error {
562 type NoMethod Level
563 var s1 struct {
564 Number gensupport.JSONFloat64 `json:"number"`
565 *NoMethod
566 }
567 s1.NoMethod = (*NoMethod)(s)
568 if err := json.Unmarshal(data, &s1); err != nil {
569 return err
570 }
571 s.Number = float64(s1.Number)
572 return nil
573 }
574
575 // ListPhotoSequencesResponse: Response to list all photo sequences that belong
576 // to a user.
577 type ListPhotoSequencesResponse struct {
578 // NextPageToken: Token to retrieve the next page of results, or empty if there
579 // are no more results in the list.
580 NextPageToken string `json:"nextPageToken,omitempty"`
581 // PhotoSequences: List of photo sequences via Operation interface. The maximum
582 // number of items returned is based on the pageSize field in the request. Each
583 // item in the list can have three possible states, * `Operation.done` = false,
584 // if the processing of PhotoSequence is not finished yet. * `Operation.done` =
585 // true and `Operation.error` is populated, if there was an error in
586 // processing. * `Operation.done` = true and `Operation.response` contains a
587 // PhotoSequence message, In each sequence, only Id is populated.
588 PhotoSequences []*Operation `json:"photoSequences,omitempty"`
589
590 // ServerResponse contains the HTTP response code and headers from the server.
591 googleapi.ServerResponse `json:"-"`
592 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
593 // unconditionally include in API requests. By default, fields with empty or
594 // default values are omitted from API requests. See
595 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
596 // details.
597 ForceSendFields []string `json:"-"`
598 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
599 // requests with the JSON null value. By default, fields with empty values are
600 // omitted from API requests. See
601 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
602 NullFields []string `json:"-"`
603 }
604
605 func (s ListPhotoSequencesResponse) MarshalJSON() ([]byte, error) {
606 type NoMethod ListPhotoSequencesResponse
607 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
608 }
609
610 // ListPhotosResponse: Response to list all photos that belong to a user.
611 type ListPhotosResponse struct {
612 // NextPageToken: Token to retrieve the next page of results, or empty if there
613 // are no more results in the list.
614 NextPageToken string `json:"nextPageToken,omitempty"`
615 // Photos: List of photos. The pageSize field in the request determines the
616 // number of items returned.
617 Photos []*Photo `json:"photos,omitempty"`
618
619 // ServerResponse contains the HTTP response code and headers from the server.
620 googleapi.ServerResponse `json:"-"`
621 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
622 // unconditionally include in API requests. By default, fields with empty or
623 // default values are omitted from API requests. See
624 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
625 // details.
626 ForceSendFields []string `json:"-"`
627 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
628 // requests with the JSON null value. By default, fields with empty values are
629 // omitted from API requests. See
630 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
631 NullFields []string `json:"-"`
632 }
633
634 func (s ListPhotosResponse) MarshalJSON() ([]byte, error) {
635 type NoMethod ListPhotosResponse
636 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
637 }
638
639 // Measurement3d: A Generic 3d measurement sample.
640 type Measurement3d struct {
641 // CaptureTime: The timestamp of the IMU measurement.
642 CaptureTime string `json:"captureTime,omitempty"`
643 // X: The sensor measurement in the x axis.
644 X float64 `json:"x,omitempty"`
645 // Y: The sensor measurement in the y axis.
646 Y float64 `json:"y,omitempty"`
647 // Z: The sensor measurement in the z axis.
648 Z float64 `json:"z,omitempty"`
649 // ForceSendFields is a list of field names (e.g. "CaptureTime") to
650 // unconditionally include in API requests. By default, fields with empty or
651 // default values are omitted from API requests. See
652 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
653 // details.
654 ForceSendFields []string `json:"-"`
655 // NullFields is a list of field names (e.g. "CaptureTime") to include in API
656 // requests with the JSON null value. By default, fields with empty values are
657 // omitted from API requests. See
658 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
659 NullFields []string `json:"-"`
660 }
661
662 func (s Measurement3d) MarshalJSON() ([]byte, error) {
663 type NoMethod Measurement3d
664 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
665 }
666
667 func (s *Measurement3d) UnmarshalJSON(data []byte) error {
668 type NoMethod Measurement3d
669 var s1 struct {
670 X gensupport.JSONFloat64 `json:"x"`
671 Y gensupport.JSONFloat64 `json:"y"`
672 Z gensupport.JSONFloat64 `json:"z"`
673 *NoMethod
674 }
675 s1.NoMethod = (*NoMethod)(s)
676 if err := json.Unmarshal(data, &s1); err != nil {
677 return err
678 }
679 s.X = float64(s1.X)
680 s.Y = float64(s1.Y)
681 s.Z = float64(s1.Z)
682 return nil
683 }
684
685 // NoOverlapGpsFailureDetails: Details related to
686 // PhotoSequenceProcessingFailureReason#NO_OVERLAP_GPS.
687 type NoOverlapGpsFailureDetails struct {
688 // GpsEndTime: Time of last recorded GPS point.
689 GpsEndTime string `json:"gpsEndTime,omitempty"`
690 // GpsStartTime: Time of first recorded GPS point.
691 GpsStartTime string `json:"gpsStartTime,omitempty"`
692 // VideoEndTime: End time of video.
693 VideoEndTime string `json:"videoEndTime,omitempty"`
694 // VideoStartTime: Start time of video.
695 VideoStartTime string `json:"videoStartTime,omitempty"`
696 // ForceSendFields is a list of field names (e.g. "GpsEndTime") to
697 // unconditionally include in API requests. By default, fields with empty or
698 // default values are omitted from API requests. See
699 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
700 // details.
701 ForceSendFields []string `json:"-"`
702 // NullFields is a list of field names (e.g. "GpsEndTime") to include in API
703 // requests with the JSON null value. By default, fields with empty values are
704 // omitted from API requests. See
705 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
706 NullFields []string `json:"-"`
707 }
708
709 func (s NoOverlapGpsFailureDetails) MarshalJSON() ([]byte, error) {
710 type NoMethod NoOverlapGpsFailureDetails
711 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
712 }
713
714 // NotOutdoorsFailureDetails: Details related to
715 // ProcessingFailureReason#NOT_OUTDOORS. If there are multiple indoor frames
716 // found, the first frame is recorded here.
717 type NotOutdoorsFailureDetails struct {
718 // StartTime: Relative time (from the start of the video stream) when an indoor
719 // frame was found.
720 StartTime string `json:"startTime,omitempty"`
721 // ForceSendFields is a list of field names (e.g. "StartTime") to
722 // unconditionally include in API requests. By default, fields with empty or
723 // default values are omitted from API requests. See
724 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
725 // details.
726 ForceSendFields []string `json:"-"`
727 // NullFields is a list of field names (e.g. "StartTime") to include in API
728 // requests with the JSON null value. By default, fields with empty values are
729 // omitted from API requests. See
730 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
731 NullFields []string `json:"-"`
732 }
733
734 func (s NotOutdoorsFailureDetails) MarshalJSON() ([]byte, error) {
735 type NoMethod NotOutdoorsFailureDetails
736 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
737 }
738
739 // Operation: This resource represents a long-running operation that is the
740 // result of a network API call.
741 type Operation struct {
742 // Done: If the value is `false`, it means the operation is still in progress.
743 // If `true`, the operation is completed, and either `error` or `response` is
744 // available.
745 Done bool `json:"done,omitempty"`
746 // Error: The error result of the operation in case of failure or cancellation.
747 Error *Status `json:"error,omitempty"`
748 // Metadata: Service-specific metadata associated with the operation. It
749 // typically contains progress information and common metadata such as create
750 // time. Some services might not provide such metadata. Any method that returns
751 // a long-running operation should document the metadata type, if any.
752 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
753 // Name: The server-assigned name, which is only unique within the same service
754 // that originally returns it. If you use the default HTTP mapping, the `name`
755 // should be a resource name ending with `operations/{unique_id}`.
756 Name string `json:"name,omitempty"`
757 // Response: The normal, successful response of the operation. If the original
758 // method returns no data on success, such as `Delete`, the response is
759 // `google.protobuf.Empty`. If the original method is standard
760 // `Get`/`Create`/`Update`, the response should be the resource. For other
761 // methods, the response should have the type `XxxResponse`, where `Xxx` is the
762 // original method name. For example, if the original method name is
763 // `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
764 Response googleapi.RawMessage `json:"response,omitempty"`
765
766 // ServerResponse contains the HTTP response code and headers from the server.
767 googleapi.ServerResponse `json:"-"`
768 // ForceSendFields is a list of field names (e.g. "Done") to unconditionally
769 // include in API requests. By default, fields with empty or default values are
770 // omitted from API requests. See
771 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
772 // details.
773 ForceSendFields []string `json:"-"`
774 // NullFields is a list of field names (e.g. "Done") to include in API requests
775 // with the JSON null value. By default, fields with empty values are omitted
776 // from API requests. See
777 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
778 NullFields []string `json:"-"`
779 }
780
781 func (s Operation) MarshalJSON() ([]byte, error) {
782 type NoMethod Operation
783 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
784 }
785
786 // Photo: Photo is used to store 360 photos along with photo metadata.
787 type Photo struct {
788 // CaptureTime: Optional. Absolute time when the photo was captured. When the
789 // photo has no exif timestamp, this is used to set a timestamp in the photo
790 // metadata.
791 CaptureTime string `json:"captureTime,omitempty"`
792 // Connections: Optional. Connections to other photos. A connection represents
793 // the link from this photo to another photo.
794 Connections []*Connection `json:"connections,omitempty"`
795 // DownloadUrl: Output only. The download URL for the photo bytes. This field
796 // is set only when GetPhotoRequest.view is set to
797 // PhotoView.INCLUDE_DOWNLOAD_URL.
798 DownloadUrl string `json:"downloadUrl,omitempty"`
799 // MapsPublishStatus: Output only. Status in Google Maps, whether this photo
800 // was published or rejected.
801 //
802 // Possible values:
803 // "UNSPECIFIED_MAPS_PUBLISH_STATUS" - The status of the photo is unknown.
804 // "PUBLISHED" - The photo is published to the public through Google Maps.
805 // "REJECTED_UNKNOWN" - The photo has been rejected for an unknown reason.
806 MapsPublishStatus string `json:"mapsPublishStatus,omitempty"`
807 // PhotoId: Required. Output only. Required when updating a photo. Output only
808 // when creating a photo. Identifier for the photo, which is unique among all
809 // photos in Google.
810 PhotoId *PhotoId `json:"photoId,omitempty"`
811 // Places: Optional. Places where this photo belongs.
812 Places []*Place `json:"places,omitempty"`
813 // Pose: Optional. Pose of the photo.
814 Pose *Pose `json:"pose,omitempty"`
815 // ShareLink: Output only. The share link for the photo.
816 ShareLink string `json:"shareLink,omitempty"`
817 // ThumbnailUrl: Output only. The thumbnail URL for showing a preview of the
818 // given photo.
819 ThumbnailUrl string `json:"thumbnailUrl,omitempty"`
820 // TransferStatus: Output only. Status of rights transfer on this photo.
821 //
822 // Possible values:
823 // "TRANSFER_STATUS_UNKNOWN" - The status of this transfer is unspecified.
824 // "NEVER_TRANSFERRED" - This photo has never been in a transfer.
825 // "PENDING" - This photo transfer has been initiated, but the receiver has
826 // not yet responded.
827 // "COMPLETED" - The photo transfer has been completed, and this photo has
828 // been transferred to the recipient.
829 // "REJECTED" - The recipient rejected this photo transfer.
830 // "EXPIRED" - The photo transfer expired before the recipient took any
831 // action.
832 // "CANCELLED" - The sender cancelled this photo transfer.
833 // "RECEIVED_VIA_TRANSFER" - The recipient owns this photo due to a rights
834 // transfer.
835 TransferStatus string `json:"transferStatus,omitempty"`
836 // UploadReference: Input only. Required when creating a photo. Input only. The
837 // resource URL where the photo bytes are uploaded to.
838 UploadReference *UploadRef `json:"uploadReference,omitempty"`
839 // UploadTime: Output only. Time when the image was uploaded.
840 UploadTime string `json:"uploadTime,omitempty"`
841 // ViewCount: Output only. View count of the photo.
842 ViewCount int64 `json:"viewCount,omitempty,string"`
843
844 // ServerResponse contains the HTTP response code and headers from the server.
845 googleapi.ServerResponse `json:"-"`
846 // ForceSendFields is a list of field names (e.g. "CaptureTime") to
847 // unconditionally include in API requests. By default, fields with empty or
848 // default values are omitted from API requests. See
849 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
850 // details.
851 ForceSendFields []string `json:"-"`
852 // NullFields is a list of field names (e.g. "CaptureTime") to include in API
853 // requests with the JSON null value. By default, fields with empty values are
854 // omitted from API requests. See
855 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
856 NullFields []string `json:"-"`
857 }
858
859 func (s Photo) MarshalJSON() ([]byte, error) {
860 type NoMethod Photo
861 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
862 }
863
864 // PhotoId: Identifier for a Photo.
865 type PhotoId struct {
866 // Id: A unique identifier for a photo.
867 Id string `json:"id,omitempty"`
868 // ForceSendFields is a list of field names (e.g. "Id") to unconditionally
869 // include in API requests. By default, fields with empty or default values are
870 // omitted from API requests. See
871 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
872 // details.
873 ForceSendFields []string `json:"-"`
874 // NullFields is a list of field names (e.g. "Id") to include in API requests
875 // with the JSON null value. By default, fields with empty values are omitted
876 // from API requests. See
877 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
878 NullFields []string `json:"-"`
879 }
880
881 func (s PhotoId) MarshalJSON() ([]byte, error) {
882 type NoMethod PhotoId
883 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
884 }
885
886 // PhotoResponse: Response payload for a single Photo in batch operations
887 // including BatchGetPhotos and BatchUpdatePhotos.
888 type PhotoResponse struct {
889 // Photo: The Photo resource, if the request was successful.
890 Photo *Photo `json:"photo,omitempty"`
891 // Status: The status for the operation to get or update a single photo in the
892 // batch request.
893 Status *Status `json:"status,omitempty"`
894 // ForceSendFields is a list of field names (e.g. "Photo") to unconditionally
895 // include in API requests. By default, fields with empty or default values are
896 // omitted from API requests. See
897 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
898 // details.
899 ForceSendFields []string `json:"-"`
900 // NullFields is a list of field names (e.g. "Photo") to include in API
901 // requests with the JSON null value. By default, fields with empty values are
902 // omitted from API requests. See
903 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
904 NullFields []string `json:"-"`
905 }
906
907 func (s PhotoResponse) MarshalJSON() ([]byte, error) {
908 type NoMethod PhotoResponse
909 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
910 }
911
912 // PhotoSequence: A sequence of 360 photos along with metadata.
913 type PhotoSequence struct {
914 // CaptureTimeOverride: Optional. Absolute time when the photo sequence starts
915 // to be captured. If the photo sequence is a video, this is the start time of
916 // the video. If this field is populated in input, it overrides the capture
917 // time in the video or XDM file.
918 CaptureTimeOverride string `json:"captureTimeOverride,omitempty"`
919 // DistanceMeters: Output only. The computed distance of the photo sequence in
920 // meters.
921 DistanceMeters float64 `json:"distanceMeters,omitempty"`
922 // FailureDetails: Output only. If this sequence has `failure_reason` set, this
923 // may contain additional details about the failure.
924 FailureDetails *ProcessingFailureDetails `json:"failureDetails,omitempty"`
925 // FailureReason: Output only. If this sequence has processing_state = FAILED,
926 // this will contain the reason why it failed. If the processing_state is any
927 // other value, this field will be unset.
928 //
929 // Possible values:
930 // "PROCESSING_FAILURE_REASON_UNSPECIFIED" - The failure reason is
931 // unspecified, this is the default value.
932 // "LOW_RESOLUTION" - Video frame's resolution is too small.
933 // "DUPLICATE" - This video has been uploaded before.
934 // "INSUFFICIENT_GPS" - Too few GPS points.
935 // "NO_OVERLAP_GPS" - No overlap between the time frame of GPS track and the
936 // time frame of video.
937 // "INVALID_GPS" - GPS is invalid (e.x. all GPS points are at (0,0))
938 // "FAILED_TO_REFINE_POSITIONS" - The sequence of photos could not be
939 // accurately located in the world.
940 // "TAKEDOWN" - The sequence was taken down for policy reasons.
941 // "CORRUPT_VIDEO" - The video file was corrupt or could not be decoded.
942 // "INTERNAL" - A permanent failure in the underlying system occurred.
943 // "INVALID_VIDEO_FORMAT" - The video format is invalid or unsupported.
944 // "INVALID_VIDEO_DIMENSIONS" - Invalid image aspect ratio found.
945 // "INVALID_CAPTURE_TIME" - Invalid capture time. Timestamps were from the
946 // future.
947 // "GPS_DATA_GAP" - GPS data contains a gap greater than 5 seconds in
948 // duration.
949 // "JUMPY_GPS" - GPS data is too erratic to be processed.
950 // "INVALID_IMU" - IMU (Accelerometer, Gyroscope, etc.) data are not valid.
951 // They may be missing required fields (x, y, z or time), may not be formatted
952 // correctly, or any other issue that prevents our systems from parsing it.
953 // "INSUFFICIENT_IMU" - Too few IMU points.
954 // "INSUFFICIENT_OVERLAP_TIME_SERIES" - Insufficient overlap in the time
955 // frame between GPS, IMU, and other time series data.
956 // "IMU_DATA_GAP" - IMU (Accelerometer, Gyroscope, etc.) data contain gaps
957 // greater than 0.1 seconds in duration.
958 // "UNSUPPORTED_CAMERA" - The camera is not supported.
959 // "NOT_OUTDOORS" - Some frames were indoors, which is unsupported.
960 // "INSUFFICIENT_VIDEO_FRAMES" - Not enough video frames.
961 // "INSUFFICIENT_MOVEMENT" - Not enough moving data.
962 // "MAST_DOWN" - Mast is down.
963 // "CAMERA_COVERED" - Camera is covered.
964 FailureReason string `json:"failureReason,omitempty"`
965 // Filename: Output only. The filename of the upload. Does not include the
966 // directory path. Only available if the sequence was uploaded on a platform
967 // that provides the filename.
968 Filename string `json:"filename,omitempty"`
969 // GpsSource: Input only. If both raw_gps_timeline and the Camera Motion
970 // Metadata Track (CAMM) contain GPS measurements, indicate which takes
971 // precedence.
972 //
973 // Possible values:
974 // "PHOTO_SEQUENCE" - GPS in raw_gps_timeline takes precedence if it exists.
975 // "CAMERA_MOTION_METADATA_TRACK" - GPS in Camera Motion Metadata Track
976 // (CAMM) takes precedence if it exists.
977 GpsSource string `json:"gpsSource,omitempty"`
978 // Id: Output only. Unique identifier for the photo sequence. This also acts as
979 // a long running operation ID if uploading is performed asynchronously.
980 Id string `json:"id,omitempty"`
981 // Imu: Input only. Three axis IMU data for the collection. If this data is too
982 // large to put in the request, then it should be put in the CAMM track for the
983 // video. This data always takes precedence over the equivalent CAMM data, if
984 // it exists.
985 Imu *Imu `json:"imu,omitempty"`
986 // Photos: Output only. Photos with increasing timestamps.
987 Photos []*Photo `json:"photos,omitempty"`
988 // ProcessingState: Output only. The processing state of this sequence.
989 //
990 // Possible values:
991 // "PROCESSING_STATE_UNSPECIFIED" - The state is unspecified, this is the
992 // default value.
993 // "PENDING" - The sequence has not yet started processing.
994 // "PROCESSING" - The sequence is currently in processing.
995 // "PROCESSED" - The sequence has finished processing including refining
996 // position.
997 // "FAILED" - The sequence failed processing. See FailureReason for more
998 // details.
999 ProcessingState string `json:"processingState,omitempty"`
1000 // RawGpsTimeline: Input only. Raw GPS measurements with increasing timestamps
1001 // from the device that aren't time synced with each photo. These raw
1002 // measurements will be used to infer the pose of each frame. Required in input
1003 // when InputType is VIDEO and raw GPS measurements are not in Camera Motion
1004 // Metadata Track (CAMM). User can indicate which takes precedence using
1005 // gps_source if raw GPS measurements are provided in both raw_gps_timeline and
1006 // Camera Motion Metadata Track (CAMM).
1007 RawGpsTimeline []*Pose `json:"rawGpsTimeline,omitempty"`
1008 // SequenceBounds: Output only. A rectangular box that encapsulates every image
1009 // in this photo sequence.
1010 SequenceBounds *LatLngBounds `json:"sequenceBounds,omitempty"`
1011 // UploadReference: Input only. Required when creating photo sequence. The
1012 // resource name where the bytes of the photo sequence (in the form of video)
1013 // are uploaded.
1014 UploadReference *UploadRef `json:"uploadReference,omitempty"`
1015 // UploadTime: Output only. The time this photo sequence was created in uSV
1016 // Store service.
1017 UploadTime string `json:"uploadTime,omitempty"`
1018 // ViewCount: Output only. The total number of views that all the published
1019 // images in this PhotoSequence have received.
1020 ViewCount int64 `json:"viewCount,omitempty,string"`
1021 // ForceSendFields is a list of field names (e.g. "CaptureTimeOverride") to
1022 // unconditionally include in API requests. By default, fields with empty or
1023 // default values are omitted from API requests. See
1024 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1025 // details.
1026 ForceSendFields []string `json:"-"`
1027 // NullFields is a list of field names (e.g. "CaptureTimeOverride") to include
1028 // in API requests with the JSON null value. By default, fields with empty
1029 // values are omitted from API requests. See
1030 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1031 NullFields []string `json:"-"`
1032 }
1033
1034 func (s PhotoSequence) MarshalJSON() ([]byte, error) {
1035 type NoMethod PhotoSequence
1036 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1037 }
1038
1039 func (s *PhotoSequence) UnmarshalJSON(data []byte) error {
1040 type NoMethod PhotoSequence
1041 var s1 struct {
1042 DistanceMeters gensupport.JSONFloat64 `json:"distanceMeters"`
1043 *NoMethod
1044 }
1045 s1.NoMethod = (*NoMethod)(s)
1046 if err := json.Unmarshal(data, &s1); err != nil {
1047 return err
1048 }
1049 s.DistanceMeters = float64(s1.DistanceMeters)
1050 return nil
1051 }
1052
1053 // Place: Place metadata for an entity.
1054 type Place struct {
1055 // LanguageCode: Output only. The language_code that the name is localized
1056 // with. This should be the language_code specified in the request, but may be
1057 // a fallback.
1058 LanguageCode string `json:"languageCode,omitempty"`
1059 // Name: Output only. The name of the place, localized to the language_code.
1060 Name string `json:"name,omitempty"`
1061 // PlaceId: Place identifier, as described in
1062 // https://developers.google.com/places/place-id.
1063 PlaceId string `json:"placeId,omitempty"`
1064 // ForceSendFields is a list of field names (e.g. "LanguageCode") to
1065 // unconditionally include in API requests. By default, fields with empty or
1066 // default values are omitted from API requests. See
1067 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1068 // details.
1069 ForceSendFields []string `json:"-"`
1070 // NullFields is a list of field names (e.g. "LanguageCode") to include in API
1071 // requests with the JSON null value. By default, fields with empty values are
1072 // omitted from API requests. See
1073 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1074 NullFields []string `json:"-"`
1075 }
1076
1077 func (s Place) MarshalJSON() ([]byte, error) {
1078 type NoMethod Place
1079 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1080 }
1081
1082 // Pose: Raw pose measurement for an entity.
1083 type Pose struct {
1084 // AccuracyMeters: The estimated horizontal accuracy of this pose in meters
1085 // with 68% confidence (one standard deviation). For example, on Android, this
1086 // value is available from this method:
1087 // https://developer.android.com/reference/android/location/Location#getAccuracy().
1088 // Other platforms have different methods of obtaining similar accuracy
1089 // estimations.
1090 AccuracyMeters float64 `json:"accuracyMeters,omitempty"`
1091 // Altitude: Altitude of the pose in meters above WGS84 ellipsoid. NaN
1092 // indicates an unmeasured quantity.
1093 Altitude float64 `json:"altitude,omitempty"`
1094 // GpsRecordTimestampUnixEpoch: Time of the GPS record since UTC epoch.
1095 GpsRecordTimestampUnixEpoch string `json:"gpsRecordTimestampUnixEpoch,omitempty"`
1096 // Heading: The following pose parameters pertain to the center of the photo.
1097 // They match https://developers.google.com/streetview/spherical-metadata.
1098 // Compass heading, measured at the center of the photo in degrees clockwise
1099 // from North. Value must be >=0 and <360. NaN indicates an unmeasured
1100 // quantity.
1101 Heading float64 `json:"heading,omitempty"`
1102 // LatLngPair: Latitude and longitude pair of the pose, as explained here:
1103 // https://cloud.google.com/datastore/docs/reference/rest/Shared.Types/LatLng
1104 // When creating a Photo, if the latitude and longitude pair are not provided,
1105 // the geolocation from the exif header is used. A latitude and longitude pair
1106 // not provided in the photo or exif header causes the photo process to fail.
1107 LatLngPair *LatLng `json:"latLngPair,omitempty"`
1108 // Level: Level (the floor in a building) used to configure vertical
1109 // navigation.
1110 Level *Level `json:"level,omitempty"`
1111 // Pitch: Pitch, measured at the center of the photo in degrees. Value must be
1112 // >=-90 and <= 90. A value of -90 means looking directly down, and a value of
1113 // 90 means looking directly up. NaN indicates an unmeasured quantity.
1114 Pitch float64 `json:"pitch,omitempty"`
1115 // Roll: Roll, measured in degrees. Value must be >= 0 and <360. A value of 0
1116 // means level with the horizon. NaN indicates an unmeasured quantity.
1117 Roll float64 `json:"roll,omitempty"`
1118 // ForceSendFields is a list of field names (e.g. "AccuracyMeters") to
1119 // unconditionally include in API requests. By default, fields with empty or
1120 // default values are omitted from API requests. See
1121 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1122 // details.
1123 ForceSendFields []string `json:"-"`
1124 // NullFields is a list of field names (e.g. "AccuracyMeters") to include in
1125 // API requests with the JSON null value. By default, fields with empty values
1126 // are omitted from API requests. See
1127 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1128 NullFields []string `json:"-"`
1129 }
1130
1131 func (s Pose) MarshalJSON() ([]byte, error) {
1132 type NoMethod Pose
1133 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1134 }
1135
1136 func (s *Pose) UnmarshalJSON(data []byte) error {
1137 type NoMethod Pose
1138 var s1 struct {
1139 AccuracyMeters gensupport.JSONFloat64 `json:"accuracyMeters"`
1140 Altitude gensupport.JSONFloat64 `json:"altitude"`
1141 Heading gensupport.JSONFloat64 `json:"heading"`
1142 Pitch gensupport.JSONFloat64 `json:"pitch"`
1143 Roll gensupport.JSONFloat64 `json:"roll"`
1144 *NoMethod
1145 }
1146 s1.NoMethod = (*NoMethod)(s)
1147 if err := json.Unmarshal(data, &s1); err != nil {
1148 return err
1149 }
1150 s.AccuracyMeters = float64(s1.AccuracyMeters)
1151 s.Altitude = float64(s1.Altitude)
1152 s.Heading = float64(s1.Heading)
1153 s.Pitch = float64(s1.Pitch)
1154 s.Roll = float64(s1.Roll)
1155 return nil
1156 }
1157
1158 // ProcessingFailureDetails: Additional details to accompany the
1159 // ProcessingFailureReason enum. This message is always expected to be used in
1160 // conjunction with ProcessingFailureReason, and the oneof value set in this
1161 // message should match the FailureReason.
1162 type ProcessingFailureDetails struct {
1163 // GpsDataGapDetails: See GpsDataGapFailureDetails.
1164 GpsDataGapDetails *GpsDataGapFailureDetails `json:"gpsDataGapDetails,omitempty"`
1165 // ImuDataGapDetails: See ImuDataGapFailureDetails.
1166 ImuDataGapDetails *ImuDataGapFailureDetails `json:"imuDataGapDetails,omitempty"`
1167 // InsufficientGpsDetails: See InsufficientGpsFailureDetails.
1168 InsufficientGpsDetails *InsufficientGpsFailureDetails `json:"insufficientGpsDetails,omitempty"`
1169 // NoOverlapGpsDetails: See NoOverlapGpsFailureDetails.
1170 NoOverlapGpsDetails *NoOverlapGpsFailureDetails `json:"noOverlapGpsDetails,omitempty"`
1171 // NotOutdoorsDetails: See NotOutdoorsFailureDetails.
1172 NotOutdoorsDetails *NotOutdoorsFailureDetails `json:"notOutdoorsDetails,omitempty"`
1173 // ForceSendFields is a list of field names (e.g. "GpsDataGapDetails") to
1174 // unconditionally include in API requests. By default, fields with empty or
1175 // default values are omitted from API requests. See
1176 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1177 // details.
1178 ForceSendFields []string `json:"-"`
1179 // NullFields is a list of field names (e.g. "GpsDataGapDetails") to include in
1180 // API requests with the JSON null value. By default, fields with empty values
1181 // are omitted from API requests. See
1182 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1183 NullFields []string `json:"-"`
1184 }
1185
1186 func (s ProcessingFailureDetails) MarshalJSON() ([]byte, error) {
1187 type NoMethod ProcessingFailureDetails
1188 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1189 }
1190
1191 // Status: The `Status` type defines a logical error model that is suitable for
1192 // different programming environments, including REST APIs and RPC APIs. It is
1193 // used by gRPC (https://github.com/grpc). Each `Status` message contains three
1194 // pieces of data: error code, error message, and error details. You can find
1195 // out more about this error model and how to work with it in the API Design
1196 // Guide (https://cloud.google.com/apis/design/errors).
1197 type Status struct {
1198 // Code: The status code, which should be an enum value of google.rpc.Code.
1199 Code int64 `json:"code,omitempty"`
1200 // Details: A list of messages that carry the error details. There is a common
1201 // set of message types for APIs to use.
1202 Details []googleapi.RawMessage `json:"details,omitempty"`
1203 // Message: A developer-facing error message, which should be in English. Any
1204 // user-facing error message should be localized and sent in the
1205 // google.rpc.Status.details field, or localized by the client.
1206 Message string `json:"message,omitempty"`
1207 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally
1208 // include in API requests. By default, fields with empty or default values are
1209 // omitted from API requests. See
1210 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1211 // details.
1212 ForceSendFields []string `json:"-"`
1213 // NullFields is a list of field names (e.g. "Code") to include in API requests
1214 // with the JSON null value. By default, fields with empty values are omitted
1215 // from API requests. See
1216 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1217 NullFields []string `json:"-"`
1218 }
1219
1220 func (s Status) MarshalJSON() ([]byte, error) {
1221 type NoMethod Status
1222 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1223 }
1224
1225 // UpdatePhotoRequest: Request to update the metadata of a Photo. Updating the
1226 // pixels of a photo is not supported.
1227 type UpdatePhotoRequest struct {
1228 // Photo: Required. Photo object containing the new metadata.
1229 Photo *Photo `json:"photo,omitempty"`
1230 // UpdateMask: Required. Mask that identifies fields on the photo metadata to
1231 // update. If not present, the old Photo metadata is entirely replaced with the
1232 // new Photo metadata in this request. The update fails if invalid fields are
1233 // specified. Multiple fields can be specified in a comma-delimited list. The
1234 // following fields are valid: * `pose.heading` * `pose.lat_lng_pair` *
1235 // `pose.pitch` * `pose.roll` * `pose.level` * `pose.altitude` * `connections`
1236 // * `places` > Note: When updateMask contains repeated fields, the entire set
1237 // of repeated values get replaced with the new contents. For example, if
1238 // updateMask contains `connections` and `UpdatePhotoRequest.photo.connections`
1239 // is empty, all connections are removed.
1240 UpdateMask string `json:"updateMask,omitempty"`
1241 // ForceSendFields is a list of field names (e.g. "Photo") to unconditionally
1242 // include in API requests. By default, fields with empty or default values are
1243 // omitted from API requests. See
1244 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1245 // details.
1246 ForceSendFields []string `json:"-"`
1247 // NullFields is a list of field names (e.g. "Photo") to include in API
1248 // requests with the JSON null value. By default, fields with empty values are
1249 // omitted from API requests. See
1250 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1251 NullFields []string `json:"-"`
1252 }
1253
1254 func (s UpdatePhotoRequest) MarshalJSON() ([]byte, error) {
1255 type NoMethod UpdatePhotoRequest
1256 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1257 }
1258
1259 // UploadRef: Upload reference for media files.
1260 type UploadRef struct {
1261 // UploadUrl: An upload reference should be unique for each user. It follows
1262 // the form:
1263 // "https://streetviewpublish.googleapis.com/media/user/{account_id}/photo/{uplo
1264 // ad_reference}"
1265 UploadUrl string `json:"uploadUrl,omitempty"`
1266
1267 // ServerResponse contains the HTTP response code and headers from the server.
1268 googleapi.ServerResponse `json:"-"`
1269 // ForceSendFields is a list of field names (e.g. "UploadUrl") to
1270 // unconditionally include in API requests. By default, fields with empty or
1271 // default values are omitted from API requests. See
1272 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1273 // details.
1274 ForceSendFields []string `json:"-"`
1275 // NullFields is a list of field names (e.g. "UploadUrl") to include in API
1276 // requests with the JSON null value. By default, fields with empty values are
1277 // omitted from API requests. See
1278 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1279 NullFields []string `json:"-"`
1280 }
1281
1282 func (s UploadRef) MarshalJSON() ([]byte, error) {
1283 type NoMethod UploadRef
1284 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1285 }
1286
1287 type PhotoCreateCall struct {
1288 s *Service
1289 photo *Photo
1290 urlParams_ gensupport.URLParams
1291 ctx_ context.Context
1292 header_ http.Header
1293 }
1294
1295 // Create: After the client finishes uploading the photo with the returned
1296 // UploadRef, CreatePhoto publishes the uploaded Photo to Street View on Google
1297 // Maps. Currently, the only way to set heading, pitch, and roll in CreatePhoto
1298 // is through the Photo Sphere XMP metadata
1299 // (https://developers.google.com/streetview/spherical-metadata) in the photo
1300 // bytes. CreatePhoto ignores the `pose.heading`, `pose.pitch`, `pose.roll`,
1301 // `pose.altitude`, and `pose.level` fields in Pose. This method returns the
1302 // following error codes: * google.rpc.Code.INVALID_ARGUMENT if the request is
1303 // malformed or if the uploaded photo is not a 360 photo. *
1304 // google.rpc.Code.NOT_FOUND if the upload reference does not exist. *
1305 // google.rpc.Code.RESOURCE_EXHAUSTED if the account has reached the storage
1306 // limit.
1307 func (r *PhotoService) Create(photo *Photo) *PhotoCreateCall {
1308 c := &PhotoCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1309 c.photo = photo
1310 return c
1311 }
1312
1313 // Fields allows partial responses to be retrieved. See
1314 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1315 // details.
1316 func (c *PhotoCreateCall) Fields(s ...googleapi.Field) *PhotoCreateCall {
1317 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1318 return c
1319 }
1320
1321 // Context sets the context to be used in this call's Do method.
1322 func (c *PhotoCreateCall) Context(ctx context.Context) *PhotoCreateCall {
1323 c.ctx_ = ctx
1324 return c
1325 }
1326
1327 // Header returns a http.Header that can be modified by the caller to add
1328 // headers to the request.
1329 func (c *PhotoCreateCall) Header() http.Header {
1330 if c.header_ == nil {
1331 c.header_ = make(http.Header)
1332 }
1333 return c.header_
1334 }
1335
1336 func (c *PhotoCreateCall) doRequest(alt string) (*http.Response, error) {
1337 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1338 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.photo)
1339 if err != nil {
1340 return nil, err
1341 }
1342 c.urlParams_.Set("alt", alt)
1343 c.urlParams_.Set("prettyPrint", "false")
1344 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photo")
1345 urls += "?" + c.urlParams_.Encode()
1346 req, err := http.NewRequest("POST", urls, body)
1347 if err != nil {
1348 return nil, err
1349 }
1350 req.Header = reqHeaders
1351 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "streetviewpublish.photo.create", "request", internallog.HTTPRequest(req, body.Bytes()))
1352 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1353 }
1354
1355 // Do executes the "streetviewpublish.photo.create" call.
1356 // Any non-2xx status code is an error. Response headers are in either
1357 // *Photo.ServerResponse.Header or (if a response was returned at all) in
1358 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
1359 // whether the returned error was because http.StatusNotModified was returned.
1360 func (c *PhotoCreateCall) Do(opts ...googleapi.CallOption) (*Photo, error) {
1361 gensupport.SetOptions(c.urlParams_, opts...)
1362 res, err := c.doRequest("json")
1363 if res != nil && res.StatusCode == http.StatusNotModified {
1364 if res.Body != nil {
1365 res.Body.Close()
1366 }
1367 return nil, gensupport.WrapError(&googleapi.Error{
1368 Code: res.StatusCode,
1369 Header: res.Header,
1370 })
1371 }
1372 if err != nil {
1373 return nil, err
1374 }
1375 defer googleapi.CloseBody(res)
1376 if err := googleapi.CheckResponse(res); err != nil {
1377 return nil, gensupport.WrapError(err)
1378 }
1379 ret := &Photo{
1380 ServerResponse: googleapi.ServerResponse{
1381 Header: res.Header,
1382 HTTPStatusCode: res.StatusCode,
1383 },
1384 }
1385 target := &ret
1386 b, err := gensupport.DecodeResponseBytes(target, res)
1387 if err != nil {
1388 return nil, err
1389 }
1390 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "streetviewpublish.photo.create", "response", internallog.HTTPResponse(res, b))
1391 return ret, nil
1392 }
1393
1394 type PhotoDeleteCall struct {
1395 s *Service
1396 photoId string
1397 urlParams_ gensupport.URLParams
1398 ctx_ context.Context
1399 header_ http.Header
1400 }
1401
1402 // Delete: Deletes a Photo and its metadata. This method returns the following
1403 // error codes: * google.rpc.Code.PERMISSION_DENIED if the requesting user did
1404 // not create the requested photo. * google.rpc.Code.NOT_FOUND if the photo ID
1405 // does not exist.
1406 //
1407 // - photoId: ID of the Photo.
1408 func (r *PhotoService) Delete(photoId string) *PhotoDeleteCall {
1409 c := &PhotoDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1410 c.photoId = photoId
1411 return c
1412 }
1413
1414 // Fields allows partial responses to be retrieved. See
1415 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1416 // details.
1417 func (c *PhotoDeleteCall) Fields(s ...googleapi.Field) *PhotoDeleteCall {
1418 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1419 return c
1420 }
1421
1422 // Context sets the context to be used in this call's Do method.
1423 func (c *PhotoDeleteCall) Context(ctx context.Context) *PhotoDeleteCall {
1424 c.ctx_ = ctx
1425 return c
1426 }
1427
1428 // Header returns a http.Header that can be modified by the caller to add
1429 // headers to the request.
1430 func (c *PhotoDeleteCall) Header() http.Header {
1431 if c.header_ == nil {
1432 c.header_ = make(http.Header)
1433 }
1434 return c.header_
1435 }
1436
1437 func (c *PhotoDeleteCall) doRequest(alt string) (*http.Response, error) {
1438 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1439 c.urlParams_.Set("alt", alt)
1440 c.urlParams_.Set("prettyPrint", "false")
1441 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photo/{photoId}")
1442 urls += "?" + c.urlParams_.Encode()
1443 req, err := http.NewRequest("DELETE", urls, nil)
1444 if err != nil {
1445 return nil, err
1446 }
1447 req.Header = reqHeaders
1448 googleapi.Expand(req.URL, map[string]string{
1449 "photoId": c.photoId,
1450 })
1451 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "streetviewpublish.photo.delete", "request", internallog.HTTPRequest(req, nil))
1452 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1453 }
1454
1455 // Do executes the "streetviewpublish.photo.delete" call.
1456 // Any non-2xx status code is an error. Response headers are in either
1457 // *Empty.ServerResponse.Header or (if a response was returned at all) in
1458 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
1459 // whether the returned error was because http.StatusNotModified was returned.
1460 func (c *PhotoDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
1461 gensupport.SetOptions(c.urlParams_, opts...)
1462 res, err := c.doRequest("json")
1463 if res != nil && res.StatusCode == http.StatusNotModified {
1464 if res.Body != nil {
1465 res.Body.Close()
1466 }
1467 return nil, gensupport.WrapError(&googleapi.Error{
1468 Code: res.StatusCode,
1469 Header: res.Header,
1470 })
1471 }
1472 if err != nil {
1473 return nil, err
1474 }
1475 defer googleapi.CloseBody(res)
1476 if err := googleapi.CheckResponse(res); err != nil {
1477 return nil, gensupport.WrapError(err)
1478 }
1479 ret := &Empty{
1480 ServerResponse: googleapi.ServerResponse{
1481 Header: res.Header,
1482 HTTPStatusCode: res.StatusCode,
1483 },
1484 }
1485 target := &ret
1486 b, err := gensupport.DecodeResponseBytes(target, res)
1487 if err != nil {
1488 return nil, err
1489 }
1490 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "streetviewpublish.photo.delete", "response", internallog.HTTPResponse(res, b))
1491 return ret, nil
1492 }
1493
1494 type PhotoGetCall struct {
1495 s *Service
1496 photoId string
1497 urlParams_ gensupport.URLParams
1498 ifNoneMatch_ string
1499 ctx_ context.Context
1500 header_ http.Header
1501 }
1502
1503 // Get: Gets the metadata of the specified Photo. This method returns the
1504 // following error codes: * google.rpc.Code.PERMISSION_DENIED if the requesting
1505 // user did not create the requested Photo. * google.rpc.Code.NOT_FOUND if the
1506 // requested Photo does not exist. * google.rpc.Code.UNAVAILABLE if the
1507 // requested Photo is still being indexed.
1508 //
1509 // - photoId: ID of the Photo.
1510 func (r *PhotoService) Get(photoId string) *PhotoGetCall {
1511 c := &PhotoGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1512 c.photoId = photoId
1513 return c
1514 }
1515
1516 // LanguageCode sets the optional parameter "languageCode": The BCP-47 language
1517 // code, such as "en-US" or "sr-Latn". For more information, see
1518 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. If
1519 // language_code is unspecified, the user's language preference for Google
1520 // services is used.
1521 func (c *PhotoGetCall) LanguageCode(languageCode string) *PhotoGetCall {
1522 c.urlParams_.Set("languageCode", languageCode)
1523 return c
1524 }
1525
1526 // View sets the optional parameter "view": Required. Specifies if a download
1527 // URL for the photo bytes should be returned in the Photo response.
1528 //
1529 // Possible values:
1530 //
1531 // "BASIC" - Server responses do not include the download URL for the photo
1532 //
1533 // bytes. The default value.
1534 //
1535 // "INCLUDE_DOWNLOAD_URL" - Server responses include the download URL for the
1536 //
1537 // photo bytes.
1538 func (c *PhotoGetCall) View(view string) *PhotoGetCall {
1539 c.urlParams_.Set("view", view)
1540 return c
1541 }
1542
1543 // Fields allows partial responses to be retrieved. See
1544 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1545 // details.
1546 func (c *PhotoGetCall) Fields(s ...googleapi.Field) *PhotoGetCall {
1547 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1548 return c
1549 }
1550
1551 // IfNoneMatch sets an optional parameter which makes the operation fail if the
1552 // object's ETag matches the given value. This is useful for getting updates
1553 // only after the object has changed since the last request.
1554 func (c *PhotoGetCall) IfNoneMatch(entityTag string) *PhotoGetCall {
1555 c.ifNoneMatch_ = entityTag
1556 return c
1557 }
1558
1559 // Context sets the context to be used in this call's Do method.
1560 func (c *PhotoGetCall) Context(ctx context.Context) *PhotoGetCall {
1561 c.ctx_ = ctx
1562 return c
1563 }
1564
1565 // Header returns a http.Header that can be modified by the caller to add
1566 // headers to the request.
1567 func (c *PhotoGetCall) Header() http.Header {
1568 if c.header_ == nil {
1569 c.header_ = make(http.Header)
1570 }
1571 return c.header_
1572 }
1573
1574 func (c *PhotoGetCall) doRequest(alt string) (*http.Response, error) {
1575 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1576 if c.ifNoneMatch_ != "" {
1577 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1578 }
1579 c.urlParams_.Set("alt", alt)
1580 c.urlParams_.Set("prettyPrint", "false")
1581 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photo/{photoId}")
1582 urls += "?" + c.urlParams_.Encode()
1583 req, err := http.NewRequest("GET", urls, nil)
1584 if err != nil {
1585 return nil, err
1586 }
1587 req.Header = reqHeaders
1588 googleapi.Expand(req.URL, map[string]string{
1589 "photoId": c.photoId,
1590 })
1591 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "streetviewpublish.photo.get", "request", internallog.HTTPRequest(req, nil))
1592 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1593 }
1594
1595 // Do executes the "streetviewpublish.photo.get" call.
1596 // Any non-2xx status code is an error. Response headers are in either
1597 // *Photo.ServerResponse.Header or (if a response was returned at all) in
1598 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
1599 // whether the returned error was because http.StatusNotModified was returned.
1600 func (c *PhotoGetCall) Do(opts ...googleapi.CallOption) (*Photo, error) {
1601 gensupport.SetOptions(c.urlParams_, opts...)
1602 res, err := c.doRequest("json")
1603 if res != nil && res.StatusCode == http.StatusNotModified {
1604 if res.Body != nil {
1605 res.Body.Close()
1606 }
1607 return nil, gensupport.WrapError(&googleapi.Error{
1608 Code: res.StatusCode,
1609 Header: res.Header,
1610 })
1611 }
1612 if err != nil {
1613 return nil, err
1614 }
1615 defer googleapi.CloseBody(res)
1616 if err := googleapi.CheckResponse(res); err != nil {
1617 return nil, gensupport.WrapError(err)
1618 }
1619 ret := &Photo{
1620 ServerResponse: googleapi.ServerResponse{
1621 Header: res.Header,
1622 HTTPStatusCode: res.StatusCode,
1623 },
1624 }
1625 target := &ret
1626 b, err := gensupport.DecodeResponseBytes(target, res)
1627 if err != nil {
1628 return nil, err
1629 }
1630 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "streetviewpublish.photo.get", "response", internallog.HTTPResponse(res, b))
1631 return ret, nil
1632 }
1633
1634 type PhotoStartUploadCall struct {
1635 s *Service
1636 empty *Empty
1637 urlParams_ gensupport.URLParams
1638 ctx_ context.Context
1639 header_ http.Header
1640 }
1641
1642 // StartUpload: Creates an upload session to start uploading photo bytes. The
1643 // method uses the upload URL of the returned UploadRef to upload the bytes for
1644 // the Photo. In addition to the photo requirements shown in
1645 // https://support.google.com/maps/answer/7012050?ref_topic=6275604, the photo
1646 // must meet the following requirements: * Photo Sphere XMP metadata must be
1647 // included in the photo metadata. See
1648 // https://developers.google.com/streetview/spherical-metadata for the required
1649 // fields. * The pixel size of the photo must meet the size requirements listed
1650 // in https://support.google.com/maps/answer/7012050?ref_topic=6275604, and the
1651 // photo must be a full 360 horizontally. After the upload completes, the
1652 // method uses UploadRef with CreatePhoto to create the Photo object entry.
1653 func (r *PhotoService) StartUpload(empty *Empty) *PhotoStartUploadCall {
1654 c := &PhotoStartUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1655 c.empty = empty
1656 return c
1657 }
1658
1659 // Fields allows partial responses to be retrieved. See
1660 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1661 // details.
1662 func (c *PhotoStartUploadCall) Fields(s ...googleapi.Field) *PhotoStartUploadCall {
1663 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1664 return c
1665 }
1666
1667 // Context sets the context to be used in this call's Do method.
1668 func (c *PhotoStartUploadCall) Context(ctx context.Context) *PhotoStartUploadCall {
1669 c.ctx_ = ctx
1670 return c
1671 }
1672
1673 // Header returns a http.Header that can be modified by the caller to add
1674 // headers to the request.
1675 func (c *PhotoStartUploadCall) Header() http.Header {
1676 if c.header_ == nil {
1677 c.header_ = make(http.Header)
1678 }
1679 return c.header_
1680 }
1681
1682 func (c *PhotoStartUploadCall) doRequest(alt string) (*http.Response, error) {
1683 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1684 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.empty)
1685 if err != nil {
1686 return nil, err
1687 }
1688 c.urlParams_.Set("alt", alt)
1689 c.urlParams_.Set("prettyPrint", "false")
1690 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photo:startUpload")
1691 urls += "?" + c.urlParams_.Encode()
1692 req, err := http.NewRequest("POST", urls, body)
1693 if err != nil {
1694 return nil, err
1695 }
1696 req.Header = reqHeaders
1697 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "streetviewpublish.photo.startUpload", "request", internallog.HTTPRequest(req, body.Bytes()))
1698 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1699 }
1700
1701 // Do executes the "streetviewpublish.photo.startUpload" call.
1702 // Any non-2xx status code is an error. Response headers are in either
1703 // *UploadRef.ServerResponse.Header or (if a response was returned at all) in
1704 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
1705 // whether the returned error was because http.StatusNotModified was returned.
1706 func (c *PhotoStartUploadCall) Do(opts ...googleapi.CallOption) (*UploadRef, error) {
1707 gensupport.SetOptions(c.urlParams_, opts...)
1708 res, err := c.doRequest("json")
1709 if res != nil && res.StatusCode == http.StatusNotModified {
1710 if res.Body != nil {
1711 res.Body.Close()
1712 }
1713 return nil, gensupport.WrapError(&googleapi.Error{
1714 Code: res.StatusCode,
1715 Header: res.Header,
1716 })
1717 }
1718 if err != nil {
1719 return nil, err
1720 }
1721 defer googleapi.CloseBody(res)
1722 if err := googleapi.CheckResponse(res); err != nil {
1723 return nil, gensupport.WrapError(err)
1724 }
1725 ret := &UploadRef{
1726 ServerResponse: googleapi.ServerResponse{
1727 Header: res.Header,
1728 HTTPStatusCode: res.StatusCode,
1729 },
1730 }
1731 target := &ret
1732 b, err := gensupport.DecodeResponseBytes(target, res)
1733 if err != nil {
1734 return nil, err
1735 }
1736 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "streetviewpublish.photo.startUpload", "response", internallog.HTTPResponse(res, b))
1737 return ret, nil
1738 }
1739
1740 type PhotoUpdateCall struct {
1741 s *Service
1742 id string
1743 photo *Photo
1744 urlParams_ gensupport.URLParams
1745 ctx_ context.Context
1746 header_ http.Header
1747 }
1748
1749 // Update: Updates the metadata of a Photo, such as pose, place association,
1750 // connections, etc. Changing the pixels of a photo is not supported. Only the
1751 // fields specified in the updateMask field are used. If `updateMask` is not
1752 // present, the update applies to all fields. This method returns the following
1753 // error codes: * google.rpc.Code.PERMISSION_DENIED if the requesting user did
1754 // not create the requested photo. * google.rpc.Code.INVALID_ARGUMENT if the
1755 // request is malformed. * google.rpc.Code.NOT_FOUND if the requested photo
1756 // does not exist. * google.rpc.Code.UNAVAILABLE if the requested Photo is
1757 // still being indexed.
1758 //
1759 // - id: A unique identifier for a photo.
1760 func (r *PhotoService) Update(id string, photo *Photo) *PhotoUpdateCall {
1761 c := &PhotoUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1762 c.id = id
1763 c.photo = photo
1764 return c
1765 }
1766
1767 // UpdateMask sets the optional parameter "updateMask": Required. Mask that
1768 // identifies fields on the photo metadata to update. If not present, the old
1769 // Photo metadata is entirely replaced with the new Photo metadata in this
1770 // request. The update fails if invalid fields are specified. Multiple fields
1771 // can be specified in a comma-delimited list. The following fields are valid:
1772 // * `pose.heading` * `pose.lat_lng_pair` * `pose.pitch` * `pose.roll` *
1773 // `pose.level` * `pose.altitude` * `connections` * `places` > Note: When
1774 // updateMask contains repeated fields, the entire set of repeated values get
1775 // replaced with the new contents. For example, if updateMask contains
1776 // `connections` and `UpdatePhotoRequest.photo.connections` is empty, all
1777 // connections are removed.
1778 func (c *PhotoUpdateCall) UpdateMask(updateMask string) *PhotoUpdateCall {
1779 c.urlParams_.Set("updateMask", updateMask)
1780 return c
1781 }
1782
1783 // Fields allows partial responses to be retrieved. See
1784 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1785 // details.
1786 func (c *PhotoUpdateCall) Fields(s ...googleapi.Field) *PhotoUpdateCall {
1787 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1788 return c
1789 }
1790
1791 // Context sets the context to be used in this call's Do method.
1792 func (c *PhotoUpdateCall) Context(ctx context.Context) *PhotoUpdateCall {
1793 c.ctx_ = ctx
1794 return c
1795 }
1796
1797 // Header returns a http.Header that can be modified by the caller to add
1798 // headers to the request.
1799 func (c *PhotoUpdateCall) Header() http.Header {
1800 if c.header_ == nil {
1801 c.header_ = make(http.Header)
1802 }
1803 return c.header_
1804 }
1805
1806 func (c *PhotoUpdateCall) doRequest(alt string) (*http.Response, error) {
1807 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1808 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.photo)
1809 if err != nil {
1810 return nil, err
1811 }
1812 c.urlParams_.Set("alt", alt)
1813 c.urlParams_.Set("prettyPrint", "false")
1814 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photo/{id}")
1815 urls += "?" + c.urlParams_.Encode()
1816 req, err := http.NewRequest("PUT", urls, body)
1817 if err != nil {
1818 return nil, err
1819 }
1820 req.Header = reqHeaders
1821 googleapi.Expand(req.URL, map[string]string{
1822 "id": c.id,
1823 })
1824 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "streetviewpublish.photo.update", "request", internallog.HTTPRequest(req, body.Bytes()))
1825 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1826 }
1827
1828 // Do executes the "streetviewpublish.photo.update" call.
1829 // Any non-2xx status code is an error. Response headers are in either
1830 // *Photo.ServerResponse.Header or (if a response was returned at all) in
1831 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
1832 // whether the returned error was because http.StatusNotModified was returned.
1833 func (c *PhotoUpdateCall) Do(opts ...googleapi.CallOption) (*Photo, error) {
1834 gensupport.SetOptions(c.urlParams_, opts...)
1835 res, err := c.doRequest("json")
1836 if res != nil && res.StatusCode == http.StatusNotModified {
1837 if res.Body != nil {
1838 res.Body.Close()
1839 }
1840 return nil, gensupport.WrapError(&googleapi.Error{
1841 Code: res.StatusCode,
1842 Header: res.Header,
1843 })
1844 }
1845 if err != nil {
1846 return nil, err
1847 }
1848 defer googleapi.CloseBody(res)
1849 if err := googleapi.CheckResponse(res); err != nil {
1850 return nil, gensupport.WrapError(err)
1851 }
1852 ret := &Photo{
1853 ServerResponse: googleapi.ServerResponse{
1854 Header: res.Header,
1855 HTTPStatusCode: res.StatusCode,
1856 },
1857 }
1858 target := &ret
1859 b, err := gensupport.DecodeResponseBytes(target, res)
1860 if err != nil {
1861 return nil, err
1862 }
1863 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "streetviewpublish.photo.update", "response", internallog.HTTPResponse(res, b))
1864 return ret, nil
1865 }
1866
1867 type PhotoSequenceCreateCall struct {
1868 s *Service
1869 photosequence *PhotoSequence
1870 urlParams_ gensupport.URLParams
1871 ctx_ context.Context
1872 header_ http.Header
1873 }
1874
1875 // Create: After the client finishes uploading the PhotoSequence with the
1876 // returned UploadRef, CreatePhotoSequence extracts a sequence of 360 photos
1877 // from a video or Extensible Device Metadata (XDM, http://www.xdm.org/) to be
1878 // published to Street View on Google Maps. `CreatePhotoSequence` returns an
1879 // Operation, with the PhotoSequence Id set in the `Operation.name` field. This
1880 // method returns the following error codes: * google.rpc.Code.INVALID_ARGUMENT
1881 // if the request is malformed. * google.rpc.Code.NOT_FOUND if the upload
1882 // reference does not exist.
1883 func (r *PhotoSequenceService) Create(photosequence *PhotoSequence) *PhotoSequenceCreateCall {
1884 c := &PhotoSequenceCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1885 c.photosequence = photosequence
1886 return c
1887 }
1888
1889 // InputType sets the optional parameter "inputType": Required. The input form
1890 // of PhotoSequence.
1891 //
1892 // Possible values:
1893 //
1894 // "INPUT_TYPE_UNSPECIFIED" - Not specified. Server will return
1895 //
1896 // google.rpc.Code.INVALID_ARGUMENT.
1897 //
1898 // "VIDEO" - 360 Video.
1899 // "XDM" - Extensible Device Metadata, http://www.xdm.org
1900 func (c *PhotoSequenceCreateCall) InputType(inputType string) *PhotoSequenceCreateCall {
1901 c.urlParams_.Set("inputType", inputType)
1902 return c
1903 }
1904
1905 // Fields allows partial responses to be retrieved. See
1906 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1907 // details.
1908 func (c *PhotoSequenceCreateCall) Fields(s ...googleapi.Field) *PhotoSequenceCreateCall {
1909 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1910 return c
1911 }
1912
1913 // Context sets the context to be used in this call's Do method.
1914 func (c *PhotoSequenceCreateCall) Context(ctx context.Context) *PhotoSequenceCreateCall {
1915 c.ctx_ = ctx
1916 return c
1917 }
1918
1919 // Header returns a http.Header that can be modified by the caller to add
1920 // headers to the request.
1921 func (c *PhotoSequenceCreateCall) Header() http.Header {
1922 if c.header_ == nil {
1923 c.header_ = make(http.Header)
1924 }
1925 return c.header_
1926 }
1927
1928 func (c *PhotoSequenceCreateCall) doRequest(alt string) (*http.Response, error) {
1929 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1930 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.photosequence)
1931 if err != nil {
1932 return nil, err
1933 }
1934 c.urlParams_.Set("alt", alt)
1935 c.urlParams_.Set("prettyPrint", "false")
1936 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photoSequence")
1937 urls += "?" + c.urlParams_.Encode()
1938 req, err := http.NewRequest("POST", urls, body)
1939 if err != nil {
1940 return nil, err
1941 }
1942 req.Header = reqHeaders
1943 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "streetviewpublish.photoSequence.create", "request", internallog.HTTPRequest(req, body.Bytes()))
1944 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1945 }
1946
1947 // Do executes the "streetviewpublish.photoSequence.create" call.
1948 // Any non-2xx status code is an error. Response headers are in either
1949 // *Operation.ServerResponse.Header or (if a response was returned at all) in
1950 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
1951 // whether the returned error was because http.StatusNotModified was returned.
1952 func (c *PhotoSequenceCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
1953 gensupport.SetOptions(c.urlParams_, opts...)
1954 res, err := c.doRequest("json")
1955 if res != nil && res.StatusCode == http.StatusNotModified {
1956 if res.Body != nil {
1957 res.Body.Close()
1958 }
1959 return nil, gensupport.WrapError(&googleapi.Error{
1960 Code: res.StatusCode,
1961 Header: res.Header,
1962 })
1963 }
1964 if err != nil {
1965 return nil, err
1966 }
1967 defer googleapi.CloseBody(res)
1968 if err := googleapi.CheckResponse(res); err != nil {
1969 return nil, gensupport.WrapError(err)
1970 }
1971 ret := &Operation{
1972 ServerResponse: googleapi.ServerResponse{
1973 Header: res.Header,
1974 HTTPStatusCode: res.StatusCode,
1975 },
1976 }
1977 target := &ret
1978 b, err := gensupport.DecodeResponseBytes(target, res)
1979 if err != nil {
1980 return nil, err
1981 }
1982 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "streetviewpublish.photoSequence.create", "response", internallog.HTTPResponse(res, b))
1983 return ret, nil
1984 }
1985
1986 type PhotoSequenceDeleteCall struct {
1987 s *Service
1988 sequenceId string
1989 urlParams_ gensupport.URLParams
1990 ctx_ context.Context
1991 header_ http.Header
1992 }
1993
1994 // Delete: Deletes a PhotoSequence and its metadata. This method returns the
1995 // following error codes: * google.rpc.Code.PERMISSION_DENIED if the requesting
1996 // user did not create the requested photo sequence. *
1997 // google.rpc.Code.NOT_FOUND if the photo sequence ID does not exist. *
1998 // google.rpc.Code.FAILED_PRECONDITION if the photo sequence ID is not yet
1999 // finished processing.
2000 //
2001 // - sequenceId: ID of the PhotoSequence.
2002 func (r *PhotoSequenceService) Delete(sequenceId string) *PhotoSequenceDeleteCall {
2003 c := &PhotoSequenceDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2004 c.sequenceId = sequenceId
2005 return c
2006 }
2007
2008 // Fields allows partial responses to be retrieved. See
2009 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2010 // details.
2011 func (c *PhotoSequenceDeleteCall) Fields(s ...googleapi.Field) *PhotoSequenceDeleteCall {
2012 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2013 return c
2014 }
2015
2016 // Context sets the context to be used in this call's Do method.
2017 func (c *PhotoSequenceDeleteCall) Context(ctx context.Context) *PhotoSequenceDeleteCall {
2018 c.ctx_ = ctx
2019 return c
2020 }
2021
2022 // Header returns a http.Header that can be modified by the caller to add
2023 // headers to the request.
2024 func (c *PhotoSequenceDeleteCall) Header() http.Header {
2025 if c.header_ == nil {
2026 c.header_ = make(http.Header)
2027 }
2028 return c.header_
2029 }
2030
2031 func (c *PhotoSequenceDeleteCall) doRequest(alt string) (*http.Response, error) {
2032 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2033 c.urlParams_.Set("alt", alt)
2034 c.urlParams_.Set("prettyPrint", "false")
2035 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photoSequence/{sequenceId}")
2036 urls += "?" + c.urlParams_.Encode()
2037 req, err := http.NewRequest("DELETE", urls, nil)
2038 if err != nil {
2039 return nil, err
2040 }
2041 req.Header = reqHeaders
2042 googleapi.Expand(req.URL, map[string]string{
2043 "sequenceId": c.sequenceId,
2044 })
2045 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "streetviewpublish.photoSequence.delete", "request", internallog.HTTPRequest(req, nil))
2046 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2047 }
2048
2049 // Do executes the "streetviewpublish.photoSequence.delete" call.
2050 // Any non-2xx status code is an error. Response headers are in either
2051 // *Empty.ServerResponse.Header or (if a response was returned at all) in
2052 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2053 // whether the returned error was because http.StatusNotModified was returned.
2054 func (c *PhotoSequenceDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
2055 gensupport.SetOptions(c.urlParams_, opts...)
2056 res, err := c.doRequest("json")
2057 if res != nil && res.StatusCode == http.StatusNotModified {
2058 if res.Body != nil {
2059 res.Body.Close()
2060 }
2061 return nil, gensupport.WrapError(&googleapi.Error{
2062 Code: res.StatusCode,
2063 Header: res.Header,
2064 })
2065 }
2066 if err != nil {
2067 return nil, err
2068 }
2069 defer googleapi.CloseBody(res)
2070 if err := googleapi.CheckResponse(res); err != nil {
2071 return nil, gensupport.WrapError(err)
2072 }
2073 ret := &Empty{
2074 ServerResponse: googleapi.ServerResponse{
2075 Header: res.Header,
2076 HTTPStatusCode: res.StatusCode,
2077 },
2078 }
2079 target := &ret
2080 b, err := gensupport.DecodeResponseBytes(target, res)
2081 if err != nil {
2082 return nil, err
2083 }
2084 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "streetviewpublish.photoSequence.delete", "response", internallog.HTTPResponse(res, b))
2085 return ret, nil
2086 }
2087
2088 type PhotoSequenceGetCall struct {
2089 s *Service
2090 sequenceId string
2091 urlParams_ gensupport.URLParams
2092 ifNoneMatch_ string
2093 ctx_ context.Context
2094 header_ http.Header
2095 }
2096
2097 // Get: Gets the metadata of the specified PhotoSequence via the Operation
2098 // interface. This method returns the following three types of responses: *
2099 // `Operation.done` = false, if the processing of PhotoSequence is not finished
2100 // yet. * `Operation.done` = true and `Operation.error` is populated, if there
2101 // was an error in processing. * `Operation.done` = true and
2102 // `Operation.response` is poulated, which contains a PhotoSequence message.
2103 // This method returns the following error codes: *
2104 // google.rpc.Code.PERMISSION_DENIED if the requesting user did not create the
2105 // requested PhotoSequence. * google.rpc.Code.NOT_FOUND if the requested
2106 // PhotoSequence does not exist.
2107 //
2108 // - sequenceId: ID of the photo sequence.
2109 func (r *PhotoSequenceService) Get(sequenceId string) *PhotoSequenceGetCall {
2110 c := &PhotoSequenceGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2111 c.sequenceId = sequenceId
2112 return c
2113 }
2114
2115 // Filter sets the optional parameter "filter": The filter expression. For
2116 // example: `published_status=PUBLISHED`. The filters supported are:
2117 // `published_status`. See https://google.aip.dev/160 for more information.
2118 func (c *PhotoSequenceGetCall) Filter(filter string) *PhotoSequenceGetCall {
2119 c.urlParams_.Set("filter", filter)
2120 return c
2121 }
2122
2123 // View sets the optional parameter "view": Specifies if a download URL for the
2124 // photo sequence should be returned in `download_url` of individual photos in
2125 // the PhotoSequence response. > Note: Currently not implemented.
2126 //
2127 // Possible values:
2128 //
2129 // "BASIC" - Server responses do not include the download URL for the photo
2130 //
2131 // bytes. The default value.
2132 //
2133 // "INCLUDE_DOWNLOAD_URL" - Server responses include the download URL for the
2134 //
2135 // photo bytes.
2136 func (c *PhotoSequenceGetCall) View(view string) *PhotoSequenceGetCall {
2137 c.urlParams_.Set("view", view)
2138 return c
2139 }
2140
2141 // Fields allows partial responses to be retrieved. See
2142 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2143 // details.
2144 func (c *PhotoSequenceGetCall) Fields(s ...googleapi.Field) *PhotoSequenceGetCall {
2145 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2146 return c
2147 }
2148
2149 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2150 // object's ETag matches the given value. This is useful for getting updates
2151 // only after the object has changed since the last request.
2152 func (c *PhotoSequenceGetCall) IfNoneMatch(entityTag string) *PhotoSequenceGetCall {
2153 c.ifNoneMatch_ = entityTag
2154 return c
2155 }
2156
2157 // Context sets the context to be used in this call's Do method.
2158 func (c *PhotoSequenceGetCall) Context(ctx context.Context) *PhotoSequenceGetCall {
2159 c.ctx_ = ctx
2160 return c
2161 }
2162
2163 // Header returns a http.Header that can be modified by the caller to add
2164 // headers to the request.
2165 func (c *PhotoSequenceGetCall) Header() http.Header {
2166 if c.header_ == nil {
2167 c.header_ = make(http.Header)
2168 }
2169 return c.header_
2170 }
2171
2172 func (c *PhotoSequenceGetCall) doRequest(alt string) (*http.Response, error) {
2173 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2174 if c.ifNoneMatch_ != "" {
2175 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2176 }
2177 c.urlParams_.Set("alt", alt)
2178 c.urlParams_.Set("prettyPrint", "false")
2179 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photoSequence/{sequenceId}")
2180 urls += "?" + c.urlParams_.Encode()
2181 req, err := http.NewRequest("GET", urls, nil)
2182 if err != nil {
2183 return nil, err
2184 }
2185 req.Header = reqHeaders
2186 googleapi.Expand(req.URL, map[string]string{
2187 "sequenceId": c.sequenceId,
2188 })
2189 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "streetviewpublish.photoSequence.get", "request", internallog.HTTPRequest(req, nil))
2190 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2191 }
2192
2193 // Do executes the "streetviewpublish.photoSequence.get" call.
2194 // Any non-2xx status code is an error. Response headers are in either
2195 // *Operation.ServerResponse.Header or (if a response was returned at all) in
2196 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2197 // whether the returned error was because http.StatusNotModified was returned.
2198 func (c *PhotoSequenceGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2199 gensupport.SetOptions(c.urlParams_, opts...)
2200 res, err := c.doRequest("json")
2201 if res != nil && res.StatusCode == http.StatusNotModified {
2202 if res.Body != nil {
2203 res.Body.Close()
2204 }
2205 return nil, gensupport.WrapError(&googleapi.Error{
2206 Code: res.StatusCode,
2207 Header: res.Header,
2208 })
2209 }
2210 if err != nil {
2211 return nil, err
2212 }
2213 defer googleapi.CloseBody(res)
2214 if err := googleapi.CheckResponse(res); err != nil {
2215 return nil, gensupport.WrapError(err)
2216 }
2217 ret := &Operation{
2218 ServerResponse: googleapi.ServerResponse{
2219 Header: res.Header,
2220 HTTPStatusCode: res.StatusCode,
2221 },
2222 }
2223 target := &ret
2224 b, err := gensupport.DecodeResponseBytes(target, res)
2225 if err != nil {
2226 return nil, err
2227 }
2228 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "streetviewpublish.photoSequence.get", "response", internallog.HTTPResponse(res, b))
2229 return ret, nil
2230 }
2231
2232 type PhotoSequenceStartUploadCall struct {
2233 s *Service
2234 empty *Empty
2235 urlParams_ gensupport.URLParams
2236 ctx_ context.Context
2237 header_ http.Header
2238 }
2239
2240 // StartUpload: Creates an upload session to start uploading photo sequence
2241 // data. The upload URL of the returned UploadRef is used to upload the data
2242 // for the `photoSequence`. After the upload is complete, the UploadRef is used
2243 // with CreatePhotoSequence to create the PhotoSequence object entry.
2244 func (r *PhotoSequenceService) StartUpload(empty *Empty) *PhotoSequenceStartUploadCall {
2245 c := &PhotoSequenceStartUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2246 c.empty = empty
2247 return c
2248 }
2249
2250 // Fields allows partial responses to be retrieved. See
2251 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2252 // details.
2253 func (c *PhotoSequenceStartUploadCall) Fields(s ...googleapi.Field) *PhotoSequenceStartUploadCall {
2254 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2255 return c
2256 }
2257
2258 // Context sets the context to be used in this call's Do method.
2259 func (c *PhotoSequenceStartUploadCall) Context(ctx context.Context) *PhotoSequenceStartUploadCall {
2260 c.ctx_ = ctx
2261 return c
2262 }
2263
2264 // Header returns a http.Header that can be modified by the caller to add
2265 // headers to the request.
2266 func (c *PhotoSequenceStartUploadCall) Header() http.Header {
2267 if c.header_ == nil {
2268 c.header_ = make(http.Header)
2269 }
2270 return c.header_
2271 }
2272
2273 func (c *PhotoSequenceStartUploadCall) doRequest(alt string) (*http.Response, error) {
2274 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2275 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.empty)
2276 if err != nil {
2277 return nil, err
2278 }
2279 c.urlParams_.Set("alt", alt)
2280 c.urlParams_.Set("prettyPrint", "false")
2281 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photoSequence:startUpload")
2282 urls += "?" + c.urlParams_.Encode()
2283 req, err := http.NewRequest("POST", urls, body)
2284 if err != nil {
2285 return nil, err
2286 }
2287 req.Header = reqHeaders
2288 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "streetviewpublish.photoSequence.startUpload", "request", internallog.HTTPRequest(req, body.Bytes()))
2289 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2290 }
2291
2292 // Do executes the "streetviewpublish.photoSequence.startUpload" call.
2293 // Any non-2xx status code is an error. Response headers are in either
2294 // *UploadRef.ServerResponse.Header or (if a response was returned at all) in
2295 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2296 // whether the returned error was because http.StatusNotModified was returned.
2297 func (c *PhotoSequenceStartUploadCall) Do(opts ...googleapi.CallOption) (*UploadRef, error) {
2298 gensupport.SetOptions(c.urlParams_, opts...)
2299 res, err := c.doRequest("json")
2300 if res != nil && res.StatusCode == http.StatusNotModified {
2301 if res.Body != nil {
2302 res.Body.Close()
2303 }
2304 return nil, gensupport.WrapError(&googleapi.Error{
2305 Code: res.StatusCode,
2306 Header: res.Header,
2307 })
2308 }
2309 if err != nil {
2310 return nil, err
2311 }
2312 defer googleapi.CloseBody(res)
2313 if err := googleapi.CheckResponse(res); err != nil {
2314 return nil, gensupport.WrapError(err)
2315 }
2316 ret := &UploadRef{
2317 ServerResponse: googleapi.ServerResponse{
2318 Header: res.Header,
2319 HTTPStatusCode: res.StatusCode,
2320 },
2321 }
2322 target := &ret
2323 b, err := gensupport.DecodeResponseBytes(target, res)
2324 if err != nil {
2325 return nil, err
2326 }
2327 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "streetviewpublish.photoSequence.startUpload", "response", internallog.HTTPResponse(res, b))
2328 return ret, nil
2329 }
2330
2331 type PhotoSequencesListCall struct {
2332 s *Service
2333 urlParams_ gensupport.URLParams
2334 ifNoneMatch_ string
2335 ctx_ context.Context
2336 header_ http.Header
2337 }
2338
2339 // List: Lists all the PhotoSequences that belong to the user, in descending
2340 // CreatePhotoSequence timestamp order.
2341 func (r *PhotoSequencesService) List() *PhotoSequencesListCall {
2342 c := &PhotoSequencesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2343 return c
2344 }
2345
2346 // Filter sets the optional parameter "filter": The filter expression. For
2347 // example: `imagery_type=SPHERICAL`. The filters supported are:
2348 // `imagery_type`, `processing_state`, `min_latitude`, `max_latitude`,
2349 // `min_longitude`, `max_longitude`, `filename_query`,
2350 // `min_capture_time_seconds`, `max_capture_time_seconds. See
2351 // https://google.aip.dev/160 for more information. Filename queries should
2352 // sent as a Phrase in order to support multiple words and special characters
2353 // by adding escaped quotes. Ex: filename_query="example of a phrase.mp4"
2354 func (c *PhotoSequencesListCall) Filter(filter string) *PhotoSequencesListCall {
2355 c.urlParams_.Set("filter", filter)
2356 return c
2357 }
2358
2359 // PageSize sets the optional parameter "pageSize": The maximum number of photo
2360 // sequences to return. `pageSize` must be non-negative. If `pageSize` is zero
2361 // or is not provided, the default page size of 100 is used. The number of
2362 // photo sequences returned in the response may be less than `pageSize` if the
2363 // number of matches is less than `pageSize`. This is currently unimplemented
2364 // but is in process.
2365 func (c *PhotoSequencesListCall) PageSize(pageSize int64) *PhotoSequencesListCall {
2366 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2367 return c
2368 }
2369
2370 // PageToken sets the optional parameter "pageToken": The nextPageToken value
2371 // returned from a previous ListPhotoSequences request, if any.
2372 func (c *PhotoSequencesListCall) PageToken(pageToken string) *PhotoSequencesListCall {
2373 c.urlParams_.Set("pageToken", pageToken)
2374 return c
2375 }
2376
2377 // Fields allows partial responses to be retrieved. See
2378 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2379 // details.
2380 func (c *PhotoSequencesListCall) Fields(s ...googleapi.Field) *PhotoSequencesListCall {
2381 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2382 return c
2383 }
2384
2385 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2386 // object's ETag matches the given value. This is useful for getting updates
2387 // only after the object has changed since the last request.
2388 func (c *PhotoSequencesListCall) IfNoneMatch(entityTag string) *PhotoSequencesListCall {
2389 c.ifNoneMatch_ = entityTag
2390 return c
2391 }
2392
2393 // Context sets the context to be used in this call's Do method.
2394 func (c *PhotoSequencesListCall) Context(ctx context.Context) *PhotoSequencesListCall {
2395 c.ctx_ = ctx
2396 return c
2397 }
2398
2399 // Header returns a http.Header that can be modified by the caller to add
2400 // headers to the request.
2401 func (c *PhotoSequencesListCall) Header() http.Header {
2402 if c.header_ == nil {
2403 c.header_ = make(http.Header)
2404 }
2405 return c.header_
2406 }
2407
2408 func (c *PhotoSequencesListCall) doRequest(alt string) (*http.Response, error) {
2409 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2410 if c.ifNoneMatch_ != "" {
2411 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2412 }
2413 c.urlParams_.Set("alt", alt)
2414 c.urlParams_.Set("prettyPrint", "false")
2415 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photoSequences")
2416 urls += "?" + c.urlParams_.Encode()
2417 req, err := http.NewRequest("GET", urls, nil)
2418 if err != nil {
2419 return nil, err
2420 }
2421 req.Header = reqHeaders
2422 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "streetviewpublish.photoSequences.list", "request", internallog.HTTPRequest(req, nil))
2423 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2424 }
2425
2426 // Do executes the "streetviewpublish.photoSequences.list" call.
2427 // Any non-2xx status code is an error. Response headers are in either
2428 // *ListPhotoSequencesResponse.ServerResponse.Header or (if a response was
2429 // returned at all) in error.(*googleapi.Error).Header. Use
2430 // googleapi.IsNotModified to check whether the returned error was because
2431 // http.StatusNotModified was returned.
2432 func (c *PhotoSequencesListCall) Do(opts ...googleapi.CallOption) (*ListPhotoSequencesResponse, error) {
2433 gensupport.SetOptions(c.urlParams_, opts...)
2434 res, err := c.doRequest("json")
2435 if res != nil && res.StatusCode == http.StatusNotModified {
2436 if res.Body != nil {
2437 res.Body.Close()
2438 }
2439 return nil, gensupport.WrapError(&googleapi.Error{
2440 Code: res.StatusCode,
2441 Header: res.Header,
2442 })
2443 }
2444 if err != nil {
2445 return nil, err
2446 }
2447 defer googleapi.CloseBody(res)
2448 if err := googleapi.CheckResponse(res); err != nil {
2449 return nil, gensupport.WrapError(err)
2450 }
2451 ret := &ListPhotoSequencesResponse{
2452 ServerResponse: googleapi.ServerResponse{
2453 Header: res.Header,
2454 HTTPStatusCode: res.StatusCode,
2455 },
2456 }
2457 target := &ret
2458 b, err := gensupport.DecodeResponseBytes(target, res)
2459 if err != nil {
2460 return nil, err
2461 }
2462 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "streetviewpublish.photoSequences.list", "response", internallog.HTTPResponse(res, b))
2463 return ret, nil
2464 }
2465
2466 // Pages invokes f for each page of results.
2467 // A non-nil error returned from f will halt the iteration.
2468 // The provided context supersedes any context provided to the Context method.
2469 func (c *PhotoSequencesListCall) Pages(ctx context.Context, f func(*ListPhotoSequencesResponse) error) error {
2470 c.ctx_ = ctx
2471 defer c.PageToken(c.urlParams_.Get("pageToken"))
2472 for {
2473 x, err := c.Do()
2474 if err != nil {
2475 return err
2476 }
2477 if err := f(x); err != nil {
2478 return err
2479 }
2480 if x.NextPageToken == "" {
2481 return nil
2482 }
2483 c.PageToken(x.NextPageToken)
2484 }
2485 }
2486
2487 type PhotosBatchDeleteCall struct {
2488 s *Service
2489 batchdeletephotosrequest *BatchDeletePhotosRequest
2490 urlParams_ gensupport.URLParams
2491 ctx_ context.Context
2492 header_ http.Header
2493 }
2494
2495 // BatchDelete: Deletes a list of Photos and their metadata. Note that if
2496 // BatchDeletePhotos fails, either critical fields are missing or there is an
2497 // authentication error. Even if BatchDeletePhotos succeeds, individual photos
2498 // in the batch may have failures. These failures are specified in each
2499 // PhotoResponse.status in BatchDeletePhotosResponse.results. See DeletePhoto
2500 // for specific failures that can occur per photo.
2501 func (r *PhotosService) BatchDelete(batchdeletephotosrequest *BatchDeletePhotosRequest) *PhotosBatchDeleteCall {
2502 c := &PhotosBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2503 c.batchdeletephotosrequest = batchdeletephotosrequest
2504 return c
2505 }
2506
2507 // Fields allows partial responses to be retrieved. See
2508 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2509 // details.
2510 func (c *PhotosBatchDeleteCall) Fields(s ...googleapi.Field) *PhotosBatchDeleteCall {
2511 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2512 return c
2513 }
2514
2515 // Context sets the context to be used in this call's Do method.
2516 func (c *PhotosBatchDeleteCall) Context(ctx context.Context) *PhotosBatchDeleteCall {
2517 c.ctx_ = ctx
2518 return c
2519 }
2520
2521 // Header returns a http.Header that can be modified by the caller to add
2522 // headers to the request.
2523 func (c *PhotosBatchDeleteCall) Header() http.Header {
2524 if c.header_ == nil {
2525 c.header_ = make(http.Header)
2526 }
2527 return c.header_
2528 }
2529
2530 func (c *PhotosBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
2531 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2532 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchdeletephotosrequest)
2533 if err != nil {
2534 return nil, err
2535 }
2536 c.urlParams_.Set("alt", alt)
2537 c.urlParams_.Set("prettyPrint", "false")
2538 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photos:batchDelete")
2539 urls += "?" + c.urlParams_.Encode()
2540 req, err := http.NewRequest("POST", urls, body)
2541 if err != nil {
2542 return nil, err
2543 }
2544 req.Header = reqHeaders
2545 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "streetviewpublish.photos.batchDelete", "request", internallog.HTTPRequest(req, body.Bytes()))
2546 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2547 }
2548
2549 // Do executes the "streetviewpublish.photos.batchDelete" call.
2550 // Any non-2xx status code is an error. Response headers are in either
2551 // *BatchDeletePhotosResponse.ServerResponse.Header or (if a response was
2552 // returned at all) in error.(*googleapi.Error).Header. Use
2553 // googleapi.IsNotModified to check whether the returned error was because
2554 // http.StatusNotModified was returned.
2555 func (c *PhotosBatchDeleteCall) Do(opts ...googleapi.CallOption) (*BatchDeletePhotosResponse, error) {
2556 gensupport.SetOptions(c.urlParams_, opts...)
2557 res, err := c.doRequest("json")
2558 if res != nil && res.StatusCode == http.StatusNotModified {
2559 if res.Body != nil {
2560 res.Body.Close()
2561 }
2562 return nil, gensupport.WrapError(&googleapi.Error{
2563 Code: res.StatusCode,
2564 Header: res.Header,
2565 })
2566 }
2567 if err != nil {
2568 return nil, err
2569 }
2570 defer googleapi.CloseBody(res)
2571 if err := googleapi.CheckResponse(res); err != nil {
2572 return nil, gensupport.WrapError(err)
2573 }
2574 ret := &BatchDeletePhotosResponse{
2575 ServerResponse: googleapi.ServerResponse{
2576 Header: res.Header,
2577 HTTPStatusCode: res.StatusCode,
2578 },
2579 }
2580 target := &ret
2581 b, err := gensupport.DecodeResponseBytes(target, res)
2582 if err != nil {
2583 return nil, err
2584 }
2585 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "streetviewpublish.photos.batchDelete", "response", internallog.HTTPResponse(res, b))
2586 return ret, nil
2587 }
2588
2589 type PhotosBatchGetCall struct {
2590 s *Service
2591 urlParams_ gensupport.URLParams
2592 ifNoneMatch_ string
2593 ctx_ context.Context
2594 header_ http.Header
2595 }
2596
2597 // BatchGet: Gets the metadata of the specified Photo batch. Note that if
2598 // BatchGetPhotos fails, either critical fields are missing or there is an
2599 // authentication error. Even if BatchGetPhotos succeeds, individual photos in
2600 // the batch may have failures. These failures are specified in each
2601 // PhotoResponse.status in BatchGetPhotosResponse.results. See GetPhoto for
2602 // specific failures that can occur per photo.
2603 func (r *PhotosService) BatchGet() *PhotosBatchGetCall {
2604 c := &PhotosBatchGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2605 return c
2606 }
2607
2608 // LanguageCode sets the optional parameter "languageCode": The BCP-47 language
2609 // code, such as "en-US" or "sr-Latn". For more information, see
2610 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. If
2611 // language_code is unspecified, the user's language preference for Google
2612 // services is used.
2613 func (c *PhotosBatchGetCall) LanguageCode(languageCode string) *PhotosBatchGetCall {
2614 c.urlParams_.Set("languageCode", languageCode)
2615 return c
2616 }
2617
2618 // PhotoIds sets the optional parameter "photoIds": Required. IDs of the
2619 // Photos. For HTTP GET requests, the URL query parameter should be
2620 // `photoIds=&photoIds=&...`.
2621 func (c *PhotosBatchGetCall) PhotoIds(photoIds ...string) *PhotosBatchGetCall {
2622 c.urlParams_.SetMulti("photoIds", append([]string{}, photoIds...))
2623 return c
2624 }
2625
2626 // View sets the optional parameter "view": Required. Specifies if a download
2627 // URL for the photo bytes should be returned in the Photo response.
2628 //
2629 // Possible values:
2630 //
2631 // "BASIC" - Server responses do not include the download URL for the photo
2632 //
2633 // bytes. The default value.
2634 //
2635 // "INCLUDE_DOWNLOAD_URL" - Server responses include the download URL for the
2636 //
2637 // photo bytes.
2638 func (c *PhotosBatchGetCall) View(view string) *PhotosBatchGetCall {
2639 c.urlParams_.Set("view", view)
2640 return c
2641 }
2642
2643 // Fields allows partial responses to be retrieved. See
2644 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2645 // details.
2646 func (c *PhotosBatchGetCall) Fields(s ...googleapi.Field) *PhotosBatchGetCall {
2647 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2648 return c
2649 }
2650
2651 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2652 // object's ETag matches the given value. This is useful for getting updates
2653 // only after the object has changed since the last request.
2654 func (c *PhotosBatchGetCall) IfNoneMatch(entityTag string) *PhotosBatchGetCall {
2655 c.ifNoneMatch_ = entityTag
2656 return c
2657 }
2658
2659 // Context sets the context to be used in this call's Do method.
2660 func (c *PhotosBatchGetCall) Context(ctx context.Context) *PhotosBatchGetCall {
2661 c.ctx_ = ctx
2662 return c
2663 }
2664
2665 // Header returns a http.Header that can be modified by the caller to add
2666 // headers to the request.
2667 func (c *PhotosBatchGetCall) Header() http.Header {
2668 if c.header_ == nil {
2669 c.header_ = make(http.Header)
2670 }
2671 return c.header_
2672 }
2673
2674 func (c *PhotosBatchGetCall) doRequest(alt string) (*http.Response, error) {
2675 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2676 if c.ifNoneMatch_ != "" {
2677 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2678 }
2679 c.urlParams_.Set("alt", alt)
2680 c.urlParams_.Set("prettyPrint", "false")
2681 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photos:batchGet")
2682 urls += "?" + c.urlParams_.Encode()
2683 req, err := http.NewRequest("GET", urls, nil)
2684 if err != nil {
2685 return nil, err
2686 }
2687 req.Header = reqHeaders
2688 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "streetviewpublish.photos.batchGet", "request", internallog.HTTPRequest(req, nil))
2689 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2690 }
2691
2692 // Do executes the "streetviewpublish.photos.batchGet" call.
2693 // Any non-2xx status code is an error. Response headers are in either
2694 // *BatchGetPhotosResponse.ServerResponse.Header or (if a response was returned
2695 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2696 // check whether the returned error was because http.StatusNotModified was
2697 // returned.
2698 func (c *PhotosBatchGetCall) Do(opts ...googleapi.CallOption) (*BatchGetPhotosResponse, error) {
2699 gensupport.SetOptions(c.urlParams_, opts...)
2700 res, err := c.doRequest("json")
2701 if res != nil && res.StatusCode == http.StatusNotModified {
2702 if res.Body != nil {
2703 res.Body.Close()
2704 }
2705 return nil, gensupport.WrapError(&googleapi.Error{
2706 Code: res.StatusCode,
2707 Header: res.Header,
2708 })
2709 }
2710 if err != nil {
2711 return nil, err
2712 }
2713 defer googleapi.CloseBody(res)
2714 if err := googleapi.CheckResponse(res); err != nil {
2715 return nil, gensupport.WrapError(err)
2716 }
2717 ret := &BatchGetPhotosResponse{
2718 ServerResponse: googleapi.ServerResponse{
2719 Header: res.Header,
2720 HTTPStatusCode: res.StatusCode,
2721 },
2722 }
2723 target := &ret
2724 b, err := gensupport.DecodeResponseBytes(target, res)
2725 if err != nil {
2726 return nil, err
2727 }
2728 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "streetviewpublish.photos.batchGet", "response", internallog.HTTPResponse(res, b))
2729 return ret, nil
2730 }
2731
2732 type PhotosBatchUpdateCall struct {
2733 s *Service
2734 batchupdatephotosrequest *BatchUpdatePhotosRequest
2735 urlParams_ gensupport.URLParams
2736 ctx_ context.Context
2737 header_ http.Header
2738 }
2739
2740 // BatchUpdate: Updates the metadata of Photos, such as pose, place
2741 // association, connections, etc. Changing the pixels of photos is not
2742 // supported. Note that if BatchUpdatePhotos fails, either critical fields are
2743 // missing or there is an authentication error. Even if BatchUpdatePhotos
2744 // succeeds, individual photos in the batch may have failures. These failures
2745 // are specified in each PhotoResponse.status in
2746 // BatchUpdatePhotosResponse.results. See UpdatePhoto for specific failures
2747 // that can occur per photo. Only the fields specified in updateMask field are
2748 // used. If `updateMask` is not present, the update applies to all fields. The
2749 // number of UpdatePhotoRequest messages in a BatchUpdatePhotosRequest must not
2750 // exceed 20. > Note: To update Pose.altitude, Pose.latLngPair has to be filled
2751 // as well. Otherwise, the request will fail.
2752 func (r *PhotosService) BatchUpdate(batchupdatephotosrequest *BatchUpdatePhotosRequest) *PhotosBatchUpdateCall {
2753 c := &PhotosBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2754 c.batchupdatephotosrequest = batchupdatephotosrequest
2755 return c
2756 }
2757
2758 // Fields allows partial responses to be retrieved. See
2759 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2760 // details.
2761 func (c *PhotosBatchUpdateCall) Fields(s ...googleapi.Field) *PhotosBatchUpdateCall {
2762 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2763 return c
2764 }
2765
2766 // Context sets the context to be used in this call's Do method.
2767 func (c *PhotosBatchUpdateCall) Context(ctx context.Context) *PhotosBatchUpdateCall {
2768 c.ctx_ = ctx
2769 return c
2770 }
2771
2772 // Header returns a http.Header that can be modified by the caller to add
2773 // headers to the request.
2774 func (c *PhotosBatchUpdateCall) Header() http.Header {
2775 if c.header_ == nil {
2776 c.header_ = make(http.Header)
2777 }
2778 return c.header_
2779 }
2780
2781 func (c *PhotosBatchUpdateCall) doRequest(alt string) (*http.Response, error) {
2782 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2783 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchupdatephotosrequest)
2784 if err != nil {
2785 return nil, err
2786 }
2787 c.urlParams_.Set("alt", alt)
2788 c.urlParams_.Set("prettyPrint", "false")
2789 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photos:batchUpdate")
2790 urls += "?" + c.urlParams_.Encode()
2791 req, err := http.NewRequest("POST", urls, body)
2792 if err != nil {
2793 return nil, err
2794 }
2795 req.Header = reqHeaders
2796 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "streetviewpublish.photos.batchUpdate", "request", internallog.HTTPRequest(req, body.Bytes()))
2797 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2798 }
2799
2800 // Do executes the "streetviewpublish.photos.batchUpdate" call.
2801 // Any non-2xx status code is an error. Response headers are in either
2802 // *BatchUpdatePhotosResponse.ServerResponse.Header or (if a response was
2803 // returned at all) in error.(*googleapi.Error).Header. Use
2804 // googleapi.IsNotModified to check whether the returned error was because
2805 // http.StatusNotModified was returned.
2806 func (c *PhotosBatchUpdateCall) Do(opts ...googleapi.CallOption) (*BatchUpdatePhotosResponse, error) {
2807 gensupport.SetOptions(c.urlParams_, opts...)
2808 res, err := c.doRequest("json")
2809 if res != nil && res.StatusCode == http.StatusNotModified {
2810 if res.Body != nil {
2811 res.Body.Close()
2812 }
2813 return nil, gensupport.WrapError(&googleapi.Error{
2814 Code: res.StatusCode,
2815 Header: res.Header,
2816 })
2817 }
2818 if err != nil {
2819 return nil, err
2820 }
2821 defer googleapi.CloseBody(res)
2822 if err := googleapi.CheckResponse(res); err != nil {
2823 return nil, gensupport.WrapError(err)
2824 }
2825 ret := &BatchUpdatePhotosResponse{
2826 ServerResponse: googleapi.ServerResponse{
2827 Header: res.Header,
2828 HTTPStatusCode: res.StatusCode,
2829 },
2830 }
2831 target := &ret
2832 b, err := gensupport.DecodeResponseBytes(target, res)
2833 if err != nil {
2834 return nil, err
2835 }
2836 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "streetviewpublish.photos.batchUpdate", "response", internallog.HTTPResponse(res, b))
2837 return ret, nil
2838 }
2839
2840 type PhotosListCall struct {
2841 s *Service
2842 urlParams_ gensupport.URLParams
2843 ifNoneMatch_ string
2844 ctx_ context.Context
2845 header_ http.Header
2846 }
2847
2848 // List: Lists all the Photos that belong to the user. > Note: Recently created
2849 // photos that are still being indexed are not returned in the response.
2850 func (r *PhotosService) List() *PhotosListCall {
2851 c := &PhotosListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2852 return c
2853 }
2854
2855 // Filter sets the optional parameter "filter": The filter expression. For
2856 // example: `placeId=ChIJj61dQgK6j4AR4GeTYWZsKWw`. The filters supported are:
2857 // `placeId`, `min_latitude`, `max_latitude`, `min_longitude`, `max_longitude`.
2858 // See https://google.aip.dev/160 for more information.
2859 func (c *PhotosListCall) Filter(filter string) *PhotosListCall {
2860 c.urlParams_.Set("filter", filter)
2861 return c
2862 }
2863
2864 // LanguageCode sets the optional parameter "languageCode": The BCP-47 language
2865 // code, such as "en-US" or "sr-Latn". For more information, see
2866 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. If
2867 // language_code is unspecified, the user's language preference for Google
2868 // services is used.
2869 func (c *PhotosListCall) LanguageCode(languageCode string) *PhotosListCall {
2870 c.urlParams_.Set("languageCode", languageCode)
2871 return c
2872 }
2873
2874 // PageSize sets the optional parameter "pageSize": The maximum number of
2875 // photos to return. `pageSize` must be non-negative. If `pageSize` is zero or
2876 // is not provided, the default page size of 100 is used. The number of photos
2877 // returned in the response may be less than `pageSize` if the number of photos
2878 // that belong to the user is less than `pageSize`.
2879 func (c *PhotosListCall) PageSize(pageSize int64) *PhotosListCall {
2880 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2881 return c
2882 }
2883
2884 // PageToken sets the optional parameter "pageToken": The nextPageToken value
2885 // returned from a previous ListPhotos request, if any.
2886 func (c *PhotosListCall) PageToken(pageToken string) *PhotosListCall {
2887 c.urlParams_.Set("pageToken", pageToken)
2888 return c
2889 }
2890
2891 // View sets the optional parameter "view": Required. Specifies if a download
2892 // URL for the photos bytes should be returned in the Photos response.
2893 //
2894 // Possible values:
2895 //
2896 // "BASIC" - Server responses do not include the download URL for the photo
2897 //
2898 // bytes. The default value.
2899 //
2900 // "INCLUDE_DOWNLOAD_URL" - Server responses include the download URL for the
2901 //
2902 // photo bytes.
2903 func (c *PhotosListCall) View(view string) *PhotosListCall {
2904 c.urlParams_.Set("view", view)
2905 return c
2906 }
2907
2908 // Fields allows partial responses to be retrieved. See
2909 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2910 // details.
2911 func (c *PhotosListCall) Fields(s ...googleapi.Field) *PhotosListCall {
2912 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2913 return c
2914 }
2915
2916 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2917 // object's ETag matches the given value. This is useful for getting updates
2918 // only after the object has changed since the last request.
2919 func (c *PhotosListCall) IfNoneMatch(entityTag string) *PhotosListCall {
2920 c.ifNoneMatch_ = entityTag
2921 return c
2922 }
2923
2924 // Context sets the context to be used in this call's Do method.
2925 func (c *PhotosListCall) Context(ctx context.Context) *PhotosListCall {
2926 c.ctx_ = ctx
2927 return c
2928 }
2929
2930 // Header returns a http.Header that can be modified by the caller to add
2931 // headers to the request.
2932 func (c *PhotosListCall) Header() http.Header {
2933 if c.header_ == nil {
2934 c.header_ = make(http.Header)
2935 }
2936 return c.header_
2937 }
2938
2939 func (c *PhotosListCall) doRequest(alt string) (*http.Response, error) {
2940 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2941 if c.ifNoneMatch_ != "" {
2942 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2943 }
2944 c.urlParams_.Set("alt", alt)
2945 c.urlParams_.Set("prettyPrint", "false")
2946 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/photos")
2947 urls += "?" + c.urlParams_.Encode()
2948 req, err := http.NewRequest("GET", urls, nil)
2949 if err != nil {
2950 return nil, err
2951 }
2952 req.Header = reqHeaders
2953 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "streetviewpublish.photos.list", "request", internallog.HTTPRequest(req, nil))
2954 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2955 }
2956
2957 // Do executes the "streetviewpublish.photos.list" call.
2958 // Any non-2xx status code is an error. Response headers are in either
2959 // *ListPhotosResponse.ServerResponse.Header or (if a response was returned at
2960 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2961 // check whether the returned error was because http.StatusNotModified was
2962 // returned.
2963 func (c *PhotosListCall) Do(opts ...googleapi.CallOption) (*ListPhotosResponse, error) {
2964 gensupport.SetOptions(c.urlParams_, opts...)
2965 res, err := c.doRequest("json")
2966 if res != nil && res.StatusCode == http.StatusNotModified {
2967 if res.Body != nil {
2968 res.Body.Close()
2969 }
2970 return nil, gensupport.WrapError(&googleapi.Error{
2971 Code: res.StatusCode,
2972 Header: res.Header,
2973 })
2974 }
2975 if err != nil {
2976 return nil, err
2977 }
2978 defer googleapi.CloseBody(res)
2979 if err := googleapi.CheckResponse(res); err != nil {
2980 return nil, gensupport.WrapError(err)
2981 }
2982 ret := &ListPhotosResponse{
2983 ServerResponse: googleapi.ServerResponse{
2984 Header: res.Header,
2985 HTTPStatusCode: res.StatusCode,
2986 },
2987 }
2988 target := &ret
2989 b, err := gensupport.DecodeResponseBytes(target, res)
2990 if err != nil {
2991 return nil, err
2992 }
2993 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "streetviewpublish.photos.list", "response", internallog.HTTPResponse(res, b))
2994 return ret, nil
2995 }
2996
2997 // Pages invokes f for each page of results.
2998 // A non-nil error returned from f will halt the iteration.
2999 // The provided context supersedes any context provided to the Context method.
3000 func (c *PhotosListCall) Pages(ctx context.Context, f func(*ListPhotosResponse) error) error {
3001 c.ctx_ = ctx
3002 defer c.PageToken(c.urlParams_.Get("pageToken"))
3003 for {
3004 x, err := c.Do()
3005 if err != nil {
3006 return err
3007 }
3008 if err := f(x); err != nil {
3009 return err
3010 }
3011 if x.NextPageToken == "" {
3012 return nil
3013 }
3014 c.PageToken(x.NextPageToken)
3015 }
3016 }