1 // Copyright 2024 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 vision provides access to the Cloud Vision API. 8 // 9 // This package is DEPRECATED. Use package cloud.google.com/go/vision/apiv1 instead. 10 // 11 // For product documentation, see: https://cloud.google.com/vision/ 12 // 13 // # Library status 14 // 15 // These client libraries are officially supported by Google. However, this 16 // library is considered complete and is in maintenance mode. This means 17 // that we will address critical bugs and security issues but will not add 18 // any new features. 19 // 20 // When possible, we recommend using our newer 21 // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) 22 // that are still actively being worked and iterated on. 23 // 24 // # Creating a client 25 // 26 // Usage example: 27 // 28 // import "google.golang.org/api/vision/v1" 29 // ... 30 // ctx := context.Background() 31 // visionService, err := vision.NewService(ctx) 32 // 33 // In this example, Google Application Default Credentials are used for 34 // authentication. For information on how to create and obtain Application 35 // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 36 // 37 // # Other authentication options 38 // 39 // By default, all available scopes (see "Constants") are used to authenticate. 40 // To restrict scopes, use [google.golang.org/api/option.WithScopes]: 41 // 42 // visionService, err := vision.NewService(ctx, option.WithScopes(vision.CloudVisionScope)) 43 // 44 // To use an API key for authentication (note: some APIs do not support API 45 // keys), use [google.golang.org/api/option.WithAPIKey]: 46 // 47 // visionService, err := vision.NewService(ctx, option.WithAPIKey("AIza...")) 48 // 49 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth 50 // flow, use [google.golang.org/api/option.WithTokenSource]: 51 // 52 // config := &oauth2.Config{...} 53 // // ... 54 // token, err := config.Exchange(ctx, ...) 55 // visionService, err := vision.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 56 // 57 // See [google.golang.org/api/option.ClientOption] for details on options. 58 package vision // import "google.golang.org/api/vision/v1" 59 60 import ( 61 "bytes" 62 "context" 63 "encoding/json" 64 "errors" 65 "fmt" 66 "io" 67 "net/http" 68 "net/url" 69 "strconv" 70 "strings" 71 72 googleapi "google.golang.org/api/googleapi" 73 internal "google.golang.org/api/internal" 74 gensupport "google.golang.org/api/internal/gensupport" 75 option "google.golang.org/api/option" 76 internaloption "google.golang.org/api/option/internaloption" 77 htransport "google.golang.org/api/transport/http" 78 ) 79 80 // Always reference these packages, just in case the auto-generated code 81 // below doesn't. 82 var _ = bytes.NewBuffer 83 var _ = strconv.Itoa 84 var _ = fmt.Sprintf 85 var _ = json.NewDecoder 86 var _ = io.Copy 87 var _ = url.Parse 88 var _ = gensupport.MarshalJSON 89 var _ = googleapi.Version 90 var _ = errors.New 91 var _ = strings.Replace 92 var _ = context.Canceled 93 var _ = internaloption.WithDefaultEndpoint 94 var _ = internal.Version 95 96 const apiId = "vision:v1" 97 const apiName = "vision" 98 const apiVersion = "v1" 99 const basePath = "https://vision.googleapis.com/" 100 const basePathTemplate = "https://vision.UNIVERSE_DOMAIN/" 101 const mtlsBasePath = "https://vision.mtls.googleapis.com/" 102 103 // OAuth2 scopes used by this API. 104 const ( 105 // See, edit, configure, and delete your Google Cloud data and see the email 106 // address for your Google Account. 107 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 108 109 // Apply machine learning models to understand and label images 110 CloudVisionScope = "https://www.googleapis.com/auth/cloud-vision" 111 ) 112 113 // NewService creates a new Service. 114 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 115 scopesOption := internaloption.WithDefaultScopes( 116 "https://www.googleapis.com/auth/cloud-platform", 117 "https://www.googleapis.com/auth/cloud-vision", 118 ) 119 // NOTE: prepend, so we don't override user-specified scopes. 120 opts = append([]option.ClientOption{scopesOption}, opts...) 121 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 122 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) 123 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 124 opts = append(opts, internaloption.EnableNewAuthLibrary()) 125 client, endpoint, err := htransport.NewClient(ctx, opts...) 126 if err != nil { 127 return nil, err 128 } 129 s, err := New(client) 130 if err != nil { 131 return nil, err 132 } 133 if endpoint != "" { 134 s.BasePath = endpoint 135 } 136 return s, nil 137 } 138 139 // New creates a new Service. It uses the provided http.Client for requests. 140 // 141 // Deprecated: please use NewService instead. 142 // To provide a custom HTTP client, use option.WithHTTPClient. 143 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 144 func New(client *http.Client) (*Service, error) { 145 if client == nil { 146 return nil, errors.New("client is nil") 147 } 148 s := &Service{client: client, BasePath: basePath} 149 s.Files = NewFilesService(s) 150 s.Images = NewImagesService(s) 151 s.Locations = NewLocationsService(s) 152 s.Operations = NewOperationsService(s) 153 s.Projects = NewProjectsService(s) 154 return s, nil 155 } 156 157 type Service struct { 158 client *http.Client 159 BasePath string // API endpoint base URL 160 UserAgent string // optional additional User-Agent fragment 161 162 Files *FilesService 163 164 Images *ImagesService 165 166 Locations *LocationsService 167 168 Operations *OperationsService 169 170 Projects *ProjectsService 171 } 172 173 func (s *Service) userAgent() string { 174 if s.UserAgent == "" { 175 return googleapi.UserAgent 176 } 177 return googleapi.UserAgent + " " + s.UserAgent 178 } 179 180 func NewFilesService(s *Service) *FilesService { 181 rs := &FilesService{s: s} 182 return rs 183 } 184 185 type FilesService struct { 186 s *Service 187 } 188 189 func NewImagesService(s *Service) *ImagesService { 190 rs := &ImagesService{s: s} 191 return rs 192 } 193 194 type ImagesService struct { 195 s *Service 196 } 197 198 func NewLocationsService(s *Service) *LocationsService { 199 rs := &LocationsService{s: s} 200 rs.Operations = NewLocationsOperationsService(s) 201 return rs 202 } 203 204 type LocationsService struct { 205 s *Service 206 207 Operations *LocationsOperationsService 208 } 209 210 func NewLocationsOperationsService(s *Service) *LocationsOperationsService { 211 rs := &LocationsOperationsService{s: s} 212 return rs 213 } 214 215 type LocationsOperationsService struct { 216 s *Service 217 } 218 219 func NewOperationsService(s *Service) *OperationsService { 220 rs := &OperationsService{s: s} 221 return rs 222 } 223 224 type OperationsService struct { 225 s *Service 226 } 227 228 func NewProjectsService(s *Service) *ProjectsService { 229 rs := &ProjectsService{s: s} 230 rs.Files = NewProjectsFilesService(s) 231 rs.Images = NewProjectsImagesService(s) 232 rs.Locations = NewProjectsLocationsService(s) 233 rs.Operations = NewProjectsOperationsService(s) 234 return rs 235 } 236 237 type ProjectsService struct { 238 s *Service 239 240 Files *ProjectsFilesService 241 242 Images *ProjectsImagesService 243 244 Locations *ProjectsLocationsService 245 246 Operations *ProjectsOperationsService 247 } 248 249 func NewProjectsFilesService(s *Service) *ProjectsFilesService { 250 rs := &ProjectsFilesService{s: s} 251 return rs 252 } 253 254 type ProjectsFilesService struct { 255 s *Service 256 } 257 258 func NewProjectsImagesService(s *Service) *ProjectsImagesService { 259 rs := &ProjectsImagesService{s: s} 260 return rs 261 } 262 263 type ProjectsImagesService struct { 264 s *Service 265 } 266 267 func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { 268 rs := &ProjectsLocationsService{s: s} 269 rs.Files = NewProjectsLocationsFilesService(s) 270 rs.Images = NewProjectsLocationsImagesService(s) 271 rs.Operations = NewProjectsLocationsOperationsService(s) 272 rs.ProductSets = NewProjectsLocationsProductSetsService(s) 273 rs.Products = NewProjectsLocationsProductsService(s) 274 return rs 275 } 276 277 type ProjectsLocationsService struct { 278 s *Service 279 280 Files *ProjectsLocationsFilesService 281 282 Images *ProjectsLocationsImagesService 283 284 Operations *ProjectsLocationsOperationsService 285 286 ProductSets *ProjectsLocationsProductSetsService 287 288 Products *ProjectsLocationsProductsService 289 } 290 291 func NewProjectsLocationsFilesService(s *Service) *ProjectsLocationsFilesService { 292 rs := &ProjectsLocationsFilesService{s: s} 293 return rs 294 } 295 296 type ProjectsLocationsFilesService struct { 297 s *Service 298 } 299 300 func NewProjectsLocationsImagesService(s *Service) *ProjectsLocationsImagesService { 301 rs := &ProjectsLocationsImagesService{s: s} 302 return rs 303 } 304 305 type ProjectsLocationsImagesService struct { 306 s *Service 307 } 308 309 func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService { 310 rs := &ProjectsLocationsOperationsService{s: s} 311 return rs 312 } 313 314 type ProjectsLocationsOperationsService struct { 315 s *Service 316 } 317 318 func NewProjectsLocationsProductSetsService(s *Service) *ProjectsLocationsProductSetsService { 319 rs := &ProjectsLocationsProductSetsService{s: s} 320 rs.Products = NewProjectsLocationsProductSetsProductsService(s) 321 return rs 322 } 323 324 type ProjectsLocationsProductSetsService struct { 325 s *Service 326 327 Products *ProjectsLocationsProductSetsProductsService 328 } 329 330 func NewProjectsLocationsProductSetsProductsService(s *Service) *ProjectsLocationsProductSetsProductsService { 331 rs := &ProjectsLocationsProductSetsProductsService{s: s} 332 return rs 333 } 334 335 type ProjectsLocationsProductSetsProductsService struct { 336 s *Service 337 } 338 339 func NewProjectsLocationsProductsService(s *Service) *ProjectsLocationsProductsService { 340 rs := &ProjectsLocationsProductsService{s: s} 341 rs.ReferenceImages = NewProjectsLocationsProductsReferenceImagesService(s) 342 return rs 343 } 344 345 type ProjectsLocationsProductsService struct { 346 s *Service 347 348 ReferenceImages *ProjectsLocationsProductsReferenceImagesService 349 } 350 351 func NewProjectsLocationsProductsReferenceImagesService(s *Service) *ProjectsLocationsProductsReferenceImagesService { 352 rs := &ProjectsLocationsProductsReferenceImagesService{s: s} 353 return rs 354 } 355 356 type ProjectsLocationsProductsReferenceImagesService struct { 357 s *Service 358 } 359 360 func NewProjectsOperationsService(s *Service) *ProjectsOperationsService { 361 rs := &ProjectsOperationsService{s: s} 362 return rs 363 } 364 365 type ProjectsOperationsService struct { 366 s *Service 367 } 368 369 // AddProductToProductSetRequest: Request message for the 370 // `AddProductToProductSet` method. 371 type AddProductToProductSetRequest struct { 372 // Product: Required. The resource name for the Product to be added to this 373 // ProductSet. Format is: 374 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` 375 Product string `json:"product,omitempty"` 376 // ForceSendFields is a list of field names (e.g. "Product") to unconditionally 377 // include in API requests. By default, fields with empty or default values are 378 // omitted from API requests. See 379 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 380 // details. 381 ForceSendFields []string `json:"-"` 382 // NullFields is a list of field names (e.g. "Product") to include in API 383 // requests with the JSON null value. By default, fields with empty values are 384 // omitted from API requests. See 385 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 386 NullFields []string `json:"-"` 387 } 388 389 func (s *AddProductToProductSetRequest) MarshalJSON() ([]byte, error) { 390 type NoMethod AddProductToProductSetRequest 391 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 392 } 393 394 // AnnotateFileRequest: A request to annotate one single file, e.g. a PDF, TIFF 395 // or GIF file. 396 type AnnotateFileRequest struct { 397 // Features: Required. Requested features. 398 Features []*Feature `json:"features,omitempty"` 399 // ImageContext: Additional context that may accompany the image(s) in the 400 // file. 401 ImageContext *ImageContext `json:"imageContext,omitempty"` 402 // InputConfig: Required. Information about the input file. 403 InputConfig *InputConfig `json:"inputConfig,omitempty"` 404 // Pages: Pages of the file to perform image annotation. Pages starts from 1, 405 // we assume the first page of the file is page 1. At most 5 pages are 406 // supported per request. Pages can be negative. Page 1 means the first page. 407 // Page 2 means the second page. Page -1 means the last page. Page -2 means the 408 // second to the last page. If the file is GIF instead of PDF or TIFF, page 409 // refers to GIF frames. If this field is empty, by default the service 410 // performs image annotation for the first 5 pages of the file. 411 Pages []int64 `json:"pages,omitempty"` 412 // ForceSendFields is a list of field names (e.g. "Features") to 413 // unconditionally include in API requests. By default, fields with empty or 414 // default values are omitted from API requests. See 415 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 416 // details. 417 ForceSendFields []string `json:"-"` 418 // NullFields is a list of field names (e.g. "Features") to include in API 419 // requests with the JSON null value. By default, fields with empty values are 420 // omitted from API requests. See 421 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 422 NullFields []string `json:"-"` 423 } 424 425 func (s *AnnotateFileRequest) MarshalJSON() ([]byte, error) { 426 type NoMethod AnnotateFileRequest 427 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 428 } 429 430 // AnnotateFileResponse: Response to a single file annotation request. A file 431 // may contain one or more images, which individually have their own responses. 432 type AnnotateFileResponse struct { 433 // Error: If set, represents the error message for the failed request. The 434 // `responses` field will not be set in this case. 435 Error *Status `json:"error,omitempty"` 436 // InputConfig: Information about the file for which this response is 437 // generated. 438 InputConfig *InputConfig `json:"inputConfig,omitempty"` 439 // Responses: Individual responses to images found within the file. This field 440 // will be empty if the `error` field is set. 441 Responses []*AnnotateImageResponse `json:"responses,omitempty"` 442 // TotalPages: This field gives the total number of pages in the file. 443 TotalPages int64 `json:"totalPages,omitempty"` 444 // ForceSendFields is a list of field names (e.g. "Error") to unconditionally 445 // include in API requests. By default, fields with empty or default values are 446 // omitted from API requests. See 447 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 448 // details. 449 ForceSendFields []string `json:"-"` 450 // NullFields is a list of field names (e.g. "Error") to include in API 451 // requests with the JSON null value. By default, fields with empty values are 452 // omitted from API requests. See 453 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 454 NullFields []string `json:"-"` 455 } 456 457 func (s *AnnotateFileResponse) MarshalJSON() ([]byte, error) { 458 type NoMethod AnnotateFileResponse 459 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 460 } 461 462 // AnnotateImageRequest: Request for performing Google Cloud Vision API tasks 463 // over a user-provided image, with user-requested features, and with context 464 // information. 465 type AnnotateImageRequest struct { 466 // Features: Requested features. 467 Features []*Feature `json:"features,omitempty"` 468 // Image: The image to be processed. 469 Image *Image `json:"image,omitempty"` 470 // ImageContext: Additional context that may accompany the image. 471 ImageContext *ImageContext `json:"imageContext,omitempty"` 472 // ForceSendFields is a list of field names (e.g. "Features") to 473 // unconditionally include in API requests. By default, fields with empty or 474 // default values are omitted from API requests. See 475 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 476 // details. 477 ForceSendFields []string `json:"-"` 478 // NullFields is a list of field names (e.g. "Features") to include in API 479 // requests with the JSON null value. By default, fields with empty values are 480 // omitted from API requests. See 481 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 482 NullFields []string `json:"-"` 483 } 484 485 func (s *AnnotateImageRequest) MarshalJSON() ([]byte, error) { 486 type NoMethod AnnotateImageRequest 487 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 488 } 489 490 // AnnotateImageResponse: Response to an image annotation request. 491 type AnnotateImageResponse struct { 492 // Context: If present, contextual information is needed to understand where 493 // this image comes from. 494 Context *ImageAnnotationContext `json:"context,omitempty"` 495 // CropHintsAnnotation: If present, crop hints have completed successfully. 496 CropHintsAnnotation *CropHintsAnnotation `json:"cropHintsAnnotation,omitempty"` 497 // Error: If set, represents the error message for the operation. Note that 498 // filled-in image annotations are guaranteed to be correct, even when `error` 499 // is set. 500 Error *Status `json:"error,omitempty"` 501 // FaceAnnotations: If present, face detection has completed successfully. 502 FaceAnnotations []*FaceAnnotation `json:"faceAnnotations,omitempty"` 503 // FullTextAnnotation: If present, text (OCR) detection or document (OCR) text 504 // detection has completed successfully. This annotation provides the 505 // structural hierarchy for the OCR detected text. 506 FullTextAnnotation *TextAnnotation `json:"fullTextAnnotation,omitempty"` 507 // ImagePropertiesAnnotation: If present, image properties were extracted 508 // successfully. 509 ImagePropertiesAnnotation *ImageProperties `json:"imagePropertiesAnnotation,omitempty"` 510 // LabelAnnotations: If present, label detection has completed successfully. 511 LabelAnnotations []*EntityAnnotation `json:"labelAnnotations,omitempty"` 512 // LandmarkAnnotations: If present, landmark detection has completed 513 // successfully. 514 LandmarkAnnotations []*EntityAnnotation `json:"landmarkAnnotations,omitempty"` 515 // LocalizedObjectAnnotations: If present, localized object detection has 516 // completed successfully. This will be sorted descending by confidence score. 517 LocalizedObjectAnnotations []*LocalizedObjectAnnotation `json:"localizedObjectAnnotations,omitempty"` 518 // LogoAnnotations: If present, logo detection has completed successfully. 519 LogoAnnotations []*EntityAnnotation `json:"logoAnnotations,omitempty"` 520 // ProductSearchResults: If present, product search has completed successfully. 521 ProductSearchResults *ProductSearchResults `json:"productSearchResults,omitempty"` 522 // SafeSearchAnnotation: If present, safe-search annotation has completed 523 // successfully. 524 SafeSearchAnnotation *SafeSearchAnnotation `json:"safeSearchAnnotation,omitempty"` 525 // TextAnnotations: If present, text (OCR) detection has completed 526 // successfully. 527 TextAnnotations []*EntityAnnotation `json:"textAnnotations,omitempty"` 528 // WebDetection: If present, web detection has completed successfully. 529 WebDetection *WebDetection `json:"webDetection,omitempty"` 530 // ForceSendFields is a list of field names (e.g. "Context") to unconditionally 531 // include in API requests. By default, fields with empty or default values are 532 // omitted from API requests. See 533 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 534 // details. 535 ForceSendFields []string `json:"-"` 536 // NullFields is a list of field names (e.g. "Context") to include in API 537 // requests with the JSON null value. By default, fields with empty values are 538 // omitted from API requests. See 539 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 540 NullFields []string `json:"-"` 541 } 542 543 func (s *AnnotateImageResponse) MarshalJSON() ([]byte, error) { 544 type NoMethod AnnotateImageResponse 545 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 546 } 547 548 // AsyncAnnotateFileRequest: An offline file annotation request. 549 type AsyncAnnotateFileRequest struct { 550 // Features: Required. Requested features. 551 Features []*Feature `json:"features,omitempty"` 552 // ImageContext: Additional context that may accompany the image(s) in the 553 // file. 554 ImageContext *ImageContext `json:"imageContext,omitempty"` 555 // InputConfig: Required. Information about the input file. 556 InputConfig *InputConfig `json:"inputConfig,omitempty"` 557 // OutputConfig: Required. The desired output location and metadata (e.g. 558 // format). 559 OutputConfig *OutputConfig `json:"outputConfig,omitempty"` 560 // ForceSendFields is a list of field names (e.g. "Features") to 561 // unconditionally include in API requests. By default, fields with empty or 562 // default values are omitted from API requests. See 563 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 564 // details. 565 ForceSendFields []string `json:"-"` 566 // NullFields is a list of field names (e.g. "Features") to include in API 567 // requests with the JSON null value. By default, fields with empty values are 568 // omitted from API requests. See 569 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 570 NullFields []string `json:"-"` 571 } 572 573 func (s *AsyncAnnotateFileRequest) MarshalJSON() ([]byte, error) { 574 type NoMethod AsyncAnnotateFileRequest 575 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 576 } 577 578 // AsyncAnnotateFileResponse: The response for a single offline file annotation 579 // request. 580 type AsyncAnnotateFileResponse struct { 581 // OutputConfig: The output location and metadata from 582 // AsyncAnnotateFileRequest. 583 OutputConfig *OutputConfig `json:"outputConfig,omitempty"` 584 // ForceSendFields is a list of field names (e.g. "OutputConfig") to 585 // unconditionally include in API requests. By default, fields with empty or 586 // default values are omitted from API requests. See 587 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 588 // details. 589 ForceSendFields []string `json:"-"` 590 // NullFields is a list of field names (e.g. "OutputConfig") to include in API 591 // requests with the JSON null value. By default, fields with empty values are 592 // omitted from API requests. See 593 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 594 NullFields []string `json:"-"` 595 } 596 597 func (s *AsyncAnnotateFileResponse) MarshalJSON() ([]byte, error) { 598 type NoMethod AsyncAnnotateFileResponse 599 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 600 } 601 602 // AsyncBatchAnnotateFilesRequest: Multiple async file annotation requests are 603 // batched into a single service call. 604 type AsyncBatchAnnotateFilesRequest struct { 605 // Labels: Optional. The labels with user-defined metadata for the request. 606 // Label keys and values can be no longer than 63 characters (Unicode 607 // codepoints), can only contain lowercase letters, numeric characters, 608 // underscores and dashes. International characters are allowed. Label values 609 // are optional. Label keys must start with a letter. 610 Labels map[string]string `json:"labels,omitempty"` 611 // Parent: Optional. Target project and location to make a call. Format: 612 // `projects/{project-id}/locations/{location-id}`. If no parent is specified, 613 // a region will be chosen automatically. Supported location-ids: `us`: USA 614 // country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: The 615 // European Union. Example: `projects/project-A/locations/eu`. 616 Parent string `json:"parent,omitempty"` 617 // Requests: Required. Individual async file annotation requests for this 618 // batch. 619 Requests []*AsyncAnnotateFileRequest `json:"requests,omitempty"` 620 // ForceSendFields is a list of field names (e.g. "Labels") to unconditionally 621 // include in API requests. By default, fields with empty or default values are 622 // omitted from API requests. See 623 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 624 // details. 625 ForceSendFields []string `json:"-"` 626 // NullFields is a list of field names (e.g. "Labels") to include in API 627 // requests with the JSON null value. By default, fields with empty values are 628 // omitted from API requests. See 629 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 630 NullFields []string `json:"-"` 631 } 632 633 func (s *AsyncBatchAnnotateFilesRequest) MarshalJSON() ([]byte, error) { 634 type NoMethod AsyncBatchAnnotateFilesRequest 635 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 636 } 637 638 // AsyncBatchAnnotateFilesResponse: Response to an async batch file annotation 639 // request. 640 type AsyncBatchAnnotateFilesResponse struct { 641 // Responses: The list of file annotation responses, one for each request in 642 // AsyncBatchAnnotateFilesRequest. 643 Responses []*AsyncAnnotateFileResponse `json:"responses,omitempty"` 644 // ForceSendFields is a list of field names (e.g. "Responses") to 645 // unconditionally include in API requests. By default, fields with empty or 646 // default values are omitted from API requests. See 647 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 648 // details. 649 ForceSendFields []string `json:"-"` 650 // NullFields is a list of field names (e.g. "Responses") to include in API 651 // requests with the JSON null value. By default, fields with empty values are 652 // omitted from API requests. See 653 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 654 NullFields []string `json:"-"` 655 } 656 657 func (s *AsyncBatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) { 658 type NoMethod AsyncBatchAnnotateFilesResponse 659 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 660 } 661 662 // AsyncBatchAnnotateImagesRequest: Request for async image annotation for a 663 // list of images. 664 type AsyncBatchAnnotateImagesRequest struct { 665 // Labels: Optional. The labels with user-defined metadata for the request. 666 // Label keys and values can be no longer than 63 characters (Unicode 667 // codepoints), can only contain lowercase letters, numeric characters, 668 // underscores and dashes. International characters are allowed. Label values 669 // are optional. Label keys must start with a letter. 670 Labels map[string]string `json:"labels,omitempty"` 671 // OutputConfig: Required. The desired output location and metadata (e.g. 672 // format). 673 OutputConfig *OutputConfig `json:"outputConfig,omitempty"` 674 // Parent: Optional. Target project and location to make a call. Format: 675 // `projects/{project-id}/locations/{location-id}`. If no parent is specified, 676 // a region will be chosen automatically. Supported location-ids: `us`: USA 677 // country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: The 678 // European Union. Example: `projects/project-A/locations/eu`. 679 Parent string `json:"parent,omitempty"` 680 // Requests: Required. Individual image annotation requests for this batch. 681 Requests []*AnnotateImageRequest `json:"requests,omitempty"` 682 // ForceSendFields is a list of field names (e.g. "Labels") to unconditionally 683 // include in API requests. By default, fields with empty or default values are 684 // omitted from API requests. See 685 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 686 // details. 687 ForceSendFields []string `json:"-"` 688 // NullFields is a list of field names (e.g. "Labels") to include in API 689 // requests with the JSON null value. By default, fields with empty values are 690 // omitted from API requests. See 691 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 692 NullFields []string `json:"-"` 693 } 694 695 func (s *AsyncBatchAnnotateImagesRequest) MarshalJSON() ([]byte, error) { 696 type NoMethod AsyncBatchAnnotateImagesRequest 697 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 698 } 699 700 // AsyncBatchAnnotateImagesResponse: Response to an async batch image 701 // annotation request. 702 type AsyncBatchAnnotateImagesResponse struct { 703 // OutputConfig: The output location and metadata from 704 // AsyncBatchAnnotateImagesRequest. 705 OutputConfig *OutputConfig `json:"outputConfig,omitempty"` 706 // ForceSendFields is a list of field names (e.g. "OutputConfig") to 707 // unconditionally include in API requests. By default, fields with empty or 708 // default values are omitted from API requests. See 709 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 710 // details. 711 ForceSendFields []string `json:"-"` 712 // NullFields is a list of field names (e.g. "OutputConfig") to include in API 713 // requests with the JSON null value. By default, fields with empty values are 714 // omitted from API requests. See 715 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 716 NullFields []string `json:"-"` 717 } 718 719 func (s *AsyncBatchAnnotateImagesResponse) MarshalJSON() ([]byte, error) { 720 type NoMethod AsyncBatchAnnotateImagesResponse 721 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 722 } 723 724 // BatchAnnotateFilesRequest: A list of requests to annotate files using the 725 // BatchAnnotateFiles API. 726 type BatchAnnotateFilesRequest struct { 727 // Labels: Optional. The labels with user-defined metadata for the request. 728 // Label keys and values can be no longer than 63 characters (Unicode 729 // codepoints), can only contain lowercase letters, numeric characters, 730 // underscores and dashes. International characters are allowed. Label values 731 // are optional. Label keys must start with a letter. 732 Labels map[string]string `json:"labels,omitempty"` 733 // Parent: Optional. Target project and location to make a call. Format: 734 // `projects/{project-id}/locations/{location-id}`. If no parent is specified, 735 // a region will be chosen automatically. Supported location-ids: `us`: USA 736 // country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: The 737 // European Union. Example: `projects/project-A/locations/eu`. 738 Parent string `json:"parent,omitempty"` 739 // Requests: Required. The list of file annotation requests. Right now we 740 // support only one AnnotateFileRequest in BatchAnnotateFilesRequest. 741 Requests []*AnnotateFileRequest `json:"requests,omitempty"` 742 // ForceSendFields is a list of field names (e.g. "Labels") to unconditionally 743 // include in API requests. By default, fields with empty or default values are 744 // omitted from API requests. See 745 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 746 // details. 747 ForceSendFields []string `json:"-"` 748 // NullFields is a list of field names (e.g. "Labels") to include in API 749 // requests with the JSON null value. By default, fields with empty values are 750 // omitted from API requests. See 751 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 752 NullFields []string `json:"-"` 753 } 754 755 func (s *BatchAnnotateFilesRequest) MarshalJSON() ([]byte, error) { 756 type NoMethod BatchAnnotateFilesRequest 757 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 758 } 759 760 // BatchAnnotateFilesResponse: A list of file annotation responses. 761 type BatchAnnotateFilesResponse struct { 762 // Responses: The list of file annotation responses, each response 763 // corresponding to each AnnotateFileRequest in BatchAnnotateFilesRequest. 764 Responses []*AnnotateFileResponse `json:"responses,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. "Responses") to 769 // unconditionally include in API requests. By default, fields with empty or 770 // default values are 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. "Responses") to include in API 775 // requests with the JSON null value. By default, fields with empty values are 776 // omitted 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 *BatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) { 782 type NoMethod BatchAnnotateFilesResponse 783 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 784 } 785 786 // BatchAnnotateImagesRequest: Multiple image annotation requests are batched 787 // into a single service call. 788 type BatchAnnotateImagesRequest struct { 789 // Labels: Optional. The labels with user-defined metadata for the request. 790 // Label keys and values can be no longer than 63 characters (Unicode 791 // codepoints), can only contain lowercase letters, numeric characters, 792 // underscores and dashes. International characters are allowed. Label values 793 // are optional. Label keys must start with a letter. 794 Labels map[string]string `json:"labels,omitempty"` 795 // Parent: Optional. Target project and location to make a call. Format: 796 // `projects/{project-id}/locations/{location-id}`. If no parent is specified, 797 // a region will be chosen automatically. Supported location-ids: `us`: USA 798 // country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: The 799 // European Union. Example: `projects/project-A/locations/eu`. 800 Parent string `json:"parent,omitempty"` 801 // Requests: Required. Individual image annotation requests for this batch. 802 Requests []*AnnotateImageRequest `json:"requests,omitempty"` 803 // ForceSendFields is a list of field names (e.g. "Labels") to unconditionally 804 // include in API requests. By default, fields with empty or default values are 805 // omitted from API requests. See 806 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 807 // details. 808 ForceSendFields []string `json:"-"` 809 // NullFields is a list of field names (e.g. "Labels") to include in API 810 // requests with the JSON null value. By default, fields with empty values are 811 // omitted from API requests. See 812 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 813 NullFields []string `json:"-"` 814 } 815 816 func (s *BatchAnnotateImagesRequest) MarshalJSON() ([]byte, error) { 817 type NoMethod BatchAnnotateImagesRequest 818 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 819 } 820 821 // BatchAnnotateImagesResponse: Response to a batch image annotation request. 822 type BatchAnnotateImagesResponse struct { 823 // Responses: Individual responses to image annotation requests within the 824 // batch. 825 Responses []*AnnotateImageResponse `json:"responses,omitempty"` 826 827 // ServerResponse contains the HTTP response code and headers from the server. 828 googleapi.ServerResponse `json:"-"` 829 // ForceSendFields is a list of field names (e.g. "Responses") to 830 // unconditionally include in API requests. By default, fields with empty or 831 // default values are omitted from API requests. See 832 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 833 // details. 834 ForceSendFields []string `json:"-"` 835 // NullFields is a list of field names (e.g. "Responses") to include in API 836 // requests with the JSON null value. By default, fields with empty values are 837 // omitted from API requests. See 838 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 839 NullFields []string `json:"-"` 840 } 841 842 func (s *BatchAnnotateImagesResponse) MarshalJSON() ([]byte, error) { 843 type NoMethod BatchAnnotateImagesResponse 844 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 845 } 846 847 // BatchOperationMetadata: Metadata for the batch operations such as the 848 // current state. This is included in the `metadata` field of the `Operation` 849 // returned by the `GetOperation` call of the `google::longrunning::Operations` 850 // service. 851 type BatchOperationMetadata struct { 852 // EndTime: The time when the batch request is finished and 853 // google.longrunning.Operation.done is set to true. 854 EndTime string `json:"endTime,omitempty"` 855 // State: The current state of the batch operation. 856 // 857 // Possible values: 858 // "STATE_UNSPECIFIED" - Invalid. 859 // "PROCESSING" - Request is actively being processed. 860 // "SUCCESSFUL" - The request is done and at least one item has been 861 // successfully processed. 862 // "FAILED" - The request is done and no item has been successfully 863 // processed. 864 // "CANCELLED" - The request is done after the 865 // longrunning.Operations.CancelOperation has been called by the user. Any 866 // records that were processed before the cancel command are output as 867 // specified in the request. 868 State string `json:"state,omitempty"` 869 // SubmitTime: The time when the batch request was submitted to the server. 870 SubmitTime string `json:"submitTime,omitempty"` 871 // ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally 872 // include in API requests. By default, fields with empty or default values are 873 // omitted from API requests. See 874 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 875 // details. 876 ForceSendFields []string `json:"-"` 877 // NullFields is a list of field names (e.g. "EndTime") to include in API 878 // requests with the JSON null value. By default, fields with empty values are 879 // omitted from API requests. See 880 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 881 NullFields []string `json:"-"` 882 } 883 884 func (s *BatchOperationMetadata) MarshalJSON() ([]byte, error) { 885 type NoMethod BatchOperationMetadata 886 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 887 } 888 889 // Block: Logical element on the page. 890 type Block struct { 891 // BlockType: Detected block type (text, image etc) for this block. 892 // 893 // Possible values: 894 // "UNKNOWN" - Unknown block type. 895 // "TEXT" - Regular text block. 896 // "TABLE" - Table block. 897 // "PICTURE" - Image block. 898 // "RULER" - Horizontal/vertical line box. 899 // "BARCODE" - Barcode block. 900 BlockType string `json:"blockType,omitempty"` 901 // BoundingBox: The bounding box for the block. The vertices are in the order 902 // of top-left, top-right, bottom-right, bottom-left. When a rotation of the 903 // bounding box is detected the rotation is represented as around the top-left 904 // corner as defined when the text is read in the 'natural' orientation. For 905 // example: * when the text is horizontal it might look like: 0----1 | | 3----2 906 // * when it's rotated 180 degrees around the top-left corner it becomes: 907 // 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 3). 908 BoundingBox *BoundingPoly `json:"boundingBox,omitempty"` 909 // Confidence: Confidence of the OCR results on the block. Range [0, 1]. 910 Confidence float64 `json:"confidence,omitempty"` 911 // Paragraphs: List of paragraphs in this block (if this blocks is of type 912 // text). 913 Paragraphs []*Paragraph `json:"paragraphs,omitempty"` 914 // Property: Additional information detected for the block. 915 Property *TextProperty `json:"property,omitempty"` 916 // ForceSendFields is a list of field names (e.g. "BlockType") to 917 // unconditionally include in API requests. By default, fields with empty or 918 // default values are omitted from API requests. See 919 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 920 // details. 921 ForceSendFields []string `json:"-"` 922 // NullFields is a list of field names (e.g. "BlockType") to include in API 923 // requests with the JSON null value. By default, fields with empty values are 924 // omitted from API requests. See 925 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 926 NullFields []string `json:"-"` 927 } 928 929 func (s *Block) MarshalJSON() ([]byte, error) { 930 type NoMethod Block 931 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 932 } 933 934 func (s *Block) UnmarshalJSON(data []byte) error { 935 type NoMethod Block 936 var s1 struct { 937 Confidence gensupport.JSONFloat64 `json:"confidence"` 938 *NoMethod 939 } 940 s1.NoMethod = (*NoMethod)(s) 941 if err := json.Unmarshal(data, &s1); err != nil { 942 return err 943 } 944 s.Confidence = float64(s1.Confidence) 945 return nil 946 } 947 948 // BoundingPoly: A bounding polygon for the detected image annotation. 949 type BoundingPoly struct { 950 // NormalizedVertices: The bounding polygon normalized vertices. 951 NormalizedVertices []*NormalizedVertex `json:"normalizedVertices,omitempty"` 952 // Vertices: The bounding polygon vertices. 953 Vertices []*Vertex `json:"vertices,omitempty"` 954 // ForceSendFields is a list of field names (e.g. "NormalizedVertices") to 955 // unconditionally include in API requests. By default, fields with empty or 956 // default values are omitted from API requests. See 957 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 958 // details. 959 ForceSendFields []string `json:"-"` 960 // NullFields is a list of field names (e.g. "NormalizedVertices") to include 961 // in API requests with the JSON null value. By default, fields with empty 962 // values are omitted from API requests. See 963 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 964 NullFields []string `json:"-"` 965 } 966 967 func (s *BoundingPoly) MarshalJSON() ([]byte, error) { 968 type NoMethod BoundingPoly 969 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 970 } 971 972 // CancelOperationRequest: The request message for Operations.CancelOperation. 973 type CancelOperationRequest struct { 974 } 975 976 // Color: Represents a color in the RGBA color space. This representation is 977 // designed for simplicity of conversion to and from color representations in 978 // various languages over compactness. For example, the fields of this 979 // representation can be trivially provided to the constructor of 980 // `java.awt.Color` in Java; it can also be trivially provided to UIColor's 981 // `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little 982 // work, it can be easily formatted into a CSS `rgba()` string in JavaScript. 983 // This reference page doesn't have information about the absolute color space 984 // that should be used to interpret the RGB value—for example, sRGB, Adobe 985 // RGB, DCI-P3, and BT.2020. By default, applications should assume the sRGB 986 // color space. When color equality needs to be decided, implementations, 987 // unless documented otherwise, treat two colors as equal if all their red, 988 // green, blue, and alpha values each differ by at most `1e-5`. Example (Java): 989 // import com.google.type.Color; // ... public static java.awt.Color 990 // fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? 991 // protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( 992 // protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } 993 // public static Color toProto(java.awt.Color color) { float red = (float) 994 // color.getRed(); float green = (float) color.getGreen(); float blue = (float) 995 // color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = 996 // Color .newBuilder() .setRed(red / denominator) .setGreen(green / 997 // denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if 998 // (alpha != 255) { result.setAlpha( FloatValue .newBuilder() 999 // .setValue(((float) alpha) / denominator) .build()); } return 1000 // resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static 1001 // UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float 1002 // green = [protocolor green]; float blue = [protocolor blue]; FloatValue* 1003 // alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != 1004 // nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red 1005 // green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) 1006 // { CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green 1007 // blue:&blue alpha:&alpha]) { return nil; } Color* result = [[Color alloc] 1008 // init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; 1009 // if (alpha <= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } 1010 // [result autorelease]; return result; } // ... Example (JavaScript): // ... 1011 // var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 1012 // 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue 1013 // || 0.0; var red = Math.floor(redFrac * 255); var green = 1014 // Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if 1015 // (!('alpha' in rgb_color)) { return rgbToCssColor(red, green, blue); } var 1016 // alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, 1017 // blue].join(','); return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(”); 1018 // }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new 1019 // Number((red << 16) | (green << 8) | blue); var hexString = 1020 // rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var 1021 // resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) { 1022 // resultBuilder.push('0'); } resultBuilder.push(hexString); return 1023 // resultBuilder.join(”); }; // ... 1024 type Color struct { 1025 // Alpha: The fraction of this color that should be applied to the pixel. That 1026 // is, the final pixel color is defined by the equation: `pixel color = alpha * 1027 // (this color) + (1.0 - alpha) * (background color)` This means that a value 1028 // of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a 1029 // completely transparent color. This uses a wrapper message rather than a 1030 // simple float scalar so that it is possible to distinguish between a default 1031 // value and the value being unset. If omitted, this color object is rendered 1032 // as a solid color (as if the alpha value had been explicitly given a value of 1033 // 1.0). 1034 Alpha float64 `json:"alpha,omitempty"` 1035 // Blue: The amount of blue in the color as a value in the interval [0, 1]. 1036 Blue float64 `json:"blue,omitempty"` 1037 // Green: The amount of green in the color as a value in the interval [0, 1]. 1038 Green float64 `json:"green,omitempty"` 1039 // Red: The amount of red in the color as a value in the interval [0, 1]. 1040 Red float64 `json:"red,omitempty"` 1041 // ForceSendFields is a list of field names (e.g. "Alpha") to unconditionally 1042 // include in API requests. By default, fields with empty or default values are 1043 // omitted from API requests. See 1044 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1045 // details. 1046 ForceSendFields []string `json:"-"` 1047 // NullFields is a list of field names (e.g. "Alpha") to include in API 1048 // requests with the JSON null value. By default, fields with empty values are 1049 // omitted from API requests. See 1050 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1051 NullFields []string `json:"-"` 1052 } 1053 1054 func (s *Color) MarshalJSON() ([]byte, error) { 1055 type NoMethod Color 1056 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1057 } 1058 1059 func (s *Color) UnmarshalJSON(data []byte) error { 1060 type NoMethod Color 1061 var s1 struct { 1062 Alpha gensupport.JSONFloat64 `json:"alpha"` 1063 Blue gensupport.JSONFloat64 `json:"blue"` 1064 Green gensupport.JSONFloat64 `json:"green"` 1065 Red gensupport.JSONFloat64 `json:"red"` 1066 *NoMethod 1067 } 1068 s1.NoMethod = (*NoMethod)(s) 1069 if err := json.Unmarshal(data, &s1); err != nil { 1070 return err 1071 } 1072 s.Alpha = float64(s1.Alpha) 1073 s.Blue = float64(s1.Blue) 1074 s.Green = float64(s1.Green) 1075 s.Red = float64(s1.Red) 1076 return nil 1077 } 1078 1079 // ColorInfo: Color information consists of RGB channels, score, and the 1080 // fraction of the image that the color occupies in the image. 1081 type ColorInfo struct { 1082 // Color: RGB components of the color. 1083 Color *Color `json:"color,omitempty"` 1084 // PixelFraction: The fraction of pixels the color occupies in the image. Value 1085 // in range [0, 1]. 1086 PixelFraction float64 `json:"pixelFraction,omitempty"` 1087 // Score: Image-specific score for this color. Value in range [0, 1]. 1088 Score float64 `json:"score,omitempty"` 1089 // ForceSendFields is a list of field names (e.g. "Color") to unconditionally 1090 // include in API requests. By default, fields with empty or default values are 1091 // omitted from API requests. See 1092 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1093 // details. 1094 ForceSendFields []string `json:"-"` 1095 // NullFields is a list of field names (e.g. "Color") to include in API 1096 // requests with the JSON null value. By default, fields with empty values are 1097 // omitted from API requests. See 1098 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1099 NullFields []string `json:"-"` 1100 } 1101 1102 func (s *ColorInfo) MarshalJSON() ([]byte, error) { 1103 type NoMethod ColorInfo 1104 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1105 } 1106 1107 func (s *ColorInfo) UnmarshalJSON(data []byte) error { 1108 type NoMethod ColorInfo 1109 var s1 struct { 1110 PixelFraction gensupport.JSONFloat64 `json:"pixelFraction"` 1111 Score gensupport.JSONFloat64 `json:"score"` 1112 *NoMethod 1113 } 1114 s1.NoMethod = (*NoMethod)(s) 1115 if err := json.Unmarshal(data, &s1); err != nil { 1116 return err 1117 } 1118 s.PixelFraction = float64(s1.PixelFraction) 1119 s.Score = float64(s1.Score) 1120 return nil 1121 } 1122 1123 // CropHint: Single crop hint that is used to generate a new crop when serving 1124 // an image. 1125 type CropHint struct { 1126 // BoundingPoly: The bounding polygon for the crop region. The coordinates of 1127 // the bounding box are in the original image's scale. 1128 BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"` 1129 // Confidence: Confidence of this being a salient region. Range [0, 1]. 1130 Confidence float64 `json:"confidence,omitempty"` 1131 // ImportanceFraction: Fraction of importance of this salient region with 1132 // respect to the original image. 1133 ImportanceFraction float64 `json:"importanceFraction,omitempty"` 1134 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 1135 // unconditionally include in API requests. By default, fields with empty or 1136 // default values are omitted from API requests. See 1137 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1138 // details. 1139 ForceSendFields []string `json:"-"` 1140 // NullFields is a list of field names (e.g. "BoundingPoly") to include in API 1141 // requests with the JSON null value. By default, fields with empty values are 1142 // omitted from API requests. See 1143 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1144 NullFields []string `json:"-"` 1145 } 1146 1147 func (s *CropHint) MarshalJSON() ([]byte, error) { 1148 type NoMethod CropHint 1149 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1150 } 1151 1152 func (s *CropHint) UnmarshalJSON(data []byte) error { 1153 type NoMethod CropHint 1154 var s1 struct { 1155 Confidence gensupport.JSONFloat64 `json:"confidence"` 1156 ImportanceFraction gensupport.JSONFloat64 `json:"importanceFraction"` 1157 *NoMethod 1158 } 1159 s1.NoMethod = (*NoMethod)(s) 1160 if err := json.Unmarshal(data, &s1); err != nil { 1161 return err 1162 } 1163 s.Confidence = float64(s1.Confidence) 1164 s.ImportanceFraction = float64(s1.ImportanceFraction) 1165 return nil 1166 } 1167 1168 // CropHintsAnnotation: Set of crop hints that are used to generate new crops 1169 // when serving images. 1170 type CropHintsAnnotation struct { 1171 // CropHints: Crop hint results. 1172 CropHints []*CropHint `json:"cropHints,omitempty"` 1173 // ForceSendFields is a list of field names (e.g. "CropHints") 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. "CropHints") to include in API 1180 // requests with the JSON null value. By default, fields with empty values are 1181 // 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 *CropHintsAnnotation) MarshalJSON() ([]byte, error) { 1187 type NoMethod CropHintsAnnotation 1188 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1189 } 1190 1191 // CropHintsParams: Parameters for crop hints annotation request. 1192 type CropHintsParams struct { 1193 // AspectRatios: Aspect ratios in floats, representing the ratio of the width 1194 // to the height of the image. For example, if the desired aspect ratio is 4/3, 1195 // the corresponding float value should be 1.33333. If not specified, the best 1196 // possible crop is returned. The number of provided aspect ratios is limited 1197 // to a maximum of 16; any aspect ratios provided after the 16th are ignored. 1198 AspectRatios []float64 `json:"aspectRatios,omitempty"` 1199 // ForceSendFields is a list of field names (e.g. "AspectRatios") to 1200 // unconditionally include in API requests. By default, fields with empty or 1201 // default values are omitted from API requests. See 1202 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1203 // details. 1204 ForceSendFields []string `json:"-"` 1205 // NullFields is a list of field names (e.g. "AspectRatios") to include in API 1206 // requests with the JSON null value. By default, fields with empty values are 1207 // omitted from API requests. See 1208 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1209 NullFields []string `json:"-"` 1210 } 1211 1212 func (s *CropHintsParams) MarshalJSON() ([]byte, error) { 1213 type NoMethod CropHintsParams 1214 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1215 } 1216 1217 func (s *CropHintsParams) UnmarshalJSON(data []byte) error { 1218 type NoMethod CropHintsParams 1219 var s1 struct { 1220 AspectRatios []gensupport.JSONFloat64 `json:"aspectRatios"` 1221 *NoMethod 1222 } 1223 s1.NoMethod = (*NoMethod)(s) 1224 if err := json.Unmarshal(data, &s1); err != nil { 1225 return err 1226 } 1227 s.AspectRatios = make([]float64, len(s1.AspectRatios)) 1228 for i := range s1.AspectRatios { 1229 s.AspectRatios[i] = float64(s1.AspectRatios[i]) 1230 } 1231 return nil 1232 } 1233 1234 // DetectedBreak: Detected start or end of a structural component. 1235 type DetectedBreak struct { 1236 // IsPrefix: True if break prepends the element. 1237 IsPrefix bool `json:"isPrefix,omitempty"` 1238 // Type: Detected break type. 1239 // 1240 // Possible values: 1241 // "UNKNOWN" - Unknown break label type. 1242 // "SPACE" - Regular space. 1243 // "SURE_SPACE" - Sure space (very wide). 1244 // "EOL_SURE_SPACE" - Line-wrapping break. 1245 // "HYPHEN" - End-line hyphen that is not present in text; does not co-occur 1246 // with `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. 1247 // "LINE_BREAK" - Line break that ends a paragraph. 1248 Type string `json:"type,omitempty"` 1249 // ForceSendFields is a list of field names (e.g. "IsPrefix") to 1250 // unconditionally include in API requests. By default, fields with empty or 1251 // default values are omitted from API requests. See 1252 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1253 // details. 1254 ForceSendFields []string `json:"-"` 1255 // NullFields is a list of field names (e.g. "IsPrefix") to include in API 1256 // requests with the JSON null value. By default, fields with empty values are 1257 // omitted from API requests. See 1258 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1259 NullFields []string `json:"-"` 1260 } 1261 1262 func (s *DetectedBreak) MarshalJSON() ([]byte, error) { 1263 type NoMethod DetectedBreak 1264 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1265 } 1266 1267 // DetectedLanguage: Detected language for a structural component. 1268 type DetectedLanguage struct { 1269 // Confidence: Confidence of detected language. Range [0, 1]. 1270 Confidence float64 `json:"confidence,omitempty"` 1271 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". For 1272 // more information, see 1273 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 1274 LanguageCode string `json:"languageCode,omitempty"` 1275 // ForceSendFields is a list of field names (e.g. "Confidence") to 1276 // unconditionally include in API requests. By default, fields with empty or 1277 // default values are omitted from API requests. See 1278 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1279 // details. 1280 ForceSendFields []string `json:"-"` 1281 // NullFields is a list of field names (e.g. "Confidence") to include in API 1282 // requests with the JSON null value. By default, fields with empty values are 1283 // omitted from API requests. See 1284 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1285 NullFields []string `json:"-"` 1286 } 1287 1288 func (s *DetectedLanguage) MarshalJSON() ([]byte, error) { 1289 type NoMethod DetectedLanguage 1290 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1291 } 1292 1293 func (s *DetectedLanguage) UnmarshalJSON(data []byte) error { 1294 type NoMethod DetectedLanguage 1295 var s1 struct { 1296 Confidence gensupport.JSONFloat64 `json:"confidence"` 1297 *NoMethod 1298 } 1299 s1.NoMethod = (*NoMethod)(s) 1300 if err := json.Unmarshal(data, &s1); err != nil { 1301 return err 1302 } 1303 s.Confidence = float64(s1.Confidence) 1304 return nil 1305 } 1306 1307 // DominantColorsAnnotation: Set of dominant colors and their corresponding 1308 // scores. 1309 type DominantColorsAnnotation struct { 1310 // Colors: RGB color values with their score and pixel fraction. 1311 Colors []*ColorInfo `json:"colors,omitempty"` 1312 // ForceSendFields is a list of field names (e.g. "Colors") to unconditionally 1313 // include in API requests. By default, fields with empty or default values are 1314 // omitted from API requests. See 1315 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1316 // details. 1317 ForceSendFields []string `json:"-"` 1318 // NullFields is a list of field names (e.g. "Colors") to include in API 1319 // requests with the JSON null value. By default, fields with empty values are 1320 // omitted from API requests. See 1321 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1322 NullFields []string `json:"-"` 1323 } 1324 1325 func (s *DominantColorsAnnotation) MarshalJSON() ([]byte, error) { 1326 type NoMethod DominantColorsAnnotation 1327 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1328 } 1329 1330 // Empty: A generic empty message that you can re-use to avoid defining 1331 // duplicated empty messages in your APIs. A typical example is to use it as 1332 // the request or the response type of an API method. For instance: service Foo 1333 // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } 1334 type Empty struct { 1335 // ServerResponse contains the HTTP response code and headers from the server. 1336 googleapi.ServerResponse `json:"-"` 1337 } 1338 1339 // EntityAnnotation: Set of detected entity features. 1340 type EntityAnnotation struct { 1341 // BoundingPoly: Image region to which this entity belongs. Not produced for 1342 // `LABEL_DETECTION` features. 1343 BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"` 1344 // Confidence: **Deprecated. Use `score` instead.** The accuracy of the entity 1345 // detection in an image. For example, for an image in which the "Eiffel Tower" 1346 // entity is detected, this field represents the confidence that there is a 1347 // tower in the query image. Range [0, 1]. 1348 Confidence float64 `json:"confidence,omitempty"` 1349 // Description: Entity textual description, expressed in its `locale` language. 1350 Description string `json:"description,omitempty"` 1351 // Locale: The language code for the locale in which the entity textual 1352 // `description` is expressed. 1353 Locale string `json:"locale,omitempty"` 1354 // Locations: The location information for the detected entity. Multiple 1355 // `LocationInfo` elements can be present because one location may indicate the 1356 // location of the scene in the image, and another location may indicate the 1357 // location of the place where the image was taken. Location information is 1358 // usually present for landmarks. 1359 Locations []*LocationInfo `json:"locations,omitempty"` 1360 // Mid: Opaque entity ID. Some IDs may be available in Google Knowledge Graph 1361 // Search API (https://developers.google.com/knowledge-graph/). 1362 Mid string `json:"mid,omitempty"` 1363 // Properties: Some entities may have optional user-supplied `Property` 1364 // (name/value) fields, such a score or string that qualifies the entity. 1365 Properties []*Property `json:"properties,omitempty"` 1366 // Score: Overall score of the result. Range [0, 1]. 1367 Score float64 `json:"score,omitempty"` 1368 // Topicality: The relevancy of the ICA (Image Content Annotation) label to the 1369 // image. For example, the relevancy of "tower" is likely higher to an image 1370 // containing the detected "Eiffel Tower" than to an image containing a 1371 // detected distant towering building, even though the confidence that there is 1372 // a tower in each image may be the same. Range [0, 1]. 1373 Topicality float64 `json:"topicality,omitempty"` 1374 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 1375 // unconditionally include in API requests. By default, fields with empty or 1376 // default values are omitted from API requests. See 1377 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1378 // details. 1379 ForceSendFields []string `json:"-"` 1380 // NullFields is a list of field names (e.g. "BoundingPoly") to include in API 1381 // requests with the JSON null value. By default, fields with empty values are 1382 // omitted from API requests. See 1383 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1384 NullFields []string `json:"-"` 1385 } 1386 1387 func (s *EntityAnnotation) MarshalJSON() ([]byte, error) { 1388 type NoMethod EntityAnnotation 1389 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1390 } 1391 1392 func (s *EntityAnnotation) UnmarshalJSON(data []byte) error { 1393 type NoMethod EntityAnnotation 1394 var s1 struct { 1395 Confidence gensupport.JSONFloat64 `json:"confidence"` 1396 Score gensupport.JSONFloat64 `json:"score"` 1397 Topicality gensupport.JSONFloat64 `json:"topicality"` 1398 *NoMethod 1399 } 1400 s1.NoMethod = (*NoMethod)(s) 1401 if err := json.Unmarshal(data, &s1); err != nil { 1402 return err 1403 } 1404 s.Confidence = float64(s1.Confidence) 1405 s.Score = float64(s1.Score) 1406 s.Topicality = float64(s1.Topicality) 1407 return nil 1408 } 1409 1410 // FaceAnnotation: A face annotation object contains the results of face 1411 // detection. 1412 type FaceAnnotation struct { 1413 // AngerLikelihood: Anger likelihood. 1414 // 1415 // Possible values: 1416 // "UNKNOWN" - Unknown likelihood. 1417 // "VERY_UNLIKELY" - It is very unlikely. 1418 // "UNLIKELY" - It is unlikely. 1419 // "POSSIBLE" - It is possible. 1420 // "LIKELY" - It is likely. 1421 // "VERY_LIKELY" - It is very likely. 1422 AngerLikelihood string `json:"angerLikelihood,omitempty"` 1423 // BlurredLikelihood: Blurred likelihood. 1424 // 1425 // Possible values: 1426 // "UNKNOWN" - Unknown likelihood. 1427 // "VERY_UNLIKELY" - It is very unlikely. 1428 // "UNLIKELY" - It is unlikely. 1429 // "POSSIBLE" - It is possible. 1430 // "LIKELY" - It is likely. 1431 // "VERY_LIKELY" - It is very likely. 1432 BlurredLikelihood string `json:"blurredLikelihood,omitempty"` 1433 // BoundingPoly: The bounding polygon around the face. The coordinates of the 1434 // bounding box are in the original image's scale. The bounding box is computed 1435 // to "frame" the face in accordance with human expectations. It is based on 1436 // the landmarker results. Note that one or more x and/or y coordinates may not 1437 // be generated in the `BoundingPoly` (the polygon will be unbounded) if only a 1438 // partial face appears in the image to be annotated. 1439 BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"` 1440 // DetectionConfidence: Detection confidence. Range [0, 1]. 1441 DetectionConfidence float64 `json:"detectionConfidence,omitempty"` 1442 // FdBoundingPoly: The `fd_bounding_poly` bounding polygon is tighter than the 1443 // `boundingPoly`, and encloses only the skin part of the face. Typically, it 1444 // is used to eliminate the face from any image analysis that detects the 1445 // "amount of skin" visible in an image. It is not based on the landmarker 1446 // results, only on the initial face detection, hence the fd (face detection) 1447 // prefix. 1448 FdBoundingPoly *BoundingPoly `json:"fdBoundingPoly,omitempty"` 1449 // HeadwearLikelihood: Headwear likelihood. 1450 // 1451 // Possible values: 1452 // "UNKNOWN" - Unknown likelihood. 1453 // "VERY_UNLIKELY" - It is very unlikely. 1454 // "UNLIKELY" - It is unlikely. 1455 // "POSSIBLE" - It is possible. 1456 // "LIKELY" - It is likely. 1457 // "VERY_LIKELY" - It is very likely. 1458 HeadwearLikelihood string `json:"headwearLikelihood,omitempty"` 1459 // JoyLikelihood: Joy likelihood. 1460 // 1461 // Possible values: 1462 // "UNKNOWN" - Unknown likelihood. 1463 // "VERY_UNLIKELY" - It is very unlikely. 1464 // "UNLIKELY" - It is unlikely. 1465 // "POSSIBLE" - It is possible. 1466 // "LIKELY" - It is likely. 1467 // "VERY_LIKELY" - It is very likely. 1468 JoyLikelihood string `json:"joyLikelihood,omitempty"` 1469 // LandmarkingConfidence: Face landmarking confidence. Range [0, 1]. 1470 LandmarkingConfidence float64 `json:"landmarkingConfidence,omitempty"` 1471 // Landmarks: Detected face landmarks. 1472 Landmarks []*Landmark `json:"landmarks,omitempty"` 1473 // PanAngle: Yaw angle, which indicates the leftward/rightward angle that the 1474 // face is pointing relative to the vertical plane perpendicular to the image. 1475 // Range [-180,180]. 1476 PanAngle float64 `json:"panAngle,omitempty"` 1477 // RollAngle: Roll angle, which indicates the amount of 1478 // clockwise/anti-clockwise rotation of the face relative to the image vertical 1479 // about the axis perpendicular to the face. Range [-180,180]. 1480 RollAngle float64 `json:"rollAngle,omitempty"` 1481 // SorrowLikelihood: Sorrow likelihood. 1482 // 1483 // Possible values: 1484 // "UNKNOWN" - Unknown likelihood. 1485 // "VERY_UNLIKELY" - It is very unlikely. 1486 // "UNLIKELY" - It is unlikely. 1487 // "POSSIBLE" - It is possible. 1488 // "LIKELY" - It is likely. 1489 // "VERY_LIKELY" - It is very likely. 1490 SorrowLikelihood string `json:"sorrowLikelihood,omitempty"` 1491 // SurpriseLikelihood: Surprise likelihood. 1492 // 1493 // Possible values: 1494 // "UNKNOWN" - Unknown likelihood. 1495 // "VERY_UNLIKELY" - It is very unlikely. 1496 // "UNLIKELY" - It is unlikely. 1497 // "POSSIBLE" - It is possible. 1498 // "LIKELY" - It is likely. 1499 // "VERY_LIKELY" - It is very likely. 1500 SurpriseLikelihood string `json:"surpriseLikelihood,omitempty"` 1501 // TiltAngle: Pitch angle, which indicates the upwards/downwards angle that the 1502 // face is pointing relative to the image's horizontal plane. Range [-180,180]. 1503 TiltAngle float64 `json:"tiltAngle,omitempty"` 1504 // UnderExposedLikelihood: Under-exposed likelihood. 1505 // 1506 // Possible values: 1507 // "UNKNOWN" - Unknown likelihood. 1508 // "VERY_UNLIKELY" - It is very unlikely. 1509 // "UNLIKELY" - It is unlikely. 1510 // "POSSIBLE" - It is possible. 1511 // "LIKELY" - It is likely. 1512 // "VERY_LIKELY" - It is very likely. 1513 UnderExposedLikelihood string `json:"underExposedLikelihood,omitempty"` 1514 // ForceSendFields is a list of field names (e.g. "AngerLikelihood") to 1515 // unconditionally include in API requests. By default, fields with empty or 1516 // default values are omitted from API requests. See 1517 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1518 // details. 1519 ForceSendFields []string `json:"-"` 1520 // NullFields is a list of field names (e.g. "AngerLikelihood") to include in 1521 // API requests with the JSON null value. By default, fields with empty values 1522 // are omitted from API requests. See 1523 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1524 NullFields []string `json:"-"` 1525 } 1526 1527 func (s *FaceAnnotation) MarshalJSON() ([]byte, error) { 1528 type NoMethod FaceAnnotation 1529 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1530 } 1531 1532 func (s *FaceAnnotation) UnmarshalJSON(data []byte) error { 1533 type NoMethod FaceAnnotation 1534 var s1 struct { 1535 DetectionConfidence gensupport.JSONFloat64 `json:"detectionConfidence"` 1536 LandmarkingConfidence gensupport.JSONFloat64 `json:"landmarkingConfidence"` 1537 PanAngle gensupport.JSONFloat64 `json:"panAngle"` 1538 RollAngle gensupport.JSONFloat64 `json:"rollAngle"` 1539 TiltAngle gensupport.JSONFloat64 `json:"tiltAngle"` 1540 *NoMethod 1541 } 1542 s1.NoMethod = (*NoMethod)(s) 1543 if err := json.Unmarshal(data, &s1); err != nil { 1544 return err 1545 } 1546 s.DetectionConfidence = float64(s1.DetectionConfidence) 1547 s.LandmarkingConfidence = float64(s1.LandmarkingConfidence) 1548 s.PanAngle = float64(s1.PanAngle) 1549 s.RollAngle = float64(s1.RollAngle) 1550 s.TiltAngle = float64(s1.TiltAngle) 1551 return nil 1552 } 1553 1554 // Feature: The type of Google Cloud Vision API detection to perform, and the 1555 // maximum number of results to return for that type. Multiple `Feature` 1556 // objects can be specified in the `features` list. 1557 type Feature struct { 1558 // MaxResults: Maximum number of results of this type. Does not apply to 1559 // `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`. 1560 MaxResults int64 `json:"maxResults,omitempty"` 1561 // Model: Model to use for the feature. Supported values: "builtin/stable" (the 1562 // default if unset) and "builtin/latest". `DOCUMENT_TEXT_DETECTION` and 1563 // `TEXT_DETECTION` also support "builtin/weekly" for the bleeding edge release 1564 // updated weekly. 1565 Model string `json:"model,omitempty"` 1566 // Type: The feature type. 1567 // 1568 // Possible values: 1569 // "TYPE_UNSPECIFIED" - Unspecified feature type. 1570 // "FACE_DETECTION" - Run face detection. 1571 // "LANDMARK_DETECTION" - Run landmark detection. 1572 // "LOGO_DETECTION" - Run logo detection. 1573 // "LABEL_DETECTION" - Run label detection. 1574 // "TEXT_DETECTION" - Run text detection / optical character recognition 1575 // (OCR). Text detection is optimized for areas of text within a larger image; 1576 // if the image is a document, use `DOCUMENT_TEXT_DETECTION` instead. 1577 // "DOCUMENT_TEXT_DETECTION" - Run dense text document OCR. Takes precedence 1578 // when both `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` are present. 1579 // "SAFE_SEARCH_DETECTION" - Run Safe Search to detect potentially unsafe or 1580 // undesirable content. 1581 // "IMAGE_PROPERTIES" - Compute a set of image properties, such as the 1582 // image's dominant colors. 1583 // "CROP_HINTS" - Run crop hints. 1584 // "WEB_DETECTION" - Run web detection. 1585 // "PRODUCT_SEARCH" - Run Product Search. 1586 // "OBJECT_LOCALIZATION" - Run localizer for object detection. 1587 Type string `json:"type,omitempty"` 1588 // ForceSendFields is a list of field names (e.g. "MaxResults") to 1589 // unconditionally include in API requests. By default, fields with empty or 1590 // default values are omitted from API requests. See 1591 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1592 // details. 1593 ForceSendFields []string `json:"-"` 1594 // NullFields is a list of field names (e.g. "MaxResults") to include in API 1595 // requests with the JSON null value. By default, fields with empty values are 1596 // omitted from API requests. See 1597 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1598 NullFields []string `json:"-"` 1599 } 1600 1601 func (s *Feature) MarshalJSON() ([]byte, error) { 1602 type NoMethod Feature 1603 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1604 } 1605 1606 // GcsDestination: The Google Cloud Storage location where the output will be 1607 // written to. 1608 type GcsDestination struct { 1609 // Uri: Google Cloud Storage URI prefix where the results will be stored. 1610 // Results will be in JSON format and preceded by its corresponding input URI 1611 // prefix. This field can either represent a gcs file prefix or gcs directory. 1612 // In either case, the uri should be unique because in order to get all of the 1613 // output files, you will need to do a wildcard gcs search on the uri prefix 1614 // you provide. Examples: * File Prefix: gs://bucket-name/here/filenameprefix 1615 // The output files will be created in gs://bucket-name/here/ and the names of 1616 // the output files will begin with "filenameprefix". * Directory Prefix: 1617 // gs://bucket-name/some/location/ The output files will be created in 1618 // gs://bucket-name/some/location/ and the names of the output files could be 1619 // anything because there was no filename prefix specified. If multiple 1620 // outputs, each response is still AnnotateFileResponse, each of which contains 1621 // some subset of the full list of AnnotateImageResponse. Multiple outputs can 1622 // happen if, for example, the output JSON is too large and overflows into 1623 // multiple sharded files. 1624 Uri string `json:"uri,omitempty"` 1625 // ForceSendFields is a list of field names (e.g. "Uri") to unconditionally 1626 // include in API requests. By default, fields with empty or default values are 1627 // omitted from API requests. See 1628 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1629 // details. 1630 ForceSendFields []string `json:"-"` 1631 // NullFields is a list of field names (e.g. "Uri") to include in API requests 1632 // with the JSON null value. By default, fields with empty values are omitted 1633 // from API requests. See 1634 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1635 NullFields []string `json:"-"` 1636 } 1637 1638 func (s *GcsDestination) MarshalJSON() ([]byte, error) { 1639 type NoMethod GcsDestination 1640 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1641 } 1642 1643 // GcsSource: The Google Cloud Storage location where the input will be read 1644 // from. 1645 type GcsSource struct { 1646 // Uri: Google Cloud Storage URI for the input file. This must only be a Google 1647 // Cloud Storage object. Wildcards are not currently supported. 1648 Uri string `json:"uri,omitempty"` 1649 // ForceSendFields is a list of field names (e.g. "Uri") to unconditionally 1650 // include in API requests. By default, fields with empty or default values are 1651 // omitted from API requests. See 1652 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1653 // details. 1654 ForceSendFields []string `json:"-"` 1655 // NullFields is a list of field names (e.g. "Uri") to include in API requests 1656 // with the JSON null value. By default, fields with empty values are omitted 1657 // from API requests. See 1658 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1659 NullFields []string `json:"-"` 1660 } 1661 1662 func (s *GcsSource) MarshalJSON() ([]byte, error) { 1663 type NoMethod GcsSource 1664 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1665 } 1666 1667 // GoogleCloudVisionV1p1beta1AnnotateFileResponse: Response to a single file 1668 // annotation request. A file may contain one or more images, which 1669 // individually have their own responses. 1670 type GoogleCloudVisionV1p1beta1AnnotateFileResponse struct { 1671 // Error: If set, represents the error message for the failed request. The 1672 // `responses` field will not be set in this case. 1673 Error *Status `json:"error,omitempty"` 1674 // InputConfig: Information about the file for which this response is 1675 // generated. 1676 InputConfig *GoogleCloudVisionV1p1beta1InputConfig `json:"inputConfig,omitempty"` 1677 // Responses: Individual responses to images found within the file. This field 1678 // will be empty if the `error` field is set. 1679 Responses []*GoogleCloudVisionV1p1beta1AnnotateImageResponse `json:"responses,omitempty"` 1680 // TotalPages: This field gives the total number of pages in the file. 1681 TotalPages int64 `json:"totalPages,omitempty"` 1682 // ForceSendFields is a list of field names (e.g. "Error") to unconditionally 1683 // include in API requests. By default, fields with empty or default values are 1684 // omitted from API requests. See 1685 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1686 // details. 1687 ForceSendFields []string `json:"-"` 1688 // NullFields is a list of field names (e.g. "Error") to include in API 1689 // requests with the JSON null value. By default, fields with empty values are 1690 // omitted from API requests. See 1691 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1692 NullFields []string `json:"-"` 1693 } 1694 1695 func (s *GoogleCloudVisionV1p1beta1AnnotateFileResponse) MarshalJSON() ([]byte, error) { 1696 type NoMethod GoogleCloudVisionV1p1beta1AnnotateFileResponse 1697 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1698 } 1699 1700 // GoogleCloudVisionV1p1beta1AnnotateImageResponse: Response to an image 1701 // annotation request. 1702 type GoogleCloudVisionV1p1beta1AnnotateImageResponse struct { 1703 // Context: If present, contextual information is needed to understand where 1704 // this image comes from. 1705 Context *GoogleCloudVisionV1p1beta1ImageAnnotationContext `json:"context,omitempty"` 1706 // CropHintsAnnotation: If present, crop hints have completed successfully. 1707 CropHintsAnnotation *GoogleCloudVisionV1p1beta1CropHintsAnnotation `json:"cropHintsAnnotation,omitempty"` 1708 // Error: If set, represents the error message for the operation. Note that 1709 // filled-in image annotations are guaranteed to be correct, even when `error` 1710 // is set. 1711 Error *Status `json:"error,omitempty"` 1712 // FaceAnnotations: If present, face detection has completed successfully. 1713 FaceAnnotations []*GoogleCloudVisionV1p1beta1FaceAnnotation `json:"faceAnnotations,omitempty"` 1714 // FullTextAnnotation: If present, text (OCR) detection or document (OCR) text 1715 // detection has completed successfully. This annotation provides the 1716 // structural hierarchy for the OCR detected text. 1717 FullTextAnnotation *GoogleCloudVisionV1p1beta1TextAnnotation `json:"fullTextAnnotation,omitempty"` 1718 // ImagePropertiesAnnotation: If present, image properties were extracted 1719 // successfully. 1720 ImagePropertiesAnnotation *GoogleCloudVisionV1p1beta1ImageProperties `json:"imagePropertiesAnnotation,omitempty"` 1721 // LabelAnnotations: If present, label detection has completed successfully. 1722 LabelAnnotations []*GoogleCloudVisionV1p1beta1EntityAnnotation `json:"labelAnnotations,omitempty"` 1723 // LandmarkAnnotations: If present, landmark detection has completed 1724 // successfully. 1725 LandmarkAnnotations []*GoogleCloudVisionV1p1beta1EntityAnnotation `json:"landmarkAnnotations,omitempty"` 1726 // LocalizedObjectAnnotations: If present, localized object detection has 1727 // completed successfully. This will be sorted descending by confidence score. 1728 LocalizedObjectAnnotations []*GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation `json:"localizedObjectAnnotations,omitempty"` 1729 // LogoAnnotations: If present, logo detection has completed successfully. 1730 LogoAnnotations []*GoogleCloudVisionV1p1beta1EntityAnnotation `json:"logoAnnotations,omitempty"` 1731 // ProductSearchResults: If present, product search has completed successfully. 1732 ProductSearchResults *GoogleCloudVisionV1p1beta1ProductSearchResults `json:"productSearchResults,omitempty"` 1733 // SafeSearchAnnotation: If present, safe-search annotation has completed 1734 // successfully. 1735 SafeSearchAnnotation *GoogleCloudVisionV1p1beta1SafeSearchAnnotation `json:"safeSearchAnnotation,omitempty"` 1736 // TextAnnotations: If present, text (OCR) detection has completed 1737 // successfully. 1738 TextAnnotations []*GoogleCloudVisionV1p1beta1EntityAnnotation `json:"textAnnotations,omitempty"` 1739 // WebDetection: If present, web detection has completed successfully. 1740 WebDetection *GoogleCloudVisionV1p1beta1WebDetection `json:"webDetection,omitempty"` 1741 // ForceSendFields is a list of field names (e.g. "Context") to unconditionally 1742 // include in API requests. By default, fields with empty or default values are 1743 // omitted from API requests. See 1744 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1745 // details. 1746 ForceSendFields []string `json:"-"` 1747 // NullFields is a list of field names (e.g. "Context") to include in API 1748 // requests with the JSON null value. By default, fields with empty values are 1749 // omitted from API requests. See 1750 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1751 NullFields []string `json:"-"` 1752 } 1753 1754 func (s *GoogleCloudVisionV1p1beta1AnnotateImageResponse) MarshalJSON() ([]byte, error) { 1755 type NoMethod GoogleCloudVisionV1p1beta1AnnotateImageResponse 1756 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1757 } 1758 1759 // GoogleCloudVisionV1p1beta1AsyncAnnotateFileResponse: The response for a 1760 // single offline file annotation request. 1761 type GoogleCloudVisionV1p1beta1AsyncAnnotateFileResponse struct { 1762 // OutputConfig: The output location and metadata from 1763 // AsyncAnnotateFileRequest. 1764 OutputConfig *GoogleCloudVisionV1p1beta1OutputConfig `json:"outputConfig,omitempty"` 1765 // ForceSendFields is a list of field names (e.g. "OutputConfig") to 1766 // unconditionally include in API requests. By default, fields with empty or 1767 // default values are omitted from API requests. See 1768 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1769 // details. 1770 ForceSendFields []string `json:"-"` 1771 // NullFields is a list of field names (e.g. "OutputConfig") to include in API 1772 // requests with the JSON null value. By default, fields with empty values are 1773 // omitted from API requests. See 1774 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1775 NullFields []string `json:"-"` 1776 } 1777 1778 func (s *GoogleCloudVisionV1p1beta1AsyncAnnotateFileResponse) MarshalJSON() ([]byte, error) { 1779 type NoMethod GoogleCloudVisionV1p1beta1AsyncAnnotateFileResponse 1780 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1781 } 1782 1783 // GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesResponse: Response to an 1784 // async batch file annotation request. 1785 type GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesResponse struct { 1786 // Responses: The list of file annotation responses, one for each request in 1787 // AsyncBatchAnnotateFilesRequest. 1788 Responses []*GoogleCloudVisionV1p1beta1AsyncAnnotateFileResponse `json:"responses,omitempty"` 1789 // ForceSendFields is a list of field names (e.g. "Responses") to 1790 // unconditionally include in API requests. By default, fields with empty or 1791 // default values are omitted from API requests. See 1792 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1793 // details. 1794 ForceSendFields []string `json:"-"` 1795 // NullFields is a list of field names (e.g. "Responses") to include in API 1796 // requests with the JSON null value. By default, fields with empty values are 1797 // omitted from API requests. See 1798 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1799 NullFields []string `json:"-"` 1800 } 1801 1802 func (s *GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) { 1803 type NoMethod GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesResponse 1804 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1805 } 1806 1807 // GoogleCloudVisionV1p1beta1Block: Logical element on the page. 1808 type GoogleCloudVisionV1p1beta1Block struct { 1809 // BlockType: Detected block type (text, image etc) for this block. 1810 // 1811 // Possible values: 1812 // "UNKNOWN" - Unknown block type. 1813 // "TEXT" - Regular text block. 1814 // "TABLE" - Table block. 1815 // "PICTURE" - Image block. 1816 // "RULER" - Horizontal/vertical line box. 1817 // "BARCODE" - Barcode block. 1818 BlockType string `json:"blockType,omitempty"` 1819 // BoundingBox: The bounding box for the block. The vertices are in the order 1820 // of top-left, top-right, bottom-right, bottom-left. When a rotation of the 1821 // bounding box is detected the rotation is represented as around the top-left 1822 // corner as defined when the text is read in the 'natural' orientation. For 1823 // example: * when the text is horizontal it might look like: 0----1 | | 3----2 1824 // * when it's rotated 180 degrees around the top-left corner it becomes: 1825 // 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 3). 1826 BoundingBox *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingBox,omitempty"` 1827 // Confidence: Confidence of the OCR results on the block. Range [0, 1]. 1828 Confidence float64 `json:"confidence,omitempty"` 1829 // Paragraphs: List of paragraphs in this block (if this blocks is of type 1830 // text). 1831 Paragraphs []*GoogleCloudVisionV1p1beta1Paragraph `json:"paragraphs,omitempty"` 1832 // Property: Additional information detected for the block. 1833 Property *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty `json:"property,omitempty"` 1834 // ForceSendFields is a list of field names (e.g. "BlockType") to 1835 // unconditionally include in API requests. By default, fields with empty or 1836 // default values are omitted from API requests. See 1837 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1838 // details. 1839 ForceSendFields []string `json:"-"` 1840 // NullFields is a list of field names (e.g. "BlockType") to include in API 1841 // requests with the JSON null value. By default, fields with empty values are 1842 // omitted from API requests. See 1843 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1844 NullFields []string `json:"-"` 1845 } 1846 1847 func (s *GoogleCloudVisionV1p1beta1Block) MarshalJSON() ([]byte, error) { 1848 type NoMethod GoogleCloudVisionV1p1beta1Block 1849 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1850 } 1851 1852 func (s *GoogleCloudVisionV1p1beta1Block) UnmarshalJSON(data []byte) error { 1853 type NoMethod GoogleCloudVisionV1p1beta1Block 1854 var s1 struct { 1855 Confidence gensupport.JSONFloat64 `json:"confidence"` 1856 *NoMethod 1857 } 1858 s1.NoMethod = (*NoMethod)(s) 1859 if err := json.Unmarshal(data, &s1); err != nil { 1860 return err 1861 } 1862 s.Confidence = float64(s1.Confidence) 1863 return nil 1864 } 1865 1866 // GoogleCloudVisionV1p1beta1BoundingPoly: A bounding polygon for the detected 1867 // image annotation. 1868 type GoogleCloudVisionV1p1beta1BoundingPoly struct { 1869 // NormalizedVertices: The bounding polygon normalized vertices. 1870 NormalizedVertices []*GoogleCloudVisionV1p1beta1NormalizedVertex `json:"normalizedVertices,omitempty"` 1871 // Vertices: The bounding polygon vertices. 1872 Vertices []*GoogleCloudVisionV1p1beta1Vertex `json:"vertices,omitempty"` 1873 // ForceSendFields is a list of field names (e.g. "NormalizedVertices") to 1874 // unconditionally include in API requests. By default, fields with empty or 1875 // default values are omitted from API requests. See 1876 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1877 // details. 1878 ForceSendFields []string `json:"-"` 1879 // NullFields is a list of field names (e.g. "NormalizedVertices") to include 1880 // in API requests with the JSON null value. By default, fields with empty 1881 // values are omitted from API requests. See 1882 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1883 NullFields []string `json:"-"` 1884 } 1885 1886 func (s *GoogleCloudVisionV1p1beta1BoundingPoly) MarshalJSON() ([]byte, error) { 1887 type NoMethod GoogleCloudVisionV1p1beta1BoundingPoly 1888 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1889 } 1890 1891 // GoogleCloudVisionV1p1beta1ColorInfo: Color information consists of RGB 1892 // channels, score, and the fraction of the image that the color occupies in 1893 // the image. 1894 type GoogleCloudVisionV1p1beta1ColorInfo struct { 1895 // Color: RGB components of the color. 1896 Color *Color `json:"color,omitempty"` 1897 // PixelFraction: The fraction of pixels the color occupies in the image. Value 1898 // in range [0, 1]. 1899 PixelFraction float64 `json:"pixelFraction,omitempty"` 1900 // Score: Image-specific score for this color. Value in range [0, 1]. 1901 Score float64 `json:"score,omitempty"` 1902 // ForceSendFields is a list of field names (e.g. "Color") to unconditionally 1903 // include in API requests. By default, fields with empty or default values are 1904 // omitted from API requests. See 1905 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1906 // details. 1907 ForceSendFields []string `json:"-"` 1908 // NullFields is a list of field names (e.g. "Color") to include in API 1909 // requests with the JSON null value. By default, fields with empty values are 1910 // omitted from API requests. See 1911 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1912 NullFields []string `json:"-"` 1913 } 1914 1915 func (s *GoogleCloudVisionV1p1beta1ColorInfo) MarshalJSON() ([]byte, error) { 1916 type NoMethod GoogleCloudVisionV1p1beta1ColorInfo 1917 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1918 } 1919 1920 func (s *GoogleCloudVisionV1p1beta1ColorInfo) UnmarshalJSON(data []byte) error { 1921 type NoMethod GoogleCloudVisionV1p1beta1ColorInfo 1922 var s1 struct { 1923 PixelFraction gensupport.JSONFloat64 `json:"pixelFraction"` 1924 Score gensupport.JSONFloat64 `json:"score"` 1925 *NoMethod 1926 } 1927 s1.NoMethod = (*NoMethod)(s) 1928 if err := json.Unmarshal(data, &s1); err != nil { 1929 return err 1930 } 1931 s.PixelFraction = float64(s1.PixelFraction) 1932 s.Score = float64(s1.Score) 1933 return nil 1934 } 1935 1936 // GoogleCloudVisionV1p1beta1CropHint: Single crop hint that is used to 1937 // generate a new crop when serving an image. 1938 type GoogleCloudVisionV1p1beta1CropHint struct { 1939 // BoundingPoly: The bounding polygon for the crop region. The coordinates of 1940 // the bounding box are in the original image's scale. 1941 BoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingPoly,omitempty"` 1942 // Confidence: Confidence of this being a salient region. Range [0, 1]. 1943 Confidence float64 `json:"confidence,omitempty"` 1944 // ImportanceFraction: Fraction of importance of this salient region with 1945 // respect to the original image. 1946 ImportanceFraction float64 `json:"importanceFraction,omitempty"` 1947 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 1948 // unconditionally include in API requests. By default, fields with empty or 1949 // default values are omitted from API requests. See 1950 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1951 // details. 1952 ForceSendFields []string `json:"-"` 1953 // NullFields is a list of field names (e.g. "BoundingPoly") to include in API 1954 // requests with the JSON null value. By default, fields with empty values are 1955 // omitted from API requests. See 1956 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1957 NullFields []string `json:"-"` 1958 } 1959 1960 func (s *GoogleCloudVisionV1p1beta1CropHint) MarshalJSON() ([]byte, error) { 1961 type NoMethod GoogleCloudVisionV1p1beta1CropHint 1962 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1963 } 1964 1965 func (s *GoogleCloudVisionV1p1beta1CropHint) UnmarshalJSON(data []byte) error { 1966 type NoMethod GoogleCloudVisionV1p1beta1CropHint 1967 var s1 struct { 1968 Confidence gensupport.JSONFloat64 `json:"confidence"` 1969 ImportanceFraction gensupport.JSONFloat64 `json:"importanceFraction"` 1970 *NoMethod 1971 } 1972 s1.NoMethod = (*NoMethod)(s) 1973 if err := json.Unmarshal(data, &s1); err != nil { 1974 return err 1975 } 1976 s.Confidence = float64(s1.Confidence) 1977 s.ImportanceFraction = float64(s1.ImportanceFraction) 1978 return nil 1979 } 1980 1981 // GoogleCloudVisionV1p1beta1CropHintsAnnotation: Set of crop hints that are 1982 // used to generate new crops when serving images. 1983 type GoogleCloudVisionV1p1beta1CropHintsAnnotation struct { 1984 // CropHints: Crop hint results. 1985 CropHints []*GoogleCloudVisionV1p1beta1CropHint `json:"cropHints,omitempty"` 1986 // ForceSendFields is a list of field names (e.g. "CropHints") to 1987 // unconditionally include in API requests. By default, fields with empty or 1988 // default values are omitted from API requests. See 1989 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1990 // details. 1991 ForceSendFields []string `json:"-"` 1992 // NullFields is a list of field names (e.g. "CropHints") to include in API 1993 // requests with the JSON null value. By default, fields with empty values are 1994 // omitted from API requests. See 1995 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1996 NullFields []string `json:"-"` 1997 } 1998 1999 func (s *GoogleCloudVisionV1p1beta1CropHintsAnnotation) MarshalJSON() ([]byte, error) { 2000 type NoMethod GoogleCloudVisionV1p1beta1CropHintsAnnotation 2001 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2002 } 2003 2004 // GoogleCloudVisionV1p1beta1DominantColorsAnnotation: Set of dominant colors 2005 // and their corresponding scores. 2006 type GoogleCloudVisionV1p1beta1DominantColorsAnnotation struct { 2007 // Colors: RGB color values with their score and pixel fraction. 2008 Colors []*GoogleCloudVisionV1p1beta1ColorInfo `json:"colors,omitempty"` 2009 // ForceSendFields is a list of field names (e.g. "Colors") to unconditionally 2010 // include in API requests. By default, fields with empty or default values are 2011 // omitted from API requests. See 2012 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2013 // details. 2014 ForceSendFields []string `json:"-"` 2015 // NullFields is a list of field names (e.g. "Colors") to include in API 2016 // requests with the JSON null value. By default, fields with empty values are 2017 // omitted from API requests. See 2018 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2019 NullFields []string `json:"-"` 2020 } 2021 2022 func (s *GoogleCloudVisionV1p1beta1DominantColorsAnnotation) MarshalJSON() ([]byte, error) { 2023 type NoMethod GoogleCloudVisionV1p1beta1DominantColorsAnnotation 2024 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2025 } 2026 2027 // GoogleCloudVisionV1p1beta1EntityAnnotation: Set of detected entity features. 2028 type GoogleCloudVisionV1p1beta1EntityAnnotation struct { 2029 // BoundingPoly: Image region to which this entity belongs. Not produced for 2030 // `LABEL_DETECTION` features. 2031 BoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingPoly,omitempty"` 2032 // Confidence: **Deprecated. Use `score` instead.** The accuracy of the entity 2033 // detection in an image. For example, for an image in which the "Eiffel Tower" 2034 // entity is detected, this field represents the confidence that there is a 2035 // tower in the query image. Range [0, 1]. 2036 Confidence float64 `json:"confidence,omitempty"` 2037 // Description: Entity textual description, expressed in its `locale` language. 2038 Description string `json:"description,omitempty"` 2039 // Locale: The language code for the locale in which the entity textual 2040 // `description` is expressed. 2041 Locale string `json:"locale,omitempty"` 2042 // Locations: The location information for the detected entity. Multiple 2043 // `LocationInfo` elements can be present because one location may indicate the 2044 // location of the scene in the image, and another location may indicate the 2045 // location of the place where the image was taken. Location information is 2046 // usually present for landmarks. 2047 Locations []*GoogleCloudVisionV1p1beta1LocationInfo `json:"locations,omitempty"` 2048 // Mid: Opaque entity ID. Some IDs may be available in Google Knowledge Graph 2049 // Search API (https://developers.google.com/knowledge-graph/). 2050 Mid string `json:"mid,omitempty"` 2051 // Properties: Some entities may have optional user-supplied `Property` 2052 // (name/value) fields, such a score or string that qualifies the entity. 2053 Properties []*GoogleCloudVisionV1p1beta1Property `json:"properties,omitempty"` 2054 // Score: Overall score of the result. Range [0, 1]. 2055 Score float64 `json:"score,omitempty"` 2056 // Topicality: The relevancy of the ICA (Image Content Annotation) label to the 2057 // image. For example, the relevancy of "tower" is likely higher to an image 2058 // containing the detected "Eiffel Tower" than to an image containing a 2059 // detected distant towering building, even though the confidence that there is 2060 // a tower in each image may be the same. Range [0, 1]. 2061 Topicality float64 `json:"topicality,omitempty"` 2062 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 2063 // unconditionally include in API requests. By default, fields with empty or 2064 // default values are omitted from API requests. See 2065 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2066 // details. 2067 ForceSendFields []string `json:"-"` 2068 // NullFields is a list of field names (e.g. "BoundingPoly") to include in API 2069 // requests with the JSON null value. By default, fields with empty values are 2070 // omitted from API requests. See 2071 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2072 NullFields []string `json:"-"` 2073 } 2074 2075 func (s *GoogleCloudVisionV1p1beta1EntityAnnotation) MarshalJSON() ([]byte, error) { 2076 type NoMethod GoogleCloudVisionV1p1beta1EntityAnnotation 2077 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2078 } 2079 2080 func (s *GoogleCloudVisionV1p1beta1EntityAnnotation) UnmarshalJSON(data []byte) error { 2081 type NoMethod GoogleCloudVisionV1p1beta1EntityAnnotation 2082 var s1 struct { 2083 Confidence gensupport.JSONFloat64 `json:"confidence"` 2084 Score gensupport.JSONFloat64 `json:"score"` 2085 Topicality gensupport.JSONFloat64 `json:"topicality"` 2086 *NoMethod 2087 } 2088 s1.NoMethod = (*NoMethod)(s) 2089 if err := json.Unmarshal(data, &s1); err != nil { 2090 return err 2091 } 2092 s.Confidence = float64(s1.Confidence) 2093 s.Score = float64(s1.Score) 2094 s.Topicality = float64(s1.Topicality) 2095 return nil 2096 } 2097 2098 // GoogleCloudVisionV1p1beta1FaceAnnotation: A face annotation object contains 2099 // the results of face detection. 2100 type GoogleCloudVisionV1p1beta1FaceAnnotation struct { 2101 // AngerLikelihood: Anger likelihood. 2102 // 2103 // Possible values: 2104 // "UNKNOWN" - Unknown likelihood. 2105 // "VERY_UNLIKELY" - It is very unlikely. 2106 // "UNLIKELY" - It is unlikely. 2107 // "POSSIBLE" - It is possible. 2108 // "LIKELY" - It is likely. 2109 // "VERY_LIKELY" - It is very likely. 2110 AngerLikelihood string `json:"angerLikelihood,omitempty"` 2111 // BlurredLikelihood: Blurred likelihood. 2112 // 2113 // Possible values: 2114 // "UNKNOWN" - Unknown likelihood. 2115 // "VERY_UNLIKELY" - It is very unlikely. 2116 // "UNLIKELY" - It is unlikely. 2117 // "POSSIBLE" - It is possible. 2118 // "LIKELY" - It is likely. 2119 // "VERY_LIKELY" - It is very likely. 2120 BlurredLikelihood string `json:"blurredLikelihood,omitempty"` 2121 // BoundingPoly: The bounding polygon around the face. The coordinates of the 2122 // bounding box are in the original image's scale. The bounding box is computed 2123 // to "frame" the face in accordance with human expectations. It is based on 2124 // the landmarker results. Note that one or more x and/or y coordinates may not 2125 // be generated in the `BoundingPoly` (the polygon will be unbounded) if only a 2126 // partial face appears in the image to be annotated. 2127 BoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingPoly,omitempty"` 2128 // DetectionConfidence: Detection confidence. Range [0, 1]. 2129 DetectionConfidence float64 `json:"detectionConfidence,omitempty"` 2130 // FdBoundingPoly: The `fd_bounding_poly` bounding polygon is tighter than the 2131 // `boundingPoly`, and encloses only the skin part of the face. Typically, it 2132 // is used to eliminate the face from any image analysis that detects the 2133 // "amount of skin" visible in an image. It is not based on the landmarker 2134 // results, only on the initial face detection, hence the fd (face detection) 2135 // prefix. 2136 FdBoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"fdBoundingPoly,omitempty"` 2137 // HeadwearLikelihood: Headwear likelihood. 2138 // 2139 // Possible values: 2140 // "UNKNOWN" - Unknown likelihood. 2141 // "VERY_UNLIKELY" - It is very unlikely. 2142 // "UNLIKELY" - It is unlikely. 2143 // "POSSIBLE" - It is possible. 2144 // "LIKELY" - It is likely. 2145 // "VERY_LIKELY" - It is very likely. 2146 HeadwearLikelihood string `json:"headwearLikelihood,omitempty"` 2147 // JoyLikelihood: Joy likelihood. 2148 // 2149 // Possible values: 2150 // "UNKNOWN" - Unknown likelihood. 2151 // "VERY_UNLIKELY" - It is very unlikely. 2152 // "UNLIKELY" - It is unlikely. 2153 // "POSSIBLE" - It is possible. 2154 // "LIKELY" - It is likely. 2155 // "VERY_LIKELY" - It is very likely. 2156 JoyLikelihood string `json:"joyLikelihood,omitempty"` 2157 // LandmarkingConfidence: Face landmarking confidence. Range [0, 1]. 2158 LandmarkingConfidence float64 `json:"landmarkingConfidence,omitempty"` 2159 // Landmarks: Detected face landmarks. 2160 Landmarks []*GoogleCloudVisionV1p1beta1FaceAnnotationLandmark `json:"landmarks,omitempty"` 2161 // PanAngle: Yaw angle, which indicates the leftward/rightward angle that the 2162 // face is pointing relative to the vertical plane perpendicular to the image. 2163 // Range [-180,180]. 2164 PanAngle float64 `json:"panAngle,omitempty"` 2165 // RollAngle: Roll angle, which indicates the amount of 2166 // clockwise/anti-clockwise rotation of the face relative to the image vertical 2167 // about the axis perpendicular to the face. Range [-180,180]. 2168 RollAngle float64 `json:"rollAngle,omitempty"` 2169 // SorrowLikelihood: Sorrow likelihood. 2170 // 2171 // Possible values: 2172 // "UNKNOWN" - Unknown likelihood. 2173 // "VERY_UNLIKELY" - It is very unlikely. 2174 // "UNLIKELY" - It is unlikely. 2175 // "POSSIBLE" - It is possible. 2176 // "LIKELY" - It is likely. 2177 // "VERY_LIKELY" - It is very likely. 2178 SorrowLikelihood string `json:"sorrowLikelihood,omitempty"` 2179 // SurpriseLikelihood: Surprise likelihood. 2180 // 2181 // Possible values: 2182 // "UNKNOWN" - Unknown likelihood. 2183 // "VERY_UNLIKELY" - It is very unlikely. 2184 // "UNLIKELY" - It is unlikely. 2185 // "POSSIBLE" - It is possible. 2186 // "LIKELY" - It is likely. 2187 // "VERY_LIKELY" - It is very likely. 2188 SurpriseLikelihood string `json:"surpriseLikelihood,omitempty"` 2189 // TiltAngle: Pitch angle, which indicates the upwards/downwards angle that the 2190 // face is pointing relative to the image's horizontal plane. Range [-180,180]. 2191 TiltAngle float64 `json:"tiltAngle,omitempty"` 2192 // UnderExposedLikelihood: Under-exposed likelihood. 2193 // 2194 // Possible values: 2195 // "UNKNOWN" - Unknown likelihood. 2196 // "VERY_UNLIKELY" - It is very unlikely. 2197 // "UNLIKELY" - It is unlikely. 2198 // "POSSIBLE" - It is possible. 2199 // "LIKELY" - It is likely. 2200 // "VERY_LIKELY" - It is very likely. 2201 UnderExposedLikelihood string `json:"underExposedLikelihood,omitempty"` 2202 // ForceSendFields is a list of field names (e.g. "AngerLikelihood") to 2203 // unconditionally include in API requests. By default, fields with empty or 2204 // default values are omitted from API requests. See 2205 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2206 // details. 2207 ForceSendFields []string `json:"-"` 2208 // NullFields is a list of field names (e.g. "AngerLikelihood") to include in 2209 // API requests with the JSON null value. By default, fields with empty values 2210 // are omitted from API requests. See 2211 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2212 NullFields []string `json:"-"` 2213 } 2214 2215 func (s *GoogleCloudVisionV1p1beta1FaceAnnotation) MarshalJSON() ([]byte, error) { 2216 type NoMethod GoogleCloudVisionV1p1beta1FaceAnnotation 2217 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2218 } 2219 2220 func (s *GoogleCloudVisionV1p1beta1FaceAnnotation) UnmarshalJSON(data []byte) error { 2221 type NoMethod GoogleCloudVisionV1p1beta1FaceAnnotation 2222 var s1 struct { 2223 DetectionConfidence gensupport.JSONFloat64 `json:"detectionConfidence"` 2224 LandmarkingConfidence gensupport.JSONFloat64 `json:"landmarkingConfidence"` 2225 PanAngle gensupport.JSONFloat64 `json:"panAngle"` 2226 RollAngle gensupport.JSONFloat64 `json:"rollAngle"` 2227 TiltAngle gensupport.JSONFloat64 `json:"tiltAngle"` 2228 *NoMethod 2229 } 2230 s1.NoMethod = (*NoMethod)(s) 2231 if err := json.Unmarshal(data, &s1); err != nil { 2232 return err 2233 } 2234 s.DetectionConfidence = float64(s1.DetectionConfidence) 2235 s.LandmarkingConfidence = float64(s1.LandmarkingConfidence) 2236 s.PanAngle = float64(s1.PanAngle) 2237 s.RollAngle = float64(s1.RollAngle) 2238 s.TiltAngle = float64(s1.TiltAngle) 2239 return nil 2240 } 2241 2242 // GoogleCloudVisionV1p1beta1FaceAnnotationLandmark: A face-specific landmark 2243 // (for example, a face feature). 2244 type GoogleCloudVisionV1p1beta1FaceAnnotationLandmark struct { 2245 // Position: Face landmark position. 2246 Position *GoogleCloudVisionV1p1beta1Position `json:"position,omitempty"` 2247 // Type: Face landmark type. 2248 // 2249 // Possible values: 2250 // "UNKNOWN_LANDMARK" - Unknown face landmark detected. Should not be filled. 2251 // "LEFT_EYE" - Left eye. 2252 // "RIGHT_EYE" - Right eye. 2253 // "LEFT_OF_LEFT_EYEBROW" - Left of left eyebrow. 2254 // "RIGHT_OF_LEFT_EYEBROW" - Right of left eyebrow. 2255 // "LEFT_OF_RIGHT_EYEBROW" - Left of right eyebrow. 2256 // "RIGHT_OF_RIGHT_EYEBROW" - Right of right eyebrow. 2257 // "MIDPOINT_BETWEEN_EYES" - Midpoint between eyes. 2258 // "NOSE_TIP" - Nose tip. 2259 // "UPPER_LIP" - Upper lip. 2260 // "LOWER_LIP" - Lower lip. 2261 // "MOUTH_LEFT" - Mouth left. 2262 // "MOUTH_RIGHT" - Mouth right. 2263 // "MOUTH_CENTER" - Mouth center. 2264 // "NOSE_BOTTOM_RIGHT" - Nose, bottom right. 2265 // "NOSE_BOTTOM_LEFT" - Nose, bottom left. 2266 // "NOSE_BOTTOM_CENTER" - Nose, bottom center. 2267 // "LEFT_EYE_TOP_BOUNDARY" - Left eye, top boundary. 2268 // "LEFT_EYE_RIGHT_CORNER" - Left eye, right corner. 2269 // "LEFT_EYE_BOTTOM_BOUNDARY" - Left eye, bottom boundary. 2270 // "LEFT_EYE_LEFT_CORNER" - Left eye, left corner. 2271 // "RIGHT_EYE_TOP_BOUNDARY" - Right eye, top boundary. 2272 // "RIGHT_EYE_RIGHT_CORNER" - Right eye, right corner. 2273 // "RIGHT_EYE_BOTTOM_BOUNDARY" - Right eye, bottom boundary. 2274 // "RIGHT_EYE_LEFT_CORNER" - Right eye, left corner. 2275 // "LEFT_EYEBROW_UPPER_MIDPOINT" - Left eyebrow, upper midpoint. 2276 // "RIGHT_EYEBROW_UPPER_MIDPOINT" - Right eyebrow, upper midpoint. 2277 // "LEFT_EAR_TRAGION" - Left ear tragion. 2278 // "RIGHT_EAR_TRAGION" - Right ear tragion. 2279 // "LEFT_EYE_PUPIL" - Left eye pupil. 2280 // "RIGHT_EYE_PUPIL" - Right eye pupil. 2281 // "FOREHEAD_GLABELLA" - Forehead glabella. 2282 // "CHIN_GNATHION" - Chin gnathion. 2283 // "CHIN_LEFT_GONION" - Chin left gonion. 2284 // "CHIN_RIGHT_GONION" - Chin right gonion. 2285 // "LEFT_CHEEK_CENTER" - Left cheek center. 2286 // "RIGHT_CHEEK_CENTER" - Right cheek center. 2287 Type string `json:"type,omitempty"` 2288 // ForceSendFields is a list of field names (e.g. "Position") to 2289 // unconditionally include in API requests. By default, fields with empty or 2290 // default values are omitted from API requests. See 2291 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2292 // details. 2293 ForceSendFields []string `json:"-"` 2294 // NullFields is a list of field names (e.g. "Position") to include in API 2295 // requests with the JSON null value. By default, fields with empty values are 2296 // omitted from API requests. See 2297 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2298 NullFields []string `json:"-"` 2299 } 2300 2301 func (s *GoogleCloudVisionV1p1beta1FaceAnnotationLandmark) MarshalJSON() ([]byte, error) { 2302 type NoMethod GoogleCloudVisionV1p1beta1FaceAnnotationLandmark 2303 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2304 } 2305 2306 // GoogleCloudVisionV1p1beta1GcsDestination: The Google Cloud Storage location 2307 // where the output will be written to. 2308 type GoogleCloudVisionV1p1beta1GcsDestination struct { 2309 // Uri: Google Cloud Storage URI prefix where the results will be stored. 2310 // Results will be in JSON format and preceded by its corresponding input URI 2311 // prefix. This field can either represent a gcs file prefix or gcs directory. 2312 // In either case, the uri should be unique because in order to get all of the 2313 // output files, you will need to do a wildcard gcs search on the uri prefix 2314 // you provide. Examples: * File Prefix: gs://bucket-name/here/filenameprefix 2315 // The output files will be created in gs://bucket-name/here/ and the names of 2316 // the output files will begin with "filenameprefix". * Directory Prefix: 2317 // gs://bucket-name/some/location/ The output files will be created in 2318 // gs://bucket-name/some/location/ and the names of the output files could be 2319 // anything because there was no filename prefix specified. If multiple 2320 // outputs, each response is still AnnotateFileResponse, each of which contains 2321 // some subset of the full list of AnnotateImageResponse. Multiple outputs can 2322 // happen if, for example, the output JSON is too large and overflows into 2323 // multiple sharded files. 2324 Uri string `json:"uri,omitempty"` 2325 // ForceSendFields is a list of field names (e.g. "Uri") to unconditionally 2326 // include in API requests. By default, fields with empty or default values are 2327 // omitted from API requests. See 2328 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2329 // details. 2330 ForceSendFields []string `json:"-"` 2331 // NullFields is a list of field names (e.g. "Uri") to include in API requests 2332 // with the JSON null value. By default, fields with empty values are omitted 2333 // from API requests. See 2334 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2335 NullFields []string `json:"-"` 2336 } 2337 2338 func (s *GoogleCloudVisionV1p1beta1GcsDestination) MarshalJSON() ([]byte, error) { 2339 type NoMethod GoogleCloudVisionV1p1beta1GcsDestination 2340 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2341 } 2342 2343 // GoogleCloudVisionV1p1beta1GcsSource: The Google Cloud Storage location where 2344 // the input will be read from. 2345 type GoogleCloudVisionV1p1beta1GcsSource struct { 2346 // Uri: Google Cloud Storage URI for the input file. This must only be a Google 2347 // Cloud Storage object. Wildcards are not currently supported. 2348 Uri string `json:"uri,omitempty"` 2349 // ForceSendFields is a list of field names (e.g. "Uri") to unconditionally 2350 // include in API requests. By default, fields with empty or default values are 2351 // omitted from API requests. See 2352 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2353 // details. 2354 ForceSendFields []string `json:"-"` 2355 // NullFields is a list of field names (e.g. "Uri") to include in API requests 2356 // with the JSON null value. By default, fields with empty values are omitted 2357 // from API requests. See 2358 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2359 NullFields []string `json:"-"` 2360 } 2361 2362 func (s *GoogleCloudVisionV1p1beta1GcsSource) MarshalJSON() ([]byte, error) { 2363 type NoMethod GoogleCloudVisionV1p1beta1GcsSource 2364 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2365 } 2366 2367 // GoogleCloudVisionV1p1beta1ImageAnnotationContext: If an image was produced 2368 // from a file (e.g. a PDF), this message gives information about the source of 2369 // that image. 2370 type GoogleCloudVisionV1p1beta1ImageAnnotationContext struct { 2371 // PageNumber: If the file was a PDF or TIFF, this field gives the page number 2372 // within the file used to produce the image. 2373 PageNumber int64 `json:"pageNumber,omitempty"` 2374 // Uri: The URI of the file used to produce the image. 2375 Uri string `json:"uri,omitempty"` 2376 // ForceSendFields is a list of field names (e.g. "PageNumber") to 2377 // unconditionally include in API requests. By default, fields with empty or 2378 // default values are omitted from API requests. See 2379 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2380 // details. 2381 ForceSendFields []string `json:"-"` 2382 // NullFields is a list of field names (e.g. "PageNumber") to include in API 2383 // requests with the JSON null value. By default, fields with empty values are 2384 // omitted from API requests. See 2385 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2386 NullFields []string `json:"-"` 2387 } 2388 2389 func (s *GoogleCloudVisionV1p1beta1ImageAnnotationContext) MarshalJSON() ([]byte, error) { 2390 type NoMethod GoogleCloudVisionV1p1beta1ImageAnnotationContext 2391 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2392 } 2393 2394 // GoogleCloudVisionV1p1beta1ImageProperties: Stores image properties, such as 2395 // dominant colors. 2396 type GoogleCloudVisionV1p1beta1ImageProperties struct { 2397 // DominantColors: If present, dominant colors completed successfully. 2398 DominantColors *GoogleCloudVisionV1p1beta1DominantColorsAnnotation `json:"dominantColors,omitempty"` 2399 // ForceSendFields is a list of field names (e.g. "DominantColors") to 2400 // unconditionally include in API requests. By default, fields with empty or 2401 // default values are omitted from API requests. See 2402 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2403 // details. 2404 ForceSendFields []string `json:"-"` 2405 // NullFields is a list of field names (e.g. "DominantColors") to include in 2406 // API requests with the JSON null value. By default, fields with empty values 2407 // are omitted from API requests. See 2408 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2409 NullFields []string `json:"-"` 2410 } 2411 2412 func (s *GoogleCloudVisionV1p1beta1ImageProperties) MarshalJSON() ([]byte, error) { 2413 type NoMethod GoogleCloudVisionV1p1beta1ImageProperties 2414 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2415 } 2416 2417 // GoogleCloudVisionV1p1beta1InputConfig: The desired input location and 2418 // metadata. 2419 type GoogleCloudVisionV1p1beta1InputConfig struct { 2420 // Content: File content, represented as a stream of bytes. Note: As with all 2421 // `bytes` fields, protobuffers use a pure binary representation, whereas JSON 2422 // representations use base64. Currently, this field only works for 2423 // BatchAnnotateFiles requests. It does not work for AsyncBatchAnnotateFiles 2424 // requests. 2425 Content string `json:"content,omitempty"` 2426 // GcsSource: The Google Cloud Storage location to read the input from. 2427 GcsSource *GoogleCloudVisionV1p1beta1GcsSource `json:"gcsSource,omitempty"` 2428 // MimeType: The type of the file. Currently only "application/pdf", 2429 // "image/tiff" and "image/gif" are supported. Wildcards are not supported. 2430 MimeType string `json:"mimeType,omitempty"` 2431 // ForceSendFields is a list of field names (e.g. "Content") to unconditionally 2432 // include in API requests. By default, fields with empty or default values are 2433 // omitted from API requests. See 2434 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2435 // details. 2436 ForceSendFields []string `json:"-"` 2437 // NullFields is a list of field names (e.g. "Content") to include in API 2438 // requests with the JSON null value. By default, fields with empty values are 2439 // omitted from API requests. See 2440 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2441 NullFields []string `json:"-"` 2442 } 2443 2444 func (s *GoogleCloudVisionV1p1beta1InputConfig) MarshalJSON() ([]byte, error) { 2445 type NoMethod GoogleCloudVisionV1p1beta1InputConfig 2446 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2447 } 2448 2449 // GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation: Set of detected objects 2450 // with bounding boxes. 2451 type GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation struct { 2452 // BoundingPoly: Image region to which this object belongs. This must be 2453 // populated. 2454 BoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingPoly,omitempty"` 2455 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". For 2456 // more information, see 2457 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 2458 LanguageCode string `json:"languageCode,omitempty"` 2459 // Mid: Object ID that should align with EntityAnnotation mid. 2460 Mid string `json:"mid,omitempty"` 2461 // Name: Object name, expressed in its `language_code` language. 2462 Name string `json:"name,omitempty"` 2463 // Score: Score of the result. Range [0, 1]. 2464 Score float64 `json:"score,omitempty"` 2465 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 2466 // unconditionally include in API requests. By default, fields with empty or 2467 // default values are omitted from API requests. See 2468 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2469 // details. 2470 ForceSendFields []string `json:"-"` 2471 // NullFields is a list of field names (e.g. "BoundingPoly") to include in API 2472 // requests with the JSON null value. By default, fields with empty values are 2473 // omitted from API requests. See 2474 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2475 NullFields []string `json:"-"` 2476 } 2477 2478 func (s *GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation) MarshalJSON() ([]byte, error) { 2479 type NoMethod GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation 2480 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2481 } 2482 2483 func (s *GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation) UnmarshalJSON(data []byte) error { 2484 type NoMethod GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation 2485 var s1 struct { 2486 Score gensupport.JSONFloat64 `json:"score"` 2487 *NoMethod 2488 } 2489 s1.NoMethod = (*NoMethod)(s) 2490 if err := json.Unmarshal(data, &s1); err != nil { 2491 return err 2492 } 2493 s.Score = float64(s1.Score) 2494 return nil 2495 } 2496 2497 // GoogleCloudVisionV1p1beta1LocationInfo: Detected entity location 2498 // information. 2499 type GoogleCloudVisionV1p1beta1LocationInfo struct { 2500 // LatLng: lat/long location coordinates. 2501 LatLng *LatLng `json:"latLng,omitempty"` 2502 // ForceSendFields is a list of field names (e.g. "LatLng") to unconditionally 2503 // include in API requests. By default, fields with empty or default values are 2504 // omitted from API requests. See 2505 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2506 // details. 2507 ForceSendFields []string `json:"-"` 2508 // NullFields is a list of field names (e.g. "LatLng") to include in API 2509 // requests with the JSON null value. By default, fields with empty values are 2510 // omitted from API requests. See 2511 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2512 NullFields []string `json:"-"` 2513 } 2514 2515 func (s *GoogleCloudVisionV1p1beta1LocationInfo) MarshalJSON() ([]byte, error) { 2516 type NoMethod GoogleCloudVisionV1p1beta1LocationInfo 2517 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2518 } 2519 2520 // GoogleCloudVisionV1p1beta1NormalizedVertex: A vertex represents a 2D point 2521 // in the image. NOTE: the normalized vertex coordinates are relative to the 2522 // original image and range from 0 to 1. 2523 type GoogleCloudVisionV1p1beta1NormalizedVertex struct { 2524 // X: X coordinate. 2525 X float64 `json:"x,omitempty"` 2526 // Y: Y coordinate. 2527 Y float64 `json:"y,omitempty"` 2528 // ForceSendFields is a list of field names (e.g. "X") to unconditionally 2529 // include in API requests. By default, fields with empty or default values are 2530 // omitted from API requests. See 2531 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2532 // details. 2533 ForceSendFields []string `json:"-"` 2534 // NullFields is a list of field names (e.g. "X") to include in API requests 2535 // with the JSON null value. By default, fields with empty values are omitted 2536 // from API requests. See 2537 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2538 NullFields []string `json:"-"` 2539 } 2540 2541 func (s *GoogleCloudVisionV1p1beta1NormalizedVertex) MarshalJSON() ([]byte, error) { 2542 type NoMethod GoogleCloudVisionV1p1beta1NormalizedVertex 2543 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2544 } 2545 2546 func (s *GoogleCloudVisionV1p1beta1NormalizedVertex) UnmarshalJSON(data []byte) error { 2547 type NoMethod GoogleCloudVisionV1p1beta1NormalizedVertex 2548 var s1 struct { 2549 X gensupport.JSONFloat64 `json:"x"` 2550 Y gensupport.JSONFloat64 `json:"y"` 2551 *NoMethod 2552 } 2553 s1.NoMethod = (*NoMethod)(s) 2554 if err := json.Unmarshal(data, &s1); err != nil { 2555 return err 2556 } 2557 s.X = float64(s1.X) 2558 s.Y = float64(s1.Y) 2559 return nil 2560 } 2561 2562 // GoogleCloudVisionV1p1beta1OperationMetadata: Contains metadata for the 2563 // BatchAnnotateImages operation. 2564 type GoogleCloudVisionV1p1beta1OperationMetadata struct { 2565 // CreateTime: The time when the batch request was received. 2566 CreateTime string `json:"createTime,omitempty"` 2567 // State: Current state of the batch operation. 2568 // 2569 // Possible values: 2570 // "STATE_UNSPECIFIED" - Invalid. 2571 // "CREATED" - Request is received. 2572 // "RUNNING" - Request is actively being processed. 2573 // "DONE" - The batch processing is done. 2574 // "CANCELLED" - The batch processing was cancelled. 2575 State string `json:"state,omitempty"` 2576 // UpdateTime: The time when the operation result was last updated. 2577 UpdateTime string `json:"updateTime,omitempty"` 2578 // ForceSendFields is a list of field names (e.g. "CreateTime") to 2579 // unconditionally include in API requests. By default, fields with empty or 2580 // default values are omitted from API requests. See 2581 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2582 // details. 2583 ForceSendFields []string `json:"-"` 2584 // NullFields is a list of field names (e.g. "CreateTime") to include in API 2585 // requests with the JSON null value. By default, fields with empty values are 2586 // omitted from API requests. See 2587 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2588 NullFields []string `json:"-"` 2589 } 2590 2591 func (s *GoogleCloudVisionV1p1beta1OperationMetadata) MarshalJSON() ([]byte, error) { 2592 type NoMethod GoogleCloudVisionV1p1beta1OperationMetadata 2593 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2594 } 2595 2596 // GoogleCloudVisionV1p1beta1OutputConfig: The desired output location and 2597 // metadata. 2598 type GoogleCloudVisionV1p1beta1OutputConfig struct { 2599 // BatchSize: The max number of response protos to put into each output JSON 2600 // file on Google Cloud Storage. The valid range is [1, 100]. If not specified, 2601 // the default value is 20. For example, for one pdf file with 100 pages, 100 2602 // response protos will be generated. If `batch_size` = 20, then 5 json files 2603 // each containing 20 response protos will be written under the prefix 2604 // `gcs_destination`.`uri`. Currently, batch_size only applies to 2605 // GcsDestination, with potential future support for other output 2606 // configurations. 2607 BatchSize int64 `json:"batchSize,omitempty"` 2608 // GcsDestination: The Google Cloud Storage location to write the output(s) to. 2609 GcsDestination *GoogleCloudVisionV1p1beta1GcsDestination `json:"gcsDestination,omitempty"` 2610 // ForceSendFields is a list of field names (e.g. "BatchSize") to 2611 // unconditionally include in API requests. By default, fields with empty or 2612 // default values are omitted from API requests. See 2613 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2614 // details. 2615 ForceSendFields []string `json:"-"` 2616 // NullFields is a list of field names (e.g. "BatchSize") to include in API 2617 // requests with the JSON null value. By default, fields with empty values are 2618 // omitted from API requests. See 2619 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2620 NullFields []string `json:"-"` 2621 } 2622 2623 func (s *GoogleCloudVisionV1p1beta1OutputConfig) MarshalJSON() ([]byte, error) { 2624 type NoMethod GoogleCloudVisionV1p1beta1OutputConfig 2625 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2626 } 2627 2628 // GoogleCloudVisionV1p1beta1Page: Detected page from OCR. 2629 type GoogleCloudVisionV1p1beta1Page struct { 2630 // Blocks: List of blocks of text, images etc on this page. 2631 Blocks []*GoogleCloudVisionV1p1beta1Block `json:"blocks,omitempty"` 2632 // Confidence: Confidence of the OCR results on the page. Range [0, 1]. 2633 Confidence float64 `json:"confidence,omitempty"` 2634 // Height: Page height. For PDFs the unit is points. For images (including 2635 // TIFFs) the unit is pixels. 2636 Height int64 `json:"height,omitempty"` 2637 // Property: Additional information detected on the page. 2638 Property *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty `json:"property,omitempty"` 2639 // Width: Page width. For PDFs the unit is points. For images (including TIFFs) 2640 // the unit is pixels. 2641 Width int64 `json:"width,omitempty"` 2642 // ForceSendFields is a list of field names (e.g. "Blocks") to unconditionally 2643 // include in API requests. By default, fields with empty or default values are 2644 // omitted from API requests. See 2645 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2646 // details. 2647 ForceSendFields []string `json:"-"` 2648 // NullFields is a list of field names (e.g. "Blocks") to include in API 2649 // requests with the JSON null value. By default, fields with empty values are 2650 // omitted from API requests. See 2651 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2652 NullFields []string `json:"-"` 2653 } 2654 2655 func (s *GoogleCloudVisionV1p1beta1Page) MarshalJSON() ([]byte, error) { 2656 type NoMethod GoogleCloudVisionV1p1beta1Page 2657 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2658 } 2659 2660 func (s *GoogleCloudVisionV1p1beta1Page) UnmarshalJSON(data []byte) error { 2661 type NoMethod GoogleCloudVisionV1p1beta1Page 2662 var s1 struct { 2663 Confidence gensupport.JSONFloat64 `json:"confidence"` 2664 *NoMethod 2665 } 2666 s1.NoMethod = (*NoMethod)(s) 2667 if err := json.Unmarshal(data, &s1); err != nil { 2668 return err 2669 } 2670 s.Confidence = float64(s1.Confidence) 2671 return nil 2672 } 2673 2674 // GoogleCloudVisionV1p1beta1Paragraph: Structural unit of text representing a 2675 // number of words in certain order. 2676 type GoogleCloudVisionV1p1beta1Paragraph struct { 2677 // BoundingBox: The bounding box for the paragraph. The vertices are in the 2678 // order of top-left, top-right, bottom-right, bottom-left. When a rotation of 2679 // the bounding box is detected the rotation is represented as around the 2680 // top-left corner as defined when the text is read in the 'natural' 2681 // orientation. For example: * when the text is horizontal it might look like: 2682 // 0----1 | | 3----2 * when it's rotated 180 degrees around the top-left corner 2683 // it becomes: 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 2684 // 3). 2685 BoundingBox *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingBox,omitempty"` 2686 // Confidence: Confidence of the OCR results for the paragraph. Range [0, 1]. 2687 Confidence float64 `json:"confidence,omitempty"` 2688 // Property: Additional information detected for the paragraph. 2689 Property *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty `json:"property,omitempty"` 2690 // Words: List of all words in this paragraph. 2691 Words []*GoogleCloudVisionV1p1beta1Word `json:"words,omitempty"` 2692 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 2693 // unconditionally include in API requests. By default, fields with empty or 2694 // default values are omitted from API requests. See 2695 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2696 // details. 2697 ForceSendFields []string `json:"-"` 2698 // NullFields is a list of field names (e.g. "BoundingBox") to include in API 2699 // requests with the JSON null value. By default, fields with empty values are 2700 // omitted from API requests. See 2701 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2702 NullFields []string `json:"-"` 2703 } 2704 2705 func (s *GoogleCloudVisionV1p1beta1Paragraph) MarshalJSON() ([]byte, error) { 2706 type NoMethod GoogleCloudVisionV1p1beta1Paragraph 2707 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2708 } 2709 2710 func (s *GoogleCloudVisionV1p1beta1Paragraph) UnmarshalJSON(data []byte) error { 2711 type NoMethod GoogleCloudVisionV1p1beta1Paragraph 2712 var s1 struct { 2713 Confidence gensupport.JSONFloat64 `json:"confidence"` 2714 *NoMethod 2715 } 2716 s1.NoMethod = (*NoMethod)(s) 2717 if err := json.Unmarshal(data, &s1); err != nil { 2718 return err 2719 } 2720 s.Confidence = float64(s1.Confidence) 2721 return nil 2722 } 2723 2724 // GoogleCloudVisionV1p1beta1Position: A 3D position in the image, used 2725 // primarily for Face detection landmarks. A valid Position must have both x 2726 // and y coordinates. The position coordinates are in the same scale as the 2727 // original image. 2728 type GoogleCloudVisionV1p1beta1Position struct { 2729 // X: X coordinate. 2730 X float64 `json:"x,omitempty"` 2731 // Y: Y coordinate. 2732 Y float64 `json:"y,omitempty"` 2733 // Z: Z coordinate (or depth). 2734 Z float64 `json:"z,omitempty"` 2735 // ForceSendFields is a list of field names (e.g. "X") to unconditionally 2736 // include in API requests. By default, fields with empty or default values are 2737 // omitted from API requests. See 2738 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2739 // details. 2740 ForceSendFields []string `json:"-"` 2741 // NullFields is a list of field names (e.g. "X") to include in API requests 2742 // with the JSON null value. By default, fields with empty values are omitted 2743 // from API requests. See 2744 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2745 NullFields []string `json:"-"` 2746 } 2747 2748 func (s *GoogleCloudVisionV1p1beta1Position) MarshalJSON() ([]byte, error) { 2749 type NoMethod GoogleCloudVisionV1p1beta1Position 2750 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2751 } 2752 2753 func (s *GoogleCloudVisionV1p1beta1Position) UnmarshalJSON(data []byte) error { 2754 type NoMethod GoogleCloudVisionV1p1beta1Position 2755 var s1 struct { 2756 X gensupport.JSONFloat64 `json:"x"` 2757 Y gensupport.JSONFloat64 `json:"y"` 2758 Z gensupport.JSONFloat64 `json:"z"` 2759 *NoMethod 2760 } 2761 s1.NoMethod = (*NoMethod)(s) 2762 if err := json.Unmarshal(data, &s1); err != nil { 2763 return err 2764 } 2765 s.X = float64(s1.X) 2766 s.Y = float64(s1.Y) 2767 s.Z = float64(s1.Z) 2768 return nil 2769 } 2770 2771 // GoogleCloudVisionV1p1beta1Product: A Product contains ReferenceImages. 2772 type GoogleCloudVisionV1p1beta1Product struct { 2773 // Description: User-provided metadata to be stored with this product. Must be 2774 // at most 4096 characters long. 2775 Description string `json:"description,omitempty"` 2776 // DisplayName: The user-provided name for this Product. Must not be empty. 2777 // Must be at most 4096 characters long. 2778 DisplayName string `json:"displayName,omitempty"` 2779 // Name: The resource name of the product. Format is: 2780 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This field is 2781 // ignored when creating a product. 2782 Name string `json:"name,omitempty"` 2783 // ProductCategory: Immutable. The category for the product identified by the 2784 // reference image. This should be one of "homegoods-v2", "apparel-v2", 2785 // "toys-v2", "packagedgoods-v1" or "general-v1". The legacy categories 2786 // "homegoods", "apparel", and "toys" are still supported, but these should not 2787 // be used for new products. 2788 ProductCategory string `json:"productCategory,omitempty"` 2789 // ProductLabels: Key-value pairs that can be attached to a product. At query 2790 // time, constraints can be specified based on the product_labels. Note that 2791 // integer values can be provided as strings, e.g. "1199". Only strings with 2792 // integer values can match a range-based restriction which is to be supported 2793 // soon. Multiple values can be assigned to the same key. One product may have 2794 // up to 500 product_labels. Notice that the total number of distinct 2795 // product_labels over all products in one ProductSet cannot exceed 1M, 2796 // otherwise the product search pipeline will refuse to work for that 2797 // ProductSet. 2798 ProductLabels []*GoogleCloudVisionV1p1beta1ProductKeyValue `json:"productLabels,omitempty"` 2799 // ForceSendFields is a list of field names (e.g. "Description") to 2800 // unconditionally include in API requests. By default, fields with empty or 2801 // default values are omitted from API requests. See 2802 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2803 // details. 2804 ForceSendFields []string `json:"-"` 2805 // NullFields is a list of field names (e.g. "Description") to include in API 2806 // requests with the JSON null value. By default, fields with empty values are 2807 // omitted from API requests. See 2808 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2809 NullFields []string `json:"-"` 2810 } 2811 2812 func (s *GoogleCloudVisionV1p1beta1Product) MarshalJSON() ([]byte, error) { 2813 type NoMethod GoogleCloudVisionV1p1beta1Product 2814 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2815 } 2816 2817 // GoogleCloudVisionV1p1beta1ProductKeyValue: A product label represented as a 2818 // key-value pair. 2819 type GoogleCloudVisionV1p1beta1ProductKeyValue struct { 2820 // Key: The key of the label attached to the product. Cannot be empty and 2821 // cannot exceed 128 bytes. 2822 Key string `json:"key,omitempty"` 2823 // Value: The value of the label attached to the product. Cannot be empty and 2824 // cannot exceed 128 bytes. 2825 Value string `json:"value,omitempty"` 2826 // ForceSendFields is a list of field names (e.g. "Key") to unconditionally 2827 // include in API requests. By default, fields with empty or default values are 2828 // omitted from API requests. See 2829 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2830 // details. 2831 ForceSendFields []string `json:"-"` 2832 // NullFields is a list of field names (e.g. "Key") to include in API requests 2833 // with the JSON null value. By default, fields with empty values are omitted 2834 // from API requests. See 2835 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2836 NullFields []string `json:"-"` 2837 } 2838 2839 func (s *GoogleCloudVisionV1p1beta1ProductKeyValue) MarshalJSON() ([]byte, error) { 2840 type NoMethod GoogleCloudVisionV1p1beta1ProductKeyValue 2841 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2842 } 2843 2844 // GoogleCloudVisionV1p1beta1ProductSearchResults: Results for a product search 2845 // request. 2846 type GoogleCloudVisionV1p1beta1ProductSearchResults struct { 2847 // IndexTime: Timestamp of the index which provided these results. Products 2848 // added to the product set and products removed from the product set after 2849 // this time are not reflected in the current results. 2850 IndexTime string `json:"indexTime,omitempty"` 2851 // ProductGroupedResults: List of results grouped by products detected in the 2852 // query image. Each entry corresponds to one bounding polygon in the query 2853 // image, and contains the matching products specific to that region. There may 2854 // be duplicate product matches in the union of all the per-product results. 2855 ProductGroupedResults []*GoogleCloudVisionV1p1beta1ProductSearchResultsGroupedResult `json:"productGroupedResults,omitempty"` 2856 // Results: List of results, one for each product match. 2857 Results []*GoogleCloudVisionV1p1beta1ProductSearchResultsResult `json:"results,omitempty"` 2858 // ForceSendFields is a list of field names (e.g. "IndexTime") to 2859 // unconditionally include in API requests. By default, fields with empty or 2860 // default values are omitted from API requests. See 2861 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2862 // details. 2863 ForceSendFields []string `json:"-"` 2864 // NullFields is a list of field names (e.g. "IndexTime") to include in API 2865 // requests with the JSON null value. By default, fields with empty values are 2866 // omitted from API requests. See 2867 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2868 NullFields []string `json:"-"` 2869 } 2870 2871 func (s *GoogleCloudVisionV1p1beta1ProductSearchResults) MarshalJSON() ([]byte, error) { 2872 type NoMethod GoogleCloudVisionV1p1beta1ProductSearchResults 2873 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2874 } 2875 2876 // GoogleCloudVisionV1p1beta1ProductSearchResultsGroupedResult: Information 2877 // about the products similar to a single product in a query image. 2878 type GoogleCloudVisionV1p1beta1ProductSearchResultsGroupedResult struct { 2879 // BoundingPoly: The bounding polygon around the product detected in the query 2880 // image. 2881 BoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingPoly,omitempty"` 2882 // ObjectAnnotations: List of generic predictions for the object in the 2883 // bounding box. 2884 ObjectAnnotations []*GoogleCloudVisionV1p1beta1ProductSearchResultsObjectAnnotation `json:"objectAnnotations,omitempty"` 2885 // Results: List of results, one for each product match. 2886 Results []*GoogleCloudVisionV1p1beta1ProductSearchResultsResult `json:"results,omitempty"` 2887 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 2888 // unconditionally include in API requests. By default, fields with empty or 2889 // default values are omitted from API requests. See 2890 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2891 // details. 2892 ForceSendFields []string `json:"-"` 2893 // NullFields is a list of field names (e.g. "BoundingPoly") to include in API 2894 // requests with the JSON null value. By default, fields with empty values are 2895 // omitted from API requests. See 2896 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2897 NullFields []string `json:"-"` 2898 } 2899 2900 func (s *GoogleCloudVisionV1p1beta1ProductSearchResultsGroupedResult) MarshalJSON() ([]byte, error) { 2901 type NoMethod GoogleCloudVisionV1p1beta1ProductSearchResultsGroupedResult 2902 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2903 } 2904 2905 // GoogleCloudVisionV1p1beta1ProductSearchResultsObjectAnnotation: Prediction 2906 // for what the object in the bounding box is. 2907 type GoogleCloudVisionV1p1beta1ProductSearchResultsObjectAnnotation struct { 2908 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". For 2909 // more information, see 2910 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 2911 LanguageCode string `json:"languageCode,omitempty"` 2912 // Mid: Object ID that should align with EntityAnnotation mid. 2913 Mid string `json:"mid,omitempty"` 2914 // Name: Object name, expressed in its `language_code` language. 2915 Name string `json:"name,omitempty"` 2916 // Score: Score of the result. Range [0, 1]. 2917 Score float64 `json:"score,omitempty"` 2918 // ForceSendFields is a list of field names (e.g. "LanguageCode") to 2919 // unconditionally include in API requests. By default, fields with empty or 2920 // default values are omitted from API requests. See 2921 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2922 // details. 2923 ForceSendFields []string `json:"-"` 2924 // NullFields is a list of field names (e.g. "LanguageCode") to include in API 2925 // requests with the JSON null value. By default, fields with empty values are 2926 // omitted from API requests. See 2927 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2928 NullFields []string `json:"-"` 2929 } 2930 2931 func (s *GoogleCloudVisionV1p1beta1ProductSearchResultsObjectAnnotation) MarshalJSON() ([]byte, error) { 2932 type NoMethod GoogleCloudVisionV1p1beta1ProductSearchResultsObjectAnnotation 2933 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2934 } 2935 2936 func (s *GoogleCloudVisionV1p1beta1ProductSearchResultsObjectAnnotation) UnmarshalJSON(data []byte) error { 2937 type NoMethod GoogleCloudVisionV1p1beta1ProductSearchResultsObjectAnnotation 2938 var s1 struct { 2939 Score gensupport.JSONFloat64 `json:"score"` 2940 *NoMethod 2941 } 2942 s1.NoMethod = (*NoMethod)(s) 2943 if err := json.Unmarshal(data, &s1); err != nil { 2944 return err 2945 } 2946 s.Score = float64(s1.Score) 2947 return nil 2948 } 2949 2950 // GoogleCloudVisionV1p1beta1ProductSearchResultsResult: Information about a 2951 // product. 2952 type GoogleCloudVisionV1p1beta1ProductSearchResultsResult struct { 2953 // Image: The resource name of the image from the product that is the closest 2954 // match to the query. 2955 Image string `json:"image,omitempty"` 2956 // Product: The Product. 2957 Product *GoogleCloudVisionV1p1beta1Product `json:"product,omitempty"` 2958 // Score: A confidence level on the match, ranging from 0 (no confidence) to 1 2959 // (full confidence). 2960 Score float64 `json:"score,omitempty"` 2961 // ForceSendFields is a list of field names (e.g. "Image") to unconditionally 2962 // include in API requests. By default, fields with empty or default values are 2963 // omitted from API requests. See 2964 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2965 // details. 2966 ForceSendFields []string `json:"-"` 2967 // NullFields is a list of field names (e.g. "Image") to include in API 2968 // requests with the JSON null value. By default, fields with empty values are 2969 // omitted from API requests. See 2970 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2971 NullFields []string `json:"-"` 2972 } 2973 2974 func (s *GoogleCloudVisionV1p1beta1ProductSearchResultsResult) MarshalJSON() ([]byte, error) { 2975 type NoMethod GoogleCloudVisionV1p1beta1ProductSearchResultsResult 2976 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2977 } 2978 2979 func (s *GoogleCloudVisionV1p1beta1ProductSearchResultsResult) UnmarshalJSON(data []byte) error { 2980 type NoMethod GoogleCloudVisionV1p1beta1ProductSearchResultsResult 2981 var s1 struct { 2982 Score gensupport.JSONFloat64 `json:"score"` 2983 *NoMethod 2984 } 2985 s1.NoMethod = (*NoMethod)(s) 2986 if err := json.Unmarshal(data, &s1); err != nil { 2987 return err 2988 } 2989 s.Score = float64(s1.Score) 2990 return nil 2991 } 2992 2993 // GoogleCloudVisionV1p1beta1Property: A `Property` consists of a user-supplied 2994 // name/value pair. 2995 type GoogleCloudVisionV1p1beta1Property struct { 2996 // Name: Name of the property. 2997 Name string `json:"name,omitempty"` 2998 // Uint64Value: Value of numeric properties. 2999 Uint64Value uint64 `json:"uint64Value,omitempty,string"` 3000 // Value: Value of the property. 3001 Value string `json:"value,omitempty"` 3002 // ForceSendFields is a list of field names (e.g. "Name") to unconditionally 3003 // include in API requests. By default, fields with empty or default values are 3004 // omitted from API requests. See 3005 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3006 // details. 3007 ForceSendFields []string `json:"-"` 3008 // NullFields is a list of field names (e.g. "Name") to include in API requests 3009 // with the JSON null value. By default, fields with empty values are omitted 3010 // from API requests. See 3011 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3012 NullFields []string `json:"-"` 3013 } 3014 3015 func (s *GoogleCloudVisionV1p1beta1Property) MarshalJSON() ([]byte, error) { 3016 type NoMethod GoogleCloudVisionV1p1beta1Property 3017 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3018 } 3019 3020 // GoogleCloudVisionV1p1beta1SafeSearchAnnotation: Set of features pertaining 3021 // to the image, computed by computer vision methods over safe-search verticals 3022 // (for example, adult, spoof, medical, violence). 3023 type GoogleCloudVisionV1p1beta1SafeSearchAnnotation struct { 3024 // Adult: Represents the adult content likelihood for the image. Adult content 3025 // may contain elements such as nudity, pornographic images or cartoons, or 3026 // sexual activities. 3027 // 3028 // Possible values: 3029 // "UNKNOWN" - Unknown likelihood. 3030 // "VERY_UNLIKELY" - It is very unlikely. 3031 // "UNLIKELY" - It is unlikely. 3032 // "POSSIBLE" - It is possible. 3033 // "LIKELY" - It is likely. 3034 // "VERY_LIKELY" - It is very likely. 3035 Adult string `json:"adult,omitempty"` 3036 // Medical: Likelihood that this is a medical image. 3037 // 3038 // Possible values: 3039 // "UNKNOWN" - Unknown likelihood. 3040 // "VERY_UNLIKELY" - It is very unlikely. 3041 // "UNLIKELY" - It is unlikely. 3042 // "POSSIBLE" - It is possible. 3043 // "LIKELY" - It is likely. 3044 // "VERY_LIKELY" - It is very likely. 3045 Medical string `json:"medical,omitempty"` 3046 // Racy: Likelihood that the request image contains racy content. Racy content 3047 // may include (but is not limited to) skimpy or sheer clothing, strategically 3048 // covered nudity, lewd or provocative poses, or close-ups of sensitive body 3049 // areas. 3050 // 3051 // Possible values: 3052 // "UNKNOWN" - Unknown likelihood. 3053 // "VERY_UNLIKELY" - It is very unlikely. 3054 // "UNLIKELY" - It is unlikely. 3055 // "POSSIBLE" - It is possible. 3056 // "LIKELY" - It is likely. 3057 // "VERY_LIKELY" - It is very likely. 3058 Racy string `json:"racy,omitempty"` 3059 // Spoof: Spoof likelihood. The likelihood that an modification was made to the 3060 // image's canonical version to make it appear funny or offensive. 3061 // 3062 // Possible values: 3063 // "UNKNOWN" - Unknown likelihood. 3064 // "VERY_UNLIKELY" - It is very unlikely. 3065 // "UNLIKELY" - It is unlikely. 3066 // "POSSIBLE" - It is possible. 3067 // "LIKELY" - It is likely. 3068 // "VERY_LIKELY" - It is very likely. 3069 Spoof string `json:"spoof,omitempty"` 3070 // Violence: Likelihood that this image contains violent content. Violent 3071 // content may include death, serious harm, or injury to individuals or groups 3072 // of individuals. 3073 // 3074 // Possible values: 3075 // "UNKNOWN" - Unknown likelihood. 3076 // "VERY_UNLIKELY" - It is very unlikely. 3077 // "UNLIKELY" - It is unlikely. 3078 // "POSSIBLE" - It is possible. 3079 // "LIKELY" - It is likely. 3080 // "VERY_LIKELY" - It is very likely. 3081 Violence string `json:"violence,omitempty"` 3082 // ForceSendFields is a list of field names (e.g. "Adult") to unconditionally 3083 // include in API requests. By default, fields with empty or default values are 3084 // omitted from API requests. See 3085 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3086 // details. 3087 ForceSendFields []string `json:"-"` 3088 // NullFields is a list of field names (e.g. "Adult") to include in API 3089 // requests with the JSON null value. By default, fields with empty values are 3090 // omitted from API requests. See 3091 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3092 NullFields []string `json:"-"` 3093 } 3094 3095 func (s *GoogleCloudVisionV1p1beta1SafeSearchAnnotation) MarshalJSON() ([]byte, error) { 3096 type NoMethod GoogleCloudVisionV1p1beta1SafeSearchAnnotation 3097 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3098 } 3099 3100 // GoogleCloudVisionV1p1beta1Symbol: A single symbol representation. 3101 type GoogleCloudVisionV1p1beta1Symbol struct { 3102 // BoundingBox: The bounding box for the symbol. The vertices are in the order 3103 // of top-left, top-right, bottom-right, bottom-left. When a rotation of the 3104 // bounding box is detected the rotation is represented as around the top-left 3105 // corner as defined when the text is read in the 'natural' orientation. For 3106 // example: * when the text is horizontal it might look like: 0----1 | | 3----2 3107 // * when it's rotated 180 degrees around the top-left corner it becomes: 3108 // 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 3). 3109 BoundingBox *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingBox,omitempty"` 3110 // Confidence: Confidence of the OCR results for the symbol. Range [0, 1]. 3111 Confidence float64 `json:"confidence,omitempty"` 3112 // Property: Additional information detected for the symbol. 3113 Property *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty `json:"property,omitempty"` 3114 // Text: The actual UTF-8 representation of the symbol. 3115 Text string `json:"text,omitempty"` 3116 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 3117 // unconditionally include in API requests. By default, fields with empty or 3118 // default values are omitted from API requests. See 3119 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3120 // details. 3121 ForceSendFields []string `json:"-"` 3122 // NullFields is a list of field names (e.g. "BoundingBox") to include in API 3123 // requests with the JSON null value. By default, fields with empty values are 3124 // omitted from API requests. See 3125 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3126 NullFields []string `json:"-"` 3127 } 3128 3129 func (s *GoogleCloudVisionV1p1beta1Symbol) MarshalJSON() ([]byte, error) { 3130 type NoMethod GoogleCloudVisionV1p1beta1Symbol 3131 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3132 } 3133 3134 func (s *GoogleCloudVisionV1p1beta1Symbol) UnmarshalJSON(data []byte) error { 3135 type NoMethod GoogleCloudVisionV1p1beta1Symbol 3136 var s1 struct { 3137 Confidence gensupport.JSONFloat64 `json:"confidence"` 3138 *NoMethod 3139 } 3140 s1.NoMethod = (*NoMethod)(s) 3141 if err := json.Unmarshal(data, &s1); err != nil { 3142 return err 3143 } 3144 s.Confidence = float64(s1.Confidence) 3145 return nil 3146 } 3147 3148 // GoogleCloudVisionV1p1beta1TextAnnotation: TextAnnotation contains a 3149 // structured representation of OCR extracted text. The hierarchy of an OCR 3150 // extracted text structure is like this: TextAnnotation -> Page -> Block -> 3151 // Paragraph -> Word -> Symbol Each structural component, starting from Page, 3152 // may further have their own properties. Properties describe detected 3153 // languages, breaks etc.. Please refer to the TextAnnotation.TextProperty 3154 // message definition below for more detail. 3155 type GoogleCloudVisionV1p1beta1TextAnnotation struct { 3156 // Pages: List of pages detected by OCR. 3157 Pages []*GoogleCloudVisionV1p1beta1Page `json:"pages,omitempty"` 3158 // Text: UTF-8 text detected on the pages. 3159 Text string `json:"text,omitempty"` 3160 // ForceSendFields is a list of field names (e.g. "Pages") to unconditionally 3161 // include in API requests. By default, fields with empty or default values are 3162 // omitted from API requests. See 3163 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3164 // details. 3165 ForceSendFields []string `json:"-"` 3166 // NullFields is a list of field names (e.g. "Pages") to include in API 3167 // requests with the JSON null value. By default, fields with empty values are 3168 // omitted from API requests. See 3169 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3170 NullFields []string `json:"-"` 3171 } 3172 3173 func (s *GoogleCloudVisionV1p1beta1TextAnnotation) MarshalJSON() ([]byte, error) { 3174 type NoMethod GoogleCloudVisionV1p1beta1TextAnnotation 3175 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3176 } 3177 3178 // GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak: Detected start or end 3179 // of a structural component. 3180 type GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak struct { 3181 // IsPrefix: True if break prepends the element. 3182 IsPrefix bool `json:"isPrefix,omitempty"` 3183 // Type: Detected break type. 3184 // 3185 // Possible values: 3186 // "UNKNOWN" - Unknown break label type. 3187 // "SPACE" - Regular space. 3188 // "SURE_SPACE" - Sure space (very wide). 3189 // "EOL_SURE_SPACE" - Line-wrapping break. 3190 // "HYPHEN" - End-line hyphen that is not present in text; does not co-occur 3191 // with `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. 3192 // "LINE_BREAK" - Line break that ends a paragraph. 3193 Type string `json:"type,omitempty"` 3194 // ForceSendFields is a list of field names (e.g. "IsPrefix") to 3195 // unconditionally include in API requests. By default, fields with empty or 3196 // default values are omitted from API requests. See 3197 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3198 // details. 3199 ForceSendFields []string `json:"-"` 3200 // NullFields is a list of field names (e.g. "IsPrefix") to include in API 3201 // requests with the JSON null value. By default, fields with empty values are 3202 // omitted from API requests. See 3203 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3204 NullFields []string `json:"-"` 3205 } 3206 3207 func (s *GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak) MarshalJSON() ([]byte, error) { 3208 type NoMethod GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak 3209 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3210 } 3211 3212 // GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage: Detected language 3213 // for a structural component. 3214 type GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage struct { 3215 // Confidence: Confidence of detected language. Range [0, 1]. 3216 Confidence float64 `json:"confidence,omitempty"` 3217 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". For 3218 // more information, see 3219 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 3220 LanguageCode string `json:"languageCode,omitempty"` 3221 // ForceSendFields is a list of field names (e.g. "Confidence") to 3222 // unconditionally include in API requests. By default, fields with empty or 3223 // default values are omitted from API requests. See 3224 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3225 // details. 3226 ForceSendFields []string `json:"-"` 3227 // NullFields is a list of field names (e.g. "Confidence") to include in API 3228 // requests with the JSON null value. By default, fields with empty values are 3229 // omitted from API requests. See 3230 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3231 NullFields []string `json:"-"` 3232 } 3233 3234 func (s *GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage) MarshalJSON() ([]byte, error) { 3235 type NoMethod GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage 3236 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3237 } 3238 3239 func (s *GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage) UnmarshalJSON(data []byte) error { 3240 type NoMethod GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage 3241 var s1 struct { 3242 Confidence gensupport.JSONFloat64 `json:"confidence"` 3243 *NoMethod 3244 } 3245 s1.NoMethod = (*NoMethod)(s) 3246 if err := json.Unmarshal(data, &s1); err != nil { 3247 return err 3248 } 3249 s.Confidence = float64(s1.Confidence) 3250 return nil 3251 } 3252 3253 // GoogleCloudVisionV1p1beta1TextAnnotationTextProperty: Additional information 3254 // detected on the structural component. 3255 type GoogleCloudVisionV1p1beta1TextAnnotationTextProperty struct { 3256 // DetectedBreak: Detected start or end of a text segment. 3257 DetectedBreak *GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak `json:"detectedBreak,omitempty"` 3258 // DetectedLanguages: A list of detected languages together with confidence. 3259 DetectedLanguages []*GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage `json:"detectedLanguages,omitempty"` 3260 // ForceSendFields is a list of field names (e.g. "DetectedBreak") to 3261 // unconditionally include in API requests. By default, fields with empty or 3262 // default values are omitted from API requests. See 3263 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3264 // details. 3265 ForceSendFields []string `json:"-"` 3266 // NullFields is a list of field names (e.g. "DetectedBreak") to include in API 3267 // requests with the JSON null value. By default, fields with empty values are 3268 // omitted from API requests. See 3269 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3270 NullFields []string `json:"-"` 3271 } 3272 3273 func (s *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty) MarshalJSON() ([]byte, error) { 3274 type NoMethod GoogleCloudVisionV1p1beta1TextAnnotationTextProperty 3275 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3276 } 3277 3278 // GoogleCloudVisionV1p1beta1Vertex: A vertex represents a 2D point in the 3279 // image. NOTE: the vertex coordinates are in the same scale as the original 3280 // image. 3281 type GoogleCloudVisionV1p1beta1Vertex struct { 3282 // X: X coordinate. 3283 X int64 `json:"x,omitempty"` 3284 // Y: Y coordinate. 3285 Y int64 `json:"y,omitempty"` 3286 // ForceSendFields is a list of field names (e.g. "X") to unconditionally 3287 // include in API requests. By default, fields with empty or default values are 3288 // omitted from API requests. See 3289 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3290 // details. 3291 ForceSendFields []string `json:"-"` 3292 // NullFields is a list of field names (e.g. "X") to include in API requests 3293 // with the JSON null value. By default, fields with empty values are omitted 3294 // from API requests. See 3295 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3296 NullFields []string `json:"-"` 3297 } 3298 3299 func (s *GoogleCloudVisionV1p1beta1Vertex) MarshalJSON() ([]byte, error) { 3300 type NoMethod GoogleCloudVisionV1p1beta1Vertex 3301 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3302 } 3303 3304 // GoogleCloudVisionV1p1beta1WebDetection: Relevant information for the image 3305 // from the Internet. 3306 type GoogleCloudVisionV1p1beta1WebDetection struct { 3307 // BestGuessLabels: The service's best guess as to the topic of the request 3308 // image. Inferred from similar images on the open web. 3309 BestGuessLabels []*GoogleCloudVisionV1p1beta1WebDetectionWebLabel `json:"bestGuessLabels,omitempty"` 3310 // FullMatchingImages: Fully matching images from the Internet. Can include 3311 // resized copies of the query image. 3312 FullMatchingImages []*GoogleCloudVisionV1p1beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"` 3313 // PagesWithMatchingImages: Web pages containing the matching images from the 3314 // Internet. 3315 PagesWithMatchingImages []*GoogleCloudVisionV1p1beta1WebDetectionWebPage `json:"pagesWithMatchingImages,omitempty"` 3316 // PartialMatchingImages: Partial matching images from the Internet. Those 3317 // images are similar enough to share some key-point features. For example an 3318 // original image will likely have partial matching for its crops. 3319 PartialMatchingImages []*GoogleCloudVisionV1p1beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"` 3320 // VisuallySimilarImages: The visually similar image results. 3321 VisuallySimilarImages []*GoogleCloudVisionV1p1beta1WebDetectionWebImage `json:"visuallySimilarImages,omitempty"` 3322 // WebEntities: Deduced entities from similar images on the Internet. 3323 WebEntities []*GoogleCloudVisionV1p1beta1WebDetectionWebEntity `json:"webEntities,omitempty"` 3324 // ForceSendFields is a list of field names (e.g. "BestGuessLabels") to 3325 // unconditionally include in API requests. By default, fields with empty or 3326 // default values are omitted from API requests. See 3327 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3328 // details. 3329 ForceSendFields []string `json:"-"` 3330 // NullFields is a list of field names (e.g. "BestGuessLabels") to include in 3331 // API requests with the JSON null value. By default, fields with empty values 3332 // are omitted from API requests. See 3333 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3334 NullFields []string `json:"-"` 3335 } 3336 3337 func (s *GoogleCloudVisionV1p1beta1WebDetection) MarshalJSON() ([]byte, error) { 3338 type NoMethod GoogleCloudVisionV1p1beta1WebDetection 3339 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3340 } 3341 3342 // GoogleCloudVisionV1p1beta1WebDetectionWebEntity: Entity deduced from similar 3343 // images on the Internet. 3344 type GoogleCloudVisionV1p1beta1WebDetectionWebEntity struct { 3345 // Description: Canonical description of the entity, in English. 3346 Description string `json:"description,omitempty"` 3347 // EntityId: Opaque entity ID. 3348 EntityId string `json:"entityId,omitempty"` 3349 // Score: Overall relevancy score for the entity. Not normalized and not 3350 // comparable across different image queries. 3351 Score float64 `json:"score,omitempty"` 3352 // ForceSendFields is a list of field names (e.g. "Description") to 3353 // unconditionally include in API requests. By default, fields with empty or 3354 // default values are omitted from API requests. See 3355 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3356 // details. 3357 ForceSendFields []string `json:"-"` 3358 // NullFields is a list of field names (e.g. "Description") to include in API 3359 // requests with the JSON null value. By default, fields with empty values are 3360 // omitted from API requests. See 3361 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3362 NullFields []string `json:"-"` 3363 } 3364 3365 func (s *GoogleCloudVisionV1p1beta1WebDetectionWebEntity) MarshalJSON() ([]byte, error) { 3366 type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebEntity 3367 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3368 } 3369 3370 func (s *GoogleCloudVisionV1p1beta1WebDetectionWebEntity) UnmarshalJSON(data []byte) error { 3371 type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebEntity 3372 var s1 struct { 3373 Score gensupport.JSONFloat64 `json:"score"` 3374 *NoMethod 3375 } 3376 s1.NoMethod = (*NoMethod)(s) 3377 if err := json.Unmarshal(data, &s1); err != nil { 3378 return err 3379 } 3380 s.Score = float64(s1.Score) 3381 return nil 3382 } 3383 3384 // GoogleCloudVisionV1p1beta1WebDetectionWebImage: Metadata for online images. 3385 type GoogleCloudVisionV1p1beta1WebDetectionWebImage struct { 3386 // Score: (Deprecated) Overall relevancy score for the image. 3387 Score float64 `json:"score,omitempty"` 3388 // Url: The result image URL. 3389 Url string `json:"url,omitempty"` 3390 // ForceSendFields is a list of field names (e.g. "Score") to unconditionally 3391 // include in API requests. By default, fields with empty or default values are 3392 // omitted from API requests. See 3393 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3394 // details. 3395 ForceSendFields []string `json:"-"` 3396 // NullFields is a list of field names (e.g. "Score") to include in API 3397 // requests with the JSON null value. By default, fields with empty values are 3398 // omitted from API requests. See 3399 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3400 NullFields []string `json:"-"` 3401 } 3402 3403 func (s *GoogleCloudVisionV1p1beta1WebDetectionWebImage) MarshalJSON() ([]byte, error) { 3404 type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebImage 3405 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3406 } 3407 3408 func (s *GoogleCloudVisionV1p1beta1WebDetectionWebImage) UnmarshalJSON(data []byte) error { 3409 type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebImage 3410 var s1 struct { 3411 Score gensupport.JSONFloat64 `json:"score"` 3412 *NoMethod 3413 } 3414 s1.NoMethod = (*NoMethod)(s) 3415 if err := json.Unmarshal(data, &s1); err != nil { 3416 return err 3417 } 3418 s.Score = float64(s1.Score) 3419 return nil 3420 } 3421 3422 // GoogleCloudVisionV1p1beta1WebDetectionWebLabel: Label to provide extra 3423 // metadata for the web detection. 3424 type GoogleCloudVisionV1p1beta1WebDetectionWebLabel struct { 3425 // Label: Label for extra metadata. 3426 Label string `json:"label,omitempty"` 3427 // LanguageCode: The BCP-47 language code for `label`, such as "en-US" or 3428 // "sr-Latn". For more information, see 3429 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 3430 LanguageCode string `json:"languageCode,omitempty"` 3431 // ForceSendFields is a list of field names (e.g. "Label") to unconditionally 3432 // include in API requests. By default, fields with empty or default values are 3433 // omitted from API requests. See 3434 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3435 // details. 3436 ForceSendFields []string `json:"-"` 3437 // NullFields is a list of field names (e.g. "Label") to include in API 3438 // requests with the JSON null value. By default, fields with empty values are 3439 // omitted from API requests. See 3440 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3441 NullFields []string `json:"-"` 3442 } 3443 3444 func (s *GoogleCloudVisionV1p1beta1WebDetectionWebLabel) MarshalJSON() ([]byte, error) { 3445 type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebLabel 3446 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3447 } 3448 3449 // GoogleCloudVisionV1p1beta1WebDetectionWebPage: Metadata for web pages. 3450 type GoogleCloudVisionV1p1beta1WebDetectionWebPage struct { 3451 // FullMatchingImages: Fully matching images on the page. Can include resized 3452 // copies of the query image. 3453 FullMatchingImages []*GoogleCloudVisionV1p1beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"` 3454 // PageTitle: Title for the web page, may contain HTML markups. 3455 PageTitle string `json:"pageTitle,omitempty"` 3456 // PartialMatchingImages: Partial matching images on the page. Those images are 3457 // similar enough to share some key-point features. For example an original 3458 // image will likely have partial matching for its crops. 3459 PartialMatchingImages []*GoogleCloudVisionV1p1beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"` 3460 // Score: (Deprecated) Overall relevancy score for the web page. 3461 Score float64 `json:"score,omitempty"` 3462 // Url: The result web page URL. 3463 Url string `json:"url,omitempty"` 3464 // ForceSendFields is a list of field names (e.g. "FullMatchingImages") to 3465 // unconditionally include in API requests. By default, fields with empty or 3466 // default values are omitted from API requests. See 3467 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3468 // details. 3469 ForceSendFields []string `json:"-"` 3470 // NullFields is a list of field names (e.g. "FullMatchingImages") to include 3471 // in API requests with the JSON null value. By default, fields with empty 3472 // values are omitted from API requests. See 3473 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3474 NullFields []string `json:"-"` 3475 } 3476 3477 func (s *GoogleCloudVisionV1p1beta1WebDetectionWebPage) MarshalJSON() ([]byte, error) { 3478 type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebPage 3479 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3480 } 3481 3482 func (s *GoogleCloudVisionV1p1beta1WebDetectionWebPage) UnmarshalJSON(data []byte) error { 3483 type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebPage 3484 var s1 struct { 3485 Score gensupport.JSONFloat64 `json:"score"` 3486 *NoMethod 3487 } 3488 s1.NoMethod = (*NoMethod)(s) 3489 if err := json.Unmarshal(data, &s1); err != nil { 3490 return err 3491 } 3492 s.Score = float64(s1.Score) 3493 return nil 3494 } 3495 3496 // GoogleCloudVisionV1p1beta1Word: A word representation. 3497 type GoogleCloudVisionV1p1beta1Word struct { 3498 // BoundingBox: The bounding box for the word. The vertices are in the order of 3499 // top-left, top-right, bottom-right, bottom-left. When a rotation of the 3500 // bounding box is detected the rotation is represented as around the top-left 3501 // corner as defined when the text is read in the 'natural' orientation. For 3502 // example: * when the text is horizontal it might look like: 0----1 | | 3----2 3503 // * when it's rotated 180 degrees around the top-left corner it becomes: 3504 // 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 3). 3505 BoundingBox *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingBox,omitempty"` 3506 // Confidence: Confidence of the OCR results for the word. Range [0, 1]. 3507 Confidence float64 `json:"confidence,omitempty"` 3508 // Property: Additional information detected for the word. 3509 Property *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty `json:"property,omitempty"` 3510 // Symbols: List of symbols in the word. The order of the symbols follows the 3511 // natural reading order. 3512 Symbols []*GoogleCloudVisionV1p1beta1Symbol `json:"symbols,omitempty"` 3513 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 3514 // unconditionally include in API requests. By default, fields with empty or 3515 // default values are omitted from API requests. See 3516 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3517 // details. 3518 ForceSendFields []string `json:"-"` 3519 // NullFields is a list of field names (e.g. "BoundingBox") to include in API 3520 // requests with the JSON null value. By default, fields with empty values are 3521 // omitted from API requests. See 3522 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3523 NullFields []string `json:"-"` 3524 } 3525 3526 func (s *GoogleCloudVisionV1p1beta1Word) MarshalJSON() ([]byte, error) { 3527 type NoMethod GoogleCloudVisionV1p1beta1Word 3528 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3529 } 3530 3531 func (s *GoogleCloudVisionV1p1beta1Word) UnmarshalJSON(data []byte) error { 3532 type NoMethod GoogleCloudVisionV1p1beta1Word 3533 var s1 struct { 3534 Confidence gensupport.JSONFloat64 `json:"confidence"` 3535 *NoMethod 3536 } 3537 s1.NoMethod = (*NoMethod)(s) 3538 if err := json.Unmarshal(data, &s1); err != nil { 3539 return err 3540 } 3541 s.Confidence = float64(s1.Confidence) 3542 return nil 3543 } 3544 3545 // GoogleCloudVisionV1p2beta1AnnotateFileResponse: Response to a single file 3546 // annotation request. A file may contain one or more images, which 3547 // individually have their own responses. 3548 type GoogleCloudVisionV1p2beta1AnnotateFileResponse struct { 3549 // Error: If set, represents the error message for the failed request. The 3550 // `responses` field will not be set in this case. 3551 Error *Status `json:"error,omitempty"` 3552 // InputConfig: Information about the file for which this response is 3553 // generated. 3554 InputConfig *GoogleCloudVisionV1p2beta1InputConfig `json:"inputConfig,omitempty"` 3555 // Responses: Individual responses to images found within the file. This field 3556 // will be empty if the `error` field is set. 3557 Responses []*GoogleCloudVisionV1p2beta1AnnotateImageResponse `json:"responses,omitempty"` 3558 // TotalPages: This field gives the total number of pages in the file. 3559 TotalPages int64 `json:"totalPages,omitempty"` 3560 // ForceSendFields is a list of field names (e.g. "Error") to unconditionally 3561 // include in API requests. By default, fields with empty or default values are 3562 // omitted from API requests. See 3563 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3564 // details. 3565 ForceSendFields []string `json:"-"` 3566 // NullFields is a list of field names (e.g. "Error") to include in API 3567 // requests with the JSON null value. By default, fields with empty values are 3568 // omitted from API requests. See 3569 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3570 NullFields []string `json:"-"` 3571 } 3572 3573 func (s *GoogleCloudVisionV1p2beta1AnnotateFileResponse) MarshalJSON() ([]byte, error) { 3574 type NoMethod GoogleCloudVisionV1p2beta1AnnotateFileResponse 3575 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3576 } 3577 3578 // GoogleCloudVisionV1p2beta1AnnotateImageResponse: Response to an image 3579 // annotation request. 3580 type GoogleCloudVisionV1p2beta1AnnotateImageResponse struct { 3581 // Context: If present, contextual information is needed to understand where 3582 // this image comes from. 3583 Context *GoogleCloudVisionV1p2beta1ImageAnnotationContext `json:"context,omitempty"` 3584 // CropHintsAnnotation: If present, crop hints have completed successfully. 3585 CropHintsAnnotation *GoogleCloudVisionV1p2beta1CropHintsAnnotation `json:"cropHintsAnnotation,omitempty"` 3586 // Error: If set, represents the error message for the operation. Note that 3587 // filled-in image annotations are guaranteed to be correct, even when `error` 3588 // is set. 3589 Error *Status `json:"error,omitempty"` 3590 // FaceAnnotations: If present, face detection has completed successfully. 3591 FaceAnnotations []*GoogleCloudVisionV1p2beta1FaceAnnotation `json:"faceAnnotations,omitempty"` 3592 // FullTextAnnotation: If present, text (OCR) detection or document (OCR) text 3593 // detection has completed successfully. This annotation provides the 3594 // structural hierarchy for the OCR detected text. 3595 FullTextAnnotation *GoogleCloudVisionV1p2beta1TextAnnotation `json:"fullTextAnnotation,omitempty"` 3596 // ImagePropertiesAnnotation: If present, image properties were extracted 3597 // successfully. 3598 ImagePropertiesAnnotation *GoogleCloudVisionV1p2beta1ImageProperties `json:"imagePropertiesAnnotation,omitempty"` 3599 // LabelAnnotations: If present, label detection has completed successfully. 3600 LabelAnnotations []*GoogleCloudVisionV1p2beta1EntityAnnotation `json:"labelAnnotations,omitempty"` 3601 // LandmarkAnnotations: If present, landmark detection has completed 3602 // successfully. 3603 LandmarkAnnotations []*GoogleCloudVisionV1p2beta1EntityAnnotation `json:"landmarkAnnotations,omitempty"` 3604 // LocalizedObjectAnnotations: If present, localized object detection has 3605 // completed successfully. This will be sorted descending by confidence score. 3606 LocalizedObjectAnnotations []*GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation `json:"localizedObjectAnnotations,omitempty"` 3607 // LogoAnnotations: If present, logo detection has completed successfully. 3608 LogoAnnotations []*GoogleCloudVisionV1p2beta1EntityAnnotation `json:"logoAnnotations,omitempty"` 3609 // ProductSearchResults: If present, product search has completed successfully. 3610 ProductSearchResults *GoogleCloudVisionV1p2beta1ProductSearchResults `json:"productSearchResults,omitempty"` 3611 // SafeSearchAnnotation: If present, safe-search annotation has completed 3612 // successfully. 3613 SafeSearchAnnotation *GoogleCloudVisionV1p2beta1SafeSearchAnnotation `json:"safeSearchAnnotation,omitempty"` 3614 // TextAnnotations: If present, text (OCR) detection has completed 3615 // successfully. 3616 TextAnnotations []*GoogleCloudVisionV1p2beta1EntityAnnotation `json:"textAnnotations,omitempty"` 3617 // WebDetection: If present, web detection has completed successfully. 3618 WebDetection *GoogleCloudVisionV1p2beta1WebDetection `json:"webDetection,omitempty"` 3619 // ForceSendFields is a list of field names (e.g. "Context") to unconditionally 3620 // include in API requests. By default, fields with empty or default values are 3621 // omitted from API requests. See 3622 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3623 // details. 3624 ForceSendFields []string `json:"-"` 3625 // NullFields is a list of field names (e.g. "Context") to include in API 3626 // requests with the JSON null value. By default, fields with empty values are 3627 // omitted from API requests. See 3628 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3629 NullFields []string `json:"-"` 3630 } 3631 3632 func (s *GoogleCloudVisionV1p2beta1AnnotateImageResponse) MarshalJSON() ([]byte, error) { 3633 type NoMethod GoogleCloudVisionV1p2beta1AnnotateImageResponse 3634 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3635 } 3636 3637 // GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse: The response for a 3638 // single offline file annotation request. 3639 type GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse struct { 3640 // OutputConfig: The output location and metadata from 3641 // AsyncAnnotateFileRequest. 3642 OutputConfig *GoogleCloudVisionV1p2beta1OutputConfig `json:"outputConfig,omitempty"` 3643 // ForceSendFields is a list of field names (e.g. "OutputConfig") to 3644 // unconditionally include in API requests. By default, fields with empty or 3645 // default values are omitted from API requests. See 3646 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3647 // details. 3648 ForceSendFields []string `json:"-"` 3649 // NullFields is a list of field names (e.g. "OutputConfig") to include in API 3650 // requests with the JSON null value. By default, fields with empty values are 3651 // omitted from API requests. See 3652 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3653 NullFields []string `json:"-"` 3654 } 3655 3656 func (s *GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse) MarshalJSON() ([]byte, error) { 3657 type NoMethod GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse 3658 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3659 } 3660 3661 // GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse: Response to an 3662 // async batch file annotation request. 3663 type GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse struct { 3664 // Responses: The list of file annotation responses, one for each request in 3665 // AsyncBatchAnnotateFilesRequest. 3666 Responses []*GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse `json:"responses,omitempty"` 3667 // ForceSendFields is a list of field names (e.g. "Responses") to 3668 // unconditionally include in API requests. By default, fields with empty or 3669 // default values are omitted from API requests. See 3670 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3671 // details. 3672 ForceSendFields []string `json:"-"` 3673 // NullFields is a list of field names (e.g. "Responses") to include in API 3674 // requests with the JSON null value. By default, fields with empty values are 3675 // omitted from API requests. See 3676 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3677 NullFields []string `json:"-"` 3678 } 3679 3680 func (s *GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) { 3681 type NoMethod GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse 3682 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3683 } 3684 3685 // GoogleCloudVisionV1p2beta1Block: Logical element on the page. 3686 type GoogleCloudVisionV1p2beta1Block struct { 3687 // BlockType: Detected block type (text, image etc) for this block. 3688 // 3689 // Possible values: 3690 // "UNKNOWN" - Unknown block type. 3691 // "TEXT" - Regular text block. 3692 // "TABLE" - Table block. 3693 // "PICTURE" - Image block. 3694 // "RULER" - Horizontal/vertical line box. 3695 // "BARCODE" - Barcode block. 3696 BlockType string `json:"blockType,omitempty"` 3697 // BoundingBox: The bounding box for the block. The vertices are in the order 3698 // of top-left, top-right, bottom-right, bottom-left. When a rotation of the 3699 // bounding box is detected the rotation is represented as around the top-left 3700 // corner as defined when the text is read in the 'natural' orientation. For 3701 // example: * when the text is horizontal it might look like: 0----1 | | 3----2 3702 // * when it's rotated 180 degrees around the top-left corner it becomes: 3703 // 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 3). 3704 BoundingBox *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingBox,omitempty"` 3705 // Confidence: Confidence of the OCR results on the block. Range [0, 1]. 3706 Confidence float64 `json:"confidence,omitempty"` 3707 // Paragraphs: List of paragraphs in this block (if this blocks is of type 3708 // text). 3709 Paragraphs []*GoogleCloudVisionV1p2beta1Paragraph `json:"paragraphs,omitempty"` 3710 // Property: Additional information detected for the block. 3711 Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"` 3712 // ForceSendFields is a list of field names (e.g. "BlockType") to 3713 // unconditionally include in API requests. By default, fields with empty or 3714 // default values are omitted from API requests. See 3715 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3716 // details. 3717 ForceSendFields []string `json:"-"` 3718 // NullFields is a list of field names (e.g. "BlockType") to include in API 3719 // requests with the JSON null value. By default, fields with empty values are 3720 // omitted from API requests. See 3721 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3722 NullFields []string `json:"-"` 3723 } 3724 3725 func (s *GoogleCloudVisionV1p2beta1Block) MarshalJSON() ([]byte, error) { 3726 type NoMethod GoogleCloudVisionV1p2beta1Block 3727 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3728 } 3729 3730 func (s *GoogleCloudVisionV1p2beta1Block) UnmarshalJSON(data []byte) error { 3731 type NoMethod GoogleCloudVisionV1p2beta1Block 3732 var s1 struct { 3733 Confidence gensupport.JSONFloat64 `json:"confidence"` 3734 *NoMethod 3735 } 3736 s1.NoMethod = (*NoMethod)(s) 3737 if err := json.Unmarshal(data, &s1); err != nil { 3738 return err 3739 } 3740 s.Confidence = float64(s1.Confidence) 3741 return nil 3742 } 3743 3744 // GoogleCloudVisionV1p2beta1BoundingPoly: A bounding polygon for the detected 3745 // image annotation. 3746 type GoogleCloudVisionV1p2beta1BoundingPoly struct { 3747 // NormalizedVertices: The bounding polygon normalized vertices. 3748 NormalizedVertices []*GoogleCloudVisionV1p2beta1NormalizedVertex `json:"normalizedVertices,omitempty"` 3749 // Vertices: The bounding polygon vertices. 3750 Vertices []*GoogleCloudVisionV1p2beta1Vertex `json:"vertices,omitempty"` 3751 // ForceSendFields is a list of field names (e.g. "NormalizedVertices") to 3752 // unconditionally include in API requests. By default, fields with empty or 3753 // default values are omitted from API requests. See 3754 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3755 // details. 3756 ForceSendFields []string `json:"-"` 3757 // NullFields is a list of field names (e.g. "NormalizedVertices") to include 3758 // in API requests with the JSON null value. By default, fields with empty 3759 // values are omitted from API requests. See 3760 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3761 NullFields []string `json:"-"` 3762 } 3763 3764 func (s *GoogleCloudVisionV1p2beta1BoundingPoly) MarshalJSON() ([]byte, error) { 3765 type NoMethod GoogleCloudVisionV1p2beta1BoundingPoly 3766 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3767 } 3768 3769 // GoogleCloudVisionV1p2beta1ColorInfo: Color information consists of RGB 3770 // channels, score, and the fraction of the image that the color occupies in 3771 // the image. 3772 type GoogleCloudVisionV1p2beta1ColorInfo struct { 3773 // Color: RGB components of the color. 3774 Color *Color `json:"color,omitempty"` 3775 // PixelFraction: The fraction of pixels the color occupies in the image. Value 3776 // in range [0, 1]. 3777 PixelFraction float64 `json:"pixelFraction,omitempty"` 3778 // Score: Image-specific score for this color. Value in range [0, 1]. 3779 Score float64 `json:"score,omitempty"` 3780 // ForceSendFields is a list of field names (e.g. "Color") to unconditionally 3781 // include in API requests. By default, fields with empty or default values are 3782 // omitted from API requests. See 3783 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3784 // details. 3785 ForceSendFields []string `json:"-"` 3786 // NullFields is a list of field names (e.g. "Color") to include in API 3787 // requests with the JSON null value. By default, fields with empty values are 3788 // omitted from API requests. See 3789 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3790 NullFields []string `json:"-"` 3791 } 3792 3793 func (s *GoogleCloudVisionV1p2beta1ColorInfo) MarshalJSON() ([]byte, error) { 3794 type NoMethod GoogleCloudVisionV1p2beta1ColorInfo 3795 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3796 } 3797 3798 func (s *GoogleCloudVisionV1p2beta1ColorInfo) UnmarshalJSON(data []byte) error { 3799 type NoMethod GoogleCloudVisionV1p2beta1ColorInfo 3800 var s1 struct { 3801 PixelFraction gensupport.JSONFloat64 `json:"pixelFraction"` 3802 Score gensupport.JSONFloat64 `json:"score"` 3803 *NoMethod 3804 } 3805 s1.NoMethod = (*NoMethod)(s) 3806 if err := json.Unmarshal(data, &s1); err != nil { 3807 return err 3808 } 3809 s.PixelFraction = float64(s1.PixelFraction) 3810 s.Score = float64(s1.Score) 3811 return nil 3812 } 3813 3814 // GoogleCloudVisionV1p2beta1CropHint: Single crop hint that is used to 3815 // generate a new crop when serving an image. 3816 type GoogleCloudVisionV1p2beta1CropHint struct { 3817 // BoundingPoly: The bounding polygon for the crop region. The coordinates of 3818 // the bounding box are in the original image's scale. 3819 BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"` 3820 // Confidence: Confidence of this being a salient region. Range [0, 1]. 3821 Confidence float64 `json:"confidence,omitempty"` 3822 // ImportanceFraction: Fraction of importance of this salient region with 3823 // respect to the original image. 3824 ImportanceFraction float64 `json:"importanceFraction,omitempty"` 3825 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 3826 // unconditionally include in API requests. By default, fields with empty or 3827 // default values are omitted from API requests. See 3828 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3829 // details. 3830 ForceSendFields []string `json:"-"` 3831 // NullFields is a list of field names (e.g. "BoundingPoly") to include in API 3832 // requests with the JSON null value. By default, fields with empty values are 3833 // omitted from API requests. See 3834 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3835 NullFields []string `json:"-"` 3836 } 3837 3838 func (s *GoogleCloudVisionV1p2beta1CropHint) MarshalJSON() ([]byte, error) { 3839 type NoMethod GoogleCloudVisionV1p2beta1CropHint 3840 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3841 } 3842 3843 func (s *GoogleCloudVisionV1p2beta1CropHint) UnmarshalJSON(data []byte) error { 3844 type NoMethod GoogleCloudVisionV1p2beta1CropHint 3845 var s1 struct { 3846 Confidence gensupport.JSONFloat64 `json:"confidence"` 3847 ImportanceFraction gensupport.JSONFloat64 `json:"importanceFraction"` 3848 *NoMethod 3849 } 3850 s1.NoMethod = (*NoMethod)(s) 3851 if err := json.Unmarshal(data, &s1); err != nil { 3852 return err 3853 } 3854 s.Confidence = float64(s1.Confidence) 3855 s.ImportanceFraction = float64(s1.ImportanceFraction) 3856 return nil 3857 } 3858 3859 // GoogleCloudVisionV1p2beta1CropHintsAnnotation: Set of crop hints that are 3860 // used to generate new crops when serving images. 3861 type GoogleCloudVisionV1p2beta1CropHintsAnnotation struct { 3862 // CropHints: Crop hint results. 3863 CropHints []*GoogleCloudVisionV1p2beta1CropHint `json:"cropHints,omitempty"` 3864 // ForceSendFields is a list of field names (e.g. "CropHints") to 3865 // unconditionally include in API requests. By default, fields with empty or 3866 // default values are omitted from API requests. See 3867 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3868 // details. 3869 ForceSendFields []string `json:"-"` 3870 // NullFields is a list of field names (e.g. "CropHints") to include in API 3871 // requests with the JSON null value. By default, fields with empty values are 3872 // omitted from API requests. See 3873 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3874 NullFields []string `json:"-"` 3875 } 3876 3877 func (s *GoogleCloudVisionV1p2beta1CropHintsAnnotation) MarshalJSON() ([]byte, error) { 3878 type NoMethod GoogleCloudVisionV1p2beta1CropHintsAnnotation 3879 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3880 } 3881 3882 // GoogleCloudVisionV1p2beta1DominantColorsAnnotation: Set of dominant colors 3883 // and their corresponding scores. 3884 type GoogleCloudVisionV1p2beta1DominantColorsAnnotation struct { 3885 // Colors: RGB color values with their score and pixel fraction. 3886 Colors []*GoogleCloudVisionV1p2beta1ColorInfo `json:"colors,omitempty"` 3887 // ForceSendFields is a list of field names (e.g. "Colors") to unconditionally 3888 // include in API requests. By default, fields with empty or default values are 3889 // omitted from API requests. See 3890 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3891 // details. 3892 ForceSendFields []string `json:"-"` 3893 // NullFields is a list of field names (e.g. "Colors") to include in API 3894 // requests with the JSON null value. By default, fields with empty values are 3895 // omitted from API requests. See 3896 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3897 NullFields []string `json:"-"` 3898 } 3899 3900 func (s *GoogleCloudVisionV1p2beta1DominantColorsAnnotation) MarshalJSON() ([]byte, error) { 3901 type NoMethod GoogleCloudVisionV1p2beta1DominantColorsAnnotation 3902 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3903 } 3904 3905 // GoogleCloudVisionV1p2beta1EntityAnnotation: Set of detected entity features. 3906 type GoogleCloudVisionV1p2beta1EntityAnnotation struct { 3907 // BoundingPoly: Image region to which this entity belongs. Not produced for 3908 // `LABEL_DETECTION` features. 3909 BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"` 3910 // Confidence: **Deprecated. Use `score` instead.** The accuracy of the entity 3911 // detection in an image. For example, for an image in which the "Eiffel Tower" 3912 // entity is detected, this field represents the confidence that there is a 3913 // tower in the query image. Range [0, 1]. 3914 Confidence float64 `json:"confidence,omitempty"` 3915 // Description: Entity textual description, expressed in its `locale` language. 3916 Description string `json:"description,omitempty"` 3917 // Locale: The language code for the locale in which the entity textual 3918 // `description` is expressed. 3919 Locale string `json:"locale,omitempty"` 3920 // Locations: The location information for the detected entity. Multiple 3921 // `LocationInfo` elements can be present because one location may indicate the 3922 // location of the scene in the image, and another location may indicate the 3923 // location of the place where the image was taken. Location information is 3924 // usually present for landmarks. 3925 Locations []*GoogleCloudVisionV1p2beta1LocationInfo `json:"locations,omitempty"` 3926 // Mid: Opaque entity ID. Some IDs may be available in Google Knowledge Graph 3927 // Search API (https://developers.google.com/knowledge-graph/). 3928 Mid string `json:"mid,omitempty"` 3929 // Properties: Some entities may have optional user-supplied `Property` 3930 // (name/value) fields, such a score or string that qualifies the entity. 3931 Properties []*GoogleCloudVisionV1p2beta1Property `json:"properties,omitempty"` 3932 // Score: Overall score of the result. Range [0, 1]. 3933 Score float64 `json:"score,omitempty"` 3934 // Topicality: The relevancy of the ICA (Image Content Annotation) label to the 3935 // image. For example, the relevancy of "tower" is likely higher to an image 3936 // containing the detected "Eiffel Tower" than to an image containing a 3937 // detected distant towering building, even though the confidence that there is 3938 // a tower in each image may be the same. Range [0, 1]. 3939 Topicality float64 `json:"topicality,omitempty"` 3940 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 3941 // unconditionally include in API requests. By default, fields with empty or 3942 // default values are omitted from API requests. See 3943 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3944 // details. 3945 ForceSendFields []string `json:"-"` 3946 // NullFields is a list of field names (e.g. "BoundingPoly") to include in API 3947 // requests with the JSON null value. By default, fields with empty values are 3948 // omitted from API requests. See 3949 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3950 NullFields []string `json:"-"` 3951 } 3952 3953 func (s *GoogleCloudVisionV1p2beta1EntityAnnotation) MarshalJSON() ([]byte, error) { 3954 type NoMethod GoogleCloudVisionV1p2beta1EntityAnnotation 3955 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3956 } 3957 3958 func (s *GoogleCloudVisionV1p2beta1EntityAnnotation) UnmarshalJSON(data []byte) error { 3959 type NoMethod GoogleCloudVisionV1p2beta1EntityAnnotation 3960 var s1 struct { 3961 Confidence gensupport.JSONFloat64 `json:"confidence"` 3962 Score gensupport.JSONFloat64 `json:"score"` 3963 Topicality gensupport.JSONFloat64 `json:"topicality"` 3964 *NoMethod 3965 } 3966 s1.NoMethod = (*NoMethod)(s) 3967 if err := json.Unmarshal(data, &s1); err != nil { 3968 return err 3969 } 3970 s.Confidence = float64(s1.Confidence) 3971 s.Score = float64(s1.Score) 3972 s.Topicality = float64(s1.Topicality) 3973 return nil 3974 } 3975 3976 // GoogleCloudVisionV1p2beta1FaceAnnotation: A face annotation object contains 3977 // the results of face detection. 3978 type GoogleCloudVisionV1p2beta1FaceAnnotation struct { 3979 // AngerLikelihood: Anger likelihood. 3980 // 3981 // Possible values: 3982 // "UNKNOWN" - Unknown likelihood. 3983 // "VERY_UNLIKELY" - It is very unlikely. 3984 // "UNLIKELY" - It is unlikely. 3985 // "POSSIBLE" - It is possible. 3986 // "LIKELY" - It is likely. 3987 // "VERY_LIKELY" - It is very likely. 3988 AngerLikelihood string `json:"angerLikelihood,omitempty"` 3989 // BlurredLikelihood: Blurred likelihood. 3990 // 3991 // Possible values: 3992 // "UNKNOWN" - Unknown likelihood. 3993 // "VERY_UNLIKELY" - It is very unlikely. 3994 // "UNLIKELY" - It is unlikely. 3995 // "POSSIBLE" - It is possible. 3996 // "LIKELY" - It is likely. 3997 // "VERY_LIKELY" - It is very likely. 3998 BlurredLikelihood string `json:"blurredLikelihood,omitempty"` 3999 // BoundingPoly: The bounding polygon around the face. The coordinates of the 4000 // bounding box are in the original image's scale. The bounding box is computed 4001 // to "frame" the face in accordance with human expectations. It is based on 4002 // the landmarker results. Note that one or more x and/or y coordinates may not 4003 // be generated in the `BoundingPoly` (the polygon will be unbounded) if only a 4004 // partial face appears in the image to be annotated. 4005 BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"` 4006 // DetectionConfidence: Detection confidence. Range [0, 1]. 4007 DetectionConfidence float64 `json:"detectionConfidence,omitempty"` 4008 // FdBoundingPoly: The `fd_bounding_poly` bounding polygon is tighter than the 4009 // `boundingPoly`, and encloses only the skin part of the face. Typically, it 4010 // is used to eliminate the face from any image analysis that detects the 4011 // "amount of skin" visible in an image. It is not based on the landmarker 4012 // results, only on the initial face detection, hence the fd (face detection) 4013 // prefix. 4014 FdBoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"fdBoundingPoly,omitempty"` 4015 // HeadwearLikelihood: Headwear likelihood. 4016 // 4017 // Possible values: 4018 // "UNKNOWN" - Unknown likelihood. 4019 // "VERY_UNLIKELY" - It is very unlikely. 4020 // "UNLIKELY" - It is unlikely. 4021 // "POSSIBLE" - It is possible. 4022 // "LIKELY" - It is likely. 4023 // "VERY_LIKELY" - It is very likely. 4024 HeadwearLikelihood string `json:"headwearLikelihood,omitempty"` 4025 // JoyLikelihood: Joy likelihood. 4026 // 4027 // Possible values: 4028 // "UNKNOWN" - Unknown likelihood. 4029 // "VERY_UNLIKELY" - It is very unlikely. 4030 // "UNLIKELY" - It is unlikely. 4031 // "POSSIBLE" - It is possible. 4032 // "LIKELY" - It is likely. 4033 // "VERY_LIKELY" - It is very likely. 4034 JoyLikelihood string `json:"joyLikelihood,omitempty"` 4035 // LandmarkingConfidence: Face landmarking confidence. Range [0, 1]. 4036 LandmarkingConfidence float64 `json:"landmarkingConfidence,omitempty"` 4037 // Landmarks: Detected face landmarks. 4038 Landmarks []*GoogleCloudVisionV1p2beta1FaceAnnotationLandmark `json:"landmarks,omitempty"` 4039 // PanAngle: Yaw angle, which indicates the leftward/rightward angle that the 4040 // face is pointing relative to the vertical plane perpendicular to the image. 4041 // Range [-180,180]. 4042 PanAngle float64 `json:"panAngle,omitempty"` 4043 // RollAngle: Roll angle, which indicates the amount of 4044 // clockwise/anti-clockwise rotation of the face relative to the image vertical 4045 // about the axis perpendicular to the face. Range [-180,180]. 4046 RollAngle float64 `json:"rollAngle,omitempty"` 4047 // SorrowLikelihood: Sorrow likelihood. 4048 // 4049 // Possible values: 4050 // "UNKNOWN" - Unknown likelihood. 4051 // "VERY_UNLIKELY" - It is very unlikely. 4052 // "UNLIKELY" - It is unlikely. 4053 // "POSSIBLE" - It is possible. 4054 // "LIKELY" - It is likely. 4055 // "VERY_LIKELY" - It is very likely. 4056 SorrowLikelihood string `json:"sorrowLikelihood,omitempty"` 4057 // SurpriseLikelihood: Surprise likelihood. 4058 // 4059 // Possible values: 4060 // "UNKNOWN" - Unknown likelihood. 4061 // "VERY_UNLIKELY" - It is very unlikely. 4062 // "UNLIKELY" - It is unlikely. 4063 // "POSSIBLE" - It is possible. 4064 // "LIKELY" - It is likely. 4065 // "VERY_LIKELY" - It is very likely. 4066 SurpriseLikelihood string `json:"surpriseLikelihood,omitempty"` 4067 // TiltAngle: Pitch angle, which indicates the upwards/downwards angle that the 4068 // face is pointing relative to the image's horizontal plane. Range [-180,180]. 4069 TiltAngle float64 `json:"tiltAngle,omitempty"` 4070 // UnderExposedLikelihood: Under-exposed likelihood. 4071 // 4072 // Possible values: 4073 // "UNKNOWN" - Unknown likelihood. 4074 // "VERY_UNLIKELY" - It is very unlikely. 4075 // "UNLIKELY" - It is unlikely. 4076 // "POSSIBLE" - It is possible. 4077 // "LIKELY" - It is likely. 4078 // "VERY_LIKELY" - It is very likely. 4079 UnderExposedLikelihood string `json:"underExposedLikelihood,omitempty"` 4080 // ForceSendFields is a list of field names (e.g. "AngerLikelihood") to 4081 // unconditionally include in API requests. By default, fields with empty or 4082 // default values are omitted from API requests. See 4083 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4084 // details. 4085 ForceSendFields []string `json:"-"` 4086 // NullFields is a list of field names (e.g. "AngerLikelihood") to include in 4087 // API requests with the JSON null value. By default, fields with empty values 4088 // are omitted from API requests. See 4089 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4090 NullFields []string `json:"-"` 4091 } 4092 4093 func (s *GoogleCloudVisionV1p2beta1FaceAnnotation) MarshalJSON() ([]byte, error) { 4094 type NoMethod GoogleCloudVisionV1p2beta1FaceAnnotation 4095 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4096 } 4097 4098 func (s *GoogleCloudVisionV1p2beta1FaceAnnotation) UnmarshalJSON(data []byte) error { 4099 type NoMethod GoogleCloudVisionV1p2beta1FaceAnnotation 4100 var s1 struct { 4101 DetectionConfidence gensupport.JSONFloat64 `json:"detectionConfidence"` 4102 LandmarkingConfidence gensupport.JSONFloat64 `json:"landmarkingConfidence"` 4103 PanAngle gensupport.JSONFloat64 `json:"panAngle"` 4104 RollAngle gensupport.JSONFloat64 `json:"rollAngle"` 4105 TiltAngle gensupport.JSONFloat64 `json:"tiltAngle"` 4106 *NoMethod 4107 } 4108 s1.NoMethod = (*NoMethod)(s) 4109 if err := json.Unmarshal(data, &s1); err != nil { 4110 return err 4111 } 4112 s.DetectionConfidence = float64(s1.DetectionConfidence) 4113 s.LandmarkingConfidence = float64(s1.LandmarkingConfidence) 4114 s.PanAngle = float64(s1.PanAngle) 4115 s.RollAngle = float64(s1.RollAngle) 4116 s.TiltAngle = float64(s1.TiltAngle) 4117 return nil 4118 } 4119 4120 // GoogleCloudVisionV1p2beta1FaceAnnotationLandmark: A face-specific landmark 4121 // (for example, a face feature). 4122 type GoogleCloudVisionV1p2beta1FaceAnnotationLandmark struct { 4123 // Position: Face landmark position. 4124 Position *GoogleCloudVisionV1p2beta1Position `json:"position,omitempty"` 4125 // Type: Face landmark type. 4126 // 4127 // Possible values: 4128 // "UNKNOWN_LANDMARK" - Unknown face landmark detected. Should not be filled. 4129 // "LEFT_EYE" - Left eye. 4130 // "RIGHT_EYE" - Right eye. 4131 // "LEFT_OF_LEFT_EYEBROW" - Left of left eyebrow. 4132 // "RIGHT_OF_LEFT_EYEBROW" - Right of left eyebrow. 4133 // "LEFT_OF_RIGHT_EYEBROW" - Left of right eyebrow. 4134 // "RIGHT_OF_RIGHT_EYEBROW" - Right of right eyebrow. 4135 // "MIDPOINT_BETWEEN_EYES" - Midpoint between eyes. 4136 // "NOSE_TIP" - Nose tip. 4137 // "UPPER_LIP" - Upper lip. 4138 // "LOWER_LIP" - Lower lip. 4139 // "MOUTH_LEFT" - Mouth left. 4140 // "MOUTH_RIGHT" - Mouth right. 4141 // "MOUTH_CENTER" - Mouth center. 4142 // "NOSE_BOTTOM_RIGHT" - Nose, bottom right. 4143 // "NOSE_BOTTOM_LEFT" - Nose, bottom left. 4144 // "NOSE_BOTTOM_CENTER" - Nose, bottom center. 4145 // "LEFT_EYE_TOP_BOUNDARY" - Left eye, top boundary. 4146 // "LEFT_EYE_RIGHT_CORNER" - Left eye, right corner. 4147 // "LEFT_EYE_BOTTOM_BOUNDARY" - Left eye, bottom boundary. 4148 // "LEFT_EYE_LEFT_CORNER" - Left eye, left corner. 4149 // "RIGHT_EYE_TOP_BOUNDARY" - Right eye, top boundary. 4150 // "RIGHT_EYE_RIGHT_CORNER" - Right eye, right corner. 4151 // "RIGHT_EYE_BOTTOM_BOUNDARY" - Right eye, bottom boundary. 4152 // "RIGHT_EYE_LEFT_CORNER" - Right eye, left corner. 4153 // "LEFT_EYEBROW_UPPER_MIDPOINT" - Left eyebrow, upper midpoint. 4154 // "RIGHT_EYEBROW_UPPER_MIDPOINT" - Right eyebrow, upper midpoint. 4155 // "LEFT_EAR_TRAGION" - Left ear tragion. 4156 // "RIGHT_EAR_TRAGION" - Right ear tragion. 4157 // "LEFT_EYE_PUPIL" - Left eye pupil. 4158 // "RIGHT_EYE_PUPIL" - Right eye pupil. 4159 // "FOREHEAD_GLABELLA" - Forehead glabella. 4160 // "CHIN_GNATHION" - Chin gnathion. 4161 // "CHIN_LEFT_GONION" - Chin left gonion. 4162 // "CHIN_RIGHT_GONION" - Chin right gonion. 4163 // "LEFT_CHEEK_CENTER" - Left cheek center. 4164 // "RIGHT_CHEEK_CENTER" - Right cheek center. 4165 Type string `json:"type,omitempty"` 4166 // ForceSendFields is a list of field names (e.g. "Position") to 4167 // unconditionally include in API requests. By default, fields with empty or 4168 // default values are omitted from API requests. See 4169 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4170 // details. 4171 ForceSendFields []string `json:"-"` 4172 // NullFields is a list of field names (e.g. "Position") to include in API 4173 // requests with the JSON null value. By default, fields with empty values are 4174 // omitted from API requests. See 4175 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4176 NullFields []string `json:"-"` 4177 } 4178 4179 func (s *GoogleCloudVisionV1p2beta1FaceAnnotationLandmark) MarshalJSON() ([]byte, error) { 4180 type NoMethod GoogleCloudVisionV1p2beta1FaceAnnotationLandmark 4181 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4182 } 4183 4184 // GoogleCloudVisionV1p2beta1GcsDestination: The Google Cloud Storage location 4185 // where the output will be written to. 4186 type GoogleCloudVisionV1p2beta1GcsDestination struct { 4187 // Uri: Google Cloud Storage URI prefix where the results will be stored. 4188 // Results will be in JSON format and preceded by its corresponding input URI 4189 // prefix. This field can either represent a gcs file prefix or gcs directory. 4190 // In either case, the uri should be unique because in order to get all of the 4191 // output files, you will need to do a wildcard gcs search on the uri prefix 4192 // you provide. Examples: * File Prefix: gs://bucket-name/here/filenameprefix 4193 // The output files will be created in gs://bucket-name/here/ and the names of 4194 // the output files will begin with "filenameprefix". * Directory Prefix: 4195 // gs://bucket-name/some/location/ The output files will be created in 4196 // gs://bucket-name/some/location/ and the names of the output files could be 4197 // anything because there was no filename prefix specified. If multiple 4198 // outputs, each response is still AnnotateFileResponse, each of which contains 4199 // some subset of the full list of AnnotateImageResponse. Multiple outputs can 4200 // happen if, for example, the output JSON is too large and overflows into 4201 // multiple sharded files. 4202 Uri string `json:"uri,omitempty"` 4203 // ForceSendFields is a list of field names (e.g. "Uri") to unconditionally 4204 // include in API requests. By default, fields with empty or default values are 4205 // omitted from API requests. See 4206 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4207 // details. 4208 ForceSendFields []string `json:"-"` 4209 // NullFields is a list of field names (e.g. "Uri") to include in API requests 4210 // with the JSON null value. By default, fields with empty values are omitted 4211 // from API requests. See 4212 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4213 NullFields []string `json:"-"` 4214 } 4215 4216 func (s *GoogleCloudVisionV1p2beta1GcsDestination) MarshalJSON() ([]byte, error) { 4217 type NoMethod GoogleCloudVisionV1p2beta1GcsDestination 4218 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4219 } 4220 4221 // GoogleCloudVisionV1p2beta1GcsSource: The Google Cloud Storage location where 4222 // the input will be read from. 4223 type GoogleCloudVisionV1p2beta1GcsSource struct { 4224 // Uri: Google Cloud Storage URI for the input file. This must only be a Google 4225 // Cloud Storage object. Wildcards are not currently supported. 4226 Uri string `json:"uri,omitempty"` 4227 // ForceSendFields is a list of field names (e.g. "Uri") to unconditionally 4228 // include in API requests. By default, fields with empty or default values are 4229 // omitted from API requests. See 4230 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4231 // details. 4232 ForceSendFields []string `json:"-"` 4233 // NullFields is a list of field names (e.g. "Uri") to include in API requests 4234 // with the JSON null value. By default, fields with empty values are omitted 4235 // from API requests. See 4236 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4237 NullFields []string `json:"-"` 4238 } 4239 4240 func (s *GoogleCloudVisionV1p2beta1GcsSource) MarshalJSON() ([]byte, error) { 4241 type NoMethod GoogleCloudVisionV1p2beta1GcsSource 4242 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4243 } 4244 4245 // GoogleCloudVisionV1p2beta1ImageAnnotationContext: If an image was produced 4246 // from a file (e.g. a PDF), this message gives information about the source of 4247 // that image. 4248 type GoogleCloudVisionV1p2beta1ImageAnnotationContext struct { 4249 // PageNumber: If the file was a PDF or TIFF, this field gives the page number 4250 // within the file used to produce the image. 4251 PageNumber int64 `json:"pageNumber,omitempty"` 4252 // Uri: The URI of the file used to produce the image. 4253 Uri string `json:"uri,omitempty"` 4254 // ForceSendFields is a list of field names (e.g. "PageNumber") to 4255 // unconditionally include in API requests. By default, fields with empty or 4256 // default values are omitted from API requests. See 4257 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4258 // details. 4259 ForceSendFields []string `json:"-"` 4260 // NullFields is a list of field names (e.g. "PageNumber") to include in API 4261 // requests with the JSON null value. By default, fields with empty values are 4262 // omitted from API requests. See 4263 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4264 NullFields []string `json:"-"` 4265 } 4266 4267 func (s *GoogleCloudVisionV1p2beta1ImageAnnotationContext) MarshalJSON() ([]byte, error) { 4268 type NoMethod GoogleCloudVisionV1p2beta1ImageAnnotationContext 4269 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4270 } 4271 4272 // GoogleCloudVisionV1p2beta1ImageProperties: Stores image properties, such as 4273 // dominant colors. 4274 type GoogleCloudVisionV1p2beta1ImageProperties struct { 4275 // DominantColors: If present, dominant colors completed successfully. 4276 DominantColors *GoogleCloudVisionV1p2beta1DominantColorsAnnotation `json:"dominantColors,omitempty"` 4277 // ForceSendFields is a list of field names (e.g. "DominantColors") to 4278 // unconditionally include in API requests. By default, fields with empty or 4279 // default values are omitted from API requests. See 4280 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4281 // details. 4282 ForceSendFields []string `json:"-"` 4283 // NullFields is a list of field names (e.g. "DominantColors") to include in 4284 // API requests with the JSON null value. By default, fields with empty values 4285 // are omitted from API requests. See 4286 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4287 NullFields []string `json:"-"` 4288 } 4289 4290 func (s *GoogleCloudVisionV1p2beta1ImageProperties) MarshalJSON() ([]byte, error) { 4291 type NoMethod GoogleCloudVisionV1p2beta1ImageProperties 4292 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4293 } 4294 4295 // GoogleCloudVisionV1p2beta1InputConfig: The desired input location and 4296 // metadata. 4297 type GoogleCloudVisionV1p2beta1InputConfig struct { 4298 // Content: File content, represented as a stream of bytes. Note: As with all 4299 // `bytes` fields, protobuffers use a pure binary representation, whereas JSON 4300 // representations use base64. Currently, this field only works for 4301 // BatchAnnotateFiles requests. It does not work for AsyncBatchAnnotateFiles 4302 // requests. 4303 Content string `json:"content,omitempty"` 4304 // GcsSource: The Google Cloud Storage location to read the input from. 4305 GcsSource *GoogleCloudVisionV1p2beta1GcsSource `json:"gcsSource,omitempty"` 4306 // MimeType: The type of the file. Currently only "application/pdf", 4307 // "image/tiff" and "image/gif" are supported. Wildcards are not supported. 4308 MimeType string `json:"mimeType,omitempty"` 4309 // ForceSendFields is a list of field names (e.g. "Content") to unconditionally 4310 // include in API requests. By default, fields with empty or default values are 4311 // omitted from API requests. See 4312 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4313 // details. 4314 ForceSendFields []string `json:"-"` 4315 // NullFields is a list of field names (e.g. "Content") to include in API 4316 // requests with the JSON null value. By default, fields with empty values are 4317 // omitted from API requests. See 4318 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4319 NullFields []string `json:"-"` 4320 } 4321 4322 func (s *GoogleCloudVisionV1p2beta1InputConfig) MarshalJSON() ([]byte, error) { 4323 type NoMethod GoogleCloudVisionV1p2beta1InputConfig 4324 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4325 } 4326 4327 // GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation: Set of detected objects 4328 // with bounding boxes. 4329 type GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation struct { 4330 // BoundingPoly: Image region to which this object belongs. This must be 4331 // populated. 4332 BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"` 4333 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". For 4334 // more information, see 4335 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 4336 LanguageCode string `json:"languageCode,omitempty"` 4337 // Mid: Object ID that should align with EntityAnnotation mid. 4338 Mid string `json:"mid,omitempty"` 4339 // Name: Object name, expressed in its `language_code` language. 4340 Name string `json:"name,omitempty"` 4341 // Score: Score of the result. Range [0, 1]. 4342 Score float64 `json:"score,omitempty"` 4343 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 4344 // unconditionally include in API requests. By default, fields with empty or 4345 // default values are omitted from API requests. See 4346 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4347 // details. 4348 ForceSendFields []string `json:"-"` 4349 // NullFields is a list of field names (e.g. "BoundingPoly") to include in API 4350 // requests with the JSON null value. By default, fields with empty values are 4351 // omitted from API requests. See 4352 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4353 NullFields []string `json:"-"` 4354 } 4355 4356 func (s *GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation) MarshalJSON() ([]byte, error) { 4357 type NoMethod GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation 4358 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4359 } 4360 4361 func (s *GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation) UnmarshalJSON(data []byte) error { 4362 type NoMethod GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation 4363 var s1 struct { 4364 Score gensupport.JSONFloat64 `json:"score"` 4365 *NoMethod 4366 } 4367 s1.NoMethod = (*NoMethod)(s) 4368 if err := json.Unmarshal(data, &s1); err != nil { 4369 return err 4370 } 4371 s.Score = float64(s1.Score) 4372 return nil 4373 } 4374 4375 // GoogleCloudVisionV1p2beta1LocationInfo: Detected entity location 4376 // information. 4377 type GoogleCloudVisionV1p2beta1LocationInfo struct { 4378 // LatLng: lat/long location coordinates. 4379 LatLng *LatLng `json:"latLng,omitempty"` 4380 // ForceSendFields is a list of field names (e.g. "LatLng") to unconditionally 4381 // include in API requests. By default, fields with empty or default values are 4382 // omitted from API requests. See 4383 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4384 // details. 4385 ForceSendFields []string `json:"-"` 4386 // NullFields is a list of field names (e.g. "LatLng") to include in API 4387 // requests with the JSON null value. By default, fields with empty values are 4388 // omitted from API requests. See 4389 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4390 NullFields []string `json:"-"` 4391 } 4392 4393 func (s *GoogleCloudVisionV1p2beta1LocationInfo) MarshalJSON() ([]byte, error) { 4394 type NoMethod GoogleCloudVisionV1p2beta1LocationInfo 4395 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4396 } 4397 4398 // GoogleCloudVisionV1p2beta1NormalizedVertex: A vertex represents a 2D point 4399 // in the image. NOTE: the normalized vertex coordinates are relative to the 4400 // original image and range from 0 to 1. 4401 type GoogleCloudVisionV1p2beta1NormalizedVertex struct { 4402 // X: X coordinate. 4403 X float64 `json:"x,omitempty"` 4404 // Y: Y coordinate. 4405 Y float64 `json:"y,omitempty"` 4406 // ForceSendFields is a list of field names (e.g. "X") to unconditionally 4407 // include in API requests. By default, fields with empty or default values are 4408 // omitted from API requests. See 4409 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4410 // details. 4411 ForceSendFields []string `json:"-"` 4412 // NullFields is a list of field names (e.g. "X") to include in API requests 4413 // with the JSON null value. By default, fields with empty values are omitted 4414 // from API requests. See 4415 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4416 NullFields []string `json:"-"` 4417 } 4418 4419 func (s *GoogleCloudVisionV1p2beta1NormalizedVertex) MarshalJSON() ([]byte, error) { 4420 type NoMethod GoogleCloudVisionV1p2beta1NormalizedVertex 4421 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4422 } 4423 4424 func (s *GoogleCloudVisionV1p2beta1NormalizedVertex) UnmarshalJSON(data []byte) error { 4425 type NoMethod GoogleCloudVisionV1p2beta1NormalizedVertex 4426 var s1 struct { 4427 X gensupport.JSONFloat64 `json:"x"` 4428 Y gensupport.JSONFloat64 `json:"y"` 4429 *NoMethod 4430 } 4431 s1.NoMethod = (*NoMethod)(s) 4432 if err := json.Unmarshal(data, &s1); err != nil { 4433 return err 4434 } 4435 s.X = float64(s1.X) 4436 s.Y = float64(s1.Y) 4437 return nil 4438 } 4439 4440 // GoogleCloudVisionV1p2beta1OperationMetadata: Contains metadata for the 4441 // BatchAnnotateImages operation. 4442 type GoogleCloudVisionV1p2beta1OperationMetadata struct { 4443 // CreateTime: The time when the batch request was received. 4444 CreateTime string `json:"createTime,omitempty"` 4445 // State: Current state of the batch operation. 4446 // 4447 // Possible values: 4448 // "STATE_UNSPECIFIED" - Invalid. 4449 // "CREATED" - Request is received. 4450 // "RUNNING" - Request is actively being processed. 4451 // "DONE" - The batch processing is done. 4452 // "CANCELLED" - The batch processing was cancelled. 4453 State string `json:"state,omitempty"` 4454 // UpdateTime: The time when the operation result was last updated. 4455 UpdateTime string `json:"updateTime,omitempty"` 4456 // ForceSendFields is a list of field names (e.g. "CreateTime") to 4457 // unconditionally include in API requests. By default, fields with empty or 4458 // default values are omitted from API requests. See 4459 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4460 // details. 4461 ForceSendFields []string `json:"-"` 4462 // NullFields is a list of field names (e.g. "CreateTime") to include in API 4463 // requests with the JSON null value. By default, fields with empty values are 4464 // omitted from API requests. See 4465 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4466 NullFields []string `json:"-"` 4467 } 4468 4469 func (s *GoogleCloudVisionV1p2beta1OperationMetadata) MarshalJSON() ([]byte, error) { 4470 type NoMethod GoogleCloudVisionV1p2beta1OperationMetadata 4471 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4472 } 4473 4474 // GoogleCloudVisionV1p2beta1OutputConfig: The desired output location and 4475 // metadata. 4476 type GoogleCloudVisionV1p2beta1OutputConfig struct { 4477 // BatchSize: The max number of response protos to put into each output JSON 4478 // file on Google Cloud Storage. The valid range is [1, 100]. If not specified, 4479 // the default value is 20. For example, for one pdf file with 100 pages, 100 4480 // response protos will be generated. If `batch_size` = 20, then 5 json files 4481 // each containing 20 response protos will be written under the prefix 4482 // `gcs_destination`.`uri`. Currently, batch_size only applies to 4483 // GcsDestination, with potential future support for other output 4484 // configurations. 4485 BatchSize int64 `json:"batchSize,omitempty"` 4486 // GcsDestination: The Google Cloud Storage location to write the output(s) to. 4487 GcsDestination *GoogleCloudVisionV1p2beta1GcsDestination `json:"gcsDestination,omitempty"` 4488 // ForceSendFields is a list of field names (e.g. "BatchSize") to 4489 // unconditionally include in API requests. By default, fields with empty or 4490 // default values are omitted from API requests. See 4491 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4492 // details. 4493 ForceSendFields []string `json:"-"` 4494 // NullFields is a list of field names (e.g. "BatchSize") to include in API 4495 // requests with the JSON null value. By default, fields with empty values are 4496 // omitted from API requests. See 4497 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4498 NullFields []string `json:"-"` 4499 } 4500 4501 func (s *GoogleCloudVisionV1p2beta1OutputConfig) MarshalJSON() ([]byte, error) { 4502 type NoMethod GoogleCloudVisionV1p2beta1OutputConfig 4503 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4504 } 4505 4506 // GoogleCloudVisionV1p2beta1Page: Detected page from OCR. 4507 type GoogleCloudVisionV1p2beta1Page struct { 4508 // Blocks: List of blocks of text, images etc on this page. 4509 Blocks []*GoogleCloudVisionV1p2beta1Block `json:"blocks,omitempty"` 4510 // Confidence: Confidence of the OCR results on the page. Range [0, 1]. 4511 Confidence float64 `json:"confidence,omitempty"` 4512 // Height: Page height. For PDFs the unit is points. For images (including 4513 // TIFFs) the unit is pixels. 4514 Height int64 `json:"height,omitempty"` 4515 // Property: Additional information detected on the page. 4516 Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"` 4517 // Width: Page width. For PDFs the unit is points. For images (including TIFFs) 4518 // the unit is pixels. 4519 Width int64 `json:"width,omitempty"` 4520 // ForceSendFields is a list of field names (e.g. "Blocks") to unconditionally 4521 // include in API requests. By default, fields with empty or default values are 4522 // omitted from API requests. See 4523 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4524 // details. 4525 ForceSendFields []string `json:"-"` 4526 // NullFields is a list of field names (e.g. "Blocks") to include in API 4527 // requests with the JSON null value. By default, fields with empty values are 4528 // omitted from API requests. See 4529 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4530 NullFields []string `json:"-"` 4531 } 4532 4533 func (s *GoogleCloudVisionV1p2beta1Page) MarshalJSON() ([]byte, error) { 4534 type NoMethod GoogleCloudVisionV1p2beta1Page 4535 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4536 } 4537 4538 func (s *GoogleCloudVisionV1p2beta1Page) UnmarshalJSON(data []byte) error { 4539 type NoMethod GoogleCloudVisionV1p2beta1Page 4540 var s1 struct { 4541 Confidence gensupport.JSONFloat64 `json:"confidence"` 4542 *NoMethod 4543 } 4544 s1.NoMethod = (*NoMethod)(s) 4545 if err := json.Unmarshal(data, &s1); err != nil { 4546 return err 4547 } 4548 s.Confidence = float64(s1.Confidence) 4549 return nil 4550 } 4551 4552 // GoogleCloudVisionV1p2beta1Paragraph: Structural unit of text representing a 4553 // number of words in certain order. 4554 type GoogleCloudVisionV1p2beta1Paragraph struct { 4555 // BoundingBox: The bounding box for the paragraph. The vertices are in the 4556 // order of top-left, top-right, bottom-right, bottom-left. When a rotation of 4557 // the bounding box is detected the rotation is represented as around the 4558 // top-left corner as defined when the text is read in the 'natural' 4559 // orientation. For example: * when the text is horizontal it might look like: 4560 // 0----1 | | 3----2 * when it's rotated 180 degrees around the top-left corner 4561 // it becomes: 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 4562 // 3). 4563 BoundingBox *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingBox,omitempty"` 4564 // Confidence: Confidence of the OCR results for the paragraph. Range [0, 1]. 4565 Confidence float64 `json:"confidence,omitempty"` 4566 // Property: Additional information detected for the paragraph. 4567 Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"` 4568 // Words: List of all words in this paragraph. 4569 Words []*GoogleCloudVisionV1p2beta1Word `json:"words,omitempty"` 4570 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 4571 // unconditionally include in API requests. By default, fields with empty or 4572 // default values are omitted from API requests. See 4573 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4574 // details. 4575 ForceSendFields []string `json:"-"` 4576 // NullFields is a list of field names (e.g. "BoundingBox") to include in API 4577 // requests with the JSON null value. By default, fields with empty values are 4578 // omitted from API requests. See 4579 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4580 NullFields []string `json:"-"` 4581 } 4582 4583 func (s *GoogleCloudVisionV1p2beta1Paragraph) MarshalJSON() ([]byte, error) { 4584 type NoMethod GoogleCloudVisionV1p2beta1Paragraph 4585 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4586 } 4587 4588 func (s *GoogleCloudVisionV1p2beta1Paragraph) UnmarshalJSON(data []byte) error { 4589 type NoMethod GoogleCloudVisionV1p2beta1Paragraph 4590 var s1 struct { 4591 Confidence gensupport.JSONFloat64 `json:"confidence"` 4592 *NoMethod 4593 } 4594 s1.NoMethod = (*NoMethod)(s) 4595 if err := json.Unmarshal(data, &s1); err != nil { 4596 return err 4597 } 4598 s.Confidence = float64(s1.Confidence) 4599 return nil 4600 } 4601 4602 // GoogleCloudVisionV1p2beta1Position: A 3D position in the image, used 4603 // primarily for Face detection landmarks. A valid Position must have both x 4604 // and y coordinates. The position coordinates are in the same scale as the 4605 // original image. 4606 type GoogleCloudVisionV1p2beta1Position struct { 4607 // X: X coordinate. 4608 X float64 `json:"x,omitempty"` 4609 // Y: Y coordinate. 4610 Y float64 `json:"y,omitempty"` 4611 // Z: Z coordinate (or depth). 4612 Z float64 `json:"z,omitempty"` 4613 // ForceSendFields is a list of field names (e.g. "X") to unconditionally 4614 // include in API requests. By default, fields with empty or default values are 4615 // omitted from API requests. See 4616 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4617 // details. 4618 ForceSendFields []string `json:"-"` 4619 // NullFields is a list of field names (e.g. "X") to include in API requests 4620 // with the JSON null value. By default, fields with empty values are omitted 4621 // from API requests. See 4622 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4623 NullFields []string `json:"-"` 4624 } 4625 4626 func (s *GoogleCloudVisionV1p2beta1Position) MarshalJSON() ([]byte, error) { 4627 type NoMethod GoogleCloudVisionV1p2beta1Position 4628 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4629 } 4630 4631 func (s *GoogleCloudVisionV1p2beta1Position) UnmarshalJSON(data []byte) error { 4632 type NoMethod GoogleCloudVisionV1p2beta1Position 4633 var s1 struct { 4634 X gensupport.JSONFloat64 `json:"x"` 4635 Y gensupport.JSONFloat64 `json:"y"` 4636 Z gensupport.JSONFloat64 `json:"z"` 4637 *NoMethod 4638 } 4639 s1.NoMethod = (*NoMethod)(s) 4640 if err := json.Unmarshal(data, &s1); err != nil { 4641 return err 4642 } 4643 s.X = float64(s1.X) 4644 s.Y = float64(s1.Y) 4645 s.Z = float64(s1.Z) 4646 return nil 4647 } 4648 4649 // GoogleCloudVisionV1p2beta1Product: A Product contains ReferenceImages. 4650 type GoogleCloudVisionV1p2beta1Product struct { 4651 // Description: User-provided metadata to be stored with this product. Must be 4652 // at most 4096 characters long. 4653 Description string `json:"description,omitempty"` 4654 // DisplayName: The user-provided name for this Product. Must not be empty. 4655 // Must be at most 4096 characters long. 4656 DisplayName string `json:"displayName,omitempty"` 4657 // Name: The resource name of the product. Format is: 4658 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This field is 4659 // ignored when creating a product. 4660 Name string `json:"name,omitempty"` 4661 // ProductCategory: Immutable. The category for the product identified by the 4662 // reference image. This should be one of "homegoods-v2", "apparel-v2", 4663 // "toys-v2", "packagedgoods-v1" or "general-v1". The legacy categories 4664 // "homegoods", "apparel", and "toys" are still supported, but these should not 4665 // be used for new products. 4666 ProductCategory string `json:"productCategory,omitempty"` 4667 // ProductLabels: Key-value pairs that can be attached to a product. At query 4668 // time, constraints can be specified based on the product_labels. Note that 4669 // integer values can be provided as strings, e.g. "1199". Only strings with 4670 // integer values can match a range-based restriction which is to be supported 4671 // soon. Multiple values can be assigned to the same key. One product may have 4672 // up to 500 product_labels. Notice that the total number of distinct 4673 // product_labels over all products in one ProductSet cannot exceed 1M, 4674 // otherwise the product search pipeline will refuse to work for that 4675 // ProductSet. 4676 ProductLabels []*GoogleCloudVisionV1p2beta1ProductKeyValue `json:"productLabels,omitempty"` 4677 // ForceSendFields is a list of field names (e.g. "Description") to 4678 // unconditionally include in API requests. By default, fields with empty or 4679 // default values are omitted from API requests. See 4680 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4681 // details. 4682 ForceSendFields []string `json:"-"` 4683 // NullFields is a list of field names (e.g. "Description") to include in API 4684 // requests with the JSON null value. By default, fields with empty values are 4685 // omitted from API requests. See 4686 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4687 NullFields []string `json:"-"` 4688 } 4689 4690 func (s *GoogleCloudVisionV1p2beta1Product) MarshalJSON() ([]byte, error) { 4691 type NoMethod GoogleCloudVisionV1p2beta1Product 4692 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4693 } 4694 4695 // GoogleCloudVisionV1p2beta1ProductKeyValue: A product label represented as a 4696 // key-value pair. 4697 type GoogleCloudVisionV1p2beta1ProductKeyValue struct { 4698 // Key: The key of the label attached to the product. Cannot be empty and 4699 // cannot exceed 128 bytes. 4700 Key string `json:"key,omitempty"` 4701 // Value: The value of the label attached to the product. Cannot be empty and 4702 // cannot exceed 128 bytes. 4703 Value string `json:"value,omitempty"` 4704 // ForceSendFields is a list of field names (e.g. "Key") to unconditionally 4705 // include in API requests. By default, fields with empty or default values are 4706 // omitted from API requests. See 4707 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4708 // details. 4709 ForceSendFields []string `json:"-"` 4710 // NullFields is a list of field names (e.g. "Key") to include in API requests 4711 // with the JSON null value. By default, fields with empty values are omitted 4712 // from API requests. See 4713 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4714 NullFields []string `json:"-"` 4715 } 4716 4717 func (s *GoogleCloudVisionV1p2beta1ProductKeyValue) MarshalJSON() ([]byte, error) { 4718 type NoMethod GoogleCloudVisionV1p2beta1ProductKeyValue 4719 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4720 } 4721 4722 // GoogleCloudVisionV1p2beta1ProductSearchResults: Results for a product search 4723 // request. 4724 type GoogleCloudVisionV1p2beta1ProductSearchResults struct { 4725 // IndexTime: Timestamp of the index which provided these results. Products 4726 // added to the product set and products removed from the product set after 4727 // this time are not reflected in the current results. 4728 IndexTime string `json:"indexTime,omitempty"` 4729 // ProductGroupedResults: List of results grouped by products detected in the 4730 // query image. Each entry corresponds to one bounding polygon in the query 4731 // image, and contains the matching products specific to that region. There may 4732 // be duplicate product matches in the union of all the per-product results. 4733 ProductGroupedResults []*GoogleCloudVisionV1p2beta1ProductSearchResultsGroupedResult `json:"productGroupedResults,omitempty"` 4734 // Results: List of results, one for each product match. 4735 Results []*GoogleCloudVisionV1p2beta1ProductSearchResultsResult `json:"results,omitempty"` 4736 // ForceSendFields is a list of field names (e.g. "IndexTime") to 4737 // unconditionally include in API requests. By default, fields with empty or 4738 // default values are omitted from API requests. See 4739 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4740 // details. 4741 ForceSendFields []string `json:"-"` 4742 // NullFields is a list of field names (e.g. "IndexTime") to include in API 4743 // requests with the JSON null value. By default, fields with empty values are 4744 // omitted from API requests. See 4745 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4746 NullFields []string `json:"-"` 4747 } 4748 4749 func (s *GoogleCloudVisionV1p2beta1ProductSearchResults) MarshalJSON() ([]byte, error) { 4750 type NoMethod GoogleCloudVisionV1p2beta1ProductSearchResults 4751 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4752 } 4753 4754 // GoogleCloudVisionV1p2beta1ProductSearchResultsGroupedResult: Information 4755 // about the products similar to a single product in a query image. 4756 type GoogleCloudVisionV1p2beta1ProductSearchResultsGroupedResult struct { 4757 // BoundingPoly: The bounding polygon around the product detected in the query 4758 // image. 4759 BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"` 4760 // ObjectAnnotations: List of generic predictions for the object in the 4761 // bounding box. 4762 ObjectAnnotations []*GoogleCloudVisionV1p2beta1ProductSearchResultsObjectAnnotation `json:"objectAnnotations,omitempty"` 4763 // Results: List of results, one for each product match. 4764 Results []*GoogleCloudVisionV1p2beta1ProductSearchResultsResult `json:"results,omitempty"` 4765 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 4766 // unconditionally include in API requests. By default, fields with empty or 4767 // default values are omitted from API requests. See 4768 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4769 // details. 4770 ForceSendFields []string `json:"-"` 4771 // NullFields is a list of field names (e.g. "BoundingPoly") to include in API 4772 // requests with the JSON null value. By default, fields with empty values are 4773 // omitted from API requests. See 4774 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4775 NullFields []string `json:"-"` 4776 } 4777 4778 func (s *GoogleCloudVisionV1p2beta1ProductSearchResultsGroupedResult) MarshalJSON() ([]byte, error) { 4779 type NoMethod GoogleCloudVisionV1p2beta1ProductSearchResultsGroupedResult 4780 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4781 } 4782 4783 // GoogleCloudVisionV1p2beta1ProductSearchResultsObjectAnnotation: Prediction 4784 // for what the object in the bounding box is. 4785 type GoogleCloudVisionV1p2beta1ProductSearchResultsObjectAnnotation struct { 4786 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". For 4787 // more information, see 4788 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 4789 LanguageCode string `json:"languageCode,omitempty"` 4790 // Mid: Object ID that should align with EntityAnnotation mid. 4791 Mid string `json:"mid,omitempty"` 4792 // Name: Object name, expressed in its `language_code` language. 4793 Name string `json:"name,omitempty"` 4794 // Score: Score of the result. Range [0, 1]. 4795 Score float64 `json:"score,omitempty"` 4796 // ForceSendFields is a list of field names (e.g. "LanguageCode") to 4797 // unconditionally include in API requests. By default, fields with empty or 4798 // default values are omitted from API requests. See 4799 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4800 // details. 4801 ForceSendFields []string `json:"-"` 4802 // NullFields is a list of field names (e.g. "LanguageCode") to include in API 4803 // requests with the JSON null value. By default, fields with empty values are 4804 // omitted from API requests. See 4805 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4806 NullFields []string `json:"-"` 4807 } 4808 4809 func (s *GoogleCloudVisionV1p2beta1ProductSearchResultsObjectAnnotation) MarshalJSON() ([]byte, error) { 4810 type NoMethod GoogleCloudVisionV1p2beta1ProductSearchResultsObjectAnnotation 4811 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4812 } 4813 4814 func (s *GoogleCloudVisionV1p2beta1ProductSearchResultsObjectAnnotation) UnmarshalJSON(data []byte) error { 4815 type NoMethod GoogleCloudVisionV1p2beta1ProductSearchResultsObjectAnnotation 4816 var s1 struct { 4817 Score gensupport.JSONFloat64 `json:"score"` 4818 *NoMethod 4819 } 4820 s1.NoMethod = (*NoMethod)(s) 4821 if err := json.Unmarshal(data, &s1); err != nil { 4822 return err 4823 } 4824 s.Score = float64(s1.Score) 4825 return nil 4826 } 4827 4828 // GoogleCloudVisionV1p2beta1ProductSearchResultsResult: Information about a 4829 // product. 4830 type GoogleCloudVisionV1p2beta1ProductSearchResultsResult struct { 4831 // Image: The resource name of the image from the product that is the closest 4832 // match to the query. 4833 Image string `json:"image,omitempty"` 4834 // Product: The Product. 4835 Product *GoogleCloudVisionV1p2beta1Product `json:"product,omitempty"` 4836 // Score: A confidence level on the match, ranging from 0 (no confidence) to 1 4837 // (full confidence). 4838 Score float64 `json:"score,omitempty"` 4839 // ForceSendFields is a list of field names (e.g. "Image") to unconditionally 4840 // include in API requests. By default, fields with empty or default values are 4841 // omitted from API requests. See 4842 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4843 // details. 4844 ForceSendFields []string `json:"-"` 4845 // NullFields is a list of field names (e.g. "Image") to include in API 4846 // requests with the JSON null value. By default, fields with empty values are 4847 // omitted from API requests. See 4848 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4849 NullFields []string `json:"-"` 4850 } 4851 4852 func (s *GoogleCloudVisionV1p2beta1ProductSearchResultsResult) MarshalJSON() ([]byte, error) { 4853 type NoMethod GoogleCloudVisionV1p2beta1ProductSearchResultsResult 4854 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4855 } 4856 4857 func (s *GoogleCloudVisionV1p2beta1ProductSearchResultsResult) UnmarshalJSON(data []byte) error { 4858 type NoMethod GoogleCloudVisionV1p2beta1ProductSearchResultsResult 4859 var s1 struct { 4860 Score gensupport.JSONFloat64 `json:"score"` 4861 *NoMethod 4862 } 4863 s1.NoMethod = (*NoMethod)(s) 4864 if err := json.Unmarshal(data, &s1); err != nil { 4865 return err 4866 } 4867 s.Score = float64(s1.Score) 4868 return nil 4869 } 4870 4871 // GoogleCloudVisionV1p2beta1Property: A `Property` consists of a user-supplied 4872 // name/value pair. 4873 type GoogleCloudVisionV1p2beta1Property struct { 4874 // Name: Name of the property. 4875 Name string `json:"name,omitempty"` 4876 // Uint64Value: Value of numeric properties. 4877 Uint64Value uint64 `json:"uint64Value,omitempty,string"` 4878 // Value: Value of the property. 4879 Value string `json:"value,omitempty"` 4880 // ForceSendFields is a list of field names (e.g. "Name") to unconditionally 4881 // include in API requests. By default, fields with empty or default values are 4882 // omitted from API requests. See 4883 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4884 // details. 4885 ForceSendFields []string `json:"-"` 4886 // NullFields is a list of field names (e.g. "Name") to include in API requests 4887 // with the JSON null value. By default, fields with empty values are omitted 4888 // from API requests. See 4889 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4890 NullFields []string `json:"-"` 4891 } 4892 4893 func (s *GoogleCloudVisionV1p2beta1Property) MarshalJSON() ([]byte, error) { 4894 type NoMethod GoogleCloudVisionV1p2beta1Property 4895 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4896 } 4897 4898 // GoogleCloudVisionV1p2beta1SafeSearchAnnotation: Set of features pertaining 4899 // to the image, computed by computer vision methods over safe-search verticals 4900 // (for example, adult, spoof, medical, violence). 4901 type GoogleCloudVisionV1p2beta1SafeSearchAnnotation struct { 4902 // Adult: Represents the adult content likelihood for the image. Adult content 4903 // may contain elements such as nudity, pornographic images or cartoons, or 4904 // sexual activities. 4905 // 4906 // Possible values: 4907 // "UNKNOWN" - Unknown likelihood. 4908 // "VERY_UNLIKELY" - It is very unlikely. 4909 // "UNLIKELY" - It is unlikely. 4910 // "POSSIBLE" - It is possible. 4911 // "LIKELY" - It is likely. 4912 // "VERY_LIKELY" - It is very likely. 4913 Adult string `json:"adult,omitempty"` 4914 // Medical: Likelihood that this is a medical image. 4915 // 4916 // Possible values: 4917 // "UNKNOWN" - Unknown likelihood. 4918 // "VERY_UNLIKELY" - It is very unlikely. 4919 // "UNLIKELY" - It is unlikely. 4920 // "POSSIBLE" - It is possible. 4921 // "LIKELY" - It is likely. 4922 // "VERY_LIKELY" - It is very likely. 4923 Medical string `json:"medical,omitempty"` 4924 // Racy: Likelihood that the request image contains racy content. Racy content 4925 // may include (but is not limited to) skimpy or sheer clothing, strategically 4926 // covered nudity, lewd or provocative poses, or close-ups of sensitive body 4927 // areas. 4928 // 4929 // Possible values: 4930 // "UNKNOWN" - Unknown likelihood. 4931 // "VERY_UNLIKELY" - It is very unlikely. 4932 // "UNLIKELY" - It is unlikely. 4933 // "POSSIBLE" - It is possible. 4934 // "LIKELY" - It is likely. 4935 // "VERY_LIKELY" - It is very likely. 4936 Racy string `json:"racy,omitempty"` 4937 // Spoof: Spoof likelihood. The likelihood that an modification was made to the 4938 // image's canonical version to make it appear funny or offensive. 4939 // 4940 // Possible values: 4941 // "UNKNOWN" - Unknown likelihood. 4942 // "VERY_UNLIKELY" - It is very unlikely. 4943 // "UNLIKELY" - It is unlikely. 4944 // "POSSIBLE" - It is possible. 4945 // "LIKELY" - It is likely. 4946 // "VERY_LIKELY" - It is very likely. 4947 Spoof string `json:"spoof,omitempty"` 4948 // Violence: Likelihood that this image contains violent content. Violent 4949 // content may include death, serious harm, or injury to individuals or groups 4950 // of individuals. 4951 // 4952 // Possible values: 4953 // "UNKNOWN" - Unknown likelihood. 4954 // "VERY_UNLIKELY" - It is very unlikely. 4955 // "UNLIKELY" - It is unlikely. 4956 // "POSSIBLE" - It is possible. 4957 // "LIKELY" - It is likely. 4958 // "VERY_LIKELY" - It is very likely. 4959 Violence string `json:"violence,omitempty"` 4960 // ForceSendFields is a list of field names (e.g. "Adult") to unconditionally 4961 // include in API requests. By default, fields with empty or default values are 4962 // omitted from API requests. See 4963 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4964 // details. 4965 ForceSendFields []string `json:"-"` 4966 // NullFields is a list of field names (e.g. "Adult") to include in API 4967 // requests with the JSON null value. By default, fields with empty values are 4968 // omitted from API requests. See 4969 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4970 NullFields []string `json:"-"` 4971 } 4972 4973 func (s *GoogleCloudVisionV1p2beta1SafeSearchAnnotation) MarshalJSON() ([]byte, error) { 4974 type NoMethod GoogleCloudVisionV1p2beta1SafeSearchAnnotation 4975 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4976 } 4977 4978 // GoogleCloudVisionV1p2beta1Symbol: A single symbol representation. 4979 type GoogleCloudVisionV1p2beta1Symbol struct { 4980 // BoundingBox: The bounding box for the symbol. The vertices are in the order 4981 // of top-left, top-right, bottom-right, bottom-left. When a rotation of the 4982 // bounding box is detected the rotation is represented as around the top-left 4983 // corner as defined when the text is read in the 'natural' orientation. For 4984 // example: * when the text is horizontal it might look like: 0----1 | | 3----2 4985 // * when it's rotated 180 degrees around the top-left corner it becomes: 4986 // 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 3). 4987 BoundingBox *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingBox,omitempty"` 4988 // Confidence: Confidence of the OCR results for the symbol. Range [0, 1]. 4989 Confidence float64 `json:"confidence,omitempty"` 4990 // Property: Additional information detected for the symbol. 4991 Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"` 4992 // Text: The actual UTF-8 representation of the symbol. 4993 Text string `json:"text,omitempty"` 4994 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 4995 // unconditionally include in API requests. By default, fields with empty or 4996 // default values are omitted from API requests. See 4997 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4998 // details. 4999 ForceSendFields []string `json:"-"` 5000 // NullFields is a list of field names (e.g. "BoundingBox") to include in API 5001 // requests with the JSON null value. By default, fields with empty values are 5002 // omitted from API requests. See 5003 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5004 NullFields []string `json:"-"` 5005 } 5006 5007 func (s *GoogleCloudVisionV1p2beta1Symbol) MarshalJSON() ([]byte, error) { 5008 type NoMethod GoogleCloudVisionV1p2beta1Symbol 5009 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5010 } 5011 5012 func (s *GoogleCloudVisionV1p2beta1Symbol) UnmarshalJSON(data []byte) error { 5013 type NoMethod GoogleCloudVisionV1p2beta1Symbol 5014 var s1 struct { 5015 Confidence gensupport.JSONFloat64 `json:"confidence"` 5016 *NoMethod 5017 } 5018 s1.NoMethod = (*NoMethod)(s) 5019 if err := json.Unmarshal(data, &s1); err != nil { 5020 return err 5021 } 5022 s.Confidence = float64(s1.Confidence) 5023 return nil 5024 } 5025 5026 // GoogleCloudVisionV1p2beta1TextAnnotation: TextAnnotation contains a 5027 // structured representation of OCR extracted text. The hierarchy of an OCR 5028 // extracted text structure is like this: TextAnnotation -> Page -> Block -> 5029 // Paragraph -> Word -> Symbol Each structural component, starting from Page, 5030 // may further have their own properties. Properties describe detected 5031 // languages, breaks etc.. Please refer to the TextAnnotation.TextProperty 5032 // message definition below for more detail. 5033 type GoogleCloudVisionV1p2beta1TextAnnotation struct { 5034 // Pages: List of pages detected by OCR. 5035 Pages []*GoogleCloudVisionV1p2beta1Page `json:"pages,omitempty"` 5036 // Text: UTF-8 text detected on the pages. 5037 Text string `json:"text,omitempty"` 5038 // ForceSendFields is a list of field names (e.g. "Pages") to unconditionally 5039 // include in API requests. By default, fields with empty or default values are 5040 // omitted from API requests. See 5041 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5042 // details. 5043 ForceSendFields []string `json:"-"` 5044 // NullFields is a list of field names (e.g. "Pages") to include in API 5045 // requests with the JSON null value. By default, fields with empty values are 5046 // omitted from API requests. See 5047 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5048 NullFields []string `json:"-"` 5049 } 5050 5051 func (s *GoogleCloudVisionV1p2beta1TextAnnotation) MarshalJSON() ([]byte, error) { 5052 type NoMethod GoogleCloudVisionV1p2beta1TextAnnotation 5053 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5054 } 5055 5056 // GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak: Detected start or end 5057 // of a structural component. 5058 type GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak struct { 5059 // IsPrefix: True if break prepends the element. 5060 IsPrefix bool `json:"isPrefix,omitempty"` 5061 // Type: Detected break type. 5062 // 5063 // Possible values: 5064 // "UNKNOWN" - Unknown break label type. 5065 // "SPACE" - Regular space. 5066 // "SURE_SPACE" - Sure space (very wide). 5067 // "EOL_SURE_SPACE" - Line-wrapping break. 5068 // "HYPHEN" - End-line hyphen that is not present in text; does not co-occur 5069 // with `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. 5070 // "LINE_BREAK" - Line break that ends a paragraph. 5071 Type string `json:"type,omitempty"` 5072 // ForceSendFields is a list of field names (e.g. "IsPrefix") to 5073 // unconditionally include in API requests. By default, fields with empty or 5074 // default values are omitted from API requests. See 5075 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5076 // details. 5077 ForceSendFields []string `json:"-"` 5078 // NullFields is a list of field names (e.g. "IsPrefix") to include in API 5079 // requests with the JSON null value. By default, fields with empty values are 5080 // omitted from API requests. See 5081 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5082 NullFields []string `json:"-"` 5083 } 5084 5085 func (s *GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak) MarshalJSON() ([]byte, error) { 5086 type NoMethod GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak 5087 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5088 } 5089 5090 // GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage: Detected language 5091 // for a structural component. 5092 type GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage struct { 5093 // Confidence: Confidence of detected language. Range [0, 1]. 5094 Confidence float64 `json:"confidence,omitempty"` 5095 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". For 5096 // more information, see 5097 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 5098 LanguageCode string `json:"languageCode,omitempty"` 5099 // ForceSendFields is a list of field names (e.g. "Confidence") to 5100 // unconditionally include in API requests. By default, fields with empty or 5101 // default values are omitted from API requests. See 5102 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5103 // details. 5104 ForceSendFields []string `json:"-"` 5105 // NullFields is a list of field names (e.g. "Confidence") to include in API 5106 // requests with the JSON null value. By default, fields with empty values are 5107 // omitted from API requests. See 5108 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5109 NullFields []string `json:"-"` 5110 } 5111 5112 func (s *GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage) MarshalJSON() ([]byte, error) { 5113 type NoMethod GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage 5114 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5115 } 5116 5117 func (s *GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage) UnmarshalJSON(data []byte) error { 5118 type NoMethod GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage 5119 var s1 struct { 5120 Confidence gensupport.JSONFloat64 `json:"confidence"` 5121 *NoMethod 5122 } 5123 s1.NoMethod = (*NoMethod)(s) 5124 if err := json.Unmarshal(data, &s1); err != nil { 5125 return err 5126 } 5127 s.Confidence = float64(s1.Confidence) 5128 return nil 5129 } 5130 5131 // GoogleCloudVisionV1p2beta1TextAnnotationTextProperty: Additional information 5132 // detected on the structural component. 5133 type GoogleCloudVisionV1p2beta1TextAnnotationTextProperty struct { 5134 // DetectedBreak: Detected start or end of a text segment. 5135 DetectedBreak *GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak `json:"detectedBreak,omitempty"` 5136 // DetectedLanguages: A list of detected languages together with confidence. 5137 DetectedLanguages []*GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage `json:"detectedLanguages,omitempty"` 5138 // ForceSendFields is a list of field names (e.g. "DetectedBreak") to 5139 // unconditionally include in API requests. By default, fields with empty or 5140 // default values are omitted from API requests. See 5141 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5142 // details. 5143 ForceSendFields []string `json:"-"` 5144 // NullFields is a list of field names (e.g. "DetectedBreak") to include in API 5145 // requests with the JSON null value. By default, fields with empty values are 5146 // omitted from API requests. See 5147 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5148 NullFields []string `json:"-"` 5149 } 5150 5151 func (s *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty) MarshalJSON() ([]byte, error) { 5152 type NoMethod GoogleCloudVisionV1p2beta1TextAnnotationTextProperty 5153 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5154 } 5155 5156 // GoogleCloudVisionV1p2beta1Vertex: A vertex represents a 2D point in the 5157 // image. NOTE: the vertex coordinates are in the same scale as the original 5158 // image. 5159 type GoogleCloudVisionV1p2beta1Vertex struct { 5160 // X: X coordinate. 5161 X int64 `json:"x,omitempty"` 5162 // Y: Y coordinate. 5163 Y int64 `json:"y,omitempty"` 5164 // ForceSendFields is a list of field names (e.g. "X") to unconditionally 5165 // include in API requests. By default, fields with empty or default values are 5166 // omitted from API requests. See 5167 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5168 // details. 5169 ForceSendFields []string `json:"-"` 5170 // NullFields is a list of field names (e.g. "X") to include in API requests 5171 // with the JSON null value. By default, fields with empty values are omitted 5172 // from API requests. See 5173 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5174 NullFields []string `json:"-"` 5175 } 5176 5177 func (s *GoogleCloudVisionV1p2beta1Vertex) MarshalJSON() ([]byte, error) { 5178 type NoMethod GoogleCloudVisionV1p2beta1Vertex 5179 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5180 } 5181 5182 // GoogleCloudVisionV1p2beta1WebDetection: Relevant information for the image 5183 // from the Internet. 5184 type GoogleCloudVisionV1p2beta1WebDetection struct { 5185 // BestGuessLabels: The service's best guess as to the topic of the request 5186 // image. Inferred from similar images on the open web. 5187 BestGuessLabels []*GoogleCloudVisionV1p2beta1WebDetectionWebLabel `json:"bestGuessLabels,omitempty"` 5188 // FullMatchingImages: Fully matching images from the Internet. Can include 5189 // resized copies of the query image. 5190 FullMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"` 5191 // PagesWithMatchingImages: Web pages containing the matching images from the 5192 // Internet. 5193 PagesWithMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebPage `json:"pagesWithMatchingImages,omitempty"` 5194 // PartialMatchingImages: Partial matching images from the Internet. Those 5195 // images are similar enough to share some key-point features. For example an 5196 // original image will likely have partial matching for its crops. 5197 PartialMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"` 5198 // VisuallySimilarImages: The visually similar image results. 5199 VisuallySimilarImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"visuallySimilarImages,omitempty"` 5200 // WebEntities: Deduced entities from similar images on the Internet. 5201 WebEntities []*GoogleCloudVisionV1p2beta1WebDetectionWebEntity `json:"webEntities,omitempty"` 5202 // ForceSendFields is a list of field names (e.g. "BestGuessLabels") to 5203 // unconditionally include in API requests. By default, fields with empty or 5204 // default values are omitted from API requests. See 5205 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5206 // details. 5207 ForceSendFields []string `json:"-"` 5208 // NullFields is a list of field names (e.g. "BestGuessLabels") to include in 5209 // API requests with the JSON null value. By default, fields with empty values 5210 // are omitted from API requests. See 5211 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5212 NullFields []string `json:"-"` 5213 } 5214 5215 func (s *GoogleCloudVisionV1p2beta1WebDetection) MarshalJSON() ([]byte, error) { 5216 type NoMethod GoogleCloudVisionV1p2beta1WebDetection 5217 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5218 } 5219 5220 // GoogleCloudVisionV1p2beta1WebDetectionWebEntity: Entity deduced from similar 5221 // images on the Internet. 5222 type GoogleCloudVisionV1p2beta1WebDetectionWebEntity struct { 5223 // Description: Canonical description of the entity, in English. 5224 Description string `json:"description,omitempty"` 5225 // EntityId: Opaque entity ID. 5226 EntityId string `json:"entityId,omitempty"` 5227 // Score: Overall relevancy score for the entity. Not normalized and not 5228 // comparable across different image queries. 5229 Score float64 `json:"score,omitempty"` 5230 // ForceSendFields is a list of field names (e.g. "Description") to 5231 // unconditionally include in API requests. By default, fields with empty or 5232 // default values are omitted from API requests. See 5233 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5234 // details. 5235 ForceSendFields []string `json:"-"` 5236 // NullFields is a list of field names (e.g. "Description") to include in API 5237 // requests with the JSON null value. By default, fields with empty values are 5238 // omitted from API requests. See 5239 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5240 NullFields []string `json:"-"` 5241 } 5242 5243 func (s *GoogleCloudVisionV1p2beta1WebDetectionWebEntity) MarshalJSON() ([]byte, error) { 5244 type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebEntity 5245 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5246 } 5247 5248 func (s *GoogleCloudVisionV1p2beta1WebDetectionWebEntity) UnmarshalJSON(data []byte) error { 5249 type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebEntity 5250 var s1 struct { 5251 Score gensupport.JSONFloat64 `json:"score"` 5252 *NoMethod 5253 } 5254 s1.NoMethod = (*NoMethod)(s) 5255 if err := json.Unmarshal(data, &s1); err != nil { 5256 return err 5257 } 5258 s.Score = float64(s1.Score) 5259 return nil 5260 } 5261 5262 // GoogleCloudVisionV1p2beta1WebDetectionWebImage: Metadata for online images. 5263 type GoogleCloudVisionV1p2beta1WebDetectionWebImage struct { 5264 // Score: (Deprecated) Overall relevancy score for the image. 5265 Score float64 `json:"score,omitempty"` 5266 // Url: The result image URL. 5267 Url string `json:"url,omitempty"` 5268 // ForceSendFields is a list of field names (e.g. "Score") to unconditionally 5269 // include in API requests. By default, fields with empty or default values are 5270 // omitted from API requests. See 5271 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5272 // details. 5273 ForceSendFields []string `json:"-"` 5274 // NullFields is a list of field names (e.g. "Score") to include in API 5275 // requests with the JSON null value. By default, fields with empty values are 5276 // omitted from API requests. See 5277 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5278 NullFields []string `json:"-"` 5279 } 5280 5281 func (s *GoogleCloudVisionV1p2beta1WebDetectionWebImage) MarshalJSON() ([]byte, error) { 5282 type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebImage 5283 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5284 } 5285 5286 func (s *GoogleCloudVisionV1p2beta1WebDetectionWebImage) UnmarshalJSON(data []byte) error { 5287 type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebImage 5288 var s1 struct { 5289 Score gensupport.JSONFloat64 `json:"score"` 5290 *NoMethod 5291 } 5292 s1.NoMethod = (*NoMethod)(s) 5293 if err := json.Unmarshal(data, &s1); err != nil { 5294 return err 5295 } 5296 s.Score = float64(s1.Score) 5297 return nil 5298 } 5299 5300 // GoogleCloudVisionV1p2beta1WebDetectionWebLabel: Label to provide extra 5301 // metadata for the web detection. 5302 type GoogleCloudVisionV1p2beta1WebDetectionWebLabel struct { 5303 // Label: Label for extra metadata. 5304 Label string `json:"label,omitempty"` 5305 // LanguageCode: The BCP-47 language code for `label`, such as "en-US" or 5306 // "sr-Latn". For more information, see 5307 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 5308 LanguageCode string `json:"languageCode,omitempty"` 5309 // ForceSendFields is a list of field names (e.g. "Label") to unconditionally 5310 // include in API requests. By default, fields with empty or default values are 5311 // omitted from API requests. See 5312 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5313 // details. 5314 ForceSendFields []string `json:"-"` 5315 // NullFields is a list of field names (e.g. "Label") to include in API 5316 // requests with the JSON null value. By default, fields with empty values are 5317 // omitted from API requests. See 5318 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5319 NullFields []string `json:"-"` 5320 } 5321 5322 func (s *GoogleCloudVisionV1p2beta1WebDetectionWebLabel) MarshalJSON() ([]byte, error) { 5323 type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebLabel 5324 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5325 } 5326 5327 // GoogleCloudVisionV1p2beta1WebDetectionWebPage: Metadata for web pages. 5328 type GoogleCloudVisionV1p2beta1WebDetectionWebPage struct { 5329 // FullMatchingImages: Fully matching images on the page. Can include resized 5330 // copies of the query image. 5331 FullMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"` 5332 // PageTitle: Title for the web page, may contain HTML markups. 5333 PageTitle string `json:"pageTitle,omitempty"` 5334 // PartialMatchingImages: Partial matching images on the page. Those images are 5335 // similar enough to share some key-point features. For example an original 5336 // image will likely have partial matching for its crops. 5337 PartialMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"` 5338 // Score: (Deprecated) Overall relevancy score for the web page. 5339 Score float64 `json:"score,omitempty"` 5340 // Url: The result web page URL. 5341 Url string `json:"url,omitempty"` 5342 // ForceSendFields is a list of field names (e.g. "FullMatchingImages") to 5343 // unconditionally include in API requests. By default, fields with empty or 5344 // default values are omitted from API requests. See 5345 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5346 // details. 5347 ForceSendFields []string `json:"-"` 5348 // NullFields is a list of field names (e.g. "FullMatchingImages") to include 5349 // in API requests with the JSON null value. By default, fields with empty 5350 // values are omitted from API requests. See 5351 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5352 NullFields []string `json:"-"` 5353 } 5354 5355 func (s *GoogleCloudVisionV1p2beta1WebDetectionWebPage) MarshalJSON() ([]byte, error) { 5356 type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebPage 5357 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5358 } 5359 5360 func (s *GoogleCloudVisionV1p2beta1WebDetectionWebPage) UnmarshalJSON(data []byte) error { 5361 type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebPage 5362 var s1 struct { 5363 Score gensupport.JSONFloat64 `json:"score"` 5364 *NoMethod 5365 } 5366 s1.NoMethod = (*NoMethod)(s) 5367 if err := json.Unmarshal(data, &s1); err != nil { 5368 return err 5369 } 5370 s.Score = float64(s1.Score) 5371 return nil 5372 } 5373 5374 // GoogleCloudVisionV1p2beta1Word: A word representation. 5375 type GoogleCloudVisionV1p2beta1Word struct { 5376 // BoundingBox: The bounding box for the word. The vertices are in the order of 5377 // top-left, top-right, bottom-right, bottom-left. When a rotation of the 5378 // bounding box is detected the rotation is represented as around the top-left 5379 // corner as defined when the text is read in the 'natural' orientation. For 5380 // example: * when the text is horizontal it might look like: 0----1 | | 3----2 5381 // * when it's rotated 180 degrees around the top-left corner it becomes: 5382 // 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 3). 5383 BoundingBox *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingBox,omitempty"` 5384 // Confidence: Confidence of the OCR results for the word. Range [0, 1]. 5385 Confidence float64 `json:"confidence,omitempty"` 5386 // Property: Additional information detected for the word. 5387 Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"` 5388 // Symbols: List of symbols in the word. The order of the symbols follows the 5389 // natural reading order. 5390 Symbols []*GoogleCloudVisionV1p2beta1Symbol `json:"symbols,omitempty"` 5391 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 5392 // unconditionally include in API requests. By default, fields with empty or 5393 // default values are omitted from API requests. See 5394 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5395 // details. 5396 ForceSendFields []string `json:"-"` 5397 // NullFields is a list of field names (e.g. "BoundingBox") to include in API 5398 // requests with the JSON null value. By default, fields with empty values are 5399 // omitted from API requests. See 5400 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5401 NullFields []string `json:"-"` 5402 } 5403 5404 func (s *GoogleCloudVisionV1p2beta1Word) MarshalJSON() ([]byte, error) { 5405 type NoMethod GoogleCloudVisionV1p2beta1Word 5406 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5407 } 5408 5409 func (s *GoogleCloudVisionV1p2beta1Word) UnmarshalJSON(data []byte) error { 5410 type NoMethod GoogleCloudVisionV1p2beta1Word 5411 var s1 struct { 5412 Confidence gensupport.JSONFloat64 `json:"confidence"` 5413 *NoMethod 5414 } 5415 s1.NoMethod = (*NoMethod)(s) 5416 if err := json.Unmarshal(data, &s1); err != nil { 5417 return err 5418 } 5419 s.Confidence = float64(s1.Confidence) 5420 return nil 5421 } 5422 5423 // GoogleCloudVisionV1p3beta1AnnotateFileResponse: Response to a single file 5424 // annotation request. A file may contain one or more images, which 5425 // individually have their own responses. 5426 type GoogleCloudVisionV1p3beta1AnnotateFileResponse struct { 5427 // Error: If set, represents the error message for the failed request. The 5428 // `responses` field will not be set in this case. 5429 Error *Status `json:"error,omitempty"` 5430 // InputConfig: Information about the file for which this response is 5431 // generated. 5432 InputConfig *GoogleCloudVisionV1p3beta1InputConfig `json:"inputConfig,omitempty"` 5433 // Responses: Individual responses to images found within the file. This field 5434 // will be empty if the `error` field is set. 5435 Responses []*GoogleCloudVisionV1p3beta1AnnotateImageResponse `json:"responses,omitempty"` 5436 // TotalPages: This field gives the total number of pages in the file. 5437 TotalPages int64 `json:"totalPages,omitempty"` 5438 // ForceSendFields is a list of field names (e.g. "Error") to unconditionally 5439 // include in API requests. By default, fields with empty or default values are 5440 // omitted from API requests. See 5441 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5442 // details. 5443 ForceSendFields []string `json:"-"` 5444 // NullFields is a list of field names (e.g. "Error") to include in API 5445 // requests with the JSON null value. By default, fields with empty values are 5446 // omitted from API requests. See 5447 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5448 NullFields []string `json:"-"` 5449 } 5450 5451 func (s *GoogleCloudVisionV1p3beta1AnnotateFileResponse) MarshalJSON() ([]byte, error) { 5452 type NoMethod GoogleCloudVisionV1p3beta1AnnotateFileResponse 5453 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5454 } 5455 5456 // GoogleCloudVisionV1p3beta1AnnotateImageResponse: Response to an image 5457 // annotation request. 5458 type GoogleCloudVisionV1p3beta1AnnotateImageResponse struct { 5459 // Context: If present, contextual information is needed to understand where 5460 // this image comes from. 5461 Context *GoogleCloudVisionV1p3beta1ImageAnnotationContext `json:"context,omitempty"` 5462 // CropHintsAnnotation: If present, crop hints have completed successfully. 5463 CropHintsAnnotation *GoogleCloudVisionV1p3beta1CropHintsAnnotation `json:"cropHintsAnnotation,omitempty"` 5464 // Error: If set, represents the error message for the operation. Note that 5465 // filled-in image annotations are guaranteed to be correct, even when `error` 5466 // is set. 5467 Error *Status `json:"error,omitempty"` 5468 // FaceAnnotations: If present, face detection has completed successfully. 5469 FaceAnnotations []*GoogleCloudVisionV1p3beta1FaceAnnotation `json:"faceAnnotations,omitempty"` 5470 // FullTextAnnotation: If present, text (OCR) detection or document (OCR) text 5471 // detection has completed successfully. This annotation provides the 5472 // structural hierarchy for the OCR detected text. 5473 FullTextAnnotation *GoogleCloudVisionV1p3beta1TextAnnotation `json:"fullTextAnnotation,omitempty"` 5474 // ImagePropertiesAnnotation: If present, image properties were extracted 5475 // successfully. 5476 ImagePropertiesAnnotation *GoogleCloudVisionV1p3beta1ImageProperties `json:"imagePropertiesAnnotation,omitempty"` 5477 // LabelAnnotations: If present, label detection has completed successfully. 5478 LabelAnnotations []*GoogleCloudVisionV1p3beta1EntityAnnotation `json:"labelAnnotations,omitempty"` 5479 // LandmarkAnnotations: If present, landmark detection has completed 5480 // successfully. 5481 LandmarkAnnotations []*GoogleCloudVisionV1p3beta1EntityAnnotation `json:"landmarkAnnotations,omitempty"` 5482 // LocalizedObjectAnnotations: If present, localized object detection has 5483 // completed successfully. This will be sorted descending by confidence score. 5484 LocalizedObjectAnnotations []*GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation `json:"localizedObjectAnnotations,omitempty"` 5485 // LogoAnnotations: If present, logo detection has completed successfully. 5486 LogoAnnotations []*GoogleCloudVisionV1p3beta1EntityAnnotation `json:"logoAnnotations,omitempty"` 5487 // ProductSearchResults: If present, product search has completed successfully. 5488 ProductSearchResults *GoogleCloudVisionV1p3beta1ProductSearchResults `json:"productSearchResults,omitempty"` 5489 // SafeSearchAnnotation: If present, safe-search annotation has completed 5490 // successfully. 5491 SafeSearchAnnotation *GoogleCloudVisionV1p3beta1SafeSearchAnnotation `json:"safeSearchAnnotation,omitempty"` 5492 // TextAnnotations: If present, text (OCR) detection has completed 5493 // successfully. 5494 TextAnnotations []*GoogleCloudVisionV1p3beta1EntityAnnotation `json:"textAnnotations,omitempty"` 5495 // WebDetection: If present, web detection has completed successfully. 5496 WebDetection *GoogleCloudVisionV1p3beta1WebDetection `json:"webDetection,omitempty"` 5497 // ForceSendFields is a list of field names (e.g. "Context") to unconditionally 5498 // include in API requests. By default, fields with empty or default values are 5499 // omitted from API requests. See 5500 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5501 // details. 5502 ForceSendFields []string `json:"-"` 5503 // NullFields is a list of field names (e.g. "Context") to include in API 5504 // requests with the JSON null value. By default, fields with empty values are 5505 // omitted from API requests. See 5506 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5507 NullFields []string `json:"-"` 5508 } 5509 5510 func (s *GoogleCloudVisionV1p3beta1AnnotateImageResponse) MarshalJSON() ([]byte, error) { 5511 type NoMethod GoogleCloudVisionV1p3beta1AnnotateImageResponse 5512 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5513 } 5514 5515 // GoogleCloudVisionV1p3beta1AsyncAnnotateFileResponse: The response for a 5516 // single offline file annotation request. 5517 type GoogleCloudVisionV1p3beta1AsyncAnnotateFileResponse struct { 5518 // OutputConfig: The output location and metadata from 5519 // AsyncAnnotateFileRequest. 5520 OutputConfig *GoogleCloudVisionV1p3beta1OutputConfig `json:"outputConfig,omitempty"` 5521 // ForceSendFields is a list of field names (e.g. "OutputConfig") to 5522 // unconditionally include in API requests. By default, fields with empty or 5523 // default values are omitted from API requests. See 5524 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5525 // details. 5526 ForceSendFields []string `json:"-"` 5527 // NullFields is a list of field names (e.g. "OutputConfig") to include in API 5528 // requests with the JSON null value. By default, fields with empty values are 5529 // omitted from API requests. See 5530 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5531 NullFields []string `json:"-"` 5532 } 5533 5534 func (s *GoogleCloudVisionV1p3beta1AsyncAnnotateFileResponse) MarshalJSON() ([]byte, error) { 5535 type NoMethod GoogleCloudVisionV1p3beta1AsyncAnnotateFileResponse 5536 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5537 } 5538 5539 // GoogleCloudVisionV1p3beta1AsyncBatchAnnotateFilesResponse: Response to an 5540 // async batch file annotation request. 5541 type GoogleCloudVisionV1p3beta1AsyncBatchAnnotateFilesResponse struct { 5542 // Responses: The list of file annotation responses, one for each request in 5543 // AsyncBatchAnnotateFilesRequest. 5544 Responses []*GoogleCloudVisionV1p3beta1AsyncAnnotateFileResponse `json:"responses,omitempty"` 5545 // ForceSendFields is a list of field names (e.g. "Responses") to 5546 // unconditionally include in API requests. By default, fields with empty or 5547 // default values are omitted from API requests. See 5548 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5549 // details. 5550 ForceSendFields []string `json:"-"` 5551 // NullFields is a list of field names (e.g. "Responses") to include in API 5552 // requests with the JSON null value. By default, fields with empty values are 5553 // omitted from API requests. See 5554 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5555 NullFields []string `json:"-"` 5556 } 5557 5558 func (s *GoogleCloudVisionV1p3beta1AsyncBatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) { 5559 type NoMethod GoogleCloudVisionV1p3beta1AsyncBatchAnnotateFilesResponse 5560 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5561 } 5562 5563 // GoogleCloudVisionV1p3beta1BatchOperationMetadata: Metadata for the batch 5564 // operations such as the current state. This is included in the `metadata` 5565 // field of the `Operation` returned by the `GetOperation` call of the 5566 // `google::longrunning::Operations` service. 5567 type GoogleCloudVisionV1p3beta1BatchOperationMetadata struct { 5568 // EndTime: The time when the batch request is finished and 5569 // google.longrunning.Operation.done is set to true. 5570 EndTime string `json:"endTime,omitempty"` 5571 // State: The current state of the batch operation. 5572 // 5573 // Possible values: 5574 // "STATE_UNSPECIFIED" - Invalid. 5575 // "PROCESSING" - Request is actively being processed. 5576 // "SUCCESSFUL" - The request is done and at least one item has been 5577 // successfully processed. 5578 // "FAILED" - The request is done and no item has been successfully 5579 // processed. 5580 // "CANCELLED" - The request is done after the 5581 // longrunning.Operations.CancelOperation has been called by the user. Any 5582 // records that were processed before the cancel command are output as 5583 // specified in the request. 5584 State string `json:"state,omitempty"` 5585 // SubmitTime: The time when the batch request was submitted to the server. 5586 SubmitTime string `json:"submitTime,omitempty"` 5587 // ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally 5588 // include in API requests. By default, fields with empty or default values are 5589 // omitted from API requests. See 5590 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5591 // details. 5592 ForceSendFields []string `json:"-"` 5593 // NullFields is a list of field names (e.g. "EndTime") to include in API 5594 // requests with the JSON null value. By default, fields with empty values are 5595 // omitted from API requests. See 5596 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5597 NullFields []string `json:"-"` 5598 } 5599 5600 func (s *GoogleCloudVisionV1p3beta1BatchOperationMetadata) MarshalJSON() ([]byte, error) { 5601 type NoMethod GoogleCloudVisionV1p3beta1BatchOperationMetadata 5602 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5603 } 5604 5605 // GoogleCloudVisionV1p3beta1Block: Logical element on the page. 5606 type GoogleCloudVisionV1p3beta1Block struct { 5607 // BlockType: Detected block type (text, image etc) for this block. 5608 // 5609 // Possible values: 5610 // "UNKNOWN" - Unknown block type. 5611 // "TEXT" - Regular text block. 5612 // "TABLE" - Table block. 5613 // "PICTURE" - Image block. 5614 // "RULER" - Horizontal/vertical line box. 5615 // "BARCODE" - Barcode block. 5616 BlockType string `json:"blockType,omitempty"` 5617 // BoundingBox: The bounding box for the block. The vertices are in the order 5618 // of top-left, top-right, bottom-right, bottom-left. When a rotation of the 5619 // bounding box is detected the rotation is represented as around the top-left 5620 // corner as defined when the text is read in the 'natural' orientation. For 5621 // example: * when the text is horizontal it might look like: 0----1 | | 3----2 5622 // * when it's rotated 180 degrees around the top-left corner it becomes: 5623 // 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 3). 5624 BoundingBox *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingBox,omitempty"` 5625 // Confidence: Confidence of the OCR results on the block. Range [0, 1]. 5626 Confidence float64 `json:"confidence,omitempty"` 5627 // Paragraphs: List of paragraphs in this block (if this blocks is of type 5628 // text). 5629 Paragraphs []*GoogleCloudVisionV1p3beta1Paragraph `json:"paragraphs,omitempty"` 5630 // Property: Additional information detected for the block. 5631 Property *GoogleCloudVisionV1p3beta1TextAnnotationTextProperty `json:"property,omitempty"` 5632 // ForceSendFields is a list of field names (e.g. "BlockType") to 5633 // unconditionally include in API requests. By default, fields with empty or 5634 // default values are omitted from API requests. See 5635 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5636 // details. 5637 ForceSendFields []string `json:"-"` 5638 // NullFields is a list of field names (e.g. "BlockType") to include in API 5639 // requests with the JSON null value. By default, fields with empty values are 5640 // omitted from API requests. See 5641 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5642 NullFields []string `json:"-"` 5643 } 5644 5645 func (s *GoogleCloudVisionV1p3beta1Block) MarshalJSON() ([]byte, error) { 5646 type NoMethod GoogleCloudVisionV1p3beta1Block 5647 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5648 } 5649 5650 func (s *GoogleCloudVisionV1p3beta1Block) UnmarshalJSON(data []byte) error { 5651 type NoMethod GoogleCloudVisionV1p3beta1Block 5652 var s1 struct { 5653 Confidence gensupport.JSONFloat64 `json:"confidence"` 5654 *NoMethod 5655 } 5656 s1.NoMethod = (*NoMethod)(s) 5657 if err := json.Unmarshal(data, &s1); err != nil { 5658 return err 5659 } 5660 s.Confidence = float64(s1.Confidence) 5661 return nil 5662 } 5663 5664 // GoogleCloudVisionV1p3beta1BoundingPoly: A bounding polygon for the detected 5665 // image annotation. 5666 type GoogleCloudVisionV1p3beta1BoundingPoly struct { 5667 // NormalizedVertices: The bounding polygon normalized vertices. 5668 NormalizedVertices []*GoogleCloudVisionV1p3beta1NormalizedVertex `json:"normalizedVertices,omitempty"` 5669 // Vertices: The bounding polygon vertices. 5670 Vertices []*GoogleCloudVisionV1p3beta1Vertex `json:"vertices,omitempty"` 5671 // ForceSendFields is a list of field names (e.g. "NormalizedVertices") to 5672 // unconditionally include in API requests. By default, fields with empty or 5673 // default values are omitted from API requests. See 5674 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5675 // details. 5676 ForceSendFields []string `json:"-"` 5677 // NullFields is a list of field names (e.g. "NormalizedVertices") to include 5678 // in API requests with the JSON null value. By default, fields with empty 5679 // values are omitted from API requests. See 5680 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5681 NullFields []string `json:"-"` 5682 } 5683 5684 func (s *GoogleCloudVisionV1p3beta1BoundingPoly) MarshalJSON() ([]byte, error) { 5685 type NoMethod GoogleCloudVisionV1p3beta1BoundingPoly 5686 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5687 } 5688 5689 // GoogleCloudVisionV1p3beta1ColorInfo: Color information consists of RGB 5690 // channels, score, and the fraction of the image that the color occupies in 5691 // the image. 5692 type GoogleCloudVisionV1p3beta1ColorInfo struct { 5693 // Color: RGB components of the color. 5694 Color *Color `json:"color,omitempty"` 5695 // PixelFraction: The fraction of pixels the color occupies in the image. Value 5696 // in range [0, 1]. 5697 PixelFraction float64 `json:"pixelFraction,omitempty"` 5698 // Score: Image-specific score for this color. Value in range [0, 1]. 5699 Score float64 `json:"score,omitempty"` 5700 // ForceSendFields is a list of field names (e.g. "Color") to unconditionally 5701 // include in API requests. By default, fields with empty or default values are 5702 // omitted from API requests. See 5703 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5704 // details. 5705 ForceSendFields []string `json:"-"` 5706 // NullFields is a list of field names (e.g. "Color") to include in API 5707 // requests with the JSON null value. By default, fields with empty values are 5708 // omitted from API requests. See 5709 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5710 NullFields []string `json:"-"` 5711 } 5712 5713 func (s *GoogleCloudVisionV1p3beta1ColorInfo) MarshalJSON() ([]byte, error) { 5714 type NoMethod GoogleCloudVisionV1p3beta1ColorInfo 5715 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5716 } 5717 5718 func (s *GoogleCloudVisionV1p3beta1ColorInfo) UnmarshalJSON(data []byte) error { 5719 type NoMethod GoogleCloudVisionV1p3beta1ColorInfo 5720 var s1 struct { 5721 PixelFraction gensupport.JSONFloat64 `json:"pixelFraction"` 5722 Score gensupport.JSONFloat64 `json:"score"` 5723 *NoMethod 5724 } 5725 s1.NoMethod = (*NoMethod)(s) 5726 if err := json.Unmarshal(data, &s1); err != nil { 5727 return err 5728 } 5729 s.PixelFraction = float64(s1.PixelFraction) 5730 s.Score = float64(s1.Score) 5731 return nil 5732 } 5733 5734 // GoogleCloudVisionV1p3beta1CropHint: Single crop hint that is used to 5735 // generate a new crop when serving an image. 5736 type GoogleCloudVisionV1p3beta1CropHint struct { 5737 // BoundingPoly: The bounding polygon for the crop region. The coordinates of 5738 // the bounding box are in the original image's scale. 5739 BoundingPoly *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPoly,omitempty"` 5740 // Confidence: Confidence of this being a salient region. Range [0, 1]. 5741 Confidence float64 `json:"confidence,omitempty"` 5742 // ImportanceFraction: Fraction of importance of this salient region with 5743 // respect to the original image. 5744 ImportanceFraction float64 `json:"importanceFraction,omitempty"` 5745 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 5746 // unconditionally include in API requests. By default, fields with empty or 5747 // default values are omitted from API requests. See 5748 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5749 // details. 5750 ForceSendFields []string `json:"-"` 5751 // NullFields is a list of field names (e.g. "BoundingPoly") to include in API 5752 // requests with the JSON null value. By default, fields with empty values are 5753 // omitted from API requests. See 5754 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5755 NullFields []string `json:"-"` 5756 } 5757 5758 func (s *GoogleCloudVisionV1p3beta1CropHint) MarshalJSON() ([]byte, error) { 5759 type NoMethod GoogleCloudVisionV1p3beta1CropHint 5760 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5761 } 5762 5763 func (s *GoogleCloudVisionV1p3beta1CropHint) UnmarshalJSON(data []byte) error { 5764 type NoMethod GoogleCloudVisionV1p3beta1CropHint 5765 var s1 struct { 5766 Confidence gensupport.JSONFloat64 `json:"confidence"` 5767 ImportanceFraction gensupport.JSONFloat64 `json:"importanceFraction"` 5768 *NoMethod 5769 } 5770 s1.NoMethod = (*NoMethod)(s) 5771 if err := json.Unmarshal(data, &s1); err != nil { 5772 return err 5773 } 5774 s.Confidence = float64(s1.Confidence) 5775 s.ImportanceFraction = float64(s1.ImportanceFraction) 5776 return nil 5777 } 5778 5779 // GoogleCloudVisionV1p3beta1CropHintsAnnotation: Set of crop hints that are 5780 // used to generate new crops when serving images. 5781 type GoogleCloudVisionV1p3beta1CropHintsAnnotation struct { 5782 // CropHints: Crop hint results. 5783 CropHints []*GoogleCloudVisionV1p3beta1CropHint `json:"cropHints,omitempty"` 5784 // ForceSendFields is a list of field names (e.g. "CropHints") to 5785 // unconditionally include in API requests. By default, fields with empty or 5786 // default values are omitted from API requests. See 5787 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5788 // details. 5789 ForceSendFields []string `json:"-"` 5790 // NullFields is a list of field names (e.g. "CropHints") to include in API 5791 // requests with the JSON null value. By default, fields with empty values are 5792 // omitted from API requests. See 5793 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5794 NullFields []string `json:"-"` 5795 } 5796 5797 func (s *GoogleCloudVisionV1p3beta1CropHintsAnnotation) MarshalJSON() ([]byte, error) { 5798 type NoMethod GoogleCloudVisionV1p3beta1CropHintsAnnotation 5799 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5800 } 5801 5802 // GoogleCloudVisionV1p3beta1DominantColorsAnnotation: Set of dominant colors 5803 // and their corresponding scores. 5804 type GoogleCloudVisionV1p3beta1DominantColorsAnnotation struct { 5805 // Colors: RGB color values with their score and pixel fraction. 5806 Colors []*GoogleCloudVisionV1p3beta1ColorInfo `json:"colors,omitempty"` 5807 // ForceSendFields is a list of field names (e.g. "Colors") to unconditionally 5808 // include in API requests. By default, fields with empty or default values are 5809 // omitted from API requests. See 5810 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5811 // details. 5812 ForceSendFields []string `json:"-"` 5813 // NullFields is a list of field names (e.g. "Colors") to include in API 5814 // requests with the JSON null value. By default, fields with empty values are 5815 // omitted from API requests. See 5816 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5817 NullFields []string `json:"-"` 5818 } 5819 5820 func (s *GoogleCloudVisionV1p3beta1DominantColorsAnnotation) MarshalJSON() ([]byte, error) { 5821 type NoMethod GoogleCloudVisionV1p3beta1DominantColorsAnnotation 5822 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5823 } 5824 5825 // GoogleCloudVisionV1p3beta1EntityAnnotation: Set of detected entity features. 5826 type GoogleCloudVisionV1p3beta1EntityAnnotation struct { 5827 // BoundingPoly: Image region to which this entity belongs. Not produced for 5828 // `LABEL_DETECTION` features. 5829 BoundingPoly *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPoly,omitempty"` 5830 // Confidence: **Deprecated. Use `score` instead.** The accuracy of the entity 5831 // detection in an image. For example, for an image in which the "Eiffel Tower" 5832 // entity is detected, this field represents the confidence that there is a 5833 // tower in the query image. Range [0, 1]. 5834 Confidence float64 `json:"confidence,omitempty"` 5835 // Description: Entity textual description, expressed in its `locale` language. 5836 Description string `json:"description,omitempty"` 5837 // Locale: The language code for the locale in which the entity textual 5838 // `description` is expressed. 5839 Locale string `json:"locale,omitempty"` 5840 // Locations: The location information for the detected entity. Multiple 5841 // `LocationInfo` elements can be present because one location may indicate the 5842 // location of the scene in the image, and another location may indicate the 5843 // location of the place where the image was taken. Location information is 5844 // usually present for landmarks. 5845 Locations []*GoogleCloudVisionV1p3beta1LocationInfo `json:"locations,omitempty"` 5846 // Mid: Opaque entity ID. Some IDs may be available in Google Knowledge Graph 5847 // Search API (https://developers.google.com/knowledge-graph/). 5848 Mid string `json:"mid,omitempty"` 5849 // Properties: Some entities may have optional user-supplied `Property` 5850 // (name/value) fields, such a score or string that qualifies the entity. 5851 Properties []*GoogleCloudVisionV1p3beta1Property `json:"properties,omitempty"` 5852 // Score: Overall score of the result. Range [0, 1]. 5853 Score float64 `json:"score,omitempty"` 5854 // Topicality: The relevancy of the ICA (Image Content Annotation) label to the 5855 // image. For example, the relevancy of "tower" is likely higher to an image 5856 // containing the detected "Eiffel Tower" than to an image containing a 5857 // detected distant towering building, even though the confidence that there is 5858 // a tower in each image may be the same. Range [0, 1]. 5859 Topicality float64 `json:"topicality,omitempty"` 5860 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 5861 // unconditionally include in API requests. By default, fields with empty or 5862 // default values are omitted from API requests. See 5863 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5864 // details. 5865 ForceSendFields []string `json:"-"` 5866 // NullFields is a list of field names (e.g. "BoundingPoly") to include in API 5867 // requests with the JSON null value. By default, fields with empty values are 5868 // omitted from API requests. See 5869 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5870 NullFields []string `json:"-"` 5871 } 5872 5873 func (s *GoogleCloudVisionV1p3beta1EntityAnnotation) MarshalJSON() ([]byte, error) { 5874 type NoMethod GoogleCloudVisionV1p3beta1EntityAnnotation 5875 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5876 } 5877 5878 func (s *GoogleCloudVisionV1p3beta1EntityAnnotation) UnmarshalJSON(data []byte) error { 5879 type NoMethod GoogleCloudVisionV1p3beta1EntityAnnotation 5880 var s1 struct { 5881 Confidence gensupport.JSONFloat64 `json:"confidence"` 5882 Score gensupport.JSONFloat64 `json:"score"` 5883 Topicality gensupport.JSONFloat64 `json:"topicality"` 5884 *NoMethod 5885 } 5886 s1.NoMethod = (*NoMethod)(s) 5887 if err := json.Unmarshal(data, &s1); err != nil { 5888 return err 5889 } 5890 s.Confidence = float64(s1.Confidence) 5891 s.Score = float64(s1.Score) 5892 s.Topicality = float64(s1.Topicality) 5893 return nil 5894 } 5895 5896 // GoogleCloudVisionV1p3beta1FaceAnnotation: A face annotation object contains 5897 // the results of face detection. 5898 type GoogleCloudVisionV1p3beta1FaceAnnotation struct { 5899 // AngerLikelihood: Anger likelihood. 5900 // 5901 // Possible values: 5902 // "UNKNOWN" - Unknown likelihood. 5903 // "VERY_UNLIKELY" - It is very unlikely. 5904 // "UNLIKELY" - It is unlikely. 5905 // "POSSIBLE" - It is possible. 5906 // "LIKELY" - It is likely. 5907 // "VERY_LIKELY" - It is very likely. 5908 AngerLikelihood string `json:"angerLikelihood,omitempty"` 5909 // BlurredLikelihood: Blurred likelihood. 5910 // 5911 // Possible values: 5912 // "UNKNOWN" - Unknown likelihood. 5913 // "VERY_UNLIKELY" - It is very unlikely. 5914 // "UNLIKELY" - It is unlikely. 5915 // "POSSIBLE" - It is possible. 5916 // "LIKELY" - It is likely. 5917 // "VERY_LIKELY" - It is very likely. 5918 BlurredLikelihood string `json:"blurredLikelihood,omitempty"` 5919 // BoundingPoly: The bounding polygon around the face. The coordinates of the 5920 // bounding box are in the original image's scale. The bounding box is computed 5921 // to "frame" the face in accordance with human expectations. It is based on 5922 // the landmarker results. Note that one or more x and/or y coordinates may not 5923 // be generated in the `BoundingPoly` (the polygon will be unbounded) if only a 5924 // partial face appears in the image to be annotated. 5925 BoundingPoly *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPoly,omitempty"` 5926 // DetectionConfidence: Detection confidence. Range [0, 1]. 5927 DetectionConfidence float64 `json:"detectionConfidence,omitempty"` 5928 // FdBoundingPoly: The `fd_bounding_poly` bounding polygon is tighter than the 5929 // `boundingPoly`, and encloses only the skin part of the face. Typically, it 5930 // is used to eliminate the face from any image analysis that detects the 5931 // "amount of skin" visible in an image. It is not based on the landmarker 5932 // results, only on the initial face detection, hence the fd (face detection) 5933 // prefix. 5934 FdBoundingPoly *GoogleCloudVisionV1p3beta1BoundingPoly `json:"fdBoundingPoly,omitempty"` 5935 // HeadwearLikelihood: Headwear likelihood. 5936 // 5937 // Possible values: 5938 // "UNKNOWN" - Unknown likelihood. 5939 // "VERY_UNLIKELY" - It is very unlikely. 5940 // "UNLIKELY" - It is unlikely. 5941 // "POSSIBLE" - It is possible. 5942 // "LIKELY" - It is likely. 5943 // "VERY_LIKELY" - It is very likely. 5944 HeadwearLikelihood string `json:"headwearLikelihood,omitempty"` 5945 // JoyLikelihood: Joy likelihood. 5946 // 5947 // Possible values: 5948 // "UNKNOWN" - Unknown likelihood. 5949 // "VERY_UNLIKELY" - It is very unlikely. 5950 // "UNLIKELY" - It is unlikely. 5951 // "POSSIBLE" - It is possible. 5952 // "LIKELY" - It is likely. 5953 // "VERY_LIKELY" - It is very likely. 5954 JoyLikelihood string `json:"joyLikelihood,omitempty"` 5955 // LandmarkingConfidence: Face landmarking confidence. Range [0, 1]. 5956 LandmarkingConfidence float64 `json:"landmarkingConfidence,omitempty"` 5957 // Landmarks: Detected face landmarks. 5958 Landmarks []*GoogleCloudVisionV1p3beta1FaceAnnotationLandmark `json:"landmarks,omitempty"` 5959 // PanAngle: Yaw angle, which indicates the leftward/rightward angle that the 5960 // face is pointing relative to the vertical plane perpendicular to the image. 5961 // Range [-180,180]. 5962 PanAngle float64 `json:"panAngle,omitempty"` 5963 // RollAngle: Roll angle, which indicates the amount of 5964 // clockwise/anti-clockwise rotation of the face relative to the image vertical 5965 // about the axis perpendicular to the face. Range [-180,180]. 5966 RollAngle float64 `json:"rollAngle,omitempty"` 5967 // SorrowLikelihood: Sorrow likelihood. 5968 // 5969 // Possible values: 5970 // "UNKNOWN" - Unknown likelihood. 5971 // "VERY_UNLIKELY" - It is very unlikely. 5972 // "UNLIKELY" - It is unlikely. 5973 // "POSSIBLE" - It is possible. 5974 // "LIKELY" - It is likely. 5975 // "VERY_LIKELY" - It is very likely. 5976 SorrowLikelihood string `json:"sorrowLikelihood,omitempty"` 5977 // SurpriseLikelihood: Surprise likelihood. 5978 // 5979 // Possible values: 5980 // "UNKNOWN" - Unknown likelihood. 5981 // "VERY_UNLIKELY" - It is very unlikely. 5982 // "UNLIKELY" - It is unlikely. 5983 // "POSSIBLE" - It is possible. 5984 // "LIKELY" - It is likely. 5985 // "VERY_LIKELY" - It is very likely. 5986 SurpriseLikelihood string `json:"surpriseLikelihood,omitempty"` 5987 // TiltAngle: Pitch angle, which indicates the upwards/downwards angle that the 5988 // face is pointing relative to the image's horizontal plane. Range [-180,180]. 5989 TiltAngle float64 `json:"tiltAngle,omitempty"` 5990 // UnderExposedLikelihood: Under-exposed likelihood. 5991 // 5992 // Possible values: 5993 // "UNKNOWN" - Unknown likelihood. 5994 // "VERY_UNLIKELY" - It is very unlikely. 5995 // "UNLIKELY" - It is unlikely. 5996 // "POSSIBLE" - It is possible. 5997 // "LIKELY" - It is likely. 5998 // "VERY_LIKELY" - It is very likely. 5999 UnderExposedLikelihood string `json:"underExposedLikelihood,omitempty"` 6000 // ForceSendFields is a list of field names (e.g. "AngerLikelihood") to 6001 // unconditionally include in API requests. By default, fields with empty or 6002 // default values are omitted from API requests. See 6003 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6004 // details. 6005 ForceSendFields []string `json:"-"` 6006 // NullFields is a list of field names (e.g. "AngerLikelihood") to include in 6007 // API requests with the JSON null value. By default, fields with empty values 6008 // are omitted from API requests. See 6009 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6010 NullFields []string `json:"-"` 6011 } 6012 6013 func (s *GoogleCloudVisionV1p3beta1FaceAnnotation) MarshalJSON() ([]byte, error) { 6014 type NoMethod GoogleCloudVisionV1p3beta1FaceAnnotation 6015 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6016 } 6017 6018 func (s *GoogleCloudVisionV1p3beta1FaceAnnotation) UnmarshalJSON(data []byte) error { 6019 type NoMethod GoogleCloudVisionV1p3beta1FaceAnnotation 6020 var s1 struct { 6021 DetectionConfidence gensupport.JSONFloat64 `json:"detectionConfidence"` 6022 LandmarkingConfidence gensupport.JSONFloat64 `json:"landmarkingConfidence"` 6023 PanAngle gensupport.JSONFloat64 `json:"panAngle"` 6024 RollAngle gensupport.JSONFloat64 `json:"rollAngle"` 6025 TiltAngle gensupport.JSONFloat64 `json:"tiltAngle"` 6026 *NoMethod 6027 } 6028 s1.NoMethod = (*NoMethod)(s) 6029 if err := json.Unmarshal(data, &s1); err != nil { 6030 return err 6031 } 6032 s.DetectionConfidence = float64(s1.DetectionConfidence) 6033 s.LandmarkingConfidence = float64(s1.LandmarkingConfidence) 6034 s.PanAngle = float64(s1.PanAngle) 6035 s.RollAngle = float64(s1.RollAngle) 6036 s.TiltAngle = float64(s1.TiltAngle) 6037 return nil 6038 } 6039 6040 // GoogleCloudVisionV1p3beta1FaceAnnotationLandmark: A face-specific landmark 6041 // (for example, a face feature). 6042 type GoogleCloudVisionV1p3beta1FaceAnnotationLandmark struct { 6043 // Position: Face landmark position. 6044 Position *GoogleCloudVisionV1p3beta1Position `json:"position,omitempty"` 6045 // Type: Face landmark type. 6046 // 6047 // Possible values: 6048 // "UNKNOWN_LANDMARK" - Unknown face landmark detected. Should not be filled. 6049 // "LEFT_EYE" - Left eye. 6050 // "RIGHT_EYE" - Right eye. 6051 // "LEFT_OF_LEFT_EYEBROW" - Left of left eyebrow. 6052 // "RIGHT_OF_LEFT_EYEBROW" - Right of left eyebrow. 6053 // "LEFT_OF_RIGHT_EYEBROW" - Left of right eyebrow. 6054 // "RIGHT_OF_RIGHT_EYEBROW" - Right of right eyebrow. 6055 // "MIDPOINT_BETWEEN_EYES" - Midpoint between eyes. 6056 // "NOSE_TIP" - Nose tip. 6057 // "UPPER_LIP" - Upper lip. 6058 // "LOWER_LIP" - Lower lip. 6059 // "MOUTH_LEFT" - Mouth left. 6060 // "MOUTH_RIGHT" - Mouth right. 6061 // "MOUTH_CENTER" - Mouth center. 6062 // "NOSE_BOTTOM_RIGHT" - Nose, bottom right. 6063 // "NOSE_BOTTOM_LEFT" - Nose, bottom left. 6064 // "NOSE_BOTTOM_CENTER" - Nose, bottom center. 6065 // "LEFT_EYE_TOP_BOUNDARY" - Left eye, top boundary. 6066 // "LEFT_EYE_RIGHT_CORNER" - Left eye, right corner. 6067 // "LEFT_EYE_BOTTOM_BOUNDARY" - Left eye, bottom boundary. 6068 // "LEFT_EYE_LEFT_CORNER" - Left eye, left corner. 6069 // "RIGHT_EYE_TOP_BOUNDARY" - Right eye, top boundary. 6070 // "RIGHT_EYE_RIGHT_CORNER" - Right eye, right corner. 6071 // "RIGHT_EYE_BOTTOM_BOUNDARY" - Right eye, bottom boundary. 6072 // "RIGHT_EYE_LEFT_CORNER" - Right eye, left corner. 6073 // "LEFT_EYEBROW_UPPER_MIDPOINT" - Left eyebrow, upper midpoint. 6074 // "RIGHT_EYEBROW_UPPER_MIDPOINT" - Right eyebrow, upper midpoint. 6075 // "LEFT_EAR_TRAGION" - Left ear tragion. 6076 // "RIGHT_EAR_TRAGION" - Right ear tragion. 6077 // "LEFT_EYE_PUPIL" - Left eye pupil. 6078 // "RIGHT_EYE_PUPIL" - Right eye pupil. 6079 // "FOREHEAD_GLABELLA" - Forehead glabella. 6080 // "CHIN_GNATHION" - Chin gnathion. 6081 // "CHIN_LEFT_GONION" - Chin left gonion. 6082 // "CHIN_RIGHT_GONION" - Chin right gonion. 6083 // "LEFT_CHEEK_CENTER" - Left cheek center. 6084 // "RIGHT_CHEEK_CENTER" - Right cheek center. 6085 Type string `json:"type,omitempty"` 6086 // ForceSendFields is a list of field names (e.g. "Position") to 6087 // unconditionally include in API requests. By default, fields with empty or 6088 // default values are omitted from API requests. See 6089 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6090 // details. 6091 ForceSendFields []string `json:"-"` 6092 // NullFields is a list of field names (e.g. "Position") to include in API 6093 // requests with the JSON null value. By default, fields with empty values are 6094 // omitted from API requests. See 6095 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6096 NullFields []string `json:"-"` 6097 } 6098 6099 func (s *GoogleCloudVisionV1p3beta1FaceAnnotationLandmark) MarshalJSON() ([]byte, error) { 6100 type NoMethod GoogleCloudVisionV1p3beta1FaceAnnotationLandmark 6101 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6102 } 6103 6104 // GoogleCloudVisionV1p3beta1GcsDestination: The Google Cloud Storage location 6105 // where the output will be written to. 6106 type GoogleCloudVisionV1p3beta1GcsDestination struct { 6107 // Uri: Google Cloud Storage URI prefix where the results will be stored. 6108 // Results will be in JSON format and preceded by its corresponding input URI 6109 // prefix. This field can either represent a gcs file prefix or gcs directory. 6110 // In either case, the uri should be unique because in order to get all of the 6111 // output files, you will need to do a wildcard gcs search on the uri prefix 6112 // you provide. Examples: * File Prefix: gs://bucket-name/here/filenameprefix 6113 // The output files will be created in gs://bucket-name/here/ and the names of 6114 // the output files will begin with "filenameprefix". * Directory Prefix: 6115 // gs://bucket-name/some/location/ The output files will be created in 6116 // gs://bucket-name/some/location/ and the names of the output files could be 6117 // anything because there was no filename prefix specified. If multiple 6118 // outputs, each response is still AnnotateFileResponse, each of which contains 6119 // some subset of the full list of AnnotateImageResponse. Multiple outputs can 6120 // happen if, for example, the output JSON is too large and overflows into 6121 // multiple sharded files. 6122 Uri string `json:"uri,omitempty"` 6123 // ForceSendFields is a list of field names (e.g. "Uri") to unconditionally 6124 // include in API requests. By default, fields with empty or default values are 6125 // omitted from API requests. See 6126 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6127 // details. 6128 ForceSendFields []string `json:"-"` 6129 // NullFields is a list of field names (e.g. "Uri") to include in API requests 6130 // with the JSON null value. By default, fields with empty values are omitted 6131 // from API requests. See 6132 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6133 NullFields []string `json:"-"` 6134 } 6135 6136 func (s *GoogleCloudVisionV1p3beta1GcsDestination) MarshalJSON() ([]byte, error) { 6137 type NoMethod GoogleCloudVisionV1p3beta1GcsDestination 6138 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6139 } 6140 6141 // GoogleCloudVisionV1p3beta1GcsSource: The Google Cloud Storage location where 6142 // the input will be read from. 6143 type GoogleCloudVisionV1p3beta1GcsSource struct { 6144 // Uri: Google Cloud Storage URI for the input file. This must only be a Google 6145 // Cloud Storage object. Wildcards are not currently supported. 6146 Uri string `json:"uri,omitempty"` 6147 // ForceSendFields is a list of field names (e.g. "Uri") to unconditionally 6148 // include in API requests. By default, fields with empty or default values are 6149 // omitted from API requests. See 6150 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6151 // details. 6152 ForceSendFields []string `json:"-"` 6153 // NullFields is a list of field names (e.g. "Uri") to include in API requests 6154 // with the JSON null value. By default, fields with empty values are omitted 6155 // from API requests. See 6156 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6157 NullFields []string `json:"-"` 6158 } 6159 6160 func (s *GoogleCloudVisionV1p3beta1GcsSource) MarshalJSON() ([]byte, error) { 6161 type NoMethod GoogleCloudVisionV1p3beta1GcsSource 6162 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6163 } 6164 6165 // GoogleCloudVisionV1p3beta1ImageAnnotationContext: If an image was produced 6166 // from a file (e.g. a PDF), this message gives information about the source of 6167 // that image. 6168 type GoogleCloudVisionV1p3beta1ImageAnnotationContext struct { 6169 // PageNumber: If the file was a PDF or TIFF, this field gives the page number 6170 // within the file used to produce the image. 6171 PageNumber int64 `json:"pageNumber,omitempty"` 6172 // Uri: The URI of the file used to produce the image. 6173 Uri string `json:"uri,omitempty"` 6174 // ForceSendFields is a list of field names (e.g. "PageNumber") to 6175 // unconditionally include in API requests. By default, fields with empty or 6176 // default values are omitted from API requests. See 6177 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6178 // details. 6179 ForceSendFields []string `json:"-"` 6180 // NullFields is a list of field names (e.g. "PageNumber") to include in API 6181 // requests with the JSON null value. By default, fields with empty values are 6182 // omitted from API requests. See 6183 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6184 NullFields []string `json:"-"` 6185 } 6186 6187 func (s *GoogleCloudVisionV1p3beta1ImageAnnotationContext) MarshalJSON() ([]byte, error) { 6188 type NoMethod GoogleCloudVisionV1p3beta1ImageAnnotationContext 6189 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6190 } 6191 6192 // GoogleCloudVisionV1p3beta1ImageProperties: Stores image properties, such as 6193 // dominant colors. 6194 type GoogleCloudVisionV1p3beta1ImageProperties struct { 6195 // DominantColors: If present, dominant colors completed successfully. 6196 DominantColors *GoogleCloudVisionV1p3beta1DominantColorsAnnotation `json:"dominantColors,omitempty"` 6197 // ForceSendFields is a list of field names (e.g. "DominantColors") to 6198 // unconditionally include in API requests. By default, fields with empty or 6199 // default values are omitted from API requests. See 6200 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6201 // details. 6202 ForceSendFields []string `json:"-"` 6203 // NullFields is a list of field names (e.g. "DominantColors") to include in 6204 // API requests with the JSON null value. By default, fields with empty values 6205 // are omitted from API requests. See 6206 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6207 NullFields []string `json:"-"` 6208 } 6209 6210 func (s *GoogleCloudVisionV1p3beta1ImageProperties) MarshalJSON() ([]byte, error) { 6211 type NoMethod GoogleCloudVisionV1p3beta1ImageProperties 6212 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6213 } 6214 6215 // GoogleCloudVisionV1p3beta1ImportProductSetsResponse: Response message for 6216 // the `ImportProductSets` method. This message is returned by the 6217 // google.longrunning.Operations.GetOperation method in the returned 6218 // google.longrunning.Operation.response field. 6219 type GoogleCloudVisionV1p3beta1ImportProductSetsResponse struct { 6220 // ReferenceImages: The list of reference_images that are imported 6221 // successfully. 6222 ReferenceImages []*GoogleCloudVisionV1p3beta1ReferenceImage `json:"referenceImages,omitempty"` 6223 // Statuses: The rpc status for each ImportProductSet request, including both 6224 // successes and errors. The number of statuses here matches the number of 6225 // lines in the csv file, and statuses[i] stores the success or failure status 6226 // of processing the i-th line of the csv, starting from line 0. 6227 Statuses []*Status `json:"statuses,omitempty"` 6228 // ForceSendFields is a list of field names (e.g. "ReferenceImages") to 6229 // unconditionally include in API requests. By default, fields with empty or 6230 // default values are omitted from API requests. See 6231 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6232 // details. 6233 ForceSendFields []string `json:"-"` 6234 // NullFields is a list of field names (e.g. "ReferenceImages") to include in 6235 // API requests with the JSON null value. By default, fields with empty values 6236 // are omitted from API requests. See 6237 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6238 NullFields []string `json:"-"` 6239 } 6240 6241 func (s *GoogleCloudVisionV1p3beta1ImportProductSetsResponse) MarshalJSON() ([]byte, error) { 6242 type NoMethod GoogleCloudVisionV1p3beta1ImportProductSetsResponse 6243 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6244 } 6245 6246 // GoogleCloudVisionV1p3beta1InputConfig: The desired input location and 6247 // metadata. 6248 type GoogleCloudVisionV1p3beta1InputConfig struct { 6249 // Content: File content, represented as a stream of bytes. Note: As with all 6250 // `bytes` fields, protobuffers use a pure binary representation, whereas JSON 6251 // representations use base64. Currently, this field only works for 6252 // BatchAnnotateFiles requests. It does not work for AsyncBatchAnnotateFiles 6253 // requests. 6254 Content string `json:"content,omitempty"` 6255 // GcsSource: The Google Cloud Storage location to read the input from. 6256 GcsSource *GoogleCloudVisionV1p3beta1GcsSource `json:"gcsSource,omitempty"` 6257 // MimeType: The type of the file. Currently only "application/pdf", 6258 // "image/tiff" and "image/gif" are supported. Wildcards are not supported. 6259 MimeType string `json:"mimeType,omitempty"` 6260 // ForceSendFields is a list of field names (e.g. "Content") to unconditionally 6261 // include in API requests. By default, fields with empty or default values are 6262 // omitted from API requests. See 6263 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6264 // details. 6265 ForceSendFields []string `json:"-"` 6266 // NullFields is a list of field names (e.g. "Content") to include in API 6267 // requests with the JSON null value. By default, fields with empty values are 6268 // omitted from API requests. See 6269 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6270 NullFields []string `json:"-"` 6271 } 6272 6273 func (s *GoogleCloudVisionV1p3beta1InputConfig) MarshalJSON() ([]byte, error) { 6274 type NoMethod GoogleCloudVisionV1p3beta1InputConfig 6275 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6276 } 6277 6278 // GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation: Set of detected objects 6279 // with bounding boxes. 6280 type GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation struct { 6281 // BoundingPoly: Image region to which this object belongs. This must be 6282 // populated. 6283 BoundingPoly *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPoly,omitempty"` 6284 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". For 6285 // more information, see 6286 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 6287 LanguageCode string `json:"languageCode,omitempty"` 6288 // Mid: Object ID that should align with EntityAnnotation mid. 6289 Mid string `json:"mid,omitempty"` 6290 // Name: Object name, expressed in its `language_code` language. 6291 Name string `json:"name,omitempty"` 6292 // Score: Score of the result. Range [0, 1]. 6293 Score float64 `json:"score,omitempty"` 6294 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 6295 // unconditionally include in API requests. By default, fields with empty or 6296 // default values are omitted from API requests. See 6297 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6298 // details. 6299 ForceSendFields []string `json:"-"` 6300 // NullFields is a list of field names (e.g. "BoundingPoly") to include in API 6301 // requests with the JSON null value. By default, fields with empty values are 6302 // omitted from API requests. See 6303 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6304 NullFields []string `json:"-"` 6305 } 6306 6307 func (s *GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation) MarshalJSON() ([]byte, error) { 6308 type NoMethod GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation 6309 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6310 } 6311 6312 func (s *GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation) UnmarshalJSON(data []byte) error { 6313 type NoMethod GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation 6314 var s1 struct { 6315 Score gensupport.JSONFloat64 `json:"score"` 6316 *NoMethod 6317 } 6318 s1.NoMethod = (*NoMethod)(s) 6319 if err := json.Unmarshal(data, &s1); err != nil { 6320 return err 6321 } 6322 s.Score = float64(s1.Score) 6323 return nil 6324 } 6325 6326 // GoogleCloudVisionV1p3beta1LocationInfo: Detected entity location 6327 // information. 6328 type GoogleCloudVisionV1p3beta1LocationInfo struct { 6329 // LatLng: lat/long location coordinates. 6330 LatLng *LatLng `json:"latLng,omitempty"` 6331 // ForceSendFields is a list of field names (e.g. "LatLng") to unconditionally 6332 // include in API requests. By default, fields with empty or default values are 6333 // omitted from API requests. See 6334 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6335 // details. 6336 ForceSendFields []string `json:"-"` 6337 // NullFields is a list of field names (e.g. "LatLng") to include in API 6338 // requests with the JSON null value. By default, fields with empty values are 6339 // omitted from API requests. See 6340 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6341 NullFields []string `json:"-"` 6342 } 6343 6344 func (s *GoogleCloudVisionV1p3beta1LocationInfo) MarshalJSON() ([]byte, error) { 6345 type NoMethod GoogleCloudVisionV1p3beta1LocationInfo 6346 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6347 } 6348 6349 // GoogleCloudVisionV1p3beta1NormalizedVertex: A vertex represents a 2D point 6350 // in the image. NOTE: the normalized vertex coordinates are relative to the 6351 // original image and range from 0 to 1. 6352 type GoogleCloudVisionV1p3beta1NormalizedVertex struct { 6353 // X: X coordinate. 6354 X float64 `json:"x,omitempty"` 6355 // Y: Y coordinate. 6356 Y float64 `json:"y,omitempty"` 6357 // ForceSendFields is a list of field names (e.g. "X") to unconditionally 6358 // include in API requests. By default, fields with empty or default values are 6359 // omitted from API requests. See 6360 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6361 // details. 6362 ForceSendFields []string `json:"-"` 6363 // NullFields is a list of field names (e.g. "X") to include in API requests 6364 // with the JSON null value. By default, fields with empty values are omitted 6365 // from API requests. See 6366 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6367 NullFields []string `json:"-"` 6368 } 6369 6370 func (s *GoogleCloudVisionV1p3beta1NormalizedVertex) MarshalJSON() ([]byte, error) { 6371 type NoMethod GoogleCloudVisionV1p3beta1NormalizedVertex 6372 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6373 } 6374 6375 func (s *GoogleCloudVisionV1p3beta1NormalizedVertex) UnmarshalJSON(data []byte) error { 6376 type NoMethod GoogleCloudVisionV1p3beta1NormalizedVertex 6377 var s1 struct { 6378 X gensupport.JSONFloat64 `json:"x"` 6379 Y gensupport.JSONFloat64 `json:"y"` 6380 *NoMethod 6381 } 6382 s1.NoMethod = (*NoMethod)(s) 6383 if err := json.Unmarshal(data, &s1); err != nil { 6384 return err 6385 } 6386 s.X = float64(s1.X) 6387 s.Y = float64(s1.Y) 6388 return nil 6389 } 6390 6391 // GoogleCloudVisionV1p3beta1OperationMetadata: Contains metadata for the 6392 // BatchAnnotateImages operation. 6393 type GoogleCloudVisionV1p3beta1OperationMetadata struct { 6394 // CreateTime: The time when the batch request was received. 6395 CreateTime string `json:"createTime,omitempty"` 6396 // State: Current state of the batch operation. 6397 // 6398 // Possible values: 6399 // "STATE_UNSPECIFIED" - Invalid. 6400 // "CREATED" - Request is received. 6401 // "RUNNING" - Request is actively being processed. 6402 // "DONE" - The batch processing is done. 6403 // "CANCELLED" - The batch processing was cancelled. 6404 State string `json:"state,omitempty"` 6405 // UpdateTime: The time when the operation result was last updated. 6406 UpdateTime string `json:"updateTime,omitempty"` 6407 // ForceSendFields is a list of field names (e.g. "CreateTime") to 6408 // unconditionally include in API requests. By default, fields with empty or 6409 // default values are omitted from API requests. See 6410 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6411 // details. 6412 ForceSendFields []string `json:"-"` 6413 // NullFields is a list of field names (e.g. "CreateTime") to include in API 6414 // requests with the JSON null value. By default, fields with empty values are 6415 // omitted from API requests. See 6416 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6417 NullFields []string `json:"-"` 6418 } 6419 6420 func (s *GoogleCloudVisionV1p3beta1OperationMetadata) MarshalJSON() ([]byte, error) { 6421 type NoMethod GoogleCloudVisionV1p3beta1OperationMetadata 6422 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6423 } 6424 6425 // GoogleCloudVisionV1p3beta1OutputConfig: The desired output location and 6426 // metadata. 6427 type GoogleCloudVisionV1p3beta1OutputConfig struct { 6428 // BatchSize: The max number of response protos to put into each output JSON 6429 // file on Google Cloud Storage. The valid range is [1, 100]. If not specified, 6430 // the default value is 20. For example, for one pdf file with 100 pages, 100 6431 // response protos will be generated. If `batch_size` = 20, then 5 json files 6432 // each containing 20 response protos will be written under the prefix 6433 // `gcs_destination`.`uri`. Currently, batch_size only applies to 6434 // GcsDestination, with potential future support for other output 6435 // configurations. 6436 BatchSize int64 `json:"batchSize,omitempty"` 6437 // GcsDestination: The Google Cloud Storage location to write the output(s) to. 6438 GcsDestination *GoogleCloudVisionV1p3beta1GcsDestination `json:"gcsDestination,omitempty"` 6439 // ForceSendFields is a list of field names (e.g. "BatchSize") to 6440 // unconditionally include in API requests. By default, fields with empty or 6441 // default values are omitted from API requests. See 6442 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6443 // details. 6444 ForceSendFields []string `json:"-"` 6445 // NullFields is a list of field names (e.g. "BatchSize") to include in API 6446 // requests with the JSON null value. By default, fields with empty values are 6447 // omitted from API requests. See 6448 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6449 NullFields []string `json:"-"` 6450 } 6451 6452 func (s *GoogleCloudVisionV1p3beta1OutputConfig) MarshalJSON() ([]byte, error) { 6453 type NoMethod GoogleCloudVisionV1p3beta1OutputConfig 6454 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6455 } 6456 6457 // GoogleCloudVisionV1p3beta1Page: Detected page from OCR. 6458 type GoogleCloudVisionV1p3beta1Page struct { 6459 // Blocks: List of blocks of text, images etc on this page. 6460 Blocks []*GoogleCloudVisionV1p3beta1Block `json:"blocks,omitempty"` 6461 // Confidence: Confidence of the OCR results on the page. Range [0, 1]. 6462 Confidence float64 `json:"confidence,omitempty"` 6463 // Height: Page height. For PDFs the unit is points. For images (including 6464 // TIFFs) the unit is pixels. 6465 Height int64 `json:"height,omitempty"` 6466 // Property: Additional information detected on the page. 6467 Property *GoogleCloudVisionV1p3beta1TextAnnotationTextProperty `json:"property,omitempty"` 6468 // Width: Page width. For PDFs the unit is points. For images (including TIFFs) 6469 // the unit is pixels. 6470 Width int64 `json:"width,omitempty"` 6471 // ForceSendFields is a list of field names (e.g. "Blocks") to unconditionally 6472 // include in API requests. By default, fields with empty or default values are 6473 // omitted from API requests. See 6474 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6475 // details. 6476 ForceSendFields []string `json:"-"` 6477 // NullFields is a list of field names (e.g. "Blocks") to include in API 6478 // requests with the JSON null value. By default, fields with empty values are 6479 // omitted from API requests. See 6480 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6481 NullFields []string `json:"-"` 6482 } 6483 6484 func (s *GoogleCloudVisionV1p3beta1Page) MarshalJSON() ([]byte, error) { 6485 type NoMethod GoogleCloudVisionV1p3beta1Page 6486 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6487 } 6488 6489 func (s *GoogleCloudVisionV1p3beta1Page) UnmarshalJSON(data []byte) error { 6490 type NoMethod GoogleCloudVisionV1p3beta1Page 6491 var s1 struct { 6492 Confidence gensupport.JSONFloat64 `json:"confidence"` 6493 *NoMethod 6494 } 6495 s1.NoMethod = (*NoMethod)(s) 6496 if err := json.Unmarshal(data, &s1); err != nil { 6497 return err 6498 } 6499 s.Confidence = float64(s1.Confidence) 6500 return nil 6501 } 6502 6503 // GoogleCloudVisionV1p3beta1Paragraph: Structural unit of text representing a 6504 // number of words in certain order. 6505 type GoogleCloudVisionV1p3beta1Paragraph struct { 6506 // BoundingBox: The bounding box for the paragraph. The vertices are in the 6507 // order of top-left, top-right, bottom-right, bottom-left. When a rotation of 6508 // the bounding box is detected the rotation is represented as around the 6509 // top-left corner as defined when the text is read in the 'natural' 6510 // orientation. For example: * when the text is horizontal it might look like: 6511 // 0----1 | | 3----2 * when it's rotated 180 degrees around the top-left corner 6512 // it becomes: 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 6513 // 3). 6514 BoundingBox *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingBox,omitempty"` 6515 // Confidence: Confidence of the OCR results for the paragraph. Range [0, 1]. 6516 Confidence float64 `json:"confidence,omitempty"` 6517 // Property: Additional information detected for the paragraph. 6518 Property *GoogleCloudVisionV1p3beta1TextAnnotationTextProperty `json:"property,omitempty"` 6519 // Words: List of all words in this paragraph. 6520 Words []*GoogleCloudVisionV1p3beta1Word `json:"words,omitempty"` 6521 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 6522 // unconditionally include in API requests. By default, fields with empty or 6523 // default values are omitted from API requests. See 6524 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6525 // details. 6526 ForceSendFields []string `json:"-"` 6527 // NullFields is a list of field names (e.g. "BoundingBox") to include in API 6528 // requests with the JSON null value. By default, fields with empty values are 6529 // omitted from API requests. See 6530 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6531 NullFields []string `json:"-"` 6532 } 6533 6534 func (s *GoogleCloudVisionV1p3beta1Paragraph) MarshalJSON() ([]byte, error) { 6535 type NoMethod GoogleCloudVisionV1p3beta1Paragraph 6536 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6537 } 6538 6539 func (s *GoogleCloudVisionV1p3beta1Paragraph) UnmarshalJSON(data []byte) error { 6540 type NoMethod GoogleCloudVisionV1p3beta1Paragraph 6541 var s1 struct { 6542 Confidence gensupport.JSONFloat64 `json:"confidence"` 6543 *NoMethod 6544 } 6545 s1.NoMethod = (*NoMethod)(s) 6546 if err := json.Unmarshal(data, &s1); err != nil { 6547 return err 6548 } 6549 s.Confidence = float64(s1.Confidence) 6550 return nil 6551 } 6552 6553 // GoogleCloudVisionV1p3beta1Position: A 3D position in the image, used 6554 // primarily for Face detection landmarks. A valid Position must have both x 6555 // and y coordinates. The position coordinates are in the same scale as the 6556 // original image. 6557 type GoogleCloudVisionV1p3beta1Position struct { 6558 // X: X coordinate. 6559 X float64 `json:"x,omitempty"` 6560 // Y: Y coordinate. 6561 Y float64 `json:"y,omitempty"` 6562 // Z: Z coordinate (or depth). 6563 Z float64 `json:"z,omitempty"` 6564 // ForceSendFields is a list of field names (e.g. "X") to unconditionally 6565 // include in API requests. By default, fields with empty or default values are 6566 // omitted from API requests. See 6567 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6568 // details. 6569 ForceSendFields []string `json:"-"` 6570 // NullFields is a list of field names (e.g. "X") to include in API requests 6571 // with the JSON null value. By default, fields with empty values are omitted 6572 // from API requests. See 6573 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6574 NullFields []string `json:"-"` 6575 } 6576 6577 func (s *GoogleCloudVisionV1p3beta1Position) MarshalJSON() ([]byte, error) { 6578 type NoMethod GoogleCloudVisionV1p3beta1Position 6579 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6580 } 6581 6582 func (s *GoogleCloudVisionV1p3beta1Position) UnmarshalJSON(data []byte) error { 6583 type NoMethod GoogleCloudVisionV1p3beta1Position 6584 var s1 struct { 6585 X gensupport.JSONFloat64 `json:"x"` 6586 Y gensupport.JSONFloat64 `json:"y"` 6587 Z gensupport.JSONFloat64 `json:"z"` 6588 *NoMethod 6589 } 6590 s1.NoMethod = (*NoMethod)(s) 6591 if err := json.Unmarshal(data, &s1); err != nil { 6592 return err 6593 } 6594 s.X = float64(s1.X) 6595 s.Y = float64(s1.Y) 6596 s.Z = float64(s1.Z) 6597 return nil 6598 } 6599 6600 // GoogleCloudVisionV1p3beta1Product: A Product contains ReferenceImages. 6601 type GoogleCloudVisionV1p3beta1Product struct { 6602 // Description: User-provided metadata to be stored with this product. Must be 6603 // at most 4096 characters long. 6604 Description string `json:"description,omitempty"` 6605 // DisplayName: The user-provided name for this Product. Must not be empty. 6606 // Must be at most 4096 characters long. 6607 DisplayName string `json:"displayName,omitempty"` 6608 // Name: The resource name of the product. Format is: 6609 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This field is 6610 // ignored when creating a product. 6611 Name string `json:"name,omitempty"` 6612 // ProductCategory: Immutable. The category for the product identified by the 6613 // reference image. This should be one of "homegoods-v2", "apparel-v2", 6614 // "toys-v2", "packagedgoods-v1" or "general-v1". The legacy categories 6615 // "homegoods", "apparel", and "toys" are still supported, but these should not 6616 // be used for new products. 6617 ProductCategory string `json:"productCategory,omitempty"` 6618 // ProductLabels: Key-value pairs that can be attached to a product. At query 6619 // time, constraints can be specified based on the product_labels. Note that 6620 // integer values can be provided as strings, e.g. "1199". Only strings with 6621 // integer values can match a range-based restriction which is to be supported 6622 // soon. Multiple values can be assigned to the same key. One product may have 6623 // up to 500 product_labels. Notice that the total number of distinct 6624 // product_labels over all products in one ProductSet cannot exceed 1M, 6625 // otherwise the product search pipeline will refuse to work for that 6626 // ProductSet. 6627 ProductLabels []*GoogleCloudVisionV1p3beta1ProductKeyValue `json:"productLabels,omitempty"` 6628 // ForceSendFields is a list of field names (e.g. "Description") to 6629 // unconditionally include in API requests. By default, fields with empty or 6630 // default values are omitted from API requests. See 6631 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6632 // details. 6633 ForceSendFields []string `json:"-"` 6634 // NullFields is a list of field names (e.g. "Description") to include in API 6635 // requests with the JSON null value. By default, fields with empty values are 6636 // omitted from API requests. See 6637 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6638 NullFields []string `json:"-"` 6639 } 6640 6641 func (s *GoogleCloudVisionV1p3beta1Product) MarshalJSON() ([]byte, error) { 6642 type NoMethod GoogleCloudVisionV1p3beta1Product 6643 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6644 } 6645 6646 // GoogleCloudVisionV1p3beta1ProductKeyValue: A product label represented as a 6647 // key-value pair. 6648 type GoogleCloudVisionV1p3beta1ProductKeyValue struct { 6649 // Key: The key of the label attached to the product. Cannot be empty and 6650 // cannot exceed 128 bytes. 6651 Key string `json:"key,omitempty"` 6652 // Value: The value of the label attached to the product. Cannot be empty and 6653 // cannot exceed 128 bytes. 6654 Value string `json:"value,omitempty"` 6655 // ForceSendFields is a list of field names (e.g. "Key") to unconditionally 6656 // include in API requests. By default, fields with empty or default values are 6657 // omitted from API requests. See 6658 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6659 // details. 6660 ForceSendFields []string `json:"-"` 6661 // NullFields is a list of field names (e.g. "Key") to include in API requests 6662 // with the JSON null value. By default, fields with empty values are omitted 6663 // from API requests. See 6664 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6665 NullFields []string `json:"-"` 6666 } 6667 6668 func (s *GoogleCloudVisionV1p3beta1ProductKeyValue) MarshalJSON() ([]byte, error) { 6669 type NoMethod GoogleCloudVisionV1p3beta1ProductKeyValue 6670 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6671 } 6672 6673 // GoogleCloudVisionV1p3beta1ProductSearchResults: Results for a product search 6674 // request. 6675 type GoogleCloudVisionV1p3beta1ProductSearchResults struct { 6676 // IndexTime: Timestamp of the index which provided these results. Products 6677 // added to the product set and products removed from the product set after 6678 // this time are not reflected in the current results. 6679 IndexTime string `json:"indexTime,omitempty"` 6680 // ProductGroupedResults: List of results grouped by products detected in the 6681 // query image. Each entry corresponds to one bounding polygon in the query 6682 // image, and contains the matching products specific to that region. There may 6683 // be duplicate product matches in the union of all the per-product results. 6684 ProductGroupedResults []*GoogleCloudVisionV1p3beta1ProductSearchResultsGroupedResult `json:"productGroupedResults,omitempty"` 6685 // Results: List of results, one for each product match. 6686 Results []*GoogleCloudVisionV1p3beta1ProductSearchResultsResult `json:"results,omitempty"` 6687 // ForceSendFields is a list of field names (e.g. "IndexTime") to 6688 // unconditionally include in API requests. By default, fields with empty or 6689 // default values are omitted from API requests. See 6690 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6691 // details. 6692 ForceSendFields []string `json:"-"` 6693 // NullFields is a list of field names (e.g. "IndexTime") to include in API 6694 // requests with the JSON null value. By default, fields with empty values are 6695 // omitted from API requests. See 6696 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6697 NullFields []string `json:"-"` 6698 } 6699 6700 func (s *GoogleCloudVisionV1p3beta1ProductSearchResults) MarshalJSON() ([]byte, error) { 6701 type NoMethod GoogleCloudVisionV1p3beta1ProductSearchResults 6702 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6703 } 6704 6705 // GoogleCloudVisionV1p3beta1ProductSearchResultsGroupedResult: Information 6706 // about the products similar to a single product in a query image. 6707 type GoogleCloudVisionV1p3beta1ProductSearchResultsGroupedResult struct { 6708 // BoundingPoly: The bounding polygon around the product detected in the query 6709 // image. 6710 BoundingPoly *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPoly,omitempty"` 6711 // ObjectAnnotations: List of generic predictions for the object in the 6712 // bounding box. 6713 ObjectAnnotations []*GoogleCloudVisionV1p3beta1ProductSearchResultsObjectAnnotation `json:"objectAnnotations,omitempty"` 6714 // Results: List of results, one for each product match. 6715 Results []*GoogleCloudVisionV1p3beta1ProductSearchResultsResult `json:"results,omitempty"` 6716 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 6717 // unconditionally include in API requests. By default, fields with empty or 6718 // default values are omitted from API requests. See 6719 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6720 // details. 6721 ForceSendFields []string `json:"-"` 6722 // NullFields is a list of field names (e.g. "BoundingPoly") to include in API 6723 // requests with the JSON null value. By default, fields with empty values are 6724 // omitted from API requests. See 6725 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6726 NullFields []string `json:"-"` 6727 } 6728 6729 func (s *GoogleCloudVisionV1p3beta1ProductSearchResultsGroupedResult) MarshalJSON() ([]byte, error) { 6730 type NoMethod GoogleCloudVisionV1p3beta1ProductSearchResultsGroupedResult 6731 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6732 } 6733 6734 // GoogleCloudVisionV1p3beta1ProductSearchResultsObjectAnnotation: Prediction 6735 // for what the object in the bounding box is. 6736 type GoogleCloudVisionV1p3beta1ProductSearchResultsObjectAnnotation struct { 6737 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". For 6738 // more information, see 6739 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 6740 LanguageCode string `json:"languageCode,omitempty"` 6741 // Mid: Object ID that should align with EntityAnnotation mid. 6742 Mid string `json:"mid,omitempty"` 6743 // Name: Object name, expressed in its `language_code` language. 6744 Name string `json:"name,omitempty"` 6745 // Score: Score of the result. Range [0, 1]. 6746 Score float64 `json:"score,omitempty"` 6747 // ForceSendFields is a list of field names (e.g. "LanguageCode") to 6748 // unconditionally include in API requests. By default, fields with empty or 6749 // default values are omitted from API requests. See 6750 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6751 // details. 6752 ForceSendFields []string `json:"-"` 6753 // NullFields is a list of field names (e.g. "LanguageCode") to include in API 6754 // requests with the JSON null value. By default, fields with empty values are 6755 // omitted from API requests. See 6756 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6757 NullFields []string `json:"-"` 6758 } 6759 6760 func (s *GoogleCloudVisionV1p3beta1ProductSearchResultsObjectAnnotation) MarshalJSON() ([]byte, error) { 6761 type NoMethod GoogleCloudVisionV1p3beta1ProductSearchResultsObjectAnnotation 6762 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6763 } 6764 6765 func (s *GoogleCloudVisionV1p3beta1ProductSearchResultsObjectAnnotation) UnmarshalJSON(data []byte) error { 6766 type NoMethod GoogleCloudVisionV1p3beta1ProductSearchResultsObjectAnnotation 6767 var s1 struct { 6768 Score gensupport.JSONFloat64 `json:"score"` 6769 *NoMethod 6770 } 6771 s1.NoMethod = (*NoMethod)(s) 6772 if err := json.Unmarshal(data, &s1); err != nil { 6773 return err 6774 } 6775 s.Score = float64(s1.Score) 6776 return nil 6777 } 6778 6779 // GoogleCloudVisionV1p3beta1ProductSearchResultsResult: Information about a 6780 // product. 6781 type GoogleCloudVisionV1p3beta1ProductSearchResultsResult struct { 6782 // Image: The resource name of the image from the product that is the closest 6783 // match to the query. 6784 Image string `json:"image,omitempty"` 6785 // Product: The Product. 6786 Product *GoogleCloudVisionV1p3beta1Product `json:"product,omitempty"` 6787 // Score: A confidence level on the match, ranging from 0 (no confidence) to 1 6788 // (full confidence). 6789 Score float64 `json:"score,omitempty"` 6790 // ForceSendFields is a list of field names (e.g. "Image") to unconditionally 6791 // include in API requests. By default, fields with empty or default values are 6792 // omitted from API requests. See 6793 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6794 // details. 6795 ForceSendFields []string `json:"-"` 6796 // NullFields is a list of field names (e.g. "Image") to include in API 6797 // requests with the JSON null value. By default, fields with empty values are 6798 // omitted from API requests. See 6799 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6800 NullFields []string `json:"-"` 6801 } 6802 6803 func (s *GoogleCloudVisionV1p3beta1ProductSearchResultsResult) MarshalJSON() ([]byte, error) { 6804 type NoMethod GoogleCloudVisionV1p3beta1ProductSearchResultsResult 6805 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6806 } 6807 6808 func (s *GoogleCloudVisionV1p3beta1ProductSearchResultsResult) UnmarshalJSON(data []byte) error { 6809 type NoMethod GoogleCloudVisionV1p3beta1ProductSearchResultsResult 6810 var s1 struct { 6811 Score gensupport.JSONFloat64 `json:"score"` 6812 *NoMethod 6813 } 6814 s1.NoMethod = (*NoMethod)(s) 6815 if err := json.Unmarshal(data, &s1); err != nil { 6816 return err 6817 } 6818 s.Score = float64(s1.Score) 6819 return nil 6820 } 6821 6822 // GoogleCloudVisionV1p3beta1Property: A `Property` consists of a user-supplied 6823 // name/value pair. 6824 type GoogleCloudVisionV1p3beta1Property struct { 6825 // Name: Name of the property. 6826 Name string `json:"name,omitempty"` 6827 // Uint64Value: Value of numeric properties. 6828 Uint64Value uint64 `json:"uint64Value,omitempty,string"` 6829 // Value: Value of the property. 6830 Value string `json:"value,omitempty"` 6831 // ForceSendFields is a list of field names (e.g. "Name") to unconditionally 6832 // include in API requests. By default, fields with empty or default values are 6833 // omitted from API requests. See 6834 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6835 // details. 6836 ForceSendFields []string `json:"-"` 6837 // NullFields is a list of field names (e.g. "Name") to include in API requests 6838 // with the JSON null value. By default, fields with empty values are omitted 6839 // from API requests. See 6840 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6841 NullFields []string `json:"-"` 6842 } 6843 6844 func (s *GoogleCloudVisionV1p3beta1Property) MarshalJSON() ([]byte, error) { 6845 type NoMethod GoogleCloudVisionV1p3beta1Property 6846 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6847 } 6848 6849 // GoogleCloudVisionV1p3beta1ReferenceImage: A `ReferenceImage` represents a 6850 // product image and its associated metadata, such as bounding boxes. 6851 type GoogleCloudVisionV1p3beta1ReferenceImage struct { 6852 // BoundingPolys: Optional. Bounding polygons around the areas of interest in 6853 // the reference image. If this field is empty, the system will try to detect 6854 // regions of interest. At most 10 bounding polygons will be used. The provided 6855 // shape is converted into a non-rotated rectangle. Once converted, the small 6856 // edge of the rectangle must be greater than or equal to 300 pixels. The 6857 // aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 is not). 6858 BoundingPolys []*GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPolys,omitempty"` 6859 // Name: The resource name of the reference image. Format is: 6860 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMA 6861 // GE_ID`. This field is ignored when creating a reference image. 6862 Name string `json:"name,omitempty"` 6863 // Uri: Required. The Google Cloud Storage URI of the reference image. The URI 6864 // must start with `gs://`. 6865 Uri string `json:"uri,omitempty"` 6866 // ForceSendFields is a list of field names (e.g. "BoundingPolys") to 6867 // unconditionally include in API requests. By default, fields with empty or 6868 // default values are omitted from API requests. See 6869 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6870 // details. 6871 ForceSendFields []string `json:"-"` 6872 // NullFields is a list of field names (e.g. "BoundingPolys") to include in API 6873 // requests with the JSON null value. By default, fields with empty values are 6874 // omitted from API requests. See 6875 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6876 NullFields []string `json:"-"` 6877 } 6878 6879 func (s *GoogleCloudVisionV1p3beta1ReferenceImage) MarshalJSON() ([]byte, error) { 6880 type NoMethod GoogleCloudVisionV1p3beta1ReferenceImage 6881 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6882 } 6883 6884 // GoogleCloudVisionV1p3beta1SafeSearchAnnotation: Set of features pertaining 6885 // to the image, computed by computer vision methods over safe-search verticals 6886 // (for example, adult, spoof, medical, violence). 6887 type GoogleCloudVisionV1p3beta1SafeSearchAnnotation struct { 6888 // Adult: Represents the adult content likelihood for the image. Adult content 6889 // may contain elements such as nudity, pornographic images or cartoons, or 6890 // sexual activities. 6891 // 6892 // Possible values: 6893 // "UNKNOWN" - Unknown likelihood. 6894 // "VERY_UNLIKELY" - It is very unlikely. 6895 // "UNLIKELY" - It is unlikely. 6896 // "POSSIBLE" - It is possible. 6897 // "LIKELY" - It is likely. 6898 // "VERY_LIKELY" - It is very likely. 6899 Adult string `json:"adult,omitempty"` 6900 // Medical: Likelihood that this is a medical image. 6901 // 6902 // Possible values: 6903 // "UNKNOWN" - Unknown likelihood. 6904 // "VERY_UNLIKELY" - It is very unlikely. 6905 // "UNLIKELY" - It is unlikely. 6906 // "POSSIBLE" - It is possible. 6907 // "LIKELY" - It is likely. 6908 // "VERY_LIKELY" - It is very likely. 6909 Medical string `json:"medical,omitempty"` 6910 // Racy: Likelihood that the request image contains racy content. Racy content 6911 // may include (but is not limited to) skimpy or sheer clothing, strategically 6912 // covered nudity, lewd or provocative poses, or close-ups of sensitive body 6913 // areas. 6914 // 6915 // Possible values: 6916 // "UNKNOWN" - Unknown likelihood. 6917 // "VERY_UNLIKELY" - It is very unlikely. 6918 // "UNLIKELY" - It is unlikely. 6919 // "POSSIBLE" - It is possible. 6920 // "LIKELY" - It is likely. 6921 // "VERY_LIKELY" - It is very likely. 6922 Racy string `json:"racy,omitempty"` 6923 // Spoof: Spoof likelihood. The likelihood that an modification was made to the 6924 // image's canonical version to make it appear funny or offensive. 6925 // 6926 // Possible values: 6927 // "UNKNOWN" - Unknown likelihood. 6928 // "VERY_UNLIKELY" - It is very unlikely. 6929 // "UNLIKELY" - It is unlikely. 6930 // "POSSIBLE" - It is possible. 6931 // "LIKELY" - It is likely. 6932 // "VERY_LIKELY" - It is very likely. 6933 Spoof string `json:"spoof,omitempty"` 6934 // Violence: Likelihood that this image contains violent content. Violent 6935 // content may include death, serious harm, or injury to individuals or groups 6936 // of individuals. 6937 // 6938 // Possible values: 6939 // "UNKNOWN" - Unknown likelihood. 6940 // "VERY_UNLIKELY" - It is very unlikely. 6941 // "UNLIKELY" - It is unlikely. 6942 // "POSSIBLE" - It is possible. 6943 // "LIKELY" - It is likely. 6944 // "VERY_LIKELY" - It is very likely. 6945 Violence string `json:"violence,omitempty"` 6946 // ForceSendFields is a list of field names (e.g. "Adult") to unconditionally 6947 // include in API requests. By default, fields with empty or default values are 6948 // omitted from API requests. See 6949 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6950 // details. 6951 ForceSendFields []string `json:"-"` 6952 // NullFields is a list of field names (e.g. "Adult") to include in API 6953 // requests with the JSON null value. By default, fields with empty values are 6954 // omitted from API requests. See 6955 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6956 NullFields []string `json:"-"` 6957 } 6958 6959 func (s *GoogleCloudVisionV1p3beta1SafeSearchAnnotation) MarshalJSON() ([]byte, error) { 6960 type NoMethod GoogleCloudVisionV1p3beta1SafeSearchAnnotation 6961 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6962 } 6963 6964 // GoogleCloudVisionV1p3beta1Symbol: A single symbol representation. 6965 type GoogleCloudVisionV1p3beta1Symbol struct { 6966 // BoundingBox: The bounding box for the symbol. The vertices are in the order 6967 // of top-left, top-right, bottom-right, bottom-left. When a rotation of the 6968 // bounding box is detected the rotation is represented as around the top-left 6969 // corner as defined when the text is read in the 'natural' orientation. For 6970 // example: * when the text is horizontal it might look like: 0----1 | | 3----2 6971 // * when it's rotated 180 degrees around the top-left corner it becomes: 6972 // 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 3). 6973 BoundingBox *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingBox,omitempty"` 6974 // Confidence: Confidence of the OCR results for the symbol. Range [0, 1]. 6975 Confidence float64 `json:"confidence,omitempty"` 6976 // Property: Additional information detected for the symbol. 6977 Property *GoogleCloudVisionV1p3beta1TextAnnotationTextProperty `json:"property,omitempty"` 6978 // Text: The actual UTF-8 representation of the symbol. 6979 Text string `json:"text,omitempty"` 6980 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 6981 // unconditionally include in API requests. By default, fields with empty or 6982 // default values are omitted from API requests. See 6983 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6984 // details. 6985 ForceSendFields []string `json:"-"` 6986 // NullFields is a list of field names (e.g. "BoundingBox") to include in API 6987 // requests with the JSON null value. By default, fields with empty values are 6988 // omitted from API requests. See 6989 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6990 NullFields []string `json:"-"` 6991 } 6992 6993 func (s *GoogleCloudVisionV1p3beta1Symbol) MarshalJSON() ([]byte, error) { 6994 type NoMethod GoogleCloudVisionV1p3beta1Symbol 6995 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6996 } 6997 6998 func (s *GoogleCloudVisionV1p3beta1Symbol) UnmarshalJSON(data []byte) error { 6999 type NoMethod GoogleCloudVisionV1p3beta1Symbol 7000 var s1 struct { 7001 Confidence gensupport.JSONFloat64 `json:"confidence"` 7002 *NoMethod 7003 } 7004 s1.NoMethod = (*NoMethod)(s) 7005 if err := json.Unmarshal(data, &s1); err != nil { 7006 return err 7007 } 7008 s.Confidence = float64(s1.Confidence) 7009 return nil 7010 } 7011 7012 // GoogleCloudVisionV1p3beta1TextAnnotation: TextAnnotation contains a 7013 // structured representation of OCR extracted text. The hierarchy of an OCR 7014 // extracted text structure is like this: TextAnnotation -> Page -> Block -> 7015 // Paragraph -> Word -> Symbol Each structural component, starting from Page, 7016 // may further have their own properties. Properties describe detected 7017 // languages, breaks etc.. Please refer to the TextAnnotation.TextProperty 7018 // message definition below for more detail. 7019 type GoogleCloudVisionV1p3beta1TextAnnotation struct { 7020 // Pages: List of pages detected by OCR. 7021 Pages []*GoogleCloudVisionV1p3beta1Page `json:"pages,omitempty"` 7022 // Text: UTF-8 text detected on the pages. 7023 Text string `json:"text,omitempty"` 7024 // ForceSendFields is a list of field names (e.g. "Pages") to unconditionally 7025 // include in API requests. By default, fields with empty or default values are 7026 // omitted from API requests. See 7027 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7028 // details. 7029 ForceSendFields []string `json:"-"` 7030 // NullFields is a list of field names (e.g. "Pages") to include in API 7031 // requests with the JSON null value. By default, fields with empty values are 7032 // omitted from API requests. See 7033 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7034 NullFields []string `json:"-"` 7035 } 7036 7037 func (s *GoogleCloudVisionV1p3beta1TextAnnotation) MarshalJSON() ([]byte, error) { 7038 type NoMethod GoogleCloudVisionV1p3beta1TextAnnotation 7039 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7040 } 7041 7042 // GoogleCloudVisionV1p3beta1TextAnnotationDetectedBreak: Detected start or end 7043 // of a structural component. 7044 type GoogleCloudVisionV1p3beta1TextAnnotationDetectedBreak struct { 7045 // IsPrefix: True if break prepends the element. 7046 IsPrefix bool `json:"isPrefix,omitempty"` 7047 // Type: Detected break type. 7048 // 7049 // Possible values: 7050 // "UNKNOWN" - Unknown break label type. 7051 // "SPACE" - Regular space. 7052 // "SURE_SPACE" - Sure space (very wide). 7053 // "EOL_SURE_SPACE" - Line-wrapping break. 7054 // "HYPHEN" - End-line hyphen that is not present in text; does not co-occur 7055 // with `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. 7056 // "LINE_BREAK" - Line break that ends a paragraph. 7057 Type string `json:"type,omitempty"` 7058 // ForceSendFields is a list of field names (e.g. "IsPrefix") to 7059 // unconditionally include in API requests. By default, fields with empty or 7060 // default values are omitted from API requests. See 7061 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7062 // details. 7063 ForceSendFields []string `json:"-"` 7064 // NullFields is a list of field names (e.g. "IsPrefix") to include in API 7065 // requests with the JSON null value. By default, fields with empty values are 7066 // omitted from API requests. See 7067 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7068 NullFields []string `json:"-"` 7069 } 7070 7071 func (s *GoogleCloudVisionV1p3beta1TextAnnotationDetectedBreak) MarshalJSON() ([]byte, error) { 7072 type NoMethod GoogleCloudVisionV1p3beta1TextAnnotationDetectedBreak 7073 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7074 } 7075 7076 // GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage: Detected language 7077 // for a structural component. 7078 type GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage struct { 7079 // Confidence: Confidence of detected language. Range [0, 1]. 7080 Confidence float64 `json:"confidence,omitempty"` 7081 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". For 7082 // more information, see 7083 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 7084 LanguageCode string `json:"languageCode,omitempty"` 7085 // ForceSendFields is a list of field names (e.g. "Confidence") to 7086 // unconditionally include in API requests. By default, fields with empty or 7087 // default values are omitted from API requests. See 7088 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7089 // details. 7090 ForceSendFields []string `json:"-"` 7091 // NullFields is a list of field names (e.g. "Confidence") to include in API 7092 // requests with the JSON null value. By default, fields with empty values are 7093 // omitted from API requests. See 7094 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7095 NullFields []string `json:"-"` 7096 } 7097 7098 func (s *GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage) MarshalJSON() ([]byte, error) { 7099 type NoMethod GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage 7100 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7101 } 7102 7103 func (s *GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage) UnmarshalJSON(data []byte) error { 7104 type NoMethod GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage 7105 var s1 struct { 7106 Confidence gensupport.JSONFloat64 `json:"confidence"` 7107 *NoMethod 7108 } 7109 s1.NoMethod = (*NoMethod)(s) 7110 if err := json.Unmarshal(data, &s1); err != nil { 7111 return err 7112 } 7113 s.Confidence = float64(s1.Confidence) 7114 return nil 7115 } 7116 7117 // GoogleCloudVisionV1p3beta1TextAnnotationTextProperty: Additional information 7118 // detected on the structural component. 7119 type GoogleCloudVisionV1p3beta1TextAnnotationTextProperty struct { 7120 // DetectedBreak: Detected start or end of a text segment. 7121 DetectedBreak *GoogleCloudVisionV1p3beta1TextAnnotationDetectedBreak `json:"detectedBreak,omitempty"` 7122 // DetectedLanguages: A list of detected languages together with confidence. 7123 DetectedLanguages []*GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage `json:"detectedLanguages,omitempty"` 7124 // ForceSendFields is a list of field names (e.g. "DetectedBreak") to 7125 // unconditionally include in API requests. By default, fields with empty or 7126 // default values are omitted from API requests. See 7127 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7128 // details. 7129 ForceSendFields []string `json:"-"` 7130 // NullFields is a list of field names (e.g. "DetectedBreak") to include in API 7131 // requests with the JSON null value. By default, fields with empty values are 7132 // omitted from API requests. See 7133 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7134 NullFields []string `json:"-"` 7135 } 7136 7137 func (s *GoogleCloudVisionV1p3beta1TextAnnotationTextProperty) MarshalJSON() ([]byte, error) { 7138 type NoMethod GoogleCloudVisionV1p3beta1TextAnnotationTextProperty 7139 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7140 } 7141 7142 // GoogleCloudVisionV1p3beta1Vertex: A vertex represents a 2D point in the 7143 // image. NOTE: the vertex coordinates are in the same scale as the original 7144 // image. 7145 type GoogleCloudVisionV1p3beta1Vertex struct { 7146 // X: X coordinate. 7147 X int64 `json:"x,omitempty"` 7148 // Y: Y coordinate. 7149 Y int64 `json:"y,omitempty"` 7150 // ForceSendFields is a list of field names (e.g. "X") to unconditionally 7151 // include in API requests. By default, fields with empty or default values are 7152 // omitted from API requests. See 7153 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7154 // details. 7155 ForceSendFields []string `json:"-"` 7156 // NullFields is a list of field names (e.g. "X") to include in API requests 7157 // with the JSON null value. By default, fields with empty values are omitted 7158 // from API requests. See 7159 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7160 NullFields []string `json:"-"` 7161 } 7162 7163 func (s *GoogleCloudVisionV1p3beta1Vertex) MarshalJSON() ([]byte, error) { 7164 type NoMethod GoogleCloudVisionV1p3beta1Vertex 7165 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7166 } 7167 7168 // GoogleCloudVisionV1p3beta1WebDetection: Relevant information for the image 7169 // from the Internet. 7170 type GoogleCloudVisionV1p3beta1WebDetection struct { 7171 // BestGuessLabels: The service's best guess as to the topic of the request 7172 // image. Inferred from similar images on the open web. 7173 BestGuessLabels []*GoogleCloudVisionV1p3beta1WebDetectionWebLabel `json:"bestGuessLabels,omitempty"` 7174 // FullMatchingImages: Fully matching images from the Internet. Can include 7175 // resized copies of the query image. 7176 FullMatchingImages []*GoogleCloudVisionV1p3beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"` 7177 // PagesWithMatchingImages: Web pages containing the matching images from the 7178 // Internet. 7179 PagesWithMatchingImages []*GoogleCloudVisionV1p3beta1WebDetectionWebPage `json:"pagesWithMatchingImages,omitempty"` 7180 // PartialMatchingImages: Partial matching images from the Internet. Those 7181 // images are similar enough to share some key-point features. For example an 7182 // original image will likely have partial matching for its crops. 7183 PartialMatchingImages []*GoogleCloudVisionV1p3beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"` 7184 // VisuallySimilarImages: The visually similar image results. 7185 VisuallySimilarImages []*GoogleCloudVisionV1p3beta1WebDetectionWebImage `json:"visuallySimilarImages,omitempty"` 7186 // WebEntities: Deduced entities from similar images on the Internet. 7187 WebEntities []*GoogleCloudVisionV1p3beta1WebDetectionWebEntity `json:"webEntities,omitempty"` 7188 // ForceSendFields is a list of field names (e.g. "BestGuessLabels") to 7189 // unconditionally include in API requests. By default, fields with empty or 7190 // default values are omitted from API requests. See 7191 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7192 // details. 7193 ForceSendFields []string `json:"-"` 7194 // NullFields is a list of field names (e.g. "BestGuessLabels") to include in 7195 // API requests with the JSON null value. By default, fields with empty values 7196 // are omitted from API requests. See 7197 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7198 NullFields []string `json:"-"` 7199 } 7200 7201 func (s *GoogleCloudVisionV1p3beta1WebDetection) MarshalJSON() ([]byte, error) { 7202 type NoMethod GoogleCloudVisionV1p3beta1WebDetection 7203 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7204 } 7205 7206 // GoogleCloudVisionV1p3beta1WebDetectionWebEntity: Entity deduced from similar 7207 // images on the Internet. 7208 type GoogleCloudVisionV1p3beta1WebDetectionWebEntity struct { 7209 // Description: Canonical description of the entity, in English. 7210 Description string `json:"description,omitempty"` 7211 // EntityId: Opaque entity ID. 7212 EntityId string `json:"entityId,omitempty"` 7213 // Score: Overall relevancy score for the entity. Not normalized and not 7214 // comparable across different image queries. 7215 Score float64 `json:"score,omitempty"` 7216 // ForceSendFields is a list of field names (e.g. "Description") to 7217 // unconditionally include in API requests. By default, fields with empty or 7218 // default values are omitted from API requests. See 7219 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7220 // details. 7221 ForceSendFields []string `json:"-"` 7222 // NullFields is a list of field names (e.g. "Description") to include in API 7223 // requests with the JSON null value. By default, fields with empty values are 7224 // omitted from API requests. See 7225 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7226 NullFields []string `json:"-"` 7227 } 7228 7229 func (s *GoogleCloudVisionV1p3beta1WebDetectionWebEntity) MarshalJSON() ([]byte, error) { 7230 type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebEntity 7231 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7232 } 7233 7234 func (s *GoogleCloudVisionV1p3beta1WebDetectionWebEntity) UnmarshalJSON(data []byte) error { 7235 type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebEntity 7236 var s1 struct { 7237 Score gensupport.JSONFloat64 `json:"score"` 7238 *NoMethod 7239 } 7240 s1.NoMethod = (*NoMethod)(s) 7241 if err := json.Unmarshal(data, &s1); err != nil { 7242 return err 7243 } 7244 s.Score = float64(s1.Score) 7245 return nil 7246 } 7247 7248 // GoogleCloudVisionV1p3beta1WebDetectionWebImage: Metadata for online images. 7249 type GoogleCloudVisionV1p3beta1WebDetectionWebImage struct { 7250 // Score: (Deprecated) Overall relevancy score for the image. 7251 Score float64 `json:"score,omitempty"` 7252 // Url: The result image URL. 7253 Url string `json:"url,omitempty"` 7254 // ForceSendFields is a list of field names (e.g. "Score") to unconditionally 7255 // include in API requests. By default, fields with empty or default values are 7256 // omitted from API requests. See 7257 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7258 // details. 7259 ForceSendFields []string `json:"-"` 7260 // NullFields is a list of field names (e.g. "Score") to include in API 7261 // requests with the JSON null value. By default, fields with empty values are 7262 // omitted from API requests. See 7263 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7264 NullFields []string `json:"-"` 7265 } 7266 7267 func (s *GoogleCloudVisionV1p3beta1WebDetectionWebImage) MarshalJSON() ([]byte, error) { 7268 type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebImage 7269 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7270 } 7271 7272 func (s *GoogleCloudVisionV1p3beta1WebDetectionWebImage) UnmarshalJSON(data []byte) error { 7273 type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebImage 7274 var s1 struct { 7275 Score gensupport.JSONFloat64 `json:"score"` 7276 *NoMethod 7277 } 7278 s1.NoMethod = (*NoMethod)(s) 7279 if err := json.Unmarshal(data, &s1); err != nil { 7280 return err 7281 } 7282 s.Score = float64(s1.Score) 7283 return nil 7284 } 7285 7286 // GoogleCloudVisionV1p3beta1WebDetectionWebLabel: Label to provide extra 7287 // metadata for the web detection. 7288 type GoogleCloudVisionV1p3beta1WebDetectionWebLabel struct { 7289 // Label: Label for extra metadata. 7290 Label string `json:"label,omitempty"` 7291 // LanguageCode: The BCP-47 language code for `label`, such as "en-US" or 7292 // "sr-Latn". For more information, see 7293 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 7294 LanguageCode string `json:"languageCode,omitempty"` 7295 // ForceSendFields is a list of field names (e.g. "Label") to unconditionally 7296 // include in API requests. By default, fields with empty or default values are 7297 // omitted from API requests. See 7298 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7299 // details. 7300 ForceSendFields []string `json:"-"` 7301 // NullFields is a list of field names (e.g. "Label") to include in API 7302 // requests with the JSON null value. By default, fields with empty values are 7303 // omitted from API requests. See 7304 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7305 NullFields []string `json:"-"` 7306 } 7307 7308 func (s *GoogleCloudVisionV1p3beta1WebDetectionWebLabel) MarshalJSON() ([]byte, error) { 7309 type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebLabel 7310 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7311 } 7312 7313 // GoogleCloudVisionV1p3beta1WebDetectionWebPage: Metadata for web pages. 7314 type GoogleCloudVisionV1p3beta1WebDetectionWebPage struct { 7315 // FullMatchingImages: Fully matching images on the page. Can include resized 7316 // copies of the query image. 7317 FullMatchingImages []*GoogleCloudVisionV1p3beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"` 7318 // PageTitle: Title for the web page, may contain HTML markups. 7319 PageTitle string `json:"pageTitle,omitempty"` 7320 // PartialMatchingImages: Partial matching images on the page. Those images are 7321 // similar enough to share some key-point features. For example an original 7322 // image will likely have partial matching for its crops. 7323 PartialMatchingImages []*GoogleCloudVisionV1p3beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"` 7324 // Score: (Deprecated) Overall relevancy score for the web page. 7325 Score float64 `json:"score,omitempty"` 7326 // Url: The result web page URL. 7327 Url string `json:"url,omitempty"` 7328 // ForceSendFields is a list of field names (e.g. "FullMatchingImages") to 7329 // unconditionally include in API requests. By default, fields with empty or 7330 // default values are omitted from API requests. See 7331 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7332 // details. 7333 ForceSendFields []string `json:"-"` 7334 // NullFields is a list of field names (e.g. "FullMatchingImages") to include 7335 // in API requests with the JSON null value. By default, fields with empty 7336 // values are omitted from API requests. See 7337 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7338 NullFields []string `json:"-"` 7339 } 7340 7341 func (s *GoogleCloudVisionV1p3beta1WebDetectionWebPage) MarshalJSON() ([]byte, error) { 7342 type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebPage 7343 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7344 } 7345 7346 func (s *GoogleCloudVisionV1p3beta1WebDetectionWebPage) UnmarshalJSON(data []byte) error { 7347 type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebPage 7348 var s1 struct { 7349 Score gensupport.JSONFloat64 `json:"score"` 7350 *NoMethod 7351 } 7352 s1.NoMethod = (*NoMethod)(s) 7353 if err := json.Unmarshal(data, &s1); err != nil { 7354 return err 7355 } 7356 s.Score = float64(s1.Score) 7357 return nil 7358 } 7359 7360 // GoogleCloudVisionV1p3beta1Word: A word representation. 7361 type GoogleCloudVisionV1p3beta1Word struct { 7362 // BoundingBox: The bounding box for the word. The vertices are in the order of 7363 // top-left, top-right, bottom-right, bottom-left. When a rotation of the 7364 // bounding box is detected the rotation is represented as around the top-left 7365 // corner as defined when the text is read in the 'natural' orientation. For 7366 // example: * when the text is horizontal it might look like: 0----1 | | 3----2 7367 // * when it's rotated 180 degrees around the top-left corner it becomes: 7368 // 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 3). 7369 BoundingBox *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingBox,omitempty"` 7370 // Confidence: Confidence of the OCR results for the word. Range [0, 1]. 7371 Confidence float64 `json:"confidence,omitempty"` 7372 // Property: Additional information detected for the word. 7373 Property *GoogleCloudVisionV1p3beta1TextAnnotationTextProperty `json:"property,omitempty"` 7374 // Symbols: List of symbols in the word. The order of the symbols follows the 7375 // natural reading order. 7376 Symbols []*GoogleCloudVisionV1p3beta1Symbol `json:"symbols,omitempty"` 7377 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 7378 // unconditionally include in API requests. By default, fields with empty or 7379 // default values are omitted from API requests. See 7380 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7381 // details. 7382 ForceSendFields []string `json:"-"` 7383 // NullFields is a list of field names (e.g. "BoundingBox") to include in API 7384 // requests with the JSON null value. By default, fields with empty values are 7385 // omitted from API requests. See 7386 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7387 NullFields []string `json:"-"` 7388 } 7389 7390 func (s *GoogleCloudVisionV1p3beta1Word) MarshalJSON() ([]byte, error) { 7391 type NoMethod GoogleCloudVisionV1p3beta1Word 7392 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7393 } 7394 7395 func (s *GoogleCloudVisionV1p3beta1Word) UnmarshalJSON(data []byte) error { 7396 type NoMethod GoogleCloudVisionV1p3beta1Word 7397 var s1 struct { 7398 Confidence gensupport.JSONFloat64 `json:"confidence"` 7399 *NoMethod 7400 } 7401 s1.NoMethod = (*NoMethod)(s) 7402 if err := json.Unmarshal(data, &s1); err != nil { 7403 return err 7404 } 7405 s.Confidence = float64(s1.Confidence) 7406 return nil 7407 } 7408 7409 // GoogleCloudVisionV1p4beta1AnnotateFileResponse: Response to a single file 7410 // annotation request. A file may contain one or more images, which 7411 // individually have their own responses. 7412 type GoogleCloudVisionV1p4beta1AnnotateFileResponse struct { 7413 // Error: If set, represents the error message for the failed request. The 7414 // `responses` field will not be set in this case. 7415 Error *Status `json:"error,omitempty"` 7416 // InputConfig: Information about the file for which this response is 7417 // generated. 7418 InputConfig *GoogleCloudVisionV1p4beta1InputConfig `json:"inputConfig,omitempty"` 7419 // Responses: Individual responses to images found within the file. This field 7420 // will be empty if the `error` field is set. 7421 Responses []*GoogleCloudVisionV1p4beta1AnnotateImageResponse `json:"responses,omitempty"` 7422 // TotalPages: This field gives the total number of pages in the file. 7423 TotalPages int64 `json:"totalPages,omitempty"` 7424 // ForceSendFields is a list of field names (e.g. "Error") to unconditionally 7425 // include in API requests. By default, fields with empty or default values are 7426 // omitted from API requests. See 7427 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7428 // details. 7429 ForceSendFields []string `json:"-"` 7430 // NullFields is a list of field names (e.g. "Error") to include in API 7431 // requests with the JSON null value. By default, fields with empty values are 7432 // omitted from API requests. See 7433 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7434 NullFields []string `json:"-"` 7435 } 7436 7437 func (s *GoogleCloudVisionV1p4beta1AnnotateFileResponse) MarshalJSON() ([]byte, error) { 7438 type NoMethod GoogleCloudVisionV1p4beta1AnnotateFileResponse 7439 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7440 } 7441 7442 // GoogleCloudVisionV1p4beta1AnnotateImageResponse: Response to an image 7443 // annotation request. 7444 type GoogleCloudVisionV1p4beta1AnnotateImageResponse struct { 7445 // Context: If present, contextual information is needed to understand where 7446 // this image comes from. 7447 Context *GoogleCloudVisionV1p4beta1ImageAnnotationContext `json:"context,omitempty"` 7448 // CropHintsAnnotation: If present, crop hints have completed successfully. 7449 CropHintsAnnotation *GoogleCloudVisionV1p4beta1CropHintsAnnotation `json:"cropHintsAnnotation,omitempty"` 7450 // Error: If set, represents the error message for the operation. Note that 7451 // filled-in image annotations are guaranteed to be correct, even when `error` 7452 // is set. 7453 Error *Status `json:"error,omitempty"` 7454 // FaceAnnotations: If present, face detection has completed successfully. 7455 FaceAnnotations []*GoogleCloudVisionV1p4beta1FaceAnnotation `json:"faceAnnotations,omitempty"` 7456 // FullTextAnnotation: If present, text (OCR) detection or document (OCR) text 7457 // detection has completed successfully. This annotation provides the 7458 // structural hierarchy for the OCR detected text. 7459 FullTextAnnotation *GoogleCloudVisionV1p4beta1TextAnnotation `json:"fullTextAnnotation,omitempty"` 7460 // ImagePropertiesAnnotation: If present, image properties were extracted 7461 // successfully. 7462 ImagePropertiesAnnotation *GoogleCloudVisionV1p4beta1ImageProperties `json:"imagePropertiesAnnotation,omitempty"` 7463 // LabelAnnotations: If present, label detection has completed successfully. 7464 LabelAnnotations []*GoogleCloudVisionV1p4beta1EntityAnnotation `json:"labelAnnotations,omitempty"` 7465 // LandmarkAnnotations: If present, landmark detection has completed 7466 // successfully. 7467 LandmarkAnnotations []*GoogleCloudVisionV1p4beta1EntityAnnotation `json:"landmarkAnnotations,omitempty"` 7468 // LocalizedObjectAnnotations: If present, localized object detection has 7469 // completed successfully. This will be sorted descending by confidence score. 7470 LocalizedObjectAnnotations []*GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation `json:"localizedObjectAnnotations,omitempty"` 7471 // LogoAnnotations: If present, logo detection has completed successfully. 7472 LogoAnnotations []*GoogleCloudVisionV1p4beta1EntityAnnotation `json:"logoAnnotations,omitempty"` 7473 // ProductSearchResults: If present, product search has completed successfully. 7474 ProductSearchResults *GoogleCloudVisionV1p4beta1ProductSearchResults `json:"productSearchResults,omitempty"` 7475 // SafeSearchAnnotation: If present, safe-search annotation has completed 7476 // successfully. 7477 SafeSearchAnnotation *GoogleCloudVisionV1p4beta1SafeSearchAnnotation `json:"safeSearchAnnotation,omitempty"` 7478 // TextAnnotations: If present, text (OCR) detection has completed 7479 // successfully. 7480 TextAnnotations []*GoogleCloudVisionV1p4beta1EntityAnnotation `json:"textAnnotations,omitempty"` 7481 // WebDetection: If present, web detection has completed successfully. 7482 WebDetection *GoogleCloudVisionV1p4beta1WebDetection `json:"webDetection,omitempty"` 7483 // ForceSendFields is a list of field names (e.g. "Context") to unconditionally 7484 // include in API requests. By default, fields with empty or default values are 7485 // omitted from API requests. See 7486 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7487 // details. 7488 ForceSendFields []string `json:"-"` 7489 // NullFields is a list of field names (e.g. "Context") to include in API 7490 // requests with the JSON null value. By default, fields with empty values are 7491 // omitted from API requests. See 7492 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7493 NullFields []string `json:"-"` 7494 } 7495 7496 func (s *GoogleCloudVisionV1p4beta1AnnotateImageResponse) MarshalJSON() ([]byte, error) { 7497 type NoMethod GoogleCloudVisionV1p4beta1AnnotateImageResponse 7498 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7499 } 7500 7501 // GoogleCloudVisionV1p4beta1AsyncAnnotateFileResponse: The response for a 7502 // single offline file annotation request. 7503 type GoogleCloudVisionV1p4beta1AsyncAnnotateFileResponse struct { 7504 // OutputConfig: The output location and metadata from 7505 // AsyncAnnotateFileRequest. 7506 OutputConfig *GoogleCloudVisionV1p4beta1OutputConfig `json:"outputConfig,omitempty"` 7507 // ForceSendFields is a list of field names (e.g. "OutputConfig") to 7508 // unconditionally include in API requests. By default, fields with empty or 7509 // default values are omitted from API requests. See 7510 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7511 // details. 7512 ForceSendFields []string `json:"-"` 7513 // NullFields is a list of field names (e.g. "OutputConfig") to include in API 7514 // requests with the JSON null value. By default, fields with empty values are 7515 // omitted from API requests. See 7516 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7517 NullFields []string `json:"-"` 7518 } 7519 7520 func (s *GoogleCloudVisionV1p4beta1AsyncAnnotateFileResponse) MarshalJSON() ([]byte, error) { 7521 type NoMethod GoogleCloudVisionV1p4beta1AsyncAnnotateFileResponse 7522 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7523 } 7524 7525 // GoogleCloudVisionV1p4beta1AsyncBatchAnnotateFilesResponse: Response to an 7526 // async batch file annotation request. 7527 type GoogleCloudVisionV1p4beta1AsyncBatchAnnotateFilesResponse struct { 7528 // Responses: The list of file annotation responses, one for each request in 7529 // AsyncBatchAnnotateFilesRequest. 7530 Responses []*GoogleCloudVisionV1p4beta1AsyncAnnotateFileResponse `json:"responses,omitempty"` 7531 // ForceSendFields is a list of field names (e.g. "Responses") to 7532 // unconditionally include in API requests. By default, fields with empty or 7533 // default values are omitted from API requests. See 7534 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7535 // details. 7536 ForceSendFields []string `json:"-"` 7537 // NullFields is a list of field names (e.g. "Responses") to include in API 7538 // requests with the JSON null value. By default, fields with empty values are 7539 // omitted from API requests. See 7540 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7541 NullFields []string `json:"-"` 7542 } 7543 7544 func (s *GoogleCloudVisionV1p4beta1AsyncBatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) { 7545 type NoMethod GoogleCloudVisionV1p4beta1AsyncBatchAnnotateFilesResponse 7546 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7547 } 7548 7549 // GoogleCloudVisionV1p4beta1AsyncBatchAnnotateImagesResponse: Response to an 7550 // async batch image annotation request. 7551 type GoogleCloudVisionV1p4beta1AsyncBatchAnnotateImagesResponse struct { 7552 // OutputConfig: The output location and metadata from 7553 // AsyncBatchAnnotateImagesRequest. 7554 OutputConfig *GoogleCloudVisionV1p4beta1OutputConfig `json:"outputConfig,omitempty"` 7555 // ForceSendFields is a list of field names (e.g. "OutputConfig") to 7556 // unconditionally include in API requests. By default, fields with empty or 7557 // default values are omitted from API requests. See 7558 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7559 // details. 7560 ForceSendFields []string `json:"-"` 7561 // NullFields is a list of field names (e.g. "OutputConfig") to include in API 7562 // requests with the JSON null value. By default, fields with empty values are 7563 // omitted from API requests. See 7564 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7565 NullFields []string `json:"-"` 7566 } 7567 7568 func (s *GoogleCloudVisionV1p4beta1AsyncBatchAnnotateImagesResponse) MarshalJSON() ([]byte, error) { 7569 type NoMethod GoogleCloudVisionV1p4beta1AsyncBatchAnnotateImagesResponse 7570 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7571 } 7572 7573 // GoogleCloudVisionV1p4beta1BatchAnnotateFilesResponse: A list of file 7574 // annotation responses. 7575 type GoogleCloudVisionV1p4beta1BatchAnnotateFilesResponse struct { 7576 // Responses: The list of file annotation responses, each response 7577 // corresponding to each AnnotateFileRequest in BatchAnnotateFilesRequest. 7578 Responses []*GoogleCloudVisionV1p4beta1AnnotateFileResponse `json:"responses,omitempty"` 7579 // ForceSendFields is a list of field names (e.g. "Responses") to 7580 // unconditionally include in API requests. By default, fields with empty or 7581 // default values are omitted from API requests. See 7582 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7583 // details. 7584 ForceSendFields []string `json:"-"` 7585 // NullFields is a list of field names (e.g. "Responses") to include in API 7586 // requests with the JSON null value. By default, fields with empty values are 7587 // omitted from API requests. See 7588 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7589 NullFields []string `json:"-"` 7590 } 7591 7592 func (s *GoogleCloudVisionV1p4beta1BatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) { 7593 type NoMethod GoogleCloudVisionV1p4beta1BatchAnnotateFilesResponse 7594 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7595 } 7596 7597 // GoogleCloudVisionV1p4beta1BatchOperationMetadata: Metadata for the batch 7598 // operations such as the current state. This is included in the `metadata` 7599 // field of the `Operation` returned by the `GetOperation` call of the 7600 // `google::longrunning::Operations` service. 7601 type GoogleCloudVisionV1p4beta1BatchOperationMetadata struct { 7602 // EndTime: The time when the batch request is finished and 7603 // google.longrunning.Operation.done is set to true. 7604 EndTime string `json:"endTime,omitempty"` 7605 // State: The current state of the batch operation. 7606 // 7607 // Possible values: 7608 // "STATE_UNSPECIFIED" - Invalid. 7609 // "PROCESSING" - Request is actively being processed. 7610 // "SUCCESSFUL" - The request is done and at least one item has been 7611 // successfully processed. 7612 // "FAILED" - The request is done and no item has been successfully 7613 // processed. 7614 // "CANCELLED" - The request is done after the 7615 // longrunning.Operations.CancelOperation has been called by the user. Any 7616 // records that were processed before the cancel command are output as 7617 // specified in the request. 7618 State string `json:"state,omitempty"` 7619 // SubmitTime: The time when the batch request was submitted to the server. 7620 SubmitTime string `json:"submitTime,omitempty"` 7621 // ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally 7622 // include in API requests. By default, fields with empty or default values are 7623 // omitted from API requests. See 7624 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7625 // details. 7626 ForceSendFields []string `json:"-"` 7627 // NullFields is a list of field names (e.g. "EndTime") to include in API 7628 // requests with the JSON null value. By default, fields with empty values are 7629 // omitted from API requests. See 7630 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7631 NullFields []string `json:"-"` 7632 } 7633 7634 func (s *GoogleCloudVisionV1p4beta1BatchOperationMetadata) MarshalJSON() ([]byte, error) { 7635 type NoMethod GoogleCloudVisionV1p4beta1BatchOperationMetadata 7636 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7637 } 7638 7639 // GoogleCloudVisionV1p4beta1Block: Logical element on the page. 7640 type GoogleCloudVisionV1p4beta1Block struct { 7641 // BlockType: Detected block type (text, image etc) for this block. 7642 // 7643 // Possible values: 7644 // "UNKNOWN" - Unknown block type. 7645 // "TEXT" - Regular text block. 7646 // "TABLE" - Table block. 7647 // "PICTURE" - Image block. 7648 // "RULER" - Horizontal/vertical line box. 7649 // "BARCODE" - Barcode block. 7650 BlockType string `json:"blockType,omitempty"` 7651 // BoundingBox: The bounding box for the block. The vertices are in the order 7652 // of top-left, top-right, bottom-right, bottom-left. When a rotation of the 7653 // bounding box is detected the rotation is represented as around the top-left 7654 // corner as defined when the text is read in the 'natural' orientation. For 7655 // example: * when the text is horizontal it might look like: 0----1 | | 3----2 7656 // * when it's rotated 180 degrees around the top-left corner it becomes: 7657 // 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 3). 7658 BoundingBox *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingBox,omitempty"` 7659 // Confidence: Confidence of the OCR results on the block. Range [0, 1]. 7660 Confidence float64 `json:"confidence,omitempty"` 7661 // Paragraphs: List of paragraphs in this block (if this blocks is of type 7662 // text). 7663 Paragraphs []*GoogleCloudVisionV1p4beta1Paragraph `json:"paragraphs,omitempty"` 7664 // Property: Additional information detected for the block. 7665 Property *GoogleCloudVisionV1p4beta1TextAnnotationTextProperty `json:"property,omitempty"` 7666 // ForceSendFields is a list of field names (e.g. "BlockType") to 7667 // unconditionally include in API requests. By default, fields with empty or 7668 // default values are omitted from API requests. See 7669 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7670 // details. 7671 ForceSendFields []string `json:"-"` 7672 // NullFields is a list of field names (e.g. "BlockType") to include in API 7673 // requests with the JSON null value. By default, fields with empty values are 7674 // omitted from API requests. See 7675 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7676 NullFields []string `json:"-"` 7677 } 7678 7679 func (s *GoogleCloudVisionV1p4beta1Block) MarshalJSON() ([]byte, error) { 7680 type NoMethod GoogleCloudVisionV1p4beta1Block 7681 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7682 } 7683 7684 func (s *GoogleCloudVisionV1p4beta1Block) UnmarshalJSON(data []byte) error { 7685 type NoMethod GoogleCloudVisionV1p4beta1Block 7686 var s1 struct { 7687 Confidence gensupport.JSONFloat64 `json:"confidence"` 7688 *NoMethod 7689 } 7690 s1.NoMethod = (*NoMethod)(s) 7691 if err := json.Unmarshal(data, &s1); err != nil { 7692 return err 7693 } 7694 s.Confidence = float64(s1.Confidence) 7695 return nil 7696 } 7697 7698 // GoogleCloudVisionV1p4beta1BoundingPoly: A bounding polygon for the detected 7699 // image annotation. 7700 type GoogleCloudVisionV1p4beta1BoundingPoly struct { 7701 // NormalizedVertices: The bounding polygon normalized vertices. 7702 NormalizedVertices []*GoogleCloudVisionV1p4beta1NormalizedVertex `json:"normalizedVertices,omitempty"` 7703 // Vertices: The bounding polygon vertices. 7704 Vertices []*GoogleCloudVisionV1p4beta1Vertex `json:"vertices,omitempty"` 7705 // ForceSendFields is a list of field names (e.g. "NormalizedVertices") to 7706 // unconditionally include in API requests. By default, fields with empty or 7707 // default values are omitted from API requests. See 7708 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7709 // details. 7710 ForceSendFields []string `json:"-"` 7711 // NullFields is a list of field names (e.g. "NormalizedVertices") to include 7712 // in API requests with the JSON null value. By default, fields with empty 7713 // values are omitted from API requests. See 7714 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7715 NullFields []string `json:"-"` 7716 } 7717 7718 func (s *GoogleCloudVisionV1p4beta1BoundingPoly) MarshalJSON() ([]byte, error) { 7719 type NoMethod GoogleCloudVisionV1p4beta1BoundingPoly 7720 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7721 } 7722 7723 // GoogleCloudVisionV1p4beta1Celebrity: A Celebrity is a group of Faces with an 7724 // identity. 7725 type GoogleCloudVisionV1p4beta1Celebrity struct { 7726 // Description: The Celebrity's description. 7727 Description string `json:"description,omitempty"` 7728 // DisplayName: The Celebrity's display name. 7729 DisplayName string `json:"displayName,omitempty"` 7730 // Name: The resource name of the preloaded Celebrity. Has the format 7731 // `builtin/{mid}`. 7732 Name string `json:"name,omitempty"` 7733 // ForceSendFields is a list of field names (e.g. "Description") to 7734 // unconditionally include in API requests. By default, fields with empty or 7735 // default values are omitted from API requests. See 7736 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7737 // details. 7738 ForceSendFields []string `json:"-"` 7739 // NullFields is a list of field names (e.g. "Description") to include in API 7740 // requests with the JSON null value. By default, fields with empty values are 7741 // omitted from API requests. See 7742 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7743 NullFields []string `json:"-"` 7744 } 7745 7746 func (s *GoogleCloudVisionV1p4beta1Celebrity) MarshalJSON() ([]byte, error) { 7747 type NoMethod GoogleCloudVisionV1p4beta1Celebrity 7748 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7749 } 7750 7751 // GoogleCloudVisionV1p4beta1ColorInfo: Color information consists of RGB 7752 // channels, score, and the fraction of the image that the color occupies in 7753 // the image. 7754 type GoogleCloudVisionV1p4beta1ColorInfo struct { 7755 // Color: RGB components of the color. 7756 Color *Color `json:"color,omitempty"` 7757 // PixelFraction: The fraction of pixels the color occupies in the image. Value 7758 // in range [0, 1]. 7759 PixelFraction float64 `json:"pixelFraction,omitempty"` 7760 // Score: Image-specific score for this color. Value in range [0, 1]. 7761 Score float64 `json:"score,omitempty"` 7762 // ForceSendFields is a list of field names (e.g. "Color") to unconditionally 7763 // include in API requests. By default, fields with empty or default values are 7764 // omitted from API requests. See 7765 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7766 // details. 7767 ForceSendFields []string `json:"-"` 7768 // NullFields is a list of field names (e.g. "Color") to include in API 7769 // requests with the JSON null value. By default, fields with empty values are 7770 // omitted from API requests. See 7771 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7772 NullFields []string `json:"-"` 7773 } 7774 7775 func (s *GoogleCloudVisionV1p4beta1ColorInfo) MarshalJSON() ([]byte, error) { 7776 type NoMethod GoogleCloudVisionV1p4beta1ColorInfo 7777 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7778 } 7779 7780 func (s *GoogleCloudVisionV1p4beta1ColorInfo) UnmarshalJSON(data []byte) error { 7781 type NoMethod GoogleCloudVisionV1p4beta1ColorInfo 7782 var s1 struct { 7783 PixelFraction gensupport.JSONFloat64 `json:"pixelFraction"` 7784 Score gensupport.JSONFloat64 `json:"score"` 7785 *NoMethod 7786 } 7787 s1.NoMethod = (*NoMethod)(s) 7788 if err := json.Unmarshal(data, &s1); err != nil { 7789 return err 7790 } 7791 s.PixelFraction = float64(s1.PixelFraction) 7792 s.Score = float64(s1.Score) 7793 return nil 7794 } 7795 7796 // GoogleCloudVisionV1p4beta1CropHint: Single crop hint that is used to 7797 // generate a new crop when serving an image. 7798 type GoogleCloudVisionV1p4beta1CropHint struct { 7799 // BoundingPoly: The bounding polygon for the crop region. The coordinates of 7800 // the bounding box are in the original image's scale. 7801 BoundingPoly *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingPoly,omitempty"` 7802 // Confidence: Confidence of this being a salient region. Range [0, 1]. 7803 Confidence float64 `json:"confidence,omitempty"` 7804 // ImportanceFraction: Fraction of importance of this salient region with 7805 // respect to the original image. 7806 ImportanceFraction float64 `json:"importanceFraction,omitempty"` 7807 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 7808 // unconditionally include in API requests. By default, fields with empty or 7809 // default values are omitted from API requests. See 7810 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7811 // details. 7812 ForceSendFields []string `json:"-"` 7813 // NullFields is a list of field names (e.g. "BoundingPoly") to include in API 7814 // requests with the JSON null value. By default, fields with empty values are 7815 // omitted from API requests. See 7816 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7817 NullFields []string `json:"-"` 7818 } 7819 7820 func (s *GoogleCloudVisionV1p4beta1CropHint) MarshalJSON() ([]byte, error) { 7821 type NoMethod GoogleCloudVisionV1p4beta1CropHint 7822 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7823 } 7824 7825 func (s *GoogleCloudVisionV1p4beta1CropHint) UnmarshalJSON(data []byte) error { 7826 type NoMethod GoogleCloudVisionV1p4beta1CropHint 7827 var s1 struct { 7828 Confidence gensupport.JSONFloat64 `json:"confidence"` 7829 ImportanceFraction gensupport.JSONFloat64 `json:"importanceFraction"` 7830 *NoMethod 7831 } 7832 s1.NoMethod = (*NoMethod)(s) 7833 if err := json.Unmarshal(data, &s1); err != nil { 7834 return err 7835 } 7836 s.Confidence = float64(s1.Confidence) 7837 s.ImportanceFraction = float64(s1.ImportanceFraction) 7838 return nil 7839 } 7840 7841 // GoogleCloudVisionV1p4beta1CropHintsAnnotation: Set of crop hints that are 7842 // used to generate new crops when serving images. 7843 type GoogleCloudVisionV1p4beta1CropHintsAnnotation struct { 7844 // CropHints: Crop hint results. 7845 CropHints []*GoogleCloudVisionV1p4beta1CropHint `json:"cropHints,omitempty"` 7846 // ForceSendFields is a list of field names (e.g. "CropHints") to 7847 // unconditionally include in API requests. By default, fields with empty or 7848 // default values are omitted from API requests. See 7849 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7850 // details. 7851 ForceSendFields []string `json:"-"` 7852 // NullFields is a list of field names (e.g. "CropHints") to include in API 7853 // requests with the JSON null value. By default, fields with empty values are 7854 // omitted from API requests. See 7855 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7856 NullFields []string `json:"-"` 7857 } 7858 7859 func (s *GoogleCloudVisionV1p4beta1CropHintsAnnotation) MarshalJSON() ([]byte, error) { 7860 type NoMethod GoogleCloudVisionV1p4beta1CropHintsAnnotation 7861 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7862 } 7863 7864 // GoogleCloudVisionV1p4beta1DominantColorsAnnotation: Set of dominant colors 7865 // and their corresponding scores. 7866 type GoogleCloudVisionV1p4beta1DominantColorsAnnotation struct { 7867 // Colors: RGB color values with their score and pixel fraction. 7868 Colors []*GoogleCloudVisionV1p4beta1ColorInfo `json:"colors,omitempty"` 7869 // ForceSendFields is a list of field names (e.g. "Colors") to unconditionally 7870 // include in API requests. By default, fields with empty or default values are 7871 // omitted from API requests. See 7872 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7873 // details. 7874 ForceSendFields []string `json:"-"` 7875 // NullFields is a list of field names (e.g. "Colors") to include in API 7876 // requests with the JSON null value. By default, fields with empty values are 7877 // omitted from API requests. See 7878 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7879 NullFields []string `json:"-"` 7880 } 7881 7882 func (s *GoogleCloudVisionV1p4beta1DominantColorsAnnotation) MarshalJSON() ([]byte, error) { 7883 type NoMethod GoogleCloudVisionV1p4beta1DominantColorsAnnotation 7884 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7885 } 7886 7887 // GoogleCloudVisionV1p4beta1EntityAnnotation: Set of detected entity features. 7888 type GoogleCloudVisionV1p4beta1EntityAnnotation struct { 7889 // BoundingPoly: Image region to which this entity belongs. Not produced for 7890 // `LABEL_DETECTION` features. 7891 BoundingPoly *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingPoly,omitempty"` 7892 // Confidence: **Deprecated. Use `score` instead.** The accuracy of the entity 7893 // detection in an image. For example, for an image in which the "Eiffel Tower" 7894 // entity is detected, this field represents the confidence that there is a 7895 // tower in the query image. Range [0, 1]. 7896 Confidence float64 `json:"confidence,omitempty"` 7897 // Description: Entity textual description, expressed in its `locale` language. 7898 Description string `json:"description,omitempty"` 7899 // Locale: The language code for the locale in which the entity textual 7900 // `description` is expressed. 7901 Locale string `json:"locale,omitempty"` 7902 // Locations: The location information for the detected entity. Multiple 7903 // `LocationInfo` elements can be present because one location may indicate the 7904 // location of the scene in the image, and another location may indicate the 7905 // location of the place where the image was taken. Location information is 7906 // usually present for landmarks. 7907 Locations []*GoogleCloudVisionV1p4beta1LocationInfo `json:"locations,omitempty"` 7908 // Mid: Opaque entity ID. Some IDs may be available in Google Knowledge Graph 7909 // Search API (https://developers.google.com/knowledge-graph/). 7910 Mid string `json:"mid,omitempty"` 7911 // Properties: Some entities may have optional user-supplied `Property` 7912 // (name/value) fields, such a score or string that qualifies the entity. 7913 Properties []*GoogleCloudVisionV1p4beta1Property `json:"properties,omitempty"` 7914 // Score: Overall score of the result. Range [0, 1]. 7915 Score float64 `json:"score,omitempty"` 7916 // Topicality: The relevancy of the ICA (Image Content Annotation) label to the 7917 // image. For example, the relevancy of "tower" is likely higher to an image 7918 // containing the detected "Eiffel Tower" than to an image containing a 7919 // detected distant towering building, even though the confidence that there is 7920 // a tower in each image may be the same. Range [0, 1]. 7921 Topicality float64 `json:"topicality,omitempty"` 7922 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 7923 // unconditionally include in API requests. By default, fields with empty or 7924 // default values are omitted from API requests. See 7925 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7926 // details. 7927 ForceSendFields []string `json:"-"` 7928 // NullFields is a list of field names (e.g. "BoundingPoly") to include in API 7929 // requests with the JSON null value. By default, fields with empty values are 7930 // omitted from API requests. See 7931 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7932 NullFields []string `json:"-"` 7933 } 7934 7935 func (s *GoogleCloudVisionV1p4beta1EntityAnnotation) MarshalJSON() ([]byte, error) { 7936 type NoMethod GoogleCloudVisionV1p4beta1EntityAnnotation 7937 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7938 } 7939 7940 func (s *GoogleCloudVisionV1p4beta1EntityAnnotation) UnmarshalJSON(data []byte) error { 7941 type NoMethod GoogleCloudVisionV1p4beta1EntityAnnotation 7942 var s1 struct { 7943 Confidence gensupport.JSONFloat64 `json:"confidence"` 7944 Score gensupport.JSONFloat64 `json:"score"` 7945 Topicality gensupport.JSONFloat64 `json:"topicality"` 7946 *NoMethod 7947 } 7948 s1.NoMethod = (*NoMethod)(s) 7949 if err := json.Unmarshal(data, &s1); err != nil { 7950 return err 7951 } 7952 s.Confidence = float64(s1.Confidence) 7953 s.Score = float64(s1.Score) 7954 s.Topicality = float64(s1.Topicality) 7955 return nil 7956 } 7957 7958 // GoogleCloudVisionV1p4beta1FaceAnnotation: A face annotation object contains 7959 // the results of face detection. 7960 type GoogleCloudVisionV1p4beta1FaceAnnotation struct { 7961 // AngerLikelihood: Anger likelihood. 7962 // 7963 // Possible values: 7964 // "UNKNOWN" - Unknown likelihood. 7965 // "VERY_UNLIKELY" - It is very unlikely. 7966 // "UNLIKELY" - It is unlikely. 7967 // "POSSIBLE" - It is possible. 7968 // "LIKELY" - It is likely. 7969 // "VERY_LIKELY" - It is very likely. 7970 AngerLikelihood string `json:"angerLikelihood,omitempty"` 7971 // BlurredLikelihood: Blurred likelihood. 7972 // 7973 // Possible values: 7974 // "UNKNOWN" - Unknown likelihood. 7975 // "VERY_UNLIKELY" - It is very unlikely. 7976 // "UNLIKELY" - It is unlikely. 7977 // "POSSIBLE" - It is possible. 7978 // "LIKELY" - It is likely. 7979 // "VERY_LIKELY" - It is very likely. 7980 BlurredLikelihood string `json:"blurredLikelihood,omitempty"` 7981 // BoundingPoly: The bounding polygon around the face. The coordinates of the 7982 // bounding box are in the original image's scale. The bounding box is computed 7983 // to "frame" the face in accordance with human expectations. It is based on 7984 // the landmarker results. Note that one or more x and/or y coordinates may not 7985 // be generated in the `BoundingPoly` (the polygon will be unbounded) if only a 7986 // partial face appears in the image to be annotated. 7987 BoundingPoly *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingPoly,omitempty"` 7988 // DetectionConfidence: Detection confidence. Range [0, 1]. 7989 DetectionConfidence float64 `json:"detectionConfidence,omitempty"` 7990 // FdBoundingPoly: The `fd_bounding_poly` bounding polygon is tighter than the 7991 // `boundingPoly`, and encloses only the skin part of the face. Typically, it 7992 // is used to eliminate the face from any image analysis that detects the 7993 // "amount of skin" visible in an image. It is not based on the landmarker 7994 // results, only on the initial face detection, hence the fd (face detection) 7995 // prefix. 7996 FdBoundingPoly *GoogleCloudVisionV1p4beta1BoundingPoly `json:"fdBoundingPoly,omitempty"` 7997 // HeadwearLikelihood: Headwear likelihood. 7998 // 7999 // Possible values: 8000 // "UNKNOWN" - Unknown likelihood. 8001 // "VERY_UNLIKELY" - It is very unlikely. 8002 // "UNLIKELY" - It is unlikely. 8003 // "POSSIBLE" - It is possible. 8004 // "LIKELY" - It is likely. 8005 // "VERY_LIKELY" - It is very likely. 8006 HeadwearLikelihood string `json:"headwearLikelihood,omitempty"` 8007 // JoyLikelihood: Joy likelihood. 8008 // 8009 // Possible values: 8010 // "UNKNOWN" - Unknown likelihood. 8011 // "VERY_UNLIKELY" - It is very unlikely. 8012 // "UNLIKELY" - It is unlikely. 8013 // "POSSIBLE" - It is possible. 8014 // "LIKELY" - It is likely. 8015 // "VERY_LIKELY" - It is very likely. 8016 JoyLikelihood string `json:"joyLikelihood,omitempty"` 8017 // LandmarkingConfidence: Face landmarking confidence. Range [0, 1]. 8018 LandmarkingConfidence float64 `json:"landmarkingConfidence,omitempty"` 8019 // Landmarks: Detected face landmarks. 8020 Landmarks []*GoogleCloudVisionV1p4beta1FaceAnnotationLandmark `json:"landmarks,omitempty"` 8021 // PanAngle: Yaw angle, which indicates the leftward/rightward angle that the 8022 // face is pointing relative to the vertical plane perpendicular to the image. 8023 // Range [-180,180]. 8024 PanAngle float64 `json:"panAngle,omitempty"` 8025 // RecognitionResult: Additional recognition information. Only computed if 8026 // image_context.face_recognition_params is provided, **and** a match is found 8027 // to a Celebrity in the input CelebritySet. This field is sorted in order of 8028 // decreasing confidence values. 8029 RecognitionResult []*GoogleCloudVisionV1p4beta1FaceRecognitionResult `json:"recognitionResult,omitempty"` 8030 // RollAngle: Roll angle, which indicates the amount of 8031 // clockwise/anti-clockwise rotation of the face relative to the image vertical 8032 // about the axis perpendicular to the face. Range [-180,180]. 8033 RollAngle float64 `json:"rollAngle,omitempty"` 8034 // SorrowLikelihood: Sorrow likelihood. 8035 // 8036 // Possible values: 8037 // "UNKNOWN" - Unknown likelihood. 8038 // "VERY_UNLIKELY" - It is very unlikely. 8039 // "UNLIKELY" - It is unlikely. 8040 // "POSSIBLE" - It is possible. 8041 // "LIKELY" - It is likely. 8042 // "VERY_LIKELY" - It is very likely. 8043 SorrowLikelihood string `json:"sorrowLikelihood,omitempty"` 8044 // SurpriseLikelihood: Surprise likelihood. 8045 // 8046 // Possible values: 8047 // "UNKNOWN" - Unknown likelihood. 8048 // "VERY_UNLIKELY" - It is very unlikely. 8049 // "UNLIKELY" - It is unlikely. 8050 // "POSSIBLE" - It is possible. 8051 // "LIKELY" - It is likely. 8052 // "VERY_LIKELY" - It is very likely. 8053 SurpriseLikelihood string `json:"surpriseLikelihood,omitempty"` 8054 // TiltAngle: Pitch angle, which indicates the upwards/downwards angle that the 8055 // face is pointing relative to the image's horizontal plane. Range [-180,180]. 8056 TiltAngle float64 `json:"tiltAngle,omitempty"` 8057 // UnderExposedLikelihood: Under-exposed likelihood. 8058 // 8059 // Possible values: 8060 // "UNKNOWN" - Unknown likelihood. 8061 // "VERY_UNLIKELY" - It is very unlikely. 8062 // "UNLIKELY" - It is unlikely. 8063 // "POSSIBLE" - It is possible. 8064 // "LIKELY" - It is likely. 8065 // "VERY_LIKELY" - It is very likely. 8066 UnderExposedLikelihood string `json:"underExposedLikelihood,omitempty"` 8067 // ForceSendFields is a list of field names (e.g. "AngerLikelihood") to 8068 // unconditionally include in API requests. By default, fields with empty or 8069 // default values are omitted from API requests. See 8070 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8071 // details. 8072 ForceSendFields []string `json:"-"` 8073 // NullFields is a list of field names (e.g. "AngerLikelihood") to include in 8074 // API requests with the JSON null value. By default, fields with empty values 8075 // are omitted from API requests. See 8076 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8077 NullFields []string `json:"-"` 8078 } 8079 8080 func (s *GoogleCloudVisionV1p4beta1FaceAnnotation) MarshalJSON() ([]byte, error) { 8081 type NoMethod GoogleCloudVisionV1p4beta1FaceAnnotation 8082 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8083 } 8084 8085 func (s *GoogleCloudVisionV1p4beta1FaceAnnotation) UnmarshalJSON(data []byte) error { 8086 type NoMethod GoogleCloudVisionV1p4beta1FaceAnnotation 8087 var s1 struct { 8088 DetectionConfidence gensupport.JSONFloat64 `json:"detectionConfidence"` 8089 LandmarkingConfidence gensupport.JSONFloat64 `json:"landmarkingConfidence"` 8090 PanAngle gensupport.JSONFloat64 `json:"panAngle"` 8091 RollAngle gensupport.JSONFloat64 `json:"rollAngle"` 8092 TiltAngle gensupport.JSONFloat64 `json:"tiltAngle"` 8093 *NoMethod 8094 } 8095 s1.NoMethod = (*NoMethod)(s) 8096 if err := json.Unmarshal(data, &s1); err != nil { 8097 return err 8098 } 8099 s.DetectionConfidence = float64(s1.DetectionConfidence) 8100 s.LandmarkingConfidence = float64(s1.LandmarkingConfidence) 8101 s.PanAngle = float64(s1.PanAngle) 8102 s.RollAngle = float64(s1.RollAngle) 8103 s.TiltAngle = float64(s1.TiltAngle) 8104 return nil 8105 } 8106 8107 // GoogleCloudVisionV1p4beta1FaceAnnotationLandmark: A face-specific landmark 8108 // (for example, a face feature). 8109 type GoogleCloudVisionV1p4beta1FaceAnnotationLandmark struct { 8110 // Position: Face landmark position. 8111 Position *GoogleCloudVisionV1p4beta1Position `json:"position,omitempty"` 8112 // Type: Face landmark type. 8113 // 8114 // Possible values: 8115 // "UNKNOWN_LANDMARK" - Unknown face landmark detected. Should not be filled. 8116 // "LEFT_EYE" - Left eye. 8117 // "RIGHT_EYE" - Right eye. 8118 // "LEFT_OF_LEFT_EYEBROW" - Left of left eyebrow. 8119 // "RIGHT_OF_LEFT_EYEBROW" - Right of left eyebrow. 8120 // "LEFT_OF_RIGHT_EYEBROW" - Left of right eyebrow. 8121 // "RIGHT_OF_RIGHT_EYEBROW" - Right of right eyebrow. 8122 // "MIDPOINT_BETWEEN_EYES" - Midpoint between eyes. 8123 // "NOSE_TIP" - Nose tip. 8124 // "UPPER_LIP" - Upper lip. 8125 // "LOWER_LIP" - Lower lip. 8126 // "MOUTH_LEFT" - Mouth left. 8127 // "MOUTH_RIGHT" - Mouth right. 8128 // "MOUTH_CENTER" - Mouth center. 8129 // "NOSE_BOTTOM_RIGHT" - Nose, bottom right. 8130 // "NOSE_BOTTOM_LEFT" - Nose, bottom left. 8131 // "NOSE_BOTTOM_CENTER" - Nose, bottom center. 8132 // "LEFT_EYE_TOP_BOUNDARY" - Left eye, top boundary. 8133 // "LEFT_EYE_RIGHT_CORNER" - Left eye, right corner. 8134 // "LEFT_EYE_BOTTOM_BOUNDARY" - Left eye, bottom boundary. 8135 // "LEFT_EYE_LEFT_CORNER" - Left eye, left corner. 8136 // "RIGHT_EYE_TOP_BOUNDARY" - Right eye, top boundary. 8137 // "RIGHT_EYE_RIGHT_CORNER" - Right eye, right corner. 8138 // "RIGHT_EYE_BOTTOM_BOUNDARY" - Right eye, bottom boundary. 8139 // "RIGHT_EYE_LEFT_CORNER" - Right eye, left corner. 8140 // "LEFT_EYEBROW_UPPER_MIDPOINT" - Left eyebrow, upper midpoint. 8141 // "RIGHT_EYEBROW_UPPER_MIDPOINT" - Right eyebrow, upper midpoint. 8142 // "LEFT_EAR_TRAGION" - Left ear tragion. 8143 // "RIGHT_EAR_TRAGION" - Right ear tragion. 8144 // "LEFT_EYE_PUPIL" - Left eye pupil. 8145 // "RIGHT_EYE_PUPIL" - Right eye pupil. 8146 // "FOREHEAD_GLABELLA" - Forehead glabella. 8147 // "CHIN_GNATHION" - Chin gnathion. 8148 // "CHIN_LEFT_GONION" - Chin left gonion. 8149 // "CHIN_RIGHT_GONION" - Chin right gonion. 8150 // "LEFT_CHEEK_CENTER" - Left cheek center. 8151 // "RIGHT_CHEEK_CENTER" - Right cheek center. 8152 Type string `json:"type,omitempty"` 8153 // ForceSendFields is a list of field names (e.g. "Position") to 8154 // unconditionally include in API requests. By default, fields with empty or 8155 // default values are omitted from API requests. See 8156 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8157 // details. 8158 ForceSendFields []string `json:"-"` 8159 // NullFields is a list of field names (e.g. "Position") to include in API 8160 // requests with the JSON null value. By default, fields with empty values are 8161 // omitted from API requests. See 8162 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8163 NullFields []string `json:"-"` 8164 } 8165 8166 func (s *GoogleCloudVisionV1p4beta1FaceAnnotationLandmark) MarshalJSON() ([]byte, error) { 8167 type NoMethod GoogleCloudVisionV1p4beta1FaceAnnotationLandmark 8168 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8169 } 8170 8171 // GoogleCloudVisionV1p4beta1FaceRecognitionResult: Information about a face's 8172 // identity. 8173 type GoogleCloudVisionV1p4beta1FaceRecognitionResult struct { 8174 // Celebrity: The Celebrity that this face was matched to. 8175 Celebrity *GoogleCloudVisionV1p4beta1Celebrity `json:"celebrity,omitempty"` 8176 // Confidence: Recognition confidence. Range [0, 1]. 8177 Confidence float64 `json:"confidence,omitempty"` 8178 // ForceSendFields is a list of field names (e.g. "Celebrity") to 8179 // unconditionally include in API requests. By default, fields with empty or 8180 // default values are omitted from API requests. See 8181 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8182 // details. 8183 ForceSendFields []string `json:"-"` 8184 // NullFields is a list of field names (e.g. "Celebrity") to include in API 8185 // requests with the JSON null value. By default, fields with empty values are 8186 // omitted from API requests. See 8187 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8188 NullFields []string `json:"-"` 8189 } 8190 8191 func (s *GoogleCloudVisionV1p4beta1FaceRecognitionResult) MarshalJSON() ([]byte, error) { 8192 type NoMethod GoogleCloudVisionV1p4beta1FaceRecognitionResult 8193 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8194 } 8195 8196 func (s *GoogleCloudVisionV1p4beta1FaceRecognitionResult) UnmarshalJSON(data []byte) error { 8197 type NoMethod GoogleCloudVisionV1p4beta1FaceRecognitionResult 8198 var s1 struct { 8199 Confidence gensupport.JSONFloat64 `json:"confidence"` 8200 *NoMethod 8201 } 8202 s1.NoMethod = (*NoMethod)(s) 8203 if err := json.Unmarshal(data, &s1); err != nil { 8204 return err 8205 } 8206 s.Confidence = float64(s1.Confidence) 8207 return nil 8208 } 8209 8210 // GoogleCloudVisionV1p4beta1GcsDestination: The Google Cloud Storage location 8211 // where the output will be written to. 8212 type GoogleCloudVisionV1p4beta1GcsDestination struct { 8213 // Uri: Google Cloud Storage URI prefix where the results will be stored. 8214 // Results will be in JSON format and preceded by its corresponding input URI 8215 // prefix. This field can either represent a gcs file prefix or gcs directory. 8216 // In either case, the uri should be unique because in order to get all of the 8217 // output files, you will need to do a wildcard gcs search on the uri prefix 8218 // you provide. Examples: * File Prefix: gs://bucket-name/here/filenameprefix 8219 // The output files will be created in gs://bucket-name/here/ and the names of 8220 // the output files will begin with "filenameprefix". * Directory Prefix: 8221 // gs://bucket-name/some/location/ The output files will be created in 8222 // gs://bucket-name/some/location/ and the names of the output files could be 8223 // anything because there was no filename prefix specified. If multiple 8224 // outputs, each response is still AnnotateFileResponse, each of which contains 8225 // some subset of the full list of AnnotateImageResponse. Multiple outputs can 8226 // happen if, for example, the output JSON is too large and overflows into 8227 // multiple sharded files. 8228 Uri string `json:"uri,omitempty"` 8229 // ForceSendFields is a list of field names (e.g. "Uri") to unconditionally 8230 // include in API requests. By default, fields with empty or default values are 8231 // omitted from API requests. See 8232 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8233 // details. 8234 ForceSendFields []string `json:"-"` 8235 // NullFields is a list of field names (e.g. "Uri") to include in API requests 8236 // with the JSON null value. By default, fields with empty values are omitted 8237 // from API requests. See 8238 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8239 NullFields []string `json:"-"` 8240 } 8241 8242 func (s *GoogleCloudVisionV1p4beta1GcsDestination) MarshalJSON() ([]byte, error) { 8243 type NoMethod GoogleCloudVisionV1p4beta1GcsDestination 8244 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8245 } 8246 8247 // GoogleCloudVisionV1p4beta1GcsSource: The Google Cloud Storage location where 8248 // the input will be read from. 8249 type GoogleCloudVisionV1p4beta1GcsSource struct { 8250 // Uri: Google Cloud Storage URI for the input file. This must only be a Google 8251 // Cloud Storage object. Wildcards are not currently supported. 8252 Uri string `json:"uri,omitempty"` 8253 // ForceSendFields is a list of field names (e.g. "Uri") to unconditionally 8254 // include in API requests. By default, fields with empty or default values are 8255 // omitted from API requests. See 8256 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8257 // details. 8258 ForceSendFields []string `json:"-"` 8259 // NullFields is a list of field names (e.g. "Uri") to include in API requests 8260 // with the JSON null value. By default, fields with empty values are omitted 8261 // from API requests. See 8262 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8263 NullFields []string `json:"-"` 8264 } 8265 8266 func (s *GoogleCloudVisionV1p4beta1GcsSource) MarshalJSON() ([]byte, error) { 8267 type NoMethod GoogleCloudVisionV1p4beta1GcsSource 8268 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8269 } 8270 8271 // GoogleCloudVisionV1p4beta1ImageAnnotationContext: If an image was produced 8272 // from a file (e.g. a PDF), this message gives information about the source of 8273 // that image. 8274 type GoogleCloudVisionV1p4beta1ImageAnnotationContext struct { 8275 // PageNumber: If the file was a PDF or TIFF, this field gives the page number 8276 // within the file used to produce the image. 8277 PageNumber int64 `json:"pageNumber,omitempty"` 8278 // Uri: The URI of the file used to produce the image. 8279 Uri string `json:"uri,omitempty"` 8280 // ForceSendFields is a list of field names (e.g. "PageNumber") to 8281 // unconditionally include in API requests. By default, fields with empty or 8282 // default values are omitted from API requests. See 8283 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8284 // details. 8285 ForceSendFields []string `json:"-"` 8286 // NullFields is a list of field names (e.g. "PageNumber") to include in API 8287 // requests with the JSON null value. By default, fields with empty values are 8288 // omitted from API requests. See 8289 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8290 NullFields []string `json:"-"` 8291 } 8292 8293 func (s *GoogleCloudVisionV1p4beta1ImageAnnotationContext) MarshalJSON() ([]byte, error) { 8294 type NoMethod GoogleCloudVisionV1p4beta1ImageAnnotationContext 8295 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8296 } 8297 8298 // GoogleCloudVisionV1p4beta1ImageProperties: Stores image properties, such as 8299 // dominant colors. 8300 type GoogleCloudVisionV1p4beta1ImageProperties struct { 8301 // DominantColors: If present, dominant colors completed successfully. 8302 DominantColors *GoogleCloudVisionV1p4beta1DominantColorsAnnotation `json:"dominantColors,omitempty"` 8303 // ForceSendFields is a list of field names (e.g. "DominantColors") to 8304 // unconditionally include in API requests. By default, fields with empty or 8305 // default values are omitted from API requests. See 8306 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8307 // details. 8308 ForceSendFields []string `json:"-"` 8309 // NullFields is a list of field names (e.g. "DominantColors") to include in 8310 // API requests with the JSON null value. By default, fields with empty values 8311 // are omitted from API requests. See 8312 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8313 NullFields []string `json:"-"` 8314 } 8315 8316 func (s *GoogleCloudVisionV1p4beta1ImageProperties) MarshalJSON() ([]byte, error) { 8317 type NoMethod GoogleCloudVisionV1p4beta1ImageProperties 8318 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8319 } 8320 8321 // GoogleCloudVisionV1p4beta1ImportProductSetsResponse: Response message for 8322 // the `ImportProductSets` method. This message is returned by the 8323 // google.longrunning.Operations.GetOperation method in the returned 8324 // google.longrunning.Operation.response field. 8325 type GoogleCloudVisionV1p4beta1ImportProductSetsResponse struct { 8326 // ReferenceImages: The list of reference_images that are imported 8327 // successfully. 8328 ReferenceImages []*GoogleCloudVisionV1p4beta1ReferenceImage `json:"referenceImages,omitempty"` 8329 // Statuses: The rpc status for each ImportProductSet request, including both 8330 // successes and errors. The number of statuses here matches the number of 8331 // lines in the csv file, and statuses[i] stores the success or failure status 8332 // of processing the i-th line of the csv, starting from line 0. 8333 Statuses []*Status `json:"statuses,omitempty"` 8334 // ForceSendFields is a list of field names (e.g. "ReferenceImages") to 8335 // unconditionally include in API requests. By default, fields with empty or 8336 // default values are omitted from API requests. See 8337 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8338 // details. 8339 ForceSendFields []string `json:"-"` 8340 // NullFields is a list of field names (e.g. "ReferenceImages") to include in 8341 // API requests with the JSON null value. By default, fields with empty values 8342 // are omitted from API requests. See 8343 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8344 NullFields []string `json:"-"` 8345 } 8346 8347 func (s *GoogleCloudVisionV1p4beta1ImportProductSetsResponse) MarshalJSON() ([]byte, error) { 8348 type NoMethod GoogleCloudVisionV1p4beta1ImportProductSetsResponse 8349 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8350 } 8351 8352 // GoogleCloudVisionV1p4beta1InputConfig: The desired input location and 8353 // metadata. 8354 type GoogleCloudVisionV1p4beta1InputConfig struct { 8355 // Content: File content, represented as a stream of bytes. Note: As with all 8356 // `bytes` fields, protobuffers use a pure binary representation, whereas JSON 8357 // representations use base64. Currently, this field only works for 8358 // BatchAnnotateFiles requests. It does not work for AsyncBatchAnnotateFiles 8359 // requests. 8360 Content string `json:"content,omitempty"` 8361 // GcsSource: The Google Cloud Storage location to read the input from. 8362 GcsSource *GoogleCloudVisionV1p4beta1GcsSource `json:"gcsSource,omitempty"` 8363 // MimeType: The type of the file. Currently only "application/pdf", 8364 // "image/tiff" and "image/gif" are supported. Wildcards are not supported. 8365 MimeType string `json:"mimeType,omitempty"` 8366 // ForceSendFields is a list of field names (e.g. "Content") to unconditionally 8367 // include in API requests. By default, fields with empty or default values are 8368 // omitted from API requests. See 8369 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8370 // details. 8371 ForceSendFields []string `json:"-"` 8372 // NullFields is a list of field names (e.g. "Content") to include in API 8373 // requests with the JSON null value. By default, fields with empty values are 8374 // omitted from API requests. See 8375 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8376 NullFields []string `json:"-"` 8377 } 8378 8379 func (s *GoogleCloudVisionV1p4beta1InputConfig) MarshalJSON() ([]byte, error) { 8380 type NoMethod GoogleCloudVisionV1p4beta1InputConfig 8381 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8382 } 8383 8384 // GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation: Set of detected objects 8385 // with bounding boxes. 8386 type GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation struct { 8387 // BoundingPoly: Image region to which this object belongs. This must be 8388 // populated. 8389 BoundingPoly *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingPoly,omitempty"` 8390 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". For 8391 // more information, see 8392 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 8393 LanguageCode string `json:"languageCode,omitempty"` 8394 // Mid: Object ID that should align with EntityAnnotation mid. 8395 Mid string `json:"mid,omitempty"` 8396 // Name: Object name, expressed in its `language_code` language. 8397 Name string `json:"name,omitempty"` 8398 // Score: Score of the result. Range [0, 1]. 8399 Score float64 `json:"score,omitempty"` 8400 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 8401 // unconditionally include in API requests. By default, fields with empty or 8402 // default values are omitted from API requests. See 8403 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8404 // details. 8405 ForceSendFields []string `json:"-"` 8406 // NullFields is a list of field names (e.g. "BoundingPoly") to include in API 8407 // requests with the JSON null value. By default, fields with empty values are 8408 // omitted from API requests. See 8409 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8410 NullFields []string `json:"-"` 8411 } 8412 8413 func (s *GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation) MarshalJSON() ([]byte, error) { 8414 type NoMethod GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation 8415 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8416 } 8417 8418 func (s *GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation) UnmarshalJSON(data []byte) error { 8419 type NoMethod GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation 8420 var s1 struct { 8421 Score gensupport.JSONFloat64 `json:"score"` 8422 *NoMethod 8423 } 8424 s1.NoMethod = (*NoMethod)(s) 8425 if err := json.Unmarshal(data, &s1); err != nil { 8426 return err 8427 } 8428 s.Score = float64(s1.Score) 8429 return nil 8430 } 8431 8432 // GoogleCloudVisionV1p4beta1LocationInfo: Detected entity location 8433 // information. 8434 type GoogleCloudVisionV1p4beta1LocationInfo struct { 8435 // LatLng: lat/long location coordinates. 8436 LatLng *LatLng `json:"latLng,omitempty"` 8437 // ForceSendFields is a list of field names (e.g. "LatLng") to unconditionally 8438 // include in API requests. By default, fields with empty or default values are 8439 // omitted from API requests. See 8440 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8441 // details. 8442 ForceSendFields []string `json:"-"` 8443 // NullFields is a list of field names (e.g. "LatLng") to include in API 8444 // requests with the JSON null value. By default, fields with empty values are 8445 // omitted from API requests. See 8446 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8447 NullFields []string `json:"-"` 8448 } 8449 8450 func (s *GoogleCloudVisionV1p4beta1LocationInfo) MarshalJSON() ([]byte, error) { 8451 type NoMethod GoogleCloudVisionV1p4beta1LocationInfo 8452 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8453 } 8454 8455 // GoogleCloudVisionV1p4beta1NormalizedVertex: A vertex represents a 2D point 8456 // in the image. NOTE: the normalized vertex coordinates are relative to the 8457 // original image and range from 0 to 1. 8458 type GoogleCloudVisionV1p4beta1NormalizedVertex struct { 8459 // X: X coordinate. 8460 X float64 `json:"x,omitempty"` 8461 // Y: Y coordinate. 8462 Y float64 `json:"y,omitempty"` 8463 // ForceSendFields is a list of field names (e.g. "X") to unconditionally 8464 // include in API requests. By default, fields with empty or default values are 8465 // omitted from API requests. See 8466 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8467 // details. 8468 ForceSendFields []string `json:"-"` 8469 // NullFields is a list of field names (e.g. "X") to include in API requests 8470 // with the JSON null value. By default, fields with empty values are omitted 8471 // from API requests. See 8472 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8473 NullFields []string `json:"-"` 8474 } 8475 8476 func (s *GoogleCloudVisionV1p4beta1NormalizedVertex) MarshalJSON() ([]byte, error) { 8477 type NoMethod GoogleCloudVisionV1p4beta1NormalizedVertex 8478 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8479 } 8480 8481 func (s *GoogleCloudVisionV1p4beta1NormalizedVertex) UnmarshalJSON(data []byte) error { 8482 type NoMethod GoogleCloudVisionV1p4beta1NormalizedVertex 8483 var s1 struct { 8484 X gensupport.JSONFloat64 `json:"x"` 8485 Y gensupport.JSONFloat64 `json:"y"` 8486 *NoMethod 8487 } 8488 s1.NoMethod = (*NoMethod)(s) 8489 if err := json.Unmarshal(data, &s1); err != nil { 8490 return err 8491 } 8492 s.X = float64(s1.X) 8493 s.Y = float64(s1.Y) 8494 return nil 8495 } 8496 8497 // GoogleCloudVisionV1p4beta1OperationMetadata: Contains metadata for the 8498 // BatchAnnotateImages operation. 8499 type GoogleCloudVisionV1p4beta1OperationMetadata struct { 8500 // CreateTime: The time when the batch request was received. 8501 CreateTime string `json:"createTime,omitempty"` 8502 // State: Current state of the batch operation. 8503 // 8504 // Possible values: 8505 // "STATE_UNSPECIFIED" - Invalid. 8506 // "CREATED" - Request is received. 8507 // "RUNNING" - Request is actively being processed. 8508 // "DONE" - The batch processing is done. 8509 // "CANCELLED" - The batch processing was cancelled. 8510 State string `json:"state,omitempty"` 8511 // UpdateTime: The time when the operation result was last updated. 8512 UpdateTime string `json:"updateTime,omitempty"` 8513 // ForceSendFields is a list of field names (e.g. "CreateTime") to 8514 // unconditionally include in API requests. By default, fields with empty or 8515 // default values are omitted from API requests. See 8516 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8517 // details. 8518 ForceSendFields []string `json:"-"` 8519 // NullFields is a list of field names (e.g. "CreateTime") to include in API 8520 // requests with the JSON null value. By default, fields with empty values are 8521 // omitted from API requests. See 8522 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8523 NullFields []string `json:"-"` 8524 } 8525 8526 func (s *GoogleCloudVisionV1p4beta1OperationMetadata) MarshalJSON() ([]byte, error) { 8527 type NoMethod GoogleCloudVisionV1p4beta1OperationMetadata 8528 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8529 } 8530 8531 // GoogleCloudVisionV1p4beta1OutputConfig: The desired output location and 8532 // metadata. 8533 type GoogleCloudVisionV1p4beta1OutputConfig struct { 8534 // BatchSize: The max number of response protos to put into each output JSON 8535 // file on Google Cloud Storage. The valid range is [1, 100]. If not specified, 8536 // the default value is 20. For example, for one pdf file with 100 pages, 100 8537 // response protos will be generated. If `batch_size` = 20, then 5 json files 8538 // each containing 20 response protos will be written under the prefix 8539 // `gcs_destination`.`uri`. Currently, batch_size only applies to 8540 // GcsDestination, with potential future support for other output 8541 // configurations. 8542 BatchSize int64 `json:"batchSize,omitempty"` 8543 // GcsDestination: The Google Cloud Storage location to write the output(s) to. 8544 GcsDestination *GoogleCloudVisionV1p4beta1GcsDestination `json:"gcsDestination,omitempty"` 8545 // ForceSendFields is a list of field names (e.g. "BatchSize") to 8546 // unconditionally include in API requests. By default, fields with empty or 8547 // default values are omitted from API requests. See 8548 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8549 // details. 8550 ForceSendFields []string `json:"-"` 8551 // NullFields is a list of field names (e.g. "BatchSize") to include in API 8552 // requests with the JSON null value. By default, fields with empty values are 8553 // omitted from API requests. See 8554 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8555 NullFields []string `json:"-"` 8556 } 8557 8558 func (s *GoogleCloudVisionV1p4beta1OutputConfig) MarshalJSON() ([]byte, error) { 8559 type NoMethod GoogleCloudVisionV1p4beta1OutputConfig 8560 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8561 } 8562 8563 // GoogleCloudVisionV1p4beta1Page: Detected page from OCR. 8564 type GoogleCloudVisionV1p4beta1Page struct { 8565 // Blocks: List of blocks of text, images etc on this page. 8566 Blocks []*GoogleCloudVisionV1p4beta1Block `json:"blocks,omitempty"` 8567 // Confidence: Confidence of the OCR results on the page. Range [0, 1]. 8568 Confidence float64 `json:"confidence,omitempty"` 8569 // Height: Page height. For PDFs the unit is points. For images (including 8570 // TIFFs) the unit is pixels. 8571 Height int64 `json:"height,omitempty"` 8572 // Property: Additional information detected on the page. 8573 Property *GoogleCloudVisionV1p4beta1TextAnnotationTextProperty `json:"property,omitempty"` 8574 // Width: Page width. For PDFs the unit is points. For images (including TIFFs) 8575 // the unit is pixels. 8576 Width int64 `json:"width,omitempty"` 8577 // ForceSendFields is a list of field names (e.g. "Blocks") to unconditionally 8578 // include in API requests. By default, fields with empty or default values are 8579 // omitted from API requests. See 8580 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8581 // details. 8582 ForceSendFields []string `json:"-"` 8583 // NullFields is a list of field names (e.g. "Blocks") to include in API 8584 // requests with the JSON null value. By default, fields with empty values are 8585 // omitted from API requests. See 8586 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8587 NullFields []string `json:"-"` 8588 } 8589 8590 func (s *GoogleCloudVisionV1p4beta1Page) MarshalJSON() ([]byte, error) { 8591 type NoMethod GoogleCloudVisionV1p4beta1Page 8592 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8593 } 8594 8595 func (s *GoogleCloudVisionV1p4beta1Page) UnmarshalJSON(data []byte) error { 8596 type NoMethod GoogleCloudVisionV1p4beta1Page 8597 var s1 struct { 8598 Confidence gensupport.JSONFloat64 `json:"confidence"` 8599 *NoMethod 8600 } 8601 s1.NoMethod = (*NoMethod)(s) 8602 if err := json.Unmarshal(data, &s1); err != nil { 8603 return err 8604 } 8605 s.Confidence = float64(s1.Confidence) 8606 return nil 8607 } 8608 8609 // GoogleCloudVisionV1p4beta1Paragraph: Structural unit of text representing a 8610 // number of words in certain order. 8611 type GoogleCloudVisionV1p4beta1Paragraph struct { 8612 // BoundingBox: The bounding box for the paragraph. The vertices are in the 8613 // order of top-left, top-right, bottom-right, bottom-left. When a rotation of 8614 // the bounding box is detected the rotation is represented as around the 8615 // top-left corner as defined when the text is read in the 'natural' 8616 // orientation. For example: * when the text is horizontal it might look like: 8617 // 0----1 | | 3----2 * when it's rotated 180 degrees around the top-left corner 8618 // it becomes: 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 8619 // 3). 8620 BoundingBox *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingBox,omitempty"` 8621 // Confidence: Confidence of the OCR results for the paragraph. Range [0, 1]. 8622 Confidence float64 `json:"confidence,omitempty"` 8623 // Property: Additional information detected for the paragraph. 8624 Property *GoogleCloudVisionV1p4beta1TextAnnotationTextProperty `json:"property,omitempty"` 8625 // Words: List of all words in this paragraph. 8626 Words []*GoogleCloudVisionV1p4beta1Word `json:"words,omitempty"` 8627 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 8628 // unconditionally include in API requests. By default, fields with empty or 8629 // default values are omitted from API requests. See 8630 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8631 // details. 8632 ForceSendFields []string `json:"-"` 8633 // NullFields is a list of field names (e.g. "BoundingBox") to include in API 8634 // requests with the JSON null value. By default, fields with empty values are 8635 // omitted from API requests. See 8636 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8637 NullFields []string `json:"-"` 8638 } 8639 8640 func (s *GoogleCloudVisionV1p4beta1Paragraph) MarshalJSON() ([]byte, error) { 8641 type NoMethod GoogleCloudVisionV1p4beta1Paragraph 8642 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8643 } 8644 8645 func (s *GoogleCloudVisionV1p4beta1Paragraph) UnmarshalJSON(data []byte) error { 8646 type NoMethod GoogleCloudVisionV1p4beta1Paragraph 8647 var s1 struct { 8648 Confidence gensupport.JSONFloat64 `json:"confidence"` 8649 *NoMethod 8650 } 8651 s1.NoMethod = (*NoMethod)(s) 8652 if err := json.Unmarshal(data, &s1); err != nil { 8653 return err 8654 } 8655 s.Confidence = float64(s1.Confidence) 8656 return nil 8657 } 8658 8659 // GoogleCloudVisionV1p4beta1Position: A 3D position in the image, used 8660 // primarily for Face detection landmarks. A valid Position must have both x 8661 // and y coordinates. The position coordinates are in the same scale as the 8662 // original image. 8663 type GoogleCloudVisionV1p4beta1Position struct { 8664 // X: X coordinate. 8665 X float64 `json:"x,omitempty"` 8666 // Y: Y coordinate. 8667 Y float64 `json:"y,omitempty"` 8668 // Z: Z coordinate (or depth). 8669 Z float64 `json:"z,omitempty"` 8670 // ForceSendFields is a list of field names (e.g. "X") to unconditionally 8671 // include in API requests. By default, fields with empty or default values are 8672 // omitted from API requests. See 8673 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8674 // details. 8675 ForceSendFields []string `json:"-"` 8676 // NullFields is a list of field names (e.g. "X") to include in API requests 8677 // with the JSON null value. By default, fields with empty values are omitted 8678 // from API requests. See 8679 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8680 NullFields []string `json:"-"` 8681 } 8682 8683 func (s *GoogleCloudVisionV1p4beta1Position) MarshalJSON() ([]byte, error) { 8684 type NoMethod GoogleCloudVisionV1p4beta1Position 8685 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8686 } 8687 8688 func (s *GoogleCloudVisionV1p4beta1Position) UnmarshalJSON(data []byte) error { 8689 type NoMethod GoogleCloudVisionV1p4beta1Position 8690 var s1 struct { 8691 X gensupport.JSONFloat64 `json:"x"` 8692 Y gensupport.JSONFloat64 `json:"y"` 8693 Z gensupport.JSONFloat64 `json:"z"` 8694 *NoMethod 8695 } 8696 s1.NoMethod = (*NoMethod)(s) 8697 if err := json.Unmarshal(data, &s1); err != nil { 8698 return err 8699 } 8700 s.X = float64(s1.X) 8701 s.Y = float64(s1.Y) 8702 s.Z = float64(s1.Z) 8703 return nil 8704 } 8705 8706 // GoogleCloudVisionV1p4beta1Product: A Product contains ReferenceImages. 8707 type GoogleCloudVisionV1p4beta1Product struct { 8708 // Description: User-provided metadata to be stored with this product. Must be 8709 // at most 4096 characters long. 8710 Description string `json:"description,omitempty"` 8711 // DisplayName: The user-provided name for this Product. Must not be empty. 8712 // Must be at most 4096 characters long. 8713 DisplayName string `json:"displayName,omitempty"` 8714 // Name: The resource name of the product. Format is: 8715 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This field is 8716 // ignored when creating a product. 8717 Name string `json:"name,omitempty"` 8718 // ProductCategory: Immutable. The category for the product identified by the 8719 // reference image. This should be one of "homegoods-v2", "apparel-v2", 8720 // "toys-v2", "packagedgoods-v1" or "general-v1". The legacy categories 8721 // "homegoods", "apparel", and "toys" are still supported, but these should not 8722 // be used for new products. 8723 ProductCategory string `json:"productCategory,omitempty"` 8724 // ProductLabels: Key-value pairs that can be attached to a product. At query 8725 // time, constraints can be specified based on the product_labels. Note that 8726 // integer values can be provided as strings, e.g. "1199". Only strings with 8727 // integer values can match a range-based restriction which is to be supported 8728 // soon. Multiple values can be assigned to the same key. One product may have 8729 // up to 500 product_labels. Notice that the total number of distinct 8730 // product_labels over all products in one ProductSet cannot exceed 1M, 8731 // otherwise the product search pipeline will refuse to work for that 8732 // ProductSet. 8733 ProductLabels []*GoogleCloudVisionV1p4beta1ProductKeyValue `json:"productLabels,omitempty"` 8734 // ForceSendFields is a list of field names (e.g. "Description") to 8735 // unconditionally include in API requests. By default, fields with empty or 8736 // default values are omitted from API requests. See 8737 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8738 // details. 8739 ForceSendFields []string `json:"-"` 8740 // NullFields is a list of field names (e.g. "Description") to include in API 8741 // requests with the JSON null value. By default, fields with empty values are 8742 // omitted from API requests. See 8743 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8744 NullFields []string `json:"-"` 8745 } 8746 8747 func (s *GoogleCloudVisionV1p4beta1Product) MarshalJSON() ([]byte, error) { 8748 type NoMethod GoogleCloudVisionV1p4beta1Product 8749 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8750 } 8751 8752 // GoogleCloudVisionV1p4beta1ProductKeyValue: A product label represented as a 8753 // key-value pair. 8754 type GoogleCloudVisionV1p4beta1ProductKeyValue struct { 8755 // Key: The key of the label attached to the product. Cannot be empty and 8756 // cannot exceed 128 bytes. 8757 Key string `json:"key,omitempty"` 8758 // Value: The value of the label attached to the product. Cannot be empty and 8759 // cannot exceed 128 bytes. 8760 Value string `json:"value,omitempty"` 8761 // ForceSendFields is a list of field names (e.g. "Key") to unconditionally 8762 // include in API requests. By default, fields with empty or default values are 8763 // omitted from API requests. See 8764 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8765 // details. 8766 ForceSendFields []string `json:"-"` 8767 // NullFields is a list of field names (e.g. "Key") to include in API requests 8768 // with the JSON null value. By default, fields with empty values are omitted 8769 // from API requests. See 8770 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8771 NullFields []string `json:"-"` 8772 } 8773 8774 func (s *GoogleCloudVisionV1p4beta1ProductKeyValue) MarshalJSON() ([]byte, error) { 8775 type NoMethod GoogleCloudVisionV1p4beta1ProductKeyValue 8776 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8777 } 8778 8779 // GoogleCloudVisionV1p4beta1ProductSearchResults: Results for a product search 8780 // request. 8781 type GoogleCloudVisionV1p4beta1ProductSearchResults struct { 8782 // IndexTime: Timestamp of the index which provided these results. Products 8783 // added to the product set and products removed from the product set after 8784 // this time are not reflected in the current results. 8785 IndexTime string `json:"indexTime,omitempty"` 8786 // ProductGroupedResults: List of results grouped by products detected in the 8787 // query image. Each entry corresponds to one bounding polygon in the query 8788 // image, and contains the matching products specific to that region. There may 8789 // be duplicate product matches in the union of all the per-product results. 8790 ProductGroupedResults []*GoogleCloudVisionV1p4beta1ProductSearchResultsGroupedResult `json:"productGroupedResults,omitempty"` 8791 // Results: List of results, one for each product match. 8792 Results []*GoogleCloudVisionV1p4beta1ProductSearchResultsResult `json:"results,omitempty"` 8793 // ForceSendFields is a list of field names (e.g. "IndexTime") to 8794 // unconditionally include in API requests. By default, fields with empty or 8795 // default values are omitted from API requests. See 8796 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8797 // details. 8798 ForceSendFields []string `json:"-"` 8799 // NullFields is a list of field names (e.g. "IndexTime") to include in API 8800 // requests with the JSON null value. By default, fields with empty values are 8801 // omitted from API requests. See 8802 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8803 NullFields []string `json:"-"` 8804 } 8805 8806 func (s *GoogleCloudVisionV1p4beta1ProductSearchResults) MarshalJSON() ([]byte, error) { 8807 type NoMethod GoogleCloudVisionV1p4beta1ProductSearchResults 8808 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8809 } 8810 8811 // GoogleCloudVisionV1p4beta1ProductSearchResultsGroupedResult: Information 8812 // about the products similar to a single product in a query image. 8813 type GoogleCloudVisionV1p4beta1ProductSearchResultsGroupedResult struct { 8814 // BoundingPoly: The bounding polygon around the product detected in the query 8815 // image. 8816 BoundingPoly *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingPoly,omitempty"` 8817 // ObjectAnnotations: List of generic predictions for the object in the 8818 // bounding box. 8819 ObjectAnnotations []*GoogleCloudVisionV1p4beta1ProductSearchResultsObjectAnnotation `json:"objectAnnotations,omitempty"` 8820 // Results: List of results, one for each product match. 8821 Results []*GoogleCloudVisionV1p4beta1ProductSearchResultsResult `json:"results,omitempty"` 8822 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 8823 // unconditionally include in API requests. By default, fields with empty or 8824 // default values are omitted from API requests. See 8825 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8826 // details. 8827 ForceSendFields []string `json:"-"` 8828 // NullFields is a list of field names (e.g. "BoundingPoly") to include in API 8829 // requests with the JSON null value. By default, fields with empty values are 8830 // omitted from API requests. See 8831 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8832 NullFields []string `json:"-"` 8833 } 8834 8835 func (s *GoogleCloudVisionV1p4beta1ProductSearchResultsGroupedResult) MarshalJSON() ([]byte, error) { 8836 type NoMethod GoogleCloudVisionV1p4beta1ProductSearchResultsGroupedResult 8837 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8838 } 8839 8840 // GoogleCloudVisionV1p4beta1ProductSearchResultsObjectAnnotation: Prediction 8841 // for what the object in the bounding box is. 8842 type GoogleCloudVisionV1p4beta1ProductSearchResultsObjectAnnotation struct { 8843 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". For 8844 // more information, see 8845 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 8846 LanguageCode string `json:"languageCode,omitempty"` 8847 // Mid: Object ID that should align with EntityAnnotation mid. 8848 Mid string `json:"mid,omitempty"` 8849 // Name: Object name, expressed in its `language_code` language. 8850 Name string `json:"name,omitempty"` 8851 // Score: Score of the result. Range [0, 1]. 8852 Score float64 `json:"score,omitempty"` 8853 // ForceSendFields is a list of field names (e.g. "LanguageCode") to 8854 // unconditionally include in API requests. By default, fields with empty or 8855 // default values are omitted from API requests. See 8856 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8857 // details. 8858 ForceSendFields []string `json:"-"` 8859 // NullFields is a list of field names (e.g. "LanguageCode") to include in API 8860 // requests with the JSON null value. By default, fields with empty values are 8861 // omitted from API requests. See 8862 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8863 NullFields []string `json:"-"` 8864 } 8865 8866 func (s *GoogleCloudVisionV1p4beta1ProductSearchResultsObjectAnnotation) MarshalJSON() ([]byte, error) { 8867 type NoMethod GoogleCloudVisionV1p4beta1ProductSearchResultsObjectAnnotation 8868 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8869 } 8870 8871 func (s *GoogleCloudVisionV1p4beta1ProductSearchResultsObjectAnnotation) UnmarshalJSON(data []byte) error { 8872 type NoMethod GoogleCloudVisionV1p4beta1ProductSearchResultsObjectAnnotation 8873 var s1 struct { 8874 Score gensupport.JSONFloat64 `json:"score"` 8875 *NoMethod 8876 } 8877 s1.NoMethod = (*NoMethod)(s) 8878 if err := json.Unmarshal(data, &s1); err != nil { 8879 return err 8880 } 8881 s.Score = float64(s1.Score) 8882 return nil 8883 } 8884 8885 // GoogleCloudVisionV1p4beta1ProductSearchResultsResult: Information about a 8886 // product. 8887 type GoogleCloudVisionV1p4beta1ProductSearchResultsResult struct { 8888 // Image: The resource name of the image from the product that is the closest 8889 // match to the query. 8890 Image string `json:"image,omitempty"` 8891 // Product: The Product. 8892 Product *GoogleCloudVisionV1p4beta1Product `json:"product,omitempty"` 8893 // Score: A confidence level on the match, ranging from 0 (no confidence) to 1 8894 // (full confidence). 8895 Score float64 `json:"score,omitempty"` 8896 // ForceSendFields is a list of field names (e.g. "Image") to unconditionally 8897 // include in API requests. By default, fields with empty or default values are 8898 // omitted from API requests. See 8899 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8900 // details. 8901 ForceSendFields []string `json:"-"` 8902 // NullFields is a list of field names (e.g. "Image") to include in API 8903 // requests with the JSON null value. By default, fields with empty values are 8904 // omitted from API requests. See 8905 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8906 NullFields []string `json:"-"` 8907 } 8908 8909 func (s *GoogleCloudVisionV1p4beta1ProductSearchResultsResult) MarshalJSON() ([]byte, error) { 8910 type NoMethod GoogleCloudVisionV1p4beta1ProductSearchResultsResult 8911 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8912 } 8913 8914 func (s *GoogleCloudVisionV1p4beta1ProductSearchResultsResult) UnmarshalJSON(data []byte) error { 8915 type NoMethod GoogleCloudVisionV1p4beta1ProductSearchResultsResult 8916 var s1 struct { 8917 Score gensupport.JSONFloat64 `json:"score"` 8918 *NoMethod 8919 } 8920 s1.NoMethod = (*NoMethod)(s) 8921 if err := json.Unmarshal(data, &s1); err != nil { 8922 return err 8923 } 8924 s.Score = float64(s1.Score) 8925 return nil 8926 } 8927 8928 // GoogleCloudVisionV1p4beta1Property: A `Property` consists of a user-supplied 8929 // name/value pair. 8930 type GoogleCloudVisionV1p4beta1Property struct { 8931 // Name: Name of the property. 8932 Name string `json:"name,omitempty"` 8933 // Uint64Value: Value of numeric properties. 8934 Uint64Value uint64 `json:"uint64Value,omitempty,string"` 8935 // Value: Value of the property. 8936 Value string `json:"value,omitempty"` 8937 // ForceSendFields is a list of field names (e.g. "Name") to unconditionally 8938 // include in API requests. By default, fields with empty or default values are 8939 // omitted from API requests. See 8940 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8941 // details. 8942 ForceSendFields []string `json:"-"` 8943 // NullFields is a list of field names (e.g. "Name") to include in API requests 8944 // with the JSON null value. By default, fields with empty values are omitted 8945 // from API requests. See 8946 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8947 NullFields []string `json:"-"` 8948 } 8949 8950 func (s *GoogleCloudVisionV1p4beta1Property) MarshalJSON() ([]byte, error) { 8951 type NoMethod GoogleCloudVisionV1p4beta1Property 8952 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8953 } 8954 8955 // GoogleCloudVisionV1p4beta1ReferenceImage: A `ReferenceImage` represents a 8956 // product image and its associated metadata, such as bounding boxes. 8957 type GoogleCloudVisionV1p4beta1ReferenceImage struct { 8958 // BoundingPolys: Optional. Bounding polygons around the areas of interest in 8959 // the reference image. If this field is empty, the system will try to detect 8960 // regions of interest. At most 10 bounding polygons will be used. The provided 8961 // shape is converted into a non-rotated rectangle. Once converted, the small 8962 // edge of the rectangle must be greater than or equal to 300 pixels. The 8963 // aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 is not). 8964 BoundingPolys []*GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingPolys,omitempty"` 8965 // Name: The resource name of the reference image. Format is: 8966 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMA 8967 // GE_ID`. This field is ignored when creating a reference image. 8968 Name string `json:"name,omitempty"` 8969 // Uri: Required. The Google Cloud Storage URI of the reference image. The URI 8970 // must start with `gs://`. 8971 Uri string `json:"uri,omitempty"` 8972 // ForceSendFields is a list of field names (e.g. "BoundingPolys") to 8973 // unconditionally include in API requests. By default, fields with empty or 8974 // default values are omitted from API requests. See 8975 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8976 // details. 8977 ForceSendFields []string `json:"-"` 8978 // NullFields is a list of field names (e.g. "BoundingPolys") to include in API 8979 // requests with the JSON null value. By default, fields with empty values are 8980 // omitted from API requests. See 8981 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8982 NullFields []string `json:"-"` 8983 } 8984 8985 func (s *GoogleCloudVisionV1p4beta1ReferenceImage) MarshalJSON() ([]byte, error) { 8986 type NoMethod GoogleCloudVisionV1p4beta1ReferenceImage 8987 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8988 } 8989 8990 // GoogleCloudVisionV1p4beta1SafeSearchAnnotation: Set of features pertaining 8991 // to the image, computed by computer vision methods over safe-search verticals 8992 // (for example, adult, spoof, medical, violence). 8993 type GoogleCloudVisionV1p4beta1SafeSearchAnnotation struct { 8994 // Adult: Represents the adult content likelihood for the image. Adult content 8995 // may contain elements such as nudity, pornographic images or cartoons, or 8996 // sexual activities. 8997 // 8998 // Possible values: 8999 // "UNKNOWN" - Unknown likelihood. 9000 // "VERY_UNLIKELY" - It is very unlikely. 9001 // "UNLIKELY" - It is unlikely. 9002 // "POSSIBLE" - It is possible. 9003 // "LIKELY" - It is likely. 9004 // "VERY_LIKELY" - It is very likely. 9005 Adult string `json:"adult,omitempty"` 9006 // Medical: Likelihood that this is a medical image. 9007 // 9008 // Possible values: 9009 // "UNKNOWN" - Unknown likelihood. 9010 // "VERY_UNLIKELY" - It is very unlikely. 9011 // "UNLIKELY" - It is unlikely. 9012 // "POSSIBLE" - It is possible. 9013 // "LIKELY" - It is likely. 9014 // "VERY_LIKELY" - It is very likely. 9015 Medical string `json:"medical,omitempty"` 9016 // Racy: Likelihood that the request image contains racy content. Racy content 9017 // may include (but is not limited to) skimpy or sheer clothing, strategically 9018 // covered nudity, lewd or provocative poses, or close-ups of sensitive body 9019 // areas. 9020 // 9021 // Possible values: 9022 // "UNKNOWN" - Unknown likelihood. 9023 // "VERY_UNLIKELY" - It is very unlikely. 9024 // "UNLIKELY" - It is unlikely. 9025 // "POSSIBLE" - It is possible. 9026 // "LIKELY" - It is likely. 9027 // "VERY_LIKELY" - It is very likely. 9028 Racy string `json:"racy,omitempty"` 9029 // Spoof: Spoof likelihood. The likelihood that an modification was made to the 9030 // image's canonical version to make it appear funny or offensive. 9031 // 9032 // Possible values: 9033 // "UNKNOWN" - Unknown likelihood. 9034 // "VERY_UNLIKELY" - It is very unlikely. 9035 // "UNLIKELY" - It is unlikely. 9036 // "POSSIBLE" - It is possible. 9037 // "LIKELY" - It is likely. 9038 // "VERY_LIKELY" - It is very likely. 9039 Spoof string `json:"spoof,omitempty"` 9040 // Violence: Likelihood that this image contains violent content. Violent 9041 // content may include death, serious harm, or injury to individuals or groups 9042 // of individuals. 9043 // 9044 // Possible values: 9045 // "UNKNOWN" - Unknown likelihood. 9046 // "VERY_UNLIKELY" - It is very unlikely. 9047 // "UNLIKELY" - It is unlikely. 9048 // "POSSIBLE" - It is possible. 9049 // "LIKELY" - It is likely. 9050 // "VERY_LIKELY" - It is very likely. 9051 Violence string `json:"violence,omitempty"` 9052 // ForceSendFields is a list of field names (e.g. "Adult") to unconditionally 9053 // include in API requests. By default, fields with empty or default values are 9054 // omitted from API requests. See 9055 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 9056 // details. 9057 ForceSendFields []string `json:"-"` 9058 // NullFields is a list of field names (e.g. "Adult") to include in API 9059 // requests with the JSON null value. By default, fields with empty values are 9060 // omitted from API requests. See 9061 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 9062 NullFields []string `json:"-"` 9063 } 9064 9065 func (s *GoogleCloudVisionV1p4beta1SafeSearchAnnotation) MarshalJSON() ([]byte, error) { 9066 type NoMethod GoogleCloudVisionV1p4beta1SafeSearchAnnotation 9067 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 9068 } 9069 9070 // GoogleCloudVisionV1p4beta1Symbol: A single symbol representation. 9071 type GoogleCloudVisionV1p4beta1Symbol struct { 9072 // BoundingBox: The bounding box for the symbol. The vertices are in the order 9073 // of top-left, top-right, bottom-right, bottom-left. When a rotation of the 9074 // bounding box is detected the rotation is represented as around the top-left 9075 // corner as defined when the text is read in the 'natural' orientation. For 9076 // example: * when the text is horizontal it might look like: 0----1 | | 3----2 9077 // * when it's rotated 180 degrees around the top-left corner it becomes: 9078 // 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 3). 9079 BoundingBox *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingBox,omitempty"` 9080 // Confidence: Confidence of the OCR results for the symbol. Range [0, 1]. 9081 Confidence float64 `json:"confidence,omitempty"` 9082 // Property: Additional information detected for the symbol. 9083 Property *GoogleCloudVisionV1p4beta1TextAnnotationTextProperty `json:"property,omitempty"` 9084 // Text: The actual UTF-8 representation of the symbol. 9085 Text string `json:"text,omitempty"` 9086 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 9087 // unconditionally include in API requests. By default, fields with empty or 9088 // default values are omitted from API requests. See 9089 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 9090 // details. 9091 ForceSendFields []string `json:"-"` 9092 // NullFields is a list of field names (e.g. "BoundingBox") to include in API 9093 // requests with the JSON null value. By default, fields with empty values are 9094 // omitted from API requests. See 9095 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 9096 NullFields []string `json:"-"` 9097 } 9098 9099 func (s *GoogleCloudVisionV1p4beta1Symbol) MarshalJSON() ([]byte, error) { 9100 type NoMethod GoogleCloudVisionV1p4beta1Symbol 9101 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 9102 } 9103 9104 func (s *GoogleCloudVisionV1p4beta1Symbol) UnmarshalJSON(data []byte) error { 9105 type NoMethod GoogleCloudVisionV1p4beta1Symbol 9106 var s1 struct { 9107 Confidence gensupport.JSONFloat64 `json:"confidence"` 9108 *NoMethod 9109 } 9110 s1.NoMethod = (*NoMethod)(s) 9111 if err := json.Unmarshal(data, &s1); err != nil { 9112 return err 9113 } 9114 s.Confidence = float64(s1.Confidence) 9115 return nil 9116 } 9117 9118 // GoogleCloudVisionV1p4beta1TextAnnotation: TextAnnotation contains a 9119 // structured representation of OCR extracted text. The hierarchy of an OCR 9120 // extracted text structure is like this: TextAnnotation -> Page -> Block -> 9121 // Paragraph -> Word -> Symbol Each structural component, starting from Page, 9122 // may further have their own properties. Properties describe detected 9123 // languages, breaks etc.. Please refer to the TextAnnotation.TextProperty 9124 // message definition below for more detail. 9125 type GoogleCloudVisionV1p4beta1TextAnnotation struct { 9126 // Pages: List of pages detected by OCR. 9127 Pages []*GoogleCloudVisionV1p4beta1Page `json:"pages,omitempty"` 9128 // Text: UTF-8 text detected on the pages. 9129 Text string `json:"text,omitempty"` 9130 // ForceSendFields is a list of field names (e.g. "Pages") to unconditionally 9131 // include in API requests. By default, fields with empty or default values are 9132 // omitted from API requests. See 9133 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 9134 // details. 9135 ForceSendFields []string `json:"-"` 9136 // NullFields is a list of field names (e.g. "Pages") to include in API 9137 // requests with the JSON null value. By default, fields with empty values are 9138 // omitted from API requests. See 9139 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 9140 NullFields []string `json:"-"` 9141 } 9142 9143 func (s *GoogleCloudVisionV1p4beta1TextAnnotation) MarshalJSON() ([]byte, error) { 9144 type NoMethod GoogleCloudVisionV1p4beta1TextAnnotation 9145 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 9146 } 9147 9148 // GoogleCloudVisionV1p4beta1TextAnnotationDetectedBreak: Detected start or end 9149 // of a structural component. 9150 type GoogleCloudVisionV1p4beta1TextAnnotationDetectedBreak struct { 9151 // IsPrefix: True if break prepends the element. 9152 IsPrefix bool `json:"isPrefix,omitempty"` 9153 // Type: Detected break type. 9154 // 9155 // Possible values: 9156 // "UNKNOWN" - Unknown break label type. 9157 // "SPACE" - Regular space. 9158 // "SURE_SPACE" - Sure space (very wide). 9159 // "EOL_SURE_SPACE" - Line-wrapping break. 9160 // "HYPHEN" - End-line hyphen that is not present in text; does not co-occur 9161 // with `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. 9162 // "LINE_BREAK" - Line break that ends a paragraph. 9163 Type string `json:"type,omitempty"` 9164 // ForceSendFields is a list of field names (e.g. "IsPrefix") to 9165 // unconditionally include in API requests. By default, fields with empty or 9166 // default values are omitted from API requests. See 9167 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 9168 // details. 9169 ForceSendFields []string `json:"-"` 9170 // NullFields is a list of field names (e.g. "IsPrefix") to include in API 9171 // requests with the JSON null value. By default, fields with empty values are 9172 // omitted from API requests. See 9173 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 9174 NullFields []string `json:"-"` 9175 } 9176 9177 func (s *GoogleCloudVisionV1p4beta1TextAnnotationDetectedBreak) MarshalJSON() ([]byte, error) { 9178 type NoMethod GoogleCloudVisionV1p4beta1TextAnnotationDetectedBreak 9179 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 9180 } 9181 9182 // GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage: Detected language 9183 // for a structural component. 9184 type GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage struct { 9185 // Confidence: Confidence of detected language. Range [0, 1]. 9186 Confidence float64 `json:"confidence,omitempty"` 9187 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". For 9188 // more information, see 9189 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 9190 LanguageCode string `json:"languageCode,omitempty"` 9191 // ForceSendFields is a list of field names (e.g. "Confidence") to 9192 // unconditionally include in API requests. By default, fields with empty or 9193 // default values are omitted from API requests. See 9194 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 9195 // details. 9196 ForceSendFields []string `json:"-"` 9197 // NullFields is a list of field names (e.g. "Confidence") to include in API 9198 // requests with the JSON null value. By default, fields with empty values are 9199 // omitted from API requests. See 9200 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 9201 NullFields []string `json:"-"` 9202 } 9203 9204 func (s *GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage) MarshalJSON() ([]byte, error) { 9205 type NoMethod GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage 9206 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 9207 } 9208 9209 func (s *GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage) UnmarshalJSON(data []byte) error { 9210 type NoMethod GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage 9211 var s1 struct { 9212 Confidence gensupport.JSONFloat64 `json:"confidence"` 9213 *NoMethod 9214 } 9215 s1.NoMethod = (*NoMethod)(s) 9216 if err := json.Unmarshal(data, &s1); err != nil { 9217 return err 9218 } 9219 s.Confidence = float64(s1.Confidence) 9220 return nil 9221 } 9222 9223 // GoogleCloudVisionV1p4beta1TextAnnotationTextProperty: Additional information 9224 // detected on the structural component. 9225 type GoogleCloudVisionV1p4beta1TextAnnotationTextProperty struct { 9226 // DetectedBreak: Detected start or end of a text segment. 9227 DetectedBreak *GoogleCloudVisionV1p4beta1TextAnnotationDetectedBreak `json:"detectedBreak,omitempty"` 9228 // DetectedLanguages: A list of detected languages together with confidence. 9229 DetectedLanguages []*GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage `json:"detectedLanguages,omitempty"` 9230 // ForceSendFields is a list of field names (e.g. "DetectedBreak") to 9231 // unconditionally include in API requests. By default, fields with empty or 9232 // default values are omitted from API requests. See 9233 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 9234 // details. 9235 ForceSendFields []string `json:"-"` 9236 // NullFields is a list of field names (e.g. "DetectedBreak") to include in API 9237 // requests with the JSON null value. By default, fields with empty values are 9238 // omitted from API requests. See 9239 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 9240 NullFields []string `json:"-"` 9241 } 9242 9243 func (s *GoogleCloudVisionV1p4beta1TextAnnotationTextProperty) MarshalJSON() ([]byte, error) { 9244 type NoMethod GoogleCloudVisionV1p4beta1TextAnnotationTextProperty 9245 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 9246 } 9247 9248 // GoogleCloudVisionV1p4beta1Vertex: A vertex represents a 2D point in the 9249 // image. NOTE: the vertex coordinates are in the same scale as the original 9250 // image. 9251 type GoogleCloudVisionV1p4beta1Vertex struct { 9252 // X: X coordinate. 9253 X int64 `json:"x,omitempty"` 9254 // Y: Y coordinate. 9255 Y int64 `json:"y,omitempty"` 9256 // ForceSendFields is a list of field names (e.g. "X") to unconditionally 9257 // include in API requests. By default, fields with empty or default values are 9258 // omitted from API requests. See 9259 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 9260 // details. 9261 ForceSendFields []string `json:"-"` 9262 // NullFields is a list of field names (e.g. "X") to include in API requests 9263 // with the JSON null value. By default, fields with empty values are omitted 9264 // from API requests. See 9265 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 9266 NullFields []string `json:"-"` 9267 } 9268 9269 func (s *GoogleCloudVisionV1p4beta1Vertex) MarshalJSON() ([]byte, error) { 9270 type NoMethod GoogleCloudVisionV1p4beta1Vertex 9271 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 9272 } 9273 9274 // GoogleCloudVisionV1p4beta1WebDetection: Relevant information for the image 9275 // from the Internet. 9276 type GoogleCloudVisionV1p4beta1WebDetection struct { 9277 // BestGuessLabels: The service's best guess as to the topic of the request 9278 // image. Inferred from similar images on the open web. 9279 BestGuessLabels []*GoogleCloudVisionV1p4beta1WebDetectionWebLabel `json:"bestGuessLabels,omitempty"` 9280 // FullMatchingImages: Fully matching images from the Internet. Can include 9281 // resized copies of the query image. 9282 FullMatchingImages []*GoogleCloudVisionV1p4beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"` 9283 // PagesWithMatchingImages: Web pages containing the matching images from the 9284 // Internet. 9285 PagesWithMatchingImages []*GoogleCloudVisionV1p4beta1WebDetectionWebPage `json:"pagesWithMatchingImages,omitempty"` 9286 // PartialMatchingImages: Partial matching images from the Internet. Those 9287 // images are similar enough to share some key-point features. For example an 9288 // original image will likely have partial matching for its crops. 9289 PartialMatchingImages []*GoogleCloudVisionV1p4beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"` 9290 // VisuallySimilarImages: The visually similar image results. 9291 VisuallySimilarImages []*GoogleCloudVisionV1p4beta1WebDetectionWebImage `json:"visuallySimilarImages,omitempty"` 9292 // WebEntities: Deduced entities from similar images on the Internet. 9293 WebEntities []*GoogleCloudVisionV1p4beta1WebDetectionWebEntity `json:"webEntities,omitempty"` 9294 // ForceSendFields is a list of field names (e.g. "BestGuessLabels") to 9295 // unconditionally include in API requests. By default, fields with empty or 9296 // default values are omitted from API requests. See 9297 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 9298 // details. 9299 ForceSendFields []string `json:"-"` 9300 // NullFields is a list of field names (e.g. "BestGuessLabels") to include in 9301 // API requests with the JSON null value. By default, fields with empty values 9302 // are omitted from API requests. See 9303 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 9304 NullFields []string `json:"-"` 9305 } 9306 9307 func (s *GoogleCloudVisionV1p4beta1WebDetection) MarshalJSON() ([]byte, error) { 9308 type NoMethod GoogleCloudVisionV1p4beta1WebDetection 9309 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 9310 } 9311 9312 // GoogleCloudVisionV1p4beta1WebDetectionWebEntity: Entity deduced from similar 9313 // images on the Internet. 9314 type GoogleCloudVisionV1p4beta1WebDetectionWebEntity struct { 9315 // Description: Canonical description of the entity, in English. 9316 Description string `json:"description,omitempty"` 9317 // EntityId: Opaque entity ID. 9318 EntityId string `json:"entityId,omitempty"` 9319 // Score: Overall relevancy score for the entity. Not normalized and not 9320 // comparable across different image queries. 9321 Score float64 `json:"score,omitempty"` 9322 // ForceSendFields is a list of field names (e.g. "Description") to 9323 // unconditionally include in API requests. By default, fields with empty or 9324 // default values are omitted from API requests. See 9325 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 9326 // details. 9327 ForceSendFields []string `json:"-"` 9328 // NullFields is a list of field names (e.g. "Description") to include in API 9329 // requests with the JSON null value. By default, fields with empty values are 9330 // omitted from API requests. See 9331 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 9332 NullFields []string `json:"-"` 9333 } 9334 9335 func (s *GoogleCloudVisionV1p4beta1WebDetectionWebEntity) MarshalJSON() ([]byte, error) { 9336 type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebEntity 9337 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 9338 } 9339 9340 func (s *GoogleCloudVisionV1p4beta1WebDetectionWebEntity) UnmarshalJSON(data []byte) error { 9341 type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebEntity 9342 var s1 struct { 9343 Score gensupport.JSONFloat64 `json:"score"` 9344 *NoMethod 9345 } 9346 s1.NoMethod = (*NoMethod)(s) 9347 if err := json.Unmarshal(data, &s1); err != nil { 9348 return err 9349 } 9350 s.Score = float64(s1.Score) 9351 return nil 9352 } 9353 9354 // GoogleCloudVisionV1p4beta1WebDetectionWebImage: Metadata for online images. 9355 type GoogleCloudVisionV1p4beta1WebDetectionWebImage struct { 9356 // Score: (Deprecated) Overall relevancy score for the image. 9357 Score float64 `json:"score,omitempty"` 9358 // Url: The result image URL. 9359 Url string `json:"url,omitempty"` 9360 // ForceSendFields is a list of field names (e.g. "Score") to unconditionally 9361 // include in API requests. By default, fields with empty or default values are 9362 // omitted from API requests. See 9363 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 9364 // details. 9365 ForceSendFields []string `json:"-"` 9366 // NullFields is a list of field names (e.g. "Score") to include in API 9367 // requests with the JSON null value. By default, fields with empty values are 9368 // omitted from API requests. See 9369 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 9370 NullFields []string `json:"-"` 9371 } 9372 9373 func (s *GoogleCloudVisionV1p4beta1WebDetectionWebImage) MarshalJSON() ([]byte, error) { 9374 type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebImage 9375 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 9376 } 9377 9378 func (s *GoogleCloudVisionV1p4beta1WebDetectionWebImage) UnmarshalJSON(data []byte) error { 9379 type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebImage 9380 var s1 struct { 9381 Score gensupport.JSONFloat64 `json:"score"` 9382 *NoMethod 9383 } 9384 s1.NoMethod = (*NoMethod)(s) 9385 if err := json.Unmarshal(data, &s1); err != nil { 9386 return err 9387 } 9388 s.Score = float64(s1.Score) 9389 return nil 9390 } 9391 9392 // GoogleCloudVisionV1p4beta1WebDetectionWebLabel: Label to provide extra 9393 // metadata for the web detection. 9394 type GoogleCloudVisionV1p4beta1WebDetectionWebLabel struct { 9395 // Label: Label for extra metadata. 9396 Label string `json:"label,omitempty"` 9397 // LanguageCode: The BCP-47 language code for `label`, such as "en-US" or 9398 // "sr-Latn". For more information, see 9399 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 9400 LanguageCode string `json:"languageCode,omitempty"` 9401 // ForceSendFields is a list of field names (e.g. "Label") to unconditionally 9402 // include in API requests. By default, fields with empty or default values are 9403 // omitted from API requests. See 9404 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 9405 // details. 9406 ForceSendFields []string `json:"-"` 9407 // NullFields is a list of field names (e.g. "Label") to include in API 9408 // requests with the JSON null value. By default, fields with empty values are 9409 // omitted from API requests. See 9410 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 9411 NullFields []string `json:"-"` 9412 } 9413 9414 func (s *GoogleCloudVisionV1p4beta1WebDetectionWebLabel) MarshalJSON() ([]byte, error) { 9415 type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebLabel 9416 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 9417 } 9418 9419 // GoogleCloudVisionV1p4beta1WebDetectionWebPage: Metadata for web pages. 9420 type GoogleCloudVisionV1p4beta1WebDetectionWebPage struct { 9421 // FullMatchingImages: Fully matching images on the page. Can include resized 9422 // copies of the query image. 9423 FullMatchingImages []*GoogleCloudVisionV1p4beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"` 9424 // PageTitle: Title for the web page, may contain HTML markups. 9425 PageTitle string `json:"pageTitle,omitempty"` 9426 // PartialMatchingImages: Partial matching images on the page. Those images are 9427 // similar enough to share some key-point features. For example an original 9428 // image will likely have partial matching for its crops. 9429 PartialMatchingImages []*GoogleCloudVisionV1p4beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"` 9430 // Score: (Deprecated) Overall relevancy score for the web page. 9431 Score float64 `json:"score,omitempty"` 9432 // Url: The result web page URL. 9433 Url string `json:"url,omitempty"` 9434 // ForceSendFields is a list of field names (e.g. "FullMatchingImages") to 9435 // unconditionally include in API requests. By default, fields with empty or 9436 // default values are omitted from API requests. See 9437 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 9438 // details. 9439 ForceSendFields []string `json:"-"` 9440 // NullFields is a list of field names (e.g. "FullMatchingImages") to include 9441 // in API requests with the JSON null value. By default, fields with empty 9442 // values are omitted from API requests. See 9443 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 9444 NullFields []string `json:"-"` 9445 } 9446 9447 func (s *GoogleCloudVisionV1p4beta1WebDetectionWebPage) MarshalJSON() ([]byte, error) { 9448 type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebPage 9449 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 9450 } 9451 9452 func (s *GoogleCloudVisionV1p4beta1WebDetectionWebPage) UnmarshalJSON(data []byte) error { 9453 type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebPage 9454 var s1 struct { 9455 Score gensupport.JSONFloat64 `json:"score"` 9456 *NoMethod 9457 } 9458 s1.NoMethod = (*NoMethod)(s) 9459 if err := json.Unmarshal(data, &s1); err != nil { 9460 return err 9461 } 9462 s.Score = float64(s1.Score) 9463 return nil 9464 } 9465 9466 // GoogleCloudVisionV1p4beta1Word: A word representation. 9467 type GoogleCloudVisionV1p4beta1Word struct { 9468 // BoundingBox: The bounding box for the word. The vertices are in the order of 9469 // top-left, top-right, bottom-right, bottom-left. When a rotation of the 9470 // bounding box is detected the rotation is represented as around the top-left 9471 // corner as defined when the text is read in the 'natural' orientation. For 9472 // example: * when the text is horizontal it might look like: 0----1 | | 3----2 9473 // * when it's rotated 180 degrees around the top-left corner it becomes: 9474 // 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 3). 9475 BoundingBox *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingBox,omitempty"` 9476 // Confidence: Confidence of the OCR results for the word. Range [0, 1]. 9477 Confidence float64 `json:"confidence,omitempty"` 9478 // Property: Additional information detected for the word. 9479 Property *GoogleCloudVisionV1p4beta1TextAnnotationTextProperty `json:"property,omitempty"` 9480 // Symbols: List of symbols in the word. The order of the symbols follows the 9481 // natural reading order. 9482 Symbols []*GoogleCloudVisionV1p4beta1Symbol `json:"symbols,omitempty"` 9483 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 9484 // unconditionally include in API requests. By default, fields with empty or 9485 // default values are omitted from API requests. See 9486 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 9487 // details. 9488 ForceSendFields []string `json:"-"` 9489 // NullFields is a list of field names (e.g. "BoundingBox") to include in API 9490 // requests with the JSON null value. By default, fields with empty values are 9491 // omitted from API requests. See 9492 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 9493 NullFields []string `json:"-"` 9494 } 9495 9496 func (s *GoogleCloudVisionV1p4beta1Word) MarshalJSON() ([]byte, error) { 9497 type NoMethod GoogleCloudVisionV1p4beta1Word 9498 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 9499 } 9500 9501 func (s *GoogleCloudVisionV1p4beta1Word) UnmarshalJSON(data []byte) error { 9502 type NoMethod GoogleCloudVisionV1p4beta1Word 9503 var s1 struct { 9504 Confidence gensupport.JSONFloat64 `json:"confidence"` 9505 *NoMethod 9506 } 9507 s1.NoMethod = (*NoMethod)(s) 9508 if err := json.Unmarshal(data, &s1); err != nil { 9509 return err 9510 } 9511 s.Confidence = float64(s1.Confidence) 9512 return nil 9513 } 9514 9515 // GroupedResult: Information about the products similar to a single product in 9516 // a query image. 9517 type GroupedResult struct { 9518 // BoundingPoly: The bounding polygon around the product detected in the query 9519 // image. 9520 BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"` 9521 // ObjectAnnotations: List of generic predictions for the object in the 9522 // bounding box. 9523 ObjectAnnotations []*ObjectAnnotation `json:"objectAnnotations,omitempty"` 9524 // Results: List of results, one for each product match. 9525 Results []*Result `json:"results,omitempty"` 9526 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 9527 // unconditionally include in API requests. By default, fields with empty or 9528 // default values are omitted from API requests. See 9529 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 9530 // details. 9531 ForceSendFields []string `json:"-"` 9532 // NullFields is a list of field names (e.g. "BoundingPoly") to include in API 9533 // requests with the JSON null value. By default, fields with empty values are 9534 // omitted from API requests. See 9535 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 9536 NullFields []string `json:"-"` 9537 } 9538 9539 func (s *GroupedResult) MarshalJSON() ([]byte, error) { 9540 type NoMethod GroupedResult 9541 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 9542 } 9543 9544 // Image: Client image to perform Google Cloud Vision API tasks over. 9545 type Image struct { 9546 // Content: Image content, represented as a stream of bytes. Note: As with all 9547 // `bytes` fields, protobuffers use a pure binary representation, whereas JSON 9548 // representations use base64. Currently, this field only works for 9549 // BatchAnnotateImages requests. It does not work for AsyncBatchAnnotateImages 9550 // requests. 9551 Content string `json:"content,omitempty"` 9552 // Source: Google Cloud Storage image location, or publicly-accessible image 9553 // URL. If both `content` and `source` are provided for an image, `content` 9554 // takes precedence and is used to perform the image annotation request. 9555 Source *ImageSource `json:"source,omitempty"` 9556 // ForceSendFields is a list of field names (e.g. "Content") to unconditionally 9557 // include in API requests. By default, fields with empty or default values are 9558 // omitted from API requests. See 9559 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 9560 // details. 9561 ForceSendFields []string `json:"-"` 9562 // NullFields is a list of field names (e.g. "Content") to include in API 9563 // requests with the JSON null value. By default, fields with empty values are 9564 // omitted from API requests. See 9565 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 9566 NullFields []string `json:"-"` 9567 } 9568 9569 func (s *Image) MarshalJSON() ([]byte, error) { 9570 type NoMethod Image 9571 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 9572 } 9573 9574 // ImageAnnotationContext: If an image was produced from a file (e.g. a PDF), 9575 // this message gives information about the source of that image. 9576 type ImageAnnotationContext struct { 9577 // PageNumber: If the file was a PDF or TIFF, this field gives the page number 9578 // within the file used to produce the image. 9579 PageNumber int64 `json:"pageNumber,omitempty"` 9580 // Uri: The URI of the file used to produce the image. 9581 Uri string `json:"uri,omitempty"` 9582 // ForceSendFields is a list of field names (e.g. "PageNumber") to 9583 // unconditionally include in API requests. By default, fields with empty or 9584 // default values are omitted from API requests. See 9585 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 9586 // details. 9587 ForceSendFields []string `json:"-"` 9588 // NullFields is a list of field names (e.g. "PageNumber") to include in API 9589 // requests with the JSON null value. By default, fields with empty values are 9590 // omitted from API requests. See 9591 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 9592 NullFields []string `json:"-"` 9593 } 9594 9595 func (s *ImageAnnotationContext) MarshalJSON() ([]byte, error) { 9596 type NoMethod ImageAnnotationContext 9597 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 9598 } 9599 9600 // ImageContext: Image context and/or feature-specific parameters. 9601 type ImageContext struct { 9602 // CropHintsParams: Parameters for crop hints annotation request. 9603 CropHintsParams *CropHintsParams `json:"cropHintsParams,omitempty"` 9604 // LanguageHints: List of languages to use for TEXT_DETECTION. In most cases, 9605 // an empty value yields the best results since it enables automatic language 9606 // detection. For languages based on the Latin alphabet, setting 9607 // `language_hints` is not needed. In rare cases, when the language of the text 9608 // in the image is known, setting a hint will help get better results (although 9609 // it will be a significant hindrance if the hint is wrong). Text detection 9610 // returns an error if one or more of the specified languages is not one of the 9611 // supported languages (https://cloud.google.com/vision/docs/languages). 9612 LanguageHints []string `json:"languageHints,omitempty"` 9613 // LatLongRect: Not used. 9614 LatLongRect *LatLongRect `json:"latLongRect,omitempty"` 9615 // ProductSearchParams: Parameters for product search. 9616 ProductSearchParams *ProductSearchParams `json:"productSearchParams,omitempty"` 9617 // TextDetectionParams: Parameters for text detection and document text 9618 // detection. 9619 TextDetectionParams *TextDetectionParams `json:"textDetectionParams,omitempty"` 9620 // WebDetectionParams: Parameters for web detection. 9621 WebDetectionParams *WebDetectionParams `json:"webDetectionParams,omitempty"` 9622 // ForceSendFields is a list of field names (e.g. "CropHintsParams") to 9623 // unconditionally include in API requests. By default, fields with empty or 9624 // default values are omitted from API requests. See 9625 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 9626 // details. 9627 ForceSendFields []string `json:"-"` 9628 // NullFields is a list of field names (e.g. "CropHintsParams") to include in 9629 // API requests with the JSON null value. By default, fields with empty values 9630 // are omitted from API requests. See 9631 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 9632 NullFields []string `json:"-"` 9633 } 9634 9635 func (s *ImageContext) MarshalJSON() ([]byte, error) { 9636 type NoMethod ImageContext 9637 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 9638 } 9639 9640 // ImageProperties: Stores image properties, such as dominant colors. 9641 type ImageProperties struct { 9642 // DominantColors: If present, dominant colors completed successfully. 9643 DominantColors *DominantColorsAnnotation `json:"dominantColors,omitempty"` 9644 // ForceSendFields is a list of field names (e.g. "DominantColors") to 9645 // unconditionally include in API requests. By default, fields with empty or 9646 // default values are omitted from API requests. See 9647 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 9648 // details. 9649 ForceSendFields []string `json:"-"` 9650 // NullFields is a list of field names (e.g. "DominantColors") to include in 9651 // API requests with the JSON null value. By default, fields with empty values 9652 // are omitted from API requests. See 9653 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 9654 NullFields []string `json:"-"` 9655 } 9656 9657 func (s *ImageProperties) MarshalJSON() ([]byte, error) { 9658 type NoMethod ImageProperties 9659 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 9660 } 9661 9662 // ImageSource: External image source (Google Cloud Storage or web URL image 9663 // location). 9664 type ImageSource struct { 9665 // GcsImageUri: **Use `image_uri` instead.** The Google Cloud Storage URI of 9666 // the form `gs://bucket_name/object_name`. Object versioning is not supported. 9667 // See Google Cloud Storage Request URIs 9668 // (https://cloud.google.com/storage/docs/reference-uris) for more info. 9669 GcsImageUri string `json:"gcsImageUri,omitempty"` 9670 // ImageUri: The URI of the source image. Can be either: 1. A Google Cloud 9671 // Storage URI of the form `gs://bucket_name/object_name`. Object versioning is 9672 // not supported. See Google Cloud Storage Request URIs 9673 // (https://cloud.google.com/storage/docs/reference-uris) for more info. 2. A 9674 // publicly-accessible image HTTP/HTTPS URL. When fetching images from 9675 // HTTP/HTTPS URLs, Google cannot guarantee that the request will be completed. 9676 // Your request may fail if the specified host denies the request (e.g. due to 9677 // request throttling or DOS prevention), or if Google throttles requests to 9678 // the site for abuse prevention. You should not depend on externally-hosted 9679 // images for production applications. When both `gcs_image_uri` and 9680 // `image_uri` are specified, `image_uri` takes precedence. 9681 ImageUri string `json:"imageUri,omitempty"` 9682 // ForceSendFields is a list of field names (e.g. "GcsImageUri") to 9683 // unconditionally include in API requests. By default, fields with empty or 9684 // default values are omitted from API requests. See 9685 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 9686 // details. 9687 ForceSendFields []string `json:"-"` 9688 // NullFields is a list of field names (e.g. "GcsImageUri") to include in API 9689 // requests with the JSON null value. By default, fields with empty values are 9690 // omitted from API requests. See 9691 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 9692 NullFields []string `json:"-"` 9693 } 9694 9695 func (s *ImageSource) MarshalJSON() ([]byte, error) { 9696 type NoMethod ImageSource 9697 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 9698 } 9699 9700 // ImportProductSetsGcsSource: The Google Cloud Storage location for a csv file 9701 // which preserves a list of ImportProductSetRequests in each line. 9702 type ImportProductSetsGcsSource struct { 9703 // CsvFileUri: The Google Cloud Storage URI of the input csv file. The URI must 9704 // start with `gs://`. The format of the input csv file should be one image per 9705 // line. In each line, there are 8 columns. 1. image-uri 2. image-id 3. 9706 // product-set-id 4. product-id 5. product-category 6. product-display-name 7. 9707 // labels 8. bounding-poly The `image-uri`, `product-set-id`, `product-id`, and 9708 // `product-category` columns are required. All other columns are optional. If 9709 // the `ProductSet` or `Product` specified by the `product-set-id` and 9710 // `product-id` values does not exist, then the system will create a new 9711 // `ProductSet` or `Product` for the image. In this case, the 9712 // `product-display-name` column refers to display_name, the `product-category` 9713 // column refers to product_category, and the `labels` column refers to 9714 // product_labels. The `image-id` column is optional but must be unique if 9715 // provided. If it is empty, the system will automatically assign a unique id 9716 // to the image. The `product-display-name` column is optional. If it is empty, 9717 // the system sets the display_name field for the product to a space (" "). You 9718 // can update the `display_name` later by using the API. If a `Product` with 9719 // the specified `product-id` already exists, then the system ignores the 9720 // `product-display-name`, `product-category`, and `labels` columns. The 9721 // `labels` column (optional) is a line containing a list of comma-separated 9722 // key-value pairs, in the following format: 9723 // "key_1=value_1,key_2=value_2,...,key_n=value_n" The `bounding-poly` column 9724 // (optional) identifies one region of interest from the image in the same 9725 // manner as `CreateReferenceImage`. If you do not specify the `bounding-poly` 9726 // column, then the system will try to detect regions of interest 9727 // automatically. At most one `bounding-poly` column is allowed per line. If 9728 // the image contains multiple regions of interest, add a line to the CSV file 9729 // that includes the same product information, and the `bounding-poly` values 9730 // for each region of interest. The `bounding-poly` column must contain an even 9731 // number of comma-separated numbers, in the format 9732 // "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use non-negative integers for absolute 9733 // bounding polygons, and float values in [0, 1] for normalized bounding 9734 // polygons. The system will resize the image if the image resolution is too 9735 // large to process (larger than 20MP). 9736 CsvFileUri string `json:"csvFileUri,omitempty"` 9737 // ForceSendFields is a list of field names (e.g. "CsvFileUri") to 9738 // unconditionally include in API requests. By default, fields with empty or 9739 // default values are omitted from API requests. See 9740 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 9741 // details. 9742 ForceSendFields []string `json:"-"` 9743 // NullFields is a list of field names (e.g. "CsvFileUri") to include in API 9744 // requests with the JSON null value. By default, fields with empty values are 9745 // omitted from API requests. See 9746 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 9747 NullFields []string `json:"-"` 9748 } 9749 9750 func (s *ImportProductSetsGcsSource) MarshalJSON() ([]byte, error) { 9751 type NoMethod ImportProductSetsGcsSource 9752 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 9753 } 9754 9755 // ImportProductSetsInputConfig: The input content for the `ImportProductSets` 9756 // method. 9757 type ImportProductSetsInputConfig struct { 9758 // GcsSource: The Google Cloud Storage location for a csv file which preserves 9759 // a list of ImportProductSetRequests in each line. 9760 GcsSource *ImportProductSetsGcsSource `json:"gcsSource,omitempty"` 9761 // ForceSendFields is a list of field names (e.g. "GcsSource") to 9762 // unconditionally include in API requests. By default, fields with empty or 9763 // default values are omitted from API requests. See 9764 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 9765 // details. 9766 ForceSendFields []string `json:"-"` 9767 // NullFields is a list of field names (e.g. "GcsSource") to include in API 9768 // requests with the JSON null value. By default, fields with empty values are 9769 // omitted from API requests. See 9770 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 9771 NullFields []string `json:"-"` 9772 } 9773 9774 func (s *ImportProductSetsInputConfig) MarshalJSON() ([]byte, error) { 9775 type NoMethod ImportProductSetsInputConfig 9776 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 9777 } 9778 9779 // ImportProductSetsRequest: Request message for the `ImportProductSets` 9780 // method. 9781 type ImportProductSetsRequest struct { 9782 // InputConfig: Required. The input content for the list of requests. 9783 InputConfig *ImportProductSetsInputConfig `json:"inputConfig,omitempty"` 9784 // ForceSendFields is a list of field names (e.g. "InputConfig") to 9785 // unconditionally include in API requests. By default, fields with empty or 9786 // default values are omitted from API requests. See 9787 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 9788 // details. 9789 ForceSendFields []string `json:"-"` 9790 // NullFields is a list of field names (e.g. "InputConfig") to include in API 9791 // requests with the JSON null value. By default, fields with empty values are 9792 // omitted from API requests. See 9793 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 9794 NullFields []string `json:"-"` 9795 } 9796 9797 func (s *ImportProductSetsRequest) MarshalJSON() ([]byte, error) { 9798 type NoMethod ImportProductSetsRequest 9799 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 9800 } 9801 9802 // ImportProductSetsResponse: Response message for the `ImportProductSets` 9803 // method. This message is returned by the 9804 // google.longrunning.Operations.GetOperation method in the returned 9805 // google.longrunning.Operation.response field. 9806 type ImportProductSetsResponse struct { 9807 // ReferenceImages: The list of reference_images that are imported 9808 // successfully. 9809 ReferenceImages []*ReferenceImage `json:"referenceImages,omitempty"` 9810 // Statuses: The rpc status for each ImportProductSet request, including both 9811 // successes and errors. The number of statuses here matches the number of 9812 // lines in the csv file, and statuses[i] stores the success or failure status 9813 // of processing the i-th line of the csv, starting from line 0. 9814 Statuses []*Status `json:"statuses,omitempty"` 9815 // ForceSendFields is a list of field names (e.g. "ReferenceImages") to 9816 // unconditionally include in API requests. By default, fields with empty or 9817 // default values are omitted from API requests. See 9818 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 9819 // details. 9820 ForceSendFields []string `json:"-"` 9821 // NullFields is a list of field names (e.g. "ReferenceImages") to include in 9822 // API requests with the JSON null value. By default, fields with empty values 9823 // are omitted from API requests. See 9824 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 9825 NullFields []string `json:"-"` 9826 } 9827 9828 func (s *ImportProductSetsResponse) MarshalJSON() ([]byte, error) { 9829 type NoMethod ImportProductSetsResponse 9830 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 9831 } 9832 9833 // InputConfig: The desired input location and metadata. 9834 type InputConfig struct { 9835 // Content: File content, represented as a stream of bytes. Note: As with all 9836 // `bytes` fields, protobuffers use a pure binary representation, whereas JSON 9837 // representations use base64. Currently, this field only works for 9838 // BatchAnnotateFiles requests. It does not work for AsyncBatchAnnotateFiles 9839 // requests. 9840 Content string `json:"content,omitempty"` 9841 // GcsSource: The Google Cloud Storage location to read the input from. 9842 GcsSource *GcsSource `json:"gcsSource,omitempty"` 9843 // MimeType: The type of the file. Currently only "application/pdf", 9844 // "image/tiff" and "image/gif" are supported. Wildcards are not supported. 9845 MimeType string `json:"mimeType,omitempty"` 9846 // ForceSendFields is a list of field names (e.g. "Content") to unconditionally 9847 // include in API requests. By default, fields with empty or default values are 9848 // omitted from API requests. See 9849 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 9850 // details. 9851 ForceSendFields []string `json:"-"` 9852 // NullFields is a list of field names (e.g. "Content") to include in API 9853 // requests with the JSON null value. By default, fields with empty values are 9854 // omitted from API requests. See 9855 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 9856 NullFields []string `json:"-"` 9857 } 9858 9859 func (s *InputConfig) MarshalJSON() ([]byte, error) { 9860 type NoMethod InputConfig 9861 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 9862 } 9863 9864 // KeyValue: A product label represented as a key-value pair. 9865 type KeyValue struct { 9866 // Key: The key of the label attached to the product. Cannot be empty and 9867 // cannot exceed 128 bytes. 9868 Key string `json:"key,omitempty"` 9869 // Value: The value of the label attached to the product. Cannot be empty and 9870 // cannot exceed 128 bytes. 9871 Value string `json:"value,omitempty"` 9872 // ForceSendFields is a list of field names (e.g. "Key") to unconditionally 9873 // include in API requests. By default, fields with empty or default values are 9874 // omitted from API requests. See 9875 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 9876 // details. 9877 ForceSendFields []string `json:"-"` 9878 // NullFields is a list of field names (e.g. "Key") to include in API requests 9879 // with the JSON null value. By default, fields with empty values are omitted 9880 // from API requests. See 9881 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 9882 NullFields []string `json:"-"` 9883 } 9884 9885 func (s *KeyValue) MarshalJSON() ([]byte, error) { 9886 type NoMethod KeyValue 9887 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 9888 } 9889 9890 // Landmark: A face-specific landmark (for example, a face feature). 9891 type Landmark struct { 9892 // Position: Face landmark position. 9893 Position *Position `json:"position,omitempty"` 9894 // Type: Face landmark type. 9895 // 9896 // Possible values: 9897 // "UNKNOWN_LANDMARK" - Unknown face landmark detected. Should not be filled. 9898 // "LEFT_EYE" - Left eye. 9899 // "RIGHT_EYE" - Right eye. 9900 // "LEFT_OF_LEFT_EYEBROW" - Left of left eyebrow. 9901 // "RIGHT_OF_LEFT_EYEBROW" - Right of left eyebrow. 9902 // "LEFT_OF_RIGHT_EYEBROW" - Left of right eyebrow. 9903 // "RIGHT_OF_RIGHT_EYEBROW" - Right of right eyebrow. 9904 // "MIDPOINT_BETWEEN_EYES" - Midpoint between eyes. 9905 // "NOSE_TIP" - Nose tip. 9906 // "UPPER_LIP" - Upper lip. 9907 // "LOWER_LIP" - Lower lip. 9908 // "MOUTH_LEFT" - Mouth left. 9909 // "MOUTH_RIGHT" - Mouth right. 9910 // "MOUTH_CENTER" - Mouth center. 9911 // "NOSE_BOTTOM_RIGHT" - Nose, bottom right. 9912 // "NOSE_BOTTOM_LEFT" - Nose, bottom left. 9913 // "NOSE_BOTTOM_CENTER" - Nose, bottom center. 9914 // "LEFT_EYE_TOP_BOUNDARY" - Left eye, top boundary. 9915 // "LEFT_EYE_RIGHT_CORNER" - Left eye, right corner. 9916 // "LEFT_EYE_BOTTOM_BOUNDARY" - Left eye, bottom boundary. 9917 // "LEFT_EYE_LEFT_CORNER" - Left eye, left corner. 9918 // "RIGHT_EYE_TOP_BOUNDARY" - Right eye, top boundary. 9919 // "RIGHT_EYE_RIGHT_CORNER" - Right eye, right corner. 9920 // "RIGHT_EYE_BOTTOM_BOUNDARY" - Right eye, bottom boundary. 9921 // "RIGHT_EYE_LEFT_CORNER" - Right eye, left corner. 9922 // "LEFT_EYEBROW_UPPER_MIDPOINT" - Left eyebrow, upper midpoint. 9923 // "RIGHT_EYEBROW_UPPER_MIDPOINT" - Right eyebrow, upper midpoint. 9924 // "LEFT_EAR_TRAGION" - Left ear tragion. 9925 // "RIGHT_EAR_TRAGION" - Right ear tragion. 9926 // "LEFT_EYE_PUPIL" - Left eye pupil. 9927 // "RIGHT_EYE_PUPIL" - Right eye pupil. 9928 // "FOREHEAD_GLABELLA" - Forehead glabella. 9929 // "CHIN_GNATHION" - Chin gnathion. 9930 // "CHIN_LEFT_GONION" - Chin left gonion. 9931 // "CHIN_RIGHT_GONION" - Chin right gonion. 9932 // "LEFT_CHEEK_CENTER" - Left cheek center. 9933 // "RIGHT_CHEEK_CENTER" - Right cheek center. 9934 Type string `json:"type,omitempty"` 9935 // ForceSendFields is a list of field names (e.g. "Position") to 9936 // unconditionally include in API requests. By default, fields with empty or 9937 // default values are omitted from API requests. See 9938 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 9939 // details. 9940 ForceSendFields []string `json:"-"` 9941 // NullFields is a list of field names (e.g. "Position") to include in API 9942 // requests with the JSON null value. By default, fields with empty values are 9943 // omitted from API requests. See 9944 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 9945 NullFields []string `json:"-"` 9946 } 9947 9948 func (s *Landmark) MarshalJSON() ([]byte, error) { 9949 type NoMethod Landmark 9950 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 9951 } 9952 9953 // LatLng: An object that represents a latitude/longitude pair. This is 9954 // expressed as a pair of doubles to represent degrees latitude and degrees 9955 // longitude. Unless specified otherwise, this object must conform to the WGS84 9956 // standard. Values must be within normalized ranges. 9957 type LatLng struct { 9958 // Latitude: The latitude in degrees. It must be in the range [-90.0, +90.0]. 9959 Latitude float64 `json:"latitude,omitempty"` 9960 // Longitude: The longitude in degrees. It must be in the range [-180.0, 9961 // +180.0]. 9962 Longitude float64 `json:"longitude,omitempty"` 9963 // ForceSendFields is a list of field names (e.g. "Latitude") to 9964 // unconditionally include in API requests. By default, fields with empty or 9965 // default values are omitted from API requests. See 9966 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 9967 // details. 9968 ForceSendFields []string `json:"-"` 9969 // NullFields is a list of field names (e.g. "Latitude") to include in API 9970 // requests with the JSON null value. By default, fields with empty values are 9971 // omitted from API requests. See 9972 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 9973 NullFields []string `json:"-"` 9974 } 9975 9976 func (s *LatLng) MarshalJSON() ([]byte, error) { 9977 type NoMethod LatLng 9978 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 9979 } 9980 9981 func (s *LatLng) UnmarshalJSON(data []byte) error { 9982 type NoMethod LatLng 9983 var s1 struct { 9984 Latitude gensupport.JSONFloat64 `json:"latitude"` 9985 Longitude gensupport.JSONFloat64 `json:"longitude"` 9986 *NoMethod 9987 } 9988 s1.NoMethod = (*NoMethod)(s) 9989 if err := json.Unmarshal(data, &s1); err != nil { 9990 return err 9991 } 9992 s.Latitude = float64(s1.Latitude) 9993 s.Longitude = float64(s1.Longitude) 9994 return nil 9995 } 9996 9997 // LatLongRect: Rectangle determined by min and max `LatLng` pairs. 9998 type LatLongRect struct { 9999 // MaxLatLng: Max lat/long pair. 10000 MaxLatLng *LatLng `json:"maxLatLng,omitempty"` 10001 // MinLatLng: Min lat/long pair. 10002 MinLatLng *LatLng `json:"minLatLng,omitempty"` 10003 // ForceSendFields is a list of field names (e.g. "MaxLatLng") to 10004 // unconditionally include in API requests. By default, fields with empty or 10005 // default values are omitted from API requests. See 10006 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 10007 // details. 10008 ForceSendFields []string `json:"-"` 10009 // NullFields is a list of field names (e.g. "MaxLatLng") to include in API 10010 // requests with the JSON null value. By default, fields with empty values are 10011 // omitted from API requests. See 10012 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 10013 NullFields []string `json:"-"` 10014 } 10015 10016 func (s *LatLongRect) MarshalJSON() ([]byte, error) { 10017 type NoMethod LatLongRect 10018 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 10019 } 10020 10021 // ListOperationsResponse: The response message for Operations.ListOperations. 10022 type ListOperationsResponse struct { 10023 // NextPageToken: The standard List next-page token. 10024 NextPageToken string `json:"nextPageToken,omitempty"` 10025 // Operations: A list of operations that matches the specified filter in the 10026 // request. 10027 Operations []*Operation `json:"operations,omitempty"` 10028 10029 // ServerResponse contains the HTTP response code and headers from the server. 10030 googleapi.ServerResponse `json:"-"` 10031 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 10032 // unconditionally include in API requests. By default, fields with empty or 10033 // default values are omitted from API requests. See 10034 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 10035 // details. 10036 ForceSendFields []string `json:"-"` 10037 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 10038 // requests with the JSON null value. By default, fields with empty values are 10039 // omitted from API requests. See 10040 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 10041 NullFields []string `json:"-"` 10042 } 10043 10044 func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) { 10045 type NoMethod ListOperationsResponse 10046 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 10047 } 10048 10049 // ListProductSetsResponse: Response message for the `ListProductSets` method. 10050 type ListProductSetsResponse struct { 10051 // NextPageToken: Token to retrieve the next page of results, or empty if there 10052 // are no more results in the list. 10053 NextPageToken string `json:"nextPageToken,omitempty"` 10054 // ProductSets: List of ProductSets. 10055 ProductSets []*ProductSet `json:"productSets,omitempty"` 10056 10057 // ServerResponse contains the HTTP response code and headers from the server. 10058 googleapi.ServerResponse `json:"-"` 10059 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 10060 // unconditionally include in API requests. By default, fields with empty or 10061 // default values are omitted from API requests. See 10062 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 10063 // details. 10064 ForceSendFields []string `json:"-"` 10065 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 10066 // requests with the JSON null value. By default, fields with empty values are 10067 // omitted from API requests. See 10068 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 10069 NullFields []string `json:"-"` 10070 } 10071 10072 func (s *ListProductSetsResponse) MarshalJSON() ([]byte, error) { 10073 type NoMethod ListProductSetsResponse 10074 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 10075 } 10076 10077 // ListProductsInProductSetResponse: Response message for the 10078 // `ListProductsInProductSet` method. 10079 type ListProductsInProductSetResponse struct { 10080 // NextPageToken: Token to retrieve the next page of results, or empty if there 10081 // are no more results in the list. 10082 NextPageToken string `json:"nextPageToken,omitempty"` 10083 // Products: The list of Products. 10084 Products []*Product `json:"products,omitempty"` 10085 10086 // ServerResponse contains the HTTP response code and headers from the server. 10087 googleapi.ServerResponse `json:"-"` 10088 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 10089 // unconditionally include in API requests. By default, fields with empty or 10090 // default values are omitted from API requests. See 10091 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 10092 // details. 10093 ForceSendFields []string `json:"-"` 10094 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 10095 // requests with the JSON null value. By default, fields with empty values are 10096 // omitted from API requests. See 10097 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 10098 NullFields []string `json:"-"` 10099 } 10100 10101 func (s *ListProductsInProductSetResponse) MarshalJSON() ([]byte, error) { 10102 type NoMethod ListProductsInProductSetResponse 10103 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 10104 } 10105 10106 // ListProductsResponse: Response message for the `ListProducts` method. 10107 type ListProductsResponse struct { 10108 // NextPageToken: Token to retrieve the next page of results, or empty if there 10109 // are no more results in the list. 10110 NextPageToken string `json:"nextPageToken,omitempty"` 10111 // Products: List of products. 10112 Products []*Product `json:"products,omitempty"` 10113 10114 // ServerResponse contains the HTTP response code and headers from the server. 10115 googleapi.ServerResponse `json:"-"` 10116 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 10117 // unconditionally include in API requests. By default, fields with empty or 10118 // default values are omitted from API requests. See 10119 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 10120 // details. 10121 ForceSendFields []string `json:"-"` 10122 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 10123 // requests with the JSON null value. By default, fields with empty values are 10124 // omitted from API requests. See 10125 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 10126 NullFields []string `json:"-"` 10127 } 10128 10129 func (s *ListProductsResponse) MarshalJSON() ([]byte, error) { 10130 type NoMethod ListProductsResponse 10131 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 10132 } 10133 10134 // ListReferenceImagesResponse: Response message for the `ListReferenceImages` 10135 // method. 10136 type ListReferenceImagesResponse struct { 10137 // NextPageToken: The next_page_token returned from a previous List request, if 10138 // any. 10139 NextPageToken string `json:"nextPageToken,omitempty"` 10140 // PageSize: The maximum number of items to return. Default 10, maximum 100. 10141 PageSize int64 `json:"pageSize,omitempty"` 10142 // ReferenceImages: The list of reference images. 10143 ReferenceImages []*ReferenceImage `json:"referenceImages,omitempty"` 10144 10145 // ServerResponse contains the HTTP response code and headers from the server. 10146 googleapi.ServerResponse `json:"-"` 10147 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 10148 // unconditionally include in API requests. By default, fields with empty or 10149 // default values are omitted from API requests. See 10150 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 10151 // details. 10152 ForceSendFields []string `json:"-"` 10153 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 10154 // requests with the JSON null value. By default, fields with empty values are 10155 // omitted from API requests. See 10156 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 10157 NullFields []string `json:"-"` 10158 } 10159 10160 func (s *ListReferenceImagesResponse) MarshalJSON() ([]byte, error) { 10161 type NoMethod ListReferenceImagesResponse 10162 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 10163 } 10164 10165 // LocalizedObjectAnnotation: Set of detected objects with bounding boxes. 10166 type LocalizedObjectAnnotation struct { 10167 // BoundingPoly: Image region to which this object belongs. This must be 10168 // populated. 10169 BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"` 10170 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". For 10171 // more information, see 10172 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 10173 LanguageCode string `json:"languageCode,omitempty"` 10174 // Mid: Object ID that should align with EntityAnnotation mid. 10175 Mid string `json:"mid,omitempty"` 10176 // Name: Object name, expressed in its `language_code` language. 10177 Name string `json:"name,omitempty"` 10178 // Score: Score of the result. Range [0, 1]. 10179 Score float64 `json:"score,omitempty"` 10180 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 10181 // unconditionally include in API requests. By default, fields with empty or 10182 // default values are omitted from API requests. See 10183 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 10184 // details. 10185 ForceSendFields []string `json:"-"` 10186 // NullFields is a list of field names (e.g. "BoundingPoly") to include in API 10187 // requests with the JSON null value. By default, fields with empty values are 10188 // omitted from API requests. See 10189 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 10190 NullFields []string `json:"-"` 10191 } 10192 10193 func (s *LocalizedObjectAnnotation) MarshalJSON() ([]byte, error) { 10194 type NoMethod LocalizedObjectAnnotation 10195 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 10196 } 10197 10198 func (s *LocalizedObjectAnnotation) UnmarshalJSON(data []byte) error { 10199 type NoMethod LocalizedObjectAnnotation 10200 var s1 struct { 10201 Score gensupport.JSONFloat64 `json:"score"` 10202 *NoMethod 10203 } 10204 s1.NoMethod = (*NoMethod)(s) 10205 if err := json.Unmarshal(data, &s1); err != nil { 10206 return err 10207 } 10208 s.Score = float64(s1.Score) 10209 return nil 10210 } 10211 10212 // LocationInfo: Detected entity location information. 10213 type LocationInfo struct { 10214 // LatLng: lat/long location coordinates. 10215 LatLng *LatLng `json:"latLng,omitempty"` 10216 // ForceSendFields is a list of field names (e.g. "LatLng") to unconditionally 10217 // include in API requests. By default, fields with empty or default values are 10218 // omitted from API requests. See 10219 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 10220 // details. 10221 ForceSendFields []string `json:"-"` 10222 // NullFields is a list of field names (e.g. "LatLng") to include in API 10223 // requests with the JSON null value. By default, fields with empty values are 10224 // omitted from API requests. See 10225 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 10226 NullFields []string `json:"-"` 10227 } 10228 10229 func (s *LocationInfo) MarshalJSON() ([]byte, error) { 10230 type NoMethod LocationInfo 10231 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 10232 } 10233 10234 // NormalizedVertex: A vertex represents a 2D point in the image. NOTE: the 10235 // normalized vertex coordinates are relative to the original image and range 10236 // from 0 to 1. 10237 type NormalizedVertex struct { 10238 // X: X coordinate. 10239 X float64 `json:"x,omitempty"` 10240 // Y: Y coordinate. 10241 Y float64 `json:"y,omitempty"` 10242 // ForceSendFields is a list of field names (e.g. "X") to unconditionally 10243 // include in API requests. By default, fields with empty or default values are 10244 // omitted from API requests. See 10245 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 10246 // details. 10247 ForceSendFields []string `json:"-"` 10248 // NullFields is a list of field names (e.g. "X") to include in API requests 10249 // with the JSON null value. By default, fields with empty values are omitted 10250 // from API requests. See 10251 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 10252 NullFields []string `json:"-"` 10253 } 10254 10255 func (s *NormalizedVertex) MarshalJSON() ([]byte, error) { 10256 type NoMethod NormalizedVertex 10257 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 10258 } 10259 10260 func (s *NormalizedVertex) UnmarshalJSON(data []byte) error { 10261 type NoMethod NormalizedVertex 10262 var s1 struct { 10263 X gensupport.JSONFloat64 `json:"x"` 10264 Y gensupport.JSONFloat64 `json:"y"` 10265 *NoMethod 10266 } 10267 s1.NoMethod = (*NoMethod)(s) 10268 if err := json.Unmarshal(data, &s1); err != nil { 10269 return err 10270 } 10271 s.X = float64(s1.X) 10272 s.Y = float64(s1.Y) 10273 return nil 10274 } 10275 10276 // ObjectAnnotation: Prediction for what the object in the bounding box is. 10277 type ObjectAnnotation struct { 10278 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". For 10279 // more information, see 10280 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 10281 LanguageCode string `json:"languageCode,omitempty"` 10282 // Mid: Object ID that should align with EntityAnnotation mid. 10283 Mid string `json:"mid,omitempty"` 10284 // Name: Object name, expressed in its `language_code` language. 10285 Name string `json:"name,omitempty"` 10286 // Score: Score of the result. Range [0, 1]. 10287 Score float64 `json:"score,omitempty"` 10288 // ForceSendFields is a list of field names (e.g. "LanguageCode") to 10289 // unconditionally include in API requests. By default, fields with empty or 10290 // default values are omitted from API requests. See 10291 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 10292 // details. 10293 ForceSendFields []string `json:"-"` 10294 // NullFields is a list of field names (e.g. "LanguageCode") to include in API 10295 // requests with the JSON null value. By default, fields with empty values are 10296 // omitted from API requests. See 10297 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 10298 NullFields []string `json:"-"` 10299 } 10300 10301 func (s *ObjectAnnotation) MarshalJSON() ([]byte, error) { 10302 type NoMethod ObjectAnnotation 10303 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 10304 } 10305 10306 func (s *ObjectAnnotation) UnmarshalJSON(data []byte) error { 10307 type NoMethod ObjectAnnotation 10308 var s1 struct { 10309 Score gensupport.JSONFloat64 `json:"score"` 10310 *NoMethod 10311 } 10312 s1.NoMethod = (*NoMethod)(s) 10313 if err := json.Unmarshal(data, &s1); err != nil { 10314 return err 10315 } 10316 s.Score = float64(s1.Score) 10317 return nil 10318 } 10319 10320 // Operation: This resource represents a long-running operation that is the 10321 // result of a network API call. 10322 type Operation struct { 10323 // Done: If the value is `false`, it means the operation is still in progress. 10324 // If `true`, the operation is completed, and either `error` or `response` is 10325 // available. 10326 Done bool `json:"done,omitempty"` 10327 // Error: The error result of the operation in case of failure or cancellation. 10328 Error *Status `json:"error,omitempty"` 10329 // Metadata: Service-specific metadata associated with the operation. It 10330 // typically contains progress information and common metadata such as create 10331 // time. Some services might not provide such metadata. Any method that returns 10332 // a long-running operation should document the metadata type, if any. 10333 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 10334 // Name: The server-assigned name, which is only unique within the same service 10335 // that originally returns it. If you use the default HTTP mapping, the `name` 10336 // should be a resource name ending with `operations/{unique_id}`. 10337 Name string `json:"name,omitempty"` 10338 // Response: The normal, successful response of the operation. If the original 10339 // method returns no data on success, such as `Delete`, the response is 10340 // `google.protobuf.Empty`. If the original method is standard 10341 // `Get`/`Create`/`Update`, the response should be the resource. For other 10342 // methods, the response should have the type `XxxResponse`, where `Xxx` is the 10343 // original method name. For example, if the original method name is 10344 // `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. 10345 Response googleapi.RawMessage `json:"response,omitempty"` 10346 10347 // ServerResponse contains the HTTP response code and headers from the server. 10348 googleapi.ServerResponse `json:"-"` 10349 // ForceSendFields is a list of field names (e.g. "Done") to unconditionally 10350 // include in API requests. By default, fields with empty or default values are 10351 // omitted from API requests. See 10352 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 10353 // details. 10354 ForceSendFields []string `json:"-"` 10355 // NullFields is a list of field names (e.g. "Done") to include in API requests 10356 // with the JSON null value. By default, fields with empty values are omitted 10357 // from API requests. See 10358 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 10359 NullFields []string `json:"-"` 10360 } 10361 10362 func (s *Operation) MarshalJSON() ([]byte, error) { 10363 type NoMethod Operation 10364 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 10365 } 10366 10367 // OperationMetadata: Contains metadata for the BatchAnnotateImages operation. 10368 type OperationMetadata struct { 10369 // CreateTime: The time when the batch request was received. 10370 CreateTime string `json:"createTime,omitempty"` 10371 // State: Current state of the batch operation. 10372 // 10373 // Possible values: 10374 // "STATE_UNSPECIFIED" - Invalid. 10375 // "CREATED" - Request is received. 10376 // "RUNNING" - Request is actively being processed. 10377 // "DONE" - The batch processing is done. 10378 // "CANCELLED" - The batch processing was cancelled. 10379 State string `json:"state,omitempty"` 10380 // UpdateTime: The time when the operation result was last updated. 10381 UpdateTime string `json:"updateTime,omitempty"` 10382 // ForceSendFields is a list of field names (e.g. "CreateTime") to 10383 // unconditionally include in API requests. By default, fields with empty or 10384 // default values are omitted from API requests. See 10385 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 10386 // details. 10387 ForceSendFields []string `json:"-"` 10388 // NullFields is a list of field names (e.g. "CreateTime") to include in API 10389 // requests with the JSON null value. By default, fields with empty values are 10390 // omitted from API requests. See 10391 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 10392 NullFields []string `json:"-"` 10393 } 10394 10395 func (s *OperationMetadata) MarshalJSON() ([]byte, error) { 10396 type NoMethod OperationMetadata 10397 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 10398 } 10399 10400 // OutputConfig: The desired output location and metadata. 10401 type OutputConfig struct { 10402 // BatchSize: The max number of response protos to put into each output JSON 10403 // file on Google Cloud Storage. The valid range is [1, 100]. If not specified, 10404 // the default value is 20. For example, for one pdf file with 100 pages, 100 10405 // response protos will be generated. If `batch_size` = 20, then 5 json files 10406 // each containing 20 response protos will be written under the prefix 10407 // `gcs_destination`.`uri`. Currently, batch_size only applies to 10408 // GcsDestination, with potential future support for other output 10409 // configurations. 10410 BatchSize int64 `json:"batchSize,omitempty"` 10411 // GcsDestination: The Google Cloud Storage location to write the output(s) to. 10412 GcsDestination *GcsDestination `json:"gcsDestination,omitempty"` 10413 // ForceSendFields is a list of field names (e.g. "BatchSize") to 10414 // unconditionally include in API requests. By default, fields with empty or 10415 // default values are omitted from API requests. See 10416 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 10417 // details. 10418 ForceSendFields []string `json:"-"` 10419 // NullFields is a list of field names (e.g. "BatchSize") to include in API 10420 // requests with the JSON null value. By default, fields with empty values are 10421 // omitted from API requests. See 10422 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 10423 NullFields []string `json:"-"` 10424 } 10425 10426 func (s *OutputConfig) MarshalJSON() ([]byte, error) { 10427 type NoMethod OutputConfig 10428 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 10429 } 10430 10431 // Page: Detected page from OCR. 10432 type Page struct { 10433 // Blocks: List of blocks of text, images etc on this page. 10434 Blocks []*Block `json:"blocks,omitempty"` 10435 // Confidence: Confidence of the OCR results on the page. Range [0, 1]. 10436 Confidence float64 `json:"confidence,omitempty"` 10437 // Height: Page height. For PDFs the unit is points. For images (including 10438 // TIFFs) the unit is pixels. 10439 Height int64 `json:"height,omitempty"` 10440 // Property: Additional information detected on the page. 10441 Property *TextProperty `json:"property,omitempty"` 10442 // Width: Page width. For PDFs the unit is points. For images (including TIFFs) 10443 // the unit is pixels. 10444 Width int64 `json:"width,omitempty"` 10445 // ForceSendFields is a list of field names (e.g. "Blocks") to unconditionally 10446 // include in API requests. By default, fields with empty or default values are 10447 // omitted from API requests. See 10448 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 10449 // details. 10450 ForceSendFields []string `json:"-"` 10451 // NullFields is a list of field names (e.g. "Blocks") to include in API 10452 // requests with the JSON null value. By default, fields with empty values are 10453 // omitted from API requests. See 10454 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 10455 NullFields []string `json:"-"` 10456 } 10457 10458 func (s *Page) MarshalJSON() ([]byte, error) { 10459 type NoMethod Page 10460 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 10461 } 10462 10463 func (s *Page) UnmarshalJSON(data []byte) error { 10464 type NoMethod Page 10465 var s1 struct { 10466 Confidence gensupport.JSONFloat64 `json:"confidence"` 10467 *NoMethod 10468 } 10469 s1.NoMethod = (*NoMethod)(s) 10470 if err := json.Unmarshal(data, &s1); err != nil { 10471 return err 10472 } 10473 s.Confidence = float64(s1.Confidence) 10474 return nil 10475 } 10476 10477 // Paragraph: Structural unit of text representing a number of words in certain 10478 // order. 10479 type Paragraph struct { 10480 // BoundingBox: The bounding box for the paragraph. The vertices are in the 10481 // order of top-left, top-right, bottom-right, bottom-left. When a rotation of 10482 // the bounding box is detected the rotation is represented as around the 10483 // top-left corner as defined when the text is read in the 'natural' 10484 // orientation. For example: * when the text is horizontal it might look like: 10485 // 0----1 | | 3----2 * when it's rotated 180 degrees around the top-left corner 10486 // it becomes: 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 10487 // 3). 10488 BoundingBox *BoundingPoly `json:"boundingBox,omitempty"` 10489 // Confidence: Confidence of the OCR results for the paragraph. Range [0, 1]. 10490 Confidence float64 `json:"confidence,omitempty"` 10491 // Property: Additional information detected for the paragraph. 10492 Property *TextProperty `json:"property,omitempty"` 10493 // Words: List of all words in this paragraph. 10494 Words []*Word `json:"words,omitempty"` 10495 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 10496 // unconditionally include in API requests. By default, fields with empty or 10497 // default values are omitted from API requests. See 10498 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 10499 // details. 10500 ForceSendFields []string `json:"-"` 10501 // NullFields is a list of field names (e.g. "BoundingBox") to include in API 10502 // requests with the JSON null value. By default, fields with empty values are 10503 // omitted from API requests. See 10504 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 10505 NullFields []string `json:"-"` 10506 } 10507 10508 func (s *Paragraph) MarshalJSON() ([]byte, error) { 10509 type NoMethod Paragraph 10510 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 10511 } 10512 10513 func (s *Paragraph) UnmarshalJSON(data []byte) error { 10514 type NoMethod Paragraph 10515 var s1 struct { 10516 Confidence gensupport.JSONFloat64 `json:"confidence"` 10517 *NoMethod 10518 } 10519 s1.NoMethod = (*NoMethod)(s) 10520 if err := json.Unmarshal(data, &s1); err != nil { 10521 return err 10522 } 10523 s.Confidence = float64(s1.Confidence) 10524 return nil 10525 } 10526 10527 // Position: A 3D position in the image, used primarily for Face detection 10528 // landmarks. A valid Position must have both x and y coordinates. The position 10529 // coordinates are in the same scale as the original image. 10530 type Position struct { 10531 // X: X coordinate. 10532 X float64 `json:"x,omitempty"` 10533 // Y: Y coordinate. 10534 Y float64 `json:"y,omitempty"` 10535 // Z: Z coordinate (or depth). 10536 Z float64 `json:"z,omitempty"` 10537 // ForceSendFields is a list of field names (e.g. "X") to unconditionally 10538 // include in API requests. By default, fields with empty or default values are 10539 // omitted from API requests. See 10540 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 10541 // details. 10542 ForceSendFields []string `json:"-"` 10543 // NullFields is a list of field names (e.g. "X") to include in API requests 10544 // with the JSON null value. By default, fields with empty values are omitted 10545 // from API requests. See 10546 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 10547 NullFields []string `json:"-"` 10548 } 10549 10550 func (s *Position) MarshalJSON() ([]byte, error) { 10551 type NoMethod Position 10552 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 10553 } 10554 10555 func (s *Position) UnmarshalJSON(data []byte) error { 10556 type NoMethod Position 10557 var s1 struct { 10558 X gensupport.JSONFloat64 `json:"x"` 10559 Y gensupport.JSONFloat64 `json:"y"` 10560 Z gensupport.JSONFloat64 `json:"z"` 10561 *NoMethod 10562 } 10563 s1.NoMethod = (*NoMethod)(s) 10564 if err := json.Unmarshal(data, &s1); err != nil { 10565 return err 10566 } 10567 s.X = float64(s1.X) 10568 s.Y = float64(s1.Y) 10569 s.Z = float64(s1.Z) 10570 return nil 10571 } 10572 10573 // Product: A Product contains ReferenceImages. 10574 type Product struct { 10575 // Description: User-provided metadata to be stored with this product. Must be 10576 // at most 4096 characters long. 10577 Description string `json:"description,omitempty"` 10578 // DisplayName: The user-provided name for this Product. Must not be empty. 10579 // Must be at most 4096 characters long. 10580 DisplayName string `json:"displayName,omitempty"` 10581 // Name: The resource name of the product. Format is: 10582 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This field is 10583 // ignored when creating a product. 10584 Name string `json:"name,omitempty"` 10585 // ProductCategory: Immutable. The category for the product identified by the 10586 // reference image. This should be one of "homegoods-v2", "apparel-v2", 10587 // "toys-v2", "packagedgoods-v1" or "general-v1". The legacy categories 10588 // "homegoods", "apparel", and "toys" are still supported, but these should not 10589 // be used for new products. 10590 ProductCategory string `json:"productCategory,omitempty"` 10591 // ProductLabels: Key-value pairs that can be attached to a product. At query 10592 // time, constraints can be specified based on the product_labels. Note that 10593 // integer values can be provided as strings, e.g. "1199". Only strings with 10594 // integer values can match a range-based restriction which is to be supported 10595 // soon. Multiple values can be assigned to the same key. One product may have 10596 // up to 500 product_labels. Notice that the total number of distinct 10597 // product_labels over all products in one ProductSet cannot exceed 1M, 10598 // otherwise the product search pipeline will refuse to work for that 10599 // ProductSet. 10600 ProductLabels []*KeyValue `json:"productLabels,omitempty"` 10601 10602 // ServerResponse contains the HTTP response code and headers from the server. 10603 googleapi.ServerResponse `json:"-"` 10604 // ForceSendFields is a list of field names (e.g. "Description") to 10605 // unconditionally include in API requests. By default, fields with empty or 10606 // default values are omitted from API requests. See 10607 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 10608 // details. 10609 ForceSendFields []string `json:"-"` 10610 // NullFields is a list of field names (e.g. "Description") to include in API 10611 // requests with the JSON null value. By default, fields with empty values are 10612 // omitted from API requests. See 10613 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 10614 NullFields []string `json:"-"` 10615 } 10616 10617 func (s *Product) MarshalJSON() ([]byte, error) { 10618 type NoMethod Product 10619 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 10620 } 10621 10622 // ProductSearchParams: Parameters for a product search request. 10623 type ProductSearchParams struct { 10624 // BoundingPoly: The bounding polygon around the area of interest in the image. 10625 // If it is not specified, system discretion will be applied. 10626 BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"` 10627 // Filter: The filtering expression. This can be used to restrict search 10628 // results based on Product labels. We currently support an AND of OR of 10629 // key-value expressions, where each expression within an OR must have the same 10630 // key. An '=' should be used to connect the key and value. For example, 10631 // "(color = red OR color = blue) AND brand = Google" is acceptable, but 10632 // "(color = red OR brand = Google)" is not acceptable. "color: red" is not 10633 // acceptable because it uses a ':' instead of an '='. 10634 Filter string `json:"filter,omitempty"` 10635 // ProductCategories: The list of product categories to search in. Currently, 10636 // we only consider the first category, and either "homegoods-v2", 10637 // "apparel-v2", "toys-v2", "packagedgoods-v1", or "general-v1" should be 10638 // specified. The legacy categories "homegoods", "apparel", and "toys" are 10639 // still supported but will be deprecated. For new products, please use 10640 // "homegoods-v2", "apparel-v2", or "toys-v2" for better product search 10641 // accuracy. It is recommended to migrate existing products to these categories 10642 // as well. 10643 ProductCategories []string `json:"productCategories,omitempty"` 10644 // ProductSet: The resource name of a ProductSet to be searched for similar 10645 // images. Format is: 10646 // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. 10647 ProductSet string `json:"productSet,omitempty"` 10648 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 10649 // unconditionally include in API requests. By default, fields with empty or 10650 // default values are omitted from API requests. See 10651 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 10652 // details. 10653 ForceSendFields []string `json:"-"` 10654 // NullFields is a list of field names (e.g. "BoundingPoly") to include in API 10655 // requests with the JSON null value. By default, fields with empty values are 10656 // omitted from API requests. See 10657 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 10658 NullFields []string `json:"-"` 10659 } 10660 10661 func (s *ProductSearchParams) MarshalJSON() ([]byte, error) { 10662 type NoMethod ProductSearchParams 10663 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 10664 } 10665 10666 // ProductSearchResults: Results for a product search request. 10667 type ProductSearchResults struct { 10668 // IndexTime: Timestamp of the index which provided these results. Products 10669 // added to the product set and products removed from the product set after 10670 // this time are not reflected in the current results. 10671 IndexTime string `json:"indexTime,omitempty"` 10672 // ProductGroupedResults: List of results grouped by products detected in the 10673 // query image. Each entry corresponds to one bounding polygon in the query 10674 // image, and contains the matching products specific to that region. There may 10675 // be duplicate product matches in the union of all the per-product results. 10676 ProductGroupedResults []*GroupedResult `json:"productGroupedResults,omitempty"` 10677 // Results: List of results, one for each product match. 10678 Results []*Result `json:"results,omitempty"` 10679 // ForceSendFields is a list of field names (e.g. "IndexTime") to 10680 // unconditionally include in API requests. By default, fields with empty or 10681 // default values are omitted from API requests. See 10682 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 10683 // details. 10684 ForceSendFields []string `json:"-"` 10685 // NullFields is a list of field names (e.g. "IndexTime") to include in API 10686 // requests with the JSON null value. By default, fields with empty values are 10687 // omitted from API requests. See 10688 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 10689 NullFields []string `json:"-"` 10690 } 10691 10692 func (s *ProductSearchResults) MarshalJSON() ([]byte, error) { 10693 type NoMethod ProductSearchResults 10694 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 10695 } 10696 10697 // ProductSet: A ProductSet contains Products. A ProductSet can contain a 10698 // maximum of 1 million reference images. If the limit is exceeded, periodic 10699 // indexing will fail. 10700 type ProductSet struct { 10701 // DisplayName: The user-provided name for this ProductSet. Must not be empty. 10702 // Must be at most 4096 characters long. 10703 DisplayName string `json:"displayName,omitempty"` 10704 // IndexError: Output only. If there was an error with indexing the product 10705 // set, the field is populated. This field is ignored when creating a 10706 // ProductSet. 10707 IndexError *Status `json:"indexError,omitempty"` 10708 // IndexTime: Output only. The time at which this ProductSet was last indexed. 10709 // Query results will reflect all updates before this time. If this ProductSet 10710 // has never been indexed, this timestamp is the default value 10711 // "1970-01-01T00:00:00Z". This field is ignored when creating a ProductSet. 10712 IndexTime string `json:"indexTime,omitempty"` 10713 // Name: The resource name of the ProductSet. Format is: 10714 // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. This 10715 // field is ignored when creating a ProductSet. 10716 Name string `json:"name,omitempty"` 10717 10718 // ServerResponse contains the HTTP response code and headers from the server. 10719 googleapi.ServerResponse `json:"-"` 10720 // ForceSendFields is a list of field names (e.g. "DisplayName") to 10721 // unconditionally include in API requests. By default, fields with empty or 10722 // default values are omitted from API requests. See 10723 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 10724 // details. 10725 ForceSendFields []string `json:"-"` 10726 // NullFields is a list of field names (e.g. "DisplayName") to include in API 10727 // requests with the JSON null value. By default, fields with empty values are 10728 // omitted from API requests. See 10729 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 10730 NullFields []string `json:"-"` 10731 } 10732 10733 func (s *ProductSet) MarshalJSON() ([]byte, error) { 10734 type NoMethod ProductSet 10735 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 10736 } 10737 10738 // ProductSetPurgeConfig: Config to control which ProductSet contains the 10739 // Products to be deleted. 10740 type ProductSetPurgeConfig struct { 10741 // ProductSetId: The ProductSet that contains the Products to delete. If a 10742 // Product is a member of product_set_id in addition to other ProductSets, the 10743 // Product will still be deleted. 10744 ProductSetId string `json:"productSetId,omitempty"` 10745 // ForceSendFields is a list of field names (e.g. "ProductSetId") to 10746 // unconditionally include in API requests. By default, fields with empty or 10747 // default values are omitted from API requests. See 10748 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 10749 // details. 10750 ForceSendFields []string `json:"-"` 10751 // NullFields is a list of field names (e.g. "ProductSetId") to include in API 10752 // requests with the JSON null value. By default, fields with empty values are 10753 // omitted from API requests. See 10754 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 10755 NullFields []string `json:"-"` 10756 } 10757 10758 func (s *ProductSetPurgeConfig) MarshalJSON() ([]byte, error) { 10759 type NoMethod ProductSetPurgeConfig 10760 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 10761 } 10762 10763 // Property: A `Property` consists of a user-supplied name/value pair. 10764 type Property struct { 10765 // Name: Name of the property. 10766 Name string `json:"name,omitempty"` 10767 // Uint64Value: Value of numeric properties. 10768 Uint64Value uint64 `json:"uint64Value,omitempty,string"` 10769 // Value: Value of the property. 10770 Value string `json:"value,omitempty"` 10771 // ForceSendFields is a list of field names (e.g. "Name") to unconditionally 10772 // include in API requests. By default, fields with empty or default values are 10773 // omitted from API requests. See 10774 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 10775 // details. 10776 ForceSendFields []string `json:"-"` 10777 // NullFields is a list of field names (e.g. "Name") to include in API requests 10778 // with the JSON null value. By default, fields with empty values are omitted 10779 // from API requests. See 10780 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 10781 NullFields []string `json:"-"` 10782 } 10783 10784 func (s *Property) MarshalJSON() ([]byte, error) { 10785 type NoMethod Property 10786 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 10787 } 10788 10789 // PurgeProductsRequest: Request message for the `PurgeProducts` method. 10790 type PurgeProductsRequest struct { 10791 // DeleteOrphanProducts: If delete_orphan_products is true, all Products that 10792 // are not in any ProductSet will be deleted. 10793 DeleteOrphanProducts bool `json:"deleteOrphanProducts,omitempty"` 10794 // Force: The default value is false. Override this value to true to actually 10795 // perform the purge. 10796 Force bool `json:"force,omitempty"` 10797 // ProductSetPurgeConfig: Specify which ProductSet contains the Products to be 10798 // deleted. 10799 ProductSetPurgeConfig *ProductSetPurgeConfig `json:"productSetPurgeConfig,omitempty"` 10800 // ForceSendFields is a list of field names (e.g. "DeleteOrphanProducts") to 10801 // unconditionally include in API requests. By default, fields with empty or 10802 // default values are omitted from API requests. See 10803 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 10804 // details. 10805 ForceSendFields []string `json:"-"` 10806 // NullFields is a list of field names (e.g. "DeleteOrphanProducts") to include 10807 // in API requests with the JSON null value. By default, fields with empty 10808 // values are omitted from API requests. See 10809 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 10810 NullFields []string `json:"-"` 10811 } 10812 10813 func (s *PurgeProductsRequest) MarshalJSON() ([]byte, error) { 10814 type NoMethod PurgeProductsRequest 10815 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 10816 } 10817 10818 // ReferenceImage: A `ReferenceImage` represents a product image and its 10819 // associated metadata, such as bounding boxes. 10820 type ReferenceImage struct { 10821 // BoundingPolys: Optional. Bounding polygons around the areas of interest in 10822 // the reference image. If this field is empty, the system will try to detect 10823 // regions of interest. At most 10 bounding polygons will be used. The provided 10824 // shape is converted into a non-rotated rectangle. Once converted, the small 10825 // edge of the rectangle must be greater than or equal to 300 pixels. The 10826 // aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 is not). 10827 BoundingPolys []*BoundingPoly `json:"boundingPolys,omitempty"` 10828 // Name: The resource name of the reference image. Format is: 10829 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMA 10830 // GE_ID`. This field is ignored when creating a reference image. 10831 Name string `json:"name,omitempty"` 10832 // Uri: Required. The Google Cloud Storage URI of the reference image. The URI 10833 // must start with `gs://`. 10834 Uri string `json:"uri,omitempty"` 10835 10836 // ServerResponse contains the HTTP response code and headers from the server. 10837 googleapi.ServerResponse `json:"-"` 10838 // ForceSendFields is a list of field names (e.g. "BoundingPolys") to 10839 // unconditionally include in API requests. By default, fields with empty or 10840 // default values are omitted from API requests. See 10841 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 10842 // details. 10843 ForceSendFields []string `json:"-"` 10844 // NullFields is a list of field names (e.g. "BoundingPolys") to include in API 10845 // requests with the JSON null value. By default, fields with empty values are 10846 // omitted from API requests. See 10847 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 10848 NullFields []string `json:"-"` 10849 } 10850 10851 func (s *ReferenceImage) MarshalJSON() ([]byte, error) { 10852 type NoMethod ReferenceImage 10853 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 10854 } 10855 10856 // RemoveProductFromProductSetRequest: Request message for the 10857 // `RemoveProductFromProductSet` method. 10858 type RemoveProductFromProductSetRequest struct { 10859 // Product: Required. The resource name for the Product to be removed from this 10860 // ProductSet. Format is: 10861 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` 10862 Product string `json:"product,omitempty"` 10863 // ForceSendFields is a list of field names (e.g. "Product") to unconditionally 10864 // include in API requests. By default, fields with empty or default values are 10865 // omitted from API requests. See 10866 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 10867 // details. 10868 ForceSendFields []string `json:"-"` 10869 // NullFields is a list of field names (e.g. "Product") to include in API 10870 // requests with the JSON null value. By default, fields with empty values are 10871 // omitted from API requests. See 10872 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 10873 NullFields []string `json:"-"` 10874 } 10875 10876 func (s *RemoveProductFromProductSetRequest) MarshalJSON() ([]byte, error) { 10877 type NoMethod RemoveProductFromProductSetRequest 10878 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 10879 } 10880 10881 // Result: Information about a product. 10882 type Result struct { 10883 // Image: The resource name of the image from the product that is the closest 10884 // match to the query. 10885 Image string `json:"image,omitempty"` 10886 // Product: The Product. 10887 Product *Product `json:"product,omitempty"` 10888 // Score: A confidence level on the match, ranging from 0 (no confidence) to 1 10889 // (full confidence). 10890 Score float64 `json:"score,omitempty"` 10891 // ForceSendFields is a list of field names (e.g. "Image") to unconditionally 10892 // include in API requests. By default, fields with empty or default values are 10893 // omitted from API requests. See 10894 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 10895 // details. 10896 ForceSendFields []string `json:"-"` 10897 // NullFields is a list of field names (e.g. "Image") to include in API 10898 // requests with the JSON null value. By default, fields with empty values are 10899 // omitted from API requests. See 10900 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 10901 NullFields []string `json:"-"` 10902 } 10903 10904 func (s *Result) MarshalJSON() ([]byte, error) { 10905 type NoMethod Result 10906 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 10907 } 10908 10909 func (s *Result) UnmarshalJSON(data []byte) error { 10910 type NoMethod Result 10911 var s1 struct { 10912 Score gensupport.JSONFloat64 `json:"score"` 10913 *NoMethod 10914 } 10915 s1.NoMethod = (*NoMethod)(s) 10916 if err := json.Unmarshal(data, &s1); err != nil { 10917 return err 10918 } 10919 s.Score = float64(s1.Score) 10920 return nil 10921 } 10922 10923 // SafeSearchAnnotation: Set of features pertaining to the image, computed by 10924 // computer vision methods over safe-search verticals (for example, adult, 10925 // spoof, medical, violence). 10926 type SafeSearchAnnotation struct { 10927 // Adult: Represents the adult content likelihood for the image. Adult content 10928 // may contain elements such as nudity, pornographic images or cartoons, or 10929 // sexual activities. 10930 // 10931 // Possible values: 10932 // "UNKNOWN" - Unknown likelihood. 10933 // "VERY_UNLIKELY" - It is very unlikely. 10934 // "UNLIKELY" - It is unlikely. 10935 // "POSSIBLE" - It is possible. 10936 // "LIKELY" - It is likely. 10937 // "VERY_LIKELY" - It is very likely. 10938 Adult string `json:"adult,omitempty"` 10939 // Medical: Likelihood that this is a medical image. 10940 // 10941 // Possible values: 10942 // "UNKNOWN" - Unknown likelihood. 10943 // "VERY_UNLIKELY" - It is very unlikely. 10944 // "UNLIKELY" - It is unlikely. 10945 // "POSSIBLE" - It is possible. 10946 // "LIKELY" - It is likely. 10947 // "VERY_LIKELY" - It is very likely. 10948 Medical string `json:"medical,omitempty"` 10949 // Racy: Likelihood that the request image contains racy content. Racy content 10950 // may include (but is not limited to) skimpy or sheer clothing, strategically 10951 // covered nudity, lewd or provocative poses, or close-ups of sensitive body 10952 // areas. 10953 // 10954 // Possible values: 10955 // "UNKNOWN" - Unknown likelihood. 10956 // "VERY_UNLIKELY" - It is very unlikely. 10957 // "UNLIKELY" - It is unlikely. 10958 // "POSSIBLE" - It is possible. 10959 // "LIKELY" - It is likely. 10960 // "VERY_LIKELY" - It is very likely. 10961 Racy string `json:"racy,omitempty"` 10962 // Spoof: Spoof likelihood. The likelihood that an modification was made to the 10963 // image's canonical version to make it appear funny or offensive. 10964 // 10965 // Possible values: 10966 // "UNKNOWN" - Unknown likelihood. 10967 // "VERY_UNLIKELY" - It is very unlikely. 10968 // "UNLIKELY" - It is unlikely. 10969 // "POSSIBLE" - It is possible. 10970 // "LIKELY" - It is likely. 10971 // "VERY_LIKELY" - It is very likely. 10972 Spoof string `json:"spoof,omitempty"` 10973 // Violence: Likelihood that this image contains violent content. Violent 10974 // content may include death, serious harm, or injury to individuals or groups 10975 // of individuals. 10976 // 10977 // Possible values: 10978 // "UNKNOWN" - Unknown likelihood. 10979 // "VERY_UNLIKELY" - It is very unlikely. 10980 // "UNLIKELY" - It is unlikely. 10981 // "POSSIBLE" - It is possible. 10982 // "LIKELY" - It is likely. 10983 // "VERY_LIKELY" - It is very likely. 10984 Violence string `json:"violence,omitempty"` 10985 // ForceSendFields is a list of field names (e.g. "Adult") to unconditionally 10986 // include in API requests. By default, fields with empty or default values are 10987 // omitted from API requests. See 10988 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 10989 // details. 10990 ForceSendFields []string `json:"-"` 10991 // NullFields is a list of field names (e.g. "Adult") to include in API 10992 // requests with the JSON null value. By default, fields with empty values are 10993 // omitted from API requests. See 10994 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 10995 NullFields []string `json:"-"` 10996 } 10997 10998 func (s *SafeSearchAnnotation) MarshalJSON() ([]byte, error) { 10999 type NoMethod SafeSearchAnnotation 11000 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 11001 } 11002 11003 // Status: The `Status` type defines a logical error model that is suitable for 11004 // different programming environments, including REST APIs and RPC APIs. It is 11005 // used by gRPC (https://github.com/grpc). Each `Status` message contains three 11006 // pieces of data: error code, error message, and error details. You can find 11007 // out more about this error model and how to work with it in the API Design 11008 // Guide (https://cloud.google.com/apis/design/errors). 11009 type Status struct { 11010 // Code: The status code, which should be an enum value of google.rpc.Code. 11011 Code int64 `json:"code,omitempty"` 11012 // Details: A list of messages that carry the error details. There is a common 11013 // set of message types for APIs to use. 11014 Details []googleapi.RawMessage `json:"details,omitempty"` 11015 // Message: A developer-facing error message, which should be in English. Any 11016 // user-facing error message should be localized and sent in the 11017 // google.rpc.Status.details field, or localized by the client. 11018 Message string `json:"message,omitempty"` 11019 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally 11020 // include in API requests. By default, fields with empty or default values are 11021 // omitted from API requests. See 11022 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 11023 // details. 11024 ForceSendFields []string `json:"-"` 11025 // NullFields is a list of field names (e.g. "Code") to include in API requests 11026 // with the JSON null value. By default, fields with empty values are omitted 11027 // from API requests. See 11028 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 11029 NullFields []string `json:"-"` 11030 } 11031 11032 func (s *Status) MarshalJSON() ([]byte, error) { 11033 type NoMethod Status 11034 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 11035 } 11036 11037 // Symbol: A single symbol representation. 11038 type Symbol struct { 11039 // BoundingBox: The bounding box for the symbol. The vertices are in the order 11040 // of top-left, top-right, bottom-right, bottom-left. When a rotation of the 11041 // bounding box is detected the rotation is represented as around the top-left 11042 // corner as defined when the text is read in the 'natural' orientation. For 11043 // example: * when the text is horizontal it might look like: 0----1 | | 3----2 11044 // * when it's rotated 180 degrees around the top-left corner it becomes: 11045 // 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 3). 11046 BoundingBox *BoundingPoly `json:"boundingBox,omitempty"` 11047 // Confidence: Confidence of the OCR results for the symbol. Range [0, 1]. 11048 Confidence float64 `json:"confidence,omitempty"` 11049 // Property: Additional information detected for the symbol. 11050 Property *TextProperty `json:"property,omitempty"` 11051 // Text: The actual UTF-8 representation of the symbol. 11052 Text string `json:"text,omitempty"` 11053 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 11054 // unconditionally include in API requests. By default, fields with empty or 11055 // default values are omitted from API requests. See 11056 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 11057 // details. 11058 ForceSendFields []string `json:"-"` 11059 // NullFields is a list of field names (e.g. "BoundingBox") to include in API 11060 // requests with the JSON null value. By default, fields with empty values are 11061 // omitted from API requests. See 11062 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 11063 NullFields []string `json:"-"` 11064 } 11065 11066 func (s *Symbol) MarshalJSON() ([]byte, error) { 11067 type NoMethod Symbol 11068 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 11069 } 11070 11071 func (s *Symbol) UnmarshalJSON(data []byte) error { 11072 type NoMethod Symbol 11073 var s1 struct { 11074 Confidence gensupport.JSONFloat64 `json:"confidence"` 11075 *NoMethod 11076 } 11077 s1.NoMethod = (*NoMethod)(s) 11078 if err := json.Unmarshal(data, &s1); err != nil { 11079 return err 11080 } 11081 s.Confidence = float64(s1.Confidence) 11082 return nil 11083 } 11084 11085 // TextAnnotation: TextAnnotation contains a structured representation of OCR 11086 // extracted text. The hierarchy of an OCR extracted text structure is like 11087 // this: TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol Each 11088 // structural component, starting from Page, may further have their own 11089 // properties. Properties describe detected languages, breaks etc.. Please 11090 // refer to the TextAnnotation.TextProperty message definition below for more 11091 // detail. 11092 type TextAnnotation struct { 11093 // Pages: List of pages detected by OCR. 11094 Pages []*Page `json:"pages,omitempty"` 11095 // Text: UTF-8 text detected on the pages. 11096 Text string `json:"text,omitempty"` 11097 // ForceSendFields is a list of field names (e.g. "Pages") to unconditionally 11098 // include in API requests. By default, fields with empty or default values are 11099 // omitted from API requests. See 11100 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 11101 // details. 11102 ForceSendFields []string `json:"-"` 11103 // NullFields is a list of field names (e.g. "Pages") to include in API 11104 // requests with the JSON null value. By default, fields with empty values are 11105 // omitted from API requests. See 11106 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 11107 NullFields []string `json:"-"` 11108 } 11109 11110 func (s *TextAnnotation) MarshalJSON() ([]byte, error) { 11111 type NoMethod TextAnnotation 11112 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 11113 } 11114 11115 // TextDetectionParams: Parameters for text detections. This is used to control 11116 // TEXT_DETECTION and DOCUMENT_TEXT_DETECTION features. 11117 type TextDetectionParams struct { 11118 // AdvancedOcrOptions: A list of advanced OCR options to further fine-tune OCR 11119 // behavior. Current valid values are: - `legacy_layout`: a heuristics layout 11120 // detection algorithm, which serves as an alternative to the current ML-based 11121 // layout detection algorithm. Customers can choose the best suitable layout 11122 // algorithm based on their situation. 11123 AdvancedOcrOptions []string `json:"advancedOcrOptions,omitempty"` 11124 // EnableTextDetectionConfidenceScore: By default, Cloud Vision API only 11125 // includes confidence score for DOCUMENT_TEXT_DETECTION result. Set the flag 11126 // to true to include confidence score for TEXT_DETECTION as well. 11127 EnableTextDetectionConfidenceScore bool `json:"enableTextDetectionConfidenceScore,omitempty"` 11128 // ForceSendFields is a list of field names (e.g. "AdvancedOcrOptions") to 11129 // unconditionally include in API requests. By default, fields with empty or 11130 // default values are omitted from API requests. See 11131 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 11132 // details. 11133 ForceSendFields []string `json:"-"` 11134 // NullFields is a list of field names (e.g. "AdvancedOcrOptions") to include 11135 // in API requests with the JSON null value. By default, fields with empty 11136 // values are omitted from API requests. See 11137 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 11138 NullFields []string `json:"-"` 11139 } 11140 11141 func (s *TextDetectionParams) MarshalJSON() ([]byte, error) { 11142 type NoMethod TextDetectionParams 11143 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 11144 } 11145 11146 // TextProperty: Additional information detected on the structural component. 11147 type TextProperty struct { 11148 // DetectedBreak: Detected start or end of a text segment. 11149 DetectedBreak *DetectedBreak `json:"detectedBreak,omitempty"` 11150 // DetectedLanguages: A list of detected languages together with confidence. 11151 DetectedLanguages []*DetectedLanguage `json:"detectedLanguages,omitempty"` 11152 // ForceSendFields is a list of field names (e.g. "DetectedBreak") to 11153 // unconditionally include in API requests. By default, fields with empty or 11154 // default values are omitted from API requests. See 11155 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 11156 // details. 11157 ForceSendFields []string `json:"-"` 11158 // NullFields is a list of field names (e.g. "DetectedBreak") to include in API 11159 // requests with the JSON null value. By default, fields with empty values are 11160 // omitted from API requests. See 11161 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 11162 NullFields []string `json:"-"` 11163 } 11164 11165 func (s *TextProperty) MarshalJSON() ([]byte, error) { 11166 type NoMethod TextProperty 11167 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 11168 } 11169 11170 // Vertex: A vertex represents a 2D point in the image. NOTE: the vertex 11171 // coordinates are in the same scale as the original image. 11172 type Vertex struct { 11173 // X: X coordinate. 11174 X int64 `json:"x,omitempty"` 11175 // Y: Y coordinate. 11176 Y int64 `json:"y,omitempty"` 11177 // ForceSendFields is a list of field names (e.g. "X") to unconditionally 11178 // include in API requests. By default, fields with empty or default values are 11179 // omitted from API requests. See 11180 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 11181 // details. 11182 ForceSendFields []string `json:"-"` 11183 // NullFields is a list of field names (e.g. "X") to include in API requests 11184 // with the JSON null value. By default, fields with empty values are omitted 11185 // from API requests. See 11186 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 11187 NullFields []string `json:"-"` 11188 } 11189 11190 func (s *Vertex) MarshalJSON() ([]byte, error) { 11191 type NoMethod Vertex 11192 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 11193 } 11194 11195 // WebDetection: Relevant information for the image from the Internet. 11196 type WebDetection struct { 11197 // BestGuessLabels: The service's best guess as to the topic of the request 11198 // image. Inferred from similar images on the open web. 11199 BestGuessLabels []*WebLabel `json:"bestGuessLabels,omitempty"` 11200 // FullMatchingImages: Fully matching images from the Internet. Can include 11201 // resized copies of the query image. 11202 FullMatchingImages []*WebImage `json:"fullMatchingImages,omitempty"` 11203 // PagesWithMatchingImages: Web pages containing the matching images from the 11204 // Internet. 11205 PagesWithMatchingImages []*WebPage `json:"pagesWithMatchingImages,omitempty"` 11206 // PartialMatchingImages: Partial matching images from the Internet. Those 11207 // images are similar enough to share some key-point features. For example an 11208 // original image will likely have partial matching for its crops. 11209 PartialMatchingImages []*WebImage `json:"partialMatchingImages,omitempty"` 11210 // VisuallySimilarImages: The visually similar image results. 11211 VisuallySimilarImages []*WebImage `json:"visuallySimilarImages,omitempty"` 11212 // WebEntities: Deduced entities from similar images on the Internet. 11213 WebEntities []*WebEntity `json:"webEntities,omitempty"` 11214 // ForceSendFields is a list of field names (e.g. "BestGuessLabels") to 11215 // unconditionally include in API requests. By default, fields with empty or 11216 // default values are omitted from API requests. See 11217 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 11218 // details. 11219 ForceSendFields []string `json:"-"` 11220 // NullFields is a list of field names (e.g. "BestGuessLabels") to include in 11221 // API requests with the JSON null value. By default, fields with empty values 11222 // are omitted from API requests. See 11223 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 11224 NullFields []string `json:"-"` 11225 } 11226 11227 func (s *WebDetection) MarshalJSON() ([]byte, error) { 11228 type NoMethod WebDetection 11229 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 11230 } 11231 11232 // WebDetectionParams: Parameters for web detection request. 11233 type WebDetectionParams struct { 11234 // IncludeGeoResults: This field has no effect on results. 11235 IncludeGeoResults bool `json:"includeGeoResults,omitempty"` 11236 // ForceSendFields is a list of field names (e.g. "IncludeGeoResults") to 11237 // unconditionally include in API requests. By default, fields with empty or 11238 // default values are omitted from API requests. See 11239 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 11240 // details. 11241 ForceSendFields []string `json:"-"` 11242 // NullFields is a list of field names (e.g. "IncludeGeoResults") to include in 11243 // API requests with the JSON null value. By default, fields with empty values 11244 // are omitted from API requests. See 11245 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 11246 NullFields []string `json:"-"` 11247 } 11248 11249 func (s *WebDetectionParams) MarshalJSON() ([]byte, error) { 11250 type NoMethod WebDetectionParams 11251 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 11252 } 11253 11254 // WebEntity: Entity deduced from similar images on the Internet. 11255 type WebEntity struct { 11256 // Description: Canonical description of the entity, in English. 11257 Description string `json:"description,omitempty"` 11258 // EntityId: Opaque entity ID. 11259 EntityId string `json:"entityId,omitempty"` 11260 // Score: Overall relevancy score for the entity. Not normalized and not 11261 // comparable across different image queries. 11262 Score float64 `json:"score,omitempty"` 11263 // ForceSendFields is a list of field names (e.g. "Description") to 11264 // unconditionally include in API requests. By default, fields with empty or 11265 // default values are omitted from API requests. See 11266 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 11267 // details. 11268 ForceSendFields []string `json:"-"` 11269 // NullFields is a list of field names (e.g. "Description") to include in API 11270 // requests with the JSON null value. By default, fields with empty values are 11271 // omitted from API requests. See 11272 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 11273 NullFields []string `json:"-"` 11274 } 11275 11276 func (s *WebEntity) MarshalJSON() ([]byte, error) { 11277 type NoMethod WebEntity 11278 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 11279 } 11280 11281 func (s *WebEntity) UnmarshalJSON(data []byte) error { 11282 type NoMethod WebEntity 11283 var s1 struct { 11284 Score gensupport.JSONFloat64 `json:"score"` 11285 *NoMethod 11286 } 11287 s1.NoMethod = (*NoMethod)(s) 11288 if err := json.Unmarshal(data, &s1); err != nil { 11289 return err 11290 } 11291 s.Score = float64(s1.Score) 11292 return nil 11293 } 11294 11295 // WebImage: Metadata for online images. 11296 type WebImage struct { 11297 // Score: (Deprecated) Overall relevancy score for the image. 11298 Score float64 `json:"score,omitempty"` 11299 // Url: The result image URL. 11300 Url string `json:"url,omitempty"` 11301 // ForceSendFields is a list of field names (e.g. "Score") to unconditionally 11302 // include in API requests. By default, fields with empty or default values are 11303 // omitted from API requests. See 11304 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 11305 // details. 11306 ForceSendFields []string `json:"-"` 11307 // NullFields is a list of field names (e.g. "Score") to include in API 11308 // requests with the JSON null value. By default, fields with empty values are 11309 // omitted from API requests. See 11310 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 11311 NullFields []string `json:"-"` 11312 } 11313 11314 func (s *WebImage) MarshalJSON() ([]byte, error) { 11315 type NoMethod WebImage 11316 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 11317 } 11318 11319 func (s *WebImage) UnmarshalJSON(data []byte) error { 11320 type NoMethod WebImage 11321 var s1 struct { 11322 Score gensupport.JSONFloat64 `json:"score"` 11323 *NoMethod 11324 } 11325 s1.NoMethod = (*NoMethod)(s) 11326 if err := json.Unmarshal(data, &s1); err != nil { 11327 return err 11328 } 11329 s.Score = float64(s1.Score) 11330 return nil 11331 } 11332 11333 // WebLabel: Label to provide extra metadata for the web detection. 11334 type WebLabel struct { 11335 // Label: Label for extra metadata. 11336 Label string `json:"label,omitempty"` 11337 // LanguageCode: The BCP-47 language code for `label`, such as "en-US" or 11338 // "sr-Latn". For more information, see 11339 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 11340 LanguageCode string `json:"languageCode,omitempty"` 11341 // ForceSendFields is a list of field names (e.g. "Label") to unconditionally 11342 // include in API requests. By default, fields with empty or default values are 11343 // omitted from API requests. See 11344 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 11345 // details. 11346 ForceSendFields []string `json:"-"` 11347 // NullFields is a list of field names (e.g. "Label") to include in API 11348 // requests with the JSON null value. By default, fields with empty values are 11349 // omitted from API requests. See 11350 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 11351 NullFields []string `json:"-"` 11352 } 11353 11354 func (s *WebLabel) MarshalJSON() ([]byte, error) { 11355 type NoMethod WebLabel 11356 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 11357 } 11358 11359 // WebPage: Metadata for web pages. 11360 type WebPage struct { 11361 // FullMatchingImages: Fully matching images on the page. Can include resized 11362 // copies of the query image. 11363 FullMatchingImages []*WebImage `json:"fullMatchingImages,omitempty"` 11364 // PageTitle: Title for the web page, may contain HTML markups. 11365 PageTitle string `json:"pageTitle,omitempty"` 11366 // PartialMatchingImages: Partial matching images on the page. Those images are 11367 // similar enough to share some key-point features. For example an original 11368 // image will likely have partial matching for its crops. 11369 PartialMatchingImages []*WebImage `json:"partialMatchingImages,omitempty"` 11370 // Score: (Deprecated) Overall relevancy score for the web page. 11371 Score float64 `json:"score,omitempty"` 11372 // Url: The result web page URL. 11373 Url string `json:"url,omitempty"` 11374 // ForceSendFields is a list of field names (e.g. "FullMatchingImages") to 11375 // unconditionally include in API requests. By default, fields with empty or 11376 // default values are omitted from API requests. See 11377 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 11378 // details. 11379 ForceSendFields []string `json:"-"` 11380 // NullFields is a list of field names (e.g. "FullMatchingImages") to include 11381 // in API requests with the JSON null value. By default, fields with empty 11382 // values are omitted from API requests. See 11383 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 11384 NullFields []string `json:"-"` 11385 } 11386 11387 func (s *WebPage) MarshalJSON() ([]byte, error) { 11388 type NoMethod WebPage 11389 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 11390 } 11391 11392 func (s *WebPage) UnmarshalJSON(data []byte) error { 11393 type NoMethod WebPage 11394 var s1 struct { 11395 Score gensupport.JSONFloat64 `json:"score"` 11396 *NoMethod 11397 } 11398 s1.NoMethod = (*NoMethod)(s) 11399 if err := json.Unmarshal(data, &s1); err != nil { 11400 return err 11401 } 11402 s.Score = float64(s1.Score) 11403 return nil 11404 } 11405 11406 // Word: A word representation. 11407 type Word struct { 11408 // BoundingBox: The bounding box for the word. The vertices are in the order of 11409 // top-left, top-right, bottom-right, bottom-left. When a rotation of the 11410 // bounding box is detected the rotation is represented as around the top-left 11411 // corner as defined when the text is read in the 'natural' orientation. For 11412 // example: * when the text is horizontal it might look like: 0----1 | | 3----2 11413 // * when it's rotated 180 degrees around the top-left corner it becomes: 11414 // 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 3). 11415 BoundingBox *BoundingPoly `json:"boundingBox,omitempty"` 11416 // Confidence: Confidence of the OCR results for the word. Range [0, 1]. 11417 Confidence float64 `json:"confidence,omitempty"` 11418 // Property: Additional information detected for the word. 11419 Property *TextProperty `json:"property,omitempty"` 11420 // Symbols: List of symbols in the word. The order of the symbols follows the 11421 // natural reading order. 11422 Symbols []*Symbol `json:"symbols,omitempty"` 11423 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 11424 // unconditionally include in API requests. By default, fields with empty or 11425 // default values are omitted from API requests. See 11426 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 11427 // details. 11428 ForceSendFields []string `json:"-"` 11429 // NullFields is a list of field names (e.g. "BoundingBox") to include in API 11430 // requests with the JSON null value. By default, fields with empty values are 11431 // omitted from API requests. See 11432 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 11433 NullFields []string `json:"-"` 11434 } 11435 11436 func (s *Word) MarshalJSON() ([]byte, error) { 11437 type NoMethod Word 11438 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 11439 } 11440 11441 func (s *Word) UnmarshalJSON(data []byte) error { 11442 type NoMethod Word 11443 var s1 struct { 11444 Confidence gensupport.JSONFloat64 `json:"confidence"` 11445 *NoMethod 11446 } 11447 s1.NoMethod = (*NoMethod)(s) 11448 if err := json.Unmarshal(data, &s1); err != nil { 11449 return err 11450 } 11451 s.Confidence = float64(s1.Confidence) 11452 return nil 11453 } 11454 11455 type FilesAnnotateCall struct { 11456 s *Service 11457 batchannotatefilesrequest *BatchAnnotateFilesRequest 11458 urlParams_ gensupport.URLParams 11459 ctx_ context.Context 11460 header_ http.Header 11461 } 11462 11463 // Annotate: Service that performs image detection and annotation for a batch 11464 // of files. Now only "application/pdf", "image/tiff" and "image/gif" are 11465 // supported. This service will extract at most 5 (customers can specify which 11466 // 5 in AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from 11467 // each file provided and perform detection and annotation for each image 11468 // extracted. 11469 func (r *FilesService) Annotate(batchannotatefilesrequest *BatchAnnotateFilesRequest) *FilesAnnotateCall { 11470 c := &FilesAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11471 c.batchannotatefilesrequest = batchannotatefilesrequest 11472 return c 11473 } 11474 11475 // Fields allows partial responses to be retrieved. See 11476 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 11477 // details. 11478 func (c *FilesAnnotateCall) Fields(s ...googleapi.Field) *FilesAnnotateCall { 11479 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11480 return c 11481 } 11482 11483 // Context sets the context to be used in this call's Do method. 11484 func (c *FilesAnnotateCall) Context(ctx context.Context) *FilesAnnotateCall { 11485 c.ctx_ = ctx 11486 return c 11487 } 11488 11489 // Header returns a http.Header that can be modified by the caller to add 11490 // headers to the request. 11491 func (c *FilesAnnotateCall) Header() http.Header { 11492 if c.header_ == nil { 11493 c.header_ = make(http.Header) 11494 } 11495 return c.header_ 11496 } 11497 11498 func (c *FilesAnnotateCall) doRequest(alt string) (*http.Response, error) { 11499 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 11500 var body io.Reader = nil 11501 body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchannotatefilesrequest) 11502 if err != nil { 11503 return nil, err 11504 } 11505 c.urlParams_.Set("alt", alt) 11506 c.urlParams_.Set("prettyPrint", "false") 11507 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/files:annotate") 11508 urls += "?" + c.urlParams_.Encode() 11509 req, err := http.NewRequest("POST", urls, body) 11510 if err != nil { 11511 return nil, err 11512 } 11513 req.Header = reqHeaders 11514 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11515 } 11516 11517 // Do executes the "vision.files.annotate" call. 11518 // Any non-2xx status code is an error. Response headers are in either 11519 // *BatchAnnotateFilesResponse.ServerResponse.Header or (if a response was 11520 // returned at all) in error.(*googleapi.Error).Header. Use 11521 // googleapi.IsNotModified to check whether the returned error was because 11522 // http.StatusNotModified was returned. 11523 func (c *FilesAnnotateCall) Do(opts ...googleapi.CallOption) (*BatchAnnotateFilesResponse, error) { 11524 gensupport.SetOptions(c.urlParams_, opts...) 11525 res, err := c.doRequest("json") 11526 if res != nil && res.StatusCode == http.StatusNotModified { 11527 if res.Body != nil { 11528 res.Body.Close() 11529 } 11530 return nil, gensupport.WrapError(&googleapi.Error{ 11531 Code: res.StatusCode, 11532 Header: res.Header, 11533 }) 11534 } 11535 if err != nil { 11536 return nil, err 11537 } 11538 defer googleapi.CloseBody(res) 11539 if err := googleapi.CheckResponse(res); err != nil { 11540 return nil, gensupport.WrapError(err) 11541 } 11542 ret := &BatchAnnotateFilesResponse{ 11543 ServerResponse: googleapi.ServerResponse{ 11544 Header: res.Header, 11545 HTTPStatusCode: res.StatusCode, 11546 }, 11547 } 11548 target := &ret 11549 if err := gensupport.DecodeResponse(target, res); err != nil { 11550 return nil, err 11551 } 11552 return ret, nil 11553 } 11554 11555 type FilesAsyncBatchAnnotateCall struct { 11556 s *Service 11557 asyncbatchannotatefilesrequest *AsyncBatchAnnotateFilesRequest 11558 urlParams_ gensupport.URLParams 11559 ctx_ context.Context 11560 header_ http.Header 11561 } 11562 11563 // AsyncBatchAnnotate: Run asynchronous image detection and annotation for a 11564 // list of generic files, such as PDF files, which may contain multiple pages 11565 // and multiple images per page. Progress and results can be retrieved through 11566 // the `google.longrunning.Operations` interface. `Operation.metadata` contains 11567 // `OperationMetadata` (metadata). `Operation.response` contains 11568 // `AsyncBatchAnnotateFilesResponse` (results). 11569 func (r *FilesService) AsyncBatchAnnotate(asyncbatchannotatefilesrequest *AsyncBatchAnnotateFilesRequest) *FilesAsyncBatchAnnotateCall { 11570 c := &FilesAsyncBatchAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11571 c.asyncbatchannotatefilesrequest = asyncbatchannotatefilesrequest 11572 return c 11573 } 11574 11575 // Fields allows partial responses to be retrieved. See 11576 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 11577 // details. 11578 func (c *FilesAsyncBatchAnnotateCall) Fields(s ...googleapi.Field) *FilesAsyncBatchAnnotateCall { 11579 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11580 return c 11581 } 11582 11583 // Context sets the context to be used in this call's Do method. 11584 func (c *FilesAsyncBatchAnnotateCall) Context(ctx context.Context) *FilesAsyncBatchAnnotateCall { 11585 c.ctx_ = ctx 11586 return c 11587 } 11588 11589 // Header returns a http.Header that can be modified by the caller to add 11590 // headers to the request. 11591 func (c *FilesAsyncBatchAnnotateCall) Header() http.Header { 11592 if c.header_ == nil { 11593 c.header_ = make(http.Header) 11594 } 11595 return c.header_ 11596 } 11597 11598 func (c *FilesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { 11599 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 11600 var body io.Reader = nil 11601 body, err := googleapi.WithoutDataWrapper.JSONReader(c.asyncbatchannotatefilesrequest) 11602 if err != nil { 11603 return nil, err 11604 } 11605 c.urlParams_.Set("alt", alt) 11606 c.urlParams_.Set("prettyPrint", "false") 11607 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/files:asyncBatchAnnotate") 11608 urls += "?" + c.urlParams_.Encode() 11609 req, err := http.NewRequest("POST", urls, body) 11610 if err != nil { 11611 return nil, err 11612 } 11613 req.Header = reqHeaders 11614 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11615 } 11616 11617 // Do executes the "vision.files.asyncBatchAnnotate" call. 11618 // Any non-2xx status code is an error. Response headers are in either 11619 // *Operation.ServerResponse.Header or (if a response was returned at all) in 11620 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 11621 // whether the returned error was because http.StatusNotModified was returned. 11622 func (c *FilesAsyncBatchAnnotateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 11623 gensupport.SetOptions(c.urlParams_, opts...) 11624 res, err := c.doRequest("json") 11625 if res != nil && res.StatusCode == http.StatusNotModified { 11626 if res.Body != nil { 11627 res.Body.Close() 11628 } 11629 return nil, gensupport.WrapError(&googleapi.Error{ 11630 Code: res.StatusCode, 11631 Header: res.Header, 11632 }) 11633 } 11634 if err != nil { 11635 return nil, err 11636 } 11637 defer googleapi.CloseBody(res) 11638 if err := googleapi.CheckResponse(res); err != nil { 11639 return nil, gensupport.WrapError(err) 11640 } 11641 ret := &Operation{ 11642 ServerResponse: googleapi.ServerResponse{ 11643 Header: res.Header, 11644 HTTPStatusCode: res.StatusCode, 11645 }, 11646 } 11647 target := &ret 11648 if err := gensupport.DecodeResponse(target, res); err != nil { 11649 return nil, err 11650 } 11651 return ret, nil 11652 } 11653 11654 type ImagesAnnotateCall struct { 11655 s *Service 11656 batchannotateimagesrequest *BatchAnnotateImagesRequest 11657 urlParams_ gensupport.URLParams 11658 ctx_ context.Context 11659 header_ http.Header 11660 } 11661 11662 // Annotate: Run image detection and annotation for a batch of images. 11663 func (r *ImagesService) Annotate(batchannotateimagesrequest *BatchAnnotateImagesRequest) *ImagesAnnotateCall { 11664 c := &ImagesAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11665 c.batchannotateimagesrequest = batchannotateimagesrequest 11666 return c 11667 } 11668 11669 // Fields allows partial responses to be retrieved. See 11670 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 11671 // details. 11672 func (c *ImagesAnnotateCall) Fields(s ...googleapi.Field) *ImagesAnnotateCall { 11673 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11674 return c 11675 } 11676 11677 // Context sets the context to be used in this call's Do method. 11678 func (c *ImagesAnnotateCall) Context(ctx context.Context) *ImagesAnnotateCall { 11679 c.ctx_ = ctx 11680 return c 11681 } 11682 11683 // Header returns a http.Header that can be modified by the caller to add 11684 // headers to the request. 11685 func (c *ImagesAnnotateCall) Header() http.Header { 11686 if c.header_ == nil { 11687 c.header_ = make(http.Header) 11688 } 11689 return c.header_ 11690 } 11691 11692 func (c *ImagesAnnotateCall) doRequest(alt string) (*http.Response, error) { 11693 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 11694 var body io.Reader = nil 11695 body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchannotateimagesrequest) 11696 if err != nil { 11697 return nil, err 11698 } 11699 c.urlParams_.Set("alt", alt) 11700 c.urlParams_.Set("prettyPrint", "false") 11701 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/images:annotate") 11702 urls += "?" + c.urlParams_.Encode() 11703 req, err := http.NewRequest("POST", urls, body) 11704 if err != nil { 11705 return nil, err 11706 } 11707 req.Header = reqHeaders 11708 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11709 } 11710 11711 // Do executes the "vision.images.annotate" call. 11712 // Any non-2xx status code is an error. Response headers are in either 11713 // *BatchAnnotateImagesResponse.ServerResponse.Header or (if a response was 11714 // returned at all) in error.(*googleapi.Error).Header. Use 11715 // googleapi.IsNotModified to check whether the returned error was because 11716 // http.StatusNotModified was returned. 11717 func (c *ImagesAnnotateCall) Do(opts ...googleapi.CallOption) (*BatchAnnotateImagesResponse, error) { 11718 gensupport.SetOptions(c.urlParams_, opts...) 11719 res, err := c.doRequest("json") 11720 if res != nil && res.StatusCode == http.StatusNotModified { 11721 if res.Body != nil { 11722 res.Body.Close() 11723 } 11724 return nil, gensupport.WrapError(&googleapi.Error{ 11725 Code: res.StatusCode, 11726 Header: res.Header, 11727 }) 11728 } 11729 if err != nil { 11730 return nil, err 11731 } 11732 defer googleapi.CloseBody(res) 11733 if err := googleapi.CheckResponse(res); err != nil { 11734 return nil, gensupport.WrapError(err) 11735 } 11736 ret := &BatchAnnotateImagesResponse{ 11737 ServerResponse: googleapi.ServerResponse{ 11738 Header: res.Header, 11739 HTTPStatusCode: res.StatusCode, 11740 }, 11741 } 11742 target := &ret 11743 if err := gensupport.DecodeResponse(target, res); err != nil { 11744 return nil, err 11745 } 11746 return ret, nil 11747 } 11748 11749 type ImagesAsyncBatchAnnotateCall struct { 11750 s *Service 11751 asyncbatchannotateimagesrequest *AsyncBatchAnnotateImagesRequest 11752 urlParams_ gensupport.URLParams 11753 ctx_ context.Context 11754 header_ http.Header 11755 } 11756 11757 // AsyncBatchAnnotate: Run asynchronous image detection and annotation for a 11758 // list of images. Progress and results can be retrieved through the 11759 // `google.longrunning.Operations` interface. `Operation.metadata` contains 11760 // `OperationMetadata` (metadata). `Operation.response` contains 11761 // `AsyncBatchAnnotateImagesResponse` (results). This service will write image 11762 // annotation outputs to json files in customer GCS bucket, each json file 11763 // containing BatchAnnotateImagesResponse proto. 11764 func (r *ImagesService) AsyncBatchAnnotate(asyncbatchannotateimagesrequest *AsyncBatchAnnotateImagesRequest) *ImagesAsyncBatchAnnotateCall { 11765 c := &ImagesAsyncBatchAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11766 c.asyncbatchannotateimagesrequest = asyncbatchannotateimagesrequest 11767 return c 11768 } 11769 11770 // Fields allows partial responses to be retrieved. See 11771 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 11772 // details. 11773 func (c *ImagesAsyncBatchAnnotateCall) Fields(s ...googleapi.Field) *ImagesAsyncBatchAnnotateCall { 11774 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11775 return c 11776 } 11777 11778 // Context sets the context to be used in this call's Do method. 11779 func (c *ImagesAsyncBatchAnnotateCall) Context(ctx context.Context) *ImagesAsyncBatchAnnotateCall { 11780 c.ctx_ = ctx 11781 return c 11782 } 11783 11784 // Header returns a http.Header that can be modified by the caller to add 11785 // headers to the request. 11786 func (c *ImagesAsyncBatchAnnotateCall) Header() http.Header { 11787 if c.header_ == nil { 11788 c.header_ = make(http.Header) 11789 } 11790 return c.header_ 11791 } 11792 11793 func (c *ImagesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { 11794 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 11795 var body io.Reader = nil 11796 body, err := googleapi.WithoutDataWrapper.JSONReader(c.asyncbatchannotateimagesrequest) 11797 if err != nil { 11798 return nil, err 11799 } 11800 c.urlParams_.Set("alt", alt) 11801 c.urlParams_.Set("prettyPrint", "false") 11802 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/images:asyncBatchAnnotate") 11803 urls += "?" + c.urlParams_.Encode() 11804 req, err := http.NewRequest("POST", urls, body) 11805 if err != nil { 11806 return nil, err 11807 } 11808 req.Header = reqHeaders 11809 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11810 } 11811 11812 // Do executes the "vision.images.asyncBatchAnnotate" call. 11813 // Any non-2xx status code is an error. Response headers are in either 11814 // *Operation.ServerResponse.Header or (if a response was returned at all) in 11815 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 11816 // whether the returned error was because http.StatusNotModified was returned. 11817 func (c *ImagesAsyncBatchAnnotateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 11818 gensupport.SetOptions(c.urlParams_, opts...) 11819 res, err := c.doRequest("json") 11820 if res != nil && res.StatusCode == http.StatusNotModified { 11821 if res.Body != nil { 11822 res.Body.Close() 11823 } 11824 return nil, gensupport.WrapError(&googleapi.Error{ 11825 Code: res.StatusCode, 11826 Header: res.Header, 11827 }) 11828 } 11829 if err != nil { 11830 return nil, err 11831 } 11832 defer googleapi.CloseBody(res) 11833 if err := googleapi.CheckResponse(res); err != nil { 11834 return nil, gensupport.WrapError(err) 11835 } 11836 ret := &Operation{ 11837 ServerResponse: googleapi.ServerResponse{ 11838 Header: res.Header, 11839 HTTPStatusCode: res.StatusCode, 11840 }, 11841 } 11842 target := &ret 11843 if err := gensupport.DecodeResponse(target, res); err != nil { 11844 return nil, err 11845 } 11846 return ret, nil 11847 } 11848 11849 type LocationsOperationsGetCall struct { 11850 s *Service 11851 name string 11852 urlParams_ gensupport.URLParams 11853 ifNoneMatch_ string 11854 ctx_ context.Context 11855 header_ http.Header 11856 } 11857 11858 // Get: Gets the latest state of a long-running operation. Clients can use this 11859 // method to poll the operation result at intervals as recommended by the API 11860 // service. 11861 // 11862 // - name: The name of the operation resource. 11863 func (r *LocationsOperationsService) Get(name string) *LocationsOperationsGetCall { 11864 c := &LocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11865 c.name = name 11866 return c 11867 } 11868 11869 // Fields allows partial responses to be retrieved. See 11870 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 11871 // details. 11872 func (c *LocationsOperationsGetCall) Fields(s ...googleapi.Field) *LocationsOperationsGetCall { 11873 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11874 return c 11875 } 11876 11877 // IfNoneMatch sets an optional parameter which makes the operation fail if the 11878 // object's ETag matches the given value. This is useful for getting updates 11879 // only after the object has changed since the last request. 11880 func (c *LocationsOperationsGetCall) IfNoneMatch(entityTag string) *LocationsOperationsGetCall { 11881 c.ifNoneMatch_ = entityTag 11882 return c 11883 } 11884 11885 // Context sets the context to be used in this call's Do method. 11886 func (c *LocationsOperationsGetCall) Context(ctx context.Context) *LocationsOperationsGetCall { 11887 c.ctx_ = ctx 11888 return c 11889 } 11890 11891 // Header returns a http.Header that can be modified by the caller to add 11892 // headers to the request. 11893 func (c *LocationsOperationsGetCall) Header() http.Header { 11894 if c.header_ == nil { 11895 c.header_ = make(http.Header) 11896 } 11897 return c.header_ 11898 } 11899 11900 func (c *LocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 11901 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 11902 if c.ifNoneMatch_ != "" { 11903 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11904 } 11905 var body io.Reader = nil 11906 c.urlParams_.Set("alt", alt) 11907 c.urlParams_.Set("prettyPrint", "false") 11908 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 11909 urls += "?" + c.urlParams_.Encode() 11910 req, err := http.NewRequest("GET", urls, body) 11911 if err != nil { 11912 return nil, err 11913 } 11914 req.Header = reqHeaders 11915 googleapi.Expand(req.URL, map[string]string{ 11916 "name": c.name, 11917 }) 11918 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11919 } 11920 11921 // Do executes the "vision.locations.operations.get" call. 11922 // Any non-2xx status code is an error. Response headers are in either 11923 // *Operation.ServerResponse.Header or (if a response was returned at all) in 11924 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 11925 // whether the returned error was because http.StatusNotModified was returned. 11926 func (c *LocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 11927 gensupport.SetOptions(c.urlParams_, opts...) 11928 res, err := c.doRequest("json") 11929 if res != nil && res.StatusCode == http.StatusNotModified { 11930 if res.Body != nil { 11931 res.Body.Close() 11932 } 11933 return nil, gensupport.WrapError(&googleapi.Error{ 11934 Code: res.StatusCode, 11935 Header: res.Header, 11936 }) 11937 } 11938 if err != nil { 11939 return nil, err 11940 } 11941 defer googleapi.CloseBody(res) 11942 if err := googleapi.CheckResponse(res); err != nil { 11943 return nil, gensupport.WrapError(err) 11944 } 11945 ret := &Operation{ 11946 ServerResponse: googleapi.ServerResponse{ 11947 Header: res.Header, 11948 HTTPStatusCode: res.StatusCode, 11949 }, 11950 } 11951 target := &ret 11952 if err := gensupport.DecodeResponse(target, res); err != nil { 11953 return nil, err 11954 } 11955 return ret, nil 11956 } 11957 11958 type OperationsCancelCall struct { 11959 s *Service 11960 name string 11961 canceloperationrequest *CancelOperationRequest 11962 urlParams_ gensupport.URLParams 11963 ctx_ context.Context 11964 header_ http.Header 11965 } 11966 11967 // Cancel: Starts asynchronous cancellation on a long-running operation. The 11968 // server makes a best effort to cancel the operation, but success is not 11969 // guaranteed. If the server doesn't support this method, it returns 11970 // `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or 11971 // other methods to check whether the cancellation succeeded or whether the 11972 // operation completed despite cancellation. On successful cancellation, the 11973 // operation is not deleted; instead, it becomes an operation with an 11974 // Operation.error value with a google.rpc.Status.code of 1, corresponding to 11975 // `Code.CANCELLED`. 11976 // 11977 // - name: The name of the operation resource to be cancelled. 11978 func (r *OperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *OperationsCancelCall { 11979 c := &OperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11980 c.name = name 11981 c.canceloperationrequest = canceloperationrequest 11982 return c 11983 } 11984 11985 // Fields allows partial responses to be retrieved. See 11986 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 11987 // details. 11988 func (c *OperationsCancelCall) Fields(s ...googleapi.Field) *OperationsCancelCall { 11989 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11990 return c 11991 } 11992 11993 // Context sets the context to be used in this call's Do method. 11994 func (c *OperationsCancelCall) Context(ctx context.Context) *OperationsCancelCall { 11995 c.ctx_ = ctx 11996 return c 11997 } 11998 11999 // Header returns a http.Header that can be modified by the caller to add 12000 // headers to the request. 12001 func (c *OperationsCancelCall) Header() http.Header { 12002 if c.header_ == nil { 12003 c.header_ = make(http.Header) 12004 } 12005 return c.header_ 12006 } 12007 12008 func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) { 12009 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 12010 var body io.Reader = nil 12011 body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) 12012 if err != nil { 12013 return nil, err 12014 } 12015 c.urlParams_.Set("alt", alt) 12016 c.urlParams_.Set("prettyPrint", "false") 12017 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") 12018 urls += "?" + c.urlParams_.Encode() 12019 req, err := http.NewRequest("POST", urls, body) 12020 if err != nil { 12021 return nil, err 12022 } 12023 req.Header = reqHeaders 12024 googleapi.Expand(req.URL, map[string]string{ 12025 "name": c.name, 12026 }) 12027 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12028 } 12029 12030 // Do executes the "vision.operations.cancel" call. 12031 // Any non-2xx status code is an error. Response headers are in either 12032 // *Empty.ServerResponse.Header or (if a response was returned at all) in 12033 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 12034 // whether the returned error was because http.StatusNotModified was returned. 12035 func (c *OperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 12036 gensupport.SetOptions(c.urlParams_, opts...) 12037 res, err := c.doRequest("json") 12038 if res != nil && res.StatusCode == http.StatusNotModified { 12039 if res.Body != nil { 12040 res.Body.Close() 12041 } 12042 return nil, gensupport.WrapError(&googleapi.Error{ 12043 Code: res.StatusCode, 12044 Header: res.Header, 12045 }) 12046 } 12047 if err != nil { 12048 return nil, err 12049 } 12050 defer googleapi.CloseBody(res) 12051 if err := googleapi.CheckResponse(res); err != nil { 12052 return nil, gensupport.WrapError(err) 12053 } 12054 ret := &Empty{ 12055 ServerResponse: googleapi.ServerResponse{ 12056 Header: res.Header, 12057 HTTPStatusCode: res.StatusCode, 12058 }, 12059 } 12060 target := &ret 12061 if err := gensupport.DecodeResponse(target, res); err != nil { 12062 return nil, err 12063 } 12064 return ret, nil 12065 } 12066 12067 type OperationsDeleteCall struct { 12068 s *Service 12069 name string 12070 urlParams_ gensupport.URLParams 12071 ctx_ context.Context 12072 header_ http.Header 12073 } 12074 12075 // Delete: Deletes a long-running operation. This method indicates that the 12076 // client is no longer interested in the operation result. It does not cancel 12077 // the operation. If the server doesn't support this method, it returns 12078 // `google.rpc.Code.UNIMPLEMENTED`. 12079 // 12080 // - name: The name of the operation resource to be deleted. 12081 func (r *OperationsService) Delete(name string) *OperationsDeleteCall { 12082 c := &OperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12083 c.name = name 12084 return c 12085 } 12086 12087 // Fields allows partial responses to be retrieved. See 12088 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12089 // details. 12090 func (c *OperationsDeleteCall) Fields(s ...googleapi.Field) *OperationsDeleteCall { 12091 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12092 return c 12093 } 12094 12095 // Context sets the context to be used in this call's Do method. 12096 func (c *OperationsDeleteCall) Context(ctx context.Context) *OperationsDeleteCall { 12097 c.ctx_ = ctx 12098 return c 12099 } 12100 12101 // Header returns a http.Header that can be modified by the caller to add 12102 // headers to the request. 12103 func (c *OperationsDeleteCall) Header() http.Header { 12104 if c.header_ == nil { 12105 c.header_ = make(http.Header) 12106 } 12107 return c.header_ 12108 } 12109 12110 func (c *OperationsDeleteCall) doRequest(alt string) (*http.Response, error) { 12111 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 12112 var body io.Reader = nil 12113 c.urlParams_.Set("alt", alt) 12114 c.urlParams_.Set("prettyPrint", "false") 12115 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 12116 urls += "?" + c.urlParams_.Encode() 12117 req, err := http.NewRequest("DELETE", urls, body) 12118 if err != nil { 12119 return nil, err 12120 } 12121 req.Header = reqHeaders 12122 googleapi.Expand(req.URL, map[string]string{ 12123 "name": c.name, 12124 }) 12125 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12126 } 12127 12128 // Do executes the "vision.operations.delete" call. 12129 // Any non-2xx status code is an error. Response headers are in either 12130 // *Empty.ServerResponse.Header or (if a response was returned at all) in 12131 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 12132 // whether the returned error was because http.StatusNotModified was returned. 12133 func (c *OperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 12134 gensupport.SetOptions(c.urlParams_, opts...) 12135 res, err := c.doRequest("json") 12136 if res != nil && res.StatusCode == http.StatusNotModified { 12137 if res.Body != nil { 12138 res.Body.Close() 12139 } 12140 return nil, gensupport.WrapError(&googleapi.Error{ 12141 Code: res.StatusCode, 12142 Header: res.Header, 12143 }) 12144 } 12145 if err != nil { 12146 return nil, err 12147 } 12148 defer googleapi.CloseBody(res) 12149 if err := googleapi.CheckResponse(res); err != nil { 12150 return nil, gensupport.WrapError(err) 12151 } 12152 ret := &Empty{ 12153 ServerResponse: googleapi.ServerResponse{ 12154 Header: res.Header, 12155 HTTPStatusCode: res.StatusCode, 12156 }, 12157 } 12158 target := &ret 12159 if err := gensupport.DecodeResponse(target, res); err != nil { 12160 return nil, err 12161 } 12162 return ret, nil 12163 } 12164 12165 type OperationsGetCall struct { 12166 s *Service 12167 name string 12168 urlParams_ gensupport.URLParams 12169 ifNoneMatch_ string 12170 ctx_ context.Context 12171 header_ http.Header 12172 } 12173 12174 // Get: Gets the latest state of a long-running operation. Clients can use this 12175 // method to poll the operation result at intervals as recommended by the API 12176 // service. 12177 // 12178 // - name: The name of the operation resource. 12179 func (r *OperationsService) Get(name string) *OperationsGetCall { 12180 c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12181 c.name = name 12182 return c 12183 } 12184 12185 // Fields allows partial responses to be retrieved. See 12186 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12187 // details. 12188 func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall { 12189 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12190 return c 12191 } 12192 12193 // IfNoneMatch sets an optional parameter which makes the operation fail if the 12194 // object's ETag matches the given value. This is useful for getting updates 12195 // only after the object has changed since the last request. 12196 func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall { 12197 c.ifNoneMatch_ = entityTag 12198 return c 12199 } 12200 12201 // Context sets the context to be used in this call's Do method. 12202 func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall { 12203 c.ctx_ = ctx 12204 return c 12205 } 12206 12207 // Header returns a http.Header that can be modified by the caller to add 12208 // headers to the request. 12209 func (c *OperationsGetCall) Header() http.Header { 12210 if c.header_ == nil { 12211 c.header_ = make(http.Header) 12212 } 12213 return c.header_ 12214 } 12215 12216 func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { 12217 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 12218 if c.ifNoneMatch_ != "" { 12219 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12220 } 12221 var body io.Reader = nil 12222 c.urlParams_.Set("alt", alt) 12223 c.urlParams_.Set("prettyPrint", "false") 12224 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 12225 urls += "?" + c.urlParams_.Encode() 12226 req, err := http.NewRequest("GET", urls, body) 12227 if err != nil { 12228 return nil, err 12229 } 12230 req.Header = reqHeaders 12231 googleapi.Expand(req.URL, map[string]string{ 12232 "name": c.name, 12233 }) 12234 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12235 } 12236 12237 // Do executes the "vision.operations.get" call. 12238 // Any non-2xx status code is an error. Response headers are in either 12239 // *Operation.ServerResponse.Header or (if a response was returned at all) in 12240 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 12241 // whether the returned error was because http.StatusNotModified was returned. 12242 func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 12243 gensupport.SetOptions(c.urlParams_, opts...) 12244 res, err := c.doRequest("json") 12245 if res != nil && res.StatusCode == http.StatusNotModified { 12246 if res.Body != nil { 12247 res.Body.Close() 12248 } 12249 return nil, gensupport.WrapError(&googleapi.Error{ 12250 Code: res.StatusCode, 12251 Header: res.Header, 12252 }) 12253 } 12254 if err != nil { 12255 return nil, err 12256 } 12257 defer googleapi.CloseBody(res) 12258 if err := googleapi.CheckResponse(res); err != nil { 12259 return nil, gensupport.WrapError(err) 12260 } 12261 ret := &Operation{ 12262 ServerResponse: googleapi.ServerResponse{ 12263 Header: res.Header, 12264 HTTPStatusCode: res.StatusCode, 12265 }, 12266 } 12267 target := &ret 12268 if err := gensupport.DecodeResponse(target, res); err != nil { 12269 return nil, err 12270 } 12271 return ret, nil 12272 } 12273 12274 type OperationsListCall struct { 12275 s *Service 12276 name string 12277 urlParams_ gensupport.URLParams 12278 ifNoneMatch_ string 12279 ctx_ context.Context 12280 header_ http.Header 12281 } 12282 12283 // List: Lists operations that match the specified filter in the request. If 12284 // the server doesn't support this method, it returns `UNIMPLEMENTED`. 12285 // 12286 // - name: The name of the operation's parent resource. 12287 func (r *OperationsService) List(name string) *OperationsListCall { 12288 c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12289 c.name = name 12290 return c 12291 } 12292 12293 // Filter sets the optional parameter "filter": The standard list filter. 12294 func (c *OperationsListCall) Filter(filter string) *OperationsListCall { 12295 c.urlParams_.Set("filter", filter) 12296 return c 12297 } 12298 12299 // PageSize sets the optional parameter "pageSize": The standard list page 12300 // size. 12301 func (c *OperationsListCall) PageSize(pageSize int64) *OperationsListCall { 12302 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 12303 return c 12304 } 12305 12306 // PageToken sets the optional parameter "pageToken": The standard list page 12307 // token. 12308 func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall { 12309 c.urlParams_.Set("pageToken", pageToken) 12310 return c 12311 } 12312 12313 // Fields allows partial responses to be retrieved. See 12314 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12315 // details. 12316 func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall { 12317 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12318 return c 12319 } 12320 12321 // IfNoneMatch sets an optional parameter which makes the operation fail if the 12322 // object's ETag matches the given value. This is useful for getting updates 12323 // only after the object has changed since the last request. 12324 func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall { 12325 c.ifNoneMatch_ = entityTag 12326 return c 12327 } 12328 12329 // Context sets the context to be used in this call's Do method. 12330 func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall { 12331 c.ctx_ = ctx 12332 return c 12333 } 12334 12335 // Header returns a http.Header that can be modified by the caller to add 12336 // headers to the request. 12337 func (c *OperationsListCall) Header() http.Header { 12338 if c.header_ == nil { 12339 c.header_ = make(http.Header) 12340 } 12341 return c.header_ 12342 } 12343 12344 func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { 12345 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 12346 if c.ifNoneMatch_ != "" { 12347 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12348 } 12349 var body io.Reader = nil 12350 c.urlParams_.Set("alt", alt) 12351 c.urlParams_.Set("prettyPrint", "false") 12352 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 12353 urls += "?" + c.urlParams_.Encode() 12354 req, err := http.NewRequest("GET", urls, body) 12355 if err != nil { 12356 return nil, err 12357 } 12358 req.Header = reqHeaders 12359 googleapi.Expand(req.URL, map[string]string{ 12360 "name": c.name, 12361 }) 12362 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12363 } 12364 12365 // Do executes the "vision.operations.list" call. 12366 // Any non-2xx status code is an error. Response headers are in either 12367 // *ListOperationsResponse.ServerResponse.Header or (if a response was returned 12368 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12369 // check whether the returned error was because http.StatusNotModified was 12370 // returned. 12371 func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { 12372 gensupport.SetOptions(c.urlParams_, opts...) 12373 res, err := c.doRequest("json") 12374 if res != nil && res.StatusCode == http.StatusNotModified { 12375 if res.Body != nil { 12376 res.Body.Close() 12377 } 12378 return nil, gensupport.WrapError(&googleapi.Error{ 12379 Code: res.StatusCode, 12380 Header: res.Header, 12381 }) 12382 } 12383 if err != nil { 12384 return nil, err 12385 } 12386 defer googleapi.CloseBody(res) 12387 if err := googleapi.CheckResponse(res); err != nil { 12388 return nil, gensupport.WrapError(err) 12389 } 12390 ret := &ListOperationsResponse{ 12391 ServerResponse: googleapi.ServerResponse{ 12392 Header: res.Header, 12393 HTTPStatusCode: res.StatusCode, 12394 }, 12395 } 12396 target := &ret 12397 if err := gensupport.DecodeResponse(target, res); err != nil { 12398 return nil, err 12399 } 12400 return ret, nil 12401 } 12402 12403 // Pages invokes f for each page of results. 12404 // A non-nil error returned from f will halt the iteration. 12405 // The provided context supersedes any context provided to the Context method. 12406 func (c *OperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { 12407 c.ctx_ = ctx 12408 defer c.PageToken(c.urlParams_.Get("pageToken")) 12409 for { 12410 x, err := c.Do() 12411 if err != nil { 12412 return err 12413 } 12414 if err := f(x); err != nil { 12415 return err 12416 } 12417 if x.NextPageToken == "" { 12418 return nil 12419 } 12420 c.PageToken(x.NextPageToken) 12421 } 12422 } 12423 12424 type ProjectsFilesAnnotateCall struct { 12425 s *Service 12426 parent string 12427 batchannotatefilesrequest *BatchAnnotateFilesRequest 12428 urlParams_ gensupport.URLParams 12429 ctx_ context.Context 12430 header_ http.Header 12431 } 12432 12433 // Annotate: Service that performs image detection and annotation for a batch 12434 // of files. Now only "application/pdf", "image/tiff" and "image/gif" are 12435 // supported. This service will extract at most 5 (customers can specify which 12436 // 5 in AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from 12437 // each file provided and perform detection and annotation for each image 12438 // extracted. 12439 // 12440 // - parent: Optional. Target project and location to make a call. Format: 12441 // `projects/{project-id}/locations/{location-id}`. If no parent is 12442 // specified, a region will be chosen automatically. Supported location-ids: 12443 // `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: 12444 // The European Union. Example: `projects/project-A/locations/eu`. 12445 func (r *ProjectsFilesService) Annotate(parent string, batchannotatefilesrequest *BatchAnnotateFilesRequest) *ProjectsFilesAnnotateCall { 12446 c := &ProjectsFilesAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12447 c.parent = parent 12448 c.batchannotatefilesrequest = batchannotatefilesrequest 12449 return c 12450 } 12451 12452 // Fields allows partial responses to be retrieved. See 12453 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12454 // details. 12455 func (c *ProjectsFilesAnnotateCall) Fields(s ...googleapi.Field) *ProjectsFilesAnnotateCall { 12456 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12457 return c 12458 } 12459 12460 // Context sets the context to be used in this call's Do method. 12461 func (c *ProjectsFilesAnnotateCall) Context(ctx context.Context) *ProjectsFilesAnnotateCall { 12462 c.ctx_ = ctx 12463 return c 12464 } 12465 12466 // Header returns a http.Header that can be modified by the caller to add 12467 // headers to the request. 12468 func (c *ProjectsFilesAnnotateCall) Header() http.Header { 12469 if c.header_ == nil { 12470 c.header_ = make(http.Header) 12471 } 12472 return c.header_ 12473 } 12474 12475 func (c *ProjectsFilesAnnotateCall) doRequest(alt string) (*http.Response, error) { 12476 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 12477 var body io.Reader = nil 12478 body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchannotatefilesrequest) 12479 if err != nil { 12480 return nil, err 12481 } 12482 c.urlParams_.Set("alt", alt) 12483 c.urlParams_.Set("prettyPrint", "false") 12484 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/files:annotate") 12485 urls += "?" + c.urlParams_.Encode() 12486 req, err := http.NewRequest("POST", urls, body) 12487 if err != nil { 12488 return nil, err 12489 } 12490 req.Header = reqHeaders 12491 googleapi.Expand(req.URL, map[string]string{ 12492 "parent": c.parent, 12493 }) 12494 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12495 } 12496 12497 // Do executes the "vision.projects.files.annotate" call. 12498 // Any non-2xx status code is an error. Response headers are in either 12499 // *BatchAnnotateFilesResponse.ServerResponse.Header or (if a response was 12500 // returned at all) in error.(*googleapi.Error).Header. Use 12501 // googleapi.IsNotModified to check whether the returned error was because 12502 // http.StatusNotModified was returned. 12503 func (c *ProjectsFilesAnnotateCall) Do(opts ...googleapi.CallOption) (*BatchAnnotateFilesResponse, error) { 12504 gensupport.SetOptions(c.urlParams_, opts...) 12505 res, err := c.doRequest("json") 12506 if res != nil && res.StatusCode == http.StatusNotModified { 12507 if res.Body != nil { 12508 res.Body.Close() 12509 } 12510 return nil, gensupport.WrapError(&googleapi.Error{ 12511 Code: res.StatusCode, 12512 Header: res.Header, 12513 }) 12514 } 12515 if err != nil { 12516 return nil, err 12517 } 12518 defer googleapi.CloseBody(res) 12519 if err := googleapi.CheckResponse(res); err != nil { 12520 return nil, gensupport.WrapError(err) 12521 } 12522 ret := &BatchAnnotateFilesResponse{ 12523 ServerResponse: googleapi.ServerResponse{ 12524 Header: res.Header, 12525 HTTPStatusCode: res.StatusCode, 12526 }, 12527 } 12528 target := &ret 12529 if err := gensupport.DecodeResponse(target, res); err != nil { 12530 return nil, err 12531 } 12532 return ret, nil 12533 } 12534 12535 type ProjectsFilesAsyncBatchAnnotateCall struct { 12536 s *Service 12537 parent string 12538 asyncbatchannotatefilesrequest *AsyncBatchAnnotateFilesRequest 12539 urlParams_ gensupport.URLParams 12540 ctx_ context.Context 12541 header_ http.Header 12542 } 12543 12544 // AsyncBatchAnnotate: Run asynchronous image detection and annotation for a 12545 // list of generic files, such as PDF files, which may contain multiple pages 12546 // and multiple images per page. Progress and results can be retrieved through 12547 // the `google.longrunning.Operations` interface. `Operation.metadata` contains 12548 // `OperationMetadata` (metadata). `Operation.response` contains 12549 // `AsyncBatchAnnotateFilesResponse` (results). 12550 // 12551 // - parent: Optional. Target project and location to make a call. Format: 12552 // `projects/{project-id}/locations/{location-id}`. If no parent is 12553 // specified, a region will be chosen automatically. Supported location-ids: 12554 // `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: 12555 // The European Union. Example: `projects/project-A/locations/eu`. 12556 func (r *ProjectsFilesService) AsyncBatchAnnotate(parent string, asyncbatchannotatefilesrequest *AsyncBatchAnnotateFilesRequest) *ProjectsFilesAsyncBatchAnnotateCall { 12557 c := &ProjectsFilesAsyncBatchAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12558 c.parent = parent 12559 c.asyncbatchannotatefilesrequest = asyncbatchannotatefilesrequest 12560 return c 12561 } 12562 12563 // Fields allows partial responses to be retrieved. See 12564 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12565 // details. 12566 func (c *ProjectsFilesAsyncBatchAnnotateCall) Fields(s ...googleapi.Field) *ProjectsFilesAsyncBatchAnnotateCall { 12567 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12568 return c 12569 } 12570 12571 // Context sets the context to be used in this call's Do method. 12572 func (c *ProjectsFilesAsyncBatchAnnotateCall) Context(ctx context.Context) *ProjectsFilesAsyncBatchAnnotateCall { 12573 c.ctx_ = ctx 12574 return c 12575 } 12576 12577 // Header returns a http.Header that can be modified by the caller to add 12578 // headers to the request. 12579 func (c *ProjectsFilesAsyncBatchAnnotateCall) Header() http.Header { 12580 if c.header_ == nil { 12581 c.header_ = make(http.Header) 12582 } 12583 return c.header_ 12584 } 12585 12586 func (c *ProjectsFilesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { 12587 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 12588 var body io.Reader = nil 12589 body, err := googleapi.WithoutDataWrapper.JSONReader(c.asyncbatchannotatefilesrequest) 12590 if err != nil { 12591 return nil, err 12592 } 12593 c.urlParams_.Set("alt", alt) 12594 c.urlParams_.Set("prettyPrint", "false") 12595 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/files:asyncBatchAnnotate") 12596 urls += "?" + c.urlParams_.Encode() 12597 req, err := http.NewRequest("POST", urls, body) 12598 if err != nil { 12599 return nil, err 12600 } 12601 req.Header = reqHeaders 12602 googleapi.Expand(req.URL, map[string]string{ 12603 "parent": c.parent, 12604 }) 12605 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12606 } 12607 12608 // Do executes the "vision.projects.files.asyncBatchAnnotate" call. 12609 // Any non-2xx status code is an error. Response headers are in either 12610 // *Operation.ServerResponse.Header or (if a response was returned at all) in 12611 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 12612 // whether the returned error was because http.StatusNotModified was returned. 12613 func (c *ProjectsFilesAsyncBatchAnnotateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 12614 gensupport.SetOptions(c.urlParams_, opts...) 12615 res, err := c.doRequest("json") 12616 if res != nil && res.StatusCode == http.StatusNotModified { 12617 if res.Body != nil { 12618 res.Body.Close() 12619 } 12620 return nil, gensupport.WrapError(&googleapi.Error{ 12621 Code: res.StatusCode, 12622 Header: res.Header, 12623 }) 12624 } 12625 if err != nil { 12626 return nil, err 12627 } 12628 defer googleapi.CloseBody(res) 12629 if err := googleapi.CheckResponse(res); err != nil { 12630 return nil, gensupport.WrapError(err) 12631 } 12632 ret := &Operation{ 12633 ServerResponse: googleapi.ServerResponse{ 12634 Header: res.Header, 12635 HTTPStatusCode: res.StatusCode, 12636 }, 12637 } 12638 target := &ret 12639 if err := gensupport.DecodeResponse(target, res); err != nil { 12640 return nil, err 12641 } 12642 return ret, nil 12643 } 12644 12645 type ProjectsImagesAnnotateCall struct { 12646 s *Service 12647 parent string 12648 batchannotateimagesrequest *BatchAnnotateImagesRequest 12649 urlParams_ gensupport.URLParams 12650 ctx_ context.Context 12651 header_ http.Header 12652 } 12653 12654 // Annotate: Run image detection and annotation for a batch of images. 12655 // 12656 // - parent: Optional. Target project and location to make a call. Format: 12657 // `projects/{project-id}/locations/{location-id}`. If no parent is 12658 // specified, a region will be chosen automatically. Supported location-ids: 12659 // `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: 12660 // The European Union. Example: `projects/project-A/locations/eu`. 12661 func (r *ProjectsImagesService) Annotate(parent string, batchannotateimagesrequest *BatchAnnotateImagesRequest) *ProjectsImagesAnnotateCall { 12662 c := &ProjectsImagesAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12663 c.parent = parent 12664 c.batchannotateimagesrequest = batchannotateimagesrequest 12665 return c 12666 } 12667 12668 // Fields allows partial responses to be retrieved. See 12669 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12670 // details. 12671 func (c *ProjectsImagesAnnotateCall) Fields(s ...googleapi.Field) *ProjectsImagesAnnotateCall { 12672 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12673 return c 12674 } 12675 12676 // Context sets the context to be used in this call's Do method. 12677 func (c *ProjectsImagesAnnotateCall) Context(ctx context.Context) *ProjectsImagesAnnotateCall { 12678 c.ctx_ = ctx 12679 return c 12680 } 12681 12682 // Header returns a http.Header that can be modified by the caller to add 12683 // headers to the request. 12684 func (c *ProjectsImagesAnnotateCall) Header() http.Header { 12685 if c.header_ == nil { 12686 c.header_ = make(http.Header) 12687 } 12688 return c.header_ 12689 } 12690 12691 func (c *ProjectsImagesAnnotateCall) doRequest(alt string) (*http.Response, error) { 12692 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 12693 var body io.Reader = nil 12694 body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchannotateimagesrequest) 12695 if err != nil { 12696 return nil, err 12697 } 12698 c.urlParams_.Set("alt", alt) 12699 c.urlParams_.Set("prettyPrint", "false") 12700 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/images:annotate") 12701 urls += "?" + c.urlParams_.Encode() 12702 req, err := http.NewRequest("POST", urls, body) 12703 if err != nil { 12704 return nil, err 12705 } 12706 req.Header = reqHeaders 12707 googleapi.Expand(req.URL, map[string]string{ 12708 "parent": c.parent, 12709 }) 12710 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12711 } 12712 12713 // Do executes the "vision.projects.images.annotate" call. 12714 // Any non-2xx status code is an error. Response headers are in either 12715 // *BatchAnnotateImagesResponse.ServerResponse.Header or (if a response was 12716 // returned at all) in error.(*googleapi.Error).Header. Use 12717 // googleapi.IsNotModified to check whether the returned error was because 12718 // http.StatusNotModified was returned. 12719 func (c *ProjectsImagesAnnotateCall) Do(opts ...googleapi.CallOption) (*BatchAnnotateImagesResponse, error) { 12720 gensupport.SetOptions(c.urlParams_, opts...) 12721 res, err := c.doRequest("json") 12722 if res != nil && res.StatusCode == http.StatusNotModified { 12723 if res.Body != nil { 12724 res.Body.Close() 12725 } 12726 return nil, gensupport.WrapError(&googleapi.Error{ 12727 Code: res.StatusCode, 12728 Header: res.Header, 12729 }) 12730 } 12731 if err != nil { 12732 return nil, err 12733 } 12734 defer googleapi.CloseBody(res) 12735 if err := googleapi.CheckResponse(res); err != nil { 12736 return nil, gensupport.WrapError(err) 12737 } 12738 ret := &BatchAnnotateImagesResponse{ 12739 ServerResponse: googleapi.ServerResponse{ 12740 Header: res.Header, 12741 HTTPStatusCode: res.StatusCode, 12742 }, 12743 } 12744 target := &ret 12745 if err := gensupport.DecodeResponse(target, res); err != nil { 12746 return nil, err 12747 } 12748 return ret, nil 12749 } 12750 12751 type ProjectsImagesAsyncBatchAnnotateCall struct { 12752 s *Service 12753 parent string 12754 asyncbatchannotateimagesrequest *AsyncBatchAnnotateImagesRequest 12755 urlParams_ gensupport.URLParams 12756 ctx_ context.Context 12757 header_ http.Header 12758 } 12759 12760 // AsyncBatchAnnotate: Run asynchronous image detection and annotation for a 12761 // list of images. Progress and results can be retrieved through the 12762 // `google.longrunning.Operations` interface. `Operation.metadata` contains 12763 // `OperationMetadata` (metadata). `Operation.response` contains 12764 // `AsyncBatchAnnotateImagesResponse` (results). This service will write image 12765 // annotation outputs to json files in customer GCS bucket, each json file 12766 // containing BatchAnnotateImagesResponse proto. 12767 // 12768 // - parent: Optional. Target project and location to make a call. Format: 12769 // `projects/{project-id}/locations/{location-id}`. If no parent is 12770 // specified, a region will be chosen automatically. Supported location-ids: 12771 // `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: 12772 // The European Union. Example: `projects/project-A/locations/eu`. 12773 func (r *ProjectsImagesService) AsyncBatchAnnotate(parent string, asyncbatchannotateimagesrequest *AsyncBatchAnnotateImagesRequest) *ProjectsImagesAsyncBatchAnnotateCall { 12774 c := &ProjectsImagesAsyncBatchAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12775 c.parent = parent 12776 c.asyncbatchannotateimagesrequest = asyncbatchannotateimagesrequest 12777 return c 12778 } 12779 12780 // Fields allows partial responses to be retrieved. See 12781 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12782 // details. 12783 func (c *ProjectsImagesAsyncBatchAnnotateCall) Fields(s ...googleapi.Field) *ProjectsImagesAsyncBatchAnnotateCall { 12784 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12785 return c 12786 } 12787 12788 // Context sets the context to be used in this call's Do method. 12789 func (c *ProjectsImagesAsyncBatchAnnotateCall) Context(ctx context.Context) *ProjectsImagesAsyncBatchAnnotateCall { 12790 c.ctx_ = ctx 12791 return c 12792 } 12793 12794 // Header returns a http.Header that can be modified by the caller to add 12795 // headers to the request. 12796 func (c *ProjectsImagesAsyncBatchAnnotateCall) Header() http.Header { 12797 if c.header_ == nil { 12798 c.header_ = make(http.Header) 12799 } 12800 return c.header_ 12801 } 12802 12803 func (c *ProjectsImagesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { 12804 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 12805 var body io.Reader = nil 12806 body, err := googleapi.WithoutDataWrapper.JSONReader(c.asyncbatchannotateimagesrequest) 12807 if err != nil { 12808 return nil, err 12809 } 12810 c.urlParams_.Set("alt", alt) 12811 c.urlParams_.Set("prettyPrint", "false") 12812 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/images:asyncBatchAnnotate") 12813 urls += "?" + c.urlParams_.Encode() 12814 req, err := http.NewRequest("POST", urls, body) 12815 if err != nil { 12816 return nil, err 12817 } 12818 req.Header = reqHeaders 12819 googleapi.Expand(req.URL, map[string]string{ 12820 "parent": c.parent, 12821 }) 12822 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12823 } 12824 12825 // Do executes the "vision.projects.images.asyncBatchAnnotate" call. 12826 // Any non-2xx status code is an error. Response headers are in either 12827 // *Operation.ServerResponse.Header or (if a response was returned at all) in 12828 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 12829 // whether the returned error was because http.StatusNotModified was returned. 12830 func (c *ProjectsImagesAsyncBatchAnnotateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 12831 gensupport.SetOptions(c.urlParams_, opts...) 12832 res, err := c.doRequest("json") 12833 if res != nil && res.StatusCode == http.StatusNotModified { 12834 if res.Body != nil { 12835 res.Body.Close() 12836 } 12837 return nil, gensupport.WrapError(&googleapi.Error{ 12838 Code: res.StatusCode, 12839 Header: res.Header, 12840 }) 12841 } 12842 if err != nil { 12843 return nil, err 12844 } 12845 defer googleapi.CloseBody(res) 12846 if err := googleapi.CheckResponse(res); err != nil { 12847 return nil, gensupport.WrapError(err) 12848 } 12849 ret := &Operation{ 12850 ServerResponse: googleapi.ServerResponse{ 12851 Header: res.Header, 12852 HTTPStatusCode: res.StatusCode, 12853 }, 12854 } 12855 target := &ret 12856 if err := gensupport.DecodeResponse(target, res); err != nil { 12857 return nil, err 12858 } 12859 return ret, nil 12860 } 12861 12862 type ProjectsLocationsFilesAnnotateCall struct { 12863 s *Service 12864 parent string 12865 batchannotatefilesrequest *BatchAnnotateFilesRequest 12866 urlParams_ gensupport.URLParams 12867 ctx_ context.Context 12868 header_ http.Header 12869 } 12870 12871 // Annotate: Service that performs image detection and annotation for a batch 12872 // of files. Now only "application/pdf", "image/tiff" and "image/gif" are 12873 // supported. This service will extract at most 5 (customers can specify which 12874 // 5 in AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from 12875 // each file provided and perform detection and annotation for each image 12876 // extracted. 12877 // 12878 // - parent: Optional. Target project and location to make a call. Format: 12879 // `projects/{project-id}/locations/{location-id}`. If no parent is 12880 // specified, a region will be chosen automatically. Supported location-ids: 12881 // `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: 12882 // The European Union. Example: `projects/project-A/locations/eu`. 12883 func (r *ProjectsLocationsFilesService) Annotate(parent string, batchannotatefilesrequest *BatchAnnotateFilesRequest) *ProjectsLocationsFilesAnnotateCall { 12884 c := &ProjectsLocationsFilesAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12885 c.parent = parent 12886 c.batchannotatefilesrequest = batchannotatefilesrequest 12887 return c 12888 } 12889 12890 // Fields allows partial responses to be retrieved. See 12891 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12892 // details. 12893 func (c *ProjectsLocationsFilesAnnotateCall) Fields(s ...googleapi.Field) *ProjectsLocationsFilesAnnotateCall { 12894 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12895 return c 12896 } 12897 12898 // Context sets the context to be used in this call's Do method. 12899 func (c *ProjectsLocationsFilesAnnotateCall) Context(ctx context.Context) *ProjectsLocationsFilesAnnotateCall { 12900 c.ctx_ = ctx 12901 return c 12902 } 12903 12904 // Header returns a http.Header that can be modified by the caller to add 12905 // headers to the request. 12906 func (c *ProjectsLocationsFilesAnnotateCall) Header() http.Header { 12907 if c.header_ == nil { 12908 c.header_ = make(http.Header) 12909 } 12910 return c.header_ 12911 } 12912 12913 func (c *ProjectsLocationsFilesAnnotateCall) doRequest(alt string) (*http.Response, error) { 12914 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 12915 var body io.Reader = nil 12916 body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchannotatefilesrequest) 12917 if err != nil { 12918 return nil, err 12919 } 12920 c.urlParams_.Set("alt", alt) 12921 c.urlParams_.Set("prettyPrint", "false") 12922 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/files:annotate") 12923 urls += "?" + c.urlParams_.Encode() 12924 req, err := http.NewRequest("POST", urls, body) 12925 if err != nil { 12926 return nil, err 12927 } 12928 req.Header = reqHeaders 12929 googleapi.Expand(req.URL, map[string]string{ 12930 "parent": c.parent, 12931 }) 12932 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12933 } 12934 12935 // Do executes the "vision.projects.locations.files.annotate" call. 12936 // Any non-2xx status code is an error. Response headers are in either 12937 // *BatchAnnotateFilesResponse.ServerResponse.Header or (if a response was 12938 // returned at all) in error.(*googleapi.Error).Header. Use 12939 // googleapi.IsNotModified to check whether the returned error was because 12940 // http.StatusNotModified was returned. 12941 func (c *ProjectsLocationsFilesAnnotateCall) Do(opts ...googleapi.CallOption) (*BatchAnnotateFilesResponse, error) { 12942 gensupport.SetOptions(c.urlParams_, opts...) 12943 res, err := c.doRequest("json") 12944 if res != nil && res.StatusCode == http.StatusNotModified { 12945 if res.Body != nil { 12946 res.Body.Close() 12947 } 12948 return nil, gensupport.WrapError(&googleapi.Error{ 12949 Code: res.StatusCode, 12950 Header: res.Header, 12951 }) 12952 } 12953 if err != nil { 12954 return nil, err 12955 } 12956 defer googleapi.CloseBody(res) 12957 if err := googleapi.CheckResponse(res); err != nil { 12958 return nil, gensupport.WrapError(err) 12959 } 12960 ret := &BatchAnnotateFilesResponse{ 12961 ServerResponse: googleapi.ServerResponse{ 12962 Header: res.Header, 12963 HTTPStatusCode: res.StatusCode, 12964 }, 12965 } 12966 target := &ret 12967 if err := gensupport.DecodeResponse(target, res); err != nil { 12968 return nil, err 12969 } 12970 return ret, nil 12971 } 12972 12973 type ProjectsLocationsFilesAsyncBatchAnnotateCall struct { 12974 s *Service 12975 parent string 12976 asyncbatchannotatefilesrequest *AsyncBatchAnnotateFilesRequest 12977 urlParams_ gensupport.URLParams 12978 ctx_ context.Context 12979 header_ http.Header 12980 } 12981 12982 // AsyncBatchAnnotate: Run asynchronous image detection and annotation for a 12983 // list of generic files, such as PDF files, which may contain multiple pages 12984 // and multiple images per page. Progress and results can be retrieved through 12985 // the `google.longrunning.Operations` interface. `Operation.metadata` contains 12986 // `OperationMetadata` (metadata). `Operation.response` contains 12987 // `AsyncBatchAnnotateFilesResponse` (results). 12988 // 12989 // - parent: Optional. Target project and location to make a call. Format: 12990 // `projects/{project-id}/locations/{location-id}`. If no parent is 12991 // specified, a region will be chosen automatically. Supported location-ids: 12992 // `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: 12993 // The European Union. Example: `projects/project-A/locations/eu`. 12994 func (r *ProjectsLocationsFilesService) AsyncBatchAnnotate(parent string, asyncbatchannotatefilesrequest *AsyncBatchAnnotateFilesRequest) *ProjectsLocationsFilesAsyncBatchAnnotateCall { 12995 c := &ProjectsLocationsFilesAsyncBatchAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12996 c.parent = parent 12997 c.asyncbatchannotatefilesrequest = asyncbatchannotatefilesrequest 12998 return c 12999 } 13000 13001 // Fields allows partial responses to be retrieved. See 13002 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13003 // details. 13004 func (c *ProjectsLocationsFilesAsyncBatchAnnotateCall) Fields(s ...googleapi.Field) *ProjectsLocationsFilesAsyncBatchAnnotateCall { 13005 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13006 return c 13007 } 13008 13009 // Context sets the context to be used in this call's Do method. 13010 func (c *ProjectsLocationsFilesAsyncBatchAnnotateCall) Context(ctx context.Context) *ProjectsLocationsFilesAsyncBatchAnnotateCall { 13011 c.ctx_ = ctx 13012 return c 13013 } 13014 13015 // Header returns a http.Header that can be modified by the caller to add 13016 // headers to the request. 13017 func (c *ProjectsLocationsFilesAsyncBatchAnnotateCall) Header() http.Header { 13018 if c.header_ == nil { 13019 c.header_ = make(http.Header) 13020 } 13021 return c.header_ 13022 } 13023 13024 func (c *ProjectsLocationsFilesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { 13025 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 13026 var body io.Reader = nil 13027 body, err := googleapi.WithoutDataWrapper.JSONReader(c.asyncbatchannotatefilesrequest) 13028 if err != nil { 13029 return nil, err 13030 } 13031 c.urlParams_.Set("alt", alt) 13032 c.urlParams_.Set("prettyPrint", "false") 13033 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/files:asyncBatchAnnotate") 13034 urls += "?" + c.urlParams_.Encode() 13035 req, err := http.NewRequest("POST", urls, body) 13036 if err != nil { 13037 return nil, err 13038 } 13039 req.Header = reqHeaders 13040 googleapi.Expand(req.URL, map[string]string{ 13041 "parent": c.parent, 13042 }) 13043 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13044 } 13045 13046 // Do executes the "vision.projects.locations.files.asyncBatchAnnotate" call. 13047 // Any non-2xx status code is an error. Response headers are in either 13048 // *Operation.ServerResponse.Header or (if a response was returned at all) in 13049 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 13050 // whether the returned error was because http.StatusNotModified was returned. 13051 func (c *ProjectsLocationsFilesAsyncBatchAnnotateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 13052 gensupport.SetOptions(c.urlParams_, opts...) 13053 res, err := c.doRequest("json") 13054 if res != nil && res.StatusCode == http.StatusNotModified { 13055 if res.Body != nil { 13056 res.Body.Close() 13057 } 13058 return nil, gensupport.WrapError(&googleapi.Error{ 13059 Code: res.StatusCode, 13060 Header: res.Header, 13061 }) 13062 } 13063 if err != nil { 13064 return nil, err 13065 } 13066 defer googleapi.CloseBody(res) 13067 if err := googleapi.CheckResponse(res); err != nil { 13068 return nil, gensupport.WrapError(err) 13069 } 13070 ret := &Operation{ 13071 ServerResponse: googleapi.ServerResponse{ 13072 Header: res.Header, 13073 HTTPStatusCode: res.StatusCode, 13074 }, 13075 } 13076 target := &ret 13077 if err := gensupport.DecodeResponse(target, res); err != nil { 13078 return nil, err 13079 } 13080 return ret, nil 13081 } 13082 13083 type ProjectsLocationsImagesAnnotateCall struct { 13084 s *Service 13085 parent string 13086 batchannotateimagesrequest *BatchAnnotateImagesRequest 13087 urlParams_ gensupport.URLParams 13088 ctx_ context.Context 13089 header_ http.Header 13090 } 13091 13092 // Annotate: Run image detection and annotation for a batch of images. 13093 // 13094 // - parent: Optional. Target project and location to make a call. Format: 13095 // `projects/{project-id}/locations/{location-id}`. If no parent is 13096 // specified, a region will be chosen automatically. Supported location-ids: 13097 // `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: 13098 // The European Union. Example: `projects/project-A/locations/eu`. 13099 func (r *ProjectsLocationsImagesService) Annotate(parent string, batchannotateimagesrequest *BatchAnnotateImagesRequest) *ProjectsLocationsImagesAnnotateCall { 13100 c := &ProjectsLocationsImagesAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13101 c.parent = parent 13102 c.batchannotateimagesrequest = batchannotateimagesrequest 13103 return c 13104 } 13105 13106 // Fields allows partial responses to be retrieved. See 13107 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13108 // details. 13109 func (c *ProjectsLocationsImagesAnnotateCall) Fields(s ...googleapi.Field) *ProjectsLocationsImagesAnnotateCall { 13110 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13111 return c 13112 } 13113 13114 // Context sets the context to be used in this call's Do method. 13115 func (c *ProjectsLocationsImagesAnnotateCall) Context(ctx context.Context) *ProjectsLocationsImagesAnnotateCall { 13116 c.ctx_ = ctx 13117 return c 13118 } 13119 13120 // Header returns a http.Header that can be modified by the caller to add 13121 // headers to the request. 13122 func (c *ProjectsLocationsImagesAnnotateCall) Header() http.Header { 13123 if c.header_ == nil { 13124 c.header_ = make(http.Header) 13125 } 13126 return c.header_ 13127 } 13128 13129 func (c *ProjectsLocationsImagesAnnotateCall) doRequest(alt string) (*http.Response, error) { 13130 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 13131 var body io.Reader = nil 13132 body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchannotateimagesrequest) 13133 if err != nil { 13134 return nil, err 13135 } 13136 c.urlParams_.Set("alt", alt) 13137 c.urlParams_.Set("prettyPrint", "false") 13138 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/images:annotate") 13139 urls += "?" + c.urlParams_.Encode() 13140 req, err := http.NewRequest("POST", urls, body) 13141 if err != nil { 13142 return nil, err 13143 } 13144 req.Header = reqHeaders 13145 googleapi.Expand(req.URL, map[string]string{ 13146 "parent": c.parent, 13147 }) 13148 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13149 } 13150 13151 // Do executes the "vision.projects.locations.images.annotate" call. 13152 // Any non-2xx status code is an error. Response headers are in either 13153 // *BatchAnnotateImagesResponse.ServerResponse.Header or (if a response was 13154 // returned at all) in error.(*googleapi.Error).Header. Use 13155 // googleapi.IsNotModified to check whether the returned error was because 13156 // http.StatusNotModified was returned. 13157 func (c *ProjectsLocationsImagesAnnotateCall) Do(opts ...googleapi.CallOption) (*BatchAnnotateImagesResponse, error) { 13158 gensupport.SetOptions(c.urlParams_, opts...) 13159 res, err := c.doRequest("json") 13160 if res != nil && res.StatusCode == http.StatusNotModified { 13161 if res.Body != nil { 13162 res.Body.Close() 13163 } 13164 return nil, gensupport.WrapError(&googleapi.Error{ 13165 Code: res.StatusCode, 13166 Header: res.Header, 13167 }) 13168 } 13169 if err != nil { 13170 return nil, err 13171 } 13172 defer googleapi.CloseBody(res) 13173 if err := googleapi.CheckResponse(res); err != nil { 13174 return nil, gensupport.WrapError(err) 13175 } 13176 ret := &BatchAnnotateImagesResponse{ 13177 ServerResponse: googleapi.ServerResponse{ 13178 Header: res.Header, 13179 HTTPStatusCode: res.StatusCode, 13180 }, 13181 } 13182 target := &ret 13183 if err := gensupport.DecodeResponse(target, res); err != nil { 13184 return nil, err 13185 } 13186 return ret, nil 13187 } 13188 13189 type ProjectsLocationsImagesAsyncBatchAnnotateCall struct { 13190 s *Service 13191 parent string 13192 asyncbatchannotateimagesrequest *AsyncBatchAnnotateImagesRequest 13193 urlParams_ gensupport.URLParams 13194 ctx_ context.Context 13195 header_ http.Header 13196 } 13197 13198 // AsyncBatchAnnotate: Run asynchronous image detection and annotation for a 13199 // list of images. Progress and results can be retrieved through the 13200 // `google.longrunning.Operations` interface. `Operation.metadata` contains 13201 // `OperationMetadata` (metadata). `Operation.response` contains 13202 // `AsyncBatchAnnotateImagesResponse` (results). This service will write image 13203 // annotation outputs to json files in customer GCS bucket, each json file 13204 // containing BatchAnnotateImagesResponse proto. 13205 // 13206 // - parent: Optional. Target project and location to make a call. Format: 13207 // `projects/{project-id}/locations/{location-id}`. If no parent is 13208 // specified, a region will be chosen automatically. Supported location-ids: 13209 // `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: 13210 // The European Union. Example: `projects/project-A/locations/eu`. 13211 func (r *ProjectsLocationsImagesService) AsyncBatchAnnotate(parent string, asyncbatchannotateimagesrequest *AsyncBatchAnnotateImagesRequest) *ProjectsLocationsImagesAsyncBatchAnnotateCall { 13212 c := &ProjectsLocationsImagesAsyncBatchAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13213 c.parent = parent 13214 c.asyncbatchannotateimagesrequest = asyncbatchannotateimagesrequest 13215 return c 13216 } 13217 13218 // Fields allows partial responses to be retrieved. See 13219 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13220 // details. 13221 func (c *ProjectsLocationsImagesAsyncBatchAnnotateCall) Fields(s ...googleapi.Field) *ProjectsLocationsImagesAsyncBatchAnnotateCall { 13222 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13223 return c 13224 } 13225 13226 // Context sets the context to be used in this call's Do method. 13227 func (c *ProjectsLocationsImagesAsyncBatchAnnotateCall) Context(ctx context.Context) *ProjectsLocationsImagesAsyncBatchAnnotateCall { 13228 c.ctx_ = ctx 13229 return c 13230 } 13231 13232 // Header returns a http.Header that can be modified by the caller to add 13233 // headers to the request. 13234 func (c *ProjectsLocationsImagesAsyncBatchAnnotateCall) Header() http.Header { 13235 if c.header_ == nil { 13236 c.header_ = make(http.Header) 13237 } 13238 return c.header_ 13239 } 13240 13241 func (c *ProjectsLocationsImagesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { 13242 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 13243 var body io.Reader = nil 13244 body, err := googleapi.WithoutDataWrapper.JSONReader(c.asyncbatchannotateimagesrequest) 13245 if err != nil { 13246 return nil, err 13247 } 13248 c.urlParams_.Set("alt", alt) 13249 c.urlParams_.Set("prettyPrint", "false") 13250 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/images:asyncBatchAnnotate") 13251 urls += "?" + c.urlParams_.Encode() 13252 req, err := http.NewRequest("POST", urls, body) 13253 if err != nil { 13254 return nil, err 13255 } 13256 req.Header = reqHeaders 13257 googleapi.Expand(req.URL, map[string]string{ 13258 "parent": c.parent, 13259 }) 13260 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13261 } 13262 13263 // Do executes the "vision.projects.locations.images.asyncBatchAnnotate" call. 13264 // Any non-2xx status code is an error. Response headers are in either 13265 // *Operation.ServerResponse.Header or (if a response was returned at all) in 13266 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 13267 // whether the returned error was because http.StatusNotModified was returned. 13268 func (c *ProjectsLocationsImagesAsyncBatchAnnotateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 13269 gensupport.SetOptions(c.urlParams_, opts...) 13270 res, err := c.doRequest("json") 13271 if res != nil && res.StatusCode == http.StatusNotModified { 13272 if res.Body != nil { 13273 res.Body.Close() 13274 } 13275 return nil, gensupport.WrapError(&googleapi.Error{ 13276 Code: res.StatusCode, 13277 Header: res.Header, 13278 }) 13279 } 13280 if err != nil { 13281 return nil, err 13282 } 13283 defer googleapi.CloseBody(res) 13284 if err := googleapi.CheckResponse(res); err != nil { 13285 return nil, gensupport.WrapError(err) 13286 } 13287 ret := &Operation{ 13288 ServerResponse: googleapi.ServerResponse{ 13289 Header: res.Header, 13290 HTTPStatusCode: res.StatusCode, 13291 }, 13292 } 13293 target := &ret 13294 if err := gensupport.DecodeResponse(target, res); err != nil { 13295 return nil, err 13296 } 13297 return ret, nil 13298 } 13299 13300 type ProjectsLocationsOperationsGetCall struct { 13301 s *Service 13302 name string 13303 urlParams_ gensupport.URLParams 13304 ifNoneMatch_ string 13305 ctx_ context.Context 13306 header_ http.Header 13307 } 13308 13309 // Get: Gets the latest state of a long-running operation. Clients can use this 13310 // method to poll the operation result at intervals as recommended by the API 13311 // service. 13312 // 13313 // - name: The name of the operation resource. 13314 func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall { 13315 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13316 c.name = name 13317 return c 13318 } 13319 13320 // Fields allows partial responses to be retrieved. See 13321 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13322 // details. 13323 func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall { 13324 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13325 return c 13326 } 13327 13328 // IfNoneMatch sets an optional parameter which makes the operation fail if the 13329 // object's ETag matches the given value. This is useful for getting updates 13330 // only after the object has changed since the last request. 13331 func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall { 13332 c.ifNoneMatch_ = entityTag 13333 return c 13334 } 13335 13336 // Context sets the context to be used in this call's Do method. 13337 func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall { 13338 c.ctx_ = ctx 13339 return c 13340 } 13341 13342 // Header returns a http.Header that can be modified by the caller to add 13343 // headers to the request. 13344 func (c *ProjectsLocationsOperationsGetCall) Header() http.Header { 13345 if c.header_ == nil { 13346 c.header_ = make(http.Header) 13347 } 13348 return c.header_ 13349 } 13350 13351 func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 13352 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 13353 if c.ifNoneMatch_ != "" { 13354 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13355 } 13356 var body io.Reader = nil 13357 c.urlParams_.Set("alt", alt) 13358 c.urlParams_.Set("prettyPrint", "false") 13359 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 13360 urls += "?" + c.urlParams_.Encode() 13361 req, err := http.NewRequest("GET", urls, body) 13362 if err != nil { 13363 return nil, err 13364 } 13365 req.Header = reqHeaders 13366 googleapi.Expand(req.URL, map[string]string{ 13367 "name": c.name, 13368 }) 13369 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13370 } 13371 13372 // Do executes the "vision.projects.locations.operations.get" call. 13373 // Any non-2xx status code is an error. Response headers are in either 13374 // *Operation.ServerResponse.Header or (if a response was returned at all) in 13375 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 13376 // whether the returned error was because http.StatusNotModified was returned. 13377 func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 13378 gensupport.SetOptions(c.urlParams_, opts...) 13379 res, err := c.doRequest("json") 13380 if res != nil && res.StatusCode == http.StatusNotModified { 13381 if res.Body != nil { 13382 res.Body.Close() 13383 } 13384 return nil, gensupport.WrapError(&googleapi.Error{ 13385 Code: res.StatusCode, 13386 Header: res.Header, 13387 }) 13388 } 13389 if err != nil { 13390 return nil, err 13391 } 13392 defer googleapi.CloseBody(res) 13393 if err := googleapi.CheckResponse(res); err != nil { 13394 return nil, gensupport.WrapError(err) 13395 } 13396 ret := &Operation{ 13397 ServerResponse: googleapi.ServerResponse{ 13398 Header: res.Header, 13399 HTTPStatusCode: res.StatusCode, 13400 }, 13401 } 13402 target := &ret 13403 if err := gensupport.DecodeResponse(target, res); err != nil { 13404 return nil, err 13405 } 13406 return ret, nil 13407 } 13408 13409 type ProjectsLocationsProductSetsAddProductCall struct { 13410 s *Service 13411 name string 13412 addproducttoproductsetrequest *AddProductToProductSetRequest 13413 urlParams_ gensupport.URLParams 13414 ctx_ context.Context 13415 header_ http.Header 13416 } 13417 13418 // AddProduct: Adds a Product to the specified ProductSet. If the Product is 13419 // already present, no change is made. One Product can be added to at most 100 13420 // ProductSets. Possible errors: * Returns NOT_FOUND if the Product or the 13421 // ProductSet doesn't exist. 13422 // 13423 // - name: The resource name for the ProductSet to modify. Format is: 13424 // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. 13425 func (r *ProjectsLocationsProductSetsService) AddProduct(name string, addproducttoproductsetrequest *AddProductToProductSetRequest) *ProjectsLocationsProductSetsAddProductCall { 13426 c := &ProjectsLocationsProductSetsAddProductCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13427 c.name = name 13428 c.addproducttoproductsetrequest = addproducttoproductsetrequest 13429 return c 13430 } 13431 13432 // Fields allows partial responses to be retrieved. See 13433 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13434 // details. 13435 func (c *ProjectsLocationsProductSetsAddProductCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductSetsAddProductCall { 13436 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13437 return c 13438 } 13439 13440 // Context sets the context to be used in this call's Do method. 13441 func (c *ProjectsLocationsProductSetsAddProductCall) Context(ctx context.Context) *ProjectsLocationsProductSetsAddProductCall { 13442 c.ctx_ = ctx 13443 return c 13444 } 13445 13446 // Header returns a http.Header that can be modified by the caller to add 13447 // headers to the request. 13448 func (c *ProjectsLocationsProductSetsAddProductCall) Header() http.Header { 13449 if c.header_ == nil { 13450 c.header_ = make(http.Header) 13451 } 13452 return c.header_ 13453 } 13454 13455 func (c *ProjectsLocationsProductSetsAddProductCall) doRequest(alt string) (*http.Response, error) { 13456 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 13457 var body io.Reader = nil 13458 body, err := googleapi.WithoutDataWrapper.JSONReader(c.addproducttoproductsetrequest) 13459 if err != nil { 13460 return nil, err 13461 } 13462 c.urlParams_.Set("alt", alt) 13463 c.urlParams_.Set("prettyPrint", "false") 13464 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:addProduct") 13465 urls += "?" + c.urlParams_.Encode() 13466 req, err := http.NewRequest("POST", urls, body) 13467 if err != nil { 13468 return nil, err 13469 } 13470 req.Header = reqHeaders 13471 googleapi.Expand(req.URL, map[string]string{ 13472 "name": c.name, 13473 }) 13474 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13475 } 13476 13477 // Do executes the "vision.projects.locations.productSets.addProduct" call. 13478 // Any non-2xx status code is an error. Response headers are in either 13479 // *Empty.ServerResponse.Header or (if a response was returned at all) in 13480 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 13481 // whether the returned error was because http.StatusNotModified was returned. 13482 func (c *ProjectsLocationsProductSetsAddProductCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 13483 gensupport.SetOptions(c.urlParams_, opts...) 13484 res, err := c.doRequest("json") 13485 if res != nil && res.StatusCode == http.StatusNotModified { 13486 if res.Body != nil { 13487 res.Body.Close() 13488 } 13489 return nil, gensupport.WrapError(&googleapi.Error{ 13490 Code: res.StatusCode, 13491 Header: res.Header, 13492 }) 13493 } 13494 if err != nil { 13495 return nil, err 13496 } 13497 defer googleapi.CloseBody(res) 13498 if err := googleapi.CheckResponse(res); err != nil { 13499 return nil, gensupport.WrapError(err) 13500 } 13501 ret := &Empty{ 13502 ServerResponse: googleapi.ServerResponse{ 13503 Header: res.Header, 13504 HTTPStatusCode: res.StatusCode, 13505 }, 13506 } 13507 target := &ret 13508 if err := gensupport.DecodeResponse(target, res); err != nil { 13509 return nil, err 13510 } 13511 return ret, nil 13512 } 13513 13514 type ProjectsLocationsProductSetsCreateCall struct { 13515 s *Service 13516 parent string 13517 productset *ProductSet 13518 urlParams_ gensupport.URLParams 13519 ctx_ context.Context 13520 header_ http.Header 13521 } 13522 13523 // Create: Creates and returns a new ProductSet resource. Possible errors: * 13524 // Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 13525 // characters. 13526 // 13527 // - parent: The project in which the ProductSet should be created. Format is 13528 // `projects/PROJECT_ID/locations/LOC_ID`. 13529 func (r *ProjectsLocationsProductSetsService) Create(parent string, productset *ProductSet) *ProjectsLocationsProductSetsCreateCall { 13530 c := &ProjectsLocationsProductSetsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13531 c.parent = parent 13532 c.productset = productset 13533 return c 13534 } 13535 13536 // ProductSetId sets the optional parameter "productSetId": A user-supplied 13537 // resource id for this ProductSet. If set, the server will attempt to use this 13538 // value as the resource id. If it is already in use, an error is returned with 13539 // code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain 13540 // the character `/`. 13541 func (c *ProjectsLocationsProductSetsCreateCall) ProductSetId(productSetId string) *ProjectsLocationsProductSetsCreateCall { 13542 c.urlParams_.Set("productSetId", productSetId) 13543 return c 13544 } 13545 13546 // Fields allows partial responses to be retrieved. See 13547 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13548 // details. 13549 func (c *ProjectsLocationsProductSetsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductSetsCreateCall { 13550 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13551 return c 13552 } 13553 13554 // Context sets the context to be used in this call's Do method. 13555 func (c *ProjectsLocationsProductSetsCreateCall) Context(ctx context.Context) *ProjectsLocationsProductSetsCreateCall { 13556 c.ctx_ = ctx 13557 return c 13558 } 13559 13560 // Header returns a http.Header that can be modified by the caller to add 13561 // headers to the request. 13562 func (c *ProjectsLocationsProductSetsCreateCall) Header() http.Header { 13563 if c.header_ == nil { 13564 c.header_ = make(http.Header) 13565 } 13566 return c.header_ 13567 } 13568 13569 func (c *ProjectsLocationsProductSetsCreateCall) doRequest(alt string) (*http.Response, error) { 13570 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 13571 var body io.Reader = nil 13572 body, err := googleapi.WithoutDataWrapper.JSONReader(c.productset) 13573 if err != nil { 13574 return nil, err 13575 } 13576 c.urlParams_.Set("alt", alt) 13577 c.urlParams_.Set("prettyPrint", "false") 13578 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/productSets") 13579 urls += "?" + c.urlParams_.Encode() 13580 req, err := http.NewRequest("POST", urls, body) 13581 if err != nil { 13582 return nil, err 13583 } 13584 req.Header = reqHeaders 13585 googleapi.Expand(req.URL, map[string]string{ 13586 "parent": c.parent, 13587 }) 13588 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13589 } 13590 13591 // Do executes the "vision.projects.locations.productSets.create" call. 13592 // Any non-2xx status code is an error. Response headers are in either 13593 // *ProductSet.ServerResponse.Header or (if a response was returned at all) in 13594 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 13595 // whether the returned error was because http.StatusNotModified was returned. 13596 func (c *ProjectsLocationsProductSetsCreateCall) Do(opts ...googleapi.CallOption) (*ProductSet, error) { 13597 gensupport.SetOptions(c.urlParams_, opts...) 13598 res, err := c.doRequest("json") 13599 if res != nil && res.StatusCode == http.StatusNotModified { 13600 if res.Body != nil { 13601 res.Body.Close() 13602 } 13603 return nil, gensupport.WrapError(&googleapi.Error{ 13604 Code: res.StatusCode, 13605 Header: res.Header, 13606 }) 13607 } 13608 if err != nil { 13609 return nil, err 13610 } 13611 defer googleapi.CloseBody(res) 13612 if err := googleapi.CheckResponse(res); err != nil { 13613 return nil, gensupport.WrapError(err) 13614 } 13615 ret := &ProductSet{ 13616 ServerResponse: googleapi.ServerResponse{ 13617 Header: res.Header, 13618 HTTPStatusCode: res.StatusCode, 13619 }, 13620 } 13621 target := &ret 13622 if err := gensupport.DecodeResponse(target, res); err != nil { 13623 return nil, err 13624 } 13625 return ret, nil 13626 } 13627 13628 type ProjectsLocationsProductSetsDeleteCall struct { 13629 s *Service 13630 name string 13631 urlParams_ gensupport.URLParams 13632 ctx_ context.Context 13633 header_ http.Header 13634 } 13635 13636 // Delete: Permanently deletes a ProductSet. Products and ReferenceImages in 13637 // the ProductSet are not deleted. The actual image files are not deleted from 13638 // Google Cloud Storage. 13639 // 13640 // - name: Resource name of the ProductSet to delete. Format is: 13641 // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. 13642 func (r *ProjectsLocationsProductSetsService) Delete(name string) *ProjectsLocationsProductSetsDeleteCall { 13643 c := &ProjectsLocationsProductSetsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13644 c.name = name 13645 return c 13646 } 13647 13648 // Fields allows partial responses to be retrieved. See 13649 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13650 // details. 13651 func (c *ProjectsLocationsProductSetsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductSetsDeleteCall { 13652 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13653 return c 13654 } 13655 13656 // Context sets the context to be used in this call's Do method. 13657 func (c *ProjectsLocationsProductSetsDeleteCall) Context(ctx context.Context) *ProjectsLocationsProductSetsDeleteCall { 13658 c.ctx_ = ctx 13659 return c 13660 } 13661 13662 // Header returns a http.Header that can be modified by the caller to add 13663 // headers to the request. 13664 func (c *ProjectsLocationsProductSetsDeleteCall) Header() http.Header { 13665 if c.header_ == nil { 13666 c.header_ = make(http.Header) 13667 } 13668 return c.header_ 13669 } 13670 13671 func (c *ProjectsLocationsProductSetsDeleteCall) doRequest(alt string) (*http.Response, error) { 13672 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 13673 var body io.Reader = nil 13674 c.urlParams_.Set("alt", alt) 13675 c.urlParams_.Set("prettyPrint", "false") 13676 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 13677 urls += "?" + c.urlParams_.Encode() 13678 req, err := http.NewRequest("DELETE", urls, body) 13679 if err != nil { 13680 return nil, err 13681 } 13682 req.Header = reqHeaders 13683 googleapi.Expand(req.URL, map[string]string{ 13684 "name": c.name, 13685 }) 13686 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13687 } 13688 13689 // Do executes the "vision.projects.locations.productSets.delete" call. 13690 // Any non-2xx status code is an error. Response headers are in either 13691 // *Empty.ServerResponse.Header or (if a response was returned at all) in 13692 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 13693 // whether the returned error was because http.StatusNotModified was returned. 13694 func (c *ProjectsLocationsProductSetsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 13695 gensupport.SetOptions(c.urlParams_, opts...) 13696 res, err := c.doRequest("json") 13697 if res != nil && res.StatusCode == http.StatusNotModified { 13698 if res.Body != nil { 13699 res.Body.Close() 13700 } 13701 return nil, gensupport.WrapError(&googleapi.Error{ 13702 Code: res.StatusCode, 13703 Header: res.Header, 13704 }) 13705 } 13706 if err != nil { 13707 return nil, err 13708 } 13709 defer googleapi.CloseBody(res) 13710 if err := googleapi.CheckResponse(res); err != nil { 13711 return nil, gensupport.WrapError(err) 13712 } 13713 ret := &Empty{ 13714 ServerResponse: googleapi.ServerResponse{ 13715 Header: res.Header, 13716 HTTPStatusCode: res.StatusCode, 13717 }, 13718 } 13719 target := &ret 13720 if err := gensupport.DecodeResponse(target, res); err != nil { 13721 return nil, err 13722 } 13723 return ret, nil 13724 } 13725 13726 type ProjectsLocationsProductSetsGetCall struct { 13727 s *Service 13728 name string 13729 urlParams_ gensupport.URLParams 13730 ifNoneMatch_ string 13731 ctx_ context.Context 13732 header_ http.Header 13733 } 13734 13735 // Get: Gets information associated with a ProductSet. Possible errors: * 13736 // Returns NOT_FOUND if the ProductSet does not exist. 13737 // 13738 // - name: Resource name of the ProductSet to get. Format is: 13739 // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. 13740 func (r *ProjectsLocationsProductSetsService) Get(name string) *ProjectsLocationsProductSetsGetCall { 13741 c := &ProjectsLocationsProductSetsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13742 c.name = name 13743 return c 13744 } 13745 13746 // Fields allows partial responses to be retrieved. See 13747 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13748 // details. 13749 func (c *ProjectsLocationsProductSetsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductSetsGetCall { 13750 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13751 return c 13752 } 13753 13754 // IfNoneMatch sets an optional parameter which makes the operation fail if the 13755 // object's ETag matches the given value. This is useful for getting updates 13756 // only after the object has changed since the last request. 13757 func (c *ProjectsLocationsProductSetsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsProductSetsGetCall { 13758 c.ifNoneMatch_ = entityTag 13759 return c 13760 } 13761 13762 // Context sets the context to be used in this call's Do method. 13763 func (c *ProjectsLocationsProductSetsGetCall) Context(ctx context.Context) *ProjectsLocationsProductSetsGetCall { 13764 c.ctx_ = ctx 13765 return c 13766 } 13767 13768 // Header returns a http.Header that can be modified by the caller to add 13769 // headers to the request. 13770 func (c *ProjectsLocationsProductSetsGetCall) Header() http.Header { 13771 if c.header_ == nil { 13772 c.header_ = make(http.Header) 13773 } 13774 return c.header_ 13775 } 13776 13777 func (c *ProjectsLocationsProductSetsGetCall) doRequest(alt string) (*http.Response, error) { 13778 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 13779 if c.ifNoneMatch_ != "" { 13780 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13781 } 13782 var body io.Reader = nil 13783 c.urlParams_.Set("alt", alt) 13784 c.urlParams_.Set("prettyPrint", "false") 13785 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 13786 urls += "?" + c.urlParams_.Encode() 13787 req, err := http.NewRequest("GET", urls, body) 13788 if err != nil { 13789 return nil, err 13790 } 13791 req.Header = reqHeaders 13792 googleapi.Expand(req.URL, map[string]string{ 13793 "name": c.name, 13794 }) 13795 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13796 } 13797 13798 // Do executes the "vision.projects.locations.productSets.get" call. 13799 // Any non-2xx status code is an error. Response headers are in either 13800 // *ProductSet.ServerResponse.Header or (if a response was returned at all) in 13801 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 13802 // whether the returned error was because http.StatusNotModified was returned. 13803 func (c *ProjectsLocationsProductSetsGetCall) Do(opts ...googleapi.CallOption) (*ProductSet, error) { 13804 gensupport.SetOptions(c.urlParams_, opts...) 13805 res, err := c.doRequest("json") 13806 if res != nil && res.StatusCode == http.StatusNotModified { 13807 if res.Body != nil { 13808 res.Body.Close() 13809 } 13810 return nil, gensupport.WrapError(&googleapi.Error{ 13811 Code: res.StatusCode, 13812 Header: res.Header, 13813 }) 13814 } 13815 if err != nil { 13816 return nil, err 13817 } 13818 defer googleapi.CloseBody(res) 13819 if err := googleapi.CheckResponse(res); err != nil { 13820 return nil, gensupport.WrapError(err) 13821 } 13822 ret := &ProductSet{ 13823 ServerResponse: googleapi.ServerResponse{ 13824 Header: res.Header, 13825 HTTPStatusCode: res.StatusCode, 13826 }, 13827 } 13828 target := &ret 13829 if err := gensupport.DecodeResponse(target, res); err != nil { 13830 return nil, err 13831 } 13832 return ret, nil 13833 } 13834 13835 type ProjectsLocationsProductSetsImportCall struct { 13836 s *Service 13837 parent string 13838 importproductsetsrequest *ImportProductSetsRequest 13839 urlParams_ gensupport.URLParams 13840 ctx_ context.Context 13841 header_ http.Header 13842 } 13843 13844 // Import: Asynchronous API that imports a list of reference images to 13845 // specified product sets based on a list of image information. The 13846 // google.longrunning.Operation API can be used to keep track of the progress 13847 // and results of the request. `Operation.metadata` contains 13848 // `BatchOperationMetadata`. (progress) `Operation.response` contains 13849 // `ImportProductSetsResponse`. (results) The input source of this method is a 13850 // csv file on Google Cloud Storage. For the format of the csv file please see 13851 // ImportProductSetsGcsSource.csv_file_uri. 13852 // 13853 // - parent: The project in which the ProductSets should be imported. Format is 13854 // `projects/PROJECT_ID/locations/LOC_ID`. 13855 func (r *ProjectsLocationsProductSetsService) Import(parent string, importproductsetsrequest *ImportProductSetsRequest) *ProjectsLocationsProductSetsImportCall { 13856 c := &ProjectsLocationsProductSetsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13857 c.parent = parent 13858 c.importproductsetsrequest = importproductsetsrequest 13859 return c 13860 } 13861 13862 // Fields allows partial responses to be retrieved. See 13863 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13864 // details. 13865 func (c *ProjectsLocationsProductSetsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductSetsImportCall { 13866 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13867 return c 13868 } 13869 13870 // Context sets the context to be used in this call's Do method. 13871 func (c *ProjectsLocationsProductSetsImportCall) Context(ctx context.Context) *ProjectsLocationsProductSetsImportCall { 13872 c.ctx_ = ctx 13873 return c 13874 } 13875 13876 // Header returns a http.Header that can be modified by the caller to add 13877 // headers to the request. 13878 func (c *ProjectsLocationsProductSetsImportCall) Header() http.Header { 13879 if c.header_ == nil { 13880 c.header_ = make(http.Header) 13881 } 13882 return c.header_ 13883 } 13884 13885 func (c *ProjectsLocationsProductSetsImportCall) doRequest(alt string) (*http.Response, error) { 13886 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 13887 var body io.Reader = nil 13888 body, err := googleapi.WithoutDataWrapper.JSONReader(c.importproductsetsrequest) 13889 if err != nil { 13890 return nil, err 13891 } 13892 c.urlParams_.Set("alt", alt) 13893 c.urlParams_.Set("prettyPrint", "false") 13894 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/productSets:import") 13895 urls += "?" + c.urlParams_.Encode() 13896 req, err := http.NewRequest("POST", urls, body) 13897 if err != nil { 13898 return nil, err 13899 } 13900 req.Header = reqHeaders 13901 googleapi.Expand(req.URL, map[string]string{ 13902 "parent": c.parent, 13903 }) 13904 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13905 } 13906 13907 // Do executes the "vision.projects.locations.productSets.import" call. 13908 // Any non-2xx status code is an error. Response headers are in either 13909 // *Operation.ServerResponse.Header or (if a response was returned at all) in 13910 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 13911 // whether the returned error was because http.StatusNotModified was returned. 13912 func (c *ProjectsLocationsProductSetsImportCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 13913 gensupport.SetOptions(c.urlParams_, opts...) 13914 res, err := c.doRequest("json") 13915 if res != nil && res.StatusCode == http.StatusNotModified { 13916 if res.Body != nil { 13917 res.Body.Close() 13918 } 13919 return nil, gensupport.WrapError(&googleapi.Error{ 13920 Code: res.StatusCode, 13921 Header: res.Header, 13922 }) 13923 } 13924 if err != nil { 13925 return nil, err 13926 } 13927 defer googleapi.CloseBody(res) 13928 if err := googleapi.CheckResponse(res); err != nil { 13929 return nil, gensupport.WrapError(err) 13930 } 13931 ret := &Operation{ 13932 ServerResponse: googleapi.ServerResponse{ 13933 Header: res.Header, 13934 HTTPStatusCode: res.StatusCode, 13935 }, 13936 } 13937 target := &ret 13938 if err := gensupport.DecodeResponse(target, res); err != nil { 13939 return nil, err 13940 } 13941 return ret, nil 13942 } 13943 13944 type ProjectsLocationsProductSetsListCall struct { 13945 s *Service 13946 parent string 13947 urlParams_ gensupport.URLParams 13948 ifNoneMatch_ string 13949 ctx_ context.Context 13950 header_ http.Header 13951 } 13952 13953 // List: Lists ProductSets in an unspecified order. Possible errors: * Returns 13954 // INVALID_ARGUMENT if page_size is greater than 100, or less than 1. 13955 // 13956 // - parent: The project from which ProductSets should be listed. Format is 13957 // `projects/PROJECT_ID/locations/LOC_ID`. 13958 func (r *ProjectsLocationsProductSetsService) List(parent string) *ProjectsLocationsProductSetsListCall { 13959 c := &ProjectsLocationsProductSetsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13960 c.parent = parent 13961 return c 13962 } 13963 13964 // PageSize sets the optional parameter "pageSize": The maximum number of items 13965 // to return. Default 10, maximum 100. 13966 func (c *ProjectsLocationsProductSetsListCall) PageSize(pageSize int64) *ProjectsLocationsProductSetsListCall { 13967 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 13968 return c 13969 } 13970 13971 // PageToken sets the optional parameter "pageToken": The next_page_token 13972 // returned from a previous List request, if any. 13973 func (c *ProjectsLocationsProductSetsListCall) PageToken(pageToken string) *ProjectsLocationsProductSetsListCall { 13974 c.urlParams_.Set("pageToken", pageToken) 13975 return c 13976 } 13977 13978 // Fields allows partial responses to be retrieved. See 13979 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13980 // details. 13981 func (c *ProjectsLocationsProductSetsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductSetsListCall { 13982 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13983 return c 13984 } 13985 13986 // IfNoneMatch sets an optional parameter which makes the operation fail if the 13987 // object's ETag matches the given value. This is useful for getting updates 13988 // only after the object has changed since the last request. 13989 func (c *ProjectsLocationsProductSetsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsProductSetsListCall { 13990 c.ifNoneMatch_ = entityTag 13991 return c 13992 } 13993 13994 // Context sets the context to be used in this call's Do method. 13995 func (c *ProjectsLocationsProductSetsListCall) Context(ctx context.Context) *ProjectsLocationsProductSetsListCall { 13996 c.ctx_ = ctx 13997 return c 13998 } 13999 14000 // Header returns a http.Header that can be modified by the caller to add 14001 // headers to the request. 14002 func (c *ProjectsLocationsProductSetsListCall) Header() http.Header { 14003 if c.header_ == nil { 14004 c.header_ = make(http.Header) 14005 } 14006 return c.header_ 14007 } 14008 14009 func (c *ProjectsLocationsProductSetsListCall) doRequest(alt string) (*http.Response, error) { 14010 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 14011 if c.ifNoneMatch_ != "" { 14012 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14013 } 14014 var body io.Reader = nil 14015 c.urlParams_.Set("alt", alt) 14016 c.urlParams_.Set("prettyPrint", "false") 14017 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/productSets") 14018 urls += "?" + c.urlParams_.Encode() 14019 req, err := http.NewRequest("GET", urls, body) 14020 if err != nil { 14021 return nil, err 14022 } 14023 req.Header = reqHeaders 14024 googleapi.Expand(req.URL, map[string]string{ 14025 "parent": c.parent, 14026 }) 14027 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14028 } 14029 14030 // Do executes the "vision.projects.locations.productSets.list" call. 14031 // Any non-2xx status code is an error. Response headers are in either 14032 // *ListProductSetsResponse.ServerResponse.Header or (if a response was 14033 // returned at all) in error.(*googleapi.Error).Header. Use 14034 // googleapi.IsNotModified to check whether the returned error was because 14035 // http.StatusNotModified was returned. 14036 func (c *ProjectsLocationsProductSetsListCall) Do(opts ...googleapi.CallOption) (*ListProductSetsResponse, error) { 14037 gensupport.SetOptions(c.urlParams_, opts...) 14038 res, err := c.doRequest("json") 14039 if res != nil && res.StatusCode == http.StatusNotModified { 14040 if res.Body != nil { 14041 res.Body.Close() 14042 } 14043 return nil, gensupport.WrapError(&googleapi.Error{ 14044 Code: res.StatusCode, 14045 Header: res.Header, 14046 }) 14047 } 14048 if err != nil { 14049 return nil, err 14050 } 14051 defer googleapi.CloseBody(res) 14052 if err := googleapi.CheckResponse(res); err != nil { 14053 return nil, gensupport.WrapError(err) 14054 } 14055 ret := &ListProductSetsResponse{ 14056 ServerResponse: googleapi.ServerResponse{ 14057 Header: res.Header, 14058 HTTPStatusCode: res.StatusCode, 14059 }, 14060 } 14061 target := &ret 14062 if err := gensupport.DecodeResponse(target, res); err != nil { 14063 return nil, err 14064 } 14065 return ret, nil 14066 } 14067 14068 // Pages invokes f for each page of results. 14069 // A non-nil error returned from f will halt the iteration. 14070 // The provided context supersedes any context provided to the Context method. 14071 func (c *ProjectsLocationsProductSetsListCall) Pages(ctx context.Context, f func(*ListProductSetsResponse) error) error { 14072 c.ctx_ = ctx 14073 defer c.PageToken(c.urlParams_.Get("pageToken")) 14074 for { 14075 x, err := c.Do() 14076 if err != nil { 14077 return err 14078 } 14079 if err := f(x); err != nil { 14080 return err 14081 } 14082 if x.NextPageToken == "" { 14083 return nil 14084 } 14085 c.PageToken(x.NextPageToken) 14086 } 14087 } 14088 14089 type ProjectsLocationsProductSetsPatchCall struct { 14090 s *Service 14091 name string 14092 productset *ProductSet 14093 urlParams_ gensupport.URLParams 14094 ctx_ context.Context 14095 header_ http.Header 14096 } 14097 14098 // Patch: Makes changes to a ProductSet resource. Only display_name can be 14099 // updated currently. Possible errors: * Returns NOT_FOUND if the ProductSet 14100 // does not exist. * Returns INVALID_ARGUMENT if display_name is present in 14101 // update_mask but missing from the request or longer than 4096 characters. 14102 // 14103 // - name: The resource name of the ProductSet. Format is: 14104 // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. This 14105 // field is ignored when creating a ProductSet. 14106 func (r *ProjectsLocationsProductSetsService) Patch(name string, productset *ProductSet) *ProjectsLocationsProductSetsPatchCall { 14107 c := &ProjectsLocationsProductSetsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14108 c.name = name 14109 c.productset = productset 14110 return c 14111 } 14112 14113 // UpdateMask sets the optional parameter "updateMask": The FieldMask that 14114 // specifies which fields to update. If update_mask isn't specified, all 14115 // mutable fields are to be updated. Valid mask path is `display_name`. 14116 func (c *ProjectsLocationsProductSetsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsProductSetsPatchCall { 14117 c.urlParams_.Set("updateMask", updateMask) 14118 return c 14119 } 14120 14121 // Fields allows partial responses to be retrieved. See 14122 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 14123 // details. 14124 func (c *ProjectsLocationsProductSetsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductSetsPatchCall { 14125 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14126 return c 14127 } 14128 14129 // Context sets the context to be used in this call's Do method. 14130 func (c *ProjectsLocationsProductSetsPatchCall) Context(ctx context.Context) *ProjectsLocationsProductSetsPatchCall { 14131 c.ctx_ = ctx 14132 return c 14133 } 14134 14135 // Header returns a http.Header that can be modified by the caller to add 14136 // headers to the request. 14137 func (c *ProjectsLocationsProductSetsPatchCall) Header() http.Header { 14138 if c.header_ == nil { 14139 c.header_ = make(http.Header) 14140 } 14141 return c.header_ 14142 } 14143 14144 func (c *ProjectsLocationsProductSetsPatchCall) doRequest(alt string) (*http.Response, error) { 14145 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 14146 var body io.Reader = nil 14147 body, err := googleapi.WithoutDataWrapper.JSONReader(c.productset) 14148 if err != nil { 14149 return nil, err 14150 } 14151 c.urlParams_.Set("alt", alt) 14152 c.urlParams_.Set("prettyPrint", "false") 14153 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 14154 urls += "?" + c.urlParams_.Encode() 14155 req, err := http.NewRequest("PATCH", urls, body) 14156 if err != nil { 14157 return nil, err 14158 } 14159 req.Header = reqHeaders 14160 googleapi.Expand(req.URL, map[string]string{ 14161 "name": c.name, 14162 }) 14163 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14164 } 14165 14166 // Do executes the "vision.projects.locations.productSets.patch" call. 14167 // Any non-2xx status code is an error. Response headers are in either 14168 // *ProductSet.ServerResponse.Header or (if a response was returned at all) in 14169 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 14170 // whether the returned error was because http.StatusNotModified was returned. 14171 func (c *ProjectsLocationsProductSetsPatchCall) Do(opts ...googleapi.CallOption) (*ProductSet, error) { 14172 gensupport.SetOptions(c.urlParams_, opts...) 14173 res, err := c.doRequest("json") 14174 if res != nil && res.StatusCode == http.StatusNotModified { 14175 if res.Body != nil { 14176 res.Body.Close() 14177 } 14178 return nil, gensupport.WrapError(&googleapi.Error{ 14179 Code: res.StatusCode, 14180 Header: res.Header, 14181 }) 14182 } 14183 if err != nil { 14184 return nil, err 14185 } 14186 defer googleapi.CloseBody(res) 14187 if err := googleapi.CheckResponse(res); err != nil { 14188 return nil, gensupport.WrapError(err) 14189 } 14190 ret := &ProductSet{ 14191 ServerResponse: googleapi.ServerResponse{ 14192 Header: res.Header, 14193 HTTPStatusCode: res.StatusCode, 14194 }, 14195 } 14196 target := &ret 14197 if err := gensupport.DecodeResponse(target, res); err != nil { 14198 return nil, err 14199 } 14200 return ret, nil 14201 } 14202 14203 type ProjectsLocationsProductSetsRemoveProductCall struct { 14204 s *Service 14205 name string 14206 removeproductfromproductsetrequest *RemoveProductFromProductSetRequest 14207 urlParams_ gensupport.URLParams 14208 ctx_ context.Context 14209 header_ http.Header 14210 } 14211 14212 // RemoveProduct: Removes a Product from the specified ProductSet. 14213 // 14214 // - name: The resource name for the ProductSet to modify. Format is: 14215 // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. 14216 func (r *ProjectsLocationsProductSetsService) RemoveProduct(name string, removeproductfromproductsetrequest *RemoveProductFromProductSetRequest) *ProjectsLocationsProductSetsRemoveProductCall { 14217 c := &ProjectsLocationsProductSetsRemoveProductCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14218 c.name = name 14219 c.removeproductfromproductsetrequest = removeproductfromproductsetrequest 14220 return c 14221 } 14222 14223 // Fields allows partial responses to be retrieved. See 14224 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 14225 // details. 14226 func (c *ProjectsLocationsProductSetsRemoveProductCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductSetsRemoveProductCall { 14227 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14228 return c 14229 } 14230 14231 // Context sets the context to be used in this call's Do method. 14232 func (c *ProjectsLocationsProductSetsRemoveProductCall) Context(ctx context.Context) *ProjectsLocationsProductSetsRemoveProductCall { 14233 c.ctx_ = ctx 14234 return c 14235 } 14236 14237 // Header returns a http.Header that can be modified by the caller to add 14238 // headers to the request. 14239 func (c *ProjectsLocationsProductSetsRemoveProductCall) Header() http.Header { 14240 if c.header_ == nil { 14241 c.header_ = make(http.Header) 14242 } 14243 return c.header_ 14244 } 14245 14246 func (c *ProjectsLocationsProductSetsRemoveProductCall) doRequest(alt string) (*http.Response, error) { 14247 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 14248 var body io.Reader = nil 14249 body, err := googleapi.WithoutDataWrapper.JSONReader(c.removeproductfromproductsetrequest) 14250 if err != nil { 14251 return nil, err 14252 } 14253 c.urlParams_.Set("alt", alt) 14254 c.urlParams_.Set("prettyPrint", "false") 14255 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:removeProduct") 14256 urls += "?" + c.urlParams_.Encode() 14257 req, err := http.NewRequest("POST", urls, body) 14258 if err != nil { 14259 return nil, err 14260 } 14261 req.Header = reqHeaders 14262 googleapi.Expand(req.URL, map[string]string{ 14263 "name": c.name, 14264 }) 14265 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14266 } 14267 14268 // Do executes the "vision.projects.locations.productSets.removeProduct" call. 14269 // Any non-2xx status code is an error. Response headers are in either 14270 // *Empty.ServerResponse.Header or (if a response was returned at all) in 14271 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 14272 // whether the returned error was because http.StatusNotModified was returned. 14273 func (c *ProjectsLocationsProductSetsRemoveProductCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 14274 gensupport.SetOptions(c.urlParams_, opts...) 14275 res, err := c.doRequest("json") 14276 if res != nil && res.StatusCode == http.StatusNotModified { 14277 if res.Body != nil { 14278 res.Body.Close() 14279 } 14280 return nil, gensupport.WrapError(&googleapi.Error{ 14281 Code: res.StatusCode, 14282 Header: res.Header, 14283 }) 14284 } 14285 if err != nil { 14286 return nil, err 14287 } 14288 defer googleapi.CloseBody(res) 14289 if err := googleapi.CheckResponse(res); err != nil { 14290 return nil, gensupport.WrapError(err) 14291 } 14292 ret := &Empty{ 14293 ServerResponse: googleapi.ServerResponse{ 14294 Header: res.Header, 14295 HTTPStatusCode: res.StatusCode, 14296 }, 14297 } 14298 target := &ret 14299 if err := gensupport.DecodeResponse(target, res); err != nil { 14300 return nil, err 14301 } 14302 return ret, nil 14303 } 14304 14305 type ProjectsLocationsProductSetsProductsListCall struct { 14306 s *Service 14307 name string 14308 urlParams_ gensupport.URLParams 14309 ifNoneMatch_ string 14310 ctx_ context.Context 14311 header_ http.Header 14312 } 14313 14314 // List: Lists the Products in a ProductSet, in an unspecified order. If the 14315 // ProductSet does not exist, the products field of the response will be empty. 14316 // Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 14317 // or less than 1. 14318 // 14319 // - name: The ProductSet resource for which to retrieve Products. Format is: 14320 // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. 14321 func (r *ProjectsLocationsProductSetsProductsService) List(name string) *ProjectsLocationsProductSetsProductsListCall { 14322 c := &ProjectsLocationsProductSetsProductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14323 c.name = name 14324 return c 14325 } 14326 14327 // PageSize sets the optional parameter "pageSize": The maximum number of items 14328 // to return. Default 10, maximum 100. 14329 func (c *ProjectsLocationsProductSetsProductsListCall) PageSize(pageSize int64) *ProjectsLocationsProductSetsProductsListCall { 14330 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 14331 return c 14332 } 14333 14334 // PageToken sets the optional parameter "pageToken": The next_page_token 14335 // returned from a previous List request, if any. 14336 func (c *ProjectsLocationsProductSetsProductsListCall) PageToken(pageToken string) *ProjectsLocationsProductSetsProductsListCall { 14337 c.urlParams_.Set("pageToken", pageToken) 14338 return c 14339 } 14340 14341 // Fields allows partial responses to be retrieved. See 14342 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 14343 // details. 14344 func (c *ProjectsLocationsProductSetsProductsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductSetsProductsListCall { 14345 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14346 return c 14347 } 14348 14349 // IfNoneMatch sets an optional parameter which makes the operation fail if the 14350 // object's ETag matches the given value. This is useful for getting updates 14351 // only after the object has changed since the last request. 14352 func (c *ProjectsLocationsProductSetsProductsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsProductSetsProductsListCall { 14353 c.ifNoneMatch_ = entityTag 14354 return c 14355 } 14356 14357 // Context sets the context to be used in this call's Do method. 14358 func (c *ProjectsLocationsProductSetsProductsListCall) Context(ctx context.Context) *ProjectsLocationsProductSetsProductsListCall { 14359 c.ctx_ = ctx 14360 return c 14361 } 14362 14363 // Header returns a http.Header that can be modified by the caller to add 14364 // headers to the request. 14365 func (c *ProjectsLocationsProductSetsProductsListCall) Header() http.Header { 14366 if c.header_ == nil { 14367 c.header_ = make(http.Header) 14368 } 14369 return c.header_ 14370 } 14371 14372 func (c *ProjectsLocationsProductSetsProductsListCall) doRequest(alt string) (*http.Response, error) { 14373 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 14374 if c.ifNoneMatch_ != "" { 14375 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14376 } 14377 var body io.Reader = nil 14378 c.urlParams_.Set("alt", alt) 14379 c.urlParams_.Set("prettyPrint", "false") 14380 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/products") 14381 urls += "?" + c.urlParams_.Encode() 14382 req, err := http.NewRequest("GET", urls, body) 14383 if err != nil { 14384 return nil, err 14385 } 14386 req.Header = reqHeaders 14387 googleapi.Expand(req.URL, map[string]string{ 14388 "name": c.name, 14389 }) 14390 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14391 } 14392 14393 // Do executes the "vision.projects.locations.productSets.products.list" call. 14394 // Any non-2xx status code is an error. Response headers are in either 14395 // *ListProductsInProductSetResponse.ServerResponse.Header or (if a response 14396 // was returned at all) in error.(*googleapi.Error).Header. Use 14397 // googleapi.IsNotModified to check whether the returned error was because 14398 // http.StatusNotModified was returned. 14399 func (c *ProjectsLocationsProductSetsProductsListCall) Do(opts ...googleapi.CallOption) (*ListProductsInProductSetResponse, error) { 14400 gensupport.SetOptions(c.urlParams_, opts...) 14401 res, err := c.doRequest("json") 14402 if res != nil && res.StatusCode == http.StatusNotModified { 14403 if res.Body != nil { 14404 res.Body.Close() 14405 } 14406 return nil, gensupport.WrapError(&googleapi.Error{ 14407 Code: res.StatusCode, 14408 Header: res.Header, 14409 }) 14410 } 14411 if err != nil { 14412 return nil, err 14413 } 14414 defer googleapi.CloseBody(res) 14415 if err := googleapi.CheckResponse(res); err != nil { 14416 return nil, gensupport.WrapError(err) 14417 } 14418 ret := &ListProductsInProductSetResponse{ 14419 ServerResponse: googleapi.ServerResponse{ 14420 Header: res.Header, 14421 HTTPStatusCode: res.StatusCode, 14422 }, 14423 } 14424 target := &ret 14425 if err := gensupport.DecodeResponse(target, res); err != nil { 14426 return nil, err 14427 } 14428 return ret, nil 14429 } 14430 14431 // Pages invokes f for each page of results. 14432 // A non-nil error returned from f will halt the iteration. 14433 // The provided context supersedes any context provided to the Context method. 14434 func (c *ProjectsLocationsProductSetsProductsListCall) Pages(ctx context.Context, f func(*ListProductsInProductSetResponse) error) error { 14435 c.ctx_ = ctx 14436 defer c.PageToken(c.urlParams_.Get("pageToken")) 14437 for { 14438 x, err := c.Do() 14439 if err != nil { 14440 return err 14441 } 14442 if err := f(x); err != nil { 14443 return err 14444 } 14445 if x.NextPageToken == "" { 14446 return nil 14447 } 14448 c.PageToken(x.NextPageToken) 14449 } 14450 } 14451 14452 type ProjectsLocationsProductsCreateCall struct { 14453 s *Service 14454 parent string 14455 product *Product 14456 urlParams_ gensupport.URLParams 14457 ctx_ context.Context 14458 header_ http.Header 14459 } 14460 14461 // Create: Creates and returns a new product resource. Possible errors: * 14462 // Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 14463 // characters. * Returns INVALID_ARGUMENT if description is longer than 4096 14464 // characters. * Returns INVALID_ARGUMENT if product_category is missing or 14465 // invalid. 14466 // 14467 // - parent: The project in which the Product should be created. Format is 14468 // `projects/PROJECT_ID/locations/LOC_ID`. 14469 func (r *ProjectsLocationsProductsService) Create(parent string, product *Product) *ProjectsLocationsProductsCreateCall { 14470 c := &ProjectsLocationsProductsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14471 c.parent = parent 14472 c.product = product 14473 return c 14474 } 14475 14476 // ProductId sets the optional parameter "productId": A user-supplied resource 14477 // id for this Product. If set, the server will attempt to use this value as 14478 // the resource id. If it is already in use, an error is returned with code 14479 // ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the 14480 // character `/`. 14481 func (c *ProjectsLocationsProductsCreateCall) ProductId(productId string) *ProjectsLocationsProductsCreateCall { 14482 c.urlParams_.Set("productId", productId) 14483 return c 14484 } 14485 14486 // Fields allows partial responses to be retrieved. See 14487 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 14488 // details. 14489 func (c *ProjectsLocationsProductsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductsCreateCall { 14490 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14491 return c 14492 } 14493 14494 // Context sets the context to be used in this call's Do method. 14495 func (c *ProjectsLocationsProductsCreateCall) Context(ctx context.Context) *ProjectsLocationsProductsCreateCall { 14496 c.ctx_ = ctx 14497 return c 14498 } 14499 14500 // Header returns a http.Header that can be modified by the caller to add 14501 // headers to the request. 14502 func (c *ProjectsLocationsProductsCreateCall) Header() http.Header { 14503 if c.header_ == nil { 14504 c.header_ = make(http.Header) 14505 } 14506 return c.header_ 14507 } 14508 14509 func (c *ProjectsLocationsProductsCreateCall) doRequest(alt string) (*http.Response, error) { 14510 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 14511 var body io.Reader = nil 14512 body, err := googleapi.WithoutDataWrapper.JSONReader(c.product) 14513 if err != nil { 14514 return nil, err 14515 } 14516 c.urlParams_.Set("alt", alt) 14517 c.urlParams_.Set("prettyPrint", "false") 14518 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/products") 14519 urls += "?" + c.urlParams_.Encode() 14520 req, err := http.NewRequest("POST", urls, body) 14521 if err != nil { 14522 return nil, err 14523 } 14524 req.Header = reqHeaders 14525 googleapi.Expand(req.URL, map[string]string{ 14526 "parent": c.parent, 14527 }) 14528 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14529 } 14530 14531 // Do executes the "vision.projects.locations.products.create" call. 14532 // Any non-2xx status code is an error. Response headers are in either 14533 // *Product.ServerResponse.Header or (if a response was returned at all) in 14534 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 14535 // whether the returned error was because http.StatusNotModified was returned. 14536 func (c *ProjectsLocationsProductsCreateCall) Do(opts ...googleapi.CallOption) (*Product, error) { 14537 gensupport.SetOptions(c.urlParams_, opts...) 14538 res, err := c.doRequest("json") 14539 if res != nil && res.StatusCode == http.StatusNotModified { 14540 if res.Body != nil { 14541 res.Body.Close() 14542 } 14543 return nil, gensupport.WrapError(&googleapi.Error{ 14544 Code: res.StatusCode, 14545 Header: res.Header, 14546 }) 14547 } 14548 if err != nil { 14549 return nil, err 14550 } 14551 defer googleapi.CloseBody(res) 14552 if err := googleapi.CheckResponse(res); err != nil { 14553 return nil, gensupport.WrapError(err) 14554 } 14555 ret := &Product{ 14556 ServerResponse: googleapi.ServerResponse{ 14557 Header: res.Header, 14558 HTTPStatusCode: res.StatusCode, 14559 }, 14560 } 14561 target := &ret 14562 if err := gensupport.DecodeResponse(target, res); err != nil { 14563 return nil, err 14564 } 14565 return ret, nil 14566 } 14567 14568 type ProjectsLocationsProductsDeleteCall struct { 14569 s *Service 14570 name string 14571 urlParams_ gensupport.URLParams 14572 ctx_ context.Context 14573 header_ http.Header 14574 } 14575 14576 // Delete: Permanently deletes a product and its reference images. Metadata of 14577 // the product and all its images will be deleted right away, but search 14578 // queries against ProductSets containing the product may still work until all 14579 // related caches are refreshed. 14580 // 14581 // - name: Resource name of product to delete. Format is: 14582 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. 14583 func (r *ProjectsLocationsProductsService) Delete(name string) *ProjectsLocationsProductsDeleteCall { 14584 c := &ProjectsLocationsProductsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14585 c.name = name 14586 return c 14587 } 14588 14589 // Fields allows partial responses to be retrieved. See 14590 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 14591 // details. 14592 func (c *ProjectsLocationsProductsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductsDeleteCall { 14593 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14594 return c 14595 } 14596 14597 // Context sets the context to be used in this call's Do method. 14598 func (c *ProjectsLocationsProductsDeleteCall) Context(ctx context.Context) *ProjectsLocationsProductsDeleteCall { 14599 c.ctx_ = ctx 14600 return c 14601 } 14602 14603 // Header returns a http.Header that can be modified by the caller to add 14604 // headers to the request. 14605 func (c *ProjectsLocationsProductsDeleteCall) Header() http.Header { 14606 if c.header_ == nil { 14607 c.header_ = make(http.Header) 14608 } 14609 return c.header_ 14610 } 14611 14612 func (c *ProjectsLocationsProductsDeleteCall) doRequest(alt string) (*http.Response, error) { 14613 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 14614 var body io.Reader = nil 14615 c.urlParams_.Set("alt", alt) 14616 c.urlParams_.Set("prettyPrint", "false") 14617 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 14618 urls += "?" + c.urlParams_.Encode() 14619 req, err := http.NewRequest("DELETE", urls, body) 14620 if err != nil { 14621 return nil, err 14622 } 14623 req.Header = reqHeaders 14624 googleapi.Expand(req.URL, map[string]string{ 14625 "name": c.name, 14626 }) 14627 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14628 } 14629 14630 // Do executes the "vision.projects.locations.products.delete" call. 14631 // Any non-2xx status code is an error. Response headers are in either 14632 // *Empty.ServerResponse.Header or (if a response was returned at all) in 14633 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 14634 // whether the returned error was because http.StatusNotModified was returned. 14635 func (c *ProjectsLocationsProductsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 14636 gensupport.SetOptions(c.urlParams_, opts...) 14637 res, err := c.doRequest("json") 14638 if res != nil && res.StatusCode == http.StatusNotModified { 14639 if res.Body != nil { 14640 res.Body.Close() 14641 } 14642 return nil, gensupport.WrapError(&googleapi.Error{ 14643 Code: res.StatusCode, 14644 Header: res.Header, 14645 }) 14646 } 14647 if err != nil { 14648 return nil, err 14649 } 14650 defer googleapi.CloseBody(res) 14651 if err := googleapi.CheckResponse(res); err != nil { 14652 return nil, gensupport.WrapError(err) 14653 } 14654 ret := &Empty{ 14655 ServerResponse: googleapi.ServerResponse{ 14656 Header: res.Header, 14657 HTTPStatusCode: res.StatusCode, 14658 }, 14659 } 14660 target := &ret 14661 if err := gensupport.DecodeResponse(target, res); err != nil { 14662 return nil, err 14663 } 14664 return ret, nil 14665 } 14666 14667 type ProjectsLocationsProductsGetCall struct { 14668 s *Service 14669 name string 14670 urlParams_ gensupport.URLParams 14671 ifNoneMatch_ string 14672 ctx_ context.Context 14673 header_ http.Header 14674 } 14675 14676 // Get: Gets information associated with a Product. Possible errors: * Returns 14677 // NOT_FOUND if the Product does not exist. 14678 // 14679 // - name: Resource name of the Product to get. Format is: 14680 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. 14681 func (r *ProjectsLocationsProductsService) Get(name string) *ProjectsLocationsProductsGetCall { 14682 c := &ProjectsLocationsProductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14683 c.name = name 14684 return c 14685 } 14686 14687 // Fields allows partial responses to be retrieved. See 14688 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 14689 // details. 14690 func (c *ProjectsLocationsProductsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductsGetCall { 14691 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14692 return c 14693 } 14694 14695 // IfNoneMatch sets an optional parameter which makes the operation fail if the 14696 // object's ETag matches the given value. This is useful for getting updates 14697 // only after the object has changed since the last request. 14698 func (c *ProjectsLocationsProductsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsProductsGetCall { 14699 c.ifNoneMatch_ = entityTag 14700 return c 14701 } 14702 14703 // Context sets the context to be used in this call's Do method. 14704 func (c *ProjectsLocationsProductsGetCall) Context(ctx context.Context) *ProjectsLocationsProductsGetCall { 14705 c.ctx_ = ctx 14706 return c 14707 } 14708 14709 // Header returns a http.Header that can be modified by the caller to add 14710 // headers to the request. 14711 func (c *ProjectsLocationsProductsGetCall) Header() http.Header { 14712 if c.header_ == nil { 14713 c.header_ = make(http.Header) 14714 } 14715 return c.header_ 14716 } 14717 14718 func (c *ProjectsLocationsProductsGetCall) doRequest(alt string) (*http.Response, error) { 14719 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 14720 if c.ifNoneMatch_ != "" { 14721 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14722 } 14723 var body io.Reader = nil 14724 c.urlParams_.Set("alt", alt) 14725 c.urlParams_.Set("prettyPrint", "false") 14726 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 14727 urls += "?" + c.urlParams_.Encode() 14728 req, err := http.NewRequest("GET", urls, body) 14729 if err != nil { 14730 return nil, err 14731 } 14732 req.Header = reqHeaders 14733 googleapi.Expand(req.URL, map[string]string{ 14734 "name": c.name, 14735 }) 14736 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14737 } 14738 14739 // Do executes the "vision.projects.locations.products.get" call. 14740 // Any non-2xx status code is an error. Response headers are in either 14741 // *Product.ServerResponse.Header or (if a response was returned at all) in 14742 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 14743 // whether the returned error was because http.StatusNotModified was returned. 14744 func (c *ProjectsLocationsProductsGetCall) Do(opts ...googleapi.CallOption) (*Product, error) { 14745 gensupport.SetOptions(c.urlParams_, opts...) 14746 res, err := c.doRequest("json") 14747 if res != nil && res.StatusCode == http.StatusNotModified { 14748 if res.Body != nil { 14749 res.Body.Close() 14750 } 14751 return nil, gensupport.WrapError(&googleapi.Error{ 14752 Code: res.StatusCode, 14753 Header: res.Header, 14754 }) 14755 } 14756 if err != nil { 14757 return nil, err 14758 } 14759 defer googleapi.CloseBody(res) 14760 if err := googleapi.CheckResponse(res); err != nil { 14761 return nil, gensupport.WrapError(err) 14762 } 14763 ret := &Product{ 14764 ServerResponse: googleapi.ServerResponse{ 14765 Header: res.Header, 14766 HTTPStatusCode: res.StatusCode, 14767 }, 14768 } 14769 target := &ret 14770 if err := gensupport.DecodeResponse(target, res); err != nil { 14771 return nil, err 14772 } 14773 return ret, nil 14774 } 14775 14776 type ProjectsLocationsProductsListCall struct { 14777 s *Service 14778 parent string 14779 urlParams_ gensupport.URLParams 14780 ifNoneMatch_ string 14781 ctx_ context.Context 14782 header_ http.Header 14783 } 14784 14785 // List: Lists products in an unspecified order. Possible errors: * Returns 14786 // INVALID_ARGUMENT if page_size is greater than 100 or less than 1. 14787 // 14788 // - parent: The project OR ProductSet from which Products should be listed. 14789 // Format: `projects/PROJECT_ID/locations/LOC_ID`. 14790 func (r *ProjectsLocationsProductsService) List(parent string) *ProjectsLocationsProductsListCall { 14791 c := &ProjectsLocationsProductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14792 c.parent = parent 14793 return c 14794 } 14795 14796 // PageSize sets the optional parameter "pageSize": The maximum number of items 14797 // to return. Default 10, maximum 100. 14798 func (c *ProjectsLocationsProductsListCall) PageSize(pageSize int64) *ProjectsLocationsProductsListCall { 14799 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 14800 return c 14801 } 14802 14803 // PageToken sets the optional parameter "pageToken": The next_page_token 14804 // returned from a previous List request, if any. 14805 func (c *ProjectsLocationsProductsListCall) PageToken(pageToken string) *ProjectsLocationsProductsListCall { 14806 c.urlParams_.Set("pageToken", pageToken) 14807 return c 14808 } 14809 14810 // Fields allows partial responses to be retrieved. See 14811 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 14812 // details. 14813 func (c *ProjectsLocationsProductsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductsListCall { 14814 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14815 return c 14816 } 14817 14818 // IfNoneMatch sets an optional parameter which makes the operation fail if the 14819 // object's ETag matches the given value. This is useful for getting updates 14820 // only after the object has changed since the last request. 14821 func (c *ProjectsLocationsProductsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsProductsListCall { 14822 c.ifNoneMatch_ = entityTag 14823 return c 14824 } 14825 14826 // Context sets the context to be used in this call's Do method. 14827 func (c *ProjectsLocationsProductsListCall) Context(ctx context.Context) *ProjectsLocationsProductsListCall { 14828 c.ctx_ = ctx 14829 return c 14830 } 14831 14832 // Header returns a http.Header that can be modified by the caller to add 14833 // headers to the request. 14834 func (c *ProjectsLocationsProductsListCall) Header() http.Header { 14835 if c.header_ == nil { 14836 c.header_ = make(http.Header) 14837 } 14838 return c.header_ 14839 } 14840 14841 func (c *ProjectsLocationsProductsListCall) doRequest(alt string) (*http.Response, error) { 14842 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 14843 if c.ifNoneMatch_ != "" { 14844 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14845 } 14846 var body io.Reader = nil 14847 c.urlParams_.Set("alt", alt) 14848 c.urlParams_.Set("prettyPrint", "false") 14849 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/products") 14850 urls += "?" + c.urlParams_.Encode() 14851 req, err := http.NewRequest("GET", urls, body) 14852 if err != nil { 14853 return nil, err 14854 } 14855 req.Header = reqHeaders 14856 googleapi.Expand(req.URL, map[string]string{ 14857 "parent": c.parent, 14858 }) 14859 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14860 } 14861 14862 // Do executes the "vision.projects.locations.products.list" call. 14863 // Any non-2xx status code is an error. Response headers are in either 14864 // *ListProductsResponse.ServerResponse.Header or (if a response was returned 14865 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 14866 // check whether the returned error was because http.StatusNotModified was 14867 // returned. 14868 func (c *ProjectsLocationsProductsListCall) Do(opts ...googleapi.CallOption) (*ListProductsResponse, error) { 14869 gensupport.SetOptions(c.urlParams_, opts...) 14870 res, err := c.doRequest("json") 14871 if res != nil && res.StatusCode == http.StatusNotModified { 14872 if res.Body != nil { 14873 res.Body.Close() 14874 } 14875 return nil, gensupport.WrapError(&googleapi.Error{ 14876 Code: res.StatusCode, 14877 Header: res.Header, 14878 }) 14879 } 14880 if err != nil { 14881 return nil, err 14882 } 14883 defer googleapi.CloseBody(res) 14884 if err := googleapi.CheckResponse(res); err != nil { 14885 return nil, gensupport.WrapError(err) 14886 } 14887 ret := &ListProductsResponse{ 14888 ServerResponse: googleapi.ServerResponse{ 14889 Header: res.Header, 14890 HTTPStatusCode: res.StatusCode, 14891 }, 14892 } 14893 target := &ret 14894 if err := gensupport.DecodeResponse(target, res); err != nil { 14895 return nil, err 14896 } 14897 return ret, nil 14898 } 14899 14900 // Pages invokes f for each page of results. 14901 // A non-nil error returned from f will halt the iteration. 14902 // The provided context supersedes any context provided to the Context method. 14903 func (c *ProjectsLocationsProductsListCall) Pages(ctx context.Context, f func(*ListProductsResponse) error) error { 14904 c.ctx_ = ctx 14905 defer c.PageToken(c.urlParams_.Get("pageToken")) 14906 for { 14907 x, err := c.Do() 14908 if err != nil { 14909 return err 14910 } 14911 if err := f(x); err != nil { 14912 return err 14913 } 14914 if x.NextPageToken == "" { 14915 return nil 14916 } 14917 c.PageToken(x.NextPageToken) 14918 } 14919 } 14920 14921 type ProjectsLocationsProductsPatchCall struct { 14922 s *Service 14923 name string 14924 product *Product 14925 urlParams_ gensupport.URLParams 14926 ctx_ context.Context 14927 header_ http.Header 14928 } 14929 14930 // Patch: Makes changes to a Product resource. Only the `display_name`, 14931 // `description`, and `labels` fields can be updated right now. If labels are 14932 // updated, the change will not be reflected in queries until the next index 14933 // time. Possible errors: * Returns NOT_FOUND if the Product does not exist. * 14934 // Returns INVALID_ARGUMENT if display_name is present in update_mask but is 14935 // missing from the request or longer than 4096 characters. * Returns 14936 // INVALID_ARGUMENT if description is present in update_mask but is longer than 14937 // 4096 characters. * Returns INVALID_ARGUMENT if product_category is present 14938 // in update_mask. 14939 // 14940 // - name: The resource name of the product. Format is: 14941 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This field is 14942 // ignored when creating a product. 14943 func (r *ProjectsLocationsProductsService) Patch(name string, product *Product) *ProjectsLocationsProductsPatchCall { 14944 c := &ProjectsLocationsProductsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14945 c.name = name 14946 c.product = product 14947 return c 14948 } 14949 14950 // UpdateMask sets the optional parameter "updateMask": The FieldMask that 14951 // specifies which fields to update. If update_mask isn't specified, all 14952 // mutable fields are to be updated. Valid mask paths include `product_labels`, 14953 // `display_name`, and `description`. 14954 func (c *ProjectsLocationsProductsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsProductsPatchCall { 14955 c.urlParams_.Set("updateMask", updateMask) 14956 return c 14957 } 14958 14959 // Fields allows partial responses to be retrieved. See 14960 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 14961 // details. 14962 func (c *ProjectsLocationsProductsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductsPatchCall { 14963 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14964 return c 14965 } 14966 14967 // Context sets the context to be used in this call's Do method. 14968 func (c *ProjectsLocationsProductsPatchCall) Context(ctx context.Context) *ProjectsLocationsProductsPatchCall { 14969 c.ctx_ = ctx 14970 return c 14971 } 14972 14973 // Header returns a http.Header that can be modified by the caller to add 14974 // headers to the request. 14975 func (c *ProjectsLocationsProductsPatchCall) Header() http.Header { 14976 if c.header_ == nil { 14977 c.header_ = make(http.Header) 14978 } 14979 return c.header_ 14980 } 14981 14982 func (c *ProjectsLocationsProductsPatchCall) doRequest(alt string) (*http.Response, error) { 14983 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 14984 var body io.Reader = nil 14985 body, err := googleapi.WithoutDataWrapper.JSONReader(c.product) 14986 if err != nil { 14987 return nil, err 14988 } 14989 c.urlParams_.Set("alt", alt) 14990 c.urlParams_.Set("prettyPrint", "false") 14991 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 14992 urls += "?" + c.urlParams_.Encode() 14993 req, err := http.NewRequest("PATCH", urls, body) 14994 if err != nil { 14995 return nil, err 14996 } 14997 req.Header = reqHeaders 14998 googleapi.Expand(req.URL, map[string]string{ 14999 "name": c.name, 15000 }) 15001 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15002 } 15003 15004 // Do executes the "vision.projects.locations.products.patch" call. 15005 // Any non-2xx status code is an error. Response headers are in either 15006 // *Product.ServerResponse.Header or (if a response was returned at all) in 15007 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 15008 // whether the returned error was because http.StatusNotModified was returned. 15009 func (c *ProjectsLocationsProductsPatchCall) Do(opts ...googleapi.CallOption) (*Product, error) { 15010 gensupport.SetOptions(c.urlParams_, opts...) 15011 res, err := c.doRequest("json") 15012 if res != nil && res.StatusCode == http.StatusNotModified { 15013 if res.Body != nil { 15014 res.Body.Close() 15015 } 15016 return nil, gensupport.WrapError(&googleapi.Error{ 15017 Code: res.StatusCode, 15018 Header: res.Header, 15019 }) 15020 } 15021 if err != nil { 15022 return nil, err 15023 } 15024 defer googleapi.CloseBody(res) 15025 if err := googleapi.CheckResponse(res); err != nil { 15026 return nil, gensupport.WrapError(err) 15027 } 15028 ret := &Product{ 15029 ServerResponse: googleapi.ServerResponse{ 15030 Header: res.Header, 15031 HTTPStatusCode: res.StatusCode, 15032 }, 15033 } 15034 target := &ret 15035 if err := gensupport.DecodeResponse(target, res); err != nil { 15036 return nil, err 15037 } 15038 return ret, nil 15039 } 15040 15041 type ProjectsLocationsProductsPurgeCall struct { 15042 s *Service 15043 parent string 15044 purgeproductsrequest *PurgeProductsRequest 15045 urlParams_ gensupport.URLParams 15046 ctx_ context.Context 15047 header_ http.Header 15048 } 15049 15050 // Purge: Asynchronous API to delete all Products in a ProductSet or all 15051 // Products that are in no ProductSet. If a Product is a member of the 15052 // specified ProductSet in addition to other ProductSets, the Product will 15053 // still be deleted. It is recommended to not delete the specified ProductSet 15054 // until after this operation has completed. It is also recommended to not add 15055 // any of the Products involved in the batch delete to a new ProductSet while 15056 // this operation is running because those Products may still end up deleted. 15057 // It's not possible to undo the PurgeProducts operation. Therefore, it is 15058 // recommended to keep the csv files used in ImportProductSets (if that was how 15059 // you originally built the Product Set) before starting PurgeProducts, in case 15060 // you need to re-import the data after deletion. If the plan is to purge all 15061 // of the Products from a ProductSet and then re-use the empty ProductSet to 15062 // re-import new Products into the empty ProductSet, you must wait until the 15063 // PurgeProducts operation has finished for that ProductSet. The 15064 // google.longrunning.Operation API can be used to keep track of the progress 15065 // and results of the request. `Operation.metadata` contains 15066 // `BatchOperationMetadata`. (progress) 15067 // 15068 // - parent: The project and location in which the Products should be deleted. 15069 // Format is `projects/PROJECT_ID/locations/LOC_ID`. 15070 func (r *ProjectsLocationsProductsService) Purge(parent string, purgeproductsrequest *PurgeProductsRequest) *ProjectsLocationsProductsPurgeCall { 15071 c := &ProjectsLocationsProductsPurgeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15072 c.parent = parent 15073 c.purgeproductsrequest = purgeproductsrequest 15074 return c 15075 } 15076 15077 // Fields allows partial responses to be retrieved. See 15078 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 15079 // details. 15080 func (c *ProjectsLocationsProductsPurgeCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductsPurgeCall { 15081 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15082 return c 15083 } 15084 15085 // Context sets the context to be used in this call's Do method. 15086 func (c *ProjectsLocationsProductsPurgeCall) Context(ctx context.Context) *ProjectsLocationsProductsPurgeCall { 15087 c.ctx_ = ctx 15088 return c 15089 } 15090 15091 // Header returns a http.Header that can be modified by the caller to add 15092 // headers to the request. 15093 func (c *ProjectsLocationsProductsPurgeCall) Header() http.Header { 15094 if c.header_ == nil { 15095 c.header_ = make(http.Header) 15096 } 15097 return c.header_ 15098 } 15099 15100 func (c *ProjectsLocationsProductsPurgeCall) doRequest(alt string) (*http.Response, error) { 15101 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 15102 var body io.Reader = nil 15103 body, err := googleapi.WithoutDataWrapper.JSONReader(c.purgeproductsrequest) 15104 if err != nil { 15105 return nil, err 15106 } 15107 c.urlParams_.Set("alt", alt) 15108 c.urlParams_.Set("prettyPrint", "false") 15109 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/products:purge") 15110 urls += "?" + c.urlParams_.Encode() 15111 req, err := http.NewRequest("POST", urls, body) 15112 if err != nil { 15113 return nil, err 15114 } 15115 req.Header = reqHeaders 15116 googleapi.Expand(req.URL, map[string]string{ 15117 "parent": c.parent, 15118 }) 15119 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15120 } 15121 15122 // Do executes the "vision.projects.locations.products.purge" call. 15123 // Any non-2xx status code is an error. Response headers are in either 15124 // *Operation.ServerResponse.Header or (if a response was returned at all) in 15125 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 15126 // whether the returned error was because http.StatusNotModified was returned. 15127 func (c *ProjectsLocationsProductsPurgeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 15128 gensupport.SetOptions(c.urlParams_, opts...) 15129 res, err := c.doRequest("json") 15130 if res != nil && res.StatusCode == http.StatusNotModified { 15131 if res.Body != nil { 15132 res.Body.Close() 15133 } 15134 return nil, gensupport.WrapError(&googleapi.Error{ 15135 Code: res.StatusCode, 15136 Header: res.Header, 15137 }) 15138 } 15139 if err != nil { 15140 return nil, err 15141 } 15142 defer googleapi.CloseBody(res) 15143 if err := googleapi.CheckResponse(res); err != nil { 15144 return nil, gensupport.WrapError(err) 15145 } 15146 ret := &Operation{ 15147 ServerResponse: googleapi.ServerResponse{ 15148 Header: res.Header, 15149 HTTPStatusCode: res.StatusCode, 15150 }, 15151 } 15152 target := &ret 15153 if err := gensupport.DecodeResponse(target, res); err != nil { 15154 return nil, err 15155 } 15156 return ret, nil 15157 } 15158 15159 type ProjectsLocationsProductsReferenceImagesCreateCall struct { 15160 s *Service 15161 parent string 15162 referenceimage *ReferenceImage 15163 urlParams_ gensupport.URLParams 15164 ctx_ context.Context 15165 header_ http.Header 15166 } 15167 15168 // Create: Creates and returns a new ReferenceImage resource. The 15169 // `bounding_poly` field is optional. If `bounding_poly` is not specified, the 15170 // system will try to detect regions of interest in the image that are 15171 // compatible with the product_category on the parent product. If it is 15172 // specified, detection is ALWAYS skipped. The system converts polygons into 15173 // non-rotated rectangles. Note that the pipeline will resize the image if the 15174 // image resolution is too large to process (above 50MP). Possible errors: * 15175 // Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 15176 // characters. * Returns INVALID_ARGUMENT if the product does not exist. * 15177 // Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing 15178 // compatible with the parent product's product_category is detected. * Returns 15179 // INVALID_ARGUMENT if bounding_poly contains more than 10 polygons. 15180 // 15181 // - parent: Resource name of the product in which to create the reference 15182 // image. Format is 15183 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. 15184 func (r *ProjectsLocationsProductsReferenceImagesService) Create(parent string, referenceimage *ReferenceImage) *ProjectsLocationsProductsReferenceImagesCreateCall { 15185 c := &ProjectsLocationsProductsReferenceImagesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15186 c.parent = parent 15187 c.referenceimage = referenceimage 15188 return c 15189 } 15190 15191 // ReferenceImageId sets the optional parameter "referenceImageId": A 15192 // user-supplied resource id for the ReferenceImage to be added. If set, the 15193 // server will attempt to use this value as the resource id. If it is already 15194 // in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 15195 // characters long. It cannot contain the character `/`. 15196 func (c *ProjectsLocationsProductsReferenceImagesCreateCall) ReferenceImageId(referenceImageId string) *ProjectsLocationsProductsReferenceImagesCreateCall { 15197 c.urlParams_.Set("referenceImageId", referenceImageId) 15198 return c 15199 } 15200 15201 // Fields allows partial responses to be retrieved. See 15202 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 15203 // details. 15204 func (c *ProjectsLocationsProductsReferenceImagesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductsReferenceImagesCreateCall { 15205 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15206 return c 15207 } 15208 15209 // Context sets the context to be used in this call's Do method. 15210 func (c *ProjectsLocationsProductsReferenceImagesCreateCall) Context(ctx context.Context) *ProjectsLocationsProductsReferenceImagesCreateCall { 15211 c.ctx_ = ctx 15212 return c 15213 } 15214 15215 // Header returns a http.Header that can be modified by the caller to add 15216 // headers to the request. 15217 func (c *ProjectsLocationsProductsReferenceImagesCreateCall) Header() http.Header { 15218 if c.header_ == nil { 15219 c.header_ = make(http.Header) 15220 } 15221 return c.header_ 15222 } 15223 15224 func (c *ProjectsLocationsProductsReferenceImagesCreateCall) doRequest(alt string) (*http.Response, error) { 15225 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 15226 var body io.Reader = nil 15227 body, err := googleapi.WithoutDataWrapper.JSONReader(c.referenceimage) 15228 if err != nil { 15229 return nil, err 15230 } 15231 c.urlParams_.Set("alt", alt) 15232 c.urlParams_.Set("prettyPrint", "false") 15233 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/referenceImages") 15234 urls += "?" + c.urlParams_.Encode() 15235 req, err := http.NewRequest("POST", urls, body) 15236 if err != nil { 15237 return nil, err 15238 } 15239 req.Header = reqHeaders 15240 googleapi.Expand(req.URL, map[string]string{ 15241 "parent": c.parent, 15242 }) 15243 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15244 } 15245 15246 // Do executes the "vision.projects.locations.products.referenceImages.create" call. 15247 // Any non-2xx status code is an error. Response headers are in either 15248 // *ReferenceImage.ServerResponse.Header or (if a response was returned at all) 15249 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 15250 // whether the returned error was because http.StatusNotModified was returned. 15251 func (c *ProjectsLocationsProductsReferenceImagesCreateCall) Do(opts ...googleapi.CallOption) (*ReferenceImage, error) { 15252 gensupport.SetOptions(c.urlParams_, opts...) 15253 res, err := c.doRequest("json") 15254 if res != nil && res.StatusCode == http.StatusNotModified { 15255 if res.Body != nil { 15256 res.Body.Close() 15257 } 15258 return nil, gensupport.WrapError(&googleapi.Error{ 15259 Code: res.StatusCode, 15260 Header: res.Header, 15261 }) 15262 } 15263 if err != nil { 15264 return nil, err 15265 } 15266 defer googleapi.CloseBody(res) 15267 if err := googleapi.CheckResponse(res); err != nil { 15268 return nil, gensupport.WrapError(err) 15269 } 15270 ret := &ReferenceImage{ 15271 ServerResponse: googleapi.ServerResponse{ 15272 Header: res.Header, 15273 HTTPStatusCode: res.StatusCode, 15274 }, 15275 } 15276 target := &ret 15277 if err := gensupport.DecodeResponse(target, res); err != nil { 15278 return nil, err 15279 } 15280 return ret, nil 15281 } 15282 15283 type ProjectsLocationsProductsReferenceImagesDeleteCall struct { 15284 s *Service 15285 name string 15286 urlParams_ gensupport.URLParams 15287 ctx_ context.Context 15288 header_ http.Header 15289 } 15290 15291 // Delete: Permanently deletes a reference image. The image metadata will be 15292 // deleted right away, but search queries against ProductSets containing the 15293 // image may still work until all related caches are refreshed. The actual 15294 // image files are not deleted from Google Cloud Storage. 15295 // 15296 // - name: The resource name of the reference image to delete. Format is: 15297 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/I 15298 // MAGE_ID`. 15299 func (r *ProjectsLocationsProductsReferenceImagesService) Delete(name string) *ProjectsLocationsProductsReferenceImagesDeleteCall { 15300 c := &ProjectsLocationsProductsReferenceImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15301 c.name = name 15302 return c 15303 } 15304 15305 // Fields allows partial responses to be retrieved. See 15306 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 15307 // details. 15308 func (c *ProjectsLocationsProductsReferenceImagesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductsReferenceImagesDeleteCall { 15309 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15310 return c 15311 } 15312 15313 // Context sets the context to be used in this call's Do method. 15314 func (c *ProjectsLocationsProductsReferenceImagesDeleteCall) Context(ctx context.Context) *ProjectsLocationsProductsReferenceImagesDeleteCall { 15315 c.ctx_ = ctx 15316 return c 15317 } 15318 15319 // Header returns a http.Header that can be modified by the caller to add 15320 // headers to the request. 15321 func (c *ProjectsLocationsProductsReferenceImagesDeleteCall) Header() http.Header { 15322 if c.header_ == nil { 15323 c.header_ = make(http.Header) 15324 } 15325 return c.header_ 15326 } 15327 15328 func (c *ProjectsLocationsProductsReferenceImagesDeleteCall) doRequest(alt string) (*http.Response, error) { 15329 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 15330 var body io.Reader = nil 15331 c.urlParams_.Set("alt", alt) 15332 c.urlParams_.Set("prettyPrint", "false") 15333 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 15334 urls += "?" + c.urlParams_.Encode() 15335 req, err := http.NewRequest("DELETE", urls, body) 15336 if err != nil { 15337 return nil, err 15338 } 15339 req.Header = reqHeaders 15340 googleapi.Expand(req.URL, map[string]string{ 15341 "name": c.name, 15342 }) 15343 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15344 } 15345 15346 // Do executes the "vision.projects.locations.products.referenceImages.delete" call. 15347 // Any non-2xx status code is an error. Response headers are in either 15348 // *Empty.ServerResponse.Header or (if a response was returned at all) in 15349 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 15350 // whether the returned error was because http.StatusNotModified was returned. 15351 func (c *ProjectsLocationsProductsReferenceImagesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 15352 gensupport.SetOptions(c.urlParams_, opts...) 15353 res, err := c.doRequest("json") 15354 if res != nil && res.StatusCode == http.StatusNotModified { 15355 if res.Body != nil { 15356 res.Body.Close() 15357 } 15358 return nil, gensupport.WrapError(&googleapi.Error{ 15359 Code: res.StatusCode, 15360 Header: res.Header, 15361 }) 15362 } 15363 if err != nil { 15364 return nil, err 15365 } 15366 defer googleapi.CloseBody(res) 15367 if err := googleapi.CheckResponse(res); err != nil { 15368 return nil, gensupport.WrapError(err) 15369 } 15370 ret := &Empty{ 15371 ServerResponse: googleapi.ServerResponse{ 15372 Header: res.Header, 15373 HTTPStatusCode: res.StatusCode, 15374 }, 15375 } 15376 target := &ret 15377 if err := gensupport.DecodeResponse(target, res); err != nil { 15378 return nil, err 15379 } 15380 return ret, nil 15381 } 15382 15383 type ProjectsLocationsProductsReferenceImagesGetCall struct { 15384 s *Service 15385 name string 15386 urlParams_ gensupport.URLParams 15387 ifNoneMatch_ string 15388 ctx_ context.Context 15389 header_ http.Header 15390 } 15391 15392 // Get: Gets information associated with a ReferenceImage. Possible errors: * 15393 // Returns NOT_FOUND if the specified image does not exist. 15394 // 15395 // - name: The resource name of the ReferenceImage to get. Format is: 15396 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/I 15397 // MAGE_ID`. 15398 func (r *ProjectsLocationsProductsReferenceImagesService) Get(name string) *ProjectsLocationsProductsReferenceImagesGetCall { 15399 c := &ProjectsLocationsProductsReferenceImagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15400 c.name = name 15401 return c 15402 } 15403 15404 // Fields allows partial responses to be retrieved. See 15405 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 15406 // details. 15407 func (c *ProjectsLocationsProductsReferenceImagesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductsReferenceImagesGetCall { 15408 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15409 return c 15410 } 15411 15412 // IfNoneMatch sets an optional parameter which makes the operation fail if the 15413 // object's ETag matches the given value. This is useful for getting updates 15414 // only after the object has changed since the last request. 15415 func (c *ProjectsLocationsProductsReferenceImagesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsProductsReferenceImagesGetCall { 15416 c.ifNoneMatch_ = entityTag 15417 return c 15418 } 15419 15420 // Context sets the context to be used in this call's Do method. 15421 func (c *ProjectsLocationsProductsReferenceImagesGetCall) Context(ctx context.Context) *ProjectsLocationsProductsReferenceImagesGetCall { 15422 c.ctx_ = ctx 15423 return c 15424 } 15425 15426 // Header returns a http.Header that can be modified by the caller to add 15427 // headers to the request. 15428 func (c *ProjectsLocationsProductsReferenceImagesGetCall) Header() http.Header { 15429 if c.header_ == nil { 15430 c.header_ = make(http.Header) 15431 } 15432 return c.header_ 15433 } 15434 15435 func (c *ProjectsLocationsProductsReferenceImagesGetCall) doRequest(alt string) (*http.Response, error) { 15436 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 15437 if c.ifNoneMatch_ != "" { 15438 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 15439 } 15440 var body io.Reader = nil 15441 c.urlParams_.Set("alt", alt) 15442 c.urlParams_.Set("prettyPrint", "false") 15443 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 15444 urls += "?" + c.urlParams_.Encode() 15445 req, err := http.NewRequest("GET", urls, body) 15446 if err != nil { 15447 return nil, err 15448 } 15449 req.Header = reqHeaders 15450 googleapi.Expand(req.URL, map[string]string{ 15451 "name": c.name, 15452 }) 15453 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15454 } 15455 15456 // Do executes the "vision.projects.locations.products.referenceImages.get" call. 15457 // Any non-2xx status code is an error. Response headers are in either 15458 // *ReferenceImage.ServerResponse.Header or (if a response was returned at all) 15459 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 15460 // whether the returned error was because http.StatusNotModified was returned. 15461 func (c *ProjectsLocationsProductsReferenceImagesGetCall) Do(opts ...googleapi.CallOption) (*ReferenceImage, error) { 15462 gensupport.SetOptions(c.urlParams_, opts...) 15463 res, err := c.doRequest("json") 15464 if res != nil && res.StatusCode == http.StatusNotModified { 15465 if res.Body != nil { 15466 res.Body.Close() 15467 } 15468 return nil, gensupport.WrapError(&googleapi.Error{ 15469 Code: res.StatusCode, 15470 Header: res.Header, 15471 }) 15472 } 15473 if err != nil { 15474 return nil, err 15475 } 15476 defer googleapi.CloseBody(res) 15477 if err := googleapi.CheckResponse(res); err != nil { 15478 return nil, gensupport.WrapError(err) 15479 } 15480 ret := &ReferenceImage{ 15481 ServerResponse: googleapi.ServerResponse{ 15482 Header: res.Header, 15483 HTTPStatusCode: res.StatusCode, 15484 }, 15485 } 15486 target := &ret 15487 if err := gensupport.DecodeResponse(target, res); err != nil { 15488 return nil, err 15489 } 15490 return ret, nil 15491 } 15492 15493 type ProjectsLocationsProductsReferenceImagesListCall struct { 15494 s *Service 15495 parent string 15496 urlParams_ gensupport.URLParams 15497 ifNoneMatch_ string 15498 ctx_ context.Context 15499 header_ http.Header 15500 } 15501 15502 // List: Lists reference images. Possible errors: * Returns NOT_FOUND if the 15503 // parent product does not exist. * Returns INVALID_ARGUMENT if the page_size 15504 // is greater than 100, or less than 1. 15505 // 15506 // - parent: Resource name of the product containing the reference images. 15507 // Format is `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. 15508 func (r *ProjectsLocationsProductsReferenceImagesService) List(parent string) *ProjectsLocationsProductsReferenceImagesListCall { 15509 c := &ProjectsLocationsProductsReferenceImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15510 c.parent = parent 15511 return c 15512 } 15513 15514 // PageSize sets the optional parameter "pageSize": The maximum number of items 15515 // to return. Default 10, maximum 100. 15516 func (c *ProjectsLocationsProductsReferenceImagesListCall) PageSize(pageSize int64) *ProjectsLocationsProductsReferenceImagesListCall { 15517 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 15518 return c 15519 } 15520 15521 // PageToken sets the optional parameter "pageToken": A token identifying a 15522 // page of results to be returned. This is the value of `nextPageToken` 15523 // returned in a previous reference image list request. Defaults to the first 15524 // page if not specified. 15525 func (c *ProjectsLocationsProductsReferenceImagesListCall) PageToken(pageToken string) *ProjectsLocationsProductsReferenceImagesListCall { 15526 c.urlParams_.Set("pageToken", pageToken) 15527 return c 15528 } 15529 15530 // Fields allows partial responses to be retrieved. See 15531 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 15532 // details. 15533 func (c *ProjectsLocationsProductsReferenceImagesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductsReferenceImagesListCall { 15534 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15535 return c 15536 } 15537 15538 // IfNoneMatch sets an optional parameter which makes the operation fail if the 15539 // object's ETag matches the given value. This is useful for getting updates 15540 // only after the object has changed since the last request. 15541 func (c *ProjectsLocationsProductsReferenceImagesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsProductsReferenceImagesListCall { 15542 c.ifNoneMatch_ = entityTag 15543 return c 15544 } 15545 15546 // Context sets the context to be used in this call's Do method. 15547 func (c *ProjectsLocationsProductsReferenceImagesListCall) Context(ctx context.Context) *ProjectsLocationsProductsReferenceImagesListCall { 15548 c.ctx_ = ctx 15549 return c 15550 } 15551 15552 // Header returns a http.Header that can be modified by the caller to add 15553 // headers to the request. 15554 func (c *ProjectsLocationsProductsReferenceImagesListCall) Header() http.Header { 15555 if c.header_ == nil { 15556 c.header_ = make(http.Header) 15557 } 15558 return c.header_ 15559 } 15560 15561 func (c *ProjectsLocationsProductsReferenceImagesListCall) doRequest(alt string) (*http.Response, error) { 15562 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 15563 if c.ifNoneMatch_ != "" { 15564 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 15565 } 15566 var body io.Reader = nil 15567 c.urlParams_.Set("alt", alt) 15568 c.urlParams_.Set("prettyPrint", "false") 15569 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/referenceImages") 15570 urls += "?" + c.urlParams_.Encode() 15571 req, err := http.NewRequest("GET", urls, body) 15572 if err != nil { 15573 return nil, err 15574 } 15575 req.Header = reqHeaders 15576 googleapi.Expand(req.URL, map[string]string{ 15577 "parent": c.parent, 15578 }) 15579 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15580 } 15581 15582 // Do executes the "vision.projects.locations.products.referenceImages.list" call. 15583 // Any non-2xx status code is an error. Response headers are in either 15584 // *ListReferenceImagesResponse.ServerResponse.Header or (if a response was 15585 // returned at all) in error.(*googleapi.Error).Header. Use 15586 // googleapi.IsNotModified to check whether the returned error was because 15587 // http.StatusNotModified was returned. 15588 func (c *ProjectsLocationsProductsReferenceImagesListCall) Do(opts ...googleapi.CallOption) (*ListReferenceImagesResponse, error) { 15589 gensupport.SetOptions(c.urlParams_, opts...) 15590 res, err := c.doRequest("json") 15591 if res != nil && res.StatusCode == http.StatusNotModified { 15592 if res.Body != nil { 15593 res.Body.Close() 15594 } 15595 return nil, gensupport.WrapError(&googleapi.Error{ 15596 Code: res.StatusCode, 15597 Header: res.Header, 15598 }) 15599 } 15600 if err != nil { 15601 return nil, err 15602 } 15603 defer googleapi.CloseBody(res) 15604 if err := googleapi.CheckResponse(res); err != nil { 15605 return nil, gensupport.WrapError(err) 15606 } 15607 ret := &ListReferenceImagesResponse{ 15608 ServerResponse: googleapi.ServerResponse{ 15609 Header: res.Header, 15610 HTTPStatusCode: res.StatusCode, 15611 }, 15612 } 15613 target := &ret 15614 if err := gensupport.DecodeResponse(target, res); err != nil { 15615 return nil, err 15616 } 15617 return ret, nil 15618 } 15619 15620 // Pages invokes f for each page of results. 15621 // A non-nil error returned from f will halt the iteration. 15622 // The provided context supersedes any context provided to the Context method. 15623 func (c *ProjectsLocationsProductsReferenceImagesListCall) Pages(ctx context.Context, f func(*ListReferenceImagesResponse) error) error { 15624 c.ctx_ = ctx 15625 defer c.PageToken(c.urlParams_.Get("pageToken")) 15626 for { 15627 x, err := c.Do() 15628 if err != nil { 15629 return err 15630 } 15631 if err := f(x); err != nil { 15632 return err 15633 } 15634 if x.NextPageToken == "" { 15635 return nil 15636 } 15637 c.PageToken(x.NextPageToken) 15638 } 15639 } 15640 15641 type ProjectsOperationsGetCall struct { 15642 s *Service 15643 name string 15644 urlParams_ gensupport.URLParams 15645 ifNoneMatch_ string 15646 ctx_ context.Context 15647 header_ http.Header 15648 } 15649 15650 // Get: Gets the latest state of a long-running operation. Clients can use this 15651 // method to poll the operation result at intervals as recommended by the API 15652 // service. 15653 // 15654 // - name: The name of the operation resource. 15655 func (r *ProjectsOperationsService) Get(name string) *ProjectsOperationsGetCall { 15656 c := &ProjectsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15657 c.name = name 15658 return c 15659 } 15660 15661 // Fields allows partial responses to be retrieved. See 15662 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 15663 // details. 15664 func (c *ProjectsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsOperationsGetCall { 15665 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15666 return c 15667 } 15668 15669 // IfNoneMatch sets an optional parameter which makes the operation fail if the 15670 // object's ETag matches the given value. This is useful for getting updates 15671 // only after the object has changed since the last request. 15672 func (c *ProjectsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsOperationsGetCall { 15673 c.ifNoneMatch_ = entityTag 15674 return c 15675 } 15676 15677 // Context sets the context to be used in this call's Do method. 15678 func (c *ProjectsOperationsGetCall) Context(ctx context.Context) *ProjectsOperationsGetCall { 15679 c.ctx_ = ctx 15680 return c 15681 } 15682 15683 // Header returns a http.Header that can be modified by the caller to add 15684 // headers to the request. 15685 func (c *ProjectsOperationsGetCall) Header() http.Header { 15686 if c.header_ == nil { 15687 c.header_ = make(http.Header) 15688 } 15689 return c.header_ 15690 } 15691 15692 func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 15693 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 15694 if c.ifNoneMatch_ != "" { 15695 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 15696 } 15697 var body io.Reader = nil 15698 c.urlParams_.Set("alt", alt) 15699 c.urlParams_.Set("prettyPrint", "false") 15700 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 15701 urls += "?" + c.urlParams_.Encode() 15702 req, err := http.NewRequest("GET", urls, body) 15703 if err != nil { 15704 return nil, err 15705 } 15706 req.Header = reqHeaders 15707 googleapi.Expand(req.URL, map[string]string{ 15708 "name": c.name, 15709 }) 15710 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15711 } 15712 15713 // Do executes the "vision.projects.operations.get" call. 15714 // Any non-2xx status code is an error. Response headers are in either 15715 // *Operation.ServerResponse.Header or (if a response was returned at all) in 15716 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 15717 // whether the returned error was because http.StatusNotModified was returned. 15718 func (c *ProjectsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 15719 gensupport.SetOptions(c.urlParams_, opts...) 15720 res, err := c.doRequest("json") 15721 if res != nil && res.StatusCode == http.StatusNotModified { 15722 if res.Body != nil { 15723 res.Body.Close() 15724 } 15725 return nil, gensupport.WrapError(&googleapi.Error{ 15726 Code: res.StatusCode, 15727 Header: res.Header, 15728 }) 15729 } 15730 if err != nil { 15731 return nil, err 15732 } 15733 defer googleapi.CloseBody(res) 15734 if err := googleapi.CheckResponse(res); err != nil { 15735 return nil, gensupport.WrapError(err) 15736 } 15737 ret := &Operation{ 15738 ServerResponse: googleapi.ServerResponse{ 15739 Header: res.Header, 15740 HTTPStatusCode: res.StatusCode, 15741 }, 15742 } 15743 target := &ret 15744 if err := gensupport.DecodeResponse(target, res); err != nil { 15745 return nil, err 15746 } 15747 return ret, nil 15748 } 15749