1// Copyright 2020 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// Creating a client 14// 15// Usage example: 16// 17// import "google.golang.org/api/vision/v1" 18// ... 19// ctx := context.Background() 20// visionService, err := vision.NewService(ctx) 21// 22// In this example, Google Application Default Credentials are used for authentication. 23// 24// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 25// 26// Other authentication options 27// 28// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes: 29// 30// visionService, err := vision.NewService(ctx, option.WithScopes(vision.CloudVisionScope)) 31// 32// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 33// 34// visionService, err := vision.NewService(ctx, option.WithAPIKey("AIza...")) 35// 36// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 37// 38// config := &oauth2.Config{...} 39// // ... 40// token, err := config.Exchange(ctx, ...) 41// visionService, err := vision.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 42// 43// See https://godoc.org/google.golang.org/api/option/ for details on options. 44package vision // import "google.golang.org/api/vision/v1" 45 46import ( 47 "bytes" 48 "context" 49 "encoding/json" 50 "errors" 51 "fmt" 52 "io" 53 "net/http" 54 "net/url" 55 "strconv" 56 "strings" 57 58 googleapi "google.golang.org/api/googleapi" 59 gensupport "google.golang.org/api/internal/gensupport" 60 option "google.golang.org/api/option" 61 internaloption "google.golang.org/api/option/internaloption" 62 htransport "google.golang.org/api/transport/http" 63) 64 65// Always reference these packages, just in case the auto-generated code 66// below doesn't. 67var _ = bytes.NewBuffer 68var _ = strconv.Itoa 69var _ = fmt.Sprintf 70var _ = json.NewDecoder 71var _ = io.Copy 72var _ = url.Parse 73var _ = gensupport.MarshalJSON 74var _ = googleapi.Version 75var _ = errors.New 76var _ = strings.Replace 77var _ = context.Canceled 78var _ = internaloption.WithDefaultEndpoint 79 80const apiId = "vision:v1" 81const apiName = "vision" 82const apiVersion = "v1" 83const basePath = "https://vision.googleapis.com/" 84const mtlsBasePath = "https://vision.mtls.googleapis.com/" 85 86// OAuth2 scopes used by this API. 87const ( 88 // View and manage your data across Google Cloud Platform services 89 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 90 91 // Apply machine learning models to understand and label images 92 CloudVisionScope = "https://www.googleapis.com/auth/cloud-vision" 93) 94 95// NewService creates a new Service. 96func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 97 scopesOption := option.WithScopes( 98 "https://www.googleapis.com/auth/cloud-platform", 99 "https://www.googleapis.com/auth/cloud-vision", 100 ) 101 // NOTE: prepend, so we don't override user-specified scopes. 102 opts = append([]option.ClientOption{scopesOption}, opts...) 103 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 104 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 105 client, endpoint, err := htransport.NewClient(ctx, opts...) 106 if err != nil { 107 return nil, err 108 } 109 s, err := New(client) 110 if err != nil { 111 return nil, err 112 } 113 if endpoint != "" { 114 s.BasePath = endpoint 115 } 116 return s, nil 117} 118 119// New creates a new Service. It uses the provided http.Client for requests. 120// 121// Deprecated: please use NewService instead. 122// To provide a custom HTTP client, use option.WithHTTPClient. 123// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 124func New(client *http.Client) (*Service, error) { 125 if client == nil { 126 return nil, errors.New("client is nil") 127 } 128 s := &Service{client: client, BasePath: basePath} 129 s.Files = NewFilesService(s) 130 s.Images = NewImagesService(s) 131 s.Locations = NewLocationsService(s) 132 s.Operations = NewOperationsService(s) 133 s.Projects = NewProjectsService(s) 134 return s, nil 135} 136 137type Service struct { 138 client *http.Client 139 BasePath string // API endpoint base URL 140 UserAgent string // optional additional User-Agent fragment 141 142 Files *FilesService 143 144 Images *ImagesService 145 146 Locations *LocationsService 147 148 Operations *OperationsService 149 150 Projects *ProjectsService 151} 152 153func (s *Service) userAgent() string { 154 if s.UserAgent == "" { 155 return googleapi.UserAgent 156 } 157 return googleapi.UserAgent + " " + s.UserAgent 158} 159 160func NewFilesService(s *Service) *FilesService { 161 rs := &FilesService{s: s} 162 return rs 163} 164 165type FilesService struct { 166 s *Service 167} 168 169func NewImagesService(s *Service) *ImagesService { 170 rs := &ImagesService{s: s} 171 return rs 172} 173 174type ImagesService struct { 175 s *Service 176} 177 178func NewLocationsService(s *Service) *LocationsService { 179 rs := &LocationsService{s: s} 180 rs.Operations = NewLocationsOperationsService(s) 181 return rs 182} 183 184type LocationsService struct { 185 s *Service 186 187 Operations *LocationsOperationsService 188} 189 190func NewLocationsOperationsService(s *Service) *LocationsOperationsService { 191 rs := &LocationsOperationsService{s: s} 192 return rs 193} 194 195type LocationsOperationsService struct { 196 s *Service 197} 198 199func NewOperationsService(s *Service) *OperationsService { 200 rs := &OperationsService{s: s} 201 return rs 202} 203 204type OperationsService struct { 205 s *Service 206} 207 208func NewProjectsService(s *Service) *ProjectsService { 209 rs := &ProjectsService{s: s} 210 rs.Files = NewProjectsFilesService(s) 211 rs.Images = NewProjectsImagesService(s) 212 rs.Locations = NewProjectsLocationsService(s) 213 rs.Operations = NewProjectsOperationsService(s) 214 return rs 215} 216 217type ProjectsService struct { 218 s *Service 219 220 Files *ProjectsFilesService 221 222 Images *ProjectsImagesService 223 224 Locations *ProjectsLocationsService 225 226 Operations *ProjectsOperationsService 227} 228 229func NewProjectsFilesService(s *Service) *ProjectsFilesService { 230 rs := &ProjectsFilesService{s: s} 231 return rs 232} 233 234type ProjectsFilesService struct { 235 s *Service 236} 237 238func NewProjectsImagesService(s *Service) *ProjectsImagesService { 239 rs := &ProjectsImagesService{s: s} 240 return rs 241} 242 243type ProjectsImagesService struct { 244 s *Service 245} 246 247func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { 248 rs := &ProjectsLocationsService{s: s} 249 rs.Files = NewProjectsLocationsFilesService(s) 250 rs.Images = NewProjectsLocationsImagesService(s) 251 rs.Operations = NewProjectsLocationsOperationsService(s) 252 rs.ProductSets = NewProjectsLocationsProductSetsService(s) 253 rs.Products = NewProjectsLocationsProductsService(s) 254 return rs 255} 256 257type ProjectsLocationsService struct { 258 s *Service 259 260 Files *ProjectsLocationsFilesService 261 262 Images *ProjectsLocationsImagesService 263 264 Operations *ProjectsLocationsOperationsService 265 266 ProductSets *ProjectsLocationsProductSetsService 267 268 Products *ProjectsLocationsProductsService 269} 270 271func NewProjectsLocationsFilesService(s *Service) *ProjectsLocationsFilesService { 272 rs := &ProjectsLocationsFilesService{s: s} 273 return rs 274} 275 276type ProjectsLocationsFilesService struct { 277 s *Service 278} 279 280func NewProjectsLocationsImagesService(s *Service) *ProjectsLocationsImagesService { 281 rs := &ProjectsLocationsImagesService{s: s} 282 return rs 283} 284 285type ProjectsLocationsImagesService struct { 286 s *Service 287} 288 289func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService { 290 rs := &ProjectsLocationsOperationsService{s: s} 291 return rs 292} 293 294type ProjectsLocationsOperationsService struct { 295 s *Service 296} 297 298func NewProjectsLocationsProductSetsService(s *Service) *ProjectsLocationsProductSetsService { 299 rs := &ProjectsLocationsProductSetsService{s: s} 300 rs.Products = NewProjectsLocationsProductSetsProductsService(s) 301 return rs 302} 303 304type ProjectsLocationsProductSetsService struct { 305 s *Service 306 307 Products *ProjectsLocationsProductSetsProductsService 308} 309 310func NewProjectsLocationsProductSetsProductsService(s *Service) *ProjectsLocationsProductSetsProductsService { 311 rs := &ProjectsLocationsProductSetsProductsService{s: s} 312 return rs 313} 314 315type ProjectsLocationsProductSetsProductsService struct { 316 s *Service 317} 318 319func NewProjectsLocationsProductsService(s *Service) *ProjectsLocationsProductsService { 320 rs := &ProjectsLocationsProductsService{s: s} 321 rs.ReferenceImages = NewProjectsLocationsProductsReferenceImagesService(s) 322 return rs 323} 324 325type ProjectsLocationsProductsService struct { 326 s *Service 327 328 ReferenceImages *ProjectsLocationsProductsReferenceImagesService 329} 330 331func NewProjectsLocationsProductsReferenceImagesService(s *Service) *ProjectsLocationsProductsReferenceImagesService { 332 rs := &ProjectsLocationsProductsReferenceImagesService{s: s} 333 return rs 334} 335 336type ProjectsLocationsProductsReferenceImagesService struct { 337 s *Service 338} 339 340func NewProjectsOperationsService(s *Service) *ProjectsOperationsService { 341 rs := &ProjectsOperationsService{s: s} 342 return rs 343} 344 345type ProjectsOperationsService struct { 346 s *Service 347} 348 349// AddProductToProductSetRequest: Request message for the 350// `AddProductToProductSet` method. 351type AddProductToProductSetRequest struct { 352 // Product: Required. The resource name for the Product to be added to 353 // this ProductSet. Format is: 354 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` 355 Product string `json:"product,omitempty"` 356 357 // ForceSendFields is a list of field names (e.g. "Product") to 358 // unconditionally include in API requests. By default, fields with 359 // empty values are omitted from API requests. However, any non-pointer, 360 // non-interface field appearing in ForceSendFields will be sent to the 361 // server regardless of whether the field is empty or not. This may be 362 // used to include empty fields in Patch requests. 363 ForceSendFields []string `json:"-"` 364 365 // NullFields is a list of field names (e.g. "Product") to include in 366 // API requests with the JSON null value. By default, fields with empty 367 // values are omitted from API requests. However, any field with an 368 // empty value appearing in NullFields will be sent to the server as 369 // null. It is an error if a field in this list has a non-empty value. 370 // This may be used to include null fields in Patch requests. 371 NullFields []string `json:"-"` 372} 373 374func (s *AddProductToProductSetRequest) MarshalJSON() ([]byte, error) { 375 type NoMethod AddProductToProductSetRequest 376 raw := NoMethod(*s) 377 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 378} 379 380// AnnotateFileRequest: A request to annotate one single file, e.g. a 381// PDF, TIFF or GIF file. 382type AnnotateFileRequest struct { 383 // Features: Required. Requested features. 384 Features []*Feature `json:"features,omitempty"` 385 386 // ImageContext: Additional context that may accompany the image(s) in 387 // the file. 388 ImageContext *ImageContext `json:"imageContext,omitempty"` 389 390 // InputConfig: Required. Information about the input file. 391 InputConfig *InputConfig `json:"inputConfig,omitempty"` 392 393 // Pages: Pages of the file to perform image annotation. Pages starts 394 // from 1, we assume the first page of the file is page 1. At most 5 395 // pages are supported per request. Pages can be negative. Page 1 means 396 // the first page. Page 2 means the second page. Page -1 means the last 397 // page. Page -2 means the second to the last page. If the file is GIF 398 // instead of PDF or TIFF, page refers to GIF frames. If this field is 399 // empty, by default the service performs image annotation for the first 400 // 5 pages of the file. 401 Pages []int64 `json:"pages,omitempty"` 402 403 // ForceSendFields is a list of field names (e.g. "Features") to 404 // unconditionally include in API requests. By default, fields with 405 // empty values are omitted from API requests. However, any non-pointer, 406 // non-interface field appearing in ForceSendFields will be sent to the 407 // server regardless of whether the field is empty or not. This may be 408 // used to include empty fields in Patch requests. 409 ForceSendFields []string `json:"-"` 410 411 // NullFields is a list of field names (e.g. "Features") to include in 412 // API requests with the JSON null value. By default, fields with empty 413 // values are omitted from API requests. However, any field with an 414 // empty value appearing in NullFields will be sent to the server as 415 // null. It is an error if a field in this list has a non-empty value. 416 // This may be used to include null fields in Patch requests. 417 NullFields []string `json:"-"` 418} 419 420func (s *AnnotateFileRequest) MarshalJSON() ([]byte, error) { 421 type NoMethod AnnotateFileRequest 422 raw := NoMethod(*s) 423 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 424} 425 426// AnnotateFileResponse: Response to a single file annotation request. A 427// file may contain one or more images, which individually have their 428// own responses. 429type AnnotateFileResponse struct { 430 // Error: If set, represents the error message for the failed request. 431 // The `responses` field will not be set in this case. 432 Error *Status `json:"error,omitempty"` 433 434 // InputConfig: Information about the file for which this response is 435 // generated. 436 InputConfig *InputConfig `json:"inputConfig,omitempty"` 437 438 // Responses: Individual responses to images found within the file. This 439 // field will be empty if the `error` field is set. 440 Responses []*AnnotateImageResponse `json:"responses,omitempty"` 441 442 // TotalPages: This field gives the total number of pages in the file. 443 TotalPages int64 `json:"totalPages,omitempty"` 444 445 // ForceSendFields is a list of field names (e.g. "Error") to 446 // unconditionally include in API requests. By default, fields with 447 // empty values are omitted from API requests. However, any non-pointer, 448 // non-interface field appearing in ForceSendFields will be sent to the 449 // server regardless of whether the field is empty or not. This may be 450 // used to include empty fields in Patch requests. 451 ForceSendFields []string `json:"-"` 452 453 // NullFields is a list of field names (e.g. "Error") to include in API 454 // requests with the JSON null value. By default, fields with empty 455 // values are omitted from API requests. However, any field with an 456 // empty value appearing in NullFields will be sent to the server as 457 // null. It is an error if a field in this list has a non-empty value. 458 // This may be used to include null fields in Patch requests. 459 NullFields []string `json:"-"` 460} 461 462func (s *AnnotateFileResponse) MarshalJSON() ([]byte, error) { 463 type NoMethod AnnotateFileResponse 464 raw := NoMethod(*s) 465 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 466} 467 468// AnnotateImageRequest: Request for performing Google Cloud Vision API 469// tasks over a user-provided image, with user-requested features, and 470// with context information. 471type AnnotateImageRequest struct { 472 // Features: Requested features. 473 Features []*Feature `json:"features,omitempty"` 474 475 // Image: The image to be processed. 476 Image *Image `json:"image,omitempty"` 477 478 // ImageContext: Additional context that may accompany the image. 479 ImageContext *ImageContext `json:"imageContext,omitempty"` 480 481 // ForceSendFields is a list of field names (e.g. "Features") to 482 // unconditionally include in API requests. By default, fields with 483 // empty values are omitted from API requests. However, any non-pointer, 484 // non-interface field appearing in ForceSendFields will be sent to the 485 // server regardless of whether the field is empty or not. This may be 486 // used to include empty fields in Patch requests. 487 ForceSendFields []string `json:"-"` 488 489 // NullFields is a list of field names (e.g. "Features") to include in 490 // API requests with the JSON null value. By default, fields with empty 491 // values are omitted from API requests. However, any field with an 492 // empty value appearing in NullFields will be sent to the server as 493 // null. It is an error if a field in this list has a non-empty value. 494 // This may be used to include null fields in Patch requests. 495 NullFields []string `json:"-"` 496} 497 498func (s *AnnotateImageRequest) MarshalJSON() ([]byte, error) { 499 type NoMethod AnnotateImageRequest 500 raw := NoMethod(*s) 501 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 502} 503 504// AnnotateImageResponse: Response to an image annotation request. 505type AnnotateImageResponse struct { 506 // Context: If present, contextual information is needed to understand 507 // where this image comes from. 508 Context *ImageAnnotationContext `json:"context,omitempty"` 509 510 // CropHintsAnnotation: If present, crop hints have completed 511 // successfully. 512 CropHintsAnnotation *CropHintsAnnotation `json:"cropHintsAnnotation,omitempty"` 513 514 // Error: If set, represents the error message for the operation. Note 515 // that filled-in image annotations are guaranteed to be correct, even 516 // when `error` is set. 517 Error *Status `json:"error,omitempty"` 518 519 // FaceAnnotations: If present, face detection has completed 520 // successfully. 521 FaceAnnotations []*FaceAnnotation `json:"faceAnnotations,omitempty"` 522 523 // FullTextAnnotation: If present, text (OCR) detection or document 524 // (OCR) text detection has completed successfully. This annotation 525 // provides the structural hierarchy for the OCR detected text. 526 FullTextAnnotation *TextAnnotation `json:"fullTextAnnotation,omitempty"` 527 528 // ImagePropertiesAnnotation: If present, image properties were 529 // extracted successfully. 530 ImagePropertiesAnnotation *ImageProperties `json:"imagePropertiesAnnotation,omitempty"` 531 532 // LabelAnnotations: If present, label detection has completed 533 // successfully. 534 LabelAnnotations []*EntityAnnotation `json:"labelAnnotations,omitempty"` 535 536 // LandmarkAnnotations: If present, landmark detection has completed 537 // successfully. 538 LandmarkAnnotations []*EntityAnnotation `json:"landmarkAnnotations,omitempty"` 539 540 // LocalizedObjectAnnotations: If present, localized object detection 541 // has completed successfully. This will be sorted descending by 542 // confidence score. 543 LocalizedObjectAnnotations []*LocalizedObjectAnnotation `json:"localizedObjectAnnotations,omitempty"` 544 545 // LogoAnnotations: If present, logo detection has completed 546 // successfully. 547 LogoAnnotations []*EntityAnnotation `json:"logoAnnotations,omitempty"` 548 549 // ProductSearchResults: If present, product search has completed 550 // successfully. 551 ProductSearchResults *ProductSearchResults `json:"productSearchResults,omitempty"` 552 553 // SafeSearchAnnotation: If present, safe-search annotation has 554 // completed successfully. 555 SafeSearchAnnotation *SafeSearchAnnotation `json:"safeSearchAnnotation,omitempty"` 556 557 // TextAnnotations: If present, text (OCR) detection has completed 558 // successfully. 559 TextAnnotations []*EntityAnnotation `json:"textAnnotations,omitempty"` 560 561 // WebDetection: If present, web detection has completed successfully. 562 WebDetection *WebDetection `json:"webDetection,omitempty"` 563 564 // ForceSendFields is a list of field names (e.g. "Context") to 565 // unconditionally include in API requests. By default, fields with 566 // empty values are omitted from API requests. However, any non-pointer, 567 // non-interface field appearing in ForceSendFields will be sent to the 568 // server regardless of whether the field is empty or not. This may be 569 // used to include empty fields in Patch requests. 570 ForceSendFields []string `json:"-"` 571 572 // NullFields is a list of field names (e.g. "Context") to include in 573 // API requests with the JSON null value. By default, fields with empty 574 // values are omitted from API requests. However, any field with an 575 // empty value appearing in NullFields will be sent to the server as 576 // null. It is an error if a field in this list has a non-empty value. 577 // This may be used to include null fields in Patch requests. 578 NullFields []string `json:"-"` 579} 580 581func (s *AnnotateImageResponse) MarshalJSON() ([]byte, error) { 582 type NoMethod AnnotateImageResponse 583 raw := NoMethod(*s) 584 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 585} 586 587// AsyncAnnotateFileRequest: An offline file annotation request. 588type AsyncAnnotateFileRequest struct { 589 // Features: Required. Requested features. 590 Features []*Feature `json:"features,omitempty"` 591 592 // ImageContext: Additional context that may accompany the image(s) in 593 // the file. 594 ImageContext *ImageContext `json:"imageContext,omitempty"` 595 596 // InputConfig: Required. Information about the input file. 597 InputConfig *InputConfig `json:"inputConfig,omitempty"` 598 599 // OutputConfig: Required. The desired output location and metadata 600 // (e.g. format). 601 OutputConfig *OutputConfig `json:"outputConfig,omitempty"` 602 603 // ForceSendFields is a list of field names (e.g. "Features") to 604 // unconditionally include in API requests. By default, fields with 605 // empty values are omitted from API requests. However, any non-pointer, 606 // non-interface field appearing in ForceSendFields will be sent to the 607 // server regardless of whether the field is empty or not. This may be 608 // used to include empty fields in Patch requests. 609 ForceSendFields []string `json:"-"` 610 611 // NullFields is a list of field names (e.g. "Features") to include in 612 // API requests with the JSON null value. By default, fields with empty 613 // values are omitted from API requests. However, any field with an 614 // empty value appearing in NullFields will be sent to the server as 615 // null. It is an error if a field in this list has a non-empty value. 616 // This may be used to include null fields in Patch requests. 617 NullFields []string `json:"-"` 618} 619 620func (s *AsyncAnnotateFileRequest) MarshalJSON() ([]byte, error) { 621 type NoMethod AsyncAnnotateFileRequest 622 raw := NoMethod(*s) 623 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 624} 625 626// AsyncAnnotateFileResponse: The response for a single offline file 627// annotation request. 628type AsyncAnnotateFileResponse struct { 629 // OutputConfig: The output location and metadata from 630 // AsyncAnnotateFileRequest. 631 OutputConfig *OutputConfig `json:"outputConfig,omitempty"` 632 633 // ForceSendFields is a list of field names (e.g. "OutputConfig") to 634 // unconditionally include in API requests. By default, fields with 635 // empty values are omitted from API requests. However, any non-pointer, 636 // non-interface field appearing in ForceSendFields will be sent to the 637 // server regardless of whether the field is empty or not. This may be 638 // used to include empty fields in Patch requests. 639 ForceSendFields []string `json:"-"` 640 641 // NullFields is a list of field names (e.g. "OutputConfig") to include 642 // in API requests with the JSON null value. By default, fields with 643 // empty values are omitted from API requests. However, any field with 644 // an empty value appearing in NullFields will be sent to the server as 645 // null. It is an error if a field in this list has a non-empty value. 646 // This may be used to include null fields in Patch requests. 647 NullFields []string `json:"-"` 648} 649 650func (s *AsyncAnnotateFileResponse) MarshalJSON() ([]byte, error) { 651 type NoMethod AsyncAnnotateFileResponse 652 raw := NoMethod(*s) 653 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 654} 655 656// AsyncBatchAnnotateFilesRequest: Multiple async file annotation 657// requests are batched into a single service call. 658type AsyncBatchAnnotateFilesRequest struct { 659 // Parent: Optional. Target project and location to make a call. Format: 660 // `projects/{project-id}/locations/{location-id}`. If no parent is 661 // specified, a region will be chosen automatically. Supported 662 // location-ids: `us`: USA country only, `asia`: East asia areas, like 663 // Japan, Taiwan, `eu`: The European Union. Example: 664 // `projects/project-A/locations/eu`. 665 Parent string `json:"parent,omitempty"` 666 667 // Requests: Required. Individual async file annotation requests for 668 // this batch. 669 Requests []*AsyncAnnotateFileRequest `json:"requests,omitempty"` 670 671 // ForceSendFields is a list of field names (e.g. "Parent") to 672 // unconditionally include in API requests. By default, fields with 673 // empty values are omitted from API requests. However, any non-pointer, 674 // non-interface field appearing in ForceSendFields will be sent to the 675 // server regardless of whether the field is empty or not. This may be 676 // used to include empty fields in Patch requests. 677 ForceSendFields []string `json:"-"` 678 679 // NullFields is a list of field names (e.g. "Parent") to include in API 680 // requests with the JSON null value. By default, fields with empty 681 // values are omitted from API requests. However, any field with an 682 // empty value appearing in NullFields will be sent to the server as 683 // null. It is an error if a field in this list has a non-empty value. 684 // This may be used to include null fields in Patch requests. 685 NullFields []string `json:"-"` 686} 687 688func (s *AsyncBatchAnnotateFilesRequest) MarshalJSON() ([]byte, error) { 689 type NoMethod AsyncBatchAnnotateFilesRequest 690 raw := NoMethod(*s) 691 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 692} 693 694// AsyncBatchAnnotateFilesResponse: Response to an async batch file 695// annotation request. 696type AsyncBatchAnnotateFilesResponse struct { 697 // Responses: The list of file annotation responses, one for each 698 // request in AsyncBatchAnnotateFilesRequest. 699 Responses []*AsyncAnnotateFileResponse `json:"responses,omitempty"` 700 701 // ForceSendFields is a list of field names (e.g. "Responses") to 702 // unconditionally include in API requests. By default, fields with 703 // empty values are omitted from API requests. However, any non-pointer, 704 // non-interface field appearing in ForceSendFields will be sent to the 705 // server regardless of whether the field is empty or not. This may be 706 // used to include empty fields in Patch requests. 707 ForceSendFields []string `json:"-"` 708 709 // NullFields is a list of field names (e.g. "Responses") to include in 710 // API requests with the JSON null value. By default, fields with empty 711 // values are omitted from API requests. However, any field with an 712 // empty value appearing in NullFields will be sent to the server as 713 // null. It is an error if a field in this list has a non-empty value. 714 // This may be used to include null fields in Patch requests. 715 NullFields []string `json:"-"` 716} 717 718func (s *AsyncBatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) { 719 type NoMethod AsyncBatchAnnotateFilesResponse 720 raw := NoMethod(*s) 721 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 722} 723 724// AsyncBatchAnnotateImagesRequest: Request for async image annotation 725// for a list of images. 726type AsyncBatchAnnotateImagesRequest struct { 727 // OutputConfig: Required. The desired output location and metadata 728 // (e.g. format). 729 OutputConfig *OutputConfig `json:"outputConfig,omitempty"` 730 731 // Parent: Optional. Target project and location to make a call. Format: 732 // `projects/{project-id}/locations/{location-id}`. If no parent is 733 // specified, a region will be chosen automatically. Supported 734 // location-ids: `us`: USA country only, `asia`: East asia areas, like 735 // Japan, Taiwan, `eu`: The European Union. Example: 736 // `projects/project-A/locations/eu`. 737 Parent string `json:"parent,omitempty"` 738 739 // Requests: Required. Individual image annotation requests for this 740 // batch. 741 Requests []*AnnotateImageRequest `json:"requests,omitempty"` 742 743 // ForceSendFields is a list of field names (e.g. "OutputConfig") to 744 // unconditionally include in API requests. By default, fields with 745 // empty values are omitted from API requests. However, any non-pointer, 746 // non-interface field appearing in ForceSendFields will be sent to the 747 // server regardless of whether the field is empty or not. This may be 748 // used to include empty fields in Patch requests. 749 ForceSendFields []string `json:"-"` 750 751 // NullFields is a list of field names (e.g. "OutputConfig") to include 752 // in API requests with the JSON null value. By default, fields with 753 // empty values are omitted from API requests. However, any field with 754 // an empty value appearing in NullFields will be sent to the server as 755 // null. It is an error if a field in this list has a non-empty value. 756 // This may be used to include null fields in Patch requests. 757 NullFields []string `json:"-"` 758} 759 760func (s *AsyncBatchAnnotateImagesRequest) MarshalJSON() ([]byte, error) { 761 type NoMethod AsyncBatchAnnotateImagesRequest 762 raw := NoMethod(*s) 763 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 764} 765 766// AsyncBatchAnnotateImagesResponse: Response to an async batch image 767// annotation request. 768type AsyncBatchAnnotateImagesResponse struct { 769 // OutputConfig: The output location and metadata from 770 // AsyncBatchAnnotateImagesRequest. 771 OutputConfig *OutputConfig `json:"outputConfig,omitempty"` 772 773 // ForceSendFields is a list of field names (e.g. "OutputConfig") to 774 // unconditionally include in API requests. By default, fields with 775 // empty values are omitted from API requests. However, any non-pointer, 776 // non-interface field appearing in ForceSendFields will be sent to the 777 // server regardless of whether the field is empty or not. This may be 778 // used to include empty fields in Patch requests. 779 ForceSendFields []string `json:"-"` 780 781 // NullFields is a list of field names (e.g. "OutputConfig") to include 782 // in API requests with the JSON null value. By default, fields with 783 // empty values are omitted from API requests. However, any field with 784 // an empty value appearing in NullFields will be sent to the server as 785 // null. It is an error if a field in this list has a non-empty value. 786 // This may be used to include null fields in Patch requests. 787 NullFields []string `json:"-"` 788} 789 790func (s *AsyncBatchAnnotateImagesResponse) MarshalJSON() ([]byte, error) { 791 type NoMethod AsyncBatchAnnotateImagesResponse 792 raw := NoMethod(*s) 793 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 794} 795 796// BatchAnnotateFilesRequest: A list of requests to annotate files using 797// the BatchAnnotateFiles API. 798type BatchAnnotateFilesRequest struct { 799 // Parent: Optional. Target project and location to make a call. Format: 800 // `projects/{project-id}/locations/{location-id}`. If no parent is 801 // specified, a region will be chosen automatically. Supported 802 // location-ids: `us`: USA country only, `asia`: East asia areas, like 803 // Japan, Taiwan, `eu`: The European Union. Example: 804 // `projects/project-A/locations/eu`. 805 Parent string `json:"parent,omitempty"` 806 807 // Requests: Required. The list of file annotation requests. Right now 808 // we support only one AnnotateFileRequest in BatchAnnotateFilesRequest. 809 Requests []*AnnotateFileRequest `json:"requests,omitempty"` 810 811 // ForceSendFields is a list of field names (e.g. "Parent") to 812 // unconditionally include in API requests. By default, fields with 813 // empty values are omitted from API requests. However, any non-pointer, 814 // non-interface field appearing in ForceSendFields will be sent to the 815 // server regardless of whether the field is empty or not. This may be 816 // used to include empty fields in Patch requests. 817 ForceSendFields []string `json:"-"` 818 819 // NullFields is a list of field names (e.g. "Parent") to include in API 820 // requests with the JSON null value. By default, fields with empty 821 // values are omitted from API requests. However, any field with an 822 // empty value appearing in NullFields will be sent to the server as 823 // null. It is an error if a field in this list has a non-empty value. 824 // This may be used to include null fields in Patch requests. 825 NullFields []string `json:"-"` 826} 827 828func (s *BatchAnnotateFilesRequest) MarshalJSON() ([]byte, error) { 829 type NoMethod BatchAnnotateFilesRequest 830 raw := NoMethod(*s) 831 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 832} 833 834// BatchAnnotateFilesResponse: A list of file annotation responses. 835type BatchAnnotateFilesResponse struct { 836 // Responses: The list of file annotation responses, each response 837 // corresponding to each AnnotateFileRequest in 838 // BatchAnnotateFilesRequest. 839 Responses []*AnnotateFileResponse `json:"responses,omitempty"` 840 841 // ServerResponse contains the HTTP response code and headers from the 842 // server. 843 googleapi.ServerResponse `json:"-"` 844 845 // ForceSendFields is a list of field names (e.g. "Responses") to 846 // unconditionally include in API requests. By default, fields with 847 // empty values are omitted from API requests. However, any non-pointer, 848 // non-interface field appearing in ForceSendFields will be sent to the 849 // server regardless of whether the field is empty or not. This may be 850 // used to include empty fields in Patch requests. 851 ForceSendFields []string `json:"-"` 852 853 // NullFields is a list of field names (e.g. "Responses") to include in 854 // API requests with the JSON null value. By default, fields with empty 855 // values are omitted from API requests. However, any field with an 856 // empty value appearing in NullFields will be sent to the server as 857 // null. It is an error if a field in this list has a non-empty value. 858 // This may be used to include null fields in Patch requests. 859 NullFields []string `json:"-"` 860} 861 862func (s *BatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) { 863 type NoMethod BatchAnnotateFilesResponse 864 raw := NoMethod(*s) 865 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 866} 867 868// BatchAnnotateImagesRequest: Multiple image annotation requests are 869// batched into a single service call. 870type BatchAnnotateImagesRequest struct { 871 // Parent: Optional. Target project and location to make a call. Format: 872 // `projects/{project-id}/locations/{location-id}`. If no parent is 873 // specified, a region will be chosen automatically. Supported 874 // location-ids: `us`: USA country only, `asia`: East asia areas, like 875 // Japan, Taiwan, `eu`: The European Union. Example: 876 // `projects/project-A/locations/eu`. 877 Parent string `json:"parent,omitempty"` 878 879 // Requests: Required. Individual image annotation requests for this 880 // batch. 881 Requests []*AnnotateImageRequest `json:"requests,omitempty"` 882 883 // ForceSendFields is a list of field names (e.g. "Parent") to 884 // unconditionally include in API requests. By default, fields with 885 // empty values are omitted from API requests. However, any non-pointer, 886 // non-interface field appearing in ForceSendFields will be sent to the 887 // server regardless of whether the field is empty or not. This may be 888 // used to include empty fields in Patch requests. 889 ForceSendFields []string `json:"-"` 890 891 // NullFields is a list of field names (e.g. "Parent") to include in API 892 // requests with the JSON null value. By default, fields with empty 893 // values are omitted from API requests. However, any field with an 894 // empty value appearing in NullFields will be sent to the server as 895 // null. It is an error if a field in this list has a non-empty value. 896 // This may be used to include null fields in Patch requests. 897 NullFields []string `json:"-"` 898} 899 900func (s *BatchAnnotateImagesRequest) MarshalJSON() ([]byte, error) { 901 type NoMethod BatchAnnotateImagesRequest 902 raw := NoMethod(*s) 903 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 904} 905 906// BatchAnnotateImagesResponse: Response to a batch image annotation 907// request. 908type BatchAnnotateImagesResponse struct { 909 // Responses: Individual responses to image annotation requests within 910 // the batch. 911 Responses []*AnnotateImageResponse `json:"responses,omitempty"` 912 913 // ServerResponse contains the HTTP response code and headers from the 914 // server. 915 googleapi.ServerResponse `json:"-"` 916 917 // ForceSendFields is a list of field names (e.g. "Responses") to 918 // unconditionally include in API requests. By default, fields with 919 // empty values are omitted from API requests. However, any non-pointer, 920 // non-interface field appearing in ForceSendFields will be sent to the 921 // server regardless of whether the field is empty or not. This may be 922 // used to include empty fields in Patch requests. 923 ForceSendFields []string `json:"-"` 924 925 // NullFields is a list of field names (e.g. "Responses") to include in 926 // API requests with the JSON null value. By default, fields with empty 927 // values are omitted from API requests. However, any field with an 928 // empty value appearing in NullFields will be sent to the server as 929 // null. It is an error if a field in this list has a non-empty value. 930 // This may be used to include null fields in Patch requests. 931 NullFields []string `json:"-"` 932} 933 934func (s *BatchAnnotateImagesResponse) MarshalJSON() ([]byte, error) { 935 type NoMethod BatchAnnotateImagesResponse 936 raw := NoMethod(*s) 937 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 938} 939 940// BatchOperationMetadata: Metadata for the batch operations such as the 941// current state. This is included in the `metadata` field of the 942// `Operation` returned by the `GetOperation` call of the 943// `google::longrunning::Operations` service. 944type BatchOperationMetadata struct { 945 // EndTime: The time when the batch request is finished and 946 // google.longrunning.Operation.done is set to true. 947 EndTime string `json:"endTime,omitempty"` 948 949 // State: The current state of the batch operation. 950 // 951 // Possible values: 952 // "STATE_UNSPECIFIED" - Invalid. 953 // "PROCESSING" - Request is actively being processed. 954 // "SUCCESSFUL" - The request is done and at least one item has been 955 // successfully processed. 956 // "FAILED" - The request is done and no item has been successfully 957 // processed. 958 // "CANCELLED" - The request is done after the 959 // longrunning.Operations.CancelOperation has been called by the user. 960 // Any records that were processed before the cancel command are output 961 // as specified in the request. 962 State string `json:"state,omitempty"` 963 964 // SubmitTime: The time when the batch request was submitted to the 965 // server. 966 SubmitTime string `json:"submitTime,omitempty"` 967 968 // ForceSendFields is a list of field names (e.g. "EndTime") to 969 // unconditionally include in API requests. By default, fields with 970 // empty values are omitted from API requests. However, any non-pointer, 971 // non-interface field appearing in ForceSendFields will be sent to the 972 // server regardless of whether the field is empty or not. This may be 973 // used to include empty fields in Patch requests. 974 ForceSendFields []string `json:"-"` 975 976 // NullFields is a list of field names (e.g. "EndTime") to include in 977 // API requests with the JSON null value. By default, fields with empty 978 // values are omitted from API requests. However, any field with an 979 // empty value appearing in NullFields will be sent to the server as 980 // null. It is an error if a field in this list has a non-empty value. 981 // This may be used to include null fields in Patch requests. 982 NullFields []string `json:"-"` 983} 984 985func (s *BatchOperationMetadata) MarshalJSON() ([]byte, error) { 986 type NoMethod BatchOperationMetadata 987 raw := NoMethod(*s) 988 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 989} 990 991// Block: Logical element on the page. 992type Block struct { 993 // BlockType: Detected block type (text, image etc) for this block. 994 // 995 // Possible values: 996 // "UNKNOWN" - Unknown block type. 997 // "TEXT" - Regular text block. 998 // "TABLE" - Table block. 999 // "PICTURE" - Image block. 1000 // "RULER" - Horizontal/vertical line box. 1001 // "BARCODE" - Barcode block. 1002 BlockType string `json:"blockType,omitempty"` 1003 1004 // BoundingBox: The bounding box for the block. The vertices are in the 1005 // order of top-left, top-right, bottom-right, bottom-left. When a 1006 // rotation of the bounding box is detected the rotation is represented 1007 // as around the top-left corner as defined when the text is read in the 1008 // 'natural' orientation. For example: * when the text is horizontal it 1009 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 1010 // around the top-left corner it becomes: 2----3 | | 1----0 and the 1011 // vertex order will still be (0, 1, 2, 3). 1012 BoundingBox *BoundingPoly `json:"boundingBox,omitempty"` 1013 1014 // Confidence: Confidence of the OCR results on the block. Range [0, 1]. 1015 Confidence float64 `json:"confidence,omitempty"` 1016 1017 // Paragraphs: List of paragraphs in this block (if this blocks is of 1018 // type text). 1019 Paragraphs []*Paragraph `json:"paragraphs,omitempty"` 1020 1021 // Property: Additional information detected for the block. 1022 Property *TextProperty `json:"property,omitempty"` 1023 1024 // ForceSendFields is a list of field names (e.g. "BlockType") to 1025 // unconditionally include in API requests. By default, fields with 1026 // empty values are omitted from API requests. However, any non-pointer, 1027 // non-interface field appearing in ForceSendFields will be sent to the 1028 // server regardless of whether the field is empty or not. This may be 1029 // used to include empty fields in Patch requests. 1030 ForceSendFields []string `json:"-"` 1031 1032 // NullFields is a list of field names (e.g. "BlockType") to include in 1033 // API requests with the JSON null value. By default, fields with empty 1034 // values are omitted from API requests. However, any field with an 1035 // empty value appearing in NullFields will be sent to the server as 1036 // null. It is an error if a field in this list has a non-empty value. 1037 // This may be used to include null fields in Patch requests. 1038 NullFields []string `json:"-"` 1039} 1040 1041func (s *Block) MarshalJSON() ([]byte, error) { 1042 type NoMethod Block 1043 raw := NoMethod(*s) 1044 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1045} 1046 1047func (s *Block) UnmarshalJSON(data []byte) error { 1048 type NoMethod Block 1049 var s1 struct { 1050 Confidence gensupport.JSONFloat64 `json:"confidence"` 1051 *NoMethod 1052 } 1053 s1.NoMethod = (*NoMethod)(s) 1054 if err := json.Unmarshal(data, &s1); err != nil { 1055 return err 1056 } 1057 s.Confidence = float64(s1.Confidence) 1058 return nil 1059} 1060 1061// BoundingPoly: A bounding polygon for the detected image annotation. 1062type BoundingPoly struct { 1063 // NormalizedVertices: The bounding polygon normalized vertices. 1064 NormalizedVertices []*NormalizedVertex `json:"normalizedVertices,omitempty"` 1065 1066 // Vertices: The bounding polygon vertices. 1067 Vertices []*Vertex `json:"vertices,omitempty"` 1068 1069 // ForceSendFields is a list of field names (e.g. "NormalizedVertices") 1070 // to unconditionally include in API requests. By default, fields with 1071 // empty values are omitted from API requests. However, any non-pointer, 1072 // non-interface field appearing in ForceSendFields will be sent to the 1073 // server regardless of whether the field is empty or not. This may be 1074 // used to include empty fields in Patch requests. 1075 ForceSendFields []string `json:"-"` 1076 1077 // NullFields is a list of field names (e.g. "NormalizedVertices") to 1078 // include in API requests with the JSON null value. By default, fields 1079 // with empty values are omitted from API requests. However, any field 1080 // with an empty value appearing in NullFields will be sent to the 1081 // server as null. It is an error if a field in this list has a 1082 // non-empty value. This may be used to include null fields in Patch 1083 // requests. 1084 NullFields []string `json:"-"` 1085} 1086 1087func (s *BoundingPoly) MarshalJSON() ([]byte, error) { 1088 type NoMethod BoundingPoly 1089 raw := NoMethod(*s) 1090 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1091} 1092 1093// CancelOperationRequest: The request message for 1094// Operations.CancelOperation. 1095type CancelOperationRequest struct { 1096} 1097 1098// Color: Represents a color in the RGBA color space. This 1099// representation is designed for simplicity of conversion to/from color 1100// representations in various languages over compactness; for example, 1101// the fields of this representation can be trivially provided to the 1102// constructor of "java.awt.Color" in Java; it can also be trivially 1103// provided to UIColor's "+colorWithRed:green:blue:alpha" method in iOS; 1104// and, with just a little work, it can be easily formatted into a CSS 1105// "rgba()" string in JavaScript, as well. Note: this proto does not 1106// carry information about the absolute color space that should be used 1107// to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, 1108// etc.). By default, applications SHOULD assume the sRGB color space. 1109// Note: when color equality needs to be decided, implementations, 1110// unless documented otherwise, will treat two colors to be equal if all 1111// their red, green, blue and alpha values each differ by at most 1e-5. 1112// Example (Java): import com.google.type.Color; // ... public static 1113// java.awt.Color fromProto(Color protocolor) { float alpha = 1114// protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; 1115// return new java.awt.Color( protocolor.getRed(), 1116// protocolor.getGreen(), protocolor.getBlue(), alpha); } public static 1117// Color toProto(java.awt.Color color) { float red = (float) 1118// color.getRed(); float green = (float) color.getGreen(); float blue = 1119// (float) color.getBlue(); float denominator = 255.0; Color.Builder 1120// resultBuilder = Color .newBuilder() .setRed(red / denominator) 1121// .setGreen(green / denominator) .setBlue(blue / denominator); int 1122// alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( 1123// FloatValue .newBuilder() .setValue(((float) alpha) / denominator) 1124// .build()); } return resultBuilder.build(); } // ... Example (iOS / 1125// Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float 1126// red = [protocolor red]; float green = [protocolor green]; float blue 1127// = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; 1128// float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper 1129// value]; } return [UIColor colorWithRed:red green:green blue:blue 1130// alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, 1131// green, blue, alpha; if (![color getRed:&red green:&green blue:&blue 1132// alpha:&alpha]) { return nil; } Color* result = [[Color alloc] init]; 1133// [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; 1134// if (alpha <= 0.9999) { [result 1135// setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; 1136// return result; } // ... Example (JavaScript): // ... var 1137// protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red 1138// || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = 1139// rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green 1140// = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); 1141// if (!('alpha' in rgb_color)) { return rgbToCssColor_(red, green, 1142// blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams 1143// = [red, green, blue].join(','); return ['rgba(', rgbParams, ',', 1144// alphaFrac, ')'].join(''); }; var rgbToCssColor_ = function(red, 1145// green, blue) { var rgbNumber = new Number((red << 16) | (green << 8) 1146// | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 1147// - hexString.length; var resultBuilder = ['#']; for (var i = 0; i < 1148// missingZeros; i++) { resultBuilder.push('0'); } 1149// resultBuilder.push(hexString); return resultBuilder.join(''); }; // 1150// ... 1151type Color struct { 1152 // Alpha: The fraction of this color that should be applied to the 1153 // pixel. That is, the final pixel color is defined by the equation: 1154 // pixel color = alpha * (this color) + (1.0 - alpha) * (background 1155 // color) This means that a value of 1.0 corresponds to a solid color, 1156 // whereas a value of 0.0 corresponds to a completely transparent color. 1157 // This uses a wrapper message rather than a simple float scalar so that 1158 // it is possible to distinguish between a default value and the value 1159 // being unset. If omitted, this color object is to be rendered as a 1160 // solid color (as if the alpha value had been explicitly given with a 1161 // value of 1.0). 1162 Alpha float64 `json:"alpha,omitempty"` 1163 1164 // Blue: The amount of blue in the color as a value in the interval [0, 1165 // 1]. 1166 Blue float64 `json:"blue,omitempty"` 1167 1168 // Green: The amount of green in the color as a value in the interval 1169 // [0, 1]. 1170 Green float64 `json:"green,omitempty"` 1171 1172 // Red: The amount of red in the color as a value in the interval [0, 1173 // 1]. 1174 Red float64 `json:"red,omitempty"` 1175 1176 // ForceSendFields is a list of field names (e.g. "Alpha") to 1177 // unconditionally include in API requests. By default, fields with 1178 // empty values are omitted from API requests. However, any non-pointer, 1179 // non-interface field appearing in ForceSendFields will be sent to the 1180 // server regardless of whether the field is empty or not. This may be 1181 // used to include empty fields in Patch requests. 1182 ForceSendFields []string `json:"-"` 1183 1184 // NullFields is a list of field names (e.g. "Alpha") to include in API 1185 // requests with the JSON null value. By default, fields with empty 1186 // values are omitted from API requests. However, any field with an 1187 // empty value appearing in NullFields will be sent to the server as 1188 // null. It is an error if a field in this list has a non-empty value. 1189 // This may be used to include null fields in Patch requests. 1190 NullFields []string `json:"-"` 1191} 1192 1193func (s *Color) MarshalJSON() ([]byte, error) { 1194 type NoMethod Color 1195 raw := NoMethod(*s) 1196 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1197} 1198 1199func (s *Color) UnmarshalJSON(data []byte) error { 1200 type NoMethod Color 1201 var s1 struct { 1202 Alpha gensupport.JSONFloat64 `json:"alpha"` 1203 Blue gensupport.JSONFloat64 `json:"blue"` 1204 Green gensupport.JSONFloat64 `json:"green"` 1205 Red gensupport.JSONFloat64 `json:"red"` 1206 *NoMethod 1207 } 1208 s1.NoMethod = (*NoMethod)(s) 1209 if err := json.Unmarshal(data, &s1); err != nil { 1210 return err 1211 } 1212 s.Alpha = float64(s1.Alpha) 1213 s.Blue = float64(s1.Blue) 1214 s.Green = float64(s1.Green) 1215 s.Red = float64(s1.Red) 1216 return nil 1217} 1218 1219// ColorInfo: Color information consists of RGB channels, score, and the 1220// fraction of the image that the color occupies in the image. 1221type ColorInfo struct { 1222 // Color: RGB components of the color. 1223 Color *Color `json:"color,omitempty"` 1224 1225 // PixelFraction: The fraction of pixels the color occupies in the 1226 // image. Value in range [0, 1]. 1227 PixelFraction float64 `json:"pixelFraction,omitempty"` 1228 1229 // Score: Image-specific score for this color. Value in range [0, 1]. 1230 Score float64 `json:"score,omitempty"` 1231 1232 // ForceSendFields is a list of field names (e.g. "Color") to 1233 // unconditionally include in API requests. By default, fields with 1234 // empty values are omitted from API requests. However, any non-pointer, 1235 // non-interface field appearing in ForceSendFields will be sent to the 1236 // server regardless of whether the field is empty or not. This may be 1237 // used to include empty fields in Patch requests. 1238 ForceSendFields []string `json:"-"` 1239 1240 // NullFields is a list of field names (e.g. "Color") to include in API 1241 // requests with the JSON null value. By default, fields with empty 1242 // values are omitted from API requests. However, any field with an 1243 // empty value appearing in NullFields will be sent to the server as 1244 // null. It is an error if a field in this list has a non-empty value. 1245 // This may be used to include null fields in Patch requests. 1246 NullFields []string `json:"-"` 1247} 1248 1249func (s *ColorInfo) MarshalJSON() ([]byte, error) { 1250 type NoMethod ColorInfo 1251 raw := NoMethod(*s) 1252 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1253} 1254 1255func (s *ColorInfo) UnmarshalJSON(data []byte) error { 1256 type NoMethod ColorInfo 1257 var s1 struct { 1258 PixelFraction gensupport.JSONFloat64 `json:"pixelFraction"` 1259 Score gensupport.JSONFloat64 `json:"score"` 1260 *NoMethod 1261 } 1262 s1.NoMethod = (*NoMethod)(s) 1263 if err := json.Unmarshal(data, &s1); err != nil { 1264 return err 1265 } 1266 s.PixelFraction = float64(s1.PixelFraction) 1267 s.Score = float64(s1.Score) 1268 return nil 1269} 1270 1271// CropHint: Single crop hint that is used to generate a new crop when 1272// serving an image. 1273type CropHint struct { 1274 // BoundingPoly: The bounding polygon for the crop region. The 1275 // coordinates of the bounding box are in the original image's scale. 1276 BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"` 1277 1278 // Confidence: Confidence of this being a salient region. Range [0, 1]. 1279 Confidence float64 `json:"confidence,omitempty"` 1280 1281 // ImportanceFraction: Fraction of importance of this salient region 1282 // with respect to the original image. 1283 ImportanceFraction float64 `json:"importanceFraction,omitempty"` 1284 1285 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 1286 // unconditionally include in API requests. By default, fields with 1287 // empty values are omitted from API requests. However, any non-pointer, 1288 // non-interface field appearing in ForceSendFields will be sent to the 1289 // server regardless of whether the field is empty or not. This may be 1290 // used to include empty fields in Patch requests. 1291 ForceSendFields []string `json:"-"` 1292 1293 // NullFields is a list of field names (e.g. "BoundingPoly") to include 1294 // in API requests with the JSON null value. By default, fields with 1295 // empty values are omitted from API requests. However, any field with 1296 // an empty value appearing in NullFields will be sent to the server as 1297 // null. It is an error if a field in this list has a non-empty value. 1298 // This may be used to include null fields in Patch requests. 1299 NullFields []string `json:"-"` 1300} 1301 1302func (s *CropHint) MarshalJSON() ([]byte, error) { 1303 type NoMethod CropHint 1304 raw := NoMethod(*s) 1305 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1306} 1307 1308func (s *CropHint) UnmarshalJSON(data []byte) error { 1309 type NoMethod CropHint 1310 var s1 struct { 1311 Confidence gensupport.JSONFloat64 `json:"confidence"` 1312 ImportanceFraction gensupport.JSONFloat64 `json:"importanceFraction"` 1313 *NoMethod 1314 } 1315 s1.NoMethod = (*NoMethod)(s) 1316 if err := json.Unmarshal(data, &s1); err != nil { 1317 return err 1318 } 1319 s.Confidence = float64(s1.Confidence) 1320 s.ImportanceFraction = float64(s1.ImportanceFraction) 1321 return nil 1322} 1323 1324// CropHintsAnnotation: Set of crop hints that are used to generate new 1325// crops when serving images. 1326type CropHintsAnnotation struct { 1327 // CropHints: Crop hint results. 1328 CropHints []*CropHint `json:"cropHints,omitempty"` 1329 1330 // ForceSendFields is a list of field names (e.g. "CropHints") to 1331 // unconditionally include in API requests. By default, fields with 1332 // empty values are omitted from API requests. However, any non-pointer, 1333 // non-interface field appearing in ForceSendFields will be sent to the 1334 // server regardless of whether the field is empty or not. This may be 1335 // used to include empty fields in Patch requests. 1336 ForceSendFields []string `json:"-"` 1337 1338 // NullFields is a list of field names (e.g. "CropHints") to include in 1339 // API requests with the JSON null value. By default, fields with empty 1340 // values are omitted from API requests. However, any field with an 1341 // empty value appearing in NullFields will be sent to the server as 1342 // null. It is an error if a field in this list has a non-empty value. 1343 // This may be used to include null fields in Patch requests. 1344 NullFields []string `json:"-"` 1345} 1346 1347func (s *CropHintsAnnotation) MarshalJSON() ([]byte, error) { 1348 type NoMethod CropHintsAnnotation 1349 raw := NoMethod(*s) 1350 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1351} 1352 1353// CropHintsParams: Parameters for crop hints annotation request. 1354type CropHintsParams struct { 1355 // AspectRatios: Aspect ratios in floats, representing the ratio of the 1356 // width to the height of the image. For example, if the desired aspect 1357 // ratio is 4/3, the corresponding float value should be 1.33333. If not 1358 // specified, the best possible crop is returned. The number of provided 1359 // aspect ratios is limited to a maximum of 16; any aspect ratios 1360 // provided after the 16th are ignored. 1361 AspectRatios []float64 `json:"aspectRatios,omitempty"` 1362 1363 // ForceSendFields is a list of field names (e.g. "AspectRatios") to 1364 // unconditionally include in API requests. By default, fields with 1365 // empty values are omitted from API requests. However, any non-pointer, 1366 // non-interface field appearing in ForceSendFields will be sent to the 1367 // server regardless of whether the field is empty or not. This may be 1368 // used to include empty fields in Patch requests. 1369 ForceSendFields []string `json:"-"` 1370 1371 // NullFields is a list of field names (e.g. "AspectRatios") to include 1372 // in API requests with the JSON null value. By default, fields with 1373 // empty values are omitted from API requests. However, any field with 1374 // an empty value appearing in NullFields will be sent to the server as 1375 // null. It is an error if a field in this list has a non-empty value. 1376 // This may be used to include null fields in Patch requests. 1377 NullFields []string `json:"-"` 1378} 1379 1380func (s *CropHintsParams) MarshalJSON() ([]byte, error) { 1381 type NoMethod CropHintsParams 1382 raw := NoMethod(*s) 1383 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1384} 1385 1386// DetectedBreak: Detected start or end of a structural component. 1387type DetectedBreak struct { 1388 // IsPrefix: True if break prepends the element. 1389 IsPrefix bool `json:"isPrefix,omitempty"` 1390 1391 // Type: Detected break type. 1392 // 1393 // Possible values: 1394 // "UNKNOWN" - Unknown break label type. 1395 // "SPACE" - Regular space. 1396 // "SURE_SPACE" - Sure space (very wide). 1397 // "EOL_SURE_SPACE" - Line-wrapping break. 1398 // "HYPHEN" - End-line hyphen that is not present in text; does not 1399 // co-occur with `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. 1400 // "LINE_BREAK" - Line break that ends a paragraph. 1401 Type string `json:"type,omitempty"` 1402 1403 // ForceSendFields is a list of field names (e.g. "IsPrefix") to 1404 // unconditionally include in API requests. By default, fields with 1405 // empty values are omitted from API requests. However, any non-pointer, 1406 // non-interface field appearing in ForceSendFields will be sent to the 1407 // server regardless of whether the field is empty or not. This may be 1408 // used to include empty fields in Patch requests. 1409 ForceSendFields []string `json:"-"` 1410 1411 // NullFields is a list of field names (e.g. "IsPrefix") to include in 1412 // API requests with the JSON null value. By default, fields with empty 1413 // values are omitted from API requests. However, any field with an 1414 // empty value appearing in NullFields will be sent to the server as 1415 // null. It is an error if a field in this list has a non-empty value. 1416 // This may be used to include null fields in Patch requests. 1417 NullFields []string `json:"-"` 1418} 1419 1420func (s *DetectedBreak) MarshalJSON() ([]byte, error) { 1421 type NoMethod DetectedBreak 1422 raw := NoMethod(*s) 1423 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1424} 1425 1426// DetectedLanguage: Detected language for a structural component. 1427type DetectedLanguage struct { 1428 // Confidence: Confidence of detected language. Range [0, 1]. 1429 Confidence float64 `json:"confidence,omitempty"` 1430 1431 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". 1432 // For more information, see 1433 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 1434 LanguageCode string `json:"languageCode,omitempty"` 1435 1436 // ForceSendFields is a list of field names (e.g. "Confidence") to 1437 // unconditionally include in API requests. By default, fields with 1438 // empty values are omitted from API requests. However, any non-pointer, 1439 // non-interface field appearing in ForceSendFields will be sent to the 1440 // server regardless of whether the field is empty or not. This may be 1441 // used to include empty fields in Patch requests. 1442 ForceSendFields []string `json:"-"` 1443 1444 // NullFields is a list of field names (e.g. "Confidence") to include in 1445 // API requests with the JSON null value. By default, fields with empty 1446 // values are omitted from API requests. However, any field with an 1447 // empty value appearing in NullFields will be sent to the server as 1448 // null. It is an error if a field in this list has a non-empty value. 1449 // This may be used to include null fields in Patch requests. 1450 NullFields []string `json:"-"` 1451} 1452 1453func (s *DetectedLanguage) MarshalJSON() ([]byte, error) { 1454 type NoMethod DetectedLanguage 1455 raw := NoMethod(*s) 1456 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1457} 1458 1459func (s *DetectedLanguage) UnmarshalJSON(data []byte) error { 1460 type NoMethod DetectedLanguage 1461 var s1 struct { 1462 Confidence gensupport.JSONFloat64 `json:"confidence"` 1463 *NoMethod 1464 } 1465 s1.NoMethod = (*NoMethod)(s) 1466 if err := json.Unmarshal(data, &s1); err != nil { 1467 return err 1468 } 1469 s.Confidence = float64(s1.Confidence) 1470 return nil 1471} 1472 1473// DominantColorsAnnotation: Set of dominant colors and their 1474// corresponding scores. 1475type DominantColorsAnnotation struct { 1476 // Colors: RGB color values with their score and pixel fraction. 1477 Colors []*ColorInfo `json:"colors,omitempty"` 1478 1479 // ForceSendFields is a list of field names (e.g. "Colors") to 1480 // unconditionally include in API requests. By default, fields with 1481 // empty values are omitted from API requests. However, any non-pointer, 1482 // non-interface field appearing in ForceSendFields will be sent to the 1483 // server regardless of whether the field is empty or not. This may be 1484 // used to include empty fields in Patch requests. 1485 ForceSendFields []string `json:"-"` 1486 1487 // NullFields is a list of field names (e.g. "Colors") to include in API 1488 // requests with the JSON null value. By default, fields with empty 1489 // values are omitted from API requests. However, any field with an 1490 // empty value appearing in NullFields will be sent to the server as 1491 // null. It is an error if a field in this list has a non-empty value. 1492 // This may be used to include null fields in Patch requests. 1493 NullFields []string `json:"-"` 1494} 1495 1496func (s *DominantColorsAnnotation) MarshalJSON() ([]byte, error) { 1497 type NoMethod DominantColorsAnnotation 1498 raw := NoMethod(*s) 1499 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1500} 1501 1502// Empty: A generic empty message that you can re-use to avoid defining 1503// duplicated empty messages in your APIs. A typical example is to use 1504// it as the request or the response type of an API method. For 1505// instance: service Foo { rpc Bar(google.protobuf.Empty) returns 1506// (google.protobuf.Empty); } The JSON representation for `Empty` is 1507// empty JSON object `{}`. 1508type Empty struct { 1509 // ServerResponse contains the HTTP response code and headers from the 1510 // server. 1511 googleapi.ServerResponse `json:"-"` 1512} 1513 1514// EntityAnnotation: Set of detected entity features. 1515type EntityAnnotation struct { 1516 // BoundingPoly: Image region to which this entity belongs. Not produced 1517 // for `LABEL_DETECTION` features. 1518 BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"` 1519 1520 // Confidence: **Deprecated. Use `score` instead.** The accuracy of the 1521 // entity detection in an image. For example, for an image in which the 1522 // "Eiffel Tower" entity is detected, this field represents the 1523 // confidence that there is a tower in the query image. Range [0, 1]. 1524 Confidence float64 `json:"confidence,omitempty"` 1525 1526 // Description: Entity textual description, expressed in its `locale` 1527 // language. 1528 Description string `json:"description,omitempty"` 1529 1530 // Locale: The language code for the locale in which the entity textual 1531 // `description` is expressed. 1532 Locale string `json:"locale,omitempty"` 1533 1534 // Locations: The location information for the detected entity. Multiple 1535 // `LocationInfo` elements can be present because one location may 1536 // indicate the location of the scene in the image, and another location 1537 // may indicate the location of the place where the image was taken. 1538 // Location information is usually present for landmarks. 1539 Locations []*LocationInfo `json:"locations,omitempty"` 1540 1541 // Mid: Opaque entity ID. Some IDs may be available in [Google Knowledge 1542 // Graph Search API](https://developers.google.com/knowledge-graph/). 1543 Mid string `json:"mid,omitempty"` 1544 1545 // Properties: Some entities may have optional user-supplied `Property` 1546 // (name/value) fields, such a score or string that qualifies the 1547 // entity. 1548 Properties []*Property `json:"properties,omitempty"` 1549 1550 // Score: Overall score of the result. Range [0, 1]. 1551 Score float64 `json:"score,omitempty"` 1552 1553 // Topicality: The relevancy of the ICA (Image Content Annotation) label 1554 // to the image. For example, the relevancy of "tower" is likely higher 1555 // to an image containing the detected "Eiffel Tower" than to an image 1556 // containing a detected distant towering building, even though the 1557 // confidence that there is a tower in each image may be the same. Range 1558 // [0, 1]. 1559 Topicality float64 `json:"topicality,omitempty"` 1560 1561 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 1562 // unconditionally include in API requests. By default, fields with 1563 // empty values are omitted from API requests. However, any non-pointer, 1564 // non-interface field appearing in ForceSendFields will be sent to the 1565 // server regardless of whether the field is empty or not. This may be 1566 // used to include empty fields in Patch requests. 1567 ForceSendFields []string `json:"-"` 1568 1569 // NullFields is a list of field names (e.g. "BoundingPoly") to include 1570 // in API requests with the JSON null value. By default, fields with 1571 // empty values are omitted from API requests. However, any field with 1572 // an empty value appearing in NullFields will be sent to the server as 1573 // null. It is an error if a field in this list has a non-empty value. 1574 // This may be used to include null fields in Patch requests. 1575 NullFields []string `json:"-"` 1576} 1577 1578func (s *EntityAnnotation) MarshalJSON() ([]byte, error) { 1579 type NoMethod EntityAnnotation 1580 raw := NoMethod(*s) 1581 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1582} 1583 1584func (s *EntityAnnotation) UnmarshalJSON(data []byte) error { 1585 type NoMethod EntityAnnotation 1586 var s1 struct { 1587 Confidence gensupport.JSONFloat64 `json:"confidence"` 1588 Score gensupport.JSONFloat64 `json:"score"` 1589 Topicality gensupport.JSONFloat64 `json:"topicality"` 1590 *NoMethod 1591 } 1592 s1.NoMethod = (*NoMethod)(s) 1593 if err := json.Unmarshal(data, &s1); err != nil { 1594 return err 1595 } 1596 s.Confidence = float64(s1.Confidence) 1597 s.Score = float64(s1.Score) 1598 s.Topicality = float64(s1.Topicality) 1599 return nil 1600} 1601 1602// FaceAnnotation: A face annotation object contains the results of face 1603// detection. 1604type FaceAnnotation struct { 1605 // AngerLikelihood: Anger likelihood. 1606 // 1607 // Possible values: 1608 // "UNKNOWN" - Unknown likelihood. 1609 // "VERY_UNLIKELY" - It is very unlikely. 1610 // "UNLIKELY" - It is unlikely. 1611 // "POSSIBLE" - It is possible. 1612 // "LIKELY" - It is likely. 1613 // "VERY_LIKELY" - It is very likely. 1614 AngerLikelihood string `json:"angerLikelihood,omitempty"` 1615 1616 // BlurredLikelihood: Blurred likelihood. 1617 // 1618 // Possible values: 1619 // "UNKNOWN" - Unknown likelihood. 1620 // "VERY_UNLIKELY" - It is very unlikely. 1621 // "UNLIKELY" - It is unlikely. 1622 // "POSSIBLE" - It is possible. 1623 // "LIKELY" - It is likely. 1624 // "VERY_LIKELY" - It is very likely. 1625 BlurredLikelihood string `json:"blurredLikelihood,omitempty"` 1626 1627 // BoundingPoly: The bounding polygon around the face. The coordinates 1628 // of the bounding box are in the original image's scale. The bounding 1629 // box is computed to "frame" the face in accordance with human 1630 // expectations. It is based on the landmarker results. Note that one or 1631 // more x and/or y coordinates may not be generated in the 1632 // `BoundingPoly` (the polygon will be unbounded) if only a partial face 1633 // appears in the image to be annotated. 1634 BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"` 1635 1636 // DetectionConfidence: Detection confidence. Range [0, 1]. 1637 DetectionConfidence float64 `json:"detectionConfidence,omitempty"` 1638 1639 // FdBoundingPoly: The `fd_bounding_poly` bounding polygon is tighter 1640 // than the `boundingPoly`, and encloses only the skin part of the face. 1641 // Typically, it is used to eliminate the face from any image analysis 1642 // that detects the "amount of skin" visible in an image. It is not 1643 // based on the landmarker results, only on the initial face detection, 1644 // hence the fd (face detection) prefix. 1645 FdBoundingPoly *BoundingPoly `json:"fdBoundingPoly,omitempty"` 1646 1647 // HeadwearLikelihood: Headwear likelihood. 1648 // 1649 // Possible values: 1650 // "UNKNOWN" - Unknown likelihood. 1651 // "VERY_UNLIKELY" - It is very unlikely. 1652 // "UNLIKELY" - It is unlikely. 1653 // "POSSIBLE" - It is possible. 1654 // "LIKELY" - It is likely. 1655 // "VERY_LIKELY" - It is very likely. 1656 HeadwearLikelihood string `json:"headwearLikelihood,omitempty"` 1657 1658 // JoyLikelihood: Joy likelihood. 1659 // 1660 // Possible values: 1661 // "UNKNOWN" - Unknown likelihood. 1662 // "VERY_UNLIKELY" - It is very unlikely. 1663 // "UNLIKELY" - It is unlikely. 1664 // "POSSIBLE" - It is possible. 1665 // "LIKELY" - It is likely. 1666 // "VERY_LIKELY" - It is very likely. 1667 JoyLikelihood string `json:"joyLikelihood,omitempty"` 1668 1669 // LandmarkingConfidence: Face landmarking confidence. Range [0, 1]. 1670 LandmarkingConfidence float64 `json:"landmarkingConfidence,omitempty"` 1671 1672 // Landmarks: Detected face landmarks. 1673 Landmarks []*Landmark `json:"landmarks,omitempty"` 1674 1675 // PanAngle: Yaw angle, which indicates the leftward/rightward angle 1676 // that the face is pointing relative to the vertical plane 1677 // perpendicular to the image. Range [-180,180]. 1678 PanAngle float64 `json:"panAngle,omitempty"` 1679 1680 // RollAngle: Roll angle, which indicates the amount of 1681 // clockwise/anti-clockwise rotation of the face relative to the image 1682 // vertical about the axis perpendicular to the face. Range [-180,180]. 1683 RollAngle float64 `json:"rollAngle,omitempty"` 1684 1685 // SorrowLikelihood: Sorrow likelihood. 1686 // 1687 // Possible values: 1688 // "UNKNOWN" - Unknown likelihood. 1689 // "VERY_UNLIKELY" - It is very unlikely. 1690 // "UNLIKELY" - It is unlikely. 1691 // "POSSIBLE" - It is possible. 1692 // "LIKELY" - It is likely. 1693 // "VERY_LIKELY" - It is very likely. 1694 SorrowLikelihood string `json:"sorrowLikelihood,omitempty"` 1695 1696 // SurpriseLikelihood: Surprise likelihood. 1697 // 1698 // Possible values: 1699 // "UNKNOWN" - Unknown likelihood. 1700 // "VERY_UNLIKELY" - It is very unlikely. 1701 // "UNLIKELY" - It is unlikely. 1702 // "POSSIBLE" - It is possible. 1703 // "LIKELY" - It is likely. 1704 // "VERY_LIKELY" - It is very likely. 1705 SurpriseLikelihood string `json:"surpriseLikelihood,omitempty"` 1706 1707 // TiltAngle: Pitch angle, which indicates the upwards/downwards angle 1708 // that the face is pointing relative to the image's horizontal plane. 1709 // Range [-180,180]. 1710 TiltAngle float64 `json:"tiltAngle,omitempty"` 1711 1712 // UnderExposedLikelihood: Under-exposed likelihood. 1713 // 1714 // Possible values: 1715 // "UNKNOWN" - Unknown likelihood. 1716 // "VERY_UNLIKELY" - It is very unlikely. 1717 // "UNLIKELY" - It is unlikely. 1718 // "POSSIBLE" - It is possible. 1719 // "LIKELY" - It is likely. 1720 // "VERY_LIKELY" - It is very likely. 1721 UnderExposedLikelihood string `json:"underExposedLikelihood,omitempty"` 1722 1723 // ForceSendFields is a list of field names (e.g. "AngerLikelihood") to 1724 // unconditionally include in API requests. By default, fields with 1725 // empty values are omitted from API requests. However, any non-pointer, 1726 // non-interface field appearing in ForceSendFields will be sent to the 1727 // server regardless of whether the field is empty or not. This may be 1728 // used to include empty fields in Patch requests. 1729 ForceSendFields []string `json:"-"` 1730 1731 // NullFields is a list of field names (e.g. "AngerLikelihood") to 1732 // include in API requests with the JSON null value. By default, fields 1733 // with empty values are omitted from API requests. However, any field 1734 // with an empty value appearing in NullFields will be sent to the 1735 // server as null. It is an error if a field in this list has a 1736 // non-empty value. This may be used to include null fields in Patch 1737 // requests. 1738 NullFields []string `json:"-"` 1739} 1740 1741func (s *FaceAnnotation) MarshalJSON() ([]byte, error) { 1742 type NoMethod FaceAnnotation 1743 raw := NoMethod(*s) 1744 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1745} 1746 1747func (s *FaceAnnotation) UnmarshalJSON(data []byte) error { 1748 type NoMethod FaceAnnotation 1749 var s1 struct { 1750 DetectionConfidence gensupport.JSONFloat64 `json:"detectionConfidence"` 1751 LandmarkingConfidence gensupport.JSONFloat64 `json:"landmarkingConfidence"` 1752 PanAngle gensupport.JSONFloat64 `json:"panAngle"` 1753 RollAngle gensupport.JSONFloat64 `json:"rollAngle"` 1754 TiltAngle gensupport.JSONFloat64 `json:"tiltAngle"` 1755 *NoMethod 1756 } 1757 s1.NoMethod = (*NoMethod)(s) 1758 if err := json.Unmarshal(data, &s1); err != nil { 1759 return err 1760 } 1761 s.DetectionConfidence = float64(s1.DetectionConfidence) 1762 s.LandmarkingConfidence = float64(s1.LandmarkingConfidence) 1763 s.PanAngle = float64(s1.PanAngle) 1764 s.RollAngle = float64(s1.RollAngle) 1765 s.TiltAngle = float64(s1.TiltAngle) 1766 return nil 1767} 1768 1769// Feature: The type of Google Cloud Vision API detection to perform, 1770// and the maximum number of results to return for that type. Multiple 1771// `Feature` objects can be specified in the `features` list. 1772type Feature struct { 1773 // MaxResults: Maximum number of results of this type. Does not apply to 1774 // `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`. 1775 MaxResults int64 `json:"maxResults,omitempty"` 1776 1777 // Model: Model to use for the feature. Supported values: 1778 // "builtin/stable" (the default if unset) and "builtin/latest". 1779 Model string `json:"model,omitempty"` 1780 1781 // Type: The feature type. 1782 // 1783 // Possible values: 1784 // "TYPE_UNSPECIFIED" - Unspecified feature type. 1785 // "FACE_DETECTION" - Run face detection. 1786 // "LANDMARK_DETECTION" - Run landmark detection. 1787 // "LOGO_DETECTION" - Run logo detection. 1788 // "LABEL_DETECTION" - Run label detection. 1789 // "TEXT_DETECTION" - Run text detection / optical character 1790 // recognition (OCR). Text detection is optimized for areas of text 1791 // within a larger image; if the image is a document, use 1792 // `DOCUMENT_TEXT_DETECTION` instead. 1793 // "DOCUMENT_TEXT_DETECTION" - Run dense text document OCR. Takes 1794 // precedence when both `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` 1795 // are present. 1796 // "SAFE_SEARCH_DETECTION" - Run Safe Search to detect potentially 1797 // unsafe or undesirable content. 1798 // "IMAGE_PROPERTIES" - Compute a set of image properties, such as the 1799 // image's dominant colors. 1800 // "CROP_HINTS" - Run crop hints. 1801 // "WEB_DETECTION" - Run web detection. 1802 // "PRODUCT_SEARCH" - Run Product Search. 1803 // "OBJECT_LOCALIZATION" - Run localizer for object detection. 1804 Type string `json:"type,omitempty"` 1805 1806 // ForceSendFields is a list of field names (e.g. "MaxResults") to 1807 // unconditionally include in API requests. By default, fields with 1808 // empty values are omitted from API requests. However, any non-pointer, 1809 // non-interface field appearing in ForceSendFields will be sent to the 1810 // server regardless of whether the field is empty or not. This may be 1811 // used to include empty fields in Patch requests. 1812 ForceSendFields []string `json:"-"` 1813 1814 // NullFields is a list of field names (e.g. "MaxResults") to include in 1815 // API requests with the JSON null value. By default, fields with empty 1816 // values are omitted from API requests. However, any field with an 1817 // empty value appearing in NullFields will be sent to the server as 1818 // null. It is an error if a field in this list has a non-empty value. 1819 // This may be used to include null fields in Patch requests. 1820 NullFields []string `json:"-"` 1821} 1822 1823func (s *Feature) MarshalJSON() ([]byte, error) { 1824 type NoMethod Feature 1825 raw := NoMethod(*s) 1826 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1827} 1828 1829// GcsDestination: The Google Cloud Storage location where the output 1830// will be written to. 1831type GcsDestination struct { 1832 // Uri: Google Cloud Storage URI prefix where the results will be 1833 // stored. Results will be in JSON format and preceded by its 1834 // corresponding input URI prefix. This field can either represent a gcs 1835 // file prefix or gcs directory. In either case, the uri should be 1836 // unique because in order to get all of the output files, you will need 1837 // to do a wildcard gcs search on the uri prefix you provide. Examples: 1838 // * File Prefix: gs://bucket-name/here/filenameprefix The output files 1839 // will be created in gs://bucket-name/here/ and the names of the output 1840 // files will begin with "filenameprefix". * Directory Prefix: 1841 // gs://bucket-name/some/location/ The output files will be created in 1842 // gs://bucket-name/some/location/ and the names of the output files 1843 // could be anything because there was no filename prefix specified. If 1844 // multiple outputs, each response is still AnnotateFileResponse, each 1845 // of which contains some subset of the full list of 1846 // AnnotateImageResponse. Multiple outputs can happen if, for example, 1847 // the output JSON is too large and overflows into multiple sharded 1848 // files. 1849 Uri string `json:"uri,omitempty"` 1850 1851 // ForceSendFields is a list of field names (e.g. "Uri") to 1852 // unconditionally include in API requests. By default, fields with 1853 // empty values are omitted from API requests. However, any non-pointer, 1854 // non-interface field appearing in ForceSendFields will be sent to the 1855 // server regardless of whether the field is empty or not. This may be 1856 // used to include empty fields in Patch requests. 1857 ForceSendFields []string `json:"-"` 1858 1859 // NullFields is a list of field names (e.g. "Uri") to include in API 1860 // requests with the JSON null value. By default, fields with empty 1861 // values are omitted from API requests. However, any field with an 1862 // empty value appearing in NullFields will be sent to the server as 1863 // null. It is an error if a field in this list has a non-empty value. 1864 // This may be used to include null fields in Patch requests. 1865 NullFields []string `json:"-"` 1866} 1867 1868func (s *GcsDestination) MarshalJSON() ([]byte, error) { 1869 type NoMethod GcsDestination 1870 raw := NoMethod(*s) 1871 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1872} 1873 1874// GcsSource: The Google Cloud Storage location where the input will be 1875// read from. 1876type GcsSource struct { 1877 // Uri: Google Cloud Storage URI for the input file. This must only be a 1878 // Google Cloud Storage object. Wildcards are not currently supported. 1879 Uri string `json:"uri,omitempty"` 1880 1881 // ForceSendFields is a list of field names (e.g. "Uri") to 1882 // unconditionally include in API requests. By default, fields with 1883 // empty values are omitted from API requests. However, any non-pointer, 1884 // non-interface field appearing in ForceSendFields will be sent to the 1885 // server regardless of whether the field is empty or not. This may be 1886 // used to include empty fields in Patch requests. 1887 ForceSendFields []string `json:"-"` 1888 1889 // NullFields is a list of field names (e.g. "Uri") to include in API 1890 // requests with the JSON null value. By default, fields with empty 1891 // values are omitted from API requests. However, any field with an 1892 // empty value appearing in NullFields will be sent to the server as 1893 // null. It is an error if a field in this list has a non-empty value. 1894 // This may be used to include null fields in Patch requests. 1895 NullFields []string `json:"-"` 1896} 1897 1898func (s *GcsSource) MarshalJSON() ([]byte, error) { 1899 type NoMethod GcsSource 1900 raw := NoMethod(*s) 1901 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1902} 1903 1904// GoogleCloudVisionV1p1beta1AnnotateFileResponse: Response to a single 1905// file annotation request. A file may contain one or more images, which 1906// individually have their own responses. 1907type GoogleCloudVisionV1p1beta1AnnotateFileResponse struct { 1908 // Error: If set, represents the error message for the failed request. 1909 // The `responses` field will not be set in this case. 1910 Error *Status `json:"error,omitempty"` 1911 1912 // InputConfig: Information about the file for which this response is 1913 // generated. 1914 InputConfig *GoogleCloudVisionV1p1beta1InputConfig `json:"inputConfig,omitempty"` 1915 1916 // Responses: Individual responses to images found within the file. This 1917 // field will be empty if the `error` field is set. 1918 Responses []*GoogleCloudVisionV1p1beta1AnnotateImageResponse `json:"responses,omitempty"` 1919 1920 // TotalPages: This field gives the total number of pages in the file. 1921 TotalPages int64 `json:"totalPages,omitempty"` 1922 1923 // ForceSendFields is a list of field names (e.g. "Error") to 1924 // unconditionally include in API requests. By default, fields with 1925 // empty values are omitted from API requests. However, any non-pointer, 1926 // non-interface field appearing in ForceSendFields will be sent to the 1927 // server regardless of whether the field is empty or not. This may be 1928 // used to include empty fields in Patch requests. 1929 ForceSendFields []string `json:"-"` 1930 1931 // NullFields is a list of field names (e.g. "Error") to include in API 1932 // requests with the JSON null value. By default, fields with empty 1933 // values are omitted from API requests. However, any field with an 1934 // empty value appearing in NullFields will be sent to the server as 1935 // null. It is an error if a field in this list has a non-empty value. 1936 // This may be used to include null fields in Patch requests. 1937 NullFields []string `json:"-"` 1938} 1939 1940func (s *GoogleCloudVisionV1p1beta1AnnotateFileResponse) MarshalJSON() ([]byte, error) { 1941 type NoMethod GoogleCloudVisionV1p1beta1AnnotateFileResponse 1942 raw := NoMethod(*s) 1943 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1944} 1945 1946// GoogleCloudVisionV1p1beta1AnnotateImageResponse: Response to an image 1947// annotation request. 1948type GoogleCloudVisionV1p1beta1AnnotateImageResponse struct { 1949 // Context: If present, contextual information is needed to understand 1950 // where this image comes from. 1951 Context *GoogleCloudVisionV1p1beta1ImageAnnotationContext `json:"context,omitempty"` 1952 1953 // CropHintsAnnotation: If present, crop hints have completed 1954 // successfully. 1955 CropHintsAnnotation *GoogleCloudVisionV1p1beta1CropHintsAnnotation `json:"cropHintsAnnotation,omitempty"` 1956 1957 // Error: If set, represents the error message for the operation. Note 1958 // that filled-in image annotations are guaranteed to be correct, even 1959 // when `error` is set. 1960 Error *Status `json:"error,omitempty"` 1961 1962 // FaceAnnotations: If present, face detection has completed 1963 // successfully. 1964 FaceAnnotations []*GoogleCloudVisionV1p1beta1FaceAnnotation `json:"faceAnnotations,omitempty"` 1965 1966 // FullTextAnnotation: If present, text (OCR) detection or document 1967 // (OCR) text detection has completed successfully. This annotation 1968 // provides the structural hierarchy for the OCR detected text. 1969 FullTextAnnotation *GoogleCloudVisionV1p1beta1TextAnnotation `json:"fullTextAnnotation,omitempty"` 1970 1971 // ImagePropertiesAnnotation: If present, image properties were 1972 // extracted successfully. 1973 ImagePropertiesAnnotation *GoogleCloudVisionV1p1beta1ImageProperties `json:"imagePropertiesAnnotation,omitempty"` 1974 1975 // LabelAnnotations: If present, label detection has completed 1976 // successfully. 1977 LabelAnnotations []*GoogleCloudVisionV1p1beta1EntityAnnotation `json:"labelAnnotations,omitempty"` 1978 1979 // LandmarkAnnotations: If present, landmark detection has completed 1980 // successfully. 1981 LandmarkAnnotations []*GoogleCloudVisionV1p1beta1EntityAnnotation `json:"landmarkAnnotations,omitempty"` 1982 1983 // LocalizedObjectAnnotations: If present, localized object detection 1984 // has completed successfully. This will be sorted descending by 1985 // confidence score. 1986 LocalizedObjectAnnotations []*GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation `json:"localizedObjectAnnotations,omitempty"` 1987 1988 // LogoAnnotations: If present, logo detection has completed 1989 // successfully. 1990 LogoAnnotations []*GoogleCloudVisionV1p1beta1EntityAnnotation `json:"logoAnnotations,omitempty"` 1991 1992 // ProductSearchResults: If present, product search has completed 1993 // successfully. 1994 ProductSearchResults *GoogleCloudVisionV1p1beta1ProductSearchResults `json:"productSearchResults,omitempty"` 1995 1996 // SafeSearchAnnotation: If present, safe-search annotation has 1997 // completed successfully. 1998 SafeSearchAnnotation *GoogleCloudVisionV1p1beta1SafeSearchAnnotation `json:"safeSearchAnnotation,omitempty"` 1999 2000 // TextAnnotations: If present, text (OCR) detection has completed 2001 // successfully. 2002 TextAnnotations []*GoogleCloudVisionV1p1beta1EntityAnnotation `json:"textAnnotations,omitempty"` 2003 2004 // WebDetection: If present, web detection has completed successfully. 2005 WebDetection *GoogleCloudVisionV1p1beta1WebDetection `json:"webDetection,omitempty"` 2006 2007 // ForceSendFields is a list of field names (e.g. "Context") to 2008 // unconditionally include in API requests. By default, fields with 2009 // empty values are omitted from API requests. However, any non-pointer, 2010 // non-interface field appearing in ForceSendFields will be sent to the 2011 // server regardless of whether the field is empty or not. This may be 2012 // used to include empty fields in Patch requests. 2013 ForceSendFields []string `json:"-"` 2014 2015 // NullFields is a list of field names (e.g. "Context") to include in 2016 // API requests with the JSON null value. By default, fields with empty 2017 // values are omitted from API requests. However, any field with an 2018 // empty value appearing in NullFields will be sent to the server as 2019 // null. It is an error if a field in this list has a non-empty value. 2020 // This may be used to include null fields in Patch requests. 2021 NullFields []string `json:"-"` 2022} 2023 2024func (s *GoogleCloudVisionV1p1beta1AnnotateImageResponse) MarshalJSON() ([]byte, error) { 2025 type NoMethod GoogleCloudVisionV1p1beta1AnnotateImageResponse 2026 raw := NoMethod(*s) 2027 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2028} 2029 2030// GoogleCloudVisionV1p1beta1AsyncAnnotateFileResponse: The response for 2031// a single offline file annotation request. 2032type GoogleCloudVisionV1p1beta1AsyncAnnotateFileResponse struct { 2033 // OutputConfig: The output location and metadata from 2034 // AsyncAnnotateFileRequest. 2035 OutputConfig *GoogleCloudVisionV1p1beta1OutputConfig `json:"outputConfig,omitempty"` 2036 2037 // ForceSendFields is a list of field names (e.g. "OutputConfig") to 2038 // unconditionally include in API requests. By default, fields with 2039 // empty values are omitted from API requests. However, any non-pointer, 2040 // non-interface field appearing in ForceSendFields will be sent to the 2041 // server regardless of whether the field is empty or not. This may be 2042 // used to include empty fields in Patch requests. 2043 ForceSendFields []string `json:"-"` 2044 2045 // NullFields is a list of field names (e.g. "OutputConfig") to include 2046 // in API requests with the JSON null value. By default, fields with 2047 // empty values are omitted from API requests. However, any field with 2048 // an empty value appearing in NullFields will be sent to the server as 2049 // null. It is an error if a field in this list has a non-empty value. 2050 // This may be used to include null fields in Patch requests. 2051 NullFields []string `json:"-"` 2052} 2053 2054func (s *GoogleCloudVisionV1p1beta1AsyncAnnotateFileResponse) MarshalJSON() ([]byte, error) { 2055 type NoMethod GoogleCloudVisionV1p1beta1AsyncAnnotateFileResponse 2056 raw := NoMethod(*s) 2057 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2058} 2059 2060// GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesResponse: Response 2061// to an async batch file annotation request. 2062type GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesResponse struct { 2063 // Responses: The list of file annotation responses, one for each 2064 // request in AsyncBatchAnnotateFilesRequest. 2065 Responses []*GoogleCloudVisionV1p1beta1AsyncAnnotateFileResponse `json:"responses,omitempty"` 2066 2067 // ForceSendFields is a list of field names (e.g. "Responses") to 2068 // unconditionally include in API requests. By default, fields with 2069 // empty values are omitted from API requests. However, any non-pointer, 2070 // non-interface field appearing in ForceSendFields will be sent to the 2071 // server regardless of whether the field is empty or not. This may be 2072 // used to include empty fields in Patch requests. 2073 ForceSendFields []string `json:"-"` 2074 2075 // NullFields is a list of field names (e.g. "Responses") to include in 2076 // API requests with the JSON null value. By default, fields with empty 2077 // values are omitted from API requests. However, any field with an 2078 // empty value appearing in NullFields will be sent to the server as 2079 // null. It is an error if a field in this list has a non-empty value. 2080 // This may be used to include null fields in Patch requests. 2081 NullFields []string `json:"-"` 2082} 2083 2084func (s *GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) { 2085 type NoMethod GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesResponse 2086 raw := NoMethod(*s) 2087 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2088} 2089 2090// GoogleCloudVisionV1p1beta1Block: Logical element on the page. 2091type GoogleCloudVisionV1p1beta1Block struct { 2092 // BlockType: Detected block type (text, image etc) for this block. 2093 // 2094 // Possible values: 2095 // "UNKNOWN" - Unknown block type. 2096 // "TEXT" - Regular text block. 2097 // "TABLE" - Table block. 2098 // "PICTURE" - Image block. 2099 // "RULER" - Horizontal/vertical line box. 2100 // "BARCODE" - Barcode block. 2101 BlockType string `json:"blockType,omitempty"` 2102 2103 // BoundingBox: The bounding box for the block. The vertices are in the 2104 // order of top-left, top-right, bottom-right, bottom-left. When a 2105 // rotation of the bounding box is detected the rotation is represented 2106 // as around the top-left corner as defined when the text is read in the 2107 // 'natural' orientation. For example: * when the text is horizontal it 2108 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 2109 // around the top-left corner it becomes: 2----3 | | 1----0 and the 2110 // vertex order will still be (0, 1, 2, 3). 2111 BoundingBox *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingBox,omitempty"` 2112 2113 // Confidence: Confidence of the OCR results on the block. Range [0, 1]. 2114 Confidence float64 `json:"confidence,omitempty"` 2115 2116 // Paragraphs: List of paragraphs in this block (if this blocks is of 2117 // type text). 2118 Paragraphs []*GoogleCloudVisionV1p1beta1Paragraph `json:"paragraphs,omitempty"` 2119 2120 // Property: Additional information detected for the block. 2121 Property *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty `json:"property,omitempty"` 2122 2123 // ForceSendFields is a list of field names (e.g. "BlockType") to 2124 // unconditionally include in API requests. By default, fields with 2125 // empty values are omitted from API requests. However, any non-pointer, 2126 // non-interface field appearing in ForceSendFields will be sent to the 2127 // server regardless of whether the field is empty or not. This may be 2128 // used to include empty fields in Patch requests. 2129 ForceSendFields []string `json:"-"` 2130 2131 // NullFields is a list of field names (e.g. "BlockType") to include in 2132 // API requests with the JSON null value. By default, fields with empty 2133 // values are omitted from API requests. However, any field with an 2134 // empty value appearing in NullFields will be sent to the server as 2135 // null. It is an error if a field in this list has a non-empty value. 2136 // This may be used to include null fields in Patch requests. 2137 NullFields []string `json:"-"` 2138} 2139 2140func (s *GoogleCloudVisionV1p1beta1Block) MarshalJSON() ([]byte, error) { 2141 type NoMethod GoogleCloudVisionV1p1beta1Block 2142 raw := NoMethod(*s) 2143 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2144} 2145 2146func (s *GoogleCloudVisionV1p1beta1Block) UnmarshalJSON(data []byte) error { 2147 type NoMethod GoogleCloudVisionV1p1beta1Block 2148 var s1 struct { 2149 Confidence gensupport.JSONFloat64 `json:"confidence"` 2150 *NoMethod 2151 } 2152 s1.NoMethod = (*NoMethod)(s) 2153 if err := json.Unmarshal(data, &s1); err != nil { 2154 return err 2155 } 2156 s.Confidence = float64(s1.Confidence) 2157 return nil 2158} 2159 2160// GoogleCloudVisionV1p1beta1BoundingPoly: A bounding polygon for the 2161// detected image annotation. 2162type GoogleCloudVisionV1p1beta1BoundingPoly struct { 2163 // NormalizedVertices: The bounding polygon normalized vertices. 2164 NormalizedVertices []*GoogleCloudVisionV1p1beta1NormalizedVertex `json:"normalizedVertices,omitempty"` 2165 2166 // Vertices: The bounding polygon vertices. 2167 Vertices []*GoogleCloudVisionV1p1beta1Vertex `json:"vertices,omitempty"` 2168 2169 // ForceSendFields is a list of field names (e.g. "NormalizedVertices") 2170 // to unconditionally include in API requests. By default, fields with 2171 // empty values are omitted from API requests. However, any non-pointer, 2172 // non-interface field appearing in ForceSendFields will be sent to the 2173 // server regardless of whether the field is empty or not. This may be 2174 // used to include empty fields in Patch requests. 2175 ForceSendFields []string `json:"-"` 2176 2177 // NullFields is a list of field names (e.g. "NormalizedVertices") to 2178 // include in API requests with the JSON null value. By default, fields 2179 // with empty values are omitted from API requests. However, any field 2180 // with an empty value appearing in NullFields will be sent to the 2181 // server as null. It is an error if a field in this list has a 2182 // non-empty value. This may be used to include null fields in Patch 2183 // requests. 2184 NullFields []string `json:"-"` 2185} 2186 2187func (s *GoogleCloudVisionV1p1beta1BoundingPoly) MarshalJSON() ([]byte, error) { 2188 type NoMethod GoogleCloudVisionV1p1beta1BoundingPoly 2189 raw := NoMethod(*s) 2190 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2191} 2192 2193// GoogleCloudVisionV1p1beta1ColorInfo: Color information consists of 2194// RGB channels, score, and the fraction of the image that the color 2195// occupies in the image. 2196type GoogleCloudVisionV1p1beta1ColorInfo struct { 2197 // Color: RGB components of the color. 2198 Color *Color `json:"color,omitempty"` 2199 2200 // PixelFraction: The fraction of pixels the color occupies in the 2201 // image. Value in range [0, 1]. 2202 PixelFraction float64 `json:"pixelFraction,omitempty"` 2203 2204 // Score: Image-specific score for this color. Value in range [0, 1]. 2205 Score float64 `json:"score,omitempty"` 2206 2207 // ForceSendFields is a list of field names (e.g. "Color") to 2208 // unconditionally include in API requests. By default, fields with 2209 // empty values are omitted from API requests. However, any non-pointer, 2210 // non-interface field appearing in ForceSendFields will be sent to the 2211 // server regardless of whether the field is empty or not. This may be 2212 // used to include empty fields in Patch requests. 2213 ForceSendFields []string `json:"-"` 2214 2215 // NullFields is a list of field names (e.g. "Color") to include in API 2216 // requests with the JSON null value. By default, fields with empty 2217 // values are omitted from API requests. However, any field with an 2218 // empty value appearing in NullFields will be sent to the server as 2219 // null. It is an error if a field in this list has a non-empty value. 2220 // This may be used to include null fields in Patch requests. 2221 NullFields []string `json:"-"` 2222} 2223 2224func (s *GoogleCloudVisionV1p1beta1ColorInfo) MarshalJSON() ([]byte, error) { 2225 type NoMethod GoogleCloudVisionV1p1beta1ColorInfo 2226 raw := NoMethod(*s) 2227 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2228} 2229 2230func (s *GoogleCloudVisionV1p1beta1ColorInfo) UnmarshalJSON(data []byte) error { 2231 type NoMethod GoogleCloudVisionV1p1beta1ColorInfo 2232 var s1 struct { 2233 PixelFraction gensupport.JSONFloat64 `json:"pixelFraction"` 2234 Score gensupport.JSONFloat64 `json:"score"` 2235 *NoMethod 2236 } 2237 s1.NoMethod = (*NoMethod)(s) 2238 if err := json.Unmarshal(data, &s1); err != nil { 2239 return err 2240 } 2241 s.PixelFraction = float64(s1.PixelFraction) 2242 s.Score = float64(s1.Score) 2243 return nil 2244} 2245 2246// GoogleCloudVisionV1p1beta1CropHint: Single crop hint that is used to 2247// generate a new crop when serving an image. 2248type GoogleCloudVisionV1p1beta1CropHint struct { 2249 // BoundingPoly: The bounding polygon for the crop region. The 2250 // coordinates of the bounding box are in the original image's scale. 2251 BoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingPoly,omitempty"` 2252 2253 // Confidence: Confidence of this being a salient region. Range [0, 1]. 2254 Confidence float64 `json:"confidence,omitempty"` 2255 2256 // ImportanceFraction: Fraction of importance of this salient region 2257 // with respect to the original image. 2258 ImportanceFraction float64 `json:"importanceFraction,omitempty"` 2259 2260 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 2261 // unconditionally include in API requests. By default, fields with 2262 // empty values are omitted from API requests. However, any non-pointer, 2263 // non-interface field appearing in ForceSendFields will be sent to the 2264 // server regardless of whether the field is empty or not. This may be 2265 // used to include empty fields in Patch requests. 2266 ForceSendFields []string `json:"-"` 2267 2268 // NullFields is a list of field names (e.g. "BoundingPoly") to include 2269 // in API requests with the JSON null value. By default, fields with 2270 // empty values are omitted from API requests. However, any field with 2271 // an empty value appearing in NullFields will be sent to the server as 2272 // null. It is an error if a field in this list has a non-empty value. 2273 // This may be used to include null fields in Patch requests. 2274 NullFields []string `json:"-"` 2275} 2276 2277func (s *GoogleCloudVisionV1p1beta1CropHint) MarshalJSON() ([]byte, error) { 2278 type NoMethod GoogleCloudVisionV1p1beta1CropHint 2279 raw := NoMethod(*s) 2280 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2281} 2282 2283func (s *GoogleCloudVisionV1p1beta1CropHint) UnmarshalJSON(data []byte) error { 2284 type NoMethod GoogleCloudVisionV1p1beta1CropHint 2285 var s1 struct { 2286 Confidence gensupport.JSONFloat64 `json:"confidence"` 2287 ImportanceFraction gensupport.JSONFloat64 `json:"importanceFraction"` 2288 *NoMethod 2289 } 2290 s1.NoMethod = (*NoMethod)(s) 2291 if err := json.Unmarshal(data, &s1); err != nil { 2292 return err 2293 } 2294 s.Confidence = float64(s1.Confidence) 2295 s.ImportanceFraction = float64(s1.ImportanceFraction) 2296 return nil 2297} 2298 2299// GoogleCloudVisionV1p1beta1CropHintsAnnotation: Set of crop hints that 2300// are used to generate new crops when serving images. 2301type GoogleCloudVisionV1p1beta1CropHintsAnnotation struct { 2302 // CropHints: Crop hint results. 2303 CropHints []*GoogleCloudVisionV1p1beta1CropHint `json:"cropHints,omitempty"` 2304 2305 // ForceSendFields is a list of field names (e.g. "CropHints") to 2306 // unconditionally include in API requests. By default, fields with 2307 // empty values are omitted from API requests. However, any non-pointer, 2308 // non-interface field appearing in ForceSendFields will be sent to the 2309 // server regardless of whether the field is empty or not. This may be 2310 // used to include empty fields in Patch requests. 2311 ForceSendFields []string `json:"-"` 2312 2313 // NullFields is a list of field names (e.g. "CropHints") to include in 2314 // API requests with the JSON null value. By default, fields with empty 2315 // values are omitted from API requests. However, any field with an 2316 // empty value appearing in NullFields will be sent to the server as 2317 // null. It is an error if a field in this list has a non-empty value. 2318 // This may be used to include null fields in Patch requests. 2319 NullFields []string `json:"-"` 2320} 2321 2322func (s *GoogleCloudVisionV1p1beta1CropHintsAnnotation) MarshalJSON() ([]byte, error) { 2323 type NoMethod GoogleCloudVisionV1p1beta1CropHintsAnnotation 2324 raw := NoMethod(*s) 2325 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2326} 2327 2328// GoogleCloudVisionV1p1beta1DominantColorsAnnotation: Set of dominant 2329// colors and their corresponding scores. 2330type GoogleCloudVisionV1p1beta1DominantColorsAnnotation struct { 2331 // Colors: RGB color values with their score and pixel fraction. 2332 Colors []*GoogleCloudVisionV1p1beta1ColorInfo `json:"colors,omitempty"` 2333 2334 // ForceSendFields is a list of field names (e.g. "Colors") to 2335 // unconditionally include in API requests. By default, fields with 2336 // empty values are omitted from API requests. However, any non-pointer, 2337 // non-interface field appearing in ForceSendFields will be sent to the 2338 // server regardless of whether the field is empty or not. This may be 2339 // used to include empty fields in Patch requests. 2340 ForceSendFields []string `json:"-"` 2341 2342 // NullFields is a list of field names (e.g. "Colors") to include in API 2343 // requests with the JSON null value. By default, fields with empty 2344 // values are omitted from API requests. However, any field with an 2345 // empty value appearing in NullFields will be sent to the server as 2346 // null. It is an error if a field in this list has a non-empty value. 2347 // This may be used to include null fields in Patch requests. 2348 NullFields []string `json:"-"` 2349} 2350 2351func (s *GoogleCloudVisionV1p1beta1DominantColorsAnnotation) MarshalJSON() ([]byte, error) { 2352 type NoMethod GoogleCloudVisionV1p1beta1DominantColorsAnnotation 2353 raw := NoMethod(*s) 2354 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2355} 2356 2357// GoogleCloudVisionV1p1beta1EntityAnnotation: Set of detected entity 2358// features. 2359type GoogleCloudVisionV1p1beta1EntityAnnotation struct { 2360 // BoundingPoly: Image region to which this entity belongs. Not produced 2361 // for `LABEL_DETECTION` features. 2362 BoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingPoly,omitempty"` 2363 2364 // Confidence: **Deprecated. Use `score` instead.** The accuracy of the 2365 // entity detection in an image. For example, for an image in which the 2366 // "Eiffel Tower" entity is detected, this field represents the 2367 // confidence that there is a tower in the query image. Range [0, 1]. 2368 Confidence float64 `json:"confidence,omitempty"` 2369 2370 // Description: Entity textual description, expressed in its `locale` 2371 // language. 2372 Description string `json:"description,omitempty"` 2373 2374 // Locale: The language code for the locale in which the entity textual 2375 // `description` is expressed. 2376 Locale string `json:"locale,omitempty"` 2377 2378 // Locations: The location information for the detected entity. Multiple 2379 // `LocationInfo` elements can be present because one location may 2380 // indicate the location of the scene in the image, and another location 2381 // may indicate the location of the place where the image was taken. 2382 // Location information is usually present for landmarks. 2383 Locations []*GoogleCloudVisionV1p1beta1LocationInfo `json:"locations,omitempty"` 2384 2385 // Mid: Opaque entity ID. Some IDs may be available in [Google Knowledge 2386 // Graph Search API](https://developers.google.com/knowledge-graph/). 2387 Mid string `json:"mid,omitempty"` 2388 2389 // Properties: Some entities may have optional user-supplied `Property` 2390 // (name/value) fields, such a score or string that qualifies the 2391 // entity. 2392 Properties []*GoogleCloudVisionV1p1beta1Property `json:"properties,omitempty"` 2393 2394 // Score: Overall score of the result. Range [0, 1]. 2395 Score float64 `json:"score,omitempty"` 2396 2397 // Topicality: The relevancy of the ICA (Image Content Annotation) label 2398 // to the image. For example, the relevancy of "tower" is likely higher 2399 // to an image containing the detected "Eiffel Tower" than to an image 2400 // containing a detected distant towering building, even though the 2401 // confidence that there is a tower in each image may be the same. Range 2402 // [0, 1]. 2403 Topicality float64 `json:"topicality,omitempty"` 2404 2405 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 2406 // unconditionally include in API requests. By default, fields with 2407 // empty values are omitted from API requests. However, any non-pointer, 2408 // non-interface field appearing in ForceSendFields will be sent to the 2409 // server regardless of whether the field is empty or not. This may be 2410 // used to include empty fields in Patch requests. 2411 ForceSendFields []string `json:"-"` 2412 2413 // NullFields is a list of field names (e.g. "BoundingPoly") to include 2414 // in API requests with the JSON null value. By default, fields with 2415 // empty values are omitted from API requests. However, any field with 2416 // an empty value appearing in NullFields will be sent to the server as 2417 // null. It is an error if a field in this list has a non-empty value. 2418 // This may be used to include null fields in Patch requests. 2419 NullFields []string `json:"-"` 2420} 2421 2422func (s *GoogleCloudVisionV1p1beta1EntityAnnotation) MarshalJSON() ([]byte, error) { 2423 type NoMethod GoogleCloudVisionV1p1beta1EntityAnnotation 2424 raw := NoMethod(*s) 2425 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2426} 2427 2428func (s *GoogleCloudVisionV1p1beta1EntityAnnotation) UnmarshalJSON(data []byte) error { 2429 type NoMethod GoogleCloudVisionV1p1beta1EntityAnnotation 2430 var s1 struct { 2431 Confidence gensupport.JSONFloat64 `json:"confidence"` 2432 Score gensupport.JSONFloat64 `json:"score"` 2433 Topicality gensupport.JSONFloat64 `json:"topicality"` 2434 *NoMethod 2435 } 2436 s1.NoMethod = (*NoMethod)(s) 2437 if err := json.Unmarshal(data, &s1); err != nil { 2438 return err 2439 } 2440 s.Confidence = float64(s1.Confidence) 2441 s.Score = float64(s1.Score) 2442 s.Topicality = float64(s1.Topicality) 2443 return nil 2444} 2445 2446// GoogleCloudVisionV1p1beta1FaceAnnotation: A face annotation object 2447// contains the results of face detection. 2448type GoogleCloudVisionV1p1beta1FaceAnnotation struct { 2449 // AngerLikelihood: Anger likelihood. 2450 // 2451 // Possible values: 2452 // "UNKNOWN" - Unknown likelihood. 2453 // "VERY_UNLIKELY" - It is very unlikely. 2454 // "UNLIKELY" - It is unlikely. 2455 // "POSSIBLE" - It is possible. 2456 // "LIKELY" - It is likely. 2457 // "VERY_LIKELY" - It is very likely. 2458 AngerLikelihood string `json:"angerLikelihood,omitempty"` 2459 2460 // BlurredLikelihood: Blurred likelihood. 2461 // 2462 // Possible values: 2463 // "UNKNOWN" - Unknown likelihood. 2464 // "VERY_UNLIKELY" - It is very unlikely. 2465 // "UNLIKELY" - It is unlikely. 2466 // "POSSIBLE" - It is possible. 2467 // "LIKELY" - It is likely. 2468 // "VERY_LIKELY" - It is very likely. 2469 BlurredLikelihood string `json:"blurredLikelihood,omitempty"` 2470 2471 // BoundingPoly: The bounding polygon around the face. The coordinates 2472 // of the bounding box are in the original image's scale. The bounding 2473 // box is computed to "frame" the face in accordance with human 2474 // expectations. It is based on the landmarker results. Note that one or 2475 // more x and/or y coordinates may not be generated in the 2476 // `BoundingPoly` (the polygon will be unbounded) if only a partial face 2477 // appears in the image to be annotated. 2478 BoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingPoly,omitempty"` 2479 2480 // DetectionConfidence: Detection confidence. Range [0, 1]. 2481 DetectionConfidence float64 `json:"detectionConfidence,omitempty"` 2482 2483 // FdBoundingPoly: The `fd_bounding_poly` bounding polygon is tighter 2484 // than the `boundingPoly`, and encloses only the skin part of the face. 2485 // Typically, it is used to eliminate the face from any image analysis 2486 // that detects the "amount of skin" visible in an image. It is not 2487 // based on the landmarker results, only on the initial face detection, 2488 // hence the fd (face detection) prefix. 2489 FdBoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"fdBoundingPoly,omitempty"` 2490 2491 // HeadwearLikelihood: Headwear likelihood. 2492 // 2493 // Possible values: 2494 // "UNKNOWN" - Unknown likelihood. 2495 // "VERY_UNLIKELY" - It is very unlikely. 2496 // "UNLIKELY" - It is unlikely. 2497 // "POSSIBLE" - It is possible. 2498 // "LIKELY" - It is likely. 2499 // "VERY_LIKELY" - It is very likely. 2500 HeadwearLikelihood string `json:"headwearLikelihood,omitempty"` 2501 2502 // JoyLikelihood: Joy likelihood. 2503 // 2504 // Possible values: 2505 // "UNKNOWN" - Unknown likelihood. 2506 // "VERY_UNLIKELY" - It is very unlikely. 2507 // "UNLIKELY" - It is unlikely. 2508 // "POSSIBLE" - It is possible. 2509 // "LIKELY" - It is likely. 2510 // "VERY_LIKELY" - It is very likely. 2511 JoyLikelihood string `json:"joyLikelihood,omitempty"` 2512 2513 // LandmarkingConfidence: Face landmarking confidence. Range [0, 1]. 2514 LandmarkingConfidence float64 `json:"landmarkingConfidence,omitempty"` 2515 2516 // Landmarks: Detected face landmarks. 2517 Landmarks []*GoogleCloudVisionV1p1beta1FaceAnnotationLandmark `json:"landmarks,omitempty"` 2518 2519 // PanAngle: Yaw angle, which indicates the leftward/rightward angle 2520 // that the face is pointing relative to the vertical plane 2521 // perpendicular to the image. Range [-180,180]. 2522 PanAngle float64 `json:"panAngle,omitempty"` 2523 2524 // RollAngle: Roll angle, which indicates the amount of 2525 // clockwise/anti-clockwise rotation of the face relative to the image 2526 // vertical about the axis perpendicular to the face. Range [-180,180]. 2527 RollAngle float64 `json:"rollAngle,omitempty"` 2528 2529 // SorrowLikelihood: Sorrow likelihood. 2530 // 2531 // Possible values: 2532 // "UNKNOWN" - Unknown likelihood. 2533 // "VERY_UNLIKELY" - It is very unlikely. 2534 // "UNLIKELY" - It is unlikely. 2535 // "POSSIBLE" - It is possible. 2536 // "LIKELY" - It is likely. 2537 // "VERY_LIKELY" - It is very likely. 2538 SorrowLikelihood string `json:"sorrowLikelihood,omitempty"` 2539 2540 // SurpriseLikelihood: Surprise likelihood. 2541 // 2542 // Possible values: 2543 // "UNKNOWN" - Unknown likelihood. 2544 // "VERY_UNLIKELY" - It is very unlikely. 2545 // "UNLIKELY" - It is unlikely. 2546 // "POSSIBLE" - It is possible. 2547 // "LIKELY" - It is likely. 2548 // "VERY_LIKELY" - It is very likely. 2549 SurpriseLikelihood string `json:"surpriseLikelihood,omitempty"` 2550 2551 // TiltAngle: Pitch angle, which indicates the upwards/downwards angle 2552 // that the face is pointing relative to the image's horizontal plane. 2553 // Range [-180,180]. 2554 TiltAngle float64 `json:"tiltAngle,omitempty"` 2555 2556 // UnderExposedLikelihood: Under-exposed likelihood. 2557 // 2558 // Possible values: 2559 // "UNKNOWN" - Unknown likelihood. 2560 // "VERY_UNLIKELY" - It is very unlikely. 2561 // "UNLIKELY" - It is unlikely. 2562 // "POSSIBLE" - It is possible. 2563 // "LIKELY" - It is likely. 2564 // "VERY_LIKELY" - It is very likely. 2565 UnderExposedLikelihood string `json:"underExposedLikelihood,omitempty"` 2566 2567 // ForceSendFields is a list of field names (e.g. "AngerLikelihood") to 2568 // unconditionally include in API requests. By default, fields with 2569 // empty values are omitted from API requests. However, any non-pointer, 2570 // non-interface field appearing in ForceSendFields will be sent to the 2571 // server regardless of whether the field is empty or not. This may be 2572 // used to include empty fields in Patch requests. 2573 ForceSendFields []string `json:"-"` 2574 2575 // NullFields is a list of field names (e.g. "AngerLikelihood") to 2576 // include in API requests with the JSON null value. By default, fields 2577 // with empty values are omitted from API requests. However, any field 2578 // with an empty value appearing in NullFields will be sent to the 2579 // server as null. It is an error if a field in this list has a 2580 // non-empty value. This may be used to include null fields in Patch 2581 // requests. 2582 NullFields []string `json:"-"` 2583} 2584 2585func (s *GoogleCloudVisionV1p1beta1FaceAnnotation) MarshalJSON() ([]byte, error) { 2586 type NoMethod GoogleCloudVisionV1p1beta1FaceAnnotation 2587 raw := NoMethod(*s) 2588 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2589} 2590 2591func (s *GoogleCloudVisionV1p1beta1FaceAnnotation) UnmarshalJSON(data []byte) error { 2592 type NoMethod GoogleCloudVisionV1p1beta1FaceAnnotation 2593 var s1 struct { 2594 DetectionConfidence gensupport.JSONFloat64 `json:"detectionConfidence"` 2595 LandmarkingConfidence gensupport.JSONFloat64 `json:"landmarkingConfidence"` 2596 PanAngle gensupport.JSONFloat64 `json:"panAngle"` 2597 RollAngle gensupport.JSONFloat64 `json:"rollAngle"` 2598 TiltAngle gensupport.JSONFloat64 `json:"tiltAngle"` 2599 *NoMethod 2600 } 2601 s1.NoMethod = (*NoMethod)(s) 2602 if err := json.Unmarshal(data, &s1); err != nil { 2603 return err 2604 } 2605 s.DetectionConfidence = float64(s1.DetectionConfidence) 2606 s.LandmarkingConfidence = float64(s1.LandmarkingConfidence) 2607 s.PanAngle = float64(s1.PanAngle) 2608 s.RollAngle = float64(s1.RollAngle) 2609 s.TiltAngle = float64(s1.TiltAngle) 2610 return nil 2611} 2612 2613// GoogleCloudVisionV1p1beta1FaceAnnotationLandmark: A face-specific 2614// landmark (for example, a face feature). 2615type GoogleCloudVisionV1p1beta1FaceAnnotationLandmark struct { 2616 // Position: Face landmark position. 2617 Position *GoogleCloudVisionV1p1beta1Position `json:"position,omitempty"` 2618 2619 // Type: Face landmark type. 2620 // 2621 // Possible values: 2622 // "UNKNOWN_LANDMARK" - Unknown face landmark detected. Should not be 2623 // filled. 2624 // "LEFT_EYE" - Left eye. 2625 // "RIGHT_EYE" - Right eye. 2626 // "LEFT_OF_LEFT_EYEBROW" - Left of left eyebrow. 2627 // "RIGHT_OF_LEFT_EYEBROW" - Right of left eyebrow. 2628 // "LEFT_OF_RIGHT_EYEBROW" - Left of right eyebrow. 2629 // "RIGHT_OF_RIGHT_EYEBROW" - Right of right eyebrow. 2630 // "MIDPOINT_BETWEEN_EYES" - Midpoint between eyes. 2631 // "NOSE_TIP" - Nose tip. 2632 // "UPPER_LIP" - Upper lip. 2633 // "LOWER_LIP" - Lower lip. 2634 // "MOUTH_LEFT" - Mouth left. 2635 // "MOUTH_RIGHT" - Mouth right. 2636 // "MOUTH_CENTER" - Mouth center. 2637 // "NOSE_BOTTOM_RIGHT" - Nose, bottom right. 2638 // "NOSE_BOTTOM_LEFT" - Nose, bottom left. 2639 // "NOSE_BOTTOM_CENTER" - Nose, bottom center. 2640 // "LEFT_EYE_TOP_BOUNDARY" - Left eye, top boundary. 2641 // "LEFT_EYE_RIGHT_CORNER" - Left eye, right corner. 2642 // "LEFT_EYE_BOTTOM_BOUNDARY" - Left eye, bottom boundary. 2643 // "LEFT_EYE_LEFT_CORNER" - Left eye, left corner. 2644 // "RIGHT_EYE_TOP_BOUNDARY" - Right eye, top boundary. 2645 // "RIGHT_EYE_RIGHT_CORNER" - Right eye, right corner. 2646 // "RIGHT_EYE_BOTTOM_BOUNDARY" - Right eye, bottom boundary. 2647 // "RIGHT_EYE_LEFT_CORNER" - Right eye, left corner. 2648 // "LEFT_EYEBROW_UPPER_MIDPOINT" - Left eyebrow, upper midpoint. 2649 // "RIGHT_EYEBROW_UPPER_MIDPOINT" - Right eyebrow, upper midpoint. 2650 // "LEFT_EAR_TRAGION" - Left ear tragion. 2651 // "RIGHT_EAR_TRAGION" - Right ear tragion. 2652 // "LEFT_EYE_PUPIL" - Left eye pupil. 2653 // "RIGHT_EYE_PUPIL" - Right eye pupil. 2654 // "FOREHEAD_GLABELLA" - Forehead glabella. 2655 // "CHIN_GNATHION" - Chin gnathion. 2656 // "CHIN_LEFT_GONION" - Chin left gonion. 2657 // "CHIN_RIGHT_GONION" - Chin right gonion. 2658 // "LEFT_CHEEK_CENTER" - Left cheek center. 2659 // "RIGHT_CHEEK_CENTER" - Right cheek center. 2660 Type string `json:"type,omitempty"` 2661 2662 // ForceSendFields is a list of field names (e.g. "Position") to 2663 // unconditionally include in API requests. By default, fields with 2664 // empty values are omitted from API requests. However, any non-pointer, 2665 // non-interface field appearing in ForceSendFields will be sent to the 2666 // server regardless of whether the field is empty or not. This may be 2667 // used to include empty fields in Patch requests. 2668 ForceSendFields []string `json:"-"` 2669 2670 // NullFields is a list of field names (e.g. "Position") to include in 2671 // API requests with the JSON null value. By default, fields with empty 2672 // values are omitted from API requests. However, any field with an 2673 // empty value appearing in NullFields will be sent to the server as 2674 // null. It is an error if a field in this list has a non-empty value. 2675 // This may be used to include null fields in Patch requests. 2676 NullFields []string `json:"-"` 2677} 2678 2679func (s *GoogleCloudVisionV1p1beta1FaceAnnotationLandmark) MarshalJSON() ([]byte, error) { 2680 type NoMethod GoogleCloudVisionV1p1beta1FaceAnnotationLandmark 2681 raw := NoMethod(*s) 2682 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2683} 2684 2685// GoogleCloudVisionV1p1beta1GcsDestination: The Google Cloud Storage 2686// location where the output will be written to. 2687type GoogleCloudVisionV1p1beta1GcsDestination struct { 2688 // Uri: Google Cloud Storage URI prefix where the results will be 2689 // stored. Results will be in JSON format and preceded by its 2690 // corresponding input URI prefix. This field can either represent a gcs 2691 // file prefix or gcs directory. In either case, the uri should be 2692 // unique because in order to get all of the output files, you will need 2693 // to do a wildcard gcs search on the uri prefix you provide. Examples: 2694 // * File Prefix: gs://bucket-name/here/filenameprefix The output files 2695 // will be created in gs://bucket-name/here/ and the names of the output 2696 // files will begin with "filenameprefix". * Directory Prefix: 2697 // gs://bucket-name/some/location/ The output files will be created in 2698 // gs://bucket-name/some/location/ and the names of the output files 2699 // could be anything because there was no filename prefix specified. If 2700 // multiple outputs, each response is still AnnotateFileResponse, each 2701 // of which contains some subset of the full list of 2702 // AnnotateImageResponse. Multiple outputs can happen if, for example, 2703 // the output JSON is too large and overflows into multiple sharded 2704 // files. 2705 Uri string `json:"uri,omitempty"` 2706 2707 // ForceSendFields is a list of field names (e.g. "Uri") to 2708 // unconditionally include in API requests. By default, fields with 2709 // empty values are omitted from API requests. However, any non-pointer, 2710 // non-interface field appearing in ForceSendFields will be sent to the 2711 // server regardless of whether the field is empty or not. This may be 2712 // used to include empty fields in Patch requests. 2713 ForceSendFields []string `json:"-"` 2714 2715 // NullFields is a list of field names (e.g. "Uri") to include in API 2716 // requests with the JSON null value. By default, fields with empty 2717 // values are omitted from API requests. However, any field with an 2718 // empty value appearing in NullFields will be sent to the server as 2719 // null. It is an error if a field in this list has a non-empty value. 2720 // This may be used to include null fields in Patch requests. 2721 NullFields []string `json:"-"` 2722} 2723 2724func (s *GoogleCloudVisionV1p1beta1GcsDestination) MarshalJSON() ([]byte, error) { 2725 type NoMethod GoogleCloudVisionV1p1beta1GcsDestination 2726 raw := NoMethod(*s) 2727 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2728} 2729 2730// GoogleCloudVisionV1p1beta1GcsSource: The Google Cloud Storage 2731// location where the input will be read from. 2732type GoogleCloudVisionV1p1beta1GcsSource struct { 2733 // Uri: Google Cloud Storage URI for the input file. This must only be a 2734 // Google Cloud Storage object. Wildcards are not currently supported. 2735 Uri string `json:"uri,omitempty"` 2736 2737 // ForceSendFields is a list of field names (e.g. "Uri") to 2738 // unconditionally include in API requests. By default, fields with 2739 // empty values are omitted from API requests. However, any non-pointer, 2740 // non-interface field appearing in ForceSendFields will be sent to the 2741 // server regardless of whether the field is empty or not. This may be 2742 // used to include empty fields in Patch requests. 2743 ForceSendFields []string `json:"-"` 2744 2745 // NullFields is a list of field names (e.g. "Uri") to include in API 2746 // requests with the JSON null value. By default, fields with empty 2747 // values are omitted from API requests. However, any field with an 2748 // empty value appearing in NullFields will be sent to the server as 2749 // null. It is an error if a field in this list has a non-empty value. 2750 // This may be used to include null fields in Patch requests. 2751 NullFields []string `json:"-"` 2752} 2753 2754func (s *GoogleCloudVisionV1p1beta1GcsSource) MarshalJSON() ([]byte, error) { 2755 type NoMethod GoogleCloudVisionV1p1beta1GcsSource 2756 raw := NoMethod(*s) 2757 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2758} 2759 2760// GoogleCloudVisionV1p1beta1ImageAnnotationContext: If an image was 2761// produced from a file (e.g. a PDF), this message gives information 2762// about the source of that image. 2763type GoogleCloudVisionV1p1beta1ImageAnnotationContext struct { 2764 // PageNumber: If the file was a PDF or TIFF, this field gives the page 2765 // number within the file used to produce the image. 2766 PageNumber int64 `json:"pageNumber,omitempty"` 2767 2768 // Uri: The URI of the file used to produce the image. 2769 Uri string `json:"uri,omitempty"` 2770 2771 // ForceSendFields is a list of field names (e.g. "PageNumber") to 2772 // unconditionally include in API requests. By default, fields with 2773 // empty values are omitted from API requests. However, any non-pointer, 2774 // non-interface field appearing in ForceSendFields will be sent to the 2775 // server regardless of whether the field is empty or not. This may be 2776 // used to include empty fields in Patch requests. 2777 ForceSendFields []string `json:"-"` 2778 2779 // NullFields is a list of field names (e.g. "PageNumber") to include in 2780 // API requests with the JSON null value. By default, fields with empty 2781 // values are omitted from API requests. However, any field with an 2782 // empty value appearing in NullFields will be sent to the server as 2783 // null. It is an error if a field in this list has a non-empty value. 2784 // This may be used to include null fields in Patch requests. 2785 NullFields []string `json:"-"` 2786} 2787 2788func (s *GoogleCloudVisionV1p1beta1ImageAnnotationContext) MarshalJSON() ([]byte, error) { 2789 type NoMethod GoogleCloudVisionV1p1beta1ImageAnnotationContext 2790 raw := NoMethod(*s) 2791 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2792} 2793 2794// GoogleCloudVisionV1p1beta1ImageProperties: Stores image properties, 2795// such as dominant colors. 2796type GoogleCloudVisionV1p1beta1ImageProperties struct { 2797 // DominantColors: If present, dominant colors completed successfully. 2798 DominantColors *GoogleCloudVisionV1p1beta1DominantColorsAnnotation `json:"dominantColors,omitempty"` 2799 2800 // ForceSendFields is a list of field names (e.g. "DominantColors") to 2801 // unconditionally include in API requests. By default, fields with 2802 // empty values are omitted from API requests. However, any non-pointer, 2803 // non-interface field appearing in ForceSendFields will be sent to the 2804 // server regardless of whether the field is empty or not. This may be 2805 // used to include empty fields in Patch requests. 2806 ForceSendFields []string `json:"-"` 2807 2808 // NullFields is a list of field names (e.g. "DominantColors") to 2809 // include in API requests with the JSON null value. By default, fields 2810 // with empty values are omitted from API requests. However, any field 2811 // with an empty value appearing in NullFields will be sent to the 2812 // server as null. It is an error if a field in this list has a 2813 // non-empty value. This may be used to include null fields in Patch 2814 // requests. 2815 NullFields []string `json:"-"` 2816} 2817 2818func (s *GoogleCloudVisionV1p1beta1ImageProperties) MarshalJSON() ([]byte, error) { 2819 type NoMethod GoogleCloudVisionV1p1beta1ImageProperties 2820 raw := NoMethod(*s) 2821 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2822} 2823 2824// GoogleCloudVisionV1p1beta1InputConfig: The desired input location and 2825// metadata. 2826type GoogleCloudVisionV1p1beta1InputConfig struct { 2827 // Content: File content, represented as a stream of bytes. Note: As 2828 // with all `bytes` fields, protobuffers use a pure binary 2829 // representation, whereas JSON representations use base64. Currently, 2830 // this field only works for BatchAnnotateFiles requests. It does not 2831 // work for AsyncBatchAnnotateFiles requests. 2832 Content string `json:"content,omitempty"` 2833 2834 // GcsSource: The Google Cloud Storage location to read the input from. 2835 GcsSource *GoogleCloudVisionV1p1beta1GcsSource `json:"gcsSource,omitempty"` 2836 2837 // MimeType: The type of the file. Currently only "application/pdf", 2838 // "image/tiff" and "image/gif" are supported. Wildcards are not 2839 // supported. 2840 MimeType string `json:"mimeType,omitempty"` 2841 2842 // ForceSendFields is a list of field names (e.g. "Content") to 2843 // unconditionally include in API requests. By default, fields with 2844 // empty values are omitted from API requests. However, any non-pointer, 2845 // non-interface field appearing in ForceSendFields will be sent to the 2846 // server regardless of whether the field is empty or not. This may be 2847 // used to include empty fields in Patch requests. 2848 ForceSendFields []string `json:"-"` 2849 2850 // NullFields is a list of field names (e.g. "Content") to include in 2851 // API requests with the JSON null value. By default, fields with empty 2852 // values are omitted from API requests. However, any field with an 2853 // empty value appearing in NullFields will be sent to the server as 2854 // null. It is an error if a field in this list has a non-empty value. 2855 // This may be used to include null fields in Patch requests. 2856 NullFields []string `json:"-"` 2857} 2858 2859func (s *GoogleCloudVisionV1p1beta1InputConfig) MarshalJSON() ([]byte, error) { 2860 type NoMethod GoogleCloudVisionV1p1beta1InputConfig 2861 raw := NoMethod(*s) 2862 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2863} 2864 2865// GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation: Set of detected 2866// objects with bounding boxes. 2867type GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation struct { 2868 // BoundingPoly: Image region to which this object belongs. This must be 2869 // populated. 2870 BoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingPoly,omitempty"` 2871 2872 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". 2873 // For more information, see 2874 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 2875 LanguageCode string `json:"languageCode,omitempty"` 2876 2877 // Mid: Object ID that should align with EntityAnnotation mid. 2878 Mid string `json:"mid,omitempty"` 2879 2880 // Name: Object name, expressed in its `language_code` language. 2881 Name string `json:"name,omitempty"` 2882 2883 // Score: Score of the result. Range [0, 1]. 2884 Score float64 `json:"score,omitempty"` 2885 2886 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 2887 // unconditionally include in API requests. By default, fields with 2888 // empty values are omitted from API requests. However, any non-pointer, 2889 // non-interface field appearing in ForceSendFields will be sent to the 2890 // server regardless of whether the field is empty or not. This may be 2891 // used to include empty fields in Patch requests. 2892 ForceSendFields []string `json:"-"` 2893 2894 // NullFields is a list of field names (e.g. "BoundingPoly") to include 2895 // in API requests with the JSON null value. By default, fields with 2896 // empty values are omitted from API requests. However, any field with 2897 // an empty value appearing in NullFields will be sent to the server as 2898 // null. It is an error if a field in this list has a non-empty value. 2899 // This may be used to include null fields in Patch requests. 2900 NullFields []string `json:"-"` 2901} 2902 2903func (s *GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation) MarshalJSON() ([]byte, error) { 2904 type NoMethod GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation 2905 raw := NoMethod(*s) 2906 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2907} 2908 2909func (s *GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation) UnmarshalJSON(data []byte) error { 2910 type NoMethod GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation 2911 var s1 struct { 2912 Score gensupport.JSONFloat64 `json:"score"` 2913 *NoMethod 2914 } 2915 s1.NoMethod = (*NoMethod)(s) 2916 if err := json.Unmarshal(data, &s1); err != nil { 2917 return err 2918 } 2919 s.Score = float64(s1.Score) 2920 return nil 2921} 2922 2923// GoogleCloudVisionV1p1beta1LocationInfo: Detected entity location 2924// information. 2925type GoogleCloudVisionV1p1beta1LocationInfo struct { 2926 // LatLng: lat/long location coordinates. 2927 LatLng *LatLng `json:"latLng,omitempty"` 2928 2929 // ForceSendFields is a list of field names (e.g. "LatLng") to 2930 // unconditionally include in API requests. By default, fields with 2931 // empty values are omitted from API requests. However, any non-pointer, 2932 // non-interface field appearing in ForceSendFields will be sent to the 2933 // server regardless of whether the field is empty or not. This may be 2934 // used to include empty fields in Patch requests. 2935 ForceSendFields []string `json:"-"` 2936 2937 // NullFields is a list of field names (e.g. "LatLng") to include in API 2938 // requests with the JSON null value. By default, fields with empty 2939 // values are omitted from API requests. However, any field with an 2940 // empty value appearing in NullFields will be sent to the server as 2941 // null. It is an error if a field in this list has a non-empty value. 2942 // This may be used to include null fields in Patch requests. 2943 NullFields []string `json:"-"` 2944} 2945 2946func (s *GoogleCloudVisionV1p1beta1LocationInfo) MarshalJSON() ([]byte, error) { 2947 type NoMethod GoogleCloudVisionV1p1beta1LocationInfo 2948 raw := NoMethod(*s) 2949 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2950} 2951 2952// GoogleCloudVisionV1p1beta1NormalizedVertex: A vertex represents a 2D 2953// point in the image. NOTE: the normalized vertex coordinates are 2954// relative to the original image and range from 0 to 1. 2955type GoogleCloudVisionV1p1beta1NormalizedVertex struct { 2956 // X: X coordinate. 2957 X float64 `json:"x,omitempty"` 2958 2959 // Y: Y coordinate. 2960 Y float64 `json:"y,omitempty"` 2961 2962 // ForceSendFields is a list of field names (e.g. "X") to 2963 // unconditionally include in API requests. By default, fields with 2964 // empty values are omitted from API requests. However, any non-pointer, 2965 // non-interface field appearing in ForceSendFields will be sent to the 2966 // server regardless of whether the field is empty or not. This may be 2967 // used to include empty fields in Patch requests. 2968 ForceSendFields []string `json:"-"` 2969 2970 // NullFields is a list of field names (e.g. "X") to include in API 2971 // requests with the JSON null value. By default, fields with empty 2972 // values are omitted from API requests. However, any field with an 2973 // empty value appearing in NullFields will be sent to the server as 2974 // null. It is an error if a field in this list has a non-empty value. 2975 // This may be used to include null fields in Patch requests. 2976 NullFields []string `json:"-"` 2977} 2978 2979func (s *GoogleCloudVisionV1p1beta1NormalizedVertex) MarshalJSON() ([]byte, error) { 2980 type NoMethod GoogleCloudVisionV1p1beta1NormalizedVertex 2981 raw := NoMethod(*s) 2982 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2983} 2984 2985func (s *GoogleCloudVisionV1p1beta1NormalizedVertex) UnmarshalJSON(data []byte) error { 2986 type NoMethod GoogleCloudVisionV1p1beta1NormalizedVertex 2987 var s1 struct { 2988 X gensupport.JSONFloat64 `json:"x"` 2989 Y gensupport.JSONFloat64 `json:"y"` 2990 *NoMethod 2991 } 2992 s1.NoMethod = (*NoMethod)(s) 2993 if err := json.Unmarshal(data, &s1); err != nil { 2994 return err 2995 } 2996 s.X = float64(s1.X) 2997 s.Y = float64(s1.Y) 2998 return nil 2999} 3000 3001// GoogleCloudVisionV1p1beta1OperationMetadata: Contains metadata for 3002// the BatchAnnotateImages operation. 3003type GoogleCloudVisionV1p1beta1OperationMetadata struct { 3004 // CreateTime: The time when the batch request was received. 3005 CreateTime string `json:"createTime,omitempty"` 3006 3007 // State: Current state of the batch operation. 3008 // 3009 // Possible values: 3010 // "STATE_UNSPECIFIED" - Invalid. 3011 // "CREATED" - Request is received. 3012 // "RUNNING" - Request is actively being processed. 3013 // "DONE" - The batch processing is done. 3014 // "CANCELLED" - The batch processing was cancelled. 3015 State string `json:"state,omitempty"` 3016 3017 // UpdateTime: The time when the operation result was last updated. 3018 UpdateTime string `json:"updateTime,omitempty"` 3019 3020 // ForceSendFields is a list of field names (e.g. "CreateTime") to 3021 // unconditionally include in API requests. By default, fields with 3022 // empty values are omitted from API requests. However, any non-pointer, 3023 // non-interface field appearing in ForceSendFields will be sent to the 3024 // server regardless of whether the field is empty or not. This may be 3025 // used to include empty fields in Patch requests. 3026 ForceSendFields []string `json:"-"` 3027 3028 // NullFields is a list of field names (e.g. "CreateTime") to include in 3029 // API requests with the JSON null value. By default, fields with empty 3030 // values are omitted from API requests. However, any field with an 3031 // empty value appearing in NullFields will be sent to the server as 3032 // null. It is an error if a field in this list has a non-empty value. 3033 // This may be used to include null fields in Patch requests. 3034 NullFields []string `json:"-"` 3035} 3036 3037func (s *GoogleCloudVisionV1p1beta1OperationMetadata) MarshalJSON() ([]byte, error) { 3038 type NoMethod GoogleCloudVisionV1p1beta1OperationMetadata 3039 raw := NoMethod(*s) 3040 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3041} 3042 3043// GoogleCloudVisionV1p1beta1OutputConfig: The desired output location 3044// and metadata. 3045type GoogleCloudVisionV1p1beta1OutputConfig struct { 3046 // BatchSize: The max number of response protos to put into each output 3047 // JSON file on Google Cloud Storage. The valid range is [1, 100]. If 3048 // not specified, the default value is 20. For example, for one pdf file 3049 // with 100 pages, 100 response protos will be generated. If 3050 // `batch_size` = 20, then 5 json files each containing 20 response 3051 // protos will be written under the prefix `gcs_destination`.`uri`. 3052 // Currently, batch_size only applies to GcsDestination, with potential 3053 // future support for other output configurations. 3054 BatchSize int64 `json:"batchSize,omitempty"` 3055 3056 // GcsDestination: The Google Cloud Storage location to write the 3057 // output(s) to. 3058 GcsDestination *GoogleCloudVisionV1p1beta1GcsDestination `json:"gcsDestination,omitempty"` 3059 3060 // ForceSendFields is a list of field names (e.g. "BatchSize") to 3061 // unconditionally include in API requests. By default, fields with 3062 // empty values are omitted from API requests. However, any non-pointer, 3063 // non-interface field appearing in ForceSendFields will be sent to the 3064 // server regardless of whether the field is empty or not. This may be 3065 // used to include empty fields in Patch requests. 3066 ForceSendFields []string `json:"-"` 3067 3068 // NullFields is a list of field names (e.g. "BatchSize") to include in 3069 // API requests with the JSON null value. By default, fields with empty 3070 // values are omitted from API requests. However, any field with an 3071 // empty value appearing in NullFields will be sent to the server as 3072 // null. It is an error if a field in this list has a non-empty value. 3073 // This may be used to include null fields in Patch requests. 3074 NullFields []string `json:"-"` 3075} 3076 3077func (s *GoogleCloudVisionV1p1beta1OutputConfig) MarshalJSON() ([]byte, error) { 3078 type NoMethod GoogleCloudVisionV1p1beta1OutputConfig 3079 raw := NoMethod(*s) 3080 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3081} 3082 3083// GoogleCloudVisionV1p1beta1Page: Detected page from OCR. 3084type GoogleCloudVisionV1p1beta1Page struct { 3085 // Blocks: List of blocks of text, images etc on this page. 3086 Blocks []*GoogleCloudVisionV1p1beta1Block `json:"blocks,omitempty"` 3087 3088 // Confidence: Confidence of the OCR results on the page. Range [0, 1]. 3089 Confidence float64 `json:"confidence,omitempty"` 3090 3091 // Height: Page height. For PDFs the unit is points. For images 3092 // (including TIFFs) the unit is pixels. 3093 Height int64 `json:"height,omitempty"` 3094 3095 // Property: Additional information detected on the page. 3096 Property *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty `json:"property,omitempty"` 3097 3098 // Width: Page width. For PDFs the unit is points. For images (including 3099 // TIFFs) the unit is pixels. 3100 Width int64 `json:"width,omitempty"` 3101 3102 // ForceSendFields is a list of field names (e.g. "Blocks") to 3103 // unconditionally include in API requests. By default, fields with 3104 // empty values are omitted from API requests. However, any non-pointer, 3105 // non-interface field appearing in ForceSendFields will be sent to the 3106 // server regardless of whether the field is empty or not. This may be 3107 // used to include empty fields in Patch requests. 3108 ForceSendFields []string `json:"-"` 3109 3110 // NullFields is a list of field names (e.g. "Blocks") to include in API 3111 // requests with the JSON null value. By default, fields with empty 3112 // values are omitted from API requests. However, any field with an 3113 // empty value appearing in NullFields will be sent to the server as 3114 // null. It is an error if a field in this list has a non-empty value. 3115 // This may be used to include null fields in Patch requests. 3116 NullFields []string `json:"-"` 3117} 3118 3119func (s *GoogleCloudVisionV1p1beta1Page) MarshalJSON() ([]byte, error) { 3120 type NoMethod GoogleCloudVisionV1p1beta1Page 3121 raw := NoMethod(*s) 3122 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3123} 3124 3125func (s *GoogleCloudVisionV1p1beta1Page) UnmarshalJSON(data []byte) error { 3126 type NoMethod GoogleCloudVisionV1p1beta1Page 3127 var s1 struct { 3128 Confidence gensupport.JSONFloat64 `json:"confidence"` 3129 *NoMethod 3130 } 3131 s1.NoMethod = (*NoMethod)(s) 3132 if err := json.Unmarshal(data, &s1); err != nil { 3133 return err 3134 } 3135 s.Confidence = float64(s1.Confidence) 3136 return nil 3137} 3138 3139// GoogleCloudVisionV1p1beta1Paragraph: Structural unit of text 3140// representing a number of words in certain order. 3141type GoogleCloudVisionV1p1beta1Paragraph struct { 3142 // BoundingBox: The bounding box for the paragraph. The vertices are in 3143 // the order of top-left, top-right, bottom-right, bottom-left. When a 3144 // rotation of the bounding box is detected the rotation is represented 3145 // as around the top-left corner as defined when the text is read in the 3146 // 'natural' orientation. For example: * when the text is horizontal it 3147 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 3148 // around the top-left corner it becomes: 2----3 | | 1----0 and the 3149 // vertex order will still be (0, 1, 2, 3). 3150 BoundingBox *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingBox,omitempty"` 3151 3152 // Confidence: Confidence of the OCR results for the paragraph. Range 3153 // [0, 1]. 3154 Confidence float64 `json:"confidence,omitempty"` 3155 3156 // Property: Additional information detected for the paragraph. 3157 Property *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty `json:"property,omitempty"` 3158 3159 // Words: List of all words in this paragraph. 3160 Words []*GoogleCloudVisionV1p1beta1Word `json:"words,omitempty"` 3161 3162 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 3163 // unconditionally include in API requests. By default, fields with 3164 // empty values are omitted from API requests. However, any non-pointer, 3165 // non-interface field appearing in ForceSendFields will be sent to the 3166 // server regardless of whether the field is empty or not. This may be 3167 // used to include empty fields in Patch requests. 3168 ForceSendFields []string `json:"-"` 3169 3170 // NullFields is a list of field names (e.g. "BoundingBox") to include 3171 // in API requests with the JSON null value. By default, fields with 3172 // empty values are omitted from API requests. However, any field with 3173 // an empty value appearing in NullFields will be sent to the server as 3174 // null. It is an error if a field in this list has a non-empty value. 3175 // This may be used to include null fields in Patch requests. 3176 NullFields []string `json:"-"` 3177} 3178 3179func (s *GoogleCloudVisionV1p1beta1Paragraph) MarshalJSON() ([]byte, error) { 3180 type NoMethod GoogleCloudVisionV1p1beta1Paragraph 3181 raw := NoMethod(*s) 3182 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3183} 3184 3185func (s *GoogleCloudVisionV1p1beta1Paragraph) UnmarshalJSON(data []byte) error { 3186 type NoMethod GoogleCloudVisionV1p1beta1Paragraph 3187 var s1 struct { 3188 Confidence gensupport.JSONFloat64 `json:"confidence"` 3189 *NoMethod 3190 } 3191 s1.NoMethod = (*NoMethod)(s) 3192 if err := json.Unmarshal(data, &s1); err != nil { 3193 return err 3194 } 3195 s.Confidence = float64(s1.Confidence) 3196 return nil 3197} 3198 3199// GoogleCloudVisionV1p1beta1Position: A 3D position in the image, used 3200// primarily for Face detection landmarks. A valid Position must have 3201// both x and y coordinates. The position coordinates are in the same 3202// scale as the original image. 3203type GoogleCloudVisionV1p1beta1Position struct { 3204 // X: X coordinate. 3205 X float64 `json:"x,omitempty"` 3206 3207 // Y: Y coordinate. 3208 Y float64 `json:"y,omitempty"` 3209 3210 // Z: Z coordinate (or depth). 3211 Z float64 `json:"z,omitempty"` 3212 3213 // ForceSendFields is a list of field names (e.g. "X") to 3214 // unconditionally include in API requests. By default, fields with 3215 // empty values are omitted from API requests. However, any non-pointer, 3216 // non-interface field appearing in ForceSendFields will be sent to the 3217 // server regardless of whether the field is empty or not. This may be 3218 // used to include empty fields in Patch requests. 3219 ForceSendFields []string `json:"-"` 3220 3221 // NullFields is a list of field names (e.g. "X") to include in API 3222 // requests with the JSON null value. By default, fields with empty 3223 // values are omitted from API requests. However, any field with an 3224 // empty value appearing in NullFields will be sent to the server as 3225 // null. It is an error if a field in this list has a non-empty value. 3226 // This may be used to include null fields in Patch requests. 3227 NullFields []string `json:"-"` 3228} 3229 3230func (s *GoogleCloudVisionV1p1beta1Position) MarshalJSON() ([]byte, error) { 3231 type NoMethod GoogleCloudVisionV1p1beta1Position 3232 raw := NoMethod(*s) 3233 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3234} 3235 3236func (s *GoogleCloudVisionV1p1beta1Position) UnmarshalJSON(data []byte) error { 3237 type NoMethod GoogleCloudVisionV1p1beta1Position 3238 var s1 struct { 3239 X gensupport.JSONFloat64 `json:"x"` 3240 Y gensupport.JSONFloat64 `json:"y"` 3241 Z gensupport.JSONFloat64 `json:"z"` 3242 *NoMethod 3243 } 3244 s1.NoMethod = (*NoMethod)(s) 3245 if err := json.Unmarshal(data, &s1); err != nil { 3246 return err 3247 } 3248 s.X = float64(s1.X) 3249 s.Y = float64(s1.Y) 3250 s.Z = float64(s1.Z) 3251 return nil 3252} 3253 3254// GoogleCloudVisionV1p1beta1Product: A Product contains 3255// ReferenceImages. 3256type GoogleCloudVisionV1p1beta1Product struct { 3257 // Description: User-provided metadata to be stored with this product. 3258 // Must be at most 4096 characters long. 3259 Description string `json:"description,omitempty"` 3260 3261 // DisplayName: The user-provided name for this Product. Must not be 3262 // empty. Must be at most 4096 characters long. 3263 DisplayName string `json:"displayName,omitempty"` 3264 3265 // Name: The resource name of the product. Format is: 3266 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This 3267 // field is ignored when creating a product. 3268 Name string `json:"name,omitempty"` 3269 3270 // ProductCategory: Immutable. The category for the product identified 3271 // by the reference image. This should be one of "homegoods-v2", 3272 // "apparel-v2", "toys-v2", "packagedgoods-v1" or "general-v1". The 3273 // legacy categories "homegoods", "apparel", and "toys" are still 3274 // supported, but these should not be used for new products. 3275 ProductCategory string `json:"productCategory,omitempty"` 3276 3277 // ProductLabels: Key-value pairs that can be attached to a product. At 3278 // query time, constraints can be specified based on the product_labels. 3279 // Note that integer values can be provided as strings, e.g. "1199". 3280 // Only strings with integer values can match a range-based restriction 3281 // which is to be supported soon. Multiple values can be assigned to the 3282 // same key. One product may have up to 500 product_labels. Notice that 3283 // the total number of distinct product_labels over all products in one 3284 // ProductSet cannot exceed 1M, otherwise the product search pipeline 3285 // will refuse to work for that ProductSet. 3286 ProductLabels []*GoogleCloudVisionV1p1beta1ProductKeyValue `json:"productLabels,omitempty"` 3287 3288 // ForceSendFields is a list of field names (e.g. "Description") to 3289 // unconditionally include in API requests. By default, fields with 3290 // empty values are omitted from API requests. However, any non-pointer, 3291 // non-interface field appearing in ForceSendFields will be sent to the 3292 // server regardless of whether the field is empty or not. This may be 3293 // used to include empty fields in Patch requests. 3294 ForceSendFields []string `json:"-"` 3295 3296 // NullFields is a list of field names (e.g. "Description") to include 3297 // in API requests with the JSON null value. By default, fields with 3298 // empty values are omitted from API requests. However, any field with 3299 // an empty value appearing in NullFields will be sent to the server as 3300 // null. It is an error if a field in this list has a non-empty value. 3301 // This may be used to include null fields in Patch requests. 3302 NullFields []string `json:"-"` 3303} 3304 3305func (s *GoogleCloudVisionV1p1beta1Product) MarshalJSON() ([]byte, error) { 3306 type NoMethod GoogleCloudVisionV1p1beta1Product 3307 raw := NoMethod(*s) 3308 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3309} 3310 3311// GoogleCloudVisionV1p1beta1ProductKeyValue: A product label 3312// represented as a key-value pair. 3313type GoogleCloudVisionV1p1beta1ProductKeyValue struct { 3314 // Key: The key of the label attached to the product. Cannot be empty 3315 // and cannot exceed 128 bytes. 3316 Key string `json:"key,omitempty"` 3317 3318 // Value: The value of the label attached to the product. Cannot be 3319 // empty and cannot exceed 128 bytes. 3320 Value string `json:"value,omitempty"` 3321 3322 // ForceSendFields is a list of field names (e.g. "Key") to 3323 // unconditionally include in API requests. By default, fields with 3324 // empty values are omitted from API requests. However, any non-pointer, 3325 // non-interface field appearing in ForceSendFields will be sent to the 3326 // server regardless of whether the field is empty or not. This may be 3327 // used to include empty fields in Patch requests. 3328 ForceSendFields []string `json:"-"` 3329 3330 // NullFields is a list of field names (e.g. "Key") to include in API 3331 // requests with the JSON null value. By default, fields with empty 3332 // values are omitted from API requests. However, any field with an 3333 // empty value appearing in NullFields will be sent to the server as 3334 // null. It is an error if a field in this list has a non-empty value. 3335 // This may be used to include null fields in Patch requests. 3336 NullFields []string `json:"-"` 3337} 3338 3339func (s *GoogleCloudVisionV1p1beta1ProductKeyValue) MarshalJSON() ([]byte, error) { 3340 type NoMethod GoogleCloudVisionV1p1beta1ProductKeyValue 3341 raw := NoMethod(*s) 3342 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3343} 3344 3345// GoogleCloudVisionV1p1beta1ProductSearchResults: Results for a product 3346// search request. 3347type GoogleCloudVisionV1p1beta1ProductSearchResults struct { 3348 // IndexTime: Timestamp of the index which provided these results. 3349 // Products added to the product set and products removed from the 3350 // product set after this time are not reflected in the current results. 3351 IndexTime string `json:"indexTime,omitempty"` 3352 3353 // ProductGroupedResults: List of results grouped by products detected 3354 // in the query image. Each entry corresponds to one bounding polygon in 3355 // the query image, and contains the matching products specific to that 3356 // region. There may be duplicate product matches in the union of all 3357 // the per-product results. 3358 ProductGroupedResults []*GoogleCloudVisionV1p1beta1ProductSearchResultsGroupedResult `json:"productGroupedResults,omitempty"` 3359 3360 // Results: List of results, one for each product match. 3361 Results []*GoogleCloudVisionV1p1beta1ProductSearchResultsResult `json:"results,omitempty"` 3362 3363 // ForceSendFields is a list of field names (e.g. "IndexTime") to 3364 // unconditionally include in API requests. By default, fields with 3365 // empty values are omitted from API requests. However, any non-pointer, 3366 // non-interface field appearing in ForceSendFields will be sent to the 3367 // server regardless of whether the field is empty or not. This may be 3368 // used to include empty fields in Patch requests. 3369 ForceSendFields []string `json:"-"` 3370 3371 // NullFields is a list of field names (e.g. "IndexTime") to include in 3372 // API requests with the JSON null value. By default, fields with empty 3373 // values are omitted from API requests. However, any field with an 3374 // empty value appearing in NullFields will be sent to the server as 3375 // null. It is an error if a field in this list has a non-empty value. 3376 // This may be used to include null fields in Patch requests. 3377 NullFields []string `json:"-"` 3378} 3379 3380func (s *GoogleCloudVisionV1p1beta1ProductSearchResults) MarshalJSON() ([]byte, error) { 3381 type NoMethod GoogleCloudVisionV1p1beta1ProductSearchResults 3382 raw := NoMethod(*s) 3383 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3384} 3385 3386// GoogleCloudVisionV1p1beta1ProductSearchResultsGroupedResult: 3387// Information about the products similar to a single product in a query 3388// image. 3389type GoogleCloudVisionV1p1beta1ProductSearchResultsGroupedResult struct { 3390 // BoundingPoly: The bounding polygon around the product detected in the 3391 // query image. 3392 BoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingPoly,omitempty"` 3393 3394 // ObjectAnnotations: List of generic predictions for the object in the 3395 // bounding box. 3396 ObjectAnnotations []*GoogleCloudVisionV1p1beta1ProductSearchResultsObjectAnnotation `json:"objectAnnotations,omitempty"` 3397 3398 // Results: List of results, one for each product match. 3399 Results []*GoogleCloudVisionV1p1beta1ProductSearchResultsResult `json:"results,omitempty"` 3400 3401 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 3402 // unconditionally include in API requests. By default, fields with 3403 // empty values are omitted from API requests. However, any non-pointer, 3404 // non-interface field appearing in ForceSendFields will be sent to the 3405 // server regardless of whether the field is empty or not. This may be 3406 // used to include empty fields in Patch requests. 3407 ForceSendFields []string `json:"-"` 3408 3409 // NullFields is a list of field names (e.g. "BoundingPoly") to include 3410 // in API requests with the JSON null value. By default, fields with 3411 // empty values are omitted from API requests. However, any field with 3412 // an empty value appearing in NullFields will be sent to the server as 3413 // null. It is an error if a field in this list has a non-empty value. 3414 // This may be used to include null fields in Patch requests. 3415 NullFields []string `json:"-"` 3416} 3417 3418func (s *GoogleCloudVisionV1p1beta1ProductSearchResultsGroupedResult) MarshalJSON() ([]byte, error) { 3419 type NoMethod GoogleCloudVisionV1p1beta1ProductSearchResultsGroupedResult 3420 raw := NoMethod(*s) 3421 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3422} 3423 3424// GoogleCloudVisionV1p1beta1ProductSearchResultsObjectAnnotation: 3425// Prediction for what the object in the bounding box is. 3426type GoogleCloudVisionV1p1beta1ProductSearchResultsObjectAnnotation struct { 3427 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". 3428 // For more information, see 3429 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 3430 LanguageCode string `json:"languageCode,omitempty"` 3431 3432 // Mid: Object ID that should align with EntityAnnotation mid. 3433 Mid string `json:"mid,omitempty"` 3434 3435 // Name: Object name, expressed in its `language_code` language. 3436 Name string `json:"name,omitempty"` 3437 3438 // Score: Score of the result. Range [0, 1]. 3439 Score float64 `json:"score,omitempty"` 3440 3441 // ForceSendFields is a list of field names (e.g. "LanguageCode") to 3442 // unconditionally include in API requests. By default, fields with 3443 // empty values are omitted from API requests. However, any non-pointer, 3444 // non-interface field appearing in ForceSendFields will be sent to the 3445 // server regardless of whether the field is empty or not. This may be 3446 // used to include empty fields in Patch requests. 3447 ForceSendFields []string `json:"-"` 3448 3449 // NullFields is a list of field names (e.g. "LanguageCode") to include 3450 // in API requests with the JSON null value. By default, fields with 3451 // empty values are omitted from API requests. However, any field with 3452 // an empty value appearing in NullFields will be sent to the server as 3453 // null. It is an error if a field in this list has a non-empty value. 3454 // This may be used to include null fields in Patch requests. 3455 NullFields []string `json:"-"` 3456} 3457 3458func (s *GoogleCloudVisionV1p1beta1ProductSearchResultsObjectAnnotation) MarshalJSON() ([]byte, error) { 3459 type NoMethod GoogleCloudVisionV1p1beta1ProductSearchResultsObjectAnnotation 3460 raw := NoMethod(*s) 3461 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3462} 3463 3464func (s *GoogleCloudVisionV1p1beta1ProductSearchResultsObjectAnnotation) UnmarshalJSON(data []byte) error { 3465 type NoMethod GoogleCloudVisionV1p1beta1ProductSearchResultsObjectAnnotation 3466 var s1 struct { 3467 Score gensupport.JSONFloat64 `json:"score"` 3468 *NoMethod 3469 } 3470 s1.NoMethod = (*NoMethod)(s) 3471 if err := json.Unmarshal(data, &s1); err != nil { 3472 return err 3473 } 3474 s.Score = float64(s1.Score) 3475 return nil 3476} 3477 3478// GoogleCloudVisionV1p1beta1ProductSearchResultsResult: Information 3479// about a product. 3480type GoogleCloudVisionV1p1beta1ProductSearchResultsResult struct { 3481 // Image: The resource name of the image from the product that is the 3482 // closest match to the query. 3483 Image string `json:"image,omitempty"` 3484 3485 // Product: The Product. 3486 Product *GoogleCloudVisionV1p1beta1Product `json:"product,omitempty"` 3487 3488 // Score: A confidence level on the match, ranging from 0 (no 3489 // confidence) to 1 (full confidence). 3490 Score float64 `json:"score,omitempty"` 3491 3492 // ForceSendFields is a list of field names (e.g. "Image") to 3493 // unconditionally include in API requests. By default, fields with 3494 // empty values are omitted from API requests. However, any non-pointer, 3495 // non-interface field appearing in ForceSendFields will be sent to the 3496 // server regardless of whether the field is empty or not. This may be 3497 // used to include empty fields in Patch requests. 3498 ForceSendFields []string `json:"-"` 3499 3500 // NullFields is a list of field names (e.g. "Image") to include in API 3501 // requests with the JSON null value. By default, fields with empty 3502 // values are omitted from API requests. However, any field with an 3503 // empty value appearing in NullFields will be sent to the server as 3504 // null. It is an error if a field in this list has a non-empty value. 3505 // This may be used to include null fields in Patch requests. 3506 NullFields []string `json:"-"` 3507} 3508 3509func (s *GoogleCloudVisionV1p1beta1ProductSearchResultsResult) MarshalJSON() ([]byte, error) { 3510 type NoMethod GoogleCloudVisionV1p1beta1ProductSearchResultsResult 3511 raw := NoMethod(*s) 3512 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3513} 3514 3515func (s *GoogleCloudVisionV1p1beta1ProductSearchResultsResult) UnmarshalJSON(data []byte) error { 3516 type NoMethod GoogleCloudVisionV1p1beta1ProductSearchResultsResult 3517 var s1 struct { 3518 Score gensupport.JSONFloat64 `json:"score"` 3519 *NoMethod 3520 } 3521 s1.NoMethod = (*NoMethod)(s) 3522 if err := json.Unmarshal(data, &s1); err != nil { 3523 return err 3524 } 3525 s.Score = float64(s1.Score) 3526 return nil 3527} 3528 3529// GoogleCloudVisionV1p1beta1Property: A `Property` consists of a 3530// user-supplied name/value pair. 3531type GoogleCloudVisionV1p1beta1Property struct { 3532 // Name: Name of the property. 3533 Name string `json:"name,omitempty"` 3534 3535 // Uint64Value: Value of numeric properties. 3536 Uint64Value uint64 `json:"uint64Value,omitempty,string"` 3537 3538 // Value: Value of the property. 3539 Value string `json:"value,omitempty"` 3540 3541 // ForceSendFields is a list of field names (e.g. "Name") to 3542 // unconditionally include in API requests. By default, fields with 3543 // empty values are omitted from API requests. However, any non-pointer, 3544 // non-interface field appearing in ForceSendFields will be sent to the 3545 // server regardless of whether the field is empty or not. This may be 3546 // used to include empty fields in Patch requests. 3547 ForceSendFields []string `json:"-"` 3548 3549 // NullFields is a list of field names (e.g. "Name") to include in API 3550 // requests with the JSON null value. By default, fields with empty 3551 // values are omitted from API requests. However, any field with an 3552 // empty value appearing in NullFields will be sent to the server as 3553 // null. It is an error if a field in this list has a non-empty value. 3554 // This may be used to include null fields in Patch requests. 3555 NullFields []string `json:"-"` 3556} 3557 3558func (s *GoogleCloudVisionV1p1beta1Property) MarshalJSON() ([]byte, error) { 3559 type NoMethod GoogleCloudVisionV1p1beta1Property 3560 raw := NoMethod(*s) 3561 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3562} 3563 3564// GoogleCloudVisionV1p1beta1SafeSearchAnnotation: Set of features 3565// pertaining to the image, computed by computer vision methods over 3566// safe-search verticals (for example, adult, spoof, medical, violence). 3567type GoogleCloudVisionV1p1beta1SafeSearchAnnotation struct { 3568 // Adult: Represents the adult content likelihood for the image. Adult 3569 // content may contain elements such as nudity, pornographic images or 3570 // cartoons, or sexual activities. 3571 // 3572 // Possible values: 3573 // "UNKNOWN" - Unknown likelihood. 3574 // "VERY_UNLIKELY" - It is very unlikely. 3575 // "UNLIKELY" - It is unlikely. 3576 // "POSSIBLE" - It is possible. 3577 // "LIKELY" - It is likely. 3578 // "VERY_LIKELY" - It is very likely. 3579 Adult string `json:"adult,omitempty"` 3580 3581 // Medical: Likelihood that this is a medical image. 3582 // 3583 // Possible values: 3584 // "UNKNOWN" - Unknown likelihood. 3585 // "VERY_UNLIKELY" - It is very unlikely. 3586 // "UNLIKELY" - It is unlikely. 3587 // "POSSIBLE" - It is possible. 3588 // "LIKELY" - It is likely. 3589 // "VERY_LIKELY" - It is very likely. 3590 Medical string `json:"medical,omitempty"` 3591 3592 // Racy: Likelihood that the request image contains racy content. Racy 3593 // content may include (but is not limited to) skimpy or sheer clothing, 3594 // strategically covered nudity, lewd or provocative poses, or close-ups 3595 // of sensitive body areas. 3596 // 3597 // Possible values: 3598 // "UNKNOWN" - Unknown likelihood. 3599 // "VERY_UNLIKELY" - It is very unlikely. 3600 // "UNLIKELY" - It is unlikely. 3601 // "POSSIBLE" - It is possible. 3602 // "LIKELY" - It is likely. 3603 // "VERY_LIKELY" - It is very likely. 3604 Racy string `json:"racy,omitempty"` 3605 3606 // Spoof: Spoof likelihood. The likelihood that an modification was made 3607 // to the image's canonical version to make it appear funny or 3608 // offensive. 3609 // 3610 // Possible values: 3611 // "UNKNOWN" - Unknown likelihood. 3612 // "VERY_UNLIKELY" - It is very unlikely. 3613 // "UNLIKELY" - It is unlikely. 3614 // "POSSIBLE" - It is possible. 3615 // "LIKELY" - It is likely. 3616 // "VERY_LIKELY" - It is very likely. 3617 Spoof string `json:"spoof,omitempty"` 3618 3619 // Violence: Likelihood that this image contains violent content. 3620 // 3621 // Possible values: 3622 // "UNKNOWN" - Unknown likelihood. 3623 // "VERY_UNLIKELY" - It is very unlikely. 3624 // "UNLIKELY" - It is unlikely. 3625 // "POSSIBLE" - It is possible. 3626 // "LIKELY" - It is likely. 3627 // "VERY_LIKELY" - It is very likely. 3628 Violence string `json:"violence,omitempty"` 3629 3630 // ForceSendFields is a list of field names (e.g. "Adult") to 3631 // unconditionally include in API requests. By default, fields with 3632 // empty values are omitted from API requests. However, any non-pointer, 3633 // non-interface field appearing in ForceSendFields will be sent to the 3634 // server regardless of whether the field is empty or not. This may be 3635 // used to include empty fields in Patch requests. 3636 ForceSendFields []string `json:"-"` 3637 3638 // NullFields is a list of field names (e.g. "Adult") to include in API 3639 // requests with the JSON null value. By default, fields with empty 3640 // values are omitted from API requests. However, any field with an 3641 // empty value appearing in NullFields will be sent to the server as 3642 // null. It is an error if a field in this list has a non-empty value. 3643 // This may be used to include null fields in Patch requests. 3644 NullFields []string `json:"-"` 3645} 3646 3647func (s *GoogleCloudVisionV1p1beta1SafeSearchAnnotation) MarshalJSON() ([]byte, error) { 3648 type NoMethod GoogleCloudVisionV1p1beta1SafeSearchAnnotation 3649 raw := NoMethod(*s) 3650 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3651} 3652 3653// GoogleCloudVisionV1p1beta1Symbol: A single symbol representation. 3654type GoogleCloudVisionV1p1beta1Symbol struct { 3655 // BoundingBox: The bounding box for the symbol. The vertices are in the 3656 // order of top-left, top-right, bottom-right, bottom-left. When a 3657 // rotation of the bounding box is detected the rotation is represented 3658 // as around the top-left corner as defined when the text is read in the 3659 // 'natural' orientation. For example: * when the text is horizontal it 3660 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 3661 // around the top-left corner it becomes: 2----3 | | 1----0 and the 3662 // vertex order will still be (0, 1, 2, 3). 3663 BoundingBox *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingBox,omitempty"` 3664 3665 // Confidence: Confidence of the OCR results for the symbol. Range [0, 3666 // 1]. 3667 Confidence float64 `json:"confidence,omitempty"` 3668 3669 // Property: Additional information detected for the symbol. 3670 Property *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty `json:"property,omitempty"` 3671 3672 // Text: The actual UTF-8 representation of the symbol. 3673 Text string `json:"text,omitempty"` 3674 3675 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 3676 // unconditionally include in API requests. By default, fields with 3677 // empty values are omitted from API requests. However, any non-pointer, 3678 // non-interface field appearing in ForceSendFields will be sent to the 3679 // server regardless of whether the field is empty or not. This may be 3680 // used to include empty fields in Patch requests. 3681 ForceSendFields []string `json:"-"` 3682 3683 // NullFields is a list of field names (e.g. "BoundingBox") to include 3684 // in API requests with the JSON null value. By default, fields with 3685 // empty values are omitted from API requests. However, any field with 3686 // an empty value appearing in NullFields will be sent to the server as 3687 // null. It is an error if a field in this list has a non-empty value. 3688 // This may be used to include null fields in Patch requests. 3689 NullFields []string `json:"-"` 3690} 3691 3692func (s *GoogleCloudVisionV1p1beta1Symbol) MarshalJSON() ([]byte, error) { 3693 type NoMethod GoogleCloudVisionV1p1beta1Symbol 3694 raw := NoMethod(*s) 3695 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3696} 3697 3698func (s *GoogleCloudVisionV1p1beta1Symbol) UnmarshalJSON(data []byte) error { 3699 type NoMethod GoogleCloudVisionV1p1beta1Symbol 3700 var s1 struct { 3701 Confidence gensupport.JSONFloat64 `json:"confidence"` 3702 *NoMethod 3703 } 3704 s1.NoMethod = (*NoMethod)(s) 3705 if err := json.Unmarshal(data, &s1); err != nil { 3706 return err 3707 } 3708 s.Confidence = float64(s1.Confidence) 3709 return nil 3710} 3711 3712// GoogleCloudVisionV1p1beta1TextAnnotation: TextAnnotation contains a 3713// structured representation of OCR extracted text. The hierarchy of an 3714// OCR extracted text structure is like this: TextAnnotation -> Page -> 3715// Block -> Paragraph -> Word -> Symbol Each structural component, 3716// starting from Page, may further have their own properties. Properties 3717// describe detected languages, breaks etc.. Please refer to the 3718// TextAnnotation.TextProperty message definition below for more detail. 3719type GoogleCloudVisionV1p1beta1TextAnnotation struct { 3720 // Pages: List of pages detected by OCR. 3721 Pages []*GoogleCloudVisionV1p1beta1Page `json:"pages,omitempty"` 3722 3723 // Text: UTF-8 text detected on the pages. 3724 Text string `json:"text,omitempty"` 3725 3726 // ForceSendFields is a list of field names (e.g. "Pages") to 3727 // unconditionally include in API requests. By default, fields with 3728 // empty values are omitted from API requests. However, any non-pointer, 3729 // non-interface field appearing in ForceSendFields will be sent to the 3730 // server regardless of whether the field is empty or not. This may be 3731 // used to include empty fields in Patch requests. 3732 ForceSendFields []string `json:"-"` 3733 3734 // NullFields is a list of field names (e.g. "Pages") to include in API 3735 // requests with the JSON null value. By default, fields with empty 3736 // values are omitted from API requests. However, any field with an 3737 // empty value appearing in NullFields will be sent to the server as 3738 // null. It is an error if a field in this list has a non-empty value. 3739 // This may be used to include null fields in Patch requests. 3740 NullFields []string `json:"-"` 3741} 3742 3743func (s *GoogleCloudVisionV1p1beta1TextAnnotation) MarshalJSON() ([]byte, error) { 3744 type NoMethod GoogleCloudVisionV1p1beta1TextAnnotation 3745 raw := NoMethod(*s) 3746 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3747} 3748 3749// GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak: Detected start 3750// or end of a structural component. 3751type GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak struct { 3752 // IsPrefix: True if break prepends the element. 3753 IsPrefix bool `json:"isPrefix,omitempty"` 3754 3755 // Type: Detected break type. 3756 // 3757 // Possible values: 3758 // "UNKNOWN" - Unknown break label type. 3759 // "SPACE" - Regular space. 3760 // "SURE_SPACE" - Sure space (very wide). 3761 // "EOL_SURE_SPACE" - Line-wrapping break. 3762 // "HYPHEN" - End-line hyphen that is not present in text; does not 3763 // co-occur with `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. 3764 // "LINE_BREAK" - Line break that ends a paragraph. 3765 Type string `json:"type,omitempty"` 3766 3767 // ForceSendFields is a list of field names (e.g. "IsPrefix") to 3768 // unconditionally include in API requests. By default, fields with 3769 // empty values are omitted from API requests. However, any non-pointer, 3770 // non-interface field appearing in ForceSendFields will be sent to the 3771 // server regardless of whether the field is empty or not. This may be 3772 // used to include empty fields in Patch requests. 3773 ForceSendFields []string `json:"-"` 3774 3775 // NullFields is a list of field names (e.g. "IsPrefix") to include in 3776 // API requests with the JSON null value. By default, fields with empty 3777 // values are omitted from API requests. However, any field with an 3778 // empty value appearing in NullFields will be sent to the server as 3779 // null. It is an error if a field in this list has a non-empty value. 3780 // This may be used to include null fields in Patch requests. 3781 NullFields []string `json:"-"` 3782} 3783 3784func (s *GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak) MarshalJSON() ([]byte, error) { 3785 type NoMethod GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak 3786 raw := NoMethod(*s) 3787 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3788} 3789 3790// GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage: Detected 3791// language for a structural component. 3792type GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage struct { 3793 // Confidence: Confidence of detected language. Range [0, 1]. 3794 Confidence float64 `json:"confidence,omitempty"` 3795 3796 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". 3797 // For more information, see 3798 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 3799 LanguageCode string `json:"languageCode,omitempty"` 3800 3801 // ForceSendFields is a list of field names (e.g. "Confidence") to 3802 // unconditionally include in API requests. By default, fields with 3803 // empty values are omitted from API requests. However, any non-pointer, 3804 // non-interface field appearing in ForceSendFields will be sent to the 3805 // server regardless of whether the field is empty or not. This may be 3806 // used to include empty fields in Patch requests. 3807 ForceSendFields []string `json:"-"` 3808 3809 // NullFields is a list of field names (e.g. "Confidence") to include in 3810 // API requests with the JSON null value. By default, fields with empty 3811 // values are omitted from API requests. However, any field with an 3812 // empty value appearing in NullFields will be sent to the server as 3813 // null. It is an error if a field in this list has a non-empty value. 3814 // This may be used to include null fields in Patch requests. 3815 NullFields []string `json:"-"` 3816} 3817 3818func (s *GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage) MarshalJSON() ([]byte, error) { 3819 type NoMethod GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage 3820 raw := NoMethod(*s) 3821 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3822} 3823 3824func (s *GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage) UnmarshalJSON(data []byte) error { 3825 type NoMethod GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage 3826 var s1 struct { 3827 Confidence gensupport.JSONFloat64 `json:"confidence"` 3828 *NoMethod 3829 } 3830 s1.NoMethod = (*NoMethod)(s) 3831 if err := json.Unmarshal(data, &s1); err != nil { 3832 return err 3833 } 3834 s.Confidence = float64(s1.Confidence) 3835 return nil 3836} 3837 3838// GoogleCloudVisionV1p1beta1TextAnnotationTextProperty: Additional 3839// information detected on the structural component. 3840type GoogleCloudVisionV1p1beta1TextAnnotationTextProperty struct { 3841 // DetectedBreak: Detected start or end of a text segment. 3842 DetectedBreak *GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak `json:"detectedBreak,omitempty"` 3843 3844 // DetectedLanguages: A list of detected languages together with 3845 // confidence. 3846 DetectedLanguages []*GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage `json:"detectedLanguages,omitempty"` 3847 3848 // ForceSendFields is a list of field names (e.g. "DetectedBreak") to 3849 // unconditionally include in API requests. By default, fields with 3850 // empty values are omitted from API requests. However, any non-pointer, 3851 // non-interface field appearing in ForceSendFields will be sent to the 3852 // server regardless of whether the field is empty or not. This may be 3853 // used to include empty fields in Patch requests. 3854 ForceSendFields []string `json:"-"` 3855 3856 // NullFields is a list of field names (e.g. "DetectedBreak") to include 3857 // in API requests with the JSON null value. By default, fields with 3858 // empty values are omitted from API requests. However, any field with 3859 // an empty value appearing in NullFields will be sent to the server as 3860 // null. It is an error if a field in this list has a non-empty value. 3861 // This may be used to include null fields in Patch requests. 3862 NullFields []string `json:"-"` 3863} 3864 3865func (s *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty) MarshalJSON() ([]byte, error) { 3866 type NoMethod GoogleCloudVisionV1p1beta1TextAnnotationTextProperty 3867 raw := NoMethod(*s) 3868 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3869} 3870 3871// GoogleCloudVisionV1p1beta1Vertex: A vertex represents a 2D point in 3872// the image. NOTE: the vertex coordinates are in the same scale as the 3873// original image. 3874type GoogleCloudVisionV1p1beta1Vertex struct { 3875 // X: X coordinate. 3876 X int64 `json:"x,omitempty"` 3877 3878 // Y: Y coordinate. 3879 Y int64 `json:"y,omitempty"` 3880 3881 // ForceSendFields is a list of field names (e.g. "X") to 3882 // unconditionally include in API requests. By default, fields with 3883 // empty values are omitted from API requests. However, any non-pointer, 3884 // non-interface field appearing in ForceSendFields will be sent to the 3885 // server regardless of whether the field is empty or not. This may be 3886 // used to include empty fields in Patch requests. 3887 ForceSendFields []string `json:"-"` 3888 3889 // NullFields is a list of field names (e.g. "X") to include in API 3890 // requests with the JSON null value. By default, fields with empty 3891 // values are omitted from API requests. However, any field with an 3892 // empty value appearing in NullFields will be sent to the server as 3893 // null. It is an error if a field in this list has a non-empty value. 3894 // This may be used to include null fields in Patch requests. 3895 NullFields []string `json:"-"` 3896} 3897 3898func (s *GoogleCloudVisionV1p1beta1Vertex) MarshalJSON() ([]byte, error) { 3899 type NoMethod GoogleCloudVisionV1p1beta1Vertex 3900 raw := NoMethod(*s) 3901 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3902} 3903 3904// GoogleCloudVisionV1p1beta1WebDetection: Relevant information for the 3905// image from the Internet. 3906type GoogleCloudVisionV1p1beta1WebDetection struct { 3907 // BestGuessLabels: The service's best guess as to the topic of the 3908 // request image. Inferred from similar images on the open web. 3909 BestGuessLabels []*GoogleCloudVisionV1p1beta1WebDetectionWebLabel `json:"bestGuessLabels,omitempty"` 3910 3911 // FullMatchingImages: Fully matching images from the Internet. Can 3912 // include resized copies of the query image. 3913 FullMatchingImages []*GoogleCloudVisionV1p1beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"` 3914 3915 // PagesWithMatchingImages: Web pages containing the matching images 3916 // from the Internet. 3917 PagesWithMatchingImages []*GoogleCloudVisionV1p1beta1WebDetectionWebPage `json:"pagesWithMatchingImages,omitempty"` 3918 3919 // PartialMatchingImages: Partial matching images from the Internet. 3920 // Those images are similar enough to share some key-point features. For 3921 // example an original image will likely have partial matching for its 3922 // crops. 3923 PartialMatchingImages []*GoogleCloudVisionV1p1beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"` 3924 3925 // VisuallySimilarImages: The visually similar image results. 3926 VisuallySimilarImages []*GoogleCloudVisionV1p1beta1WebDetectionWebImage `json:"visuallySimilarImages,omitempty"` 3927 3928 // WebEntities: Deduced entities from similar images on the Internet. 3929 WebEntities []*GoogleCloudVisionV1p1beta1WebDetectionWebEntity `json:"webEntities,omitempty"` 3930 3931 // ForceSendFields is a list of field names (e.g. "BestGuessLabels") to 3932 // unconditionally include in API requests. By default, fields with 3933 // empty values are omitted from API requests. However, any non-pointer, 3934 // non-interface field appearing in ForceSendFields will be sent to the 3935 // server regardless of whether the field is empty or not. This may be 3936 // used to include empty fields in Patch requests. 3937 ForceSendFields []string `json:"-"` 3938 3939 // NullFields is a list of field names (e.g. "BestGuessLabels") to 3940 // include in API requests with the JSON null value. By default, fields 3941 // with empty values are omitted from API requests. However, any field 3942 // with an empty value appearing in NullFields will be sent to the 3943 // server as null. It is an error if a field in this list has a 3944 // non-empty value. This may be used to include null fields in Patch 3945 // requests. 3946 NullFields []string `json:"-"` 3947} 3948 3949func (s *GoogleCloudVisionV1p1beta1WebDetection) MarshalJSON() ([]byte, error) { 3950 type NoMethod GoogleCloudVisionV1p1beta1WebDetection 3951 raw := NoMethod(*s) 3952 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3953} 3954 3955// GoogleCloudVisionV1p1beta1WebDetectionWebEntity: Entity deduced from 3956// similar images on the Internet. 3957type GoogleCloudVisionV1p1beta1WebDetectionWebEntity struct { 3958 // Description: Canonical description of the entity, in English. 3959 Description string `json:"description,omitempty"` 3960 3961 // EntityId: Opaque entity ID. 3962 EntityId string `json:"entityId,omitempty"` 3963 3964 // Score: Overall relevancy score for the entity. Not normalized and not 3965 // comparable across different image queries. 3966 Score float64 `json:"score,omitempty"` 3967 3968 // ForceSendFields is a list of field names (e.g. "Description") to 3969 // unconditionally include in API requests. By default, fields with 3970 // empty values are omitted from API requests. However, any non-pointer, 3971 // non-interface field appearing in ForceSendFields will be sent to the 3972 // server regardless of whether the field is empty or not. This may be 3973 // used to include empty fields in Patch requests. 3974 ForceSendFields []string `json:"-"` 3975 3976 // NullFields is a list of field names (e.g. "Description") to include 3977 // in API requests with the JSON null value. By default, fields with 3978 // empty values are omitted from API requests. However, any field with 3979 // an empty value appearing in NullFields will be sent to the server as 3980 // null. It is an error if a field in this list has a non-empty value. 3981 // This may be used to include null fields in Patch requests. 3982 NullFields []string `json:"-"` 3983} 3984 3985func (s *GoogleCloudVisionV1p1beta1WebDetectionWebEntity) MarshalJSON() ([]byte, error) { 3986 type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebEntity 3987 raw := NoMethod(*s) 3988 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3989} 3990 3991func (s *GoogleCloudVisionV1p1beta1WebDetectionWebEntity) UnmarshalJSON(data []byte) error { 3992 type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebEntity 3993 var s1 struct { 3994 Score gensupport.JSONFloat64 `json:"score"` 3995 *NoMethod 3996 } 3997 s1.NoMethod = (*NoMethod)(s) 3998 if err := json.Unmarshal(data, &s1); err != nil { 3999 return err 4000 } 4001 s.Score = float64(s1.Score) 4002 return nil 4003} 4004 4005// GoogleCloudVisionV1p1beta1WebDetectionWebImage: Metadata for online 4006// images. 4007type GoogleCloudVisionV1p1beta1WebDetectionWebImage struct { 4008 // Score: (Deprecated) Overall relevancy score for the image. 4009 Score float64 `json:"score,omitempty"` 4010 4011 // Url: The result image URL. 4012 Url string `json:"url,omitempty"` 4013 4014 // ForceSendFields is a list of field names (e.g. "Score") to 4015 // unconditionally include in API requests. By default, fields with 4016 // empty values are omitted from API requests. However, any non-pointer, 4017 // non-interface field appearing in ForceSendFields will be sent to the 4018 // server regardless of whether the field is empty or not. This may be 4019 // used to include empty fields in Patch requests. 4020 ForceSendFields []string `json:"-"` 4021 4022 // NullFields is a list of field names (e.g. "Score") to include in API 4023 // requests with the JSON null value. By default, fields with empty 4024 // values are omitted from API requests. However, any field with an 4025 // empty value appearing in NullFields will be sent to the server as 4026 // null. It is an error if a field in this list has a non-empty value. 4027 // This may be used to include null fields in Patch requests. 4028 NullFields []string `json:"-"` 4029} 4030 4031func (s *GoogleCloudVisionV1p1beta1WebDetectionWebImage) MarshalJSON() ([]byte, error) { 4032 type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebImage 4033 raw := NoMethod(*s) 4034 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4035} 4036 4037func (s *GoogleCloudVisionV1p1beta1WebDetectionWebImage) UnmarshalJSON(data []byte) error { 4038 type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebImage 4039 var s1 struct { 4040 Score gensupport.JSONFloat64 `json:"score"` 4041 *NoMethod 4042 } 4043 s1.NoMethod = (*NoMethod)(s) 4044 if err := json.Unmarshal(data, &s1); err != nil { 4045 return err 4046 } 4047 s.Score = float64(s1.Score) 4048 return nil 4049} 4050 4051// GoogleCloudVisionV1p1beta1WebDetectionWebLabel: Label to provide 4052// extra metadata for the web detection. 4053type GoogleCloudVisionV1p1beta1WebDetectionWebLabel struct { 4054 // Label: Label for extra metadata. 4055 Label string `json:"label,omitempty"` 4056 4057 // LanguageCode: The BCP-47 language code for `label`, such as "en-US" 4058 // or "sr-Latn". For more information, see 4059 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 4060 LanguageCode string `json:"languageCode,omitempty"` 4061 4062 // ForceSendFields is a list of field names (e.g. "Label") to 4063 // unconditionally include in API requests. By default, fields with 4064 // empty values are omitted from API requests. However, any non-pointer, 4065 // non-interface field appearing in ForceSendFields will be sent to the 4066 // server regardless of whether the field is empty or not. This may be 4067 // used to include empty fields in Patch requests. 4068 ForceSendFields []string `json:"-"` 4069 4070 // NullFields is a list of field names (e.g. "Label") to include in API 4071 // requests with the JSON null value. By default, fields with empty 4072 // values are omitted from API requests. However, any field with an 4073 // empty value appearing in NullFields will be sent to the server as 4074 // null. It is an error if a field in this list has a non-empty value. 4075 // This may be used to include null fields in Patch requests. 4076 NullFields []string `json:"-"` 4077} 4078 4079func (s *GoogleCloudVisionV1p1beta1WebDetectionWebLabel) MarshalJSON() ([]byte, error) { 4080 type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebLabel 4081 raw := NoMethod(*s) 4082 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4083} 4084 4085// GoogleCloudVisionV1p1beta1WebDetectionWebPage: Metadata for web 4086// pages. 4087type GoogleCloudVisionV1p1beta1WebDetectionWebPage struct { 4088 // FullMatchingImages: Fully matching images on the page. Can include 4089 // resized copies of the query image. 4090 FullMatchingImages []*GoogleCloudVisionV1p1beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"` 4091 4092 // PageTitle: Title for the web page, may contain HTML markups. 4093 PageTitle string `json:"pageTitle,omitempty"` 4094 4095 // PartialMatchingImages: Partial matching images on the page. Those 4096 // images are similar enough to share some key-point features. For 4097 // example an original image will likely have partial matching for its 4098 // crops. 4099 PartialMatchingImages []*GoogleCloudVisionV1p1beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"` 4100 4101 // Score: (Deprecated) Overall relevancy score for the web page. 4102 Score float64 `json:"score,omitempty"` 4103 4104 // Url: The result web page URL. 4105 Url string `json:"url,omitempty"` 4106 4107 // ForceSendFields is a list of field names (e.g. "FullMatchingImages") 4108 // to unconditionally include in API requests. By default, fields with 4109 // empty values are omitted from API requests. However, any non-pointer, 4110 // non-interface field appearing in ForceSendFields will be sent to the 4111 // server regardless of whether the field is empty or not. This may be 4112 // used to include empty fields in Patch requests. 4113 ForceSendFields []string `json:"-"` 4114 4115 // NullFields is a list of field names (e.g. "FullMatchingImages") to 4116 // include in API requests with the JSON null value. By default, fields 4117 // with empty values are omitted from API requests. However, any field 4118 // with an empty value appearing in NullFields will be sent to the 4119 // server as null. It is an error if a field in this list has a 4120 // non-empty value. This may be used to include null fields in Patch 4121 // requests. 4122 NullFields []string `json:"-"` 4123} 4124 4125func (s *GoogleCloudVisionV1p1beta1WebDetectionWebPage) MarshalJSON() ([]byte, error) { 4126 type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebPage 4127 raw := NoMethod(*s) 4128 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4129} 4130 4131func (s *GoogleCloudVisionV1p1beta1WebDetectionWebPage) UnmarshalJSON(data []byte) error { 4132 type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebPage 4133 var s1 struct { 4134 Score gensupport.JSONFloat64 `json:"score"` 4135 *NoMethod 4136 } 4137 s1.NoMethod = (*NoMethod)(s) 4138 if err := json.Unmarshal(data, &s1); err != nil { 4139 return err 4140 } 4141 s.Score = float64(s1.Score) 4142 return nil 4143} 4144 4145// GoogleCloudVisionV1p1beta1Word: A word representation. 4146type GoogleCloudVisionV1p1beta1Word struct { 4147 // BoundingBox: The bounding box for the word. The vertices are in the 4148 // order of top-left, top-right, bottom-right, bottom-left. When a 4149 // rotation of the bounding box is detected the rotation is represented 4150 // as around the top-left corner as defined when the text is read in the 4151 // 'natural' orientation. For example: * when the text is horizontal it 4152 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 4153 // around the top-left corner it becomes: 2----3 | | 1----0 and the 4154 // vertex order will still be (0, 1, 2, 3). 4155 BoundingBox *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingBox,omitempty"` 4156 4157 // Confidence: Confidence of the OCR results for the word. Range [0, 1]. 4158 Confidence float64 `json:"confidence,omitempty"` 4159 4160 // Property: Additional information detected for the word. 4161 Property *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty `json:"property,omitempty"` 4162 4163 // Symbols: List of symbols in the word. The order of the symbols 4164 // follows the natural reading order. 4165 Symbols []*GoogleCloudVisionV1p1beta1Symbol `json:"symbols,omitempty"` 4166 4167 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 4168 // unconditionally include in API requests. By default, fields with 4169 // empty values are omitted from API requests. However, any non-pointer, 4170 // non-interface field appearing in ForceSendFields will be sent to the 4171 // server regardless of whether the field is empty or not. This may be 4172 // used to include empty fields in Patch requests. 4173 ForceSendFields []string `json:"-"` 4174 4175 // NullFields is a list of field names (e.g. "BoundingBox") to include 4176 // in API requests with the JSON null value. By default, fields with 4177 // empty values are omitted from API requests. However, any field with 4178 // an empty value appearing in NullFields will be sent to the server as 4179 // null. It is an error if a field in this list has a non-empty value. 4180 // This may be used to include null fields in Patch requests. 4181 NullFields []string `json:"-"` 4182} 4183 4184func (s *GoogleCloudVisionV1p1beta1Word) MarshalJSON() ([]byte, error) { 4185 type NoMethod GoogleCloudVisionV1p1beta1Word 4186 raw := NoMethod(*s) 4187 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4188} 4189 4190func (s *GoogleCloudVisionV1p1beta1Word) UnmarshalJSON(data []byte) error { 4191 type NoMethod GoogleCloudVisionV1p1beta1Word 4192 var s1 struct { 4193 Confidence gensupport.JSONFloat64 `json:"confidence"` 4194 *NoMethod 4195 } 4196 s1.NoMethod = (*NoMethod)(s) 4197 if err := json.Unmarshal(data, &s1); err != nil { 4198 return err 4199 } 4200 s.Confidence = float64(s1.Confidence) 4201 return nil 4202} 4203 4204// GoogleCloudVisionV1p2beta1AnnotateFileResponse: Response to a single 4205// file annotation request. A file may contain one or more images, which 4206// individually have their own responses. 4207type GoogleCloudVisionV1p2beta1AnnotateFileResponse struct { 4208 // Error: If set, represents the error message for the failed request. 4209 // The `responses` field will not be set in this case. 4210 Error *Status `json:"error,omitempty"` 4211 4212 // InputConfig: Information about the file for which this response is 4213 // generated. 4214 InputConfig *GoogleCloudVisionV1p2beta1InputConfig `json:"inputConfig,omitempty"` 4215 4216 // Responses: Individual responses to images found within the file. This 4217 // field will be empty if the `error` field is set. 4218 Responses []*GoogleCloudVisionV1p2beta1AnnotateImageResponse `json:"responses,omitempty"` 4219 4220 // TotalPages: This field gives the total number of pages in the file. 4221 TotalPages int64 `json:"totalPages,omitempty"` 4222 4223 // ForceSendFields is a list of field names (e.g. "Error") to 4224 // unconditionally include in API requests. By default, fields with 4225 // empty values are omitted from API requests. However, any non-pointer, 4226 // non-interface field appearing in ForceSendFields will be sent to the 4227 // server regardless of whether the field is empty or not. This may be 4228 // used to include empty fields in Patch requests. 4229 ForceSendFields []string `json:"-"` 4230 4231 // NullFields is a list of field names (e.g. "Error") to include in API 4232 // requests with the JSON null value. By default, fields with empty 4233 // values are omitted from API requests. However, any field with an 4234 // empty value appearing in NullFields will be sent to the server as 4235 // null. It is an error if a field in this list has a non-empty value. 4236 // This may be used to include null fields in Patch requests. 4237 NullFields []string `json:"-"` 4238} 4239 4240func (s *GoogleCloudVisionV1p2beta1AnnotateFileResponse) MarshalJSON() ([]byte, error) { 4241 type NoMethod GoogleCloudVisionV1p2beta1AnnotateFileResponse 4242 raw := NoMethod(*s) 4243 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4244} 4245 4246// GoogleCloudVisionV1p2beta1AnnotateImageResponse: Response to an image 4247// annotation request. 4248type GoogleCloudVisionV1p2beta1AnnotateImageResponse struct { 4249 // Context: If present, contextual information is needed to understand 4250 // where this image comes from. 4251 Context *GoogleCloudVisionV1p2beta1ImageAnnotationContext `json:"context,omitempty"` 4252 4253 // CropHintsAnnotation: If present, crop hints have completed 4254 // successfully. 4255 CropHintsAnnotation *GoogleCloudVisionV1p2beta1CropHintsAnnotation `json:"cropHintsAnnotation,omitempty"` 4256 4257 // Error: If set, represents the error message for the operation. Note 4258 // that filled-in image annotations are guaranteed to be correct, even 4259 // when `error` is set. 4260 Error *Status `json:"error,omitempty"` 4261 4262 // FaceAnnotations: If present, face detection has completed 4263 // successfully. 4264 FaceAnnotations []*GoogleCloudVisionV1p2beta1FaceAnnotation `json:"faceAnnotations,omitempty"` 4265 4266 // FullTextAnnotation: If present, text (OCR) detection or document 4267 // (OCR) text detection has completed successfully. This annotation 4268 // provides the structural hierarchy for the OCR detected text. 4269 FullTextAnnotation *GoogleCloudVisionV1p2beta1TextAnnotation `json:"fullTextAnnotation,omitempty"` 4270 4271 // ImagePropertiesAnnotation: If present, image properties were 4272 // extracted successfully. 4273 ImagePropertiesAnnotation *GoogleCloudVisionV1p2beta1ImageProperties `json:"imagePropertiesAnnotation,omitempty"` 4274 4275 // LabelAnnotations: If present, label detection has completed 4276 // successfully. 4277 LabelAnnotations []*GoogleCloudVisionV1p2beta1EntityAnnotation `json:"labelAnnotations,omitempty"` 4278 4279 // LandmarkAnnotations: If present, landmark detection has completed 4280 // successfully. 4281 LandmarkAnnotations []*GoogleCloudVisionV1p2beta1EntityAnnotation `json:"landmarkAnnotations,omitempty"` 4282 4283 // LocalizedObjectAnnotations: If present, localized object detection 4284 // has completed successfully. This will be sorted descending by 4285 // confidence score. 4286 LocalizedObjectAnnotations []*GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation `json:"localizedObjectAnnotations,omitempty"` 4287 4288 // LogoAnnotations: If present, logo detection has completed 4289 // successfully. 4290 LogoAnnotations []*GoogleCloudVisionV1p2beta1EntityAnnotation `json:"logoAnnotations,omitempty"` 4291 4292 // ProductSearchResults: If present, product search has completed 4293 // successfully. 4294 ProductSearchResults *GoogleCloudVisionV1p2beta1ProductSearchResults `json:"productSearchResults,omitempty"` 4295 4296 // SafeSearchAnnotation: If present, safe-search annotation has 4297 // completed successfully. 4298 SafeSearchAnnotation *GoogleCloudVisionV1p2beta1SafeSearchAnnotation `json:"safeSearchAnnotation,omitempty"` 4299 4300 // TextAnnotations: If present, text (OCR) detection has completed 4301 // successfully. 4302 TextAnnotations []*GoogleCloudVisionV1p2beta1EntityAnnotation `json:"textAnnotations,omitempty"` 4303 4304 // WebDetection: If present, web detection has completed successfully. 4305 WebDetection *GoogleCloudVisionV1p2beta1WebDetection `json:"webDetection,omitempty"` 4306 4307 // ForceSendFields is a list of field names (e.g. "Context") to 4308 // unconditionally include in API requests. By default, fields with 4309 // empty values are omitted from API requests. However, any non-pointer, 4310 // non-interface field appearing in ForceSendFields will be sent to the 4311 // server regardless of whether the field is empty or not. This may be 4312 // used to include empty fields in Patch requests. 4313 ForceSendFields []string `json:"-"` 4314 4315 // NullFields is a list of field names (e.g. "Context") to include in 4316 // API requests with the JSON null value. By default, fields with empty 4317 // values are omitted from API requests. However, any field with an 4318 // empty value appearing in NullFields will be sent to the server as 4319 // null. It is an error if a field in this list has a non-empty value. 4320 // This may be used to include null fields in Patch requests. 4321 NullFields []string `json:"-"` 4322} 4323 4324func (s *GoogleCloudVisionV1p2beta1AnnotateImageResponse) MarshalJSON() ([]byte, error) { 4325 type NoMethod GoogleCloudVisionV1p2beta1AnnotateImageResponse 4326 raw := NoMethod(*s) 4327 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4328} 4329 4330// GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse: The response for 4331// a single offline file annotation request. 4332type GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse struct { 4333 // OutputConfig: The output location and metadata from 4334 // AsyncAnnotateFileRequest. 4335 OutputConfig *GoogleCloudVisionV1p2beta1OutputConfig `json:"outputConfig,omitempty"` 4336 4337 // ForceSendFields is a list of field names (e.g. "OutputConfig") to 4338 // unconditionally include in API requests. By default, fields with 4339 // empty values are omitted from API requests. However, any non-pointer, 4340 // non-interface field appearing in ForceSendFields will be sent to the 4341 // server regardless of whether the field is empty or not. This may be 4342 // used to include empty fields in Patch requests. 4343 ForceSendFields []string `json:"-"` 4344 4345 // NullFields is a list of field names (e.g. "OutputConfig") to include 4346 // in API requests with the JSON null value. By default, fields with 4347 // empty values are omitted from API requests. However, any field with 4348 // an empty value appearing in NullFields will be sent to the server as 4349 // null. It is an error if a field in this list has a non-empty value. 4350 // This may be used to include null fields in Patch requests. 4351 NullFields []string `json:"-"` 4352} 4353 4354func (s *GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse) MarshalJSON() ([]byte, error) { 4355 type NoMethod GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse 4356 raw := NoMethod(*s) 4357 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4358} 4359 4360// GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse: Response 4361// to an async batch file annotation request. 4362type GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse struct { 4363 // Responses: The list of file annotation responses, one for each 4364 // request in AsyncBatchAnnotateFilesRequest. 4365 Responses []*GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse `json:"responses,omitempty"` 4366 4367 // ForceSendFields is a list of field names (e.g. "Responses") to 4368 // unconditionally include in API requests. By default, fields with 4369 // empty values are omitted from API requests. However, any non-pointer, 4370 // non-interface field appearing in ForceSendFields will be sent to the 4371 // server regardless of whether the field is empty or not. This may be 4372 // used to include empty fields in Patch requests. 4373 ForceSendFields []string `json:"-"` 4374 4375 // NullFields is a list of field names (e.g. "Responses") to include in 4376 // API requests with the JSON null value. By default, fields with empty 4377 // values are omitted from API requests. However, any field with an 4378 // empty value appearing in NullFields will be sent to the server as 4379 // null. It is an error if a field in this list has a non-empty value. 4380 // This may be used to include null fields in Patch requests. 4381 NullFields []string `json:"-"` 4382} 4383 4384func (s *GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) { 4385 type NoMethod GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse 4386 raw := NoMethod(*s) 4387 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4388} 4389 4390// GoogleCloudVisionV1p2beta1Block: Logical element on the page. 4391type GoogleCloudVisionV1p2beta1Block struct { 4392 // BlockType: Detected block type (text, image etc) for this block. 4393 // 4394 // Possible values: 4395 // "UNKNOWN" - Unknown block type. 4396 // "TEXT" - Regular text block. 4397 // "TABLE" - Table block. 4398 // "PICTURE" - Image block. 4399 // "RULER" - Horizontal/vertical line box. 4400 // "BARCODE" - Barcode block. 4401 BlockType string `json:"blockType,omitempty"` 4402 4403 // BoundingBox: The bounding box for the block. The vertices are in the 4404 // order of top-left, top-right, bottom-right, bottom-left. When a 4405 // rotation of the bounding box is detected the rotation is represented 4406 // as around the top-left corner as defined when the text is read in the 4407 // 'natural' orientation. For example: * when the text is horizontal it 4408 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 4409 // around the top-left corner it becomes: 2----3 | | 1----0 and the 4410 // vertex order will still be (0, 1, 2, 3). 4411 BoundingBox *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingBox,omitempty"` 4412 4413 // Confidence: Confidence of the OCR results on the block. Range [0, 1]. 4414 Confidence float64 `json:"confidence,omitempty"` 4415 4416 // Paragraphs: List of paragraphs in this block (if this blocks is of 4417 // type text). 4418 Paragraphs []*GoogleCloudVisionV1p2beta1Paragraph `json:"paragraphs,omitempty"` 4419 4420 // Property: Additional information detected for the block. 4421 Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"` 4422 4423 // ForceSendFields is a list of field names (e.g. "BlockType") to 4424 // unconditionally include in API requests. By default, fields with 4425 // empty values are omitted from API requests. However, any non-pointer, 4426 // non-interface field appearing in ForceSendFields will be sent to the 4427 // server regardless of whether the field is empty or not. This may be 4428 // used to include empty fields in Patch requests. 4429 ForceSendFields []string `json:"-"` 4430 4431 // NullFields is a list of field names (e.g. "BlockType") to include in 4432 // API requests with the JSON null value. By default, fields with empty 4433 // values are omitted from API requests. However, any field with an 4434 // empty value appearing in NullFields will be sent to the server as 4435 // null. It is an error if a field in this list has a non-empty value. 4436 // This may be used to include null fields in Patch requests. 4437 NullFields []string `json:"-"` 4438} 4439 4440func (s *GoogleCloudVisionV1p2beta1Block) MarshalJSON() ([]byte, error) { 4441 type NoMethod GoogleCloudVisionV1p2beta1Block 4442 raw := NoMethod(*s) 4443 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4444} 4445 4446func (s *GoogleCloudVisionV1p2beta1Block) UnmarshalJSON(data []byte) error { 4447 type NoMethod GoogleCloudVisionV1p2beta1Block 4448 var s1 struct { 4449 Confidence gensupport.JSONFloat64 `json:"confidence"` 4450 *NoMethod 4451 } 4452 s1.NoMethod = (*NoMethod)(s) 4453 if err := json.Unmarshal(data, &s1); err != nil { 4454 return err 4455 } 4456 s.Confidence = float64(s1.Confidence) 4457 return nil 4458} 4459 4460// GoogleCloudVisionV1p2beta1BoundingPoly: A bounding polygon for the 4461// detected image annotation. 4462type GoogleCloudVisionV1p2beta1BoundingPoly struct { 4463 // NormalizedVertices: The bounding polygon normalized vertices. 4464 NormalizedVertices []*GoogleCloudVisionV1p2beta1NormalizedVertex `json:"normalizedVertices,omitempty"` 4465 4466 // Vertices: The bounding polygon vertices. 4467 Vertices []*GoogleCloudVisionV1p2beta1Vertex `json:"vertices,omitempty"` 4468 4469 // ForceSendFields is a list of field names (e.g. "NormalizedVertices") 4470 // to unconditionally include in API requests. By default, fields with 4471 // empty values are omitted from API requests. However, any non-pointer, 4472 // non-interface field appearing in ForceSendFields will be sent to the 4473 // server regardless of whether the field is empty or not. This may be 4474 // used to include empty fields in Patch requests. 4475 ForceSendFields []string `json:"-"` 4476 4477 // NullFields is a list of field names (e.g. "NormalizedVertices") to 4478 // include in API requests with the JSON null value. By default, fields 4479 // with empty values are omitted from API requests. However, any field 4480 // with an empty value appearing in NullFields will be sent to the 4481 // server as null. It is an error if a field in this list has a 4482 // non-empty value. This may be used to include null fields in Patch 4483 // requests. 4484 NullFields []string `json:"-"` 4485} 4486 4487func (s *GoogleCloudVisionV1p2beta1BoundingPoly) MarshalJSON() ([]byte, error) { 4488 type NoMethod GoogleCloudVisionV1p2beta1BoundingPoly 4489 raw := NoMethod(*s) 4490 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4491} 4492 4493// GoogleCloudVisionV1p2beta1ColorInfo: Color information consists of 4494// RGB channels, score, and the fraction of the image that the color 4495// occupies in the image. 4496type GoogleCloudVisionV1p2beta1ColorInfo struct { 4497 // Color: RGB components of the color. 4498 Color *Color `json:"color,omitempty"` 4499 4500 // PixelFraction: The fraction of pixels the color occupies in the 4501 // image. Value in range [0, 1]. 4502 PixelFraction float64 `json:"pixelFraction,omitempty"` 4503 4504 // Score: Image-specific score for this color. Value in range [0, 1]. 4505 Score float64 `json:"score,omitempty"` 4506 4507 // ForceSendFields is a list of field names (e.g. "Color") to 4508 // unconditionally include in API requests. By default, fields with 4509 // empty values are omitted from API requests. However, any non-pointer, 4510 // non-interface field appearing in ForceSendFields will be sent to the 4511 // server regardless of whether the field is empty or not. This may be 4512 // used to include empty fields in Patch requests. 4513 ForceSendFields []string `json:"-"` 4514 4515 // NullFields is a list of field names (e.g. "Color") to include in API 4516 // requests with the JSON null value. By default, fields with empty 4517 // values are omitted from API requests. However, any field with an 4518 // empty value appearing in NullFields will be sent to the server as 4519 // null. It is an error if a field in this list has a non-empty value. 4520 // This may be used to include null fields in Patch requests. 4521 NullFields []string `json:"-"` 4522} 4523 4524func (s *GoogleCloudVisionV1p2beta1ColorInfo) MarshalJSON() ([]byte, error) { 4525 type NoMethod GoogleCloudVisionV1p2beta1ColorInfo 4526 raw := NoMethod(*s) 4527 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4528} 4529 4530func (s *GoogleCloudVisionV1p2beta1ColorInfo) UnmarshalJSON(data []byte) error { 4531 type NoMethod GoogleCloudVisionV1p2beta1ColorInfo 4532 var s1 struct { 4533 PixelFraction gensupport.JSONFloat64 `json:"pixelFraction"` 4534 Score gensupport.JSONFloat64 `json:"score"` 4535 *NoMethod 4536 } 4537 s1.NoMethod = (*NoMethod)(s) 4538 if err := json.Unmarshal(data, &s1); err != nil { 4539 return err 4540 } 4541 s.PixelFraction = float64(s1.PixelFraction) 4542 s.Score = float64(s1.Score) 4543 return nil 4544} 4545 4546// GoogleCloudVisionV1p2beta1CropHint: Single crop hint that is used to 4547// generate a new crop when serving an image. 4548type GoogleCloudVisionV1p2beta1CropHint struct { 4549 // BoundingPoly: The bounding polygon for the crop region. The 4550 // coordinates of the bounding box are in the original image's scale. 4551 BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"` 4552 4553 // Confidence: Confidence of this being a salient region. Range [0, 1]. 4554 Confidence float64 `json:"confidence,omitempty"` 4555 4556 // ImportanceFraction: Fraction of importance of this salient region 4557 // with respect to the original image. 4558 ImportanceFraction float64 `json:"importanceFraction,omitempty"` 4559 4560 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 4561 // unconditionally include in API requests. By default, fields with 4562 // empty values are omitted from API requests. However, any non-pointer, 4563 // non-interface field appearing in ForceSendFields will be sent to the 4564 // server regardless of whether the field is empty or not. This may be 4565 // used to include empty fields in Patch requests. 4566 ForceSendFields []string `json:"-"` 4567 4568 // NullFields is a list of field names (e.g. "BoundingPoly") to include 4569 // in API requests with the JSON null value. By default, fields with 4570 // empty values are omitted from API requests. However, any field with 4571 // an empty value appearing in NullFields will be sent to the server as 4572 // null. It is an error if a field in this list has a non-empty value. 4573 // This may be used to include null fields in Patch requests. 4574 NullFields []string `json:"-"` 4575} 4576 4577func (s *GoogleCloudVisionV1p2beta1CropHint) MarshalJSON() ([]byte, error) { 4578 type NoMethod GoogleCloudVisionV1p2beta1CropHint 4579 raw := NoMethod(*s) 4580 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4581} 4582 4583func (s *GoogleCloudVisionV1p2beta1CropHint) UnmarshalJSON(data []byte) error { 4584 type NoMethod GoogleCloudVisionV1p2beta1CropHint 4585 var s1 struct { 4586 Confidence gensupport.JSONFloat64 `json:"confidence"` 4587 ImportanceFraction gensupport.JSONFloat64 `json:"importanceFraction"` 4588 *NoMethod 4589 } 4590 s1.NoMethod = (*NoMethod)(s) 4591 if err := json.Unmarshal(data, &s1); err != nil { 4592 return err 4593 } 4594 s.Confidence = float64(s1.Confidence) 4595 s.ImportanceFraction = float64(s1.ImportanceFraction) 4596 return nil 4597} 4598 4599// GoogleCloudVisionV1p2beta1CropHintsAnnotation: Set of crop hints that 4600// are used to generate new crops when serving images. 4601type GoogleCloudVisionV1p2beta1CropHintsAnnotation struct { 4602 // CropHints: Crop hint results. 4603 CropHints []*GoogleCloudVisionV1p2beta1CropHint `json:"cropHints,omitempty"` 4604 4605 // ForceSendFields is a list of field names (e.g. "CropHints") to 4606 // unconditionally include in API requests. By default, fields with 4607 // empty values are omitted from API requests. However, any non-pointer, 4608 // non-interface field appearing in ForceSendFields will be sent to the 4609 // server regardless of whether the field is empty or not. This may be 4610 // used to include empty fields in Patch requests. 4611 ForceSendFields []string `json:"-"` 4612 4613 // NullFields is a list of field names (e.g. "CropHints") to include in 4614 // API requests with the JSON null value. By default, fields with empty 4615 // values are omitted from API requests. However, any field with an 4616 // empty value appearing in NullFields will be sent to the server as 4617 // null. It is an error if a field in this list has a non-empty value. 4618 // This may be used to include null fields in Patch requests. 4619 NullFields []string `json:"-"` 4620} 4621 4622func (s *GoogleCloudVisionV1p2beta1CropHintsAnnotation) MarshalJSON() ([]byte, error) { 4623 type NoMethod GoogleCloudVisionV1p2beta1CropHintsAnnotation 4624 raw := NoMethod(*s) 4625 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4626} 4627 4628// GoogleCloudVisionV1p2beta1DominantColorsAnnotation: Set of dominant 4629// colors and their corresponding scores. 4630type GoogleCloudVisionV1p2beta1DominantColorsAnnotation struct { 4631 // Colors: RGB color values with their score and pixel fraction. 4632 Colors []*GoogleCloudVisionV1p2beta1ColorInfo `json:"colors,omitempty"` 4633 4634 // ForceSendFields is a list of field names (e.g. "Colors") to 4635 // unconditionally include in API requests. By default, fields with 4636 // empty values are omitted from API requests. However, any non-pointer, 4637 // non-interface field appearing in ForceSendFields will be sent to the 4638 // server regardless of whether the field is empty or not. This may be 4639 // used to include empty fields in Patch requests. 4640 ForceSendFields []string `json:"-"` 4641 4642 // NullFields is a list of field names (e.g. "Colors") to include in API 4643 // requests with the JSON null value. By default, fields with empty 4644 // values are omitted from API requests. However, any field with an 4645 // empty value appearing in NullFields will be sent to the server as 4646 // null. It is an error if a field in this list has a non-empty value. 4647 // This may be used to include null fields in Patch requests. 4648 NullFields []string `json:"-"` 4649} 4650 4651func (s *GoogleCloudVisionV1p2beta1DominantColorsAnnotation) MarshalJSON() ([]byte, error) { 4652 type NoMethod GoogleCloudVisionV1p2beta1DominantColorsAnnotation 4653 raw := NoMethod(*s) 4654 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4655} 4656 4657// GoogleCloudVisionV1p2beta1EntityAnnotation: Set of detected entity 4658// features. 4659type GoogleCloudVisionV1p2beta1EntityAnnotation struct { 4660 // BoundingPoly: Image region to which this entity belongs. Not produced 4661 // for `LABEL_DETECTION` features. 4662 BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"` 4663 4664 // Confidence: **Deprecated. Use `score` instead.** The accuracy of the 4665 // entity detection in an image. For example, for an image in which the 4666 // "Eiffel Tower" entity is detected, this field represents the 4667 // confidence that there is a tower in the query image. Range [0, 1]. 4668 Confidence float64 `json:"confidence,omitempty"` 4669 4670 // Description: Entity textual description, expressed in its `locale` 4671 // language. 4672 Description string `json:"description,omitempty"` 4673 4674 // Locale: The language code for the locale in which the entity textual 4675 // `description` is expressed. 4676 Locale string `json:"locale,omitempty"` 4677 4678 // Locations: The location information for the detected entity. Multiple 4679 // `LocationInfo` elements can be present because one location may 4680 // indicate the location of the scene in the image, and another location 4681 // may indicate the location of the place where the image was taken. 4682 // Location information is usually present for landmarks. 4683 Locations []*GoogleCloudVisionV1p2beta1LocationInfo `json:"locations,omitempty"` 4684 4685 // Mid: Opaque entity ID. Some IDs may be available in [Google Knowledge 4686 // Graph Search API](https://developers.google.com/knowledge-graph/). 4687 Mid string `json:"mid,omitempty"` 4688 4689 // Properties: Some entities may have optional user-supplied `Property` 4690 // (name/value) fields, such a score or string that qualifies the 4691 // entity. 4692 Properties []*GoogleCloudVisionV1p2beta1Property `json:"properties,omitempty"` 4693 4694 // Score: Overall score of the result. Range [0, 1]. 4695 Score float64 `json:"score,omitempty"` 4696 4697 // Topicality: The relevancy of the ICA (Image Content Annotation) label 4698 // to the image. For example, the relevancy of "tower" is likely higher 4699 // to an image containing the detected "Eiffel Tower" than to an image 4700 // containing a detected distant towering building, even though the 4701 // confidence that there is a tower in each image may be the same. Range 4702 // [0, 1]. 4703 Topicality float64 `json:"topicality,omitempty"` 4704 4705 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 4706 // unconditionally include in API requests. By default, fields with 4707 // empty values are omitted from API requests. However, any non-pointer, 4708 // non-interface field appearing in ForceSendFields will be sent to the 4709 // server regardless of whether the field is empty or not. This may be 4710 // used to include empty fields in Patch requests. 4711 ForceSendFields []string `json:"-"` 4712 4713 // NullFields is a list of field names (e.g. "BoundingPoly") to include 4714 // in API requests with the JSON null value. By default, fields with 4715 // empty values are omitted from API requests. However, any field with 4716 // an empty value appearing in NullFields will be sent to the server as 4717 // null. It is an error if a field in this list has a non-empty value. 4718 // This may be used to include null fields in Patch requests. 4719 NullFields []string `json:"-"` 4720} 4721 4722func (s *GoogleCloudVisionV1p2beta1EntityAnnotation) MarshalJSON() ([]byte, error) { 4723 type NoMethod GoogleCloudVisionV1p2beta1EntityAnnotation 4724 raw := NoMethod(*s) 4725 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4726} 4727 4728func (s *GoogleCloudVisionV1p2beta1EntityAnnotation) UnmarshalJSON(data []byte) error { 4729 type NoMethod GoogleCloudVisionV1p2beta1EntityAnnotation 4730 var s1 struct { 4731 Confidence gensupport.JSONFloat64 `json:"confidence"` 4732 Score gensupport.JSONFloat64 `json:"score"` 4733 Topicality gensupport.JSONFloat64 `json:"topicality"` 4734 *NoMethod 4735 } 4736 s1.NoMethod = (*NoMethod)(s) 4737 if err := json.Unmarshal(data, &s1); err != nil { 4738 return err 4739 } 4740 s.Confidence = float64(s1.Confidence) 4741 s.Score = float64(s1.Score) 4742 s.Topicality = float64(s1.Topicality) 4743 return nil 4744} 4745 4746// GoogleCloudVisionV1p2beta1FaceAnnotation: A face annotation object 4747// contains the results of face detection. 4748type GoogleCloudVisionV1p2beta1FaceAnnotation struct { 4749 // AngerLikelihood: Anger likelihood. 4750 // 4751 // Possible values: 4752 // "UNKNOWN" - Unknown likelihood. 4753 // "VERY_UNLIKELY" - It is very unlikely. 4754 // "UNLIKELY" - It is unlikely. 4755 // "POSSIBLE" - It is possible. 4756 // "LIKELY" - It is likely. 4757 // "VERY_LIKELY" - It is very likely. 4758 AngerLikelihood string `json:"angerLikelihood,omitempty"` 4759 4760 // BlurredLikelihood: Blurred likelihood. 4761 // 4762 // Possible values: 4763 // "UNKNOWN" - Unknown likelihood. 4764 // "VERY_UNLIKELY" - It is very unlikely. 4765 // "UNLIKELY" - It is unlikely. 4766 // "POSSIBLE" - It is possible. 4767 // "LIKELY" - It is likely. 4768 // "VERY_LIKELY" - It is very likely. 4769 BlurredLikelihood string `json:"blurredLikelihood,omitempty"` 4770 4771 // BoundingPoly: The bounding polygon around the face. The coordinates 4772 // of the bounding box are in the original image's scale. The bounding 4773 // box is computed to "frame" the face in accordance with human 4774 // expectations. It is based on the landmarker results. Note that one or 4775 // more x and/or y coordinates may not be generated in the 4776 // `BoundingPoly` (the polygon will be unbounded) if only a partial face 4777 // appears in the image to be annotated. 4778 BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"` 4779 4780 // DetectionConfidence: Detection confidence. Range [0, 1]. 4781 DetectionConfidence float64 `json:"detectionConfidence,omitempty"` 4782 4783 // FdBoundingPoly: The `fd_bounding_poly` bounding polygon is tighter 4784 // than the `boundingPoly`, and encloses only the skin part of the face. 4785 // Typically, it is used to eliminate the face from any image analysis 4786 // that detects the "amount of skin" visible in an image. It is not 4787 // based on the landmarker results, only on the initial face detection, 4788 // hence the fd (face detection) prefix. 4789 FdBoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"fdBoundingPoly,omitempty"` 4790 4791 // HeadwearLikelihood: Headwear likelihood. 4792 // 4793 // Possible values: 4794 // "UNKNOWN" - Unknown likelihood. 4795 // "VERY_UNLIKELY" - It is very unlikely. 4796 // "UNLIKELY" - It is unlikely. 4797 // "POSSIBLE" - It is possible. 4798 // "LIKELY" - It is likely. 4799 // "VERY_LIKELY" - It is very likely. 4800 HeadwearLikelihood string `json:"headwearLikelihood,omitempty"` 4801 4802 // JoyLikelihood: Joy likelihood. 4803 // 4804 // Possible values: 4805 // "UNKNOWN" - Unknown likelihood. 4806 // "VERY_UNLIKELY" - It is very unlikely. 4807 // "UNLIKELY" - It is unlikely. 4808 // "POSSIBLE" - It is possible. 4809 // "LIKELY" - It is likely. 4810 // "VERY_LIKELY" - It is very likely. 4811 JoyLikelihood string `json:"joyLikelihood,omitempty"` 4812 4813 // LandmarkingConfidence: Face landmarking confidence. Range [0, 1]. 4814 LandmarkingConfidence float64 `json:"landmarkingConfidence,omitempty"` 4815 4816 // Landmarks: Detected face landmarks. 4817 Landmarks []*GoogleCloudVisionV1p2beta1FaceAnnotationLandmark `json:"landmarks,omitempty"` 4818 4819 // PanAngle: Yaw angle, which indicates the leftward/rightward angle 4820 // that the face is pointing relative to the vertical plane 4821 // perpendicular to the image. Range [-180,180]. 4822 PanAngle float64 `json:"panAngle,omitempty"` 4823 4824 // RollAngle: Roll angle, which indicates the amount of 4825 // clockwise/anti-clockwise rotation of the face relative to the image 4826 // vertical about the axis perpendicular to the face. Range [-180,180]. 4827 RollAngle float64 `json:"rollAngle,omitempty"` 4828 4829 // SorrowLikelihood: Sorrow likelihood. 4830 // 4831 // Possible values: 4832 // "UNKNOWN" - Unknown likelihood. 4833 // "VERY_UNLIKELY" - It is very unlikely. 4834 // "UNLIKELY" - It is unlikely. 4835 // "POSSIBLE" - It is possible. 4836 // "LIKELY" - It is likely. 4837 // "VERY_LIKELY" - It is very likely. 4838 SorrowLikelihood string `json:"sorrowLikelihood,omitempty"` 4839 4840 // SurpriseLikelihood: Surprise likelihood. 4841 // 4842 // Possible values: 4843 // "UNKNOWN" - Unknown likelihood. 4844 // "VERY_UNLIKELY" - It is very unlikely. 4845 // "UNLIKELY" - It is unlikely. 4846 // "POSSIBLE" - It is possible. 4847 // "LIKELY" - It is likely. 4848 // "VERY_LIKELY" - It is very likely. 4849 SurpriseLikelihood string `json:"surpriseLikelihood,omitempty"` 4850 4851 // TiltAngle: Pitch angle, which indicates the upwards/downwards angle 4852 // that the face is pointing relative to the image's horizontal plane. 4853 // Range [-180,180]. 4854 TiltAngle float64 `json:"tiltAngle,omitempty"` 4855 4856 // UnderExposedLikelihood: Under-exposed likelihood. 4857 // 4858 // Possible values: 4859 // "UNKNOWN" - Unknown likelihood. 4860 // "VERY_UNLIKELY" - It is very unlikely. 4861 // "UNLIKELY" - It is unlikely. 4862 // "POSSIBLE" - It is possible. 4863 // "LIKELY" - It is likely. 4864 // "VERY_LIKELY" - It is very likely. 4865 UnderExposedLikelihood string `json:"underExposedLikelihood,omitempty"` 4866 4867 // ForceSendFields is a list of field names (e.g. "AngerLikelihood") to 4868 // unconditionally include in API requests. By default, fields with 4869 // empty values are omitted from API requests. However, any non-pointer, 4870 // non-interface field appearing in ForceSendFields will be sent to the 4871 // server regardless of whether the field is empty or not. This may be 4872 // used to include empty fields in Patch requests. 4873 ForceSendFields []string `json:"-"` 4874 4875 // NullFields is a list of field names (e.g. "AngerLikelihood") to 4876 // include in API requests with the JSON null value. By default, fields 4877 // with empty values are omitted from API requests. However, any field 4878 // with an empty value appearing in NullFields will be sent to the 4879 // server as null. It is an error if a field in this list has a 4880 // non-empty value. This may be used to include null fields in Patch 4881 // requests. 4882 NullFields []string `json:"-"` 4883} 4884 4885func (s *GoogleCloudVisionV1p2beta1FaceAnnotation) MarshalJSON() ([]byte, error) { 4886 type NoMethod GoogleCloudVisionV1p2beta1FaceAnnotation 4887 raw := NoMethod(*s) 4888 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4889} 4890 4891func (s *GoogleCloudVisionV1p2beta1FaceAnnotation) UnmarshalJSON(data []byte) error { 4892 type NoMethod GoogleCloudVisionV1p2beta1FaceAnnotation 4893 var s1 struct { 4894 DetectionConfidence gensupport.JSONFloat64 `json:"detectionConfidence"` 4895 LandmarkingConfidence gensupport.JSONFloat64 `json:"landmarkingConfidence"` 4896 PanAngle gensupport.JSONFloat64 `json:"panAngle"` 4897 RollAngle gensupport.JSONFloat64 `json:"rollAngle"` 4898 TiltAngle gensupport.JSONFloat64 `json:"tiltAngle"` 4899 *NoMethod 4900 } 4901 s1.NoMethod = (*NoMethod)(s) 4902 if err := json.Unmarshal(data, &s1); err != nil { 4903 return err 4904 } 4905 s.DetectionConfidence = float64(s1.DetectionConfidence) 4906 s.LandmarkingConfidence = float64(s1.LandmarkingConfidence) 4907 s.PanAngle = float64(s1.PanAngle) 4908 s.RollAngle = float64(s1.RollAngle) 4909 s.TiltAngle = float64(s1.TiltAngle) 4910 return nil 4911} 4912 4913// GoogleCloudVisionV1p2beta1FaceAnnotationLandmark: A face-specific 4914// landmark (for example, a face feature). 4915type GoogleCloudVisionV1p2beta1FaceAnnotationLandmark struct { 4916 // Position: Face landmark position. 4917 Position *GoogleCloudVisionV1p2beta1Position `json:"position,omitempty"` 4918 4919 // Type: Face landmark type. 4920 // 4921 // Possible values: 4922 // "UNKNOWN_LANDMARK" - Unknown face landmark detected. Should not be 4923 // filled. 4924 // "LEFT_EYE" - Left eye. 4925 // "RIGHT_EYE" - Right eye. 4926 // "LEFT_OF_LEFT_EYEBROW" - Left of left eyebrow. 4927 // "RIGHT_OF_LEFT_EYEBROW" - Right of left eyebrow. 4928 // "LEFT_OF_RIGHT_EYEBROW" - Left of right eyebrow. 4929 // "RIGHT_OF_RIGHT_EYEBROW" - Right of right eyebrow. 4930 // "MIDPOINT_BETWEEN_EYES" - Midpoint between eyes. 4931 // "NOSE_TIP" - Nose tip. 4932 // "UPPER_LIP" - Upper lip. 4933 // "LOWER_LIP" - Lower lip. 4934 // "MOUTH_LEFT" - Mouth left. 4935 // "MOUTH_RIGHT" - Mouth right. 4936 // "MOUTH_CENTER" - Mouth center. 4937 // "NOSE_BOTTOM_RIGHT" - Nose, bottom right. 4938 // "NOSE_BOTTOM_LEFT" - Nose, bottom left. 4939 // "NOSE_BOTTOM_CENTER" - Nose, bottom center. 4940 // "LEFT_EYE_TOP_BOUNDARY" - Left eye, top boundary. 4941 // "LEFT_EYE_RIGHT_CORNER" - Left eye, right corner. 4942 // "LEFT_EYE_BOTTOM_BOUNDARY" - Left eye, bottom boundary. 4943 // "LEFT_EYE_LEFT_CORNER" - Left eye, left corner. 4944 // "RIGHT_EYE_TOP_BOUNDARY" - Right eye, top boundary. 4945 // "RIGHT_EYE_RIGHT_CORNER" - Right eye, right corner. 4946 // "RIGHT_EYE_BOTTOM_BOUNDARY" - Right eye, bottom boundary. 4947 // "RIGHT_EYE_LEFT_CORNER" - Right eye, left corner. 4948 // "LEFT_EYEBROW_UPPER_MIDPOINT" - Left eyebrow, upper midpoint. 4949 // "RIGHT_EYEBROW_UPPER_MIDPOINT" - Right eyebrow, upper midpoint. 4950 // "LEFT_EAR_TRAGION" - Left ear tragion. 4951 // "RIGHT_EAR_TRAGION" - Right ear tragion. 4952 // "LEFT_EYE_PUPIL" - Left eye pupil. 4953 // "RIGHT_EYE_PUPIL" - Right eye pupil. 4954 // "FOREHEAD_GLABELLA" - Forehead glabella. 4955 // "CHIN_GNATHION" - Chin gnathion. 4956 // "CHIN_LEFT_GONION" - Chin left gonion. 4957 // "CHIN_RIGHT_GONION" - Chin right gonion. 4958 // "LEFT_CHEEK_CENTER" - Left cheek center. 4959 // "RIGHT_CHEEK_CENTER" - Right cheek center. 4960 Type string `json:"type,omitempty"` 4961 4962 // ForceSendFields is a list of field names (e.g. "Position") to 4963 // unconditionally include in API requests. By default, fields with 4964 // empty values are omitted from API requests. However, any non-pointer, 4965 // non-interface field appearing in ForceSendFields will be sent to the 4966 // server regardless of whether the field is empty or not. This may be 4967 // used to include empty fields in Patch requests. 4968 ForceSendFields []string `json:"-"` 4969 4970 // NullFields is a list of field names (e.g. "Position") to include in 4971 // API requests with the JSON null value. By default, fields with empty 4972 // values are omitted from API requests. However, any field with an 4973 // empty value appearing in NullFields will be sent to the server as 4974 // null. It is an error if a field in this list has a non-empty value. 4975 // This may be used to include null fields in Patch requests. 4976 NullFields []string `json:"-"` 4977} 4978 4979func (s *GoogleCloudVisionV1p2beta1FaceAnnotationLandmark) MarshalJSON() ([]byte, error) { 4980 type NoMethod GoogleCloudVisionV1p2beta1FaceAnnotationLandmark 4981 raw := NoMethod(*s) 4982 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4983} 4984 4985// GoogleCloudVisionV1p2beta1GcsDestination: The Google Cloud Storage 4986// location where the output will be written to. 4987type GoogleCloudVisionV1p2beta1GcsDestination struct { 4988 // Uri: Google Cloud Storage URI prefix where the results will be 4989 // stored. Results will be in JSON format and preceded by its 4990 // corresponding input URI prefix. This field can either represent a gcs 4991 // file prefix or gcs directory. In either case, the uri should be 4992 // unique because in order to get all of the output files, you will need 4993 // to do a wildcard gcs search on the uri prefix you provide. Examples: 4994 // * File Prefix: gs://bucket-name/here/filenameprefix The output files 4995 // will be created in gs://bucket-name/here/ and the names of the output 4996 // files will begin with "filenameprefix". * Directory Prefix: 4997 // gs://bucket-name/some/location/ The output files will be created in 4998 // gs://bucket-name/some/location/ and the names of the output files 4999 // could be anything because there was no filename prefix specified. If 5000 // multiple outputs, each response is still AnnotateFileResponse, each 5001 // of which contains some subset of the full list of 5002 // AnnotateImageResponse. Multiple outputs can happen if, for example, 5003 // the output JSON is too large and overflows into multiple sharded 5004 // files. 5005 Uri string `json:"uri,omitempty"` 5006 5007 // ForceSendFields is a list of field names (e.g. "Uri") to 5008 // unconditionally include in API requests. By default, fields with 5009 // empty values are omitted from API requests. However, any non-pointer, 5010 // non-interface field appearing in ForceSendFields will be sent to the 5011 // server regardless of whether the field is empty or not. This may be 5012 // used to include empty fields in Patch requests. 5013 ForceSendFields []string `json:"-"` 5014 5015 // NullFields is a list of field names (e.g. "Uri") to include in API 5016 // requests with the JSON null value. By default, fields with empty 5017 // values are omitted from API requests. However, any field with an 5018 // empty value appearing in NullFields will be sent to the server as 5019 // null. It is an error if a field in this list has a non-empty value. 5020 // This may be used to include null fields in Patch requests. 5021 NullFields []string `json:"-"` 5022} 5023 5024func (s *GoogleCloudVisionV1p2beta1GcsDestination) MarshalJSON() ([]byte, error) { 5025 type NoMethod GoogleCloudVisionV1p2beta1GcsDestination 5026 raw := NoMethod(*s) 5027 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5028} 5029 5030// GoogleCloudVisionV1p2beta1GcsSource: The Google Cloud Storage 5031// location where the input will be read from. 5032type GoogleCloudVisionV1p2beta1GcsSource struct { 5033 // Uri: Google Cloud Storage URI for the input file. This must only be a 5034 // Google Cloud Storage object. Wildcards are not currently supported. 5035 Uri string `json:"uri,omitempty"` 5036 5037 // ForceSendFields is a list of field names (e.g. "Uri") to 5038 // unconditionally include in API requests. By default, fields with 5039 // empty values are omitted from API requests. However, any non-pointer, 5040 // non-interface field appearing in ForceSendFields will be sent to the 5041 // server regardless of whether the field is empty or not. This may be 5042 // used to include empty fields in Patch requests. 5043 ForceSendFields []string `json:"-"` 5044 5045 // NullFields is a list of field names (e.g. "Uri") to include in API 5046 // requests with the JSON null value. By default, fields with empty 5047 // values are omitted from API requests. However, any field with an 5048 // empty value appearing in NullFields will be sent to the server as 5049 // null. It is an error if a field in this list has a non-empty value. 5050 // This may be used to include null fields in Patch requests. 5051 NullFields []string `json:"-"` 5052} 5053 5054func (s *GoogleCloudVisionV1p2beta1GcsSource) MarshalJSON() ([]byte, error) { 5055 type NoMethod GoogleCloudVisionV1p2beta1GcsSource 5056 raw := NoMethod(*s) 5057 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5058} 5059 5060// GoogleCloudVisionV1p2beta1ImageAnnotationContext: If an image was 5061// produced from a file (e.g. a PDF), this message gives information 5062// about the source of that image. 5063type GoogleCloudVisionV1p2beta1ImageAnnotationContext struct { 5064 // PageNumber: If the file was a PDF or TIFF, this field gives the page 5065 // number within the file used to produce the image. 5066 PageNumber int64 `json:"pageNumber,omitempty"` 5067 5068 // Uri: The URI of the file used to produce the image. 5069 Uri string `json:"uri,omitempty"` 5070 5071 // ForceSendFields is a list of field names (e.g. "PageNumber") to 5072 // unconditionally include in API requests. By default, fields with 5073 // empty values are omitted from API requests. However, any non-pointer, 5074 // non-interface field appearing in ForceSendFields will be sent to the 5075 // server regardless of whether the field is empty or not. This may be 5076 // used to include empty fields in Patch requests. 5077 ForceSendFields []string `json:"-"` 5078 5079 // NullFields is a list of field names (e.g. "PageNumber") to include in 5080 // API requests with the JSON null value. By default, fields with empty 5081 // values are omitted from API requests. However, any field with an 5082 // empty value appearing in NullFields will be sent to the server as 5083 // null. It is an error if a field in this list has a non-empty value. 5084 // This may be used to include null fields in Patch requests. 5085 NullFields []string `json:"-"` 5086} 5087 5088func (s *GoogleCloudVisionV1p2beta1ImageAnnotationContext) MarshalJSON() ([]byte, error) { 5089 type NoMethod GoogleCloudVisionV1p2beta1ImageAnnotationContext 5090 raw := NoMethod(*s) 5091 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5092} 5093 5094// GoogleCloudVisionV1p2beta1ImageProperties: Stores image properties, 5095// such as dominant colors. 5096type GoogleCloudVisionV1p2beta1ImageProperties struct { 5097 // DominantColors: If present, dominant colors completed successfully. 5098 DominantColors *GoogleCloudVisionV1p2beta1DominantColorsAnnotation `json:"dominantColors,omitempty"` 5099 5100 // ForceSendFields is a list of field names (e.g. "DominantColors") to 5101 // unconditionally include in API requests. By default, fields with 5102 // empty values are omitted from API requests. However, any non-pointer, 5103 // non-interface field appearing in ForceSendFields will be sent to the 5104 // server regardless of whether the field is empty or not. This may be 5105 // used to include empty fields in Patch requests. 5106 ForceSendFields []string `json:"-"` 5107 5108 // NullFields is a list of field names (e.g. "DominantColors") to 5109 // include in API requests with the JSON null value. By default, fields 5110 // with empty values are omitted from API requests. However, any field 5111 // with an empty value appearing in NullFields will be sent to the 5112 // server as null. It is an error if a field in this list has a 5113 // non-empty value. This may be used to include null fields in Patch 5114 // requests. 5115 NullFields []string `json:"-"` 5116} 5117 5118func (s *GoogleCloudVisionV1p2beta1ImageProperties) MarshalJSON() ([]byte, error) { 5119 type NoMethod GoogleCloudVisionV1p2beta1ImageProperties 5120 raw := NoMethod(*s) 5121 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5122} 5123 5124// GoogleCloudVisionV1p2beta1InputConfig: The desired input location and 5125// metadata. 5126type GoogleCloudVisionV1p2beta1InputConfig struct { 5127 // Content: File content, represented as a stream of bytes. Note: As 5128 // with all `bytes` fields, protobuffers use a pure binary 5129 // representation, whereas JSON representations use base64. Currently, 5130 // this field only works for BatchAnnotateFiles requests. It does not 5131 // work for AsyncBatchAnnotateFiles requests. 5132 Content string `json:"content,omitempty"` 5133 5134 // GcsSource: The Google Cloud Storage location to read the input from. 5135 GcsSource *GoogleCloudVisionV1p2beta1GcsSource `json:"gcsSource,omitempty"` 5136 5137 // MimeType: The type of the file. Currently only "application/pdf", 5138 // "image/tiff" and "image/gif" are supported. Wildcards are not 5139 // supported. 5140 MimeType string `json:"mimeType,omitempty"` 5141 5142 // ForceSendFields is a list of field names (e.g. "Content") to 5143 // unconditionally include in API requests. By default, fields with 5144 // empty values are omitted from API requests. However, any non-pointer, 5145 // non-interface field appearing in ForceSendFields will be sent to the 5146 // server regardless of whether the field is empty or not. This may be 5147 // used to include empty fields in Patch requests. 5148 ForceSendFields []string `json:"-"` 5149 5150 // NullFields is a list of field names (e.g. "Content") to include in 5151 // API requests with the JSON null value. By default, fields with empty 5152 // values are omitted from API requests. However, any field with an 5153 // empty value appearing in NullFields will be sent to the server as 5154 // null. It is an error if a field in this list has a non-empty value. 5155 // This may be used to include null fields in Patch requests. 5156 NullFields []string `json:"-"` 5157} 5158 5159func (s *GoogleCloudVisionV1p2beta1InputConfig) MarshalJSON() ([]byte, error) { 5160 type NoMethod GoogleCloudVisionV1p2beta1InputConfig 5161 raw := NoMethod(*s) 5162 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5163} 5164 5165// GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation: Set of detected 5166// objects with bounding boxes. 5167type GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation struct { 5168 // BoundingPoly: Image region to which this object belongs. This must be 5169 // populated. 5170 BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"` 5171 5172 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". 5173 // For more information, see 5174 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 5175 LanguageCode string `json:"languageCode,omitempty"` 5176 5177 // Mid: Object ID that should align with EntityAnnotation mid. 5178 Mid string `json:"mid,omitempty"` 5179 5180 // Name: Object name, expressed in its `language_code` language. 5181 Name string `json:"name,omitempty"` 5182 5183 // Score: Score of the result. Range [0, 1]. 5184 Score float64 `json:"score,omitempty"` 5185 5186 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 5187 // unconditionally include in API requests. By default, fields with 5188 // empty values are omitted from API requests. However, any non-pointer, 5189 // non-interface field appearing in ForceSendFields will be sent to the 5190 // server regardless of whether the field is empty or not. This may be 5191 // used to include empty fields in Patch requests. 5192 ForceSendFields []string `json:"-"` 5193 5194 // NullFields is a list of field names (e.g. "BoundingPoly") to include 5195 // in API requests with the JSON null value. By default, fields with 5196 // empty values are omitted from API requests. However, any field with 5197 // an empty value appearing in NullFields will be sent to the server as 5198 // null. It is an error if a field in this list has a non-empty value. 5199 // This may be used to include null fields in Patch requests. 5200 NullFields []string `json:"-"` 5201} 5202 5203func (s *GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation) MarshalJSON() ([]byte, error) { 5204 type NoMethod GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation 5205 raw := NoMethod(*s) 5206 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5207} 5208 5209func (s *GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation) UnmarshalJSON(data []byte) error { 5210 type NoMethod GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation 5211 var s1 struct { 5212 Score gensupport.JSONFloat64 `json:"score"` 5213 *NoMethod 5214 } 5215 s1.NoMethod = (*NoMethod)(s) 5216 if err := json.Unmarshal(data, &s1); err != nil { 5217 return err 5218 } 5219 s.Score = float64(s1.Score) 5220 return nil 5221} 5222 5223// GoogleCloudVisionV1p2beta1LocationInfo: Detected entity location 5224// information. 5225type GoogleCloudVisionV1p2beta1LocationInfo struct { 5226 // LatLng: lat/long location coordinates. 5227 LatLng *LatLng `json:"latLng,omitempty"` 5228 5229 // ForceSendFields is a list of field names (e.g. "LatLng") to 5230 // unconditionally include in API requests. By default, fields with 5231 // empty values are omitted from API requests. However, any non-pointer, 5232 // non-interface field appearing in ForceSendFields will be sent to the 5233 // server regardless of whether the field is empty or not. This may be 5234 // used to include empty fields in Patch requests. 5235 ForceSendFields []string `json:"-"` 5236 5237 // NullFields is a list of field names (e.g. "LatLng") to include in API 5238 // requests with the JSON null value. By default, fields with empty 5239 // values are omitted from API requests. However, any field with an 5240 // empty value appearing in NullFields will be sent to the server as 5241 // null. It is an error if a field in this list has a non-empty value. 5242 // This may be used to include null fields in Patch requests. 5243 NullFields []string `json:"-"` 5244} 5245 5246func (s *GoogleCloudVisionV1p2beta1LocationInfo) MarshalJSON() ([]byte, error) { 5247 type NoMethod GoogleCloudVisionV1p2beta1LocationInfo 5248 raw := NoMethod(*s) 5249 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5250} 5251 5252// GoogleCloudVisionV1p2beta1NormalizedVertex: A vertex represents a 2D 5253// point in the image. NOTE: the normalized vertex coordinates are 5254// relative to the original image and range from 0 to 1. 5255type GoogleCloudVisionV1p2beta1NormalizedVertex struct { 5256 // X: X coordinate. 5257 X float64 `json:"x,omitempty"` 5258 5259 // Y: Y coordinate. 5260 Y float64 `json:"y,omitempty"` 5261 5262 // ForceSendFields is a list of field names (e.g. "X") to 5263 // unconditionally include in API requests. By default, fields with 5264 // empty values are omitted from API requests. However, any non-pointer, 5265 // non-interface field appearing in ForceSendFields will be sent to the 5266 // server regardless of whether the field is empty or not. This may be 5267 // used to include empty fields in Patch requests. 5268 ForceSendFields []string `json:"-"` 5269 5270 // NullFields is a list of field names (e.g. "X") to include in API 5271 // requests with the JSON null value. By default, fields with empty 5272 // values are omitted from API requests. However, any field with an 5273 // empty value appearing in NullFields will be sent to the server as 5274 // null. It is an error if a field in this list has a non-empty value. 5275 // This may be used to include null fields in Patch requests. 5276 NullFields []string `json:"-"` 5277} 5278 5279func (s *GoogleCloudVisionV1p2beta1NormalizedVertex) MarshalJSON() ([]byte, error) { 5280 type NoMethod GoogleCloudVisionV1p2beta1NormalizedVertex 5281 raw := NoMethod(*s) 5282 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5283} 5284 5285func (s *GoogleCloudVisionV1p2beta1NormalizedVertex) UnmarshalJSON(data []byte) error { 5286 type NoMethod GoogleCloudVisionV1p2beta1NormalizedVertex 5287 var s1 struct { 5288 X gensupport.JSONFloat64 `json:"x"` 5289 Y gensupport.JSONFloat64 `json:"y"` 5290 *NoMethod 5291 } 5292 s1.NoMethod = (*NoMethod)(s) 5293 if err := json.Unmarshal(data, &s1); err != nil { 5294 return err 5295 } 5296 s.X = float64(s1.X) 5297 s.Y = float64(s1.Y) 5298 return nil 5299} 5300 5301// GoogleCloudVisionV1p2beta1OperationMetadata: Contains metadata for 5302// the BatchAnnotateImages operation. 5303type GoogleCloudVisionV1p2beta1OperationMetadata struct { 5304 // CreateTime: The time when the batch request was received. 5305 CreateTime string `json:"createTime,omitempty"` 5306 5307 // State: Current state of the batch operation. 5308 // 5309 // Possible values: 5310 // "STATE_UNSPECIFIED" - Invalid. 5311 // "CREATED" - Request is received. 5312 // "RUNNING" - Request is actively being processed. 5313 // "DONE" - The batch processing is done. 5314 // "CANCELLED" - The batch processing was cancelled. 5315 State string `json:"state,omitempty"` 5316 5317 // UpdateTime: The time when the operation result was last updated. 5318 UpdateTime string `json:"updateTime,omitempty"` 5319 5320 // ForceSendFields is a list of field names (e.g. "CreateTime") to 5321 // unconditionally include in API requests. By default, fields with 5322 // empty values are omitted from API requests. However, any non-pointer, 5323 // non-interface field appearing in ForceSendFields will be sent to the 5324 // server regardless of whether the field is empty or not. This may be 5325 // used to include empty fields in Patch requests. 5326 ForceSendFields []string `json:"-"` 5327 5328 // NullFields is a list of field names (e.g. "CreateTime") to include in 5329 // API requests with the JSON null value. By default, fields with empty 5330 // values are omitted from API requests. However, any field with an 5331 // empty value appearing in NullFields will be sent to the server as 5332 // null. It is an error if a field in this list has a non-empty value. 5333 // This may be used to include null fields in Patch requests. 5334 NullFields []string `json:"-"` 5335} 5336 5337func (s *GoogleCloudVisionV1p2beta1OperationMetadata) MarshalJSON() ([]byte, error) { 5338 type NoMethod GoogleCloudVisionV1p2beta1OperationMetadata 5339 raw := NoMethod(*s) 5340 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5341} 5342 5343// GoogleCloudVisionV1p2beta1OutputConfig: The desired output location 5344// and metadata. 5345type GoogleCloudVisionV1p2beta1OutputConfig struct { 5346 // BatchSize: The max number of response protos to put into each output 5347 // JSON file on Google Cloud Storage. The valid range is [1, 100]. If 5348 // not specified, the default value is 20. For example, for one pdf file 5349 // with 100 pages, 100 response protos will be generated. If 5350 // `batch_size` = 20, then 5 json files each containing 20 response 5351 // protos will be written under the prefix `gcs_destination`.`uri`. 5352 // Currently, batch_size only applies to GcsDestination, with potential 5353 // future support for other output configurations. 5354 BatchSize int64 `json:"batchSize,omitempty"` 5355 5356 // GcsDestination: The Google Cloud Storage location to write the 5357 // output(s) to. 5358 GcsDestination *GoogleCloudVisionV1p2beta1GcsDestination `json:"gcsDestination,omitempty"` 5359 5360 // ForceSendFields is a list of field names (e.g. "BatchSize") to 5361 // unconditionally include in API requests. By default, fields with 5362 // empty values are omitted from API requests. However, any non-pointer, 5363 // non-interface field appearing in ForceSendFields will be sent to the 5364 // server regardless of whether the field is empty or not. This may be 5365 // used to include empty fields in Patch requests. 5366 ForceSendFields []string `json:"-"` 5367 5368 // NullFields is a list of field names (e.g. "BatchSize") to include in 5369 // API requests with the JSON null value. By default, fields with empty 5370 // values are omitted from API requests. However, any field with an 5371 // empty value appearing in NullFields will be sent to the server as 5372 // null. It is an error if a field in this list has a non-empty value. 5373 // This may be used to include null fields in Patch requests. 5374 NullFields []string `json:"-"` 5375} 5376 5377func (s *GoogleCloudVisionV1p2beta1OutputConfig) MarshalJSON() ([]byte, error) { 5378 type NoMethod GoogleCloudVisionV1p2beta1OutputConfig 5379 raw := NoMethod(*s) 5380 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5381} 5382 5383// GoogleCloudVisionV1p2beta1Page: Detected page from OCR. 5384type GoogleCloudVisionV1p2beta1Page struct { 5385 // Blocks: List of blocks of text, images etc on this page. 5386 Blocks []*GoogleCloudVisionV1p2beta1Block `json:"blocks,omitempty"` 5387 5388 // Confidence: Confidence of the OCR results on the page. Range [0, 1]. 5389 Confidence float64 `json:"confidence,omitempty"` 5390 5391 // Height: Page height. For PDFs the unit is points. For images 5392 // (including TIFFs) the unit is pixels. 5393 Height int64 `json:"height,omitempty"` 5394 5395 // Property: Additional information detected on the page. 5396 Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"` 5397 5398 // Width: Page width. For PDFs the unit is points. For images (including 5399 // TIFFs) the unit is pixels. 5400 Width int64 `json:"width,omitempty"` 5401 5402 // ForceSendFields is a list of field names (e.g. "Blocks") to 5403 // unconditionally include in API requests. By default, fields with 5404 // empty values are omitted from API requests. However, any non-pointer, 5405 // non-interface field appearing in ForceSendFields will be sent to the 5406 // server regardless of whether the field is empty or not. This may be 5407 // used to include empty fields in Patch requests. 5408 ForceSendFields []string `json:"-"` 5409 5410 // NullFields is a list of field names (e.g. "Blocks") to include in API 5411 // requests with the JSON null value. By default, fields with empty 5412 // values are omitted from API requests. However, any field with an 5413 // empty value appearing in NullFields will be sent to the server as 5414 // null. It is an error if a field in this list has a non-empty value. 5415 // This may be used to include null fields in Patch requests. 5416 NullFields []string `json:"-"` 5417} 5418 5419func (s *GoogleCloudVisionV1p2beta1Page) MarshalJSON() ([]byte, error) { 5420 type NoMethod GoogleCloudVisionV1p2beta1Page 5421 raw := NoMethod(*s) 5422 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5423} 5424 5425func (s *GoogleCloudVisionV1p2beta1Page) UnmarshalJSON(data []byte) error { 5426 type NoMethod GoogleCloudVisionV1p2beta1Page 5427 var s1 struct { 5428 Confidence gensupport.JSONFloat64 `json:"confidence"` 5429 *NoMethod 5430 } 5431 s1.NoMethod = (*NoMethod)(s) 5432 if err := json.Unmarshal(data, &s1); err != nil { 5433 return err 5434 } 5435 s.Confidence = float64(s1.Confidence) 5436 return nil 5437} 5438 5439// GoogleCloudVisionV1p2beta1Paragraph: Structural unit of text 5440// representing a number of words in certain order. 5441type GoogleCloudVisionV1p2beta1Paragraph struct { 5442 // BoundingBox: The bounding box for the paragraph. The vertices are in 5443 // the order of top-left, top-right, bottom-right, bottom-left. When a 5444 // rotation of the bounding box is detected the rotation is represented 5445 // as around the top-left corner as defined when the text is read in the 5446 // 'natural' orientation. For example: * when the text is horizontal it 5447 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 5448 // around the top-left corner it becomes: 2----3 | | 1----0 and the 5449 // vertex order will still be (0, 1, 2, 3). 5450 BoundingBox *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingBox,omitempty"` 5451 5452 // Confidence: Confidence of the OCR results for the paragraph. Range 5453 // [0, 1]. 5454 Confidence float64 `json:"confidence,omitempty"` 5455 5456 // Property: Additional information detected for the paragraph. 5457 Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"` 5458 5459 // Words: List of all words in this paragraph. 5460 Words []*GoogleCloudVisionV1p2beta1Word `json:"words,omitempty"` 5461 5462 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 5463 // unconditionally include in API requests. By default, fields with 5464 // empty values are omitted from API requests. However, any non-pointer, 5465 // non-interface field appearing in ForceSendFields will be sent to the 5466 // server regardless of whether the field is empty or not. This may be 5467 // used to include empty fields in Patch requests. 5468 ForceSendFields []string `json:"-"` 5469 5470 // NullFields is a list of field names (e.g. "BoundingBox") to include 5471 // in API requests with the JSON null value. By default, fields with 5472 // empty values are omitted from API requests. However, any field with 5473 // an empty value appearing in NullFields will be sent to the server as 5474 // null. It is an error if a field in this list has a non-empty value. 5475 // This may be used to include null fields in Patch requests. 5476 NullFields []string `json:"-"` 5477} 5478 5479func (s *GoogleCloudVisionV1p2beta1Paragraph) MarshalJSON() ([]byte, error) { 5480 type NoMethod GoogleCloudVisionV1p2beta1Paragraph 5481 raw := NoMethod(*s) 5482 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5483} 5484 5485func (s *GoogleCloudVisionV1p2beta1Paragraph) UnmarshalJSON(data []byte) error { 5486 type NoMethod GoogleCloudVisionV1p2beta1Paragraph 5487 var s1 struct { 5488 Confidence gensupport.JSONFloat64 `json:"confidence"` 5489 *NoMethod 5490 } 5491 s1.NoMethod = (*NoMethod)(s) 5492 if err := json.Unmarshal(data, &s1); err != nil { 5493 return err 5494 } 5495 s.Confidence = float64(s1.Confidence) 5496 return nil 5497} 5498 5499// GoogleCloudVisionV1p2beta1Position: A 3D position in the image, used 5500// primarily for Face detection landmarks. A valid Position must have 5501// both x and y coordinates. The position coordinates are in the same 5502// scale as the original image. 5503type GoogleCloudVisionV1p2beta1Position struct { 5504 // X: X coordinate. 5505 X float64 `json:"x,omitempty"` 5506 5507 // Y: Y coordinate. 5508 Y float64 `json:"y,omitempty"` 5509 5510 // Z: Z coordinate (or depth). 5511 Z float64 `json:"z,omitempty"` 5512 5513 // ForceSendFields is a list of field names (e.g. "X") to 5514 // unconditionally include in API requests. By default, fields with 5515 // empty values are omitted from API requests. However, any non-pointer, 5516 // non-interface field appearing in ForceSendFields will be sent to the 5517 // server regardless of whether the field is empty or not. This may be 5518 // used to include empty fields in Patch requests. 5519 ForceSendFields []string `json:"-"` 5520 5521 // NullFields is a list of field names (e.g. "X") to include in API 5522 // requests with the JSON null value. By default, fields with empty 5523 // values are omitted from API requests. However, any field with an 5524 // empty value appearing in NullFields will be sent to the server as 5525 // null. It is an error if a field in this list has a non-empty value. 5526 // This may be used to include null fields in Patch requests. 5527 NullFields []string `json:"-"` 5528} 5529 5530func (s *GoogleCloudVisionV1p2beta1Position) MarshalJSON() ([]byte, error) { 5531 type NoMethod GoogleCloudVisionV1p2beta1Position 5532 raw := NoMethod(*s) 5533 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5534} 5535 5536func (s *GoogleCloudVisionV1p2beta1Position) UnmarshalJSON(data []byte) error { 5537 type NoMethod GoogleCloudVisionV1p2beta1Position 5538 var s1 struct { 5539 X gensupport.JSONFloat64 `json:"x"` 5540 Y gensupport.JSONFloat64 `json:"y"` 5541 Z gensupport.JSONFloat64 `json:"z"` 5542 *NoMethod 5543 } 5544 s1.NoMethod = (*NoMethod)(s) 5545 if err := json.Unmarshal(data, &s1); err != nil { 5546 return err 5547 } 5548 s.X = float64(s1.X) 5549 s.Y = float64(s1.Y) 5550 s.Z = float64(s1.Z) 5551 return nil 5552} 5553 5554// GoogleCloudVisionV1p2beta1Product: A Product contains 5555// ReferenceImages. 5556type GoogleCloudVisionV1p2beta1Product struct { 5557 // Description: User-provided metadata to be stored with this product. 5558 // Must be at most 4096 characters long. 5559 Description string `json:"description,omitempty"` 5560 5561 // DisplayName: The user-provided name for this Product. Must not be 5562 // empty. Must be at most 4096 characters long. 5563 DisplayName string `json:"displayName,omitempty"` 5564 5565 // Name: The resource name of the product. Format is: 5566 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This 5567 // field is ignored when creating a product. 5568 Name string `json:"name,omitempty"` 5569 5570 // ProductCategory: Immutable. The category for the product identified 5571 // by the reference image. This should be one of "homegoods-v2", 5572 // "apparel-v2", "toys-v2", "packagedgoods-v1" or "general-v1". The 5573 // legacy categories "homegoods", "apparel", and "toys" are still 5574 // supported, but these should not be used for new products. 5575 ProductCategory string `json:"productCategory,omitempty"` 5576 5577 // ProductLabels: Key-value pairs that can be attached to a product. At 5578 // query time, constraints can be specified based on the product_labels. 5579 // Note that integer values can be provided as strings, e.g. "1199". 5580 // Only strings with integer values can match a range-based restriction 5581 // which is to be supported soon. Multiple values can be assigned to the 5582 // same key. One product may have up to 500 product_labels. Notice that 5583 // the total number of distinct product_labels over all products in one 5584 // ProductSet cannot exceed 1M, otherwise the product search pipeline 5585 // will refuse to work for that ProductSet. 5586 ProductLabels []*GoogleCloudVisionV1p2beta1ProductKeyValue `json:"productLabels,omitempty"` 5587 5588 // ForceSendFields is a list of field names (e.g. "Description") to 5589 // unconditionally include in API requests. By default, fields with 5590 // empty values are omitted from API requests. However, any non-pointer, 5591 // non-interface field appearing in ForceSendFields will be sent to the 5592 // server regardless of whether the field is empty or not. This may be 5593 // used to include empty fields in Patch requests. 5594 ForceSendFields []string `json:"-"` 5595 5596 // NullFields is a list of field names (e.g. "Description") to include 5597 // in API requests with the JSON null value. By default, fields with 5598 // empty values are omitted from API requests. However, any field with 5599 // an empty value appearing in NullFields will be sent to the server as 5600 // null. It is an error if a field in this list has a non-empty value. 5601 // This may be used to include null fields in Patch requests. 5602 NullFields []string `json:"-"` 5603} 5604 5605func (s *GoogleCloudVisionV1p2beta1Product) MarshalJSON() ([]byte, error) { 5606 type NoMethod GoogleCloudVisionV1p2beta1Product 5607 raw := NoMethod(*s) 5608 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5609} 5610 5611// GoogleCloudVisionV1p2beta1ProductKeyValue: A product label 5612// represented as a key-value pair. 5613type GoogleCloudVisionV1p2beta1ProductKeyValue struct { 5614 // Key: The key of the label attached to the product. Cannot be empty 5615 // and cannot exceed 128 bytes. 5616 Key string `json:"key,omitempty"` 5617 5618 // Value: The value of the label attached to the product. Cannot be 5619 // empty and cannot exceed 128 bytes. 5620 Value string `json:"value,omitempty"` 5621 5622 // ForceSendFields is a list of field names (e.g. "Key") to 5623 // unconditionally include in API requests. By default, fields with 5624 // empty values are omitted from API requests. However, any non-pointer, 5625 // non-interface field appearing in ForceSendFields will be sent to the 5626 // server regardless of whether the field is empty or not. This may be 5627 // used to include empty fields in Patch requests. 5628 ForceSendFields []string `json:"-"` 5629 5630 // NullFields is a list of field names (e.g. "Key") to include in API 5631 // requests with the JSON null value. By default, fields with empty 5632 // values are omitted from API requests. However, any field with an 5633 // empty value appearing in NullFields will be sent to the server as 5634 // null. It is an error if a field in this list has a non-empty value. 5635 // This may be used to include null fields in Patch requests. 5636 NullFields []string `json:"-"` 5637} 5638 5639func (s *GoogleCloudVisionV1p2beta1ProductKeyValue) MarshalJSON() ([]byte, error) { 5640 type NoMethod GoogleCloudVisionV1p2beta1ProductKeyValue 5641 raw := NoMethod(*s) 5642 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5643} 5644 5645// GoogleCloudVisionV1p2beta1ProductSearchResults: Results for a product 5646// search request. 5647type GoogleCloudVisionV1p2beta1ProductSearchResults struct { 5648 // IndexTime: Timestamp of the index which provided these results. 5649 // Products added to the product set and products removed from the 5650 // product set after this time are not reflected in the current results. 5651 IndexTime string `json:"indexTime,omitempty"` 5652 5653 // ProductGroupedResults: List of results grouped by products detected 5654 // in the query image. Each entry corresponds to one bounding polygon in 5655 // the query image, and contains the matching products specific to that 5656 // region. There may be duplicate product matches in the union of all 5657 // the per-product results. 5658 ProductGroupedResults []*GoogleCloudVisionV1p2beta1ProductSearchResultsGroupedResult `json:"productGroupedResults,omitempty"` 5659 5660 // Results: List of results, one for each product match. 5661 Results []*GoogleCloudVisionV1p2beta1ProductSearchResultsResult `json:"results,omitempty"` 5662 5663 // ForceSendFields is a list of field names (e.g. "IndexTime") to 5664 // unconditionally include in API requests. By default, fields with 5665 // empty values are omitted from API requests. However, any non-pointer, 5666 // non-interface field appearing in ForceSendFields will be sent to the 5667 // server regardless of whether the field is empty or not. This may be 5668 // used to include empty fields in Patch requests. 5669 ForceSendFields []string `json:"-"` 5670 5671 // NullFields is a list of field names (e.g. "IndexTime") to include in 5672 // API requests with the JSON null value. By default, fields with empty 5673 // values are omitted from API requests. However, any field with an 5674 // empty value appearing in NullFields will be sent to the server as 5675 // null. It is an error if a field in this list has a non-empty value. 5676 // This may be used to include null fields in Patch requests. 5677 NullFields []string `json:"-"` 5678} 5679 5680func (s *GoogleCloudVisionV1p2beta1ProductSearchResults) MarshalJSON() ([]byte, error) { 5681 type NoMethod GoogleCloudVisionV1p2beta1ProductSearchResults 5682 raw := NoMethod(*s) 5683 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5684} 5685 5686// GoogleCloudVisionV1p2beta1ProductSearchResultsGroupedResult: 5687// Information about the products similar to a single product in a query 5688// image. 5689type GoogleCloudVisionV1p2beta1ProductSearchResultsGroupedResult struct { 5690 // BoundingPoly: The bounding polygon around the product detected in the 5691 // query image. 5692 BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"` 5693 5694 // ObjectAnnotations: List of generic predictions for the object in the 5695 // bounding box. 5696 ObjectAnnotations []*GoogleCloudVisionV1p2beta1ProductSearchResultsObjectAnnotation `json:"objectAnnotations,omitempty"` 5697 5698 // Results: List of results, one for each product match. 5699 Results []*GoogleCloudVisionV1p2beta1ProductSearchResultsResult `json:"results,omitempty"` 5700 5701 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 5702 // unconditionally include in API requests. By default, fields with 5703 // empty values are omitted from API requests. However, any non-pointer, 5704 // non-interface field appearing in ForceSendFields will be sent to the 5705 // server regardless of whether the field is empty or not. This may be 5706 // used to include empty fields in Patch requests. 5707 ForceSendFields []string `json:"-"` 5708 5709 // NullFields is a list of field names (e.g. "BoundingPoly") to include 5710 // in API requests with the JSON null value. By default, fields with 5711 // empty values are omitted from API requests. However, any field with 5712 // an empty value appearing in NullFields will be sent to the server as 5713 // null. It is an error if a field in this list has a non-empty value. 5714 // This may be used to include null fields in Patch requests. 5715 NullFields []string `json:"-"` 5716} 5717 5718func (s *GoogleCloudVisionV1p2beta1ProductSearchResultsGroupedResult) MarshalJSON() ([]byte, error) { 5719 type NoMethod GoogleCloudVisionV1p2beta1ProductSearchResultsGroupedResult 5720 raw := NoMethod(*s) 5721 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5722} 5723 5724// GoogleCloudVisionV1p2beta1ProductSearchResultsObjectAnnotation: 5725// Prediction for what the object in the bounding box is. 5726type GoogleCloudVisionV1p2beta1ProductSearchResultsObjectAnnotation struct { 5727 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". 5728 // For more information, see 5729 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 5730 LanguageCode string `json:"languageCode,omitempty"` 5731 5732 // Mid: Object ID that should align with EntityAnnotation mid. 5733 Mid string `json:"mid,omitempty"` 5734 5735 // Name: Object name, expressed in its `language_code` language. 5736 Name string `json:"name,omitempty"` 5737 5738 // Score: Score of the result. Range [0, 1]. 5739 Score float64 `json:"score,omitempty"` 5740 5741 // ForceSendFields is a list of field names (e.g. "LanguageCode") to 5742 // unconditionally include in API requests. By default, fields with 5743 // empty values are omitted from API requests. However, any non-pointer, 5744 // non-interface field appearing in ForceSendFields will be sent to the 5745 // server regardless of whether the field is empty or not. This may be 5746 // used to include empty fields in Patch requests. 5747 ForceSendFields []string `json:"-"` 5748 5749 // NullFields is a list of field names (e.g. "LanguageCode") to include 5750 // in API requests with the JSON null value. By default, fields with 5751 // empty values are omitted from API requests. However, any field with 5752 // an empty value appearing in NullFields will be sent to the server as 5753 // null. It is an error if a field in this list has a non-empty value. 5754 // This may be used to include null fields in Patch requests. 5755 NullFields []string `json:"-"` 5756} 5757 5758func (s *GoogleCloudVisionV1p2beta1ProductSearchResultsObjectAnnotation) MarshalJSON() ([]byte, error) { 5759 type NoMethod GoogleCloudVisionV1p2beta1ProductSearchResultsObjectAnnotation 5760 raw := NoMethod(*s) 5761 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5762} 5763 5764func (s *GoogleCloudVisionV1p2beta1ProductSearchResultsObjectAnnotation) UnmarshalJSON(data []byte) error { 5765 type NoMethod GoogleCloudVisionV1p2beta1ProductSearchResultsObjectAnnotation 5766 var s1 struct { 5767 Score gensupport.JSONFloat64 `json:"score"` 5768 *NoMethod 5769 } 5770 s1.NoMethod = (*NoMethod)(s) 5771 if err := json.Unmarshal(data, &s1); err != nil { 5772 return err 5773 } 5774 s.Score = float64(s1.Score) 5775 return nil 5776} 5777 5778// GoogleCloudVisionV1p2beta1ProductSearchResultsResult: Information 5779// about a product. 5780type GoogleCloudVisionV1p2beta1ProductSearchResultsResult struct { 5781 // Image: The resource name of the image from the product that is the 5782 // closest match to the query. 5783 Image string `json:"image,omitempty"` 5784 5785 // Product: The Product. 5786 Product *GoogleCloudVisionV1p2beta1Product `json:"product,omitempty"` 5787 5788 // Score: A confidence level on the match, ranging from 0 (no 5789 // confidence) to 1 (full confidence). 5790 Score float64 `json:"score,omitempty"` 5791 5792 // ForceSendFields is a list of field names (e.g. "Image") to 5793 // unconditionally include in API requests. By default, fields with 5794 // empty values are omitted from API requests. However, any non-pointer, 5795 // non-interface field appearing in ForceSendFields will be sent to the 5796 // server regardless of whether the field is empty or not. This may be 5797 // used to include empty fields in Patch requests. 5798 ForceSendFields []string `json:"-"` 5799 5800 // NullFields is a list of field names (e.g. "Image") to include in API 5801 // requests with the JSON null value. By default, fields with empty 5802 // values are omitted from API requests. However, any field with an 5803 // empty value appearing in NullFields will be sent to the server as 5804 // null. It is an error if a field in this list has a non-empty value. 5805 // This may be used to include null fields in Patch requests. 5806 NullFields []string `json:"-"` 5807} 5808 5809func (s *GoogleCloudVisionV1p2beta1ProductSearchResultsResult) MarshalJSON() ([]byte, error) { 5810 type NoMethod GoogleCloudVisionV1p2beta1ProductSearchResultsResult 5811 raw := NoMethod(*s) 5812 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5813} 5814 5815func (s *GoogleCloudVisionV1p2beta1ProductSearchResultsResult) UnmarshalJSON(data []byte) error { 5816 type NoMethod GoogleCloudVisionV1p2beta1ProductSearchResultsResult 5817 var s1 struct { 5818 Score gensupport.JSONFloat64 `json:"score"` 5819 *NoMethod 5820 } 5821 s1.NoMethod = (*NoMethod)(s) 5822 if err := json.Unmarshal(data, &s1); err != nil { 5823 return err 5824 } 5825 s.Score = float64(s1.Score) 5826 return nil 5827} 5828 5829// GoogleCloudVisionV1p2beta1Property: A `Property` consists of a 5830// user-supplied name/value pair. 5831type GoogleCloudVisionV1p2beta1Property struct { 5832 // Name: Name of the property. 5833 Name string `json:"name,omitempty"` 5834 5835 // Uint64Value: Value of numeric properties. 5836 Uint64Value uint64 `json:"uint64Value,omitempty,string"` 5837 5838 // Value: Value of the property. 5839 Value string `json:"value,omitempty"` 5840 5841 // ForceSendFields is a list of field names (e.g. "Name") to 5842 // unconditionally include in API requests. By default, fields with 5843 // empty values are omitted from API requests. However, any non-pointer, 5844 // non-interface field appearing in ForceSendFields will be sent to the 5845 // server regardless of whether the field is empty or not. This may be 5846 // used to include empty fields in Patch requests. 5847 ForceSendFields []string `json:"-"` 5848 5849 // NullFields is a list of field names (e.g. "Name") to include in API 5850 // requests with the JSON null value. By default, fields with empty 5851 // values are omitted from API requests. However, any field with an 5852 // empty value appearing in NullFields will be sent to the server as 5853 // null. It is an error if a field in this list has a non-empty value. 5854 // This may be used to include null fields in Patch requests. 5855 NullFields []string `json:"-"` 5856} 5857 5858func (s *GoogleCloudVisionV1p2beta1Property) MarshalJSON() ([]byte, error) { 5859 type NoMethod GoogleCloudVisionV1p2beta1Property 5860 raw := NoMethod(*s) 5861 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5862} 5863 5864// GoogleCloudVisionV1p2beta1SafeSearchAnnotation: Set of features 5865// pertaining to the image, computed by computer vision methods over 5866// safe-search verticals (for example, adult, spoof, medical, violence). 5867type GoogleCloudVisionV1p2beta1SafeSearchAnnotation struct { 5868 // Adult: Represents the adult content likelihood for the image. Adult 5869 // content may contain elements such as nudity, pornographic images or 5870 // cartoons, or sexual activities. 5871 // 5872 // Possible values: 5873 // "UNKNOWN" - Unknown likelihood. 5874 // "VERY_UNLIKELY" - It is very unlikely. 5875 // "UNLIKELY" - It is unlikely. 5876 // "POSSIBLE" - It is possible. 5877 // "LIKELY" - It is likely. 5878 // "VERY_LIKELY" - It is very likely. 5879 Adult string `json:"adult,omitempty"` 5880 5881 // Medical: Likelihood that this is a medical image. 5882 // 5883 // Possible values: 5884 // "UNKNOWN" - Unknown likelihood. 5885 // "VERY_UNLIKELY" - It is very unlikely. 5886 // "UNLIKELY" - It is unlikely. 5887 // "POSSIBLE" - It is possible. 5888 // "LIKELY" - It is likely. 5889 // "VERY_LIKELY" - It is very likely. 5890 Medical string `json:"medical,omitempty"` 5891 5892 // Racy: Likelihood that the request image contains racy content. Racy 5893 // content may include (but is not limited to) skimpy or sheer clothing, 5894 // strategically covered nudity, lewd or provocative poses, or close-ups 5895 // of sensitive body areas. 5896 // 5897 // Possible values: 5898 // "UNKNOWN" - Unknown likelihood. 5899 // "VERY_UNLIKELY" - It is very unlikely. 5900 // "UNLIKELY" - It is unlikely. 5901 // "POSSIBLE" - It is possible. 5902 // "LIKELY" - It is likely. 5903 // "VERY_LIKELY" - It is very likely. 5904 Racy string `json:"racy,omitempty"` 5905 5906 // Spoof: Spoof likelihood. The likelihood that an modification was made 5907 // to the image's canonical version to make it appear funny or 5908 // offensive. 5909 // 5910 // Possible values: 5911 // "UNKNOWN" - Unknown likelihood. 5912 // "VERY_UNLIKELY" - It is very unlikely. 5913 // "UNLIKELY" - It is unlikely. 5914 // "POSSIBLE" - It is possible. 5915 // "LIKELY" - It is likely. 5916 // "VERY_LIKELY" - It is very likely. 5917 Spoof string `json:"spoof,omitempty"` 5918 5919 // Violence: Likelihood that this image contains violent content. 5920 // 5921 // Possible values: 5922 // "UNKNOWN" - Unknown likelihood. 5923 // "VERY_UNLIKELY" - It is very unlikely. 5924 // "UNLIKELY" - It is unlikely. 5925 // "POSSIBLE" - It is possible. 5926 // "LIKELY" - It is likely. 5927 // "VERY_LIKELY" - It is very likely. 5928 Violence string `json:"violence,omitempty"` 5929 5930 // ForceSendFields is a list of field names (e.g. "Adult") to 5931 // unconditionally include in API requests. By default, fields with 5932 // empty values are omitted from API requests. However, any non-pointer, 5933 // non-interface field appearing in ForceSendFields will be sent to the 5934 // server regardless of whether the field is empty or not. This may be 5935 // used to include empty fields in Patch requests. 5936 ForceSendFields []string `json:"-"` 5937 5938 // NullFields is a list of field names (e.g. "Adult") to include in API 5939 // requests with the JSON null value. By default, fields with empty 5940 // values are omitted from API requests. However, any field with an 5941 // empty value appearing in NullFields will be sent to the server as 5942 // null. It is an error if a field in this list has a non-empty value. 5943 // This may be used to include null fields in Patch requests. 5944 NullFields []string `json:"-"` 5945} 5946 5947func (s *GoogleCloudVisionV1p2beta1SafeSearchAnnotation) MarshalJSON() ([]byte, error) { 5948 type NoMethod GoogleCloudVisionV1p2beta1SafeSearchAnnotation 5949 raw := NoMethod(*s) 5950 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5951} 5952 5953// GoogleCloudVisionV1p2beta1Symbol: A single symbol representation. 5954type GoogleCloudVisionV1p2beta1Symbol struct { 5955 // BoundingBox: The bounding box for the symbol. The vertices are in the 5956 // order of top-left, top-right, bottom-right, bottom-left. When a 5957 // rotation of the bounding box is detected the rotation is represented 5958 // as around the top-left corner as defined when the text is read in the 5959 // 'natural' orientation. For example: * when the text is horizontal it 5960 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 5961 // around the top-left corner it becomes: 2----3 | | 1----0 and the 5962 // vertex order will still be (0, 1, 2, 3). 5963 BoundingBox *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingBox,omitempty"` 5964 5965 // Confidence: Confidence of the OCR results for the symbol. Range [0, 5966 // 1]. 5967 Confidence float64 `json:"confidence,omitempty"` 5968 5969 // Property: Additional information detected for the symbol. 5970 Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"` 5971 5972 // Text: The actual UTF-8 representation of the symbol. 5973 Text string `json:"text,omitempty"` 5974 5975 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 5976 // unconditionally include in API requests. By default, fields with 5977 // empty values are omitted from API requests. However, any non-pointer, 5978 // non-interface field appearing in ForceSendFields will be sent to the 5979 // server regardless of whether the field is empty or not. This may be 5980 // used to include empty fields in Patch requests. 5981 ForceSendFields []string `json:"-"` 5982 5983 // NullFields is a list of field names (e.g. "BoundingBox") to include 5984 // in API requests with the JSON null value. By default, fields with 5985 // empty values are omitted from API requests. However, any field with 5986 // an empty value appearing in NullFields will be sent to the server as 5987 // null. It is an error if a field in this list has a non-empty value. 5988 // This may be used to include null fields in Patch requests. 5989 NullFields []string `json:"-"` 5990} 5991 5992func (s *GoogleCloudVisionV1p2beta1Symbol) MarshalJSON() ([]byte, error) { 5993 type NoMethod GoogleCloudVisionV1p2beta1Symbol 5994 raw := NoMethod(*s) 5995 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5996} 5997 5998func (s *GoogleCloudVisionV1p2beta1Symbol) UnmarshalJSON(data []byte) error { 5999 type NoMethod GoogleCloudVisionV1p2beta1Symbol 6000 var s1 struct { 6001 Confidence gensupport.JSONFloat64 `json:"confidence"` 6002 *NoMethod 6003 } 6004 s1.NoMethod = (*NoMethod)(s) 6005 if err := json.Unmarshal(data, &s1); err != nil { 6006 return err 6007 } 6008 s.Confidence = float64(s1.Confidence) 6009 return nil 6010} 6011 6012// GoogleCloudVisionV1p2beta1TextAnnotation: TextAnnotation contains a 6013// structured representation of OCR extracted text. The hierarchy of an 6014// OCR extracted text structure is like this: TextAnnotation -> Page -> 6015// Block -> Paragraph -> Word -> Symbol Each structural component, 6016// starting from Page, may further have their own properties. Properties 6017// describe detected languages, breaks etc.. Please refer to the 6018// TextAnnotation.TextProperty message definition below for more detail. 6019type GoogleCloudVisionV1p2beta1TextAnnotation struct { 6020 // Pages: List of pages detected by OCR. 6021 Pages []*GoogleCloudVisionV1p2beta1Page `json:"pages,omitempty"` 6022 6023 // Text: UTF-8 text detected on the pages. 6024 Text string `json:"text,omitempty"` 6025 6026 // ForceSendFields is a list of field names (e.g. "Pages") to 6027 // unconditionally include in API requests. By default, fields with 6028 // empty values are omitted from API requests. However, any non-pointer, 6029 // non-interface field appearing in ForceSendFields will be sent to the 6030 // server regardless of whether the field is empty or not. This may be 6031 // used to include empty fields in Patch requests. 6032 ForceSendFields []string `json:"-"` 6033 6034 // NullFields is a list of field names (e.g. "Pages") to include in API 6035 // requests with the JSON null value. By default, fields with empty 6036 // values are omitted from API requests. However, any field with an 6037 // empty value appearing in NullFields will be sent to the server as 6038 // null. It is an error if a field in this list has a non-empty value. 6039 // This may be used to include null fields in Patch requests. 6040 NullFields []string `json:"-"` 6041} 6042 6043func (s *GoogleCloudVisionV1p2beta1TextAnnotation) MarshalJSON() ([]byte, error) { 6044 type NoMethod GoogleCloudVisionV1p2beta1TextAnnotation 6045 raw := NoMethod(*s) 6046 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6047} 6048 6049// GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak: Detected start 6050// or end of a structural component. 6051type GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak struct { 6052 // IsPrefix: True if break prepends the element. 6053 IsPrefix bool `json:"isPrefix,omitempty"` 6054 6055 // Type: Detected break type. 6056 // 6057 // Possible values: 6058 // "UNKNOWN" - Unknown break label type. 6059 // "SPACE" - Regular space. 6060 // "SURE_SPACE" - Sure space (very wide). 6061 // "EOL_SURE_SPACE" - Line-wrapping break. 6062 // "HYPHEN" - End-line hyphen that is not present in text; does not 6063 // co-occur with `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. 6064 // "LINE_BREAK" - Line break that ends a paragraph. 6065 Type string `json:"type,omitempty"` 6066 6067 // ForceSendFields is a list of field names (e.g. "IsPrefix") to 6068 // unconditionally include in API requests. By default, fields with 6069 // empty values are omitted from API requests. However, any non-pointer, 6070 // non-interface field appearing in ForceSendFields will be sent to the 6071 // server regardless of whether the field is empty or not. This may be 6072 // used to include empty fields in Patch requests. 6073 ForceSendFields []string `json:"-"` 6074 6075 // NullFields is a list of field names (e.g. "IsPrefix") to include in 6076 // API requests with the JSON null value. By default, fields with empty 6077 // values are omitted from API requests. However, any field with an 6078 // empty value appearing in NullFields will be sent to the server as 6079 // null. It is an error if a field in this list has a non-empty value. 6080 // This may be used to include null fields in Patch requests. 6081 NullFields []string `json:"-"` 6082} 6083 6084func (s *GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak) MarshalJSON() ([]byte, error) { 6085 type NoMethod GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak 6086 raw := NoMethod(*s) 6087 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6088} 6089 6090// GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage: Detected 6091// language for a structural component. 6092type GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage struct { 6093 // Confidence: Confidence of detected language. Range [0, 1]. 6094 Confidence float64 `json:"confidence,omitempty"` 6095 6096 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". 6097 // For more information, see 6098 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 6099 LanguageCode string `json:"languageCode,omitempty"` 6100 6101 // ForceSendFields is a list of field names (e.g. "Confidence") to 6102 // unconditionally include in API requests. By default, fields with 6103 // empty values are omitted from API requests. However, any non-pointer, 6104 // non-interface field appearing in ForceSendFields will be sent to the 6105 // server regardless of whether the field is empty or not. This may be 6106 // used to include empty fields in Patch requests. 6107 ForceSendFields []string `json:"-"` 6108 6109 // NullFields is a list of field names (e.g. "Confidence") to include in 6110 // API requests with the JSON null value. By default, fields with empty 6111 // values are omitted from API requests. However, any field with an 6112 // empty value appearing in NullFields will be sent to the server as 6113 // null. It is an error if a field in this list has a non-empty value. 6114 // This may be used to include null fields in Patch requests. 6115 NullFields []string `json:"-"` 6116} 6117 6118func (s *GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage) MarshalJSON() ([]byte, error) { 6119 type NoMethod GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage 6120 raw := NoMethod(*s) 6121 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6122} 6123 6124func (s *GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage) UnmarshalJSON(data []byte) error { 6125 type NoMethod GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage 6126 var s1 struct { 6127 Confidence gensupport.JSONFloat64 `json:"confidence"` 6128 *NoMethod 6129 } 6130 s1.NoMethod = (*NoMethod)(s) 6131 if err := json.Unmarshal(data, &s1); err != nil { 6132 return err 6133 } 6134 s.Confidence = float64(s1.Confidence) 6135 return nil 6136} 6137 6138// GoogleCloudVisionV1p2beta1TextAnnotationTextProperty: Additional 6139// information detected on the structural component. 6140type GoogleCloudVisionV1p2beta1TextAnnotationTextProperty struct { 6141 // DetectedBreak: Detected start or end of a text segment. 6142 DetectedBreak *GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak `json:"detectedBreak,omitempty"` 6143 6144 // DetectedLanguages: A list of detected languages together with 6145 // confidence. 6146 DetectedLanguages []*GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage `json:"detectedLanguages,omitempty"` 6147 6148 // ForceSendFields is a list of field names (e.g. "DetectedBreak") to 6149 // unconditionally include in API requests. By default, fields with 6150 // empty values are omitted from API requests. However, any non-pointer, 6151 // non-interface field appearing in ForceSendFields will be sent to the 6152 // server regardless of whether the field is empty or not. This may be 6153 // used to include empty fields in Patch requests. 6154 ForceSendFields []string `json:"-"` 6155 6156 // NullFields is a list of field names (e.g. "DetectedBreak") to include 6157 // in API requests with the JSON null value. By default, fields with 6158 // empty values are omitted from API requests. However, any field with 6159 // an empty value appearing in NullFields will be sent to the server as 6160 // null. It is an error if a field in this list has a non-empty value. 6161 // This may be used to include null fields in Patch requests. 6162 NullFields []string `json:"-"` 6163} 6164 6165func (s *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty) MarshalJSON() ([]byte, error) { 6166 type NoMethod GoogleCloudVisionV1p2beta1TextAnnotationTextProperty 6167 raw := NoMethod(*s) 6168 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6169} 6170 6171// GoogleCloudVisionV1p2beta1Vertex: A vertex represents a 2D point in 6172// the image. NOTE: the vertex coordinates are in the same scale as the 6173// original image. 6174type GoogleCloudVisionV1p2beta1Vertex struct { 6175 // X: X coordinate. 6176 X int64 `json:"x,omitempty"` 6177 6178 // Y: Y coordinate. 6179 Y int64 `json:"y,omitempty"` 6180 6181 // ForceSendFields is a list of field names (e.g. "X") to 6182 // unconditionally include in API requests. By default, fields with 6183 // empty values are omitted from API requests. However, any non-pointer, 6184 // non-interface field appearing in ForceSendFields will be sent to the 6185 // server regardless of whether the field is empty or not. This may be 6186 // used to include empty fields in Patch requests. 6187 ForceSendFields []string `json:"-"` 6188 6189 // NullFields is a list of field names (e.g. "X") to include in API 6190 // requests with the JSON null value. By default, fields with empty 6191 // values are omitted from API requests. However, any field with an 6192 // empty value appearing in NullFields will be sent to the server as 6193 // null. It is an error if a field in this list has a non-empty value. 6194 // This may be used to include null fields in Patch requests. 6195 NullFields []string `json:"-"` 6196} 6197 6198func (s *GoogleCloudVisionV1p2beta1Vertex) MarshalJSON() ([]byte, error) { 6199 type NoMethod GoogleCloudVisionV1p2beta1Vertex 6200 raw := NoMethod(*s) 6201 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6202} 6203 6204// GoogleCloudVisionV1p2beta1WebDetection: Relevant information for the 6205// image from the Internet. 6206type GoogleCloudVisionV1p2beta1WebDetection struct { 6207 // BestGuessLabels: The service's best guess as to the topic of the 6208 // request image. Inferred from similar images on the open web. 6209 BestGuessLabels []*GoogleCloudVisionV1p2beta1WebDetectionWebLabel `json:"bestGuessLabels,omitempty"` 6210 6211 // FullMatchingImages: Fully matching images from the Internet. Can 6212 // include resized copies of the query image. 6213 FullMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"` 6214 6215 // PagesWithMatchingImages: Web pages containing the matching images 6216 // from the Internet. 6217 PagesWithMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebPage `json:"pagesWithMatchingImages,omitempty"` 6218 6219 // PartialMatchingImages: Partial matching images from the Internet. 6220 // Those images are similar enough to share some key-point features. For 6221 // example an original image will likely have partial matching for its 6222 // crops. 6223 PartialMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"` 6224 6225 // VisuallySimilarImages: The visually similar image results. 6226 VisuallySimilarImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"visuallySimilarImages,omitempty"` 6227 6228 // WebEntities: Deduced entities from similar images on the Internet. 6229 WebEntities []*GoogleCloudVisionV1p2beta1WebDetectionWebEntity `json:"webEntities,omitempty"` 6230 6231 // ForceSendFields is a list of field names (e.g. "BestGuessLabels") to 6232 // unconditionally include in API requests. By default, fields with 6233 // empty values are omitted from API requests. However, any non-pointer, 6234 // non-interface field appearing in ForceSendFields will be sent to the 6235 // server regardless of whether the field is empty or not. This may be 6236 // used to include empty fields in Patch requests. 6237 ForceSendFields []string `json:"-"` 6238 6239 // NullFields is a list of field names (e.g. "BestGuessLabels") to 6240 // include in API requests with the JSON null value. By default, fields 6241 // with empty values are omitted from API requests. However, any field 6242 // with an empty value appearing in NullFields will be sent to the 6243 // server as null. It is an error if a field in this list has a 6244 // non-empty value. This may be used to include null fields in Patch 6245 // requests. 6246 NullFields []string `json:"-"` 6247} 6248 6249func (s *GoogleCloudVisionV1p2beta1WebDetection) MarshalJSON() ([]byte, error) { 6250 type NoMethod GoogleCloudVisionV1p2beta1WebDetection 6251 raw := NoMethod(*s) 6252 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6253} 6254 6255// GoogleCloudVisionV1p2beta1WebDetectionWebEntity: Entity deduced from 6256// similar images on the Internet. 6257type GoogleCloudVisionV1p2beta1WebDetectionWebEntity struct { 6258 // Description: Canonical description of the entity, in English. 6259 Description string `json:"description,omitempty"` 6260 6261 // EntityId: Opaque entity ID. 6262 EntityId string `json:"entityId,omitempty"` 6263 6264 // Score: Overall relevancy score for the entity. Not normalized and not 6265 // comparable across different image queries. 6266 Score float64 `json:"score,omitempty"` 6267 6268 // ForceSendFields is a list of field names (e.g. "Description") to 6269 // unconditionally include in API requests. By default, fields with 6270 // empty values are omitted from API requests. However, any non-pointer, 6271 // non-interface field appearing in ForceSendFields will be sent to the 6272 // server regardless of whether the field is empty or not. This may be 6273 // used to include empty fields in Patch requests. 6274 ForceSendFields []string `json:"-"` 6275 6276 // NullFields is a list of field names (e.g. "Description") to include 6277 // in API requests with the JSON null value. By default, fields with 6278 // empty values are omitted from API requests. However, any field with 6279 // an empty value appearing in NullFields will be sent to the server as 6280 // null. It is an error if a field in this list has a non-empty value. 6281 // This may be used to include null fields in Patch requests. 6282 NullFields []string `json:"-"` 6283} 6284 6285func (s *GoogleCloudVisionV1p2beta1WebDetectionWebEntity) MarshalJSON() ([]byte, error) { 6286 type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebEntity 6287 raw := NoMethod(*s) 6288 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6289} 6290 6291func (s *GoogleCloudVisionV1p2beta1WebDetectionWebEntity) UnmarshalJSON(data []byte) error { 6292 type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebEntity 6293 var s1 struct { 6294 Score gensupport.JSONFloat64 `json:"score"` 6295 *NoMethod 6296 } 6297 s1.NoMethod = (*NoMethod)(s) 6298 if err := json.Unmarshal(data, &s1); err != nil { 6299 return err 6300 } 6301 s.Score = float64(s1.Score) 6302 return nil 6303} 6304 6305// GoogleCloudVisionV1p2beta1WebDetectionWebImage: Metadata for online 6306// images. 6307type GoogleCloudVisionV1p2beta1WebDetectionWebImage struct { 6308 // Score: (Deprecated) Overall relevancy score for the image. 6309 Score float64 `json:"score,omitempty"` 6310 6311 // Url: The result image URL. 6312 Url string `json:"url,omitempty"` 6313 6314 // ForceSendFields is a list of field names (e.g. "Score") to 6315 // unconditionally include in API requests. By default, fields with 6316 // empty values are omitted from API requests. However, any non-pointer, 6317 // non-interface field appearing in ForceSendFields will be sent to the 6318 // server regardless of whether the field is empty or not. This may be 6319 // used to include empty fields in Patch requests. 6320 ForceSendFields []string `json:"-"` 6321 6322 // NullFields is a list of field names (e.g. "Score") to include in API 6323 // requests with the JSON null value. By default, fields with empty 6324 // values are omitted from API requests. However, any field with an 6325 // empty value appearing in NullFields will be sent to the server as 6326 // null. It is an error if a field in this list has a non-empty value. 6327 // This may be used to include null fields in Patch requests. 6328 NullFields []string `json:"-"` 6329} 6330 6331func (s *GoogleCloudVisionV1p2beta1WebDetectionWebImage) MarshalJSON() ([]byte, error) { 6332 type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebImage 6333 raw := NoMethod(*s) 6334 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6335} 6336 6337func (s *GoogleCloudVisionV1p2beta1WebDetectionWebImage) UnmarshalJSON(data []byte) error { 6338 type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebImage 6339 var s1 struct { 6340 Score gensupport.JSONFloat64 `json:"score"` 6341 *NoMethod 6342 } 6343 s1.NoMethod = (*NoMethod)(s) 6344 if err := json.Unmarshal(data, &s1); err != nil { 6345 return err 6346 } 6347 s.Score = float64(s1.Score) 6348 return nil 6349} 6350 6351// GoogleCloudVisionV1p2beta1WebDetectionWebLabel: Label to provide 6352// extra metadata for the web detection. 6353type GoogleCloudVisionV1p2beta1WebDetectionWebLabel struct { 6354 // Label: Label for extra metadata. 6355 Label string `json:"label,omitempty"` 6356 6357 // LanguageCode: The BCP-47 language code for `label`, such as "en-US" 6358 // or "sr-Latn". For more information, see 6359 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 6360 LanguageCode string `json:"languageCode,omitempty"` 6361 6362 // ForceSendFields is a list of field names (e.g. "Label") to 6363 // unconditionally include in API requests. By default, fields with 6364 // empty values are omitted from API requests. However, any non-pointer, 6365 // non-interface field appearing in ForceSendFields will be sent to the 6366 // server regardless of whether the field is empty or not. This may be 6367 // used to include empty fields in Patch requests. 6368 ForceSendFields []string `json:"-"` 6369 6370 // NullFields is a list of field names (e.g. "Label") to include in API 6371 // requests with the JSON null value. By default, fields with empty 6372 // values are omitted from API requests. However, any field with an 6373 // empty value appearing in NullFields will be sent to the server as 6374 // null. It is an error if a field in this list has a non-empty value. 6375 // This may be used to include null fields in Patch requests. 6376 NullFields []string `json:"-"` 6377} 6378 6379func (s *GoogleCloudVisionV1p2beta1WebDetectionWebLabel) MarshalJSON() ([]byte, error) { 6380 type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebLabel 6381 raw := NoMethod(*s) 6382 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6383} 6384 6385// GoogleCloudVisionV1p2beta1WebDetectionWebPage: Metadata for web 6386// pages. 6387type GoogleCloudVisionV1p2beta1WebDetectionWebPage struct { 6388 // FullMatchingImages: Fully matching images on the page. Can include 6389 // resized copies of the query image. 6390 FullMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"` 6391 6392 // PageTitle: Title for the web page, may contain HTML markups. 6393 PageTitle string `json:"pageTitle,omitempty"` 6394 6395 // PartialMatchingImages: Partial matching images on the page. Those 6396 // images are similar enough to share some key-point features. For 6397 // example an original image will likely have partial matching for its 6398 // crops. 6399 PartialMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"` 6400 6401 // Score: (Deprecated) Overall relevancy score for the web page. 6402 Score float64 `json:"score,omitempty"` 6403 6404 // Url: The result web page URL. 6405 Url string `json:"url,omitempty"` 6406 6407 // ForceSendFields is a list of field names (e.g. "FullMatchingImages") 6408 // to unconditionally include in API requests. By default, fields with 6409 // empty values are omitted from API requests. However, any non-pointer, 6410 // non-interface field appearing in ForceSendFields will be sent to the 6411 // server regardless of whether the field is empty or not. This may be 6412 // used to include empty fields in Patch requests. 6413 ForceSendFields []string `json:"-"` 6414 6415 // NullFields is a list of field names (e.g. "FullMatchingImages") to 6416 // include in API requests with the JSON null value. By default, fields 6417 // with empty values are omitted from API requests. However, any field 6418 // with an empty value appearing in NullFields will be sent to the 6419 // server as null. It is an error if a field in this list has a 6420 // non-empty value. This may be used to include null fields in Patch 6421 // requests. 6422 NullFields []string `json:"-"` 6423} 6424 6425func (s *GoogleCloudVisionV1p2beta1WebDetectionWebPage) MarshalJSON() ([]byte, error) { 6426 type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebPage 6427 raw := NoMethod(*s) 6428 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6429} 6430 6431func (s *GoogleCloudVisionV1p2beta1WebDetectionWebPage) UnmarshalJSON(data []byte) error { 6432 type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebPage 6433 var s1 struct { 6434 Score gensupport.JSONFloat64 `json:"score"` 6435 *NoMethod 6436 } 6437 s1.NoMethod = (*NoMethod)(s) 6438 if err := json.Unmarshal(data, &s1); err != nil { 6439 return err 6440 } 6441 s.Score = float64(s1.Score) 6442 return nil 6443} 6444 6445// GoogleCloudVisionV1p2beta1Word: A word representation. 6446type GoogleCloudVisionV1p2beta1Word struct { 6447 // BoundingBox: The bounding box for the word. The vertices are in the 6448 // order of top-left, top-right, bottom-right, bottom-left. When a 6449 // rotation of the bounding box is detected the rotation is represented 6450 // as around the top-left corner as defined when the text is read in the 6451 // 'natural' orientation. For example: * when the text is horizontal it 6452 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 6453 // around the top-left corner it becomes: 2----3 | | 1----0 and the 6454 // vertex order will still be (0, 1, 2, 3). 6455 BoundingBox *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingBox,omitempty"` 6456 6457 // Confidence: Confidence of the OCR results for the word. Range [0, 1]. 6458 Confidence float64 `json:"confidence,omitempty"` 6459 6460 // Property: Additional information detected for the word. 6461 Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"` 6462 6463 // Symbols: List of symbols in the word. The order of the symbols 6464 // follows the natural reading order. 6465 Symbols []*GoogleCloudVisionV1p2beta1Symbol `json:"symbols,omitempty"` 6466 6467 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 6468 // unconditionally include in API requests. By default, fields with 6469 // empty values are omitted from API requests. However, any non-pointer, 6470 // non-interface field appearing in ForceSendFields will be sent to the 6471 // server regardless of whether the field is empty or not. This may be 6472 // used to include empty fields in Patch requests. 6473 ForceSendFields []string `json:"-"` 6474 6475 // NullFields is a list of field names (e.g. "BoundingBox") to include 6476 // in API requests with the JSON null value. By default, fields with 6477 // empty values are omitted from API requests. However, any field with 6478 // an empty value appearing in NullFields will be sent to the server as 6479 // null. It is an error if a field in this list has a non-empty value. 6480 // This may be used to include null fields in Patch requests. 6481 NullFields []string `json:"-"` 6482} 6483 6484func (s *GoogleCloudVisionV1p2beta1Word) MarshalJSON() ([]byte, error) { 6485 type NoMethod GoogleCloudVisionV1p2beta1Word 6486 raw := NoMethod(*s) 6487 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6488} 6489 6490func (s *GoogleCloudVisionV1p2beta1Word) UnmarshalJSON(data []byte) error { 6491 type NoMethod GoogleCloudVisionV1p2beta1Word 6492 var s1 struct { 6493 Confidence gensupport.JSONFloat64 `json:"confidence"` 6494 *NoMethod 6495 } 6496 s1.NoMethod = (*NoMethod)(s) 6497 if err := json.Unmarshal(data, &s1); err != nil { 6498 return err 6499 } 6500 s.Confidence = float64(s1.Confidence) 6501 return nil 6502} 6503 6504// GoogleCloudVisionV1p3beta1AnnotateFileResponse: Response to a single 6505// file annotation request. A file may contain one or more images, which 6506// individually have their own responses. 6507type GoogleCloudVisionV1p3beta1AnnotateFileResponse struct { 6508 // Error: If set, represents the error message for the failed request. 6509 // The `responses` field will not be set in this case. 6510 Error *Status `json:"error,omitempty"` 6511 6512 // InputConfig: Information about the file for which this response is 6513 // generated. 6514 InputConfig *GoogleCloudVisionV1p3beta1InputConfig `json:"inputConfig,omitempty"` 6515 6516 // Responses: Individual responses to images found within the file. This 6517 // field will be empty if the `error` field is set. 6518 Responses []*GoogleCloudVisionV1p3beta1AnnotateImageResponse `json:"responses,omitempty"` 6519 6520 // TotalPages: This field gives the total number of pages in the file. 6521 TotalPages int64 `json:"totalPages,omitempty"` 6522 6523 // ForceSendFields is a list of field names (e.g. "Error") to 6524 // unconditionally include in API requests. By default, fields with 6525 // empty values are omitted from API requests. However, any non-pointer, 6526 // non-interface field appearing in ForceSendFields will be sent to the 6527 // server regardless of whether the field is empty or not. This may be 6528 // used to include empty fields in Patch requests. 6529 ForceSendFields []string `json:"-"` 6530 6531 // NullFields is a list of field names (e.g. "Error") to include in API 6532 // requests with the JSON null value. By default, fields with empty 6533 // values are omitted from API requests. However, any field with an 6534 // empty value appearing in NullFields will be sent to the server as 6535 // null. It is an error if a field in this list has a non-empty value. 6536 // This may be used to include null fields in Patch requests. 6537 NullFields []string `json:"-"` 6538} 6539 6540func (s *GoogleCloudVisionV1p3beta1AnnotateFileResponse) MarshalJSON() ([]byte, error) { 6541 type NoMethod GoogleCloudVisionV1p3beta1AnnotateFileResponse 6542 raw := NoMethod(*s) 6543 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6544} 6545 6546// GoogleCloudVisionV1p3beta1AnnotateImageResponse: Response to an image 6547// annotation request. 6548type GoogleCloudVisionV1p3beta1AnnotateImageResponse struct { 6549 // Context: If present, contextual information is needed to understand 6550 // where this image comes from. 6551 Context *GoogleCloudVisionV1p3beta1ImageAnnotationContext `json:"context,omitempty"` 6552 6553 // CropHintsAnnotation: If present, crop hints have completed 6554 // successfully. 6555 CropHintsAnnotation *GoogleCloudVisionV1p3beta1CropHintsAnnotation `json:"cropHintsAnnotation,omitempty"` 6556 6557 // Error: If set, represents the error message for the operation. Note 6558 // that filled-in image annotations are guaranteed to be correct, even 6559 // when `error` is set. 6560 Error *Status `json:"error,omitempty"` 6561 6562 // FaceAnnotations: If present, face detection has completed 6563 // successfully. 6564 FaceAnnotations []*GoogleCloudVisionV1p3beta1FaceAnnotation `json:"faceAnnotations,omitempty"` 6565 6566 // FullTextAnnotation: If present, text (OCR) detection or document 6567 // (OCR) text detection has completed successfully. This annotation 6568 // provides the structural hierarchy for the OCR detected text. 6569 FullTextAnnotation *GoogleCloudVisionV1p3beta1TextAnnotation `json:"fullTextAnnotation,omitempty"` 6570 6571 // ImagePropertiesAnnotation: If present, image properties were 6572 // extracted successfully. 6573 ImagePropertiesAnnotation *GoogleCloudVisionV1p3beta1ImageProperties `json:"imagePropertiesAnnotation,omitempty"` 6574 6575 // LabelAnnotations: If present, label detection has completed 6576 // successfully. 6577 LabelAnnotations []*GoogleCloudVisionV1p3beta1EntityAnnotation `json:"labelAnnotations,omitempty"` 6578 6579 // LandmarkAnnotations: If present, landmark detection has completed 6580 // successfully. 6581 LandmarkAnnotations []*GoogleCloudVisionV1p3beta1EntityAnnotation `json:"landmarkAnnotations,omitempty"` 6582 6583 // LocalizedObjectAnnotations: If present, localized object detection 6584 // has completed successfully. This will be sorted descending by 6585 // confidence score. 6586 LocalizedObjectAnnotations []*GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation `json:"localizedObjectAnnotations,omitempty"` 6587 6588 // LogoAnnotations: If present, logo detection has completed 6589 // successfully. 6590 LogoAnnotations []*GoogleCloudVisionV1p3beta1EntityAnnotation `json:"logoAnnotations,omitempty"` 6591 6592 // ProductSearchResults: If present, product search has completed 6593 // successfully. 6594 ProductSearchResults *GoogleCloudVisionV1p3beta1ProductSearchResults `json:"productSearchResults,omitempty"` 6595 6596 // SafeSearchAnnotation: If present, safe-search annotation has 6597 // completed successfully. 6598 SafeSearchAnnotation *GoogleCloudVisionV1p3beta1SafeSearchAnnotation `json:"safeSearchAnnotation,omitempty"` 6599 6600 // TextAnnotations: If present, text (OCR) detection has completed 6601 // successfully. 6602 TextAnnotations []*GoogleCloudVisionV1p3beta1EntityAnnotation `json:"textAnnotations,omitempty"` 6603 6604 // WebDetection: If present, web detection has completed successfully. 6605 WebDetection *GoogleCloudVisionV1p3beta1WebDetection `json:"webDetection,omitempty"` 6606 6607 // ForceSendFields is a list of field names (e.g. "Context") to 6608 // unconditionally include in API requests. By default, fields with 6609 // empty values are omitted from API requests. However, any non-pointer, 6610 // non-interface field appearing in ForceSendFields will be sent to the 6611 // server regardless of whether the field is empty or not. This may be 6612 // used to include empty fields in Patch requests. 6613 ForceSendFields []string `json:"-"` 6614 6615 // NullFields is a list of field names (e.g. "Context") to include in 6616 // API requests with the JSON null value. By default, fields with empty 6617 // values are omitted from API requests. However, any field with an 6618 // empty value appearing in NullFields will be sent to the server as 6619 // null. It is an error if a field in this list has a non-empty value. 6620 // This may be used to include null fields in Patch requests. 6621 NullFields []string `json:"-"` 6622} 6623 6624func (s *GoogleCloudVisionV1p3beta1AnnotateImageResponse) MarshalJSON() ([]byte, error) { 6625 type NoMethod GoogleCloudVisionV1p3beta1AnnotateImageResponse 6626 raw := NoMethod(*s) 6627 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6628} 6629 6630// GoogleCloudVisionV1p3beta1AsyncAnnotateFileResponse: The response for 6631// a single offline file annotation request. 6632type GoogleCloudVisionV1p3beta1AsyncAnnotateFileResponse struct { 6633 // OutputConfig: The output location and metadata from 6634 // AsyncAnnotateFileRequest. 6635 OutputConfig *GoogleCloudVisionV1p3beta1OutputConfig `json:"outputConfig,omitempty"` 6636 6637 // ForceSendFields is a list of field names (e.g. "OutputConfig") to 6638 // unconditionally include in API requests. By default, fields with 6639 // empty values are omitted from API requests. However, any non-pointer, 6640 // non-interface field appearing in ForceSendFields will be sent to the 6641 // server regardless of whether the field is empty or not. This may be 6642 // used to include empty fields in Patch requests. 6643 ForceSendFields []string `json:"-"` 6644 6645 // NullFields is a list of field names (e.g. "OutputConfig") to include 6646 // in API requests with the JSON null value. By default, fields with 6647 // empty values are omitted from API requests. However, any field with 6648 // an empty value appearing in NullFields will be sent to the server as 6649 // null. It is an error if a field in this list has a non-empty value. 6650 // This may be used to include null fields in Patch requests. 6651 NullFields []string `json:"-"` 6652} 6653 6654func (s *GoogleCloudVisionV1p3beta1AsyncAnnotateFileResponse) MarshalJSON() ([]byte, error) { 6655 type NoMethod GoogleCloudVisionV1p3beta1AsyncAnnotateFileResponse 6656 raw := NoMethod(*s) 6657 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6658} 6659 6660// GoogleCloudVisionV1p3beta1AsyncBatchAnnotateFilesResponse: Response 6661// to an async batch file annotation request. 6662type GoogleCloudVisionV1p3beta1AsyncBatchAnnotateFilesResponse struct { 6663 // Responses: The list of file annotation responses, one for each 6664 // request in AsyncBatchAnnotateFilesRequest. 6665 Responses []*GoogleCloudVisionV1p3beta1AsyncAnnotateFileResponse `json:"responses,omitempty"` 6666 6667 // ForceSendFields is a list of field names (e.g. "Responses") to 6668 // unconditionally include in API requests. By default, fields with 6669 // empty values are omitted from API requests. However, any non-pointer, 6670 // non-interface field appearing in ForceSendFields will be sent to the 6671 // server regardless of whether the field is empty or not. This may be 6672 // used to include empty fields in Patch requests. 6673 ForceSendFields []string `json:"-"` 6674 6675 // NullFields is a list of field names (e.g. "Responses") to include in 6676 // API requests with the JSON null value. By default, fields with empty 6677 // values are omitted from API requests. However, any field with an 6678 // empty value appearing in NullFields will be sent to the server as 6679 // null. It is an error if a field in this list has a non-empty value. 6680 // This may be used to include null fields in Patch requests. 6681 NullFields []string `json:"-"` 6682} 6683 6684func (s *GoogleCloudVisionV1p3beta1AsyncBatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) { 6685 type NoMethod GoogleCloudVisionV1p3beta1AsyncBatchAnnotateFilesResponse 6686 raw := NoMethod(*s) 6687 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6688} 6689 6690// GoogleCloudVisionV1p3beta1BatchOperationMetadata: Metadata for the 6691// batch operations such as the current state. This is included in the 6692// `metadata` field of the `Operation` returned by the `GetOperation` 6693// call of the `google::longrunning::Operations` service. 6694type GoogleCloudVisionV1p3beta1BatchOperationMetadata struct { 6695 // EndTime: The time when the batch request is finished and 6696 // google.longrunning.Operation.done is set to true. 6697 EndTime string `json:"endTime,omitempty"` 6698 6699 // State: The current state of the batch operation. 6700 // 6701 // Possible values: 6702 // "STATE_UNSPECIFIED" - Invalid. 6703 // "PROCESSING" - Request is actively being processed. 6704 // "SUCCESSFUL" - The request is done and at least one item has been 6705 // successfully processed. 6706 // "FAILED" - The request is done and no item has been successfully 6707 // processed. 6708 // "CANCELLED" - The request is done after the 6709 // longrunning.Operations.CancelOperation has been called by the user. 6710 // Any records that were processed before the cancel command are output 6711 // as specified in the request. 6712 State string `json:"state,omitempty"` 6713 6714 // SubmitTime: The time when the batch request was submitted to the 6715 // server. 6716 SubmitTime string `json:"submitTime,omitempty"` 6717 6718 // ForceSendFields is a list of field names (e.g. "EndTime") to 6719 // unconditionally include in API requests. By default, fields with 6720 // empty values are omitted from API requests. However, any non-pointer, 6721 // non-interface field appearing in ForceSendFields will be sent to the 6722 // server regardless of whether the field is empty or not. This may be 6723 // used to include empty fields in Patch requests. 6724 ForceSendFields []string `json:"-"` 6725 6726 // NullFields is a list of field names (e.g. "EndTime") to include in 6727 // API requests with the JSON null value. By default, fields with empty 6728 // values are omitted from API requests. However, any field with an 6729 // empty value appearing in NullFields will be sent to the server as 6730 // null. It is an error if a field in this list has a non-empty value. 6731 // This may be used to include null fields in Patch requests. 6732 NullFields []string `json:"-"` 6733} 6734 6735func (s *GoogleCloudVisionV1p3beta1BatchOperationMetadata) MarshalJSON() ([]byte, error) { 6736 type NoMethod GoogleCloudVisionV1p3beta1BatchOperationMetadata 6737 raw := NoMethod(*s) 6738 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6739} 6740 6741// GoogleCloudVisionV1p3beta1Block: Logical element on the page. 6742type GoogleCloudVisionV1p3beta1Block struct { 6743 // BlockType: Detected block type (text, image etc) for this block. 6744 // 6745 // Possible values: 6746 // "UNKNOWN" - Unknown block type. 6747 // "TEXT" - Regular text block. 6748 // "TABLE" - Table block. 6749 // "PICTURE" - Image block. 6750 // "RULER" - Horizontal/vertical line box. 6751 // "BARCODE" - Barcode block. 6752 BlockType string `json:"blockType,omitempty"` 6753 6754 // BoundingBox: The bounding box for the block. The vertices are in the 6755 // order of top-left, top-right, bottom-right, bottom-left. When a 6756 // rotation of the bounding box is detected the rotation is represented 6757 // as around the top-left corner as defined when the text is read in the 6758 // 'natural' orientation. For example: * when the text is horizontal it 6759 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 6760 // around the top-left corner it becomes: 2----3 | | 1----0 and the 6761 // vertex order will still be (0, 1, 2, 3). 6762 BoundingBox *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingBox,omitempty"` 6763 6764 // Confidence: Confidence of the OCR results on the block. Range [0, 1]. 6765 Confidence float64 `json:"confidence,omitempty"` 6766 6767 // Paragraphs: List of paragraphs in this block (if this blocks is of 6768 // type text). 6769 Paragraphs []*GoogleCloudVisionV1p3beta1Paragraph `json:"paragraphs,omitempty"` 6770 6771 // Property: Additional information detected for the block. 6772 Property *GoogleCloudVisionV1p3beta1TextAnnotationTextProperty `json:"property,omitempty"` 6773 6774 // ForceSendFields is a list of field names (e.g. "BlockType") to 6775 // unconditionally include in API requests. By default, fields with 6776 // empty values are omitted from API requests. However, any non-pointer, 6777 // non-interface field appearing in ForceSendFields will be sent to the 6778 // server regardless of whether the field is empty or not. This may be 6779 // used to include empty fields in Patch requests. 6780 ForceSendFields []string `json:"-"` 6781 6782 // NullFields is a list of field names (e.g. "BlockType") to include in 6783 // API requests with the JSON null value. By default, fields with empty 6784 // values are omitted from API requests. However, any field with an 6785 // empty value appearing in NullFields will be sent to the server as 6786 // null. It is an error if a field in this list has a non-empty value. 6787 // This may be used to include null fields in Patch requests. 6788 NullFields []string `json:"-"` 6789} 6790 6791func (s *GoogleCloudVisionV1p3beta1Block) MarshalJSON() ([]byte, error) { 6792 type NoMethod GoogleCloudVisionV1p3beta1Block 6793 raw := NoMethod(*s) 6794 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6795} 6796 6797func (s *GoogleCloudVisionV1p3beta1Block) UnmarshalJSON(data []byte) error { 6798 type NoMethod GoogleCloudVisionV1p3beta1Block 6799 var s1 struct { 6800 Confidence gensupport.JSONFloat64 `json:"confidence"` 6801 *NoMethod 6802 } 6803 s1.NoMethod = (*NoMethod)(s) 6804 if err := json.Unmarshal(data, &s1); err != nil { 6805 return err 6806 } 6807 s.Confidence = float64(s1.Confidence) 6808 return nil 6809} 6810 6811// GoogleCloudVisionV1p3beta1BoundingPoly: A bounding polygon for the 6812// detected image annotation. 6813type GoogleCloudVisionV1p3beta1BoundingPoly struct { 6814 // NormalizedVertices: The bounding polygon normalized vertices. 6815 NormalizedVertices []*GoogleCloudVisionV1p3beta1NormalizedVertex `json:"normalizedVertices,omitempty"` 6816 6817 // Vertices: The bounding polygon vertices. 6818 Vertices []*GoogleCloudVisionV1p3beta1Vertex `json:"vertices,omitempty"` 6819 6820 // ForceSendFields is a list of field names (e.g. "NormalizedVertices") 6821 // to unconditionally include in API requests. By default, fields with 6822 // empty values are omitted from API requests. However, any non-pointer, 6823 // non-interface field appearing in ForceSendFields will be sent to the 6824 // server regardless of whether the field is empty or not. This may be 6825 // used to include empty fields in Patch requests. 6826 ForceSendFields []string `json:"-"` 6827 6828 // NullFields is a list of field names (e.g. "NormalizedVertices") to 6829 // include in API requests with the JSON null value. By default, fields 6830 // with empty values are omitted from API requests. However, any field 6831 // with an empty value appearing in NullFields will be sent to the 6832 // server as null. It is an error if a field in this list has a 6833 // non-empty value. This may be used to include null fields in Patch 6834 // requests. 6835 NullFields []string `json:"-"` 6836} 6837 6838func (s *GoogleCloudVisionV1p3beta1BoundingPoly) MarshalJSON() ([]byte, error) { 6839 type NoMethod GoogleCloudVisionV1p3beta1BoundingPoly 6840 raw := NoMethod(*s) 6841 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6842} 6843 6844// GoogleCloudVisionV1p3beta1ColorInfo: Color information consists of 6845// RGB channels, score, and the fraction of the image that the color 6846// occupies in the image. 6847type GoogleCloudVisionV1p3beta1ColorInfo struct { 6848 // Color: RGB components of the color. 6849 Color *Color `json:"color,omitempty"` 6850 6851 // PixelFraction: The fraction of pixels the color occupies in the 6852 // image. Value in range [0, 1]. 6853 PixelFraction float64 `json:"pixelFraction,omitempty"` 6854 6855 // Score: Image-specific score for this color. Value in range [0, 1]. 6856 Score float64 `json:"score,omitempty"` 6857 6858 // ForceSendFields is a list of field names (e.g. "Color") to 6859 // unconditionally include in API requests. By default, fields with 6860 // empty values are omitted from API requests. However, any non-pointer, 6861 // non-interface field appearing in ForceSendFields will be sent to the 6862 // server regardless of whether the field is empty or not. This may be 6863 // used to include empty fields in Patch requests. 6864 ForceSendFields []string `json:"-"` 6865 6866 // NullFields is a list of field names (e.g. "Color") to include in API 6867 // requests with the JSON null value. By default, fields with empty 6868 // values are omitted from API requests. However, any field with an 6869 // empty value appearing in NullFields will be sent to the server as 6870 // null. It is an error if a field in this list has a non-empty value. 6871 // This may be used to include null fields in Patch requests. 6872 NullFields []string `json:"-"` 6873} 6874 6875func (s *GoogleCloudVisionV1p3beta1ColorInfo) MarshalJSON() ([]byte, error) { 6876 type NoMethod GoogleCloudVisionV1p3beta1ColorInfo 6877 raw := NoMethod(*s) 6878 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6879} 6880 6881func (s *GoogleCloudVisionV1p3beta1ColorInfo) UnmarshalJSON(data []byte) error { 6882 type NoMethod GoogleCloudVisionV1p3beta1ColorInfo 6883 var s1 struct { 6884 PixelFraction gensupport.JSONFloat64 `json:"pixelFraction"` 6885 Score gensupport.JSONFloat64 `json:"score"` 6886 *NoMethod 6887 } 6888 s1.NoMethod = (*NoMethod)(s) 6889 if err := json.Unmarshal(data, &s1); err != nil { 6890 return err 6891 } 6892 s.PixelFraction = float64(s1.PixelFraction) 6893 s.Score = float64(s1.Score) 6894 return nil 6895} 6896 6897// GoogleCloudVisionV1p3beta1CropHint: Single crop hint that is used to 6898// generate a new crop when serving an image. 6899type GoogleCloudVisionV1p3beta1CropHint struct { 6900 // BoundingPoly: The bounding polygon for the crop region. The 6901 // coordinates of the bounding box are in the original image's scale. 6902 BoundingPoly *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPoly,omitempty"` 6903 6904 // Confidence: Confidence of this being a salient region. Range [0, 1]. 6905 Confidence float64 `json:"confidence,omitempty"` 6906 6907 // ImportanceFraction: Fraction of importance of this salient region 6908 // with respect to the original image. 6909 ImportanceFraction float64 `json:"importanceFraction,omitempty"` 6910 6911 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 6912 // unconditionally include in API requests. By default, fields with 6913 // empty values are omitted from API requests. However, any non-pointer, 6914 // non-interface field appearing in ForceSendFields will be sent to the 6915 // server regardless of whether the field is empty or not. This may be 6916 // used to include empty fields in Patch requests. 6917 ForceSendFields []string `json:"-"` 6918 6919 // NullFields is a list of field names (e.g. "BoundingPoly") to include 6920 // in API requests with the JSON null value. By default, fields with 6921 // empty values are omitted from API requests. However, any field with 6922 // an empty value appearing in NullFields will be sent to the server as 6923 // null. It is an error if a field in this list has a non-empty value. 6924 // This may be used to include null fields in Patch requests. 6925 NullFields []string `json:"-"` 6926} 6927 6928func (s *GoogleCloudVisionV1p3beta1CropHint) MarshalJSON() ([]byte, error) { 6929 type NoMethod GoogleCloudVisionV1p3beta1CropHint 6930 raw := NoMethod(*s) 6931 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6932} 6933 6934func (s *GoogleCloudVisionV1p3beta1CropHint) UnmarshalJSON(data []byte) error { 6935 type NoMethod GoogleCloudVisionV1p3beta1CropHint 6936 var s1 struct { 6937 Confidence gensupport.JSONFloat64 `json:"confidence"` 6938 ImportanceFraction gensupport.JSONFloat64 `json:"importanceFraction"` 6939 *NoMethod 6940 } 6941 s1.NoMethod = (*NoMethod)(s) 6942 if err := json.Unmarshal(data, &s1); err != nil { 6943 return err 6944 } 6945 s.Confidence = float64(s1.Confidence) 6946 s.ImportanceFraction = float64(s1.ImportanceFraction) 6947 return nil 6948} 6949 6950// GoogleCloudVisionV1p3beta1CropHintsAnnotation: Set of crop hints that 6951// are used to generate new crops when serving images. 6952type GoogleCloudVisionV1p3beta1CropHintsAnnotation struct { 6953 // CropHints: Crop hint results. 6954 CropHints []*GoogleCloudVisionV1p3beta1CropHint `json:"cropHints,omitempty"` 6955 6956 // ForceSendFields is a list of field names (e.g. "CropHints") to 6957 // unconditionally include in API requests. By default, fields with 6958 // empty values are omitted from API requests. However, any non-pointer, 6959 // non-interface field appearing in ForceSendFields will be sent to the 6960 // server regardless of whether the field is empty or not. This may be 6961 // used to include empty fields in Patch requests. 6962 ForceSendFields []string `json:"-"` 6963 6964 // NullFields is a list of field names (e.g. "CropHints") to include in 6965 // API requests with the JSON null value. By default, fields with empty 6966 // values are omitted from API requests. However, any field with an 6967 // empty value appearing in NullFields will be sent to the server as 6968 // null. It is an error if a field in this list has a non-empty value. 6969 // This may be used to include null fields in Patch requests. 6970 NullFields []string `json:"-"` 6971} 6972 6973func (s *GoogleCloudVisionV1p3beta1CropHintsAnnotation) MarshalJSON() ([]byte, error) { 6974 type NoMethod GoogleCloudVisionV1p3beta1CropHintsAnnotation 6975 raw := NoMethod(*s) 6976 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6977} 6978 6979// GoogleCloudVisionV1p3beta1DominantColorsAnnotation: Set of dominant 6980// colors and their corresponding scores. 6981type GoogleCloudVisionV1p3beta1DominantColorsAnnotation struct { 6982 // Colors: RGB color values with their score and pixel fraction. 6983 Colors []*GoogleCloudVisionV1p3beta1ColorInfo `json:"colors,omitempty"` 6984 6985 // ForceSendFields is a list of field names (e.g. "Colors") to 6986 // unconditionally include in API requests. By default, fields with 6987 // empty values are omitted from API requests. However, any non-pointer, 6988 // non-interface field appearing in ForceSendFields will be sent to the 6989 // server regardless of whether the field is empty or not. This may be 6990 // used to include empty fields in Patch requests. 6991 ForceSendFields []string `json:"-"` 6992 6993 // NullFields is a list of field names (e.g. "Colors") to include in API 6994 // requests with the JSON null value. By default, fields with empty 6995 // values are omitted from API requests. However, any field with an 6996 // empty value appearing in NullFields will be sent to the server as 6997 // null. It is an error if a field in this list has a non-empty value. 6998 // This may be used to include null fields in Patch requests. 6999 NullFields []string `json:"-"` 7000} 7001 7002func (s *GoogleCloudVisionV1p3beta1DominantColorsAnnotation) MarshalJSON() ([]byte, error) { 7003 type NoMethod GoogleCloudVisionV1p3beta1DominantColorsAnnotation 7004 raw := NoMethod(*s) 7005 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7006} 7007 7008// GoogleCloudVisionV1p3beta1EntityAnnotation: Set of detected entity 7009// features. 7010type GoogleCloudVisionV1p3beta1EntityAnnotation struct { 7011 // BoundingPoly: Image region to which this entity belongs. Not produced 7012 // for `LABEL_DETECTION` features. 7013 BoundingPoly *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPoly,omitempty"` 7014 7015 // Confidence: **Deprecated. Use `score` instead.** The accuracy of the 7016 // entity detection in an image. For example, for an image in which the 7017 // "Eiffel Tower" entity is detected, this field represents the 7018 // confidence that there is a tower in the query image. Range [0, 1]. 7019 Confidence float64 `json:"confidence,omitempty"` 7020 7021 // Description: Entity textual description, expressed in its `locale` 7022 // language. 7023 Description string `json:"description,omitempty"` 7024 7025 // Locale: The language code for the locale in which the entity textual 7026 // `description` is expressed. 7027 Locale string `json:"locale,omitempty"` 7028 7029 // Locations: The location information for the detected entity. Multiple 7030 // `LocationInfo` elements can be present because one location may 7031 // indicate the location of the scene in the image, and another location 7032 // may indicate the location of the place where the image was taken. 7033 // Location information is usually present for landmarks. 7034 Locations []*GoogleCloudVisionV1p3beta1LocationInfo `json:"locations,omitempty"` 7035 7036 // Mid: Opaque entity ID. Some IDs may be available in [Google Knowledge 7037 // Graph Search API](https://developers.google.com/knowledge-graph/). 7038 Mid string `json:"mid,omitempty"` 7039 7040 // Properties: Some entities may have optional user-supplied `Property` 7041 // (name/value) fields, such a score or string that qualifies the 7042 // entity. 7043 Properties []*GoogleCloudVisionV1p3beta1Property `json:"properties,omitempty"` 7044 7045 // Score: Overall score of the result. Range [0, 1]. 7046 Score float64 `json:"score,omitempty"` 7047 7048 // Topicality: The relevancy of the ICA (Image Content Annotation) label 7049 // to the image. For example, the relevancy of "tower" is likely higher 7050 // to an image containing the detected "Eiffel Tower" than to an image 7051 // containing a detected distant towering building, even though the 7052 // confidence that there is a tower in each image may be the same. Range 7053 // [0, 1]. 7054 Topicality float64 `json:"topicality,omitempty"` 7055 7056 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 7057 // unconditionally include in API requests. By default, fields with 7058 // empty values are omitted from API requests. However, any non-pointer, 7059 // non-interface field appearing in ForceSendFields will be sent to the 7060 // server regardless of whether the field is empty or not. This may be 7061 // used to include empty fields in Patch requests. 7062 ForceSendFields []string `json:"-"` 7063 7064 // NullFields is a list of field names (e.g. "BoundingPoly") to include 7065 // in API requests with the JSON null value. By default, fields with 7066 // empty values are omitted from API requests. However, any field with 7067 // an empty value appearing in NullFields will be sent to the server as 7068 // null. It is an error if a field in this list has a non-empty value. 7069 // This may be used to include null fields in Patch requests. 7070 NullFields []string `json:"-"` 7071} 7072 7073func (s *GoogleCloudVisionV1p3beta1EntityAnnotation) MarshalJSON() ([]byte, error) { 7074 type NoMethod GoogleCloudVisionV1p3beta1EntityAnnotation 7075 raw := NoMethod(*s) 7076 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7077} 7078 7079func (s *GoogleCloudVisionV1p3beta1EntityAnnotation) UnmarshalJSON(data []byte) error { 7080 type NoMethod GoogleCloudVisionV1p3beta1EntityAnnotation 7081 var s1 struct { 7082 Confidence gensupport.JSONFloat64 `json:"confidence"` 7083 Score gensupport.JSONFloat64 `json:"score"` 7084 Topicality gensupport.JSONFloat64 `json:"topicality"` 7085 *NoMethod 7086 } 7087 s1.NoMethod = (*NoMethod)(s) 7088 if err := json.Unmarshal(data, &s1); err != nil { 7089 return err 7090 } 7091 s.Confidence = float64(s1.Confidence) 7092 s.Score = float64(s1.Score) 7093 s.Topicality = float64(s1.Topicality) 7094 return nil 7095} 7096 7097// GoogleCloudVisionV1p3beta1FaceAnnotation: A face annotation object 7098// contains the results of face detection. 7099type GoogleCloudVisionV1p3beta1FaceAnnotation struct { 7100 // AngerLikelihood: Anger likelihood. 7101 // 7102 // Possible values: 7103 // "UNKNOWN" - Unknown likelihood. 7104 // "VERY_UNLIKELY" - It is very unlikely. 7105 // "UNLIKELY" - It is unlikely. 7106 // "POSSIBLE" - It is possible. 7107 // "LIKELY" - It is likely. 7108 // "VERY_LIKELY" - It is very likely. 7109 AngerLikelihood string `json:"angerLikelihood,omitempty"` 7110 7111 // BlurredLikelihood: Blurred likelihood. 7112 // 7113 // Possible values: 7114 // "UNKNOWN" - Unknown likelihood. 7115 // "VERY_UNLIKELY" - It is very unlikely. 7116 // "UNLIKELY" - It is unlikely. 7117 // "POSSIBLE" - It is possible. 7118 // "LIKELY" - It is likely. 7119 // "VERY_LIKELY" - It is very likely. 7120 BlurredLikelihood string `json:"blurredLikelihood,omitempty"` 7121 7122 // BoundingPoly: The bounding polygon around the face. The coordinates 7123 // of the bounding box are in the original image's scale. The bounding 7124 // box is computed to "frame" the face in accordance with human 7125 // expectations. It is based on the landmarker results. Note that one or 7126 // more x and/or y coordinates may not be generated in the 7127 // `BoundingPoly` (the polygon will be unbounded) if only a partial face 7128 // appears in the image to be annotated. 7129 BoundingPoly *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPoly,omitempty"` 7130 7131 // DetectionConfidence: Detection confidence. Range [0, 1]. 7132 DetectionConfidence float64 `json:"detectionConfidence,omitempty"` 7133 7134 // FdBoundingPoly: The `fd_bounding_poly` bounding polygon is tighter 7135 // than the `boundingPoly`, and encloses only the skin part of the face. 7136 // Typically, it is used to eliminate the face from any image analysis 7137 // that detects the "amount of skin" visible in an image. It is not 7138 // based on the landmarker results, only on the initial face detection, 7139 // hence the fd (face detection) prefix. 7140 FdBoundingPoly *GoogleCloudVisionV1p3beta1BoundingPoly `json:"fdBoundingPoly,omitempty"` 7141 7142 // HeadwearLikelihood: Headwear likelihood. 7143 // 7144 // Possible values: 7145 // "UNKNOWN" - Unknown likelihood. 7146 // "VERY_UNLIKELY" - It is very unlikely. 7147 // "UNLIKELY" - It is unlikely. 7148 // "POSSIBLE" - It is possible. 7149 // "LIKELY" - It is likely. 7150 // "VERY_LIKELY" - It is very likely. 7151 HeadwearLikelihood string `json:"headwearLikelihood,omitempty"` 7152 7153 // JoyLikelihood: Joy likelihood. 7154 // 7155 // Possible values: 7156 // "UNKNOWN" - Unknown likelihood. 7157 // "VERY_UNLIKELY" - It is very unlikely. 7158 // "UNLIKELY" - It is unlikely. 7159 // "POSSIBLE" - It is possible. 7160 // "LIKELY" - It is likely. 7161 // "VERY_LIKELY" - It is very likely. 7162 JoyLikelihood string `json:"joyLikelihood,omitempty"` 7163 7164 // LandmarkingConfidence: Face landmarking confidence. Range [0, 1]. 7165 LandmarkingConfidence float64 `json:"landmarkingConfidence,omitempty"` 7166 7167 // Landmarks: Detected face landmarks. 7168 Landmarks []*GoogleCloudVisionV1p3beta1FaceAnnotationLandmark `json:"landmarks,omitempty"` 7169 7170 // PanAngle: Yaw angle, which indicates the leftward/rightward angle 7171 // that the face is pointing relative to the vertical plane 7172 // perpendicular to the image. Range [-180,180]. 7173 PanAngle float64 `json:"panAngle,omitempty"` 7174 7175 // RollAngle: Roll angle, which indicates the amount of 7176 // clockwise/anti-clockwise rotation of the face relative to the image 7177 // vertical about the axis perpendicular to the face. Range [-180,180]. 7178 RollAngle float64 `json:"rollAngle,omitempty"` 7179 7180 // SorrowLikelihood: Sorrow likelihood. 7181 // 7182 // Possible values: 7183 // "UNKNOWN" - Unknown likelihood. 7184 // "VERY_UNLIKELY" - It is very unlikely. 7185 // "UNLIKELY" - It is unlikely. 7186 // "POSSIBLE" - It is possible. 7187 // "LIKELY" - It is likely. 7188 // "VERY_LIKELY" - It is very likely. 7189 SorrowLikelihood string `json:"sorrowLikelihood,omitempty"` 7190 7191 // SurpriseLikelihood: Surprise likelihood. 7192 // 7193 // Possible values: 7194 // "UNKNOWN" - Unknown likelihood. 7195 // "VERY_UNLIKELY" - It is very unlikely. 7196 // "UNLIKELY" - It is unlikely. 7197 // "POSSIBLE" - It is possible. 7198 // "LIKELY" - It is likely. 7199 // "VERY_LIKELY" - It is very likely. 7200 SurpriseLikelihood string `json:"surpriseLikelihood,omitempty"` 7201 7202 // TiltAngle: Pitch angle, which indicates the upwards/downwards angle 7203 // that the face is pointing relative to the image's horizontal plane. 7204 // Range [-180,180]. 7205 TiltAngle float64 `json:"tiltAngle,omitempty"` 7206 7207 // UnderExposedLikelihood: Under-exposed likelihood. 7208 // 7209 // Possible values: 7210 // "UNKNOWN" - Unknown likelihood. 7211 // "VERY_UNLIKELY" - It is very unlikely. 7212 // "UNLIKELY" - It is unlikely. 7213 // "POSSIBLE" - It is possible. 7214 // "LIKELY" - It is likely. 7215 // "VERY_LIKELY" - It is very likely. 7216 UnderExposedLikelihood string `json:"underExposedLikelihood,omitempty"` 7217 7218 // ForceSendFields is a list of field names (e.g. "AngerLikelihood") to 7219 // unconditionally include in API requests. By default, fields with 7220 // empty values are omitted from API requests. However, any non-pointer, 7221 // non-interface field appearing in ForceSendFields will be sent to the 7222 // server regardless of whether the field is empty or not. This may be 7223 // used to include empty fields in Patch requests. 7224 ForceSendFields []string `json:"-"` 7225 7226 // NullFields is a list of field names (e.g. "AngerLikelihood") to 7227 // include in API requests with the JSON null value. By default, fields 7228 // with empty values are omitted from API requests. However, any field 7229 // with an empty value appearing in NullFields will be sent to the 7230 // server as null. It is an error if a field in this list has a 7231 // non-empty value. This may be used to include null fields in Patch 7232 // requests. 7233 NullFields []string `json:"-"` 7234} 7235 7236func (s *GoogleCloudVisionV1p3beta1FaceAnnotation) MarshalJSON() ([]byte, error) { 7237 type NoMethod GoogleCloudVisionV1p3beta1FaceAnnotation 7238 raw := NoMethod(*s) 7239 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7240} 7241 7242func (s *GoogleCloudVisionV1p3beta1FaceAnnotation) UnmarshalJSON(data []byte) error { 7243 type NoMethod GoogleCloudVisionV1p3beta1FaceAnnotation 7244 var s1 struct { 7245 DetectionConfidence gensupport.JSONFloat64 `json:"detectionConfidence"` 7246 LandmarkingConfidence gensupport.JSONFloat64 `json:"landmarkingConfidence"` 7247 PanAngle gensupport.JSONFloat64 `json:"panAngle"` 7248 RollAngle gensupport.JSONFloat64 `json:"rollAngle"` 7249 TiltAngle gensupport.JSONFloat64 `json:"tiltAngle"` 7250 *NoMethod 7251 } 7252 s1.NoMethod = (*NoMethod)(s) 7253 if err := json.Unmarshal(data, &s1); err != nil { 7254 return err 7255 } 7256 s.DetectionConfidence = float64(s1.DetectionConfidence) 7257 s.LandmarkingConfidence = float64(s1.LandmarkingConfidence) 7258 s.PanAngle = float64(s1.PanAngle) 7259 s.RollAngle = float64(s1.RollAngle) 7260 s.TiltAngle = float64(s1.TiltAngle) 7261 return nil 7262} 7263 7264// GoogleCloudVisionV1p3beta1FaceAnnotationLandmark: A face-specific 7265// landmark (for example, a face feature). 7266type GoogleCloudVisionV1p3beta1FaceAnnotationLandmark struct { 7267 // Position: Face landmark position. 7268 Position *GoogleCloudVisionV1p3beta1Position `json:"position,omitempty"` 7269 7270 // Type: Face landmark type. 7271 // 7272 // Possible values: 7273 // "UNKNOWN_LANDMARK" - Unknown face landmark detected. Should not be 7274 // filled. 7275 // "LEFT_EYE" - Left eye. 7276 // "RIGHT_EYE" - Right eye. 7277 // "LEFT_OF_LEFT_EYEBROW" - Left of left eyebrow. 7278 // "RIGHT_OF_LEFT_EYEBROW" - Right of left eyebrow. 7279 // "LEFT_OF_RIGHT_EYEBROW" - Left of right eyebrow. 7280 // "RIGHT_OF_RIGHT_EYEBROW" - Right of right eyebrow. 7281 // "MIDPOINT_BETWEEN_EYES" - Midpoint between eyes. 7282 // "NOSE_TIP" - Nose tip. 7283 // "UPPER_LIP" - Upper lip. 7284 // "LOWER_LIP" - Lower lip. 7285 // "MOUTH_LEFT" - Mouth left. 7286 // "MOUTH_RIGHT" - Mouth right. 7287 // "MOUTH_CENTER" - Mouth center. 7288 // "NOSE_BOTTOM_RIGHT" - Nose, bottom right. 7289 // "NOSE_BOTTOM_LEFT" - Nose, bottom left. 7290 // "NOSE_BOTTOM_CENTER" - Nose, bottom center. 7291 // "LEFT_EYE_TOP_BOUNDARY" - Left eye, top boundary. 7292 // "LEFT_EYE_RIGHT_CORNER" - Left eye, right corner. 7293 // "LEFT_EYE_BOTTOM_BOUNDARY" - Left eye, bottom boundary. 7294 // "LEFT_EYE_LEFT_CORNER" - Left eye, left corner. 7295 // "RIGHT_EYE_TOP_BOUNDARY" - Right eye, top boundary. 7296 // "RIGHT_EYE_RIGHT_CORNER" - Right eye, right corner. 7297 // "RIGHT_EYE_BOTTOM_BOUNDARY" - Right eye, bottom boundary. 7298 // "RIGHT_EYE_LEFT_CORNER" - Right eye, left corner. 7299 // "LEFT_EYEBROW_UPPER_MIDPOINT" - Left eyebrow, upper midpoint. 7300 // "RIGHT_EYEBROW_UPPER_MIDPOINT" - Right eyebrow, upper midpoint. 7301 // "LEFT_EAR_TRAGION" - Left ear tragion. 7302 // "RIGHT_EAR_TRAGION" - Right ear tragion. 7303 // "LEFT_EYE_PUPIL" - Left eye pupil. 7304 // "RIGHT_EYE_PUPIL" - Right eye pupil. 7305 // "FOREHEAD_GLABELLA" - Forehead glabella. 7306 // "CHIN_GNATHION" - Chin gnathion. 7307 // "CHIN_LEFT_GONION" - Chin left gonion. 7308 // "CHIN_RIGHT_GONION" - Chin right gonion. 7309 // "LEFT_CHEEK_CENTER" - Left cheek center. 7310 // "RIGHT_CHEEK_CENTER" - Right cheek center. 7311 Type string `json:"type,omitempty"` 7312 7313 // ForceSendFields is a list of field names (e.g. "Position") to 7314 // unconditionally include in API requests. By default, fields with 7315 // empty values are omitted from API requests. However, any non-pointer, 7316 // non-interface field appearing in ForceSendFields will be sent to the 7317 // server regardless of whether the field is empty or not. This may be 7318 // used to include empty fields in Patch requests. 7319 ForceSendFields []string `json:"-"` 7320 7321 // NullFields is a list of field names (e.g. "Position") to include in 7322 // API requests with the JSON null value. By default, fields with empty 7323 // values are omitted from API requests. However, any field with an 7324 // empty value appearing in NullFields will be sent to the server as 7325 // null. It is an error if a field in this list has a non-empty value. 7326 // This may be used to include null fields in Patch requests. 7327 NullFields []string `json:"-"` 7328} 7329 7330func (s *GoogleCloudVisionV1p3beta1FaceAnnotationLandmark) MarshalJSON() ([]byte, error) { 7331 type NoMethod GoogleCloudVisionV1p3beta1FaceAnnotationLandmark 7332 raw := NoMethod(*s) 7333 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7334} 7335 7336// GoogleCloudVisionV1p3beta1GcsDestination: The Google Cloud Storage 7337// location where the output will be written to. 7338type GoogleCloudVisionV1p3beta1GcsDestination struct { 7339 // Uri: Google Cloud Storage URI prefix where the results will be 7340 // stored. Results will be in JSON format and preceded by its 7341 // corresponding input URI prefix. This field can either represent a gcs 7342 // file prefix or gcs directory. In either case, the uri should be 7343 // unique because in order to get all of the output files, you will need 7344 // to do a wildcard gcs search on the uri prefix you provide. Examples: 7345 // * File Prefix: gs://bucket-name/here/filenameprefix The output files 7346 // will be created in gs://bucket-name/here/ and the names of the output 7347 // files will begin with "filenameprefix". * Directory Prefix: 7348 // gs://bucket-name/some/location/ The output files will be created in 7349 // gs://bucket-name/some/location/ and the names of the output files 7350 // could be anything because there was no filename prefix specified. If 7351 // multiple outputs, each response is still AnnotateFileResponse, each 7352 // of which contains some subset of the full list of 7353 // AnnotateImageResponse. Multiple outputs can happen if, for example, 7354 // the output JSON is too large and overflows into multiple sharded 7355 // files. 7356 Uri string `json:"uri,omitempty"` 7357 7358 // ForceSendFields is a list of field names (e.g. "Uri") to 7359 // unconditionally include in API requests. By default, fields with 7360 // empty values are omitted from API requests. However, any non-pointer, 7361 // non-interface field appearing in ForceSendFields will be sent to the 7362 // server regardless of whether the field is empty or not. This may be 7363 // used to include empty fields in Patch requests. 7364 ForceSendFields []string `json:"-"` 7365 7366 // NullFields is a list of field names (e.g. "Uri") to include in API 7367 // requests with the JSON null value. By default, fields with empty 7368 // values are omitted from API requests. However, any field with an 7369 // empty value appearing in NullFields will be sent to the server as 7370 // null. It is an error if a field in this list has a non-empty value. 7371 // This may be used to include null fields in Patch requests. 7372 NullFields []string `json:"-"` 7373} 7374 7375func (s *GoogleCloudVisionV1p3beta1GcsDestination) MarshalJSON() ([]byte, error) { 7376 type NoMethod GoogleCloudVisionV1p3beta1GcsDestination 7377 raw := NoMethod(*s) 7378 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7379} 7380 7381// GoogleCloudVisionV1p3beta1GcsSource: The Google Cloud Storage 7382// location where the input will be read from. 7383type GoogleCloudVisionV1p3beta1GcsSource struct { 7384 // Uri: Google Cloud Storage URI for the input file. This must only be a 7385 // Google Cloud Storage object. Wildcards are not currently supported. 7386 Uri string `json:"uri,omitempty"` 7387 7388 // ForceSendFields is a list of field names (e.g. "Uri") to 7389 // unconditionally include in API requests. By default, fields with 7390 // empty values are omitted from API requests. However, any non-pointer, 7391 // non-interface field appearing in ForceSendFields will be sent to the 7392 // server regardless of whether the field is empty or not. This may be 7393 // used to include empty fields in Patch requests. 7394 ForceSendFields []string `json:"-"` 7395 7396 // NullFields is a list of field names (e.g. "Uri") to include in API 7397 // requests with the JSON null value. By default, fields with empty 7398 // values are omitted from API requests. However, any field with an 7399 // empty value appearing in NullFields will be sent to the server as 7400 // null. It is an error if a field in this list has a non-empty value. 7401 // This may be used to include null fields in Patch requests. 7402 NullFields []string `json:"-"` 7403} 7404 7405func (s *GoogleCloudVisionV1p3beta1GcsSource) MarshalJSON() ([]byte, error) { 7406 type NoMethod GoogleCloudVisionV1p3beta1GcsSource 7407 raw := NoMethod(*s) 7408 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7409} 7410 7411// GoogleCloudVisionV1p3beta1ImageAnnotationContext: If an image was 7412// produced from a file (e.g. a PDF), this message gives information 7413// about the source of that image. 7414type GoogleCloudVisionV1p3beta1ImageAnnotationContext struct { 7415 // PageNumber: If the file was a PDF or TIFF, this field gives the page 7416 // number within the file used to produce the image. 7417 PageNumber int64 `json:"pageNumber,omitempty"` 7418 7419 // Uri: The URI of the file used to produce the image. 7420 Uri string `json:"uri,omitempty"` 7421 7422 // ForceSendFields is a list of field names (e.g. "PageNumber") to 7423 // unconditionally include in API requests. By default, fields with 7424 // empty values are omitted from API requests. However, any non-pointer, 7425 // non-interface field appearing in ForceSendFields will be sent to the 7426 // server regardless of whether the field is empty or not. This may be 7427 // used to include empty fields in Patch requests. 7428 ForceSendFields []string `json:"-"` 7429 7430 // NullFields is a list of field names (e.g. "PageNumber") to include in 7431 // API requests with the JSON null value. By default, fields with empty 7432 // values are omitted from API requests. However, any field with an 7433 // empty value appearing in NullFields will be sent to the server as 7434 // null. It is an error if a field in this list has a non-empty value. 7435 // This may be used to include null fields in Patch requests. 7436 NullFields []string `json:"-"` 7437} 7438 7439func (s *GoogleCloudVisionV1p3beta1ImageAnnotationContext) MarshalJSON() ([]byte, error) { 7440 type NoMethod GoogleCloudVisionV1p3beta1ImageAnnotationContext 7441 raw := NoMethod(*s) 7442 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7443} 7444 7445// GoogleCloudVisionV1p3beta1ImageProperties: Stores image properties, 7446// such as dominant colors. 7447type GoogleCloudVisionV1p3beta1ImageProperties struct { 7448 // DominantColors: If present, dominant colors completed successfully. 7449 DominantColors *GoogleCloudVisionV1p3beta1DominantColorsAnnotation `json:"dominantColors,omitempty"` 7450 7451 // ForceSendFields is a list of field names (e.g. "DominantColors") to 7452 // unconditionally include in API requests. By default, fields with 7453 // empty values are omitted from API requests. However, any non-pointer, 7454 // non-interface field appearing in ForceSendFields will be sent to the 7455 // server regardless of whether the field is empty or not. This may be 7456 // used to include empty fields in Patch requests. 7457 ForceSendFields []string `json:"-"` 7458 7459 // NullFields is a list of field names (e.g. "DominantColors") to 7460 // include in API requests with the JSON null value. By default, fields 7461 // with empty values are omitted from API requests. However, any field 7462 // with an empty value appearing in NullFields will be sent to the 7463 // server as null. It is an error if a field in this list has a 7464 // non-empty value. This may be used to include null fields in Patch 7465 // requests. 7466 NullFields []string `json:"-"` 7467} 7468 7469func (s *GoogleCloudVisionV1p3beta1ImageProperties) MarshalJSON() ([]byte, error) { 7470 type NoMethod GoogleCloudVisionV1p3beta1ImageProperties 7471 raw := NoMethod(*s) 7472 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7473} 7474 7475// GoogleCloudVisionV1p3beta1ImportProductSetsResponse: Response message 7476// for the `ImportProductSets` method. This message is returned by the 7477// google.longrunning.Operations.GetOperation method in the returned 7478// google.longrunning.Operation.response field. 7479type GoogleCloudVisionV1p3beta1ImportProductSetsResponse struct { 7480 // ReferenceImages: The list of reference_images that are imported 7481 // successfully. 7482 ReferenceImages []*GoogleCloudVisionV1p3beta1ReferenceImage `json:"referenceImages,omitempty"` 7483 7484 // Statuses: The rpc status for each ImportProductSet request, including 7485 // both successes and errors. The number of statuses here matches the 7486 // number of lines in the csv file, and statuses[i] stores the success 7487 // or failure status of processing the i-th line of the csv, starting 7488 // from line 0. 7489 Statuses []*Status `json:"statuses,omitempty"` 7490 7491 // ForceSendFields is a list of field names (e.g. "ReferenceImages") to 7492 // unconditionally include in API requests. By default, fields with 7493 // empty values are omitted from API requests. However, any non-pointer, 7494 // non-interface field appearing in ForceSendFields will be sent to the 7495 // server regardless of whether the field is empty or not. This may be 7496 // used to include empty fields in Patch requests. 7497 ForceSendFields []string `json:"-"` 7498 7499 // NullFields is a list of field names (e.g. "ReferenceImages") to 7500 // include in API requests with the JSON null value. By default, fields 7501 // with empty values are omitted from API requests. However, any field 7502 // with an empty value appearing in NullFields will be sent to the 7503 // server as null. It is an error if a field in this list has a 7504 // non-empty value. This may be used to include null fields in Patch 7505 // requests. 7506 NullFields []string `json:"-"` 7507} 7508 7509func (s *GoogleCloudVisionV1p3beta1ImportProductSetsResponse) MarshalJSON() ([]byte, error) { 7510 type NoMethod GoogleCloudVisionV1p3beta1ImportProductSetsResponse 7511 raw := NoMethod(*s) 7512 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7513} 7514 7515// GoogleCloudVisionV1p3beta1InputConfig: The desired input location and 7516// metadata. 7517type GoogleCloudVisionV1p3beta1InputConfig struct { 7518 // Content: File content, represented as a stream of bytes. Note: As 7519 // with all `bytes` fields, protobuffers use a pure binary 7520 // representation, whereas JSON representations use base64. Currently, 7521 // this field only works for BatchAnnotateFiles requests. It does not 7522 // work for AsyncBatchAnnotateFiles requests. 7523 Content string `json:"content,omitempty"` 7524 7525 // GcsSource: The Google Cloud Storage location to read the input from. 7526 GcsSource *GoogleCloudVisionV1p3beta1GcsSource `json:"gcsSource,omitempty"` 7527 7528 // MimeType: The type of the file. Currently only "application/pdf", 7529 // "image/tiff" and "image/gif" are supported. Wildcards are not 7530 // supported. 7531 MimeType string `json:"mimeType,omitempty"` 7532 7533 // ForceSendFields is a list of field names (e.g. "Content") to 7534 // unconditionally include in API requests. By default, fields with 7535 // empty values are omitted from API requests. However, any non-pointer, 7536 // non-interface field appearing in ForceSendFields will be sent to the 7537 // server regardless of whether the field is empty or not. This may be 7538 // used to include empty fields in Patch requests. 7539 ForceSendFields []string `json:"-"` 7540 7541 // NullFields is a list of field names (e.g. "Content") to include in 7542 // API requests with the JSON null value. By default, fields with empty 7543 // values are omitted from API requests. However, any field with an 7544 // empty value appearing in NullFields will be sent to the server as 7545 // null. It is an error if a field in this list has a non-empty value. 7546 // This may be used to include null fields in Patch requests. 7547 NullFields []string `json:"-"` 7548} 7549 7550func (s *GoogleCloudVisionV1p3beta1InputConfig) MarshalJSON() ([]byte, error) { 7551 type NoMethod GoogleCloudVisionV1p3beta1InputConfig 7552 raw := NoMethod(*s) 7553 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7554} 7555 7556// GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation: Set of detected 7557// objects with bounding boxes. 7558type GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation struct { 7559 // BoundingPoly: Image region to which this object belongs. This must be 7560 // populated. 7561 BoundingPoly *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPoly,omitempty"` 7562 7563 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". 7564 // For more information, see 7565 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 7566 LanguageCode string `json:"languageCode,omitempty"` 7567 7568 // Mid: Object ID that should align with EntityAnnotation mid. 7569 Mid string `json:"mid,omitempty"` 7570 7571 // Name: Object name, expressed in its `language_code` language. 7572 Name string `json:"name,omitempty"` 7573 7574 // Score: Score of the result. Range [0, 1]. 7575 Score float64 `json:"score,omitempty"` 7576 7577 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 7578 // unconditionally include in API requests. By default, fields with 7579 // empty values are omitted from API requests. However, any non-pointer, 7580 // non-interface field appearing in ForceSendFields will be sent to the 7581 // server regardless of whether the field is empty or not. This may be 7582 // used to include empty fields in Patch requests. 7583 ForceSendFields []string `json:"-"` 7584 7585 // NullFields is a list of field names (e.g. "BoundingPoly") to include 7586 // in API requests with the JSON null value. By default, fields with 7587 // empty values are omitted from API requests. However, any field with 7588 // an empty value appearing in NullFields will be sent to the server as 7589 // null. It is an error if a field in this list has a non-empty value. 7590 // This may be used to include null fields in Patch requests. 7591 NullFields []string `json:"-"` 7592} 7593 7594func (s *GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation) MarshalJSON() ([]byte, error) { 7595 type NoMethod GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation 7596 raw := NoMethod(*s) 7597 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7598} 7599 7600func (s *GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation) UnmarshalJSON(data []byte) error { 7601 type NoMethod GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation 7602 var s1 struct { 7603 Score gensupport.JSONFloat64 `json:"score"` 7604 *NoMethod 7605 } 7606 s1.NoMethod = (*NoMethod)(s) 7607 if err := json.Unmarshal(data, &s1); err != nil { 7608 return err 7609 } 7610 s.Score = float64(s1.Score) 7611 return nil 7612} 7613 7614// GoogleCloudVisionV1p3beta1LocationInfo: Detected entity location 7615// information. 7616type GoogleCloudVisionV1p3beta1LocationInfo struct { 7617 // LatLng: lat/long location coordinates. 7618 LatLng *LatLng `json:"latLng,omitempty"` 7619 7620 // ForceSendFields is a list of field names (e.g. "LatLng") to 7621 // unconditionally include in API requests. By default, fields with 7622 // empty values are omitted from API requests. However, any non-pointer, 7623 // non-interface field appearing in ForceSendFields will be sent to the 7624 // server regardless of whether the field is empty or not. This may be 7625 // used to include empty fields in Patch requests. 7626 ForceSendFields []string `json:"-"` 7627 7628 // NullFields is a list of field names (e.g. "LatLng") to include in API 7629 // requests with the JSON null value. By default, fields with empty 7630 // values are omitted from API requests. However, any field with an 7631 // empty value appearing in NullFields will be sent to the server as 7632 // null. It is an error if a field in this list has a non-empty value. 7633 // This may be used to include null fields in Patch requests. 7634 NullFields []string `json:"-"` 7635} 7636 7637func (s *GoogleCloudVisionV1p3beta1LocationInfo) MarshalJSON() ([]byte, error) { 7638 type NoMethod GoogleCloudVisionV1p3beta1LocationInfo 7639 raw := NoMethod(*s) 7640 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7641} 7642 7643// GoogleCloudVisionV1p3beta1NormalizedVertex: A vertex represents a 2D 7644// point in the image. NOTE: the normalized vertex coordinates are 7645// relative to the original image and range from 0 to 1. 7646type GoogleCloudVisionV1p3beta1NormalizedVertex struct { 7647 // X: X coordinate. 7648 X float64 `json:"x,omitempty"` 7649 7650 // Y: Y coordinate. 7651 Y float64 `json:"y,omitempty"` 7652 7653 // ForceSendFields is a list of field names (e.g. "X") to 7654 // unconditionally include in API requests. By default, fields with 7655 // empty values are omitted from API requests. However, any non-pointer, 7656 // non-interface field appearing in ForceSendFields will be sent to the 7657 // server regardless of whether the field is empty or not. This may be 7658 // used to include empty fields in Patch requests. 7659 ForceSendFields []string `json:"-"` 7660 7661 // NullFields is a list of field names (e.g. "X") to include in API 7662 // requests with the JSON null value. By default, fields with empty 7663 // values are omitted from API requests. However, any field with an 7664 // empty value appearing in NullFields will be sent to the server as 7665 // null. It is an error if a field in this list has a non-empty value. 7666 // This may be used to include null fields in Patch requests. 7667 NullFields []string `json:"-"` 7668} 7669 7670func (s *GoogleCloudVisionV1p3beta1NormalizedVertex) MarshalJSON() ([]byte, error) { 7671 type NoMethod GoogleCloudVisionV1p3beta1NormalizedVertex 7672 raw := NoMethod(*s) 7673 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7674} 7675 7676func (s *GoogleCloudVisionV1p3beta1NormalizedVertex) UnmarshalJSON(data []byte) error { 7677 type NoMethod GoogleCloudVisionV1p3beta1NormalizedVertex 7678 var s1 struct { 7679 X gensupport.JSONFloat64 `json:"x"` 7680 Y gensupport.JSONFloat64 `json:"y"` 7681 *NoMethod 7682 } 7683 s1.NoMethod = (*NoMethod)(s) 7684 if err := json.Unmarshal(data, &s1); err != nil { 7685 return err 7686 } 7687 s.X = float64(s1.X) 7688 s.Y = float64(s1.Y) 7689 return nil 7690} 7691 7692// GoogleCloudVisionV1p3beta1OperationMetadata: Contains metadata for 7693// the BatchAnnotateImages operation. 7694type GoogleCloudVisionV1p3beta1OperationMetadata struct { 7695 // CreateTime: The time when the batch request was received. 7696 CreateTime string `json:"createTime,omitempty"` 7697 7698 // State: Current state of the batch operation. 7699 // 7700 // Possible values: 7701 // "STATE_UNSPECIFIED" - Invalid. 7702 // "CREATED" - Request is received. 7703 // "RUNNING" - Request is actively being processed. 7704 // "DONE" - The batch processing is done. 7705 // "CANCELLED" - The batch processing was cancelled. 7706 State string `json:"state,omitempty"` 7707 7708 // UpdateTime: The time when the operation result was last updated. 7709 UpdateTime string `json:"updateTime,omitempty"` 7710 7711 // ForceSendFields is a list of field names (e.g. "CreateTime") to 7712 // unconditionally include in API requests. By default, fields with 7713 // empty values are omitted from API requests. However, any non-pointer, 7714 // non-interface field appearing in ForceSendFields will be sent to the 7715 // server regardless of whether the field is empty or not. This may be 7716 // used to include empty fields in Patch requests. 7717 ForceSendFields []string `json:"-"` 7718 7719 // NullFields is a list of field names (e.g. "CreateTime") to include in 7720 // API requests with the JSON null value. By default, fields with empty 7721 // values are omitted from API requests. However, any field with an 7722 // empty value appearing in NullFields will be sent to the server as 7723 // null. It is an error if a field in this list has a non-empty value. 7724 // This may be used to include null fields in Patch requests. 7725 NullFields []string `json:"-"` 7726} 7727 7728func (s *GoogleCloudVisionV1p3beta1OperationMetadata) MarshalJSON() ([]byte, error) { 7729 type NoMethod GoogleCloudVisionV1p3beta1OperationMetadata 7730 raw := NoMethod(*s) 7731 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7732} 7733 7734// GoogleCloudVisionV1p3beta1OutputConfig: The desired output location 7735// and metadata. 7736type GoogleCloudVisionV1p3beta1OutputConfig struct { 7737 // BatchSize: The max number of response protos to put into each output 7738 // JSON file on Google Cloud Storage. The valid range is [1, 100]. If 7739 // not specified, the default value is 20. For example, for one pdf file 7740 // with 100 pages, 100 response protos will be generated. If 7741 // `batch_size` = 20, then 5 json files each containing 20 response 7742 // protos will be written under the prefix `gcs_destination`.`uri`. 7743 // Currently, batch_size only applies to GcsDestination, with potential 7744 // future support for other output configurations. 7745 BatchSize int64 `json:"batchSize,omitempty"` 7746 7747 // GcsDestination: The Google Cloud Storage location to write the 7748 // output(s) to. 7749 GcsDestination *GoogleCloudVisionV1p3beta1GcsDestination `json:"gcsDestination,omitempty"` 7750 7751 // ForceSendFields is a list of field names (e.g. "BatchSize") to 7752 // unconditionally include in API requests. By default, fields with 7753 // empty values are omitted from API requests. However, any non-pointer, 7754 // non-interface field appearing in ForceSendFields will be sent to the 7755 // server regardless of whether the field is empty or not. This may be 7756 // used to include empty fields in Patch requests. 7757 ForceSendFields []string `json:"-"` 7758 7759 // NullFields is a list of field names (e.g. "BatchSize") to include in 7760 // API requests with the JSON null value. By default, fields with empty 7761 // values are omitted from API requests. However, any field with an 7762 // empty value appearing in NullFields will be sent to the server as 7763 // null. It is an error if a field in this list has a non-empty value. 7764 // This may be used to include null fields in Patch requests. 7765 NullFields []string `json:"-"` 7766} 7767 7768func (s *GoogleCloudVisionV1p3beta1OutputConfig) MarshalJSON() ([]byte, error) { 7769 type NoMethod GoogleCloudVisionV1p3beta1OutputConfig 7770 raw := NoMethod(*s) 7771 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7772} 7773 7774// GoogleCloudVisionV1p3beta1Page: Detected page from OCR. 7775type GoogleCloudVisionV1p3beta1Page struct { 7776 // Blocks: List of blocks of text, images etc on this page. 7777 Blocks []*GoogleCloudVisionV1p3beta1Block `json:"blocks,omitempty"` 7778 7779 // Confidence: Confidence of the OCR results on the page. Range [0, 1]. 7780 Confidence float64 `json:"confidence,omitempty"` 7781 7782 // Height: Page height. For PDFs the unit is points. For images 7783 // (including TIFFs) the unit is pixels. 7784 Height int64 `json:"height,omitempty"` 7785 7786 // Property: Additional information detected on the page. 7787 Property *GoogleCloudVisionV1p3beta1TextAnnotationTextProperty `json:"property,omitempty"` 7788 7789 // Width: Page width. For PDFs the unit is points. For images (including 7790 // TIFFs) the unit is pixels. 7791 Width int64 `json:"width,omitempty"` 7792 7793 // ForceSendFields is a list of field names (e.g. "Blocks") to 7794 // unconditionally include in API requests. By default, fields with 7795 // empty values are omitted from API requests. However, any non-pointer, 7796 // non-interface field appearing in ForceSendFields will be sent to the 7797 // server regardless of whether the field is empty or not. This may be 7798 // used to include empty fields in Patch requests. 7799 ForceSendFields []string `json:"-"` 7800 7801 // NullFields is a list of field names (e.g. "Blocks") to include in API 7802 // requests with the JSON null value. By default, fields with empty 7803 // values are omitted from API requests. However, any field with an 7804 // empty value appearing in NullFields will be sent to the server as 7805 // null. It is an error if a field in this list has a non-empty value. 7806 // This may be used to include null fields in Patch requests. 7807 NullFields []string `json:"-"` 7808} 7809 7810func (s *GoogleCloudVisionV1p3beta1Page) MarshalJSON() ([]byte, error) { 7811 type NoMethod GoogleCloudVisionV1p3beta1Page 7812 raw := NoMethod(*s) 7813 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7814} 7815 7816func (s *GoogleCloudVisionV1p3beta1Page) UnmarshalJSON(data []byte) error { 7817 type NoMethod GoogleCloudVisionV1p3beta1Page 7818 var s1 struct { 7819 Confidence gensupport.JSONFloat64 `json:"confidence"` 7820 *NoMethod 7821 } 7822 s1.NoMethod = (*NoMethod)(s) 7823 if err := json.Unmarshal(data, &s1); err != nil { 7824 return err 7825 } 7826 s.Confidence = float64(s1.Confidence) 7827 return nil 7828} 7829 7830// GoogleCloudVisionV1p3beta1Paragraph: Structural unit of text 7831// representing a number of words in certain order. 7832type GoogleCloudVisionV1p3beta1Paragraph struct { 7833 // BoundingBox: The bounding box for the paragraph. The vertices are in 7834 // the order of top-left, top-right, bottom-right, bottom-left. When a 7835 // rotation of the bounding box is detected the rotation is represented 7836 // as around the top-left corner as defined when the text is read in the 7837 // 'natural' orientation. For example: * when the text is horizontal it 7838 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 7839 // around the top-left corner it becomes: 2----3 | | 1----0 and the 7840 // vertex order will still be (0, 1, 2, 3). 7841 BoundingBox *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingBox,omitempty"` 7842 7843 // Confidence: Confidence of the OCR results for the paragraph. Range 7844 // [0, 1]. 7845 Confidence float64 `json:"confidence,omitempty"` 7846 7847 // Property: Additional information detected for the paragraph. 7848 Property *GoogleCloudVisionV1p3beta1TextAnnotationTextProperty `json:"property,omitempty"` 7849 7850 // Words: List of all words in this paragraph. 7851 Words []*GoogleCloudVisionV1p3beta1Word `json:"words,omitempty"` 7852 7853 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 7854 // unconditionally include in API requests. By default, fields with 7855 // empty values are omitted from API requests. However, any non-pointer, 7856 // non-interface field appearing in ForceSendFields will be sent to the 7857 // server regardless of whether the field is empty or not. This may be 7858 // used to include empty fields in Patch requests. 7859 ForceSendFields []string `json:"-"` 7860 7861 // NullFields is a list of field names (e.g. "BoundingBox") to include 7862 // in API requests with the JSON null value. By default, fields with 7863 // empty values are omitted from API requests. However, any field with 7864 // an empty value appearing in NullFields will be sent to the server as 7865 // null. It is an error if a field in this list has a non-empty value. 7866 // This may be used to include null fields in Patch requests. 7867 NullFields []string `json:"-"` 7868} 7869 7870func (s *GoogleCloudVisionV1p3beta1Paragraph) MarshalJSON() ([]byte, error) { 7871 type NoMethod GoogleCloudVisionV1p3beta1Paragraph 7872 raw := NoMethod(*s) 7873 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7874} 7875 7876func (s *GoogleCloudVisionV1p3beta1Paragraph) UnmarshalJSON(data []byte) error { 7877 type NoMethod GoogleCloudVisionV1p3beta1Paragraph 7878 var s1 struct { 7879 Confidence gensupport.JSONFloat64 `json:"confidence"` 7880 *NoMethod 7881 } 7882 s1.NoMethod = (*NoMethod)(s) 7883 if err := json.Unmarshal(data, &s1); err != nil { 7884 return err 7885 } 7886 s.Confidence = float64(s1.Confidence) 7887 return nil 7888} 7889 7890// GoogleCloudVisionV1p3beta1Position: A 3D position in the image, used 7891// primarily for Face detection landmarks. A valid Position must have 7892// both x and y coordinates. The position coordinates are in the same 7893// scale as the original image. 7894type GoogleCloudVisionV1p3beta1Position struct { 7895 // X: X coordinate. 7896 X float64 `json:"x,omitempty"` 7897 7898 // Y: Y coordinate. 7899 Y float64 `json:"y,omitempty"` 7900 7901 // Z: Z coordinate (or depth). 7902 Z float64 `json:"z,omitempty"` 7903 7904 // ForceSendFields is a list of field names (e.g. "X") to 7905 // unconditionally include in API requests. By default, fields with 7906 // empty values are omitted from API requests. However, any non-pointer, 7907 // non-interface field appearing in ForceSendFields will be sent to the 7908 // server regardless of whether the field is empty or not. This may be 7909 // used to include empty fields in Patch requests. 7910 ForceSendFields []string `json:"-"` 7911 7912 // NullFields is a list of field names (e.g. "X") to include in API 7913 // requests with the JSON null value. By default, fields with empty 7914 // values are omitted from API requests. However, any field with an 7915 // empty value appearing in NullFields will be sent to the server as 7916 // null. It is an error if a field in this list has a non-empty value. 7917 // This may be used to include null fields in Patch requests. 7918 NullFields []string `json:"-"` 7919} 7920 7921func (s *GoogleCloudVisionV1p3beta1Position) MarshalJSON() ([]byte, error) { 7922 type NoMethod GoogleCloudVisionV1p3beta1Position 7923 raw := NoMethod(*s) 7924 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7925} 7926 7927func (s *GoogleCloudVisionV1p3beta1Position) UnmarshalJSON(data []byte) error { 7928 type NoMethod GoogleCloudVisionV1p3beta1Position 7929 var s1 struct { 7930 X gensupport.JSONFloat64 `json:"x"` 7931 Y gensupport.JSONFloat64 `json:"y"` 7932 Z gensupport.JSONFloat64 `json:"z"` 7933 *NoMethod 7934 } 7935 s1.NoMethod = (*NoMethod)(s) 7936 if err := json.Unmarshal(data, &s1); err != nil { 7937 return err 7938 } 7939 s.X = float64(s1.X) 7940 s.Y = float64(s1.Y) 7941 s.Z = float64(s1.Z) 7942 return nil 7943} 7944 7945// GoogleCloudVisionV1p3beta1Product: A Product contains 7946// ReferenceImages. 7947type GoogleCloudVisionV1p3beta1Product struct { 7948 // Description: User-provided metadata to be stored with this product. 7949 // Must be at most 4096 characters long. 7950 Description string `json:"description,omitempty"` 7951 7952 // DisplayName: The user-provided name for this Product. Must not be 7953 // empty. Must be at most 4096 characters long. 7954 DisplayName string `json:"displayName,omitempty"` 7955 7956 // Name: The resource name of the product. Format is: 7957 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This 7958 // field is ignored when creating a product. 7959 Name string `json:"name,omitempty"` 7960 7961 // ProductCategory: Immutable. The category for the product identified 7962 // by the reference image. This should be one of "homegoods-v2", 7963 // "apparel-v2", "toys-v2", "packagedgoods-v1" or "general-v1". The 7964 // legacy categories "homegoods", "apparel", and "toys" are still 7965 // supported, but these should not be used for new products. 7966 ProductCategory string `json:"productCategory,omitempty"` 7967 7968 // ProductLabels: Key-value pairs that can be attached to a product. At 7969 // query time, constraints can be specified based on the product_labels. 7970 // Note that integer values can be provided as strings, e.g. "1199". 7971 // Only strings with integer values can match a range-based restriction 7972 // which is to be supported soon. Multiple values can be assigned to the 7973 // same key. One product may have up to 500 product_labels. Notice that 7974 // the total number of distinct product_labels over all products in one 7975 // ProductSet cannot exceed 1M, otherwise the product search pipeline 7976 // will refuse to work for that ProductSet. 7977 ProductLabels []*GoogleCloudVisionV1p3beta1ProductKeyValue `json:"productLabels,omitempty"` 7978 7979 // ForceSendFields is a list of field names (e.g. "Description") to 7980 // unconditionally include in API requests. By default, fields with 7981 // empty values are omitted from API requests. However, any non-pointer, 7982 // non-interface field appearing in ForceSendFields will be sent to the 7983 // server regardless of whether the field is empty or not. This may be 7984 // used to include empty fields in Patch requests. 7985 ForceSendFields []string `json:"-"` 7986 7987 // NullFields is a list of field names (e.g. "Description") to include 7988 // in API requests with the JSON null value. By default, fields with 7989 // empty values are omitted from API requests. However, any field with 7990 // an empty value appearing in NullFields will be sent to the server as 7991 // null. It is an error if a field in this list has a non-empty value. 7992 // This may be used to include null fields in Patch requests. 7993 NullFields []string `json:"-"` 7994} 7995 7996func (s *GoogleCloudVisionV1p3beta1Product) MarshalJSON() ([]byte, error) { 7997 type NoMethod GoogleCloudVisionV1p3beta1Product 7998 raw := NoMethod(*s) 7999 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8000} 8001 8002// GoogleCloudVisionV1p3beta1ProductKeyValue: A product label 8003// represented as a key-value pair. 8004type GoogleCloudVisionV1p3beta1ProductKeyValue struct { 8005 // Key: The key of the label attached to the product. Cannot be empty 8006 // and cannot exceed 128 bytes. 8007 Key string `json:"key,omitempty"` 8008 8009 // Value: The value of the label attached to the product. Cannot be 8010 // empty and cannot exceed 128 bytes. 8011 Value string `json:"value,omitempty"` 8012 8013 // ForceSendFields is a list of field names (e.g. "Key") to 8014 // unconditionally include in API requests. By default, fields with 8015 // empty values are omitted from API requests. However, any non-pointer, 8016 // non-interface field appearing in ForceSendFields will be sent to the 8017 // server regardless of whether the field is empty or not. This may be 8018 // used to include empty fields in Patch requests. 8019 ForceSendFields []string `json:"-"` 8020 8021 // NullFields is a list of field names (e.g. "Key") to include in API 8022 // requests with the JSON null value. By default, fields with empty 8023 // values are omitted from API requests. However, any field with an 8024 // empty value appearing in NullFields will be sent to the server as 8025 // null. It is an error if a field in this list has a non-empty value. 8026 // This may be used to include null fields in Patch requests. 8027 NullFields []string `json:"-"` 8028} 8029 8030func (s *GoogleCloudVisionV1p3beta1ProductKeyValue) MarshalJSON() ([]byte, error) { 8031 type NoMethod GoogleCloudVisionV1p3beta1ProductKeyValue 8032 raw := NoMethod(*s) 8033 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8034} 8035 8036// GoogleCloudVisionV1p3beta1ProductSearchResults: Results for a product 8037// search request. 8038type GoogleCloudVisionV1p3beta1ProductSearchResults struct { 8039 // IndexTime: Timestamp of the index which provided these results. 8040 // Products added to the product set and products removed from the 8041 // product set after this time are not reflected in the current results. 8042 IndexTime string `json:"indexTime,omitempty"` 8043 8044 // ProductGroupedResults: List of results grouped by products detected 8045 // in the query image. Each entry corresponds to one bounding polygon in 8046 // the query image, and contains the matching products specific to that 8047 // region. There may be duplicate product matches in the union of all 8048 // the per-product results. 8049 ProductGroupedResults []*GoogleCloudVisionV1p3beta1ProductSearchResultsGroupedResult `json:"productGroupedResults,omitempty"` 8050 8051 // Results: List of results, one for each product match. 8052 Results []*GoogleCloudVisionV1p3beta1ProductSearchResultsResult `json:"results,omitempty"` 8053 8054 // ForceSendFields is a list of field names (e.g. "IndexTime") to 8055 // unconditionally include in API requests. By default, fields with 8056 // empty values are omitted from API requests. However, any non-pointer, 8057 // non-interface field appearing in ForceSendFields will be sent to the 8058 // server regardless of whether the field is empty or not. This may be 8059 // used to include empty fields in Patch requests. 8060 ForceSendFields []string `json:"-"` 8061 8062 // NullFields is a list of field names (e.g. "IndexTime") to include in 8063 // API requests with the JSON null value. By default, fields with empty 8064 // values are omitted from API requests. However, any field with an 8065 // empty value appearing in NullFields will be sent to the server as 8066 // null. It is an error if a field in this list has a non-empty value. 8067 // This may be used to include null fields in Patch requests. 8068 NullFields []string `json:"-"` 8069} 8070 8071func (s *GoogleCloudVisionV1p3beta1ProductSearchResults) MarshalJSON() ([]byte, error) { 8072 type NoMethod GoogleCloudVisionV1p3beta1ProductSearchResults 8073 raw := NoMethod(*s) 8074 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8075} 8076 8077// GoogleCloudVisionV1p3beta1ProductSearchResultsGroupedResult: 8078// Information about the products similar to a single product in a query 8079// image. 8080type GoogleCloudVisionV1p3beta1ProductSearchResultsGroupedResult struct { 8081 // BoundingPoly: The bounding polygon around the product detected in the 8082 // query image. 8083 BoundingPoly *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPoly,omitempty"` 8084 8085 // ObjectAnnotations: List of generic predictions for the object in the 8086 // bounding box. 8087 ObjectAnnotations []*GoogleCloudVisionV1p3beta1ProductSearchResultsObjectAnnotation `json:"objectAnnotations,omitempty"` 8088 8089 // Results: List of results, one for each product match. 8090 Results []*GoogleCloudVisionV1p3beta1ProductSearchResultsResult `json:"results,omitempty"` 8091 8092 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 8093 // unconditionally include in API requests. By default, fields with 8094 // empty values are omitted from API requests. However, any non-pointer, 8095 // non-interface field appearing in ForceSendFields will be sent to the 8096 // server regardless of whether the field is empty or not. This may be 8097 // used to include empty fields in Patch requests. 8098 ForceSendFields []string `json:"-"` 8099 8100 // NullFields is a list of field names (e.g. "BoundingPoly") to include 8101 // in API requests with the JSON null value. By default, fields with 8102 // empty values are omitted from API requests. However, any field with 8103 // an empty value appearing in NullFields will be sent to the server as 8104 // null. It is an error if a field in this list has a non-empty value. 8105 // This may be used to include null fields in Patch requests. 8106 NullFields []string `json:"-"` 8107} 8108 8109func (s *GoogleCloudVisionV1p3beta1ProductSearchResultsGroupedResult) MarshalJSON() ([]byte, error) { 8110 type NoMethod GoogleCloudVisionV1p3beta1ProductSearchResultsGroupedResult 8111 raw := NoMethod(*s) 8112 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8113} 8114 8115// GoogleCloudVisionV1p3beta1ProductSearchResultsObjectAnnotation: 8116// Prediction for what the object in the bounding box is. 8117type GoogleCloudVisionV1p3beta1ProductSearchResultsObjectAnnotation struct { 8118 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". 8119 // For more information, see 8120 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 8121 LanguageCode string `json:"languageCode,omitempty"` 8122 8123 // Mid: Object ID that should align with EntityAnnotation mid. 8124 Mid string `json:"mid,omitempty"` 8125 8126 // Name: Object name, expressed in its `language_code` language. 8127 Name string `json:"name,omitempty"` 8128 8129 // Score: Score of the result. Range [0, 1]. 8130 Score float64 `json:"score,omitempty"` 8131 8132 // ForceSendFields is a list of field names (e.g. "LanguageCode") to 8133 // unconditionally include in API requests. By default, fields with 8134 // empty values are omitted from API requests. However, any non-pointer, 8135 // non-interface field appearing in ForceSendFields will be sent to the 8136 // server regardless of whether the field is empty or not. This may be 8137 // used to include empty fields in Patch requests. 8138 ForceSendFields []string `json:"-"` 8139 8140 // NullFields is a list of field names (e.g. "LanguageCode") to include 8141 // in API requests with the JSON null value. By default, fields with 8142 // empty values are omitted from API requests. However, any field with 8143 // an empty value appearing in NullFields will be sent to the server as 8144 // null. It is an error if a field in this list has a non-empty value. 8145 // This may be used to include null fields in Patch requests. 8146 NullFields []string `json:"-"` 8147} 8148 8149func (s *GoogleCloudVisionV1p3beta1ProductSearchResultsObjectAnnotation) MarshalJSON() ([]byte, error) { 8150 type NoMethod GoogleCloudVisionV1p3beta1ProductSearchResultsObjectAnnotation 8151 raw := NoMethod(*s) 8152 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8153} 8154 8155func (s *GoogleCloudVisionV1p3beta1ProductSearchResultsObjectAnnotation) UnmarshalJSON(data []byte) error { 8156 type NoMethod GoogleCloudVisionV1p3beta1ProductSearchResultsObjectAnnotation 8157 var s1 struct { 8158 Score gensupport.JSONFloat64 `json:"score"` 8159 *NoMethod 8160 } 8161 s1.NoMethod = (*NoMethod)(s) 8162 if err := json.Unmarshal(data, &s1); err != nil { 8163 return err 8164 } 8165 s.Score = float64(s1.Score) 8166 return nil 8167} 8168 8169// GoogleCloudVisionV1p3beta1ProductSearchResultsResult: Information 8170// about a product. 8171type GoogleCloudVisionV1p3beta1ProductSearchResultsResult struct { 8172 // Image: The resource name of the image from the product that is the 8173 // closest match to the query. 8174 Image string `json:"image,omitempty"` 8175 8176 // Product: The Product. 8177 Product *GoogleCloudVisionV1p3beta1Product `json:"product,omitempty"` 8178 8179 // Score: A confidence level on the match, ranging from 0 (no 8180 // confidence) to 1 (full confidence). 8181 Score float64 `json:"score,omitempty"` 8182 8183 // ForceSendFields is a list of field names (e.g. "Image") to 8184 // unconditionally include in API requests. By default, fields with 8185 // empty values are omitted from API requests. However, any non-pointer, 8186 // non-interface field appearing in ForceSendFields will be sent to the 8187 // server regardless of whether the field is empty or not. This may be 8188 // used to include empty fields in Patch requests. 8189 ForceSendFields []string `json:"-"` 8190 8191 // NullFields is a list of field names (e.g. "Image") to include in API 8192 // requests with the JSON null value. By default, fields with empty 8193 // values are omitted from API requests. However, any field with an 8194 // empty value appearing in NullFields will be sent to the server as 8195 // null. It is an error if a field in this list has a non-empty value. 8196 // This may be used to include null fields in Patch requests. 8197 NullFields []string `json:"-"` 8198} 8199 8200func (s *GoogleCloudVisionV1p3beta1ProductSearchResultsResult) MarshalJSON() ([]byte, error) { 8201 type NoMethod GoogleCloudVisionV1p3beta1ProductSearchResultsResult 8202 raw := NoMethod(*s) 8203 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8204} 8205 8206func (s *GoogleCloudVisionV1p3beta1ProductSearchResultsResult) UnmarshalJSON(data []byte) error { 8207 type NoMethod GoogleCloudVisionV1p3beta1ProductSearchResultsResult 8208 var s1 struct { 8209 Score gensupport.JSONFloat64 `json:"score"` 8210 *NoMethod 8211 } 8212 s1.NoMethod = (*NoMethod)(s) 8213 if err := json.Unmarshal(data, &s1); err != nil { 8214 return err 8215 } 8216 s.Score = float64(s1.Score) 8217 return nil 8218} 8219 8220// GoogleCloudVisionV1p3beta1Property: A `Property` consists of a 8221// user-supplied name/value pair. 8222type GoogleCloudVisionV1p3beta1Property struct { 8223 // Name: Name of the property. 8224 Name string `json:"name,omitempty"` 8225 8226 // Uint64Value: Value of numeric properties. 8227 Uint64Value uint64 `json:"uint64Value,omitempty,string"` 8228 8229 // Value: Value of the property. 8230 Value string `json:"value,omitempty"` 8231 8232 // ForceSendFields is a list of field names (e.g. "Name") to 8233 // unconditionally include in API requests. By default, fields with 8234 // empty values are omitted from API requests. However, any non-pointer, 8235 // non-interface field appearing in ForceSendFields will be sent to the 8236 // server regardless of whether the field is empty or not. This may be 8237 // used to include empty fields in Patch requests. 8238 ForceSendFields []string `json:"-"` 8239 8240 // NullFields is a list of field names (e.g. "Name") to include in API 8241 // requests with the JSON null value. By default, fields with empty 8242 // values are omitted from API requests. However, any field with an 8243 // empty value appearing in NullFields will be sent to the server as 8244 // null. It is an error if a field in this list has a non-empty value. 8245 // This may be used to include null fields in Patch requests. 8246 NullFields []string `json:"-"` 8247} 8248 8249func (s *GoogleCloudVisionV1p3beta1Property) MarshalJSON() ([]byte, error) { 8250 type NoMethod GoogleCloudVisionV1p3beta1Property 8251 raw := NoMethod(*s) 8252 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8253} 8254 8255// GoogleCloudVisionV1p3beta1ReferenceImage: A `ReferenceImage` 8256// represents a product image and its associated metadata, such as 8257// bounding boxes. 8258type GoogleCloudVisionV1p3beta1ReferenceImage struct { 8259 // BoundingPolys: Optional. Bounding polygons around the areas of 8260 // interest in the reference image. If this field is empty, the system 8261 // will try to detect regions of interest. At most 10 bounding polygons 8262 // will be used. The provided shape is converted into a non-rotated 8263 // rectangle. Once converted, the small edge of the rectangle must be 8264 // greater than or equal to 300 pixels. The aspect ratio must be 1:4 or 8265 // less (i.e. 1:3 is ok; 1:5 is not). 8266 BoundingPolys []*GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPolys,omitempty"` 8267 8268 // Name: The resource name of the reference image. Format is: 8269 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceIma 8270 // ges/IMAGE_ID`. This field is ignored when creating a reference image. 8271 Name string `json:"name,omitempty"` 8272 8273 // Uri: Required. The Google Cloud Storage URI of the reference image. 8274 // The URI must start with `gs://`. 8275 Uri string `json:"uri,omitempty"` 8276 8277 // ForceSendFields is a list of field names (e.g. "BoundingPolys") to 8278 // unconditionally include in API requests. By default, fields with 8279 // empty values are omitted from API requests. However, any non-pointer, 8280 // non-interface field appearing in ForceSendFields will be sent to the 8281 // server regardless of whether the field is empty or not. This may be 8282 // used to include empty fields in Patch requests. 8283 ForceSendFields []string `json:"-"` 8284 8285 // NullFields is a list of field names (e.g. "BoundingPolys") to include 8286 // in API requests with the JSON null value. By default, fields with 8287 // empty values are omitted from API requests. However, any field with 8288 // an empty value appearing in NullFields will be sent to the server as 8289 // null. It is an error if a field in this list has a non-empty value. 8290 // This may be used to include null fields in Patch requests. 8291 NullFields []string `json:"-"` 8292} 8293 8294func (s *GoogleCloudVisionV1p3beta1ReferenceImage) MarshalJSON() ([]byte, error) { 8295 type NoMethod GoogleCloudVisionV1p3beta1ReferenceImage 8296 raw := NoMethod(*s) 8297 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8298} 8299 8300// GoogleCloudVisionV1p3beta1SafeSearchAnnotation: Set of features 8301// pertaining to the image, computed by computer vision methods over 8302// safe-search verticals (for example, adult, spoof, medical, violence). 8303type GoogleCloudVisionV1p3beta1SafeSearchAnnotation struct { 8304 // Adult: Represents the adult content likelihood for the image. Adult 8305 // content may contain elements such as nudity, pornographic images or 8306 // cartoons, or sexual activities. 8307 // 8308 // Possible values: 8309 // "UNKNOWN" - Unknown likelihood. 8310 // "VERY_UNLIKELY" - It is very unlikely. 8311 // "UNLIKELY" - It is unlikely. 8312 // "POSSIBLE" - It is possible. 8313 // "LIKELY" - It is likely. 8314 // "VERY_LIKELY" - It is very likely. 8315 Adult string `json:"adult,omitempty"` 8316 8317 // Medical: Likelihood that this is a medical image. 8318 // 8319 // Possible values: 8320 // "UNKNOWN" - Unknown likelihood. 8321 // "VERY_UNLIKELY" - It is very unlikely. 8322 // "UNLIKELY" - It is unlikely. 8323 // "POSSIBLE" - It is possible. 8324 // "LIKELY" - It is likely. 8325 // "VERY_LIKELY" - It is very likely. 8326 Medical string `json:"medical,omitempty"` 8327 8328 // Racy: Likelihood that the request image contains racy content. Racy 8329 // content may include (but is not limited to) skimpy or sheer clothing, 8330 // strategically covered nudity, lewd or provocative poses, or close-ups 8331 // of sensitive body areas. 8332 // 8333 // Possible values: 8334 // "UNKNOWN" - Unknown likelihood. 8335 // "VERY_UNLIKELY" - It is very unlikely. 8336 // "UNLIKELY" - It is unlikely. 8337 // "POSSIBLE" - It is possible. 8338 // "LIKELY" - It is likely. 8339 // "VERY_LIKELY" - It is very likely. 8340 Racy string `json:"racy,omitempty"` 8341 8342 // Spoof: Spoof likelihood. The likelihood that an modification was made 8343 // to the image's canonical version to make it appear funny or 8344 // offensive. 8345 // 8346 // Possible values: 8347 // "UNKNOWN" - Unknown likelihood. 8348 // "VERY_UNLIKELY" - It is very unlikely. 8349 // "UNLIKELY" - It is unlikely. 8350 // "POSSIBLE" - It is possible. 8351 // "LIKELY" - It is likely. 8352 // "VERY_LIKELY" - It is very likely. 8353 Spoof string `json:"spoof,omitempty"` 8354 8355 // Violence: Likelihood that this image contains violent content. 8356 // 8357 // Possible values: 8358 // "UNKNOWN" - Unknown likelihood. 8359 // "VERY_UNLIKELY" - It is very unlikely. 8360 // "UNLIKELY" - It is unlikely. 8361 // "POSSIBLE" - It is possible. 8362 // "LIKELY" - It is likely. 8363 // "VERY_LIKELY" - It is very likely. 8364 Violence string `json:"violence,omitempty"` 8365 8366 // ForceSendFields is a list of field names (e.g. "Adult") to 8367 // unconditionally include in API requests. By default, fields with 8368 // empty values are omitted from API requests. However, any non-pointer, 8369 // non-interface field appearing in ForceSendFields will be sent to the 8370 // server regardless of whether the field is empty or not. This may be 8371 // used to include empty fields in Patch requests. 8372 ForceSendFields []string `json:"-"` 8373 8374 // NullFields is a list of field names (e.g. "Adult") to include in API 8375 // requests with the JSON null value. By default, fields with empty 8376 // values are omitted from API requests. However, any field with an 8377 // empty value appearing in NullFields will be sent to the server as 8378 // null. It is an error if a field in this list has a non-empty value. 8379 // This may be used to include null fields in Patch requests. 8380 NullFields []string `json:"-"` 8381} 8382 8383func (s *GoogleCloudVisionV1p3beta1SafeSearchAnnotation) MarshalJSON() ([]byte, error) { 8384 type NoMethod GoogleCloudVisionV1p3beta1SafeSearchAnnotation 8385 raw := NoMethod(*s) 8386 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8387} 8388 8389// GoogleCloudVisionV1p3beta1Symbol: A single symbol representation. 8390type GoogleCloudVisionV1p3beta1Symbol struct { 8391 // BoundingBox: The bounding box for the symbol. The vertices are in the 8392 // order of top-left, top-right, bottom-right, bottom-left. When a 8393 // rotation of the bounding box is detected the rotation is represented 8394 // as around the top-left corner as defined when the text is read in the 8395 // 'natural' orientation. For example: * when the text is horizontal it 8396 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 8397 // around the top-left corner it becomes: 2----3 | | 1----0 and the 8398 // vertex order will still be (0, 1, 2, 3). 8399 BoundingBox *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingBox,omitempty"` 8400 8401 // Confidence: Confidence of the OCR results for the symbol. Range [0, 8402 // 1]. 8403 Confidence float64 `json:"confidence,omitempty"` 8404 8405 // Property: Additional information detected for the symbol. 8406 Property *GoogleCloudVisionV1p3beta1TextAnnotationTextProperty `json:"property,omitempty"` 8407 8408 // Text: The actual UTF-8 representation of the symbol. 8409 Text string `json:"text,omitempty"` 8410 8411 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 8412 // unconditionally include in API requests. By default, fields with 8413 // empty values are omitted from API requests. However, any non-pointer, 8414 // non-interface field appearing in ForceSendFields will be sent to the 8415 // server regardless of whether the field is empty or not. This may be 8416 // used to include empty fields in Patch requests. 8417 ForceSendFields []string `json:"-"` 8418 8419 // NullFields is a list of field names (e.g. "BoundingBox") to include 8420 // in API requests with the JSON null value. By default, fields with 8421 // empty values are omitted from API requests. However, any field with 8422 // an empty value appearing in NullFields will be sent to the server as 8423 // null. It is an error if a field in this list has a non-empty value. 8424 // This may be used to include null fields in Patch requests. 8425 NullFields []string `json:"-"` 8426} 8427 8428func (s *GoogleCloudVisionV1p3beta1Symbol) MarshalJSON() ([]byte, error) { 8429 type NoMethod GoogleCloudVisionV1p3beta1Symbol 8430 raw := NoMethod(*s) 8431 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8432} 8433 8434func (s *GoogleCloudVisionV1p3beta1Symbol) UnmarshalJSON(data []byte) error { 8435 type NoMethod GoogleCloudVisionV1p3beta1Symbol 8436 var s1 struct { 8437 Confidence gensupport.JSONFloat64 `json:"confidence"` 8438 *NoMethod 8439 } 8440 s1.NoMethod = (*NoMethod)(s) 8441 if err := json.Unmarshal(data, &s1); err != nil { 8442 return err 8443 } 8444 s.Confidence = float64(s1.Confidence) 8445 return nil 8446} 8447 8448// GoogleCloudVisionV1p3beta1TextAnnotation: TextAnnotation contains a 8449// structured representation of OCR extracted text. The hierarchy of an 8450// OCR extracted text structure is like this: TextAnnotation -> Page -> 8451// Block -> Paragraph -> Word -> Symbol Each structural component, 8452// starting from Page, may further have their own properties. Properties 8453// describe detected languages, breaks etc.. Please refer to the 8454// TextAnnotation.TextProperty message definition below for more detail. 8455type GoogleCloudVisionV1p3beta1TextAnnotation struct { 8456 // Pages: List of pages detected by OCR. 8457 Pages []*GoogleCloudVisionV1p3beta1Page `json:"pages,omitempty"` 8458 8459 // Text: UTF-8 text detected on the pages. 8460 Text string `json:"text,omitempty"` 8461 8462 // ForceSendFields is a list of field names (e.g. "Pages") to 8463 // unconditionally include in API requests. By default, fields with 8464 // empty values are omitted from API requests. However, any non-pointer, 8465 // non-interface field appearing in ForceSendFields will be sent to the 8466 // server regardless of whether the field is empty or not. This may be 8467 // used to include empty fields in Patch requests. 8468 ForceSendFields []string `json:"-"` 8469 8470 // NullFields is a list of field names (e.g. "Pages") to include in API 8471 // requests with the JSON null value. By default, fields with empty 8472 // values are omitted from API requests. However, any field with an 8473 // empty value appearing in NullFields will be sent to the server as 8474 // null. It is an error if a field in this list has a non-empty value. 8475 // This may be used to include null fields in Patch requests. 8476 NullFields []string `json:"-"` 8477} 8478 8479func (s *GoogleCloudVisionV1p3beta1TextAnnotation) MarshalJSON() ([]byte, error) { 8480 type NoMethod GoogleCloudVisionV1p3beta1TextAnnotation 8481 raw := NoMethod(*s) 8482 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8483} 8484 8485// GoogleCloudVisionV1p3beta1TextAnnotationDetectedBreak: Detected start 8486// or end of a structural component. 8487type GoogleCloudVisionV1p3beta1TextAnnotationDetectedBreak struct { 8488 // IsPrefix: True if break prepends the element. 8489 IsPrefix bool `json:"isPrefix,omitempty"` 8490 8491 // Type: Detected break type. 8492 // 8493 // Possible values: 8494 // "UNKNOWN" - Unknown break label type. 8495 // "SPACE" - Regular space. 8496 // "SURE_SPACE" - Sure space (very wide). 8497 // "EOL_SURE_SPACE" - Line-wrapping break. 8498 // "HYPHEN" - End-line hyphen that is not present in text; does not 8499 // co-occur with `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. 8500 // "LINE_BREAK" - Line break that ends a paragraph. 8501 Type string `json:"type,omitempty"` 8502 8503 // ForceSendFields is a list of field names (e.g. "IsPrefix") to 8504 // unconditionally include in API requests. By default, fields with 8505 // empty values are omitted from API requests. However, any non-pointer, 8506 // non-interface field appearing in ForceSendFields will be sent to the 8507 // server regardless of whether the field is empty or not. This may be 8508 // used to include empty fields in Patch requests. 8509 ForceSendFields []string `json:"-"` 8510 8511 // NullFields is a list of field names (e.g. "IsPrefix") to include in 8512 // API requests with the JSON null value. By default, fields with empty 8513 // values are omitted from API requests. However, any field with an 8514 // empty value appearing in NullFields will be sent to the server as 8515 // null. It is an error if a field in this list has a non-empty value. 8516 // This may be used to include null fields in Patch requests. 8517 NullFields []string `json:"-"` 8518} 8519 8520func (s *GoogleCloudVisionV1p3beta1TextAnnotationDetectedBreak) MarshalJSON() ([]byte, error) { 8521 type NoMethod GoogleCloudVisionV1p3beta1TextAnnotationDetectedBreak 8522 raw := NoMethod(*s) 8523 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8524} 8525 8526// GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage: Detected 8527// language for a structural component. 8528type GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage struct { 8529 // Confidence: Confidence of detected language. Range [0, 1]. 8530 Confidence float64 `json:"confidence,omitempty"` 8531 8532 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". 8533 // For more information, see 8534 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 8535 LanguageCode string `json:"languageCode,omitempty"` 8536 8537 // ForceSendFields is a list of field names (e.g. "Confidence") to 8538 // unconditionally include in API requests. By default, fields with 8539 // empty values are omitted from API requests. However, any non-pointer, 8540 // non-interface field appearing in ForceSendFields will be sent to the 8541 // server regardless of whether the field is empty or not. This may be 8542 // used to include empty fields in Patch requests. 8543 ForceSendFields []string `json:"-"` 8544 8545 // NullFields is a list of field names (e.g. "Confidence") to include in 8546 // API requests with the JSON null value. By default, fields with empty 8547 // values are omitted from API requests. However, any field with an 8548 // empty value appearing in NullFields will be sent to the server as 8549 // null. It is an error if a field in this list has a non-empty value. 8550 // This may be used to include null fields in Patch requests. 8551 NullFields []string `json:"-"` 8552} 8553 8554func (s *GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage) MarshalJSON() ([]byte, error) { 8555 type NoMethod GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage 8556 raw := NoMethod(*s) 8557 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8558} 8559 8560func (s *GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage) UnmarshalJSON(data []byte) error { 8561 type NoMethod GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage 8562 var s1 struct { 8563 Confidence gensupport.JSONFloat64 `json:"confidence"` 8564 *NoMethod 8565 } 8566 s1.NoMethod = (*NoMethod)(s) 8567 if err := json.Unmarshal(data, &s1); err != nil { 8568 return err 8569 } 8570 s.Confidence = float64(s1.Confidence) 8571 return nil 8572} 8573 8574// GoogleCloudVisionV1p3beta1TextAnnotationTextProperty: Additional 8575// information detected on the structural component. 8576type GoogleCloudVisionV1p3beta1TextAnnotationTextProperty struct { 8577 // DetectedBreak: Detected start or end of a text segment. 8578 DetectedBreak *GoogleCloudVisionV1p3beta1TextAnnotationDetectedBreak `json:"detectedBreak,omitempty"` 8579 8580 // DetectedLanguages: A list of detected languages together with 8581 // confidence. 8582 DetectedLanguages []*GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage `json:"detectedLanguages,omitempty"` 8583 8584 // ForceSendFields is a list of field names (e.g. "DetectedBreak") to 8585 // unconditionally include in API requests. By default, fields with 8586 // empty values are omitted from API requests. However, any non-pointer, 8587 // non-interface field appearing in ForceSendFields will be sent to the 8588 // server regardless of whether the field is empty or not. This may be 8589 // used to include empty fields in Patch requests. 8590 ForceSendFields []string `json:"-"` 8591 8592 // NullFields is a list of field names (e.g. "DetectedBreak") to include 8593 // in API requests with the JSON null value. By default, fields with 8594 // empty values are omitted from API requests. However, any field with 8595 // an empty value appearing in NullFields will be sent to the server as 8596 // null. It is an error if a field in this list has a non-empty value. 8597 // This may be used to include null fields in Patch requests. 8598 NullFields []string `json:"-"` 8599} 8600 8601func (s *GoogleCloudVisionV1p3beta1TextAnnotationTextProperty) MarshalJSON() ([]byte, error) { 8602 type NoMethod GoogleCloudVisionV1p3beta1TextAnnotationTextProperty 8603 raw := NoMethod(*s) 8604 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8605} 8606 8607// GoogleCloudVisionV1p3beta1Vertex: A vertex represents a 2D point in 8608// the image. NOTE: the vertex coordinates are in the same scale as the 8609// original image. 8610type GoogleCloudVisionV1p3beta1Vertex struct { 8611 // X: X coordinate. 8612 X int64 `json:"x,omitempty"` 8613 8614 // Y: Y coordinate. 8615 Y int64 `json:"y,omitempty"` 8616 8617 // ForceSendFields is a list of field names (e.g. "X") to 8618 // unconditionally include in API requests. By default, fields with 8619 // empty values are omitted from API requests. However, any non-pointer, 8620 // non-interface field appearing in ForceSendFields will be sent to the 8621 // server regardless of whether the field is empty or not. This may be 8622 // used to include empty fields in Patch requests. 8623 ForceSendFields []string `json:"-"` 8624 8625 // NullFields is a list of field names (e.g. "X") to include in API 8626 // requests with the JSON null value. By default, fields with empty 8627 // values are omitted from API requests. However, any field with an 8628 // empty value appearing in NullFields will be sent to the server as 8629 // null. It is an error if a field in this list has a non-empty value. 8630 // This may be used to include null fields in Patch requests. 8631 NullFields []string `json:"-"` 8632} 8633 8634func (s *GoogleCloudVisionV1p3beta1Vertex) MarshalJSON() ([]byte, error) { 8635 type NoMethod GoogleCloudVisionV1p3beta1Vertex 8636 raw := NoMethod(*s) 8637 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8638} 8639 8640// GoogleCloudVisionV1p3beta1WebDetection: Relevant information for the 8641// image from the Internet. 8642type GoogleCloudVisionV1p3beta1WebDetection struct { 8643 // BestGuessLabels: The service's best guess as to the topic of the 8644 // request image. Inferred from similar images on the open web. 8645 BestGuessLabels []*GoogleCloudVisionV1p3beta1WebDetectionWebLabel `json:"bestGuessLabels,omitempty"` 8646 8647 // FullMatchingImages: Fully matching images from the Internet. Can 8648 // include resized copies of the query image. 8649 FullMatchingImages []*GoogleCloudVisionV1p3beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"` 8650 8651 // PagesWithMatchingImages: Web pages containing the matching images 8652 // from the Internet. 8653 PagesWithMatchingImages []*GoogleCloudVisionV1p3beta1WebDetectionWebPage `json:"pagesWithMatchingImages,omitempty"` 8654 8655 // PartialMatchingImages: Partial matching images from the Internet. 8656 // Those images are similar enough to share some key-point features. For 8657 // example an original image will likely have partial matching for its 8658 // crops. 8659 PartialMatchingImages []*GoogleCloudVisionV1p3beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"` 8660 8661 // VisuallySimilarImages: The visually similar image results. 8662 VisuallySimilarImages []*GoogleCloudVisionV1p3beta1WebDetectionWebImage `json:"visuallySimilarImages,omitempty"` 8663 8664 // WebEntities: Deduced entities from similar images on the Internet. 8665 WebEntities []*GoogleCloudVisionV1p3beta1WebDetectionWebEntity `json:"webEntities,omitempty"` 8666 8667 // ForceSendFields is a list of field names (e.g. "BestGuessLabels") to 8668 // unconditionally include in API requests. By default, fields with 8669 // empty values are omitted from API requests. However, any non-pointer, 8670 // non-interface field appearing in ForceSendFields will be sent to the 8671 // server regardless of whether the field is empty or not. This may be 8672 // used to include empty fields in Patch requests. 8673 ForceSendFields []string `json:"-"` 8674 8675 // NullFields is a list of field names (e.g. "BestGuessLabels") to 8676 // include in API requests with the JSON null value. By default, fields 8677 // with empty values are omitted from API requests. However, any field 8678 // with an empty value appearing in NullFields will be sent to the 8679 // server as null. It is an error if a field in this list has a 8680 // non-empty value. This may be used to include null fields in Patch 8681 // requests. 8682 NullFields []string `json:"-"` 8683} 8684 8685func (s *GoogleCloudVisionV1p3beta1WebDetection) MarshalJSON() ([]byte, error) { 8686 type NoMethod GoogleCloudVisionV1p3beta1WebDetection 8687 raw := NoMethod(*s) 8688 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8689} 8690 8691// GoogleCloudVisionV1p3beta1WebDetectionWebEntity: Entity deduced from 8692// similar images on the Internet. 8693type GoogleCloudVisionV1p3beta1WebDetectionWebEntity struct { 8694 // Description: Canonical description of the entity, in English. 8695 Description string `json:"description,omitempty"` 8696 8697 // EntityId: Opaque entity ID. 8698 EntityId string `json:"entityId,omitempty"` 8699 8700 // Score: Overall relevancy score for the entity. Not normalized and not 8701 // comparable across different image queries. 8702 Score float64 `json:"score,omitempty"` 8703 8704 // ForceSendFields is a list of field names (e.g. "Description") to 8705 // unconditionally include in API requests. By default, fields with 8706 // empty values are omitted from API requests. However, any non-pointer, 8707 // non-interface field appearing in ForceSendFields will be sent to the 8708 // server regardless of whether the field is empty or not. This may be 8709 // used to include empty fields in Patch requests. 8710 ForceSendFields []string `json:"-"` 8711 8712 // NullFields is a list of field names (e.g. "Description") to include 8713 // in API requests with the JSON null value. By default, fields with 8714 // empty values are omitted from API requests. However, any field with 8715 // an empty value appearing in NullFields will be sent to the server as 8716 // null. It is an error if a field in this list has a non-empty value. 8717 // This may be used to include null fields in Patch requests. 8718 NullFields []string `json:"-"` 8719} 8720 8721func (s *GoogleCloudVisionV1p3beta1WebDetectionWebEntity) MarshalJSON() ([]byte, error) { 8722 type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebEntity 8723 raw := NoMethod(*s) 8724 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8725} 8726 8727func (s *GoogleCloudVisionV1p3beta1WebDetectionWebEntity) UnmarshalJSON(data []byte) error { 8728 type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebEntity 8729 var s1 struct { 8730 Score gensupport.JSONFloat64 `json:"score"` 8731 *NoMethod 8732 } 8733 s1.NoMethod = (*NoMethod)(s) 8734 if err := json.Unmarshal(data, &s1); err != nil { 8735 return err 8736 } 8737 s.Score = float64(s1.Score) 8738 return nil 8739} 8740 8741// GoogleCloudVisionV1p3beta1WebDetectionWebImage: Metadata for online 8742// images. 8743type GoogleCloudVisionV1p3beta1WebDetectionWebImage struct { 8744 // Score: (Deprecated) Overall relevancy score for the image. 8745 Score float64 `json:"score,omitempty"` 8746 8747 // Url: The result image URL. 8748 Url string `json:"url,omitempty"` 8749 8750 // ForceSendFields is a list of field names (e.g. "Score") to 8751 // unconditionally include in API requests. By default, fields with 8752 // empty values are omitted from API requests. However, any non-pointer, 8753 // non-interface field appearing in ForceSendFields will be sent to the 8754 // server regardless of whether the field is empty or not. This may be 8755 // used to include empty fields in Patch requests. 8756 ForceSendFields []string `json:"-"` 8757 8758 // NullFields is a list of field names (e.g. "Score") to include in API 8759 // requests with the JSON null value. By default, fields with empty 8760 // values are omitted from API requests. However, any field with an 8761 // empty value appearing in NullFields will be sent to the server as 8762 // null. It is an error if a field in this list has a non-empty value. 8763 // This may be used to include null fields in Patch requests. 8764 NullFields []string `json:"-"` 8765} 8766 8767func (s *GoogleCloudVisionV1p3beta1WebDetectionWebImage) MarshalJSON() ([]byte, error) { 8768 type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebImage 8769 raw := NoMethod(*s) 8770 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8771} 8772 8773func (s *GoogleCloudVisionV1p3beta1WebDetectionWebImage) UnmarshalJSON(data []byte) error { 8774 type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebImage 8775 var s1 struct { 8776 Score gensupport.JSONFloat64 `json:"score"` 8777 *NoMethod 8778 } 8779 s1.NoMethod = (*NoMethod)(s) 8780 if err := json.Unmarshal(data, &s1); err != nil { 8781 return err 8782 } 8783 s.Score = float64(s1.Score) 8784 return nil 8785} 8786 8787// GoogleCloudVisionV1p3beta1WebDetectionWebLabel: Label to provide 8788// extra metadata for the web detection. 8789type GoogleCloudVisionV1p3beta1WebDetectionWebLabel struct { 8790 // Label: Label for extra metadata. 8791 Label string `json:"label,omitempty"` 8792 8793 // LanguageCode: The BCP-47 language code for `label`, such as "en-US" 8794 // or "sr-Latn". For more information, see 8795 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 8796 LanguageCode string `json:"languageCode,omitempty"` 8797 8798 // ForceSendFields is a list of field names (e.g. "Label") to 8799 // unconditionally include in API requests. By default, fields with 8800 // empty values are omitted from API requests. However, any non-pointer, 8801 // non-interface field appearing in ForceSendFields will be sent to the 8802 // server regardless of whether the field is empty or not. This may be 8803 // used to include empty fields in Patch requests. 8804 ForceSendFields []string `json:"-"` 8805 8806 // NullFields is a list of field names (e.g. "Label") to include in API 8807 // requests with the JSON null value. By default, fields with empty 8808 // values are omitted from API requests. However, any field with an 8809 // empty value appearing in NullFields will be sent to the server as 8810 // null. It is an error if a field in this list has a non-empty value. 8811 // This may be used to include null fields in Patch requests. 8812 NullFields []string `json:"-"` 8813} 8814 8815func (s *GoogleCloudVisionV1p3beta1WebDetectionWebLabel) MarshalJSON() ([]byte, error) { 8816 type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebLabel 8817 raw := NoMethod(*s) 8818 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8819} 8820 8821// GoogleCloudVisionV1p3beta1WebDetectionWebPage: Metadata for web 8822// pages. 8823type GoogleCloudVisionV1p3beta1WebDetectionWebPage struct { 8824 // FullMatchingImages: Fully matching images on the page. Can include 8825 // resized copies of the query image. 8826 FullMatchingImages []*GoogleCloudVisionV1p3beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"` 8827 8828 // PageTitle: Title for the web page, may contain HTML markups. 8829 PageTitle string `json:"pageTitle,omitempty"` 8830 8831 // PartialMatchingImages: Partial matching images on the page. Those 8832 // images are similar enough to share some key-point features. For 8833 // example an original image will likely have partial matching for its 8834 // crops. 8835 PartialMatchingImages []*GoogleCloudVisionV1p3beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"` 8836 8837 // Score: (Deprecated) Overall relevancy score for the web page. 8838 Score float64 `json:"score,omitempty"` 8839 8840 // Url: The result web page URL. 8841 Url string `json:"url,omitempty"` 8842 8843 // ForceSendFields is a list of field names (e.g. "FullMatchingImages") 8844 // to unconditionally include in API requests. By default, fields with 8845 // empty values are omitted from API requests. However, any non-pointer, 8846 // non-interface field appearing in ForceSendFields will be sent to the 8847 // server regardless of whether the field is empty or not. This may be 8848 // used to include empty fields in Patch requests. 8849 ForceSendFields []string `json:"-"` 8850 8851 // NullFields is a list of field names (e.g. "FullMatchingImages") to 8852 // include in API requests with the JSON null value. By default, fields 8853 // with empty values are omitted from API requests. However, any field 8854 // with an empty value appearing in NullFields will be sent to the 8855 // server as null. It is an error if a field in this list has a 8856 // non-empty value. This may be used to include null fields in Patch 8857 // requests. 8858 NullFields []string `json:"-"` 8859} 8860 8861func (s *GoogleCloudVisionV1p3beta1WebDetectionWebPage) MarshalJSON() ([]byte, error) { 8862 type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebPage 8863 raw := NoMethod(*s) 8864 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8865} 8866 8867func (s *GoogleCloudVisionV1p3beta1WebDetectionWebPage) UnmarshalJSON(data []byte) error { 8868 type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebPage 8869 var s1 struct { 8870 Score gensupport.JSONFloat64 `json:"score"` 8871 *NoMethod 8872 } 8873 s1.NoMethod = (*NoMethod)(s) 8874 if err := json.Unmarshal(data, &s1); err != nil { 8875 return err 8876 } 8877 s.Score = float64(s1.Score) 8878 return nil 8879} 8880 8881// GoogleCloudVisionV1p3beta1Word: A word representation. 8882type GoogleCloudVisionV1p3beta1Word struct { 8883 // BoundingBox: The bounding box for the word. The vertices are in the 8884 // order of top-left, top-right, bottom-right, bottom-left. When a 8885 // rotation of the bounding box is detected the rotation is represented 8886 // as around the top-left corner as defined when the text is read in the 8887 // 'natural' orientation. For example: * when the text is horizontal it 8888 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 8889 // around the top-left corner it becomes: 2----3 | | 1----0 and the 8890 // vertex order will still be (0, 1, 2, 3). 8891 BoundingBox *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingBox,omitempty"` 8892 8893 // Confidence: Confidence of the OCR results for the word. Range [0, 1]. 8894 Confidence float64 `json:"confidence,omitempty"` 8895 8896 // Property: Additional information detected for the word. 8897 Property *GoogleCloudVisionV1p3beta1TextAnnotationTextProperty `json:"property,omitempty"` 8898 8899 // Symbols: List of symbols in the word. The order of the symbols 8900 // follows the natural reading order. 8901 Symbols []*GoogleCloudVisionV1p3beta1Symbol `json:"symbols,omitempty"` 8902 8903 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 8904 // unconditionally include in API requests. By default, fields with 8905 // empty values are omitted from API requests. However, any non-pointer, 8906 // non-interface field appearing in ForceSendFields will be sent to the 8907 // server regardless of whether the field is empty or not. This may be 8908 // used to include empty fields in Patch requests. 8909 ForceSendFields []string `json:"-"` 8910 8911 // NullFields is a list of field names (e.g. "BoundingBox") to include 8912 // in API requests with the JSON null value. By default, fields with 8913 // empty values are omitted from API requests. However, any field with 8914 // an empty value appearing in NullFields will be sent to the server as 8915 // null. It is an error if a field in this list has a non-empty value. 8916 // This may be used to include null fields in Patch requests. 8917 NullFields []string `json:"-"` 8918} 8919 8920func (s *GoogleCloudVisionV1p3beta1Word) MarshalJSON() ([]byte, error) { 8921 type NoMethod GoogleCloudVisionV1p3beta1Word 8922 raw := NoMethod(*s) 8923 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8924} 8925 8926func (s *GoogleCloudVisionV1p3beta1Word) UnmarshalJSON(data []byte) error { 8927 type NoMethod GoogleCloudVisionV1p3beta1Word 8928 var s1 struct { 8929 Confidence gensupport.JSONFloat64 `json:"confidence"` 8930 *NoMethod 8931 } 8932 s1.NoMethod = (*NoMethod)(s) 8933 if err := json.Unmarshal(data, &s1); err != nil { 8934 return err 8935 } 8936 s.Confidence = float64(s1.Confidence) 8937 return nil 8938} 8939 8940// GoogleCloudVisionV1p4beta1AnnotateFileResponse: Response to a single 8941// file annotation request. A file may contain one or more images, which 8942// individually have their own responses. 8943type GoogleCloudVisionV1p4beta1AnnotateFileResponse struct { 8944 // Error: If set, represents the error message for the failed request. 8945 // The `responses` field will not be set in this case. 8946 Error *Status `json:"error,omitempty"` 8947 8948 // InputConfig: Information about the file for which this response is 8949 // generated. 8950 InputConfig *GoogleCloudVisionV1p4beta1InputConfig `json:"inputConfig,omitempty"` 8951 8952 // Responses: Individual responses to images found within the file. This 8953 // field will be empty if the `error` field is set. 8954 Responses []*GoogleCloudVisionV1p4beta1AnnotateImageResponse `json:"responses,omitempty"` 8955 8956 // TotalPages: This field gives the total number of pages in the file. 8957 TotalPages int64 `json:"totalPages,omitempty"` 8958 8959 // ForceSendFields is a list of field names (e.g. "Error") to 8960 // unconditionally include in API requests. By default, fields with 8961 // empty values are omitted from API requests. However, any non-pointer, 8962 // non-interface field appearing in ForceSendFields will be sent to the 8963 // server regardless of whether the field is empty or not. This may be 8964 // used to include empty fields in Patch requests. 8965 ForceSendFields []string `json:"-"` 8966 8967 // NullFields is a list of field names (e.g. "Error") to include in API 8968 // requests with the JSON null value. By default, fields with empty 8969 // values are omitted from API requests. However, any field with an 8970 // empty value appearing in NullFields will be sent to the server as 8971 // null. It is an error if a field in this list has a non-empty value. 8972 // This may be used to include null fields in Patch requests. 8973 NullFields []string `json:"-"` 8974} 8975 8976func (s *GoogleCloudVisionV1p4beta1AnnotateFileResponse) MarshalJSON() ([]byte, error) { 8977 type NoMethod GoogleCloudVisionV1p4beta1AnnotateFileResponse 8978 raw := NoMethod(*s) 8979 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8980} 8981 8982// GoogleCloudVisionV1p4beta1AnnotateImageResponse: Response to an image 8983// annotation request. 8984type GoogleCloudVisionV1p4beta1AnnotateImageResponse struct { 8985 // Context: If present, contextual information is needed to understand 8986 // where this image comes from. 8987 Context *GoogleCloudVisionV1p4beta1ImageAnnotationContext `json:"context,omitempty"` 8988 8989 // CropHintsAnnotation: If present, crop hints have completed 8990 // successfully. 8991 CropHintsAnnotation *GoogleCloudVisionV1p4beta1CropHintsAnnotation `json:"cropHintsAnnotation,omitempty"` 8992 8993 // Error: If set, represents the error message for the operation. Note 8994 // that filled-in image annotations are guaranteed to be correct, even 8995 // when `error` is set. 8996 Error *Status `json:"error,omitempty"` 8997 8998 // FaceAnnotations: If present, face detection has completed 8999 // successfully. 9000 FaceAnnotations []*GoogleCloudVisionV1p4beta1FaceAnnotation `json:"faceAnnotations,omitempty"` 9001 9002 // FullTextAnnotation: If present, text (OCR) detection or document 9003 // (OCR) text detection has completed successfully. This annotation 9004 // provides the structural hierarchy for the OCR detected text. 9005 FullTextAnnotation *GoogleCloudVisionV1p4beta1TextAnnotation `json:"fullTextAnnotation,omitempty"` 9006 9007 // ImagePropertiesAnnotation: If present, image properties were 9008 // extracted successfully. 9009 ImagePropertiesAnnotation *GoogleCloudVisionV1p4beta1ImageProperties `json:"imagePropertiesAnnotation,omitempty"` 9010 9011 // LabelAnnotations: If present, label detection has completed 9012 // successfully. 9013 LabelAnnotations []*GoogleCloudVisionV1p4beta1EntityAnnotation `json:"labelAnnotations,omitempty"` 9014 9015 // LandmarkAnnotations: If present, landmark detection has completed 9016 // successfully. 9017 LandmarkAnnotations []*GoogleCloudVisionV1p4beta1EntityAnnotation `json:"landmarkAnnotations,omitempty"` 9018 9019 // LocalizedObjectAnnotations: If present, localized object detection 9020 // has completed successfully. This will be sorted descending by 9021 // confidence score. 9022 LocalizedObjectAnnotations []*GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation `json:"localizedObjectAnnotations,omitempty"` 9023 9024 // LogoAnnotations: If present, logo detection has completed 9025 // successfully. 9026 LogoAnnotations []*GoogleCloudVisionV1p4beta1EntityAnnotation `json:"logoAnnotations,omitempty"` 9027 9028 // ProductSearchResults: If present, product search has completed 9029 // successfully. 9030 ProductSearchResults *GoogleCloudVisionV1p4beta1ProductSearchResults `json:"productSearchResults,omitempty"` 9031 9032 // SafeSearchAnnotation: If present, safe-search annotation has 9033 // completed successfully. 9034 SafeSearchAnnotation *GoogleCloudVisionV1p4beta1SafeSearchAnnotation `json:"safeSearchAnnotation,omitempty"` 9035 9036 // TextAnnotations: If present, text (OCR) detection has completed 9037 // successfully. 9038 TextAnnotations []*GoogleCloudVisionV1p4beta1EntityAnnotation `json:"textAnnotations,omitempty"` 9039 9040 // WebDetection: If present, web detection has completed successfully. 9041 WebDetection *GoogleCloudVisionV1p4beta1WebDetection `json:"webDetection,omitempty"` 9042 9043 // ForceSendFields is a list of field names (e.g. "Context") to 9044 // unconditionally include in API requests. By default, fields with 9045 // empty values are omitted from API requests. However, any non-pointer, 9046 // non-interface field appearing in ForceSendFields will be sent to the 9047 // server regardless of whether the field is empty or not. This may be 9048 // used to include empty fields in Patch requests. 9049 ForceSendFields []string `json:"-"` 9050 9051 // NullFields is a list of field names (e.g. "Context") to include in 9052 // API requests with the JSON null value. By default, fields with empty 9053 // values are omitted from API requests. However, any field with an 9054 // empty value appearing in NullFields will be sent to the server as 9055 // null. It is an error if a field in this list has a non-empty value. 9056 // This may be used to include null fields in Patch requests. 9057 NullFields []string `json:"-"` 9058} 9059 9060func (s *GoogleCloudVisionV1p4beta1AnnotateImageResponse) MarshalJSON() ([]byte, error) { 9061 type NoMethod GoogleCloudVisionV1p4beta1AnnotateImageResponse 9062 raw := NoMethod(*s) 9063 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9064} 9065 9066// GoogleCloudVisionV1p4beta1AsyncAnnotateFileResponse: The response for 9067// a single offline file annotation request. 9068type GoogleCloudVisionV1p4beta1AsyncAnnotateFileResponse struct { 9069 // OutputConfig: The output location and metadata from 9070 // AsyncAnnotateFileRequest. 9071 OutputConfig *GoogleCloudVisionV1p4beta1OutputConfig `json:"outputConfig,omitempty"` 9072 9073 // ForceSendFields is a list of field names (e.g. "OutputConfig") to 9074 // unconditionally include in API requests. By default, fields with 9075 // empty values are omitted from API requests. However, any non-pointer, 9076 // non-interface field appearing in ForceSendFields will be sent to the 9077 // server regardless of whether the field is empty or not. This may be 9078 // used to include empty fields in Patch requests. 9079 ForceSendFields []string `json:"-"` 9080 9081 // NullFields is a list of field names (e.g. "OutputConfig") to include 9082 // in API requests with the JSON null value. By default, fields with 9083 // empty values are omitted from API requests. However, any field with 9084 // an empty value appearing in NullFields will be sent to the server as 9085 // null. It is an error if a field in this list has a non-empty value. 9086 // This may be used to include null fields in Patch requests. 9087 NullFields []string `json:"-"` 9088} 9089 9090func (s *GoogleCloudVisionV1p4beta1AsyncAnnotateFileResponse) MarshalJSON() ([]byte, error) { 9091 type NoMethod GoogleCloudVisionV1p4beta1AsyncAnnotateFileResponse 9092 raw := NoMethod(*s) 9093 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9094} 9095 9096// GoogleCloudVisionV1p4beta1AsyncBatchAnnotateFilesResponse: Response 9097// to an async batch file annotation request. 9098type GoogleCloudVisionV1p4beta1AsyncBatchAnnotateFilesResponse struct { 9099 // Responses: The list of file annotation responses, one for each 9100 // request in AsyncBatchAnnotateFilesRequest. 9101 Responses []*GoogleCloudVisionV1p4beta1AsyncAnnotateFileResponse `json:"responses,omitempty"` 9102 9103 // ForceSendFields is a list of field names (e.g. "Responses") to 9104 // unconditionally include in API requests. By default, fields with 9105 // empty values are omitted from API requests. However, any non-pointer, 9106 // non-interface field appearing in ForceSendFields will be sent to the 9107 // server regardless of whether the field is empty or not. This may be 9108 // used to include empty fields in Patch requests. 9109 ForceSendFields []string `json:"-"` 9110 9111 // NullFields is a list of field names (e.g. "Responses") to include in 9112 // API requests with the JSON null value. By default, fields with empty 9113 // values are omitted from API requests. However, any field with an 9114 // empty value appearing in NullFields will be sent to the server as 9115 // null. It is an error if a field in this list has a non-empty value. 9116 // This may be used to include null fields in Patch requests. 9117 NullFields []string `json:"-"` 9118} 9119 9120func (s *GoogleCloudVisionV1p4beta1AsyncBatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) { 9121 type NoMethod GoogleCloudVisionV1p4beta1AsyncBatchAnnotateFilesResponse 9122 raw := NoMethod(*s) 9123 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9124} 9125 9126// GoogleCloudVisionV1p4beta1AsyncBatchAnnotateImagesResponse: Response 9127// to an async batch image annotation request. 9128type GoogleCloudVisionV1p4beta1AsyncBatchAnnotateImagesResponse struct { 9129 // OutputConfig: The output location and metadata from 9130 // AsyncBatchAnnotateImagesRequest. 9131 OutputConfig *GoogleCloudVisionV1p4beta1OutputConfig `json:"outputConfig,omitempty"` 9132 9133 // ForceSendFields is a list of field names (e.g. "OutputConfig") to 9134 // unconditionally include in API requests. By default, fields with 9135 // empty values are omitted from API requests. However, any non-pointer, 9136 // non-interface field appearing in ForceSendFields will be sent to the 9137 // server regardless of whether the field is empty or not. This may be 9138 // used to include empty fields in Patch requests. 9139 ForceSendFields []string `json:"-"` 9140 9141 // NullFields is a list of field names (e.g. "OutputConfig") to include 9142 // in API requests with the JSON null value. By default, fields with 9143 // empty values are omitted from API requests. However, any field with 9144 // an empty value appearing in NullFields will be sent to the server as 9145 // null. It is an error if a field in this list has a non-empty value. 9146 // This may be used to include null fields in Patch requests. 9147 NullFields []string `json:"-"` 9148} 9149 9150func (s *GoogleCloudVisionV1p4beta1AsyncBatchAnnotateImagesResponse) MarshalJSON() ([]byte, error) { 9151 type NoMethod GoogleCloudVisionV1p4beta1AsyncBatchAnnotateImagesResponse 9152 raw := NoMethod(*s) 9153 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9154} 9155 9156// GoogleCloudVisionV1p4beta1BatchAnnotateFilesResponse: A list of file 9157// annotation responses. 9158type GoogleCloudVisionV1p4beta1BatchAnnotateFilesResponse struct { 9159 // Responses: The list of file annotation responses, each response 9160 // corresponding to each AnnotateFileRequest in 9161 // BatchAnnotateFilesRequest. 9162 Responses []*GoogleCloudVisionV1p4beta1AnnotateFileResponse `json:"responses,omitempty"` 9163 9164 // ForceSendFields is a list of field names (e.g. "Responses") to 9165 // unconditionally include in API requests. By default, fields with 9166 // empty values are omitted from API requests. However, any non-pointer, 9167 // non-interface field appearing in ForceSendFields will be sent to the 9168 // server regardless of whether the field is empty or not. This may be 9169 // used to include empty fields in Patch requests. 9170 ForceSendFields []string `json:"-"` 9171 9172 // NullFields is a list of field names (e.g. "Responses") to include in 9173 // API requests with the JSON null value. By default, fields with empty 9174 // values are omitted from API requests. However, any field with an 9175 // empty value appearing in NullFields will be sent to the server as 9176 // null. It is an error if a field in this list has a non-empty value. 9177 // This may be used to include null fields in Patch requests. 9178 NullFields []string `json:"-"` 9179} 9180 9181func (s *GoogleCloudVisionV1p4beta1BatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) { 9182 type NoMethod GoogleCloudVisionV1p4beta1BatchAnnotateFilesResponse 9183 raw := NoMethod(*s) 9184 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9185} 9186 9187// GoogleCloudVisionV1p4beta1BatchOperationMetadata: Metadata for the 9188// batch operations such as the current state. This is included in the 9189// `metadata` field of the `Operation` returned by the `GetOperation` 9190// call of the `google::longrunning::Operations` service. 9191type GoogleCloudVisionV1p4beta1BatchOperationMetadata struct { 9192 // EndTime: The time when the batch request is finished and 9193 // google.longrunning.Operation.done is set to true. 9194 EndTime string `json:"endTime,omitempty"` 9195 9196 // State: The current state of the batch operation. 9197 // 9198 // Possible values: 9199 // "STATE_UNSPECIFIED" - Invalid. 9200 // "PROCESSING" - Request is actively being processed. 9201 // "SUCCESSFUL" - The request is done and at least one item has been 9202 // successfully processed. 9203 // "FAILED" - The request is done and no item has been successfully 9204 // processed. 9205 // "CANCELLED" - The request is done after the 9206 // longrunning.Operations.CancelOperation has been called by the user. 9207 // Any records that were processed before the cancel command are output 9208 // as specified in the request. 9209 State string `json:"state,omitempty"` 9210 9211 // SubmitTime: The time when the batch request was submitted to the 9212 // server. 9213 SubmitTime string `json:"submitTime,omitempty"` 9214 9215 // ForceSendFields is a list of field names (e.g. "EndTime") to 9216 // unconditionally include in API requests. By default, fields with 9217 // empty values are omitted from API requests. However, any non-pointer, 9218 // non-interface field appearing in ForceSendFields will be sent to the 9219 // server regardless of whether the field is empty or not. This may be 9220 // used to include empty fields in Patch requests. 9221 ForceSendFields []string `json:"-"` 9222 9223 // NullFields is a list of field names (e.g. "EndTime") to include in 9224 // API requests with the JSON null value. By default, fields with empty 9225 // values are omitted from API requests. However, any field with an 9226 // empty value appearing in NullFields will be sent to the server as 9227 // null. It is an error if a field in this list has a non-empty value. 9228 // This may be used to include null fields in Patch requests. 9229 NullFields []string `json:"-"` 9230} 9231 9232func (s *GoogleCloudVisionV1p4beta1BatchOperationMetadata) MarshalJSON() ([]byte, error) { 9233 type NoMethod GoogleCloudVisionV1p4beta1BatchOperationMetadata 9234 raw := NoMethod(*s) 9235 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9236} 9237 9238// GoogleCloudVisionV1p4beta1Block: Logical element on the page. 9239type GoogleCloudVisionV1p4beta1Block struct { 9240 // BlockType: Detected block type (text, image etc) for this block. 9241 // 9242 // Possible values: 9243 // "UNKNOWN" - Unknown block type. 9244 // "TEXT" - Regular text block. 9245 // "TABLE" - Table block. 9246 // "PICTURE" - Image block. 9247 // "RULER" - Horizontal/vertical line box. 9248 // "BARCODE" - Barcode block. 9249 BlockType string `json:"blockType,omitempty"` 9250 9251 // BoundingBox: The bounding box for the block. The vertices are in the 9252 // order of top-left, top-right, bottom-right, bottom-left. When a 9253 // rotation of the bounding box is detected the rotation is represented 9254 // as around the top-left corner as defined when the text is read in the 9255 // 'natural' orientation. For example: * when the text is horizontal it 9256 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 9257 // around the top-left corner it becomes: 2----3 | | 1----0 and the 9258 // vertex order will still be (0, 1, 2, 3). 9259 BoundingBox *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingBox,omitempty"` 9260 9261 // Confidence: Confidence of the OCR results on the block. Range [0, 1]. 9262 Confidence float64 `json:"confidence,omitempty"` 9263 9264 // Paragraphs: List of paragraphs in this block (if this blocks is of 9265 // type text). 9266 Paragraphs []*GoogleCloudVisionV1p4beta1Paragraph `json:"paragraphs,omitempty"` 9267 9268 // Property: Additional information detected for the block. 9269 Property *GoogleCloudVisionV1p4beta1TextAnnotationTextProperty `json:"property,omitempty"` 9270 9271 // ForceSendFields is a list of field names (e.g. "BlockType") to 9272 // unconditionally include in API requests. By default, fields with 9273 // empty values are omitted from API requests. However, any non-pointer, 9274 // non-interface field appearing in ForceSendFields will be sent to the 9275 // server regardless of whether the field is empty or not. This may be 9276 // used to include empty fields in Patch requests. 9277 ForceSendFields []string `json:"-"` 9278 9279 // NullFields is a list of field names (e.g. "BlockType") to include in 9280 // API requests with the JSON null value. By default, fields with empty 9281 // values are omitted from API requests. However, any field with an 9282 // empty value appearing in NullFields will be sent to the server as 9283 // null. It is an error if a field in this list has a non-empty value. 9284 // This may be used to include null fields in Patch requests. 9285 NullFields []string `json:"-"` 9286} 9287 9288func (s *GoogleCloudVisionV1p4beta1Block) MarshalJSON() ([]byte, error) { 9289 type NoMethod GoogleCloudVisionV1p4beta1Block 9290 raw := NoMethod(*s) 9291 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9292} 9293 9294func (s *GoogleCloudVisionV1p4beta1Block) UnmarshalJSON(data []byte) error { 9295 type NoMethod GoogleCloudVisionV1p4beta1Block 9296 var s1 struct { 9297 Confidence gensupport.JSONFloat64 `json:"confidence"` 9298 *NoMethod 9299 } 9300 s1.NoMethod = (*NoMethod)(s) 9301 if err := json.Unmarshal(data, &s1); err != nil { 9302 return err 9303 } 9304 s.Confidence = float64(s1.Confidence) 9305 return nil 9306} 9307 9308// GoogleCloudVisionV1p4beta1BoundingPoly: A bounding polygon for the 9309// detected image annotation. 9310type GoogleCloudVisionV1p4beta1BoundingPoly struct { 9311 // NormalizedVertices: The bounding polygon normalized vertices. 9312 NormalizedVertices []*GoogleCloudVisionV1p4beta1NormalizedVertex `json:"normalizedVertices,omitempty"` 9313 9314 // Vertices: The bounding polygon vertices. 9315 Vertices []*GoogleCloudVisionV1p4beta1Vertex `json:"vertices,omitempty"` 9316 9317 // ForceSendFields is a list of field names (e.g. "NormalizedVertices") 9318 // to unconditionally include in API requests. By default, fields with 9319 // empty values are omitted from API requests. However, any non-pointer, 9320 // non-interface field appearing in ForceSendFields will be sent to the 9321 // server regardless of whether the field is empty or not. This may be 9322 // used to include empty fields in Patch requests. 9323 ForceSendFields []string `json:"-"` 9324 9325 // NullFields is a list of field names (e.g. "NormalizedVertices") to 9326 // include in API requests with the JSON null value. By default, fields 9327 // with empty values are omitted from API requests. However, any field 9328 // with an empty value appearing in NullFields will be sent to the 9329 // server as null. It is an error if a field in this list has a 9330 // non-empty value. This may be used to include null fields in Patch 9331 // requests. 9332 NullFields []string `json:"-"` 9333} 9334 9335func (s *GoogleCloudVisionV1p4beta1BoundingPoly) MarshalJSON() ([]byte, error) { 9336 type NoMethod GoogleCloudVisionV1p4beta1BoundingPoly 9337 raw := NoMethod(*s) 9338 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9339} 9340 9341// GoogleCloudVisionV1p4beta1Celebrity: A Celebrity is a group of Faces 9342// with an identity. 9343type GoogleCloudVisionV1p4beta1Celebrity struct { 9344 // Description: The Celebrity's description. 9345 Description string `json:"description,omitempty"` 9346 9347 // DisplayName: The Celebrity's display name. 9348 DisplayName string `json:"displayName,omitempty"` 9349 9350 // Name: The resource name of the preloaded Celebrity. Has the format 9351 // `builtin/{mid}`. 9352 Name string `json:"name,omitempty"` 9353 9354 // ForceSendFields is a list of field names (e.g. "Description") to 9355 // unconditionally include in API requests. By default, fields with 9356 // empty values are omitted from API requests. However, any non-pointer, 9357 // non-interface field appearing in ForceSendFields will be sent to the 9358 // server regardless of whether the field is empty or not. This may be 9359 // used to include empty fields in Patch requests. 9360 ForceSendFields []string `json:"-"` 9361 9362 // NullFields is a list of field names (e.g. "Description") to include 9363 // in API requests with the JSON null value. By default, fields with 9364 // empty values are omitted from API requests. However, any field with 9365 // an empty value appearing in NullFields will be sent to the server as 9366 // null. It is an error if a field in this list has a non-empty value. 9367 // This may be used to include null fields in Patch requests. 9368 NullFields []string `json:"-"` 9369} 9370 9371func (s *GoogleCloudVisionV1p4beta1Celebrity) MarshalJSON() ([]byte, error) { 9372 type NoMethod GoogleCloudVisionV1p4beta1Celebrity 9373 raw := NoMethod(*s) 9374 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9375} 9376 9377// GoogleCloudVisionV1p4beta1ColorInfo: Color information consists of 9378// RGB channels, score, and the fraction of the image that the color 9379// occupies in the image. 9380type GoogleCloudVisionV1p4beta1ColorInfo struct { 9381 // Color: RGB components of the color. 9382 Color *Color `json:"color,omitempty"` 9383 9384 // PixelFraction: The fraction of pixels the color occupies in the 9385 // image. Value in range [0, 1]. 9386 PixelFraction float64 `json:"pixelFraction,omitempty"` 9387 9388 // Score: Image-specific score for this color. Value in range [0, 1]. 9389 Score float64 `json:"score,omitempty"` 9390 9391 // ForceSendFields is a list of field names (e.g. "Color") to 9392 // unconditionally include in API requests. By default, fields with 9393 // empty values are omitted from API requests. However, any non-pointer, 9394 // non-interface field appearing in ForceSendFields will be sent to the 9395 // server regardless of whether the field is empty or not. This may be 9396 // used to include empty fields in Patch requests. 9397 ForceSendFields []string `json:"-"` 9398 9399 // NullFields is a list of field names (e.g. "Color") to include in API 9400 // requests with the JSON null value. By default, fields with empty 9401 // values are omitted from API requests. However, any field with an 9402 // empty value appearing in NullFields will be sent to the server as 9403 // null. It is an error if a field in this list has a non-empty value. 9404 // This may be used to include null fields in Patch requests. 9405 NullFields []string `json:"-"` 9406} 9407 9408func (s *GoogleCloudVisionV1p4beta1ColorInfo) MarshalJSON() ([]byte, error) { 9409 type NoMethod GoogleCloudVisionV1p4beta1ColorInfo 9410 raw := NoMethod(*s) 9411 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9412} 9413 9414func (s *GoogleCloudVisionV1p4beta1ColorInfo) UnmarshalJSON(data []byte) error { 9415 type NoMethod GoogleCloudVisionV1p4beta1ColorInfo 9416 var s1 struct { 9417 PixelFraction gensupport.JSONFloat64 `json:"pixelFraction"` 9418 Score gensupport.JSONFloat64 `json:"score"` 9419 *NoMethod 9420 } 9421 s1.NoMethod = (*NoMethod)(s) 9422 if err := json.Unmarshal(data, &s1); err != nil { 9423 return err 9424 } 9425 s.PixelFraction = float64(s1.PixelFraction) 9426 s.Score = float64(s1.Score) 9427 return nil 9428} 9429 9430// GoogleCloudVisionV1p4beta1CropHint: Single crop hint that is used to 9431// generate a new crop when serving an image. 9432type GoogleCloudVisionV1p4beta1CropHint struct { 9433 // BoundingPoly: The bounding polygon for the crop region. The 9434 // coordinates of the bounding box are in the original image's scale. 9435 BoundingPoly *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingPoly,omitempty"` 9436 9437 // Confidence: Confidence of this being a salient region. Range [0, 1]. 9438 Confidence float64 `json:"confidence,omitempty"` 9439 9440 // ImportanceFraction: Fraction of importance of this salient region 9441 // with respect to the original image. 9442 ImportanceFraction float64 `json:"importanceFraction,omitempty"` 9443 9444 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 9445 // unconditionally include in API requests. By default, fields with 9446 // empty values are omitted from API requests. However, any non-pointer, 9447 // non-interface field appearing in ForceSendFields will be sent to the 9448 // server regardless of whether the field is empty or not. This may be 9449 // used to include empty fields in Patch requests. 9450 ForceSendFields []string `json:"-"` 9451 9452 // NullFields is a list of field names (e.g. "BoundingPoly") to include 9453 // in API requests with the JSON null value. By default, fields with 9454 // empty values are omitted from API requests. However, any field with 9455 // an empty value appearing in NullFields will be sent to the server as 9456 // null. It is an error if a field in this list has a non-empty value. 9457 // This may be used to include null fields in Patch requests. 9458 NullFields []string `json:"-"` 9459} 9460 9461func (s *GoogleCloudVisionV1p4beta1CropHint) MarshalJSON() ([]byte, error) { 9462 type NoMethod GoogleCloudVisionV1p4beta1CropHint 9463 raw := NoMethod(*s) 9464 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9465} 9466 9467func (s *GoogleCloudVisionV1p4beta1CropHint) UnmarshalJSON(data []byte) error { 9468 type NoMethod GoogleCloudVisionV1p4beta1CropHint 9469 var s1 struct { 9470 Confidence gensupport.JSONFloat64 `json:"confidence"` 9471 ImportanceFraction gensupport.JSONFloat64 `json:"importanceFraction"` 9472 *NoMethod 9473 } 9474 s1.NoMethod = (*NoMethod)(s) 9475 if err := json.Unmarshal(data, &s1); err != nil { 9476 return err 9477 } 9478 s.Confidence = float64(s1.Confidence) 9479 s.ImportanceFraction = float64(s1.ImportanceFraction) 9480 return nil 9481} 9482 9483// GoogleCloudVisionV1p4beta1CropHintsAnnotation: Set of crop hints that 9484// are used to generate new crops when serving images. 9485type GoogleCloudVisionV1p4beta1CropHintsAnnotation struct { 9486 // CropHints: Crop hint results. 9487 CropHints []*GoogleCloudVisionV1p4beta1CropHint `json:"cropHints,omitempty"` 9488 9489 // ForceSendFields is a list of field names (e.g. "CropHints") to 9490 // unconditionally include in API requests. By default, fields with 9491 // empty values are omitted from API requests. However, any non-pointer, 9492 // non-interface field appearing in ForceSendFields will be sent to the 9493 // server regardless of whether the field is empty or not. This may be 9494 // used to include empty fields in Patch requests. 9495 ForceSendFields []string `json:"-"` 9496 9497 // NullFields is a list of field names (e.g. "CropHints") to include in 9498 // API requests with the JSON null value. By default, fields with empty 9499 // values are omitted from API requests. However, any field with an 9500 // empty value appearing in NullFields will be sent to the server as 9501 // null. It is an error if a field in this list has a non-empty value. 9502 // This may be used to include null fields in Patch requests. 9503 NullFields []string `json:"-"` 9504} 9505 9506func (s *GoogleCloudVisionV1p4beta1CropHintsAnnotation) MarshalJSON() ([]byte, error) { 9507 type NoMethod GoogleCloudVisionV1p4beta1CropHintsAnnotation 9508 raw := NoMethod(*s) 9509 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9510} 9511 9512// GoogleCloudVisionV1p4beta1DominantColorsAnnotation: Set of dominant 9513// colors and their corresponding scores. 9514type GoogleCloudVisionV1p4beta1DominantColorsAnnotation struct { 9515 // Colors: RGB color values with their score and pixel fraction. 9516 Colors []*GoogleCloudVisionV1p4beta1ColorInfo `json:"colors,omitempty"` 9517 9518 // ForceSendFields is a list of field names (e.g. "Colors") to 9519 // unconditionally include in API requests. By default, fields with 9520 // empty values are omitted from API requests. However, any non-pointer, 9521 // non-interface field appearing in ForceSendFields will be sent to the 9522 // server regardless of whether the field is empty or not. This may be 9523 // used to include empty fields in Patch requests. 9524 ForceSendFields []string `json:"-"` 9525 9526 // NullFields is a list of field names (e.g. "Colors") to include in API 9527 // requests with the JSON null value. By default, fields with empty 9528 // values are omitted from API requests. However, any field with an 9529 // empty value appearing in NullFields will be sent to the server as 9530 // null. It is an error if a field in this list has a non-empty value. 9531 // This may be used to include null fields in Patch requests. 9532 NullFields []string `json:"-"` 9533} 9534 9535func (s *GoogleCloudVisionV1p4beta1DominantColorsAnnotation) MarshalJSON() ([]byte, error) { 9536 type NoMethod GoogleCloudVisionV1p4beta1DominantColorsAnnotation 9537 raw := NoMethod(*s) 9538 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9539} 9540 9541// GoogleCloudVisionV1p4beta1EntityAnnotation: Set of detected entity 9542// features. 9543type GoogleCloudVisionV1p4beta1EntityAnnotation struct { 9544 // BoundingPoly: Image region to which this entity belongs. Not produced 9545 // for `LABEL_DETECTION` features. 9546 BoundingPoly *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingPoly,omitempty"` 9547 9548 // Confidence: **Deprecated. Use `score` instead.** The accuracy of the 9549 // entity detection in an image. For example, for an image in which the 9550 // "Eiffel Tower" entity is detected, this field represents the 9551 // confidence that there is a tower in the query image. Range [0, 1]. 9552 Confidence float64 `json:"confidence,omitempty"` 9553 9554 // Description: Entity textual description, expressed in its `locale` 9555 // language. 9556 Description string `json:"description,omitempty"` 9557 9558 // Locale: The language code for the locale in which the entity textual 9559 // `description` is expressed. 9560 Locale string `json:"locale,omitempty"` 9561 9562 // Locations: The location information for the detected entity. Multiple 9563 // `LocationInfo` elements can be present because one location may 9564 // indicate the location of the scene in the image, and another location 9565 // may indicate the location of the place where the image was taken. 9566 // Location information is usually present for landmarks. 9567 Locations []*GoogleCloudVisionV1p4beta1LocationInfo `json:"locations,omitempty"` 9568 9569 // Mid: Opaque entity ID. Some IDs may be available in [Google Knowledge 9570 // Graph Search API](https://developers.google.com/knowledge-graph/). 9571 Mid string `json:"mid,omitempty"` 9572 9573 // Properties: Some entities may have optional user-supplied `Property` 9574 // (name/value) fields, such a score or string that qualifies the 9575 // entity. 9576 Properties []*GoogleCloudVisionV1p4beta1Property `json:"properties,omitempty"` 9577 9578 // Score: Overall score of the result. Range [0, 1]. 9579 Score float64 `json:"score,omitempty"` 9580 9581 // Topicality: The relevancy of the ICA (Image Content Annotation) label 9582 // to the image. For example, the relevancy of "tower" is likely higher 9583 // to an image containing the detected "Eiffel Tower" than to an image 9584 // containing a detected distant towering building, even though the 9585 // confidence that there is a tower in each image may be the same. Range 9586 // [0, 1]. 9587 Topicality float64 `json:"topicality,omitempty"` 9588 9589 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 9590 // unconditionally include in API requests. By default, fields with 9591 // empty values are omitted from API requests. However, any non-pointer, 9592 // non-interface field appearing in ForceSendFields will be sent to the 9593 // server regardless of whether the field is empty or not. This may be 9594 // used to include empty fields in Patch requests. 9595 ForceSendFields []string `json:"-"` 9596 9597 // NullFields is a list of field names (e.g. "BoundingPoly") to include 9598 // in API requests with the JSON null value. By default, fields with 9599 // empty values are omitted from API requests. However, any field with 9600 // an empty value appearing in NullFields will be sent to the server as 9601 // null. It is an error if a field in this list has a non-empty value. 9602 // This may be used to include null fields in Patch requests. 9603 NullFields []string `json:"-"` 9604} 9605 9606func (s *GoogleCloudVisionV1p4beta1EntityAnnotation) MarshalJSON() ([]byte, error) { 9607 type NoMethod GoogleCloudVisionV1p4beta1EntityAnnotation 9608 raw := NoMethod(*s) 9609 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9610} 9611 9612func (s *GoogleCloudVisionV1p4beta1EntityAnnotation) UnmarshalJSON(data []byte) error { 9613 type NoMethod GoogleCloudVisionV1p4beta1EntityAnnotation 9614 var s1 struct { 9615 Confidence gensupport.JSONFloat64 `json:"confidence"` 9616 Score gensupport.JSONFloat64 `json:"score"` 9617 Topicality gensupport.JSONFloat64 `json:"topicality"` 9618 *NoMethod 9619 } 9620 s1.NoMethod = (*NoMethod)(s) 9621 if err := json.Unmarshal(data, &s1); err != nil { 9622 return err 9623 } 9624 s.Confidence = float64(s1.Confidence) 9625 s.Score = float64(s1.Score) 9626 s.Topicality = float64(s1.Topicality) 9627 return nil 9628} 9629 9630// GoogleCloudVisionV1p4beta1FaceAnnotation: A face annotation object 9631// contains the results of face detection. 9632type GoogleCloudVisionV1p4beta1FaceAnnotation struct { 9633 // AngerLikelihood: Anger likelihood. 9634 // 9635 // Possible values: 9636 // "UNKNOWN" - Unknown likelihood. 9637 // "VERY_UNLIKELY" - It is very unlikely. 9638 // "UNLIKELY" - It is unlikely. 9639 // "POSSIBLE" - It is possible. 9640 // "LIKELY" - It is likely. 9641 // "VERY_LIKELY" - It is very likely. 9642 AngerLikelihood string `json:"angerLikelihood,omitempty"` 9643 9644 // BlurredLikelihood: Blurred likelihood. 9645 // 9646 // Possible values: 9647 // "UNKNOWN" - Unknown likelihood. 9648 // "VERY_UNLIKELY" - It is very unlikely. 9649 // "UNLIKELY" - It is unlikely. 9650 // "POSSIBLE" - It is possible. 9651 // "LIKELY" - It is likely. 9652 // "VERY_LIKELY" - It is very likely. 9653 BlurredLikelihood string `json:"blurredLikelihood,omitempty"` 9654 9655 // BoundingPoly: The bounding polygon around the face. The coordinates 9656 // of the bounding box are in the original image's scale. The bounding 9657 // box is computed to "frame" the face in accordance with human 9658 // expectations. It is based on the landmarker results. Note that one or 9659 // more x and/or y coordinates may not be generated in the 9660 // `BoundingPoly` (the polygon will be unbounded) if only a partial face 9661 // appears in the image to be annotated. 9662 BoundingPoly *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingPoly,omitempty"` 9663 9664 // DetectionConfidence: Detection confidence. Range [0, 1]. 9665 DetectionConfidence float64 `json:"detectionConfidence,omitempty"` 9666 9667 // FdBoundingPoly: The `fd_bounding_poly` bounding polygon is tighter 9668 // than the `boundingPoly`, and encloses only the skin part of the face. 9669 // Typically, it is used to eliminate the face from any image analysis 9670 // that detects the "amount of skin" visible in an image. It is not 9671 // based on the landmarker results, only on the initial face detection, 9672 // hence the fd (face detection) prefix. 9673 FdBoundingPoly *GoogleCloudVisionV1p4beta1BoundingPoly `json:"fdBoundingPoly,omitempty"` 9674 9675 // HeadwearLikelihood: Headwear likelihood. 9676 // 9677 // Possible values: 9678 // "UNKNOWN" - Unknown likelihood. 9679 // "VERY_UNLIKELY" - It is very unlikely. 9680 // "UNLIKELY" - It is unlikely. 9681 // "POSSIBLE" - It is possible. 9682 // "LIKELY" - It is likely. 9683 // "VERY_LIKELY" - It is very likely. 9684 HeadwearLikelihood string `json:"headwearLikelihood,omitempty"` 9685 9686 // JoyLikelihood: Joy likelihood. 9687 // 9688 // Possible values: 9689 // "UNKNOWN" - Unknown likelihood. 9690 // "VERY_UNLIKELY" - It is very unlikely. 9691 // "UNLIKELY" - It is unlikely. 9692 // "POSSIBLE" - It is possible. 9693 // "LIKELY" - It is likely. 9694 // "VERY_LIKELY" - It is very likely. 9695 JoyLikelihood string `json:"joyLikelihood,omitempty"` 9696 9697 // LandmarkingConfidence: Face landmarking confidence. Range [0, 1]. 9698 LandmarkingConfidence float64 `json:"landmarkingConfidence,omitempty"` 9699 9700 // Landmarks: Detected face landmarks. 9701 Landmarks []*GoogleCloudVisionV1p4beta1FaceAnnotationLandmark `json:"landmarks,omitempty"` 9702 9703 // PanAngle: Yaw angle, which indicates the leftward/rightward angle 9704 // that the face is pointing relative to the vertical plane 9705 // perpendicular to the image. Range [-180,180]. 9706 PanAngle float64 `json:"panAngle,omitempty"` 9707 9708 // RecognitionResult: Additional recognition information. Only computed 9709 // if image_context.face_recognition_params is provided, **and** a match 9710 // is found to a Celebrity in the input CelebritySet. This field is 9711 // sorted in order of decreasing confidence values. 9712 RecognitionResult []*GoogleCloudVisionV1p4beta1FaceRecognitionResult `json:"recognitionResult,omitempty"` 9713 9714 // RollAngle: Roll angle, which indicates the amount of 9715 // clockwise/anti-clockwise rotation of the face relative to the image 9716 // vertical about the axis perpendicular to the face. Range [-180,180]. 9717 RollAngle float64 `json:"rollAngle,omitempty"` 9718 9719 // SorrowLikelihood: Sorrow likelihood. 9720 // 9721 // Possible values: 9722 // "UNKNOWN" - Unknown likelihood. 9723 // "VERY_UNLIKELY" - It is very unlikely. 9724 // "UNLIKELY" - It is unlikely. 9725 // "POSSIBLE" - It is possible. 9726 // "LIKELY" - It is likely. 9727 // "VERY_LIKELY" - It is very likely. 9728 SorrowLikelihood string `json:"sorrowLikelihood,omitempty"` 9729 9730 // SurpriseLikelihood: Surprise likelihood. 9731 // 9732 // Possible values: 9733 // "UNKNOWN" - Unknown likelihood. 9734 // "VERY_UNLIKELY" - It is very unlikely. 9735 // "UNLIKELY" - It is unlikely. 9736 // "POSSIBLE" - It is possible. 9737 // "LIKELY" - It is likely. 9738 // "VERY_LIKELY" - It is very likely. 9739 SurpriseLikelihood string `json:"surpriseLikelihood,omitempty"` 9740 9741 // TiltAngle: Pitch angle, which indicates the upwards/downwards angle 9742 // that the face is pointing relative to the image's horizontal plane. 9743 // Range [-180,180]. 9744 TiltAngle float64 `json:"tiltAngle,omitempty"` 9745 9746 // UnderExposedLikelihood: Under-exposed likelihood. 9747 // 9748 // Possible values: 9749 // "UNKNOWN" - Unknown likelihood. 9750 // "VERY_UNLIKELY" - It is very unlikely. 9751 // "UNLIKELY" - It is unlikely. 9752 // "POSSIBLE" - It is possible. 9753 // "LIKELY" - It is likely. 9754 // "VERY_LIKELY" - It is very likely. 9755 UnderExposedLikelihood string `json:"underExposedLikelihood,omitempty"` 9756 9757 // ForceSendFields is a list of field names (e.g. "AngerLikelihood") to 9758 // unconditionally include in API requests. By default, fields with 9759 // empty values are omitted from API requests. However, any non-pointer, 9760 // non-interface field appearing in ForceSendFields will be sent to the 9761 // server regardless of whether the field is empty or not. This may be 9762 // used to include empty fields in Patch requests. 9763 ForceSendFields []string `json:"-"` 9764 9765 // NullFields is a list of field names (e.g. "AngerLikelihood") to 9766 // include in API requests with the JSON null value. By default, fields 9767 // with empty values are omitted from API requests. However, any field 9768 // with an empty value appearing in NullFields will be sent to the 9769 // server as null. It is an error if a field in this list has a 9770 // non-empty value. This may be used to include null fields in Patch 9771 // requests. 9772 NullFields []string `json:"-"` 9773} 9774 9775func (s *GoogleCloudVisionV1p4beta1FaceAnnotation) MarshalJSON() ([]byte, error) { 9776 type NoMethod GoogleCloudVisionV1p4beta1FaceAnnotation 9777 raw := NoMethod(*s) 9778 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9779} 9780 9781func (s *GoogleCloudVisionV1p4beta1FaceAnnotation) UnmarshalJSON(data []byte) error { 9782 type NoMethod GoogleCloudVisionV1p4beta1FaceAnnotation 9783 var s1 struct { 9784 DetectionConfidence gensupport.JSONFloat64 `json:"detectionConfidence"` 9785 LandmarkingConfidence gensupport.JSONFloat64 `json:"landmarkingConfidence"` 9786 PanAngle gensupport.JSONFloat64 `json:"panAngle"` 9787 RollAngle gensupport.JSONFloat64 `json:"rollAngle"` 9788 TiltAngle gensupport.JSONFloat64 `json:"tiltAngle"` 9789 *NoMethod 9790 } 9791 s1.NoMethod = (*NoMethod)(s) 9792 if err := json.Unmarshal(data, &s1); err != nil { 9793 return err 9794 } 9795 s.DetectionConfidence = float64(s1.DetectionConfidence) 9796 s.LandmarkingConfidence = float64(s1.LandmarkingConfidence) 9797 s.PanAngle = float64(s1.PanAngle) 9798 s.RollAngle = float64(s1.RollAngle) 9799 s.TiltAngle = float64(s1.TiltAngle) 9800 return nil 9801} 9802 9803// GoogleCloudVisionV1p4beta1FaceAnnotationLandmark: A face-specific 9804// landmark (for example, a face feature). 9805type GoogleCloudVisionV1p4beta1FaceAnnotationLandmark struct { 9806 // Position: Face landmark position. 9807 Position *GoogleCloudVisionV1p4beta1Position `json:"position,omitempty"` 9808 9809 // Type: Face landmark type. 9810 // 9811 // Possible values: 9812 // "UNKNOWN_LANDMARK" - Unknown face landmark detected. Should not be 9813 // filled. 9814 // "LEFT_EYE" - Left eye. 9815 // "RIGHT_EYE" - Right eye. 9816 // "LEFT_OF_LEFT_EYEBROW" - Left of left eyebrow. 9817 // "RIGHT_OF_LEFT_EYEBROW" - Right of left eyebrow. 9818 // "LEFT_OF_RIGHT_EYEBROW" - Left of right eyebrow. 9819 // "RIGHT_OF_RIGHT_EYEBROW" - Right of right eyebrow. 9820 // "MIDPOINT_BETWEEN_EYES" - Midpoint between eyes. 9821 // "NOSE_TIP" - Nose tip. 9822 // "UPPER_LIP" - Upper lip. 9823 // "LOWER_LIP" - Lower lip. 9824 // "MOUTH_LEFT" - Mouth left. 9825 // "MOUTH_RIGHT" - Mouth right. 9826 // "MOUTH_CENTER" - Mouth center. 9827 // "NOSE_BOTTOM_RIGHT" - Nose, bottom right. 9828 // "NOSE_BOTTOM_LEFT" - Nose, bottom left. 9829 // "NOSE_BOTTOM_CENTER" - Nose, bottom center. 9830 // "LEFT_EYE_TOP_BOUNDARY" - Left eye, top boundary. 9831 // "LEFT_EYE_RIGHT_CORNER" - Left eye, right corner. 9832 // "LEFT_EYE_BOTTOM_BOUNDARY" - Left eye, bottom boundary. 9833 // "LEFT_EYE_LEFT_CORNER" - Left eye, left corner. 9834 // "RIGHT_EYE_TOP_BOUNDARY" - Right eye, top boundary. 9835 // "RIGHT_EYE_RIGHT_CORNER" - Right eye, right corner. 9836 // "RIGHT_EYE_BOTTOM_BOUNDARY" - Right eye, bottom boundary. 9837 // "RIGHT_EYE_LEFT_CORNER" - Right eye, left corner. 9838 // "LEFT_EYEBROW_UPPER_MIDPOINT" - Left eyebrow, upper midpoint. 9839 // "RIGHT_EYEBROW_UPPER_MIDPOINT" - Right eyebrow, upper midpoint. 9840 // "LEFT_EAR_TRAGION" - Left ear tragion. 9841 // "RIGHT_EAR_TRAGION" - Right ear tragion. 9842 // "LEFT_EYE_PUPIL" - Left eye pupil. 9843 // "RIGHT_EYE_PUPIL" - Right eye pupil. 9844 // "FOREHEAD_GLABELLA" - Forehead glabella. 9845 // "CHIN_GNATHION" - Chin gnathion. 9846 // "CHIN_LEFT_GONION" - Chin left gonion. 9847 // "CHIN_RIGHT_GONION" - Chin right gonion. 9848 // "LEFT_CHEEK_CENTER" - Left cheek center. 9849 // "RIGHT_CHEEK_CENTER" - Right cheek center. 9850 Type string `json:"type,omitempty"` 9851 9852 // ForceSendFields is a list of field names (e.g. "Position") to 9853 // unconditionally include in API requests. By default, fields with 9854 // empty values are omitted from API requests. However, any non-pointer, 9855 // non-interface field appearing in ForceSendFields will be sent to the 9856 // server regardless of whether the field is empty or not. This may be 9857 // used to include empty fields in Patch requests. 9858 ForceSendFields []string `json:"-"` 9859 9860 // NullFields is a list of field names (e.g. "Position") to include in 9861 // API requests with the JSON null value. By default, fields with empty 9862 // values are omitted from API requests. However, any field with an 9863 // empty value appearing in NullFields will be sent to the server as 9864 // null. It is an error if a field in this list has a non-empty value. 9865 // This may be used to include null fields in Patch requests. 9866 NullFields []string `json:"-"` 9867} 9868 9869func (s *GoogleCloudVisionV1p4beta1FaceAnnotationLandmark) MarshalJSON() ([]byte, error) { 9870 type NoMethod GoogleCloudVisionV1p4beta1FaceAnnotationLandmark 9871 raw := NoMethod(*s) 9872 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9873} 9874 9875// GoogleCloudVisionV1p4beta1FaceRecognitionResult: Information about a 9876// face's identity. 9877type GoogleCloudVisionV1p4beta1FaceRecognitionResult struct { 9878 // Celebrity: The Celebrity that this face was matched to. 9879 Celebrity *GoogleCloudVisionV1p4beta1Celebrity `json:"celebrity,omitempty"` 9880 9881 // Confidence: Recognition confidence. Range [0, 1]. 9882 Confidence float64 `json:"confidence,omitempty"` 9883 9884 // ForceSendFields is a list of field names (e.g. "Celebrity") to 9885 // unconditionally include in API requests. By default, fields with 9886 // empty values are omitted from API requests. However, any non-pointer, 9887 // non-interface field appearing in ForceSendFields will be sent to the 9888 // server regardless of whether the field is empty or not. This may be 9889 // used to include empty fields in Patch requests. 9890 ForceSendFields []string `json:"-"` 9891 9892 // NullFields is a list of field names (e.g. "Celebrity") to include in 9893 // API requests with the JSON null value. By default, fields with empty 9894 // values are omitted from API requests. However, any field with an 9895 // empty value appearing in NullFields will be sent to the server as 9896 // null. It is an error if a field in this list has a non-empty value. 9897 // This may be used to include null fields in Patch requests. 9898 NullFields []string `json:"-"` 9899} 9900 9901func (s *GoogleCloudVisionV1p4beta1FaceRecognitionResult) MarshalJSON() ([]byte, error) { 9902 type NoMethod GoogleCloudVisionV1p4beta1FaceRecognitionResult 9903 raw := NoMethod(*s) 9904 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9905} 9906 9907func (s *GoogleCloudVisionV1p4beta1FaceRecognitionResult) UnmarshalJSON(data []byte) error { 9908 type NoMethod GoogleCloudVisionV1p4beta1FaceRecognitionResult 9909 var s1 struct { 9910 Confidence gensupport.JSONFloat64 `json:"confidence"` 9911 *NoMethod 9912 } 9913 s1.NoMethod = (*NoMethod)(s) 9914 if err := json.Unmarshal(data, &s1); err != nil { 9915 return err 9916 } 9917 s.Confidence = float64(s1.Confidence) 9918 return nil 9919} 9920 9921// GoogleCloudVisionV1p4beta1GcsDestination: The Google Cloud Storage 9922// location where the output will be written to. 9923type GoogleCloudVisionV1p4beta1GcsDestination struct { 9924 // Uri: Google Cloud Storage URI prefix where the results will be 9925 // stored. Results will be in JSON format and preceded by its 9926 // corresponding input URI prefix. This field can either represent a gcs 9927 // file prefix or gcs directory. In either case, the uri should be 9928 // unique because in order to get all of the output files, you will need 9929 // to do a wildcard gcs search on the uri prefix you provide. Examples: 9930 // * File Prefix: gs://bucket-name/here/filenameprefix The output files 9931 // will be created in gs://bucket-name/here/ and the names of the output 9932 // files will begin with "filenameprefix". * Directory Prefix: 9933 // gs://bucket-name/some/location/ The output files will be created in 9934 // gs://bucket-name/some/location/ and the names of the output files 9935 // could be anything because there was no filename prefix specified. If 9936 // multiple outputs, each response is still AnnotateFileResponse, each 9937 // of which contains some subset of the full list of 9938 // AnnotateImageResponse. Multiple outputs can happen if, for example, 9939 // the output JSON is too large and overflows into multiple sharded 9940 // files. 9941 Uri string `json:"uri,omitempty"` 9942 9943 // ForceSendFields is a list of field names (e.g. "Uri") to 9944 // unconditionally include in API requests. By default, fields with 9945 // empty values are omitted from API requests. However, any non-pointer, 9946 // non-interface field appearing in ForceSendFields will be sent to the 9947 // server regardless of whether the field is empty or not. This may be 9948 // used to include empty fields in Patch requests. 9949 ForceSendFields []string `json:"-"` 9950 9951 // NullFields is a list of field names (e.g. "Uri") to include in API 9952 // requests with the JSON null value. By default, fields with empty 9953 // values are omitted from API requests. However, any field with an 9954 // empty value appearing in NullFields will be sent to the server as 9955 // null. It is an error if a field in this list has a non-empty value. 9956 // This may be used to include null fields in Patch requests. 9957 NullFields []string `json:"-"` 9958} 9959 9960func (s *GoogleCloudVisionV1p4beta1GcsDestination) MarshalJSON() ([]byte, error) { 9961 type NoMethod GoogleCloudVisionV1p4beta1GcsDestination 9962 raw := NoMethod(*s) 9963 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9964} 9965 9966// GoogleCloudVisionV1p4beta1GcsSource: The Google Cloud Storage 9967// location where the input will be read from. 9968type GoogleCloudVisionV1p4beta1GcsSource struct { 9969 // Uri: Google Cloud Storage URI for the input file. This must only be a 9970 // Google Cloud Storage object. Wildcards are not currently supported. 9971 Uri string `json:"uri,omitempty"` 9972 9973 // ForceSendFields is a list of field names (e.g. "Uri") to 9974 // unconditionally include in API requests. By default, fields with 9975 // empty values are omitted from API requests. However, any non-pointer, 9976 // non-interface field appearing in ForceSendFields will be sent to the 9977 // server regardless of whether the field is empty or not. This may be 9978 // used to include empty fields in Patch requests. 9979 ForceSendFields []string `json:"-"` 9980 9981 // NullFields is a list of field names (e.g. "Uri") to include in API 9982 // requests with the JSON null value. By default, fields with empty 9983 // values are omitted from API requests. However, any field with an 9984 // empty value appearing in NullFields will be sent to the server as 9985 // null. It is an error if a field in this list has a non-empty value. 9986 // This may be used to include null fields in Patch requests. 9987 NullFields []string `json:"-"` 9988} 9989 9990func (s *GoogleCloudVisionV1p4beta1GcsSource) MarshalJSON() ([]byte, error) { 9991 type NoMethod GoogleCloudVisionV1p4beta1GcsSource 9992 raw := NoMethod(*s) 9993 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9994} 9995 9996// GoogleCloudVisionV1p4beta1ImageAnnotationContext: If an image was 9997// produced from a file (e.g. a PDF), this message gives information 9998// about the source of that image. 9999type GoogleCloudVisionV1p4beta1ImageAnnotationContext struct { 10000 // PageNumber: If the file was a PDF or TIFF, this field gives the page 10001 // number within the file used to produce the image. 10002 PageNumber int64 `json:"pageNumber,omitempty"` 10003 10004 // Uri: The URI of the file used to produce the image. 10005 Uri string `json:"uri,omitempty"` 10006 10007 // ForceSendFields is a list of field names (e.g. "PageNumber") to 10008 // unconditionally include in API requests. By default, fields with 10009 // empty values are omitted from API requests. However, any non-pointer, 10010 // non-interface field appearing in ForceSendFields will be sent to the 10011 // server regardless of whether the field is empty or not. This may be 10012 // used to include empty fields in Patch requests. 10013 ForceSendFields []string `json:"-"` 10014 10015 // NullFields is a list of field names (e.g. "PageNumber") to include in 10016 // API requests with the JSON null value. By default, fields with empty 10017 // values are omitted from API requests. However, any field with an 10018 // empty value appearing in NullFields will be sent to the server as 10019 // null. It is an error if a field in this list has a non-empty value. 10020 // This may be used to include null fields in Patch requests. 10021 NullFields []string `json:"-"` 10022} 10023 10024func (s *GoogleCloudVisionV1p4beta1ImageAnnotationContext) MarshalJSON() ([]byte, error) { 10025 type NoMethod GoogleCloudVisionV1p4beta1ImageAnnotationContext 10026 raw := NoMethod(*s) 10027 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10028} 10029 10030// GoogleCloudVisionV1p4beta1ImageProperties: Stores image properties, 10031// such as dominant colors. 10032type GoogleCloudVisionV1p4beta1ImageProperties struct { 10033 // DominantColors: If present, dominant colors completed successfully. 10034 DominantColors *GoogleCloudVisionV1p4beta1DominantColorsAnnotation `json:"dominantColors,omitempty"` 10035 10036 // ForceSendFields is a list of field names (e.g. "DominantColors") to 10037 // unconditionally include in API requests. By default, fields with 10038 // empty values are omitted from API requests. However, any non-pointer, 10039 // non-interface field appearing in ForceSendFields will be sent to the 10040 // server regardless of whether the field is empty or not. This may be 10041 // used to include empty fields in Patch requests. 10042 ForceSendFields []string `json:"-"` 10043 10044 // NullFields is a list of field names (e.g. "DominantColors") to 10045 // include in API requests with the JSON null value. By default, fields 10046 // with empty values are omitted from API requests. However, any field 10047 // with an empty value appearing in NullFields will be sent to the 10048 // server as null. It is an error if a field in this list has a 10049 // non-empty value. This may be used to include null fields in Patch 10050 // requests. 10051 NullFields []string `json:"-"` 10052} 10053 10054func (s *GoogleCloudVisionV1p4beta1ImageProperties) MarshalJSON() ([]byte, error) { 10055 type NoMethod GoogleCloudVisionV1p4beta1ImageProperties 10056 raw := NoMethod(*s) 10057 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10058} 10059 10060// GoogleCloudVisionV1p4beta1ImportProductSetsResponse: Response message 10061// for the `ImportProductSets` method. This message is returned by the 10062// google.longrunning.Operations.GetOperation method in the returned 10063// google.longrunning.Operation.response field. 10064type GoogleCloudVisionV1p4beta1ImportProductSetsResponse struct { 10065 // ReferenceImages: The list of reference_images that are imported 10066 // successfully. 10067 ReferenceImages []*GoogleCloudVisionV1p4beta1ReferenceImage `json:"referenceImages,omitempty"` 10068 10069 // Statuses: The rpc status for each ImportProductSet request, including 10070 // both successes and errors. The number of statuses here matches the 10071 // number of lines in the csv file, and statuses[i] stores the success 10072 // or failure status of processing the i-th line of the csv, starting 10073 // from line 0. 10074 Statuses []*Status `json:"statuses,omitempty"` 10075 10076 // ForceSendFields is a list of field names (e.g. "ReferenceImages") to 10077 // unconditionally include in API requests. By default, fields with 10078 // empty values are omitted from API requests. However, any non-pointer, 10079 // non-interface field appearing in ForceSendFields will be sent to the 10080 // server regardless of whether the field is empty or not. This may be 10081 // used to include empty fields in Patch requests. 10082 ForceSendFields []string `json:"-"` 10083 10084 // NullFields is a list of field names (e.g. "ReferenceImages") to 10085 // include in API requests with the JSON null value. By default, fields 10086 // with empty values are omitted from API requests. However, any field 10087 // with an empty value appearing in NullFields will be sent to the 10088 // server as null. It is an error if a field in this list has a 10089 // non-empty value. This may be used to include null fields in Patch 10090 // requests. 10091 NullFields []string `json:"-"` 10092} 10093 10094func (s *GoogleCloudVisionV1p4beta1ImportProductSetsResponse) MarshalJSON() ([]byte, error) { 10095 type NoMethod GoogleCloudVisionV1p4beta1ImportProductSetsResponse 10096 raw := NoMethod(*s) 10097 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10098} 10099 10100// GoogleCloudVisionV1p4beta1InputConfig: The desired input location and 10101// metadata. 10102type GoogleCloudVisionV1p4beta1InputConfig struct { 10103 // Content: File content, represented as a stream of bytes. Note: As 10104 // with all `bytes` fields, protobuffers use a pure binary 10105 // representation, whereas JSON representations use base64. Currently, 10106 // this field only works for BatchAnnotateFiles requests. It does not 10107 // work for AsyncBatchAnnotateFiles requests. 10108 Content string `json:"content,omitempty"` 10109 10110 // GcsSource: The Google Cloud Storage location to read the input from. 10111 GcsSource *GoogleCloudVisionV1p4beta1GcsSource `json:"gcsSource,omitempty"` 10112 10113 // MimeType: The type of the file. Currently only "application/pdf", 10114 // "image/tiff" and "image/gif" are supported. Wildcards are not 10115 // supported. 10116 MimeType string `json:"mimeType,omitempty"` 10117 10118 // ForceSendFields is a list of field names (e.g. "Content") to 10119 // unconditionally include in API requests. By default, fields with 10120 // empty values are omitted from API requests. However, any non-pointer, 10121 // non-interface field appearing in ForceSendFields will be sent to the 10122 // server regardless of whether the field is empty or not. This may be 10123 // used to include empty fields in Patch requests. 10124 ForceSendFields []string `json:"-"` 10125 10126 // NullFields is a list of field names (e.g. "Content") to include in 10127 // API requests with the JSON null value. By default, fields with empty 10128 // values are omitted from API requests. However, any field with an 10129 // empty value appearing in NullFields will be sent to the server as 10130 // null. It is an error if a field in this list has a non-empty value. 10131 // This may be used to include null fields in Patch requests. 10132 NullFields []string `json:"-"` 10133} 10134 10135func (s *GoogleCloudVisionV1p4beta1InputConfig) MarshalJSON() ([]byte, error) { 10136 type NoMethod GoogleCloudVisionV1p4beta1InputConfig 10137 raw := NoMethod(*s) 10138 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10139} 10140 10141// GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation: Set of detected 10142// objects with bounding boxes. 10143type GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation struct { 10144 // BoundingPoly: Image region to which this object belongs. This must be 10145 // populated. 10146 BoundingPoly *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingPoly,omitempty"` 10147 10148 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". 10149 // For more information, see 10150 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 10151 LanguageCode string `json:"languageCode,omitempty"` 10152 10153 // Mid: Object ID that should align with EntityAnnotation mid. 10154 Mid string `json:"mid,omitempty"` 10155 10156 // Name: Object name, expressed in its `language_code` language. 10157 Name string `json:"name,omitempty"` 10158 10159 // Score: Score of the result. Range [0, 1]. 10160 Score float64 `json:"score,omitempty"` 10161 10162 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 10163 // unconditionally include in API requests. By default, fields with 10164 // empty values are omitted from API requests. However, any non-pointer, 10165 // non-interface field appearing in ForceSendFields will be sent to the 10166 // server regardless of whether the field is empty or not. This may be 10167 // used to include empty fields in Patch requests. 10168 ForceSendFields []string `json:"-"` 10169 10170 // NullFields is a list of field names (e.g. "BoundingPoly") to include 10171 // in API requests with the JSON null value. By default, fields with 10172 // empty values are omitted from API requests. However, any field with 10173 // an empty value appearing in NullFields will be sent to the server as 10174 // null. It is an error if a field in this list has a non-empty value. 10175 // This may be used to include null fields in Patch requests. 10176 NullFields []string `json:"-"` 10177} 10178 10179func (s *GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation) MarshalJSON() ([]byte, error) { 10180 type NoMethod GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation 10181 raw := NoMethod(*s) 10182 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10183} 10184 10185func (s *GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation) UnmarshalJSON(data []byte) error { 10186 type NoMethod GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation 10187 var s1 struct { 10188 Score gensupport.JSONFloat64 `json:"score"` 10189 *NoMethod 10190 } 10191 s1.NoMethod = (*NoMethod)(s) 10192 if err := json.Unmarshal(data, &s1); err != nil { 10193 return err 10194 } 10195 s.Score = float64(s1.Score) 10196 return nil 10197} 10198 10199// GoogleCloudVisionV1p4beta1LocationInfo: Detected entity location 10200// information. 10201type GoogleCloudVisionV1p4beta1LocationInfo struct { 10202 // LatLng: lat/long location coordinates. 10203 LatLng *LatLng `json:"latLng,omitempty"` 10204 10205 // ForceSendFields is a list of field names (e.g. "LatLng") to 10206 // unconditionally include in API requests. By default, fields with 10207 // empty values are omitted from API requests. However, any non-pointer, 10208 // non-interface field appearing in ForceSendFields will be sent to the 10209 // server regardless of whether the field is empty or not. This may be 10210 // used to include empty fields in Patch requests. 10211 ForceSendFields []string `json:"-"` 10212 10213 // NullFields is a list of field names (e.g. "LatLng") to include in API 10214 // requests with the JSON null value. By default, fields with empty 10215 // values are omitted from API requests. However, any field with an 10216 // empty value appearing in NullFields will be sent to the server as 10217 // null. It is an error if a field in this list has a non-empty value. 10218 // This may be used to include null fields in Patch requests. 10219 NullFields []string `json:"-"` 10220} 10221 10222func (s *GoogleCloudVisionV1p4beta1LocationInfo) MarshalJSON() ([]byte, error) { 10223 type NoMethod GoogleCloudVisionV1p4beta1LocationInfo 10224 raw := NoMethod(*s) 10225 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10226} 10227 10228// GoogleCloudVisionV1p4beta1NormalizedVertex: A vertex represents a 2D 10229// point in the image. NOTE: the normalized vertex coordinates are 10230// relative to the original image and range from 0 to 1. 10231type GoogleCloudVisionV1p4beta1NormalizedVertex struct { 10232 // X: X coordinate. 10233 X float64 `json:"x,omitempty"` 10234 10235 // Y: Y coordinate. 10236 Y float64 `json:"y,omitempty"` 10237 10238 // ForceSendFields is a list of field names (e.g. "X") to 10239 // unconditionally include in API requests. By default, fields with 10240 // empty values are omitted from API requests. However, any non-pointer, 10241 // non-interface field appearing in ForceSendFields will be sent to the 10242 // server regardless of whether the field is empty or not. This may be 10243 // used to include empty fields in Patch requests. 10244 ForceSendFields []string `json:"-"` 10245 10246 // NullFields is a list of field names (e.g. "X") to include in API 10247 // requests with the JSON null value. By default, fields with empty 10248 // values are omitted from API requests. However, any field with an 10249 // empty value appearing in NullFields will be sent to the server as 10250 // null. It is an error if a field in this list has a non-empty value. 10251 // This may be used to include null fields in Patch requests. 10252 NullFields []string `json:"-"` 10253} 10254 10255func (s *GoogleCloudVisionV1p4beta1NormalizedVertex) MarshalJSON() ([]byte, error) { 10256 type NoMethod GoogleCloudVisionV1p4beta1NormalizedVertex 10257 raw := NoMethod(*s) 10258 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10259} 10260 10261func (s *GoogleCloudVisionV1p4beta1NormalizedVertex) UnmarshalJSON(data []byte) error { 10262 type NoMethod GoogleCloudVisionV1p4beta1NormalizedVertex 10263 var s1 struct { 10264 X gensupport.JSONFloat64 `json:"x"` 10265 Y gensupport.JSONFloat64 `json:"y"` 10266 *NoMethod 10267 } 10268 s1.NoMethod = (*NoMethod)(s) 10269 if err := json.Unmarshal(data, &s1); err != nil { 10270 return err 10271 } 10272 s.X = float64(s1.X) 10273 s.Y = float64(s1.Y) 10274 return nil 10275} 10276 10277// GoogleCloudVisionV1p4beta1OperationMetadata: Contains metadata for 10278// the BatchAnnotateImages operation. 10279type GoogleCloudVisionV1p4beta1OperationMetadata struct { 10280 // CreateTime: The time when the batch request was received. 10281 CreateTime string `json:"createTime,omitempty"` 10282 10283 // State: Current state of the batch operation. 10284 // 10285 // Possible values: 10286 // "STATE_UNSPECIFIED" - Invalid. 10287 // "CREATED" - Request is received. 10288 // "RUNNING" - Request is actively being processed. 10289 // "DONE" - The batch processing is done. 10290 // "CANCELLED" - The batch processing was cancelled. 10291 State string `json:"state,omitempty"` 10292 10293 // UpdateTime: The time when the operation result was last updated. 10294 UpdateTime string `json:"updateTime,omitempty"` 10295 10296 // ForceSendFields is a list of field names (e.g. "CreateTime") to 10297 // unconditionally include in API requests. By default, fields with 10298 // empty values are omitted from API requests. However, any non-pointer, 10299 // non-interface field appearing in ForceSendFields will be sent to the 10300 // server regardless of whether the field is empty or not. This may be 10301 // used to include empty fields in Patch requests. 10302 ForceSendFields []string `json:"-"` 10303 10304 // NullFields is a list of field names (e.g. "CreateTime") to include in 10305 // API requests with the JSON null value. By default, fields with empty 10306 // values are omitted from API requests. However, any field with an 10307 // empty value appearing in NullFields will be sent to the server as 10308 // null. It is an error if a field in this list has a non-empty value. 10309 // This may be used to include null fields in Patch requests. 10310 NullFields []string `json:"-"` 10311} 10312 10313func (s *GoogleCloudVisionV1p4beta1OperationMetadata) MarshalJSON() ([]byte, error) { 10314 type NoMethod GoogleCloudVisionV1p4beta1OperationMetadata 10315 raw := NoMethod(*s) 10316 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10317} 10318 10319// GoogleCloudVisionV1p4beta1OutputConfig: The desired output location 10320// and metadata. 10321type GoogleCloudVisionV1p4beta1OutputConfig struct { 10322 // BatchSize: The max number of response protos to put into each output 10323 // JSON file on Google Cloud Storage. The valid range is [1, 100]. If 10324 // not specified, the default value is 20. For example, for one pdf file 10325 // with 100 pages, 100 response protos will be generated. If 10326 // `batch_size` = 20, then 5 json files each containing 20 response 10327 // protos will be written under the prefix `gcs_destination`.`uri`. 10328 // Currently, batch_size only applies to GcsDestination, with potential 10329 // future support for other output configurations. 10330 BatchSize int64 `json:"batchSize,omitempty"` 10331 10332 // GcsDestination: The Google Cloud Storage location to write the 10333 // output(s) to. 10334 GcsDestination *GoogleCloudVisionV1p4beta1GcsDestination `json:"gcsDestination,omitempty"` 10335 10336 // ForceSendFields is a list of field names (e.g. "BatchSize") to 10337 // unconditionally include in API requests. By default, fields with 10338 // empty values are omitted from API requests. However, any non-pointer, 10339 // non-interface field appearing in ForceSendFields will be sent to the 10340 // server regardless of whether the field is empty or not. This may be 10341 // used to include empty fields in Patch requests. 10342 ForceSendFields []string `json:"-"` 10343 10344 // NullFields is a list of field names (e.g. "BatchSize") to include in 10345 // API requests with the JSON null value. By default, fields with empty 10346 // values are omitted from API requests. However, any field with an 10347 // empty value appearing in NullFields will be sent to the server as 10348 // null. It is an error if a field in this list has a non-empty value. 10349 // This may be used to include null fields in Patch requests. 10350 NullFields []string `json:"-"` 10351} 10352 10353func (s *GoogleCloudVisionV1p4beta1OutputConfig) MarshalJSON() ([]byte, error) { 10354 type NoMethod GoogleCloudVisionV1p4beta1OutputConfig 10355 raw := NoMethod(*s) 10356 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10357} 10358 10359// GoogleCloudVisionV1p4beta1Page: Detected page from OCR. 10360type GoogleCloudVisionV1p4beta1Page struct { 10361 // Blocks: List of blocks of text, images etc on this page. 10362 Blocks []*GoogleCloudVisionV1p4beta1Block `json:"blocks,omitempty"` 10363 10364 // Confidence: Confidence of the OCR results on the page. Range [0, 1]. 10365 Confidence float64 `json:"confidence,omitempty"` 10366 10367 // Height: Page height. For PDFs the unit is points. For images 10368 // (including TIFFs) the unit is pixels. 10369 Height int64 `json:"height,omitempty"` 10370 10371 // Property: Additional information detected on the page. 10372 Property *GoogleCloudVisionV1p4beta1TextAnnotationTextProperty `json:"property,omitempty"` 10373 10374 // Width: Page width. For PDFs the unit is points. For images (including 10375 // TIFFs) the unit is pixels. 10376 Width int64 `json:"width,omitempty"` 10377 10378 // ForceSendFields is a list of field names (e.g. "Blocks") to 10379 // unconditionally include in API requests. By default, fields with 10380 // empty values are omitted from API requests. However, any non-pointer, 10381 // non-interface field appearing in ForceSendFields will be sent to the 10382 // server regardless of whether the field is empty or not. This may be 10383 // used to include empty fields in Patch requests. 10384 ForceSendFields []string `json:"-"` 10385 10386 // NullFields is a list of field names (e.g. "Blocks") to include in API 10387 // requests with the JSON null value. By default, fields with empty 10388 // values are omitted from API requests. However, any field with an 10389 // empty value appearing in NullFields will be sent to the server as 10390 // null. It is an error if a field in this list has a non-empty value. 10391 // This may be used to include null fields in Patch requests. 10392 NullFields []string `json:"-"` 10393} 10394 10395func (s *GoogleCloudVisionV1p4beta1Page) MarshalJSON() ([]byte, error) { 10396 type NoMethod GoogleCloudVisionV1p4beta1Page 10397 raw := NoMethod(*s) 10398 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10399} 10400 10401func (s *GoogleCloudVisionV1p4beta1Page) UnmarshalJSON(data []byte) error { 10402 type NoMethod GoogleCloudVisionV1p4beta1Page 10403 var s1 struct { 10404 Confidence gensupport.JSONFloat64 `json:"confidence"` 10405 *NoMethod 10406 } 10407 s1.NoMethod = (*NoMethod)(s) 10408 if err := json.Unmarshal(data, &s1); err != nil { 10409 return err 10410 } 10411 s.Confidence = float64(s1.Confidence) 10412 return nil 10413} 10414 10415// GoogleCloudVisionV1p4beta1Paragraph: Structural unit of text 10416// representing a number of words in certain order. 10417type GoogleCloudVisionV1p4beta1Paragraph struct { 10418 // BoundingBox: The bounding box for the paragraph. The vertices are in 10419 // the order of top-left, top-right, bottom-right, bottom-left. When a 10420 // rotation of the bounding box is detected the rotation is represented 10421 // as around the top-left corner as defined when the text is read in the 10422 // 'natural' orientation. For example: * when the text is horizontal it 10423 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 10424 // around the top-left corner it becomes: 2----3 | | 1----0 and the 10425 // vertex order will still be (0, 1, 2, 3). 10426 BoundingBox *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingBox,omitempty"` 10427 10428 // Confidence: Confidence of the OCR results for the paragraph. Range 10429 // [0, 1]. 10430 Confidence float64 `json:"confidence,omitempty"` 10431 10432 // Property: Additional information detected for the paragraph. 10433 Property *GoogleCloudVisionV1p4beta1TextAnnotationTextProperty `json:"property,omitempty"` 10434 10435 // Words: List of all words in this paragraph. 10436 Words []*GoogleCloudVisionV1p4beta1Word `json:"words,omitempty"` 10437 10438 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 10439 // unconditionally include in API requests. By default, fields with 10440 // empty values are omitted from API requests. However, any non-pointer, 10441 // non-interface field appearing in ForceSendFields will be sent to the 10442 // server regardless of whether the field is empty or not. This may be 10443 // used to include empty fields in Patch requests. 10444 ForceSendFields []string `json:"-"` 10445 10446 // NullFields is a list of field names (e.g. "BoundingBox") to include 10447 // in API requests with the JSON null value. By default, fields with 10448 // empty values are omitted from API requests. However, any field with 10449 // an empty value appearing in NullFields will be sent to the server as 10450 // null. It is an error if a field in this list has a non-empty value. 10451 // This may be used to include null fields in Patch requests. 10452 NullFields []string `json:"-"` 10453} 10454 10455func (s *GoogleCloudVisionV1p4beta1Paragraph) MarshalJSON() ([]byte, error) { 10456 type NoMethod GoogleCloudVisionV1p4beta1Paragraph 10457 raw := NoMethod(*s) 10458 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10459} 10460 10461func (s *GoogleCloudVisionV1p4beta1Paragraph) UnmarshalJSON(data []byte) error { 10462 type NoMethod GoogleCloudVisionV1p4beta1Paragraph 10463 var s1 struct { 10464 Confidence gensupport.JSONFloat64 `json:"confidence"` 10465 *NoMethod 10466 } 10467 s1.NoMethod = (*NoMethod)(s) 10468 if err := json.Unmarshal(data, &s1); err != nil { 10469 return err 10470 } 10471 s.Confidence = float64(s1.Confidence) 10472 return nil 10473} 10474 10475// GoogleCloudVisionV1p4beta1Position: A 3D position in the image, used 10476// primarily for Face detection landmarks. A valid Position must have 10477// both x and y coordinates. The position coordinates are in the same 10478// scale as the original image. 10479type GoogleCloudVisionV1p4beta1Position struct { 10480 // X: X coordinate. 10481 X float64 `json:"x,omitempty"` 10482 10483 // Y: Y coordinate. 10484 Y float64 `json:"y,omitempty"` 10485 10486 // Z: Z coordinate (or depth). 10487 Z float64 `json:"z,omitempty"` 10488 10489 // ForceSendFields is a list of field names (e.g. "X") to 10490 // unconditionally include in API requests. By default, fields with 10491 // empty values are omitted from API requests. However, any non-pointer, 10492 // non-interface field appearing in ForceSendFields will be sent to the 10493 // server regardless of whether the field is empty or not. This may be 10494 // used to include empty fields in Patch requests. 10495 ForceSendFields []string `json:"-"` 10496 10497 // NullFields is a list of field names (e.g. "X") to include in API 10498 // requests with the JSON null value. By default, fields with empty 10499 // values are omitted from API requests. However, any field with an 10500 // empty value appearing in NullFields will be sent to the server as 10501 // null. It is an error if a field in this list has a non-empty value. 10502 // This may be used to include null fields in Patch requests. 10503 NullFields []string `json:"-"` 10504} 10505 10506func (s *GoogleCloudVisionV1p4beta1Position) MarshalJSON() ([]byte, error) { 10507 type NoMethod GoogleCloudVisionV1p4beta1Position 10508 raw := NoMethod(*s) 10509 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10510} 10511 10512func (s *GoogleCloudVisionV1p4beta1Position) UnmarshalJSON(data []byte) error { 10513 type NoMethod GoogleCloudVisionV1p4beta1Position 10514 var s1 struct { 10515 X gensupport.JSONFloat64 `json:"x"` 10516 Y gensupport.JSONFloat64 `json:"y"` 10517 Z gensupport.JSONFloat64 `json:"z"` 10518 *NoMethod 10519 } 10520 s1.NoMethod = (*NoMethod)(s) 10521 if err := json.Unmarshal(data, &s1); err != nil { 10522 return err 10523 } 10524 s.X = float64(s1.X) 10525 s.Y = float64(s1.Y) 10526 s.Z = float64(s1.Z) 10527 return nil 10528} 10529 10530// GoogleCloudVisionV1p4beta1Product: A Product contains 10531// ReferenceImages. 10532type GoogleCloudVisionV1p4beta1Product struct { 10533 // Description: User-provided metadata to be stored with this product. 10534 // Must be at most 4096 characters long. 10535 Description string `json:"description,omitempty"` 10536 10537 // DisplayName: The user-provided name for this Product. Must not be 10538 // empty. Must be at most 4096 characters long. 10539 DisplayName string `json:"displayName,omitempty"` 10540 10541 // Name: The resource name of the product. Format is: 10542 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This 10543 // field is ignored when creating a product. 10544 Name string `json:"name,omitempty"` 10545 10546 // ProductCategory: Immutable. The category for the product identified 10547 // by the reference image. This should be one of "homegoods-v2", 10548 // "apparel-v2", "toys-v2", "packagedgoods-v1" or "general-v1". The 10549 // legacy categories "homegoods", "apparel", and "toys" are still 10550 // supported, but these should not be used for new products. 10551 ProductCategory string `json:"productCategory,omitempty"` 10552 10553 // ProductLabels: Key-value pairs that can be attached to a product. At 10554 // query time, constraints can be specified based on the product_labels. 10555 // Note that integer values can be provided as strings, e.g. "1199". 10556 // Only strings with integer values can match a range-based restriction 10557 // which is to be supported soon. Multiple values can be assigned to the 10558 // same key. One product may have up to 500 product_labels. Notice that 10559 // the total number of distinct product_labels over all products in one 10560 // ProductSet cannot exceed 1M, otherwise the product search pipeline 10561 // will refuse to work for that ProductSet. 10562 ProductLabels []*GoogleCloudVisionV1p4beta1ProductKeyValue `json:"productLabels,omitempty"` 10563 10564 // ForceSendFields is a list of field names (e.g. "Description") to 10565 // unconditionally include in API requests. By default, fields with 10566 // empty values are omitted from API requests. However, any non-pointer, 10567 // non-interface field appearing in ForceSendFields will be sent to the 10568 // server regardless of whether the field is empty or not. This may be 10569 // used to include empty fields in Patch requests. 10570 ForceSendFields []string `json:"-"` 10571 10572 // NullFields is a list of field names (e.g. "Description") to include 10573 // in API requests with the JSON null value. By default, fields with 10574 // empty values are omitted from API requests. However, any field with 10575 // an empty value appearing in NullFields will be sent to the server as 10576 // null. It is an error if a field in this list has a non-empty value. 10577 // This may be used to include null fields in Patch requests. 10578 NullFields []string `json:"-"` 10579} 10580 10581func (s *GoogleCloudVisionV1p4beta1Product) MarshalJSON() ([]byte, error) { 10582 type NoMethod GoogleCloudVisionV1p4beta1Product 10583 raw := NoMethod(*s) 10584 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10585} 10586 10587// GoogleCloudVisionV1p4beta1ProductKeyValue: A product label 10588// represented as a key-value pair. 10589type GoogleCloudVisionV1p4beta1ProductKeyValue struct { 10590 // Key: The key of the label attached to the product. Cannot be empty 10591 // and cannot exceed 128 bytes. 10592 Key string `json:"key,omitempty"` 10593 10594 // Value: The value of the label attached to the product. Cannot be 10595 // empty and cannot exceed 128 bytes. 10596 Value string `json:"value,omitempty"` 10597 10598 // ForceSendFields is a list of field names (e.g. "Key") to 10599 // unconditionally include in API requests. By default, fields with 10600 // empty values are omitted from API requests. However, any non-pointer, 10601 // non-interface field appearing in ForceSendFields will be sent to the 10602 // server regardless of whether the field is empty or not. This may be 10603 // used to include empty fields in Patch requests. 10604 ForceSendFields []string `json:"-"` 10605 10606 // NullFields is a list of field names (e.g. "Key") to include in API 10607 // requests with the JSON null value. By default, fields with empty 10608 // values are omitted from API requests. However, any field with an 10609 // empty value appearing in NullFields will be sent to the server as 10610 // null. It is an error if a field in this list has a non-empty value. 10611 // This may be used to include null fields in Patch requests. 10612 NullFields []string `json:"-"` 10613} 10614 10615func (s *GoogleCloudVisionV1p4beta1ProductKeyValue) MarshalJSON() ([]byte, error) { 10616 type NoMethod GoogleCloudVisionV1p4beta1ProductKeyValue 10617 raw := NoMethod(*s) 10618 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10619} 10620 10621// GoogleCloudVisionV1p4beta1ProductSearchResults: Results for a product 10622// search request. 10623type GoogleCloudVisionV1p4beta1ProductSearchResults struct { 10624 // IndexTime: Timestamp of the index which provided these results. 10625 // Products added to the product set and products removed from the 10626 // product set after this time are not reflected in the current results. 10627 IndexTime string `json:"indexTime,omitempty"` 10628 10629 // ProductGroupedResults: List of results grouped by products detected 10630 // in the query image. Each entry corresponds to one bounding polygon in 10631 // the query image, and contains the matching products specific to that 10632 // region. There may be duplicate product matches in the union of all 10633 // the per-product results. 10634 ProductGroupedResults []*GoogleCloudVisionV1p4beta1ProductSearchResultsGroupedResult `json:"productGroupedResults,omitempty"` 10635 10636 // Results: List of results, one for each product match. 10637 Results []*GoogleCloudVisionV1p4beta1ProductSearchResultsResult `json:"results,omitempty"` 10638 10639 // ForceSendFields is a list of field names (e.g. "IndexTime") to 10640 // unconditionally include in API requests. By default, fields with 10641 // empty values are omitted from API requests. However, any non-pointer, 10642 // non-interface field appearing in ForceSendFields will be sent to the 10643 // server regardless of whether the field is empty or not. This may be 10644 // used to include empty fields in Patch requests. 10645 ForceSendFields []string `json:"-"` 10646 10647 // NullFields is a list of field names (e.g. "IndexTime") to include in 10648 // API requests with the JSON null value. By default, fields with empty 10649 // values are omitted from API requests. However, any field with an 10650 // empty value appearing in NullFields will be sent to the server as 10651 // null. It is an error if a field in this list has a non-empty value. 10652 // This may be used to include null fields in Patch requests. 10653 NullFields []string `json:"-"` 10654} 10655 10656func (s *GoogleCloudVisionV1p4beta1ProductSearchResults) MarshalJSON() ([]byte, error) { 10657 type NoMethod GoogleCloudVisionV1p4beta1ProductSearchResults 10658 raw := NoMethod(*s) 10659 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10660} 10661 10662// GoogleCloudVisionV1p4beta1ProductSearchResultsGroupedResult: 10663// Information about the products similar to a single product in a query 10664// image. 10665type GoogleCloudVisionV1p4beta1ProductSearchResultsGroupedResult struct { 10666 // BoundingPoly: The bounding polygon around the product detected in the 10667 // query image. 10668 BoundingPoly *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingPoly,omitempty"` 10669 10670 // ObjectAnnotations: List of generic predictions for the object in the 10671 // bounding box. 10672 ObjectAnnotations []*GoogleCloudVisionV1p4beta1ProductSearchResultsObjectAnnotation `json:"objectAnnotations,omitempty"` 10673 10674 // Results: List of results, one for each product match. 10675 Results []*GoogleCloudVisionV1p4beta1ProductSearchResultsResult `json:"results,omitempty"` 10676 10677 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 10678 // unconditionally include in API requests. By default, fields with 10679 // empty values are omitted from API requests. However, any non-pointer, 10680 // non-interface field appearing in ForceSendFields will be sent to the 10681 // server regardless of whether the field is empty or not. This may be 10682 // used to include empty fields in Patch requests. 10683 ForceSendFields []string `json:"-"` 10684 10685 // NullFields is a list of field names (e.g. "BoundingPoly") to include 10686 // in API requests with the JSON null value. By default, fields with 10687 // empty values are omitted from API requests. However, any field with 10688 // an empty value appearing in NullFields will be sent to the server as 10689 // null. It is an error if a field in this list has a non-empty value. 10690 // This may be used to include null fields in Patch requests. 10691 NullFields []string `json:"-"` 10692} 10693 10694func (s *GoogleCloudVisionV1p4beta1ProductSearchResultsGroupedResult) MarshalJSON() ([]byte, error) { 10695 type NoMethod GoogleCloudVisionV1p4beta1ProductSearchResultsGroupedResult 10696 raw := NoMethod(*s) 10697 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10698} 10699 10700// GoogleCloudVisionV1p4beta1ProductSearchResultsObjectAnnotation: 10701// Prediction for what the object in the bounding box is. 10702type GoogleCloudVisionV1p4beta1ProductSearchResultsObjectAnnotation struct { 10703 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". 10704 // For more information, see 10705 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 10706 LanguageCode string `json:"languageCode,omitempty"` 10707 10708 // Mid: Object ID that should align with EntityAnnotation mid. 10709 Mid string `json:"mid,omitempty"` 10710 10711 // Name: Object name, expressed in its `language_code` language. 10712 Name string `json:"name,omitempty"` 10713 10714 // Score: Score of the result. Range [0, 1]. 10715 Score float64 `json:"score,omitempty"` 10716 10717 // ForceSendFields is a list of field names (e.g. "LanguageCode") to 10718 // unconditionally include in API requests. By default, fields with 10719 // empty values are omitted from API requests. However, any non-pointer, 10720 // non-interface field appearing in ForceSendFields will be sent to the 10721 // server regardless of whether the field is empty or not. This may be 10722 // used to include empty fields in Patch requests. 10723 ForceSendFields []string `json:"-"` 10724 10725 // NullFields is a list of field names (e.g. "LanguageCode") to include 10726 // in API requests with the JSON null value. By default, fields with 10727 // empty values are omitted from API requests. However, any field with 10728 // an empty value appearing in NullFields will be sent to the server as 10729 // null. It is an error if a field in this list has a non-empty value. 10730 // This may be used to include null fields in Patch requests. 10731 NullFields []string `json:"-"` 10732} 10733 10734func (s *GoogleCloudVisionV1p4beta1ProductSearchResultsObjectAnnotation) MarshalJSON() ([]byte, error) { 10735 type NoMethod GoogleCloudVisionV1p4beta1ProductSearchResultsObjectAnnotation 10736 raw := NoMethod(*s) 10737 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10738} 10739 10740func (s *GoogleCloudVisionV1p4beta1ProductSearchResultsObjectAnnotation) UnmarshalJSON(data []byte) error { 10741 type NoMethod GoogleCloudVisionV1p4beta1ProductSearchResultsObjectAnnotation 10742 var s1 struct { 10743 Score gensupport.JSONFloat64 `json:"score"` 10744 *NoMethod 10745 } 10746 s1.NoMethod = (*NoMethod)(s) 10747 if err := json.Unmarshal(data, &s1); err != nil { 10748 return err 10749 } 10750 s.Score = float64(s1.Score) 10751 return nil 10752} 10753 10754// GoogleCloudVisionV1p4beta1ProductSearchResultsResult: Information 10755// about a product. 10756type GoogleCloudVisionV1p4beta1ProductSearchResultsResult struct { 10757 // Image: The resource name of the image from the product that is the 10758 // closest match to the query. 10759 Image string `json:"image,omitempty"` 10760 10761 // Product: The Product. 10762 Product *GoogleCloudVisionV1p4beta1Product `json:"product,omitempty"` 10763 10764 // Score: A confidence level on the match, ranging from 0 (no 10765 // confidence) to 1 (full confidence). 10766 Score float64 `json:"score,omitempty"` 10767 10768 // ForceSendFields is a list of field names (e.g. "Image") to 10769 // unconditionally include in API requests. By default, fields with 10770 // empty values are omitted from API requests. However, any non-pointer, 10771 // non-interface field appearing in ForceSendFields will be sent to the 10772 // server regardless of whether the field is empty or not. This may be 10773 // used to include empty fields in Patch requests. 10774 ForceSendFields []string `json:"-"` 10775 10776 // NullFields is a list of field names (e.g. "Image") to include in API 10777 // requests with the JSON null value. By default, fields with empty 10778 // values are omitted from API requests. However, any field with an 10779 // empty value appearing in NullFields will be sent to the server as 10780 // null. It is an error if a field in this list has a non-empty value. 10781 // This may be used to include null fields in Patch requests. 10782 NullFields []string `json:"-"` 10783} 10784 10785func (s *GoogleCloudVisionV1p4beta1ProductSearchResultsResult) MarshalJSON() ([]byte, error) { 10786 type NoMethod GoogleCloudVisionV1p4beta1ProductSearchResultsResult 10787 raw := NoMethod(*s) 10788 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10789} 10790 10791func (s *GoogleCloudVisionV1p4beta1ProductSearchResultsResult) UnmarshalJSON(data []byte) error { 10792 type NoMethod GoogleCloudVisionV1p4beta1ProductSearchResultsResult 10793 var s1 struct { 10794 Score gensupport.JSONFloat64 `json:"score"` 10795 *NoMethod 10796 } 10797 s1.NoMethod = (*NoMethod)(s) 10798 if err := json.Unmarshal(data, &s1); err != nil { 10799 return err 10800 } 10801 s.Score = float64(s1.Score) 10802 return nil 10803} 10804 10805// GoogleCloudVisionV1p4beta1Property: A `Property` consists of a 10806// user-supplied name/value pair. 10807type GoogleCloudVisionV1p4beta1Property struct { 10808 // Name: Name of the property. 10809 Name string `json:"name,omitempty"` 10810 10811 // Uint64Value: Value of numeric properties. 10812 Uint64Value uint64 `json:"uint64Value,omitempty,string"` 10813 10814 // Value: Value of the property. 10815 Value string `json:"value,omitempty"` 10816 10817 // ForceSendFields is a list of field names (e.g. "Name") to 10818 // unconditionally include in API requests. By default, fields with 10819 // empty values are omitted from API requests. However, any non-pointer, 10820 // non-interface field appearing in ForceSendFields will be sent to the 10821 // server regardless of whether the field is empty or not. This may be 10822 // used to include empty fields in Patch requests. 10823 ForceSendFields []string `json:"-"` 10824 10825 // NullFields is a list of field names (e.g. "Name") to include in API 10826 // requests with the JSON null value. By default, fields with empty 10827 // values are omitted from API requests. However, any field with an 10828 // empty value appearing in NullFields will be sent to the server as 10829 // null. It is an error if a field in this list has a non-empty value. 10830 // This may be used to include null fields in Patch requests. 10831 NullFields []string `json:"-"` 10832} 10833 10834func (s *GoogleCloudVisionV1p4beta1Property) MarshalJSON() ([]byte, error) { 10835 type NoMethod GoogleCloudVisionV1p4beta1Property 10836 raw := NoMethod(*s) 10837 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10838} 10839 10840// GoogleCloudVisionV1p4beta1ReferenceImage: A `ReferenceImage` 10841// represents a product image and its associated metadata, such as 10842// bounding boxes. 10843type GoogleCloudVisionV1p4beta1ReferenceImage struct { 10844 // BoundingPolys: Optional. Bounding polygons around the areas of 10845 // interest in the reference image. If this field is empty, the system 10846 // will try to detect regions of interest. At most 10 bounding polygons 10847 // will be used. The provided shape is converted into a non-rotated 10848 // rectangle. Once converted, the small edge of the rectangle must be 10849 // greater than or equal to 300 pixels. The aspect ratio must be 1:4 or 10850 // less (i.e. 1:3 is ok; 1:5 is not). 10851 BoundingPolys []*GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingPolys,omitempty"` 10852 10853 // Name: The resource name of the reference image. Format is: 10854 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceIma 10855 // ges/IMAGE_ID`. This field is ignored when creating a reference image. 10856 Name string `json:"name,omitempty"` 10857 10858 // Uri: Required. The Google Cloud Storage URI of the reference image. 10859 // The URI must start with `gs://`. 10860 Uri string `json:"uri,omitempty"` 10861 10862 // ForceSendFields is a list of field names (e.g. "BoundingPolys") to 10863 // unconditionally include in API requests. By default, fields with 10864 // empty values are omitted from API requests. However, any non-pointer, 10865 // non-interface field appearing in ForceSendFields will be sent to the 10866 // server regardless of whether the field is empty or not. This may be 10867 // used to include empty fields in Patch requests. 10868 ForceSendFields []string `json:"-"` 10869 10870 // NullFields is a list of field names (e.g. "BoundingPolys") to include 10871 // in API requests with the JSON null value. By default, fields with 10872 // empty values are omitted from API requests. However, any field with 10873 // an empty value appearing in NullFields will be sent to the server as 10874 // null. It is an error if a field in this list has a non-empty value. 10875 // This may be used to include null fields in Patch requests. 10876 NullFields []string `json:"-"` 10877} 10878 10879func (s *GoogleCloudVisionV1p4beta1ReferenceImage) MarshalJSON() ([]byte, error) { 10880 type NoMethod GoogleCloudVisionV1p4beta1ReferenceImage 10881 raw := NoMethod(*s) 10882 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10883} 10884 10885// GoogleCloudVisionV1p4beta1SafeSearchAnnotation: Set of features 10886// pertaining to the image, computed by computer vision methods over 10887// safe-search verticals (for example, adult, spoof, medical, violence). 10888type GoogleCloudVisionV1p4beta1SafeSearchAnnotation struct { 10889 // Adult: Represents the adult content likelihood for the image. Adult 10890 // content may contain elements such as nudity, pornographic images or 10891 // cartoons, or sexual activities. 10892 // 10893 // Possible values: 10894 // "UNKNOWN" - Unknown likelihood. 10895 // "VERY_UNLIKELY" - It is very unlikely. 10896 // "UNLIKELY" - It is unlikely. 10897 // "POSSIBLE" - It is possible. 10898 // "LIKELY" - It is likely. 10899 // "VERY_LIKELY" - It is very likely. 10900 Adult string `json:"adult,omitempty"` 10901 10902 // Medical: Likelihood that this is a medical image. 10903 // 10904 // Possible values: 10905 // "UNKNOWN" - Unknown likelihood. 10906 // "VERY_UNLIKELY" - It is very unlikely. 10907 // "UNLIKELY" - It is unlikely. 10908 // "POSSIBLE" - It is possible. 10909 // "LIKELY" - It is likely. 10910 // "VERY_LIKELY" - It is very likely. 10911 Medical string `json:"medical,omitempty"` 10912 10913 // Racy: Likelihood that the request image contains racy content. Racy 10914 // content may include (but is not limited to) skimpy or sheer clothing, 10915 // strategically covered nudity, lewd or provocative poses, or close-ups 10916 // of sensitive body areas. 10917 // 10918 // Possible values: 10919 // "UNKNOWN" - Unknown likelihood. 10920 // "VERY_UNLIKELY" - It is very unlikely. 10921 // "UNLIKELY" - It is unlikely. 10922 // "POSSIBLE" - It is possible. 10923 // "LIKELY" - It is likely. 10924 // "VERY_LIKELY" - It is very likely. 10925 Racy string `json:"racy,omitempty"` 10926 10927 // Spoof: Spoof likelihood. The likelihood that an modification was made 10928 // to the image's canonical version to make it appear funny or 10929 // offensive. 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 Spoof string `json:"spoof,omitempty"` 10939 10940 // Violence: Likelihood that this image contains violent content. 10941 // 10942 // Possible values: 10943 // "UNKNOWN" - Unknown likelihood. 10944 // "VERY_UNLIKELY" - It is very unlikely. 10945 // "UNLIKELY" - It is unlikely. 10946 // "POSSIBLE" - It is possible. 10947 // "LIKELY" - It is likely. 10948 // "VERY_LIKELY" - It is very likely. 10949 Violence string `json:"violence,omitempty"` 10950 10951 // ForceSendFields is a list of field names (e.g. "Adult") to 10952 // unconditionally include in API requests. By default, fields with 10953 // empty values are omitted from API requests. However, any non-pointer, 10954 // non-interface field appearing in ForceSendFields will be sent to the 10955 // server regardless of whether the field is empty or not. This may be 10956 // used to include empty fields in Patch requests. 10957 ForceSendFields []string `json:"-"` 10958 10959 // NullFields is a list of field names (e.g. "Adult") to include in API 10960 // requests with the JSON null value. By default, fields with empty 10961 // values are omitted from API requests. However, any field with an 10962 // empty value appearing in NullFields will be sent to the server as 10963 // null. It is an error if a field in this list has a non-empty value. 10964 // This may be used to include null fields in Patch requests. 10965 NullFields []string `json:"-"` 10966} 10967 10968func (s *GoogleCloudVisionV1p4beta1SafeSearchAnnotation) MarshalJSON() ([]byte, error) { 10969 type NoMethod GoogleCloudVisionV1p4beta1SafeSearchAnnotation 10970 raw := NoMethod(*s) 10971 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10972} 10973 10974// GoogleCloudVisionV1p4beta1Symbol: A single symbol representation. 10975type GoogleCloudVisionV1p4beta1Symbol struct { 10976 // BoundingBox: The bounding box for the symbol. The vertices are in the 10977 // order of top-left, top-right, bottom-right, bottom-left. When a 10978 // rotation of the bounding box is detected the rotation is represented 10979 // as around the top-left corner as defined when the text is read in the 10980 // 'natural' orientation. For example: * when the text is horizontal it 10981 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 10982 // around the top-left corner it becomes: 2----3 | | 1----0 and the 10983 // vertex order will still be (0, 1, 2, 3). 10984 BoundingBox *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingBox,omitempty"` 10985 10986 // Confidence: Confidence of the OCR results for the symbol. Range [0, 10987 // 1]. 10988 Confidence float64 `json:"confidence,omitempty"` 10989 10990 // Property: Additional information detected for the symbol. 10991 Property *GoogleCloudVisionV1p4beta1TextAnnotationTextProperty `json:"property,omitempty"` 10992 10993 // Text: The actual UTF-8 representation of the symbol. 10994 Text string `json:"text,omitempty"` 10995 10996 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 10997 // unconditionally include in API requests. By default, fields with 10998 // empty values are omitted from API requests. However, any non-pointer, 10999 // non-interface field appearing in ForceSendFields will be sent to the 11000 // server regardless of whether the field is empty or not. This may be 11001 // used to include empty fields in Patch requests. 11002 ForceSendFields []string `json:"-"` 11003 11004 // NullFields is a list of field names (e.g. "BoundingBox") to include 11005 // in API requests with the JSON null value. By default, fields with 11006 // empty values are omitted from API requests. However, any field with 11007 // an empty value appearing in NullFields will be sent to the server as 11008 // null. It is an error if a field in this list has a non-empty value. 11009 // This may be used to include null fields in Patch requests. 11010 NullFields []string `json:"-"` 11011} 11012 11013func (s *GoogleCloudVisionV1p4beta1Symbol) MarshalJSON() ([]byte, error) { 11014 type NoMethod GoogleCloudVisionV1p4beta1Symbol 11015 raw := NoMethod(*s) 11016 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11017} 11018 11019func (s *GoogleCloudVisionV1p4beta1Symbol) UnmarshalJSON(data []byte) error { 11020 type NoMethod GoogleCloudVisionV1p4beta1Symbol 11021 var s1 struct { 11022 Confidence gensupport.JSONFloat64 `json:"confidence"` 11023 *NoMethod 11024 } 11025 s1.NoMethod = (*NoMethod)(s) 11026 if err := json.Unmarshal(data, &s1); err != nil { 11027 return err 11028 } 11029 s.Confidence = float64(s1.Confidence) 11030 return nil 11031} 11032 11033// GoogleCloudVisionV1p4beta1TextAnnotation: TextAnnotation contains a 11034// structured representation of OCR extracted text. The hierarchy of an 11035// OCR extracted text structure is like this: TextAnnotation -> Page -> 11036// Block -> Paragraph -> Word -> Symbol Each structural component, 11037// starting from Page, may further have their own properties. Properties 11038// describe detected languages, breaks etc.. Please refer to the 11039// TextAnnotation.TextProperty message definition below for more detail. 11040type GoogleCloudVisionV1p4beta1TextAnnotation struct { 11041 // Pages: List of pages detected by OCR. 11042 Pages []*GoogleCloudVisionV1p4beta1Page `json:"pages,omitempty"` 11043 11044 // Text: UTF-8 text detected on the pages. 11045 Text string `json:"text,omitempty"` 11046 11047 // ForceSendFields is a list of field names (e.g. "Pages") to 11048 // unconditionally include in API requests. By default, fields with 11049 // empty values are omitted from API requests. However, any non-pointer, 11050 // non-interface field appearing in ForceSendFields will be sent to the 11051 // server regardless of whether the field is empty or not. This may be 11052 // used to include empty fields in Patch requests. 11053 ForceSendFields []string `json:"-"` 11054 11055 // NullFields is a list of field names (e.g. "Pages") to include in API 11056 // requests with the JSON null value. By default, fields with empty 11057 // values are omitted from API requests. However, any field with an 11058 // empty value appearing in NullFields will be sent to the server as 11059 // null. It is an error if a field in this list has a non-empty value. 11060 // This may be used to include null fields in Patch requests. 11061 NullFields []string `json:"-"` 11062} 11063 11064func (s *GoogleCloudVisionV1p4beta1TextAnnotation) MarshalJSON() ([]byte, error) { 11065 type NoMethod GoogleCloudVisionV1p4beta1TextAnnotation 11066 raw := NoMethod(*s) 11067 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11068} 11069 11070// GoogleCloudVisionV1p4beta1TextAnnotationDetectedBreak: Detected start 11071// or end of a structural component. 11072type GoogleCloudVisionV1p4beta1TextAnnotationDetectedBreak struct { 11073 // IsPrefix: True if break prepends the element. 11074 IsPrefix bool `json:"isPrefix,omitempty"` 11075 11076 // Type: Detected break type. 11077 // 11078 // Possible values: 11079 // "UNKNOWN" - Unknown break label type. 11080 // "SPACE" - Regular space. 11081 // "SURE_SPACE" - Sure space (very wide). 11082 // "EOL_SURE_SPACE" - Line-wrapping break. 11083 // "HYPHEN" - End-line hyphen that is not present in text; does not 11084 // co-occur with `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. 11085 // "LINE_BREAK" - Line break that ends a paragraph. 11086 Type string `json:"type,omitempty"` 11087 11088 // ForceSendFields is a list of field names (e.g. "IsPrefix") to 11089 // unconditionally include in API requests. By default, fields with 11090 // empty values are omitted from API requests. However, any non-pointer, 11091 // non-interface field appearing in ForceSendFields will be sent to the 11092 // server regardless of whether the field is empty or not. This may be 11093 // used to include empty fields in Patch requests. 11094 ForceSendFields []string `json:"-"` 11095 11096 // NullFields is a list of field names (e.g. "IsPrefix") to include in 11097 // API requests with the JSON null value. By default, fields with empty 11098 // values are omitted from API requests. However, any field with an 11099 // empty value appearing in NullFields will be sent to the server as 11100 // null. It is an error if a field in this list has a non-empty value. 11101 // This may be used to include null fields in Patch requests. 11102 NullFields []string `json:"-"` 11103} 11104 11105func (s *GoogleCloudVisionV1p4beta1TextAnnotationDetectedBreak) MarshalJSON() ([]byte, error) { 11106 type NoMethod GoogleCloudVisionV1p4beta1TextAnnotationDetectedBreak 11107 raw := NoMethod(*s) 11108 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11109} 11110 11111// GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage: Detected 11112// language for a structural component. 11113type GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage struct { 11114 // Confidence: Confidence of detected language. Range [0, 1]. 11115 Confidence float64 `json:"confidence,omitempty"` 11116 11117 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". 11118 // For more information, see 11119 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 11120 LanguageCode string `json:"languageCode,omitempty"` 11121 11122 // ForceSendFields is a list of field names (e.g. "Confidence") to 11123 // unconditionally include in API requests. By default, fields with 11124 // empty values are omitted from API requests. However, any non-pointer, 11125 // non-interface field appearing in ForceSendFields will be sent to the 11126 // server regardless of whether the field is empty or not. This may be 11127 // used to include empty fields in Patch requests. 11128 ForceSendFields []string `json:"-"` 11129 11130 // NullFields is a list of field names (e.g. "Confidence") to include in 11131 // API requests with the JSON null value. By default, fields with empty 11132 // values are omitted from API requests. However, any field with an 11133 // empty value appearing in NullFields will be sent to the server as 11134 // null. It is an error if a field in this list has a non-empty value. 11135 // This may be used to include null fields in Patch requests. 11136 NullFields []string `json:"-"` 11137} 11138 11139func (s *GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage) MarshalJSON() ([]byte, error) { 11140 type NoMethod GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage 11141 raw := NoMethod(*s) 11142 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11143} 11144 11145func (s *GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage) UnmarshalJSON(data []byte) error { 11146 type NoMethod GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage 11147 var s1 struct { 11148 Confidence gensupport.JSONFloat64 `json:"confidence"` 11149 *NoMethod 11150 } 11151 s1.NoMethod = (*NoMethod)(s) 11152 if err := json.Unmarshal(data, &s1); err != nil { 11153 return err 11154 } 11155 s.Confidence = float64(s1.Confidence) 11156 return nil 11157} 11158 11159// GoogleCloudVisionV1p4beta1TextAnnotationTextProperty: Additional 11160// information detected on the structural component. 11161type GoogleCloudVisionV1p4beta1TextAnnotationTextProperty struct { 11162 // DetectedBreak: Detected start or end of a text segment. 11163 DetectedBreak *GoogleCloudVisionV1p4beta1TextAnnotationDetectedBreak `json:"detectedBreak,omitempty"` 11164 11165 // DetectedLanguages: A list of detected languages together with 11166 // confidence. 11167 DetectedLanguages []*GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage `json:"detectedLanguages,omitempty"` 11168 11169 // ForceSendFields is a list of field names (e.g. "DetectedBreak") to 11170 // unconditionally include in API requests. By default, fields with 11171 // empty values are omitted from API requests. However, any non-pointer, 11172 // non-interface field appearing in ForceSendFields will be sent to the 11173 // server regardless of whether the field is empty or not. This may be 11174 // used to include empty fields in Patch requests. 11175 ForceSendFields []string `json:"-"` 11176 11177 // NullFields is a list of field names (e.g. "DetectedBreak") to include 11178 // in API requests with the JSON null value. By default, fields with 11179 // empty values are omitted from API requests. However, any field with 11180 // an empty value appearing in NullFields will be sent to the server as 11181 // null. It is an error if a field in this list has a non-empty value. 11182 // This may be used to include null fields in Patch requests. 11183 NullFields []string `json:"-"` 11184} 11185 11186func (s *GoogleCloudVisionV1p4beta1TextAnnotationTextProperty) MarshalJSON() ([]byte, error) { 11187 type NoMethod GoogleCloudVisionV1p4beta1TextAnnotationTextProperty 11188 raw := NoMethod(*s) 11189 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11190} 11191 11192// GoogleCloudVisionV1p4beta1Vertex: A vertex represents a 2D point in 11193// the image. NOTE: the vertex coordinates are in the same scale as the 11194// original image. 11195type GoogleCloudVisionV1p4beta1Vertex struct { 11196 // X: X coordinate. 11197 X int64 `json:"x,omitempty"` 11198 11199 // Y: Y coordinate. 11200 Y int64 `json:"y,omitempty"` 11201 11202 // ForceSendFields is a list of field names (e.g. "X") to 11203 // unconditionally include in API requests. By default, fields with 11204 // empty values are omitted from API requests. However, any non-pointer, 11205 // non-interface field appearing in ForceSendFields will be sent to the 11206 // server regardless of whether the field is empty or not. This may be 11207 // used to include empty fields in Patch requests. 11208 ForceSendFields []string `json:"-"` 11209 11210 // NullFields is a list of field names (e.g. "X") to include in API 11211 // requests with the JSON null value. By default, fields with empty 11212 // values are omitted from API requests. However, any field with an 11213 // empty value appearing in NullFields will be sent to the server as 11214 // null. It is an error if a field in this list has a non-empty value. 11215 // This may be used to include null fields in Patch requests. 11216 NullFields []string `json:"-"` 11217} 11218 11219func (s *GoogleCloudVisionV1p4beta1Vertex) MarshalJSON() ([]byte, error) { 11220 type NoMethod GoogleCloudVisionV1p4beta1Vertex 11221 raw := NoMethod(*s) 11222 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11223} 11224 11225// GoogleCloudVisionV1p4beta1WebDetection: Relevant information for the 11226// image from the Internet. 11227type GoogleCloudVisionV1p4beta1WebDetection struct { 11228 // BestGuessLabels: The service's best guess as to the topic of the 11229 // request image. Inferred from similar images on the open web. 11230 BestGuessLabels []*GoogleCloudVisionV1p4beta1WebDetectionWebLabel `json:"bestGuessLabels,omitempty"` 11231 11232 // FullMatchingImages: Fully matching images from the Internet. Can 11233 // include resized copies of the query image. 11234 FullMatchingImages []*GoogleCloudVisionV1p4beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"` 11235 11236 // PagesWithMatchingImages: Web pages containing the matching images 11237 // from the Internet. 11238 PagesWithMatchingImages []*GoogleCloudVisionV1p4beta1WebDetectionWebPage `json:"pagesWithMatchingImages,omitempty"` 11239 11240 // PartialMatchingImages: Partial matching images from the Internet. 11241 // Those images are similar enough to share some key-point features. For 11242 // example an original image will likely have partial matching for its 11243 // crops. 11244 PartialMatchingImages []*GoogleCloudVisionV1p4beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"` 11245 11246 // VisuallySimilarImages: The visually similar image results. 11247 VisuallySimilarImages []*GoogleCloudVisionV1p4beta1WebDetectionWebImage `json:"visuallySimilarImages,omitempty"` 11248 11249 // WebEntities: Deduced entities from similar images on the Internet. 11250 WebEntities []*GoogleCloudVisionV1p4beta1WebDetectionWebEntity `json:"webEntities,omitempty"` 11251 11252 // ForceSendFields is a list of field names (e.g. "BestGuessLabels") to 11253 // unconditionally include in API requests. By default, fields with 11254 // empty values are omitted from API requests. However, any non-pointer, 11255 // non-interface field appearing in ForceSendFields will be sent to the 11256 // server regardless of whether the field is empty or not. This may be 11257 // used to include empty fields in Patch requests. 11258 ForceSendFields []string `json:"-"` 11259 11260 // NullFields is a list of field names (e.g. "BestGuessLabels") to 11261 // include in API requests with the JSON null value. By default, fields 11262 // with empty values are omitted from API requests. However, any field 11263 // with an empty value appearing in NullFields will be sent to the 11264 // server as null. It is an error if a field in this list has a 11265 // non-empty value. This may be used to include null fields in Patch 11266 // requests. 11267 NullFields []string `json:"-"` 11268} 11269 11270func (s *GoogleCloudVisionV1p4beta1WebDetection) MarshalJSON() ([]byte, error) { 11271 type NoMethod GoogleCloudVisionV1p4beta1WebDetection 11272 raw := NoMethod(*s) 11273 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11274} 11275 11276// GoogleCloudVisionV1p4beta1WebDetectionWebEntity: Entity deduced from 11277// similar images on the Internet. 11278type GoogleCloudVisionV1p4beta1WebDetectionWebEntity struct { 11279 // Description: Canonical description of the entity, in English. 11280 Description string `json:"description,omitempty"` 11281 11282 // EntityId: Opaque entity ID. 11283 EntityId string `json:"entityId,omitempty"` 11284 11285 // Score: Overall relevancy score for the entity. Not normalized and not 11286 // comparable across different image queries. 11287 Score float64 `json:"score,omitempty"` 11288 11289 // ForceSendFields is a list of field names (e.g. "Description") to 11290 // unconditionally include in API requests. By default, fields with 11291 // empty values are omitted from API requests. However, any non-pointer, 11292 // non-interface field appearing in ForceSendFields will be sent to the 11293 // server regardless of whether the field is empty or not. This may be 11294 // used to include empty fields in Patch requests. 11295 ForceSendFields []string `json:"-"` 11296 11297 // NullFields is a list of field names (e.g. "Description") to include 11298 // in API requests with the JSON null value. By default, fields with 11299 // empty values are omitted from API requests. However, any field with 11300 // an empty value appearing in NullFields will be sent to the server as 11301 // null. It is an error if a field in this list has a non-empty value. 11302 // This may be used to include null fields in Patch requests. 11303 NullFields []string `json:"-"` 11304} 11305 11306func (s *GoogleCloudVisionV1p4beta1WebDetectionWebEntity) MarshalJSON() ([]byte, error) { 11307 type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebEntity 11308 raw := NoMethod(*s) 11309 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11310} 11311 11312func (s *GoogleCloudVisionV1p4beta1WebDetectionWebEntity) UnmarshalJSON(data []byte) error { 11313 type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebEntity 11314 var s1 struct { 11315 Score gensupport.JSONFloat64 `json:"score"` 11316 *NoMethod 11317 } 11318 s1.NoMethod = (*NoMethod)(s) 11319 if err := json.Unmarshal(data, &s1); err != nil { 11320 return err 11321 } 11322 s.Score = float64(s1.Score) 11323 return nil 11324} 11325 11326// GoogleCloudVisionV1p4beta1WebDetectionWebImage: Metadata for online 11327// images. 11328type GoogleCloudVisionV1p4beta1WebDetectionWebImage struct { 11329 // Score: (Deprecated) Overall relevancy score for the image. 11330 Score float64 `json:"score,omitempty"` 11331 11332 // Url: The result image URL. 11333 Url string `json:"url,omitempty"` 11334 11335 // ForceSendFields is a list of field names (e.g. "Score") to 11336 // unconditionally include in API requests. By default, fields with 11337 // empty values are omitted from API requests. However, any non-pointer, 11338 // non-interface field appearing in ForceSendFields will be sent to the 11339 // server regardless of whether the field is empty or not. This may be 11340 // used to include empty fields in Patch requests. 11341 ForceSendFields []string `json:"-"` 11342 11343 // NullFields is a list of field names (e.g. "Score") to include in API 11344 // requests with the JSON null value. By default, fields with empty 11345 // values are omitted from API requests. However, any field with an 11346 // empty value appearing in NullFields will be sent to the server as 11347 // null. It is an error if a field in this list has a non-empty value. 11348 // This may be used to include null fields in Patch requests. 11349 NullFields []string `json:"-"` 11350} 11351 11352func (s *GoogleCloudVisionV1p4beta1WebDetectionWebImage) MarshalJSON() ([]byte, error) { 11353 type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebImage 11354 raw := NoMethod(*s) 11355 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11356} 11357 11358func (s *GoogleCloudVisionV1p4beta1WebDetectionWebImage) UnmarshalJSON(data []byte) error { 11359 type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebImage 11360 var s1 struct { 11361 Score gensupport.JSONFloat64 `json:"score"` 11362 *NoMethod 11363 } 11364 s1.NoMethod = (*NoMethod)(s) 11365 if err := json.Unmarshal(data, &s1); err != nil { 11366 return err 11367 } 11368 s.Score = float64(s1.Score) 11369 return nil 11370} 11371 11372// GoogleCloudVisionV1p4beta1WebDetectionWebLabel: Label to provide 11373// extra metadata for the web detection. 11374type GoogleCloudVisionV1p4beta1WebDetectionWebLabel struct { 11375 // Label: Label for extra metadata. 11376 Label string `json:"label,omitempty"` 11377 11378 // LanguageCode: The BCP-47 language code for `label`, such as "en-US" 11379 // or "sr-Latn". For more information, see 11380 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 11381 LanguageCode string `json:"languageCode,omitempty"` 11382 11383 // ForceSendFields is a list of field names (e.g. "Label") to 11384 // unconditionally include in API requests. By default, fields with 11385 // empty values are omitted from API requests. However, any non-pointer, 11386 // non-interface field appearing in ForceSendFields will be sent to the 11387 // server regardless of whether the field is empty or not. This may be 11388 // used to include empty fields in Patch requests. 11389 ForceSendFields []string `json:"-"` 11390 11391 // NullFields is a list of field names (e.g. "Label") to include in API 11392 // requests with the JSON null value. By default, fields with empty 11393 // values are omitted from API requests. However, any field with an 11394 // empty value appearing in NullFields will be sent to the server as 11395 // null. It is an error if a field in this list has a non-empty value. 11396 // This may be used to include null fields in Patch requests. 11397 NullFields []string `json:"-"` 11398} 11399 11400func (s *GoogleCloudVisionV1p4beta1WebDetectionWebLabel) MarshalJSON() ([]byte, error) { 11401 type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebLabel 11402 raw := NoMethod(*s) 11403 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11404} 11405 11406// GoogleCloudVisionV1p4beta1WebDetectionWebPage: Metadata for web 11407// pages. 11408type GoogleCloudVisionV1p4beta1WebDetectionWebPage struct { 11409 // FullMatchingImages: Fully matching images on the page. Can include 11410 // resized copies of the query image. 11411 FullMatchingImages []*GoogleCloudVisionV1p4beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"` 11412 11413 // PageTitle: Title for the web page, may contain HTML markups. 11414 PageTitle string `json:"pageTitle,omitempty"` 11415 11416 // PartialMatchingImages: Partial matching images on the page. Those 11417 // images are similar enough to share some key-point features. For 11418 // example an original image will likely have partial matching for its 11419 // crops. 11420 PartialMatchingImages []*GoogleCloudVisionV1p4beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"` 11421 11422 // Score: (Deprecated) Overall relevancy score for the web page. 11423 Score float64 `json:"score,omitempty"` 11424 11425 // Url: The result web page URL. 11426 Url string `json:"url,omitempty"` 11427 11428 // ForceSendFields is a list of field names (e.g. "FullMatchingImages") 11429 // to unconditionally include in API requests. By default, fields with 11430 // empty values are omitted from API requests. However, any non-pointer, 11431 // non-interface field appearing in ForceSendFields will be sent to the 11432 // server regardless of whether the field is empty or not. This may be 11433 // used to include empty fields in Patch requests. 11434 ForceSendFields []string `json:"-"` 11435 11436 // NullFields is a list of field names (e.g. "FullMatchingImages") to 11437 // include in API requests with the JSON null value. By default, fields 11438 // with empty values are omitted from API requests. However, any field 11439 // with an empty value appearing in NullFields will be sent to the 11440 // server as null. It is an error if a field in this list has a 11441 // non-empty value. This may be used to include null fields in Patch 11442 // requests. 11443 NullFields []string `json:"-"` 11444} 11445 11446func (s *GoogleCloudVisionV1p4beta1WebDetectionWebPage) MarshalJSON() ([]byte, error) { 11447 type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebPage 11448 raw := NoMethod(*s) 11449 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11450} 11451 11452func (s *GoogleCloudVisionV1p4beta1WebDetectionWebPage) UnmarshalJSON(data []byte) error { 11453 type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebPage 11454 var s1 struct { 11455 Score gensupport.JSONFloat64 `json:"score"` 11456 *NoMethod 11457 } 11458 s1.NoMethod = (*NoMethod)(s) 11459 if err := json.Unmarshal(data, &s1); err != nil { 11460 return err 11461 } 11462 s.Score = float64(s1.Score) 11463 return nil 11464} 11465 11466// GoogleCloudVisionV1p4beta1Word: A word representation. 11467type GoogleCloudVisionV1p4beta1Word struct { 11468 // BoundingBox: The bounding box for the word. The vertices are in the 11469 // order of top-left, top-right, bottom-right, bottom-left. When a 11470 // rotation of the bounding box is detected the rotation is represented 11471 // as around the top-left corner as defined when the text is read in the 11472 // 'natural' orientation. For example: * when the text is horizontal it 11473 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 11474 // around the top-left corner it becomes: 2----3 | | 1----0 and the 11475 // vertex order will still be (0, 1, 2, 3). 11476 BoundingBox *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingBox,omitempty"` 11477 11478 // Confidence: Confidence of the OCR results for the word. Range [0, 1]. 11479 Confidence float64 `json:"confidence,omitempty"` 11480 11481 // Property: Additional information detected for the word. 11482 Property *GoogleCloudVisionV1p4beta1TextAnnotationTextProperty `json:"property,omitempty"` 11483 11484 // Symbols: List of symbols in the word. The order of the symbols 11485 // follows the natural reading order. 11486 Symbols []*GoogleCloudVisionV1p4beta1Symbol `json:"symbols,omitempty"` 11487 11488 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 11489 // unconditionally include in API requests. By default, fields with 11490 // empty values are omitted from API requests. However, any non-pointer, 11491 // non-interface field appearing in ForceSendFields will be sent to the 11492 // server regardless of whether the field is empty or not. This may be 11493 // used to include empty fields in Patch requests. 11494 ForceSendFields []string `json:"-"` 11495 11496 // NullFields is a list of field names (e.g. "BoundingBox") to include 11497 // in API requests with the JSON null value. By default, fields with 11498 // empty values are omitted from API requests. However, any field with 11499 // an empty value appearing in NullFields will be sent to the server as 11500 // null. It is an error if a field in this list has a non-empty value. 11501 // This may be used to include null fields in Patch requests. 11502 NullFields []string `json:"-"` 11503} 11504 11505func (s *GoogleCloudVisionV1p4beta1Word) MarshalJSON() ([]byte, error) { 11506 type NoMethod GoogleCloudVisionV1p4beta1Word 11507 raw := NoMethod(*s) 11508 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11509} 11510 11511func (s *GoogleCloudVisionV1p4beta1Word) UnmarshalJSON(data []byte) error { 11512 type NoMethod GoogleCloudVisionV1p4beta1Word 11513 var s1 struct { 11514 Confidence gensupport.JSONFloat64 `json:"confidence"` 11515 *NoMethod 11516 } 11517 s1.NoMethod = (*NoMethod)(s) 11518 if err := json.Unmarshal(data, &s1); err != nil { 11519 return err 11520 } 11521 s.Confidence = float64(s1.Confidence) 11522 return nil 11523} 11524 11525// GroupedResult: Information about the products similar to a single 11526// product in a query image. 11527type GroupedResult struct { 11528 // BoundingPoly: The bounding polygon around the product detected in the 11529 // query image. 11530 BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"` 11531 11532 // ObjectAnnotations: List of generic predictions for the object in the 11533 // bounding box. 11534 ObjectAnnotations []*ObjectAnnotation `json:"objectAnnotations,omitempty"` 11535 11536 // Results: List of results, one for each product match. 11537 Results []*Result `json:"results,omitempty"` 11538 11539 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 11540 // unconditionally include in API requests. By default, fields with 11541 // empty values are omitted from API requests. However, any non-pointer, 11542 // non-interface field appearing in ForceSendFields will be sent to the 11543 // server regardless of whether the field is empty or not. This may be 11544 // used to include empty fields in Patch requests. 11545 ForceSendFields []string `json:"-"` 11546 11547 // NullFields is a list of field names (e.g. "BoundingPoly") to include 11548 // in API requests with the JSON null value. By default, fields with 11549 // empty values are omitted from API requests. However, any field with 11550 // an empty value appearing in NullFields will be sent to the server as 11551 // null. It is an error if a field in this list has a non-empty value. 11552 // This may be used to include null fields in Patch requests. 11553 NullFields []string `json:"-"` 11554} 11555 11556func (s *GroupedResult) MarshalJSON() ([]byte, error) { 11557 type NoMethod GroupedResult 11558 raw := NoMethod(*s) 11559 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11560} 11561 11562// Image: Client image to perform Google Cloud Vision API tasks over. 11563type Image struct { 11564 // Content: Image content, represented as a stream of bytes. Note: As 11565 // with all `bytes` fields, protobuffers use a pure binary 11566 // representation, whereas JSON representations use base64. Currently, 11567 // this field only works for BatchAnnotateImages requests. It does not 11568 // work for AsyncBatchAnnotateImages requests. 11569 Content string `json:"content,omitempty"` 11570 11571 // Source: Google Cloud Storage image location, or publicly-accessible 11572 // image URL. If both `content` and `source` are provided for an image, 11573 // `content` takes precedence and is used to perform the image 11574 // annotation request. 11575 Source *ImageSource `json:"source,omitempty"` 11576 11577 // ForceSendFields is a list of field names (e.g. "Content") to 11578 // unconditionally include in API requests. By default, fields with 11579 // empty values are omitted from API requests. However, any non-pointer, 11580 // non-interface field appearing in ForceSendFields will be sent to the 11581 // server regardless of whether the field is empty or not. This may be 11582 // used to include empty fields in Patch requests. 11583 ForceSendFields []string `json:"-"` 11584 11585 // NullFields is a list of field names (e.g. "Content") to include in 11586 // API requests with the JSON null value. By default, fields with empty 11587 // values are omitted from API requests. However, any field with an 11588 // empty value appearing in NullFields will be sent to the server as 11589 // null. It is an error if a field in this list has a non-empty value. 11590 // This may be used to include null fields in Patch requests. 11591 NullFields []string `json:"-"` 11592} 11593 11594func (s *Image) MarshalJSON() ([]byte, error) { 11595 type NoMethod Image 11596 raw := NoMethod(*s) 11597 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11598} 11599 11600// ImageAnnotationContext: If an image was produced from a file (e.g. a 11601// PDF), this message gives information about the source of that image. 11602type ImageAnnotationContext struct { 11603 // PageNumber: If the file was a PDF or TIFF, this field gives the page 11604 // number within the file used to produce the image. 11605 PageNumber int64 `json:"pageNumber,omitempty"` 11606 11607 // Uri: The URI of the file used to produce the image. 11608 Uri string `json:"uri,omitempty"` 11609 11610 // ForceSendFields is a list of field names (e.g. "PageNumber") to 11611 // unconditionally include in API requests. By default, fields with 11612 // empty values are omitted from API requests. However, any non-pointer, 11613 // non-interface field appearing in ForceSendFields will be sent to the 11614 // server regardless of whether the field is empty or not. This may be 11615 // used to include empty fields in Patch requests. 11616 ForceSendFields []string `json:"-"` 11617 11618 // NullFields is a list of field names (e.g. "PageNumber") to include in 11619 // API requests with the JSON null value. By default, fields with empty 11620 // values are omitted from API requests. However, any field with an 11621 // empty value appearing in NullFields will be sent to the server as 11622 // null. It is an error if a field in this list has a non-empty value. 11623 // This may be used to include null fields in Patch requests. 11624 NullFields []string `json:"-"` 11625} 11626 11627func (s *ImageAnnotationContext) MarshalJSON() ([]byte, error) { 11628 type NoMethod ImageAnnotationContext 11629 raw := NoMethod(*s) 11630 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11631} 11632 11633// ImageContext: Image context and/or feature-specific parameters. 11634type ImageContext struct { 11635 // CropHintsParams: Parameters for crop hints annotation request. 11636 CropHintsParams *CropHintsParams `json:"cropHintsParams,omitempty"` 11637 11638 // LanguageHints: List of languages to use for TEXT_DETECTION. In most 11639 // cases, an empty value yields the best results since it enables 11640 // automatic language detection. For languages based on the Latin 11641 // alphabet, setting `language_hints` is not needed. In rare cases, when 11642 // the language of the text in the image is known, setting a hint will 11643 // help get better results (although it will be a significant hindrance 11644 // if the hint is wrong). Text detection returns an error if one or more 11645 // of the specified languages is not one of the [supported 11646 // languages](https://cloud.google.com/vision/docs/languages). 11647 LanguageHints []string `json:"languageHints,omitempty"` 11648 11649 // LatLongRect: Not used. 11650 LatLongRect *LatLongRect `json:"latLongRect,omitempty"` 11651 11652 // ProductSearchParams: Parameters for product search. 11653 ProductSearchParams *ProductSearchParams `json:"productSearchParams,omitempty"` 11654 11655 // WebDetectionParams: Parameters for web detection. 11656 WebDetectionParams *WebDetectionParams `json:"webDetectionParams,omitempty"` 11657 11658 // ForceSendFields is a list of field names (e.g. "CropHintsParams") to 11659 // unconditionally include in API requests. By default, fields with 11660 // empty values are omitted from API requests. However, any non-pointer, 11661 // non-interface field appearing in ForceSendFields will be sent to the 11662 // server regardless of whether the field is empty or not. This may be 11663 // used to include empty fields in Patch requests. 11664 ForceSendFields []string `json:"-"` 11665 11666 // NullFields is a list of field names (e.g. "CropHintsParams") to 11667 // include in API requests with the JSON null value. By default, fields 11668 // with empty values are omitted from API requests. However, any field 11669 // with an empty value appearing in NullFields will be sent to the 11670 // server as null. It is an error if a field in this list has a 11671 // non-empty value. This may be used to include null fields in Patch 11672 // requests. 11673 NullFields []string `json:"-"` 11674} 11675 11676func (s *ImageContext) MarshalJSON() ([]byte, error) { 11677 type NoMethod ImageContext 11678 raw := NoMethod(*s) 11679 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11680} 11681 11682// ImageProperties: Stores image properties, such as dominant colors. 11683type ImageProperties struct { 11684 // DominantColors: If present, dominant colors completed successfully. 11685 DominantColors *DominantColorsAnnotation `json:"dominantColors,omitempty"` 11686 11687 // ForceSendFields is a list of field names (e.g. "DominantColors") to 11688 // unconditionally include in API requests. By default, fields with 11689 // empty values are omitted from API requests. However, any non-pointer, 11690 // non-interface field appearing in ForceSendFields will be sent to the 11691 // server regardless of whether the field is empty or not. This may be 11692 // used to include empty fields in Patch requests. 11693 ForceSendFields []string `json:"-"` 11694 11695 // NullFields is a list of field names (e.g. "DominantColors") to 11696 // include in API requests with the JSON null value. By default, fields 11697 // with empty values are omitted from API requests. However, any field 11698 // with an empty value appearing in NullFields will be sent to the 11699 // server as null. It is an error if a field in this list has a 11700 // non-empty value. This may be used to include null fields in Patch 11701 // requests. 11702 NullFields []string `json:"-"` 11703} 11704 11705func (s *ImageProperties) MarshalJSON() ([]byte, error) { 11706 type NoMethod ImageProperties 11707 raw := NoMethod(*s) 11708 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11709} 11710 11711// ImageSource: External image source (Google Cloud Storage or web URL 11712// image location). 11713type ImageSource struct { 11714 // GcsImageUri: **Use `image_uri` instead.** The Google Cloud Storage 11715 // URI of the form `gs://bucket_name/object_name`. Object versioning is 11716 // not supported. See [Google Cloud Storage Request 11717 // URIs](https://cloud.google.com/storage/docs/reference-uris) for more 11718 // info. 11719 GcsImageUri string `json:"gcsImageUri,omitempty"` 11720 11721 // ImageUri: The URI of the source image. Can be either: 1. A Google 11722 // Cloud Storage URI of the form `gs://bucket_name/object_name`. Object 11723 // versioning is not supported. See [Google Cloud Storage Request 11724 // URIs](https://cloud.google.com/storage/docs/reference-uris) for more 11725 // info. 2. A publicly-accessible image HTTP/HTTPS URL. When fetching 11726 // images from HTTP/HTTPS URLs, Google cannot guarantee that the request 11727 // will be completed. Your request may fail if the specified host denies 11728 // the request (e.g. due to request throttling or DOS prevention), or if 11729 // Google throttles requests to the site for abuse prevention. You 11730 // should not depend on externally-hosted images for production 11731 // applications. When both `gcs_image_uri` and `image_uri` are 11732 // specified, `image_uri` takes precedence. 11733 ImageUri string `json:"imageUri,omitempty"` 11734 11735 // ForceSendFields is a list of field names (e.g. "GcsImageUri") to 11736 // unconditionally include in API requests. By default, fields with 11737 // empty values are omitted from API requests. However, any non-pointer, 11738 // non-interface field appearing in ForceSendFields will be sent to the 11739 // server regardless of whether the field is empty or not. This may be 11740 // used to include empty fields in Patch requests. 11741 ForceSendFields []string `json:"-"` 11742 11743 // NullFields is a list of field names (e.g. "GcsImageUri") to include 11744 // in API requests with the JSON null value. By default, fields with 11745 // empty values are omitted from API requests. However, any field with 11746 // an empty value appearing in NullFields will be sent to the server as 11747 // null. It is an error if a field in this list has a non-empty value. 11748 // This may be used to include null fields in Patch requests. 11749 NullFields []string `json:"-"` 11750} 11751 11752func (s *ImageSource) MarshalJSON() ([]byte, error) { 11753 type NoMethod ImageSource 11754 raw := NoMethod(*s) 11755 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11756} 11757 11758// ImportProductSetsGcsSource: The Google Cloud Storage location for a 11759// csv file which preserves a list of ImportProductSetRequests in each 11760// line. 11761type ImportProductSetsGcsSource struct { 11762 // CsvFileUri: The Google Cloud Storage URI of the input csv file. The 11763 // URI must start with `gs://`. The format of the input csv file should 11764 // be one image per line. In each line, there are 8 columns. 1. 11765 // image-uri 2. image-id 3. product-set-id 4. product-id 5. 11766 // product-category 6. product-display-name 7. labels 8. bounding-poly 11767 // The `image-uri`, `product-set-id`, `product-id`, and 11768 // `product-category` columns are required. All other columns are 11769 // optional. If the `ProductSet` or `Product` specified by the 11770 // `product-set-id` and `product-id` values does not exist, then the 11771 // system will create a new `ProductSet` or `Product` for the image. In 11772 // this case, the `product-display-name` column refers to display_name, 11773 // the `product-category` column refers to product_category, and the 11774 // `labels` column refers to product_labels. The `image-id` column is 11775 // optional but must be unique if provided. If it is empty, the system 11776 // will automatically assign a unique id to the image. The 11777 // `product-display-name` column is optional. If it is empty, the system 11778 // sets the display_name field for the product to a space (" "). You can 11779 // update the `display_name` later by using the API. If a `Product` with 11780 // the specified `product-id` already exists, then the system ignores 11781 // the `product-display-name`, `product-category`, and `labels` columns. 11782 // The `labels` column (optional) is a line containing a list of 11783 // comma-separated key-value pairs, in the following format: 11784 // "key_1=value_1,key_2=value_2,...,key_n=value_n" The `bounding-poly` 11785 // column (optional) identifies one region of interest from the image in 11786 // the same manner as `CreateReferenceImage`. If you do not specify the 11787 // `bounding-poly` column, then the system will try to detect regions of 11788 // interest automatically. At most one `bounding-poly` column is allowed 11789 // per line. If the image contains multiple regions of interest, add a 11790 // line to the CSV file that includes the same product information, and 11791 // the `bounding-poly` values for each region of interest. The 11792 // `bounding-poly` column must contain an even number of comma-separated 11793 // numbers, in the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use 11794 // non-negative integers for absolute bounding polygons, and float 11795 // values in [0, 1] for normalized bounding polygons. The system will 11796 // resize the image if the image resolution is too large to process 11797 // (larger than 20MP). 11798 CsvFileUri string `json:"csvFileUri,omitempty"` 11799 11800 // ForceSendFields is a list of field names (e.g. "CsvFileUri") to 11801 // unconditionally include in API requests. By default, fields with 11802 // empty values are omitted from API requests. However, any non-pointer, 11803 // non-interface field appearing in ForceSendFields will be sent to the 11804 // server regardless of whether the field is empty or not. This may be 11805 // used to include empty fields in Patch requests. 11806 ForceSendFields []string `json:"-"` 11807 11808 // NullFields is a list of field names (e.g. "CsvFileUri") to include in 11809 // API requests with the JSON null value. By default, fields with empty 11810 // values are omitted from API requests. However, any field with an 11811 // empty value appearing in NullFields will be sent to the server as 11812 // null. It is an error if a field in this list has a non-empty value. 11813 // This may be used to include null fields in Patch requests. 11814 NullFields []string `json:"-"` 11815} 11816 11817func (s *ImportProductSetsGcsSource) MarshalJSON() ([]byte, error) { 11818 type NoMethod ImportProductSetsGcsSource 11819 raw := NoMethod(*s) 11820 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11821} 11822 11823// ImportProductSetsInputConfig: The input content for the 11824// `ImportProductSets` method. 11825type ImportProductSetsInputConfig struct { 11826 // GcsSource: The Google Cloud Storage location for a csv file which 11827 // preserves a list of ImportProductSetRequests in each line. 11828 GcsSource *ImportProductSetsGcsSource `json:"gcsSource,omitempty"` 11829 11830 // ForceSendFields is a list of field names (e.g. "GcsSource") to 11831 // unconditionally include in API requests. By default, fields with 11832 // empty values are omitted from API requests. However, any non-pointer, 11833 // non-interface field appearing in ForceSendFields will be sent to the 11834 // server regardless of whether the field is empty or not. This may be 11835 // used to include empty fields in Patch requests. 11836 ForceSendFields []string `json:"-"` 11837 11838 // NullFields is a list of field names (e.g. "GcsSource") to include in 11839 // API requests with the JSON null value. By default, fields with empty 11840 // values are omitted from API requests. However, any field with an 11841 // empty value appearing in NullFields will be sent to the server as 11842 // null. It is an error if a field in this list has a non-empty value. 11843 // This may be used to include null fields in Patch requests. 11844 NullFields []string `json:"-"` 11845} 11846 11847func (s *ImportProductSetsInputConfig) MarshalJSON() ([]byte, error) { 11848 type NoMethod ImportProductSetsInputConfig 11849 raw := NoMethod(*s) 11850 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11851} 11852 11853// ImportProductSetsRequest: Request message for the `ImportProductSets` 11854// method. 11855type ImportProductSetsRequest struct { 11856 // InputConfig: Required. The input content for the list of requests. 11857 InputConfig *ImportProductSetsInputConfig `json:"inputConfig,omitempty"` 11858 11859 // ForceSendFields is a list of field names (e.g. "InputConfig") to 11860 // unconditionally include in API requests. By default, fields with 11861 // empty values are omitted from API requests. However, any non-pointer, 11862 // non-interface field appearing in ForceSendFields will be sent to the 11863 // server regardless of whether the field is empty or not. This may be 11864 // used to include empty fields in Patch requests. 11865 ForceSendFields []string `json:"-"` 11866 11867 // NullFields is a list of field names (e.g. "InputConfig") to include 11868 // in API requests with the JSON null value. By default, fields with 11869 // empty values are omitted from API requests. However, any field with 11870 // an empty value appearing in NullFields will be sent to the server as 11871 // null. It is an error if a field in this list has a non-empty value. 11872 // This may be used to include null fields in Patch requests. 11873 NullFields []string `json:"-"` 11874} 11875 11876func (s *ImportProductSetsRequest) MarshalJSON() ([]byte, error) { 11877 type NoMethod ImportProductSetsRequest 11878 raw := NoMethod(*s) 11879 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11880} 11881 11882// ImportProductSetsResponse: Response message for the 11883// `ImportProductSets` method. This message is returned by the 11884// google.longrunning.Operations.GetOperation method in the returned 11885// google.longrunning.Operation.response field. 11886type ImportProductSetsResponse struct { 11887 // ReferenceImages: The list of reference_images that are imported 11888 // successfully. 11889 ReferenceImages []*ReferenceImage `json:"referenceImages,omitempty"` 11890 11891 // Statuses: The rpc status for each ImportProductSet request, including 11892 // both successes and errors. The number of statuses here matches the 11893 // number of lines in the csv file, and statuses[i] stores the success 11894 // or failure status of processing the i-th line of the csv, starting 11895 // from line 0. 11896 Statuses []*Status `json:"statuses,omitempty"` 11897 11898 // ForceSendFields is a list of field names (e.g. "ReferenceImages") to 11899 // unconditionally include in API requests. By default, fields with 11900 // empty values are omitted from API requests. However, any non-pointer, 11901 // non-interface field appearing in ForceSendFields will be sent to the 11902 // server regardless of whether the field is empty or not. This may be 11903 // used to include empty fields in Patch requests. 11904 ForceSendFields []string `json:"-"` 11905 11906 // NullFields is a list of field names (e.g. "ReferenceImages") to 11907 // include in API requests with the JSON null value. By default, fields 11908 // with empty values are omitted from API requests. However, any field 11909 // with an empty value appearing in NullFields will be sent to the 11910 // server as null. It is an error if a field in this list has a 11911 // non-empty value. This may be used to include null fields in Patch 11912 // requests. 11913 NullFields []string `json:"-"` 11914} 11915 11916func (s *ImportProductSetsResponse) MarshalJSON() ([]byte, error) { 11917 type NoMethod ImportProductSetsResponse 11918 raw := NoMethod(*s) 11919 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11920} 11921 11922// InputConfig: The desired input location and metadata. 11923type InputConfig struct { 11924 // Content: File content, represented as a stream of bytes. Note: As 11925 // with all `bytes` fields, protobuffers use a pure binary 11926 // representation, whereas JSON representations use base64. Currently, 11927 // this field only works for BatchAnnotateFiles requests. It does not 11928 // work for AsyncBatchAnnotateFiles requests. 11929 Content string `json:"content,omitempty"` 11930 11931 // GcsSource: The Google Cloud Storage location to read the input from. 11932 GcsSource *GcsSource `json:"gcsSource,omitempty"` 11933 11934 // MimeType: The type of the file. Currently only "application/pdf", 11935 // "image/tiff" and "image/gif" are supported. Wildcards are not 11936 // supported. 11937 MimeType string `json:"mimeType,omitempty"` 11938 11939 // ForceSendFields is a list of field names (e.g. "Content") to 11940 // unconditionally include in API requests. By default, fields with 11941 // empty values are omitted from API requests. However, any non-pointer, 11942 // non-interface field appearing in ForceSendFields will be sent to the 11943 // server regardless of whether the field is empty or not. This may be 11944 // used to include empty fields in Patch requests. 11945 ForceSendFields []string `json:"-"` 11946 11947 // NullFields is a list of field names (e.g. "Content") to include in 11948 // API requests with the JSON null value. By default, fields with empty 11949 // values are omitted from API requests. However, any field with an 11950 // empty value appearing in NullFields will be sent to the server as 11951 // null. It is an error if a field in this list has a non-empty value. 11952 // This may be used to include null fields in Patch requests. 11953 NullFields []string `json:"-"` 11954} 11955 11956func (s *InputConfig) MarshalJSON() ([]byte, error) { 11957 type NoMethod InputConfig 11958 raw := NoMethod(*s) 11959 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11960} 11961 11962// KeyValue: A product label represented as a key-value pair. 11963type KeyValue struct { 11964 // Key: The key of the label attached to the product. Cannot be empty 11965 // and cannot exceed 128 bytes. 11966 Key string `json:"key,omitempty"` 11967 11968 // Value: The value of the label attached to the product. Cannot be 11969 // empty and cannot exceed 128 bytes. 11970 Value string `json:"value,omitempty"` 11971 11972 // ForceSendFields is a list of field names (e.g. "Key") to 11973 // unconditionally include in API requests. By default, fields with 11974 // empty values are omitted from API requests. However, any non-pointer, 11975 // non-interface field appearing in ForceSendFields will be sent to the 11976 // server regardless of whether the field is empty or not. This may be 11977 // used to include empty fields in Patch requests. 11978 ForceSendFields []string `json:"-"` 11979 11980 // NullFields is a list of field names (e.g. "Key") to include in API 11981 // requests with the JSON null value. By default, fields with empty 11982 // values are omitted from API requests. However, any field with an 11983 // empty value appearing in NullFields will be sent to the server as 11984 // null. It is an error if a field in this list has a non-empty value. 11985 // This may be used to include null fields in Patch requests. 11986 NullFields []string `json:"-"` 11987} 11988 11989func (s *KeyValue) MarshalJSON() ([]byte, error) { 11990 type NoMethod KeyValue 11991 raw := NoMethod(*s) 11992 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11993} 11994 11995// Landmark: A face-specific landmark (for example, a face feature). 11996type Landmark struct { 11997 // Position: Face landmark position. 11998 Position *Position `json:"position,omitempty"` 11999 12000 // Type: Face landmark type. 12001 // 12002 // Possible values: 12003 // "UNKNOWN_LANDMARK" - Unknown face landmark detected. Should not be 12004 // filled. 12005 // "LEFT_EYE" - Left eye. 12006 // "RIGHT_EYE" - Right eye. 12007 // "LEFT_OF_LEFT_EYEBROW" - Left of left eyebrow. 12008 // "RIGHT_OF_LEFT_EYEBROW" - Right of left eyebrow. 12009 // "LEFT_OF_RIGHT_EYEBROW" - Left of right eyebrow. 12010 // "RIGHT_OF_RIGHT_EYEBROW" - Right of right eyebrow. 12011 // "MIDPOINT_BETWEEN_EYES" - Midpoint between eyes. 12012 // "NOSE_TIP" - Nose tip. 12013 // "UPPER_LIP" - Upper lip. 12014 // "LOWER_LIP" - Lower lip. 12015 // "MOUTH_LEFT" - Mouth left. 12016 // "MOUTH_RIGHT" - Mouth right. 12017 // "MOUTH_CENTER" - Mouth center. 12018 // "NOSE_BOTTOM_RIGHT" - Nose, bottom right. 12019 // "NOSE_BOTTOM_LEFT" - Nose, bottom left. 12020 // "NOSE_BOTTOM_CENTER" - Nose, bottom center. 12021 // "LEFT_EYE_TOP_BOUNDARY" - Left eye, top boundary. 12022 // "LEFT_EYE_RIGHT_CORNER" - Left eye, right corner. 12023 // "LEFT_EYE_BOTTOM_BOUNDARY" - Left eye, bottom boundary. 12024 // "LEFT_EYE_LEFT_CORNER" - Left eye, left corner. 12025 // "RIGHT_EYE_TOP_BOUNDARY" - Right eye, top boundary. 12026 // "RIGHT_EYE_RIGHT_CORNER" - Right eye, right corner. 12027 // "RIGHT_EYE_BOTTOM_BOUNDARY" - Right eye, bottom boundary. 12028 // "RIGHT_EYE_LEFT_CORNER" - Right eye, left corner. 12029 // "LEFT_EYEBROW_UPPER_MIDPOINT" - Left eyebrow, upper midpoint. 12030 // "RIGHT_EYEBROW_UPPER_MIDPOINT" - Right eyebrow, upper midpoint. 12031 // "LEFT_EAR_TRAGION" - Left ear tragion. 12032 // "RIGHT_EAR_TRAGION" - Right ear tragion. 12033 // "LEFT_EYE_PUPIL" - Left eye pupil. 12034 // "RIGHT_EYE_PUPIL" - Right eye pupil. 12035 // "FOREHEAD_GLABELLA" - Forehead glabella. 12036 // "CHIN_GNATHION" - Chin gnathion. 12037 // "CHIN_LEFT_GONION" - Chin left gonion. 12038 // "CHIN_RIGHT_GONION" - Chin right gonion. 12039 // "LEFT_CHEEK_CENTER" - Left cheek center. 12040 // "RIGHT_CHEEK_CENTER" - Right cheek center. 12041 Type string `json:"type,omitempty"` 12042 12043 // ForceSendFields is a list of field names (e.g. "Position") to 12044 // unconditionally include in API requests. By default, fields with 12045 // empty values are omitted from API requests. However, any non-pointer, 12046 // non-interface field appearing in ForceSendFields will be sent to the 12047 // server regardless of whether the field is empty or not. This may be 12048 // used to include empty fields in Patch requests. 12049 ForceSendFields []string `json:"-"` 12050 12051 // NullFields is a list of field names (e.g. "Position") to include in 12052 // API requests with the JSON null value. By default, fields with empty 12053 // values are omitted from API requests. However, any field with an 12054 // empty value appearing in NullFields will be sent to the server as 12055 // null. It is an error if a field in this list has a non-empty value. 12056 // This may be used to include null fields in Patch requests. 12057 NullFields []string `json:"-"` 12058} 12059 12060func (s *Landmark) MarshalJSON() ([]byte, error) { 12061 type NoMethod Landmark 12062 raw := NoMethod(*s) 12063 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12064} 12065 12066// LatLng: An object representing a latitude/longitude pair. This is 12067// expressed as a pair of doubles representing degrees latitude and 12068// degrees longitude. Unless specified otherwise, this must conform to 12069// the WGS84 standard. Values must be within normalized ranges. 12070type LatLng struct { 12071 // Latitude: The latitude in degrees. It must be in the range [-90.0, 12072 // +90.0]. 12073 Latitude float64 `json:"latitude,omitempty"` 12074 12075 // Longitude: The longitude in degrees. It must be in the range [-180.0, 12076 // +180.0]. 12077 Longitude float64 `json:"longitude,omitempty"` 12078 12079 // ForceSendFields is a list of field names (e.g. "Latitude") to 12080 // unconditionally include in API requests. By default, fields with 12081 // empty values are omitted from API requests. However, any non-pointer, 12082 // non-interface field appearing in ForceSendFields will be sent to the 12083 // server regardless of whether the field is empty or not. This may be 12084 // used to include empty fields in Patch requests. 12085 ForceSendFields []string `json:"-"` 12086 12087 // NullFields is a list of field names (e.g. "Latitude") to include in 12088 // API requests with the JSON null value. By default, fields with empty 12089 // values are omitted from API requests. However, any field with an 12090 // empty value appearing in NullFields will be sent to the server as 12091 // null. It is an error if a field in this list has a non-empty value. 12092 // This may be used to include null fields in Patch requests. 12093 NullFields []string `json:"-"` 12094} 12095 12096func (s *LatLng) MarshalJSON() ([]byte, error) { 12097 type NoMethod LatLng 12098 raw := NoMethod(*s) 12099 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12100} 12101 12102func (s *LatLng) UnmarshalJSON(data []byte) error { 12103 type NoMethod LatLng 12104 var s1 struct { 12105 Latitude gensupport.JSONFloat64 `json:"latitude"` 12106 Longitude gensupport.JSONFloat64 `json:"longitude"` 12107 *NoMethod 12108 } 12109 s1.NoMethod = (*NoMethod)(s) 12110 if err := json.Unmarshal(data, &s1); err != nil { 12111 return err 12112 } 12113 s.Latitude = float64(s1.Latitude) 12114 s.Longitude = float64(s1.Longitude) 12115 return nil 12116} 12117 12118// LatLongRect: Rectangle determined by min and max `LatLng` pairs. 12119type LatLongRect struct { 12120 // MaxLatLng: Max lat/long pair. 12121 MaxLatLng *LatLng `json:"maxLatLng,omitempty"` 12122 12123 // MinLatLng: Min lat/long pair. 12124 MinLatLng *LatLng `json:"minLatLng,omitempty"` 12125 12126 // ForceSendFields is a list of field names (e.g. "MaxLatLng") to 12127 // unconditionally include in API requests. By default, fields with 12128 // empty values are omitted from API requests. However, any non-pointer, 12129 // non-interface field appearing in ForceSendFields will be sent to the 12130 // server regardless of whether the field is empty or not. This may be 12131 // used to include empty fields in Patch requests. 12132 ForceSendFields []string `json:"-"` 12133 12134 // NullFields is a list of field names (e.g. "MaxLatLng") to include in 12135 // API requests with the JSON null value. By default, fields with empty 12136 // values are omitted from API requests. However, any field with an 12137 // empty value appearing in NullFields will be sent to the server as 12138 // null. It is an error if a field in this list has a non-empty value. 12139 // This may be used to include null fields in Patch requests. 12140 NullFields []string `json:"-"` 12141} 12142 12143func (s *LatLongRect) MarshalJSON() ([]byte, error) { 12144 type NoMethod LatLongRect 12145 raw := NoMethod(*s) 12146 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12147} 12148 12149// ListOperationsResponse: The response message for 12150// Operations.ListOperations. 12151type ListOperationsResponse struct { 12152 // NextPageToken: The standard List next-page token. 12153 NextPageToken string `json:"nextPageToken,omitempty"` 12154 12155 // Operations: A list of operations that matches the specified filter in 12156 // the request. 12157 Operations []*Operation `json:"operations,omitempty"` 12158 12159 // ServerResponse contains the HTTP response code and headers from the 12160 // server. 12161 googleapi.ServerResponse `json:"-"` 12162 12163 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 12164 // unconditionally include in API requests. By default, fields with 12165 // empty values are omitted from API requests. However, any non-pointer, 12166 // non-interface field appearing in ForceSendFields will be sent to the 12167 // server regardless of whether the field is empty or not. This may be 12168 // used to include empty fields in Patch requests. 12169 ForceSendFields []string `json:"-"` 12170 12171 // NullFields is a list of field names (e.g. "NextPageToken") to include 12172 // in API requests with the JSON null value. By default, fields with 12173 // empty values are omitted from API requests. However, any field with 12174 // an empty value appearing in NullFields will be sent to the server as 12175 // null. It is an error if a field in this list has a non-empty value. 12176 // This may be used to include null fields in Patch requests. 12177 NullFields []string `json:"-"` 12178} 12179 12180func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) { 12181 type NoMethod ListOperationsResponse 12182 raw := NoMethod(*s) 12183 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12184} 12185 12186// ListProductSetsResponse: Response message for the `ListProductSets` 12187// method. 12188type ListProductSetsResponse struct { 12189 // NextPageToken: Token to retrieve the next page of results, or empty 12190 // if there are no more results in the list. 12191 NextPageToken string `json:"nextPageToken,omitempty"` 12192 12193 // ProductSets: List of ProductSets. 12194 ProductSets []*ProductSet `json:"productSets,omitempty"` 12195 12196 // ServerResponse contains the HTTP response code and headers from the 12197 // server. 12198 googleapi.ServerResponse `json:"-"` 12199 12200 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 12201 // unconditionally include in API requests. By default, fields with 12202 // empty values are omitted from API requests. However, any non-pointer, 12203 // non-interface field appearing in ForceSendFields will be sent to the 12204 // server regardless of whether the field is empty or not. This may be 12205 // used to include empty fields in Patch requests. 12206 ForceSendFields []string `json:"-"` 12207 12208 // NullFields is a list of field names (e.g. "NextPageToken") to include 12209 // in API requests with the JSON null value. By default, fields with 12210 // empty values are omitted from API requests. However, any field with 12211 // an empty value appearing in NullFields will be sent to the server as 12212 // null. It is an error if a field in this list has a non-empty value. 12213 // This may be used to include null fields in Patch requests. 12214 NullFields []string `json:"-"` 12215} 12216 12217func (s *ListProductSetsResponse) MarshalJSON() ([]byte, error) { 12218 type NoMethod ListProductSetsResponse 12219 raw := NoMethod(*s) 12220 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12221} 12222 12223// ListProductsInProductSetResponse: Response message for the 12224// `ListProductsInProductSet` method. 12225type ListProductsInProductSetResponse struct { 12226 // NextPageToken: Token to retrieve the next page of results, or empty 12227 // if there are no more results in the list. 12228 NextPageToken string `json:"nextPageToken,omitempty"` 12229 12230 // Products: The list of Products. 12231 Products []*Product `json:"products,omitempty"` 12232 12233 // ServerResponse contains the HTTP response code and headers from the 12234 // server. 12235 googleapi.ServerResponse `json:"-"` 12236 12237 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 12238 // unconditionally include in API requests. By default, fields with 12239 // empty values are omitted from API requests. However, any non-pointer, 12240 // non-interface field appearing in ForceSendFields will be sent to the 12241 // server regardless of whether the field is empty or not. This may be 12242 // used to include empty fields in Patch requests. 12243 ForceSendFields []string `json:"-"` 12244 12245 // NullFields is a list of field names (e.g. "NextPageToken") to include 12246 // in API requests with the JSON null value. By default, fields with 12247 // empty values are omitted from API requests. However, any field with 12248 // an empty value appearing in NullFields will be sent to the server as 12249 // null. It is an error if a field in this list has a non-empty value. 12250 // This may be used to include null fields in Patch requests. 12251 NullFields []string `json:"-"` 12252} 12253 12254func (s *ListProductsInProductSetResponse) MarshalJSON() ([]byte, error) { 12255 type NoMethod ListProductsInProductSetResponse 12256 raw := NoMethod(*s) 12257 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12258} 12259 12260// ListProductsResponse: Response message for the `ListProducts` method. 12261type ListProductsResponse struct { 12262 // NextPageToken: Token to retrieve the next page of results, or empty 12263 // if there are no more results in the list. 12264 NextPageToken string `json:"nextPageToken,omitempty"` 12265 12266 // Products: List of products. 12267 Products []*Product `json:"products,omitempty"` 12268 12269 // ServerResponse contains the HTTP response code and headers from the 12270 // server. 12271 googleapi.ServerResponse `json:"-"` 12272 12273 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 12274 // unconditionally include in API requests. By default, fields with 12275 // empty values are omitted from API requests. However, any non-pointer, 12276 // non-interface field appearing in ForceSendFields will be sent to the 12277 // server regardless of whether the field is empty or not. This may be 12278 // used to include empty fields in Patch requests. 12279 ForceSendFields []string `json:"-"` 12280 12281 // NullFields is a list of field names (e.g. "NextPageToken") to include 12282 // in API requests with the JSON null value. By default, fields with 12283 // empty values are omitted from API requests. However, any field with 12284 // an empty value appearing in NullFields will be sent to the server as 12285 // null. It is an error if a field in this list has a non-empty value. 12286 // This may be used to include null fields in Patch requests. 12287 NullFields []string `json:"-"` 12288} 12289 12290func (s *ListProductsResponse) MarshalJSON() ([]byte, error) { 12291 type NoMethod ListProductsResponse 12292 raw := NoMethod(*s) 12293 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12294} 12295 12296// ListReferenceImagesResponse: Response message for the 12297// `ListReferenceImages` method. 12298type ListReferenceImagesResponse struct { 12299 // NextPageToken: The next_page_token returned from a previous List 12300 // request, if any. 12301 NextPageToken string `json:"nextPageToken,omitempty"` 12302 12303 // PageSize: The maximum number of items to return. Default 10, maximum 12304 // 100. 12305 PageSize int64 `json:"pageSize,omitempty"` 12306 12307 // ReferenceImages: The list of reference images. 12308 ReferenceImages []*ReferenceImage `json:"referenceImages,omitempty"` 12309 12310 // ServerResponse contains the HTTP response code and headers from the 12311 // server. 12312 googleapi.ServerResponse `json:"-"` 12313 12314 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 12315 // unconditionally include in API requests. By default, fields with 12316 // empty values are omitted from API requests. However, any non-pointer, 12317 // non-interface field appearing in ForceSendFields will be sent to the 12318 // server regardless of whether the field is empty or not. This may be 12319 // used to include empty fields in Patch requests. 12320 ForceSendFields []string `json:"-"` 12321 12322 // NullFields is a list of field names (e.g. "NextPageToken") to include 12323 // in API requests with the JSON null value. By default, fields with 12324 // empty values are omitted from API requests. However, any field with 12325 // an empty value appearing in NullFields will be sent to the server as 12326 // null. It is an error if a field in this list has a non-empty value. 12327 // This may be used to include null fields in Patch requests. 12328 NullFields []string `json:"-"` 12329} 12330 12331func (s *ListReferenceImagesResponse) MarshalJSON() ([]byte, error) { 12332 type NoMethod ListReferenceImagesResponse 12333 raw := NoMethod(*s) 12334 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12335} 12336 12337// LocalizedObjectAnnotation: Set of detected objects with bounding 12338// boxes. 12339type LocalizedObjectAnnotation struct { 12340 // BoundingPoly: Image region to which this object belongs. This must be 12341 // populated. 12342 BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"` 12343 12344 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". 12345 // For more information, see 12346 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 12347 LanguageCode string `json:"languageCode,omitempty"` 12348 12349 // Mid: Object ID that should align with EntityAnnotation mid. 12350 Mid string `json:"mid,omitempty"` 12351 12352 // Name: Object name, expressed in its `language_code` language. 12353 Name string `json:"name,omitempty"` 12354 12355 // Score: Score of the result. Range [0, 1]. 12356 Score float64 `json:"score,omitempty"` 12357 12358 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 12359 // unconditionally include in API requests. By default, fields with 12360 // empty values are omitted from API requests. However, any non-pointer, 12361 // non-interface field appearing in ForceSendFields will be sent to the 12362 // server regardless of whether the field is empty or not. This may be 12363 // used to include empty fields in Patch requests. 12364 ForceSendFields []string `json:"-"` 12365 12366 // NullFields is a list of field names (e.g. "BoundingPoly") to include 12367 // in API requests with the JSON null value. By default, fields with 12368 // empty values are omitted from API requests. However, any field with 12369 // an empty value appearing in NullFields will be sent to the server as 12370 // null. It is an error if a field in this list has a non-empty value. 12371 // This may be used to include null fields in Patch requests. 12372 NullFields []string `json:"-"` 12373} 12374 12375func (s *LocalizedObjectAnnotation) MarshalJSON() ([]byte, error) { 12376 type NoMethod LocalizedObjectAnnotation 12377 raw := NoMethod(*s) 12378 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12379} 12380 12381func (s *LocalizedObjectAnnotation) UnmarshalJSON(data []byte) error { 12382 type NoMethod LocalizedObjectAnnotation 12383 var s1 struct { 12384 Score gensupport.JSONFloat64 `json:"score"` 12385 *NoMethod 12386 } 12387 s1.NoMethod = (*NoMethod)(s) 12388 if err := json.Unmarshal(data, &s1); err != nil { 12389 return err 12390 } 12391 s.Score = float64(s1.Score) 12392 return nil 12393} 12394 12395// LocationInfo: Detected entity location information. 12396type LocationInfo struct { 12397 // LatLng: lat/long location coordinates. 12398 LatLng *LatLng `json:"latLng,omitempty"` 12399 12400 // ForceSendFields is a list of field names (e.g. "LatLng") to 12401 // unconditionally include in API requests. By default, fields with 12402 // empty values are omitted from API requests. However, any non-pointer, 12403 // non-interface field appearing in ForceSendFields will be sent to the 12404 // server regardless of whether the field is empty or not. This may be 12405 // used to include empty fields in Patch requests. 12406 ForceSendFields []string `json:"-"` 12407 12408 // NullFields is a list of field names (e.g. "LatLng") to include in API 12409 // requests with the JSON null value. By default, fields with empty 12410 // values are omitted from API requests. However, any field with an 12411 // empty value appearing in NullFields will be sent to the server as 12412 // null. It is an error if a field in this list has a non-empty value. 12413 // This may be used to include null fields in Patch requests. 12414 NullFields []string `json:"-"` 12415} 12416 12417func (s *LocationInfo) MarshalJSON() ([]byte, error) { 12418 type NoMethod LocationInfo 12419 raw := NoMethod(*s) 12420 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12421} 12422 12423// NormalizedVertex: A vertex represents a 2D point in the image. NOTE: 12424// the normalized vertex coordinates are relative to the original image 12425// and range from 0 to 1. 12426type NormalizedVertex struct { 12427 // X: X coordinate. 12428 X float64 `json:"x,omitempty"` 12429 12430 // Y: Y coordinate. 12431 Y float64 `json:"y,omitempty"` 12432 12433 // ForceSendFields is a list of field names (e.g. "X") to 12434 // unconditionally include in API requests. By default, fields with 12435 // empty values are omitted from API requests. However, any non-pointer, 12436 // non-interface field appearing in ForceSendFields will be sent to the 12437 // server regardless of whether the field is empty or not. This may be 12438 // used to include empty fields in Patch requests. 12439 ForceSendFields []string `json:"-"` 12440 12441 // NullFields is a list of field names (e.g. "X") to include in API 12442 // requests with the JSON null value. By default, fields with empty 12443 // values are omitted from API requests. However, any field with an 12444 // empty value appearing in NullFields will be sent to the server as 12445 // null. It is an error if a field in this list has a non-empty value. 12446 // This may be used to include null fields in Patch requests. 12447 NullFields []string `json:"-"` 12448} 12449 12450func (s *NormalizedVertex) MarshalJSON() ([]byte, error) { 12451 type NoMethod NormalizedVertex 12452 raw := NoMethod(*s) 12453 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12454} 12455 12456func (s *NormalizedVertex) UnmarshalJSON(data []byte) error { 12457 type NoMethod NormalizedVertex 12458 var s1 struct { 12459 X gensupport.JSONFloat64 `json:"x"` 12460 Y gensupport.JSONFloat64 `json:"y"` 12461 *NoMethod 12462 } 12463 s1.NoMethod = (*NoMethod)(s) 12464 if err := json.Unmarshal(data, &s1); err != nil { 12465 return err 12466 } 12467 s.X = float64(s1.X) 12468 s.Y = float64(s1.Y) 12469 return nil 12470} 12471 12472// ObjectAnnotation: Prediction for what the object in the bounding box 12473// is. 12474type ObjectAnnotation struct { 12475 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". 12476 // For more information, see 12477 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 12478 LanguageCode string `json:"languageCode,omitempty"` 12479 12480 // Mid: Object ID that should align with EntityAnnotation mid. 12481 Mid string `json:"mid,omitempty"` 12482 12483 // Name: Object name, expressed in its `language_code` language. 12484 Name string `json:"name,omitempty"` 12485 12486 // Score: Score of the result. Range [0, 1]. 12487 Score float64 `json:"score,omitempty"` 12488 12489 // ForceSendFields is a list of field names (e.g. "LanguageCode") to 12490 // unconditionally include in API requests. By default, fields with 12491 // empty values are omitted from API requests. However, any non-pointer, 12492 // non-interface field appearing in ForceSendFields will be sent to the 12493 // server regardless of whether the field is empty or not. This may be 12494 // used to include empty fields in Patch requests. 12495 ForceSendFields []string `json:"-"` 12496 12497 // NullFields is a list of field names (e.g. "LanguageCode") to include 12498 // in API requests with the JSON null value. By default, fields with 12499 // empty values are omitted from API requests. However, any field with 12500 // an empty value appearing in NullFields will be sent to the server as 12501 // null. It is an error if a field in this list has a non-empty value. 12502 // This may be used to include null fields in Patch requests. 12503 NullFields []string `json:"-"` 12504} 12505 12506func (s *ObjectAnnotation) MarshalJSON() ([]byte, error) { 12507 type NoMethod ObjectAnnotation 12508 raw := NoMethod(*s) 12509 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12510} 12511 12512func (s *ObjectAnnotation) UnmarshalJSON(data []byte) error { 12513 type NoMethod ObjectAnnotation 12514 var s1 struct { 12515 Score gensupport.JSONFloat64 `json:"score"` 12516 *NoMethod 12517 } 12518 s1.NoMethod = (*NoMethod)(s) 12519 if err := json.Unmarshal(data, &s1); err != nil { 12520 return err 12521 } 12522 s.Score = float64(s1.Score) 12523 return nil 12524} 12525 12526// Operation: This resource represents a long-running operation that is 12527// the result of a network API call. 12528type Operation struct { 12529 // Done: If the value is `false`, it means the operation is still in 12530 // progress. If `true`, the operation is completed, and either `error` 12531 // or `response` is available. 12532 Done bool `json:"done,omitempty"` 12533 12534 // Error: The error result of the operation in case of failure or 12535 // cancellation. 12536 Error *Status `json:"error,omitempty"` 12537 12538 // Metadata: Service-specific metadata associated with the operation. It 12539 // typically contains progress information and common metadata such as 12540 // create time. Some services might not provide such metadata. Any 12541 // method that returns a long-running operation should document the 12542 // metadata type, if any. 12543 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 12544 12545 // Name: The server-assigned name, which is only unique within the same 12546 // service that originally returns it. If you use the default HTTP 12547 // mapping, the `name` should be a resource name ending with 12548 // `operations/{unique_id}`. 12549 Name string `json:"name,omitempty"` 12550 12551 // Response: The normal response of the operation in case of success. If 12552 // the original method returns no data on success, such as `Delete`, the 12553 // response is `google.protobuf.Empty`. If the original method is 12554 // standard `Get`/`Create`/`Update`, the response should be the 12555 // resource. For other methods, the response should have the type 12556 // `XxxResponse`, where `Xxx` is the original method name. For example, 12557 // if the original method name is `TakeSnapshot()`, the inferred 12558 // response type is `TakeSnapshotResponse`. 12559 Response googleapi.RawMessage `json:"response,omitempty"` 12560 12561 // ServerResponse contains the HTTP response code and headers from the 12562 // server. 12563 googleapi.ServerResponse `json:"-"` 12564 12565 // ForceSendFields is a list of field names (e.g. "Done") to 12566 // unconditionally include in API requests. By default, fields with 12567 // empty values are omitted from API requests. However, any non-pointer, 12568 // non-interface field appearing in ForceSendFields will be sent to the 12569 // server regardless of whether the field is empty or not. This may be 12570 // used to include empty fields in Patch requests. 12571 ForceSendFields []string `json:"-"` 12572 12573 // NullFields is a list of field names (e.g. "Done") to include in API 12574 // requests with the JSON null value. By default, fields with empty 12575 // values are omitted from API requests. However, any field with an 12576 // empty value appearing in NullFields will be sent to the server as 12577 // null. It is an error if a field in this list has a non-empty value. 12578 // This may be used to include null fields in Patch requests. 12579 NullFields []string `json:"-"` 12580} 12581 12582func (s *Operation) MarshalJSON() ([]byte, error) { 12583 type NoMethod Operation 12584 raw := NoMethod(*s) 12585 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12586} 12587 12588// OperationMetadata: Contains metadata for the BatchAnnotateImages 12589// operation. 12590type OperationMetadata struct { 12591 // CreateTime: The time when the batch request was received. 12592 CreateTime string `json:"createTime,omitempty"` 12593 12594 // State: Current state of the batch operation. 12595 // 12596 // Possible values: 12597 // "STATE_UNSPECIFIED" - Invalid. 12598 // "CREATED" - Request is received. 12599 // "RUNNING" - Request is actively being processed. 12600 // "DONE" - The batch processing is done. 12601 // "CANCELLED" - The batch processing was cancelled. 12602 State string `json:"state,omitempty"` 12603 12604 // UpdateTime: The time when the operation result was last updated. 12605 UpdateTime string `json:"updateTime,omitempty"` 12606 12607 // ForceSendFields is a list of field names (e.g. "CreateTime") to 12608 // unconditionally include in API requests. By default, fields with 12609 // empty values are omitted from API requests. However, any non-pointer, 12610 // non-interface field appearing in ForceSendFields will be sent to the 12611 // server regardless of whether the field is empty or not. This may be 12612 // used to include empty fields in Patch requests. 12613 ForceSendFields []string `json:"-"` 12614 12615 // NullFields is a list of field names (e.g. "CreateTime") to include in 12616 // API requests with the JSON null value. By default, fields with empty 12617 // values are omitted from API requests. However, any field with an 12618 // empty value appearing in NullFields will be sent to the server as 12619 // null. It is an error if a field in this list has a non-empty value. 12620 // This may be used to include null fields in Patch requests. 12621 NullFields []string `json:"-"` 12622} 12623 12624func (s *OperationMetadata) MarshalJSON() ([]byte, error) { 12625 type NoMethod OperationMetadata 12626 raw := NoMethod(*s) 12627 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12628} 12629 12630// OutputConfig: The desired output location and metadata. 12631type OutputConfig struct { 12632 // BatchSize: The max number of response protos to put into each output 12633 // JSON file on Google Cloud Storage. The valid range is [1, 100]. If 12634 // not specified, the default value is 20. For example, for one pdf file 12635 // with 100 pages, 100 response protos will be generated. If 12636 // `batch_size` = 20, then 5 json files each containing 20 response 12637 // protos will be written under the prefix `gcs_destination`.`uri`. 12638 // Currently, batch_size only applies to GcsDestination, with potential 12639 // future support for other output configurations. 12640 BatchSize int64 `json:"batchSize,omitempty"` 12641 12642 // GcsDestination: The Google Cloud Storage location to write the 12643 // output(s) to. 12644 GcsDestination *GcsDestination `json:"gcsDestination,omitempty"` 12645 12646 // ForceSendFields is a list of field names (e.g. "BatchSize") to 12647 // unconditionally include in API requests. By default, fields with 12648 // empty values are omitted from API requests. However, any non-pointer, 12649 // non-interface field appearing in ForceSendFields will be sent to the 12650 // server regardless of whether the field is empty or not. This may be 12651 // used to include empty fields in Patch requests. 12652 ForceSendFields []string `json:"-"` 12653 12654 // NullFields is a list of field names (e.g. "BatchSize") to include in 12655 // API requests with the JSON null value. By default, fields with empty 12656 // values are omitted from API requests. However, any field with an 12657 // empty value appearing in NullFields will be sent to the server as 12658 // null. It is an error if a field in this list has a non-empty value. 12659 // This may be used to include null fields in Patch requests. 12660 NullFields []string `json:"-"` 12661} 12662 12663func (s *OutputConfig) MarshalJSON() ([]byte, error) { 12664 type NoMethod OutputConfig 12665 raw := NoMethod(*s) 12666 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12667} 12668 12669// Page: Detected page from OCR. 12670type Page struct { 12671 // Blocks: List of blocks of text, images etc on this page. 12672 Blocks []*Block `json:"blocks,omitempty"` 12673 12674 // Confidence: Confidence of the OCR results on the page. Range [0, 1]. 12675 Confidence float64 `json:"confidence,omitempty"` 12676 12677 // Height: Page height. For PDFs the unit is points. For images 12678 // (including TIFFs) the unit is pixels. 12679 Height int64 `json:"height,omitempty"` 12680 12681 // Property: Additional information detected on the page. 12682 Property *TextProperty `json:"property,omitempty"` 12683 12684 // Width: Page width. For PDFs the unit is points. For images (including 12685 // TIFFs) the unit is pixels. 12686 Width int64 `json:"width,omitempty"` 12687 12688 // ForceSendFields is a list of field names (e.g. "Blocks") to 12689 // unconditionally include in API requests. By default, fields with 12690 // empty values are omitted from API requests. However, any non-pointer, 12691 // non-interface field appearing in ForceSendFields will be sent to the 12692 // server regardless of whether the field is empty or not. This may be 12693 // used to include empty fields in Patch requests. 12694 ForceSendFields []string `json:"-"` 12695 12696 // NullFields is a list of field names (e.g. "Blocks") to include in API 12697 // requests with the JSON null value. By default, fields with empty 12698 // values are omitted from API requests. However, any field with an 12699 // empty value appearing in NullFields will be sent to the server as 12700 // null. It is an error if a field in this list has a non-empty value. 12701 // This may be used to include null fields in Patch requests. 12702 NullFields []string `json:"-"` 12703} 12704 12705func (s *Page) MarshalJSON() ([]byte, error) { 12706 type NoMethod Page 12707 raw := NoMethod(*s) 12708 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12709} 12710 12711func (s *Page) UnmarshalJSON(data []byte) error { 12712 type NoMethod Page 12713 var s1 struct { 12714 Confidence gensupport.JSONFloat64 `json:"confidence"` 12715 *NoMethod 12716 } 12717 s1.NoMethod = (*NoMethod)(s) 12718 if err := json.Unmarshal(data, &s1); err != nil { 12719 return err 12720 } 12721 s.Confidence = float64(s1.Confidence) 12722 return nil 12723} 12724 12725// Paragraph: Structural unit of text representing a number of words in 12726// certain order. 12727type Paragraph struct { 12728 // BoundingBox: The bounding box for the paragraph. The vertices are in 12729 // the order of top-left, top-right, bottom-right, bottom-left. When a 12730 // rotation of the bounding box is detected the rotation is represented 12731 // as around the top-left corner as defined when the text is read in the 12732 // 'natural' orientation. For example: * when the text is horizontal it 12733 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 12734 // around the top-left corner it becomes: 2----3 | | 1----0 and the 12735 // vertex order will still be (0, 1, 2, 3). 12736 BoundingBox *BoundingPoly `json:"boundingBox,omitempty"` 12737 12738 // Confidence: Confidence of the OCR results for the paragraph. Range 12739 // [0, 1]. 12740 Confidence float64 `json:"confidence,omitempty"` 12741 12742 // Property: Additional information detected for the paragraph. 12743 Property *TextProperty `json:"property,omitempty"` 12744 12745 // Words: List of all words in this paragraph. 12746 Words []*Word `json:"words,omitempty"` 12747 12748 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 12749 // unconditionally include in API requests. By default, fields with 12750 // empty values are omitted from API requests. However, any non-pointer, 12751 // non-interface field appearing in ForceSendFields will be sent to the 12752 // server regardless of whether the field is empty or not. This may be 12753 // used to include empty fields in Patch requests. 12754 ForceSendFields []string `json:"-"` 12755 12756 // NullFields is a list of field names (e.g. "BoundingBox") to include 12757 // in API requests with the JSON null value. By default, fields with 12758 // empty values are omitted from API requests. However, any field with 12759 // an empty value appearing in NullFields will be sent to the server as 12760 // null. It is an error if a field in this list has a non-empty value. 12761 // This may be used to include null fields in Patch requests. 12762 NullFields []string `json:"-"` 12763} 12764 12765func (s *Paragraph) MarshalJSON() ([]byte, error) { 12766 type NoMethod Paragraph 12767 raw := NoMethod(*s) 12768 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12769} 12770 12771func (s *Paragraph) UnmarshalJSON(data []byte) error { 12772 type NoMethod Paragraph 12773 var s1 struct { 12774 Confidence gensupport.JSONFloat64 `json:"confidence"` 12775 *NoMethod 12776 } 12777 s1.NoMethod = (*NoMethod)(s) 12778 if err := json.Unmarshal(data, &s1); err != nil { 12779 return err 12780 } 12781 s.Confidence = float64(s1.Confidence) 12782 return nil 12783} 12784 12785// Position: A 3D position in the image, used primarily for Face 12786// detection landmarks. A valid Position must have both x and y 12787// coordinates. The position coordinates are in the same scale as the 12788// original image. 12789type Position struct { 12790 // X: X coordinate. 12791 X float64 `json:"x,omitempty"` 12792 12793 // Y: Y coordinate. 12794 Y float64 `json:"y,omitempty"` 12795 12796 // Z: Z coordinate (or depth). 12797 Z float64 `json:"z,omitempty"` 12798 12799 // ForceSendFields is a list of field names (e.g. "X") to 12800 // unconditionally include in API requests. By default, fields with 12801 // empty values are omitted from API requests. However, any non-pointer, 12802 // non-interface field appearing in ForceSendFields will be sent to the 12803 // server regardless of whether the field is empty or not. This may be 12804 // used to include empty fields in Patch requests. 12805 ForceSendFields []string `json:"-"` 12806 12807 // NullFields is a list of field names (e.g. "X") to include in API 12808 // requests with the JSON null value. By default, fields with empty 12809 // values are omitted from API requests. However, any field with an 12810 // empty value appearing in NullFields will be sent to the server as 12811 // null. It is an error if a field in this list has a non-empty value. 12812 // This may be used to include null fields in Patch requests. 12813 NullFields []string `json:"-"` 12814} 12815 12816func (s *Position) MarshalJSON() ([]byte, error) { 12817 type NoMethod Position 12818 raw := NoMethod(*s) 12819 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12820} 12821 12822func (s *Position) UnmarshalJSON(data []byte) error { 12823 type NoMethod Position 12824 var s1 struct { 12825 X gensupport.JSONFloat64 `json:"x"` 12826 Y gensupport.JSONFloat64 `json:"y"` 12827 Z gensupport.JSONFloat64 `json:"z"` 12828 *NoMethod 12829 } 12830 s1.NoMethod = (*NoMethod)(s) 12831 if err := json.Unmarshal(data, &s1); err != nil { 12832 return err 12833 } 12834 s.X = float64(s1.X) 12835 s.Y = float64(s1.Y) 12836 s.Z = float64(s1.Z) 12837 return nil 12838} 12839 12840// Product: A Product contains ReferenceImages. 12841type Product struct { 12842 // Description: User-provided metadata to be stored with this product. 12843 // Must be at most 4096 characters long. 12844 Description string `json:"description,omitempty"` 12845 12846 // DisplayName: The user-provided name for this Product. Must not be 12847 // empty. Must be at most 4096 characters long. 12848 DisplayName string `json:"displayName,omitempty"` 12849 12850 // Name: The resource name of the product. Format is: 12851 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This 12852 // field is ignored when creating a product. 12853 Name string `json:"name,omitempty"` 12854 12855 // ProductCategory: Immutable. The category for the product identified 12856 // by the reference image. This should be one of "homegoods-v2", 12857 // "apparel-v2", "toys-v2", "packagedgoods-v1" or "general-v1". The 12858 // legacy categories "homegoods", "apparel", and "toys" are still 12859 // supported, but these should not be used for new products. 12860 ProductCategory string `json:"productCategory,omitempty"` 12861 12862 // ProductLabels: Key-value pairs that can be attached to a product. At 12863 // query time, constraints can be specified based on the product_labels. 12864 // Note that integer values can be provided as strings, e.g. "1199". 12865 // Only strings with integer values can match a range-based restriction 12866 // which is to be supported soon. Multiple values can be assigned to the 12867 // same key. One product may have up to 500 product_labels. Notice that 12868 // the total number of distinct product_labels over all products in one 12869 // ProductSet cannot exceed 1M, otherwise the product search pipeline 12870 // will refuse to work for that ProductSet. 12871 ProductLabels []*KeyValue `json:"productLabels,omitempty"` 12872 12873 // ServerResponse contains the HTTP response code and headers from the 12874 // server. 12875 googleapi.ServerResponse `json:"-"` 12876 12877 // ForceSendFields is a list of field names (e.g. "Description") to 12878 // unconditionally include in API requests. By default, fields with 12879 // empty values are omitted from API requests. However, any non-pointer, 12880 // non-interface field appearing in ForceSendFields will be sent to the 12881 // server regardless of whether the field is empty or not. This may be 12882 // used to include empty fields in Patch requests. 12883 ForceSendFields []string `json:"-"` 12884 12885 // NullFields is a list of field names (e.g. "Description") to include 12886 // in API requests with the JSON null value. By default, fields with 12887 // empty values are omitted from API requests. However, any field with 12888 // an empty value appearing in NullFields will be sent to the server as 12889 // null. It is an error if a field in this list has a non-empty value. 12890 // This may be used to include null fields in Patch requests. 12891 NullFields []string `json:"-"` 12892} 12893 12894func (s *Product) MarshalJSON() ([]byte, error) { 12895 type NoMethod Product 12896 raw := NoMethod(*s) 12897 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12898} 12899 12900// ProductSearchParams: Parameters for a product search request. 12901type ProductSearchParams struct { 12902 // BoundingPoly: The bounding polygon around the area of interest in the 12903 // image. If it is not specified, system discretion will be applied. 12904 BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"` 12905 12906 // Filter: The filtering expression. This can be used to restrict search 12907 // results based on Product labels. We currently support an AND of OR of 12908 // key-value expressions, where each expression within an OR must have 12909 // the same key. An '=' should be used to connect the key and value. For 12910 // example, "(color = red OR color = blue) AND brand = Google" is 12911 // acceptable, but "(color = red OR brand = Google)" is not acceptable. 12912 // "color: red" is not acceptable because it uses a ':' instead of an 12913 // '='. 12914 Filter string `json:"filter,omitempty"` 12915 12916 // ProductCategories: The list of product categories to search in. 12917 // Currently, we only consider the first category, and either 12918 // "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1", or 12919 // "general-v1" should be specified. The legacy categories "homegoods", 12920 // "apparel", and "toys" are still supported but will be deprecated. For 12921 // new products, please use "homegoods-v2", "apparel-v2", or "toys-v2" 12922 // for better product search accuracy. It is recommended to migrate 12923 // existing products to these categories as well. 12924 ProductCategories []string `json:"productCategories,omitempty"` 12925 12926 // ProductSet: The resource name of a ProductSet to be searched for 12927 // similar images. Format is: 12928 // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. 12929 ProductSet string `json:"productSet,omitempty"` 12930 12931 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 12932 // unconditionally include in API requests. By default, fields with 12933 // empty values are omitted from API requests. However, any non-pointer, 12934 // non-interface field appearing in ForceSendFields will be sent to the 12935 // server regardless of whether the field is empty or not. This may be 12936 // used to include empty fields in Patch requests. 12937 ForceSendFields []string `json:"-"` 12938 12939 // NullFields is a list of field names (e.g. "BoundingPoly") to include 12940 // in API requests with the JSON null value. By default, fields with 12941 // empty values are omitted from API requests. However, any field with 12942 // an empty value appearing in NullFields will be sent to the server as 12943 // null. It is an error if a field in this list has a non-empty value. 12944 // This may be used to include null fields in Patch requests. 12945 NullFields []string `json:"-"` 12946} 12947 12948func (s *ProductSearchParams) MarshalJSON() ([]byte, error) { 12949 type NoMethod ProductSearchParams 12950 raw := NoMethod(*s) 12951 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12952} 12953 12954// ProductSearchResults: Results for a product search request. 12955type ProductSearchResults struct { 12956 // IndexTime: Timestamp of the index which provided these results. 12957 // Products added to the product set and products removed from the 12958 // product set after this time are not reflected in the current results. 12959 IndexTime string `json:"indexTime,omitempty"` 12960 12961 // ProductGroupedResults: List of results grouped by products detected 12962 // in the query image. Each entry corresponds to one bounding polygon in 12963 // the query image, and contains the matching products specific to that 12964 // region. There may be duplicate product matches in the union of all 12965 // the per-product results. 12966 ProductGroupedResults []*GroupedResult `json:"productGroupedResults,omitempty"` 12967 12968 // Results: List of results, one for each product match. 12969 Results []*Result `json:"results,omitempty"` 12970 12971 // ForceSendFields is a list of field names (e.g. "IndexTime") to 12972 // unconditionally include in API requests. By default, fields with 12973 // empty values are omitted from API requests. However, any non-pointer, 12974 // non-interface field appearing in ForceSendFields will be sent to the 12975 // server regardless of whether the field is empty or not. This may be 12976 // used to include empty fields in Patch requests. 12977 ForceSendFields []string `json:"-"` 12978 12979 // NullFields is a list of field names (e.g. "IndexTime") to include in 12980 // API requests with the JSON null value. By default, fields with empty 12981 // values are omitted from API requests. However, any field with an 12982 // empty value appearing in NullFields will be sent to the server as 12983 // null. It is an error if a field in this list has a non-empty value. 12984 // This may be used to include null fields in Patch requests. 12985 NullFields []string `json:"-"` 12986} 12987 12988func (s *ProductSearchResults) MarshalJSON() ([]byte, error) { 12989 type NoMethod ProductSearchResults 12990 raw := NoMethod(*s) 12991 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12992} 12993 12994// ProductSet: A ProductSet contains Products. A ProductSet can contain 12995// a maximum of 1 million reference images. If the limit is exceeded, 12996// periodic indexing will fail. 12997type ProductSet struct { 12998 // DisplayName: The user-provided name for this ProductSet. Must not be 12999 // empty. Must be at most 4096 characters long. 13000 DisplayName string `json:"displayName,omitempty"` 13001 13002 // IndexError: Output only. If there was an error with indexing the 13003 // product set, the field is populated. This field is ignored when 13004 // creating a ProductSet. 13005 IndexError *Status `json:"indexError,omitempty"` 13006 13007 // IndexTime: Output only. The time at which this ProductSet was last 13008 // indexed. Query results will reflect all updates before this time. If 13009 // this ProductSet has never been indexed, this timestamp is the default 13010 // value "1970-01-01T00:00:00Z". This field is ignored when creating a 13011 // ProductSet. 13012 IndexTime string `json:"indexTime,omitempty"` 13013 13014 // Name: The resource name of the ProductSet. Format is: 13015 // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. 13016 // This field is ignored when creating a ProductSet. 13017 Name string `json:"name,omitempty"` 13018 13019 // ServerResponse contains the HTTP response code and headers from the 13020 // server. 13021 googleapi.ServerResponse `json:"-"` 13022 13023 // ForceSendFields is a list of field names (e.g. "DisplayName") to 13024 // unconditionally include in API requests. By default, fields with 13025 // empty values are omitted from API requests. However, any non-pointer, 13026 // non-interface field appearing in ForceSendFields will be sent to the 13027 // server regardless of whether the field is empty or not. This may be 13028 // used to include empty fields in Patch requests. 13029 ForceSendFields []string `json:"-"` 13030 13031 // NullFields is a list of field names (e.g. "DisplayName") to include 13032 // in API requests with the JSON null value. By default, fields with 13033 // empty values are omitted from API requests. However, any field with 13034 // an empty value appearing in NullFields will be sent to the server as 13035 // null. It is an error if a field in this list has a non-empty value. 13036 // This may be used to include null fields in Patch requests. 13037 NullFields []string `json:"-"` 13038} 13039 13040func (s *ProductSet) MarshalJSON() ([]byte, error) { 13041 type NoMethod ProductSet 13042 raw := NoMethod(*s) 13043 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 13044} 13045 13046// ProductSetPurgeConfig: Config to control which ProductSet contains 13047// the Products to be deleted. 13048type ProductSetPurgeConfig struct { 13049 // ProductSetId: The ProductSet that contains the Products to delete. If 13050 // a Product is a member of product_set_id in addition to other 13051 // ProductSets, the Product will still be deleted. 13052 ProductSetId string `json:"productSetId,omitempty"` 13053 13054 // ForceSendFields is a list of field names (e.g. "ProductSetId") to 13055 // unconditionally include in API requests. By default, fields with 13056 // empty values are omitted from API requests. However, any non-pointer, 13057 // non-interface field appearing in ForceSendFields will be sent to the 13058 // server regardless of whether the field is empty or not. This may be 13059 // used to include empty fields in Patch requests. 13060 ForceSendFields []string `json:"-"` 13061 13062 // NullFields is a list of field names (e.g. "ProductSetId") to include 13063 // in API requests with the JSON null value. By default, fields with 13064 // empty values are omitted from API requests. However, any field with 13065 // an empty value appearing in NullFields will be sent to the server as 13066 // null. It is an error if a field in this list has a non-empty value. 13067 // This may be used to include null fields in Patch requests. 13068 NullFields []string `json:"-"` 13069} 13070 13071func (s *ProductSetPurgeConfig) MarshalJSON() ([]byte, error) { 13072 type NoMethod ProductSetPurgeConfig 13073 raw := NoMethod(*s) 13074 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 13075} 13076 13077// Property: A `Property` consists of a user-supplied name/value pair. 13078type Property struct { 13079 // Name: Name of the property. 13080 Name string `json:"name,omitempty"` 13081 13082 // Uint64Value: Value of numeric properties. 13083 Uint64Value uint64 `json:"uint64Value,omitempty,string"` 13084 13085 // Value: Value of the property. 13086 Value string `json:"value,omitempty"` 13087 13088 // ForceSendFields is a list of field names (e.g. "Name") to 13089 // unconditionally include in API requests. By default, fields with 13090 // empty values are omitted from API requests. However, any non-pointer, 13091 // non-interface field appearing in ForceSendFields will be sent to the 13092 // server regardless of whether the field is empty or not. This may be 13093 // used to include empty fields in Patch requests. 13094 ForceSendFields []string `json:"-"` 13095 13096 // NullFields is a list of field names (e.g. "Name") to include in API 13097 // requests with the JSON null value. By default, fields with empty 13098 // values are omitted from API requests. However, any field with an 13099 // empty value appearing in NullFields will be sent to the server as 13100 // null. It is an error if a field in this list has a non-empty value. 13101 // This may be used to include null fields in Patch requests. 13102 NullFields []string `json:"-"` 13103} 13104 13105func (s *Property) MarshalJSON() ([]byte, error) { 13106 type NoMethod Property 13107 raw := NoMethod(*s) 13108 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 13109} 13110 13111// PurgeProductsRequest: Request message for the `PurgeProducts` method. 13112type PurgeProductsRequest struct { 13113 // DeleteOrphanProducts: If delete_orphan_products is true, all Products 13114 // that are not in any ProductSet will be deleted. 13115 DeleteOrphanProducts bool `json:"deleteOrphanProducts,omitempty"` 13116 13117 // Force: The default value is false. Override this value to true to 13118 // actually perform the purge. 13119 Force bool `json:"force,omitempty"` 13120 13121 // ProductSetPurgeConfig: Specify which ProductSet contains the Products 13122 // to be deleted. 13123 ProductSetPurgeConfig *ProductSetPurgeConfig `json:"productSetPurgeConfig,omitempty"` 13124 13125 // ForceSendFields is a list of field names (e.g. 13126 // "DeleteOrphanProducts") to unconditionally include in API requests. 13127 // By default, fields with empty values are omitted from API requests. 13128 // However, any non-pointer, non-interface field appearing in 13129 // ForceSendFields will be sent to the server regardless of whether the 13130 // field is empty or not. This may be used to include empty fields in 13131 // Patch requests. 13132 ForceSendFields []string `json:"-"` 13133 13134 // NullFields is a list of field names (e.g. "DeleteOrphanProducts") to 13135 // include in API requests with the JSON null value. By default, fields 13136 // with empty values are omitted from API requests. However, any field 13137 // with an empty value appearing in NullFields will be sent to the 13138 // server as null. It is an error if a field in this list has a 13139 // non-empty value. This may be used to include null fields in Patch 13140 // requests. 13141 NullFields []string `json:"-"` 13142} 13143 13144func (s *PurgeProductsRequest) MarshalJSON() ([]byte, error) { 13145 type NoMethod PurgeProductsRequest 13146 raw := NoMethod(*s) 13147 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 13148} 13149 13150// ReferenceImage: A `ReferenceImage` represents a product image and its 13151// associated metadata, such as bounding boxes. 13152type ReferenceImage struct { 13153 // BoundingPolys: Optional. Bounding polygons around the areas of 13154 // interest in the reference image. If this field is empty, the system 13155 // will try to detect regions of interest. At most 10 bounding polygons 13156 // will be used. The provided shape is converted into a non-rotated 13157 // rectangle. Once converted, the small edge of the rectangle must be 13158 // greater than or equal to 300 pixels. The aspect ratio must be 1:4 or 13159 // less (i.e. 1:3 is ok; 1:5 is not). 13160 BoundingPolys []*BoundingPoly `json:"boundingPolys,omitempty"` 13161 13162 // Name: The resource name of the reference image. Format is: 13163 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceIma 13164 // ges/IMAGE_ID`. This field is ignored when creating a reference image. 13165 Name string `json:"name,omitempty"` 13166 13167 // Uri: Required. The Google Cloud Storage URI of the reference image. 13168 // The URI must start with `gs://`. 13169 Uri string `json:"uri,omitempty"` 13170 13171 // ServerResponse contains the HTTP response code and headers from the 13172 // server. 13173 googleapi.ServerResponse `json:"-"` 13174 13175 // ForceSendFields is a list of field names (e.g. "BoundingPolys") to 13176 // unconditionally include in API requests. By default, fields with 13177 // empty values are omitted from API requests. However, any non-pointer, 13178 // non-interface field appearing in ForceSendFields will be sent to the 13179 // server regardless of whether the field is empty or not. This may be 13180 // used to include empty fields in Patch requests. 13181 ForceSendFields []string `json:"-"` 13182 13183 // NullFields is a list of field names (e.g. "BoundingPolys") to include 13184 // in API requests with the JSON null value. By default, fields with 13185 // empty values are omitted from API requests. However, any field with 13186 // an empty value appearing in NullFields will be sent to the server as 13187 // null. It is an error if a field in this list has a non-empty value. 13188 // This may be used to include null fields in Patch requests. 13189 NullFields []string `json:"-"` 13190} 13191 13192func (s *ReferenceImage) MarshalJSON() ([]byte, error) { 13193 type NoMethod ReferenceImage 13194 raw := NoMethod(*s) 13195 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 13196} 13197 13198// RemoveProductFromProductSetRequest: Request message for the 13199// `RemoveProductFromProductSet` method. 13200type RemoveProductFromProductSetRequest struct { 13201 // Product: Required. The resource name for the Product to be removed 13202 // from this ProductSet. Format is: 13203 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` 13204 Product string `json:"product,omitempty"` 13205 13206 // ForceSendFields is a list of field names (e.g. "Product") to 13207 // unconditionally include in API requests. By default, fields with 13208 // empty values are omitted from API requests. However, any non-pointer, 13209 // non-interface field appearing in ForceSendFields will be sent to the 13210 // server regardless of whether the field is empty or not. This may be 13211 // used to include empty fields in Patch requests. 13212 ForceSendFields []string `json:"-"` 13213 13214 // NullFields is a list of field names (e.g. "Product") to include in 13215 // API requests with the JSON null value. By default, fields with empty 13216 // values are omitted from API requests. However, any field with an 13217 // empty value appearing in NullFields will be sent to the server as 13218 // null. It is an error if a field in this list has a non-empty value. 13219 // This may be used to include null fields in Patch requests. 13220 NullFields []string `json:"-"` 13221} 13222 13223func (s *RemoveProductFromProductSetRequest) MarshalJSON() ([]byte, error) { 13224 type NoMethod RemoveProductFromProductSetRequest 13225 raw := NoMethod(*s) 13226 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 13227} 13228 13229// Result: Information about a product. 13230type Result struct { 13231 // Image: The resource name of the image from the product that is the 13232 // closest match to the query. 13233 Image string `json:"image,omitempty"` 13234 13235 // Product: The Product. 13236 Product *Product `json:"product,omitempty"` 13237 13238 // Score: A confidence level on the match, ranging from 0 (no 13239 // confidence) to 1 (full confidence). 13240 Score float64 `json:"score,omitempty"` 13241 13242 // ForceSendFields is a list of field names (e.g. "Image") to 13243 // unconditionally include in API requests. By default, fields with 13244 // empty values are omitted from API requests. However, any non-pointer, 13245 // non-interface field appearing in ForceSendFields will be sent to the 13246 // server regardless of whether the field is empty or not. This may be 13247 // used to include empty fields in Patch requests. 13248 ForceSendFields []string `json:"-"` 13249 13250 // NullFields is a list of field names (e.g. "Image") to include in API 13251 // requests with the JSON null value. By default, fields with empty 13252 // values are omitted from API requests. However, any field with an 13253 // empty value appearing in NullFields will be sent to the server as 13254 // null. It is an error if a field in this list has a non-empty value. 13255 // This may be used to include null fields in Patch requests. 13256 NullFields []string `json:"-"` 13257} 13258 13259func (s *Result) MarshalJSON() ([]byte, error) { 13260 type NoMethod Result 13261 raw := NoMethod(*s) 13262 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 13263} 13264 13265func (s *Result) UnmarshalJSON(data []byte) error { 13266 type NoMethod Result 13267 var s1 struct { 13268 Score gensupport.JSONFloat64 `json:"score"` 13269 *NoMethod 13270 } 13271 s1.NoMethod = (*NoMethod)(s) 13272 if err := json.Unmarshal(data, &s1); err != nil { 13273 return err 13274 } 13275 s.Score = float64(s1.Score) 13276 return nil 13277} 13278 13279// SafeSearchAnnotation: Set of features pertaining to the image, 13280// computed by computer vision methods over safe-search verticals (for 13281// example, adult, spoof, medical, violence). 13282type SafeSearchAnnotation struct { 13283 // Adult: Represents the adult content likelihood for the image. Adult 13284 // content may contain elements such as nudity, pornographic images or 13285 // cartoons, or sexual activities. 13286 // 13287 // Possible values: 13288 // "UNKNOWN" - Unknown likelihood. 13289 // "VERY_UNLIKELY" - It is very unlikely. 13290 // "UNLIKELY" - It is unlikely. 13291 // "POSSIBLE" - It is possible. 13292 // "LIKELY" - It is likely. 13293 // "VERY_LIKELY" - It is very likely. 13294 Adult string `json:"adult,omitempty"` 13295 13296 // Medical: Likelihood that this is a medical image. 13297 // 13298 // Possible values: 13299 // "UNKNOWN" - Unknown likelihood. 13300 // "VERY_UNLIKELY" - It is very unlikely. 13301 // "UNLIKELY" - It is unlikely. 13302 // "POSSIBLE" - It is possible. 13303 // "LIKELY" - It is likely. 13304 // "VERY_LIKELY" - It is very likely. 13305 Medical string `json:"medical,omitempty"` 13306 13307 // Racy: Likelihood that the request image contains racy content. Racy 13308 // content may include (but is not limited to) skimpy or sheer clothing, 13309 // strategically covered nudity, lewd or provocative poses, or close-ups 13310 // of sensitive body areas. 13311 // 13312 // Possible values: 13313 // "UNKNOWN" - Unknown likelihood. 13314 // "VERY_UNLIKELY" - It is very unlikely. 13315 // "UNLIKELY" - It is unlikely. 13316 // "POSSIBLE" - It is possible. 13317 // "LIKELY" - It is likely. 13318 // "VERY_LIKELY" - It is very likely. 13319 Racy string `json:"racy,omitempty"` 13320 13321 // Spoof: Spoof likelihood. The likelihood that an modification was made 13322 // to the image's canonical version to make it appear funny or 13323 // offensive. 13324 // 13325 // Possible values: 13326 // "UNKNOWN" - Unknown likelihood. 13327 // "VERY_UNLIKELY" - It is very unlikely. 13328 // "UNLIKELY" - It is unlikely. 13329 // "POSSIBLE" - It is possible. 13330 // "LIKELY" - It is likely. 13331 // "VERY_LIKELY" - It is very likely. 13332 Spoof string `json:"spoof,omitempty"` 13333 13334 // Violence: Likelihood that this image contains violent content. 13335 // 13336 // Possible values: 13337 // "UNKNOWN" - Unknown likelihood. 13338 // "VERY_UNLIKELY" - It is very unlikely. 13339 // "UNLIKELY" - It is unlikely. 13340 // "POSSIBLE" - It is possible. 13341 // "LIKELY" - It is likely. 13342 // "VERY_LIKELY" - It is very likely. 13343 Violence string `json:"violence,omitempty"` 13344 13345 // ForceSendFields is a list of field names (e.g. "Adult") to 13346 // unconditionally include in API requests. By default, fields with 13347 // empty values are omitted from API requests. However, any non-pointer, 13348 // non-interface field appearing in ForceSendFields will be sent to the 13349 // server regardless of whether the field is empty or not. This may be 13350 // used to include empty fields in Patch requests. 13351 ForceSendFields []string `json:"-"` 13352 13353 // NullFields is a list of field names (e.g. "Adult") to include in API 13354 // requests with the JSON null value. By default, fields with empty 13355 // values are omitted from API requests. However, any field with an 13356 // empty value appearing in NullFields will be sent to the server as 13357 // null. It is an error if a field in this list has a non-empty value. 13358 // This may be used to include null fields in Patch requests. 13359 NullFields []string `json:"-"` 13360} 13361 13362func (s *SafeSearchAnnotation) MarshalJSON() ([]byte, error) { 13363 type NoMethod SafeSearchAnnotation 13364 raw := NoMethod(*s) 13365 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 13366} 13367 13368// Status: The `Status` type defines a logical error model that is 13369// suitable for different programming environments, including REST APIs 13370// and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each 13371// `Status` message contains three pieces of data: error code, error 13372// message, and error details. You can find out more about this error 13373// model and how to work with it in the [API Design 13374// Guide](https://cloud.google.com/apis/design/errors). 13375type Status struct { 13376 // Code: The status code, which should be an enum value of 13377 // google.rpc.Code. 13378 Code int64 `json:"code,omitempty"` 13379 13380 // Details: A list of messages that carry the error details. There is a 13381 // common set of message types for APIs to use. 13382 Details []googleapi.RawMessage `json:"details,omitempty"` 13383 13384 // Message: A developer-facing error message, which should be in 13385 // English. Any user-facing error message should be localized and sent 13386 // in the google.rpc.Status.details field, or localized by the client. 13387 Message string `json:"message,omitempty"` 13388 13389 // ForceSendFields is a list of field names (e.g. "Code") to 13390 // unconditionally include in API requests. By default, fields with 13391 // empty values are omitted from API requests. However, any non-pointer, 13392 // non-interface field appearing in ForceSendFields will be sent to the 13393 // server regardless of whether the field is empty or not. This may be 13394 // used to include empty fields in Patch requests. 13395 ForceSendFields []string `json:"-"` 13396 13397 // NullFields is a list of field names (e.g. "Code") to include in API 13398 // requests with the JSON null value. By default, fields with empty 13399 // values are omitted from API requests. However, any field with an 13400 // empty value appearing in NullFields will be sent to the server as 13401 // null. It is an error if a field in this list has a non-empty value. 13402 // This may be used to include null fields in Patch requests. 13403 NullFields []string `json:"-"` 13404} 13405 13406func (s *Status) MarshalJSON() ([]byte, error) { 13407 type NoMethod Status 13408 raw := NoMethod(*s) 13409 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 13410} 13411 13412// Symbol: A single symbol representation. 13413type Symbol struct { 13414 // BoundingBox: The bounding box for the symbol. The vertices are in the 13415 // order of top-left, top-right, bottom-right, bottom-left. When a 13416 // rotation of the bounding box is detected the rotation is represented 13417 // as around the top-left corner as defined when the text is read in the 13418 // 'natural' orientation. For example: * when the text is horizontal it 13419 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 13420 // around the top-left corner it becomes: 2----3 | | 1----0 and the 13421 // vertex order will still be (0, 1, 2, 3). 13422 BoundingBox *BoundingPoly `json:"boundingBox,omitempty"` 13423 13424 // Confidence: Confidence of the OCR results for the symbol. Range [0, 13425 // 1]. 13426 Confidence float64 `json:"confidence,omitempty"` 13427 13428 // Property: Additional information detected for the symbol. 13429 Property *TextProperty `json:"property,omitempty"` 13430 13431 // Text: The actual UTF-8 representation of the symbol. 13432 Text string `json:"text,omitempty"` 13433 13434 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 13435 // unconditionally include in API requests. By default, fields with 13436 // empty values are omitted from API requests. However, any non-pointer, 13437 // non-interface field appearing in ForceSendFields will be sent to the 13438 // server regardless of whether the field is empty or not. This may be 13439 // used to include empty fields in Patch requests. 13440 ForceSendFields []string `json:"-"` 13441 13442 // NullFields is a list of field names (e.g. "BoundingBox") to include 13443 // in API requests with the JSON null value. By default, fields with 13444 // empty values are omitted from API requests. However, any field with 13445 // an empty value appearing in NullFields will be sent to the server as 13446 // null. It is an error if a field in this list has a non-empty value. 13447 // This may be used to include null fields in Patch requests. 13448 NullFields []string `json:"-"` 13449} 13450 13451func (s *Symbol) MarshalJSON() ([]byte, error) { 13452 type NoMethod Symbol 13453 raw := NoMethod(*s) 13454 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 13455} 13456 13457func (s *Symbol) UnmarshalJSON(data []byte) error { 13458 type NoMethod Symbol 13459 var s1 struct { 13460 Confidence gensupport.JSONFloat64 `json:"confidence"` 13461 *NoMethod 13462 } 13463 s1.NoMethod = (*NoMethod)(s) 13464 if err := json.Unmarshal(data, &s1); err != nil { 13465 return err 13466 } 13467 s.Confidence = float64(s1.Confidence) 13468 return nil 13469} 13470 13471// TextAnnotation: TextAnnotation contains a structured representation 13472// of OCR extracted text. The hierarchy of an OCR extracted text 13473// structure is like this: TextAnnotation -> Page -> Block -> Paragraph 13474// -> Word -> Symbol Each structural component, starting from Page, may 13475// further have their own properties. Properties describe detected 13476// languages, breaks etc.. Please refer to the 13477// TextAnnotation.TextProperty message definition below for more detail. 13478type TextAnnotation struct { 13479 // Pages: List of pages detected by OCR. 13480 Pages []*Page `json:"pages,omitempty"` 13481 13482 // Text: UTF-8 text detected on the pages. 13483 Text string `json:"text,omitempty"` 13484 13485 // ForceSendFields is a list of field names (e.g. "Pages") to 13486 // unconditionally include in API requests. By default, fields with 13487 // empty values are omitted from API requests. However, any non-pointer, 13488 // non-interface field appearing in ForceSendFields will be sent to the 13489 // server regardless of whether the field is empty or not. This may be 13490 // used to include empty fields in Patch requests. 13491 ForceSendFields []string `json:"-"` 13492 13493 // NullFields is a list of field names (e.g. "Pages") to include in API 13494 // requests with the JSON null value. By default, fields with empty 13495 // values are omitted from API requests. However, any field with an 13496 // empty value appearing in NullFields will be sent to the server as 13497 // null. It is an error if a field in this list has a non-empty value. 13498 // This may be used to include null fields in Patch requests. 13499 NullFields []string `json:"-"` 13500} 13501 13502func (s *TextAnnotation) MarshalJSON() ([]byte, error) { 13503 type NoMethod TextAnnotation 13504 raw := NoMethod(*s) 13505 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 13506} 13507 13508// TextProperty: Additional information detected on the structural 13509// component. 13510type TextProperty struct { 13511 // DetectedBreak: Detected start or end of a text segment. 13512 DetectedBreak *DetectedBreak `json:"detectedBreak,omitempty"` 13513 13514 // DetectedLanguages: A list of detected languages together with 13515 // confidence. 13516 DetectedLanguages []*DetectedLanguage `json:"detectedLanguages,omitempty"` 13517 13518 // ForceSendFields is a list of field names (e.g. "DetectedBreak") to 13519 // unconditionally include in API requests. By default, fields with 13520 // empty values are omitted from API requests. However, any non-pointer, 13521 // non-interface field appearing in ForceSendFields will be sent to the 13522 // server regardless of whether the field is empty or not. This may be 13523 // used to include empty fields in Patch requests. 13524 ForceSendFields []string `json:"-"` 13525 13526 // NullFields is a list of field names (e.g. "DetectedBreak") to include 13527 // in API requests with the JSON null value. By default, fields with 13528 // empty values are omitted from API requests. However, any field with 13529 // an empty value appearing in NullFields will be sent to the server as 13530 // null. It is an error if a field in this list has a non-empty value. 13531 // This may be used to include null fields in Patch requests. 13532 NullFields []string `json:"-"` 13533} 13534 13535func (s *TextProperty) MarshalJSON() ([]byte, error) { 13536 type NoMethod TextProperty 13537 raw := NoMethod(*s) 13538 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 13539} 13540 13541// Vertex: A vertex represents a 2D point in the image. NOTE: the vertex 13542// coordinates are in the same scale as the original image. 13543type Vertex struct { 13544 // X: X coordinate. 13545 X int64 `json:"x,omitempty"` 13546 13547 // Y: Y coordinate. 13548 Y int64 `json:"y,omitempty"` 13549 13550 // ForceSendFields is a list of field names (e.g. "X") to 13551 // unconditionally include in API requests. By default, fields with 13552 // empty values are omitted from API requests. However, any non-pointer, 13553 // non-interface field appearing in ForceSendFields will be sent to the 13554 // server regardless of whether the field is empty or not. This may be 13555 // used to include empty fields in Patch requests. 13556 ForceSendFields []string `json:"-"` 13557 13558 // NullFields is a list of field names (e.g. "X") to include in API 13559 // requests with the JSON null value. By default, fields with empty 13560 // values are omitted from API requests. However, any field with an 13561 // empty value appearing in NullFields will be sent to the server as 13562 // null. It is an error if a field in this list has a non-empty value. 13563 // This may be used to include null fields in Patch requests. 13564 NullFields []string `json:"-"` 13565} 13566 13567func (s *Vertex) MarshalJSON() ([]byte, error) { 13568 type NoMethod Vertex 13569 raw := NoMethod(*s) 13570 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 13571} 13572 13573// WebDetection: Relevant information for the image from the Internet. 13574type WebDetection struct { 13575 // BestGuessLabels: The service's best guess as to the topic of the 13576 // request image. Inferred from similar images on the open web. 13577 BestGuessLabels []*WebLabel `json:"bestGuessLabels,omitempty"` 13578 13579 // FullMatchingImages: Fully matching images from the Internet. Can 13580 // include resized copies of the query image. 13581 FullMatchingImages []*WebImage `json:"fullMatchingImages,omitempty"` 13582 13583 // PagesWithMatchingImages: Web pages containing the matching images 13584 // from the Internet. 13585 PagesWithMatchingImages []*WebPage `json:"pagesWithMatchingImages,omitempty"` 13586 13587 // PartialMatchingImages: Partial matching images from the Internet. 13588 // Those images are similar enough to share some key-point features. For 13589 // example an original image will likely have partial matching for its 13590 // crops. 13591 PartialMatchingImages []*WebImage `json:"partialMatchingImages,omitempty"` 13592 13593 // VisuallySimilarImages: The visually similar image results. 13594 VisuallySimilarImages []*WebImage `json:"visuallySimilarImages,omitempty"` 13595 13596 // WebEntities: Deduced entities from similar images on the Internet. 13597 WebEntities []*WebEntity `json:"webEntities,omitempty"` 13598 13599 // ForceSendFields is a list of field names (e.g. "BestGuessLabels") to 13600 // unconditionally include in API requests. By default, fields with 13601 // empty values are omitted from API requests. However, any non-pointer, 13602 // non-interface field appearing in ForceSendFields will be sent to the 13603 // server regardless of whether the field is empty or not. This may be 13604 // used to include empty fields in Patch requests. 13605 ForceSendFields []string `json:"-"` 13606 13607 // NullFields is a list of field names (e.g. "BestGuessLabels") to 13608 // include in API requests with the JSON null value. By default, fields 13609 // with empty values are omitted from API requests. However, any field 13610 // with an empty value appearing in NullFields will be sent to the 13611 // server as null. It is an error if a field in this list has a 13612 // non-empty value. This may be used to include null fields in Patch 13613 // requests. 13614 NullFields []string `json:"-"` 13615} 13616 13617func (s *WebDetection) MarshalJSON() ([]byte, error) { 13618 type NoMethod WebDetection 13619 raw := NoMethod(*s) 13620 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 13621} 13622 13623// WebDetectionParams: Parameters for web detection request. 13624type WebDetectionParams struct { 13625 // IncludeGeoResults: Whether to include results derived from the geo 13626 // information in the image. 13627 IncludeGeoResults bool `json:"includeGeoResults,omitempty"` 13628 13629 // ForceSendFields is a list of field names (e.g. "IncludeGeoResults") 13630 // to unconditionally include in API requests. By default, fields with 13631 // empty values are omitted from API requests. However, any non-pointer, 13632 // non-interface field appearing in ForceSendFields will be sent to the 13633 // server regardless of whether the field is empty or not. This may be 13634 // used to include empty fields in Patch requests. 13635 ForceSendFields []string `json:"-"` 13636 13637 // NullFields is a list of field names (e.g. "IncludeGeoResults") to 13638 // include in API requests with the JSON null value. By default, fields 13639 // with empty values are omitted from API requests. However, any field 13640 // with an empty value appearing in NullFields will be sent to the 13641 // server as null. It is an error if a field in this list has a 13642 // non-empty value. This may be used to include null fields in Patch 13643 // requests. 13644 NullFields []string `json:"-"` 13645} 13646 13647func (s *WebDetectionParams) MarshalJSON() ([]byte, error) { 13648 type NoMethod WebDetectionParams 13649 raw := NoMethod(*s) 13650 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 13651} 13652 13653// WebEntity: Entity deduced from similar images on the Internet. 13654type WebEntity struct { 13655 // Description: Canonical description of the entity, in English. 13656 Description string `json:"description,omitempty"` 13657 13658 // EntityId: Opaque entity ID. 13659 EntityId string `json:"entityId,omitempty"` 13660 13661 // Score: Overall relevancy score for the entity. Not normalized and not 13662 // comparable across different image queries. 13663 Score float64 `json:"score,omitempty"` 13664 13665 // ForceSendFields is a list of field names (e.g. "Description") to 13666 // unconditionally include in API requests. By default, fields with 13667 // empty values are omitted from API requests. However, any non-pointer, 13668 // non-interface field appearing in ForceSendFields will be sent to the 13669 // server regardless of whether the field is empty or not. This may be 13670 // used to include empty fields in Patch requests. 13671 ForceSendFields []string `json:"-"` 13672 13673 // NullFields is a list of field names (e.g. "Description") to include 13674 // in API requests with the JSON null value. By default, fields with 13675 // empty values are omitted from API requests. However, any field with 13676 // an empty value appearing in NullFields will be sent to the server as 13677 // null. It is an error if a field in this list has a non-empty value. 13678 // This may be used to include null fields in Patch requests. 13679 NullFields []string `json:"-"` 13680} 13681 13682func (s *WebEntity) MarshalJSON() ([]byte, error) { 13683 type NoMethod WebEntity 13684 raw := NoMethod(*s) 13685 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 13686} 13687 13688func (s *WebEntity) UnmarshalJSON(data []byte) error { 13689 type NoMethod WebEntity 13690 var s1 struct { 13691 Score gensupport.JSONFloat64 `json:"score"` 13692 *NoMethod 13693 } 13694 s1.NoMethod = (*NoMethod)(s) 13695 if err := json.Unmarshal(data, &s1); err != nil { 13696 return err 13697 } 13698 s.Score = float64(s1.Score) 13699 return nil 13700} 13701 13702// WebImage: Metadata for online images. 13703type WebImage struct { 13704 // Score: (Deprecated) Overall relevancy score for the image. 13705 Score float64 `json:"score,omitempty"` 13706 13707 // Url: The result image URL. 13708 Url string `json:"url,omitempty"` 13709 13710 // ForceSendFields is a list of field names (e.g. "Score") to 13711 // unconditionally include in API requests. By default, fields with 13712 // empty values are omitted from API requests. However, any non-pointer, 13713 // non-interface field appearing in ForceSendFields will be sent to the 13714 // server regardless of whether the field is empty or not. This may be 13715 // used to include empty fields in Patch requests. 13716 ForceSendFields []string `json:"-"` 13717 13718 // NullFields is a list of field names (e.g. "Score") to include in API 13719 // requests with the JSON null value. By default, fields with empty 13720 // values are omitted from API requests. However, any field with an 13721 // empty value appearing in NullFields will be sent to the server as 13722 // null. It is an error if a field in this list has a non-empty value. 13723 // This may be used to include null fields in Patch requests. 13724 NullFields []string `json:"-"` 13725} 13726 13727func (s *WebImage) MarshalJSON() ([]byte, error) { 13728 type NoMethod WebImage 13729 raw := NoMethod(*s) 13730 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 13731} 13732 13733func (s *WebImage) UnmarshalJSON(data []byte) error { 13734 type NoMethod WebImage 13735 var s1 struct { 13736 Score gensupport.JSONFloat64 `json:"score"` 13737 *NoMethod 13738 } 13739 s1.NoMethod = (*NoMethod)(s) 13740 if err := json.Unmarshal(data, &s1); err != nil { 13741 return err 13742 } 13743 s.Score = float64(s1.Score) 13744 return nil 13745} 13746 13747// WebLabel: Label to provide extra metadata for the web detection. 13748type WebLabel struct { 13749 // Label: Label for extra metadata. 13750 Label string `json:"label,omitempty"` 13751 13752 // LanguageCode: The BCP-47 language code for `label`, such as "en-US" 13753 // or "sr-Latn". For more information, see 13754 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 13755 LanguageCode string `json:"languageCode,omitempty"` 13756 13757 // ForceSendFields is a list of field names (e.g. "Label") to 13758 // unconditionally include in API requests. By default, fields with 13759 // empty values are omitted from API requests. However, any non-pointer, 13760 // non-interface field appearing in ForceSendFields will be sent to the 13761 // server regardless of whether the field is empty or not. This may be 13762 // used to include empty fields in Patch requests. 13763 ForceSendFields []string `json:"-"` 13764 13765 // NullFields is a list of field names (e.g. "Label") to include in API 13766 // requests with the JSON null value. By default, fields with empty 13767 // values are omitted from API requests. However, any field with an 13768 // empty value appearing in NullFields will be sent to the server as 13769 // null. It is an error if a field in this list has a non-empty value. 13770 // This may be used to include null fields in Patch requests. 13771 NullFields []string `json:"-"` 13772} 13773 13774func (s *WebLabel) MarshalJSON() ([]byte, error) { 13775 type NoMethod WebLabel 13776 raw := NoMethod(*s) 13777 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 13778} 13779 13780// WebPage: Metadata for web pages. 13781type WebPage struct { 13782 // FullMatchingImages: Fully matching images on the page. Can include 13783 // resized copies of the query image. 13784 FullMatchingImages []*WebImage `json:"fullMatchingImages,omitempty"` 13785 13786 // PageTitle: Title for the web page, may contain HTML markups. 13787 PageTitle string `json:"pageTitle,omitempty"` 13788 13789 // PartialMatchingImages: Partial matching images on the page. Those 13790 // images are similar enough to share some key-point features. For 13791 // example an original image will likely have partial matching for its 13792 // crops. 13793 PartialMatchingImages []*WebImage `json:"partialMatchingImages,omitempty"` 13794 13795 // Score: (Deprecated) Overall relevancy score for the web page. 13796 Score float64 `json:"score,omitempty"` 13797 13798 // Url: The result web page URL. 13799 Url string `json:"url,omitempty"` 13800 13801 // ForceSendFields is a list of field names (e.g. "FullMatchingImages") 13802 // to unconditionally include in API requests. By default, fields with 13803 // empty values are omitted from API requests. However, any non-pointer, 13804 // non-interface field appearing in ForceSendFields will be sent to the 13805 // server regardless of whether the field is empty or not. This may be 13806 // used to include empty fields in Patch requests. 13807 ForceSendFields []string `json:"-"` 13808 13809 // NullFields is a list of field names (e.g. "FullMatchingImages") to 13810 // include in API requests with the JSON null value. By default, fields 13811 // with empty values are omitted from API requests. However, any field 13812 // with an empty value appearing in NullFields will be sent to the 13813 // server as null. It is an error if a field in this list has a 13814 // non-empty value. This may be used to include null fields in Patch 13815 // requests. 13816 NullFields []string `json:"-"` 13817} 13818 13819func (s *WebPage) MarshalJSON() ([]byte, error) { 13820 type NoMethod WebPage 13821 raw := NoMethod(*s) 13822 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 13823} 13824 13825func (s *WebPage) UnmarshalJSON(data []byte) error { 13826 type NoMethod WebPage 13827 var s1 struct { 13828 Score gensupport.JSONFloat64 `json:"score"` 13829 *NoMethod 13830 } 13831 s1.NoMethod = (*NoMethod)(s) 13832 if err := json.Unmarshal(data, &s1); err != nil { 13833 return err 13834 } 13835 s.Score = float64(s1.Score) 13836 return nil 13837} 13838 13839// Word: A word representation. 13840type Word struct { 13841 // BoundingBox: The bounding box for the word. The vertices are in the 13842 // order of top-left, top-right, bottom-right, bottom-left. When a 13843 // rotation of the bounding box is detected the rotation is represented 13844 // as around the top-left corner as defined when the text is read in the 13845 // 'natural' orientation. For example: * when the text is horizontal it 13846 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 13847 // around the top-left corner it becomes: 2----3 | | 1----0 and the 13848 // vertex order will still be (0, 1, 2, 3). 13849 BoundingBox *BoundingPoly `json:"boundingBox,omitempty"` 13850 13851 // Confidence: Confidence of the OCR results for the word. Range [0, 1]. 13852 Confidence float64 `json:"confidence,omitempty"` 13853 13854 // Property: Additional information detected for the word. 13855 Property *TextProperty `json:"property,omitempty"` 13856 13857 // Symbols: List of symbols in the word. The order of the symbols 13858 // follows the natural reading order. 13859 Symbols []*Symbol `json:"symbols,omitempty"` 13860 13861 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 13862 // unconditionally include in API requests. By default, fields with 13863 // empty values are omitted from API requests. However, any non-pointer, 13864 // non-interface field appearing in ForceSendFields will be sent to the 13865 // server regardless of whether the field is empty or not. This may be 13866 // used to include empty fields in Patch requests. 13867 ForceSendFields []string `json:"-"` 13868 13869 // NullFields is a list of field names (e.g. "BoundingBox") to include 13870 // in API requests with the JSON null value. By default, fields with 13871 // empty values are omitted from API requests. However, any field with 13872 // an empty value appearing in NullFields will be sent to the server as 13873 // null. It is an error if a field in this list has a non-empty value. 13874 // This may be used to include null fields in Patch requests. 13875 NullFields []string `json:"-"` 13876} 13877 13878func (s *Word) MarshalJSON() ([]byte, error) { 13879 type NoMethod Word 13880 raw := NoMethod(*s) 13881 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 13882} 13883 13884func (s *Word) UnmarshalJSON(data []byte) error { 13885 type NoMethod Word 13886 var s1 struct { 13887 Confidence gensupport.JSONFloat64 `json:"confidence"` 13888 *NoMethod 13889 } 13890 s1.NoMethod = (*NoMethod)(s) 13891 if err := json.Unmarshal(data, &s1); err != nil { 13892 return err 13893 } 13894 s.Confidence = float64(s1.Confidence) 13895 return nil 13896} 13897 13898// method id "vision.files.annotate": 13899 13900type FilesAnnotateCall struct { 13901 s *Service 13902 batchannotatefilesrequest *BatchAnnotateFilesRequest 13903 urlParams_ gensupport.URLParams 13904 ctx_ context.Context 13905 header_ http.Header 13906} 13907 13908// Annotate: Service that performs image detection and annotation for a 13909// batch of files. Now only "application/pdf", "image/tiff" and 13910// "image/gif" are supported. This service will extract at most 5 13911// (customers can specify which 5 in AnnotateFileRequest.pages) frames 13912// (gif) or pages (pdf or tiff) from each file provided and perform 13913// detection and annotation for each image extracted. 13914func (r *FilesService) Annotate(batchannotatefilesrequest *BatchAnnotateFilesRequest) *FilesAnnotateCall { 13915 c := &FilesAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13916 c.batchannotatefilesrequest = batchannotatefilesrequest 13917 return c 13918} 13919 13920// Fields allows partial responses to be retrieved. See 13921// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13922// for more information. 13923func (c *FilesAnnotateCall) Fields(s ...googleapi.Field) *FilesAnnotateCall { 13924 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13925 return c 13926} 13927 13928// Context sets the context to be used in this call's Do method. Any 13929// pending HTTP request will be aborted if the provided context is 13930// canceled. 13931func (c *FilesAnnotateCall) Context(ctx context.Context) *FilesAnnotateCall { 13932 c.ctx_ = ctx 13933 return c 13934} 13935 13936// Header returns an http.Header that can be modified by the caller to 13937// add HTTP headers to the request. 13938func (c *FilesAnnotateCall) Header() http.Header { 13939 if c.header_ == nil { 13940 c.header_ = make(http.Header) 13941 } 13942 return c.header_ 13943} 13944 13945func (c *FilesAnnotateCall) doRequest(alt string) (*http.Response, error) { 13946 reqHeaders := make(http.Header) 13947 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 13948 for k, v := range c.header_ { 13949 reqHeaders[k] = v 13950 } 13951 reqHeaders.Set("User-Agent", c.s.userAgent()) 13952 var body io.Reader = nil 13953 body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchannotatefilesrequest) 13954 if err != nil { 13955 return nil, err 13956 } 13957 reqHeaders.Set("Content-Type", "application/json") 13958 c.urlParams_.Set("alt", alt) 13959 c.urlParams_.Set("prettyPrint", "false") 13960 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/files:annotate") 13961 urls += "?" + c.urlParams_.Encode() 13962 req, err := http.NewRequest("POST", urls, body) 13963 if err != nil { 13964 return nil, err 13965 } 13966 req.Header = reqHeaders 13967 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13968} 13969 13970// Do executes the "vision.files.annotate" call. 13971// Exactly one of *BatchAnnotateFilesResponse or error will be non-nil. 13972// Any non-2xx status code is an error. Response headers are in either 13973// *BatchAnnotateFilesResponse.ServerResponse.Header or (if a response 13974// was returned at all) in error.(*googleapi.Error).Header. Use 13975// googleapi.IsNotModified to check whether the returned error was 13976// because http.StatusNotModified was returned. 13977func (c *FilesAnnotateCall) Do(opts ...googleapi.CallOption) (*BatchAnnotateFilesResponse, error) { 13978 gensupport.SetOptions(c.urlParams_, opts...) 13979 res, err := c.doRequest("json") 13980 if res != nil && res.StatusCode == http.StatusNotModified { 13981 if res.Body != nil { 13982 res.Body.Close() 13983 } 13984 return nil, &googleapi.Error{ 13985 Code: res.StatusCode, 13986 Header: res.Header, 13987 } 13988 } 13989 if err != nil { 13990 return nil, err 13991 } 13992 defer googleapi.CloseBody(res) 13993 if err := googleapi.CheckResponse(res); err != nil { 13994 return nil, err 13995 } 13996 ret := &BatchAnnotateFilesResponse{ 13997 ServerResponse: googleapi.ServerResponse{ 13998 Header: res.Header, 13999 HTTPStatusCode: res.StatusCode, 14000 }, 14001 } 14002 target := &ret 14003 if err := gensupport.DecodeResponse(target, res); err != nil { 14004 return nil, err 14005 } 14006 return ret, nil 14007 // { 14008 // "description": "Service that performs image detection and annotation for a batch of files. Now only \"application/pdf\", \"image/tiff\" and \"image/gif\" are supported. This service will extract at most 5 (customers can specify which 5 in AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each file provided and perform detection and annotation for each image extracted.", 14009 // "flatPath": "v1/files:annotate", 14010 // "httpMethod": "POST", 14011 // "id": "vision.files.annotate", 14012 // "parameterOrder": [], 14013 // "parameters": {}, 14014 // "path": "v1/files:annotate", 14015 // "request": { 14016 // "$ref": "BatchAnnotateFilesRequest" 14017 // }, 14018 // "response": { 14019 // "$ref": "BatchAnnotateFilesResponse" 14020 // }, 14021 // "scopes": [ 14022 // "https://www.googleapis.com/auth/cloud-platform", 14023 // "https://www.googleapis.com/auth/cloud-vision" 14024 // ] 14025 // } 14026 14027} 14028 14029// method id "vision.files.asyncBatchAnnotate": 14030 14031type FilesAsyncBatchAnnotateCall struct { 14032 s *Service 14033 asyncbatchannotatefilesrequest *AsyncBatchAnnotateFilesRequest 14034 urlParams_ gensupport.URLParams 14035 ctx_ context.Context 14036 header_ http.Header 14037} 14038 14039// AsyncBatchAnnotate: Run asynchronous image detection and annotation 14040// for a list of generic files, such as PDF files, which may contain 14041// multiple pages and multiple images per page. Progress and results can 14042// be retrieved through the `google.longrunning.Operations` interface. 14043// `Operation.metadata` contains `OperationMetadata` (metadata). 14044// `Operation.response` contains `AsyncBatchAnnotateFilesResponse` 14045// (results). 14046func (r *FilesService) AsyncBatchAnnotate(asyncbatchannotatefilesrequest *AsyncBatchAnnotateFilesRequest) *FilesAsyncBatchAnnotateCall { 14047 c := &FilesAsyncBatchAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14048 c.asyncbatchannotatefilesrequest = asyncbatchannotatefilesrequest 14049 return c 14050} 14051 14052// Fields allows partial responses to be retrieved. See 14053// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14054// for more information. 14055func (c *FilesAsyncBatchAnnotateCall) Fields(s ...googleapi.Field) *FilesAsyncBatchAnnotateCall { 14056 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14057 return c 14058} 14059 14060// Context sets the context to be used in this call's Do method. Any 14061// pending HTTP request will be aborted if the provided context is 14062// canceled. 14063func (c *FilesAsyncBatchAnnotateCall) Context(ctx context.Context) *FilesAsyncBatchAnnotateCall { 14064 c.ctx_ = ctx 14065 return c 14066} 14067 14068// Header returns an http.Header that can be modified by the caller to 14069// add HTTP headers to the request. 14070func (c *FilesAsyncBatchAnnotateCall) Header() http.Header { 14071 if c.header_ == nil { 14072 c.header_ = make(http.Header) 14073 } 14074 return c.header_ 14075} 14076 14077func (c *FilesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { 14078 reqHeaders := make(http.Header) 14079 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 14080 for k, v := range c.header_ { 14081 reqHeaders[k] = v 14082 } 14083 reqHeaders.Set("User-Agent", c.s.userAgent()) 14084 var body io.Reader = nil 14085 body, err := googleapi.WithoutDataWrapper.JSONReader(c.asyncbatchannotatefilesrequest) 14086 if err != nil { 14087 return nil, err 14088 } 14089 reqHeaders.Set("Content-Type", "application/json") 14090 c.urlParams_.Set("alt", alt) 14091 c.urlParams_.Set("prettyPrint", "false") 14092 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/files:asyncBatchAnnotate") 14093 urls += "?" + c.urlParams_.Encode() 14094 req, err := http.NewRequest("POST", urls, body) 14095 if err != nil { 14096 return nil, err 14097 } 14098 req.Header = reqHeaders 14099 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14100} 14101 14102// Do executes the "vision.files.asyncBatchAnnotate" call. 14103// Exactly one of *Operation or error will be non-nil. Any non-2xx 14104// status code is an error. Response headers are in either 14105// *Operation.ServerResponse.Header or (if a response was returned at 14106// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 14107// to check whether the returned error was because 14108// http.StatusNotModified was returned. 14109func (c *FilesAsyncBatchAnnotateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 14110 gensupport.SetOptions(c.urlParams_, opts...) 14111 res, err := c.doRequest("json") 14112 if res != nil && res.StatusCode == http.StatusNotModified { 14113 if res.Body != nil { 14114 res.Body.Close() 14115 } 14116 return nil, &googleapi.Error{ 14117 Code: res.StatusCode, 14118 Header: res.Header, 14119 } 14120 } 14121 if err != nil { 14122 return nil, err 14123 } 14124 defer googleapi.CloseBody(res) 14125 if err := googleapi.CheckResponse(res); err != nil { 14126 return nil, err 14127 } 14128 ret := &Operation{ 14129 ServerResponse: googleapi.ServerResponse{ 14130 Header: res.Header, 14131 HTTPStatusCode: res.StatusCode, 14132 }, 14133 } 14134 target := &ret 14135 if err := gensupport.DecodeResponse(target, res); err != nil { 14136 return nil, err 14137 } 14138 return ret, nil 14139 // { 14140 // "description": "Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results).", 14141 // "flatPath": "v1/files:asyncBatchAnnotate", 14142 // "httpMethod": "POST", 14143 // "id": "vision.files.asyncBatchAnnotate", 14144 // "parameterOrder": [], 14145 // "parameters": {}, 14146 // "path": "v1/files:asyncBatchAnnotate", 14147 // "request": { 14148 // "$ref": "AsyncBatchAnnotateFilesRequest" 14149 // }, 14150 // "response": { 14151 // "$ref": "Operation" 14152 // }, 14153 // "scopes": [ 14154 // "https://www.googleapis.com/auth/cloud-platform", 14155 // "https://www.googleapis.com/auth/cloud-vision" 14156 // ] 14157 // } 14158 14159} 14160 14161// method id "vision.images.annotate": 14162 14163type ImagesAnnotateCall struct { 14164 s *Service 14165 batchannotateimagesrequest *BatchAnnotateImagesRequest 14166 urlParams_ gensupport.URLParams 14167 ctx_ context.Context 14168 header_ http.Header 14169} 14170 14171// Annotate: Run image detection and annotation for a batch of images. 14172func (r *ImagesService) Annotate(batchannotateimagesrequest *BatchAnnotateImagesRequest) *ImagesAnnotateCall { 14173 c := &ImagesAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14174 c.batchannotateimagesrequest = batchannotateimagesrequest 14175 return c 14176} 14177 14178// Fields allows partial responses to be retrieved. See 14179// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14180// for more information. 14181func (c *ImagesAnnotateCall) Fields(s ...googleapi.Field) *ImagesAnnotateCall { 14182 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14183 return c 14184} 14185 14186// Context sets the context to be used in this call's Do method. Any 14187// pending HTTP request will be aborted if the provided context is 14188// canceled. 14189func (c *ImagesAnnotateCall) Context(ctx context.Context) *ImagesAnnotateCall { 14190 c.ctx_ = ctx 14191 return c 14192} 14193 14194// Header returns an http.Header that can be modified by the caller to 14195// add HTTP headers to the request. 14196func (c *ImagesAnnotateCall) Header() http.Header { 14197 if c.header_ == nil { 14198 c.header_ = make(http.Header) 14199 } 14200 return c.header_ 14201} 14202 14203func (c *ImagesAnnotateCall) doRequest(alt string) (*http.Response, error) { 14204 reqHeaders := make(http.Header) 14205 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 14206 for k, v := range c.header_ { 14207 reqHeaders[k] = v 14208 } 14209 reqHeaders.Set("User-Agent", c.s.userAgent()) 14210 var body io.Reader = nil 14211 body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchannotateimagesrequest) 14212 if err != nil { 14213 return nil, err 14214 } 14215 reqHeaders.Set("Content-Type", "application/json") 14216 c.urlParams_.Set("alt", alt) 14217 c.urlParams_.Set("prettyPrint", "false") 14218 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/images:annotate") 14219 urls += "?" + c.urlParams_.Encode() 14220 req, err := http.NewRequest("POST", urls, body) 14221 if err != nil { 14222 return nil, err 14223 } 14224 req.Header = reqHeaders 14225 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14226} 14227 14228// Do executes the "vision.images.annotate" call. 14229// Exactly one of *BatchAnnotateImagesResponse or error will be non-nil. 14230// Any non-2xx status code is an error. Response headers are in either 14231// *BatchAnnotateImagesResponse.ServerResponse.Header or (if a response 14232// was returned at all) in error.(*googleapi.Error).Header. Use 14233// googleapi.IsNotModified to check whether the returned error was 14234// because http.StatusNotModified was returned. 14235func (c *ImagesAnnotateCall) Do(opts ...googleapi.CallOption) (*BatchAnnotateImagesResponse, error) { 14236 gensupport.SetOptions(c.urlParams_, opts...) 14237 res, err := c.doRequest("json") 14238 if res != nil && res.StatusCode == http.StatusNotModified { 14239 if res.Body != nil { 14240 res.Body.Close() 14241 } 14242 return nil, &googleapi.Error{ 14243 Code: res.StatusCode, 14244 Header: res.Header, 14245 } 14246 } 14247 if err != nil { 14248 return nil, err 14249 } 14250 defer googleapi.CloseBody(res) 14251 if err := googleapi.CheckResponse(res); err != nil { 14252 return nil, err 14253 } 14254 ret := &BatchAnnotateImagesResponse{ 14255 ServerResponse: googleapi.ServerResponse{ 14256 Header: res.Header, 14257 HTTPStatusCode: res.StatusCode, 14258 }, 14259 } 14260 target := &ret 14261 if err := gensupport.DecodeResponse(target, res); err != nil { 14262 return nil, err 14263 } 14264 return ret, nil 14265 // { 14266 // "description": "Run image detection and annotation for a batch of images.", 14267 // "flatPath": "v1/images:annotate", 14268 // "httpMethod": "POST", 14269 // "id": "vision.images.annotate", 14270 // "parameterOrder": [], 14271 // "parameters": {}, 14272 // "path": "v1/images:annotate", 14273 // "request": { 14274 // "$ref": "BatchAnnotateImagesRequest" 14275 // }, 14276 // "response": { 14277 // "$ref": "BatchAnnotateImagesResponse" 14278 // }, 14279 // "scopes": [ 14280 // "https://www.googleapis.com/auth/cloud-platform", 14281 // "https://www.googleapis.com/auth/cloud-vision" 14282 // ] 14283 // } 14284 14285} 14286 14287// method id "vision.images.asyncBatchAnnotate": 14288 14289type ImagesAsyncBatchAnnotateCall struct { 14290 s *Service 14291 asyncbatchannotateimagesrequest *AsyncBatchAnnotateImagesRequest 14292 urlParams_ gensupport.URLParams 14293 ctx_ context.Context 14294 header_ http.Header 14295} 14296 14297// AsyncBatchAnnotate: Run asynchronous image detection and annotation 14298// for a list of images. Progress and results can be retrieved through 14299// the `google.longrunning.Operations` interface. `Operation.metadata` 14300// contains `OperationMetadata` (metadata). `Operation.response` 14301// contains `AsyncBatchAnnotateImagesResponse` (results). This service 14302// will write image annotation outputs to json files in customer GCS 14303// bucket, each json file containing BatchAnnotateImagesResponse proto. 14304func (r *ImagesService) AsyncBatchAnnotate(asyncbatchannotateimagesrequest *AsyncBatchAnnotateImagesRequest) *ImagesAsyncBatchAnnotateCall { 14305 c := &ImagesAsyncBatchAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14306 c.asyncbatchannotateimagesrequest = asyncbatchannotateimagesrequest 14307 return c 14308} 14309 14310// Fields allows partial responses to be retrieved. See 14311// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14312// for more information. 14313func (c *ImagesAsyncBatchAnnotateCall) Fields(s ...googleapi.Field) *ImagesAsyncBatchAnnotateCall { 14314 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14315 return c 14316} 14317 14318// Context sets the context to be used in this call's Do method. Any 14319// pending HTTP request will be aborted if the provided context is 14320// canceled. 14321func (c *ImagesAsyncBatchAnnotateCall) Context(ctx context.Context) *ImagesAsyncBatchAnnotateCall { 14322 c.ctx_ = ctx 14323 return c 14324} 14325 14326// Header returns an http.Header that can be modified by the caller to 14327// add HTTP headers to the request. 14328func (c *ImagesAsyncBatchAnnotateCall) Header() http.Header { 14329 if c.header_ == nil { 14330 c.header_ = make(http.Header) 14331 } 14332 return c.header_ 14333} 14334 14335func (c *ImagesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { 14336 reqHeaders := make(http.Header) 14337 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 14338 for k, v := range c.header_ { 14339 reqHeaders[k] = v 14340 } 14341 reqHeaders.Set("User-Agent", c.s.userAgent()) 14342 var body io.Reader = nil 14343 body, err := googleapi.WithoutDataWrapper.JSONReader(c.asyncbatchannotateimagesrequest) 14344 if err != nil { 14345 return nil, err 14346 } 14347 reqHeaders.Set("Content-Type", "application/json") 14348 c.urlParams_.Set("alt", alt) 14349 c.urlParams_.Set("prettyPrint", "false") 14350 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/images:asyncBatchAnnotate") 14351 urls += "?" + c.urlParams_.Encode() 14352 req, err := http.NewRequest("POST", urls, body) 14353 if err != nil { 14354 return nil, err 14355 } 14356 req.Header = reqHeaders 14357 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14358} 14359 14360// Do executes the "vision.images.asyncBatchAnnotate" call. 14361// Exactly one of *Operation or error will be non-nil. Any non-2xx 14362// status code is an error. Response headers are in either 14363// *Operation.ServerResponse.Header or (if a response was returned at 14364// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 14365// to check whether the returned error was because 14366// http.StatusNotModified was returned. 14367func (c *ImagesAsyncBatchAnnotateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 14368 gensupport.SetOptions(c.urlParams_, opts...) 14369 res, err := c.doRequest("json") 14370 if res != nil && res.StatusCode == http.StatusNotModified { 14371 if res.Body != nil { 14372 res.Body.Close() 14373 } 14374 return nil, &googleapi.Error{ 14375 Code: res.StatusCode, 14376 Header: res.Header, 14377 } 14378 } 14379 if err != nil { 14380 return nil, err 14381 } 14382 defer googleapi.CloseBody(res) 14383 if err := googleapi.CheckResponse(res); err != nil { 14384 return nil, err 14385 } 14386 ret := &Operation{ 14387 ServerResponse: googleapi.ServerResponse{ 14388 Header: res.Header, 14389 HTTPStatusCode: res.StatusCode, 14390 }, 14391 } 14392 target := &ret 14393 if err := gensupport.DecodeResponse(target, res); err != nil { 14394 return nil, err 14395 } 14396 return ret, nil 14397 // { 14398 // "description": "Run asynchronous image detection and annotation for a list of images. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto.", 14399 // "flatPath": "v1/images:asyncBatchAnnotate", 14400 // "httpMethod": "POST", 14401 // "id": "vision.images.asyncBatchAnnotate", 14402 // "parameterOrder": [], 14403 // "parameters": {}, 14404 // "path": "v1/images:asyncBatchAnnotate", 14405 // "request": { 14406 // "$ref": "AsyncBatchAnnotateImagesRequest" 14407 // }, 14408 // "response": { 14409 // "$ref": "Operation" 14410 // }, 14411 // "scopes": [ 14412 // "https://www.googleapis.com/auth/cloud-platform", 14413 // "https://www.googleapis.com/auth/cloud-vision" 14414 // ] 14415 // } 14416 14417} 14418 14419// method id "vision.locations.operations.get": 14420 14421type LocationsOperationsGetCall struct { 14422 s *Service 14423 name string 14424 urlParams_ gensupport.URLParams 14425 ifNoneMatch_ string 14426 ctx_ context.Context 14427 header_ http.Header 14428} 14429 14430// Get: Gets the latest state of a long-running operation. Clients can 14431// use this method to poll the operation result at intervals as 14432// recommended by the API service. 14433func (r *LocationsOperationsService) Get(name string) *LocationsOperationsGetCall { 14434 c := &LocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14435 c.name = name 14436 return c 14437} 14438 14439// Fields allows partial responses to be retrieved. See 14440// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14441// for more information. 14442func (c *LocationsOperationsGetCall) Fields(s ...googleapi.Field) *LocationsOperationsGetCall { 14443 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14444 return c 14445} 14446 14447// IfNoneMatch sets the optional parameter which makes the operation 14448// fail if the object's ETag matches the given value. This is useful for 14449// getting updates only after the object has changed since the last 14450// request. Use googleapi.IsNotModified to check whether the response 14451// error from Do is the result of In-None-Match. 14452func (c *LocationsOperationsGetCall) IfNoneMatch(entityTag string) *LocationsOperationsGetCall { 14453 c.ifNoneMatch_ = entityTag 14454 return c 14455} 14456 14457// Context sets the context to be used in this call's Do method. Any 14458// pending HTTP request will be aborted if the provided context is 14459// canceled. 14460func (c *LocationsOperationsGetCall) Context(ctx context.Context) *LocationsOperationsGetCall { 14461 c.ctx_ = ctx 14462 return c 14463} 14464 14465// Header returns an http.Header that can be modified by the caller to 14466// add HTTP headers to the request. 14467func (c *LocationsOperationsGetCall) Header() http.Header { 14468 if c.header_ == nil { 14469 c.header_ = make(http.Header) 14470 } 14471 return c.header_ 14472} 14473 14474func (c *LocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 14475 reqHeaders := make(http.Header) 14476 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 14477 for k, v := range c.header_ { 14478 reqHeaders[k] = v 14479 } 14480 reqHeaders.Set("User-Agent", c.s.userAgent()) 14481 if c.ifNoneMatch_ != "" { 14482 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14483 } 14484 var body io.Reader = nil 14485 c.urlParams_.Set("alt", alt) 14486 c.urlParams_.Set("prettyPrint", "false") 14487 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 14488 urls += "?" + c.urlParams_.Encode() 14489 req, err := http.NewRequest("GET", urls, body) 14490 if err != nil { 14491 return nil, err 14492 } 14493 req.Header = reqHeaders 14494 googleapi.Expand(req.URL, map[string]string{ 14495 "name": c.name, 14496 }) 14497 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14498} 14499 14500// Do executes the "vision.locations.operations.get" call. 14501// Exactly one of *Operation or error will be non-nil. Any non-2xx 14502// status code is an error. Response headers are in either 14503// *Operation.ServerResponse.Header or (if a response was returned at 14504// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 14505// to check whether the returned error was because 14506// http.StatusNotModified was returned. 14507func (c *LocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 14508 gensupport.SetOptions(c.urlParams_, opts...) 14509 res, err := c.doRequest("json") 14510 if res != nil && res.StatusCode == http.StatusNotModified { 14511 if res.Body != nil { 14512 res.Body.Close() 14513 } 14514 return nil, &googleapi.Error{ 14515 Code: res.StatusCode, 14516 Header: res.Header, 14517 } 14518 } 14519 if err != nil { 14520 return nil, err 14521 } 14522 defer googleapi.CloseBody(res) 14523 if err := googleapi.CheckResponse(res); err != nil { 14524 return nil, err 14525 } 14526 ret := &Operation{ 14527 ServerResponse: googleapi.ServerResponse{ 14528 Header: res.Header, 14529 HTTPStatusCode: res.StatusCode, 14530 }, 14531 } 14532 target := &ret 14533 if err := gensupport.DecodeResponse(target, res); err != nil { 14534 return nil, err 14535 } 14536 return ret, nil 14537 // { 14538 // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", 14539 // "flatPath": "v1/locations/{locationsId}/operations/{operationsId}", 14540 // "httpMethod": "GET", 14541 // "id": "vision.locations.operations.get", 14542 // "parameterOrder": [ 14543 // "name" 14544 // ], 14545 // "parameters": { 14546 // "name": { 14547 // "description": "The name of the operation resource.", 14548 // "location": "path", 14549 // "pattern": "^locations/[^/]+/operations/[^/]+$", 14550 // "required": true, 14551 // "type": "string" 14552 // } 14553 // }, 14554 // "path": "v1/{+name}", 14555 // "response": { 14556 // "$ref": "Operation" 14557 // }, 14558 // "scopes": [ 14559 // "https://www.googleapis.com/auth/cloud-platform", 14560 // "https://www.googleapis.com/auth/cloud-vision" 14561 // ] 14562 // } 14563 14564} 14565 14566// method id "vision.operations.cancel": 14567 14568type OperationsCancelCall struct { 14569 s *Service 14570 name string 14571 canceloperationrequest *CancelOperationRequest 14572 urlParams_ gensupport.URLParams 14573 ctx_ context.Context 14574 header_ http.Header 14575} 14576 14577// Cancel: Starts asynchronous cancellation on a long-running operation. 14578// The server makes a best effort to cancel the operation, but success 14579// is not guaranteed. If the server doesn't support this method, it 14580// returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use 14581// Operations.GetOperation or other methods to check whether the 14582// cancellation succeeded or whether the operation completed despite 14583// cancellation. On successful cancellation, the operation is not 14584// deleted; instead, it becomes an operation with an Operation.error 14585// value with a google.rpc.Status.code of 1, corresponding to 14586// `Code.CANCELLED`. 14587func (r *OperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *OperationsCancelCall { 14588 c := &OperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14589 c.name = name 14590 c.canceloperationrequest = canceloperationrequest 14591 return c 14592} 14593 14594// Fields allows partial responses to be retrieved. See 14595// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14596// for more information. 14597func (c *OperationsCancelCall) Fields(s ...googleapi.Field) *OperationsCancelCall { 14598 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14599 return c 14600} 14601 14602// Context sets the context to be used in this call's Do method. Any 14603// pending HTTP request will be aborted if the provided context is 14604// canceled. 14605func (c *OperationsCancelCall) Context(ctx context.Context) *OperationsCancelCall { 14606 c.ctx_ = ctx 14607 return c 14608} 14609 14610// Header returns an http.Header that can be modified by the caller to 14611// add HTTP headers to the request. 14612func (c *OperationsCancelCall) Header() http.Header { 14613 if c.header_ == nil { 14614 c.header_ = make(http.Header) 14615 } 14616 return c.header_ 14617} 14618 14619func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) { 14620 reqHeaders := make(http.Header) 14621 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 14622 for k, v := range c.header_ { 14623 reqHeaders[k] = v 14624 } 14625 reqHeaders.Set("User-Agent", c.s.userAgent()) 14626 var body io.Reader = nil 14627 body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) 14628 if err != nil { 14629 return nil, err 14630 } 14631 reqHeaders.Set("Content-Type", "application/json") 14632 c.urlParams_.Set("alt", alt) 14633 c.urlParams_.Set("prettyPrint", "false") 14634 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") 14635 urls += "?" + c.urlParams_.Encode() 14636 req, err := http.NewRequest("POST", urls, body) 14637 if err != nil { 14638 return nil, err 14639 } 14640 req.Header = reqHeaders 14641 googleapi.Expand(req.URL, map[string]string{ 14642 "name": c.name, 14643 }) 14644 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14645} 14646 14647// Do executes the "vision.operations.cancel" call. 14648// Exactly one of *Empty or error will be non-nil. Any non-2xx status 14649// code is an error. Response headers are in either 14650// *Empty.ServerResponse.Header or (if a response was returned at all) 14651// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 14652// check whether the returned error was because http.StatusNotModified 14653// was returned. 14654func (c *OperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 14655 gensupport.SetOptions(c.urlParams_, opts...) 14656 res, err := c.doRequest("json") 14657 if res != nil && res.StatusCode == http.StatusNotModified { 14658 if res.Body != nil { 14659 res.Body.Close() 14660 } 14661 return nil, &googleapi.Error{ 14662 Code: res.StatusCode, 14663 Header: res.Header, 14664 } 14665 } 14666 if err != nil { 14667 return nil, err 14668 } 14669 defer googleapi.CloseBody(res) 14670 if err := googleapi.CheckResponse(res); err != nil { 14671 return nil, err 14672 } 14673 ret := &Empty{ 14674 ServerResponse: googleapi.ServerResponse{ 14675 Header: res.Header, 14676 HTTPStatusCode: res.StatusCode, 14677 }, 14678 } 14679 target := &ret 14680 if err := gensupport.DecodeResponse(target, res); err != nil { 14681 return nil, err 14682 } 14683 return ret, nil 14684 // { 14685 // "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.", 14686 // "flatPath": "v1/operations/{operationsId}:cancel", 14687 // "httpMethod": "POST", 14688 // "id": "vision.operations.cancel", 14689 // "parameterOrder": [ 14690 // "name" 14691 // ], 14692 // "parameters": { 14693 // "name": { 14694 // "description": "The name of the operation resource to be cancelled.", 14695 // "location": "path", 14696 // "pattern": "^operations/.*$", 14697 // "required": true, 14698 // "type": "string" 14699 // } 14700 // }, 14701 // "path": "v1/{+name}:cancel", 14702 // "request": { 14703 // "$ref": "CancelOperationRequest" 14704 // }, 14705 // "response": { 14706 // "$ref": "Empty" 14707 // }, 14708 // "scopes": [ 14709 // "https://www.googleapis.com/auth/cloud-platform", 14710 // "https://www.googleapis.com/auth/cloud-vision" 14711 // ] 14712 // } 14713 14714} 14715 14716// method id "vision.operations.delete": 14717 14718type OperationsDeleteCall struct { 14719 s *Service 14720 name string 14721 urlParams_ gensupport.URLParams 14722 ctx_ context.Context 14723 header_ http.Header 14724} 14725 14726// Delete: Deletes a long-running operation. This method indicates that 14727// the client is no longer interested in the operation result. It does 14728// not cancel the operation. If the server doesn't support this method, 14729// it returns `google.rpc.Code.UNIMPLEMENTED`. 14730func (r *OperationsService) Delete(name string) *OperationsDeleteCall { 14731 c := &OperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14732 c.name = name 14733 return c 14734} 14735 14736// Fields allows partial responses to be retrieved. See 14737// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14738// for more information. 14739func (c *OperationsDeleteCall) Fields(s ...googleapi.Field) *OperationsDeleteCall { 14740 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14741 return c 14742} 14743 14744// Context sets the context to be used in this call's Do method. Any 14745// pending HTTP request will be aborted if the provided context is 14746// canceled. 14747func (c *OperationsDeleteCall) Context(ctx context.Context) *OperationsDeleteCall { 14748 c.ctx_ = ctx 14749 return c 14750} 14751 14752// Header returns an http.Header that can be modified by the caller to 14753// add HTTP headers to the request. 14754func (c *OperationsDeleteCall) Header() http.Header { 14755 if c.header_ == nil { 14756 c.header_ = make(http.Header) 14757 } 14758 return c.header_ 14759} 14760 14761func (c *OperationsDeleteCall) doRequest(alt string) (*http.Response, error) { 14762 reqHeaders := make(http.Header) 14763 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 14764 for k, v := range c.header_ { 14765 reqHeaders[k] = v 14766 } 14767 reqHeaders.Set("User-Agent", c.s.userAgent()) 14768 var body io.Reader = nil 14769 c.urlParams_.Set("alt", alt) 14770 c.urlParams_.Set("prettyPrint", "false") 14771 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 14772 urls += "?" + c.urlParams_.Encode() 14773 req, err := http.NewRequest("DELETE", urls, body) 14774 if err != nil { 14775 return nil, err 14776 } 14777 req.Header = reqHeaders 14778 googleapi.Expand(req.URL, map[string]string{ 14779 "name": c.name, 14780 }) 14781 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14782} 14783 14784// Do executes the "vision.operations.delete" call. 14785// Exactly one of *Empty or error will be non-nil. Any non-2xx status 14786// code is an error. Response headers are in either 14787// *Empty.ServerResponse.Header or (if a response was returned at all) 14788// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 14789// check whether the returned error was because http.StatusNotModified 14790// was returned. 14791func (c *OperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 14792 gensupport.SetOptions(c.urlParams_, opts...) 14793 res, err := c.doRequest("json") 14794 if res != nil && res.StatusCode == http.StatusNotModified { 14795 if res.Body != nil { 14796 res.Body.Close() 14797 } 14798 return nil, &googleapi.Error{ 14799 Code: res.StatusCode, 14800 Header: res.Header, 14801 } 14802 } 14803 if err != nil { 14804 return nil, err 14805 } 14806 defer googleapi.CloseBody(res) 14807 if err := googleapi.CheckResponse(res); err != nil { 14808 return nil, err 14809 } 14810 ret := &Empty{ 14811 ServerResponse: googleapi.ServerResponse{ 14812 Header: res.Header, 14813 HTTPStatusCode: res.StatusCode, 14814 }, 14815 } 14816 target := &ret 14817 if err := gensupport.DecodeResponse(target, res); err != nil { 14818 return nil, err 14819 } 14820 return ret, nil 14821 // { 14822 // "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.", 14823 // "flatPath": "v1/operations/{operationsId}", 14824 // "httpMethod": "DELETE", 14825 // "id": "vision.operations.delete", 14826 // "parameterOrder": [ 14827 // "name" 14828 // ], 14829 // "parameters": { 14830 // "name": { 14831 // "description": "The name of the operation resource to be deleted.", 14832 // "location": "path", 14833 // "pattern": "^operations/.*$", 14834 // "required": true, 14835 // "type": "string" 14836 // } 14837 // }, 14838 // "path": "v1/{+name}", 14839 // "response": { 14840 // "$ref": "Empty" 14841 // }, 14842 // "scopes": [ 14843 // "https://www.googleapis.com/auth/cloud-platform", 14844 // "https://www.googleapis.com/auth/cloud-vision" 14845 // ] 14846 // } 14847 14848} 14849 14850// method id "vision.operations.get": 14851 14852type OperationsGetCall struct { 14853 s *Service 14854 name string 14855 urlParams_ gensupport.URLParams 14856 ifNoneMatch_ string 14857 ctx_ context.Context 14858 header_ http.Header 14859} 14860 14861// Get: Gets the latest state of a long-running operation. Clients can 14862// use this method to poll the operation result at intervals as 14863// recommended by the API service. 14864func (r *OperationsService) Get(name string) *OperationsGetCall { 14865 c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14866 c.name = name 14867 return c 14868} 14869 14870// Fields allows partial responses to be retrieved. See 14871// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14872// for more information. 14873func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall { 14874 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14875 return c 14876} 14877 14878// IfNoneMatch sets the optional parameter which makes the operation 14879// fail if the object's ETag matches the given value. This is useful for 14880// getting updates only after the object has changed since the last 14881// request. Use googleapi.IsNotModified to check whether the response 14882// error from Do is the result of In-None-Match. 14883func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall { 14884 c.ifNoneMatch_ = entityTag 14885 return c 14886} 14887 14888// Context sets the context to be used in this call's Do method. Any 14889// pending HTTP request will be aborted if the provided context is 14890// canceled. 14891func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall { 14892 c.ctx_ = ctx 14893 return c 14894} 14895 14896// Header returns an http.Header that can be modified by the caller to 14897// add HTTP headers to the request. 14898func (c *OperationsGetCall) Header() http.Header { 14899 if c.header_ == nil { 14900 c.header_ = make(http.Header) 14901 } 14902 return c.header_ 14903} 14904 14905func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { 14906 reqHeaders := make(http.Header) 14907 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 14908 for k, v := range c.header_ { 14909 reqHeaders[k] = v 14910 } 14911 reqHeaders.Set("User-Agent", c.s.userAgent()) 14912 if c.ifNoneMatch_ != "" { 14913 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14914 } 14915 var body io.Reader = nil 14916 c.urlParams_.Set("alt", alt) 14917 c.urlParams_.Set("prettyPrint", "false") 14918 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 14919 urls += "?" + c.urlParams_.Encode() 14920 req, err := http.NewRequest("GET", urls, body) 14921 if err != nil { 14922 return nil, err 14923 } 14924 req.Header = reqHeaders 14925 googleapi.Expand(req.URL, map[string]string{ 14926 "name": c.name, 14927 }) 14928 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14929} 14930 14931// Do executes the "vision.operations.get" call. 14932// Exactly one of *Operation or error will be non-nil. Any non-2xx 14933// status code is an error. Response headers are in either 14934// *Operation.ServerResponse.Header or (if a response was returned at 14935// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 14936// to check whether the returned error was because 14937// http.StatusNotModified was returned. 14938func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 14939 gensupport.SetOptions(c.urlParams_, opts...) 14940 res, err := c.doRequest("json") 14941 if res != nil && res.StatusCode == http.StatusNotModified { 14942 if res.Body != nil { 14943 res.Body.Close() 14944 } 14945 return nil, &googleapi.Error{ 14946 Code: res.StatusCode, 14947 Header: res.Header, 14948 } 14949 } 14950 if err != nil { 14951 return nil, err 14952 } 14953 defer googleapi.CloseBody(res) 14954 if err := googleapi.CheckResponse(res); err != nil { 14955 return nil, err 14956 } 14957 ret := &Operation{ 14958 ServerResponse: googleapi.ServerResponse{ 14959 Header: res.Header, 14960 HTTPStatusCode: res.StatusCode, 14961 }, 14962 } 14963 target := &ret 14964 if err := gensupport.DecodeResponse(target, res); err != nil { 14965 return nil, err 14966 } 14967 return ret, nil 14968 // { 14969 // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", 14970 // "flatPath": "v1/operations/{operationsId}", 14971 // "httpMethod": "GET", 14972 // "id": "vision.operations.get", 14973 // "parameterOrder": [ 14974 // "name" 14975 // ], 14976 // "parameters": { 14977 // "name": { 14978 // "description": "The name of the operation resource.", 14979 // "location": "path", 14980 // "pattern": "^operations/[^/]+$", 14981 // "required": true, 14982 // "type": "string" 14983 // } 14984 // }, 14985 // "path": "v1/{+name}", 14986 // "response": { 14987 // "$ref": "Operation" 14988 // }, 14989 // "scopes": [ 14990 // "https://www.googleapis.com/auth/cloud-platform", 14991 // "https://www.googleapis.com/auth/cloud-vision" 14992 // ] 14993 // } 14994 14995} 14996 14997// method id "vision.operations.list": 14998 14999type OperationsListCall struct { 15000 s *Service 15001 name string 15002 urlParams_ gensupport.URLParams 15003 ifNoneMatch_ string 15004 ctx_ context.Context 15005 header_ http.Header 15006} 15007 15008// List: Lists operations that match the specified filter in the 15009// request. If the server doesn't support this method, it returns 15010// `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to 15011// override the binding to use different resource name schemes, such as 15012// `users/*/operations`. To override the binding, API services can add a 15013// binding such as "/v1/{name=users/*}/operations" to their service 15014// configuration. For backwards compatibility, the default name includes 15015// the operations collection id, however overriding users must ensure 15016// the name binding is the parent resource, without the operations 15017// collection id. 15018func (r *OperationsService) List(name string) *OperationsListCall { 15019 c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15020 c.name = name 15021 return c 15022} 15023 15024// Filter sets the optional parameter "filter": The standard list 15025// filter. 15026func (c *OperationsListCall) Filter(filter string) *OperationsListCall { 15027 c.urlParams_.Set("filter", filter) 15028 return c 15029} 15030 15031// PageSize sets the optional parameter "pageSize": The standard list 15032// page size. 15033func (c *OperationsListCall) PageSize(pageSize int64) *OperationsListCall { 15034 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 15035 return c 15036} 15037 15038// PageToken sets the optional parameter "pageToken": The standard list 15039// page token. 15040func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall { 15041 c.urlParams_.Set("pageToken", pageToken) 15042 return c 15043} 15044 15045// Fields allows partial responses to be retrieved. See 15046// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15047// for more information. 15048func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall { 15049 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15050 return c 15051} 15052 15053// IfNoneMatch sets the optional parameter which makes the operation 15054// fail if the object's ETag matches the given value. This is useful for 15055// getting updates only after the object has changed since the last 15056// request. Use googleapi.IsNotModified to check whether the response 15057// error from Do is the result of In-None-Match. 15058func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall { 15059 c.ifNoneMatch_ = entityTag 15060 return c 15061} 15062 15063// Context sets the context to be used in this call's Do method. Any 15064// pending HTTP request will be aborted if the provided context is 15065// canceled. 15066func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall { 15067 c.ctx_ = ctx 15068 return c 15069} 15070 15071// Header returns an http.Header that can be modified by the caller to 15072// add HTTP headers to the request. 15073func (c *OperationsListCall) Header() http.Header { 15074 if c.header_ == nil { 15075 c.header_ = make(http.Header) 15076 } 15077 return c.header_ 15078} 15079 15080func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { 15081 reqHeaders := make(http.Header) 15082 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 15083 for k, v := range c.header_ { 15084 reqHeaders[k] = v 15085 } 15086 reqHeaders.Set("User-Agent", c.s.userAgent()) 15087 if c.ifNoneMatch_ != "" { 15088 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 15089 } 15090 var body io.Reader = nil 15091 c.urlParams_.Set("alt", alt) 15092 c.urlParams_.Set("prettyPrint", "false") 15093 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 15094 urls += "?" + c.urlParams_.Encode() 15095 req, err := http.NewRequest("GET", urls, body) 15096 if err != nil { 15097 return nil, err 15098 } 15099 req.Header = reqHeaders 15100 googleapi.Expand(req.URL, map[string]string{ 15101 "name": c.name, 15102 }) 15103 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15104} 15105 15106// Do executes the "vision.operations.list" call. 15107// Exactly one of *ListOperationsResponse or error will be non-nil. Any 15108// non-2xx status code is an error. Response headers are in either 15109// *ListOperationsResponse.ServerResponse.Header or (if a response was 15110// returned at all) in error.(*googleapi.Error).Header. Use 15111// googleapi.IsNotModified to check whether the returned error was 15112// because http.StatusNotModified was returned. 15113func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { 15114 gensupport.SetOptions(c.urlParams_, opts...) 15115 res, err := c.doRequest("json") 15116 if res != nil && res.StatusCode == http.StatusNotModified { 15117 if res.Body != nil { 15118 res.Body.Close() 15119 } 15120 return nil, &googleapi.Error{ 15121 Code: res.StatusCode, 15122 Header: res.Header, 15123 } 15124 } 15125 if err != nil { 15126 return nil, err 15127 } 15128 defer googleapi.CloseBody(res) 15129 if err := googleapi.CheckResponse(res); err != nil { 15130 return nil, err 15131 } 15132 ret := &ListOperationsResponse{ 15133 ServerResponse: googleapi.ServerResponse{ 15134 Header: res.Header, 15135 HTTPStatusCode: res.StatusCode, 15136 }, 15137 } 15138 target := &ret 15139 if err := gensupport.DecodeResponse(target, res); err != nil { 15140 return nil, err 15141 } 15142 return ret, nil 15143 // { 15144 // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `\"/v1/{name=users/*}/operations\"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.", 15145 // "flatPath": "v1/operations", 15146 // "httpMethod": "GET", 15147 // "id": "vision.operations.list", 15148 // "parameterOrder": [ 15149 // "name" 15150 // ], 15151 // "parameters": { 15152 // "filter": { 15153 // "description": "The standard list filter.", 15154 // "location": "query", 15155 // "type": "string" 15156 // }, 15157 // "name": { 15158 // "description": "The name of the operation's parent resource.", 15159 // "location": "path", 15160 // "pattern": "^operations$", 15161 // "required": true, 15162 // "type": "string" 15163 // }, 15164 // "pageSize": { 15165 // "description": "The standard list page size.", 15166 // "format": "int32", 15167 // "location": "query", 15168 // "type": "integer" 15169 // }, 15170 // "pageToken": { 15171 // "description": "The standard list page token.", 15172 // "location": "query", 15173 // "type": "string" 15174 // } 15175 // }, 15176 // "path": "v1/{+name}", 15177 // "response": { 15178 // "$ref": "ListOperationsResponse" 15179 // }, 15180 // "scopes": [ 15181 // "https://www.googleapis.com/auth/cloud-platform", 15182 // "https://www.googleapis.com/auth/cloud-vision" 15183 // ] 15184 // } 15185 15186} 15187 15188// Pages invokes f for each page of results. 15189// A non-nil error returned from f will halt the iteration. 15190// The provided context supersedes any context provided to the Context method. 15191func (c *OperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { 15192 c.ctx_ = ctx 15193 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 15194 for { 15195 x, err := c.Do() 15196 if err != nil { 15197 return err 15198 } 15199 if err := f(x); err != nil { 15200 return err 15201 } 15202 if x.NextPageToken == "" { 15203 return nil 15204 } 15205 c.PageToken(x.NextPageToken) 15206 } 15207} 15208 15209// method id "vision.projects.files.annotate": 15210 15211type ProjectsFilesAnnotateCall struct { 15212 s *Service 15213 parent string 15214 batchannotatefilesrequest *BatchAnnotateFilesRequest 15215 urlParams_ gensupport.URLParams 15216 ctx_ context.Context 15217 header_ http.Header 15218} 15219 15220// Annotate: Service that performs image detection and annotation for a 15221// batch of files. Now only "application/pdf", "image/tiff" and 15222// "image/gif" are supported. This service will extract at most 5 15223// (customers can specify which 5 in AnnotateFileRequest.pages) frames 15224// (gif) or pages (pdf or tiff) from each file provided and perform 15225// detection and annotation for each image extracted. 15226func (r *ProjectsFilesService) Annotate(parent string, batchannotatefilesrequest *BatchAnnotateFilesRequest) *ProjectsFilesAnnotateCall { 15227 c := &ProjectsFilesAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15228 c.parent = parent 15229 c.batchannotatefilesrequest = batchannotatefilesrequest 15230 return c 15231} 15232 15233// Fields allows partial responses to be retrieved. See 15234// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15235// for more information. 15236func (c *ProjectsFilesAnnotateCall) Fields(s ...googleapi.Field) *ProjectsFilesAnnotateCall { 15237 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15238 return c 15239} 15240 15241// Context sets the context to be used in this call's Do method. Any 15242// pending HTTP request will be aborted if the provided context is 15243// canceled. 15244func (c *ProjectsFilesAnnotateCall) Context(ctx context.Context) *ProjectsFilesAnnotateCall { 15245 c.ctx_ = ctx 15246 return c 15247} 15248 15249// Header returns an http.Header that can be modified by the caller to 15250// add HTTP headers to the request. 15251func (c *ProjectsFilesAnnotateCall) Header() http.Header { 15252 if c.header_ == nil { 15253 c.header_ = make(http.Header) 15254 } 15255 return c.header_ 15256} 15257 15258func (c *ProjectsFilesAnnotateCall) doRequest(alt string) (*http.Response, error) { 15259 reqHeaders := make(http.Header) 15260 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 15261 for k, v := range c.header_ { 15262 reqHeaders[k] = v 15263 } 15264 reqHeaders.Set("User-Agent", c.s.userAgent()) 15265 var body io.Reader = nil 15266 body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchannotatefilesrequest) 15267 if err != nil { 15268 return nil, err 15269 } 15270 reqHeaders.Set("Content-Type", "application/json") 15271 c.urlParams_.Set("alt", alt) 15272 c.urlParams_.Set("prettyPrint", "false") 15273 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/files:annotate") 15274 urls += "?" + c.urlParams_.Encode() 15275 req, err := http.NewRequest("POST", urls, body) 15276 if err != nil { 15277 return nil, err 15278 } 15279 req.Header = reqHeaders 15280 googleapi.Expand(req.URL, map[string]string{ 15281 "parent": c.parent, 15282 }) 15283 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15284} 15285 15286// Do executes the "vision.projects.files.annotate" call. 15287// Exactly one of *BatchAnnotateFilesResponse or error will be non-nil. 15288// Any non-2xx status code is an error. Response headers are in either 15289// *BatchAnnotateFilesResponse.ServerResponse.Header or (if a response 15290// was returned at all) in error.(*googleapi.Error).Header. Use 15291// googleapi.IsNotModified to check whether the returned error was 15292// because http.StatusNotModified was returned. 15293func (c *ProjectsFilesAnnotateCall) Do(opts ...googleapi.CallOption) (*BatchAnnotateFilesResponse, error) { 15294 gensupport.SetOptions(c.urlParams_, opts...) 15295 res, err := c.doRequest("json") 15296 if res != nil && res.StatusCode == http.StatusNotModified { 15297 if res.Body != nil { 15298 res.Body.Close() 15299 } 15300 return nil, &googleapi.Error{ 15301 Code: res.StatusCode, 15302 Header: res.Header, 15303 } 15304 } 15305 if err != nil { 15306 return nil, err 15307 } 15308 defer googleapi.CloseBody(res) 15309 if err := googleapi.CheckResponse(res); err != nil { 15310 return nil, err 15311 } 15312 ret := &BatchAnnotateFilesResponse{ 15313 ServerResponse: googleapi.ServerResponse{ 15314 Header: res.Header, 15315 HTTPStatusCode: res.StatusCode, 15316 }, 15317 } 15318 target := &ret 15319 if err := gensupport.DecodeResponse(target, res); err != nil { 15320 return nil, err 15321 } 15322 return ret, nil 15323 // { 15324 // "description": "Service that performs image detection and annotation for a batch of files. Now only \"application/pdf\", \"image/tiff\" and \"image/gif\" are supported. This service will extract at most 5 (customers can specify which 5 in AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each file provided and perform detection and annotation for each image extracted.", 15325 // "flatPath": "v1/projects/{projectsId}/files:annotate", 15326 // "httpMethod": "POST", 15327 // "id": "vision.projects.files.annotate", 15328 // "parameterOrder": [ 15329 // "parent" 15330 // ], 15331 // "parameters": { 15332 // "parent": { 15333 // "description": "Optional. Target project and location to make a call. Format: `projects/{project-id}/locations/{location-id}`. If no parent is specified, a region will be chosen automatically. Supported location-ids: `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: The European Union. Example: `projects/project-A/locations/eu`.", 15334 // "location": "path", 15335 // "pattern": "^projects/[^/]+$", 15336 // "required": true, 15337 // "type": "string" 15338 // } 15339 // }, 15340 // "path": "v1/{+parent}/files:annotate", 15341 // "request": { 15342 // "$ref": "BatchAnnotateFilesRequest" 15343 // }, 15344 // "response": { 15345 // "$ref": "BatchAnnotateFilesResponse" 15346 // }, 15347 // "scopes": [ 15348 // "https://www.googleapis.com/auth/cloud-platform", 15349 // "https://www.googleapis.com/auth/cloud-vision" 15350 // ] 15351 // } 15352 15353} 15354 15355// method id "vision.projects.files.asyncBatchAnnotate": 15356 15357type ProjectsFilesAsyncBatchAnnotateCall struct { 15358 s *Service 15359 parent string 15360 asyncbatchannotatefilesrequest *AsyncBatchAnnotateFilesRequest 15361 urlParams_ gensupport.URLParams 15362 ctx_ context.Context 15363 header_ http.Header 15364} 15365 15366// AsyncBatchAnnotate: Run asynchronous image detection and annotation 15367// for a list of generic files, such as PDF files, which may contain 15368// multiple pages and multiple images per page. Progress and results can 15369// be retrieved through the `google.longrunning.Operations` interface. 15370// `Operation.metadata` contains `OperationMetadata` (metadata). 15371// `Operation.response` contains `AsyncBatchAnnotateFilesResponse` 15372// (results). 15373func (r *ProjectsFilesService) AsyncBatchAnnotate(parent string, asyncbatchannotatefilesrequest *AsyncBatchAnnotateFilesRequest) *ProjectsFilesAsyncBatchAnnotateCall { 15374 c := &ProjectsFilesAsyncBatchAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15375 c.parent = parent 15376 c.asyncbatchannotatefilesrequest = asyncbatchannotatefilesrequest 15377 return c 15378} 15379 15380// Fields allows partial responses to be retrieved. See 15381// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15382// for more information. 15383func (c *ProjectsFilesAsyncBatchAnnotateCall) Fields(s ...googleapi.Field) *ProjectsFilesAsyncBatchAnnotateCall { 15384 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15385 return c 15386} 15387 15388// Context sets the context to be used in this call's Do method. Any 15389// pending HTTP request will be aborted if the provided context is 15390// canceled. 15391func (c *ProjectsFilesAsyncBatchAnnotateCall) Context(ctx context.Context) *ProjectsFilesAsyncBatchAnnotateCall { 15392 c.ctx_ = ctx 15393 return c 15394} 15395 15396// Header returns an http.Header that can be modified by the caller to 15397// add HTTP headers to the request. 15398func (c *ProjectsFilesAsyncBatchAnnotateCall) Header() http.Header { 15399 if c.header_ == nil { 15400 c.header_ = make(http.Header) 15401 } 15402 return c.header_ 15403} 15404 15405func (c *ProjectsFilesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { 15406 reqHeaders := make(http.Header) 15407 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 15408 for k, v := range c.header_ { 15409 reqHeaders[k] = v 15410 } 15411 reqHeaders.Set("User-Agent", c.s.userAgent()) 15412 var body io.Reader = nil 15413 body, err := googleapi.WithoutDataWrapper.JSONReader(c.asyncbatchannotatefilesrequest) 15414 if err != nil { 15415 return nil, err 15416 } 15417 reqHeaders.Set("Content-Type", "application/json") 15418 c.urlParams_.Set("alt", alt) 15419 c.urlParams_.Set("prettyPrint", "false") 15420 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/files:asyncBatchAnnotate") 15421 urls += "?" + c.urlParams_.Encode() 15422 req, err := http.NewRequest("POST", urls, body) 15423 if err != nil { 15424 return nil, err 15425 } 15426 req.Header = reqHeaders 15427 googleapi.Expand(req.URL, map[string]string{ 15428 "parent": c.parent, 15429 }) 15430 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15431} 15432 15433// Do executes the "vision.projects.files.asyncBatchAnnotate" call. 15434// Exactly one of *Operation or error will be non-nil. Any non-2xx 15435// status code is an error. Response headers are in either 15436// *Operation.ServerResponse.Header or (if a response was returned at 15437// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 15438// to check whether the returned error was because 15439// http.StatusNotModified was returned. 15440func (c *ProjectsFilesAsyncBatchAnnotateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 15441 gensupport.SetOptions(c.urlParams_, opts...) 15442 res, err := c.doRequest("json") 15443 if res != nil && res.StatusCode == http.StatusNotModified { 15444 if res.Body != nil { 15445 res.Body.Close() 15446 } 15447 return nil, &googleapi.Error{ 15448 Code: res.StatusCode, 15449 Header: res.Header, 15450 } 15451 } 15452 if err != nil { 15453 return nil, err 15454 } 15455 defer googleapi.CloseBody(res) 15456 if err := googleapi.CheckResponse(res); err != nil { 15457 return nil, err 15458 } 15459 ret := &Operation{ 15460 ServerResponse: googleapi.ServerResponse{ 15461 Header: res.Header, 15462 HTTPStatusCode: res.StatusCode, 15463 }, 15464 } 15465 target := &ret 15466 if err := gensupport.DecodeResponse(target, res); err != nil { 15467 return nil, err 15468 } 15469 return ret, nil 15470 // { 15471 // "description": "Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results).", 15472 // "flatPath": "v1/projects/{projectsId}/files:asyncBatchAnnotate", 15473 // "httpMethod": "POST", 15474 // "id": "vision.projects.files.asyncBatchAnnotate", 15475 // "parameterOrder": [ 15476 // "parent" 15477 // ], 15478 // "parameters": { 15479 // "parent": { 15480 // "description": "Optional. Target project and location to make a call. Format: `projects/{project-id}/locations/{location-id}`. If no parent is specified, a region will be chosen automatically. Supported location-ids: `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: The European Union. Example: `projects/project-A/locations/eu`.", 15481 // "location": "path", 15482 // "pattern": "^projects/[^/]+$", 15483 // "required": true, 15484 // "type": "string" 15485 // } 15486 // }, 15487 // "path": "v1/{+parent}/files:asyncBatchAnnotate", 15488 // "request": { 15489 // "$ref": "AsyncBatchAnnotateFilesRequest" 15490 // }, 15491 // "response": { 15492 // "$ref": "Operation" 15493 // }, 15494 // "scopes": [ 15495 // "https://www.googleapis.com/auth/cloud-platform", 15496 // "https://www.googleapis.com/auth/cloud-vision" 15497 // ] 15498 // } 15499 15500} 15501 15502// method id "vision.projects.images.annotate": 15503 15504type ProjectsImagesAnnotateCall struct { 15505 s *Service 15506 parent string 15507 batchannotateimagesrequest *BatchAnnotateImagesRequest 15508 urlParams_ gensupport.URLParams 15509 ctx_ context.Context 15510 header_ http.Header 15511} 15512 15513// Annotate: Run image detection and annotation for a batch of images. 15514func (r *ProjectsImagesService) Annotate(parent string, batchannotateimagesrequest *BatchAnnotateImagesRequest) *ProjectsImagesAnnotateCall { 15515 c := &ProjectsImagesAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15516 c.parent = parent 15517 c.batchannotateimagesrequest = batchannotateimagesrequest 15518 return c 15519} 15520 15521// Fields allows partial responses to be retrieved. See 15522// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15523// for more information. 15524func (c *ProjectsImagesAnnotateCall) Fields(s ...googleapi.Field) *ProjectsImagesAnnotateCall { 15525 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15526 return c 15527} 15528 15529// Context sets the context to be used in this call's Do method. Any 15530// pending HTTP request will be aborted if the provided context is 15531// canceled. 15532func (c *ProjectsImagesAnnotateCall) Context(ctx context.Context) *ProjectsImagesAnnotateCall { 15533 c.ctx_ = ctx 15534 return c 15535} 15536 15537// Header returns an http.Header that can be modified by the caller to 15538// add HTTP headers to the request. 15539func (c *ProjectsImagesAnnotateCall) Header() http.Header { 15540 if c.header_ == nil { 15541 c.header_ = make(http.Header) 15542 } 15543 return c.header_ 15544} 15545 15546func (c *ProjectsImagesAnnotateCall) doRequest(alt string) (*http.Response, error) { 15547 reqHeaders := make(http.Header) 15548 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 15549 for k, v := range c.header_ { 15550 reqHeaders[k] = v 15551 } 15552 reqHeaders.Set("User-Agent", c.s.userAgent()) 15553 var body io.Reader = nil 15554 body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchannotateimagesrequest) 15555 if err != nil { 15556 return nil, err 15557 } 15558 reqHeaders.Set("Content-Type", "application/json") 15559 c.urlParams_.Set("alt", alt) 15560 c.urlParams_.Set("prettyPrint", "false") 15561 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/images:annotate") 15562 urls += "?" + c.urlParams_.Encode() 15563 req, err := http.NewRequest("POST", urls, body) 15564 if err != nil { 15565 return nil, err 15566 } 15567 req.Header = reqHeaders 15568 googleapi.Expand(req.URL, map[string]string{ 15569 "parent": c.parent, 15570 }) 15571 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15572} 15573 15574// Do executes the "vision.projects.images.annotate" call. 15575// Exactly one of *BatchAnnotateImagesResponse or error will be non-nil. 15576// Any non-2xx status code is an error. Response headers are in either 15577// *BatchAnnotateImagesResponse.ServerResponse.Header or (if a response 15578// was returned at all) in error.(*googleapi.Error).Header. Use 15579// googleapi.IsNotModified to check whether the returned error was 15580// because http.StatusNotModified was returned. 15581func (c *ProjectsImagesAnnotateCall) Do(opts ...googleapi.CallOption) (*BatchAnnotateImagesResponse, error) { 15582 gensupport.SetOptions(c.urlParams_, opts...) 15583 res, err := c.doRequest("json") 15584 if res != nil && res.StatusCode == http.StatusNotModified { 15585 if res.Body != nil { 15586 res.Body.Close() 15587 } 15588 return nil, &googleapi.Error{ 15589 Code: res.StatusCode, 15590 Header: res.Header, 15591 } 15592 } 15593 if err != nil { 15594 return nil, err 15595 } 15596 defer googleapi.CloseBody(res) 15597 if err := googleapi.CheckResponse(res); err != nil { 15598 return nil, err 15599 } 15600 ret := &BatchAnnotateImagesResponse{ 15601 ServerResponse: googleapi.ServerResponse{ 15602 Header: res.Header, 15603 HTTPStatusCode: res.StatusCode, 15604 }, 15605 } 15606 target := &ret 15607 if err := gensupport.DecodeResponse(target, res); err != nil { 15608 return nil, err 15609 } 15610 return ret, nil 15611 // { 15612 // "description": "Run image detection and annotation for a batch of images.", 15613 // "flatPath": "v1/projects/{projectsId}/images:annotate", 15614 // "httpMethod": "POST", 15615 // "id": "vision.projects.images.annotate", 15616 // "parameterOrder": [ 15617 // "parent" 15618 // ], 15619 // "parameters": { 15620 // "parent": { 15621 // "description": "Optional. Target project and location to make a call. Format: `projects/{project-id}/locations/{location-id}`. If no parent is specified, a region will be chosen automatically. Supported location-ids: `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: The European Union. Example: `projects/project-A/locations/eu`.", 15622 // "location": "path", 15623 // "pattern": "^projects/[^/]+$", 15624 // "required": true, 15625 // "type": "string" 15626 // } 15627 // }, 15628 // "path": "v1/{+parent}/images:annotate", 15629 // "request": { 15630 // "$ref": "BatchAnnotateImagesRequest" 15631 // }, 15632 // "response": { 15633 // "$ref": "BatchAnnotateImagesResponse" 15634 // }, 15635 // "scopes": [ 15636 // "https://www.googleapis.com/auth/cloud-platform", 15637 // "https://www.googleapis.com/auth/cloud-vision" 15638 // ] 15639 // } 15640 15641} 15642 15643// method id "vision.projects.images.asyncBatchAnnotate": 15644 15645type ProjectsImagesAsyncBatchAnnotateCall struct { 15646 s *Service 15647 parent string 15648 asyncbatchannotateimagesrequest *AsyncBatchAnnotateImagesRequest 15649 urlParams_ gensupport.URLParams 15650 ctx_ context.Context 15651 header_ http.Header 15652} 15653 15654// AsyncBatchAnnotate: Run asynchronous image detection and annotation 15655// for a list of images. Progress and results can be retrieved through 15656// the `google.longrunning.Operations` interface. `Operation.metadata` 15657// contains `OperationMetadata` (metadata). `Operation.response` 15658// contains `AsyncBatchAnnotateImagesResponse` (results). This service 15659// will write image annotation outputs to json files in customer GCS 15660// bucket, each json file containing BatchAnnotateImagesResponse proto. 15661func (r *ProjectsImagesService) AsyncBatchAnnotate(parent string, asyncbatchannotateimagesrequest *AsyncBatchAnnotateImagesRequest) *ProjectsImagesAsyncBatchAnnotateCall { 15662 c := &ProjectsImagesAsyncBatchAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15663 c.parent = parent 15664 c.asyncbatchannotateimagesrequest = asyncbatchannotateimagesrequest 15665 return c 15666} 15667 15668// Fields allows partial responses to be retrieved. See 15669// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15670// for more information. 15671func (c *ProjectsImagesAsyncBatchAnnotateCall) Fields(s ...googleapi.Field) *ProjectsImagesAsyncBatchAnnotateCall { 15672 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15673 return c 15674} 15675 15676// Context sets the context to be used in this call's Do method. Any 15677// pending HTTP request will be aborted if the provided context is 15678// canceled. 15679func (c *ProjectsImagesAsyncBatchAnnotateCall) Context(ctx context.Context) *ProjectsImagesAsyncBatchAnnotateCall { 15680 c.ctx_ = ctx 15681 return c 15682} 15683 15684// Header returns an http.Header that can be modified by the caller to 15685// add HTTP headers to the request. 15686func (c *ProjectsImagesAsyncBatchAnnotateCall) Header() http.Header { 15687 if c.header_ == nil { 15688 c.header_ = make(http.Header) 15689 } 15690 return c.header_ 15691} 15692 15693func (c *ProjectsImagesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { 15694 reqHeaders := make(http.Header) 15695 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 15696 for k, v := range c.header_ { 15697 reqHeaders[k] = v 15698 } 15699 reqHeaders.Set("User-Agent", c.s.userAgent()) 15700 var body io.Reader = nil 15701 body, err := googleapi.WithoutDataWrapper.JSONReader(c.asyncbatchannotateimagesrequest) 15702 if err != nil { 15703 return nil, err 15704 } 15705 reqHeaders.Set("Content-Type", "application/json") 15706 c.urlParams_.Set("alt", alt) 15707 c.urlParams_.Set("prettyPrint", "false") 15708 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/images:asyncBatchAnnotate") 15709 urls += "?" + c.urlParams_.Encode() 15710 req, err := http.NewRequest("POST", urls, body) 15711 if err != nil { 15712 return nil, err 15713 } 15714 req.Header = reqHeaders 15715 googleapi.Expand(req.URL, map[string]string{ 15716 "parent": c.parent, 15717 }) 15718 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15719} 15720 15721// Do executes the "vision.projects.images.asyncBatchAnnotate" call. 15722// Exactly one of *Operation or error will be non-nil. Any non-2xx 15723// status code is an error. Response headers are in either 15724// *Operation.ServerResponse.Header or (if a response was returned at 15725// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 15726// to check whether the returned error was because 15727// http.StatusNotModified was returned. 15728func (c *ProjectsImagesAsyncBatchAnnotateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 15729 gensupport.SetOptions(c.urlParams_, opts...) 15730 res, err := c.doRequest("json") 15731 if res != nil && res.StatusCode == http.StatusNotModified { 15732 if res.Body != nil { 15733 res.Body.Close() 15734 } 15735 return nil, &googleapi.Error{ 15736 Code: res.StatusCode, 15737 Header: res.Header, 15738 } 15739 } 15740 if err != nil { 15741 return nil, err 15742 } 15743 defer googleapi.CloseBody(res) 15744 if err := googleapi.CheckResponse(res); err != nil { 15745 return nil, err 15746 } 15747 ret := &Operation{ 15748 ServerResponse: googleapi.ServerResponse{ 15749 Header: res.Header, 15750 HTTPStatusCode: res.StatusCode, 15751 }, 15752 } 15753 target := &ret 15754 if err := gensupport.DecodeResponse(target, res); err != nil { 15755 return nil, err 15756 } 15757 return ret, nil 15758 // { 15759 // "description": "Run asynchronous image detection and annotation for a list of images. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto.", 15760 // "flatPath": "v1/projects/{projectsId}/images:asyncBatchAnnotate", 15761 // "httpMethod": "POST", 15762 // "id": "vision.projects.images.asyncBatchAnnotate", 15763 // "parameterOrder": [ 15764 // "parent" 15765 // ], 15766 // "parameters": { 15767 // "parent": { 15768 // "description": "Optional. Target project and location to make a call. Format: `projects/{project-id}/locations/{location-id}`. If no parent is specified, a region will be chosen automatically. Supported location-ids: `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: The European Union. Example: `projects/project-A/locations/eu`.", 15769 // "location": "path", 15770 // "pattern": "^projects/[^/]+$", 15771 // "required": true, 15772 // "type": "string" 15773 // } 15774 // }, 15775 // "path": "v1/{+parent}/images:asyncBatchAnnotate", 15776 // "request": { 15777 // "$ref": "AsyncBatchAnnotateImagesRequest" 15778 // }, 15779 // "response": { 15780 // "$ref": "Operation" 15781 // }, 15782 // "scopes": [ 15783 // "https://www.googleapis.com/auth/cloud-platform", 15784 // "https://www.googleapis.com/auth/cloud-vision" 15785 // ] 15786 // } 15787 15788} 15789 15790// method id "vision.projects.locations.files.annotate": 15791 15792type ProjectsLocationsFilesAnnotateCall struct { 15793 s *Service 15794 parent string 15795 batchannotatefilesrequest *BatchAnnotateFilesRequest 15796 urlParams_ gensupport.URLParams 15797 ctx_ context.Context 15798 header_ http.Header 15799} 15800 15801// Annotate: Service that performs image detection and annotation for a 15802// batch of files. Now only "application/pdf", "image/tiff" and 15803// "image/gif" are supported. This service will extract at most 5 15804// (customers can specify which 5 in AnnotateFileRequest.pages) frames 15805// (gif) or pages (pdf or tiff) from each file provided and perform 15806// detection and annotation for each image extracted. 15807func (r *ProjectsLocationsFilesService) Annotate(parent string, batchannotatefilesrequest *BatchAnnotateFilesRequest) *ProjectsLocationsFilesAnnotateCall { 15808 c := &ProjectsLocationsFilesAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15809 c.parent = parent 15810 c.batchannotatefilesrequest = batchannotatefilesrequest 15811 return c 15812} 15813 15814// Fields allows partial responses to be retrieved. See 15815// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15816// for more information. 15817func (c *ProjectsLocationsFilesAnnotateCall) Fields(s ...googleapi.Field) *ProjectsLocationsFilesAnnotateCall { 15818 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15819 return c 15820} 15821 15822// Context sets the context to be used in this call's Do method. Any 15823// pending HTTP request will be aborted if the provided context is 15824// canceled. 15825func (c *ProjectsLocationsFilesAnnotateCall) Context(ctx context.Context) *ProjectsLocationsFilesAnnotateCall { 15826 c.ctx_ = ctx 15827 return c 15828} 15829 15830// Header returns an http.Header that can be modified by the caller to 15831// add HTTP headers to the request. 15832func (c *ProjectsLocationsFilesAnnotateCall) Header() http.Header { 15833 if c.header_ == nil { 15834 c.header_ = make(http.Header) 15835 } 15836 return c.header_ 15837} 15838 15839func (c *ProjectsLocationsFilesAnnotateCall) doRequest(alt string) (*http.Response, error) { 15840 reqHeaders := make(http.Header) 15841 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 15842 for k, v := range c.header_ { 15843 reqHeaders[k] = v 15844 } 15845 reqHeaders.Set("User-Agent", c.s.userAgent()) 15846 var body io.Reader = nil 15847 body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchannotatefilesrequest) 15848 if err != nil { 15849 return nil, err 15850 } 15851 reqHeaders.Set("Content-Type", "application/json") 15852 c.urlParams_.Set("alt", alt) 15853 c.urlParams_.Set("prettyPrint", "false") 15854 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/files:annotate") 15855 urls += "?" + c.urlParams_.Encode() 15856 req, err := http.NewRequest("POST", urls, body) 15857 if err != nil { 15858 return nil, err 15859 } 15860 req.Header = reqHeaders 15861 googleapi.Expand(req.URL, map[string]string{ 15862 "parent": c.parent, 15863 }) 15864 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15865} 15866 15867// Do executes the "vision.projects.locations.files.annotate" call. 15868// Exactly one of *BatchAnnotateFilesResponse or error will be non-nil. 15869// Any non-2xx status code is an error. Response headers are in either 15870// *BatchAnnotateFilesResponse.ServerResponse.Header or (if a response 15871// was returned at all) in error.(*googleapi.Error).Header. Use 15872// googleapi.IsNotModified to check whether the returned error was 15873// because http.StatusNotModified was returned. 15874func (c *ProjectsLocationsFilesAnnotateCall) Do(opts ...googleapi.CallOption) (*BatchAnnotateFilesResponse, error) { 15875 gensupport.SetOptions(c.urlParams_, opts...) 15876 res, err := c.doRequest("json") 15877 if res != nil && res.StatusCode == http.StatusNotModified { 15878 if res.Body != nil { 15879 res.Body.Close() 15880 } 15881 return nil, &googleapi.Error{ 15882 Code: res.StatusCode, 15883 Header: res.Header, 15884 } 15885 } 15886 if err != nil { 15887 return nil, err 15888 } 15889 defer googleapi.CloseBody(res) 15890 if err := googleapi.CheckResponse(res); err != nil { 15891 return nil, err 15892 } 15893 ret := &BatchAnnotateFilesResponse{ 15894 ServerResponse: googleapi.ServerResponse{ 15895 Header: res.Header, 15896 HTTPStatusCode: res.StatusCode, 15897 }, 15898 } 15899 target := &ret 15900 if err := gensupport.DecodeResponse(target, res); err != nil { 15901 return nil, err 15902 } 15903 return ret, nil 15904 // { 15905 // "description": "Service that performs image detection and annotation for a batch of files. Now only \"application/pdf\", \"image/tiff\" and \"image/gif\" are supported. This service will extract at most 5 (customers can specify which 5 in AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each file provided and perform detection and annotation for each image extracted.", 15906 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/files:annotate", 15907 // "httpMethod": "POST", 15908 // "id": "vision.projects.locations.files.annotate", 15909 // "parameterOrder": [ 15910 // "parent" 15911 // ], 15912 // "parameters": { 15913 // "parent": { 15914 // "description": "Optional. Target project and location to make a call. Format: `projects/{project-id}/locations/{location-id}`. If no parent is specified, a region will be chosen automatically. Supported location-ids: `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: The European Union. Example: `projects/project-A/locations/eu`.", 15915 // "location": "path", 15916 // "pattern": "^projects/[^/]+/locations/[^/]+$", 15917 // "required": true, 15918 // "type": "string" 15919 // } 15920 // }, 15921 // "path": "v1/{+parent}/files:annotate", 15922 // "request": { 15923 // "$ref": "BatchAnnotateFilesRequest" 15924 // }, 15925 // "response": { 15926 // "$ref": "BatchAnnotateFilesResponse" 15927 // }, 15928 // "scopes": [ 15929 // "https://www.googleapis.com/auth/cloud-platform", 15930 // "https://www.googleapis.com/auth/cloud-vision" 15931 // ] 15932 // } 15933 15934} 15935 15936// method id "vision.projects.locations.files.asyncBatchAnnotate": 15937 15938type ProjectsLocationsFilesAsyncBatchAnnotateCall struct { 15939 s *Service 15940 parent string 15941 asyncbatchannotatefilesrequest *AsyncBatchAnnotateFilesRequest 15942 urlParams_ gensupport.URLParams 15943 ctx_ context.Context 15944 header_ http.Header 15945} 15946 15947// AsyncBatchAnnotate: Run asynchronous image detection and annotation 15948// for a list of generic files, such as PDF files, which may contain 15949// multiple pages and multiple images per page. Progress and results can 15950// be retrieved through the `google.longrunning.Operations` interface. 15951// `Operation.metadata` contains `OperationMetadata` (metadata). 15952// `Operation.response` contains `AsyncBatchAnnotateFilesResponse` 15953// (results). 15954func (r *ProjectsLocationsFilesService) AsyncBatchAnnotate(parent string, asyncbatchannotatefilesrequest *AsyncBatchAnnotateFilesRequest) *ProjectsLocationsFilesAsyncBatchAnnotateCall { 15955 c := &ProjectsLocationsFilesAsyncBatchAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15956 c.parent = parent 15957 c.asyncbatchannotatefilesrequest = asyncbatchannotatefilesrequest 15958 return c 15959} 15960 15961// Fields allows partial responses to be retrieved. See 15962// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15963// for more information. 15964func (c *ProjectsLocationsFilesAsyncBatchAnnotateCall) Fields(s ...googleapi.Field) *ProjectsLocationsFilesAsyncBatchAnnotateCall { 15965 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15966 return c 15967} 15968 15969// Context sets the context to be used in this call's Do method. Any 15970// pending HTTP request will be aborted if the provided context is 15971// canceled. 15972func (c *ProjectsLocationsFilesAsyncBatchAnnotateCall) Context(ctx context.Context) *ProjectsLocationsFilesAsyncBatchAnnotateCall { 15973 c.ctx_ = ctx 15974 return c 15975} 15976 15977// Header returns an http.Header that can be modified by the caller to 15978// add HTTP headers to the request. 15979func (c *ProjectsLocationsFilesAsyncBatchAnnotateCall) Header() http.Header { 15980 if c.header_ == nil { 15981 c.header_ = make(http.Header) 15982 } 15983 return c.header_ 15984} 15985 15986func (c *ProjectsLocationsFilesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { 15987 reqHeaders := make(http.Header) 15988 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 15989 for k, v := range c.header_ { 15990 reqHeaders[k] = v 15991 } 15992 reqHeaders.Set("User-Agent", c.s.userAgent()) 15993 var body io.Reader = nil 15994 body, err := googleapi.WithoutDataWrapper.JSONReader(c.asyncbatchannotatefilesrequest) 15995 if err != nil { 15996 return nil, err 15997 } 15998 reqHeaders.Set("Content-Type", "application/json") 15999 c.urlParams_.Set("alt", alt) 16000 c.urlParams_.Set("prettyPrint", "false") 16001 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/files:asyncBatchAnnotate") 16002 urls += "?" + c.urlParams_.Encode() 16003 req, err := http.NewRequest("POST", urls, body) 16004 if err != nil { 16005 return nil, err 16006 } 16007 req.Header = reqHeaders 16008 googleapi.Expand(req.URL, map[string]string{ 16009 "parent": c.parent, 16010 }) 16011 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16012} 16013 16014// Do executes the "vision.projects.locations.files.asyncBatchAnnotate" call. 16015// Exactly one of *Operation or error will be non-nil. Any non-2xx 16016// status code is an error. Response headers are in either 16017// *Operation.ServerResponse.Header or (if a response was returned at 16018// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 16019// to check whether the returned error was because 16020// http.StatusNotModified was returned. 16021func (c *ProjectsLocationsFilesAsyncBatchAnnotateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 16022 gensupport.SetOptions(c.urlParams_, opts...) 16023 res, err := c.doRequest("json") 16024 if res != nil && res.StatusCode == http.StatusNotModified { 16025 if res.Body != nil { 16026 res.Body.Close() 16027 } 16028 return nil, &googleapi.Error{ 16029 Code: res.StatusCode, 16030 Header: res.Header, 16031 } 16032 } 16033 if err != nil { 16034 return nil, err 16035 } 16036 defer googleapi.CloseBody(res) 16037 if err := googleapi.CheckResponse(res); err != nil { 16038 return nil, err 16039 } 16040 ret := &Operation{ 16041 ServerResponse: googleapi.ServerResponse{ 16042 Header: res.Header, 16043 HTTPStatusCode: res.StatusCode, 16044 }, 16045 } 16046 target := &ret 16047 if err := gensupport.DecodeResponse(target, res); err != nil { 16048 return nil, err 16049 } 16050 return ret, nil 16051 // { 16052 // "description": "Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results).", 16053 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/files:asyncBatchAnnotate", 16054 // "httpMethod": "POST", 16055 // "id": "vision.projects.locations.files.asyncBatchAnnotate", 16056 // "parameterOrder": [ 16057 // "parent" 16058 // ], 16059 // "parameters": { 16060 // "parent": { 16061 // "description": "Optional. Target project and location to make a call. Format: `projects/{project-id}/locations/{location-id}`. If no parent is specified, a region will be chosen automatically. Supported location-ids: `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: The European Union. Example: `projects/project-A/locations/eu`.", 16062 // "location": "path", 16063 // "pattern": "^projects/[^/]+/locations/[^/]+$", 16064 // "required": true, 16065 // "type": "string" 16066 // } 16067 // }, 16068 // "path": "v1/{+parent}/files:asyncBatchAnnotate", 16069 // "request": { 16070 // "$ref": "AsyncBatchAnnotateFilesRequest" 16071 // }, 16072 // "response": { 16073 // "$ref": "Operation" 16074 // }, 16075 // "scopes": [ 16076 // "https://www.googleapis.com/auth/cloud-platform", 16077 // "https://www.googleapis.com/auth/cloud-vision" 16078 // ] 16079 // } 16080 16081} 16082 16083// method id "vision.projects.locations.images.annotate": 16084 16085type ProjectsLocationsImagesAnnotateCall struct { 16086 s *Service 16087 parent string 16088 batchannotateimagesrequest *BatchAnnotateImagesRequest 16089 urlParams_ gensupport.URLParams 16090 ctx_ context.Context 16091 header_ http.Header 16092} 16093 16094// Annotate: Run image detection and annotation for a batch of images. 16095func (r *ProjectsLocationsImagesService) Annotate(parent string, batchannotateimagesrequest *BatchAnnotateImagesRequest) *ProjectsLocationsImagesAnnotateCall { 16096 c := &ProjectsLocationsImagesAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16097 c.parent = parent 16098 c.batchannotateimagesrequest = batchannotateimagesrequest 16099 return c 16100} 16101 16102// Fields allows partial responses to be retrieved. See 16103// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 16104// for more information. 16105func (c *ProjectsLocationsImagesAnnotateCall) Fields(s ...googleapi.Field) *ProjectsLocationsImagesAnnotateCall { 16106 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16107 return c 16108} 16109 16110// Context sets the context to be used in this call's Do method. Any 16111// pending HTTP request will be aborted if the provided context is 16112// canceled. 16113func (c *ProjectsLocationsImagesAnnotateCall) Context(ctx context.Context) *ProjectsLocationsImagesAnnotateCall { 16114 c.ctx_ = ctx 16115 return c 16116} 16117 16118// Header returns an http.Header that can be modified by the caller to 16119// add HTTP headers to the request. 16120func (c *ProjectsLocationsImagesAnnotateCall) Header() http.Header { 16121 if c.header_ == nil { 16122 c.header_ = make(http.Header) 16123 } 16124 return c.header_ 16125} 16126 16127func (c *ProjectsLocationsImagesAnnotateCall) doRequest(alt string) (*http.Response, error) { 16128 reqHeaders := make(http.Header) 16129 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 16130 for k, v := range c.header_ { 16131 reqHeaders[k] = v 16132 } 16133 reqHeaders.Set("User-Agent", c.s.userAgent()) 16134 var body io.Reader = nil 16135 body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchannotateimagesrequest) 16136 if err != nil { 16137 return nil, err 16138 } 16139 reqHeaders.Set("Content-Type", "application/json") 16140 c.urlParams_.Set("alt", alt) 16141 c.urlParams_.Set("prettyPrint", "false") 16142 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/images:annotate") 16143 urls += "?" + c.urlParams_.Encode() 16144 req, err := http.NewRequest("POST", urls, body) 16145 if err != nil { 16146 return nil, err 16147 } 16148 req.Header = reqHeaders 16149 googleapi.Expand(req.URL, map[string]string{ 16150 "parent": c.parent, 16151 }) 16152 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16153} 16154 16155// Do executes the "vision.projects.locations.images.annotate" call. 16156// Exactly one of *BatchAnnotateImagesResponse or error will be non-nil. 16157// Any non-2xx status code is an error. Response headers are in either 16158// *BatchAnnotateImagesResponse.ServerResponse.Header or (if a response 16159// was returned at all) in error.(*googleapi.Error).Header. Use 16160// googleapi.IsNotModified to check whether the returned error was 16161// because http.StatusNotModified was returned. 16162func (c *ProjectsLocationsImagesAnnotateCall) Do(opts ...googleapi.CallOption) (*BatchAnnotateImagesResponse, error) { 16163 gensupport.SetOptions(c.urlParams_, opts...) 16164 res, err := c.doRequest("json") 16165 if res != nil && res.StatusCode == http.StatusNotModified { 16166 if res.Body != nil { 16167 res.Body.Close() 16168 } 16169 return nil, &googleapi.Error{ 16170 Code: res.StatusCode, 16171 Header: res.Header, 16172 } 16173 } 16174 if err != nil { 16175 return nil, err 16176 } 16177 defer googleapi.CloseBody(res) 16178 if err := googleapi.CheckResponse(res); err != nil { 16179 return nil, err 16180 } 16181 ret := &BatchAnnotateImagesResponse{ 16182 ServerResponse: googleapi.ServerResponse{ 16183 Header: res.Header, 16184 HTTPStatusCode: res.StatusCode, 16185 }, 16186 } 16187 target := &ret 16188 if err := gensupport.DecodeResponse(target, res); err != nil { 16189 return nil, err 16190 } 16191 return ret, nil 16192 // { 16193 // "description": "Run image detection and annotation for a batch of images.", 16194 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/images:annotate", 16195 // "httpMethod": "POST", 16196 // "id": "vision.projects.locations.images.annotate", 16197 // "parameterOrder": [ 16198 // "parent" 16199 // ], 16200 // "parameters": { 16201 // "parent": { 16202 // "description": "Optional. Target project and location to make a call. Format: `projects/{project-id}/locations/{location-id}`. If no parent is specified, a region will be chosen automatically. Supported location-ids: `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: The European Union. Example: `projects/project-A/locations/eu`.", 16203 // "location": "path", 16204 // "pattern": "^projects/[^/]+/locations/[^/]+$", 16205 // "required": true, 16206 // "type": "string" 16207 // } 16208 // }, 16209 // "path": "v1/{+parent}/images:annotate", 16210 // "request": { 16211 // "$ref": "BatchAnnotateImagesRequest" 16212 // }, 16213 // "response": { 16214 // "$ref": "BatchAnnotateImagesResponse" 16215 // }, 16216 // "scopes": [ 16217 // "https://www.googleapis.com/auth/cloud-platform", 16218 // "https://www.googleapis.com/auth/cloud-vision" 16219 // ] 16220 // } 16221 16222} 16223 16224// method id "vision.projects.locations.images.asyncBatchAnnotate": 16225 16226type ProjectsLocationsImagesAsyncBatchAnnotateCall struct { 16227 s *Service 16228 parent string 16229 asyncbatchannotateimagesrequest *AsyncBatchAnnotateImagesRequest 16230 urlParams_ gensupport.URLParams 16231 ctx_ context.Context 16232 header_ http.Header 16233} 16234 16235// AsyncBatchAnnotate: Run asynchronous image detection and annotation 16236// for a list of images. Progress and results can be retrieved through 16237// the `google.longrunning.Operations` interface. `Operation.metadata` 16238// contains `OperationMetadata` (metadata). `Operation.response` 16239// contains `AsyncBatchAnnotateImagesResponse` (results). This service 16240// will write image annotation outputs to json files in customer GCS 16241// bucket, each json file containing BatchAnnotateImagesResponse proto. 16242func (r *ProjectsLocationsImagesService) AsyncBatchAnnotate(parent string, asyncbatchannotateimagesrequest *AsyncBatchAnnotateImagesRequest) *ProjectsLocationsImagesAsyncBatchAnnotateCall { 16243 c := &ProjectsLocationsImagesAsyncBatchAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16244 c.parent = parent 16245 c.asyncbatchannotateimagesrequest = asyncbatchannotateimagesrequest 16246 return c 16247} 16248 16249// Fields allows partial responses to be retrieved. See 16250// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 16251// for more information. 16252func (c *ProjectsLocationsImagesAsyncBatchAnnotateCall) Fields(s ...googleapi.Field) *ProjectsLocationsImagesAsyncBatchAnnotateCall { 16253 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16254 return c 16255} 16256 16257// Context sets the context to be used in this call's Do method. Any 16258// pending HTTP request will be aborted if the provided context is 16259// canceled. 16260func (c *ProjectsLocationsImagesAsyncBatchAnnotateCall) Context(ctx context.Context) *ProjectsLocationsImagesAsyncBatchAnnotateCall { 16261 c.ctx_ = ctx 16262 return c 16263} 16264 16265// Header returns an http.Header that can be modified by the caller to 16266// add HTTP headers to the request. 16267func (c *ProjectsLocationsImagesAsyncBatchAnnotateCall) Header() http.Header { 16268 if c.header_ == nil { 16269 c.header_ = make(http.Header) 16270 } 16271 return c.header_ 16272} 16273 16274func (c *ProjectsLocationsImagesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { 16275 reqHeaders := make(http.Header) 16276 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 16277 for k, v := range c.header_ { 16278 reqHeaders[k] = v 16279 } 16280 reqHeaders.Set("User-Agent", c.s.userAgent()) 16281 var body io.Reader = nil 16282 body, err := googleapi.WithoutDataWrapper.JSONReader(c.asyncbatchannotateimagesrequest) 16283 if err != nil { 16284 return nil, err 16285 } 16286 reqHeaders.Set("Content-Type", "application/json") 16287 c.urlParams_.Set("alt", alt) 16288 c.urlParams_.Set("prettyPrint", "false") 16289 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/images:asyncBatchAnnotate") 16290 urls += "?" + c.urlParams_.Encode() 16291 req, err := http.NewRequest("POST", urls, body) 16292 if err != nil { 16293 return nil, err 16294 } 16295 req.Header = reqHeaders 16296 googleapi.Expand(req.URL, map[string]string{ 16297 "parent": c.parent, 16298 }) 16299 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16300} 16301 16302// Do executes the "vision.projects.locations.images.asyncBatchAnnotate" call. 16303// Exactly one of *Operation or error will be non-nil. Any non-2xx 16304// status code is an error. Response headers are in either 16305// *Operation.ServerResponse.Header or (if a response was returned at 16306// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 16307// to check whether the returned error was because 16308// http.StatusNotModified was returned. 16309func (c *ProjectsLocationsImagesAsyncBatchAnnotateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 16310 gensupport.SetOptions(c.urlParams_, opts...) 16311 res, err := c.doRequest("json") 16312 if res != nil && res.StatusCode == http.StatusNotModified { 16313 if res.Body != nil { 16314 res.Body.Close() 16315 } 16316 return nil, &googleapi.Error{ 16317 Code: res.StatusCode, 16318 Header: res.Header, 16319 } 16320 } 16321 if err != nil { 16322 return nil, err 16323 } 16324 defer googleapi.CloseBody(res) 16325 if err := googleapi.CheckResponse(res); err != nil { 16326 return nil, err 16327 } 16328 ret := &Operation{ 16329 ServerResponse: googleapi.ServerResponse{ 16330 Header: res.Header, 16331 HTTPStatusCode: res.StatusCode, 16332 }, 16333 } 16334 target := &ret 16335 if err := gensupport.DecodeResponse(target, res); err != nil { 16336 return nil, err 16337 } 16338 return ret, nil 16339 // { 16340 // "description": "Run asynchronous image detection and annotation for a list of images. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto.", 16341 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/images:asyncBatchAnnotate", 16342 // "httpMethod": "POST", 16343 // "id": "vision.projects.locations.images.asyncBatchAnnotate", 16344 // "parameterOrder": [ 16345 // "parent" 16346 // ], 16347 // "parameters": { 16348 // "parent": { 16349 // "description": "Optional. Target project and location to make a call. Format: `projects/{project-id}/locations/{location-id}`. If no parent is specified, a region will be chosen automatically. Supported location-ids: `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: The European Union. Example: `projects/project-A/locations/eu`.", 16350 // "location": "path", 16351 // "pattern": "^projects/[^/]+/locations/[^/]+$", 16352 // "required": true, 16353 // "type": "string" 16354 // } 16355 // }, 16356 // "path": "v1/{+parent}/images:asyncBatchAnnotate", 16357 // "request": { 16358 // "$ref": "AsyncBatchAnnotateImagesRequest" 16359 // }, 16360 // "response": { 16361 // "$ref": "Operation" 16362 // }, 16363 // "scopes": [ 16364 // "https://www.googleapis.com/auth/cloud-platform", 16365 // "https://www.googleapis.com/auth/cloud-vision" 16366 // ] 16367 // } 16368 16369} 16370 16371// method id "vision.projects.locations.operations.get": 16372 16373type ProjectsLocationsOperationsGetCall struct { 16374 s *Service 16375 name string 16376 urlParams_ gensupport.URLParams 16377 ifNoneMatch_ string 16378 ctx_ context.Context 16379 header_ http.Header 16380} 16381 16382// Get: Gets the latest state of a long-running operation. Clients can 16383// use this method to poll the operation result at intervals as 16384// recommended by the API service. 16385func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall { 16386 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16387 c.name = name 16388 return c 16389} 16390 16391// Fields allows partial responses to be retrieved. See 16392// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 16393// for more information. 16394func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall { 16395 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16396 return c 16397} 16398 16399// IfNoneMatch sets the optional parameter which makes the operation 16400// fail if the object's ETag matches the given value. This is useful for 16401// getting updates only after the object has changed since the last 16402// request. Use googleapi.IsNotModified to check whether the response 16403// error from Do is the result of In-None-Match. 16404func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall { 16405 c.ifNoneMatch_ = entityTag 16406 return c 16407} 16408 16409// Context sets the context to be used in this call's Do method. Any 16410// pending HTTP request will be aborted if the provided context is 16411// canceled. 16412func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall { 16413 c.ctx_ = ctx 16414 return c 16415} 16416 16417// Header returns an http.Header that can be modified by the caller to 16418// add HTTP headers to the request. 16419func (c *ProjectsLocationsOperationsGetCall) Header() http.Header { 16420 if c.header_ == nil { 16421 c.header_ = make(http.Header) 16422 } 16423 return c.header_ 16424} 16425 16426func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 16427 reqHeaders := make(http.Header) 16428 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 16429 for k, v := range c.header_ { 16430 reqHeaders[k] = v 16431 } 16432 reqHeaders.Set("User-Agent", c.s.userAgent()) 16433 if c.ifNoneMatch_ != "" { 16434 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 16435 } 16436 var body io.Reader = nil 16437 c.urlParams_.Set("alt", alt) 16438 c.urlParams_.Set("prettyPrint", "false") 16439 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 16440 urls += "?" + c.urlParams_.Encode() 16441 req, err := http.NewRequest("GET", urls, body) 16442 if err != nil { 16443 return nil, err 16444 } 16445 req.Header = reqHeaders 16446 googleapi.Expand(req.URL, map[string]string{ 16447 "name": c.name, 16448 }) 16449 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16450} 16451 16452// Do executes the "vision.projects.locations.operations.get" call. 16453// Exactly one of *Operation or error will be non-nil. Any non-2xx 16454// status code is an error. Response headers are in either 16455// *Operation.ServerResponse.Header or (if a response was returned at 16456// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 16457// to check whether the returned error was because 16458// http.StatusNotModified was returned. 16459func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 16460 gensupport.SetOptions(c.urlParams_, opts...) 16461 res, err := c.doRequest("json") 16462 if res != nil && res.StatusCode == http.StatusNotModified { 16463 if res.Body != nil { 16464 res.Body.Close() 16465 } 16466 return nil, &googleapi.Error{ 16467 Code: res.StatusCode, 16468 Header: res.Header, 16469 } 16470 } 16471 if err != nil { 16472 return nil, err 16473 } 16474 defer googleapi.CloseBody(res) 16475 if err := googleapi.CheckResponse(res); err != nil { 16476 return nil, err 16477 } 16478 ret := &Operation{ 16479 ServerResponse: googleapi.ServerResponse{ 16480 Header: res.Header, 16481 HTTPStatusCode: res.StatusCode, 16482 }, 16483 } 16484 target := &ret 16485 if err := gensupport.DecodeResponse(target, res); err != nil { 16486 return nil, err 16487 } 16488 return ret, nil 16489 // { 16490 // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", 16491 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}", 16492 // "httpMethod": "GET", 16493 // "id": "vision.projects.locations.operations.get", 16494 // "parameterOrder": [ 16495 // "name" 16496 // ], 16497 // "parameters": { 16498 // "name": { 16499 // "description": "The name of the operation resource.", 16500 // "location": "path", 16501 // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", 16502 // "required": true, 16503 // "type": "string" 16504 // } 16505 // }, 16506 // "path": "v1/{+name}", 16507 // "response": { 16508 // "$ref": "Operation" 16509 // }, 16510 // "scopes": [ 16511 // "https://www.googleapis.com/auth/cloud-platform", 16512 // "https://www.googleapis.com/auth/cloud-vision" 16513 // ] 16514 // } 16515 16516} 16517 16518// method id "vision.projects.locations.productSets.addProduct": 16519 16520type ProjectsLocationsProductSetsAddProductCall struct { 16521 s *Service 16522 name string 16523 addproducttoproductsetrequest *AddProductToProductSetRequest 16524 urlParams_ gensupport.URLParams 16525 ctx_ context.Context 16526 header_ http.Header 16527} 16528 16529// AddProduct: Adds a Product to the specified ProductSet. If the 16530// Product is already present, no change is made. One Product can be 16531// added to at most 100 ProductSets. Possible errors: * Returns 16532// NOT_FOUND if the Product or the ProductSet doesn't exist. 16533func (r *ProjectsLocationsProductSetsService) AddProduct(name string, addproducttoproductsetrequest *AddProductToProductSetRequest) *ProjectsLocationsProductSetsAddProductCall { 16534 c := &ProjectsLocationsProductSetsAddProductCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16535 c.name = name 16536 c.addproducttoproductsetrequest = addproducttoproductsetrequest 16537 return c 16538} 16539 16540// Fields allows partial responses to be retrieved. See 16541// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 16542// for more information. 16543func (c *ProjectsLocationsProductSetsAddProductCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductSetsAddProductCall { 16544 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16545 return c 16546} 16547 16548// Context sets the context to be used in this call's Do method. Any 16549// pending HTTP request will be aborted if the provided context is 16550// canceled. 16551func (c *ProjectsLocationsProductSetsAddProductCall) Context(ctx context.Context) *ProjectsLocationsProductSetsAddProductCall { 16552 c.ctx_ = ctx 16553 return c 16554} 16555 16556// Header returns an http.Header that can be modified by the caller to 16557// add HTTP headers to the request. 16558func (c *ProjectsLocationsProductSetsAddProductCall) Header() http.Header { 16559 if c.header_ == nil { 16560 c.header_ = make(http.Header) 16561 } 16562 return c.header_ 16563} 16564 16565func (c *ProjectsLocationsProductSetsAddProductCall) doRequest(alt string) (*http.Response, error) { 16566 reqHeaders := make(http.Header) 16567 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 16568 for k, v := range c.header_ { 16569 reqHeaders[k] = v 16570 } 16571 reqHeaders.Set("User-Agent", c.s.userAgent()) 16572 var body io.Reader = nil 16573 body, err := googleapi.WithoutDataWrapper.JSONReader(c.addproducttoproductsetrequest) 16574 if err != nil { 16575 return nil, err 16576 } 16577 reqHeaders.Set("Content-Type", "application/json") 16578 c.urlParams_.Set("alt", alt) 16579 c.urlParams_.Set("prettyPrint", "false") 16580 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:addProduct") 16581 urls += "?" + c.urlParams_.Encode() 16582 req, err := http.NewRequest("POST", urls, body) 16583 if err != nil { 16584 return nil, err 16585 } 16586 req.Header = reqHeaders 16587 googleapi.Expand(req.URL, map[string]string{ 16588 "name": c.name, 16589 }) 16590 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16591} 16592 16593// Do executes the "vision.projects.locations.productSets.addProduct" call. 16594// Exactly one of *Empty or error will be non-nil. Any non-2xx status 16595// code is an error. Response headers are in either 16596// *Empty.ServerResponse.Header or (if a response was returned at all) 16597// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 16598// check whether the returned error was because http.StatusNotModified 16599// was returned. 16600func (c *ProjectsLocationsProductSetsAddProductCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 16601 gensupport.SetOptions(c.urlParams_, opts...) 16602 res, err := c.doRequest("json") 16603 if res != nil && res.StatusCode == http.StatusNotModified { 16604 if res.Body != nil { 16605 res.Body.Close() 16606 } 16607 return nil, &googleapi.Error{ 16608 Code: res.StatusCode, 16609 Header: res.Header, 16610 } 16611 } 16612 if err != nil { 16613 return nil, err 16614 } 16615 defer googleapi.CloseBody(res) 16616 if err := googleapi.CheckResponse(res); err != nil { 16617 return nil, err 16618 } 16619 ret := &Empty{ 16620 ServerResponse: googleapi.ServerResponse{ 16621 Header: res.Header, 16622 HTTPStatusCode: res.StatusCode, 16623 }, 16624 } 16625 target := &ret 16626 if err := gensupport.DecodeResponse(target, res); err != nil { 16627 return nil, err 16628 } 16629 return ret, nil 16630 // { 16631 // "description": "Adds a Product to the specified ProductSet. If the Product is already present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: * Returns NOT_FOUND if the Product or the ProductSet doesn't exist.", 16632 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/productSets/{productSetsId}:addProduct", 16633 // "httpMethod": "POST", 16634 // "id": "vision.projects.locations.productSets.addProduct", 16635 // "parameterOrder": [ 16636 // "name" 16637 // ], 16638 // "parameters": { 16639 // "name": { 16640 // "description": "Required. The resource name for the ProductSet to modify. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`", 16641 // "location": "path", 16642 // "pattern": "^projects/[^/]+/locations/[^/]+/productSets/[^/]+$", 16643 // "required": true, 16644 // "type": "string" 16645 // } 16646 // }, 16647 // "path": "v1/{+name}:addProduct", 16648 // "request": { 16649 // "$ref": "AddProductToProductSetRequest" 16650 // }, 16651 // "response": { 16652 // "$ref": "Empty" 16653 // }, 16654 // "scopes": [ 16655 // "https://www.googleapis.com/auth/cloud-platform", 16656 // "https://www.googleapis.com/auth/cloud-vision" 16657 // ] 16658 // } 16659 16660} 16661 16662// method id "vision.projects.locations.productSets.create": 16663 16664type ProjectsLocationsProductSetsCreateCall struct { 16665 s *Service 16666 parent string 16667 productset *ProductSet 16668 urlParams_ gensupport.URLParams 16669 ctx_ context.Context 16670 header_ http.Header 16671} 16672 16673// Create: Creates and returns a new ProductSet resource. Possible 16674// errors: * Returns INVALID_ARGUMENT if display_name is missing, or is 16675// longer than 4096 characters. 16676func (r *ProjectsLocationsProductSetsService) Create(parent string, productset *ProductSet) *ProjectsLocationsProductSetsCreateCall { 16677 c := &ProjectsLocationsProductSetsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16678 c.parent = parent 16679 c.productset = productset 16680 return c 16681} 16682 16683// ProductSetId sets the optional parameter "productSetId": A 16684// user-supplied resource id for this ProductSet. If set, the server 16685// will attempt to use this value as the resource id. If it is already 16686// in use, an error is returned with code ALREADY_EXISTS. Must be at 16687// most 128 characters long. It cannot contain the character `/`. 16688func (c *ProjectsLocationsProductSetsCreateCall) ProductSetId(productSetId string) *ProjectsLocationsProductSetsCreateCall { 16689 c.urlParams_.Set("productSetId", productSetId) 16690 return c 16691} 16692 16693// Fields allows partial responses to be retrieved. See 16694// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 16695// for more information. 16696func (c *ProjectsLocationsProductSetsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductSetsCreateCall { 16697 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16698 return c 16699} 16700 16701// Context sets the context to be used in this call's Do method. Any 16702// pending HTTP request will be aborted if the provided context is 16703// canceled. 16704func (c *ProjectsLocationsProductSetsCreateCall) Context(ctx context.Context) *ProjectsLocationsProductSetsCreateCall { 16705 c.ctx_ = ctx 16706 return c 16707} 16708 16709// Header returns an http.Header that can be modified by the caller to 16710// add HTTP headers to the request. 16711func (c *ProjectsLocationsProductSetsCreateCall) Header() http.Header { 16712 if c.header_ == nil { 16713 c.header_ = make(http.Header) 16714 } 16715 return c.header_ 16716} 16717 16718func (c *ProjectsLocationsProductSetsCreateCall) doRequest(alt string) (*http.Response, error) { 16719 reqHeaders := make(http.Header) 16720 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 16721 for k, v := range c.header_ { 16722 reqHeaders[k] = v 16723 } 16724 reqHeaders.Set("User-Agent", c.s.userAgent()) 16725 var body io.Reader = nil 16726 body, err := googleapi.WithoutDataWrapper.JSONReader(c.productset) 16727 if err != nil { 16728 return nil, err 16729 } 16730 reqHeaders.Set("Content-Type", "application/json") 16731 c.urlParams_.Set("alt", alt) 16732 c.urlParams_.Set("prettyPrint", "false") 16733 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/productSets") 16734 urls += "?" + c.urlParams_.Encode() 16735 req, err := http.NewRequest("POST", urls, body) 16736 if err != nil { 16737 return nil, err 16738 } 16739 req.Header = reqHeaders 16740 googleapi.Expand(req.URL, map[string]string{ 16741 "parent": c.parent, 16742 }) 16743 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16744} 16745 16746// Do executes the "vision.projects.locations.productSets.create" call. 16747// Exactly one of *ProductSet or error will be non-nil. Any non-2xx 16748// status code is an error. Response headers are in either 16749// *ProductSet.ServerResponse.Header or (if a response was returned at 16750// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 16751// to check whether the returned error was because 16752// http.StatusNotModified was returned. 16753func (c *ProjectsLocationsProductSetsCreateCall) Do(opts ...googleapi.CallOption) (*ProductSet, error) { 16754 gensupport.SetOptions(c.urlParams_, opts...) 16755 res, err := c.doRequest("json") 16756 if res != nil && res.StatusCode == http.StatusNotModified { 16757 if res.Body != nil { 16758 res.Body.Close() 16759 } 16760 return nil, &googleapi.Error{ 16761 Code: res.StatusCode, 16762 Header: res.Header, 16763 } 16764 } 16765 if err != nil { 16766 return nil, err 16767 } 16768 defer googleapi.CloseBody(res) 16769 if err := googleapi.CheckResponse(res); err != nil { 16770 return nil, err 16771 } 16772 ret := &ProductSet{ 16773 ServerResponse: googleapi.ServerResponse{ 16774 Header: res.Header, 16775 HTTPStatusCode: res.StatusCode, 16776 }, 16777 } 16778 target := &ret 16779 if err := gensupport.DecodeResponse(target, res); err != nil { 16780 return nil, err 16781 } 16782 return ret, nil 16783 // { 16784 // "description": "Creates and returns a new ProductSet resource. Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 characters.", 16785 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/productSets", 16786 // "httpMethod": "POST", 16787 // "id": "vision.projects.locations.productSets.create", 16788 // "parameterOrder": [ 16789 // "parent" 16790 // ], 16791 // "parameters": { 16792 // "parent": { 16793 // "description": "Required. The project in which the ProductSet should be created. Format is `projects/PROJECT_ID/locations/LOC_ID`.", 16794 // "location": "path", 16795 // "pattern": "^projects/[^/]+/locations/[^/]+$", 16796 // "required": true, 16797 // "type": "string" 16798 // }, 16799 // "productSetId": { 16800 // "description": "A user-supplied resource id for this ProductSet. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character `/`.", 16801 // "location": "query", 16802 // "type": "string" 16803 // } 16804 // }, 16805 // "path": "v1/{+parent}/productSets", 16806 // "request": { 16807 // "$ref": "ProductSet" 16808 // }, 16809 // "response": { 16810 // "$ref": "ProductSet" 16811 // }, 16812 // "scopes": [ 16813 // "https://www.googleapis.com/auth/cloud-platform", 16814 // "https://www.googleapis.com/auth/cloud-vision" 16815 // ] 16816 // } 16817 16818} 16819 16820// method id "vision.projects.locations.productSets.delete": 16821 16822type ProjectsLocationsProductSetsDeleteCall struct { 16823 s *Service 16824 name string 16825 urlParams_ gensupport.URLParams 16826 ctx_ context.Context 16827 header_ http.Header 16828} 16829 16830// Delete: Permanently deletes a ProductSet. Products and 16831// ReferenceImages in the ProductSet are not deleted. The actual image 16832// files are not deleted from Google Cloud Storage. 16833func (r *ProjectsLocationsProductSetsService) Delete(name string) *ProjectsLocationsProductSetsDeleteCall { 16834 c := &ProjectsLocationsProductSetsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16835 c.name = name 16836 return c 16837} 16838 16839// Fields allows partial responses to be retrieved. See 16840// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 16841// for more information. 16842func (c *ProjectsLocationsProductSetsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductSetsDeleteCall { 16843 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16844 return c 16845} 16846 16847// Context sets the context to be used in this call's Do method. Any 16848// pending HTTP request will be aborted if the provided context is 16849// canceled. 16850func (c *ProjectsLocationsProductSetsDeleteCall) Context(ctx context.Context) *ProjectsLocationsProductSetsDeleteCall { 16851 c.ctx_ = ctx 16852 return c 16853} 16854 16855// Header returns an http.Header that can be modified by the caller to 16856// add HTTP headers to the request. 16857func (c *ProjectsLocationsProductSetsDeleteCall) Header() http.Header { 16858 if c.header_ == nil { 16859 c.header_ = make(http.Header) 16860 } 16861 return c.header_ 16862} 16863 16864func (c *ProjectsLocationsProductSetsDeleteCall) doRequest(alt string) (*http.Response, error) { 16865 reqHeaders := make(http.Header) 16866 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 16867 for k, v := range c.header_ { 16868 reqHeaders[k] = v 16869 } 16870 reqHeaders.Set("User-Agent", c.s.userAgent()) 16871 var body io.Reader = nil 16872 c.urlParams_.Set("alt", alt) 16873 c.urlParams_.Set("prettyPrint", "false") 16874 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 16875 urls += "?" + c.urlParams_.Encode() 16876 req, err := http.NewRequest("DELETE", urls, body) 16877 if err != nil { 16878 return nil, err 16879 } 16880 req.Header = reqHeaders 16881 googleapi.Expand(req.URL, map[string]string{ 16882 "name": c.name, 16883 }) 16884 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16885} 16886 16887// Do executes the "vision.projects.locations.productSets.delete" call. 16888// Exactly one of *Empty or error will be non-nil. Any non-2xx status 16889// code is an error. Response headers are in either 16890// *Empty.ServerResponse.Header or (if a response was returned at all) 16891// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 16892// check whether the returned error was because http.StatusNotModified 16893// was returned. 16894func (c *ProjectsLocationsProductSetsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 16895 gensupport.SetOptions(c.urlParams_, opts...) 16896 res, err := c.doRequest("json") 16897 if res != nil && res.StatusCode == http.StatusNotModified { 16898 if res.Body != nil { 16899 res.Body.Close() 16900 } 16901 return nil, &googleapi.Error{ 16902 Code: res.StatusCode, 16903 Header: res.Header, 16904 } 16905 } 16906 if err != nil { 16907 return nil, err 16908 } 16909 defer googleapi.CloseBody(res) 16910 if err := googleapi.CheckResponse(res); err != nil { 16911 return nil, err 16912 } 16913 ret := &Empty{ 16914 ServerResponse: googleapi.ServerResponse{ 16915 Header: res.Header, 16916 HTTPStatusCode: res.StatusCode, 16917 }, 16918 } 16919 target := &ret 16920 if err := gensupport.DecodeResponse(target, res); err != nil { 16921 return nil, err 16922 } 16923 return ret, nil 16924 // { 16925 // "description": "Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not deleted. The actual image files are not deleted from Google Cloud Storage.", 16926 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/productSets/{productSetsId}", 16927 // "httpMethod": "DELETE", 16928 // "id": "vision.projects.locations.productSets.delete", 16929 // "parameterOrder": [ 16930 // "name" 16931 // ], 16932 // "parameters": { 16933 // "name": { 16934 // "description": "Required. Resource name of the ProductSet to delete. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`", 16935 // "location": "path", 16936 // "pattern": "^projects/[^/]+/locations/[^/]+/productSets/[^/]+$", 16937 // "required": true, 16938 // "type": "string" 16939 // } 16940 // }, 16941 // "path": "v1/{+name}", 16942 // "response": { 16943 // "$ref": "Empty" 16944 // }, 16945 // "scopes": [ 16946 // "https://www.googleapis.com/auth/cloud-platform", 16947 // "https://www.googleapis.com/auth/cloud-vision" 16948 // ] 16949 // } 16950 16951} 16952 16953// method id "vision.projects.locations.productSets.get": 16954 16955type ProjectsLocationsProductSetsGetCall struct { 16956 s *Service 16957 name string 16958 urlParams_ gensupport.URLParams 16959 ifNoneMatch_ string 16960 ctx_ context.Context 16961 header_ http.Header 16962} 16963 16964// Get: Gets information associated with a ProductSet. Possible errors: 16965// * Returns NOT_FOUND if the ProductSet does not exist. 16966func (r *ProjectsLocationsProductSetsService) Get(name string) *ProjectsLocationsProductSetsGetCall { 16967 c := &ProjectsLocationsProductSetsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16968 c.name = name 16969 return c 16970} 16971 16972// Fields allows partial responses to be retrieved. See 16973// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 16974// for more information. 16975func (c *ProjectsLocationsProductSetsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductSetsGetCall { 16976 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16977 return c 16978} 16979 16980// IfNoneMatch sets the optional parameter which makes the operation 16981// fail if the object's ETag matches the given value. This is useful for 16982// getting updates only after the object has changed since the last 16983// request. Use googleapi.IsNotModified to check whether the response 16984// error from Do is the result of In-None-Match. 16985func (c *ProjectsLocationsProductSetsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsProductSetsGetCall { 16986 c.ifNoneMatch_ = entityTag 16987 return c 16988} 16989 16990// Context sets the context to be used in this call's Do method. Any 16991// pending HTTP request will be aborted if the provided context is 16992// canceled. 16993func (c *ProjectsLocationsProductSetsGetCall) Context(ctx context.Context) *ProjectsLocationsProductSetsGetCall { 16994 c.ctx_ = ctx 16995 return c 16996} 16997 16998// Header returns an http.Header that can be modified by the caller to 16999// add HTTP headers to the request. 17000func (c *ProjectsLocationsProductSetsGetCall) Header() http.Header { 17001 if c.header_ == nil { 17002 c.header_ = make(http.Header) 17003 } 17004 return c.header_ 17005} 17006 17007func (c *ProjectsLocationsProductSetsGetCall) doRequest(alt string) (*http.Response, error) { 17008 reqHeaders := make(http.Header) 17009 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 17010 for k, v := range c.header_ { 17011 reqHeaders[k] = v 17012 } 17013 reqHeaders.Set("User-Agent", c.s.userAgent()) 17014 if c.ifNoneMatch_ != "" { 17015 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 17016 } 17017 var body io.Reader = nil 17018 c.urlParams_.Set("alt", alt) 17019 c.urlParams_.Set("prettyPrint", "false") 17020 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 17021 urls += "?" + c.urlParams_.Encode() 17022 req, err := http.NewRequest("GET", urls, body) 17023 if err != nil { 17024 return nil, err 17025 } 17026 req.Header = reqHeaders 17027 googleapi.Expand(req.URL, map[string]string{ 17028 "name": c.name, 17029 }) 17030 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17031} 17032 17033// Do executes the "vision.projects.locations.productSets.get" call. 17034// Exactly one of *ProductSet or error will be non-nil. Any non-2xx 17035// status code is an error. Response headers are in either 17036// *ProductSet.ServerResponse.Header or (if a response was returned at 17037// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 17038// to check whether the returned error was because 17039// http.StatusNotModified was returned. 17040func (c *ProjectsLocationsProductSetsGetCall) Do(opts ...googleapi.CallOption) (*ProductSet, error) { 17041 gensupport.SetOptions(c.urlParams_, opts...) 17042 res, err := c.doRequest("json") 17043 if res != nil && res.StatusCode == http.StatusNotModified { 17044 if res.Body != nil { 17045 res.Body.Close() 17046 } 17047 return nil, &googleapi.Error{ 17048 Code: res.StatusCode, 17049 Header: res.Header, 17050 } 17051 } 17052 if err != nil { 17053 return nil, err 17054 } 17055 defer googleapi.CloseBody(res) 17056 if err := googleapi.CheckResponse(res); err != nil { 17057 return nil, err 17058 } 17059 ret := &ProductSet{ 17060 ServerResponse: googleapi.ServerResponse{ 17061 Header: res.Header, 17062 HTTPStatusCode: res.StatusCode, 17063 }, 17064 } 17065 target := &ret 17066 if err := gensupport.DecodeResponse(target, res); err != nil { 17067 return nil, err 17068 } 17069 return ret, nil 17070 // { 17071 // "description": "Gets information associated with a ProductSet. Possible errors: * Returns NOT_FOUND if the ProductSet does not exist.", 17072 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/productSets/{productSetsId}", 17073 // "httpMethod": "GET", 17074 // "id": "vision.projects.locations.productSets.get", 17075 // "parameterOrder": [ 17076 // "name" 17077 // ], 17078 // "parameters": { 17079 // "name": { 17080 // "description": "Required. Resource name of the ProductSet to get. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`", 17081 // "location": "path", 17082 // "pattern": "^projects/[^/]+/locations/[^/]+/productSets/[^/]+$", 17083 // "required": true, 17084 // "type": "string" 17085 // } 17086 // }, 17087 // "path": "v1/{+name}", 17088 // "response": { 17089 // "$ref": "ProductSet" 17090 // }, 17091 // "scopes": [ 17092 // "https://www.googleapis.com/auth/cloud-platform", 17093 // "https://www.googleapis.com/auth/cloud-vision" 17094 // ] 17095 // } 17096 17097} 17098 17099// method id "vision.projects.locations.productSets.import": 17100 17101type ProjectsLocationsProductSetsImportCall struct { 17102 s *Service 17103 parent string 17104 importproductsetsrequest *ImportProductSetsRequest 17105 urlParams_ gensupport.URLParams 17106 ctx_ context.Context 17107 header_ http.Header 17108} 17109 17110// Import: Asynchronous API that imports a list of reference images to 17111// specified product sets based on a list of image information. The 17112// google.longrunning.Operation API can be used to keep track of the 17113// progress and results of the request. `Operation.metadata` contains 17114// `BatchOperationMetadata`. (progress) `Operation.response` contains 17115// `ImportProductSetsResponse`. (results) The input source of this 17116// method is a csv file on Google Cloud Storage. For the format of the 17117// csv file please see ImportProductSetsGcsSource.csv_file_uri. 17118func (r *ProjectsLocationsProductSetsService) Import(parent string, importproductsetsrequest *ImportProductSetsRequest) *ProjectsLocationsProductSetsImportCall { 17119 c := &ProjectsLocationsProductSetsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 17120 c.parent = parent 17121 c.importproductsetsrequest = importproductsetsrequest 17122 return c 17123} 17124 17125// Fields allows partial responses to be retrieved. See 17126// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 17127// for more information. 17128func (c *ProjectsLocationsProductSetsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductSetsImportCall { 17129 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17130 return c 17131} 17132 17133// Context sets the context to be used in this call's Do method. Any 17134// pending HTTP request will be aborted if the provided context is 17135// canceled. 17136func (c *ProjectsLocationsProductSetsImportCall) Context(ctx context.Context) *ProjectsLocationsProductSetsImportCall { 17137 c.ctx_ = ctx 17138 return c 17139} 17140 17141// Header returns an http.Header that can be modified by the caller to 17142// add HTTP headers to the request. 17143func (c *ProjectsLocationsProductSetsImportCall) Header() http.Header { 17144 if c.header_ == nil { 17145 c.header_ = make(http.Header) 17146 } 17147 return c.header_ 17148} 17149 17150func (c *ProjectsLocationsProductSetsImportCall) doRequest(alt string) (*http.Response, error) { 17151 reqHeaders := make(http.Header) 17152 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 17153 for k, v := range c.header_ { 17154 reqHeaders[k] = v 17155 } 17156 reqHeaders.Set("User-Agent", c.s.userAgent()) 17157 var body io.Reader = nil 17158 body, err := googleapi.WithoutDataWrapper.JSONReader(c.importproductsetsrequest) 17159 if err != nil { 17160 return nil, err 17161 } 17162 reqHeaders.Set("Content-Type", "application/json") 17163 c.urlParams_.Set("alt", alt) 17164 c.urlParams_.Set("prettyPrint", "false") 17165 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/productSets:import") 17166 urls += "?" + c.urlParams_.Encode() 17167 req, err := http.NewRequest("POST", urls, body) 17168 if err != nil { 17169 return nil, err 17170 } 17171 req.Header = reqHeaders 17172 googleapi.Expand(req.URL, map[string]string{ 17173 "parent": c.parent, 17174 }) 17175 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17176} 17177 17178// Do executes the "vision.projects.locations.productSets.import" call. 17179// Exactly one of *Operation or error will be non-nil. Any non-2xx 17180// status code is an error. Response headers are in either 17181// *Operation.ServerResponse.Header or (if a response was returned at 17182// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 17183// to check whether the returned error was because 17184// http.StatusNotModified was returned. 17185func (c *ProjectsLocationsProductSetsImportCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 17186 gensupport.SetOptions(c.urlParams_, opts...) 17187 res, err := c.doRequest("json") 17188 if res != nil && res.StatusCode == http.StatusNotModified { 17189 if res.Body != nil { 17190 res.Body.Close() 17191 } 17192 return nil, &googleapi.Error{ 17193 Code: res.StatusCode, 17194 Header: res.Header, 17195 } 17196 } 17197 if err != nil { 17198 return nil, err 17199 } 17200 defer googleapi.CloseBody(res) 17201 if err := googleapi.CheckResponse(res); err != nil { 17202 return nil, err 17203 } 17204 ret := &Operation{ 17205 ServerResponse: googleapi.ServerResponse{ 17206 Header: res.Header, 17207 HTTPStatusCode: res.StatusCode, 17208 }, 17209 } 17210 target := &ret 17211 if err := gensupport.DecodeResponse(target, res); err != nil { 17212 return nil, err 17213 } 17214 return ret, nil 17215 // { 17216 // "description": "Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. The google.longrunning.Operation API can be used to keep track of the progress and results of the request. `Operation.metadata` contains `BatchOperationMetadata`. (progress) `Operation.response` contains `ImportProductSetsResponse`. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see ImportProductSetsGcsSource.csv_file_uri.", 17217 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/productSets:import", 17218 // "httpMethod": "POST", 17219 // "id": "vision.projects.locations.productSets.import", 17220 // "parameterOrder": [ 17221 // "parent" 17222 // ], 17223 // "parameters": { 17224 // "parent": { 17225 // "description": "Required. The project in which the ProductSets should be imported. Format is `projects/PROJECT_ID/locations/LOC_ID`.", 17226 // "location": "path", 17227 // "pattern": "^projects/[^/]+/locations/[^/]+$", 17228 // "required": true, 17229 // "type": "string" 17230 // } 17231 // }, 17232 // "path": "v1/{+parent}/productSets:import", 17233 // "request": { 17234 // "$ref": "ImportProductSetsRequest" 17235 // }, 17236 // "response": { 17237 // "$ref": "Operation" 17238 // }, 17239 // "scopes": [ 17240 // "https://www.googleapis.com/auth/cloud-platform", 17241 // "https://www.googleapis.com/auth/cloud-vision" 17242 // ] 17243 // } 17244 17245} 17246 17247// method id "vision.projects.locations.productSets.list": 17248 17249type ProjectsLocationsProductSetsListCall struct { 17250 s *Service 17251 parent string 17252 urlParams_ gensupport.URLParams 17253 ifNoneMatch_ string 17254 ctx_ context.Context 17255 header_ http.Header 17256} 17257 17258// List: Lists ProductSets in an unspecified order. Possible errors: * 17259// Returns INVALID_ARGUMENT if page_size is greater than 100, or less 17260// than 1. 17261func (r *ProjectsLocationsProductSetsService) List(parent string) *ProjectsLocationsProductSetsListCall { 17262 c := &ProjectsLocationsProductSetsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 17263 c.parent = parent 17264 return c 17265} 17266 17267// PageSize sets the optional parameter "pageSize": The maximum number 17268// of items to return. Default 10, maximum 100. 17269func (c *ProjectsLocationsProductSetsListCall) PageSize(pageSize int64) *ProjectsLocationsProductSetsListCall { 17270 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 17271 return c 17272} 17273 17274// PageToken sets the optional parameter "pageToken": The 17275// next_page_token returned from a previous List request, if any. 17276func (c *ProjectsLocationsProductSetsListCall) PageToken(pageToken string) *ProjectsLocationsProductSetsListCall { 17277 c.urlParams_.Set("pageToken", pageToken) 17278 return c 17279} 17280 17281// Fields allows partial responses to be retrieved. See 17282// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 17283// for more information. 17284func (c *ProjectsLocationsProductSetsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductSetsListCall { 17285 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17286 return c 17287} 17288 17289// IfNoneMatch sets the optional parameter which makes the operation 17290// fail if the object's ETag matches the given value. This is useful for 17291// getting updates only after the object has changed since the last 17292// request. Use googleapi.IsNotModified to check whether the response 17293// error from Do is the result of In-None-Match. 17294func (c *ProjectsLocationsProductSetsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsProductSetsListCall { 17295 c.ifNoneMatch_ = entityTag 17296 return c 17297} 17298 17299// Context sets the context to be used in this call's Do method. Any 17300// pending HTTP request will be aborted if the provided context is 17301// canceled. 17302func (c *ProjectsLocationsProductSetsListCall) Context(ctx context.Context) *ProjectsLocationsProductSetsListCall { 17303 c.ctx_ = ctx 17304 return c 17305} 17306 17307// Header returns an http.Header that can be modified by the caller to 17308// add HTTP headers to the request. 17309func (c *ProjectsLocationsProductSetsListCall) Header() http.Header { 17310 if c.header_ == nil { 17311 c.header_ = make(http.Header) 17312 } 17313 return c.header_ 17314} 17315 17316func (c *ProjectsLocationsProductSetsListCall) doRequest(alt string) (*http.Response, error) { 17317 reqHeaders := make(http.Header) 17318 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 17319 for k, v := range c.header_ { 17320 reqHeaders[k] = v 17321 } 17322 reqHeaders.Set("User-Agent", c.s.userAgent()) 17323 if c.ifNoneMatch_ != "" { 17324 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 17325 } 17326 var body io.Reader = nil 17327 c.urlParams_.Set("alt", alt) 17328 c.urlParams_.Set("prettyPrint", "false") 17329 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/productSets") 17330 urls += "?" + c.urlParams_.Encode() 17331 req, err := http.NewRequest("GET", urls, body) 17332 if err != nil { 17333 return nil, err 17334 } 17335 req.Header = reqHeaders 17336 googleapi.Expand(req.URL, map[string]string{ 17337 "parent": c.parent, 17338 }) 17339 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17340} 17341 17342// Do executes the "vision.projects.locations.productSets.list" call. 17343// Exactly one of *ListProductSetsResponse or error will be non-nil. Any 17344// non-2xx status code is an error. Response headers are in either 17345// *ListProductSetsResponse.ServerResponse.Header or (if a response was 17346// returned at all) in error.(*googleapi.Error).Header. Use 17347// googleapi.IsNotModified to check whether the returned error was 17348// because http.StatusNotModified was returned. 17349func (c *ProjectsLocationsProductSetsListCall) Do(opts ...googleapi.CallOption) (*ListProductSetsResponse, error) { 17350 gensupport.SetOptions(c.urlParams_, opts...) 17351 res, err := c.doRequest("json") 17352 if res != nil && res.StatusCode == http.StatusNotModified { 17353 if res.Body != nil { 17354 res.Body.Close() 17355 } 17356 return nil, &googleapi.Error{ 17357 Code: res.StatusCode, 17358 Header: res.Header, 17359 } 17360 } 17361 if err != nil { 17362 return nil, err 17363 } 17364 defer googleapi.CloseBody(res) 17365 if err := googleapi.CheckResponse(res); err != nil { 17366 return nil, err 17367 } 17368 ret := &ListProductSetsResponse{ 17369 ServerResponse: googleapi.ServerResponse{ 17370 Header: res.Header, 17371 HTTPStatusCode: res.StatusCode, 17372 }, 17373 } 17374 target := &ret 17375 if err := gensupport.DecodeResponse(target, res); err != nil { 17376 return nil, err 17377 } 17378 return ret, nil 17379 // { 17380 // "description": "Lists ProductSets in an unspecified order. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1.", 17381 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/productSets", 17382 // "httpMethod": "GET", 17383 // "id": "vision.projects.locations.productSets.list", 17384 // "parameterOrder": [ 17385 // "parent" 17386 // ], 17387 // "parameters": { 17388 // "pageSize": { 17389 // "description": "The maximum number of items to return. Default 10, maximum 100.", 17390 // "format": "int32", 17391 // "location": "query", 17392 // "type": "integer" 17393 // }, 17394 // "pageToken": { 17395 // "description": "The next_page_token returned from a previous List request, if any.", 17396 // "location": "query", 17397 // "type": "string" 17398 // }, 17399 // "parent": { 17400 // "description": "Required. The project from which ProductSets should be listed. Format is `projects/PROJECT_ID/locations/LOC_ID`.", 17401 // "location": "path", 17402 // "pattern": "^projects/[^/]+/locations/[^/]+$", 17403 // "required": true, 17404 // "type": "string" 17405 // } 17406 // }, 17407 // "path": "v1/{+parent}/productSets", 17408 // "response": { 17409 // "$ref": "ListProductSetsResponse" 17410 // }, 17411 // "scopes": [ 17412 // "https://www.googleapis.com/auth/cloud-platform", 17413 // "https://www.googleapis.com/auth/cloud-vision" 17414 // ] 17415 // } 17416 17417} 17418 17419// Pages invokes f for each page of results. 17420// A non-nil error returned from f will halt the iteration. 17421// The provided context supersedes any context provided to the Context method. 17422func (c *ProjectsLocationsProductSetsListCall) Pages(ctx context.Context, f func(*ListProductSetsResponse) error) error { 17423 c.ctx_ = ctx 17424 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 17425 for { 17426 x, err := c.Do() 17427 if err != nil { 17428 return err 17429 } 17430 if err := f(x); err != nil { 17431 return err 17432 } 17433 if x.NextPageToken == "" { 17434 return nil 17435 } 17436 c.PageToken(x.NextPageToken) 17437 } 17438} 17439 17440// method id "vision.projects.locations.productSets.patch": 17441 17442type ProjectsLocationsProductSetsPatchCall struct { 17443 s *Service 17444 name string 17445 productset *ProductSet 17446 urlParams_ gensupport.URLParams 17447 ctx_ context.Context 17448 header_ http.Header 17449} 17450 17451// Patch: Makes changes to a ProductSet resource. Only display_name can 17452// be updated currently. Possible errors: * Returns NOT_FOUND if the 17453// ProductSet does not exist. * Returns INVALID_ARGUMENT if display_name 17454// is present in update_mask but missing from the request or longer than 17455// 4096 characters. 17456func (r *ProjectsLocationsProductSetsService) Patch(name string, productset *ProductSet) *ProjectsLocationsProductSetsPatchCall { 17457 c := &ProjectsLocationsProductSetsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 17458 c.name = name 17459 c.productset = productset 17460 return c 17461} 17462 17463// UpdateMask sets the optional parameter "updateMask": The FieldMask 17464// that specifies which fields to update. If update_mask isn't 17465// specified, all mutable fields are to be updated. Valid mask path is 17466// `display_name`. 17467func (c *ProjectsLocationsProductSetsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsProductSetsPatchCall { 17468 c.urlParams_.Set("updateMask", updateMask) 17469 return c 17470} 17471 17472// Fields allows partial responses to be retrieved. See 17473// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 17474// for more information. 17475func (c *ProjectsLocationsProductSetsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductSetsPatchCall { 17476 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17477 return c 17478} 17479 17480// Context sets the context to be used in this call's Do method. Any 17481// pending HTTP request will be aborted if the provided context is 17482// canceled. 17483func (c *ProjectsLocationsProductSetsPatchCall) Context(ctx context.Context) *ProjectsLocationsProductSetsPatchCall { 17484 c.ctx_ = ctx 17485 return c 17486} 17487 17488// Header returns an http.Header that can be modified by the caller to 17489// add HTTP headers to the request. 17490func (c *ProjectsLocationsProductSetsPatchCall) Header() http.Header { 17491 if c.header_ == nil { 17492 c.header_ = make(http.Header) 17493 } 17494 return c.header_ 17495} 17496 17497func (c *ProjectsLocationsProductSetsPatchCall) doRequest(alt string) (*http.Response, error) { 17498 reqHeaders := make(http.Header) 17499 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 17500 for k, v := range c.header_ { 17501 reqHeaders[k] = v 17502 } 17503 reqHeaders.Set("User-Agent", c.s.userAgent()) 17504 var body io.Reader = nil 17505 body, err := googleapi.WithoutDataWrapper.JSONReader(c.productset) 17506 if err != nil { 17507 return nil, err 17508 } 17509 reqHeaders.Set("Content-Type", "application/json") 17510 c.urlParams_.Set("alt", alt) 17511 c.urlParams_.Set("prettyPrint", "false") 17512 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 17513 urls += "?" + c.urlParams_.Encode() 17514 req, err := http.NewRequest("PATCH", urls, body) 17515 if err != nil { 17516 return nil, err 17517 } 17518 req.Header = reqHeaders 17519 googleapi.Expand(req.URL, map[string]string{ 17520 "name": c.name, 17521 }) 17522 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17523} 17524 17525// Do executes the "vision.projects.locations.productSets.patch" call. 17526// Exactly one of *ProductSet or error will be non-nil. Any non-2xx 17527// status code is an error. Response headers are in either 17528// *ProductSet.ServerResponse.Header or (if a response was returned at 17529// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 17530// to check whether the returned error was because 17531// http.StatusNotModified was returned. 17532func (c *ProjectsLocationsProductSetsPatchCall) Do(opts ...googleapi.CallOption) (*ProductSet, error) { 17533 gensupport.SetOptions(c.urlParams_, opts...) 17534 res, err := c.doRequest("json") 17535 if res != nil && res.StatusCode == http.StatusNotModified { 17536 if res.Body != nil { 17537 res.Body.Close() 17538 } 17539 return nil, &googleapi.Error{ 17540 Code: res.StatusCode, 17541 Header: res.Header, 17542 } 17543 } 17544 if err != nil { 17545 return nil, err 17546 } 17547 defer googleapi.CloseBody(res) 17548 if err := googleapi.CheckResponse(res); err != nil { 17549 return nil, err 17550 } 17551 ret := &ProductSet{ 17552 ServerResponse: googleapi.ServerResponse{ 17553 Header: res.Header, 17554 HTTPStatusCode: res.StatusCode, 17555 }, 17556 } 17557 target := &ret 17558 if err := gensupport.DecodeResponse(target, res); err != nil { 17559 return nil, err 17560 } 17561 return ret, nil 17562 // { 17563 // "description": "Makes changes to a ProductSet resource. Only display_name can be updated currently. Possible errors: * Returns NOT_FOUND if the ProductSet does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but missing from the request or longer than 4096 characters.", 17564 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/productSets/{productSetsId}", 17565 // "httpMethod": "PATCH", 17566 // "id": "vision.projects.locations.productSets.patch", 17567 // "parameterOrder": [ 17568 // "name" 17569 // ], 17570 // "parameters": { 17571 // "name": { 17572 // "description": "The resource name of the ProductSet. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. This field is ignored when creating a ProductSet.", 17573 // "location": "path", 17574 // "pattern": "^projects/[^/]+/locations/[^/]+/productSets/[^/]+$", 17575 // "required": true, 17576 // "type": "string" 17577 // }, 17578 // "updateMask": { 17579 // "description": "The FieldMask that specifies which fields to update. If update_mask isn't specified, all mutable fields are to be updated. Valid mask path is `display_name`.", 17580 // "format": "google-fieldmask", 17581 // "location": "query", 17582 // "type": "string" 17583 // } 17584 // }, 17585 // "path": "v1/{+name}", 17586 // "request": { 17587 // "$ref": "ProductSet" 17588 // }, 17589 // "response": { 17590 // "$ref": "ProductSet" 17591 // }, 17592 // "scopes": [ 17593 // "https://www.googleapis.com/auth/cloud-platform", 17594 // "https://www.googleapis.com/auth/cloud-vision" 17595 // ] 17596 // } 17597 17598} 17599 17600// method id "vision.projects.locations.productSets.removeProduct": 17601 17602type ProjectsLocationsProductSetsRemoveProductCall struct { 17603 s *Service 17604 name string 17605 removeproductfromproductsetrequest *RemoveProductFromProductSetRequest 17606 urlParams_ gensupport.URLParams 17607 ctx_ context.Context 17608 header_ http.Header 17609} 17610 17611// RemoveProduct: Removes a Product from the specified ProductSet. 17612func (r *ProjectsLocationsProductSetsService) RemoveProduct(name string, removeproductfromproductsetrequest *RemoveProductFromProductSetRequest) *ProjectsLocationsProductSetsRemoveProductCall { 17613 c := &ProjectsLocationsProductSetsRemoveProductCall{s: r.s, urlParams_: make(gensupport.URLParams)} 17614 c.name = name 17615 c.removeproductfromproductsetrequest = removeproductfromproductsetrequest 17616 return c 17617} 17618 17619// Fields allows partial responses to be retrieved. See 17620// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 17621// for more information. 17622func (c *ProjectsLocationsProductSetsRemoveProductCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductSetsRemoveProductCall { 17623 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17624 return c 17625} 17626 17627// Context sets the context to be used in this call's Do method. Any 17628// pending HTTP request will be aborted if the provided context is 17629// canceled. 17630func (c *ProjectsLocationsProductSetsRemoveProductCall) Context(ctx context.Context) *ProjectsLocationsProductSetsRemoveProductCall { 17631 c.ctx_ = ctx 17632 return c 17633} 17634 17635// Header returns an http.Header that can be modified by the caller to 17636// add HTTP headers to the request. 17637func (c *ProjectsLocationsProductSetsRemoveProductCall) Header() http.Header { 17638 if c.header_ == nil { 17639 c.header_ = make(http.Header) 17640 } 17641 return c.header_ 17642} 17643 17644func (c *ProjectsLocationsProductSetsRemoveProductCall) doRequest(alt string) (*http.Response, error) { 17645 reqHeaders := make(http.Header) 17646 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 17647 for k, v := range c.header_ { 17648 reqHeaders[k] = v 17649 } 17650 reqHeaders.Set("User-Agent", c.s.userAgent()) 17651 var body io.Reader = nil 17652 body, err := googleapi.WithoutDataWrapper.JSONReader(c.removeproductfromproductsetrequest) 17653 if err != nil { 17654 return nil, err 17655 } 17656 reqHeaders.Set("Content-Type", "application/json") 17657 c.urlParams_.Set("alt", alt) 17658 c.urlParams_.Set("prettyPrint", "false") 17659 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:removeProduct") 17660 urls += "?" + c.urlParams_.Encode() 17661 req, err := http.NewRequest("POST", urls, body) 17662 if err != nil { 17663 return nil, err 17664 } 17665 req.Header = reqHeaders 17666 googleapi.Expand(req.URL, map[string]string{ 17667 "name": c.name, 17668 }) 17669 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17670} 17671 17672// Do executes the "vision.projects.locations.productSets.removeProduct" call. 17673// Exactly one of *Empty or error will be non-nil. Any non-2xx status 17674// code is an error. Response headers are in either 17675// *Empty.ServerResponse.Header or (if a response was returned at all) 17676// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 17677// check whether the returned error was because http.StatusNotModified 17678// was returned. 17679func (c *ProjectsLocationsProductSetsRemoveProductCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 17680 gensupport.SetOptions(c.urlParams_, opts...) 17681 res, err := c.doRequest("json") 17682 if res != nil && res.StatusCode == http.StatusNotModified { 17683 if res.Body != nil { 17684 res.Body.Close() 17685 } 17686 return nil, &googleapi.Error{ 17687 Code: res.StatusCode, 17688 Header: res.Header, 17689 } 17690 } 17691 if err != nil { 17692 return nil, err 17693 } 17694 defer googleapi.CloseBody(res) 17695 if err := googleapi.CheckResponse(res); err != nil { 17696 return nil, err 17697 } 17698 ret := &Empty{ 17699 ServerResponse: googleapi.ServerResponse{ 17700 Header: res.Header, 17701 HTTPStatusCode: res.StatusCode, 17702 }, 17703 } 17704 target := &ret 17705 if err := gensupport.DecodeResponse(target, res); err != nil { 17706 return nil, err 17707 } 17708 return ret, nil 17709 // { 17710 // "description": "Removes a Product from the specified ProductSet.", 17711 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/productSets/{productSetsId}:removeProduct", 17712 // "httpMethod": "POST", 17713 // "id": "vision.projects.locations.productSets.removeProduct", 17714 // "parameterOrder": [ 17715 // "name" 17716 // ], 17717 // "parameters": { 17718 // "name": { 17719 // "description": "Required. The resource name for the ProductSet to modify. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`", 17720 // "location": "path", 17721 // "pattern": "^projects/[^/]+/locations/[^/]+/productSets/[^/]+$", 17722 // "required": true, 17723 // "type": "string" 17724 // } 17725 // }, 17726 // "path": "v1/{+name}:removeProduct", 17727 // "request": { 17728 // "$ref": "RemoveProductFromProductSetRequest" 17729 // }, 17730 // "response": { 17731 // "$ref": "Empty" 17732 // }, 17733 // "scopes": [ 17734 // "https://www.googleapis.com/auth/cloud-platform", 17735 // "https://www.googleapis.com/auth/cloud-vision" 17736 // ] 17737 // } 17738 17739} 17740 17741// method id "vision.projects.locations.productSets.products.list": 17742 17743type ProjectsLocationsProductSetsProductsListCall struct { 17744 s *Service 17745 name string 17746 urlParams_ gensupport.URLParams 17747 ifNoneMatch_ string 17748 ctx_ context.Context 17749 header_ http.Header 17750} 17751 17752// List: Lists the Products in a ProductSet, in an unspecified order. If 17753// the ProductSet does not exist, the products field of the response 17754// will be empty. Possible errors: * Returns INVALID_ARGUMENT if 17755// page_size is greater than 100 or less than 1. 17756func (r *ProjectsLocationsProductSetsProductsService) List(name string) *ProjectsLocationsProductSetsProductsListCall { 17757 c := &ProjectsLocationsProductSetsProductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 17758 c.name = name 17759 return c 17760} 17761 17762// PageSize sets the optional parameter "pageSize": The maximum number 17763// of items to return. Default 10, maximum 100. 17764func (c *ProjectsLocationsProductSetsProductsListCall) PageSize(pageSize int64) *ProjectsLocationsProductSetsProductsListCall { 17765 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 17766 return c 17767} 17768 17769// PageToken sets the optional parameter "pageToken": The 17770// next_page_token returned from a previous List request, if any. 17771func (c *ProjectsLocationsProductSetsProductsListCall) PageToken(pageToken string) *ProjectsLocationsProductSetsProductsListCall { 17772 c.urlParams_.Set("pageToken", pageToken) 17773 return c 17774} 17775 17776// Fields allows partial responses to be retrieved. See 17777// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 17778// for more information. 17779func (c *ProjectsLocationsProductSetsProductsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductSetsProductsListCall { 17780 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17781 return c 17782} 17783 17784// IfNoneMatch sets the optional parameter which makes the operation 17785// fail if the object's ETag matches the given value. This is useful for 17786// getting updates only after the object has changed since the last 17787// request. Use googleapi.IsNotModified to check whether the response 17788// error from Do is the result of In-None-Match. 17789func (c *ProjectsLocationsProductSetsProductsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsProductSetsProductsListCall { 17790 c.ifNoneMatch_ = entityTag 17791 return c 17792} 17793 17794// Context sets the context to be used in this call's Do method. Any 17795// pending HTTP request will be aborted if the provided context is 17796// canceled. 17797func (c *ProjectsLocationsProductSetsProductsListCall) Context(ctx context.Context) *ProjectsLocationsProductSetsProductsListCall { 17798 c.ctx_ = ctx 17799 return c 17800} 17801 17802// Header returns an http.Header that can be modified by the caller to 17803// add HTTP headers to the request. 17804func (c *ProjectsLocationsProductSetsProductsListCall) Header() http.Header { 17805 if c.header_ == nil { 17806 c.header_ = make(http.Header) 17807 } 17808 return c.header_ 17809} 17810 17811func (c *ProjectsLocationsProductSetsProductsListCall) doRequest(alt string) (*http.Response, error) { 17812 reqHeaders := make(http.Header) 17813 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 17814 for k, v := range c.header_ { 17815 reqHeaders[k] = v 17816 } 17817 reqHeaders.Set("User-Agent", c.s.userAgent()) 17818 if c.ifNoneMatch_ != "" { 17819 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 17820 } 17821 var body io.Reader = nil 17822 c.urlParams_.Set("alt", alt) 17823 c.urlParams_.Set("prettyPrint", "false") 17824 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/products") 17825 urls += "?" + c.urlParams_.Encode() 17826 req, err := http.NewRequest("GET", urls, body) 17827 if err != nil { 17828 return nil, err 17829 } 17830 req.Header = reqHeaders 17831 googleapi.Expand(req.URL, map[string]string{ 17832 "name": c.name, 17833 }) 17834 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17835} 17836 17837// Do executes the "vision.projects.locations.productSets.products.list" call. 17838// Exactly one of *ListProductsInProductSetResponse or error will be 17839// non-nil. Any non-2xx status code is an error. Response headers are in 17840// either *ListProductsInProductSetResponse.ServerResponse.Header or (if 17841// a response was returned at all) in error.(*googleapi.Error).Header. 17842// Use googleapi.IsNotModified to check whether the returned error was 17843// because http.StatusNotModified was returned. 17844func (c *ProjectsLocationsProductSetsProductsListCall) Do(opts ...googleapi.CallOption) (*ListProductsInProductSetResponse, error) { 17845 gensupport.SetOptions(c.urlParams_, opts...) 17846 res, err := c.doRequest("json") 17847 if res != nil && res.StatusCode == http.StatusNotModified { 17848 if res.Body != nil { 17849 res.Body.Close() 17850 } 17851 return nil, &googleapi.Error{ 17852 Code: res.StatusCode, 17853 Header: res.Header, 17854 } 17855 } 17856 if err != nil { 17857 return nil, err 17858 } 17859 defer googleapi.CloseBody(res) 17860 if err := googleapi.CheckResponse(res); err != nil { 17861 return nil, err 17862 } 17863 ret := &ListProductsInProductSetResponse{ 17864 ServerResponse: googleapi.ServerResponse{ 17865 Header: res.Header, 17866 HTTPStatusCode: res.StatusCode, 17867 }, 17868 } 17869 target := &ret 17870 if err := gensupport.DecodeResponse(target, res); err != nil { 17871 return nil, err 17872 } 17873 return ret, nil 17874 // { 17875 // "description": "Lists the Products in a ProductSet, in an unspecified order. If the ProductSet does not exist, the products field of the response will be empty. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.", 17876 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/productSets/{productSetsId}/products", 17877 // "httpMethod": "GET", 17878 // "id": "vision.projects.locations.productSets.products.list", 17879 // "parameterOrder": [ 17880 // "name" 17881 // ], 17882 // "parameters": { 17883 // "name": { 17884 // "description": "Required. The ProductSet resource for which to retrieve Products. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`", 17885 // "location": "path", 17886 // "pattern": "^projects/[^/]+/locations/[^/]+/productSets/[^/]+$", 17887 // "required": true, 17888 // "type": "string" 17889 // }, 17890 // "pageSize": { 17891 // "description": "The maximum number of items to return. Default 10, maximum 100.", 17892 // "format": "int32", 17893 // "location": "query", 17894 // "type": "integer" 17895 // }, 17896 // "pageToken": { 17897 // "description": "The next_page_token returned from a previous List request, if any.", 17898 // "location": "query", 17899 // "type": "string" 17900 // } 17901 // }, 17902 // "path": "v1/{+name}/products", 17903 // "response": { 17904 // "$ref": "ListProductsInProductSetResponse" 17905 // }, 17906 // "scopes": [ 17907 // "https://www.googleapis.com/auth/cloud-platform", 17908 // "https://www.googleapis.com/auth/cloud-vision" 17909 // ] 17910 // } 17911 17912} 17913 17914// Pages invokes f for each page of results. 17915// A non-nil error returned from f will halt the iteration. 17916// The provided context supersedes any context provided to the Context method. 17917func (c *ProjectsLocationsProductSetsProductsListCall) Pages(ctx context.Context, f func(*ListProductsInProductSetResponse) error) error { 17918 c.ctx_ = ctx 17919 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 17920 for { 17921 x, err := c.Do() 17922 if err != nil { 17923 return err 17924 } 17925 if err := f(x); err != nil { 17926 return err 17927 } 17928 if x.NextPageToken == "" { 17929 return nil 17930 } 17931 c.PageToken(x.NextPageToken) 17932 } 17933} 17934 17935// method id "vision.projects.locations.products.create": 17936 17937type ProjectsLocationsProductsCreateCall struct { 17938 s *Service 17939 parent string 17940 product *Product 17941 urlParams_ gensupport.URLParams 17942 ctx_ context.Context 17943 header_ http.Header 17944} 17945 17946// Create: Creates and returns a new product resource. Possible errors: 17947// * Returns INVALID_ARGUMENT if display_name is missing or longer than 17948// 4096 characters. * Returns INVALID_ARGUMENT if description is longer 17949// than 4096 characters. * Returns INVALID_ARGUMENT if product_category 17950// is missing or invalid. 17951func (r *ProjectsLocationsProductsService) Create(parent string, product *Product) *ProjectsLocationsProductsCreateCall { 17952 c := &ProjectsLocationsProductsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 17953 c.parent = parent 17954 c.product = product 17955 return c 17956} 17957 17958// ProductId sets the optional parameter "productId": A user-supplied 17959// resource id for this Product. If set, the server will attempt to use 17960// this value as the resource id. If it is already in use, an error is 17961// returned with code ALREADY_EXISTS. Must be at most 128 characters 17962// long. It cannot contain the character `/`. 17963func (c *ProjectsLocationsProductsCreateCall) ProductId(productId string) *ProjectsLocationsProductsCreateCall { 17964 c.urlParams_.Set("productId", productId) 17965 return c 17966} 17967 17968// Fields allows partial responses to be retrieved. See 17969// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 17970// for more information. 17971func (c *ProjectsLocationsProductsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductsCreateCall { 17972 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17973 return c 17974} 17975 17976// Context sets the context to be used in this call's Do method. Any 17977// pending HTTP request will be aborted if the provided context is 17978// canceled. 17979func (c *ProjectsLocationsProductsCreateCall) Context(ctx context.Context) *ProjectsLocationsProductsCreateCall { 17980 c.ctx_ = ctx 17981 return c 17982} 17983 17984// Header returns an http.Header that can be modified by the caller to 17985// add HTTP headers to the request. 17986func (c *ProjectsLocationsProductsCreateCall) Header() http.Header { 17987 if c.header_ == nil { 17988 c.header_ = make(http.Header) 17989 } 17990 return c.header_ 17991} 17992 17993func (c *ProjectsLocationsProductsCreateCall) doRequest(alt string) (*http.Response, error) { 17994 reqHeaders := make(http.Header) 17995 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 17996 for k, v := range c.header_ { 17997 reqHeaders[k] = v 17998 } 17999 reqHeaders.Set("User-Agent", c.s.userAgent()) 18000 var body io.Reader = nil 18001 body, err := googleapi.WithoutDataWrapper.JSONReader(c.product) 18002 if err != nil { 18003 return nil, err 18004 } 18005 reqHeaders.Set("Content-Type", "application/json") 18006 c.urlParams_.Set("alt", alt) 18007 c.urlParams_.Set("prettyPrint", "false") 18008 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/products") 18009 urls += "?" + c.urlParams_.Encode() 18010 req, err := http.NewRequest("POST", urls, body) 18011 if err != nil { 18012 return nil, err 18013 } 18014 req.Header = reqHeaders 18015 googleapi.Expand(req.URL, map[string]string{ 18016 "parent": c.parent, 18017 }) 18018 return gensupport.SendRequest(c.ctx_, c.s.client, req) 18019} 18020 18021// Do executes the "vision.projects.locations.products.create" call. 18022// Exactly one of *Product or error will be non-nil. Any non-2xx status 18023// code is an error. Response headers are in either 18024// *Product.ServerResponse.Header or (if a response was returned at all) 18025// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 18026// check whether the returned error was because http.StatusNotModified 18027// was returned. 18028func (c *ProjectsLocationsProductsCreateCall) Do(opts ...googleapi.CallOption) (*Product, error) { 18029 gensupport.SetOptions(c.urlParams_, opts...) 18030 res, err := c.doRequest("json") 18031 if res != nil && res.StatusCode == http.StatusNotModified { 18032 if res.Body != nil { 18033 res.Body.Close() 18034 } 18035 return nil, &googleapi.Error{ 18036 Code: res.StatusCode, 18037 Header: res.Header, 18038 } 18039 } 18040 if err != nil { 18041 return nil, err 18042 } 18043 defer googleapi.CloseBody(res) 18044 if err := googleapi.CheckResponse(res); err != nil { 18045 return nil, err 18046 } 18047 ret := &Product{ 18048 ServerResponse: googleapi.ServerResponse{ 18049 Header: res.Header, 18050 HTTPStatusCode: res.StatusCode, 18051 }, 18052 } 18053 target := &ret 18054 if err := gensupport.DecodeResponse(target, res); err != nil { 18055 return nil, err 18056 } 18057 return ret, nil 18058 // { 18059 // "description": "Creates and returns a new product resource. Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if description is longer than 4096 characters. * Returns INVALID_ARGUMENT if product_category is missing or invalid.", 18060 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/products", 18061 // "httpMethod": "POST", 18062 // "id": "vision.projects.locations.products.create", 18063 // "parameterOrder": [ 18064 // "parent" 18065 // ], 18066 // "parameters": { 18067 // "parent": { 18068 // "description": "Required. The project in which the Product should be created. Format is `projects/PROJECT_ID/locations/LOC_ID`.", 18069 // "location": "path", 18070 // "pattern": "^projects/[^/]+/locations/[^/]+$", 18071 // "required": true, 18072 // "type": "string" 18073 // }, 18074 // "productId": { 18075 // "description": "A user-supplied resource id for this Product. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character `/`.", 18076 // "location": "query", 18077 // "type": "string" 18078 // } 18079 // }, 18080 // "path": "v1/{+parent}/products", 18081 // "request": { 18082 // "$ref": "Product" 18083 // }, 18084 // "response": { 18085 // "$ref": "Product" 18086 // }, 18087 // "scopes": [ 18088 // "https://www.googleapis.com/auth/cloud-platform", 18089 // "https://www.googleapis.com/auth/cloud-vision" 18090 // ] 18091 // } 18092 18093} 18094 18095// method id "vision.projects.locations.products.delete": 18096 18097type ProjectsLocationsProductsDeleteCall struct { 18098 s *Service 18099 name string 18100 urlParams_ gensupport.URLParams 18101 ctx_ context.Context 18102 header_ http.Header 18103} 18104 18105// Delete: Permanently deletes a product and its reference images. 18106// Metadata of the product and all its images will be deleted right 18107// away, but search queries against ProductSets containing the product 18108// may still work until all related caches are refreshed. 18109func (r *ProjectsLocationsProductsService) Delete(name string) *ProjectsLocationsProductsDeleteCall { 18110 c := &ProjectsLocationsProductsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 18111 c.name = name 18112 return c 18113} 18114 18115// Fields allows partial responses to be retrieved. See 18116// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 18117// for more information. 18118func (c *ProjectsLocationsProductsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductsDeleteCall { 18119 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 18120 return c 18121} 18122 18123// Context sets the context to be used in this call's Do method. Any 18124// pending HTTP request will be aborted if the provided context is 18125// canceled. 18126func (c *ProjectsLocationsProductsDeleteCall) Context(ctx context.Context) *ProjectsLocationsProductsDeleteCall { 18127 c.ctx_ = ctx 18128 return c 18129} 18130 18131// Header returns an http.Header that can be modified by the caller to 18132// add HTTP headers to the request. 18133func (c *ProjectsLocationsProductsDeleteCall) Header() http.Header { 18134 if c.header_ == nil { 18135 c.header_ = make(http.Header) 18136 } 18137 return c.header_ 18138} 18139 18140func (c *ProjectsLocationsProductsDeleteCall) doRequest(alt string) (*http.Response, error) { 18141 reqHeaders := make(http.Header) 18142 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 18143 for k, v := range c.header_ { 18144 reqHeaders[k] = v 18145 } 18146 reqHeaders.Set("User-Agent", c.s.userAgent()) 18147 var body io.Reader = nil 18148 c.urlParams_.Set("alt", alt) 18149 c.urlParams_.Set("prettyPrint", "false") 18150 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 18151 urls += "?" + c.urlParams_.Encode() 18152 req, err := http.NewRequest("DELETE", urls, body) 18153 if err != nil { 18154 return nil, err 18155 } 18156 req.Header = reqHeaders 18157 googleapi.Expand(req.URL, map[string]string{ 18158 "name": c.name, 18159 }) 18160 return gensupport.SendRequest(c.ctx_, c.s.client, req) 18161} 18162 18163// Do executes the "vision.projects.locations.products.delete" call. 18164// Exactly one of *Empty or error will be non-nil. Any non-2xx status 18165// code is an error. Response headers are in either 18166// *Empty.ServerResponse.Header or (if a response was returned at all) 18167// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 18168// check whether the returned error was because http.StatusNotModified 18169// was returned. 18170func (c *ProjectsLocationsProductsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 18171 gensupport.SetOptions(c.urlParams_, opts...) 18172 res, err := c.doRequest("json") 18173 if res != nil && res.StatusCode == http.StatusNotModified { 18174 if res.Body != nil { 18175 res.Body.Close() 18176 } 18177 return nil, &googleapi.Error{ 18178 Code: res.StatusCode, 18179 Header: res.Header, 18180 } 18181 } 18182 if err != nil { 18183 return nil, err 18184 } 18185 defer googleapi.CloseBody(res) 18186 if err := googleapi.CheckResponse(res); err != nil { 18187 return nil, err 18188 } 18189 ret := &Empty{ 18190 ServerResponse: googleapi.ServerResponse{ 18191 Header: res.Header, 18192 HTTPStatusCode: res.StatusCode, 18193 }, 18194 } 18195 target := &ret 18196 if err := gensupport.DecodeResponse(target, res); err != nil { 18197 return nil, err 18198 } 18199 return ret, nil 18200 // { 18201 // "description": "Permanently deletes a product and its reference images. Metadata of the product and all its images will be deleted right away, but search queries against ProductSets containing the product may still work until all related caches are refreshed.", 18202 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/products/{productsId}", 18203 // "httpMethod": "DELETE", 18204 // "id": "vision.projects.locations.products.delete", 18205 // "parameterOrder": [ 18206 // "name" 18207 // ], 18208 // "parameters": { 18209 // "name": { 18210 // "description": "Required. Resource name of product to delete. Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`", 18211 // "location": "path", 18212 // "pattern": "^projects/[^/]+/locations/[^/]+/products/[^/]+$", 18213 // "required": true, 18214 // "type": "string" 18215 // } 18216 // }, 18217 // "path": "v1/{+name}", 18218 // "response": { 18219 // "$ref": "Empty" 18220 // }, 18221 // "scopes": [ 18222 // "https://www.googleapis.com/auth/cloud-platform", 18223 // "https://www.googleapis.com/auth/cloud-vision" 18224 // ] 18225 // } 18226 18227} 18228 18229// method id "vision.projects.locations.products.get": 18230 18231type ProjectsLocationsProductsGetCall struct { 18232 s *Service 18233 name string 18234 urlParams_ gensupport.URLParams 18235 ifNoneMatch_ string 18236 ctx_ context.Context 18237 header_ http.Header 18238} 18239 18240// Get: Gets information associated with a Product. Possible errors: * 18241// Returns NOT_FOUND if the Product does not exist. 18242func (r *ProjectsLocationsProductsService) Get(name string) *ProjectsLocationsProductsGetCall { 18243 c := &ProjectsLocationsProductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 18244 c.name = name 18245 return c 18246} 18247 18248// Fields allows partial responses to be retrieved. See 18249// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 18250// for more information. 18251func (c *ProjectsLocationsProductsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductsGetCall { 18252 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 18253 return c 18254} 18255 18256// IfNoneMatch sets the optional parameter which makes the operation 18257// fail if the object's ETag matches the given value. This is useful for 18258// getting updates only after the object has changed since the last 18259// request. Use googleapi.IsNotModified to check whether the response 18260// error from Do is the result of In-None-Match. 18261func (c *ProjectsLocationsProductsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsProductsGetCall { 18262 c.ifNoneMatch_ = entityTag 18263 return c 18264} 18265 18266// Context sets the context to be used in this call's Do method. Any 18267// pending HTTP request will be aborted if the provided context is 18268// canceled. 18269func (c *ProjectsLocationsProductsGetCall) Context(ctx context.Context) *ProjectsLocationsProductsGetCall { 18270 c.ctx_ = ctx 18271 return c 18272} 18273 18274// Header returns an http.Header that can be modified by the caller to 18275// add HTTP headers to the request. 18276func (c *ProjectsLocationsProductsGetCall) Header() http.Header { 18277 if c.header_ == nil { 18278 c.header_ = make(http.Header) 18279 } 18280 return c.header_ 18281} 18282 18283func (c *ProjectsLocationsProductsGetCall) doRequest(alt string) (*http.Response, error) { 18284 reqHeaders := make(http.Header) 18285 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 18286 for k, v := range c.header_ { 18287 reqHeaders[k] = v 18288 } 18289 reqHeaders.Set("User-Agent", c.s.userAgent()) 18290 if c.ifNoneMatch_ != "" { 18291 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 18292 } 18293 var body io.Reader = nil 18294 c.urlParams_.Set("alt", alt) 18295 c.urlParams_.Set("prettyPrint", "false") 18296 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 18297 urls += "?" + c.urlParams_.Encode() 18298 req, err := http.NewRequest("GET", urls, body) 18299 if err != nil { 18300 return nil, err 18301 } 18302 req.Header = reqHeaders 18303 googleapi.Expand(req.URL, map[string]string{ 18304 "name": c.name, 18305 }) 18306 return gensupport.SendRequest(c.ctx_, c.s.client, req) 18307} 18308 18309// Do executes the "vision.projects.locations.products.get" call. 18310// Exactly one of *Product or error will be non-nil. Any non-2xx status 18311// code is an error. Response headers are in either 18312// *Product.ServerResponse.Header or (if a response was returned at all) 18313// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 18314// check whether the returned error was because http.StatusNotModified 18315// was returned. 18316func (c *ProjectsLocationsProductsGetCall) Do(opts ...googleapi.CallOption) (*Product, error) { 18317 gensupport.SetOptions(c.urlParams_, opts...) 18318 res, err := c.doRequest("json") 18319 if res != nil && res.StatusCode == http.StatusNotModified { 18320 if res.Body != nil { 18321 res.Body.Close() 18322 } 18323 return nil, &googleapi.Error{ 18324 Code: res.StatusCode, 18325 Header: res.Header, 18326 } 18327 } 18328 if err != nil { 18329 return nil, err 18330 } 18331 defer googleapi.CloseBody(res) 18332 if err := googleapi.CheckResponse(res); err != nil { 18333 return nil, err 18334 } 18335 ret := &Product{ 18336 ServerResponse: googleapi.ServerResponse{ 18337 Header: res.Header, 18338 HTTPStatusCode: res.StatusCode, 18339 }, 18340 } 18341 target := &ret 18342 if err := gensupport.DecodeResponse(target, res); err != nil { 18343 return nil, err 18344 } 18345 return ret, nil 18346 // { 18347 // "description": "Gets information associated with a Product. Possible errors: * Returns NOT_FOUND if the Product does not exist.", 18348 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/products/{productsId}", 18349 // "httpMethod": "GET", 18350 // "id": "vision.projects.locations.products.get", 18351 // "parameterOrder": [ 18352 // "name" 18353 // ], 18354 // "parameters": { 18355 // "name": { 18356 // "description": "Required. Resource name of the Product to get. Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`", 18357 // "location": "path", 18358 // "pattern": "^projects/[^/]+/locations/[^/]+/products/[^/]+$", 18359 // "required": true, 18360 // "type": "string" 18361 // } 18362 // }, 18363 // "path": "v1/{+name}", 18364 // "response": { 18365 // "$ref": "Product" 18366 // }, 18367 // "scopes": [ 18368 // "https://www.googleapis.com/auth/cloud-platform", 18369 // "https://www.googleapis.com/auth/cloud-vision" 18370 // ] 18371 // } 18372 18373} 18374 18375// method id "vision.projects.locations.products.list": 18376 18377type ProjectsLocationsProductsListCall struct { 18378 s *Service 18379 parent string 18380 urlParams_ gensupport.URLParams 18381 ifNoneMatch_ string 18382 ctx_ context.Context 18383 header_ http.Header 18384} 18385 18386// List: Lists products in an unspecified order. Possible errors: * 18387// Returns INVALID_ARGUMENT if page_size is greater than 100 or less 18388// than 1. 18389func (r *ProjectsLocationsProductsService) List(parent string) *ProjectsLocationsProductsListCall { 18390 c := &ProjectsLocationsProductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 18391 c.parent = parent 18392 return c 18393} 18394 18395// PageSize sets the optional parameter "pageSize": The maximum number 18396// of items to return. Default 10, maximum 100. 18397func (c *ProjectsLocationsProductsListCall) PageSize(pageSize int64) *ProjectsLocationsProductsListCall { 18398 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 18399 return c 18400} 18401 18402// PageToken sets the optional parameter "pageToken": The 18403// next_page_token returned from a previous List request, if any. 18404func (c *ProjectsLocationsProductsListCall) PageToken(pageToken string) *ProjectsLocationsProductsListCall { 18405 c.urlParams_.Set("pageToken", pageToken) 18406 return c 18407} 18408 18409// Fields allows partial responses to be retrieved. See 18410// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 18411// for more information. 18412func (c *ProjectsLocationsProductsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductsListCall { 18413 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 18414 return c 18415} 18416 18417// IfNoneMatch sets the optional parameter which makes the operation 18418// fail if the object's ETag matches the given value. This is useful for 18419// getting updates only after the object has changed since the last 18420// request. Use googleapi.IsNotModified to check whether the response 18421// error from Do is the result of In-None-Match. 18422func (c *ProjectsLocationsProductsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsProductsListCall { 18423 c.ifNoneMatch_ = entityTag 18424 return c 18425} 18426 18427// Context sets the context to be used in this call's Do method. Any 18428// pending HTTP request will be aborted if the provided context is 18429// canceled. 18430func (c *ProjectsLocationsProductsListCall) Context(ctx context.Context) *ProjectsLocationsProductsListCall { 18431 c.ctx_ = ctx 18432 return c 18433} 18434 18435// Header returns an http.Header that can be modified by the caller to 18436// add HTTP headers to the request. 18437func (c *ProjectsLocationsProductsListCall) Header() http.Header { 18438 if c.header_ == nil { 18439 c.header_ = make(http.Header) 18440 } 18441 return c.header_ 18442} 18443 18444func (c *ProjectsLocationsProductsListCall) doRequest(alt string) (*http.Response, error) { 18445 reqHeaders := make(http.Header) 18446 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 18447 for k, v := range c.header_ { 18448 reqHeaders[k] = v 18449 } 18450 reqHeaders.Set("User-Agent", c.s.userAgent()) 18451 if c.ifNoneMatch_ != "" { 18452 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 18453 } 18454 var body io.Reader = nil 18455 c.urlParams_.Set("alt", alt) 18456 c.urlParams_.Set("prettyPrint", "false") 18457 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/products") 18458 urls += "?" + c.urlParams_.Encode() 18459 req, err := http.NewRequest("GET", urls, body) 18460 if err != nil { 18461 return nil, err 18462 } 18463 req.Header = reqHeaders 18464 googleapi.Expand(req.URL, map[string]string{ 18465 "parent": c.parent, 18466 }) 18467 return gensupport.SendRequest(c.ctx_, c.s.client, req) 18468} 18469 18470// Do executes the "vision.projects.locations.products.list" call. 18471// Exactly one of *ListProductsResponse or error will be non-nil. Any 18472// non-2xx status code is an error. Response headers are in either 18473// *ListProductsResponse.ServerResponse.Header or (if a response was 18474// returned at all) in error.(*googleapi.Error).Header. Use 18475// googleapi.IsNotModified to check whether the returned error was 18476// because http.StatusNotModified was returned. 18477func (c *ProjectsLocationsProductsListCall) Do(opts ...googleapi.CallOption) (*ListProductsResponse, error) { 18478 gensupport.SetOptions(c.urlParams_, opts...) 18479 res, err := c.doRequest("json") 18480 if res != nil && res.StatusCode == http.StatusNotModified { 18481 if res.Body != nil { 18482 res.Body.Close() 18483 } 18484 return nil, &googleapi.Error{ 18485 Code: res.StatusCode, 18486 Header: res.Header, 18487 } 18488 } 18489 if err != nil { 18490 return nil, err 18491 } 18492 defer googleapi.CloseBody(res) 18493 if err := googleapi.CheckResponse(res); err != nil { 18494 return nil, err 18495 } 18496 ret := &ListProductsResponse{ 18497 ServerResponse: googleapi.ServerResponse{ 18498 Header: res.Header, 18499 HTTPStatusCode: res.StatusCode, 18500 }, 18501 } 18502 target := &ret 18503 if err := gensupport.DecodeResponse(target, res); err != nil { 18504 return nil, err 18505 } 18506 return ret, nil 18507 // { 18508 // "description": "Lists products in an unspecified order. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.", 18509 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/products", 18510 // "httpMethod": "GET", 18511 // "id": "vision.projects.locations.products.list", 18512 // "parameterOrder": [ 18513 // "parent" 18514 // ], 18515 // "parameters": { 18516 // "pageSize": { 18517 // "description": "The maximum number of items to return. Default 10, maximum 100.", 18518 // "format": "int32", 18519 // "location": "query", 18520 // "type": "integer" 18521 // }, 18522 // "pageToken": { 18523 // "description": "The next_page_token returned from a previous List request, if any.", 18524 // "location": "query", 18525 // "type": "string" 18526 // }, 18527 // "parent": { 18528 // "description": "Required. The project OR ProductSet from which Products should be listed. Format: `projects/PROJECT_ID/locations/LOC_ID`", 18529 // "location": "path", 18530 // "pattern": "^projects/[^/]+/locations/[^/]+$", 18531 // "required": true, 18532 // "type": "string" 18533 // } 18534 // }, 18535 // "path": "v1/{+parent}/products", 18536 // "response": { 18537 // "$ref": "ListProductsResponse" 18538 // }, 18539 // "scopes": [ 18540 // "https://www.googleapis.com/auth/cloud-platform", 18541 // "https://www.googleapis.com/auth/cloud-vision" 18542 // ] 18543 // } 18544 18545} 18546 18547// Pages invokes f for each page of results. 18548// A non-nil error returned from f will halt the iteration. 18549// The provided context supersedes any context provided to the Context method. 18550func (c *ProjectsLocationsProductsListCall) Pages(ctx context.Context, f func(*ListProductsResponse) error) error { 18551 c.ctx_ = ctx 18552 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 18553 for { 18554 x, err := c.Do() 18555 if err != nil { 18556 return err 18557 } 18558 if err := f(x); err != nil { 18559 return err 18560 } 18561 if x.NextPageToken == "" { 18562 return nil 18563 } 18564 c.PageToken(x.NextPageToken) 18565 } 18566} 18567 18568// method id "vision.projects.locations.products.patch": 18569 18570type ProjectsLocationsProductsPatchCall struct { 18571 s *Service 18572 name string 18573 product *Product 18574 urlParams_ gensupport.URLParams 18575 ctx_ context.Context 18576 header_ http.Header 18577} 18578 18579// Patch: Makes changes to a Product resource. Only the `display_name`, 18580// `description`, and `labels` fields can be updated right now. If 18581// labels are updated, the change will not be reflected in queries until 18582// the next index time. Possible errors: * Returns NOT_FOUND if the 18583// Product does not exist. * Returns INVALID_ARGUMENT if display_name is 18584// present in update_mask but is missing from the request or longer than 18585// 4096 characters. * Returns INVALID_ARGUMENT if description is present 18586// in update_mask but is longer than 4096 characters. * Returns 18587// INVALID_ARGUMENT if product_category is present in update_mask. 18588func (r *ProjectsLocationsProductsService) Patch(name string, product *Product) *ProjectsLocationsProductsPatchCall { 18589 c := &ProjectsLocationsProductsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 18590 c.name = name 18591 c.product = product 18592 return c 18593} 18594 18595// UpdateMask sets the optional parameter "updateMask": The FieldMask 18596// that specifies which fields to update. If update_mask isn't 18597// specified, all mutable fields are to be updated. Valid mask paths 18598// include `product_labels`, `display_name`, and `description`. 18599func (c *ProjectsLocationsProductsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsProductsPatchCall { 18600 c.urlParams_.Set("updateMask", updateMask) 18601 return c 18602} 18603 18604// Fields allows partial responses to be retrieved. See 18605// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 18606// for more information. 18607func (c *ProjectsLocationsProductsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductsPatchCall { 18608 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 18609 return c 18610} 18611 18612// Context sets the context to be used in this call's Do method. Any 18613// pending HTTP request will be aborted if the provided context is 18614// canceled. 18615func (c *ProjectsLocationsProductsPatchCall) Context(ctx context.Context) *ProjectsLocationsProductsPatchCall { 18616 c.ctx_ = ctx 18617 return c 18618} 18619 18620// Header returns an http.Header that can be modified by the caller to 18621// add HTTP headers to the request. 18622func (c *ProjectsLocationsProductsPatchCall) Header() http.Header { 18623 if c.header_ == nil { 18624 c.header_ = make(http.Header) 18625 } 18626 return c.header_ 18627} 18628 18629func (c *ProjectsLocationsProductsPatchCall) doRequest(alt string) (*http.Response, error) { 18630 reqHeaders := make(http.Header) 18631 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 18632 for k, v := range c.header_ { 18633 reqHeaders[k] = v 18634 } 18635 reqHeaders.Set("User-Agent", c.s.userAgent()) 18636 var body io.Reader = nil 18637 body, err := googleapi.WithoutDataWrapper.JSONReader(c.product) 18638 if err != nil { 18639 return nil, err 18640 } 18641 reqHeaders.Set("Content-Type", "application/json") 18642 c.urlParams_.Set("alt", alt) 18643 c.urlParams_.Set("prettyPrint", "false") 18644 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 18645 urls += "?" + c.urlParams_.Encode() 18646 req, err := http.NewRequest("PATCH", urls, body) 18647 if err != nil { 18648 return nil, err 18649 } 18650 req.Header = reqHeaders 18651 googleapi.Expand(req.URL, map[string]string{ 18652 "name": c.name, 18653 }) 18654 return gensupport.SendRequest(c.ctx_, c.s.client, req) 18655} 18656 18657// Do executes the "vision.projects.locations.products.patch" call. 18658// Exactly one of *Product or error will be non-nil. Any non-2xx status 18659// code is an error. Response headers are in either 18660// *Product.ServerResponse.Header or (if a response was returned at all) 18661// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 18662// check whether the returned error was because http.StatusNotModified 18663// was returned. 18664func (c *ProjectsLocationsProductsPatchCall) Do(opts ...googleapi.CallOption) (*Product, error) { 18665 gensupport.SetOptions(c.urlParams_, opts...) 18666 res, err := c.doRequest("json") 18667 if res != nil && res.StatusCode == http.StatusNotModified { 18668 if res.Body != nil { 18669 res.Body.Close() 18670 } 18671 return nil, &googleapi.Error{ 18672 Code: res.StatusCode, 18673 Header: res.Header, 18674 } 18675 } 18676 if err != nil { 18677 return nil, err 18678 } 18679 defer googleapi.CloseBody(res) 18680 if err := googleapi.CheckResponse(res); err != nil { 18681 return nil, err 18682 } 18683 ret := &Product{ 18684 ServerResponse: googleapi.ServerResponse{ 18685 Header: res.Header, 18686 HTTPStatusCode: res.StatusCode, 18687 }, 18688 } 18689 target := &ret 18690 if err := gensupport.DecodeResponse(target, res); err != nil { 18691 return nil, err 18692 } 18693 return ret, nil 18694 // { 18695 // "description": "Makes changes to a Product resource. Only the `display_name`, `description`, and `labels` fields can be updated right now. If labels are updated, the change will not be reflected in queries until the next index time. Possible errors: * Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but is missing from the request or longer than 4096 characters. * Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. * Returns INVALID_ARGUMENT if product_category is present in update_mask.", 18696 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/products/{productsId}", 18697 // "httpMethod": "PATCH", 18698 // "id": "vision.projects.locations.products.patch", 18699 // "parameterOrder": [ 18700 // "name" 18701 // ], 18702 // "parameters": { 18703 // "name": { 18704 // "description": "The resource name of the product. Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This field is ignored when creating a product.", 18705 // "location": "path", 18706 // "pattern": "^projects/[^/]+/locations/[^/]+/products/[^/]+$", 18707 // "required": true, 18708 // "type": "string" 18709 // }, 18710 // "updateMask": { 18711 // "description": "The FieldMask that specifies which fields to update. If update_mask isn't specified, all mutable fields are to be updated. Valid mask paths include `product_labels`, `display_name`, and `description`.", 18712 // "format": "google-fieldmask", 18713 // "location": "query", 18714 // "type": "string" 18715 // } 18716 // }, 18717 // "path": "v1/{+name}", 18718 // "request": { 18719 // "$ref": "Product" 18720 // }, 18721 // "response": { 18722 // "$ref": "Product" 18723 // }, 18724 // "scopes": [ 18725 // "https://www.googleapis.com/auth/cloud-platform", 18726 // "https://www.googleapis.com/auth/cloud-vision" 18727 // ] 18728 // } 18729 18730} 18731 18732// method id "vision.projects.locations.products.purge": 18733 18734type ProjectsLocationsProductsPurgeCall struct { 18735 s *Service 18736 parent string 18737 purgeproductsrequest *PurgeProductsRequest 18738 urlParams_ gensupport.URLParams 18739 ctx_ context.Context 18740 header_ http.Header 18741} 18742 18743// Purge: Asynchronous API to delete all Products in a ProductSet or all 18744// Products that are in no ProductSet. If a Product is a member of the 18745// specified ProductSet in addition to other ProductSets, the Product 18746// will still be deleted. It is recommended to not delete the specified 18747// ProductSet until after this operation has completed. It is also 18748// recommended to not add any of the Products involved in the batch 18749// delete to a new ProductSet while this operation is running because 18750// those Products may still end up deleted. It's not possible to undo 18751// the PurgeProducts operation. Therefore, it is recommended to keep the 18752// csv files used in ImportProductSets (if that was how you originally 18753// built the Product Set) before starting PurgeProducts, in case you 18754// need to re-import the data after deletion. If the plan is to purge 18755// all of the Products from a ProductSet and then re-use the empty 18756// ProductSet to re-import new Products into the empty ProductSet, you 18757// must wait until the PurgeProducts operation has finished for that 18758// ProductSet. The google.longrunning.Operation API can be used to keep 18759// track of the progress and results of the request. 18760// `Operation.metadata` contains `BatchOperationMetadata`. (progress) 18761func (r *ProjectsLocationsProductsService) Purge(parent string, purgeproductsrequest *PurgeProductsRequest) *ProjectsLocationsProductsPurgeCall { 18762 c := &ProjectsLocationsProductsPurgeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 18763 c.parent = parent 18764 c.purgeproductsrequest = purgeproductsrequest 18765 return c 18766} 18767 18768// Fields allows partial responses to be retrieved. See 18769// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 18770// for more information. 18771func (c *ProjectsLocationsProductsPurgeCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductsPurgeCall { 18772 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 18773 return c 18774} 18775 18776// Context sets the context to be used in this call's Do method. Any 18777// pending HTTP request will be aborted if the provided context is 18778// canceled. 18779func (c *ProjectsLocationsProductsPurgeCall) Context(ctx context.Context) *ProjectsLocationsProductsPurgeCall { 18780 c.ctx_ = ctx 18781 return c 18782} 18783 18784// Header returns an http.Header that can be modified by the caller to 18785// add HTTP headers to the request. 18786func (c *ProjectsLocationsProductsPurgeCall) Header() http.Header { 18787 if c.header_ == nil { 18788 c.header_ = make(http.Header) 18789 } 18790 return c.header_ 18791} 18792 18793func (c *ProjectsLocationsProductsPurgeCall) doRequest(alt string) (*http.Response, error) { 18794 reqHeaders := make(http.Header) 18795 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 18796 for k, v := range c.header_ { 18797 reqHeaders[k] = v 18798 } 18799 reqHeaders.Set("User-Agent", c.s.userAgent()) 18800 var body io.Reader = nil 18801 body, err := googleapi.WithoutDataWrapper.JSONReader(c.purgeproductsrequest) 18802 if err != nil { 18803 return nil, err 18804 } 18805 reqHeaders.Set("Content-Type", "application/json") 18806 c.urlParams_.Set("alt", alt) 18807 c.urlParams_.Set("prettyPrint", "false") 18808 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/products:purge") 18809 urls += "?" + c.urlParams_.Encode() 18810 req, err := http.NewRequest("POST", urls, body) 18811 if err != nil { 18812 return nil, err 18813 } 18814 req.Header = reqHeaders 18815 googleapi.Expand(req.URL, map[string]string{ 18816 "parent": c.parent, 18817 }) 18818 return gensupport.SendRequest(c.ctx_, c.s.client, req) 18819} 18820 18821// Do executes the "vision.projects.locations.products.purge" call. 18822// Exactly one of *Operation or error will be non-nil. Any non-2xx 18823// status code is an error. Response headers are in either 18824// *Operation.ServerResponse.Header or (if a response was returned at 18825// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 18826// to check whether the returned error was because 18827// http.StatusNotModified was returned. 18828func (c *ProjectsLocationsProductsPurgeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 18829 gensupport.SetOptions(c.urlParams_, opts...) 18830 res, err := c.doRequest("json") 18831 if res != nil && res.StatusCode == http.StatusNotModified { 18832 if res.Body != nil { 18833 res.Body.Close() 18834 } 18835 return nil, &googleapi.Error{ 18836 Code: res.StatusCode, 18837 Header: res.Header, 18838 } 18839 } 18840 if err != nil { 18841 return nil, err 18842 } 18843 defer googleapi.CloseBody(res) 18844 if err := googleapi.CheckResponse(res); err != nil { 18845 return nil, err 18846 } 18847 ret := &Operation{ 18848 ServerResponse: googleapi.ServerResponse{ 18849 Header: res.Header, 18850 HTTPStatusCode: res.StatusCode, 18851 }, 18852 } 18853 target := &ret 18854 if err := gensupport.DecodeResponse(target, res); err != nil { 18855 return nil, err 18856 } 18857 return ret, nil 18858 // { 18859 // "description": "Asynchronous API to delete all Products in a ProductSet or all Products that are in no ProductSet. If a Product is a member of the specified ProductSet in addition to other ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until after this operation has completed. It is also recommended to not add any of the Products involved in the batch delete to a new ProductSet while this operation is running because those Products may still end up deleted. It's not possible to undo the PurgeProducts operation. Therefore, it is recommended to keep the csv files used in ImportProductSets (if that was how you originally built the Product Set) before starting PurgeProducts, in case you need to re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet and then re-use the empty ProductSet to re-import new Products into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet. The google.longrunning.Operation API can be used to keep track of the progress and results of the request. `Operation.metadata` contains `BatchOperationMetadata`. (progress)", 18860 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/products:purge", 18861 // "httpMethod": "POST", 18862 // "id": "vision.projects.locations.products.purge", 18863 // "parameterOrder": [ 18864 // "parent" 18865 // ], 18866 // "parameters": { 18867 // "parent": { 18868 // "description": "Required. The project and location in which the Products should be deleted. Format is `projects/PROJECT_ID/locations/LOC_ID`.", 18869 // "location": "path", 18870 // "pattern": "^projects/[^/]+/locations/[^/]+$", 18871 // "required": true, 18872 // "type": "string" 18873 // } 18874 // }, 18875 // "path": "v1/{+parent}/products:purge", 18876 // "request": { 18877 // "$ref": "PurgeProductsRequest" 18878 // }, 18879 // "response": { 18880 // "$ref": "Operation" 18881 // }, 18882 // "scopes": [ 18883 // "https://www.googleapis.com/auth/cloud-platform", 18884 // "https://www.googleapis.com/auth/cloud-vision" 18885 // ] 18886 // } 18887 18888} 18889 18890// method id "vision.projects.locations.products.referenceImages.create": 18891 18892type ProjectsLocationsProductsReferenceImagesCreateCall struct { 18893 s *Service 18894 parent string 18895 referenceimage *ReferenceImage 18896 urlParams_ gensupport.URLParams 18897 ctx_ context.Context 18898 header_ http.Header 18899} 18900 18901// Create: Creates and returns a new ReferenceImage resource. The 18902// `bounding_poly` field is optional. If `bounding_poly` is not 18903// specified, the system will try to detect regions of interest in the 18904// image that are compatible with the product_category on the parent 18905// product. If it is specified, detection is ALWAYS skipped. The system 18906// converts polygons into non-rotated rectangles. Note that the pipeline 18907// will resize the image if the image resolution is too large to process 18908// (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the 18909// image_uri is missing or longer than 4096 characters. * Returns 18910// INVALID_ARGUMENT if the product does not exist. * Returns 18911// INVALID_ARGUMENT if bounding_poly is not provided, and nothing 18912// compatible with the parent product's product_category is detected. * 18913// Returns INVALID_ARGUMENT if bounding_poly contains more than 10 18914// polygons. 18915func (r *ProjectsLocationsProductsReferenceImagesService) Create(parent string, referenceimage *ReferenceImage) *ProjectsLocationsProductsReferenceImagesCreateCall { 18916 c := &ProjectsLocationsProductsReferenceImagesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 18917 c.parent = parent 18918 c.referenceimage = referenceimage 18919 return c 18920} 18921 18922// ReferenceImageId sets the optional parameter "referenceImageId": A 18923// user-supplied resource id for the ReferenceImage to be added. If set, 18924// the server will attempt to use this value as the resource id. If it 18925// is already in use, an error is returned with code ALREADY_EXISTS. 18926// Must be at most 128 characters long. It cannot contain the character 18927// `/`. 18928func (c *ProjectsLocationsProductsReferenceImagesCreateCall) ReferenceImageId(referenceImageId string) *ProjectsLocationsProductsReferenceImagesCreateCall { 18929 c.urlParams_.Set("referenceImageId", referenceImageId) 18930 return c 18931} 18932 18933// Fields allows partial responses to be retrieved. See 18934// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 18935// for more information. 18936func (c *ProjectsLocationsProductsReferenceImagesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductsReferenceImagesCreateCall { 18937 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 18938 return c 18939} 18940 18941// Context sets the context to be used in this call's Do method. Any 18942// pending HTTP request will be aborted if the provided context is 18943// canceled. 18944func (c *ProjectsLocationsProductsReferenceImagesCreateCall) Context(ctx context.Context) *ProjectsLocationsProductsReferenceImagesCreateCall { 18945 c.ctx_ = ctx 18946 return c 18947} 18948 18949// Header returns an http.Header that can be modified by the caller to 18950// add HTTP headers to the request. 18951func (c *ProjectsLocationsProductsReferenceImagesCreateCall) Header() http.Header { 18952 if c.header_ == nil { 18953 c.header_ = make(http.Header) 18954 } 18955 return c.header_ 18956} 18957 18958func (c *ProjectsLocationsProductsReferenceImagesCreateCall) doRequest(alt string) (*http.Response, error) { 18959 reqHeaders := make(http.Header) 18960 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 18961 for k, v := range c.header_ { 18962 reqHeaders[k] = v 18963 } 18964 reqHeaders.Set("User-Agent", c.s.userAgent()) 18965 var body io.Reader = nil 18966 body, err := googleapi.WithoutDataWrapper.JSONReader(c.referenceimage) 18967 if err != nil { 18968 return nil, err 18969 } 18970 reqHeaders.Set("Content-Type", "application/json") 18971 c.urlParams_.Set("alt", alt) 18972 c.urlParams_.Set("prettyPrint", "false") 18973 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/referenceImages") 18974 urls += "?" + c.urlParams_.Encode() 18975 req, err := http.NewRequest("POST", urls, body) 18976 if err != nil { 18977 return nil, err 18978 } 18979 req.Header = reqHeaders 18980 googleapi.Expand(req.URL, map[string]string{ 18981 "parent": c.parent, 18982 }) 18983 return gensupport.SendRequest(c.ctx_, c.s.client, req) 18984} 18985 18986// Do executes the "vision.projects.locations.products.referenceImages.create" call. 18987// Exactly one of *ReferenceImage or error will be non-nil. Any non-2xx 18988// status code is an error. Response headers are in either 18989// *ReferenceImage.ServerResponse.Header or (if a response was returned 18990// at all) in error.(*googleapi.Error).Header. Use 18991// googleapi.IsNotModified to check whether the returned error was 18992// because http.StatusNotModified was returned. 18993func (c *ProjectsLocationsProductsReferenceImagesCreateCall) Do(opts ...googleapi.CallOption) (*ReferenceImage, error) { 18994 gensupport.SetOptions(c.urlParams_, opts...) 18995 res, err := c.doRequest("json") 18996 if res != nil && res.StatusCode == http.StatusNotModified { 18997 if res.Body != nil { 18998 res.Body.Close() 18999 } 19000 return nil, &googleapi.Error{ 19001 Code: res.StatusCode, 19002 Header: res.Header, 19003 } 19004 } 19005 if err != nil { 19006 return nil, err 19007 } 19008 defer googleapi.CloseBody(res) 19009 if err := googleapi.CheckResponse(res); err != nil { 19010 return nil, err 19011 } 19012 ret := &ReferenceImage{ 19013 ServerResponse: googleapi.ServerResponse{ 19014 Header: res.Header, 19015 HTTPStatusCode: res.StatusCode, 19016 }, 19017 } 19018 target := &ret 19019 if err := gensupport.DecodeResponse(target, res); err != nil { 19020 return nil, err 19021 } 19022 return ret, nil 19023 // { 19024 // "description": "Creates and returns a new ReferenceImage resource. The `bounding_poly` field is optional. If `bounding_poly` is not specified, the system will try to detect regions of interest in the image that are compatible with the product_category on the parent product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if the product does not exist. * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with the parent product's product_category is detected. * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.", 19025 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/products/{productsId}/referenceImages", 19026 // "httpMethod": "POST", 19027 // "id": "vision.projects.locations.products.referenceImages.create", 19028 // "parameterOrder": [ 19029 // "parent" 19030 // ], 19031 // "parameters": { 19032 // "parent": { 19033 // "description": "Required. Resource name of the product in which to create the reference image. Format is `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.", 19034 // "location": "path", 19035 // "pattern": "^projects/[^/]+/locations/[^/]+/products/[^/]+$", 19036 // "required": true, 19037 // "type": "string" 19038 // }, 19039 // "referenceImageId": { 19040 // "description": "A user-supplied resource id for the ReferenceImage to be added. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character `/`.", 19041 // "location": "query", 19042 // "type": "string" 19043 // } 19044 // }, 19045 // "path": "v1/{+parent}/referenceImages", 19046 // "request": { 19047 // "$ref": "ReferenceImage" 19048 // }, 19049 // "response": { 19050 // "$ref": "ReferenceImage" 19051 // }, 19052 // "scopes": [ 19053 // "https://www.googleapis.com/auth/cloud-platform", 19054 // "https://www.googleapis.com/auth/cloud-vision" 19055 // ] 19056 // } 19057 19058} 19059 19060// method id "vision.projects.locations.products.referenceImages.delete": 19061 19062type ProjectsLocationsProductsReferenceImagesDeleteCall struct { 19063 s *Service 19064 name string 19065 urlParams_ gensupport.URLParams 19066 ctx_ context.Context 19067 header_ http.Header 19068} 19069 19070// Delete: Permanently deletes a reference image. The image metadata 19071// will be deleted right away, but search queries against ProductSets 19072// containing the image may still work until all related caches are 19073// refreshed. The actual image files are not deleted from Google Cloud 19074// Storage. 19075func (r *ProjectsLocationsProductsReferenceImagesService) Delete(name string) *ProjectsLocationsProductsReferenceImagesDeleteCall { 19076 c := &ProjectsLocationsProductsReferenceImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 19077 c.name = name 19078 return c 19079} 19080 19081// Fields allows partial responses to be retrieved. See 19082// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 19083// for more information. 19084func (c *ProjectsLocationsProductsReferenceImagesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductsReferenceImagesDeleteCall { 19085 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 19086 return c 19087} 19088 19089// Context sets the context to be used in this call's Do method. Any 19090// pending HTTP request will be aborted if the provided context is 19091// canceled. 19092func (c *ProjectsLocationsProductsReferenceImagesDeleteCall) Context(ctx context.Context) *ProjectsLocationsProductsReferenceImagesDeleteCall { 19093 c.ctx_ = ctx 19094 return c 19095} 19096 19097// Header returns an http.Header that can be modified by the caller to 19098// add HTTP headers to the request. 19099func (c *ProjectsLocationsProductsReferenceImagesDeleteCall) Header() http.Header { 19100 if c.header_ == nil { 19101 c.header_ = make(http.Header) 19102 } 19103 return c.header_ 19104} 19105 19106func (c *ProjectsLocationsProductsReferenceImagesDeleteCall) doRequest(alt string) (*http.Response, error) { 19107 reqHeaders := make(http.Header) 19108 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 19109 for k, v := range c.header_ { 19110 reqHeaders[k] = v 19111 } 19112 reqHeaders.Set("User-Agent", c.s.userAgent()) 19113 var body io.Reader = nil 19114 c.urlParams_.Set("alt", alt) 19115 c.urlParams_.Set("prettyPrint", "false") 19116 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 19117 urls += "?" + c.urlParams_.Encode() 19118 req, err := http.NewRequest("DELETE", urls, body) 19119 if err != nil { 19120 return nil, err 19121 } 19122 req.Header = reqHeaders 19123 googleapi.Expand(req.URL, map[string]string{ 19124 "name": c.name, 19125 }) 19126 return gensupport.SendRequest(c.ctx_, c.s.client, req) 19127} 19128 19129// Do executes the "vision.projects.locations.products.referenceImages.delete" call. 19130// Exactly one of *Empty or error will be non-nil. Any non-2xx status 19131// code is an error. Response headers are in either 19132// *Empty.ServerResponse.Header or (if a response was returned at all) 19133// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 19134// check whether the returned error was because http.StatusNotModified 19135// was returned. 19136func (c *ProjectsLocationsProductsReferenceImagesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 19137 gensupport.SetOptions(c.urlParams_, opts...) 19138 res, err := c.doRequest("json") 19139 if res != nil && res.StatusCode == http.StatusNotModified { 19140 if res.Body != nil { 19141 res.Body.Close() 19142 } 19143 return nil, &googleapi.Error{ 19144 Code: res.StatusCode, 19145 Header: res.Header, 19146 } 19147 } 19148 if err != nil { 19149 return nil, err 19150 } 19151 defer googleapi.CloseBody(res) 19152 if err := googleapi.CheckResponse(res); err != nil { 19153 return nil, err 19154 } 19155 ret := &Empty{ 19156 ServerResponse: googleapi.ServerResponse{ 19157 Header: res.Header, 19158 HTTPStatusCode: res.StatusCode, 19159 }, 19160 } 19161 target := &ret 19162 if err := gensupport.DecodeResponse(target, res); err != nil { 19163 return nil, err 19164 } 19165 return ret, nil 19166 // { 19167 // "description": "Permanently deletes a reference image. The image metadata will be deleted right away, but search queries against ProductSets containing the image may still work until all related caches are refreshed. The actual image files are not deleted from Google Cloud Storage.", 19168 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/products/{productsId}/referenceImages/{referenceImagesId}", 19169 // "httpMethod": "DELETE", 19170 // "id": "vision.projects.locations.products.referenceImages.delete", 19171 // "parameterOrder": [ 19172 // "name" 19173 // ], 19174 // "parameters": { 19175 // "name": { 19176 // "description": "Required. The resource name of the reference image to delete. Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`", 19177 // "location": "path", 19178 // "pattern": "^projects/[^/]+/locations/[^/]+/products/[^/]+/referenceImages/[^/]+$", 19179 // "required": true, 19180 // "type": "string" 19181 // } 19182 // }, 19183 // "path": "v1/{+name}", 19184 // "response": { 19185 // "$ref": "Empty" 19186 // }, 19187 // "scopes": [ 19188 // "https://www.googleapis.com/auth/cloud-platform", 19189 // "https://www.googleapis.com/auth/cloud-vision" 19190 // ] 19191 // } 19192 19193} 19194 19195// method id "vision.projects.locations.products.referenceImages.get": 19196 19197type ProjectsLocationsProductsReferenceImagesGetCall struct { 19198 s *Service 19199 name string 19200 urlParams_ gensupport.URLParams 19201 ifNoneMatch_ string 19202 ctx_ context.Context 19203 header_ http.Header 19204} 19205 19206// Get: Gets information associated with a ReferenceImage. Possible 19207// errors: * Returns NOT_FOUND if the specified image does not exist. 19208func (r *ProjectsLocationsProductsReferenceImagesService) Get(name string) *ProjectsLocationsProductsReferenceImagesGetCall { 19209 c := &ProjectsLocationsProductsReferenceImagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 19210 c.name = name 19211 return c 19212} 19213 19214// Fields allows partial responses to be retrieved. See 19215// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 19216// for more information. 19217func (c *ProjectsLocationsProductsReferenceImagesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductsReferenceImagesGetCall { 19218 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 19219 return c 19220} 19221 19222// IfNoneMatch sets the optional parameter which makes the operation 19223// fail if the object's ETag matches the given value. This is useful for 19224// getting updates only after the object has changed since the last 19225// request. Use googleapi.IsNotModified to check whether the response 19226// error from Do is the result of In-None-Match. 19227func (c *ProjectsLocationsProductsReferenceImagesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsProductsReferenceImagesGetCall { 19228 c.ifNoneMatch_ = entityTag 19229 return c 19230} 19231 19232// Context sets the context to be used in this call's Do method. Any 19233// pending HTTP request will be aborted if the provided context is 19234// canceled. 19235func (c *ProjectsLocationsProductsReferenceImagesGetCall) Context(ctx context.Context) *ProjectsLocationsProductsReferenceImagesGetCall { 19236 c.ctx_ = ctx 19237 return c 19238} 19239 19240// Header returns an http.Header that can be modified by the caller to 19241// add HTTP headers to the request. 19242func (c *ProjectsLocationsProductsReferenceImagesGetCall) Header() http.Header { 19243 if c.header_ == nil { 19244 c.header_ = make(http.Header) 19245 } 19246 return c.header_ 19247} 19248 19249func (c *ProjectsLocationsProductsReferenceImagesGetCall) doRequest(alt string) (*http.Response, error) { 19250 reqHeaders := make(http.Header) 19251 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 19252 for k, v := range c.header_ { 19253 reqHeaders[k] = v 19254 } 19255 reqHeaders.Set("User-Agent", c.s.userAgent()) 19256 if c.ifNoneMatch_ != "" { 19257 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 19258 } 19259 var body io.Reader = nil 19260 c.urlParams_.Set("alt", alt) 19261 c.urlParams_.Set("prettyPrint", "false") 19262 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 19263 urls += "?" + c.urlParams_.Encode() 19264 req, err := http.NewRequest("GET", urls, body) 19265 if err != nil { 19266 return nil, err 19267 } 19268 req.Header = reqHeaders 19269 googleapi.Expand(req.URL, map[string]string{ 19270 "name": c.name, 19271 }) 19272 return gensupport.SendRequest(c.ctx_, c.s.client, req) 19273} 19274 19275// Do executes the "vision.projects.locations.products.referenceImages.get" call. 19276// Exactly one of *ReferenceImage or error will be non-nil. Any non-2xx 19277// status code is an error. Response headers are in either 19278// *ReferenceImage.ServerResponse.Header or (if a response was returned 19279// at all) in error.(*googleapi.Error).Header. Use 19280// googleapi.IsNotModified to check whether the returned error was 19281// because http.StatusNotModified was returned. 19282func (c *ProjectsLocationsProductsReferenceImagesGetCall) Do(opts ...googleapi.CallOption) (*ReferenceImage, error) { 19283 gensupport.SetOptions(c.urlParams_, opts...) 19284 res, err := c.doRequest("json") 19285 if res != nil && res.StatusCode == http.StatusNotModified { 19286 if res.Body != nil { 19287 res.Body.Close() 19288 } 19289 return nil, &googleapi.Error{ 19290 Code: res.StatusCode, 19291 Header: res.Header, 19292 } 19293 } 19294 if err != nil { 19295 return nil, err 19296 } 19297 defer googleapi.CloseBody(res) 19298 if err := googleapi.CheckResponse(res); err != nil { 19299 return nil, err 19300 } 19301 ret := &ReferenceImage{ 19302 ServerResponse: googleapi.ServerResponse{ 19303 Header: res.Header, 19304 HTTPStatusCode: res.StatusCode, 19305 }, 19306 } 19307 target := &ret 19308 if err := gensupport.DecodeResponse(target, res); err != nil { 19309 return nil, err 19310 } 19311 return ret, nil 19312 // { 19313 // "description": "Gets information associated with a ReferenceImage. Possible errors: * Returns NOT_FOUND if the specified image does not exist.", 19314 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/products/{productsId}/referenceImages/{referenceImagesId}", 19315 // "httpMethod": "GET", 19316 // "id": "vision.projects.locations.products.referenceImages.get", 19317 // "parameterOrder": [ 19318 // "name" 19319 // ], 19320 // "parameters": { 19321 // "name": { 19322 // "description": "Required. The resource name of the ReferenceImage to get. Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.", 19323 // "location": "path", 19324 // "pattern": "^projects/[^/]+/locations/[^/]+/products/[^/]+/referenceImages/[^/]+$", 19325 // "required": true, 19326 // "type": "string" 19327 // } 19328 // }, 19329 // "path": "v1/{+name}", 19330 // "response": { 19331 // "$ref": "ReferenceImage" 19332 // }, 19333 // "scopes": [ 19334 // "https://www.googleapis.com/auth/cloud-platform", 19335 // "https://www.googleapis.com/auth/cloud-vision" 19336 // ] 19337 // } 19338 19339} 19340 19341// method id "vision.projects.locations.products.referenceImages.list": 19342 19343type ProjectsLocationsProductsReferenceImagesListCall struct { 19344 s *Service 19345 parent string 19346 urlParams_ gensupport.URLParams 19347 ifNoneMatch_ string 19348 ctx_ context.Context 19349 header_ http.Header 19350} 19351 19352// List: Lists reference images. Possible errors: * Returns NOT_FOUND if 19353// the parent product does not exist. * Returns INVALID_ARGUMENT if the 19354// page_size is greater than 100, or less than 1. 19355func (r *ProjectsLocationsProductsReferenceImagesService) List(parent string) *ProjectsLocationsProductsReferenceImagesListCall { 19356 c := &ProjectsLocationsProductsReferenceImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 19357 c.parent = parent 19358 return c 19359} 19360 19361// PageSize sets the optional parameter "pageSize": The maximum number 19362// of items to return. Default 10, maximum 100. 19363func (c *ProjectsLocationsProductsReferenceImagesListCall) PageSize(pageSize int64) *ProjectsLocationsProductsReferenceImagesListCall { 19364 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 19365 return c 19366} 19367 19368// PageToken sets the optional parameter "pageToken": A token 19369// identifying a page of results to be returned. This is the value of 19370// `nextPageToken` returned in a previous reference image list request. 19371// Defaults to the first page if not specified. 19372func (c *ProjectsLocationsProductsReferenceImagesListCall) PageToken(pageToken string) *ProjectsLocationsProductsReferenceImagesListCall { 19373 c.urlParams_.Set("pageToken", pageToken) 19374 return c 19375} 19376 19377// Fields allows partial responses to be retrieved. See 19378// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 19379// for more information. 19380func (c *ProjectsLocationsProductsReferenceImagesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductsReferenceImagesListCall { 19381 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 19382 return c 19383} 19384 19385// IfNoneMatch sets the optional parameter which makes the operation 19386// fail if the object's ETag matches the given value. This is useful for 19387// getting updates only after the object has changed since the last 19388// request. Use googleapi.IsNotModified to check whether the response 19389// error from Do is the result of In-None-Match. 19390func (c *ProjectsLocationsProductsReferenceImagesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsProductsReferenceImagesListCall { 19391 c.ifNoneMatch_ = entityTag 19392 return c 19393} 19394 19395// Context sets the context to be used in this call's Do method. Any 19396// pending HTTP request will be aborted if the provided context is 19397// canceled. 19398func (c *ProjectsLocationsProductsReferenceImagesListCall) Context(ctx context.Context) *ProjectsLocationsProductsReferenceImagesListCall { 19399 c.ctx_ = ctx 19400 return c 19401} 19402 19403// Header returns an http.Header that can be modified by the caller to 19404// add HTTP headers to the request. 19405func (c *ProjectsLocationsProductsReferenceImagesListCall) Header() http.Header { 19406 if c.header_ == nil { 19407 c.header_ = make(http.Header) 19408 } 19409 return c.header_ 19410} 19411 19412func (c *ProjectsLocationsProductsReferenceImagesListCall) doRequest(alt string) (*http.Response, error) { 19413 reqHeaders := make(http.Header) 19414 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 19415 for k, v := range c.header_ { 19416 reqHeaders[k] = v 19417 } 19418 reqHeaders.Set("User-Agent", c.s.userAgent()) 19419 if c.ifNoneMatch_ != "" { 19420 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 19421 } 19422 var body io.Reader = nil 19423 c.urlParams_.Set("alt", alt) 19424 c.urlParams_.Set("prettyPrint", "false") 19425 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/referenceImages") 19426 urls += "?" + c.urlParams_.Encode() 19427 req, err := http.NewRequest("GET", urls, body) 19428 if err != nil { 19429 return nil, err 19430 } 19431 req.Header = reqHeaders 19432 googleapi.Expand(req.URL, map[string]string{ 19433 "parent": c.parent, 19434 }) 19435 return gensupport.SendRequest(c.ctx_, c.s.client, req) 19436} 19437 19438// Do executes the "vision.projects.locations.products.referenceImages.list" call. 19439// Exactly one of *ListReferenceImagesResponse or error will be non-nil. 19440// Any non-2xx status code is an error. Response headers are in either 19441// *ListReferenceImagesResponse.ServerResponse.Header or (if a response 19442// was returned at all) in error.(*googleapi.Error).Header. Use 19443// googleapi.IsNotModified to check whether the returned error was 19444// because http.StatusNotModified was returned. 19445func (c *ProjectsLocationsProductsReferenceImagesListCall) Do(opts ...googleapi.CallOption) (*ListReferenceImagesResponse, error) { 19446 gensupport.SetOptions(c.urlParams_, opts...) 19447 res, err := c.doRequest("json") 19448 if res != nil && res.StatusCode == http.StatusNotModified { 19449 if res.Body != nil { 19450 res.Body.Close() 19451 } 19452 return nil, &googleapi.Error{ 19453 Code: res.StatusCode, 19454 Header: res.Header, 19455 } 19456 } 19457 if err != nil { 19458 return nil, err 19459 } 19460 defer googleapi.CloseBody(res) 19461 if err := googleapi.CheckResponse(res); err != nil { 19462 return nil, err 19463 } 19464 ret := &ListReferenceImagesResponse{ 19465 ServerResponse: googleapi.ServerResponse{ 19466 Header: res.Header, 19467 HTTPStatusCode: res.StatusCode, 19468 }, 19469 } 19470 target := &ret 19471 if err := gensupport.DecodeResponse(target, res); err != nil { 19472 return nil, err 19473 } 19474 return ret, nil 19475 // { 19476 // "description": "Lists reference images. Possible errors: * Returns NOT_FOUND if the parent product does not exist. * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1.", 19477 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/products/{productsId}/referenceImages", 19478 // "httpMethod": "GET", 19479 // "id": "vision.projects.locations.products.referenceImages.list", 19480 // "parameterOrder": [ 19481 // "parent" 19482 // ], 19483 // "parameters": { 19484 // "pageSize": { 19485 // "description": "The maximum number of items to return. Default 10, maximum 100.", 19486 // "format": "int32", 19487 // "location": "query", 19488 // "type": "integer" 19489 // }, 19490 // "pageToken": { 19491 // "description": "A token identifying a page of results to be returned. This is the value of `nextPageToken` returned in a previous reference image list request. Defaults to the first page if not specified.", 19492 // "location": "query", 19493 // "type": "string" 19494 // }, 19495 // "parent": { 19496 // "description": "Required. Resource name of the product containing the reference images. Format is `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.", 19497 // "location": "path", 19498 // "pattern": "^projects/[^/]+/locations/[^/]+/products/[^/]+$", 19499 // "required": true, 19500 // "type": "string" 19501 // } 19502 // }, 19503 // "path": "v1/{+parent}/referenceImages", 19504 // "response": { 19505 // "$ref": "ListReferenceImagesResponse" 19506 // }, 19507 // "scopes": [ 19508 // "https://www.googleapis.com/auth/cloud-platform", 19509 // "https://www.googleapis.com/auth/cloud-vision" 19510 // ] 19511 // } 19512 19513} 19514 19515// Pages invokes f for each page of results. 19516// A non-nil error returned from f will halt the iteration. 19517// The provided context supersedes any context provided to the Context method. 19518func (c *ProjectsLocationsProductsReferenceImagesListCall) Pages(ctx context.Context, f func(*ListReferenceImagesResponse) error) error { 19519 c.ctx_ = ctx 19520 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 19521 for { 19522 x, err := c.Do() 19523 if err != nil { 19524 return err 19525 } 19526 if err := f(x); err != nil { 19527 return err 19528 } 19529 if x.NextPageToken == "" { 19530 return nil 19531 } 19532 c.PageToken(x.NextPageToken) 19533 } 19534} 19535 19536// method id "vision.projects.operations.get": 19537 19538type ProjectsOperationsGetCall struct { 19539 s *Service 19540 name string 19541 urlParams_ gensupport.URLParams 19542 ifNoneMatch_ string 19543 ctx_ context.Context 19544 header_ http.Header 19545} 19546 19547// Get: Gets the latest state of a long-running operation. Clients can 19548// use this method to poll the operation result at intervals as 19549// recommended by the API service. 19550func (r *ProjectsOperationsService) Get(name string) *ProjectsOperationsGetCall { 19551 c := &ProjectsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 19552 c.name = name 19553 return c 19554} 19555 19556// Fields allows partial responses to be retrieved. See 19557// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 19558// for more information. 19559func (c *ProjectsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsOperationsGetCall { 19560 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 19561 return c 19562} 19563 19564// IfNoneMatch sets the optional parameter which makes the operation 19565// fail if the object's ETag matches the given value. This is useful for 19566// getting updates only after the object has changed since the last 19567// request. Use googleapi.IsNotModified to check whether the response 19568// error from Do is the result of In-None-Match. 19569func (c *ProjectsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsOperationsGetCall { 19570 c.ifNoneMatch_ = entityTag 19571 return c 19572} 19573 19574// Context sets the context to be used in this call's Do method. Any 19575// pending HTTP request will be aborted if the provided context is 19576// canceled. 19577func (c *ProjectsOperationsGetCall) Context(ctx context.Context) *ProjectsOperationsGetCall { 19578 c.ctx_ = ctx 19579 return c 19580} 19581 19582// Header returns an http.Header that can be modified by the caller to 19583// add HTTP headers to the request. 19584func (c *ProjectsOperationsGetCall) Header() http.Header { 19585 if c.header_ == nil { 19586 c.header_ = make(http.Header) 19587 } 19588 return c.header_ 19589} 19590 19591func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 19592 reqHeaders := make(http.Header) 19593 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201009") 19594 for k, v := range c.header_ { 19595 reqHeaders[k] = v 19596 } 19597 reqHeaders.Set("User-Agent", c.s.userAgent()) 19598 if c.ifNoneMatch_ != "" { 19599 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 19600 } 19601 var body io.Reader = nil 19602 c.urlParams_.Set("alt", alt) 19603 c.urlParams_.Set("prettyPrint", "false") 19604 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 19605 urls += "?" + c.urlParams_.Encode() 19606 req, err := http.NewRequest("GET", urls, body) 19607 if err != nil { 19608 return nil, err 19609 } 19610 req.Header = reqHeaders 19611 googleapi.Expand(req.URL, map[string]string{ 19612 "name": c.name, 19613 }) 19614 return gensupport.SendRequest(c.ctx_, c.s.client, req) 19615} 19616 19617// Do executes the "vision.projects.operations.get" call. 19618// Exactly one of *Operation or error will be non-nil. Any non-2xx 19619// status code is an error. Response headers are in either 19620// *Operation.ServerResponse.Header or (if a response was returned at 19621// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 19622// to check whether the returned error was because 19623// http.StatusNotModified was returned. 19624func (c *ProjectsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 19625 gensupport.SetOptions(c.urlParams_, opts...) 19626 res, err := c.doRequest("json") 19627 if res != nil && res.StatusCode == http.StatusNotModified { 19628 if res.Body != nil { 19629 res.Body.Close() 19630 } 19631 return nil, &googleapi.Error{ 19632 Code: res.StatusCode, 19633 Header: res.Header, 19634 } 19635 } 19636 if err != nil { 19637 return nil, err 19638 } 19639 defer googleapi.CloseBody(res) 19640 if err := googleapi.CheckResponse(res); err != nil { 19641 return nil, err 19642 } 19643 ret := &Operation{ 19644 ServerResponse: googleapi.ServerResponse{ 19645 Header: res.Header, 19646 HTTPStatusCode: res.StatusCode, 19647 }, 19648 } 19649 target := &ret 19650 if err := gensupport.DecodeResponse(target, res); err != nil { 19651 return nil, err 19652 } 19653 return ret, nil 19654 // { 19655 // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", 19656 // "flatPath": "v1/projects/{projectsId}/operations/{operationsId}", 19657 // "httpMethod": "GET", 19658 // "id": "vision.projects.operations.get", 19659 // "parameterOrder": [ 19660 // "name" 19661 // ], 19662 // "parameters": { 19663 // "name": { 19664 // "description": "The name of the operation resource.", 19665 // "location": "path", 19666 // "pattern": "^projects/[^/]+/operations/[^/]+$", 19667 // "required": true, 19668 // "type": "string" 19669 // } 19670 // }, 19671 // "path": "v1/{+name}", 19672 // "response": { 19673 // "$ref": "Operation" 19674 // }, 19675 // "scopes": [ 19676 // "https://www.googleapis.com/auth/cloud-platform", 19677 // "https://www.googleapis.com/auth/cloud-vision" 19678 // ] 19679 // } 19680 19681} 19682