1// Copyright 2021 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/v1p1beta1" 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/v1p1beta1" 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:v1p1beta1" 81const apiName = "vision" 82const apiVersion = "v1p1beta1" 83const basePath = "https://vision.googleapis.com/" 84const mtlsBasePath = "https://vision.mtls.googleapis.com/" 85 86// OAuth2 scopes used by this API. 87const ( 88 // See, edit, configure, and delete your Google Cloud Platform data 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.Projects = NewProjectsService(s) 132 return s, nil 133} 134 135type Service struct { 136 client *http.Client 137 BasePath string // API endpoint base URL 138 UserAgent string // optional additional User-Agent fragment 139 140 Files *FilesService 141 142 Images *ImagesService 143 144 Projects *ProjectsService 145} 146 147func (s *Service) userAgent() string { 148 if s.UserAgent == "" { 149 return googleapi.UserAgent 150 } 151 return googleapi.UserAgent + " " + s.UserAgent 152} 153 154func NewFilesService(s *Service) *FilesService { 155 rs := &FilesService{s: s} 156 return rs 157} 158 159type FilesService struct { 160 s *Service 161} 162 163func NewImagesService(s *Service) *ImagesService { 164 rs := &ImagesService{s: s} 165 return rs 166} 167 168type ImagesService struct { 169 s *Service 170} 171 172func NewProjectsService(s *Service) *ProjectsService { 173 rs := &ProjectsService{s: s} 174 rs.Files = NewProjectsFilesService(s) 175 rs.Images = NewProjectsImagesService(s) 176 rs.Locations = NewProjectsLocationsService(s) 177 return rs 178} 179 180type ProjectsService struct { 181 s *Service 182 183 Files *ProjectsFilesService 184 185 Images *ProjectsImagesService 186 187 Locations *ProjectsLocationsService 188} 189 190func NewProjectsFilesService(s *Service) *ProjectsFilesService { 191 rs := &ProjectsFilesService{s: s} 192 return rs 193} 194 195type ProjectsFilesService struct { 196 s *Service 197} 198 199func NewProjectsImagesService(s *Service) *ProjectsImagesService { 200 rs := &ProjectsImagesService{s: s} 201 return rs 202} 203 204type ProjectsImagesService struct { 205 s *Service 206} 207 208func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { 209 rs := &ProjectsLocationsService{s: s} 210 rs.Files = NewProjectsLocationsFilesService(s) 211 rs.Images = NewProjectsLocationsImagesService(s) 212 return rs 213} 214 215type ProjectsLocationsService struct { 216 s *Service 217 218 Files *ProjectsLocationsFilesService 219 220 Images *ProjectsLocationsImagesService 221} 222 223func NewProjectsLocationsFilesService(s *Service) *ProjectsLocationsFilesService { 224 rs := &ProjectsLocationsFilesService{s: s} 225 return rs 226} 227 228type ProjectsLocationsFilesService struct { 229 s *Service 230} 231 232func NewProjectsLocationsImagesService(s *Service) *ProjectsLocationsImagesService { 233 rs := &ProjectsLocationsImagesService{s: s} 234 return rs 235} 236 237type ProjectsLocationsImagesService struct { 238 s *Service 239} 240 241// AnnotateFileResponse: Response to a single file annotation request. A 242// file may contain one or more images, which individually have their 243// own responses. 244type AnnotateFileResponse struct { 245 // Error: If set, represents the error message for the failed request. 246 // The `responses` field will not be set in this case. 247 Error *Status `json:"error,omitempty"` 248 249 // InputConfig: Information about the file for which this response is 250 // generated. 251 InputConfig *InputConfig `json:"inputConfig,omitempty"` 252 253 // Responses: Individual responses to images found within the file. This 254 // field will be empty if the `error` field is set. 255 Responses []*AnnotateImageResponse `json:"responses,omitempty"` 256 257 // TotalPages: This field gives the total number of pages in the file. 258 TotalPages int64 `json:"totalPages,omitempty"` 259 260 // ForceSendFields is a list of field names (e.g. "Error") to 261 // unconditionally include in API requests. By default, fields with 262 // empty values are omitted from API requests. However, any non-pointer, 263 // non-interface field appearing in ForceSendFields will be sent to the 264 // server regardless of whether the field is empty or not. This may be 265 // used to include empty fields in Patch requests. 266 ForceSendFields []string `json:"-"` 267 268 // NullFields is a list of field names (e.g. "Error") to include in API 269 // requests with the JSON null value. By default, fields with empty 270 // values are omitted from API requests. However, any field with an 271 // empty value appearing in NullFields will be sent to the server as 272 // null. It is an error if a field in this list has a non-empty value. 273 // This may be used to include null fields in Patch requests. 274 NullFields []string `json:"-"` 275} 276 277func (s *AnnotateFileResponse) MarshalJSON() ([]byte, error) { 278 type NoMethod AnnotateFileResponse 279 raw := NoMethod(*s) 280 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 281} 282 283// AnnotateImageResponse: Response to an image annotation request. 284type AnnotateImageResponse struct { 285 // Context: If present, contextual information is needed to understand 286 // where this image comes from. 287 Context *ImageAnnotationContext `json:"context,omitempty"` 288 289 // CropHintsAnnotation: If present, crop hints have completed 290 // successfully. 291 CropHintsAnnotation *CropHintsAnnotation `json:"cropHintsAnnotation,omitempty"` 292 293 // Error: If set, represents the error message for the operation. Note 294 // that filled-in image annotations are guaranteed to be correct, even 295 // when `error` is set. 296 Error *Status `json:"error,omitempty"` 297 298 // FaceAnnotations: If present, face detection has completed 299 // successfully. 300 FaceAnnotations []*FaceAnnotation `json:"faceAnnotations,omitempty"` 301 302 // FullTextAnnotation: If present, text (OCR) detection or document 303 // (OCR) text detection has completed successfully. This annotation 304 // provides the structural hierarchy for the OCR detected text. 305 FullTextAnnotation *TextAnnotation `json:"fullTextAnnotation,omitempty"` 306 307 // ImagePropertiesAnnotation: If present, image properties were 308 // extracted successfully. 309 ImagePropertiesAnnotation *ImageProperties `json:"imagePropertiesAnnotation,omitempty"` 310 311 // LabelAnnotations: If present, label detection has completed 312 // successfully. 313 LabelAnnotations []*EntityAnnotation `json:"labelAnnotations,omitempty"` 314 315 // LandmarkAnnotations: If present, landmark detection has completed 316 // successfully. 317 LandmarkAnnotations []*EntityAnnotation `json:"landmarkAnnotations,omitempty"` 318 319 // LocalizedObjectAnnotations: If present, localized object detection 320 // has completed successfully. This will be sorted descending by 321 // confidence score. 322 LocalizedObjectAnnotations []*LocalizedObjectAnnotation `json:"localizedObjectAnnotations,omitempty"` 323 324 // LogoAnnotations: If present, logo detection has completed 325 // successfully. 326 LogoAnnotations []*EntityAnnotation `json:"logoAnnotations,omitempty"` 327 328 // ProductSearchResults: If present, product search has completed 329 // successfully. 330 ProductSearchResults *ProductSearchResults `json:"productSearchResults,omitempty"` 331 332 // SafeSearchAnnotation: If present, safe-search annotation has 333 // completed successfully. 334 SafeSearchAnnotation *SafeSearchAnnotation `json:"safeSearchAnnotation,omitempty"` 335 336 // TextAnnotations: If present, text (OCR) detection has completed 337 // successfully. 338 TextAnnotations []*EntityAnnotation `json:"textAnnotations,omitempty"` 339 340 // WebDetection: If present, web detection has completed successfully. 341 WebDetection *WebDetection `json:"webDetection,omitempty"` 342 343 // ForceSendFields is a list of field names (e.g. "Context") to 344 // unconditionally include in API requests. By default, fields with 345 // empty values are omitted from API requests. However, any non-pointer, 346 // non-interface field appearing in ForceSendFields will be sent to the 347 // server regardless of whether the field is empty or not. This may be 348 // used to include empty fields in Patch requests. 349 ForceSendFields []string `json:"-"` 350 351 // NullFields is a list of field names (e.g. "Context") to include in 352 // API requests with the JSON null value. By default, fields with empty 353 // values are omitted from API requests. However, any field with an 354 // empty value appearing in NullFields will be sent to the server as 355 // null. It is an error if a field in this list has a non-empty value. 356 // This may be used to include null fields in Patch requests. 357 NullFields []string `json:"-"` 358} 359 360func (s *AnnotateImageResponse) MarshalJSON() ([]byte, error) { 361 type NoMethod AnnotateImageResponse 362 raw := NoMethod(*s) 363 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 364} 365 366// AsyncAnnotateFileResponse: The response for a single offline file 367// annotation request. 368type AsyncAnnotateFileResponse struct { 369 // OutputConfig: The output location and metadata from 370 // AsyncAnnotateFileRequest. 371 OutputConfig *OutputConfig `json:"outputConfig,omitempty"` 372 373 // ForceSendFields is a list of field names (e.g. "OutputConfig") to 374 // unconditionally include in API requests. By default, fields with 375 // empty values are omitted from API requests. However, any non-pointer, 376 // non-interface field appearing in ForceSendFields will be sent to the 377 // server regardless of whether the field is empty or not. This may be 378 // used to include empty fields in Patch requests. 379 ForceSendFields []string `json:"-"` 380 381 // NullFields is a list of field names (e.g. "OutputConfig") to include 382 // in API requests with the JSON null value. By default, fields with 383 // empty values are omitted from API requests. However, any field with 384 // an empty value appearing in NullFields will be sent to the server as 385 // null. It is an error if a field in this list has a non-empty value. 386 // This may be used to include null fields in Patch requests. 387 NullFields []string `json:"-"` 388} 389 390func (s *AsyncAnnotateFileResponse) MarshalJSON() ([]byte, error) { 391 type NoMethod AsyncAnnotateFileResponse 392 raw := NoMethod(*s) 393 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 394} 395 396// AsyncBatchAnnotateFilesResponse: Response to an async batch file 397// annotation request. 398type AsyncBatchAnnotateFilesResponse struct { 399 // Responses: The list of file annotation responses, one for each 400 // request in AsyncBatchAnnotateFilesRequest. 401 Responses []*AsyncAnnotateFileResponse `json:"responses,omitempty"` 402 403 // ForceSendFields is a list of field names (e.g. "Responses") 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. "Responses") 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 *AsyncBatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) { 421 type NoMethod AsyncBatchAnnotateFilesResponse 422 raw := NoMethod(*s) 423 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 424} 425 426// AsyncBatchAnnotateImagesResponse: Response to an async batch image 427// annotation request. 428type AsyncBatchAnnotateImagesResponse struct { 429 // OutputConfig: The output location and metadata from 430 // AsyncBatchAnnotateImagesRequest. 431 OutputConfig *OutputConfig `json:"outputConfig,omitempty"` 432 433 // ForceSendFields is a list of field names (e.g. "OutputConfig") to 434 // unconditionally include in API requests. By default, fields with 435 // empty values are omitted from API requests. However, any non-pointer, 436 // non-interface field appearing in ForceSendFields will be sent to the 437 // server regardless of whether the field is empty or not. This may be 438 // used to include empty fields in Patch requests. 439 ForceSendFields []string `json:"-"` 440 441 // NullFields is a list of field names (e.g. "OutputConfig") to include 442 // in API requests with the JSON null value. By default, fields with 443 // empty values are omitted from API requests. However, any field with 444 // an empty value appearing in NullFields will be sent to the server as 445 // null. It is an error if a field in this list has a non-empty value. 446 // This may be used to include null fields in Patch requests. 447 NullFields []string `json:"-"` 448} 449 450func (s *AsyncBatchAnnotateImagesResponse) MarshalJSON() ([]byte, error) { 451 type NoMethod AsyncBatchAnnotateImagesResponse 452 raw := NoMethod(*s) 453 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 454} 455 456// BatchAnnotateFilesResponse: A list of file annotation responses. 457type BatchAnnotateFilesResponse struct { 458 // Responses: The list of file annotation responses, each response 459 // corresponding to each AnnotateFileRequest in 460 // BatchAnnotateFilesRequest. 461 Responses []*AnnotateFileResponse `json:"responses,omitempty"` 462 463 // ForceSendFields is a list of field names (e.g. "Responses") to 464 // unconditionally include in API requests. By default, fields with 465 // empty values are omitted from API requests. However, any non-pointer, 466 // non-interface field appearing in ForceSendFields will be sent to the 467 // server regardless of whether the field is empty or not. This may be 468 // used to include empty fields in Patch requests. 469 ForceSendFields []string `json:"-"` 470 471 // NullFields is a list of field names (e.g. "Responses") to include in 472 // API requests with the JSON null value. By default, fields with empty 473 // values are omitted from API requests. However, any field with an 474 // empty value appearing in NullFields will be sent to the server as 475 // null. It is an error if a field in this list has a non-empty value. 476 // This may be used to include null fields in Patch requests. 477 NullFields []string `json:"-"` 478} 479 480func (s *BatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) { 481 type NoMethod BatchAnnotateFilesResponse 482 raw := NoMethod(*s) 483 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 484} 485 486// BatchOperationMetadata: Metadata for the batch operations such as the 487// current state. This is included in the `metadata` field of the 488// `Operation` returned by the `GetOperation` call of the 489// `google::longrunning::Operations` service. 490type BatchOperationMetadata struct { 491 // EndTime: The time when the batch request is finished and 492 // google.longrunning.Operation.done is set to true. 493 EndTime string `json:"endTime,omitempty"` 494 495 // State: The current state of the batch operation. 496 // 497 // Possible values: 498 // "STATE_UNSPECIFIED" - Invalid. 499 // "PROCESSING" - Request is actively being processed. 500 // "SUCCESSFUL" - The request is done and at least one item has been 501 // successfully processed. 502 // "FAILED" - The request is done and no item has been successfully 503 // processed. 504 // "CANCELLED" - The request is done after the 505 // longrunning.Operations.CancelOperation has been called by the user. 506 // Any records that were processed before the cancel command are output 507 // as specified in the request. 508 State string `json:"state,omitempty"` 509 510 // SubmitTime: The time when the batch request was submitted to the 511 // server. 512 SubmitTime string `json:"submitTime,omitempty"` 513 514 // ForceSendFields is a list of field names (e.g. "EndTime") to 515 // unconditionally include in API requests. By default, fields with 516 // empty values are omitted from API requests. However, any non-pointer, 517 // non-interface field appearing in ForceSendFields will be sent to the 518 // server regardless of whether the field is empty or not. This may be 519 // used to include empty fields in Patch requests. 520 ForceSendFields []string `json:"-"` 521 522 // NullFields is a list of field names (e.g. "EndTime") to include in 523 // API requests with the JSON null value. By default, fields with empty 524 // values are omitted from API requests. However, any field with an 525 // empty value appearing in NullFields will be sent to the server as 526 // null. It is an error if a field in this list has a non-empty value. 527 // This may be used to include null fields in Patch requests. 528 NullFields []string `json:"-"` 529} 530 531func (s *BatchOperationMetadata) MarshalJSON() ([]byte, error) { 532 type NoMethod BatchOperationMetadata 533 raw := NoMethod(*s) 534 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 535} 536 537// Block: Logical element on the page. 538type Block struct { 539 // BlockType: Detected block type (text, image etc) for this block. 540 // 541 // Possible values: 542 // "UNKNOWN" - Unknown block type. 543 // "TEXT" - Regular text block. 544 // "TABLE" - Table block. 545 // "PICTURE" - Image block. 546 // "RULER" - Horizontal/vertical line box. 547 // "BARCODE" - Barcode block. 548 BlockType string `json:"blockType,omitempty"` 549 550 // BoundingBox: The bounding box for the block. The vertices are in the 551 // order of top-left, top-right, bottom-right, bottom-left. When a 552 // rotation of the bounding box is detected the rotation is represented 553 // as around the top-left corner as defined when the text is read in the 554 // 'natural' orientation. For example: * when the text is horizontal it 555 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 556 // around the top-left corner it becomes: 2----3 | | 1----0 and the 557 // vertex order will still be (0, 1, 2, 3). 558 BoundingBox *BoundingPoly `json:"boundingBox,omitempty"` 559 560 // Confidence: Confidence of the OCR results on the block. Range [0, 1]. 561 Confidence float64 `json:"confidence,omitempty"` 562 563 // Paragraphs: List of paragraphs in this block (if this blocks is of 564 // type text). 565 Paragraphs []*Paragraph `json:"paragraphs,omitempty"` 566 567 // Property: Additional information detected for the block. 568 Property *TextProperty `json:"property,omitempty"` 569 570 // ForceSendFields is a list of field names (e.g. "BlockType") to 571 // unconditionally include in API requests. By default, fields with 572 // empty values are omitted from API requests. However, any non-pointer, 573 // non-interface field appearing in ForceSendFields will be sent to the 574 // server regardless of whether the field is empty or not. This may be 575 // used to include empty fields in Patch requests. 576 ForceSendFields []string `json:"-"` 577 578 // NullFields is a list of field names (e.g. "BlockType") to include in 579 // API requests with the JSON null value. By default, fields with empty 580 // values are omitted from API requests. However, any field with an 581 // empty value appearing in NullFields will be sent to the server as 582 // null. It is an error if a field in this list has a non-empty value. 583 // This may be used to include null fields in Patch requests. 584 NullFields []string `json:"-"` 585} 586 587func (s *Block) MarshalJSON() ([]byte, error) { 588 type NoMethod Block 589 raw := NoMethod(*s) 590 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 591} 592 593func (s *Block) UnmarshalJSON(data []byte) error { 594 type NoMethod Block 595 var s1 struct { 596 Confidence gensupport.JSONFloat64 `json:"confidence"` 597 *NoMethod 598 } 599 s1.NoMethod = (*NoMethod)(s) 600 if err := json.Unmarshal(data, &s1); err != nil { 601 return err 602 } 603 s.Confidence = float64(s1.Confidence) 604 return nil 605} 606 607// BoundingPoly: A bounding polygon for the detected image annotation. 608type BoundingPoly struct { 609 // NormalizedVertices: The bounding polygon normalized vertices. 610 NormalizedVertices []*NormalizedVertex `json:"normalizedVertices,omitempty"` 611 612 // Vertices: The bounding polygon vertices. 613 Vertices []*Vertex `json:"vertices,omitempty"` 614 615 // ForceSendFields is a list of field names (e.g. "NormalizedVertices") 616 // to unconditionally include in API requests. By default, fields with 617 // empty values are omitted from API requests. However, any non-pointer, 618 // non-interface field appearing in ForceSendFields will be sent to the 619 // server regardless of whether the field is empty or not. This may be 620 // used to include empty fields in Patch requests. 621 ForceSendFields []string `json:"-"` 622 623 // NullFields is a list of field names (e.g. "NormalizedVertices") to 624 // include in API requests with the JSON null value. By default, fields 625 // with empty values are omitted from API requests. However, any field 626 // with an empty value appearing in NullFields will be sent to the 627 // server as null. It is an error if a field in this list has a 628 // non-empty value. This may be used to include null fields in Patch 629 // requests. 630 NullFields []string `json:"-"` 631} 632 633func (s *BoundingPoly) MarshalJSON() ([]byte, error) { 634 type NoMethod BoundingPoly 635 raw := NoMethod(*s) 636 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 637} 638 639// Color: Represents a color in the RGBA color space. This 640// representation is designed for simplicity of conversion to/from color 641// representations in various languages over compactness. For example, 642// the fields of this representation can be trivially provided to the 643// constructor of `java.awt.Color` in Java; it can also be trivially 644// provided to UIColor's `+colorWithRed:green:blue:alpha` method in iOS; 645// and, with just a little work, it can be easily formatted into a CSS 646// `rgba()` string in JavaScript. This reference page doesn't carry 647// information about the absolute color space that should be used to 648// interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, 649// etc.). By default, applications should assume the sRGB color space. 650// When color equality needs to be decided, implementations, unless 651// documented otherwise, treat two colors as equal if all their red, 652// green, blue, and alpha values each differ by at most 1e-5. Example 653// (Java): import com.google.type.Color; // ... public static 654// java.awt.Color fromProto(Color protocolor) { float alpha = 655// protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; 656// return new java.awt.Color( protocolor.getRed(), 657// protocolor.getGreen(), protocolor.getBlue(), alpha); } public static 658// Color toProto(java.awt.Color color) { float red = (float) 659// color.getRed(); float green = (float) color.getGreen(); float blue = 660// (float) color.getBlue(); float denominator = 255.0; Color.Builder 661// resultBuilder = Color .newBuilder() .setRed(red / denominator) 662// .setGreen(green / denominator) .setBlue(blue / denominator); int 663// alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( 664// FloatValue .newBuilder() .setValue(((float) alpha) / denominator) 665// .build()); } return resultBuilder.build(); } // ... Example (iOS / 666// Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float 667// red = [protocolor red]; float green = [protocolor green]; float blue 668// = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; 669// float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper 670// value]; } return [UIColor colorWithRed:red green:green blue:blue 671// alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, 672// green, blue, alpha; if (![color getRed:&red green:&green blue:&blue 673// alpha:&alpha]) { return nil; } Color* result = [[Color alloc] init]; 674// [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; 675// if (alpha <= 0.9999) { [result 676// setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; 677// return result; } // ... Example (JavaScript): // ... var 678// protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red 679// || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = 680// rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green 681// = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); 682// if (!('alpha' in rgb_color)) { return rgbToCssColor(red, green, 683// blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams 684// = [red, green, blue].join(','); return ['rgba(', rgbParams, ',', 685// alphaFrac, ')'].join(''); }; var rgbToCssColor = function(red, green, 686// blue) { var rgbNumber = new Number((red << 16) | (green << 8) | 687// blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - 688// hexString.length; var resultBuilder = ['#']; for (var i = 0; i < 689// missingZeros; i++) { resultBuilder.push('0'); } 690// resultBuilder.push(hexString); return resultBuilder.join(''); }; // 691// ... 692type Color struct { 693 // Alpha: The fraction of this color that should be applied to the 694 // pixel. That is, the final pixel color is defined by the equation: 695 // `pixel color = alpha * (this color) + (1.0 - alpha) * (background 696 // color)` This means that a value of 1.0 corresponds to a solid color, 697 // whereas a value of 0.0 corresponds to a completely transparent color. 698 // This uses a wrapper message rather than a simple float scalar so that 699 // it is possible to distinguish between a default value and the value 700 // being unset. If omitted, this color object is rendered as a solid 701 // color (as if the alpha value had been explicitly given a value of 702 // 1.0). 703 Alpha float64 `json:"alpha,omitempty"` 704 705 // Blue: The amount of blue in the color as a value in the interval [0, 706 // 1]. 707 Blue float64 `json:"blue,omitempty"` 708 709 // Green: The amount of green in the color as a value in the interval 710 // [0, 1]. 711 Green float64 `json:"green,omitempty"` 712 713 // Red: The amount of red in the color as a value in the interval [0, 714 // 1]. 715 Red float64 `json:"red,omitempty"` 716 717 // ForceSendFields is a list of field names (e.g. "Alpha") to 718 // unconditionally include in API requests. By default, fields with 719 // empty values are omitted from API requests. However, any non-pointer, 720 // non-interface field appearing in ForceSendFields will be sent to the 721 // server regardless of whether the field is empty or not. This may be 722 // used to include empty fields in Patch requests. 723 ForceSendFields []string `json:"-"` 724 725 // NullFields is a list of field names (e.g. "Alpha") to include in API 726 // requests with the JSON null value. By default, fields with empty 727 // values are omitted from API requests. However, any field with an 728 // empty value appearing in NullFields will be sent to the server as 729 // null. It is an error if a field in this list has a non-empty value. 730 // This may be used to include null fields in Patch requests. 731 NullFields []string `json:"-"` 732} 733 734func (s *Color) MarshalJSON() ([]byte, error) { 735 type NoMethod Color 736 raw := NoMethod(*s) 737 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 738} 739 740func (s *Color) UnmarshalJSON(data []byte) error { 741 type NoMethod Color 742 var s1 struct { 743 Alpha gensupport.JSONFloat64 `json:"alpha"` 744 Blue gensupport.JSONFloat64 `json:"blue"` 745 Green gensupport.JSONFloat64 `json:"green"` 746 Red gensupport.JSONFloat64 `json:"red"` 747 *NoMethod 748 } 749 s1.NoMethod = (*NoMethod)(s) 750 if err := json.Unmarshal(data, &s1); err != nil { 751 return err 752 } 753 s.Alpha = float64(s1.Alpha) 754 s.Blue = float64(s1.Blue) 755 s.Green = float64(s1.Green) 756 s.Red = float64(s1.Red) 757 return nil 758} 759 760// ColorInfo: Color information consists of RGB channels, score, and the 761// fraction of the image that the color occupies in the image. 762type ColorInfo struct { 763 // Color: RGB components of the color. 764 Color *Color `json:"color,omitempty"` 765 766 // PixelFraction: The fraction of pixels the color occupies in the 767 // image. Value in range [0, 1]. 768 PixelFraction float64 `json:"pixelFraction,omitempty"` 769 770 // Score: Image-specific score for this color. Value in range [0, 1]. 771 Score float64 `json:"score,omitempty"` 772 773 // ForceSendFields is a list of field names (e.g. "Color") 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. "Color") to include in API 782 // requests with the JSON null value. By default, fields with empty 783 // values are omitted from API requests. However, any field with an 784 // 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 *ColorInfo) MarshalJSON() ([]byte, error) { 791 type NoMethod ColorInfo 792 raw := NoMethod(*s) 793 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 794} 795 796func (s *ColorInfo) UnmarshalJSON(data []byte) error { 797 type NoMethod ColorInfo 798 var s1 struct { 799 PixelFraction gensupport.JSONFloat64 `json:"pixelFraction"` 800 Score gensupport.JSONFloat64 `json:"score"` 801 *NoMethod 802 } 803 s1.NoMethod = (*NoMethod)(s) 804 if err := json.Unmarshal(data, &s1); err != nil { 805 return err 806 } 807 s.PixelFraction = float64(s1.PixelFraction) 808 s.Score = float64(s1.Score) 809 return nil 810} 811 812// CropHint: Single crop hint that is used to generate a new crop when 813// serving an image. 814type CropHint struct { 815 // BoundingPoly: The bounding polygon for the crop region. The 816 // coordinates of the bounding box are in the original image's scale. 817 BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"` 818 819 // Confidence: Confidence of this being a salient region. Range [0, 1]. 820 Confidence float64 `json:"confidence,omitempty"` 821 822 // ImportanceFraction: Fraction of importance of this salient region 823 // with respect to the original image. 824 ImportanceFraction float64 `json:"importanceFraction,omitempty"` 825 826 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 827 // unconditionally include in API requests. By default, fields with 828 // empty values are omitted from API requests. However, any non-pointer, 829 // non-interface field appearing in ForceSendFields will be sent to the 830 // server regardless of whether the field is empty or not. This may be 831 // used to include empty fields in Patch requests. 832 ForceSendFields []string `json:"-"` 833 834 // NullFields is a list of field names (e.g. "BoundingPoly") to include 835 // in API requests with the JSON null value. By default, fields with 836 // empty values are omitted from API requests. However, any field with 837 // an empty value appearing in NullFields will be sent to the server as 838 // null. It is an error if a field in this list has a non-empty value. 839 // This may be used to include null fields in Patch requests. 840 NullFields []string `json:"-"` 841} 842 843func (s *CropHint) MarshalJSON() ([]byte, error) { 844 type NoMethod CropHint 845 raw := NoMethod(*s) 846 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 847} 848 849func (s *CropHint) UnmarshalJSON(data []byte) error { 850 type NoMethod CropHint 851 var s1 struct { 852 Confidence gensupport.JSONFloat64 `json:"confidence"` 853 ImportanceFraction gensupport.JSONFloat64 `json:"importanceFraction"` 854 *NoMethod 855 } 856 s1.NoMethod = (*NoMethod)(s) 857 if err := json.Unmarshal(data, &s1); err != nil { 858 return err 859 } 860 s.Confidence = float64(s1.Confidence) 861 s.ImportanceFraction = float64(s1.ImportanceFraction) 862 return nil 863} 864 865// CropHintsAnnotation: Set of crop hints that are used to generate new 866// crops when serving images. 867type CropHintsAnnotation struct { 868 // CropHints: Crop hint results. 869 CropHints []*CropHint `json:"cropHints,omitempty"` 870 871 // ForceSendFields is a list of field names (e.g. "CropHints") to 872 // unconditionally include in API requests. By default, fields with 873 // empty values are omitted from API requests. However, any non-pointer, 874 // non-interface field appearing in ForceSendFields will be sent to the 875 // server regardless of whether the field is empty or not. This may be 876 // used to include empty fields in Patch requests. 877 ForceSendFields []string `json:"-"` 878 879 // NullFields is a list of field names (e.g. "CropHints") to include in 880 // API requests with the JSON null value. By default, fields with empty 881 // values are omitted from API requests. However, any field with an 882 // empty value appearing in NullFields will be sent to the server as 883 // null. It is an error if a field in this list has a non-empty value. 884 // This may be used to include null fields in Patch requests. 885 NullFields []string `json:"-"` 886} 887 888func (s *CropHintsAnnotation) MarshalJSON() ([]byte, error) { 889 type NoMethod CropHintsAnnotation 890 raw := NoMethod(*s) 891 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 892} 893 894// DetectedBreak: Detected start or end of a structural component. 895type DetectedBreak struct { 896 // IsPrefix: True if break prepends the element. 897 IsPrefix bool `json:"isPrefix,omitempty"` 898 899 // Type: Detected break type. 900 // 901 // Possible values: 902 // "UNKNOWN" - Unknown break label type. 903 // "SPACE" - Regular space. 904 // "SURE_SPACE" - Sure space (very wide). 905 // "EOL_SURE_SPACE" - Line-wrapping break. 906 // "HYPHEN" - End-line hyphen that is not present in text; does not 907 // co-occur with `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. 908 // "LINE_BREAK" - Line break that ends a paragraph. 909 Type string `json:"type,omitempty"` 910 911 // ForceSendFields is a list of field names (e.g. "IsPrefix") to 912 // unconditionally include in API requests. By default, fields with 913 // empty values are omitted from API requests. However, any non-pointer, 914 // non-interface field appearing in ForceSendFields will be sent to the 915 // server regardless of whether the field is empty or not. This may be 916 // used to include empty fields in Patch requests. 917 ForceSendFields []string `json:"-"` 918 919 // NullFields is a list of field names (e.g. "IsPrefix") to include in 920 // API requests with the JSON null value. By default, fields with empty 921 // values are omitted from API requests. However, any field with an 922 // empty value appearing in NullFields will be sent to the server as 923 // null. It is an error if a field in this list has a non-empty value. 924 // This may be used to include null fields in Patch requests. 925 NullFields []string `json:"-"` 926} 927 928func (s *DetectedBreak) MarshalJSON() ([]byte, error) { 929 type NoMethod DetectedBreak 930 raw := NoMethod(*s) 931 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 932} 933 934// DetectedLanguage: Detected language for a structural component. 935type DetectedLanguage struct { 936 // Confidence: Confidence of detected language. Range [0, 1]. 937 Confidence float64 `json:"confidence,omitempty"` 938 939 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". 940 // For more information, see 941 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 942 LanguageCode string `json:"languageCode,omitempty"` 943 944 // ForceSendFields is a list of field names (e.g. "Confidence") to 945 // unconditionally include in API requests. By default, fields with 946 // empty values are omitted from API requests. However, any non-pointer, 947 // non-interface field appearing in ForceSendFields will be sent to the 948 // server regardless of whether the field is empty or not. This may be 949 // used to include empty fields in Patch requests. 950 ForceSendFields []string `json:"-"` 951 952 // NullFields is a list of field names (e.g. "Confidence") to include in 953 // API requests with the JSON null value. By default, fields with empty 954 // values are omitted from API requests. However, any field with an 955 // empty value appearing in NullFields will be sent to the server as 956 // null. It is an error if a field in this list has a non-empty value. 957 // This may be used to include null fields in Patch requests. 958 NullFields []string `json:"-"` 959} 960 961func (s *DetectedLanguage) MarshalJSON() ([]byte, error) { 962 type NoMethod DetectedLanguage 963 raw := NoMethod(*s) 964 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 965} 966 967func (s *DetectedLanguage) UnmarshalJSON(data []byte) error { 968 type NoMethod DetectedLanguage 969 var s1 struct { 970 Confidence gensupport.JSONFloat64 `json:"confidence"` 971 *NoMethod 972 } 973 s1.NoMethod = (*NoMethod)(s) 974 if err := json.Unmarshal(data, &s1); err != nil { 975 return err 976 } 977 s.Confidence = float64(s1.Confidence) 978 return nil 979} 980 981// DominantColorsAnnotation: Set of dominant colors and their 982// corresponding scores. 983type DominantColorsAnnotation struct { 984 // Colors: RGB color values with their score and pixel fraction. 985 Colors []*ColorInfo `json:"colors,omitempty"` 986 987 // ForceSendFields is a list of field names (e.g. "Colors") to 988 // unconditionally include in API requests. By default, fields with 989 // empty values are omitted from API requests. However, any non-pointer, 990 // non-interface field appearing in ForceSendFields will be sent to the 991 // server regardless of whether the field is empty or not. This may be 992 // used to include empty fields in Patch requests. 993 ForceSendFields []string `json:"-"` 994 995 // NullFields is a list of field names (e.g. "Colors") to include in API 996 // requests with the JSON null value. By default, fields with empty 997 // values are omitted from API requests. However, any field with an 998 // empty value appearing in NullFields will be sent to the server as 999 // null. It is an error if a field in this list has a non-empty value. 1000 // This may be used to include null fields in Patch requests. 1001 NullFields []string `json:"-"` 1002} 1003 1004func (s *DominantColorsAnnotation) MarshalJSON() ([]byte, error) { 1005 type NoMethod DominantColorsAnnotation 1006 raw := NoMethod(*s) 1007 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1008} 1009 1010// EntityAnnotation: Set of detected entity features. 1011type EntityAnnotation struct { 1012 // BoundingPoly: Image region to which this entity belongs. Not produced 1013 // for `LABEL_DETECTION` features. 1014 BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"` 1015 1016 // Confidence: **Deprecated. Use `score` instead.** The accuracy of the 1017 // entity detection in an image. For example, for an image in which the 1018 // "Eiffel Tower" entity is detected, this field represents the 1019 // confidence that there is a tower in the query image. Range [0, 1]. 1020 Confidence float64 `json:"confidence,omitempty"` 1021 1022 // Description: Entity textual description, expressed in its `locale` 1023 // language. 1024 Description string `json:"description,omitempty"` 1025 1026 // Locale: The language code for the locale in which the entity textual 1027 // `description` is expressed. 1028 Locale string `json:"locale,omitempty"` 1029 1030 // Locations: The location information for the detected entity. Multiple 1031 // `LocationInfo` elements can be present because one location may 1032 // indicate the location of the scene in the image, and another location 1033 // may indicate the location of the place where the image was taken. 1034 // Location information is usually present for landmarks. 1035 Locations []*LocationInfo `json:"locations,omitempty"` 1036 1037 // Mid: Opaque entity ID. Some IDs may be available in Google Knowledge 1038 // Graph Search API (https://developers.google.com/knowledge-graph/). 1039 Mid string `json:"mid,omitempty"` 1040 1041 // Properties: Some entities may have optional user-supplied `Property` 1042 // (name/value) fields, such a score or string that qualifies the 1043 // entity. 1044 Properties []*Property `json:"properties,omitempty"` 1045 1046 // Score: Overall score of the result. Range [0, 1]. 1047 Score float64 `json:"score,omitempty"` 1048 1049 // Topicality: The relevancy of the ICA (Image Content Annotation) label 1050 // to the image. For example, the relevancy of "tower" is likely higher 1051 // to an image containing the detected "Eiffel Tower" than to an image 1052 // containing a detected distant towering building, even though the 1053 // confidence that there is a tower in each image may be the same. Range 1054 // [0, 1]. 1055 Topicality float64 `json:"topicality,omitempty"` 1056 1057 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 1058 // unconditionally include in API requests. By default, fields with 1059 // empty values are omitted from API requests. However, any non-pointer, 1060 // non-interface field appearing in ForceSendFields will be sent to the 1061 // server regardless of whether the field is empty or not. This may be 1062 // used to include empty fields in Patch requests. 1063 ForceSendFields []string `json:"-"` 1064 1065 // NullFields is a list of field names (e.g. "BoundingPoly") to include 1066 // in API requests with the JSON null value. By default, fields with 1067 // empty values are omitted from API requests. However, any field with 1068 // an empty value appearing in NullFields will be sent to the server as 1069 // null. It is an error if a field in this list has a non-empty value. 1070 // This may be used to include null fields in Patch requests. 1071 NullFields []string `json:"-"` 1072} 1073 1074func (s *EntityAnnotation) MarshalJSON() ([]byte, error) { 1075 type NoMethod EntityAnnotation 1076 raw := NoMethod(*s) 1077 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1078} 1079 1080func (s *EntityAnnotation) UnmarshalJSON(data []byte) error { 1081 type NoMethod EntityAnnotation 1082 var s1 struct { 1083 Confidence gensupport.JSONFloat64 `json:"confidence"` 1084 Score gensupport.JSONFloat64 `json:"score"` 1085 Topicality gensupport.JSONFloat64 `json:"topicality"` 1086 *NoMethod 1087 } 1088 s1.NoMethod = (*NoMethod)(s) 1089 if err := json.Unmarshal(data, &s1); err != nil { 1090 return err 1091 } 1092 s.Confidence = float64(s1.Confidence) 1093 s.Score = float64(s1.Score) 1094 s.Topicality = float64(s1.Topicality) 1095 return nil 1096} 1097 1098// FaceAnnotation: A face annotation object contains the results of face 1099// detection. 1100type FaceAnnotation struct { 1101 // AngerLikelihood: Anger likelihood. 1102 // 1103 // Possible values: 1104 // "UNKNOWN" - Unknown likelihood. 1105 // "VERY_UNLIKELY" - It is very unlikely. 1106 // "UNLIKELY" - It is unlikely. 1107 // "POSSIBLE" - It is possible. 1108 // "LIKELY" - It is likely. 1109 // "VERY_LIKELY" - It is very likely. 1110 AngerLikelihood string `json:"angerLikelihood,omitempty"` 1111 1112 // BlurredLikelihood: Blurred likelihood. 1113 // 1114 // Possible values: 1115 // "UNKNOWN" - Unknown likelihood. 1116 // "VERY_UNLIKELY" - It is very unlikely. 1117 // "UNLIKELY" - It is unlikely. 1118 // "POSSIBLE" - It is possible. 1119 // "LIKELY" - It is likely. 1120 // "VERY_LIKELY" - It is very likely. 1121 BlurredLikelihood string `json:"blurredLikelihood,omitempty"` 1122 1123 // BoundingPoly: The bounding polygon around the face. The coordinates 1124 // of the bounding box are in the original image's scale. The bounding 1125 // box is computed to "frame" the face in accordance with human 1126 // expectations. It is based on the landmarker results. Note that one or 1127 // more x and/or y coordinates may not be generated in the 1128 // `BoundingPoly` (the polygon will be unbounded) if only a partial face 1129 // appears in the image to be annotated. 1130 BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"` 1131 1132 // DetectionConfidence: Detection confidence. Range [0, 1]. 1133 DetectionConfidence float64 `json:"detectionConfidence,omitempty"` 1134 1135 // FdBoundingPoly: The `fd_bounding_poly` bounding polygon is tighter 1136 // than the `boundingPoly`, and encloses only the skin part of the face. 1137 // Typically, it is used to eliminate the face from any image analysis 1138 // that detects the "amount of skin" visible in an image. It is not 1139 // based on the landmarker results, only on the initial face detection, 1140 // hence the fd (face detection) prefix. 1141 FdBoundingPoly *BoundingPoly `json:"fdBoundingPoly,omitempty"` 1142 1143 // HeadwearLikelihood: Headwear likelihood. 1144 // 1145 // Possible values: 1146 // "UNKNOWN" - Unknown likelihood. 1147 // "VERY_UNLIKELY" - It is very unlikely. 1148 // "UNLIKELY" - It is unlikely. 1149 // "POSSIBLE" - It is possible. 1150 // "LIKELY" - It is likely. 1151 // "VERY_LIKELY" - It is very likely. 1152 HeadwearLikelihood string `json:"headwearLikelihood,omitempty"` 1153 1154 // JoyLikelihood: Joy likelihood. 1155 // 1156 // Possible values: 1157 // "UNKNOWN" - Unknown likelihood. 1158 // "VERY_UNLIKELY" - It is very unlikely. 1159 // "UNLIKELY" - It is unlikely. 1160 // "POSSIBLE" - It is possible. 1161 // "LIKELY" - It is likely. 1162 // "VERY_LIKELY" - It is very likely. 1163 JoyLikelihood string `json:"joyLikelihood,omitempty"` 1164 1165 // LandmarkingConfidence: Face landmarking confidence. Range [0, 1]. 1166 LandmarkingConfidence float64 `json:"landmarkingConfidence,omitempty"` 1167 1168 // Landmarks: Detected face landmarks. 1169 Landmarks []*Landmark `json:"landmarks,omitempty"` 1170 1171 // PanAngle: Yaw angle, which indicates the leftward/rightward angle 1172 // that the face is pointing relative to the vertical plane 1173 // perpendicular to the image. Range [-180,180]. 1174 PanAngle float64 `json:"panAngle,omitempty"` 1175 1176 // RollAngle: Roll angle, which indicates the amount of 1177 // clockwise/anti-clockwise rotation of the face relative to the image 1178 // vertical about the axis perpendicular to the face. Range [-180,180]. 1179 RollAngle float64 `json:"rollAngle,omitempty"` 1180 1181 // SorrowLikelihood: Sorrow likelihood. 1182 // 1183 // Possible values: 1184 // "UNKNOWN" - Unknown likelihood. 1185 // "VERY_UNLIKELY" - It is very unlikely. 1186 // "UNLIKELY" - It is unlikely. 1187 // "POSSIBLE" - It is possible. 1188 // "LIKELY" - It is likely. 1189 // "VERY_LIKELY" - It is very likely. 1190 SorrowLikelihood string `json:"sorrowLikelihood,omitempty"` 1191 1192 // SurpriseLikelihood: Surprise likelihood. 1193 // 1194 // Possible values: 1195 // "UNKNOWN" - Unknown likelihood. 1196 // "VERY_UNLIKELY" - It is very unlikely. 1197 // "UNLIKELY" - It is unlikely. 1198 // "POSSIBLE" - It is possible. 1199 // "LIKELY" - It is likely. 1200 // "VERY_LIKELY" - It is very likely. 1201 SurpriseLikelihood string `json:"surpriseLikelihood,omitempty"` 1202 1203 // TiltAngle: Pitch angle, which indicates the upwards/downwards angle 1204 // that the face is pointing relative to the image's horizontal plane. 1205 // Range [-180,180]. 1206 TiltAngle float64 `json:"tiltAngle,omitempty"` 1207 1208 // UnderExposedLikelihood: Under-exposed likelihood. 1209 // 1210 // Possible values: 1211 // "UNKNOWN" - Unknown likelihood. 1212 // "VERY_UNLIKELY" - It is very unlikely. 1213 // "UNLIKELY" - It is unlikely. 1214 // "POSSIBLE" - It is possible. 1215 // "LIKELY" - It is likely. 1216 // "VERY_LIKELY" - It is very likely. 1217 UnderExposedLikelihood string `json:"underExposedLikelihood,omitempty"` 1218 1219 // ForceSendFields is a list of field names (e.g. "AngerLikelihood") to 1220 // unconditionally include in API requests. By default, fields with 1221 // empty values are omitted from API requests. However, any non-pointer, 1222 // non-interface field appearing in ForceSendFields will be sent to the 1223 // server regardless of whether the field is empty or not. This may be 1224 // used to include empty fields in Patch requests. 1225 ForceSendFields []string `json:"-"` 1226 1227 // NullFields is a list of field names (e.g. "AngerLikelihood") to 1228 // include in API requests with the JSON null value. By default, fields 1229 // with empty values are omitted from API requests. However, any field 1230 // with an empty value appearing in NullFields will be sent to the 1231 // server as null. It is an error if a field in this list has a 1232 // non-empty value. This may be used to include null fields in Patch 1233 // requests. 1234 NullFields []string `json:"-"` 1235} 1236 1237func (s *FaceAnnotation) MarshalJSON() ([]byte, error) { 1238 type NoMethod FaceAnnotation 1239 raw := NoMethod(*s) 1240 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1241} 1242 1243func (s *FaceAnnotation) UnmarshalJSON(data []byte) error { 1244 type NoMethod FaceAnnotation 1245 var s1 struct { 1246 DetectionConfidence gensupport.JSONFloat64 `json:"detectionConfidence"` 1247 LandmarkingConfidence gensupport.JSONFloat64 `json:"landmarkingConfidence"` 1248 PanAngle gensupport.JSONFloat64 `json:"panAngle"` 1249 RollAngle gensupport.JSONFloat64 `json:"rollAngle"` 1250 TiltAngle gensupport.JSONFloat64 `json:"tiltAngle"` 1251 *NoMethod 1252 } 1253 s1.NoMethod = (*NoMethod)(s) 1254 if err := json.Unmarshal(data, &s1); err != nil { 1255 return err 1256 } 1257 s.DetectionConfidence = float64(s1.DetectionConfidence) 1258 s.LandmarkingConfidence = float64(s1.LandmarkingConfidence) 1259 s.PanAngle = float64(s1.PanAngle) 1260 s.RollAngle = float64(s1.RollAngle) 1261 s.TiltAngle = float64(s1.TiltAngle) 1262 return nil 1263} 1264 1265// GcsDestination: The Google Cloud Storage location where the output 1266// will be written to. 1267type GcsDestination struct { 1268 // Uri: Google Cloud Storage URI prefix where the results will be 1269 // stored. Results will be in JSON format and preceded by its 1270 // corresponding input URI prefix. This field can either represent a gcs 1271 // file prefix or gcs directory. In either case, the uri should be 1272 // unique because in order to get all of the output files, you will need 1273 // to do a wildcard gcs search on the uri prefix you provide. Examples: 1274 // * File Prefix: gs://bucket-name/here/filenameprefix The output files 1275 // will be created in gs://bucket-name/here/ and the names of the output 1276 // files will begin with "filenameprefix". * Directory Prefix: 1277 // gs://bucket-name/some/location/ The output files will be created in 1278 // gs://bucket-name/some/location/ and the names of the output files 1279 // could be anything because there was no filename prefix specified. If 1280 // multiple outputs, each response is still AnnotateFileResponse, each 1281 // of which contains some subset of the full list of 1282 // AnnotateImageResponse. Multiple outputs can happen if, for example, 1283 // the output JSON is too large and overflows into multiple sharded 1284 // files. 1285 Uri string `json:"uri,omitempty"` 1286 1287 // ForceSendFields is a list of field names (e.g. "Uri") to 1288 // unconditionally include in API requests. By default, fields with 1289 // empty values are omitted from API requests. However, any non-pointer, 1290 // non-interface field appearing in ForceSendFields will be sent to the 1291 // server regardless of whether the field is empty or not. This may be 1292 // used to include empty fields in Patch requests. 1293 ForceSendFields []string `json:"-"` 1294 1295 // NullFields is a list of field names (e.g. "Uri") to include in API 1296 // requests with the JSON null value. By default, fields with empty 1297 // values are omitted from API requests. However, any field with an 1298 // empty value appearing in NullFields will be sent to the server as 1299 // null. It is an error if a field in this list has a non-empty value. 1300 // This may be used to include null fields in Patch requests. 1301 NullFields []string `json:"-"` 1302} 1303 1304func (s *GcsDestination) MarshalJSON() ([]byte, error) { 1305 type NoMethod GcsDestination 1306 raw := NoMethod(*s) 1307 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1308} 1309 1310// GcsSource: The Google Cloud Storage location where the input will be 1311// read from. 1312type GcsSource struct { 1313 // Uri: Google Cloud Storage URI for the input file. This must only be a 1314 // Google Cloud Storage object. Wildcards are not currently supported. 1315 Uri string `json:"uri,omitempty"` 1316 1317 // ForceSendFields is a list of field names (e.g. "Uri") to 1318 // unconditionally include in API requests. By default, fields with 1319 // empty values are omitted from API requests. However, any non-pointer, 1320 // non-interface field appearing in ForceSendFields will be sent to the 1321 // server regardless of whether the field is empty or not. This may be 1322 // used to include empty fields in Patch requests. 1323 ForceSendFields []string `json:"-"` 1324 1325 // NullFields is a list of field names (e.g. "Uri") to include in API 1326 // requests with the JSON null value. By default, fields with empty 1327 // values are omitted from API requests. However, any field with an 1328 // empty value appearing in NullFields will be sent to the server as 1329 // null. It is an error if a field in this list has a non-empty value. 1330 // This may be used to include null fields in Patch requests. 1331 NullFields []string `json:"-"` 1332} 1333 1334func (s *GcsSource) MarshalJSON() ([]byte, error) { 1335 type NoMethod GcsSource 1336 raw := NoMethod(*s) 1337 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1338} 1339 1340// GoogleCloudVisionV1p1beta1AnnotateFileRequest: A request to annotate 1341// one single file, e.g. a PDF, TIFF or GIF file. 1342type GoogleCloudVisionV1p1beta1AnnotateFileRequest struct { 1343 // Features: Required. Requested features. 1344 Features []*GoogleCloudVisionV1p1beta1Feature `json:"features,omitempty"` 1345 1346 // ImageContext: Additional context that may accompany the image(s) in 1347 // the file. 1348 ImageContext *GoogleCloudVisionV1p1beta1ImageContext `json:"imageContext,omitempty"` 1349 1350 // InputConfig: Required. Information about the input file. 1351 InputConfig *GoogleCloudVisionV1p1beta1InputConfig `json:"inputConfig,omitempty"` 1352 1353 // Pages: Pages of the file to perform image annotation. Pages starts 1354 // from 1, we assume the first page of the file is page 1. At most 5 1355 // pages are supported per request. Pages can be negative. Page 1 means 1356 // the first page. Page 2 means the second page. Page -1 means the last 1357 // page. Page -2 means the second to the last page. If the file is GIF 1358 // instead of PDF or TIFF, page refers to GIF frames. If this field is 1359 // empty, by default the service performs image annotation for the first 1360 // 5 pages of the file. 1361 Pages []int64 `json:"pages,omitempty"` 1362 1363 // ForceSendFields is a list of field names (e.g. "Features") 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. "Features") to include in 1372 // API requests with the JSON null value. By default, fields with empty 1373 // values are omitted from API requests. However, any field with an 1374 // 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 *GoogleCloudVisionV1p1beta1AnnotateFileRequest) MarshalJSON() ([]byte, error) { 1381 type NoMethod GoogleCloudVisionV1p1beta1AnnotateFileRequest 1382 raw := NoMethod(*s) 1383 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1384} 1385 1386// GoogleCloudVisionV1p1beta1AnnotateFileResponse: Response to a single 1387// file annotation request. A file may contain one or more images, which 1388// individually have their own responses. 1389type GoogleCloudVisionV1p1beta1AnnotateFileResponse struct { 1390 // Error: If set, represents the error message for the failed request. 1391 // The `responses` field will not be set in this case. 1392 Error *Status `json:"error,omitempty"` 1393 1394 // InputConfig: Information about the file for which this response is 1395 // generated. 1396 InputConfig *GoogleCloudVisionV1p1beta1InputConfig `json:"inputConfig,omitempty"` 1397 1398 // Responses: Individual responses to images found within the file. This 1399 // field will be empty if the `error` field is set. 1400 Responses []*GoogleCloudVisionV1p1beta1AnnotateImageResponse `json:"responses,omitempty"` 1401 1402 // TotalPages: This field gives the total number of pages in the file. 1403 TotalPages int64 `json:"totalPages,omitempty"` 1404 1405 // ForceSendFields is a list of field names (e.g. "Error") to 1406 // unconditionally include in API requests. By default, fields with 1407 // empty values are omitted from API requests. However, any non-pointer, 1408 // non-interface field appearing in ForceSendFields will be sent to the 1409 // server regardless of whether the field is empty or not. This may be 1410 // used to include empty fields in Patch requests. 1411 ForceSendFields []string `json:"-"` 1412 1413 // NullFields is a list of field names (e.g. "Error") to include in API 1414 // requests with the JSON null value. By default, fields with empty 1415 // values are omitted from API requests. However, any field with an 1416 // empty value appearing in NullFields will be sent to the server as 1417 // null. It is an error if a field in this list has a non-empty value. 1418 // This may be used to include null fields in Patch requests. 1419 NullFields []string `json:"-"` 1420} 1421 1422func (s *GoogleCloudVisionV1p1beta1AnnotateFileResponse) MarshalJSON() ([]byte, error) { 1423 type NoMethod GoogleCloudVisionV1p1beta1AnnotateFileResponse 1424 raw := NoMethod(*s) 1425 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1426} 1427 1428// GoogleCloudVisionV1p1beta1AnnotateImageRequest: Request for 1429// performing Google Cloud Vision API tasks over a user-provided image, 1430// with user-requested features, and with context information. 1431type GoogleCloudVisionV1p1beta1AnnotateImageRequest struct { 1432 // Features: Requested features. 1433 Features []*GoogleCloudVisionV1p1beta1Feature `json:"features,omitempty"` 1434 1435 // Image: The image to be processed. 1436 Image *GoogleCloudVisionV1p1beta1Image `json:"image,omitempty"` 1437 1438 // ImageContext: Additional context that may accompany the image. 1439 ImageContext *GoogleCloudVisionV1p1beta1ImageContext `json:"imageContext,omitempty"` 1440 1441 // ForceSendFields is a list of field names (e.g. "Features") to 1442 // unconditionally include in API requests. By default, fields with 1443 // empty values are omitted from API requests. However, any non-pointer, 1444 // non-interface field appearing in ForceSendFields will be sent to the 1445 // server regardless of whether the field is empty or not. This may be 1446 // used to include empty fields in Patch requests. 1447 ForceSendFields []string `json:"-"` 1448 1449 // NullFields is a list of field names (e.g. "Features") to include in 1450 // API requests with the JSON null value. By default, fields with empty 1451 // values are omitted from API requests. However, any field with an 1452 // empty value appearing in NullFields will be sent to the server as 1453 // null. It is an error if a field in this list has a non-empty value. 1454 // This may be used to include null fields in Patch requests. 1455 NullFields []string `json:"-"` 1456} 1457 1458func (s *GoogleCloudVisionV1p1beta1AnnotateImageRequest) MarshalJSON() ([]byte, error) { 1459 type NoMethod GoogleCloudVisionV1p1beta1AnnotateImageRequest 1460 raw := NoMethod(*s) 1461 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1462} 1463 1464// GoogleCloudVisionV1p1beta1AnnotateImageResponse: Response to an image 1465// annotation request. 1466type GoogleCloudVisionV1p1beta1AnnotateImageResponse struct { 1467 // Context: If present, contextual information is needed to understand 1468 // where this image comes from. 1469 Context *GoogleCloudVisionV1p1beta1ImageAnnotationContext `json:"context,omitempty"` 1470 1471 // CropHintsAnnotation: If present, crop hints have completed 1472 // successfully. 1473 CropHintsAnnotation *GoogleCloudVisionV1p1beta1CropHintsAnnotation `json:"cropHintsAnnotation,omitempty"` 1474 1475 // Error: If set, represents the error message for the operation. Note 1476 // that filled-in image annotations are guaranteed to be correct, even 1477 // when `error` is set. 1478 Error *Status `json:"error,omitempty"` 1479 1480 // FaceAnnotations: If present, face detection has completed 1481 // successfully. 1482 FaceAnnotations []*GoogleCloudVisionV1p1beta1FaceAnnotation `json:"faceAnnotations,omitempty"` 1483 1484 // FullTextAnnotation: If present, text (OCR) detection or document 1485 // (OCR) text detection has completed successfully. This annotation 1486 // provides the structural hierarchy for the OCR detected text. 1487 FullTextAnnotation *GoogleCloudVisionV1p1beta1TextAnnotation `json:"fullTextAnnotation,omitempty"` 1488 1489 // ImagePropertiesAnnotation: If present, image properties were 1490 // extracted successfully. 1491 ImagePropertiesAnnotation *GoogleCloudVisionV1p1beta1ImageProperties `json:"imagePropertiesAnnotation,omitempty"` 1492 1493 // LabelAnnotations: If present, label detection has completed 1494 // successfully. 1495 LabelAnnotations []*GoogleCloudVisionV1p1beta1EntityAnnotation `json:"labelAnnotations,omitempty"` 1496 1497 // LandmarkAnnotations: If present, landmark detection has completed 1498 // successfully. 1499 LandmarkAnnotations []*GoogleCloudVisionV1p1beta1EntityAnnotation `json:"landmarkAnnotations,omitempty"` 1500 1501 // LocalizedObjectAnnotations: If present, localized object detection 1502 // has completed successfully. This will be sorted descending by 1503 // confidence score. 1504 LocalizedObjectAnnotations []*GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation `json:"localizedObjectAnnotations,omitempty"` 1505 1506 // LogoAnnotations: If present, logo detection has completed 1507 // successfully. 1508 LogoAnnotations []*GoogleCloudVisionV1p1beta1EntityAnnotation `json:"logoAnnotations,omitempty"` 1509 1510 // ProductSearchResults: If present, product search has completed 1511 // successfully. 1512 ProductSearchResults *GoogleCloudVisionV1p1beta1ProductSearchResults `json:"productSearchResults,omitempty"` 1513 1514 // SafeSearchAnnotation: If present, safe-search annotation has 1515 // completed successfully. 1516 SafeSearchAnnotation *GoogleCloudVisionV1p1beta1SafeSearchAnnotation `json:"safeSearchAnnotation,omitempty"` 1517 1518 // TextAnnotations: If present, text (OCR) detection has completed 1519 // successfully. 1520 TextAnnotations []*GoogleCloudVisionV1p1beta1EntityAnnotation `json:"textAnnotations,omitempty"` 1521 1522 // WebDetection: If present, web detection has completed successfully. 1523 WebDetection *GoogleCloudVisionV1p1beta1WebDetection `json:"webDetection,omitempty"` 1524 1525 // ForceSendFields is a list of field names (e.g. "Context") to 1526 // unconditionally include in API requests. By default, fields with 1527 // empty values are omitted from API requests. However, any non-pointer, 1528 // non-interface field appearing in ForceSendFields will be sent to the 1529 // server regardless of whether the field is empty or not. This may be 1530 // used to include empty fields in Patch requests. 1531 ForceSendFields []string `json:"-"` 1532 1533 // NullFields is a list of field names (e.g. "Context") to include in 1534 // API requests with the JSON null value. By default, fields with empty 1535 // values are omitted from API requests. However, any field with an 1536 // empty value appearing in NullFields will be sent to the server as 1537 // null. It is an error if a field in this list has a non-empty value. 1538 // This may be used to include null fields in Patch requests. 1539 NullFields []string `json:"-"` 1540} 1541 1542func (s *GoogleCloudVisionV1p1beta1AnnotateImageResponse) MarshalJSON() ([]byte, error) { 1543 type NoMethod GoogleCloudVisionV1p1beta1AnnotateImageResponse 1544 raw := NoMethod(*s) 1545 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1546} 1547 1548// GoogleCloudVisionV1p1beta1AsyncAnnotateFileRequest: An offline file 1549// annotation request. 1550type GoogleCloudVisionV1p1beta1AsyncAnnotateFileRequest struct { 1551 // Features: Required. Requested features. 1552 Features []*GoogleCloudVisionV1p1beta1Feature `json:"features,omitempty"` 1553 1554 // ImageContext: Additional context that may accompany the image(s) in 1555 // the file. 1556 ImageContext *GoogleCloudVisionV1p1beta1ImageContext `json:"imageContext,omitempty"` 1557 1558 // InputConfig: Required. Information about the input file. 1559 InputConfig *GoogleCloudVisionV1p1beta1InputConfig `json:"inputConfig,omitempty"` 1560 1561 // OutputConfig: Required. The desired output location and metadata 1562 // (e.g. format). 1563 OutputConfig *GoogleCloudVisionV1p1beta1OutputConfig `json:"outputConfig,omitempty"` 1564 1565 // ForceSendFields is a list of field names (e.g. "Features") to 1566 // unconditionally include in API requests. By default, fields with 1567 // empty values are omitted from API requests. However, any non-pointer, 1568 // non-interface field appearing in ForceSendFields will be sent to the 1569 // server regardless of whether the field is empty or not. This may be 1570 // used to include empty fields in Patch requests. 1571 ForceSendFields []string `json:"-"` 1572 1573 // NullFields is a list of field names (e.g. "Features") to include in 1574 // API requests with the JSON null value. By default, fields with empty 1575 // values are omitted from API requests. However, any field with an 1576 // empty value appearing in NullFields will be sent to the server as 1577 // null. It is an error if a field in this list has a non-empty value. 1578 // This may be used to include null fields in Patch requests. 1579 NullFields []string `json:"-"` 1580} 1581 1582func (s *GoogleCloudVisionV1p1beta1AsyncAnnotateFileRequest) MarshalJSON() ([]byte, error) { 1583 type NoMethod GoogleCloudVisionV1p1beta1AsyncAnnotateFileRequest 1584 raw := NoMethod(*s) 1585 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1586} 1587 1588// GoogleCloudVisionV1p1beta1AsyncAnnotateFileResponse: The response for 1589// a single offline file annotation request. 1590type GoogleCloudVisionV1p1beta1AsyncAnnotateFileResponse struct { 1591 // OutputConfig: The output location and metadata from 1592 // AsyncAnnotateFileRequest. 1593 OutputConfig *GoogleCloudVisionV1p1beta1OutputConfig `json:"outputConfig,omitempty"` 1594 1595 // ForceSendFields is a list of field names (e.g. "OutputConfig") to 1596 // unconditionally include in API requests. By default, fields with 1597 // empty values are omitted from API requests. However, any non-pointer, 1598 // non-interface field appearing in ForceSendFields will be sent to the 1599 // server regardless of whether the field is empty or not. This may be 1600 // used to include empty fields in Patch requests. 1601 ForceSendFields []string `json:"-"` 1602 1603 // NullFields is a list of field names (e.g. "OutputConfig") to include 1604 // in API requests with the JSON null value. By default, fields with 1605 // empty values are omitted from API requests. However, any field with 1606 // an empty value appearing in NullFields will be sent to the server as 1607 // null. It is an error if a field in this list has a non-empty value. 1608 // This may be used to include null fields in Patch requests. 1609 NullFields []string `json:"-"` 1610} 1611 1612func (s *GoogleCloudVisionV1p1beta1AsyncAnnotateFileResponse) MarshalJSON() ([]byte, error) { 1613 type NoMethod GoogleCloudVisionV1p1beta1AsyncAnnotateFileResponse 1614 raw := NoMethod(*s) 1615 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1616} 1617 1618// GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesRequest: Multiple 1619// async file annotation requests are batched into a single service 1620// call. 1621type GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesRequest struct { 1622 // Parent: Optional. Target project and location to make a call. Format: 1623 // `projects/{project-id}/locations/{location-id}`. If no parent is 1624 // specified, a region will be chosen automatically. Supported 1625 // location-ids: `us`: USA country only, `asia`: East asia areas, like 1626 // Japan, Taiwan, `eu`: The European Union. Example: 1627 // `projects/project-A/locations/eu`. 1628 Parent string `json:"parent,omitempty"` 1629 1630 // Requests: Required. Individual async file annotation requests for 1631 // this batch. 1632 Requests []*GoogleCloudVisionV1p1beta1AsyncAnnotateFileRequest `json:"requests,omitempty"` 1633 1634 // ForceSendFields is a list of field names (e.g. "Parent") to 1635 // unconditionally include in API requests. By default, fields with 1636 // empty values are omitted from API requests. However, any non-pointer, 1637 // non-interface field appearing in ForceSendFields will be sent to the 1638 // server regardless of whether the field is empty or not. This may be 1639 // used to include empty fields in Patch requests. 1640 ForceSendFields []string `json:"-"` 1641 1642 // NullFields is a list of field names (e.g. "Parent") to include in API 1643 // requests with the JSON null value. By default, fields with empty 1644 // values are omitted from API requests. However, any field with an 1645 // empty value appearing in NullFields will be sent to the server as 1646 // null. It is an error if a field in this list has a non-empty value. 1647 // This may be used to include null fields in Patch requests. 1648 NullFields []string `json:"-"` 1649} 1650 1651func (s *GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesRequest) MarshalJSON() ([]byte, error) { 1652 type NoMethod GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesRequest 1653 raw := NoMethod(*s) 1654 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1655} 1656 1657// GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesResponse: Response 1658// to an async batch file annotation request. 1659type GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesResponse struct { 1660 // Responses: The list of file annotation responses, one for each 1661 // request in AsyncBatchAnnotateFilesRequest. 1662 Responses []*GoogleCloudVisionV1p1beta1AsyncAnnotateFileResponse `json:"responses,omitempty"` 1663 1664 // ForceSendFields is a list of field names (e.g. "Responses") to 1665 // unconditionally include in API requests. By default, fields with 1666 // empty values are omitted from API requests. However, any non-pointer, 1667 // non-interface field appearing in ForceSendFields will be sent to the 1668 // server regardless of whether the field is empty or not. This may be 1669 // used to include empty fields in Patch requests. 1670 ForceSendFields []string `json:"-"` 1671 1672 // NullFields is a list of field names (e.g. "Responses") to include in 1673 // API requests with the JSON null value. By default, fields with empty 1674 // values are omitted from API requests. However, any field with an 1675 // empty value appearing in NullFields will be sent to the server as 1676 // null. It is an error if a field in this list has a non-empty value. 1677 // This may be used to include null fields in Patch requests. 1678 NullFields []string `json:"-"` 1679} 1680 1681func (s *GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) { 1682 type NoMethod GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesResponse 1683 raw := NoMethod(*s) 1684 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1685} 1686 1687// GoogleCloudVisionV1p1beta1AsyncBatchAnnotateImagesRequest: Request 1688// for async image annotation for a list of images. 1689type GoogleCloudVisionV1p1beta1AsyncBatchAnnotateImagesRequest struct { 1690 // OutputConfig: Required. The desired output location and metadata 1691 // (e.g. format). 1692 OutputConfig *GoogleCloudVisionV1p1beta1OutputConfig `json:"outputConfig,omitempty"` 1693 1694 // Parent: Optional. Target project and location to make a call. Format: 1695 // `projects/{project-id}/locations/{location-id}`. If no parent is 1696 // specified, a region will be chosen automatically. Supported 1697 // location-ids: `us`: USA country only, `asia`: East asia areas, like 1698 // Japan, Taiwan, `eu`: The European Union. Example: 1699 // `projects/project-A/locations/eu`. 1700 Parent string `json:"parent,omitempty"` 1701 1702 // Requests: Required. Individual image annotation requests for this 1703 // batch. 1704 Requests []*GoogleCloudVisionV1p1beta1AnnotateImageRequest `json:"requests,omitempty"` 1705 1706 // ForceSendFields is a list of field names (e.g. "OutputConfig") to 1707 // unconditionally include in API requests. By default, fields with 1708 // empty values are omitted from API requests. However, any non-pointer, 1709 // non-interface field appearing in ForceSendFields will be sent to the 1710 // server regardless of whether the field is empty or not. This may be 1711 // used to include empty fields in Patch requests. 1712 ForceSendFields []string `json:"-"` 1713 1714 // NullFields is a list of field names (e.g. "OutputConfig") to include 1715 // in API requests with the JSON null value. By default, fields with 1716 // empty values are omitted from API requests. However, any field with 1717 // an empty value appearing in NullFields will be sent to the server as 1718 // null. It is an error if a field in this list has a non-empty value. 1719 // This may be used to include null fields in Patch requests. 1720 NullFields []string `json:"-"` 1721} 1722 1723func (s *GoogleCloudVisionV1p1beta1AsyncBatchAnnotateImagesRequest) MarshalJSON() ([]byte, error) { 1724 type NoMethod GoogleCloudVisionV1p1beta1AsyncBatchAnnotateImagesRequest 1725 raw := NoMethod(*s) 1726 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1727} 1728 1729// GoogleCloudVisionV1p1beta1BatchAnnotateFilesRequest: A list of 1730// requests to annotate files using the BatchAnnotateFiles API. 1731type GoogleCloudVisionV1p1beta1BatchAnnotateFilesRequest struct { 1732 // Parent: Optional. Target project and location to make a call. Format: 1733 // `projects/{project-id}/locations/{location-id}`. If no parent is 1734 // specified, a region will be chosen automatically. Supported 1735 // location-ids: `us`: USA country only, `asia`: East asia areas, like 1736 // Japan, Taiwan, `eu`: The European Union. Example: 1737 // `projects/project-A/locations/eu`. 1738 Parent string `json:"parent,omitempty"` 1739 1740 // Requests: Required. The list of file annotation requests. Right now 1741 // we support only one AnnotateFileRequest in BatchAnnotateFilesRequest. 1742 Requests []*GoogleCloudVisionV1p1beta1AnnotateFileRequest `json:"requests,omitempty"` 1743 1744 // ForceSendFields is a list of field names (e.g. "Parent") to 1745 // unconditionally include in API requests. By default, fields with 1746 // empty values are omitted from API requests. However, any non-pointer, 1747 // non-interface field appearing in ForceSendFields will be sent to the 1748 // server regardless of whether the field is empty or not. This may be 1749 // used to include empty fields in Patch requests. 1750 ForceSendFields []string `json:"-"` 1751 1752 // NullFields is a list of field names (e.g. "Parent") to include in API 1753 // requests with the JSON null value. By default, fields with empty 1754 // values are omitted from API requests. However, any field with an 1755 // empty value appearing in NullFields will be sent to the server as 1756 // null. It is an error if a field in this list has a non-empty value. 1757 // This may be used to include null fields in Patch requests. 1758 NullFields []string `json:"-"` 1759} 1760 1761func (s *GoogleCloudVisionV1p1beta1BatchAnnotateFilesRequest) MarshalJSON() ([]byte, error) { 1762 type NoMethod GoogleCloudVisionV1p1beta1BatchAnnotateFilesRequest 1763 raw := NoMethod(*s) 1764 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1765} 1766 1767// GoogleCloudVisionV1p1beta1BatchAnnotateFilesResponse: A list of file 1768// annotation responses. 1769type GoogleCloudVisionV1p1beta1BatchAnnotateFilesResponse struct { 1770 // Responses: The list of file annotation responses, each response 1771 // corresponding to each AnnotateFileRequest in 1772 // BatchAnnotateFilesRequest. 1773 Responses []*GoogleCloudVisionV1p1beta1AnnotateFileResponse `json:"responses,omitempty"` 1774 1775 // ServerResponse contains the HTTP response code and headers from the 1776 // server. 1777 googleapi.ServerResponse `json:"-"` 1778 1779 // ForceSendFields is a list of field names (e.g. "Responses") to 1780 // unconditionally include in API requests. By default, fields with 1781 // empty values are omitted from API requests. However, any non-pointer, 1782 // non-interface field appearing in ForceSendFields will be sent to the 1783 // server regardless of whether the field is empty or not. This may be 1784 // used to include empty fields in Patch requests. 1785 ForceSendFields []string `json:"-"` 1786 1787 // NullFields is a list of field names (e.g. "Responses") to include in 1788 // API requests with the JSON null value. By default, fields with empty 1789 // values are omitted from API requests. However, any field with an 1790 // empty value appearing in NullFields will be sent to the server as 1791 // null. It is an error if a field in this list has a non-empty value. 1792 // This may be used to include null fields in Patch requests. 1793 NullFields []string `json:"-"` 1794} 1795 1796func (s *GoogleCloudVisionV1p1beta1BatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) { 1797 type NoMethod GoogleCloudVisionV1p1beta1BatchAnnotateFilesResponse 1798 raw := NoMethod(*s) 1799 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1800} 1801 1802// GoogleCloudVisionV1p1beta1BatchAnnotateImagesRequest: Multiple image 1803// annotation requests are batched into a single service call. 1804type GoogleCloudVisionV1p1beta1BatchAnnotateImagesRequest struct { 1805 // Parent: Optional. Target project and location to make a call. Format: 1806 // `projects/{project-id}/locations/{location-id}`. If no parent is 1807 // specified, a region will be chosen automatically. Supported 1808 // location-ids: `us`: USA country only, `asia`: East asia areas, like 1809 // Japan, Taiwan, `eu`: The European Union. Example: 1810 // `projects/project-A/locations/eu`. 1811 Parent string `json:"parent,omitempty"` 1812 1813 // Requests: Required. Individual image annotation requests for this 1814 // batch. 1815 Requests []*GoogleCloudVisionV1p1beta1AnnotateImageRequest `json:"requests,omitempty"` 1816 1817 // ForceSendFields is a list of field names (e.g. "Parent") to 1818 // unconditionally include in API requests. By default, fields with 1819 // empty values are omitted from API requests. However, any non-pointer, 1820 // non-interface field appearing in ForceSendFields will be sent to the 1821 // server regardless of whether the field is empty or not. This may be 1822 // used to include empty fields in Patch requests. 1823 ForceSendFields []string `json:"-"` 1824 1825 // NullFields is a list of field names (e.g. "Parent") to include in API 1826 // requests with the JSON null value. By default, fields with empty 1827 // values are omitted from API requests. However, any field with an 1828 // empty value appearing in NullFields will be sent to the server as 1829 // null. It is an error if a field in this list has a non-empty value. 1830 // This may be used to include null fields in Patch requests. 1831 NullFields []string `json:"-"` 1832} 1833 1834func (s *GoogleCloudVisionV1p1beta1BatchAnnotateImagesRequest) MarshalJSON() ([]byte, error) { 1835 type NoMethod GoogleCloudVisionV1p1beta1BatchAnnotateImagesRequest 1836 raw := NoMethod(*s) 1837 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1838} 1839 1840// GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse: Response to a 1841// batch image annotation request. 1842type GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse struct { 1843 // Responses: Individual responses to image annotation requests within 1844 // the batch. 1845 Responses []*GoogleCloudVisionV1p1beta1AnnotateImageResponse `json:"responses,omitempty"` 1846 1847 // ServerResponse contains the HTTP response code and headers from the 1848 // server. 1849 googleapi.ServerResponse `json:"-"` 1850 1851 // ForceSendFields is a list of field names (e.g. "Responses") 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. "Responses") to include in 1860 // API 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 *GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse) MarshalJSON() ([]byte, error) { 1869 type NoMethod GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse 1870 raw := NoMethod(*s) 1871 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1872} 1873 1874// GoogleCloudVisionV1p1beta1Block: Logical element on the page. 1875type GoogleCloudVisionV1p1beta1Block struct { 1876 // BlockType: Detected block type (text, image etc) for this block. 1877 // 1878 // Possible values: 1879 // "UNKNOWN" - Unknown block type. 1880 // "TEXT" - Regular text block. 1881 // "TABLE" - Table block. 1882 // "PICTURE" - Image block. 1883 // "RULER" - Horizontal/vertical line box. 1884 // "BARCODE" - Barcode block. 1885 BlockType string `json:"blockType,omitempty"` 1886 1887 // BoundingBox: The bounding box for the block. The vertices are in the 1888 // order of top-left, top-right, bottom-right, bottom-left. When a 1889 // rotation of the bounding box is detected the rotation is represented 1890 // as around the top-left corner as defined when the text is read in the 1891 // 'natural' orientation. For example: * when the text is horizontal it 1892 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 1893 // around the top-left corner it becomes: 2----3 | | 1----0 and the 1894 // vertex order will still be (0, 1, 2, 3). 1895 BoundingBox *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingBox,omitempty"` 1896 1897 // Confidence: Confidence of the OCR results on the block. Range [0, 1]. 1898 Confidence float64 `json:"confidence,omitempty"` 1899 1900 // Paragraphs: List of paragraphs in this block (if this blocks is of 1901 // type text). 1902 Paragraphs []*GoogleCloudVisionV1p1beta1Paragraph `json:"paragraphs,omitempty"` 1903 1904 // Property: Additional information detected for the block. 1905 Property *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty `json:"property,omitempty"` 1906 1907 // ForceSendFields is a list of field names (e.g. "BlockType") to 1908 // unconditionally include in API requests. By default, fields with 1909 // empty values are omitted from API requests. However, any non-pointer, 1910 // non-interface field appearing in ForceSendFields will be sent to the 1911 // server regardless of whether the field is empty or not. This may be 1912 // used to include empty fields in Patch requests. 1913 ForceSendFields []string `json:"-"` 1914 1915 // NullFields is a list of field names (e.g. "BlockType") to include in 1916 // API requests with the JSON null value. By default, fields with empty 1917 // values are omitted from API requests. However, any field with an 1918 // empty value appearing in NullFields will be sent to the server as 1919 // null. It is an error if a field in this list has a non-empty value. 1920 // This may be used to include null fields in Patch requests. 1921 NullFields []string `json:"-"` 1922} 1923 1924func (s *GoogleCloudVisionV1p1beta1Block) MarshalJSON() ([]byte, error) { 1925 type NoMethod GoogleCloudVisionV1p1beta1Block 1926 raw := NoMethod(*s) 1927 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1928} 1929 1930func (s *GoogleCloudVisionV1p1beta1Block) UnmarshalJSON(data []byte) error { 1931 type NoMethod GoogleCloudVisionV1p1beta1Block 1932 var s1 struct { 1933 Confidence gensupport.JSONFloat64 `json:"confidence"` 1934 *NoMethod 1935 } 1936 s1.NoMethod = (*NoMethod)(s) 1937 if err := json.Unmarshal(data, &s1); err != nil { 1938 return err 1939 } 1940 s.Confidence = float64(s1.Confidence) 1941 return nil 1942} 1943 1944// GoogleCloudVisionV1p1beta1BoundingPoly: A bounding polygon for the 1945// detected image annotation. 1946type GoogleCloudVisionV1p1beta1BoundingPoly struct { 1947 // NormalizedVertices: The bounding polygon normalized vertices. 1948 NormalizedVertices []*GoogleCloudVisionV1p1beta1NormalizedVertex `json:"normalizedVertices,omitempty"` 1949 1950 // Vertices: The bounding polygon vertices. 1951 Vertices []*GoogleCloudVisionV1p1beta1Vertex `json:"vertices,omitempty"` 1952 1953 // ForceSendFields is a list of field names (e.g. "NormalizedVertices") 1954 // to unconditionally include in API requests. By default, fields with 1955 // empty values are omitted from API requests. However, any non-pointer, 1956 // non-interface field appearing in ForceSendFields will be sent to the 1957 // server regardless of whether the field is empty or not. This may be 1958 // used to include empty fields in Patch requests. 1959 ForceSendFields []string `json:"-"` 1960 1961 // NullFields is a list of field names (e.g. "NormalizedVertices") to 1962 // include in API requests with the JSON null value. By default, fields 1963 // with empty values are omitted from API requests. However, any field 1964 // with an empty value appearing in NullFields will be sent to the 1965 // server as null. It is an error if a field in this list has a 1966 // non-empty value. This may be used to include null fields in Patch 1967 // requests. 1968 NullFields []string `json:"-"` 1969} 1970 1971func (s *GoogleCloudVisionV1p1beta1BoundingPoly) MarshalJSON() ([]byte, error) { 1972 type NoMethod GoogleCloudVisionV1p1beta1BoundingPoly 1973 raw := NoMethod(*s) 1974 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1975} 1976 1977// GoogleCloudVisionV1p1beta1ColorInfo: Color information consists of 1978// RGB channels, score, and the fraction of the image that the color 1979// occupies in the image. 1980type GoogleCloudVisionV1p1beta1ColorInfo struct { 1981 // Color: RGB components of the color. 1982 Color *Color `json:"color,omitempty"` 1983 1984 // PixelFraction: The fraction of pixels the color occupies in the 1985 // image. Value in range [0, 1]. 1986 PixelFraction float64 `json:"pixelFraction,omitempty"` 1987 1988 // Score: Image-specific score for this color. Value in range [0, 1]. 1989 Score float64 `json:"score,omitempty"` 1990 1991 // ForceSendFields is a list of field names (e.g. "Color") to 1992 // unconditionally include in API requests. By default, fields with 1993 // empty values are omitted from API requests. However, any non-pointer, 1994 // non-interface field appearing in ForceSendFields will be sent to the 1995 // server regardless of whether the field is empty or not. This may be 1996 // used to include empty fields in Patch requests. 1997 ForceSendFields []string `json:"-"` 1998 1999 // NullFields is a list of field names (e.g. "Color") to include in API 2000 // requests with the JSON null value. By default, fields with empty 2001 // values are omitted from API requests. However, any field with an 2002 // empty value appearing in NullFields will be sent to the server as 2003 // null. It is an error if a field in this list has a non-empty value. 2004 // This may be used to include null fields in Patch requests. 2005 NullFields []string `json:"-"` 2006} 2007 2008func (s *GoogleCloudVisionV1p1beta1ColorInfo) MarshalJSON() ([]byte, error) { 2009 type NoMethod GoogleCloudVisionV1p1beta1ColorInfo 2010 raw := NoMethod(*s) 2011 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2012} 2013 2014func (s *GoogleCloudVisionV1p1beta1ColorInfo) UnmarshalJSON(data []byte) error { 2015 type NoMethod GoogleCloudVisionV1p1beta1ColorInfo 2016 var s1 struct { 2017 PixelFraction gensupport.JSONFloat64 `json:"pixelFraction"` 2018 Score gensupport.JSONFloat64 `json:"score"` 2019 *NoMethod 2020 } 2021 s1.NoMethod = (*NoMethod)(s) 2022 if err := json.Unmarshal(data, &s1); err != nil { 2023 return err 2024 } 2025 s.PixelFraction = float64(s1.PixelFraction) 2026 s.Score = float64(s1.Score) 2027 return nil 2028} 2029 2030// GoogleCloudVisionV1p1beta1CropHint: Single crop hint that is used to 2031// generate a new crop when serving an image. 2032type GoogleCloudVisionV1p1beta1CropHint struct { 2033 // BoundingPoly: The bounding polygon for the crop region. The 2034 // coordinates of the bounding box are in the original image's scale. 2035 BoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingPoly,omitempty"` 2036 2037 // Confidence: Confidence of this being a salient region. Range [0, 1]. 2038 Confidence float64 `json:"confidence,omitempty"` 2039 2040 // ImportanceFraction: Fraction of importance of this salient region 2041 // with respect to the original image. 2042 ImportanceFraction float64 `json:"importanceFraction,omitempty"` 2043 2044 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 2045 // unconditionally include in API requests. By default, fields with 2046 // empty values are omitted from API requests. However, any non-pointer, 2047 // non-interface field appearing in ForceSendFields will be sent to the 2048 // server regardless of whether the field is empty or not. This may be 2049 // used to include empty fields in Patch requests. 2050 ForceSendFields []string `json:"-"` 2051 2052 // NullFields is a list of field names (e.g. "BoundingPoly") to include 2053 // in API requests with the JSON null value. By default, fields with 2054 // empty values are omitted from API requests. However, any field with 2055 // an empty value appearing in NullFields will be sent to the server as 2056 // null. It is an error if a field in this list has a non-empty value. 2057 // This may be used to include null fields in Patch requests. 2058 NullFields []string `json:"-"` 2059} 2060 2061func (s *GoogleCloudVisionV1p1beta1CropHint) MarshalJSON() ([]byte, error) { 2062 type NoMethod GoogleCloudVisionV1p1beta1CropHint 2063 raw := NoMethod(*s) 2064 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2065} 2066 2067func (s *GoogleCloudVisionV1p1beta1CropHint) UnmarshalJSON(data []byte) error { 2068 type NoMethod GoogleCloudVisionV1p1beta1CropHint 2069 var s1 struct { 2070 Confidence gensupport.JSONFloat64 `json:"confidence"` 2071 ImportanceFraction gensupport.JSONFloat64 `json:"importanceFraction"` 2072 *NoMethod 2073 } 2074 s1.NoMethod = (*NoMethod)(s) 2075 if err := json.Unmarshal(data, &s1); err != nil { 2076 return err 2077 } 2078 s.Confidence = float64(s1.Confidence) 2079 s.ImportanceFraction = float64(s1.ImportanceFraction) 2080 return nil 2081} 2082 2083// GoogleCloudVisionV1p1beta1CropHintsAnnotation: Set of crop hints that 2084// are used to generate new crops when serving images. 2085type GoogleCloudVisionV1p1beta1CropHintsAnnotation struct { 2086 // CropHints: Crop hint results. 2087 CropHints []*GoogleCloudVisionV1p1beta1CropHint `json:"cropHints,omitempty"` 2088 2089 // ForceSendFields is a list of field names (e.g. "CropHints") to 2090 // unconditionally include in API requests. By default, fields with 2091 // empty values are omitted from API requests. However, any non-pointer, 2092 // non-interface field appearing in ForceSendFields will be sent to the 2093 // server regardless of whether the field is empty or not. This may be 2094 // used to include empty fields in Patch requests. 2095 ForceSendFields []string `json:"-"` 2096 2097 // NullFields is a list of field names (e.g. "CropHints") to include in 2098 // API requests with the JSON null value. By default, fields with empty 2099 // values are omitted from API requests. However, any field with an 2100 // empty value appearing in NullFields will be sent to the server as 2101 // null. It is an error if a field in this list has a non-empty value. 2102 // This may be used to include null fields in Patch requests. 2103 NullFields []string `json:"-"` 2104} 2105 2106func (s *GoogleCloudVisionV1p1beta1CropHintsAnnotation) MarshalJSON() ([]byte, error) { 2107 type NoMethod GoogleCloudVisionV1p1beta1CropHintsAnnotation 2108 raw := NoMethod(*s) 2109 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2110} 2111 2112// GoogleCloudVisionV1p1beta1CropHintsParams: Parameters for crop hints 2113// annotation request. 2114type GoogleCloudVisionV1p1beta1CropHintsParams struct { 2115 // AspectRatios: Aspect ratios in floats, representing the ratio of the 2116 // width to the height of the image. For example, if the desired aspect 2117 // ratio is 4/3, the corresponding float value should be 1.33333. If not 2118 // specified, the best possible crop is returned. The number of provided 2119 // aspect ratios is limited to a maximum of 16; any aspect ratios 2120 // provided after the 16th are ignored. 2121 AspectRatios []float64 `json:"aspectRatios,omitempty"` 2122 2123 // ForceSendFields is a list of field names (e.g. "AspectRatios") 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. "AspectRatios") to include 2132 // in API requests with the JSON null value. By default, fields with 2133 // empty values are omitted from API requests. However, any field with 2134 // an 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 *GoogleCloudVisionV1p1beta1CropHintsParams) MarshalJSON() ([]byte, error) { 2141 type NoMethod GoogleCloudVisionV1p1beta1CropHintsParams 2142 raw := NoMethod(*s) 2143 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2144} 2145 2146// GoogleCloudVisionV1p1beta1DominantColorsAnnotation: Set of dominant 2147// colors and their corresponding scores. 2148type GoogleCloudVisionV1p1beta1DominantColorsAnnotation struct { 2149 // Colors: RGB color values with their score and pixel fraction. 2150 Colors []*GoogleCloudVisionV1p1beta1ColorInfo `json:"colors,omitempty"` 2151 2152 // ForceSendFields is a list of field names (e.g. "Colors") to 2153 // unconditionally include in API requests. By default, fields with 2154 // empty values are omitted from API requests. However, any non-pointer, 2155 // non-interface field appearing in ForceSendFields will be sent to the 2156 // server regardless of whether the field is empty or not. This may be 2157 // used to include empty fields in Patch requests. 2158 ForceSendFields []string `json:"-"` 2159 2160 // NullFields is a list of field names (e.g. "Colors") to include in API 2161 // requests with the JSON null value. By default, fields with empty 2162 // values are omitted from API requests. However, any field with an 2163 // empty value appearing in NullFields will be sent to the server as 2164 // null. It is an error if a field in this list has a non-empty value. 2165 // This may be used to include null fields in Patch requests. 2166 NullFields []string `json:"-"` 2167} 2168 2169func (s *GoogleCloudVisionV1p1beta1DominantColorsAnnotation) MarshalJSON() ([]byte, error) { 2170 type NoMethod GoogleCloudVisionV1p1beta1DominantColorsAnnotation 2171 raw := NoMethod(*s) 2172 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2173} 2174 2175// GoogleCloudVisionV1p1beta1EntityAnnotation: Set of detected entity 2176// features. 2177type GoogleCloudVisionV1p1beta1EntityAnnotation struct { 2178 // BoundingPoly: Image region to which this entity belongs. Not produced 2179 // for `LABEL_DETECTION` features. 2180 BoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingPoly,omitempty"` 2181 2182 // Confidence: **Deprecated. Use `score` instead.** The accuracy of the 2183 // entity detection in an image. For example, for an image in which the 2184 // "Eiffel Tower" entity is detected, this field represents the 2185 // confidence that there is a tower in the query image. Range [0, 1]. 2186 Confidence float64 `json:"confidence,omitempty"` 2187 2188 // Description: Entity textual description, expressed in its `locale` 2189 // language. 2190 Description string `json:"description,omitempty"` 2191 2192 // Locale: The language code for the locale in which the entity textual 2193 // `description` is expressed. 2194 Locale string `json:"locale,omitempty"` 2195 2196 // Locations: The location information for the detected entity. Multiple 2197 // `LocationInfo` elements can be present because one location may 2198 // indicate the location of the scene in the image, and another location 2199 // may indicate the location of the place where the image was taken. 2200 // Location information is usually present for landmarks. 2201 Locations []*GoogleCloudVisionV1p1beta1LocationInfo `json:"locations,omitempty"` 2202 2203 // Mid: Opaque entity ID. Some IDs may be available in Google Knowledge 2204 // Graph Search API (https://developers.google.com/knowledge-graph/). 2205 Mid string `json:"mid,omitempty"` 2206 2207 // Properties: Some entities may have optional user-supplied `Property` 2208 // (name/value) fields, such a score or string that qualifies the 2209 // entity. 2210 Properties []*GoogleCloudVisionV1p1beta1Property `json:"properties,omitempty"` 2211 2212 // Score: Overall score of the result. Range [0, 1]. 2213 Score float64 `json:"score,omitempty"` 2214 2215 // Topicality: The relevancy of the ICA (Image Content Annotation) label 2216 // to the image. For example, the relevancy of "tower" is likely higher 2217 // to an image containing the detected "Eiffel Tower" than to an image 2218 // containing a detected distant towering building, even though the 2219 // confidence that there is a tower in each image may be the same. Range 2220 // [0, 1]. 2221 Topicality float64 `json:"topicality,omitempty"` 2222 2223 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 2224 // unconditionally include in API requests. By default, fields with 2225 // empty values are omitted from API requests. However, any non-pointer, 2226 // non-interface field appearing in ForceSendFields will be sent to the 2227 // server regardless of whether the field is empty or not. This may be 2228 // used to include empty fields in Patch requests. 2229 ForceSendFields []string `json:"-"` 2230 2231 // NullFields is a list of field names (e.g. "BoundingPoly") to include 2232 // in API requests with the JSON null value. By default, fields with 2233 // empty values are omitted from API requests. However, any field with 2234 // an empty value appearing in NullFields will be sent to the server as 2235 // null. It is an error if a field in this list has a non-empty value. 2236 // This may be used to include null fields in Patch requests. 2237 NullFields []string `json:"-"` 2238} 2239 2240func (s *GoogleCloudVisionV1p1beta1EntityAnnotation) MarshalJSON() ([]byte, error) { 2241 type NoMethod GoogleCloudVisionV1p1beta1EntityAnnotation 2242 raw := NoMethod(*s) 2243 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2244} 2245 2246func (s *GoogleCloudVisionV1p1beta1EntityAnnotation) UnmarshalJSON(data []byte) error { 2247 type NoMethod GoogleCloudVisionV1p1beta1EntityAnnotation 2248 var s1 struct { 2249 Confidence gensupport.JSONFloat64 `json:"confidence"` 2250 Score gensupport.JSONFloat64 `json:"score"` 2251 Topicality gensupport.JSONFloat64 `json:"topicality"` 2252 *NoMethod 2253 } 2254 s1.NoMethod = (*NoMethod)(s) 2255 if err := json.Unmarshal(data, &s1); err != nil { 2256 return err 2257 } 2258 s.Confidence = float64(s1.Confidence) 2259 s.Score = float64(s1.Score) 2260 s.Topicality = float64(s1.Topicality) 2261 return nil 2262} 2263 2264// GoogleCloudVisionV1p1beta1FaceAnnotation: A face annotation object 2265// contains the results of face detection. 2266type GoogleCloudVisionV1p1beta1FaceAnnotation struct { 2267 // AngerLikelihood: Anger likelihood. 2268 // 2269 // Possible values: 2270 // "UNKNOWN" - Unknown likelihood. 2271 // "VERY_UNLIKELY" - It is very unlikely. 2272 // "UNLIKELY" - It is unlikely. 2273 // "POSSIBLE" - It is possible. 2274 // "LIKELY" - It is likely. 2275 // "VERY_LIKELY" - It is very likely. 2276 AngerLikelihood string `json:"angerLikelihood,omitempty"` 2277 2278 // BlurredLikelihood: Blurred likelihood. 2279 // 2280 // Possible values: 2281 // "UNKNOWN" - Unknown likelihood. 2282 // "VERY_UNLIKELY" - It is very unlikely. 2283 // "UNLIKELY" - It is unlikely. 2284 // "POSSIBLE" - It is possible. 2285 // "LIKELY" - It is likely. 2286 // "VERY_LIKELY" - It is very likely. 2287 BlurredLikelihood string `json:"blurredLikelihood,omitempty"` 2288 2289 // BoundingPoly: The bounding polygon around the face. The coordinates 2290 // of the bounding box are in the original image's scale. The bounding 2291 // box is computed to "frame" the face in accordance with human 2292 // expectations. It is based on the landmarker results. Note that one or 2293 // more x and/or y coordinates may not be generated in the 2294 // `BoundingPoly` (the polygon will be unbounded) if only a partial face 2295 // appears in the image to be annotated. 2296 BoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingPoly,omitempty"` 2297 2298 // DetectionConfidence: Detection confidence. Range [0, 1]. 2299 DetectionConfidence float64 `json:"detectionConfidence,omitempty"` 2300 2301 // FdBoundingPoly: The `fd_bounding_poly` bounding polygon is tighter 2302 // than the `boundingPoly`, and encloses only the skin part of the face. 2303 // Typically, it is used to eliminate the face from any image analysis 2304 // that detects the "amount of skin" visible in an image. It is not 2305 // based on the landmarker results, only on the initial face detection, 2306 // hence the fd (face detection) prefix. 2307 FdBoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"fdBoundingPoly,omitempty"` 2308 2309 // HeadwearLikelihood: Headwear likelihood. 2310 // 2311 // Possible values: 2312 // "UNKNOWN" - Unknown likelihood. 2313 // "VERY_UNLIKELY" - It is very unlikely. 2314 // "UNLIKELY" - It is unlikely. 2315 // "POSSIBLE" - It is possible. 2316 // "LIKELY" - It is likely. 2317 // "VERY_LIKELY" - It is very likely. 2318 HeadwearLikelihood string `json:"headwearLikelihood,omitempty"` 2319 2320 // JoyLikelihood: Joy likelihood. 2321 // 2322 // Possible values: 2323 // "UNKNOWN" - Unknown likelihood. 2324 // "VERY_UNLIKELY" - It is very unlikely. 2325 // "UNLIKELY" - It is unlikely. 2326 // "POSSIBLE" - It is possible. 2327 // "LIKELY" - It is likely. 2328 // "VERY_LIKELY" - It is very likely. 2329 JoyLikelihood string `json:"joyLikelihood,omitempty"` 2330 2331 // LandmarkingConfidence: Face landmarking confidence. Range [0, 1]. 2332 LandmarkingConfidence float64 `json:"landmarkingConfidence,omitempty"` 2333 2334 // Landmarks: Detected face landmarks. 2335 Landmarks []*GoogleCloudVisionV1p1beta1FaceAnnotationLandmark `json:"landmarks,omitempty"` 2336 2337 // PanAngle: Yaw angle, which indicates the leftward/rightward angle 2338 // that the face is pointing relative to the vertical plane 2339 // perpendicular to the image. Range [-180,180]. 2340 PanAngle float64 `json:"panAngle,omitempty"` 2341 2342 // RollAngle: Roll angle, which indicates the amount of 2343 // clockwise/anti-clockwise rotation of the face relative to the image 2344 // vertical about the axis perpendicular to the face. Range [-180,180]. 2345 RollAngle float64 `json:"rollAngle,omitempty"` 2346 2347 // SorrowLikelihood: Sorrow likelihood. 2348 // 2349 // Possible values: 2350 // "UNKNOWN" - Unknown likelihood. 2351 // "VERY_UNLIKELY" - It is very unlikely. 2352 // "UNLIKELY" - It is unlikely. 2353 // "POSSIBLE" - It is possible. 2354 // "LIKELY" - It is likely. 2355 // "VERY_LIKELY" - It is very likely. 2356 SorrowLikelihood string `json:"sorrowLikelihood,omitempty"` 2357 2358 // SurpriseLikelihood: Surprise likelihood. 2359 // 2360 // Possible values: 2361 // "UNKNOWN" - Unknown likelihood. 2362 // "VERY_UNLIKELY" - It is very unlikely. 2363 // "UNLIKELY" - It is unlikely. 2364 // "POSSIBLE" - It is possible. 2365 // "LIKELY" - It is likely. 2366 // "VERY_LIKELY" - It is very likely. 2367 SurpriseLikelihood string `json:"surpriseLikelihood,omitempty"` 2368 2369 // TiltAngle: Pitch angle, which indicates the upwards/downwards angle 2370 // that the face is pointing relative to the image's horizontal plane. 2371 // Range [-180,180]. 2372 TiltAngle float64 `json:"tiltAngle,omitempty"` 2373 2374 // UnderExposedLikelihood: Under-exposed likelihood. 2375 // 2376 // Possible values: 2377 // "UNKNOWN" - Unknown likelihood. 2378 // "VERY_UNLIKELY" - It is very unlikely. 2379 // "UNLIKELY" - It is unlikely. 2380 // "POSSIBLE" - It is possible. 2381 // "LIKELY" - It is likely. 2382 // "VERY_LIKELY" - It is very likely. 2383 UnderExposedLikelihood string `json:"underExposedLikelihood,omitempty"` 2384 2385 // ForceSendFields is a list of field names (e.g. "AngerLikelihood") to 2386 // unconditionally include in API requests. By default, fields with 2387 // empty values are omitted from API requests. However, any non-pointer, 2388 // non-interface field appearing in ForceSendFields will be sent to the 2389 // server regardless of whether the field is empty or not. This may be 2390 // used to include empty fields in Patch requests. 2391 ForceSendFields []string `json:"-"` 2392 2393 // NullFields is a list of field names (e.g. "AngerLikelihood") to 2394 // include in API requests with the JSON null value. By default, fields 2395 // with empty values are omitted from API requests. However, any field 2396 // with an empty value appearing in NullFields will be sent to the 2397 // server as null. It is an error if a field in this list has a 2398 // non-empty value. This may be used to include null fields in Patch 2399 // requests. 2400 NullFields []string `json:"-"` 2401} 2402 2403func (s *GoogleCloudVisionV1p1beta1FaceAnnotation) MarshalJSON() ([]byte, error) { 2404 type NoMethod GoogleCloudVisionV1p1beta1FaceAnnotation 2405 raw := NoMethod(*s) 2406 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2407} 2408 2409func (s *GoogleCloudVisionV1p1beta1FaceAnnotation) UnmarshalJSON(data []byte) error { 2410 type NoMethod GoogleCloudVisionV1p1beta1FaceAnnotation 2411 var s1 struct { 2412 DetectionConfidence gensupport.JSONFloat64 `json:"detectionConfidence"` 2413 LandmarkingConfidence gensupport.JSONFloat64 `json:"landmarkingConfidence"` 2414 PanAngle gensupport.JSONFloat64 `json:"panAngle"` 2415 RollAngle gensupport.JSONFloat64 `json:"rollAngle"` 2416 TiltAngle gensupport.JSONFloat64 `json:"tiltAngle"` 2417 *NoMethod 2418 } 2419 s1.NoMethod = (*NoMethod)(s) 2420 if err := json.Unmarshal(data, &s1); err != nil { 2421 return err 2422 } 2423 s.DetectionConfidence = float64(s1.DetectionConfidence) 2424 s.LandmarkingConfidence = float64(s1.LandmarkingConfidence) 2425 s.PanAngle = float64(s1.PanAngle) 2426 s.RollAngle = float64(s1.RollAngle) 2427 s.TiltAngle = float64(s1.TiltAngle) 2428 return nil 2429} 2430 2431// GoogleCloudVisionV1p1beta1FaceAnnotationLandmark: A face-specific 2432// landmark (for example, a face feature). 2433type GoogleCloudVisionV1p1beta1FaceAnnotationLandmark struct { 2434 // Position: Face landmark position. 2435 Position *GoogleCloudVisionV1p1beta1Position `json:"position,omitempty"` 2436 2437 // Type: Face landmark type. 2438 // 2439 // Possible values: 2440 // "UNKNOWN_LANDMARK" - Unknown face landmark detected. Should not be 2441 // filled. 2442 // "LEFT_EYE" - Left eye. 2443 // "RIGHT_EYE" - Right eye. 2444 // "LEFT_OF_LEFT_EYEBROW" - Left of left eyebrow. 2445 // "RIGHT_OF_LEFT_EYEBROW" - Right of left eyebrow. 2446 // "LEFT_OF_RIGHT_EYEBROW" - Left of right eyebrow. 2447 // "RIGHT_OF_RIGHT_EYEBROW" - Right of right eyebrow. 2448 // "MIDPOINT_BETWEEN_EYES" - Midpoint between eyes. 2449 // "NOSE_TIP" - Nose tip. 2450 // "UPPER_LIP" - Upper lip. 2451 // "LOWER_LIP" - Lower lip. 2452 // "MOUTH_LEFT" - Mouth left. 2453 // "MOUTH_RIGHT" - Mouth right. 2454 // "MOUTH_CENTER" - Mouth center. 2455 // "NOSE_BOTTOM_RIGHT" - Nose, bottom right. 2456 // "NOSE_BOTTOM_LEFT" - Nose, bottom left. 2457 // "NOSE_BOTTOM_CENTER" - Nose, bottom center. 2458 // "LEFT_EYE_TOP_BOUNDARY" - Left eye, top boundary. 2459 // "LEFT_EYE_RIGHT_CORNER" - Left eye, right corner. 2460 // "LEFT_EYE_BOTTOM_BOUNDARY" - Left eye, bottom boundary. 2461 // "LEFT_EYE_LEFT_CORNER" - Left eye, left corner. 2462 // "RIGHT_EYE_TOP_BOUNDARY" - Right eye, top boundary. 2463 // "RIGHT_EYE_RIGHT_CORNER" - Right eye, right corner. 2464 // "RIGHT_EYE_BOTTOM_BOUNDARY" - Right eye, bottom boundary. 2465 // "RIGHT_EYE_LEFT_CORNER" - Right eye, left corner. 2466 // "LEFT_EYEBROW_UPPER_MIDPOINT" - Left eyebrow, upper midpoint. 2467 // "RIGHT_EYEBROW_UPPER_MIDPOINT" - Right eyebrow, upper midpoint. 2468 // "LEFT_EAR_TRAGION" - Left ear tragion. 2469 // "RIGHT_EAR_TRAGION" - Right ear tragion. 2470 // "LEFT_EYE_PUPIL" - Left eye pupil. 2471 // "RIGHT_EYE_PUPIL" - Right eye pupil. 2472 // "FOREHEAD_GLABELLA" - Forehead glabella. 2473 // "CHIN_GNATHION" - Chin gnathion. 2474 // "CHIN_LEFT_GONION" - Chin left gonion. 2475 // "CHIN_RIGHT_GONION" - Chin right gonion. 2476 // "LEFT_CHEEK_CENTER" - Left cheek center. 2477 // "RIGHT_CHEEK_CENTER" - Right cheek center. 2478 Type string `json:"type,omitempty"` 2479 2480 // ForceSendFields is a list of field names (e.g. "Position") to 2481 // unconditionally include in API requests. By default, fields with 2482 // empty values are omitted from API requests. However, any non-pointer, 2483 // non-interface field appearing in ForceSendFields will be sent to the 2484 // server regardless of whether the field is empty or not. This may be 2485 // used to include empty fields in Patch requests. 2486 ForceSendFields []string `json:"-"` 2487 2488 // NullFields is a list of field names (e.g. "Position") to include in 2489 // API requests with the JSON null value. By default, fields with empty 2490 // values are omitted from API requests. However, any field with an 2491 // empty value appearing in NullFields will be sent to the server as 2492 // null. It is an error if a field in this list has a non-empty value. 2493 // This may be used to include null fields in Patch requests. 2494 NullFields []string `json:"-"` 2495} 2496 2497func (s *GoogleCloudVisionV1p1beta1FaceAnnotationLandmark) MarshalJSON() ([]byte, error) { 2498 type NoMethod GoogleCloudVisionV1p1beta1FaceAnnotationLandmark 2499 raw := NoMethod(*s) 2500 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2501} 2502 2503// GoogleCloudVisionV1p1beta1Feature: The type of Google Cloud Vision 2504// API detection to perform, and the maximum number of results to return 2505// for that type. Multiple `Feature` objects can be specified in the 2506// `features` list. 2507type GoogleCloudVisionV1p1beta1Feature struct { 2508 // MaxResults: Maximum number of results of this type. Does not apply to 2509 // `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`. 2510 MaxResults int64 `json:"maxResults,omitempty"` 2511 2512 // Model: Model to use for the feature. Supported values: 2513 // "builtin/stable" (the default if unset) and "builtin/latest". 2514 Model string `json:"model,omitempty"` 2515 2516 // Type: The feature type. 2517 // 2518 // Possible values: 2519 // "TYPE_UNSPECIFIED" - Unspecified feature type. 2520 // "FACE_DETECTION" - Run face detection. 2521 // "LANDMARK_DETECTION" - Run landmark detection. 2522 // "LOGO_DETECTION" - Run logo detection. 2523 // "LABEL_DETECTION" - Run label detection. 2524 // "TEXT_DETECTION" - Run text detection / optical character 2525 // recognition (OCR). Text detection is optimized for areas of text 2526 // within a larger image; if the image is a document, use 2527 // `DOCUMENT_TEXT_DETECTION` instead. 2528 // "DOCUMENT_TEXT_DETECTION" - Run dense text document OCR. Takes 2529 // precedence when both `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` 2530 // are present. 2531 // "SAFE_SEARCH_DETECTION" - Run Safe Search to detect potentially 2532 // unsafe or undesirable content. 2533 // "IMAGE_PROPERTIES" - Compute a set of image properties, such as the 2534 // image's dominant colors. 2535 // "CROP_HINTS" - Run crop hints. 2536 // "WEB_DETECTION" - Run web detection. 2537 // "PRODUCT_SEARCH" - Run Product Search. 2538 // "OBJECT_LOCALIZATION" - Run localizer for object detection. 2539 Type string `json:"type,omitempty"` 2540 2541 // ForceSendFields is a list of field names (e.g. "MaxResults") to 2542 // unconditionally include in API requests. By default, fields with 2543 // empty values are omitted from API requests. However, any non-pointer, 2544 // non-interface field appearing in ForceSendFields will be sent to the 2545 // server regardless of whether the field is empty or not. This may be 2546 // used to include empty fields in Patch requests. 2547 ForceSendFields []string `json:"-"` 2548 2549 // NullFields is a list of field names (e.g. "MaxResults") to include in 2550 // API requests with the JSON null value. By default, fields with empty 2551 // values are omitted from API requests. However, any field with an 2552 // empty value appearing in NullFields will be sent to the server as 2553 // null. It is an error if a field in this list has a non-empty value. 2554 // This may be used to include null fields in Patch requests. 2555 NullFields []string `json:"-"` 2556} 2557 2558func (s *GoogleCloudVisionV1p1beta1Feature) MarshalJSON() ([]byte, error) { 2559 type NoMethod GoogleCloudVisionV1p1beta1Feature 2560 raw := NoMethod(*s) 2561 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2562} 2563 2564// GoogleCloudVisionV1p1beta1GcsDestination: The Google Cloud Storage 2565// location where the output will be written to. 2566type GoogleCloudVisionV1p1beta1GcsDestination struct { 2567 // Uri: Google Cloud Storage URI prefix where the results will be 2568 // stored. Results will be in JSON format and preceded by its 2569 // corresponding input URI prefix. This field can either represent a gcs 2570 // file prefix or gcs directory. In either case, the uri should be 2571 // unique because in order to get all of the output files, you will need 2572 // to do a wildcard gcs search on the uri prefix you provide. Examples: 2573 // * File Prefix: gs://bucket-name/here/filenameprefix The output files 2574 // will be created in gs://bucket-name/here/ and the names of the output 2575 // files will begin with "filenameprefix". * Directory Prefix: 2576 // gs://bucket-name/some/location/ The output files will be created in 2577 // gs://bucket-name/some/location/ and the names of the output files 2578 // could be anything because there was no filename prefix specified. If 2579 // multiple outputs, each response is still AnnotateFileResponse, each 2580 // of which contains some subset of the full list of 2581 // AnnotateImageResponse. Multiple outputs can happen if, for example, 2582 // the output JSON is too large and overflows into multiple sharded 2583 // files. 2584 Uri string `json:"uri,omitempty"` 2585 2586 // ForceSendFields is a list of field names (e.g. "Uri") to 2587 // unconditionally include in API requests. By default, fields with 2588 // empty values are omitted from API requests. However, any non-pointer, 2589 // non-interface field appearing in ForceSendFields will be sent to the 2590 // server regardless of whether the field is empty or not. This may be 2591 // used to include empty fields in Patch requests. 2592 ForceSendFields []string `json:"-"` 2593 2594 // NullFields is a list of field names (e.g. "Uri") to include in API 2595 // requests with the JSON null value. By default, fields with empty 2596 // values are omitted from API requests. However, any field with an 2597 // empty value appearing in NullFields will be sent to the server as 2598 // null. It is an error if a field in this list has a non-empty value. 2599 // This may be used to include null fields in Patch requests. 2600 NullFields []string `json:"-"` 2601} 2602 2603func (s *GoogleCloudVisionV1p1beta1GcsDestination) MarshalJSON() ([]byte, error) { 2604 type NoMethod GoogleCloudVisionV1p1beta1GcsDestination 2605 raw := NoMethod(*s) 2606 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2607} 2608 2609// GoogleCloudVisionV1p1beta1GcsSource: The Google Cloud Storage 2610// location where the input will be read from. 2611type GoogleCloudVisionV1p1beta1GcsSource struct { 2612 // Uri: Google Cloud Storage URI for the input file. This must only be a 2613 // Google Cloud Storage object. Wildcards are not currently supported. 2614 Uri string `json:"uri,omitempty"` 2615 2616 // ForceSendFields is a list of field names (e.g. "Uri") to 2617 // unconditionally include in API requests. By default, fields with 2618 // empty values are omitted from API requests. However, any non-pointer, 2619 // non-interface field appearing in ForceSendFields will be sent to the 2620 // server regardless of whether the field is empty or not. This may be 2621 // used to include empty fields in Patch requests. 2622 ForceSendFields []string `json:"-"` 2623 2624 // NullFields is a list of field names (e.g. "Uri") to include in API 2625 // requests with the JSON null value. By default, fields with empty 2626 // values are omitted from API requests. However, any field with an 2627 // empty value appearing in NullFields will be sent to the server as 2628 // null. It is an error if a field in this list has a non-empty value. 2629 // This may be used to include null fields in Patch requests. 2630 NullFields []string `json:"-"` 2631} 2632 2633func (s *GoogleCloudVisionV1p1beta1GcsSource) MarshalJSON() ([]byte, error) { 2634 type NoMethod GoogleCloudVisionV1p1beta1GcsSource 2635 raw := NoMethod(*s) 2636 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2637} 2638 2639// GoogleCloudVisionV1p1beta1Image: Client image to perform Google Cloud 2640// Vision API tasks over. 2641type GoogleCloudVisionV1p1beta1Image struct { 2642 // Content: Image content, represented as a stream of bytes. Note: As 2643 // with all `bytes` fields, protobuffers use a pure binary 2644 // representation, whereas JSON representations use base64. Currently, 2645 // this field only works for BatchAnnotateImages requests. It does not 2646 // work for AsyncBatchAnnotateImages requests. 2647 Content string `json:"content,omitempty"` 2648 2649 // Source: Google Cloud Storage image location, or publicly-accessible 2650 // image URL. If both `content` and `source` are provided for an image, 2651 // `content` takes precedence and is used to perform the image 2652 // annotation request. 2653 Source *GoogleCloudVisionV1p1beta1ImageSource `json:"source,omitempty"` 2654 2655 // ForceSendFields is a list of field names (e.g. "Content") to 2656 // unconditionally include in API requests. By default, fields with 2657 // empty values are omitted from API requests. However, any non-pointer, 2658 // non-interface field appearing in ForceSendFields will be sent to the 2659 // server regardless of whether the field is empty or not. This may be 2660 // used to include empty fields in Patch requests. 2661 ForceSendFields []string `json:"-"` 2662 2663 // NullFields is a list of field names (e.g. "Content") to include in 2664 // API requests with the JSON null value. By default, fields with empty 2665 // values are omitted from API requests. However, any field with an 2666 // empty value appearing in NullFields will be sent to the server as 2667 // null. It is an error if a field in this list has a non-empty value. 2668 // This may be used to include null fields in Patch requests. 2669 NullFields []string `json:"-"` 2670} 2671 2672func (s *GoogleCloudVisionV1p1beta1Image) MarshalJSON() ([]byte, error) { 2673 type NoMethod GoogleCloudVisionV1p1beta1Image 2674 raw := NoMethod(*s) 2675 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2676} 2677 2678// GoogleCloudVisionV1p1beta1ImageAnnotationContext: If an image was 2679// produced from a file (e.g. a PDF), this message gives information 2680// about the source of that image. 2681type GoogleCloudVisionV1p1beta1ImageAnnotationContext struct { 2682 // PageNumber: If the file was a PDF or TIFF, this field gives the page 2683 // number within the file used to produce the image. 2684 PageNumber int64 `json:"pageNumber,omitempty"` 2685 2686 // Uri: The URI of the file used to produce the image. 2687 Uri string `json:"uri,omitempty"` 2688 2689 // ForceSendFields is a list of field names (e.g. "PageNumber") to 2690 // unconditionally include in API requests. By default, fields with 2691 // empty values are omitted from API requests. However, any non-pointer, 2692 // non-interface field appearing in ForceSendFields will be sent to the 2693 // server regardless of whether the field is empty or not. This may be 2694 // used to include empty fields in Patch requests. 2695 ForceSendFields []string `json:"-"` 2696 2697 // NullFields is a list of field names (e.g. "PageNumber") to include in 2698 // API requests with the JSON null value. By default, fields with empty 2699 // values are omitted from API requests. However, any field with an 2700 // empty value appearing in NullFields will be sent to the server as 2701 // null. It is an error if a field in this list has a non-empty value. 2702 // This may be used to include null fields in Patch requests. 2703 NullFields []string `json:"-"` 2704} 2705 2706func (s *GoogleCloudVisionV1p1beta1ImageAnnotationContext) MarshalJSON() ([]byte, error) { 2707 type NoMethod GoogleCloudVisionV1p1beta1ImageAnnotationContext 2708 raw := NoMethod(*s) 2709 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2710} 2711 2712// GoogleCloudVisionV1p1beta1ImageContext: Image context and/or 2713// feature-specific parameters. 2714type GoogleCloudVisionV1p1beta1ImageContext struct { 2715 // CropHintsParams: Parameters for crop hints annotation request. 2716 CropHintsParams *GoogleCloudVisionV1p1beta1CropHintsParams `json:"cropHintsParams,omitempty"` 2717 2718 // LanguageHints: List of languages to use for TEXT_DETECTION. In most 2719 // cases, an empty value yields the best results since it enables 2720 // automatic language detection. For languages based on the Latin 2721 // alphabet, setting `language_hints` is not needed. In rare cases, when 2722 // the language of the text in the image is known, setting a hint will 2723 // help get better results (although it will be a significant hindrance 2724 // if the hint is wrong). Text detection returns an error if one or more 2725 // of the specified languages is not one of the supported languages 2726 // (https://cloud.google.com/vision/docs/languages). 2727 LanguageHints []string `json:"languageHints,omitempty"` 2728 2729 // LatLongRect: Not used. 2730 LatLongRect *GoogleCloudVisionV1p1beta1LatLongRect `json:"latLongRect,omitempty"` 2731 2732 // ProductSearchParams: Parameters for product search. 2733 ProductSearchParams *GoogleCloudVisionV1p1beta1ProductSearchParams `json:"productSearchParams,omitempty"` 2734 2735 // TextDetectionParams: Parameters for text detection and document text 2736 // detection. 2737 TextDetectionParams *GoogleCloudVisionV1p1beta1TextDetectionParams `json:"textDetectionParams,omitempty"` 2738 2739 // WebDetectionParams: Parameters for web detection. 2740 WebDetectionParams *GoogleCloudVisionV1p1beta1WebDetectionParams `json:"webDetectionParams,omitempty"` 2741 2742 // ForceSendFields is a list of field names (e.g. "CropHintsParams") to 2743 // unconditionally include in API requests. By default, fields with 2744 // empty values are omitted from API requests. However, any non-pointer, 2745 // non-interface field appearing in ForceSendFields will be sent to the 2746 // server regardless of whether the field is empty or not. This may be 2747 // used to include empty fields in Patch requests. 2748 ForceSendFields []string `json:"-"` 2749 2750 // NullFields is a list of field names (e.g. "CropHintsParams") to 2751 // include in API requests with the JSON null value. By default, fields 2752 // with empty values are omitted from API requests. However, any field 2753 // with an empty value appearing in NullFields will be sent to the 2754 // server as null. It is an error if a field in this list has a 2755 // non-empty value. This may be used to include null fields in Patch 2756 // requests. 2757 NullFields []string `json:"-"` 2758} 2759 2760func (s *GoogleCloudVisionV1p1beta1ImageContext) MarshalJSON() ([]byte, error) { 2761 type NoMethod GoogleCloudVisionV1p1beta1ImageContext 2762 raw := NoMethod(*s) 2763 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2764} 2765 2766// GoogleCloudVisionV1p1beta1ImageProperties: Stores image properties, 2767// such as dominant colors. 2768type GoogleCloudVisionV1p1beta1ImageProperties struct { 2769 // DominantColors: If present, dominant colors completed successfully. 2770 DominantColors *GoogleCloudVisionV1p1beta1DominantColorsAnnotation `json:"dominantColors,omitempty"` 2771 2772 // ForceSendFields is a list of field names (e.g. "DominantColors") to 2773 // unconditionally include in API requests. By default, fields with 2774 // empty values are omitted from API requests. However, any non-pointer, 2775 // non-interface field appearing in ForceSendFields will be sent to the 2776 // server regardless of whether the field is empty or not. This may be 2777 // used to include empty fields in Patch requests. 2778 ForceSendFields []string `json:"-"` 2779 2780 // NullFields is a list of field names (e.g. "DominantColors") to 2781 // include in API requests with the JSON null value. By default, fields 2782 // with empty values are omitted from API requests. However, any field 2783 // with an empty value appearing in NullFields will be sent to the 2784 // server as null. It is an error if a field in this list has a 2785 // non-empty value. This may be used to include null fields in Patch 2786 // requests. 2787 NullFields []string `json:"-"` 2788} 2789 2790func (s *GoogleCloudVisionV1p1beta1ImageProperties) MarshalJSON() ([]byte, error) { 2791 type NoMethod GoogleCloudVisionV1p1beta1ImageProperties 2792 raw := NoMethod(*s) 2793 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2794} 2795 2796// GoogleCloudVisionV1p1beta1ImageSource: External image source (Google 2797// Cloud Storage or web URL image location). 2798type GoogleCloudVisionV1p1beta1ImageSource struct { 2799 // GcsImageUri: **Use `image_uri` instead.** The Google Cloud Storage 2800 // URI of the form `gs://bucket_name/object_name`. Object versioning is 2801 // not supported. See Google Cloud Storage Request URIs 2802 // (https://cloud.google.com/storage/docs/reference-uris) for more info. 2803 GcsImageUri string `json:"gcsImageUri,omitempty"` 2804 2805 // ImageUri: The URI of the source image. Can be either: 1. A Google 2806 // Cloud Storage URI of the form `gs://bucket_name/object_name`. Object 2807 // versioning is not supported. See Google Cloud Storage Request URIs 2808 // (https://cloud.google.com/storage/docs/reference-uris) for more info. 2809 // 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images 2810 // from HTTP/HTTPS URLs, Google cannot guarantee that the request will 2811 // be completed. Your request may fail if the specified host denies the 2812 // request (e.g. due to request throttling or DOS prevention), or if 2813 // Google throttles requests to the site for abuse prevention. You 2814 // should not depend on externally-hosted images for production 2815 // applications. When both `gcs_image_uri` and `image_uri` are 2816 // specified, `image_uri` takes precedence. 2817 ImageUri string `json:"imageUri,omitempty"` 2818 2819 // ForceSendFields is a list of field names (e.g. "GcsImageUri") to 2820 // unconditionally include in API requests. By default, fields with 2821 // empty values are omitted from API requests. However, any non-pointer, 2822 // non-interface field appearing in ForceSendFields will be sent to the 2823 // server regardless of whether the field is empty or not. This may be 2824 // used to include empty fields in Patch requests. 2825 ForceSendFields []string `json:"-"` 2826 2827 // NullFields is a list of field names (e.g. "GcsImageUri") to include 2828 // in API requests with the JSON null value. By default, fields with 2829 // empty values are omitted from API requests. However, any field with 2830 // an empty value appearing in NullFields will be sent to the server as 2831 // null. It is an error if a field in this list has a non-empty value. 2832 // This may be used to include null fields in Patch requests. 2833 NullFields []string `json:"-"` 2834} 2835 2836func (s *GoogleCloudVisionV1p1beta1ImageSource) MarshalJSON() ([]byte, error) { 2837 type NoMethod GoogleCloudVisionV1p1beta1ImageSource 2838 raw := NoMethod(*s) 2839 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2840} 2841 2842// GoogleCloudVisionV1p1beta1InputConfig: The desired input location and 2843// metadata. 2844type GoogleCloudVisionV1p1beta1InputConfig struct { 2845 // Content: File content, represented as a stream of bytes. Note: As 2846 // with all `bytes` fields, protobuffers use a pure binary 2847 // representation, whereas JSON representations use base64. Currently, 2848 // this field only works for BatchAnnotateFiles requests. It does not 2849 // work for AsyncBatchAnnotateFiles requests. 2850 Content string `json:"content,omitempty"` 2851 2852 // GcsSource: The Google Cloud Storage location to read the input from. 2853 GcsSource *GoogleCloudVisionV1p1beta1GcsSource `json:"gcsSource,omitempty"` 2854 2855 // MimeType: The type of the file. Currently only "application/pdf", 2856 // "image/tiff" and "image/gif" are supported. Wildcards are not 2857 // supported. 2858 MimeType string `json:"mimeType,omitempty"` 2859 2860 // ForceSendFields is a list of field names (e.g. "Content") to 2861 // unconditionally include in API requests. By default, fields with 2862 // empty values are omitted from API requests. However, any non-pointer, 2863 // non-interface field appearing in ForceSendFields will be sent to the 2864 // server regardless of whether the field is empty or not. This may be 2865 // used to include empty fields in Patch requests. 2866 ForceSendFields []string `json:"-"` 2867 2868 // NullFields is a list of field names (e.g. "Content") to include in 2869 // API requests with the JSON null value. By default, fields with empty 2870 // values are omitted from API requests. However, any field with an 2871 // empty value appearing in NullFields will be sent to the server as 2872 // null. It is an error if a field in this list has a non-empty value. 2873 // This may be used to include null fields in Patch requests. 2874 NullFields []string `json:"-"` 2875} 2876 2877func (s *GoogleCloudVisionV1p1beta1InputConfig) MarshalJSON() ([]byte, error) { 2878 type NoMethod GoogleCloudVisionV1p1beta1InputConfig 2879 raw := NoMethod(*s) 2880 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2881} 2882 2883// GoogleCloudVisionV1p1beta1LatLongRect: Rectangle determined by min 2884// and max `LatLng` pairs. 2885type GoogleCloudVisionV1p1beta1LatLongRect struct { 2886 // MaxLatLng: Max lat/long pair. 2887 MaxLatLng *LatLng `json:"maxLatLng,omitempty"` 2888 2889 // MinLatLng: Min lat/long pair. 2890 MinLatLng *LatLng `json:"minLatLng,omitempty"` 2891 2892 // ForceSendFields is a list of field names (e.g. "MaxLatLng") to 2893 // unconditionally include in API requests. By default, fields with 2894 // empty values are omitted from API requests. However, any non-pointer, 2895 // non-interface field appearing in ForceSendFields will be sent to the 2896 // server regardless of whether the field is empty or not. This may be 2897 // used to include empty fields in Patch requests. 2898 ForceSendFields []string `json:"-"` 2899 2900 // NullFields is a list of field names (e.g. "MaxLatLng") to include in 2901 // API requests with the JSON null value. By default, fields with empty 2902 // values are omitted from API requests. However, any field with an 2903 // empty value appearing in NullFields will be sent to the server as 2904 // null. It is an error if a field in this list has a non-empty value. 2905 // This may be used to include null fields in Patch requests. 2906 NullFields []string `json:"-"` 2907} 2908 2909func (s *GoogleCloudVisionV1p1beta1LatLongRect) MarshalJSON() ([]byte, error) { 2910 type NoMethod GoogleCloudVisionV1p1beta1LatLongRect 2911 raw := NoMethod(*s) 2912 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2913} 2914 2915// GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation: Set of detected 2916// objects with bounding boxes. 2917type GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation struct { 2918 // BoundingPoly: Image region to which this object belongs. This must be 2919 // populated. 2920 BoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingPoly,omitempty"` 2921 2922 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". 2923 // For more information, see 2924 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 2925 LanguageCode string `json:"languageCode,omitempty"` 2926 2927 // Mid: Object ID that should align with EntityAnnotation mid. 2928 Mid string `json:"mid,omitempty"` 2929 2930 // Name: Object name, expressed in its `language_code` language. 2931 Name string `json:"name,omitempty"` 2932 2933 // Score: Score of the result. Range [0, 1]. 2934 Score float64 `json:"score,omitempty"` 2935 2936 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 2937 // unconditionally include in API requests. By default, fields with 2938 // empty values are omitted from API requests. However, any non-pointer, 2939 // non-interface field appearing in ForceSendFields will be sent to the 2940 // server regardless of whether the field is empty or not. This may be 2941 // used to include empty fields in Patch requests. 2942 ForceSendFields []string `json:"-"` 2943 2944 // NullFields is a list of field names (e.g. "BoundingPoly") to include 2945 // in API requests with the JSON null value. By default, fields with 2946 // empty values are omitted from API requests. However, any field with 2947 // an empty value appearing in NullFields will be sent to the server as 2948 // null. It is an error if a field in this list has a non-empty value. 2949 // This may be used to include null fields in Patch requests. 2950 NullFields []string `json:"-"` 2951} 2952 2953func (s *GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation) MarshalJSON() ([]byte, error) { 2954 type NoMethod GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation 2955 raw := NoMethod(*s) 2956 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2957} 2958 2959func (s *GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation) UnmarshalJSON(data []byte) error { 2960 type NoMethod GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation 2961 var s1 struct { 2962 Score gensupport.JSONFloat64 `json:"score"` 2963 *NoMethod 2964 } 2965 s1.NoMethod = (*NoMethod)(s) 2966 if err := json.Unmarshal(data, &s1); err != nil { 2967 return err 2968 } 2969 s.Score = float64(s1.Score) 2970 return nil 2971} 2972 2973// GoogleCloudVisionV1p1beta1LocationInfo: Detected entity location 2974// information. 2975type GoogleCloudVisionV1p1beta1LocationInfo struct { 2976 // LatLng: lat/long location coordinates. 2977 LatLng *LatLng `json:"latLng,omitempty"` 2978 2979 // ForceSendFields is a list of field names (e.g. "LatLng") to 2980 // unconditionally include in API requests. By default, fields with 2981 // empty values are omitted from API requests. However, any non-pointer, 2982 // non-interface field appearing in ForceSendFields will be sent to the 2983 // server regardless of whether the field is empty or not. This may be 2984 // used to include empty fields in Patch requests. 2985 ForceSendFields []string `json:"-"` 2986 2987 // NullFields is a list of field names (e.g. "LatLng") to include in API 2988 // requests with the JSON null value. By default, fields with empty 2989 // values are omitted from API requests. However, any field with an 2990 // empty value appearing in NullFields will be sent to the server as 2991 // null. It is an error if a field in this list has a non-empty value. 2992 // This may be used to include null fields in Patch requests. 2993 NullFields []string `json:"-"` 2994} 2995 2996func (s *GoogleCloudVisionV1p1beta1LocationInfo) MarshalJSON() ([]byte, error) { 2997 type NoMethod GoogleCloudVisionV1p1beta1LocationInfo 2998 raw := NoMethod(*s) 2999 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3000} 3001 3002// GoogleCloudVisionV1p1beta1NormalizedVertex: A vertex represents a 2D 3003// point in the image. NOTE: the normalized vertex coordinates are 3004// relative to the original image and range from 0 to 1. 3005type GoogleCloudVisionV1p1beta1NormalizedVertex struct { 3006 // X: X coordinate. 3007 X float64 `json:"x,omitempty"` 3008 3009 // Y: Y coordinate. 3010 Y float64 `json:"y,omitempty"` 3011 3012 // ForceSendFields is a list of field names (e.g. "X") to 3013 // unconditionally include in API requests. By default, fields with 3014 // empty values are omitted from API requests. However, any non-pointer, 3015 // non-interface field appearing in ForceSendFields will be sent to the 3016 // server regardless of whether the field is empty or not. This may be 3017 // used to include empty fields in Patch requests. 3018 ForceSendFields []string `json:"-"` 3019 3020 // NullFields is a list of field names (e.g. "X") to include in API 3021 // requests with the JSON null value. By default, fields with empty 3022 // values are omitted from API requests. However, any field with an 3023 // empty value appearing in NullFields will be sent to the server as 3024 // null. It is an error if a field in this list has a non-empty value. 3025 // This may be used to include null fields in Patch requests. 3026 NullFields []string `json:"-"` 3027} 3028 3029func (s *GoogleCloudVisionV1p1beta1NormalizedVertex) MarshalJSON() ([]byte, error) { 3030 type NoMethod GoogleCloudVisionV1p1beta1NormalizedVertex 3031 raw := NoMethod(*s) 3032 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3033} 3034 3035func (s *GoogleCloudVisionV1p1beta1NormalizedVertex) UnmarshalJSON(data []byte) error { 3036 type NoMethod GoogleCloudVisionV1p1beta1NormalizedVertex 3037 var s1 struct { 3038 X gensupport.JSONFloat64 `json:"x"` 3039 Y gensupport.JSONFloat64 `json:"y"` 3040 *NoMethod 3041 } 3042 s1.NoMethod = (*NoMethod)(s) 3043 if err := json.Unmarshal(data, &s1); err != nil { 3044 return err 3045 } 3046 s.X = float64(s1.X) 3047 s.Y = float64(s1.Y) 3048 return nil 3049} 3050 3051// GoogleCloudVisionV1p1beta1OperationMetadata: Contains metadata for 3052// the BatchAnnotateImages operation. 3053type GoogleCloudVisionV1p1beta1OperationMetadata struct { 3054 // CreateTime: The time when the batch request was received. 3055 CreateTime string `json:"createTime,omitempty"` 3056 3057 // State: Current state of the batch operation. 3058 // 3059 // Possible values: 3060 // "STATE_UNSPECIFIED" - Invalid. 3061 // "CREATED" - Request is received. 3062 // "RUNNING" - Request is actively being processed. 3063 // "DONE" - The batch processing is done. 3064 // "CANCELLED" - The batch processing was cancelled. 3065 State string `json:"state,omitempty"` 3066 3067 // UpdateTime: The time when the operation result was last updated. 3068 UpdateTime string `json:"updateTime,omitempty"` 3069 3070 // ForceSendFields is a list of field names (e.g. "CreateTime") to 3071 // unconditionally include in API requests. By default, fields with 3072 // empty values are omitted from API requests. However, any non-pointer, 3073 // non-interface field appearing in ForceSendFields will be sent to the 3074 // server regardless of whether the field is empty or not. This may be 3075 // used to include empty fields in Patch requests. 3076 ForceSendFields []string `json:"-"` 3077 3078 // NullFields is a list of field names (e.g. "CreateTime") to include in 3079 // API requests with the JSON null value. By default, fields with empty 3080 // values are omitted from API requests. However, any field with an 3081 // empty value appearing in NullFields will be sent to the server as 3082 // null. It is an error if a field in this list has a non-empty value. 3083 // This may be used to include null fields in Patch requests. 3084 NullFields []string `json:"-"` 3085} 3086 3087func (s *GoogleCloudVisionV1p1beta1OperationMetadata) MarshalJSON() ([]byte, error) { 3088 type NoMethod GoogleCloudVisionV1p1beta1OperationMetadata 3089 raw := NoMethod(*s) 3090 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3091} 3092 3093// GoogleCloudVisionV1p1beta1OutputConfig: The desired output location 3094// and metadata. 3095type GoogleCloudVisionV1p1beta1OutputConfig struct { 3096 // BatchSize: The max number of response protos to put into each output 3097 // JSON file on Google Cloud Storage. The valid range is [1, 100]. If 3098 // not specified, the default value is 20. For example, for one pdf file 3099 // with 100 pages, 100 response protos will be generated. If 3100 // `batch_size` = 20, then 5 json files each containing 20 response 3101 // protos will be written under the prefix `gcs_destination`.`uri`. 3102 // Currently, batch_size only applies to GcsDestination, with potential 3103 // future support for other output configurations. 3104 BatchSize int64 `json:"batchSize,omitempty"` 3105 3106 // GcsDestination: The Google Cloud Storage location to write the 3107 // output(s) to. 3108 GcsDestination *GoogleCloudVisionV1p1beta1GcsDestination `json:"gcsDestination,omitempty"` 3109 3110 // ForceSendFields is a list of field names (e.g. "BatchSize") to 3111 // unconditionally include in API requests. By default, fields with 3112 // empty values are omitted from API requests. However, any non-pointer, 3113 // non-interface field appearing in ForceSendFields will be sent to the 3114 // server regardless of whether the field is empty or not. This may be 3115 // used to include empty fields in Patch requests. 3116 ForceSendFields []string `json:"-"` 3117 3118 // NullFields is a list of field names (e.g. "BatchSize") to include in 3119 // API requests with the JSON null value. By default, fields with empty 3120 // values are omitted from API requests. However, any field with an 3121 // empty value appearing in NullFields will be sent to the server as 3122 // null. It is an error if a field in this list has a non-empty value. 3123 // This may be used to include null fields in Patch requests. 3124 NullFields []string `json:"-"` 3125} 3126 3127func (s *GoogleCloudVisionV1p1beta1OutputConfig) MarshalJSON() ([]byte, error) { 3128 type NoMethod GoogleCloudVisionV1p1beta1OutputConfig 3129 raw := NoMethod(*s) 3130 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3131} 3132 3133// GoogleCloudVisionV1p1beta1Page: Detected page from OCR. 3134type GoogleCloudVisionV1p1beta1Page struct { 3135 // Blocks: List of blocks of text, images etc on this page. 3136 Blocks []*GoogleCloudVisionV1p1beta1Block `json:"blocks,omitempty"` 3137 3138 // Confidence: Confidence of the OCR results on the page. Range [0, 1]. 3139 Confidence float64 `json:"confidence,omitempty"` 3140 3141 // Height: Page height. For PDFs the unit is points. For images 3142 // (including TIFFs) the unit is pixels. 3143 Height int64 `json:"height,omitempty"` 3144 3145 // Property: Additional information detected on the page. 3146 Property *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty `json:"property,omitempty"` 3147 3148 // Width: Page width. For PDFs the unit is points. For images (including 3149 // TIFFs) the unit is pixels. 3150 Width int64 `json:"width,omitempty"` 3151 3152 // ForceSendFields is a list of field names (e.g. "Blocks") to 3153 // unconditionally include in API requests. By default, fields with 3154 // empty values are omitted from API requests. However, any non-pointer, 3155 // non-interface field appearing in ForceSendFields will be sent to the 3156 // server regardless of whether the field is empty or not. This may be 3157 // used to include empty fields in Patch requests. 3158 ForceSendFields []string `json:"-"` 3159 3160 // NullFields is a list of field names (e.g. "Blocks") to include in API 3161 // requests with the JSON null value. By default, fields with empty 3162 // values are omitted from API requests. However, any field with an 3163 // empty value appearing in NullFields will be sent to the server as 3164 // null. It is an error if a field in this list has a non-empty value. 3165 // This may be used to include null fields in Patch requests. 3166 NullFields []string `json:"-"` 3167} 3168 3169func (s *GoogleCloudVisionV1p1beta1Page) MarshalJSON() ([]byte, error) { 3170 type NoMethod GoogleCloudVisionV1p1beta1Page 3171 raw := NoMethod(*s) 3172 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3173} 3174 3175func (s *GoogleCloudVisionV1p1beta1Page) UnmarshalJSON(data []byte) error { 3176 type NoMethod GoogleCloudVisionV1p1beta1Page 3177 var s1 struct { 3178 Confidence gensupport.JSONFloat64 `json:"confidence"` 3179 *NoMethod 3180 } 3181 s1.NoMethod = (*NoMethod)(s) 3182 if err := json.Unmarshal(data, &s1); err != nil { 3183 return err 3184 } 3185 s.Confidence = float64(s1.Confidence) 3186 return nil 3187} 3188 3189// GoogleCloudVisionV1p1beta1Paragraph: Structural unit of text 3190// representing a number of words in certain order. 3191type GoogleCloudVisionV1p1beta1Paragraph struct { 3192 // BoundingBox: The bounding box for the paragraph. The vertices are in 3193 // the order of top-left, top-right, bottom-right, bottom-left. When a 3194 // rotation of the bounding box is detected the rotation is represented 3195 // as around the top-left corner as defined when the text is read in the 3196 // 'natural' orientation. For example: * when the text is horizontal it 3197 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 3198 // around the top-left corner it becomes: 2----3 | | 1----0 and the 3199 // vertex order will still be (0, 1, 2, 3). 3200 BoundingBox *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingBox,omitempty"` 3201 3202 // Confidence: Confidence of the OCR results for the paragraph. Range 3203 // [0, 1]. 3204 Confidence float64 `json:"confidence,omitempty"` 3205 3206 // Property: Additional information detected for the paragraph. 3207 Property *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty `json:"property,omitempty"` 3208 3209 // Words: List of all words in this paragraph. 3210 Words []*GoogleCloudVisionV1p1beta1Word `json:"words,omitempty"` 3211 3212 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 3213 // unconditionally include in API requests. By default, fields with 3214 // empty values are omitted from API requests. However, any non-pointer, 3215 // non-interface field appearing in ForceSendFields will be sent to the 3216 // server regardless of whether the field is empty or not. This may be 3217 // used to include empty fields in Patch requests. 3218 ForceSendFields []string `json:"-"` 3219 3220 // NullFields is a list of field names (e.g. "BoundingBox") to include 3221 // in API requests with the JSON null value. By default, fields with 3222 // empty values are omitted from API requests. However, any field with 3223 // an empty value appearing in NullFields will be sent to the server as 3224 // null. It is an error if a field in this list has a non-empty value. 3225 // This may be used to include null fields in Patch requests. 3226 NullFields []string `json:"-"` 3227} 3228 3229func (s *GoogleCloudVisionV1p1beta1Paragraph) MarshalJSON() ([]byte, error) { 3230 type NoMethod GoogleCloudVisionV1p1beta1Paragraph 3231 raw := NoMethod(*s) 3232 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3233} 3234 3235func (s *GoogleCloudVisionV1p1beta1Paragraph) UnmarshalJSON(data []byte) error { 3236 type NoMethod GoogleCloudVisionV1p1beta1Paragraph 3237 var s1 struct { 3238 Confidence gensupport.JSONFloat64 `json:"confidence"` 3239 *NoMethod 3240 } 3241 s1.NoMethod = (*NoMethod)(s) 3242 if err := json.Unmarshal(data, &s1); err != nil { 3243 return err 3244 } 3245 s.Confidence = float64(s1.Confidence) 3246 return nil 3247} 3248 3249// GoogleCloudVisionV1p1beta1Position: A 3D position in the image, used 3250// primarily for Face detection landmarks. A valid Position must have 3251// both x and y coordinates. The position coordinates are in the same 3252// scale as the original image. 3253type GoogleCloudVisionV1p1beta1Position struct { 3254 // X: X coordinate. 3255 X float64 `json:"x,omitempty"` 3256 3257 // Y: Y coordinate. 3258 Y float64 `json:"y,omitempty"` 3259 3260 // Z: Z coordinate (or depth). 3261 Z float64 `json:"z,omitempty"` 3262 3263 // ForceSendFields is a list of field names (e.g. "X") to 3264 // unconditionally include in API requests. By default, fields with 3265 // empty values are omitted from API requests. However, any non-pointer, 3266 // non-interface field appearing in ForceSendFields will be sent to the 3267 // server regardless of whether the field is empty or not. This may be 3268 // used to include empty fields in Patch requests. 3269 ForceSendFields []string `json:"-"` 3270 3271 // NullFields is a list of field names (e.g. "X") to include in API 3272 // requests with the JSON null value. By default, fields with empty 3273 // values are omitted from API requests. However, any field with an 3274 // empty value appearing in NullFields will be sent to the server as 3275 // null. It is an error if a field in this list has a non-empty value. 3276 // This may be used to include null fields in Patch requests. 3277 NullFields []string `json:"-"` 3278} 3279 3280func (s *GoogleCloudVisionV1p1beta1Position) MarshalJSON() ([]byte, error) { 3281 type NoMethod GoogleCloudVisionV1p1beta1Position 3282 raw := NoMethod(*s) 3283 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3284} 3285 3286func (s *GoogleCloudVisionV1p1beta1Position) UnmarshalJSON(data []byte) error { 3287 type NoMethod GoogleCloudVisionV1p1beta1Position 3288 var s1 struct { 3289 X gensupport.JSONFloat64 `json:"x"` 3290 Y gensupport.JSONFloat64 `json:"y"` 3291 Z gensupport.JSONFloat64 `json:"z"` 3292 *NoMethod 3293 } 3294 s1.NoMethod = (*NoMethod)(s) 3295 if err := json.Unmarshal(data, &s1); err != nil { 3296 return err 3297 } 3298 s.X = float64(s1.X) 3299 s.Y = float64(s1.Y) 3300 s.Z = float64(s1.Z) 3301 return nil 3302} 3303 3304// GoogleCloudVisionV1p1beta1Product: A Product contains 3305// ReferenceImages. 3306type GoogleCloudVisionV1p1beta1Product struct { 3307 // Description: User-provided metadata to be stored with this product. 3308 // Must be at most 4096 characters long. 3309 Description string `json:"description,omitempty"` 3310 3311 // DisplayName: The user-provided name for this Product. Must not be 3312 // empty. Must be at most 4096 characters long. 3313 DisplayName string `json:"displayName,omitempty"` 3314 3315 // Name: The resource name of the product. Format is: 3316 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This 3317 // field is ignored when creating a product. 3318 Name string `json:"name,omitempty"` 3319 3320 // ProductCategory: Immutable. The category for the product identified 3321 // by the reference image. This should be one of "homegoods-v2", 3322 // "apparel-v2", "toys-v2", "packagedgoods-v1" or "general-v1". The 3323 // legacy categories "homegoods", "apparel", and "toys" are still 3324 // supported, but these should not be used for new products. 3325 ProductCategory string `json:"productCategory,omitempty"` 3326 3327 // ProductLabels: Key-value pairs that can be attached to a product. At 3328 // query time, constraints can be specified based on the product_labels. 3329 // Note that integer values can be provided as strings, e.g. "1199". 3330 // Only strings with integer values can match a range-based restriction 3331 // which is to be supported soon. Multiple values can be assigned to the 3332 // same key. One product may have up to 500 product_labels. Notice that 3333 // the total number of distinct product_labels over all products in one 3334 // ProductSet cannot exceed 1M, otherwise the product search pipeline 3335 // will refuse to work for that ProductSet. 3336 ProductLabels []*GoogleCloudVisionV1p1beta1ProductKeyValue `json:"productLabels,omitempty"` 3337 3338 // ForceSendFields is a list of field names (e.g. "Description") to 3339 // unconditionally include in API requests. By default, fields with 3340 // empty values are omitted from API requests. However, any non-pointer, 3341 // non-interface field appearing in ForceSendFields will be sent to the 3342 // server regardless of whether the field is empty or not. This may be 3343 // used to include empty fields in Patch requests. 3344 ForceSendFields []string `json:"-"` 3345 3346 // NullFields is a list of field names (e.g. "Description") to include 3347 // in API requests with the JSON null value. By default, fields with 3348 // empty values are omitted from API requests. However, any field with 3349 // an empty value appearing in NullFields will be sent to the server as 3350 // null. It is an error if a field in this list has a non-empty value. 3351 // This may be used to include null fields in Patch requests. 3352 NullFields []string `json:"-"` 3353} 3354 3355func (s *GoogleCloudVisionV1p1beta1Product) MarshalJSON() ([]byte, error) { 3356 type NoMethod GoogleCloudVisionV1p1beta1Product 3357 raw := NoMethod(*s) 3358 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3359} 3360 3361// GoogleCloudVisionV1p1beta1ProductKeyValue: A product label 3362// represented as a key-value pair. 3363type GoogleCloudVisionV1p1beta1ProductKeyValue struct { 3364 // Key: The key of the label attached to the product. Cannot be empty 3365 // and cannot exceed 128 bytes. 3366 Key string `json:"key,omitempty"` 3367 3368 // Value: The value of the label attached to the product. Cannot be 3369 // empty and cannot exceed 128 bytes. 3370 Value string `json:"value,omitempty"` 3371 3372 // ForceSendFields is a list of field names (e.g. "Key") to 3373 // unconditionally include in API requests. By default, fields with 3374 // empty values are omitted from API requests. However, any non-pointer, 3375 // non-interface field appearing in ForceSendFields will be sent to the 3376 // server regardless of whether the field is empty or not. This may be 3377 // used to include empty fields in Patch requests. 3378 ForceSendFields []string `json:"-"` 3379 3380 // NullFields is a list of field names (e.g. "Key") to include in API 3381 // requests with the JSON null value. By default, fields with empty 3382 // values are omitted from API requests. However, any field with an 3383 // empty value appearing in NullFields will be sent to the server as 3384 // null. It is an error if a field in this list has a non-empty value. 3385 // This may be used to include null fields in Patch requests. 3386 NullFields []string `json:"-"` 3387} 3388 3389func (s *GoogleCloudVisionV1p1beta1ProductKeyValue) MarshalJSON() ([]byte, error) { 3390 type NoMethod GoogleCloudVisionV1p1beta1ProductKeyValue 3391 raw := NoMethod(*s) 3392 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3393} 3394 3395// GoogleCloudVisionV1p1beta1ProductSearchParams: Parameters for a 3396// product search request. 3397type GoogleCloudVisionV1p1beta1ProductSearchParams struct { 3398 // BoundingPoly: The bounding polygon around the area of interest in the 3399 // image. If it is not specified, system discretion will be applied. 3400 BoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingPoly,omitempty"` 3401 3402 // Filter: The filtering expression. This can be used to restrict search 3403 // results based on Product labels. We currently support an AND of OR of 3404 // key-value expressions, where each expression within an OR must have 3405 // the same key. An '=' should be used to connect the key and value. For 3406 // example, "(color = red OR color = blue) AND brand = Google" is 3407 // acceptable, but "(color = red OR brand = Google)" is not acceptable. 3408 // "color: red" is not acceptable because it uses a ':' instead of an 3409 // '='. 3410 Filter string `json:"filter,omitempty"` 3411 3412 // ProductCategories: The list of product categories to search in. 3413 // Currently, we only consider the first category, and either 3414 // "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1", or 3415 // "general-v1" should be specified. The legacy categories "homegoods", 3416 // "apparel", and "toys" are still supported but will be deprecated. For 3417 // new products, please use "homegoods-v2", "apparel-v2", or "toys-v2" 3418 // for better product search accuracy. It is recommended to migrate 3419 // existing products to these categories as well. 3420 ProductCategories []string `json:"productCategories,omitempty"` 3421 3422 // ProductSet: The resource name of a ProductSet to be searched for 3423 // similar images. Format is: 3424 // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. 3425 ProductSet string `json:"productSet,omitempty"` 3426 3427 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 3428 // unconditionally include in API requests. By default, fields with 3429 // empty values are omitted from API requests. However, any non-pointer, 3430 // non-interface field appearing in ForceSendFields will be sent to the 3431 // server regardless of whether the field is empty or not. This may be 3432 // used to include empty fields in Patch requests. 3433 ForceSendFields []string `json:"-"` 3434 3435 // NullFields is a list of field names (e.g. "BoundingPoly") to include 3436 // in API requests with the JSON null value. By default, fields with 3437 // empty values are omitted from API requests. However, any field with 3438 // an empty value appearing in NullFields will be sent to the server as 3439 // null. It is an error if a field in this list has a non-empty value. 3440 // This may be used to include null fields in Patch requests. 3441 NullFields []string `json:"-"` 3442} 3443 3444func (s *GoogleCloudVisionV1p1beta1ProductSearchParams) MarshalJSON() ([]byte, error) { 3445 type NoMethod GoogleCloudVisionV1p1beta1ProductSearchParams 3446 raw := NoMethod(*s) 3447 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3448} 3449 3450// GoogleCloudVisionV1p1beta1ProductSearchResults: Results for a product 3451// search request. 3452type GoogleCloudVisionV1p1beta1ProductSearchResults struct { 3453 // IndexTime: Timestamp of the index which provided these results. 3454 // Products added to the product set and products removed from the 3455 // product set after this time are not reflected in the current results. 3456 IndexTime string `json:"indexTime,omitempty"` 3457 3458 // ProductGroupedResults: List of results grouped by products detected 3459 // in the query image. Each entry corresponds to one bounding polygon in 3460 // the query image, and contains the matching products specific to that 3461 // region. There may be duplicate product matches in the union of all 3462 // the per-product results. 3463 ProductGroupedResults []*GoogleCloudVisionV1p1beta1ProductSearchResultsGroupedResult `json:"productGroupedResults,omitempty"` 3464 3465 // Results: List of results, one for each product match. 3466 Results []*GoogleCloudVisionV1p1beta1ProductSearchResultsResult `json:"results,omitempty"` 3467 3468 // ForceSendFields is a list of field names (e.g. "IndexTime") to 3469 // unconditionally include in API requests. By default, fields with 3470 // empty values are omitted from API requests. However, any non-pointer, 3471 // non-interface field appearing in ForceSendFields will be sent to the 3472 // server regardless of whether the field is empty or not. This may be 3473 // used to include empty fields in Patch requests. 3474 ForceSendFields []string `json:"-"` 3475 3476 // NullFields is a list of field names (e.g. "IndexTime") to include in 3477 // API requests with the JSON null value. By default, fields with empty 3478 // values are omitted from API requests. However, any field with an 3479 // empty value appearing in NullFields will be sent to the server as 3480 // null. It is an error if a field in this list has a non-empty value. 3481 // This may be used to include null fields in Patch requests. 3482 NullFields []string `json:"-"` 3483} 3484 3485func (s *GoogleCloudVisionV1p1beta1ProductSearchResults) MarshalJSON() ([]byte, error) { 3486 type NoMethod GoogleCloudVisionV1p1beta1ProductSearchResults 3487 raw := NoMethod(*s) 3488 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3489} 3490 3491// GoogleCloudVisionV1p1beta1ProductSearchResultsGroupedResult: 3492// Information about the products similar to a single product in a query 3493// image. 3494type GoogleCloudVisionV1p1beta1ProductSearchResultsGroupedResult struct { 3495 // BoundingPoly: The bounding polygon around the product detected in the 3496 // query image. 3497 BoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingPoly,omitempty"` 3498 3499 // ObjectAnnotations: List of generic predictions for the object in the 3500 // bounding box. 3501 ObjectAnnotations []*GoogleCloudVisionV1p1beta1ProductSearchResultsObjectAnnotation `json:"objectAnnotations,omitempty"` 3502 3503 // Results: List of results, one for each product match. 3504 Results []*GoogleCloudVisionV1p1beta1ProductSearchResultsResult `json:"results,omitempty"` 3505 3506 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 3507 // unconditionally include in API requests. By default, fields with 3508 // empty values are omitted from API requests. However, any non-pointer, 3509 // non-interface field appearing in ForceSendFields will be sent to the 3510 // server regardless of whether the field is empty or not. This may be 3511 // used to include empty fields in Patch requests. 3512 ForceSendFields []string `json:"-"` 3513 3514 // NullFields is a list of field names (e.g. "BoundingPoly") to include 3515 // in API requests with the JSON null value. By default, fields with 3516 // empty values are omitted from API requests. However, any field with 3517 // an empty value appearing in NullFields will be sent to the server as 3518 // null. It is an error if a field in this list has a non-empty value. 3519 // This may be used to include null fields in Patch requests. 3520 NullFields []string `json:"-"` 3521} 3522 3523func (s *GoogleCloudVisionV1p1beta1ProductSearchResultsGroupedResult) MarshalJSON() ([]byte, error) { 3524 type NoMethod GoogleCloudVisionV1p1beta1ProductSearchResultsGroupedResult 3525 raw := NoMethod(*s) 3526 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3527} 3528 3529// GoogleCloudVisionV1p1beta1ProductSearchResultsObjectAnnotation: 3530// Prediction for what the object in the bounding box is. 3531type GoogleCloudVisionV1p1beta1ProductSearchResultsObjectAnnotation struct { 3532 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". 3533 // For more information, see 3534 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 3535 LanguageCode string `json:"languageCode,omitempty"` 3536 3537 // Mid: Object ID that should align with EntityAnnotation mid. 3538 Mid string `json:"mid,omitempty"` 3539 3540 // Name: Object name, expressed in its `language_code` language. 3541 Name string `json:"name,omitempty"` 3542 3543 // Score: Score of the result. Range [0, 1]. 3544 Score float64 `json:"score,omitempty"` 3545 3546 // ForceSendFields is a list of field names (e.g. "LanguageCode") to 3547 // unconditionally include in API requests. By default, fields with 3548 // empty values are omitted from API requests. However, any non-pointer, 3549 // non-interface field appearing in ForceSendFields will be sent to the 3550 // server regardless of whether the field is empty or not. This may be 3551 // used to include empty fields in Patch requests. 3552 ForceSendFields []string `json:"-"` 3553 3554 // NullFields is a list of field names (e.g. "LanguageCode") to include 3555 // in API requests with the JSON null value. By default, fields with 3556 // empty values are omitted from API requests. However, any field with 3557 // an empty value appearing in NullFields will be sent to the server as 3558 // null. It is an error if a field in this list has a non-empty value. 3559 // This may be used to include null fields in Patch requests. 3560 NullFields []string `json:"-"` 3561} 3562 3563func (s *GoogleCloudVisionV1p1beta1ProductSearchResultsObjectAnnotation) MarshalJSON() ([]byte, error) { 3564 type NoMethod GoogleCloudVisionV1p1beta1ProductSearchResultsObjectAnnotation 3565 raw := NoMethod(*s) 3566 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3567} 3568 3569func (s *GoogleCloudVisionV1p1beta1ProductSearchResultsObjectAnnotation) UnmarshalJSON(data []byte) error { 3570 type NoMethod GoogleCloudVisionV1p1beta1ProductSearchResultsObjectAnnotation 3571 var s1 struct { 3572 Score gensupport.JSONFloat64 `json:"score"` 3573 *NoMethod 3574 } 3575 s1.NoMethod = (*NoMethod)(s) 3576 if err := json.Unmarshal(data, &s1); err != nil { 3577 return err 3578 } 3579 s.Score = float64(s1.Score) 3580 return nil 3581} 3582 3583// GoogleCloudVisionV1p1beta1ProductSearchResultsResult: Information 3584// about a product. 3585type GoogleCloudVisionV1p1beta1ProductSearchResultsResult struct { 3586 // Image: The resource name of the image from the product that is the 3587 // closest match to the query. 3588 Image string `json:"image,omitempty"` 3589 3590 // Product: The Product. 3591 Product *GoogleCloudVisionV1p1beta1Product `json:"product,omitempty"` 3592 3593 // Score: A confidence level on the match, ranging from 0 (no 3594 // confidence) to 1 (full confidence). 3595 Score float64 `json:"score,omitempty"` 3596 3597 // ForceSendFields is a list of field names (e.g. "Image") to 3598 // unconditionally include in API requests. By default, fields with 3599 // empty values are omitted from API requests. However, any non-pointer, 3600 // non-interface field appearing in ForceSendFields will be sent to the 3601 // server regardless of whether the field is empty or not. This may be 3602 // used to include empty fields in Patch requests. 3603 ForceSendFields []string `json:"-"` 3604 3605 // NullFields is a list of field names (e.g. "Image") to include in API 3606 // requests with the JSON null value. By default, fields with empty 3607 // values are omitted from API requests. However, any field with an 3608 // empty value appearing in NullFields will be sent to the server as 3609 // null. It is an error if a field in this list has a non-empty value. 3610 // This may be used to include null fields in Patch requests. 3611 NullFields []string `json:"-"` 3612} 3613 3614func (s *GoogleCloudVisionV1p1beta1ProductSearchResultsResult) MarshalJSON() ([]byte, error) { 3615 type NoMethod GoogleCloudVisionV1p1beta1ProductSearchResultsResult 3616 raw := NoMethod(*s) 3617 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3618} 3619 3620func (s *GoogleCloudVisionV1p1beta1ProductSearchResultsResult) UnmarshalJSON(data []byte) error { 3621 type NoMethod GoogleCloudVisionV1p1beta1ProductSearchResultsResult 3622 var s1 struct { 3623 Score gensupport.JSONFloat64 `json:"score"` 3624 *NoMethod 3625 } 3626 s1.NoMethod = (*NoMethod)(s) 3627 if err := json.Unmarshal(data, &s1); err != nil { 3628 return err 3629 } 3630 s.Score = float64(s1.Score) 3631 return nil 3632} 3633 3634// GoogleCloudVisionV1p1beta1Property: A `Property` consists of a 3635// user-supplied name/value pair. 3636type GoogleCloudVisionV1p1beta1Property struct { 3637 // Name: Name of the property. 3638 Name string `json:"name,omitempty"` 3639 3640 // Uint64Value: Value of numeric properties. 3641 Uint64Value uint64 `json:"uint64Value,omitempty,string"` 3642 3643 // Value: Value of the property. 3644 Value string `json:"value,omitempty"` 3645 3646 // ForceSendFields is a list of field names (e.g. "Name") to 3647 // unconditionally include in API requests. By default, fields with 3648 // empty values are omitted from API requests. However, any non-pointer, 3649 // non-interface field appearing in ForceSendFields will be sent to the 3650 // server regardless of whether the field is empty or not. This may be 3651 // used to include empty fields in Patch requests. 3652 ForceSendFields []string `json:"-"` 3653 3654 // NullFields is a list of field names (e.g. "Name") to include in API 3655 // requests with the JSON null value. By default, fields with empty 3656 // values are omitted from API requests. However, any field with an 3657 // empty value appearing in NullFields will be sent to the server as 3658 // null. It is an error if a field in this list has a non-empty value. 3659 // This may be used to include null fields in Patch requests. 3660 NullFields []string `json:"-"` 3661} 3662 3663func (s *GoogleCloudVisionV1p1beta1Property) MarshalJSON() ([]byte, error) { 3664 type NoMethod GoogleCloudVisionV1p1beta1Property 3665 raw := NoMethod(*s) 3666 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3667} 3668 3669// GoogleCloudVisionV1p1beta1SafeSearchAnnotation: Set of features 3670// pertaining to the image, computed by computer vision methods over 3671// safe-search verticals (for example, adult, spoof, medical, violence). 3672type GoogleCloudVisionV1p1beta1SafeSearchAnnotation struct { 3673 // Adult: Represents the adult content likelihood for the image. Adult 3674 // content may contain elements such as nudity, pornographic images or 3675 // cartoons, or sexual activities. 3676 // 3677 // Possible values: 3678 // "UNKNOWN" - Unknown likelihood. 3679 // "VERY_UNLIKELY" - It is very unlikely. 3680 // "UNLIKELY" - It is unlikely. 3681 // "POSSIBLE" - It is possible. 3682 // "LIKELY" - It is likely. 3683 // "VERY_LIKELY" - It is very likely. 3684 Adult string `json:"adult,omitempty"` 3685 3686 // Medical: Likelihood that this is a medical image. 3687 // 3688 // Possible values: 3689 // "UNKNOWN" - Unknown likelihood. 3690 // "VERY_UNLIKELY" - It is very unlikely. 3691 // "UNLIKELY" - It is unlikely. 3692 // "POSSIBLE" - It is possible. 3693 // "LIKELY" - It is likely. 3694 // "VERY_LIKELY" - It is very likely. 3695 Medical string `json:"medical,omitempty"` 3696 3697 // Racy: Likelihood that the request image contains racy content. Racy 3698 // content may include (but is not limited to) skimpy or sheer clothing, 3699 // strategically covered nudity, lewd or provocative poses, or close-ups 3700 // of sensitive body areas. 3701 // 3702 // Possible values: 3703 // "UNKNOWN" - Unknown likelihood. 3704 // "VERY_UNLIKELY" - It is very unlikely. 3705 // "UNLIKELY" - It is unlikely. 3706 // "POSSIBLE" - It is possible. 3707 // "LIKELY" - It is likely. 3708 // "VERY_LIKELY" - It is very likely. 3709 Racy string `json:"racy,omitempty"` 3710 3711 // Spoof: Spoof likelihood. The likelihood that an modification was made 3712 // to the image's canonical version to make it appear funny or 3713 // offensive. 3714 // 3715 // Possible values: 3716 // "UNKNOWN" - Unknown likelihood. 3717 // "VERY_UNLIKELY" - It is very unlikely. 3718 // "UNLIKELY" - It is unlikely. 3719 // "POSSIBLE" - It is possible. 3720 // "LIKELY" - It is likely. 3721 // "VERY_LIKELY" - It is very likely. 3722 Spoof string `json:"spoof,omitempty"` 3723 3724 // Violence: Likelihood that this image contains violent content. 3725 // 3726 // Possible values: 3727 // "UNKNOWN" - Unknown likelihood. 3728 // "VERY_UNLIKELY" - It is very unlikely. 3729 // "UNLIKELY" - It is unlikely. 3730 // "POSSIBLE" - It is possible. 3731 // "LIKELY" - It is likely. 3732 // "VERY_LIKELY" - It is very likely. 3733 Violence string `json:"violence,omitempty"` 3734 3735 // ForceSendFields is a list of field names (e.g. "Adult") to 3736 // unconditionally include in API requests. By default, fields with 3737 // empty values are omitted from API requests. However, any non-pointer, 3738 // non-interface field appearing in ForceSendFields will be sent to the 3739 // server regardless of whether the field is empty or not. This may be 3740 // used to include empty fields in Patch requests. 3741 ForceSendFields []string `json:"-"` 3742 3743 // NullFields is a list of field names (e.g. "Adult") to include in API 3744 // requests with the JSON null value. By default, fields with empty 3745 // values are omitted from API requests. However, any field with an 3746 // empty value appearing in NullFields will be sent to the server as 3747 // null. It is an error if a field in this list has a non-empty value. 3748 // This may be used to include null fields in Patch requests. 3749 NullFields []string `json:"-"` 3750} 3751 3752func (s *GoogleCloudVisionV1p1beta1SafeSearchAnnotation) MarshalJSON() ([]byte, error) { 3753 type NoMethod GoogleCloudVisionV1p1beta1SafeSearchAnnotation 3754 raw := NoMethod(*s) 3755 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3756} 3757 3758// GoogleCloudVisionV1p1beta1Symbol: A single symbol representation. 3759type GoogleCloudVisionV1p1beta1Symbol struct { 3760 // BoundingBox: The bounding box for the symbol. The vertices are in the 3761 // order of top-left, top-right, bottom-right, bottom-left. When a 3762 // rotation of the bounding box is detected the rotation is represented 3763 // as around the top-left corner as defined when the text is read in the 3764 // 'natural' orientation. For example: * when the text is horizontal it 3765 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 3766 // around the top-left corner it becomes: 2----3 | | 1----0 and the 3767 // vertex order will still be (0, 1, 2, 3). 3768 BoundingBox *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingBox,omitempty"` 3769 3770 // Confidence: Confidence of the OCR results for the symbol. Range [0, 3771 // 1]. 3772 Confidence float64 `json:"confidence,omitempty"` 3773 3774 // Property: Additional information detected for the symbol. 3775 Property *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty `json:"property,omitempty"` 3776 3777 // Text: The actual UTF-8 representation of the symbol. 3778 Text string `json:"text,omitempty"` 3779 3780 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 3781 // unconditionally include in API requests. By default, fields with 3782 // empty values are omitted from API requests. However, any non-pointer, 3783 // non-interface field appearing in ForceSendFields will be sent to the 3784 // server regardless of whether the field is empty or not. This may be 3785 // used to include empty fields in Patch requests. 3786 ForceSendFields []string `json:"-"` 3787 3788 // NullFields is a list of field names (e.g. "BoundingBox") to include 3789 // in API requests with the JSON null value. By default, fields with 3790 // empty values are omitted from API requests. However, any field with 3791 // an empty value appearing in NullFields will be sent to the server as 3792 // null. It is an error if a field in this list has a non-empty value. 3793 // This may be used to include null fields in Patch requests. 3794 NullFields []string `json:"-"` 3795} 3796 3797func (s *GoogleCloudVisionV1p1beta1Symbol) MarshalJSON() ([]byte, error) { 3798 type NoMethod GoogleCloudVisionV1p1beta1Symbol 3799 raw := NoMethod(*s) 3800 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3801} 3802 3803func (s *GoogleCloudVisionV1p1beta1Symbol) UnmarshalJSON(data []byte) error { 3804 type NoMethod GoogleCloudVisionV1p1beta1Symbol 3805 var s1 struct { 3806 Confidence gensupport.JSONFloat64 `json:"confidence"` 3807 *NoMethod 3808 } 3809 s1.NoMethod = (*NoMethod)(s) 3810 if err := json.Unmarshal(data, &s1); err != nil { 3811 return err 3812 } 3813 s.Confidence = float64(s1.Confidence) 3814 return nil 3815} 3816 3817// GoogleCloudVisionV1p1beta1TextAnnotation: TextAnnotation contains a 3818// structured representation of OCR extracted text. The hierarchy of an 3819// OCR extracted text structure is like this: TextAnnotation -> Page -> 3820// Block -> Paragraph -> Word -> Symbol Each structural component, 3821// starting from Page, may further have their own properties. Properties 3822// describe detected languages, breaks etc.. Please refer to the 3823// TextAnnotation.TextProperty message definition below for more detail. 3824type GoogleCloudVisionV1p1beta1TextAnnotation struct { 3825 // Pages: List of pages detected by OCR. 3826 Pages []*GoogleCloudVisionV1p1beta1Page `json:"pages,omitempty"` 3827 3828 // Text: UTF-8 text detected on the pages. 3829 Text string `json:"text,omitempty"` 3830 3831 // ForceSendFields is a list of field names (e.g. "Pages") to 3832 // unconditionally include in API requests. By default, fields with 3833 // empty values are omitted from API requests. However, any non-pointer, 3834 // non-interface field appearing in ForceSendFields will be sent to the 3835 // server regardless of whether the field is empty or not. This may be 3836 // used to include empty fields in Patch requests. 3837 ForceSendFields []string `json:"-"` 3838 3839 // NullFields is a list of field names (e.g. "Pages") to include in API 3840 // requests with the JSON null value. By default, fields with empty 3841 // values are omitted from API requests. However, any field with an 3842 // empty value appearing in NullFields will be sent to the server as 3843 // null. It is an error if a field in this list has a non-empty value. 3844 // This may be used to include null fields in Patch requests. 3845 NullFields []string `json:"-"` 3846} 3847 3848func (s *GoogleCloudVisionV1p1beta1TextAnnotation) MarshalJSON() ([]byte, error) { 3849 type NoMethod GoogleCloudVisionV1p1beta1TextAnnotation 3850 raw := NoMethod(*s) 3851 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3852} 3853 3854// GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak: Detected start 3855// or end of a structural component. 3856type GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak struct { 3857 // IsPrefix: True if break prepends the element. 3858 IsPrefix bool `json:"isPrefix,omitempty"` 3859 3860 // Type: Detected break type. 3861 // 3862 // Possible values: 3863 // "UNKNOWN" - Unknown break label type. 3864 // "SPACE" - Regular space. 3865 // "SURE_SPACE" - Sure space (very wide). 3866 // "EOL_SURE_SPACE" - Line-wrapping break. 3867 // "HYPHEN" - End-line hyphen that is not present in text; does not 3868 // co-occur with `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. 3869 // "LINE_BREAK" - Line break that ends a paragraph. 3870 Type string `json:"type,omitempty"` 3871 3872 // ForceSendFields is a list of field names (e.g. "IsPrefix") to 3873 // unconditionally include in API requests. By default, fields with 3874 // empty values are omitted from API requests. However, any non-pointer, 3875 // non-interface field appearing in ForceSendFields will be sent to the 3876 // server regardless of whether the field is empty or not. This may be 3877 // used to include empty fields in Patch requests. 3878 ForceSendFields []string `json:"-"` 3879 3880 // NullFields is a list of field names (e.g. "IsPrefix") to include in 3881 // API requests with the JSON null value. By default, fields with empty 3882 // values are omitted from API requests. However, any field with an 3883 // empty value appearing in NullFields will be sent to the server as 3884 // null. It is an error if a field in this list has a non-empty value. 3885 // This may be used to include null fields in Patch requests. 3886 NullFields []string `json:"-"` 3887} 3888 3889func (s *GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak) MarshalJSON() ([]byte, error) { 3890 type NoMethod GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak 3891 raw := NoMethod(*s) 3892 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3893} 3894 3895// GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage: Detected 3896// language for a structural component. 3897type GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage struct { 3898 // Confidence: Confidence of detected language. Range [0, 1]. 3899 Confidence float64 `json:"confidence,omitempty"` 3900 3901 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". 3902 // For more information, see 3903 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 3904 LanguageCode string `json:"languageCode,omitempty"` 3905 3906 // ForceSendFields is a list of field names (e.g. "Confidence") to 3907 // unconditionally include in API requests. By default, fields with 3908 // empty values are omitted from API requests. However, any non-pointer, 3909 // non-interface field appearing in ForceSendFields will be sent to the 3910 // server regardless of whether the field is empty or not. This may be 3911 // used to include empty fields in Patch requests. 3912 ForceSendFields []string `json:"-"` 3913 3914 // NullFields is a list of field names (e.g. "Confidence") to include in 3915 // API requests with the JSON null value. By default, fields with empty 3916 // values are omitted from API requests. However, any field with an 3917 // empty value appearing in NullFields will be sent to the server as 3918 // null. It is an error if a field in this list has a non-empty value. 3919 // This may be used to include null fields in Patch requests. 3920 NullFields []string `json:"-"` 3921} 3922 3923func (s *GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage) MarshalJSON() ([]byte, error) { 3924 type NoMethod GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage 3925 raw := NoMethod(*s) 3926 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3927} 3928 3929func (s *GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage) UnmarshalJSON(data []byte) error { 3930 type NoMethod GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage 3931 var s1 struct { 3932 Confidence gensupport.JSONFloat64 `json:"confidence"` 3933 *NoMethod 3934 } 3935 s1.NoMethod = (*NoMethod)(s) 3936 if err := json.Unmarshal(data, &s1); err != nil { 3937 return err 3938 } 3939 s.Confidence = float64(s1.Confidence) 3940 return nil 3941} 3942 3943// GoogleCloudVisionV1p1beta1TextAnnotationTextProperty: Additional 3944// information detected on the structural component. 3945type GoogleCloudVisionV1p1beta1TextAnnotationTextProperty struct { 3946 // DetectedBreak: Detected start or end of a text segment. 3947 DetectedBreak *GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak `json:"detectedBreak,omitempty"` 3948 3949 // DetectedLanguages: A list of detected languages together with 3950 // confidence. 3951 DetectedLanguages []*GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage `json:"detectedLanguages,omitempty"` 3952 3953 // ForceSendFields is a list of field names (e.g. "DetectedBreak") to 3954 // unconditionally include in API requests. By default, fields with 3955 // empty values are omitted from API requests. However, any non-pointer, 3956 // non-interface field appearing in ForceSendFields will be sent to the 3957 // server regardless of whether the field is empty or not. This may be 3958 // used to include empty fields in Patch requests. 3959 ForceSendFields []string `json:"-"` 3960 3961 // NullFields is a list of field names (e.g. "DetectedBreak") to include 3962 // in API requests with the JSON null value. By default, fields with 3963 // empty values are omitted from API requests. However, any field with 3964 // an empty value appearing in NullFields will be sent to the server as 3965 // null. It is an error if a field in this list has a non-empty value. 3966 // This may be used to include null fields in Patch requests. 3967 NullFields []string `json:"-"` 3968} 3969 3970func (s *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty) MarshalJSON() ([]byte, error) { 3971 type NoMethod GoogleCloudVisionV1p1beta1TextAnnotationTextProperty 3972 raw := NoMethod(*s) 3973 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3974} 3975 3976// GoogleCloudVisionV1p1beta1TextDetectionParams: Parameters for text 3977// detections. This is used to control TEXT_DETECTION and 3978// DOCUMENT_TEXT_DETECTION features. 3979type GoogleCloudVisionV1p1beta1TextDetectionParams struct { 3980 // EnableTextDetectionConfidenceScore: By default, Cloud Vision API only 3981 // includes confidence score for DOCUMENT_TEXT_DETECTION result. Set the 3982 // flag to true to include confidence score for TEXT_DETECTION as well. 3983 EnableTextDetectionConfidenceScore bool `json:"enableTextDetectionConfidenceScore,omitempty"` 3984 3985 // ForceSendFields is a list of field names (e.g. 3986 // "EnableTextDetectionConfidenceScore") to unconditionally include in 3987 // API requests. By default, fields with empty values are omitted from 3988 // API requests. However, any non-pointer, non-interface field appearing 3989 // in ForceSendFields will be sent to the server regardless of whether 3990 // the field is empty or not. This may be used to include empty fields 3991 // in Patch requests. 3992 ForceSendFields []string `json:"-"` 3993 3994 // NullFields is a list of field names (e.g. 3995 // "EnableTextDetectionConfidenceScore") to include in API requests with 3996 // the JSON null value. By default, fields with empty values are omitted 3997 // from API requests. However, any field with an empty value appearing 3998 // in NullFields will be sent to the server as null. It is an error if a 3999 // field in this list has a non-empty value. This may be used to include 4000 // null fields in Patch requests. 4001 NullFields []string `json:"-"` 4002} 4003 4004func (s *GoogleCloudVisionV1p1beta1TextDetectionParams) MarshalJSON() ([]byte, error) { 4005 type NoMethod GoogleCloudVisionV1p1beta1TextDetectionParams 4006 raw := NoMethod(*s) 4007 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4008} 4009 4010// GoogleCloudVisionV1p1beta1Vertex: A vertex represents a 2D point in 4011// the image. NOTE: the vertex coordinates are in the same scale as the 4012// original image. 4013type GoogleCloudVisionV1p1beta1Vertex struct { 4014 // X: X coordinate. 4015 X int64 `json:"x,omitempty"` 4016 4017 // Y: Y coordinate. 4018 Y int64 `json:"y,omitempty"` 4019 4020 // ForceSendFields is a list of field names (e.g. "X") to 4021 // unconditionally include in API requests. By default, fields with 4022 // empty values are omitted from API requests. However, any non-pointer, 4023 // non-interface field appearing in ForceSendFields will be sent to the 4024 // server regardless of whether the field is empty or not. This may be 4025 // used to include empty fields in Patch requests. 4026 ForceSendFields []string `json:"-"` 4027 4028 // NullFields is a list of field names (e.g. "X") to include in API 4029 // requests with the JSON null value. By default, fields with empty 4030 // values are omitted from API requests. However, any field with an 4031 // empty value appearing in NullFields will be sent to the server as 4032 // null. It is an error if a field in this list has a non-empty value. 4033 // This may be used to include null fields in Patch requests. 4034 NullFields []string `json:"-"` 4035} 4036 4037func (s *GoogleCloudVisionV1p1beta1Vertex) MarshalJSON() ([]byte, error) { 4038 type NoMethod GoogleCloudVisionV1p1beta1Vertex 4039 raw := NoMethod(*s) 4040 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4041} 4042 4043// GoogleCloudVisionV1p1beta1WebDetection: Relevant information for the 4044// image from the Internet. 4045type GoogleCloudVisionV1p1beta1WebDetection struct { 4046 // BestGuessLabels: The service's best guess as to the topic of the 4047 // request image. Inferred from similar images on the open web. 4048 BestGuessLabels []*GoogleCloudVisionV1p1beta1WebDetectionWebLabel `json:"bestGuessLabels,omitempty"` 4049 4050 // FullMatchingImages: Fully matching images from the Internet. Can 4051 // include resized copies of the query image. 4052 FullMatchingImages []*GoogleCloudVisionV1p1beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"` 4053 4054 // PagesWithMatchingImages: Web pages containing the matching images 4055 // from the Internet. 4056 PagesWithMatchingImages []*GoogleCloudVisionV1p1beta1WebDetectionWebPage `json:"pagesWithMatchingImages,omitempty"` 4057 4058 // PartialMatchingImages: Partial matching images from the Internet. 4059 // Those images are similar enough to share some key-point features. For 4060 // example an original image will likely have partial matching for its 4061 // crops. 4062 PartialMatchingImages []*GoogleCloudVisionV1p1beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"` 4063 4064 // VisuallySimilarImages: The visually similar image results. 4065 VisuallySimilarImages []*GoogleCloudVisionV1p1beta1WebDetectionWebImage `json:"visuallySimilarImages,omitempty"` 4066 4067 // WebEntities: Deduced entities from similar images on the Internet. 4068 WebEntities []*GoogleCloudVisionV1p1beta1WebDetectionWebEntity `json:"webEntities,omitempty"` 4069 4070 // ForceSendFields is a list of field names (e.g. "BestGuessLabels") to 4071 // unconditionally include in API requests. By default, fields with 4072 // empty values are omitted from API requests. However, any non-pointer, 4073 // non-interface field appearing in ForceSendFields will be sent to the 4074 // server regardless of whether the field is empty or not. This may be 4075 // used to include empty fields in Patch requests. 4076 ForceSendFields []string `json:"-"` 4077 4078 // NullFields is a list of field names (e.g. "BestGuessLabels") to 4079 // include in API requests with the JSON null value. By default, fields 4080 // with empty values are omitted from API requests. However, any field 4081 // with an empty value appearing in NullFields will be sent to the 4082 // server as null. It is an error if a field in this list has a 4083 // non-empty value. This may be used to include null fields in Patch 4084 // requests. 4085 NullFields []string `json:"-"` 4086} 4087 4088func (s *GoogleCloudVisionV1p1beta1WebDetection) MarshalJSON() ([]byte, error) { 4089 type NoMethod GoogleCloudVisionV1p1beta1WebDetection 4090 raw := NoMethod(*s) 4091 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4092} 4093 4094// GoogleCloudVisionV1p1beta1WebDetectionParams: Parameters for web 4095// detection request. 4096type GoogleCloudVisionV1p1beta1WebDetectionParams struct { 4097 // IncludeGeoResults: Whether to include results derived from the geo 4098 // information in the image. 4099 IncludeGeoResults bool `json:"includeGeoResults,omitempty"` 4100 4101 // ForceSendFields is a list of field names (e.g. "IncludeGeoResults") 4102 // to unconditionally include in API requests. By default, fields with 4103 // empty values are omitted from API requests. However, any non-pointer, 4104 // non-interface field appearing in ForceSendFields will be sent to the 4105 // server regardless of whether the field is empty or not. This may be 4106 // used to include empty fields in Patch requests. 4107 ForceSendFields []string `json:"-"` 4108 4109 // NullFields is a list of field names (e.g. "IncludeGeoResults") to 4110 // include in API requests with the JSON null value. By default, fields 4111 // with empty values are omitted from API requests. However, any field 4112 // with an empty value appearing in NullFields will be sent to the 4113 // server as null. It is an error if a field in this list has a 4114 // non-empty value. This may be used to include null fields in Patch 4115 // requests. 4116 NullFields []string `json:"-"` 4117} 4118 4119func (s *GoogleCloudVisionV1p1beta1WebDetectionParams) MarshalJSON() ([]byte, error) { 4120 type NoMethod GoogleCloudVisionV1p1beta1WebDetectionParams 4121 raw := NoMethod(*s) 4122 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4123} 4124 4125// GoogleCloudVisionV1p1beta1WebDetectionWebEntity: Entity deduced from 4126// similar images on the Internet. 4127type GoogleCloudVisionV1p1beta1WebDetectionWebEntity struct { 4128 // Description: Canonical description of the entity, in English. 4129 Description string `json:"description,omitempty"` 4130 4131 // EntityId: Opaque entity ID. 4132 EntityId string `json:"entityId,omitempty"` 4133 4134 // Score: Overall relevancy score for the entity. Not normalized and not 4135 // comparable across different image queries. 4136 Score float64 `json:"score,omitempty"` 4137 4138 // ForceSendFields is a list of field names (e.g. "Description") to 4139 // unconditionally include in API requests. By default, fields with 4140 // empty values are omitted from API requests. However, any non-pointer, 4141 // non-interface field appearing in ForceSendFields will be sent to the 4142 // server regardless of whether the field is empty or not. This may be 4143 // used to include empty fields in Patch requests. 4144 ForceSendFields []string `json:"-"` 4145 4146 // NullFields is a list of field names (e.g. "Description") to include 4147 // in API requests with the JSON null value. By default, fields with 4148 // empty values are omitted from API requests. However, any field with 4149 // an empty value appearing in NullFields will be sent to the server as 4150 // null. It is an error if a field in this list has a non-empty value. 4151 // This may be used to include null fields in Patch requests. 4152 NullFields []string `json:"-"` 4153} 4154 4155func (s *GoogleCloudVisionV1p1beta1WebDetectionWebEntity) MarshalJSON() ([]byte, error) { 4156 type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebEntity 4157 raw := NoMethod(*s) 4158 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4159} 4160 4161func (s *GoogleCloudVisionV1p1beta1WebDetectionWebEntity) UnmarshalJSON(data []byte) error { 4162 type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebEntity 4163 var s1 struct { 4164 Score gensupport.JSONFloat64 `json:"score"` 4165 *NoMethod 4166 } 4167 s1.NoMethod = (*NoMethod)(s) 4168 if err := json.Unmarshal(data, &s1); err != nil { 4169 return err 4170 } 4171 s.Score = float64(s1.Score) 4172 return nil 4173} 4174 4175// GoogleCloudVisionV1p1beta1WebDetectionWebImage: Metadata for online 4176// images. 4177type GoogleCloudVisionV1p1beta1WebDetectionWebImage struct { 4178 // Score: (Deprecated) Overall relevancy score for the image. 4179 Score float64 `json:"score,omitempty"` 4180 4181 // Url: The result image URL. 4182 Url string `json:"url,omitempty"` 4183 4184 // ForceSendFields is a list of field names (e.g. "Score") to 4185 // unconditionally include in API requests. By default, fields with 4186 // empty values are omitted from API requests. However, any non-pointer, 4187 // non-interface field appearing in ForceSendFields will be sent to the 4188 // server regardless of whether the field is empty or not. This may be 4189 // used to include empty fields in Patch requests. 4190 ForceSendFields []string `json:"-"` 4191 4192 // NullFields is a list of field names (e.g. "Score") to include in API 4193 // requests with the JSON null value. By default, fields with empty 4194 // values are omitted from API requests. However, any field with an 4195 // empty value appearing in NullFields will be sent to the server as 4196 // null. It is an error if a field in this list has a non-empty value. 4197 // This may be used to include null fields in Patch requests. 4198 NullFields []string `json:"-"` 4199} 4200 4201func (s *GoogleCloudVisionV1p1beta1WebDetectionWebImage) MarshalJSON() ([]byte, error) { 4202 type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebImage 4203 raw := NoMethod(*s) 4204 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4205} 4206 4207func (s *GoogleCloudVisionV1p1beta1WebDetectionWebImage) UnmarshalJSON(data []byte) error { 4208 type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebImage 4209 var s1 struct { 4210 Score gensupport.JSONFloat64 `json:"score"` 4211 *NoMethod 4212 } 4213 s1.NoMethod = (*NoMethod)(s) 4214 if err := json.Unmarshal(data, &s1); err != nil { 4215 return err 4216 } 4217 s.Score = float64(s1.Score) 4218 return nil 4219} 4220 4221// GoogleCloudVisionV1p1beta1WebDetectionWebLabel: Label to provide 4222// extra metadata for the web detection. 4223type GoogleCloudVisionV1p1beta1WebDetectionWebLabel struct { 4224 // Label: Label for extra metadata. 4225 Label string `json:"label,omitempty"` 4226 4227 // LanguageCode: The BCP-47 language code for `label`, such as "en-US" 4228 // or "sr-Latn". For more information, see 4229 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 4230 LanguageCode string `json:"languageCode,omitempty"` 4231 4232 // ForceSendFields is a list of field names (e.g. "Label") to 4233 // unconditionally include in API requests. By default, fields with 4234 // empty values are omitted from API requests. However, any non-pointer, 4235 // non-interface field appearing in ForceSendFields will be sent to the 4236 // server regardless of whether the field is empty or not. This may be 4237 // used to include empty fields in Patch requests. 4238 ForceSendFields []string `json:"-"` 4239 4240 // NullFields is a list of field names (e.g. "Label") to include in API 4241 // requests with the JSON null value. By default, fields with empty 4242 // values are omitted from API requests. However, any field with an 4243 // empty value appearing in NullFields will be sent to the server as 4244 // null. It is an error if a field in this list has a non-empty value. 4245 // This may be used to include null fields in Patch requests. 4246 NullFields []string `json:"-"` 4247} 4248 4249func (s *GoogleCloudVisionV1p1beta1WebDetectionWebLabel) MarshalJSON() ([]byte, error) { 4250 type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebLabel 4251 raw := NoMethod(*s) 4252 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4253} 4254 4255// GoogleCloudVisionV1p1beta1WebDetectionWebPage: Metadata for web 4256// pages. 4257type GoogleCloudVisionV1p1beta1WebDetectionWebPage struct { 4258 // FullMatchingImages: Fully matching images on the page. Can include 4259 // resized copies of the query image. 4260 FullMatchingImages []*GoogleCloudVisionV1p1beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"` 4261 4262 // PageTitle: Title for the web page, may contain HTML markups. 4263 PageTitle string `json:"pageTitle,omitempty"` 4264 4265 // PartialMatchingImages: Partial matching images on the page. Those 4266 // images are similar enough to share some key-point features. For 4267 // example an original image will likely have partial matching for its 4268 // crops. 4269 PartialMatchingImages []*GoogleCloudVisionV1p1beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"` 4270 4271 // Score: (Deprecated) Overall relevancy score for the web page. 4272 Score float64 `json:"score,omitempty"` 4273 4274 // Url: The result web page URL. 4275 Url string `json:"url,omitempty"` 4276 4277 // ForceSendFields is a list of field names (e.g. "FullMatchingImages") 4278 // to unconditionally include in API requests. By default, fields with 4279 // empty values are omitted from API requests. However, any non-pointer, 4280 // non-interface field appearing in ForceSendFields will be sent to the 4281 // server regardless of whether the field is empty or not. This may be 4282 // used to include empty fields in Patch requests. 4283 ForceSendFields []string `json:"-"` 4284 4285 // NullFields is a list of field names (e.g. "FullMatchingImages") to 4286 // include in API requests with the JSON null value. By default, fields 4287 // with empty values are omitted from API requests. However, any field 4288 // with an empty value appearing in NullFields will be sent to the 4289 // server as null. It is an error if a field in this list has a 4290 // non-empty value. This may be used to include null fields in Patch 4291 // requests. 4292 NullFields []string `json:"-"` 4293} 4294 4295func (s *GoogleCloudVisionV1p1beta1WebDetectionWebPage) MarshalJSON() ([]byte, error) { 4296 type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebPage 4297 raw := NoMethod(*s) 4298 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4299} 4300 4301func (s *GoogleCloudVisionV1p1beta1WebDetectionWebPage) UnmarshalJSON(data []byte) error { 4302 type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebPage 4303 var s1 struct { 4304 Score gensupport.JSONFloat64 `json:"score"` 4305 *NoMethod 4306 } 4307 s1.NoMethod = (*NoMethod)(s) 4308 if err := json.Unmarshal(data, &s1); err != nil { 4309 return err 4310 } 4311 s.Score = float64(s1.Score) 4312 return nil 4313} 4314 4315// GoogleCloudVisionV1p1beta1Word: A word representation. 4316type GoogleCloudVisionV1p1beta1Word struct { 4317 // BoundingBox: The bounding box for the word. The vertices are in the 4318 // order of top-left, top-right, bottom-right, bottom-left. When a 4319 // rotation of the bounding box is detected the rotation is represented 4320 // as around the top-left corner as defined when the text is read in the 4321 // 'natural' orientation. For example: * when the text is horizontal it 4322 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 4323 // around the top-left corner it becomes: 2----3 | | 1----0 and the 4324 // vertex order will still be (0, 1, 2, 3). 4325 BoundingBox *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingBox,omitempty"` 4326 4327 // Confidence: Confidence of the OCR results for the word. Range [0, 1]. 4328 Confidence float64 `json:"confidence,omitempty"` 4329 4330 // Property: Additional information detected for the word. 4331 Property *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty `json:"property,omitempty"` 4332 4333 // Symbols: List of symbols in the word. The order of the symbols 4334 // follows the natural reading order. 4335 Symbols []*GoogleCloudVisionV1p1beta1Symbol `json:"symbols,omitempty"` 4336 4337 // ForceSendFields is a list of field names (e.g. "BoundingBox") 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. "BoundingBox") 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 *GoogleCloudVisionV1p1beta1Word) MarshalJSON() ([]byte, error) { 4355 type NoMethod GoogleCloudVisionV1p1beta1Word 4356 raw := NoMethod(*s) 4357 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4358} 4359 4360func (s *GoogleCloudVisionV1p1beta1Word) UnmarshalJSON(data []byte) error { 4361 type NoMethod GoogleCloudVisionV1p1beta1Word 4362 var s1 struct { 4363 Confidence gensupport.JSONFloat64 `json:"confidence"` 4364 *NoMethod 4365 } 4366 s1.NoMethod = (*NoMethod)(s) 4367 if err := json.Unmarshal(data, &s1); err != nil { 4368 return err 4369 } 4370 s.Confidence = float64(s1.Confidence) 4371 return nil 4372} 4373 4374// GoogleCloudVisionV1p2beta1AnnotateFileResponse: Response to a single 4375// file annotation request. A file may contain one or more images, which 4376// individually have their own responses. 4377type GoogleCloudVisionV1p2beta1AnnotateFileResponse struct { 4378 // Error: If set, represents the error message for the failed request. 4379 // The `responses` field will not be set in this case. 4380 Error *Status `json:"error,omitempty"` 4381 4382 // InputConfig: Information about the file for which this response is 4383 // generated. 4384 InputConfig *GoogleCloudVisionV1p2beta1InputConfig `json:"inputConfig,omitempty"` 4385 4386 // Responses: Individual responses to images found within the file. This 4387 // field will be empty if the `error` field is set. 4388 Responses []*GoogleCloudVisionV1p2beta1AnnotateImageResponse `json:"responses,omitempty"` 4389 4390 // TotalPages: This field gives the total number of pages in the file. 4391 TotalPages int64 `json:"totalPages,omitempty"` 4392 4393 // ForceSendFields is a list of field names (e.g. "Error") to 4394 // unconditionally include in API requests. By default, fields with 4395 // empty values are omitted from API requests. However, any non-pointer, 4396 // non-interface field appearing in ForceSendFields will be sent to the 4397 // server regardless of whether the field is empty or not. This may be 4398 // used to include empty fields in Patch requests. 4399 ForceSendFields []string `json:"-"` 4400 4401 // NullFields is a list of field names (e.g. "Error") to include in API 4402 // requests with the JSON null value. By default, fields with empty 4403 // values are omitted from API requests. However, any field with an 4404 // empty value appearing in NullFields will be sent to the server as 4405 // null. It is an error if a field in this list has a non-empty value. 4406 // This may be used to include null fields in Patch requests. 4407 NullFields []string `json:"-"` 4408} 4409 4410func (s *GoogleCloudVisionV1p2beta1AnnotateFileResponse) MarshalJSON() ([]byte, error) { 4411 type NoMethod GoogleCloudVisionV1p2beta1AnnotateFileResponse 4412 raw := NoMethod(*s) 4413 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4414} 4415 4416// GoogleCloudVisionV1p2beta1AnnotateImageResponse: Response to an image 4417// annotation request. 4418type GoogleCloudVisionV1p2beta1AnnotateImageResponse struct { 4419 // Context: If present, contextual information is needed to understand 4420 // where this image comes from. 4421 Context *GoogleCloudVisionV1p2beta1ImageAnnotationContext `json:"context,omitempty"` 4422 4423 // CropHintsAnnotation: If present, crop hints have completed 4424 // successfully. 4425 CropHintsAnnotation *GoogleCloudVisionV1p2beta1CropHintsAnnotation `json:"cropHintsAnnotation,omitempty"` 4426 4427 // Error: If set, represents the error message for the operation. Note 4428 // that filled-in image annotations are guaranteed to be correct, even 4429 // when `error` is set. 4430 Error *Status `json:"error,omitempty"` 4431 4432 // FaceAnnotations: If present, face detection has completed 4433 // successfully. 4434 FaceAnnotations []*GoogleCloudVisionV1p2beta1FaceAnnotation `json:"faceAnnotations,omitempty"` 4435 4436 // FullTextAnnotation: If present, text (OCR) detection or document 4437 // (OCR) text detection has completed successfully. This annotation 4438 // provides the structural hierarchy for the OCR detected text. 4439 FullTextAnnotation *GoogleCloudVisionV1p2beta1TextAnnotation `json:"fullTextAnnotation,omitempty"` 4440 4441 // ImagePropertiesAnnotation: If present, image properties were 4442 // extracted successfully. 4443 ImagePropertiesAnnotation *GoogleCloudVisionV1p2beta1ImageProperties `json:"imagePropertiesAnnotation,omitempty"` 4444 4445 // LabelAnnotations: If present, label detection has completed 4446 // successfully. 4447 LabelAnnotations []*GoogleCloudVisionV1p2beta1EntityAnnotation `json:"labelAnnotations,omitempty"` 4448 4449 // LandmarkAnnotations: If present, landmark detection has completed 4450 // successfully. 4451 LandmarkAnnotations []*GoogleCloudVisionV1p2beta1EntityAnnotation `json:"landmarkAnnotations,omitempty"` 4452 4453 // LocalizedObjectAnnotations: If present, localized object detection 4454 // has completed successfully. This will be sorted descending by 4455 // confidence score. 4456 LocalizedObjectAnnotations []*GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation `json:"localizedObjectAnnotations,omitempty"` 4457 4458 // LogoAnnotations: If present, logo detection has completed 4459 // successfully. 4460 LogoAnnotations []*GoogleCloudVisionV1p2beta1EntityAnnotation `json:"logoAnnotations,omitempty"` 4461 4462 // ProductSearchResults: If present, product search has completed 4463 // successfully. 4464 ProductSearchResults *GoogleCloudVisionV1p2beta1ProductSearchResults `json:"productSearchResults,omitempty"` 4465 4466 // SafeSearchAnnotation: If present, safe-search annotation has 4467 // completed successfully. 4468 SafeSearchAnnotation *GoogleCloudVisionV1p2beta1SafeSearchAnnotation `json:"safeSearchAnnotation,omitempty"` 4469 4470 // TextAnnotations: If present, text (OCR) detection has completed 4471 // successfully. 4472 TextAnnotations []*GoogleCloudVisionV1p2beta1EntityAnnotation `json:"textAnnotations,omitempty"` 4473 4474 // WebDetection: If present, web detection has completed successfully. 4475 WebDetection *GoogleCloudVisionV1p2beta1WebDetection `json:"webDetection,omitempty"` 4476 4477 // ForceSendFields is a list of field names (e.g. "Context") to 4478 // unconditionally include in API requests. By default, fields with 4479 // empty values are omitted from API requests. However, any non-pointer, 4480 // non-interface field appearing in ForceSendFields will be sent to the 4481 // server regardless of whether the field is empty or not. This may be 4482 // used to include empty fields in Patch requests. 4483 ForceSendFields []string `json:"-"` 4484 4485 // NullFields is a list of field names (e.g. "Context") to include in 4486 // API requests with the JSON null value. By default, fields with empty 4487 // values are omitted from API requests. However, any field with an 4488 // empty value appearing in NullFields will be sent to the server as 4489 // null. It is an error if a field in this list has a non-empty value. 4490 // This may be used to include null fields in Patch requests. 4491 NullFields []string `json:"-"` 4492} 4493 4494func (s *GoogleCloudVisionV1p2beta1AnnotateImageResponse) MarshalJSON() ([]byte, error) { 4495 type NoMethod GoogleCloudVisionV1p2beta1AnnotateImageResponse 4496 raw := NoMethod(*s) 4497 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4498} 4499 4500// GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse: The response for 4501// a single offline file annotation request. 4502type GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse struct { 4503 // OutputConfig: The output location and metadata from 4504 // AsyncAnnotateFileRequest. 4505 OutputConfig *GoogleCloudVisionV1p2beta1OutputConfig `json:"outputConfig,omitempty"` 4506 4507 // ForceSendFields is a list of field names (e.g. "OutputConfig") 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. "OutputConfig") to include 4516 // in API requests with the JSON null value. By default, fields with 4517 // empty values are omitted from API requests. However, any field with 4518 // an 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 *GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse) MarshalJSON() ([]byte, error) { 4525 type NoMethod GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse 4526 raw := NoMethod(*s) 4527 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4528} 4529 4530// GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse: Response 4531// to an async batch file annotation request. 4532type GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse struct { 4533 // Responses: The list of file annotation responses, one for each 4534 // request in AsyncBatchAnnotateFilesRequest. 4535 Responses []*GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse `json:"responses,omitempty"` 4536 4537 // ForceSendFields is a list of field names (e.g. "Responses") to 4538 // unconditionally include in API requests. By default, fields with 4539 // empty values are omitted from API requests. However, any non-pointer, 4540 // non-interface field appearing in ForceSendFields will be sent to the 4541 // server regardless of whether the field is empty or not. This may be 4542 // used to include empty fields in Patch requests. 4543 ForceSendFields []string `json:"-"` 4544 4545 // NullFields is a list of field names (e.g. "Responses") to include in 4546 // API requests with the JSON null value. By default, fields with empty 4547 // values are omitted from API requests. However, any field with an 4548 // empty value appearing in NullFields will be sent to the server as 4549 // null. It is an error if a field in this list has a non-empty value. 4550 // This may be used to include null fields in Patch requests. 4551 NullFields []string `json:"-"` 4552} 4553 4554func (s *GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) { 4555 type NoMethod GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse 4556 raw := NoMethod(*s) 4557 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4558} 4559 4560// GoogleCloudVisionV1p2beta1Block: Logical element on the page. 4561type GoogleCloudVisionV1p2beta1Block struct { 4562 // BlockType: Detected block type (text, image etc) for this block. 4563 // 4564 // Possible values: 4565 // "UNKNOWN" - Unknown block type. 4566 // "TEXT" - Regular text block. 4567 // "TABLE" - Table block. 4568 // "PICTURE" - Image block. 4569 // "RULER" - Horizontal/vertical line box. 4570 // "BARCODE" - Barcode block. 4571 BlockType string `json:"blockType,omitempty"` 4572 4573 // BoundingBox: The bounding box for the block. The vertices are in the 4574 // order of top-left, top-right, bottom-right, bottom-left. When a 4575 // rotation of the bounding box is detected the rotation is represented 4576 // as around the top-left corner as defined when the text is read in the 4577 // 'natural' orientation. For example: * when the text is horizontal it 4578 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 4579 // around the top-left corner it becomes: 2----3 | | 1----0 and the 4580 // vertex order will still be (0, 1, 2, 3). 4581 BoundingBox *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingBox,omitempty"` 4582 4583 // Confidence: Confidence of the OCR results on the block. Range [0, 1]. 4584 Confidence float64 `json:"confidence,omitempty"` 4585 4586 // Paragraphs: List of paragraphs in this block (if this blocks is of 4587 // type text). 4588 Paragraphs []*GoogleCloudVisionV1p2beta1Paragraph `json:"paragraphs,omitempty"` 4589 4590 // Property: Additional information detected for the block. 4591 Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"` 4592 4593 // ForceSendFields is a list of field names (e.g. "BlockType") to 4594 // unconditionally include in API requests. By default, fields with 4595 // empty values are omitted from API requests. However, any non-pointer, 4596 // non-interface field appearing in ForceSendFields will be sent to the 4597 // server regardless of whether the field is empty or not. This may be 4598 // used to include empty fields in Patch requests. 4599 ForceSendFields []string `json:"-"` 4600 4601 // NullFields is a list of field names (e.g. "BlockType") to include in 4602 // API requests with the JSON null value. By default, fields with empty 4603 // values are omitted from API requests. However, any field with an 4604 // empty value appearing in NullFields will be sent to the server as 4605 // null. It is an error if a field in this list has a non-empty value. 4606 // This may be used to include null fields in Patch requests. 4607 NullFields []string `json:"-"` 4608} 4609 4610func (s *GoogleCloudVisionV1p2beta1Block) MarshalJSON() ([]byte, error) { 4611 type NoMethod GoogleCloudVisionV1p2beta1Block 4612 raw := NoMethod(*s) 4613 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4614} 4615 4616func (s *GoogleCloudVisionV1p2beta1Block) UnmarshalJSON(data []byte) error { 4617 type NoMethod GoogleCloudVisionV1p2beta1Block 4618 var s1 struct { 4619 Confidence gensupport.JSONFloat64 `json:"confidence"` 4620 *NoMethod 4621 } 4622 s1.NoMethod = (*NoMethod)(s) 4623 if err := json.Unmarshal(data, &s1); err != nil { 4624 return err 4625 } 4626 s.Confidence = float64(s1.Confidence) 4627 return nil 4628} 4629 4630// GoogleCloudVisionV1p2beta1BoundingPoly: A bounding polygon for the 4631// detected image annotation. 4632type GoogleCloudVisionV1p2beta1BoundingPoly struct { 4633 // NormalizedVertices: The bounding polygon normalized vertices. 4634 NormalizedVertices []*GoogleCloudVisionV1p2beta1NormalizedVertex `json:"normalizedVertices,omitempty"` 4635 4636 // Vertices: The bounding polygon vertices. 4637 Vertices []*GoogleCloudVisionV1p2beta1Vertex `json:"vertices,omitempty"` 4638 4639 // ForceSendFields is a list of field names (e.g. "NormalizedVertices") 4640 // to unconditionally include in API requests. By default, fields with 4641 // empty values are omitted from API requests. However, any non-pointer, 4642 // non-interface field appearing in ForceSendFields will be sent to the 4643 // server regardless of whether the field is empty or not. This may be 4644 // used to include empty fields in Patch requests. 4645 ForceSendFields []string `json:"-"` 4646 4647 // NullFields is a list of field names (e.g. "NormalizedVertices") to 4648 // include in API requests with the JSON null value. By default, fields 4649 // with empty values are omitted from API requests. However, any field 4650 // with an empty value appearing in NullFields will be sent to the 4651 // server as null. It is an error if a field in this list has a 4652 // non-empty value. This may be used to include null fields in Patch 4653 // requests. 4654 NullFields []string `json:"-"` 4655} 4656 4657func (s *GoogleCloudVisionV1p2beta1BoundingPoly) MarshalJSON() ([]byte, error) { 4658 type NoMethod GoogleCloudVisionV1p2beta1BoundingPoly 4659 raw := NoMethod(*s) 4660 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4661} 4662 4663// GoogleCloudVisionV1p2beta1ColorInfo: Color information consists of 4664// RGB channels, score, and the fraction of the image that the color 4665// occupies in the image. 4666type GoogleCloudVisionV1p2beta1ColorInfo struct { 4667 // Color: RGB components of the color. 4668 Color *Color `json:"color,omitempty"` 4669 4670 // PixelFraction: The fraction of pixels the color occupies in the 4671 // image. Value in range [0, 1]. 4672 PixelFraction float64 `json:"pixelFraction,omitempty"` 4673 4674 // Score: Image-specific score for this color. Value in range [0, 1]. 4675 Score float64 `json:"score,omitempty"` 4676 4677 // ForceSendFields is a list of field names (e.g. "Color") to 4678 // unconditionally include in API requests. By default, fields with 4679 // empty values are omitted from API requests. However, any non-pointer, 4680 // non-interface field appearing in ForceSendFields will be sent to the 4681 // server regardless of whether the field is empty or not. This may be 4682 // used to include empty fields in Patch requests. 4683 ForceSendFields []string `json:"-"` 4684 4685 // NullFields is a list of field names (e.g. "Color") to include in API 4686 // requests with the JSON null value. By default, fields with empty 4687 // values are omitted from API requests. However, any field with an 4688 // empty value appearing in NullFields will be sent to the server as 4689 // null. It is an error if a field in this list has a non-empty value. 4690 // This may be used to include null fields in Patch requests. 4691 NullFields []string `json:"-"` 4692} 4693 4694func (s *GoogleCloudVisionV1p2beta1ColorInfo) MarshalJSON() ([]byte, error) { 4695 type NoMethod GoogleCloudVisionV1p2beta1ColorInfo 4696 raw := NoMethod(*s) 4697 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4698} 4699 4700func (s *GoogleCloudVisionV1p2beta1ColorInfo) UnmarshalJSON(data []byte) error { 4701 type NoMethod GoogleCloudVisionV1p2beta1ColorInfo 4702 var s1 struct { 4703 PixelFraction gensupport.JSONFloat64 `json:"pixelFraction"` 4704 Score gensupport.JSONFloat64 `json:"score"` 4705 *NoMethod 4706 } 4707 s1.NoMethod = (*NoMethod)(s) 4708 if err := json.Unmarshal(data, &s1); err != nil { 4709 return err 4710 } 4711 s.PixelFraction = float64(s1.PixelFraction) 4712 s.Score = float64(s1.Score) 4713 return nil 4714} 4715 4716// GoogleCloudVisionV1p2beta1CropHint: Single crop hint that is used to 4717// generate a new crop when serving an image. 4718type GoogleCloudVisionV1p2beta1CropHint struct { 4719 // BoundingPoly: The bounding polygon for the crop region. The 4720 // coordinates of the bounding box are in the original image's scale. 4721 BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"` 4722 4723 // Confidence: Confidence of this being a salient region. Range [0, 1]. 4724 Confidence float64 `json:"confidence,omitempty"` 4725 4726 // ImportanceFraction: Fraction of importance of this salient region 4727 // with respect to the original image. 4728 ImportanceFraction float64 `json:"importanceFraction,omitempty"` 4729 4730 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 4731 // unconditionally include in API requests. By default, fields with 4732 // empty values are omitted from API requests. However, any non-pointer, 4733 // non-interface field appearing in ForceSendFields will be sent to the 4734 // server regardless of whether the field is empty or not. This may be 4735 // used to include empty fields in Patch requests. 4736 ForceSendFields []string `json:"-"` 4737 4738 // NullFields is a list of field names (e.g. "BoundingPoly") to include 4739 // in API requests with the JSON null value. By default, fields with 4740 // empty values are omitted from API requests. However, any field with 4741 // an empty value appearing in NullFields will be sent to the server as 4742 // null. It is an error if a field in this list has a non-empty value. 4743 // This may be used to include null fields in Patch requests. 4744 NullFields []string `json:"-"` 4745} 4746 4747func (s *GoogleCloudVisionV1p2beta1CropHint) MarshalJSON() ([]byte, error) { 4748 type NoMethod GoogleCloudVisionV1p2beta1CropHint 4749 raw := NoMethod(*s) 4750 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4751} 4752 4753func (s *GoogleCloudVisionV1p2beta1CropHint) UnmarshalJSON(data []byte) error { 4754 type NoMethod GoogleCloudVisionV1p2beta1CropHint 4755 var s1 struct { 4756 Confidence gensupport.JSONFloat64 `json:"confidence"` 4757 ImportanceFraction gensupport.JSONFloat64 `json:"importanceFraction"` 4758 *NoMethod 4759 } 4760 s1.NoMethod = (*NoMethod)(s) 4761 if err := json.Unmarshal(data, &s1); err != nil { 4762 return err 4763 } 4764 s.Confidence = float64(s1.Confidence) 4765 s.ImportanceFraction = float64(s1.ImportanceFraction) 4766 return nil 4767} 4768 4769// GoogleCloudVisionV1p2beta1CropHintsAnnotation: Set of crop hints that 4770// are used to generate new crops when serving images. 4771type GoogleCloudVisionV1p2beta1CropHintsAnnotation struct { 4772 // CropHints: Crop hint results. 4773 CropHints []*GoogleCloudVisionV1p2beta1CropHint `json:"cropHints,omitempty"` 4774 4775 // ForceSendFields is a list of field names (e.g. "CropHints") to 4776 // unconditionally include in API requests. By default, fields with 4777 // empty values are omitted from API requests. However, any non-pointer, 4778 // non-interface field appearing in ForceSendFields will be sent to the 4779 // server regardless of whether the field is empty or not. This may be 4780 // used to include empty fields in Patch requests. 4781 ForceSendFields []string `json:"-"` 4782 4783 // NullFields is a list of field names (e.g. "CropHints") to include in 4784 // API requests with the JSON null value. By default, fields with empty 4785 // values are omitted from API requests. However, any field with an 4786 // empty value appearing in NullFields will be sent to the server as 4787 // null. It is an error if a field in this list has a non-empty value. 4788 // This may be used to include null fields in Patch requests. 4789 NullFields []string `json:"-"` 4790} 4791 4792func (s *GoogleCloudVisionV1p2beta1CropHintsAnnotation) MarshalJSON() ([]byte, error) { 4793 type NoMethod GoogleCloudVisionV1p2beta1CropHintsAnnotation 4794 raw := NoMethod(*s) 4795 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4796} 4797 4798// GoogleCloudVisionV1p2beta1DominantColorsAnnotation: Set of dominant 4799// colors and their corresponding scores. 4800type GoogleCloudVisionV1p2beta1DominantColorsAnnotation struct { 4801 // Colors: RGB color values with their score and pixel fraction. 4802 Colors []*GoogleCloudVisionV1p2beta1ColorInfo `json:"colors,omitempty"` 4803 4804 // ForceSendFields is a list of field names (e.g. "Colors") to 4805 // unconditionally include in API requests. By default, fields with 4806 // empty values are omitted from API requests. However, any non-pointer, 4807 // non-interface field appearing in ForceSendFields will be sent to the 4808 // server regardless of whether the field is empty or not. This may be 4809 // used to include empty fields in Patch requests. 4810 ForceSendFields []string `json:"-"` 4811 4812 // NullFields is a list of field names (e.g. "Colors") to include in API 4813 // requests with the JSON null value. By default, fields with empty 4814 // values are omitted from API requests. However, any field with an 4815 // empty value appearing in NullFields will be sent to the server as 4816 // null. It is an error if a field in this list has a non-empty value. 4817 // This may be used to include null fields in Patch requests. 4818 NullFields []string `json:"-"` 4819} 4820 4821func (s *GoogleCloudVisionV1p2beta1DominantColorsAnnotation) MarshalJSON() ([]byte, error) { 4822 type NoMethod GoogleCloudVisionV1p2beta1DominantColorsAnnotation 4823 raw := NoMethod(*s) 4824 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4825} 4826 4827// GoogleCloudVisionV1p2beta1EntityAnnotation: Set of detected entity 4828// features. 4829type GoogleCloudVisionV1p2beta1EntityAnnotation struct { 4830 // BoundingPoly: Image region to which this entity belongs. Not produced 4831 // for `LABEL_DETECTION` features. 4832 BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"` 4833 4834 // Confidence: **Deprecated. Use `score` instead.** The accuracy of the 4835 // entity detection in an image. For example, for an image in which the 4836 // "Eiffel Tower" entity is detected, this field represents the 4837 // confidence that there is a tower in the query image. Range [0, 1]. 4838 Confidence float64 `json:"confidence,omitempty"` 4839 4840 // Description: Entity textual description, expressed in its `locale` 4841 // language. 4842 Description string `json:"description,omitempty"` 4843 4844 // Locale: The language code for the locale in which the entity textual 4845 // `description` is expressed. 4846 Locale string `json:"locale,omitempty"` 4847 4848 // Locations: The location information for the detected entity. Multiple 4849 // `LocationInfo` elements can be present because one location may 4850 // indicate the location of the scene in the image, and another location 4851 // may indicate the location of the place where the image was taken. 4852 // Location information is usually present for landmarks. 4853 Locations []*GoogleCloudVisionV1p2beta1LocationInfo `json:"locations,omitempty"` 4854 4855 // Mid: Opaque entity ID. Some IDs may be available in Google Knowledge 4856 // Graph Search API (https://developers.google.com/knowledge-graph/). 4857 Mid string `json:"mid,omitempty"` 4858 4859 // Properties: Some entities may have optional user-supplied `Property` 4860 // (name/value) fields, such a score or string that qualifies the 4861 // entity. 4862 Properties []*GoogleCloudVisionV1p2beta1Property `json:"properties,omitempty"` 4863 4864 // Score: Overall score of the result. Range [0, 1]. 4865 Score float64 `json:"score,omitempty"` 4866 4867 // Topicality: The relevancy of the ICA (Image Content Annotation) label 4868 // to the image. For example, the relevancy of "tower" is likely higher 4869 // to an image containing the detected "Eiffel Tower" than to an image 4870 // containing a detected distant towering building, even though the 4871 // confidence that there is a tower in each image may be the same. Range 4872 // [0, 1]. 4873 Topicality float64 `json:"topicality,omitempty"` 4874 4875 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 4876 // unconditionally include in API requests. By default, fields with 4877 // empty values are omitted from API requests. However, any non-pointer, 4878 // non-interface field appearing in ForceSendFields will be sent to the 4879 // server regardless of whether the field is empty or not. This may be 4880 // used to include empty fields in Patch requests. 4881 ForceSendFields []string `json:"-"` 4882 4883 // NullFields is a list of field names (e.g. "BoundingPoly") to include 4884 // in API requests with the JSON null value. By default, fields with 4885 // empty values are omitted from API requests. However, any field with 4886 // an empty value appearing in NullFields will be sent to the server as 4887 // null. It is an error if a field in this list has a non-empty value. 4888 // This may be used to include null fields in Patch requests. 4889 NullFields []string `json:"-"` 4890} 4891 4892func (s *GoogleCloudVisionV1p2beta1EntityAnnotation) MarshalJSON() ([]byte, error) { 4893 type NoMethod GoogleCloudVisionV1p2beta1EntityAnnotation 4894 raw := NoMethod(*s) 4895 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4896} 4897 4898func (s *GoogleCloudVisionV1p2beta1EntityAnnotation) UnmarshalJSON(data []byte) error { 4899 type NoMethod GoogleCloudVisionV1p2beta1EntityAnnotation 4900 var s1 struct { 4901 Confidence gensupport.JSONFloat64 `json:"confidence"` 4902 Score gensupport.JSONFloat64 `json:"score"` 4903 Topicality gensupport.JSONFloat64 `json:"topicality"` 4904 *NoMethod 4905 } 4906 s1.NoMethod = (*NoMethod)(s) 4907 if err := json.Unmarshal(data, &s1); err != nil { 4908 return err 4909 } 4910 s.Confidence = float64(s1.Confidence) 4911 s.Score = float64(s1.Score) 4912 s.Topicality = float64(s1.Topicality) 4913 return nil 4914} 4915 4916// GoogleCloudVisionV1p2beta1FaceAnnotation: A face annotation object 4917// contains the results of face detection. 4918type GoogleCloudVisionV1p2beta1FaceAnnotation struct { 4919 // AngerLikelihood: Anger likelihood. 4920 // 4921 // Possible values: 4922 // "UNKNOWN" - Unknown likelihood. 4923 // "VERY_UNLIKELY" - It is very unlikely. 4924 // "UNLIKELY" - It is unlikely. 4925 // "POSSIBLE" - It is possible. 4926 // "LIKELY" - It is likely. 4927 // "VERY_LIKELY" - It is very likely. 4928 AngerLikelihood string `json:"angerLikelihood,omitempty"` 4929 4930 // BlurredLikelihood: Blurred likelihood. 4931 // 4932 // Possible values: 4933 // "UNKNOWN" - Unknown likelihood. 4934 // "VERY_UNLIKELY" - It is very unlikely. 4935 // "UNLIKELY" - It is unlikely. 4936 // "POSSIBLE" - It is possible. 4937 // "LIKELY" - It is likely. 4938 // "VERY_LIKELY" - It is very likely. 4939 BlurredLikelihood string `json:"blurredLikelihood,omitempty"` 4940 4941 // BoundingPoly: The bounding polygon around the face. The coordinates 4942 // of the bounding box are in the original image's scale. The bounding 4943 // box is computed to "frame" the face in accordance with human 4944 // expectations. It is based on the landmarker results. Note that one or 4945 // more x and/or y coordinates may not be generated in the 4946 // `BoundingPoly` (the polygon will be unbounded) if only a partial face 4947 // appears in the image to be annotated. 4948 BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"` 4949 4950 // DetectionConfidence: Detection confidence. Range [0, 1]. 4951 DetectionConfidence float64 `json:"detectionConfidence,omitempty"` 4952 4953 // FdBoundingPoly: The `fd_bounding_poly` bounding polygon is tighter 4954 // than the `boundingPoly`, and encloses only the skin part of the face. 4955 // Typically, it is used to eliminate the face from any image analysis 4956 // that detects the "amount of skin" visible in an image. It is not 4957 // based on the landmarker results, only on the initial face detection, 4958 // hence the fd (face detection) prefix. 4959 FdBoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"fdBoundingPoly,omitempty"` 4960 4961 // HeadwearLikelihood: Headwear likelihood. 4962 // 4963 // Possible values: 4964 // "UNKNOWN" - Unknown likelihood. 4965 // "VERY_UNLIKELY" - It is very unlikely. 4966 // "UNLIKELY" - It is unlikely. 4967 // "POSSIBLE" - It is possible. 4968 // "LIKELY" - It is likely. 4969 // "VERY_LIKELY" - It is very likely. 4970 HeadwearLikelihood string `json:"headwearLikelihood,omitempty"` 4971 4972 // JoyLikelihood: Joy likelihood. 4973 // 4974 // Possible values: 4975 // "UNKNOWN" - Unknown likelihood. 4976 // "VERY_UNLIKELY" - It is very unlikely. 4977 // "UNLIKELY" - It is unlikely. 4978 // "POSSIBLE" - It is possible. 4979 // "LIKELY" - It is likely. 4980 // "VERY_LIKELY" - It is very likely. 4981 JoyLikelihood string `json:"joyLikelihood,omitempty"` 4982 4983 // LandmarkingConfidence: Face landmarking confidence. Range [0, 1]. 4984 LandmarkingConfidence float64 `json:"landmarkingConfidence,omitempty"` 4985 4986 // Landmarks: Detected face landmarks. 4987 Landmarks []*GoogleCloudVisionV1p2beta1FaceAnnotationLandmark `json:"landmarks,omitempty"` 4988 4989 // PanAngle: Yaw angle, which indicates the leftward/rightward angle 4990 // that the face is pointing relative to the vertical plane 4991 // perpendicular to the image. Range [-180,180]. 4992 PanAngle float64 `json:"panAngle,omitempty"` 4993 4994 // RollAngle: Roll angle, which indicates the amount of 4995 // clockwise/anti-clockwise rotation of the face relative to the image 4996 // vertical about the axis perpendicular to the face. Range [-180,180]. 4997 RollAngle float64 `json:"rollAngle,omitempty"` 4998 4999 // SorrowLikelihood: Sorrow likelihood. 5000 // 5001 // Possible values: 5002 // "UNKNOWN" - Unknown likelihood. 5003 // "VERY_UNLIKELY" - It is very unlikely. 5004 // "UNLIKELY" - It is unlikely. 5005 // "POSSIBLE" - It is possible. 5006 // "LIKELY" - It is likely. 5007 // "VERY_LIKELY" - It is very likely. 5008 SorrowLikelihood string `json:"sorrowLikelihood,omitempty"` 5009 5010 // SurpriseLikelihood: Surprise likelihood. 5011 // 5012 // Possible values: 5013 // "UNKNOWN" - Unknown likelihood. 5014 // "VERY_UNLIKELY" - It is very unlikely. 5015 // "UNLIKELY" - It is unlikely. 5016 // "POSSIBLE" - It is possible. 5017 // "LIKELY" - It is likely. 5018 // "VERY_LIKELY" - It is very likely. 5019 SurpriseLikelihood string `json:"surpriseLikelihood,omitempty"` 5020 5021 // TiltAngle: Pitch angle, which indicates the upwards/downwards angle 5022 // that the face is pointing relative to the image's horizontal plane. 5023 // Range [-180,180]. 5024 TiltAngle float64 `json:"tiltAngle,omitempty"` 5025 5026 // UnderExposedLikelihood: Under-exposed likelihood. 5027 // 5028 // Possible values: 5029 // "UNKNOWN" - Unknown likelihood. 5030 // "VERY_UNLIKELY" - It is very unlikely. 5031 // "UNLIKELY" - It is unlikely. 5032 // "POSSIBLE" - It is possible. 5033 // "LIKELY" - It is likely. 5034 // "VERY_LIKELY" - It is very likely. 5035 UnderExposedLikelihood string `json:"underExposedLikelihood,omitempty"` 5036 5037 // ForceSendFields is a list of field names (e.g. "AngerLikelihood") 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. "AngerLikelihood") to 5046 // include in API requests with the JSON null value. By default, fields 5047 // with empty values are omitted from API requests. However, any field 5048 // with an empty value appearing in NullFields will be sent to the 5049 // server as null. It is an error if a field in this list has a 5050 // non-empty value. This may be used to include null fields in Patch 5051 // requests. 5052 NullFields []string `json:"-"` 5053} 5054 5055func (s *GoogleCloudVisionV1p2beta1FaceAnnotation) MarshalJSON() ([]byte, error) { 5056 type NoMethod GoogleCloudVisionV1p2beta1FaceAnnotation 5057 raw := NoMethod(*s) 5058 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5059} 5060 5061func (s *GoogleCloudVisionV1p2beta1FaceAnnotation) UnmarshalJSON(data []byte) error { 5062 type NoMethod GoogleCloudVisionV1p2beta1FaceAnnotation 5063 var s1 struct { 5064 DetectionConfidence gensupport.JSONFloat64 `json:"detectionConfidence"` 5065 LandmarkingConfidence gensupport.JSONFloat64 `json:"landmarkingConfidence"` 5066 PanAngle gensupport.JSONFloat64 `json:"panAngle"` 5067 RollAngle gensupport.JSONFloat64 `json:"rollAngle"` 5068 TiltAngle gensupport.JSONFloat64 `json:"tiltAngle"` 5069 *NoMethod 5070 } 5071 s1.NoMethod = (*NoMethod)(s) 5072 if err := json.Unmarshal(data, &s1); err != nil { 5073 return err 5074 } 5075 s.DetectionConfidence = float64(s1.DetectionConfidence) 5076 s.LandmarkingConfidence = float64(s1.LandmarkingConfidence) 5077 s.PanAngle = float64(s1.PanAngle) 5078 s.RollAngle = float64(s1.RollAngle) 5079 s.TiltAngle = float64(s1.TiltAngle) 5080 return nil 5081} 5082 5083// GoogleCloudVisionV1p2beta1FaceAnnotationLandmark: A face-specific 5084// landmark (for example, a face feature). 5085type GoogleCloudVisionV1p2beta1FaceAnnotationLandmark struct { 5086 // Position: Face landmark position. 5087 Position *GoogleCloudVisionV1p2beta1Position `json:"position,omitempty"` 5088 5089 // Type: Face landmark type. 5090 // 5091 // Possible values: 5092 // "UNKNOWN_LANDMARK" - Unknown face landmark detected. Should not be 5093 // filled. 5094 // "LEFT_EYE" - Left eye. 5095 // "RIGHT_EYE" - Right eye. 5096 // "LEFT_OF_LEFT_EYEBROW" - Left of left eyebrow. 5097 // "RIGHT_OF_LEFT_EYEBROW" - Right of left eyebrow. 5098 // "LEFT_OF_RIGHT_EYEBROW" - Left of right eyebrow. 5099 // "RIGHT_OF_RIGHT_EYEBROW" - Right of right eyebrow. 5100 // "MIDPOINT_BETWEEN_EYES" - Midpoint between eyes. 5101 // "NOSE_TIP" - Nose tip. 5102 // "UPPER_LIP" - Upper lip. 5103 // "LOWER_LIP" - Lower lip. 5104 // "MOUTH_LEFT" - Mouth left. 5105 // "MOUTH_RIGHT" - Mouth right. 5106 // "MOUTH_CENTER" - Mouth center. 5107 // "NOSE_BOTTOM_RIGHT" - Nose, bottom right. 5108 // "NOSE_BOTTOM_LEFT" - Nose, bottom left. 5109 // "NOSE_BOTTOM_CENTER" - Nose, bottom center. 5110 // "LEFT_EYE_TOP_BOUNDARY" - Left eye, top boundary. 5111 // "LEFT_EYE_RIGHT_CORNER" - Left eye, right corner. 5112 // "LEFT_EYE_BOTTOM_BOUNDARY" - Left eye, bottom boundary. 5113 // "LEFT_EYE_LEFT_CORNER" - Left eye, left corner. 5114 // "RIGHT_EYE_TOP_BOUNDARY" - Right eye, top boundary. 5115 // "RIGHT_EYE_RIGHT_CORNER" - Right eye, right corner. 5116 // "RIGHT_EYE_BOTTOM_BOUNDARY" - Right eye, bottom boundary. 5117 // "RIGHT_EYE_LEFT_CORNER" - Right eye, left corner. 5118 // "LEFT_EYEBROW_UPPER_MIDPOINT" - Left eyebrow, upper midpoint. 5119 // "RIGHT_EYEBROW_UPPER_MIDPOINT" - Right eyebrow, upper midpoint. 5120 // "LEFT_EAR_TRAGION" - Left ear tragion. 5121 // "RIGHT_EAR_TRAGION" - Right ear tragion. 5122 // "LEFT_EYE_PUPIL" - Left eye pupil. 5123 // "RIGHT_EYE_PUPIL" - Right eye pupil. 5124 // "FOREHEAD_GLABELLA" - Forehead glabella. 5125 // "CHIN_GNATHION" - Chin gnathion. 5126 // "CHIN_LEFT_GONION" - Chin left gonion. 5127 // "CHIN_RIGHT_GONION" - Chin right gonion. 5128 // "LEFT_CHEEK_CENTER" - Left cheek center. 5129 // "RIGHT_CHEEK_CENTER" - Right cheek center. 5130 Type string `json:"type,omitempty"` 5131 5132 // ForceSendFields is a list of field names (e.g. "Position") to 5133 // unconditionally include in API requests. By default, fields with 5134 // empty values are omitted from API requests. However, any non-pointer, 5135 // non-interface field appearing in ForceSendFields will be sent to the 5136 // server regardless of whether the field is empty or not. This may be 5137 // used to include empty fields in Patch requests. 5138 ForceSendFields []string `json:"-"` 5139 5140 // NullFields is a list of field names (e.g. "Position") to include in 5141 // API requests with the JSON null value. By default, fields with empty 5142 // values are omitted from API requests. However, any field with an 5143 // empty value appearing in NullFields will be sent to the server as 5144 // null. It is an error if a field in this list has a non-empty value. 5145 // This may be used to include null fields in Patch requests. 5146 NullFields []string `json:"-"` 5147} 5148 5149func (s *GoogleCloudVisionV1p2beta1FaceAnnotationLandmark) MarshalJSON() ([]byte, error) { 5150 type NoMethod GoogleCloudVisionV1p2beta1FaceAnnotationLandmark 5151 raw := NoMethod(*s) 5152 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5153} 5154 5155// GoogleCloudVisionV1p2beta1GcsDestination: The Google Cloud Storage 5156// location where the output will be written to. 5157type GoogleCloudVisionV1p2beta1GcsDestination struct { 5158 // Uri: Google Cloud Storage URI prefix where the results will be 5159 // stored. Results will be in JSON format and preceded by its 5160 // corresponding input URI prefix. This field can either represent a gcs 5161 // file prefix or gcs directory. In either case, the uri should be 5162 // unique because in order to get all of the output files, you will need 5163 // to do a wildcard gcs search on the uri prefix you provide. Examples: 5164 // * File Prefix: gs://bucket-name/here/filenameprefix The output files 5165 // will be created in gs://bucket-name/here/ and the names of the output 5166 // files will begin with "filenameprefix". * Directory Prefix: 5167 // gs://bucket-name/some/location/ The output files will be created in 5168 // gs://bucket-name/some/location/ and the names of the output files 5169 // could be anything because there was no filename prefix specified. If 5170 // multiple outputs, each response is still AnnotateFileResponse, each 5171 // of which contains some subset of the full list of 5172 // AnnotateImageResponse. Multiple outputs can happen if, for example, 5173 // the output JSON is too large and overflows into multiple sharded 5174 // files. 5175 Uri string `json:"uri,omitempty"` 5176 5177 // ForceSendFields is a list of field names (e.g. "Uri") to 5178 // unconditionally include in API requests. By default, fields with 5179 // empty values are omitted from API requests. However, any non-pointer, 5180 // non-interface field appearing in ForceSendFields will be sent to the 5181 // server regardless of whether the field is empty or not. This may be 5182 // used to include empty fields in Patch requests. 5183 ForceSendFields []string `json:"-"` 5184 5185 // NullFields is a list of field names (e.g. "Uri") to include in API 5186 // requests with the JSON null value. By default, fields with empty 5187 // values are omitted from API requests. However, any field with an 5188 // empty value appearing in NullFields will be sent to the server as 5189 // null. It is an error if a field in this list has a non-empty value. 5190 // This may be used to include null fields in Patch requests. 5191 NullFields []string `json:"-"` 5192} 5193 5194func (s *GoogleCloudVisionV1p2beta1GcsDestination) MarshalJSON() ([]byte, error) { 5195 type NoMethod GoogleCloudVisionV1p2beta1GcsDestination 5196 raw := NoMethod(*s) 5197 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5198} 5199 5200// GoogleCloudVisionV1p2beta1GcsSource: The Google Cloud Storage 5201// location where the input will be read from. 5202type GoogleCloudVisionV1p2beta1GcsSource struct { 5203 // Uri: Google Cloud Storage URI for the input file. This must only be a 5204 // Google Cloud Storage object. Wildcards are not currently supported. 5205 Uri string `json:"uri,omitempty"` 5206 5207 // ForceSendFields is a list of field names (e.g. "Uri") to 5208 // unconditionally include in API requests. By default, fields with 5209 // empty values are omitted from API requests. However, any non-pointer, 5210 // non-interface field appearing in ForceSendFields will be sent to the 5211 // server regardless of whether the field is empty or not. This may be 5212 // used to include empty fields in Patch requests. 5213 ForceSendFields []string `json:"-"` 5214 5215 // NullFields is a list of field names (e.g. "Uri") to include in API 5216 // requests with the JSON null value. By default, fields with empty 5217 // values are omitted from API requests. However, any field with an 5218 // empty value appearing in NullFields will be sent to the server as 5219 // null. It is an error if a field in this list has a non-empty value. 5220 // This may be used to include null fields in Patch requests. 5221 NullFields []string `json:"-"` 5222} 5223 5224func (s *GoogleCloudVisionV1p2beta1GcsSource) MarshalJSON() ([]byte, error) { 5225 type NoMethod GoogleCloudVisionV1p2beta1GcsSource 5226 raw := NoMethod(*s) 5227 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5228} 5229 5230// GoogleCloudVisionV1p2beta1ImageAnnotationContext: If an image was 5231// produced from a file (e.g. a PDF), this message gives information 5232// about the source of that image. 5233type GoogleCloudVisionV1p2beta1ImageAnnotationContext struct { 5234 // PageNumber: If the file was a PDF or TIFF, this field gives the page 5235 // number within the file used to produce the image. 5236 PageNumber int64 `json:"pageNumber,omitempty"` 5237 5238 // Uri: The URI of the file used to produce the image. 5239 Uri string `json:"uri,omitempty"` 5240 5241 // ForceSendFields is a list of field names (e.g. "PageNumber") to 5242 // unconditionally include in API requests. By default, fields with 5243 // empty values are omitted from API requests. However, any non-pointer, 5244 // non-interface field appearing in ForceSendFields will be sent to the 5245 // server regardless of whether the field is empty or not. This may be 5246 // used to include empty fields in Patch requests. 5247 ForceSendFields []string `json:"-"` 5248 5249 // NullFields is a list of field names (e.g. "PageNumber") to include in 5250 // API requests with the JSON null value. By default, fields with empty 5251 // values are omitted from API requests. However, any field with an 5252 // empty value appearing in NullFields will be sent to the server as 5253 // null. It is an error if a field in this list has a non-empty value. 5254 // This may be used to include null fields in Patch requests. 5255 NullFields []string `json:"-"` 5256} 5257 5258func (s *GoogleCloudVisionV1p2beta1ImageAnnotationContext) MarshalJSON() ([]byte, error) { 5259 type NoMethod GoogleCloudVisionV1p2beta1ImageAnnotationContext 5260 raw := NoMethod(*s) 5261 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5262} 5263 5264// GoogleCloudVisionV1p2beta1ImageProperties: Stores image properties, 5265// such as dominant colors. 5266type GoogleCloudVisionV1p2beta1ImageProperties struct { 5267 // DominantColors: If present, dominant colors completed successfully. 5268 DominantColors *GoogleCloudVisionV1p2beta1DominantColorsAnnotation `json:"dominantColors,omitempty"` 5269 5270 // ForceSendFields is a list of field names (e.g. "DominantColors") to 5271 // unconditionally include in API requests. By default, fields with 5272 // empty values are omitted from API requests. However, any non-pointer, 5273 // non-interface field appearing in ForceSendFields will be sent to the 5274 // server regardless of whether the field is empty or not. This may be 5275 // used to include empty fields in Patch requests. 5276 ForceSendFields []string `json:"-"` 5277 5278 // NullFields is a list of field names (e.g. "DominantColors") to 5279 // include in API requests with the JSON null value. By default, fields 5280 // with empty values are omitted from API requests. However, any field 5281 // with an empty value appearing in NullFields will be sent to the 5282 // server as null. It is an error if a field in this list has a 5283 // non-empty value. This may be used to include null fields in Patch 5284 // requests. 5285 NullFields []string `json:"-"` 5286} 5287 5288func (s *GoogleCloudVisionV1p2beta1ImageProperties) MarshalJSON() ([]byte, error) { 5289 type NoMethod GoogleCloudVisionV1p2beta1ImageProperties 5290 raw := NoMethod(*s) 5291 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5292} 5293 5294// GoogleCloudVisionV1p2beta1InputConfig: The desired input location and 5295// metadata. 5296type GoogleCloudVisionV1p2beta1InputConfig struct { 5297 // Content: File content, represented as a stream of bytes. Note: As 5298 // with all `bytes` fields, protobuffers use a pure binary 5299 // representation, whereas JSON representations use base64. Currently, 5300 // this field only works for BatchAnnotateFiles requests. It does not 5301 // work for AsyncBatchAnnotateFiles requests. 5302 Content string `json:"content,omitempty"` 5303 5304 // GcsSource: The Google Cloud Storage location to read the input from. 5305 GcsSource *GoogleCloudVisionV1p2beta1GcsSource `json:"gcsSource,omitempty"` 5306 5307 // MimeType: The type of the file. Currently only "application/pdf", 5308 // "image/tiff" and "image/gif" are supported. Wildcards are not 5309 // supported. 5310 MimeType string `json:"mimeType,omitempty"` 5311 5312 // ForceSendFields is a list of field names (e.g. "Content") to 5313 // unconditionally include in API requests. By default, fields with 5314 // empty values are omitted from API requests. However, any non-pointer, 5315 // non-interface field appearing in ForceSendFields will be sent to the 5316 // server regardless of whether the field is empty or not. This may be 5317 // used to include empty fields in Patch requests. 5318 ForceSendFields []string `json:"-"` 5319 5320 // NullFields is a list of field names (e.g. "Content") to include in 5321 // API requests with the JSON null value. By default, fields with empty 5322 // values are omitted from API requests. However, any field with an 5323 // empty value appearing in NullFields will be sent to the server as 5324 // null. It is an error if a field in this list has a non-empty value. 5325 // This may be used to include null fields in Patch requests. 5326 NullFields []string `json:"-"` 5327} 5328 5329func (s *GoogleCloudVisionV1p2beta1InputConfig) MarshalJSON() ([]byte, error) { 5330 type NoMethod GoogleCloudVisionV1p2beta1InputConfig 5331 raw := NoMethod(*s) 5332 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5333} 5334 5335// GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation: Set of detected 5336// objects with bounding boxes. 5337type GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation struct { 5338 // BoundingPoly: Image region to which this object belongs. This must be 5339 // populated. 5340 BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"` 5341 5342 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". 5343 // For more information, see 5344 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 5345 LanguageCode string `json:"languageCode,omitempty"` 5346 5347 // Mid: Object ID that should align with EntityAnnotation mid. 5348 Mid string `json:"mid,omitempty"` 5349 5350 // Name: Object name, expressed in its `language_code` language. 5351 Name string `json:"name,omitempty"` 5352 5353 // Score: Score of the result. Range [0, 1]. 5354 Score float64 `json:"score,omitempty"` 5355 5356 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 5357 // unconditionally include in API requests. By default, fields with 5358 // empty values are omitted from API requests. However, any non-pointer, 5359 // non-interface field appearing in ForceSendFields will be sent to the 5360 // server regardless of whether the field is empty or not. This may be 5361 // used to include empty fields in Patch requests. 5362 ForceSendFields []string `json:"-"` 5363 5364 // NullFields is a list of field names (e.g. "BoundingPoly") to include 5365 // in API requests with the JSON null value. By default, fields with 5366 // empty values are omitted from API requests. However, any field with 5367 // an empty value appearing in NullFields will be sent to the server as 5368 // null. It is an error if a field in this list has a non-empty value. 5369 // This may be used to include null fields in Patch requests. 5370 NullFields []string `json:"-"` 5371} 5372 5373func (s *GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation) MarshalJSON() ([]byte, error) { 5374 type NoMethod GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation 5375 raw := NoMethod(*s) 5376 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5377} 5378 5379func (s *GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation) UnmarshalJSON(data []byte) error { 5380 type NoMethod GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation 5381 var s1 struct { 5382 Score gensupport.JSONFloat64 `json:"score"` 5383 *NoMethod 5384 } 5385 s1.NoMethod = (*NoMethod)(s) 5386 if err := json.Unmarshal(data, &s1); err != nil { 5387 return err 5388 } 5389 s.Score = float64(s1.Score) 5390 return nil 5391} 5392 5393// GoogleCloudVisionV1p2beta1LocationInfo: Detected entity location 5394// information. 5395type GoogleCloudVisionV1p2beta1LocationInfo struct { 5396 // LatLng: lat/long location coordinates. 5397 LatLng *LatLng `json:"latLng,omitempty"` 5398 5399 // ForceSendFields is a list of field names (e.g. "LatLng") to 5400 // unconditionally include in API requests. By default, fields with 5401 // empty values are omitted from API requests. However, any non-pointer, 5402 // non-interface field appearing in ForceSendFields will be sent to the 5403 // server regardless of whether the field is empty or not. This may be 5404 // used to include empty fields in Patch requests. 5405 ForceSendFields []string `json:"-"` 5406 5407 // NullFields is a list of field names (e.g. "LatLng") to include in API 5408 // requests with the JSON null value. By default, fields with empty 5409 // values are omitted from API requests. However, any field with an 5410 // empty value appearing in NullFields will be sent to the server as 5411 // null. It is an error if a field in this list has a non-empty value. 5412 // This may be used to include null fields in Patch requests. 5413 NullFields []string `json:"-"` 5414} 5415 5416func (s *GoogleCloudVisionV1p2beta1LocationInfo) MarshalJSON() ([]byte, error) { 5417 type NoMethod GoogleCloudVisionV1p2beta1LocationInfo 5418 raw := NoMethod(*s) 5419 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5420} 5421 5422// GoogleCloudVisionV1p2beta1NormalizedVertex: A vertex represents a 2D 5423// point in the image. NOTE: the normalized vertex coordinates are 5424// relative to the original image and range from 0 to 1. 5425type GoogleCloudVisionV1p2beta1NormalizedVertex struct { 5426 // X: X coordinate. 5427 X float64 `json:"x,omitempty"` 5428 5429 // Y: Y coordinate. 5430 Y float64 `json:"y,omitempty"` 5431 5432 // ForceSendFields is a list of field names (e.g. "X") to 5433 // unconditionally include in API requests. By default, fields with 5434 // empty values are omitted from API requests. However, any non-pointer, 5435 // non-interface field appearing in ForceSendFields will be sent to the 5436 // server regardless of whether the field is empty or not. This may be 5437 // used to include empty fields in Patch requests. 5438 ForceSendFields []string `json:"-"` 5439 5440 // NullFields is a list of field names (e.g. "X") to include in API 5441 // requests with the JSON null value. By default, fields with empty 5442 // values are omitted from API requests. However, any field with an 5443 // empty value appearing in NullFields will be sent to the server as 5444 // null. It is an error if a field in this list has a non-empty value. 5445 // This may be used to include null fields in Patch requests. 5446 NullFields []string `json:"-"` 5447} 5448 5449func (s *GoogleCloudVisionV1p2beta1NormalizedVertex) MarshalJSON() ([]byte, error) { 5450 type NoMethod GoogleCloudVisionV1p2beta1NormalizedVertex 5451 raw := NoMethod(*s) 5452 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5453} 5454 5455func (s *GoogleCloudVisionV1p2beta1NormalizedVertex) UnmarshalJSON(data []byte) error { 5456 type NoMethod GoogleCloudVisionV1p2beta1NormalizedVertex 5457 var s1 struct { 5458 X gensupport.JSONFloat64 `json:"x"` 5459 Y gensupport.JSONFloat64 `json:"y"` 5460 *NoMethod 5461 } 5462 s1.NoMethod = (*NoMethod)(s) 5463 if err := json.Unmarshal(data, &s1); err != nil { 5464 return err 5465 } 5466 s.X = float64(s1.X) 5467 s.Y = float64(s1.Y) 5468 return nil 5469} 5470 5471// GoogleCloudVisionV1p2beta1OperationMetadata: Contains metadata for 5472// the BatchAnnotateImages operation. 5473type GoogleCloudVisionV1p2beta1OperationMetadata struct { 5474 // CreateTime: The time when the batch request was received. 5475 CreateTime string `json:"createTime,omitempty"` 5476 5477 // State: Current state of the batch operation. 5478 // 5479 // Possible values: 5480 // "STATE_UNSPECIFIED" - Invalid. 5481 // "CREATED" - Request is received. 5482 // "RUNNING" - Request is actively being processed. 5483 // "DONE" - The batch processing is done. 5484 // "CANCELLED" - The batch processing was cancelled. 5485 State string `json:"state,omitempty"` 5486 5487 // UpdateTime: The time when the operation result was last updated. 5488 UpdateTime string `json:"updateTime,omitempty"` 5489 5490 // ForceSendFields is a list of field names (e.g. "CreateTime") to 5491 // unconditionally include in API requests. By default, fields with 5492 // empty values are omitted from API requests. However, any non-pointer, 5493 // non-interface field appearing in ForceSendFields will be sent to the 5494 // server regardless of whether the field is empty or not. This may be 5495 // used to include empty fields in Patch requests. 5496 ForceSendFields []string `json:"-"` 5497 5498 // NullFields is a list of field names (e.g. "CreateTime") to include in 5499 // API requests with the JSON null value. By default, fields with empty 5500 // values are omitted from API requests. However, any field with an 5501 // empty value appearing in NullFields will be sent to the server as 5502 // null. It is an error if a field in this list has a non-empty value. 5503 // This may be used to include null fields in Patch requests. 5504 NullFields []string `json:"-"` 5505} 5506 5507func (s *GoogleCloudVisionV1p2beta1OperationMetadata) MarshalJSON() ([]byte, error) { 5508 type NoMethod GoogleCloudVisionV1p2beta1OperationMetadata 5509 raw := NoMethod(*s) 5510 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5511} 5512 5513// GoogleCloudVisionV1p2beta1OutputConfig: The desired output location 5514// and metadata. 5515type GoogleCloudVisionV1p2beta1OutputConfig struct { 5516 // BatchSize: The max number of response protos to put into each output 5517 // JSON file on Google Cloud Storage. The valid range is [1, 100]. If 5518 // not specified, the default value is 20. For example, for one pdf file 5519 // with 100 pages, 100 response protos will be generated. If 5520 // `batch_size` = 20, then 5 json files each containing 20 response 5521 // protos will be written under the prefix `gcs_destination`.`uri`. 5522 // Currently, batch_size only applies to GcsDestination, with potential 5523 // future support for other output configurations. 5524 BatchSize int64 `json:"batchSize,omitempty"` 5525 5526 // GcsDestination: The Google Cloud Storage location to write the 5527 // output(s) to. 5528 GcsDestination *GoogleCloudVisionV1p2beta1GcsDestination `json:"gcsDestination,omitempty"` 5529 5530 // ForceSendFields is a list of field names (e.g. "BatchSize") to 5531 // unconditionally include in API requests. By default, fields with 5532 // empty values are omitted from API requests. However, any non-pointer, 5533 // non-interface field appearing in ForceSendFields will be sent to the 5534 // server regardless of whether the field is empty or not. This may be 5535 // used to include empty fields in Patch requests. 5536 ForceSendFields []string `json:"-"` 5537 5538 // NullFields is a list of field names (e.g. "BatchSize") to include in 5539 // API requests with the JSON null value. By default, fields with empty 5540 // values are omitted from API requests. However, any field with an 5541 // empty value appearing in NullFields will be sent to the server as 5542 // null. It is an error if a field in this list has a non-empty value. 5543 // This may be used to include null fields in Patch requests. 5544 NullFields []string `json:"-"` 5545} 5546 5547func (s *GoogleCloudVisionV1p2beta1OutputConfig) MarshalJSON() ([]byte, error) { 5548 type NoMethod GoogleCloudVisionV1p2beta1OutputConfig 5549 raw := NoMethod(*s) 5550 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5551} 5552 5553// GoogleCloudVisionV1p2beta1Page: Detected page from OCR. 5554type GoogleCloudVisionV1p2beta1Page struct { 5555 // Blocks: List of blocks of text, images etc on this page. 5556 Blocks []*GoogleCloudVisionV1p2beta1Block `json:"blocks,omitempty"` 5557 5558 // Confidence: Confidence of the OCR results on the page. Range [0, 1]. 5559 Confidence float64 `json:"confidence,omitempty"` 5560 5561 // Height: Page height. For PDFs the unit is points. For images 5562 // (including TIFFs) the unit is pixels. 5563 Height int64 `json:"height,omitempty"` 5564 5565 // Property: Additional information detected on the page. 5566 Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"` 5567 5568 // Width: Page width. For PDFs the unit is points. For images (including 5569 // TIFFs) the unit is pixels. 5570 Width int64 `json:"width,omitempty"` 5571 5572 // ForceSendFields is a list of field names (e.g. "Blocks") to 5573 // unconditionally include in API requests. By default, fields with 5574 // empty values are omitted from API requests. However, any non-pointer, 5575 // non-interface field appearing in ForceSendFields will be sent to the 5576 // server regardless of whether the field is empty or not. This may be 5577 // used to include empty fields in Patch requests. 5578 ForceSendFields []string `json:"-"` 5579 5580 // NullFields is a list of field names (e.g. "Blocks") to include in API 5581 // requests with the JSON null value. By default, fields with empty 5582 // values are omitted from API requests. However, any field with an 5583 // empty value appearing in NullFields will be sent to the server as 5584 // null. It is an error if a field in this list has a non-empty value. 5585 // This may be used to include null fields in Patch requests. 5586 NullFields []string `json:"-"` 5587} 5588 5589func (s *GoogleCloudVisionV1p2beta1Page) MarshalJSON() ([]byte, error) { 5590 type NoMethod GoogleCloudVisionV1p2beta1Page 5591 raw := NoMethod(*s) 5592 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5593} 5594 5595func (s *GoogleCloudVisionV1p2beta1Page) UnmarshalJSON(data []byte) error { 5596 type NoMethod GoogleCloudVisionV1p2beta1Page 5597 var s1 struct { 5598 Confidence gensupport.JSONFloat64 `json:"confidence"` 5599 *NoMethod 5600 } 5601 s1.NoMethod = (*NoMethod)(s) 5602 if err := json.Unmarshal(data, &s1); err != nil { 5603 return err 5604 } 5605 s.Confidence = float64(s1.Confidence) 5606 return nil 5607} 5608 5609// GoogleCloudVisionV1p2beta1Paragraph: Structural unit of text 5610// representing a number of words in certain order. 5611type GoogleCloudVisionV1p2beta1Paragraph struct { 5612 // BoundingBox: The bounding box for the paragraph. The vertices are in 5613 // the order of top-left, top-right, bottom-right, bottom-left. When a 5614 // rotation of the bounding box is detected the rotation is represented 5615 // as around the top-left corner as defined when the text is read in the 5616 // 'natural' orientation. For example: * when the text is horizontal it 5617 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 5618 // around the top-left corner it becomes: 2----3 | | 1----0 and the 5619 // vertex order will still be (0, 1, 2, 3). 5620 BoundingBox *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingBox,omitempty"` 5621 5622 // Confidence: Confidence of the OCR results for the paragraph. Range 5623 // [0, 1]. 5624 Confidence float64 `json:"confidence,omitempty"` 5625 5626 // Property: Additional information detected for the paragraph. 5627 Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"` 5628 5629 // Words: List of all words in this paragraph. 5630 Words []*GoogleCloudVisionV1p2beta1Word `json:"words,omitempty"` 5631 5632 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 5633 // unconditionally include in API requests. By default, fields with 5634 // empty values are omitted from API requests. However, any non-pointer, 5635 // non-interface field appearing in ForceSendFields will be sent to the 5636 // server regardless of whether the field is empty or not. This may be 5637 // used to include empty fields in Patch requests. 5638 ForceSendFields []string `json:"-"` 5639 5640 // NullFields is a list of field names (e.g. "BoundingBox") to include 5641 // in API requests with the JSON null value. By default, fields with 5642 // empty values are omitted from API requests. However, any field with 5643 // an empty value appearing in NullFields will be sent to the server as 5644 // null. It is an error if a field in this list has a non-empty value. 5645 // This may be used to include null fields in Patch requests. 5646 NullFields []string `json:"-"` 5647} 5648 5649func (s *GoogleCloudVisionV1p2beta1Paragraph) MarshalJSON() ([]byte, error) { 5650 type NoMethod GoogleCloudVisionV1p2beta1Paragraph 5651 raw := NoMethod(*s) 5652 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5653} 5654 5655func (s *GoogleCloudVisionV1p2beta1Paragraph) UnmarshalJSON(data []byte) error { 5656 type NoMethod GoogleCloudVisionV1p2beta1Paragraph 5657 var s1 struct { 5658 Confidence gensupport.JSONFloat64 `json:"confidence"` 5659 *NoMethod 5660 } 5661 s1.NoMethod = (*NoMethod)(s) 5662 if err := json.Unmarshal(data, &s1); err != nil { 5663 return err 5664 } 5665 s.Confidence = float64(s1.Confidence) 5666 return nil 5667} 5668 5669// GoogleCloudVisionV1p2beta1Position: A 3D position in the image, used 5670// primarily for Face detection landmarks. A valid Position must have 5671// both x and y coordinates. The position coordinates are in the same 5672// scale as the original image. 5673type GoogleCloudVisionV1p2beta1Position struct { 5674 // X: X coordinate. 5675 X float64 `json:"x,omitempty"` 5676 5677 // Y: Y coordinate. 5678 Y float64 `json:"y,omitempty"` 5679 5680 // Z: Z coordinate (or depth). 5681 Z float64 `json:"z,omitempty"` 5682 5683 // ForceSendFields is a list of field names (e.g. "X") to 5684 // unconditionally include in API requests. By default, fields with 5685 // empty values are omitted from API requests. However, any non-pointer, 5686 // non-interface field appearing in ForceSendFields will be sent to the 5687 // server regardless of whether the field is empty or not. This may be 5688 // used to include empty fields in Patch requests. 5689 ForceSendFields []string `json:"-"` 5690 5691 // NullFields is a list of field names (e.g. "X") to include in API 5692 // requests with the JSON null value. By default, fields with empty 5693 // values are omitted from API requests. However, any field with an 5694 // empty value appearing in NullFields will be sent to the server as 5695 // null. It is an error if a field in this list has a non-empty value. 5696 // This may be used to include null fields in Patch requests. 5697 NullFields []string `json:"-"` 5698} 5699 5700func (s *GoogleCloudVisionV1p2beta1Position) MarshalJSON() ([]byte, error) { 5701 type NoMethod GoogleCloudVisionV1p2beta1Position 5702 raw := NoMethod(*s) 5703 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5704} 5705 5706func (s *GoogleCloudVisionV1p2beta1Position) UnmarshalJSON(data []byte) error { 5707 type NoMethod GoogleCloudVisionV1p2beta1Position 5708 var s1 struct { 5709 X gensupport.JSONFloat64 `json:"x"` 5710 Y gensupport.JSONFloat64 `json:"y"` 5711 Z gensupport.JSONFloat64 `json:"z"` 5712 *NoMethod 5713 } 5714 s1.NoMethod = (*NoMethod)(s) 5715 if err := json.Unmarshal(data, &s1); err != nil { 5716 return err 5717 } 5718 s.X = float64(s1.X) 5719 s.Y = float64(s1.Y) 5720 s.Z = float64(s1.Z) 5721 return nil 5722} 5723 5724// GoogleCloudVisionV1p2beta1Product: A Product contains 5725// ReferenceImages. 5726type GoogleCloudVisionV1p2beta1Product struct { 5727 // Description: User-provided metadata to be stored with this product. 5728 // Must be at most 4096 characters long. 5729 Description string `json:"description,omitempty"` 5730 5731 // DisplayName: The user-provided name for this Product. Must not be 5732 // empty. Must be at most 4096 characters long. 5733 DisplayName string `json:"displayName,omitempty"` 5734 5735 // Name: The resource name of the product. Format is: 5736 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This 5737 // field is ignored when creating a product. 5738 Name string `json:"name,omitempty"` 5739 5740 // ProductCategory: Immutable. The category for the product identified 5741 // by the reference image. This should be one of "homegoods-v2", 5742 // "apparel-v2", "toys-v2", "packagedgoods-v1" or "general-v1". The 5743 // legacy categories "homegoods", "apparel", and "toys" are still 5744 // supported, but these should not be used for new products. 5745 ProductCategory string `json:"productCategory,omitempty"` 5746 5747 // ProductLabels: Key-value pairs that can be attached to a product. At 5748 // query time, constraints can be specified based on the product_labels. 5749 // Note that integer values can be provided as strings, e.g. "1199". 5750 // Only strings with integer values can match a range-based restriction 5751 // which is to be supported soon. Multiple values can be assigned to the 5752 // same key. One product may have up to 500 product_labels. Notice that 5753 // the total number of distinct product_labels over all products in one 5754 // ProductSet cannot exceed 1M, otherwise the product search pipeline 5755 // will refuse to work for that ProductSet. 5756 ProductLabels []*GoogleCloudVisionV1p2beta1ProductKeyValue `json:"productLabels,omitempty"` 5757 5758 // ForceSendFields is a list of field names (e.g. "Description") to 5759 // unconditionally include in API requests. By default, fields with 5760 // empty values are omitted from API requests. However, any non-pointer, 5761 // non-interface field appearing in ForceSendFields will be sent to the 5762 // server regardless of whether the field is empty or not. This may be 5763 // used to include empty fields in Patch requests. 5764 ForceSendFields []string `json:"-"` 5765 5766 // NullFields is a list of field names (e.g. "Description") to include 5767 // in API requests with the JSON null value. By default, fields with 5768 // empty values are omitted from API requests. However, any field with 5769 // an empty value appearing in NullFields will be sent to the server as 5770 // null. It is an error if a field in this list has a non-empty value. 5771 // This may be used to include null fields in Patch requests. 5772 NullFields []string `json:"-"` 5773} 5774 5775func (s *GoogleCloudVisionV1p2beta1Product) MarshalJSON() ([]byte, error) { 5776 type NoMethod GoogleCloudVisionV1p2beta1Product 5777 raw := NoMethod(*s) 5778 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5779} 5780 5781// GoogleCloudVisionV1p2beta1ProductKeyValue: A product label 5782// represented as a key-value pair. 5783type GoogleCloudVisionV1p2beta1ProductKeyValue struct { 5784 // Key: The key of the label attached to the product. Cannot be empty 5785 // and cannot exceed 128 bytes. 5786 Key string `json:"key,omitempty"` 5787 5788 // Value: The value of the label attached to the product. Cannot be 5789 // empty and cannot exceed 128 bytes. 5790 Value string `json:"value,omitempty"` 5791 5792 // ForceSendFields is a list of field names (e.g. "Key") 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. "Key") 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 *GoogleCloudVisionV1p2beta1ProductKeyValue) MarshalJSON() ([]byte, error) { 5810 type NoMethod GoogleCloudVisionV1p2beta1ProductKeyValue 5811 raw := NoMethod(*s) 5812 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5813} 5814 5815// GoogleCloudVisionV1p2beta1ProductSearchResults: Results for a product 5816// search request. 5817type GoogleCloudVisionV1p2beta1ProductSearchResults struct { 5818 // IndexTime: Timestamp of the index which provided these results. 5819 // Products added to the product set and products removed from the 5820 // product set after this time are not reflected in the current results. 5821 IndexTime string `json:"indexTime,omitempty"` 5822 5823 // ProductGroupedResults: List of results grouped by products detected 5824 // in the query image. Each entry corresponds to one bounding polygon in 5825 // the query image, and contains the matching products specific to that 5826 // region. There may be duplicate product matches in the union of all 5827 // the per-product results. 5828 ProductGroupedResults []*GoogleCloudVisionV1p2beta1ProductSearchResultsGroupedResult `json:"productGroupedResults,omitempty"` 5829 5830 // Results: List of results, one for each product match. 5831 Results []*GoogleCloudVisionV1p2beta1ProductSearchResultsResult `json:"results,omitempty"` 5832 5833 // ForceSendFields is a list of field names (e.g. "IndexTime") to 5834 // unconditionally include in API requests. By default, fields with 5835 // empty values are omitted from API requests. However, any non-pointer, 5836 // non-interface field appearing in ForceSendFields will be sent to the 5837 // server regardless of whether the field is empty or not. This may be 5838 // used to include empty fields in Patch requests. 5839 ForceSendFields []string `json:"-"` 5840 5841 // NullFields is a list of field names (e.g. "IndexTime") to include in 5842 // API requests with the JSON null value. By default, fields with empty 5843 // values are omitted from API requests. However, any field with an 5844 // empty value appearing in NullFields will be sent to the server as 5845 // null. It is an error if a field in this list has a non-empty value. 5846 // This may be used to include null fields in Patch requests. 5847 NullFields []string `json:"-"` 5848} 5849 5850func (s *GoogleCloudVisionV1p2beta1ProductSearchResults) MarshalJSON() ([]byte, error) { 5851 type NoMethod GoogleCloudVisionV1p2beta1ProductSearchResults 5852 raw := NoMethod(*s) 5853 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5854} 5855 5856// GoogleCloudVisionV1p2beta1ProductSearchResultsGroupedResult: 5857// Information about the products similar to a single product in a query 5858// image. 5859type GoogleCloudVisionV1p2beta1ProductSearchResultsGroupedResult struct { 5860 // BoundingPoly: The bounding polygon around the product detected in the 5861 // query image. 5862 BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"` 5863 5864 // ObjectAnnotations: List of generic predictions for the object in the 5865 // bounding box. 5866 ObjectAnnotations []*GoogleCloudVisionV1p2beta1ProductSearchResultsObjectAnnotation `json:"objectAnnotations,omitempty"` 5867 5868 // Results: List of results, one for each product match. 5869 Results []*GoogleCloudVisionV1p2beta1ProductSearchResultsResult `json:"results,omitempty"` 5870 5871 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 5872 // unconditionally include in API requests. By default, fields with 5873 // empty values are omitted from API requests. However, any non-pointer, 5874 // non-interface field appearing in ForceSendFields will be sent to the 5875 // server regardless of whether the field is empty or not. This may be 5876 // used to include empty fields in Patch requests. 5877 ForceSendFields []string `json:"-"` 5878 5879 // NullFields is a list of field names (e.g. "BoundingPoly") to include 5880 // in API requests with the JSON null value. By default, fields with 5881 // empty values are omitted from API requests. However, any field with 5882 // an empty value appearing in NullFields will be sent to the server as 5883 // null. It is an error if a field in this list has a non-empty value. 5884 // This may be used to include null fields in Patch requests. 5885 NullFields []string `json:"-"` 5886} 5887 5888func (s *GoogleCloudVisionV1p2beta1ProductSearchResultsGroupedResult) MarshalJSON() ([]byte, error) { 5889 type NoMethod GoogleCloudVisionV1p2beta1ProductSearchResultsGroupedResult 5890 raw := NoMethod(*s) 5891 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5892} 5893 5894// GoogleCloudVisionV1p2beta1ProductSearchResultsObjectAnnotation: 5895// Prediction for what the object in the bounding box is. 5896type GoogleCloudVisionV1p2beta1ProductSearchResultsObjectAnnotation struct { 5897 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". 5898 // For more information, see 5899 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 5900 LanguageCode string `json:"languageCode,omitempty"` 5901 5902 // Mid: Object ID that should align with EntityAnnotation mid. 5903 Mid string `json:"mid,omitempty"` 5904 5905 // Name: Object name, expressed in its `language_code` language. 5906 Name string `json:"name,omitempty"` 5907 5908 // Score: Score of the result. Range [0, 1]. 5909 Score float64 `json:"score,omitempty"` 5910 5911 // ForceSendFields is a list of field names (e.g. "LanguageCode") to 5912 // unconditionally include in API requests. By default, fields with 5913 // empty values are omitted from API requests. However, any non-pointer, 5914 // non-interface field appearing in ForceSendFields will be sent to the 5915 // server regardless of whether the field is empty or not. This may be 5916 // used to include empty fields in Patch requests. 5917 ForceSendFields []string `json:"-"` 5918 5919 // NullFields is a list of field names (e.g. "LanguageCode") to include 5920 // in API requests with the JSON null value. By default, fields with 5921 // empty values are omitted from API requests. However, any field with 5922 // an empty value appearing in NullFields will be sent to the server as 5923 // null. It is an error if a field in this list has a non-empty value. 5924 // This may be used to include null fields in Patch requests. 5925 NullFields []string `json:"-"` 5926} 5927 5928func (s *GoogleCloudVisionV1p2beta1ProductSearchResultsObjectAnnotation) MarshalJSON() ([]byte, error) { 5929 type NoMethod GoogleCloudVisionV1p2beta1ProductSearchResultsObjectAnnotation 5930 raw := NoMethod(*s) 5931 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5932} 5933 5934func (s *GoogleCloudVisionV1p2beta1ProductSearchResultsObjectAnnotation) UnmarshalJSON(data []byte) error { 5935 type NoMethod GoogleCloudVisionV1p2beta1ProductSearchResultsObjectAnnotation 5936 var s1 struct { 5937 Score gensupport.JSONFloat64 `json:"score"` 5938 *NoMethod 5939 } 5940 s1.NoMethod = (*NoMethod)(s) 5941 if err := json.Unmarshal(data, &s1); err != nil { 5942 return err 5943 } 5944 s.Score = float64(s1.Score) 5945 return nil 5946} 5947 5948// GoogleCloudVisionV1p2beta1ProductSearchResultsResult: Information 5949// about a product. 5950type GoogleCloudVisionV1p2beta1ProductSearchResultsResult struct { 5951 // Image: The resource name of the image from the product that is the 5952 // closest match to the query. 5953 Image string `json:"image,omitempty"` 5954 5955 // Product: The Product. 5956 Product *GoogleCloudVisionV1p2beta1Product `json:"product,omitempty"` 5957 5958 // Score: A confidence level on the match, ranging from 0 (no 5959 // confidence) to 1 (full confidence). 5960 Score float64 `json:"score,omitempty"` 5961 5962 // ForceSendFields is a list of field names (e.g. "Image") to 5963 // unconditionally include in API requests. By default, fields with 5964 // empty values are omitted from API requests. However, any non-pointer, 5965 // non-interface field appearing in ForceSendFields will be sent to the 5966 // server regardless of whether the field is empty or not. This may be 5967 // used to include empty fields in Patch requests. 5968 ForceSendFields []string `json:"-"` 5969 5970 // NullFields is a list of field names (e.g. "Image") to include in API 5971 // requests with the JSON null value. By default, fields with empty 5972 // values are omitted from API requests. However, any field with an 5973 // empty value appearing in NullFields will be sent to the server as 5974 // null. It is an error if a field in this list has a non-empty value. 5975 // This may be used to include null fields in Patch requests. 5976 NullFields []string `json:"-"` 5977} 5978 5979func (s *GoogleCloudVisionV1p2beta1ProductSearchResultsResult) MarshalJSON() ([]byte, error) { 5980 type NoMethod GoogleCloudVisionV1p2beta1ProductSearchResultsResult 5981 raw := NoMethod(*s) 5982 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5983} 5984 5985func (s *GoogleCloudVisionV1p2beta1ProductSearchResultsResult) UnmarshalJSON(data []byte) error { 5986 type NoMethod GoogleCloudVisionV1p2beta1ProductSearchResultsResult 5987 var s1 struct { 5988 Score gensupport.JSONFloat64 `json:"score"` 5989 *NoMethod 5990 } 5991 s1.NoMethod = (*NoMethod)(s) 5992 if err := json.Unmarshal(data, &s1); err != nil { 5993 return err 5994 } 5995 s.Score = float64(s1.Score) 5996 return nil 5997} 5998 5999// GoogleCloudVisionV1p2beta1Property: A `Property` consists of a 6000// user-supplied name/value pair. 6001type GoogleCloudVisionV1p2beta1Property struct { 6002 // Name: Name of the property. 6003 Name string `json:"name,omitempty"` 6004 6005 // Uint64Value: Value of numeric properties. 6006 Uint64Value uint64 `json:"uint64Value,omitempty,string"` 6007 6008 // Value: Value of the property. 6009 Value string `json:"value,omitempty"` 6010 6011 // ForceSendFields is a list of field names (e.g. "Name") to 6012 // unconditionally include in API requests. By default, fields with 6013 // empty values are omitted from API requests. However, any non-pointer, 6014 // non-interface field appearing in ForceSendFields will be sent to the 6015 // server regardless of whether the field is empty or not. This may be 6016 // used to include empty fields in Patch requests. 6017 ForceSendFields []string `json:"-"` 6018 6019 // NullFields is a list of field names (e.g. "Name") to include in API 6020 // requests with the JSON null value. By default, fields with empty 6021 // values are omitted from API requests. However, any field with an 6022 // empty value appearing in NullFields will be sent to the server as 6023 // null. It is an error if a field in this list has a non-empty value. 6024 // This may be used to include null fields in Patch requests. 6025 NullFields []string `json:"-"` 6026} 6027 6028func (s *GoogleCloudVisionV1p2beta1Property) MarshalJSON() ([]byte, error) { 6029 type NoMethod GoogleCloudVisionV1p2beta1Property 6030 raw := NoMethod(*s) 6031 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6032} 6033 6034// GoogleCloudVisionV1p2beta1SafeSearchAnnotation: Set of features 6035// pertaining to the image, computed by computer vision methods over 6036// safe-search verticals (for example, adult, spoof, medical, violence). 6037type GoogleCloudVisionV1p2beta1SafeSearchAnnotation struct { 6038 // Adult: Represents the adult content likelihood for the image. Adult 6039 // content may contain elements such as nudity, pornographic images or 6040 // cartoons, or sexual activities. 6041 // 6042 // Possible values: 6043 // "UNKNOWN" - Unknown likelihood. 6044 // "VERY_UNLIKELY" - It is very unlikely. 6045 // "UNLIKELY" - It is unlikely. 6046 // "POSSIBLE" - It is possible. 6047 // "LIKELY" - It is likely. 6048 // "VERY_LIKELY" - It is very likely. 6049 Adult string `json:"adult,omitempty"` 6050 6051 // Medical: Likelihood that this is a medical image. 6052 // 6053 // Possible values: 6054 // "UNKNOWN" - Unknown likelihood. 6055 // "VERY_UNLIKELY" - It is very unlikely. 6056 // "UNLIKELY" - It is unlikely. 6057 // "POSSIBLE" - It is possible. 6058 // "LIKELY" - It is likely. 6059 // "VERY_LIKELY" - It is very likely. 6060 Medical string `json:"medical,omitempty"` 6061 6062 // Racy: Likelihood that the request image contains racy content. Racy 6063 // content may include (but is not limited to) skimpy or sheer clothing, 6064 // strategically covered nudity, lewd or provocative poses, or close-ups 6065 // of sensitive body areas. 6066 // 6067 // Possible values: 6068 // "UNKNOWN" - Unknown likelihood. 6069 // "VERY_UNLIKELY" - It is very unlikely. 6070 // "UNLIKELY" - It is unlikely. 6071 // "POSSIBLE" - It is possible. 6072 // "LIKELY" - It is likely. 6073 // "VERY_LIKELY" - It is very likely. 6074 Racy string `json:"racy,omitempty"` 6075 6076 // Spoof: Spoof likelihood. The likelihood that an modification was made 6077 // to the image's canonical version to make it appear funny or 6078 // offensive. 6079 // 6080 // Possible values: 6081 // "UNKNOWN" - Unknown likelihood. 6082 // "VERY_UNLIKELY" - It is very unlikely. 6083 // "UNLIKELY" - It is unlikely. 6084 // "POSSIBLE" - It is possible. 6085 // "LIKELY" - It is likely. 6086 // "VERY_LIKELY" - It is very likely. 6087 Spoof string `json:"spoof,omitempty"` 6088 6089 // Violence: Likelihood that this image contains violent content. 6090 // 6091 // Possible values: 6092 // "UNKNOWN" - Unknown likelihood. 6093 // "VERY_UNLIKELY" - It is very unlikely. 6094 // "UNLIKELY" - It is unlikely. 6095 // "POSSIBLE" - It is possible. 6096 // "LIKELY" - It is likely. 6097 // "VERY_LIKELY" - It is very likely. 6098 Violence string `json:"violence,omitempty"` 6099 6100 // ForceSendFields is a list of field names (e.g. "Adult") to 6101 // unconditionally include in API requests. By default, fields with 6102 // empty values are omitted from API requests. However, any non-pointer, 6103 // non-interface field appearing in ForceSendFields will be sent to the 6104 // server regardless of whether the field is empty or not. This may be 6105 // used to include empty fields in Patch requests. 6106 ForceSendFields []string `json:"-"` 6107 6108 // NullFields is a list of field names (e.g. "Adult") to include in API 6109 // requests with the JSON null value. By default, fields with empty 6110 // values are omitted from API requests. However, any field with an 6111 // empty value appearing in NullFields will be sent to the server as 6112 // null. It is an error if a field in this list has a non-empty value. 6113 // This may be used to include null fields in Patch requests. 6114 NullFields []string `json:"-"` 6115} 6116 6117func (s *GoogleCloudVisionV1p2beta1SafeSearchAnnotation) MarshalJSON() ([]byte, error) { 6118 type NoMethod GoogleCloudVisionV1p2beta1SafeSearchAnnotation 6119 raw := NoMethod(*s) 6120 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6121} 6122 6123// GoogleCloudVisionV1p2beta1Symbol: A single symbol representation. 6124type GoogleCloudVisionV1p2beta1Symbol struct { 6125 // BoundingBox: The bounding box for the symbol. The vertices are in the 6126 // order of top-left, top-right, bottom-right, bottom-left. When a 6127 // rotation of the bounding box is detected the rotation is represented 6128 // as around the top-left corner as defined when the text is read in the 6129 // 'natural' orientation. For example: * when the text is horizontal it 6130 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 6131 // around the top-left corner it becomes: 2----3 | | 1----0 and the 6132 // vertex order will still be (0, 1, 2, 3). 6133 BoundingBox *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingBox,omitempty"` 6134 6135 // Confidence: Confidence of the OCR results for the symbol. Range [0, 6136 // 1]. 6137 Confidence float64 `json:"confidence,omitempty"` 6138 6139 // Property: Additional information detected for the symbol. 6140 Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"` 6141 6142 // Text: The actual UTF-8 representation of the symbol. 6143 Text string `json:"text,omitempty"` 6144 6145 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 6146 // unconditionally include in API requests. By default, fields with 6147 // empty values are omitted from API requests. However, any non-pointer, 6148 // non-interface field appearing in ForceSendFields will be sent to the 6149 // server regardless of whether the field is empty or not. This may be 6150 // used to include empty fields in Patch requests. 6151 ForceSendFields []string `json:"-"` 6152 6153 // NullFields is a list of field names (e.g. "BoundingBox") to include 6154 // in API requests with the JSON null value. By default, fields with 6155 // empty values are omitted from API requests. However, any field with 6156 // an empty value appearing in NullFields will be sent to the server as 6157 // null. It is an error if a field in this list has a non-empty value. 6158 // This may be used to include null fields in Patch requests. 6159 NullFields []string `json:"-"` 6160} 6161 6162func (s *GoogleCloudVisionV1p2beta1Symbol) MarshalJSON() ([]byte, error) { 6163 type NoMethod GoogleCloudVisionV1p2beta1Symbol 6164 raw := NoMethod(*s) 6165 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6166} 6167 6168func (s *GoogleCloudVisionV1p2beta1Symbol) UnmarshalJSON(data []byte) error { 6169 type NoMethod GoogleCloudVisionV1p2beta1Symbol 6170 var s1 struct { 6171 Confidence gensupport.JSONFloat64 `json:"confidence"` 6172 *NoMethod 6173 } 6174 s1.NoMethod = (*NoMethod)(s) 6175 if err := json.Unmarshal(data, &s1); err != nil { 6176 return err 6177 } 6178 s.Confidence = float64(s1.Confidence) 6179 return nil 6180} 6181 6182// GoogleCloudVisionV1p2beta1TextAnnotation: TextAnnotation contains a 6183// structured representation of OCR extracted text. The hierarchy of an 6184// OCR extracted text structure is like this: TextAnnotation -> Page -> 6185// Block -> Paragraph -> Word -> Symbol Each structural component, 6186// starting from Page, may further have their own properties. Properties 6187// describe detected languages, breaks etc.. Please refer to the 6188// TextAnnotation.TextProperty message definition below for more detail. 6189type GoogleCloudVisionV1p2beta1TextAnnotation struct { 6190 // Pages: List of pages detected by OCR. 6191 Pages []*GoogleCloudVisionV1p2beta1Page `json:"pages,omitempty"` 6192 6193 // Text: UTF-8 text detected on the pages. 6194 Text string `json:"text,omitempty"` 6195 6196 // ForceSendFields is a list of field names (e.g. "Pages") to 6197 // unconditionally include in API requests. By default, fields with 6198 // empty values are omitted from API requests. However, any non-pointer, 6199 // non-interface field appearing in ForceSendFields will be sent to the 6200 // server regardless of whether the field is empty or not. This may be 6201 // used to include empty fields in Patch requests. 6202 ForceSendFields []string `json:"-"` 6203 6204 // NullFields is a list of field names (e.g. "Pages") to include in API 6205 // requests with the JSON null value. By default, fields with empty 6206 // values are omitted from API requests. However, any field with an 6207 // empty value appearing in NullFields will be sent to the server as 6208 // null. It is an error if a field in this list has a non-empty value. 6209 // This may be used to include null fields in Patch requests. 6210 NullFields []string `json:"-"` 6211} 6212 6213func (s *GoogleCloudVisionV1p2beta1TextAnnotation) MarshalJSON() ([]byte, error) { 6214 type NoMethod GoogleCloudVisionV1p2beta1TextAnnotation 6215 raw := NoMethod(*s) 6216 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6217} 6218 6219// GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak: Detected start 6220// or end of a structural component. 6221type GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak struct { 6222 // IsPrefix: True if break prepends the element. 6223 IsPrefix bool `json:"isPrefix,omitempty"` 6224 6225 // Type: Detected break type. 6226 // 6227 // Possible values: 6228 // "UNKNOWN" - Unknown break label type. 6229 // "SPACE" - Regular space. 6230 // "SURE_SPACE" - Sure space (very wide). 6231 // "EOL_SURE_SPACE" - Line-wrapping break. 6232 // "HYPHEN" - End-line hyphen that is not present in text; does not 6233 // co-occur with `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. 6234 // "LINE_BREAK" - Line break that ends a paragraph. 6235 Type string `json:"type,omitempty"` 6236 6237 // ForceSendFields is a list of field names (e.g. "IsPrefix") to 6238 // unconditionally include in API requests. By default, fields with 6239 // empty values are omitted from API requests. However, any non-pointer, 6240 // non-interface field appearing in ForceSendFields will be sent to the 6241 // server regardless of whether the field is empty or not. This may be 6242 // used to include empty fields in Patch requests. 6243 ForceSendFields []string `json:"-"` 6244 6245 // NullFields is a list of field names (e.g. "IsPrefix") to include in 6246 // API requests with the JSON null value. By default, fields with empty 6247 // values are omitted from API requests. However, any field with an 6248 // empty value appearing in NullFields will be sent to the server as 6249 // null. It is an error if a field in this list has a non-empty value. 6250 // This may be used to include null fields in Patch requests. 6251 NullFields []string `json:"-"` 6252} 6253 6254func (s *GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak) MarshalJSON() ([]byte, error) { 6255 type NoMethod GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak 6256 raw := NoMethod(*s) 6257 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6258} 6259 6260// GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage: Detected 6261// language for a structural component. 6262type GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage struct { 6263 // Confidence: Confidence of detected language. Range [0, 1]. 6264 Confidence float64 `json:"confidence,omitempty"` 6265 6266 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". 6267 // For more information, see 6268 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 6269 LanguageCode string `json:"languageCode,omitempty"` 6270 6271 // ForceSendFields is a list of field names (e.g. "Confidence") to 6272 // unconditionally include in API requests. By default, fields with 6273 // empty values are omitted from API requests. However, any non-pointer, 6274 // non-interface field appearing in ForceSendFields will be sent to the 6275 // server regardless of whether the field is empty or not. This may be 6276 // used to include empty fields in Patch requests. 6277 ForceSendFields []string `json:"-"` 6278 6279 // NullFields is a list of field names (e.g. "Confidence") to include in 6280 // API requests with the JSON null value. By default, fields with empty 6281 // values are omitted from API requests. However, any field with an 6282 // empty value appearing in NullFields will be sent to the server as 6283 // null. It is an error if a field in this list has a non-empty value. 6284 // This may be used to include null fields in Patch requests. 6285 NullFields []string `json:"-"` 6286} 6287 6288func (s *GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage) MarshalJSON() ([]byte, error) { 6289 type NoMethod GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage 6290 raw := NoMethod(*s) 6291 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6292} 6293 6294func (s *GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage) UnmarshalJSON(data []byte) error { 6295 type NoMethod GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage 6296 var s1 struct { 6297 Confidence gensupport.JSONFloat64 `json:"confidence"` 6298 *NoMethod 6299 } 6300 s1.NoMethod = (*NoMethod)(s) 6301 if err := json.Unmarshal(data, &s1); err != nil { 6302 return err 6303 } 6304 s.Confidence = float64(s1.Confidence) 6305 return nil 6306} 6307 6308// GoogleCloudVisionV1p2beta1TextAnnotationTextProperty: Additional 6309// information detected on the structural component. 6310type GoogleCloudVisionV1p2beta1TextAnnotationTextProperty struct { 6311 // DetectedBreak: Detected start or end of a text segment. 6312 DetectedBreak *GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak `json:"detectedBreak,omitempty"` 6313 6314 // DetectedLanguages: A list of detected languages together with 6315 // confidence. 6316 DetectedLanguages []*GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage `json:"detectedLanguages,omitempty"` 6317 6318 // ForceSendFields is a list of field names (e.g. "DetectedBreak") to 6319 // unconditionally include in API requests. By default, fields with 6320 // empty values are omitted from API requests. However, any non-pointer, 6321 // non-interface field appearing in ForceSendFields will be sent to the 6322 // server regardless of whether the field is empty or not. This may be 6323 // used to include empty fields in Patch requests. 6324 ForceSendFields []string `json:"-"` 6325 6326 // NullFields is a list of field names (e.g. "DetectedBreak") to include 6327 // in API requests with the JSON null value. By default, fields with 6328 // empty values are omitted from API requests. However, any field with 6329 // an empty value appearing in NullFields will be sent to the server as 6330 // null. It is an error if a field in this list has a non-empty value. 6331 // This may be used to include null fields in Patch requests. 6332 NullFields []string `json:"-"` 6333} 6334 6335func (s *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty) MarshalJSON() ([]byte, error) { 6336 type NoMethod GoogleCloudVisionV1p2beta1TextAnnotationTextProperty 6337 raw := NoMethod(*s) 6338 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6339} 6340 6341// GoogleCloudVisionV1p2beta1Vertex: A vertex represents a 2D point in 6342// the image. NOTE: the vertex coordinates are in the same scale as the 6343// original image. 6344type GoogleCloudVisionV1p2beta1Vertex struct { 6345 // X: X coordinate. 6346 X int64 `json:"x,omitempty"` 6347 6348 // Y: Y coordinate. 6349 Y int64 `json:"y,omitempty"` 6350 6351 // ForceSendFields is a list of field names (e.g. "X") to 6352 // unconditionally include in API requests. By default, fields with 6353 // empty values are omitted from API requests. However, any non-pointer, 6354 // non-interface field appearing in ForceSendFields will be sent to the 6355 // server regardless of whether the field is empty or not. This may be 6356 // used to include empty fields in Patch requests. 6357 ForceSendFields []string `json:"-"` 6358 6359 // NullFields is a list of field names (e.g. "X") to include in API 6360 // requests with the JSON null value. By default, fields with empty 6361 // values are omitted from API requests. However, any field with an 6362 // empty value appearing in NullFields will be sent to the server as 6363 // null. It is an error if a field in this list has a non-empty value. 6364 // This may be used to include null fields in Patch requests. 6365 NullFields []string `json:"-"` 6366} 6367 6368func (s *GoogleCloudVisionV1p2beta1Vertex) MarshalJSON() ([]byte, error) { 6369 type NoMethod GoogleCloudVisionV1p2beta1Vertex 6370 raw := NoMethod(*s) 6371 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6372} 6373 6374// GoogleCloudVisionV1p2beta1WebDetection: Relevant information for the 6375// image from the Internet. 6376type GoogleCloudVisionV1p2beta1WebDetection struct { 6377 // BestGuessLabels: The service's best guess as to the topic of the 6378 // request image. Inferred from similar images on the open web. 6379 BestGuessLabels []*GoogleCloudVisionV1p2beta1WebDetectionWebLabel `json:"bestGuessLabels,omitempty"` 6380 6381 // FullMatchingImages: Fully matching images from the Internet. Can 6382 // include resized copies of the query image. 6383 FullMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"` 6384 6385 // PagesWithMatchingImages: Web pages containing the matching images 6386 // from the Internet. 6387 PagesWithMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebPage `json:"pagesWithMatchingImages,omitempty"` 6388 6389 // PartialMatchingImages: Partial matching images from the Internet. 6390 // Those images are similar enough to share some key-point features. For 6391 // example an original image will likely have partial matching for its 6392 // crops. 6393 PartialMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"` 6394 6395 // VisuallySimilarImages: The visually similar image results. 6396 VisuallySimilarImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"visuallySimilarImages,omitempty"` 6397 6398 // WebEntities: Deduced entities from similar images on the Internet. 6399 WebEntities []*GoogleCloudVisionV1p2beta1WebDetectionWebEntity `json:"webEntities,omitempty"` 6400 6401 // ForceSendFields is a list of field names (e.g. "BestGuessLabels") to 6402 // unconditionally include in API requests. By default, fields with 6403 // empty values are omitted from API requests. However, any non-pointer, 6404 // non-interface field appearing in ForceSendFields will be sent to the 6405 // server regardless of whether the field is empty or not. This may be 6406 // used to include empty fields in Patch requests. 6407 ForceSendFields []string `json:"-"` 6408 6409 // NullFields is a list of field names (e.g. "BestGuessLabels") to 6410 // include in API requests with the JSON null value. By default, fields 6411 // with empty values are omitted from API requests. However, any field 6412 // with an empty value appearing in NullFields will be sent to the 6413 // server as null. It is an error if a field in this list has a 6414 // non-empty value. This may be used to include null fields in Patch 6415 // requests. 6416 NullFields []string `json:"-"` 6417} 6418 6419func (s *GoogleCloudVisionV1p2beta1WebDetection) MarshalJSON() ([]byte, error) { 6420 type NoMethod GoogleCloudVisionV1p2beta1WebDetection 6421 raw := NoMethod(*s) 6422 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6423} 6424 6425// GoogleCloudVisionV1p2beta1WebDetectionWebEntity: Entity deduced from 6426// similar images on the Internet. 6427type GoogleCloudVisionV1p2beta1WebDetectionWebEntity struct { 6428 // Description: Canonical description of the entity, in English. 6429 Description string `json:"description,omitempty"` 6430 6431 // EntityId: Opaque entity ID. 6432 EntityId string `json:"entityId,omitempty"` 6433 6434 // Score: Overall relevancy score for the entity. Not normalized and not 6435 // comparable across different image queries. 6436 Score float64 `json:"score,omitempty"` 6437 6438 // ForceSendFields is a list of field names (e.g. "Description") to 6439 // unconditionally include in API requests. By default, fields with 6440 // empty values are omitted from API requests. However, any non-pointer, 6441 // non-interface field appearing in ForceSendFields will be sent to the 6442 // server regardless of whether the field is empty or not. This may be 6443 // used to include empty fields in Patch requests. 6444 ForceSendFields []string `json:"-"` 6445 6446 // NullFields is a list of field names (e.g. "Description") to include 6447 // in API requests with the JSON null value. By default, fields with 6448 // empty values are omitted from API requests. However, any field with 6449 // an empty value appearing in NullFields will be sent to the server as 6450 // null. It is an error if a field in this list has a non-empty value. 6451 // This may be used to include null fields in Patch requests. 6452 NullFields []string `json:"-"` 6453} 6454 6455func (s *GoogleCloudVisionV1p2beta1WebDetectionWebEntity) MarshalJSON() ([]byte, error) { 6456 type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebEntity 6457 raw := NoMethod(*s) 6458 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6459} 6460 6461func (s *GoogleCloudVisionV1p2beta1WebDetectionWebEntity) UnmarshalJSON(data []byte) error { 6462 type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebEntity 6463 var s1 struct { 6464 Score gensupport.JSONFloat64 `json:"score"` 6465 *NoMethod 6466 } 6467 s1.NoMethod = (*NoMethod)(s) 6468 if err := json.Unmarshal(data, &s1); err != nil { 6469 return err 6470 } 6471 s.Score = float64(s1.Score) 6472 return nil 6473} 6474 6475// GoogleCloudVisionV1p2beta1WebDetectionWebImage: Metadata for online 6476// images. 6477type GoogleCloudVisionV1p2beta1WebDetectionWebImage struct { 6478 // Score: (Deprecated) Overall relevancy score for the image. 6479 Score float64 `json:"score,omitempty"` 6480 6481 // Url: The result image URL. 6482 Url string `json:"url,omitempty"` 6483 6484 // ForceSendFields is a list of field names (e.g. "Score") to 6485 // unconditionally include in API requests. By default, fields with 6486 // empty values are omitted from API requests. However, any non-pointer, 6487 // non-interface field appearing in ForceSendFields will be sent to the 6488 // server regardless of whether the field is empty or not. This may be 6489 // used to include empty fields in Patch requests. 6490 ForceSendFields []string `json:"-"` 6491 6492 // NullFields is a list of field names (e.g. "Score") to include in API 6493 // requests with the JSON null value. By default, fields with empty 6494 // values are omitted from API requests. However, any field with an 6495 // empty value appearing in NullFields will be sent to the server as 6496 // null. It is an error if a field in this list has a non-empty value. 6497 // This may be used to include null fields in Patch requests. 6498 NullFields []string `json:"-"` 6499} 6500 6501func (s *GoogleCloudVisionV1p2beta1WebDetectionWebImage) MarshalJSON() ([]byte, error) { 6502 type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebImage 6503 raw := NoMethod(*s) 6504 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6505} 6506 6507func (s *GoogleCloudVisionV1p2beta1WebDetectionWebImage) UnmarshalJSON(data []byte) error { 6508 type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebImage 6509 var s1 struct { 6510 Score gensupport.JSONFloat64 `json:"score"` 6511 *NoMethod 6512 } 6513 s1.NoMethod = (*NoMethod)(s) 6514 if err := json.Unmarshal(data, &s1); err != nil { 6515 return err 6516 } 6517 s.Score = float64(s1.Score) 6518 return nil 6519} 6520 6521// GoogleCloudVisionV1p2beta1WebDetectionWebLabel: Label to provide 6522// extra metadata for the web detection. 6523type GoogleCloudVisionV1p2beta1WebDetectionWebLabel struct { 6524 // Label: Label for extra metadata. 6525 Label string `json:"label,omitempty"` 6526 6527 // LanguageCode: The BCP-47 language code for `label`, such as "en-US" 6528 // or "sr-Latn". For more information, see 6529 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 6530 LanguageCode string `json:"languageCode,omitempty"` 6531 6532 // ForceSendFields is a list of field names (e.g. "Label") to 6533 // unconditionally include in API requests. By default, fields with 6534 // empty values are omitted from API requests. However, any non-pointer, 6535 // non-interface field appearing in ForceSendFields will be sent to the 6536 // server regardless of whether the field is empty or not. This may be 6537 // used to include empty fields in Patch requests. 6538 ForceSendFields []string `json:"-"` 6539 6540 // NullFields is a list of field names (e.g. "Label") to include in API 6541 // requests with the JSON null value. By default, fields with empty 6542 // values are omitted from API requests. However, any field with an 6543 // empty value appearing in NullFields will be sent to the server as 6544 // null. It is an error if a field in this list has a non-empty value. 6545 // This may be used to include null fields in Patch requests. 6546 NullFields []string `json:"-"` 6547} 6548 6549func (s *GoogleCloudVisionV1p2beta1WebDetectionWebLabel) MarshalJSON() ([]byte, error) { 6550 type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebLabel 6551 raw := NoMethod(*s) 6552 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6553} 6554 6555// GoogleCloudVisionV1p2beta1WebDetectionWebPage: Metadata for web 6556// pages. 6557type GoogleCloudVisionV1p2beta1WebDetectionWebPage struct { 6558 // FullMatchingImages: Fully matching images on the page. Can include 6559 // resized copies of the query image. 6560 FullMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"` 6561 6562 // PageTitle: Title for the web page, may contain HTML markups. 6563 PageTitle string `json:"pageTitle,omitempty"` 6564 6565 // PartialMatchingImages: Partial matching images on the page. Those 6566 // images are similar enough to share some key-point features. For 6567 // example an original image will likely have partial matching for its 6568 // crops. 6569 PartialMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"` 6570 6571 // Score: (Deprecated) Overall relevancy score for the web page. 6572 Score float64 `json:"score,omitempty"` 6573 6574 // Url: The result web page URL. 6575 Url string `json:"url,omitempty"` 6576 6577 // ForceSendFields is a list of field names (e.g. "FullMatchingImages") 6578 // to unconditionally include in API requests. By default, fields with 6579 // empty values are omitted from API requests. However, any non-pointer, 6580 // non-interface field appearing in ForceSendFields will be sent to the 6581 // server regardless of whether the field is empty or not. This may be 6582 // used to include empty fields in Patch requests. 6583 ForceSendFields []string `json:"-"` 6584 6585 // NullFields is a list of field names (e.g. "FullMatchingImages") to 6586 // include in API requests with the JSON null value. By default, fields 6587 // with empty values are omitted from API requests. However, any field 6588 // with an empty value appearing in NullFields will be sent to the 6589 // server as null. It is an error if a field in this list has a 6590 // non-empty value. This may be used to include null fields in Patch 6591 // requests. 6592 NullFields []string `json:"-"` 6593} 6594 6595func (s *GoogleCloudVisionV1p2beta1WebDetectionWebPage) MarshalJSON() ([]byte, error) { 6596 type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebPage 6597 raw := NoMethod(*s) 6598 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6599} 6600 6601func (s *GoogleCloudVisionV1p2beta1WebDetectionWebPage) UnmarshalJSON(data []byte) error { 6602 type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebPage 6603 var s1 struct { 6604 Score gensupport.JSONFloat64 `json:"score"` 6605 *NoMethod 6606 } 6607 s1.NoMethod = (*NoMethod)(s) 6608 if err := json.Unmarshal(data, &s1); err != nil { 6609 return err 6610 } 6611 s.Score = float64(s1.Score) 6612 return nil 6613} 6614 6615// GoogleCloudVisionV1p2beta1Word: A word representation. 6616type GoogleCloudVisionV1p2beta1Word struct { 6617 // BoundingBox: The bounding box for the word. The vertices are in the 6618 // order of top-left, top-right, bottom-right, bottom-left. When a 6619 // rotation of the bounding box is detected the rotation is represented 6620 // as around the top-left corner as defined when the text is read in the 6621 // 'natural' orientation. For example: * when the text is horizontal it 6622 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 6623 // around the top-left corner it becomes: 2----3 | | 1----0 and the 6624 // vertex order will still be (0, 1, 2, 3). 6625 BoundingBox *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingBox,omitempty"` 6626 6627 // Confidence: Confidence of the OCR results for the word. Range [0, 1]. 6628 Confidence float64 `json:"confidence,omitempty"` 6629 6630 // Property: Additional information detected for the word. 6631 Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"` 6632 6633 // Symbols: List of symbols in the word. The order of the symbols 6634 // follows the natural reading order. 6635 Symbols []*GoogleCloudVisionV1p2beta1Symbol `json:"symbols,omitempty"` 6636 6637 // ForceSendFields is a list of field names (e.g. "BoundingBox") 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. "BoundingBox") 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 *GoogleCloudVisionV1p2beta1Word) MarshalJSON() ([]byte, error) { 6655 type NoMethod GoogleCloudVisionV1p2beta1Word 6656 raw := NoMethod(*s) 6657 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6658} 6659 6660func (s *GoogleCloudVisionV1p2beta1Word) UnmarshalJSON(data []byte) error { 6661 type NoMethod GoogleCloudVisionV1p2beta1Word 6662 var s1 struct { 6663 Confidence gensupport.JSONFloat64 `json:"confidence"` 6664 *NoMethod 6665 } 6666 s1.NoMethod = (*NoMethod)(s) 6667 if err := json.Unmarshal(data, &s1); err != nil { 6668 return err 6669 } 6670 s.Confidence = float64(s1.Confidence) 6671 return nil 6672} 6673 6674// GoogleCloudVisionV1p3beta1AnnotateFileResponse: Response to a single 6675// file annotation request. A file may contain one or more images, which 6676// individually have their own responses. 6677type GoogleCloudVisionV1p3beta1AnnotateFileResponse struct { 6678 // Error: If set, represents the error message for the failed request. 6679 // The `responses` field will not be set in this case. 6680 Error *Status `json:"error,omitempty"` 6681 6682 // InputConfig: Information about the file for which this response is 6683 // generated. 6684 InputConfig *GoogleCloudVisionV1p3beta1InputConfig `json:"inputConfig,omitempty"` 6685 6686 // Responses: Individual responses to images found within the file. This 6687 // field will be empty if the `error` field is set. 6688 Responses []*GoogleCloudVisionV1p3beta1AnnotateImageResponse `json:"responses,omitempty"` 6689 6690 // TotalPages: This field gives the total number of pages in the file. 6691 TotalPages int64 `json:"totalPages,omitempty"` 6692 6693 // ForceSendFields is a list of field names (e.g. "Error") to 6694 // unconditionally include in API requests. By default, fields with 6695 // empty values are omitted from API requests. However, any non-pointer, 6696 // non-interface field appearing in ForceSendFields will be sent to the 6697 // server regardless of whether the field is empty or not. This may be 6698 // used to include empty fields in Patch requests. 6699 ForceSendFields []string `json:"-"` 6700 6701 // NullFields is a list of field names (e.g. "Error") to include in API 6702 // requests with the JSON null value. By default, fields with empty 6703 // values are omitted from API requests. However, any field with an 6704 // empty value appearing in NullFields will be sent to the server as 6705 // null. It is an error if a field in this list has a non-empty value. 6706 // This may be used to include null fields in Patch requests. 6707 NullFields []string `json:"-"` 6708} 6709 6710func (s *GoogleCloudVisionV1p3beta1AnnotateFileResponse) MarshalJSON() ([]byte, error) { 6711 type NoMethod GoogleCloudVisionV1p3beta1AnnotateFileResponse 6712 raw := NoMethod(*s) 6713 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6714} 6715 6716// GoogleCloudVisionV1p3beta1AnnotateImageResponse: Response to an image 6717// annotation request. 6718type GoogleCloudVisionV1p3beta1AnnotateImageResponse struct { 6719 // Context: If present, contextual information is needed to understand 6720 // where this image comes from. 6721 Context *GoogleCloudVisionV1p3beta1ImageAnnotationContext `json:"context,omitempty"` 6722 6723 // CropHintsAnnotation: If present, crop hints have completed 6724 // successfully. 6725 CropHintsAnnotation *GoogleCloudVisionV1p3beta1CropHintsAnnotation `json:"cropHintsAnnotation,omitempty"` 6726 6727 // Error: If set, represents the error message for the operation. Note 6728 // that filled-in image annotations are guaranteed to be correct, even 6729 // when `error` is set. 6730 Error *Status `json:"error,omitempty"` 6731 6732 // FaceAnnotations: If present, face detection has completed 6733 // successfully. 6734 FaceAnnotations []*GoogleCloudVisionV1p3beta1FaceAnnotation `json:"faceAnnotations,omitempty"` 6735 6736 // FullTextAnnotation: If present, text (OCR) detection or document 6737 // (OCR) text detection has completed successfully. This annotation 6738 // provides the structural hierarchy for the OCR detected text. 6739 FullTextAnnotation *GoogleCloudVisionV1p3beta1TextAnnotation `json:"fullTextAnnotation,omitempty"` 6740 6741 // ImagePropertiesAnnotation: If present, image properties were 6742 // extracted successfully. 6743 ImagePropertiesAnnotation *GoogleCloudVisionV1p3beta1ImageProperties `json:"imagePropertiesAnnotation,omitempty"` 6744 6745 // LabelAnnotations: If present, label detection has completed 6746 // successfully. 6747 LabelAnnotations []*GoogleCloudVisionV1p3beta1EntityAnnotation `json:"labelAnnotations,omitempty"` 6748 6749 // LandmarkAnnotations: If present, landmark detection has completed 6750 // successfully. 6751 LandmarkAnnotations []*GoogleCloudVisionV1p3beta1EntityAnnotation `json:"landmarkAnnotations,omitempty"` 6752 6753 // LocalizedObjectAnnotations: If present, localized object detection 6754 // has completed successfully. This will be sorted descending by 6755 // confidence score. 6756 LocalizedObjectAnnotations []*GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation `json:"localizedObjectAnnotations,omitempty"` 6757 6758 // LogoAnnotations: If present, logo detection has completed 6759 // successfully. 6760 LogoAnnotations []*GoogleCloudVisionV1p3beta1EntityAnnotation `json:"logoAnnotations,omitempty"` 6761 6762 // ProductSearchResults: If present, product search has completed 6763 // successfully. 6764 ProductSearchResults *GoogleCloudVisionV1p3beta1ProductSearchResults `json:"productSearchResults,omitempty"` 6765 6766 // SafeSearchAnnotation: If present, safe-search annotation has 6767 // completed successfully. 6768 SafeSearchAnnotation *GoogleCloudVisionV1p3beta1SafeSearchAnnotation `json:"safeSearchAnnotation,omitempty"` 6769 6770 // TextAnnotations: If present, text (OCR) detection has completed 6771 // successfully. 6772 TextAnnotations []*GoogleCloudVisionV1p3beta1EntityAnnotation `json:"textAnnotations,omitempty"` 6773 6774 // WebDetection: If present, web detection has completed successfully. 6775 WebDetection *GoogleCloudVisionV1p3beta1WebDetection `json:"webDetection,omitempty"` 6776 6777 // ForceSendFields is a list of field names (e.g. "Context") to 6778 // unconditionally include in API requests. By default, fields with 6779 // empty values are omitted from API requests. However, any non-pointer, 6780 // non-interface field appearing in ForceSendFields will be sent to the 6781 // server regardless of whether the field is empty or not. This may be 6782 // used to include empty fields in Patch requests. 6783 ForceSendFields []string `json:"-"` 6784 6785 // NullFields is a list of field names (e.g. "Context") to include in 6786 // API requests with the JSON null value. By default, fields with empty 6787 // values are omitted from API requests. However, any field with an 6788 // empty value appearing in NullFields will be sent to the server as 6789 // null. It is an error if a field in this list has a non-empty value. 6790 // This may be used to include null fields in Patch requests. 6791 NullFields []string `json:"-"` 6792} 6793 6794func (s *GoogleCloudVisionV1p3beta1AnnotateImageResponse) MarshalJSON() ([]byte, error) { 6795 type NoMethod GoogleCloudVisionV1p3beta1AnnotateImageResponse 6796 raw := NoMethod(*s) 6797 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6798} 6799 6800// GoogleCloudVisionV1p3beta1AsyncAnnotateFileResponse: The response for 6801// a single offline file annotation request. 6802type GoogleCloudVisionV1p3beta1AsyncAnnotateFileResponse struct { 6803 // OutputConfig: The output location and metadata from 6804 // AsyncAnnotateFileRequest. 6805 OutputConfig *GoogleCloudVisionV1p3beta1OutputConfig `json:"outputConfig,omitempty"` 6806 6807 // ForceSendFields is a list of field names (e.g. "OutputConfig") to 6808 // unconditionally include in API requests. By default, fields with 6809 // empty values are omitted from API requests. However, any non-pointer, 6810 // non-interface field appearing in ForceSendFields will be sent to the 6811 // server regardless of whether the field is empty or not. This may be 6812 // used to include empty fields in Patch requests. 6813 ForceSendFields []string `json:"-"` 6814 6815 // NullFields is a list of field names (e.g. "OutputConfig") to include 6816 // in API requests with the JSON null value. By default, fields with 6817 // empty values are omitted from API requests. However, any field with 6818 // an empty value appearing in NullFields will be sent to the server as 6819 // null. It is an error if a field in this list has a non-empty value. 6820 // This may be used to include null fields in Patch requests. 6821 NullFields []string `json:"-"` 6822} 6823 6824func (s *GoogleCloudVisionV1p3beta1AsyncAnnotateFileResponse) MarshalJSON() ([]byte, error) { 6825 type NoMethod GoogleCloudVisionV1p3beta1AsyncAnnotateFileResponse 6826 raw := NoMethod(*s) 6827 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6828} 6829 6830// GoogleCloudVisionV1p3beta1AsyncBatchAnnotateFilesResponse: Response 6831// to an async batch file annotation request. 6832type GoogleCloudVisionV1p3beta1AsyncBatchAnnotateFilesResponse struct { 6833 // Responses: The list of file annotation responses, one for each 6834 // request in AsyncBatchAnnotateFilesRequest. 6835 Responses []*GoogleCloudVisionV1p3beta1AsyncAnnotateFileResponse `json:"responses,omitempty"` 6836 6837 // ForceSendFields is a list of field names (e.g. "Responses") to 6838 // unconditionally include in API requests. By default, fields with 6839 // empty values are omitted from API requests. However, any non-pointer, 6840 // non-interface field appearing in ForceSendFields will be sent to the 6841 // server regardless of whether the field is empty or not. This may be 6842 // used to include empty fields in Patch requests. 6843 ForceSendFields []string `json:"-"` 6844 6845 // NullFields is a list of field names (e.g. "Responses") to include in 6846 // API requests with the JSON null value. By default, fields with empty 6847 // values are omitted from API requests. However, any field with an 6848 // empty value appearing in NullFields will be sent to the server as 6849 // null. It is an error if a field in this list has a non-empty value. 6850 // This may be used to include null fields in Patch requests. 6851 NullFields []string `json:"-"` 6852} 6853 6854func (s *GoogleCloudVisionV1p3beta1AsyncBatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) { 6855 type NoMethod GoogleCloudVisionV1p3beta1AsyncBatchAnnotateFilesResponse 6856 raw := NoMethod(*s) 6857 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6858} 6859 6860// GoogleCloudVisionV1p3beta1BatchOperationMetadata: Metadata for the 6861// batch operations such as the current state. This is included in the 6862// `metadata` field of the `Operation` returned by the `GetOperation` 6863// call of the `google::longrunning::Operations` service. 6864type GoogleCloudVisionV1p3beta1BatchOperationMetadata struct { 6865 // EndTime: The time when the batch request is finished and 6866 // google.longrunning.Operation.done is set to true. 6867 EndTime string `json:"endTime,omitempty"` 6868 6869 // State: The current state of the batch operation. 6870 // 6871 // Possible values: 6872 // "STATE_UNSPECIFIED" - Invalid. 6873 // "PROCESSING" - Request is actively being processed. 6874 // "SUCCESSFUL" - The request is done and at least one item has been 6875 // successfully processed. 6876 // "FAILED" - The request is done and no item has been successfully 6877 // processed. 6878 // "CANCELLED" - The request is done after the 6879 // longrunning.Operations.CancelOperation has been called by the user. 6880 // Any records that were processed before the cancel command are output 6881 // as specified in the request. 6882 State string `json:"state,omitempty"` 6883 6884 // SubmitTime: The time when the batch request was submitted to the 6885 // server. 6886 SubmitTime string `json:"submitTime,omitempty"` 6887 6888 // ForceSendFields is a list of field names (e.g. "EndTime") to 6889 // unconditionally include in API requests. By default, fields with 6890 // empty values are omitted from API requests. However, any non-pointer, 6891 // non-interface field appearing in ForceSendFields will be sent to the 6892 // server regardless of whether the field is empty or not. This may be 6893 // used to include empty fields in Patch requests. 6894 ForceSendFields []string `json:"-"` 6895 6896 // NullFields is a list of field names (e.g. "EndTime") to include in 6897 // API requests with the JSON null value. By default, fields with empty 6898 // values are omitted from API requests. However, any field with an 6899 // empty value appearing in NullFields will be sent to the server as 6900 // null. It is an error if a field in this list has a non-empty value. 6901 // This may be used to include null fields in Patch requests. 6902 NullFields []string `json:"-"` 6903} 6904 6905func (s *GoogleCloudVisionV1p3beta1BatchOperationMetadata) MarshalJSON() ([]byte, error) { 6906 type NoMethod GoogleCloudVisionV1p3beta1BatchOperationMetadata 6907 raw := NoMethod(*s) 6908 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6909} 6910 6911// GoogleCloudVisionV1p3beta1Block: Logical element on the page. 6912type GoogleCloudVisionV1p3beta1Block struct { 6913 // BlockType: Detected block type (text, image etc) for this block. 6914 // 6915 // Possible values: 6916 // "UNKNOWN" - Unknown block type. 6917 // "TEXT" - Regular text block. 6918 // "TABLE" - Table block. 6919 // "PICTURE" - Image block. 6920 // "RULER" - Horizontal/vertical line box. 6921 // "BARCODE" - Barcode block. 6922 BlockType string `json:"blockType,omitempty"` 6923 6924 // BoundingBox: The bounding box for the block. The vertices are in the 6925 // order of top-left, top-right, bottom-right, bottom-left. When a 6926 // rotation of the bounding box is detected the rotation is represented 6927 // as around the top-left corner as defined when the text is read in the 6928 // 'natural' orientation. For example: * when the text is horizontal it 6929 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 6930 // around the top-left corner it becomes: 2----3 | | 1----0 and the 6931 // vertex order will still be (0, 1, 2, 3). 6932 BoundingBox *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingBox,omitempty"` 6933 6934 // Confidence: Confidence of the OCR results on the block. Range [0, 1]. 6935 Confidence float64 `json:"confidence,omitempty"` 6936 6937 // Paragraphs: List of paragraphs in this block (if this blocks is of 6938 // type text). 6939 Paragraphs []*GoogleCloudVisionV1p3beta1Paragraph `json:"paragraphs,omitempty"` 6940 6941 // Property: Additional information detected for the block. 6942 Property *GoogleCloudVisionV1p3beta1TextAnnotationTextProperty `json:"property,omitempty"` 6943 6944 // ForceSendFields is a list of field names (e.g. "BlockType") to 6945 // unconditionally include in API requests. By default, fields with 6946 // empty values are omitted from API requests. However, any non-pointer, 6947 // non-interface field appearing in ForceSendFields will be sent to the 6948 // server regardless of whether the field is empty or not. This may be 6949 // used to include empty fields in Patch requests. 6950 ForceSendFields []string `json:"-"` 6951 6952 // NullFields is a list of field names (e.g. "BlockType") to include in 6953 // API requests with the JSON null value. By default, fields with empty 6954 // values are omitted from API requests. However, any field with an 6955 // empty value appearing in NullFields will be sent to the server as 6956 // null. It is an error if a field in this list has a non-empty value. 6957 // This may be used to include null fields in Patch requests. 6958 NullFields []string `json:"-"` 6959} 6960 6961func (s *GoogleCloudVisionV1p3beta1Block) MarshalJSON() ([]byte, error) { 6962 type NoMethod GoogleCloudVisionV1p3beta1Block 6963 raw := NoMethod(*s) 6964 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6965} 6966 6967func (s *GoogleCloudVisionV1p3beta1Block) UnmarshalJSON(data []byte) error { 6968 type NoMethod GoogleCloudVisionV1p3beta1Block 6969 var s1 struct { 6970 Confidence gensupport.JSONFloat64 `json:"confidence"` 6971 *NoMethod 6972 } 6973 s1.NoMethod = (*NoMethod)(s) 6974 if err := json.Unmarshal(data, &s1); err != nil { 6975 return err 6976 } 6977 s.Confidence = float64(s1.Confidence) 6978 return nil 6979} 6980 6981// GoogleCloudVisionV1p3beta1BoundingPoly: A bounding polygon for the 6982// detected image annotation. 6983type GoogleCloudVisionV1p3beta1BoundingPoly struct { 6984 // NormalizedVertices: The bounding polygon normalized vertices. 6985 NormalizedVertices []*GoogleCloudVisionV1p3beta1NormalizedVertex `json:"normalizedVertices,omitempty"` 6986 6987 // Vertices: The bounding polygon vertices. 6988 Vertices []*GoogleCloudVisionV1p3beta1Vertex `json:"vertices,omitempty"` 6989 6990 // ForceSendFields is a list of field names (e.g. "NormalizedVertices") 6991 // to unconditionally include in API requests. By default, fields with 6992 // empty values are omitted from API requests. However, any non-pointer, 6993 // non-interface field appearing in ForceSendFields will be sent to the 6994 // server regardless of whether the field is empty or not. This may be 6995 // used to include empty fields in Patch requests. 6996 ForceSendFields []string `json:"-"` 6997 6998 // NullFields is a list of field names (e.g. "NormalizedVertices") to 6999 // include in API requests with the JSON null value. By default, fields 7000 // with empty values are omitted from API requests. However, any field 7001 // with an empty value appearing in NullFields will be sent to the 7002 // server as null. It is an error if a field in this list has a 7003 // non-empty value. This may be used to include null fields in Patch 7004 // requests. 7005 NullFields []string `json:"-"` 7006} 7007 7008func (s *GoogleCloudVisionV1p3beta1BoundingPoly) MarshalJSON() ([]byte, error) { 7009 type NoMethod GoogleCloudVisionV1p3beta1BoundingPoly 7010 raw := NoMethod(*s) 7011 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7012} 7013 7014// GoogleCloudVisionV1p3beta1ColorInfo: Color information consists of 7015// RGB channels, score, and the fraction of the image that the color 7016// occupies in the image. 7017type GoogleCloudVisionV1p3beta1ColorInfo struct { 7018 // Color: RGB components of the color. 7019 Color *Color `json:"color,omitempty"` 7020 7021 // PixelFraction: The fraction of pixels the color occupies in the 7022 // image. Value in range [0, 1]. 7023 PixelFraction float64 `json:"pixelFraction,omitempty"` 7024 7025 // Score: Image-specific score for this color. Value in range [0, 1]. 7026 Score float64 `json:"score,omitempty"` 7027 7028 // ForceSendFields is a list of field names (e.g. "Color") to 7029 // unconditionally include in API requests. By default, fields with 7030 // empty values are omitted from API requests. However, any non-pointer, 7031 // non-interface field appearing in ForceSendFields will be sent to the 7032 // server regardless of whether the field is empty or not. This may be 7033 // used to include empty fields in Patch requests. 7034 ForceSendFields []string `json:"-"` 7035 7036 // NullFields is a list of field names (e.g. "Color") to include in API 7037 // requests with the JSON null value. By default, fields with empty 7038 // values are omitted from API requests. However, any field with an 7039 // empty value appearing in NullFields will be sent to the server as 7040 // null. It is an error if a field in this list has a non-empty value. 7041 // This may be used to include null fields in Patch requests. 7042 NullFields []string `json:"-"` 7043} 7044 7045func (s *GoogleCloudVisionV1p3beta1ColorInfo) MarshalJSON() ([]byte, error) { 7046 type NoMethod GoogleCloudVisionV1p3beta1ColorInfo 7047 raw := NoMethod(*s) 7048 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7049} 7050 7051func (s *GoogleCloudVisionV1p3beta1ColorInfo) UnmarshalJSON(data []byte) error { 7052 type NoMethod GoogleCloudVisionV1p3beta1ColorInfo 7053 var s1 struct { 7054 PixelFraction gensupport.JSONFloat64 `json:"pixelFraction"` 7055 Score gensupport.JSONFloat64 `json:"score"` 7056 *NoMethod 7057 } 7058 s1.NoMethod = (*NoMethod)(s) 7059 if err := json.Unmarshal(data, &s1); err != nil { 7060 return err 7061 } 7062 s.PixelFraction = float64(s1.PixelFraction) 7063 s.Score = float64(s1.Score) 7064 return nil 7065} 7066 7067// GoogleCloudVisionV1p3beta1CropHint: Single crop hint that is used to 7068// generate a new crop when serving an image. 7069type GoogleCloudVisionV1p3beta1CropHint struct { 7070 // BoundingPoly: The bounding polygon for the crop region. The 7071 // coordinates of the bounding box are in the original image's scale. 7072 BoundingPoly *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPoly,omitempty"` 7073 7074 // Confidence: Confidence of this being a salient region. Range [0, 1]. 7075 Confidence float64 `json:"confidence,omitempty"` 7076 7077 // ImportanceFraction: Fraction of importance of this salient region 7078 // with respect to the original image. 7079 ImportanceFraction float64 `json:"importanceFraction,omitempty"` 7080 7081 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 7082 // unconditionally include in API requests. By default, fields with 7083 // empty values are omitted from API requests. However, any non-pointer, 7084 // non-interface field appearing in ForceSendFields will be sent to the 7085 // server regardless of whether the field is empty or not. This may be 7086 // used to include empty fields in Patch requests. 7087 ForceSendFields []string `json:"-"` 7088 7089 // NullFields is a list of field names (e.g. "BoundingPoly") to include 7090 // in API requests with the JSON null value. By default, fields with 7091 // empty values are omitted from API requests. However, any field with 7092 // an empty value appearing in NullFields will be sent to the server as 7093 // null. It is an error if a field in this list has a non-empty value. 7094 // This may be used to include null fields in Patch requests. 7095 NullFields []string `json:"-"` 7096} 7097 7098func (s *GoogleCloudVisionV1p3beta1CropHint) MarshalJSON() ([]byte, error) { 7099 type NoMethod GoogleCloudVisionV1p3beta1CropHint 7100 raw := NoMethod(*s) 7101 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7102} 7103 7104func (s *GoogleCloudVisionV1p3beta1CropHint) UnmarshalJSON(data []byte) error { 7105 type NoMethod GoogleCloudVisionV1p3beta1CropHint 7106 var s1 struct { 7107 Confidence gensupport.JSONFloat64 `json:"confidence"` 7108 ImportanceFraction gensupport.JSONFloat64 `json:"importanceFraction"` 7109 *NoMethod 7110 } 7111 s1.NoMethod = (*NoMethod)(s) 7112 if err := json.Unmarshal(data, &s1); err != nil { 7113 return err 7114 } 7115 s.Confidence = float64(s1.Confidence) 7116 s.ImportanceFraction = float64(s1.ImportanceFraction) 7117 return nil 7118} 7119 7120// GoogleCloudVisionV1p3beta1CropHintsAnnotation: Set of crop hints that 7121// are used to generate new crops when serving images. 7122type GoogleCloudVisionV1p3beta1CropHintsAnnotation struct { 7123 // CropHints: Crop hint results. 7124 CropHints []*GoogleCloudVisionV1p3beta1CropHint `json:"cropHints,omitempty"` 7125 7126 // ForceSendFields is a list of field names (e.g. "CropHints") to 7127 // unconditionally include in API requests. By default, fields with 7128 // empty values are omitted from API requests. However, any non-pointer, 7129 // non-interface field appearing in ForceSendFields will be sent to the 7130 // server regardless of whether the field is empty or not. This may be 7131 // used to include empty fields in Patch requests. 7132 ForceSendFields []string `json:"-"` 7133 7134 // NullFields is a list of field names (e.g. "CropHints") to include in 7135 // API requests with the JSON null value. By default, fields with empty 7136 // values are omitted from API requests. However, any field with an 7137 // empty value appearing in NullFields will be sent to the server as 7138 // null. It is an error if a field in this list has a non-empty value. 7139 // This may be used to include null fields in Patch requests. 7140 NullFields []string `json:"-"` 7141} 7142 7143func (s *GoogleCloudVisionV1p3beta1CropHintsAnnotation) MarshalJSON() ([]byte, error) { 7144 type NoMethod GoogleCloudVisionV1p3beta1CropHintsAnnotation 7145 raw := NoMethod(*s) 7146 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7147} 7148 7149// GoogleCloudVisionV1p3beta1DominantColorsAnnotation: Set of dominant 7150// colors and their corresponding scores. 7151type GoogleCloudVisionV1p3beta1DominantColorsAnnotation struct { 7152 // Colors: RGB color values with their score and pixel fraction. 7153 Colors []*GoogleCloudVisionV1p3beta1ColorInfo `json:"colors,omitempty"` 7154 7155 // ForceSendFields is a list of field names (e.g. "Colors") to 7156 // unconditionally include in API requests. By default, fields with 7157 // empty values are omitted from API requests. However, any non-pointer, 7158 // non-interface field appearing in ForceSendFields will be sent to the 7159 // server regardless of whether the field is empty or not. This may be 7160 // used to include empty fields in Patch requests. 7161 ForceSendFields []string `json:"-"` 7162 7163 // NullFields is a list of field names (e.g. "Colors") to include in API 7164 // requests with the JSON null value. By default, fields with empty 7165 // values are omitted from API requests. However, any field with an 7166 // empty value appearing in NullFields will be sent to the server as 7167 // null. It is an error if a field in this list has a non-empty value. 7168 // This may be used to include null fields in Patch requests. 7169 NullFields []string `json:"-"` 7170} 7171 7172func (s *GoogleCloudVisionV1p3beta1DominantColorsAnnotation) MarshalJSON() ([]byte, error) { 7173 type NoMethod GoogleCloudVisionV1p3beta1DominantColorsAnnotation 7174 raw := NoMethod(*s) 7175 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7176} 7177 7178// GoogleCloudVisionV1p3beta1EntityAnnotation: Set of detected entity 7179// features. 7180type GoogleCloudVisionV1p3beta1EntityAnnotation struct { 7181 // BoundingPoly: Image region to which this entity belongs. Not produced 7182 // for `LABEL_DETECTION` features. 7183 BoundingPoly *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPoly,omitempty"` 7184 7185 // Confidence: **Deprecated. Use `score` instead.** The accuracy of the 7186 // entity detection in an image. For example, for an image in which the 7187 // "Eiffel Tower" entity is detected, this field represents the 7188 // confidence that there is a tower in the query image. Range [0, 1]. 7189 Confidence float64 `json:"confidence,omitempty"` 7190 7191 // Description: Entity textual description, expressed in its `locale` 7192 // language. 7193 Description string `json:"description,omitempty"` 7194 7195 // Locale: The language code for the locale in which the entity textual 7196 // `description` is expressed. 7197 Locale string `json:"locale,omitempty"` 7198 7199 // Locations: The location information for the detected entity. Multiple 7200 // `LocationInfo` elements can be present because one location may 7201 // indicate the location of the scene in the image, and another location 7202 // may indicate the location of the place where the image was taken. 7203 // Location information is usually present for landmarks. 7204 Locations []*GoogleCloudVisionV1p3beta1LocationInfo `json:"locations,omitempty"` 7205 7206 // Mid: Opaque entity ID. Some IDs may be available in Google Knowledge 7207 // Graph Search API (https://developers.google.com/knowledge-graph/). 7208 Mid string `json:"mid,omitempty"` 7209 7210 // Properties: Some entities may have optional user-supplied `Property` 7211 // (name/value) fields, such a score or string that qualifies the 7212 // entity. 7213 Properties []*GoogleCloudVisionV1p3beta1Property `json:"properties,omitempty"` 7214 7215 // Score: Overall score of the result. Range [0, 1]. 7216 Score float64 `json:"score,omitempty"` 7217 7218 // Topicality: The relevancy of the ICA (Image Content Annotation) label 7219 // to the image. For example, the relevancy of "tower" is likely higher 7220 // to an image containing the detected "Eiffel Tower" than to an image 7221 // containing a detected distant towering building, even though the 7222 // confidence that there is a tower in each image may be the same. Range 7223 // [0, 1]. 7224 Topicality float64 `json:"topicality,omitempty"` 7225 7226 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 7227 // unconditionally include in API requests. By default, fields with 7228 // empty values are omitted from API requests. However, any non-pointer, 7229 // non-interface field appearing in ForceSendFields will be sent to the 7230 // server regardless of whether the field is empty or not. This may be 7231 // used to include empty fields in Patch requests. 7232 ForceSendFields []string `json:"-"` 7233 7234 // NullFields is a list of field names (e.g. "BoundingPoly") to include 7235 // in API requests with the JSON null value. By default, fields with 7236 // empty values are omitted from API requests. However, any field with 7237 // an empty value appearing in NullFields will be sent to the server as 7238 // null. It is an error if a field in this list has a non-empty value. 7239 // This may be used to include null fields in Patch requests. 7240 NullFields []string `json:"-"` 7241} 7242 7243func (s *GoogleCloudVisionV1p3beta1EntityAnnotation) MarshalJSON() ([]byte, error) { 7244 type NoMethod GoogleCloudVisionV1p3beta1EntityAnnotation 7245 raw := NoMethod(*s) 7246 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7247} 7248 7249func (s *GoogleCloudVisionV1p3beta1EntityAnnotation) UnmarshalJSON(data []byte) error { 7250 type NoMethod GoogleCloudVisionV1p3beta1EntityAnnotation 7251 var s1 struct { 7252 Confidence gensupport.JSONFloat64 `json:"confidence"` 7253 Score gensupport.JSONFloat64 `json:"score"` 7254 Topicality gensupport.JSONFloat64 `json:"topicality"` 7255 *NoMethod 7256 } 7257 s1.NoMethod = (*NoMethod)(s) 7258 if err := json.Unmarshal(data, &s1); err != nil { 7259 return err 7260 } 7261 s.Confidence = float64(s1.Confidence) 7262 s.Score = float64(s1.Score) 7263 s.Topicality = float64(s1.Topicality) 7264 return nil 7265} 7266 7267// GoogleCloudVisionV1p3beta1FaceAnnotation: A face annotation object 7268// contains the results of face detection. 7269type GoogleCloudVisionV1p3beta1FaceAnnotation struct { 7270 // AngerLikelihood: Anger likelihood. 7271 // 7272 // Possible values: 7273 // "UNKNOWN" - Unknown likelihood. 7274 // "VERY_UNLIKELY" - It is very unlikely. 7275 // "UNLIKELY" - It is unlikely. 7276 // "POSSIBLE" - It is possible. 7277 // "LIKELY" - It is likely. 7278 // "VERY_LIKELY" - It is very likely. 7279 AngerLikelihood string `json:"angerLikelihood,omitempty"` 7280 7281 // BlurredLikelihood: Blurred likelihood. 7282 // 7283 // Possible values: 7284 // "UNKNOWN" - Unknown likelihood. 7285 // "VERY_UNLIKELY" - It is very unlikely. 7286 // "UNLIKELY" - It is unlikely. 7287 // "POSSIBLE" - It is possible. 7288 // "LIKELY" - It is likely. 7289 // "VERY_LIKELY" - It is very likely. 7290 BlurredLikelihood string `json:"blurredLikelihood,omitempty"` 7291 7292 // BoundingPoly: The bounding polygon around the face. The coordinates 7293 // of the bounding box are in the original image's scale. The bounding 7294 // box is computed to "frame" the face in accordance with human 7295 // expectations. It is based on the landmarker results. Note that one or 7296 // more x and/or y coordinates may not be generated in the 7297 // `BoundingPoly` (the polygon will be unbounded) if only a partial face 7298 // appears in the image to be annotated. 7299 BoundingPoly *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPoly,omitempty"` 7300 7301 // DetectionConfidence: Detection confidence. Range [0, 1]. 7302 DetectionConfidence float64 `json:"detectionConfidence,omitempty"` 7303 7304 // FdBoundingPoly: The `fd_bounding_poly` bounding polygon is tighter 7305 // than the `boundingPoly`, and encloses only the skin part of the face. 7306 // Typically, it is used to eliminate the face from any image analysis 7307 // that detects the "amount of skin" visible in an image. It is not 7308 // based on the landmarker results, only on the initial face detection, 7309 // hence the fd (face detection) prefix. 7310 FdBoundingPoly *GoogleCloudVisionV1p3beta1BoundingPoly `json:"fdBoundingPoly,omitempty"` 7311 7312 // HeadwearLikelihood: Headwear likelihood. 7313 // 7314 // Possible values: 7315 // "UNKNOWN" - Unknown likelihood. 7316 // "VERY_UNLIKELY" - It is very unlikely. 7317 // "UNLIKELY" - It is unlikely. 7318 // "POSSIBLE" - It is possible. 7319 // "LIKELY" - It is likely. 7320 // "VERY_LIKELY" - It is very likely. 7321 HeadwearLikelihood string `json:"headwearLikelihood,omitempty"` 7322 7323 // JoyLikelihood: Joy likelihood. 7324 // 7325 // Possible values: 7326 // "UNKNOWN" - Unknown likelihood. 7327 // "VERY_UNLIKELY" - It is very unlikely. 7328 // "UNLIKELY" - It is unlikely. 7329 // "POSSIBLE" - It is possible. 7330 // "LIKELY" - It is likely. 7331 // "VERY_LIKELY" - It is very likely. 7332 JoyLikelihood string `json:"joyLikelihood,omitempty"` 7333 7334 // LandmarkingConfidence: Face landmarking confidence. Range [0, 1]. 7335 LandmarkingConfidence float64 `json:"landmarkingConfidence,omitempty"` 7336 7337 // Landmarks: Detected face landmarks. 7338 Landmarks []*GoogleCloudVisionV1p3beta1FaceAnnotationLandmark `json:"landmarks,omitempty"` 7339 7340 // PanAngle: Yaw angle, which indicates the leftward/rightward angle 7341 // that the face is pointing relative to the vertical plane 7342 // perpendicular to the image. Range [-180,180]. 7343 PanAngle float64 `json:"panAngle,omitempty"` 7344 7345 // RollAngle: Roll angle, which indicates the amount of 7346 // clockwise/anti-clockwise rotation of the face relative to the image 7347 // vertical about the axis perpendicular to the face. Range [-180,180]. 7348 RollAngle float64 `json:"rollAngle,omitempty"` 7349 7350 // SorrowLikelihood: Sorrow likelihood. 7351 // 7352 // Possible values: 7353 // "UNKNOWN" - Unknown likelihood. 7354 // "VERY_UNLIKELY" - It is very unlikely. 7355 // "UNLIKELY" - It is unlikely. 7356 // "POSSIBLE" - It is possible. 7357 // "LIKELY" - It is likely. 7358 // "VERY_LIKELY" - It is very likely. 7359 SorrowLikelihood string `json:"sorrowLikelihood,omitempty"` 7360 7361 // SurpriseLikelihood: Surprise likelihood. 7362 // 7363 // Possible values: 7364 // "UNKNOWN" - Unknown likelihood. 7365 // "VERY_UNLIKELY" - It is very unlikely. 7366 // "UNLIKELY" - It is unlikely. 7367 // "POSSIBLE" - It is possible. 7368 // "LIKELY" - It is likely. 7369 // "VERY_LIKELY" - It is very likely. 7370 SurpriseLikelihood string `json:"surpriseLikelihood,omitempty"` 7371 7372 // TiltAngle: Pitch angle, which indicates the upwards/downwards angle 7373 // that the face is pointing relative to the image's horizontal plane. 7374 // Range [-180,180]. 7375 TiltAngle float64 `json:"tiltAngle,omitempty"` 7376 7377 // UnderExposedLikelihood: Under-exposed likelihood. 7378 // 7379 // Possible values: 7380 // "UNKNOWN" - Unknown likelihood. 7381 // "VERY_UNLIKELY" - It is very unlikely. 7382 // "UNLIKELY" - It is unlikely. 7383 // "POSSIBLE" - It is possible. 7384 // "LIKELY" - It is likely. 7385 // "VERY_LIKELY" - It is very likely. 7386 UnderExposedLikelihood string `json:"underExposedLikelihood,omitempty"` 7387 7388 // ForceSendFields is a list of field names (e.g. "AngerLikelihood") 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. "AngerLikelihood") to 7397 // include in API requests with the JSON null value. By default, fields 7398 // with empty values are omitted from API requests. However, any field 7399 // with an empty value appearing in NullFields will be sent to the 7400 // server as null. It is an error if a field in this list has a 7401 // non-empty value. This may be used to include null fields in Patch 7402 // requests. 7403 NullFields []string `json:"-"` 7404} 7405 7406func (s *GoogleCloudVisionV1p3beta1FaceAnnotation) MarshalJSON() ([]byte, error) { 7407 type NoMethod GoogleCloudVisionV1p3beta1FaceAnnotation 7408 raw := NoMethod(*s) 7409 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7410} 7411 7412func (s *GoogleCloudVisionV1p3beta1FaceAnnotation) UnmarshalJSON(data []byte) error { 7413 type NoMethod GoogleCloudVisionV1p3beta1FaceAnnotation 7414 var s1 struct { 7415 DetectionConfidence gensupport.JSONFloat64 `json:"detectionConfidence"` 7416 LandmarkingConfidence gensupport.JSONFloat64 `json:"landmarkingConfidence"` 7417 PanAngle gensupport.JSONFloat64 `json:"panAngle"` 7418 RollAngle gensupport.JSONFloat64 `json:"rollAngle"` 7419 TiltAngle gensupport.JSONFloat64 `json:"tiltAngle"` 7420 *NoMethod 7421 } 7422 s1.NoMethod = (*NoMethod)(s) 7423 if err := json.Unmarshal(data, &s1); err != nil { 7424 return err 7425 } 7426 s.DetectionConfidence = float64(s1.DetectionConfidence) 7427 s.LandmarkingConfidence = float64(s1.LandmarkingConfidence) 7428 s.PanAngle = float64(s1.PanAngle) 7429 s.RollAngle = float64(s1.RollAngle) 7430 s.TiltAngle = float64(s1.TiltAngle) 7431 return nil 7432} 7433 7434// GoogleCloudVisionV1p3beta1FaceAnnotationLandmark: A face-specific 7435// landmark (for example, a face feature). 7436type GoogleCloudVisionV1p3beta1FaceAnnotationLandmark struct { 7437 // Position: Face landmark position. 7438 Position *GoogleCloudVisionV1p3beta1Position `json:"position,omitempty"` 7439 7440 // Type: Face landmark type. 7441 // 7442 // Possible values: 7443 // "UNKNOWN_LANDMARK" - Unknown face landmark detected. Should not be 7444 // filled. 7445 // "LEFT_EYE" - Left eye. 7446 // "RIGHT_EYE" - Right eye. 7447 // "LEFT_OF_LEFT_EYEBROW" - Left of left eyebrow. 7448 // "RIGHT_OF_LEFT_EYEBROW" - Right of left eyebrow. 7449 // "LEFT_OF_RIGHT_EYEBROW" - Left of right eyebrow. 7450 // "RIGHT_OF_RIGHT_EYEBROW" - Right of right eyebrow. 7451 // "MIDPOINT_BETWEEN_EYES" - Midpoint between eyes. 7452 // "NOSE_TIP" - Nose tip. 7453 // "UPPER_LIP" - Upper lip. 7454 // "LOWER_LIP" - Lower lip. 7455 // "MOUTH_LEFT" - Mouth left. 7456 // "MOUTH_RIGHT" - Mouth right. 7457 // "MOUTH_CENTER" - Mouth center. 7458 // "NOSE_BOTTOM_RIGHT" - Nose, bottom right. 7459 // "NOSE_BOTTOM_LEFT" - Nose, bottom left. 7460 // "NOSE_BOTTOM_CENTER" - Nose, bottom center. 7461 // "LEFT_EYE_TOP_BOUNDARY" - Left eye, top boundary. 7462 // "LEFT_EYE_RIGHT_CORNER" - Left eye, right corner. 7463 // "LEFT_EYE_BOTTOM_BOUNDARY" - Left eye, bottom boundary. 7464 // "LEFT_EYE_LEFT_CORNER" - Left eye, left corner. 7465 // "RIGHT_EYE_TOP_BOUNDARY" - Right eye, top boundary. 7466 // "RIGHT_EYE_RIGHT_CORNER" - Right eye, right corner. 7467 // "RIGHT_EYE_BOTTOM_BOUNDARY" - Right eye, bottom boundary. 7468 // "RIGHT_EYE_LEFT_CORNER" - Right eye, left corner. 7469 // "LEFT_EYEBROW_UPPER_MIDPOINT" - Left eyebrow, upper midpoint. 7470 // "RIGHT_EYEBROW_UPPER_MIDPOINT" - Right eyebrow, upper midpoint. 7471 // "LEFT_EAR_TRAGION" - Left ear tragion. 7472 // "RIGHT_EAR_TRAGION" - Right ear tragion. 7473 // "LEFT_EYE_PUPIL" - Left eye pupil. 7474 // "RIGHT_EYE_PUPIL" - Right eye pupil. 7475 // "FOREHEAD_GLABELLA" - Forehead glabella. 7476 // "CHIN_GNATHION" - Chin gnathion. 7477 // "CHIN_LEFT_GONION" - Chin left gonion. 7478 // "CHIN_RIGHT_GONION" - Chin right gonion. 7479 // "LEFT_CHEEK_CENTER" - Left cheek center. 7480 // "RIGHT_CHEEK_CENTER" - Right cheek center. 7481 Type string `json:"type,omitempty"` 7482 7483 // ForceSendFields is a list of field names (e.g. "Position") to 7484 // unconditionally include in API requests. By default, fields with 7485 // empty values are omitted from API requests. However, any non-pointer, 7486 // non-interface field appearing in ForceSendFields will be sent to the 7487 // server regardless of whether the field is empty or not. This may be 7488 // used to include empty fields in Patch requests. 7489 ForceSendFields []string `json:"-"` 7490 7491 // NullFields is a list of field names (e.g. "Position") to include in 7492 // API requests with the JSON null value. By default, fields with empty 7493 // values are omitted from API requests. However, any field with an 7494 // empty value appearing in NullFields will be sent to the server as 7495 // null. It is an error if a field in this list has a non-empty value. 7496 // This may be used to include null fields in Patch requests. 7497 NullFields []string `json:"-"` 7498} 7499 7500func (s *GoogleCloudVisionV1p3beta1FaceAnnotationLandmark) MarshalJSON() ([]byte, error) { 7501 type NoMethod GoogleCloudVisionV1p3beta1FaceAnnotationLandmark 7502 raw := NoMethod(*s) 7503 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7504} 7505 7506// GoogleCloudVisionV1p3beta1GcsDestination: The Google Cloud Storage 7507// location where the output will be written to. 7508type GoogleCloudVisionV1p3beta1GcsDestination struct { 7509 // Uri: Google Cloud Storage URI prefix where the results will be 7510 // stored. Results will be in JSON format and preceded by its 7511 // corresponding input URI prefix. This field can either represent a gcs 7512 // file prefix or gcs directory. In either case, the uri should be 7513 // unique because in order to get all of the output files, you will need 7514 // to do a wildcard gcs search on the uri prefix you provide. Examples: 7515 // * File Prefix: gs://bucket-name/here/filenameprefix The output files 7516 // will be created in gs://bucket-name/here/ and the names of the output 7517 // files will begin with "filenameprefix". * Directory Prefix: 7518 // gs://bucket-name/some/location/ The output files will be created in 7519 // gs://bucket-name/some/location/ and the names of the output files 7520 // could be anything because there was no filename prefix specified. If 7521 // multiple outputs, each response is still AnnotateFileResponse, each 7522 // of which contains some subset of the full list of 7523 // AnnotateImageResponse. Multiple outputs can happen if, for example, 7524 // the output JSON is too large and overflows into multiple sharded 7525 // files. 7526 Uri string `json:"uri,omitempty"` 7527 7528 // ForceSendFields is a list of field names (e.g. "Uri") to 7529 // unconditionally include in API requests. By default, fields with 7530 // empty values are omitted from API requests. However, any non-pointer, 7531 // non-interface field appearing in ForceSendFields will be sent to the 7532 // server regardless of whether the field is empty or not. This may be 7533 // used to include empty fields in Patch requests. 7534 ForceSendFields []string `json:"-"` 7535 7536 // NullFields is a list of field names (e.g. "Uri") to include in API 7537 // requests with the JSON null value. By default, fields with empty 7538 // values are omitted from API requests. However, any field with an 7539 // empty value appearing in NullFields will be sent to the server as 7540 // null. It is an error if a field in this list has a non-empty value. 7541 // This may be used to include null fields in Patch requests. 7542 NullFields []string `json:"-"` 7543} 7544 7545func (s *GoogleCloudVisionV1p3beta1GcsDestination) MarshalJSON() ([]byte, error) { 7546 type NoMethod GoogleCloudVisionV1p3beta1GcsDestination 7547 raw := NoMethod(*s) 7548 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7549} 7550 7551// GoogleCloudVisionV1p3beta1GcsSource: The Google Cloud Storage 7552// location where the input will be read from. 7553type GoogleCloudVisionV1p3beta1GcsSource struct { 7554 // Uri: Google Cloud Storage URI for the input file. This must only be a 7555 // Google Cloud Storage object. Wildcards are not currently supported. 7556 Uri string `json:"uri,omitempty"` 7557 7558 // ForceSendFields is a list of field names (e.g. "Uri") to 7559 // unconditionally include in API requests. By default, fields with 7560 // empty values are omitted from API requests. However, any non-pointer, 7561 // non-interface field appearing in ForceSendFields will be sent to the 7562 // server regardless of whether the field is empty or not. This may be 7563 // used to include empty fields in Patch requests. 7564 ForceSendFields []string `json:"-"` 7565 7566 // NullFields is a list of field names (e.g. "Uri") to include in API 7567 // requests with the JSON null value. By default, fields with empty 7568 // values are omitted from API requests. However, any field with an 7569 // empty value appearing in NullFields will be sent to the server as 7570 // null. It is an error if a field in this list has a non-empty value. 7571 // This may be used to include null fields in Patch requests. 7572 NullFields []string `json:"-"` 7573} 7574 7575func (s *GoogleCloudVisionV1p3beta1GcsSource) MarshalJSON() ([]byte, error) { 7576 type NoMethod GoogleCloudVisionV1p3beta1GcsSource 7577 raw := NoMethod(*s) 7578 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7579} 7580 7581// GoogleCloudVisionV1p3beta1ImageAnnotationContext: If an image was 7582// produced from a file (e.g. a PDF), this message gives information 7583// about the source of that image. 7584type GoogleCloudVisionV1p3beta1ImageAnnotationContext struct { 7585 // PageNumber: If the file was a PDF or TIFF, this field gives the page 7586 // number within the file used to produce the image. 7587 PageNumber int64 `json:"pageNumber,omitempty"` 7588 7589 // Uri: The URI of the file used to produce the image. 7590 Uri string `json:"uri,omitempty"` 7591 7592 // ForceSendFields is a list of field names (e.g. "PageNumber") to 7593 // unconditionally include in API requests. By default, fields with 7594 // empty values are omitted from API requests. However, any non-pointer, 7595 // non-interface field appearing in ForceSendFields will be sent to the 7596 // server regardless of whether the field is empty or not. This may be 7597 // used to include empty fields in Patch requests. 7598 ForceSendFields []string `json:"-"` 7599 7600 // NullFields is a list of field names (e.g. "PageNumber") to include in 7601 // API requests with the JSON null value. By default, fields with empty 7602 // values are omitted from API requests. However, any field with an 7603 // empty value appearing in NullFields will be sent to the server as 7604 // null. It is an error if a field in this list has a non-empty value. 7605 // This may be used to include null fields in Patch requests. 7606 NullFields []string `json:"-"` 7607} 7608 7609func (s *GoogleCloudVisionV1p3beta1ImageAnnotationContext) MarshalJSON() ([]byte, error) { 7610 type NoMethod GoogleCloudVisionV1p3beta1ImageAnnotationContext 7611 raw := NoMethod(*s) 7612 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7613} 7614 7615// GoogleCloudVisionV1p3beta1ImageProperties: Stores image properties, 7616// such as dominant colors. 7617type GoogleCloudVisionV1p3beta1ImageProperties struct { 7618 // DominantColors: If present, dominant colors completed successfully. 7619 DominantColors *GoogleCloudVisionV1p3beta1DominantColorsAnnotation `json:"dominantColors,omitempty"` 7620 7621 // ForceSendFields is a list of field names (e.g. "DominantColors") to 7622 // unconditionally include in API requests. By default, fields with 7623 // empty values are omitted from API requests. However, any non-pointer, 7624 // non-interface field appearing in ForceSendFields will be sent to the 7625 // server regardless of whether the field is empty or not. This may be 7626 // used to include empty fields in Patch requests. 7627 ForceSendFields []string `json:"-"` 7628 7629 // NullFields is a list of field names (e.g. "DominantColors") to 7630 // include in API requests with the JSON null value. By default, fields 7631 // with empty values are omitted from API requests. However, any field 7632 // with an empty value appearing in NullFields will be sent to the 7633 // server as null. It is an error if a field in this list has a 7634 // non-empty value. This may be used to include null fields in Patch 7635 // requests. 7636 NullFields []string `json:"-"` 7637} 7638 7639func (s *GoogleCloudVisionV1p3beta1ImageProperties) MarshalJSON() ([]byte, error) { 7640 type NoMethod GoogleCloudVisionV1p3beta1ImageProperties 7641 raw := NoMethod(*s) 7642 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7643} 7644 7645// GoogleCloudVisionV1p3beta1ImportProductSetsResponse: Response message 7646// for the `ImportProductSets` method. This message is returned by the 7647// google.longrunning.Operations.GetOperation method in the returned 7648// google.longrunning.Operation.response field. 7649type GoogleCloudVisionV1p3beta1ImportProductSetsResponse struct { 7650 // ReferenceImages: The list of reference_images that are imported 7651 // successfully. 7652 ReferenceImages []*GoogleCloudVisionV1p3beta1ReferenceImage `json:"referenceImages,omitempty"` 7653 7654 // Statuses: The rpc status for each ImportProductSet request, including 7655 // both successes and errors. The number of statuses here matches the 7656 // number of lines in the csv file, and statuses[i] stores the success 7657 // or failure status of processing the i-th line of the csv, starting 7658 // from line 0. 7659 Statuses []*Status `json:"statuses,omitempty"` 7660 7661 // ForceSendFields is a list of field names (e.g. "ReferenceImages") to 7662 // unconditionally include in API requests. By default, fields with 7663 // empty values are omitted from API requests. However, any non-pointer, 7664 // non-interface field appearing in ForceSendFields will be sent to the 7665 // server regardless of whether the field is empty or not. This may be 7666 // used to include empty fields in Patch requests. 7667 ForceSendFields []string `json:"-"` 7668 7669 // NullFields is a list of field names (e.g. "ReferenceImages") to 7670 // include in API requests with the JSON null value. By default, fields 7671 // with empty values are omitted from API requests. However, any field 7672 // with an empty value appearing in NullFields will be sent to the 7673 // server as null. It is an error if a field in this list has a 7674 // non-empty value. This may be used to include null fields in Patch 7675 // requests. 7676 NullFields []string `json:"-"` 7677} 7678 7679func (s *GoogleCloudVisionV1p3beta1ImportProductSetsResponse) MarshalJSON() ([]byte, error) { 7680 type NoMethod GoogleCloudVisionV1p3beta1ImportProductSetsResponse 7681 raw := NoMethod(*s) 7682 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7683} 7684 7685// GoogleCloudVisionV1p3beta1InputConfig: The desired input location and 7686// metadata. 7687type GoogleCloudVisionV1p3beta1InputConfig struct { 7688 // Content: File content, represented as a stream of bytes. Note: As 7689 // with all `bytes` fields, protobuffers use a pure binary 7690 // representation, whereas JSON representations use base64. Currently, 7691 // this field only works for BatchAnnotateFiles requests. It does not 7692 // work for AsyncBatchAnnotateFiles requests. 7693 Content string `json:"content,omitempty"` 7694 7695 // GcsSource: The Google Cloud Storage location to read the input from. 7696 GcsSource *GoogleCloudVisionV1p3beta1GcsSource `json:"gcsSource,omitempty"` 7697 7698 // MimeType: The type of the file. Currently only "application/pdf", 7699 // "image/tiff" and "image/gif" are supported. Wildcards are not 7700 // supported. 7701 MimeType string `json:"mimeType,omitempty"` 7702 7703 // ForceSendFields is a list of field names (e.g. "Content") to 7704 // unconditionally include in API requests. By default, fields with 7705 // empty values are omitted from API requests. However, any non-pointer, 7706 // non-interface field appearing in ForceSendFields will be sent to the 7707 // server regardless of whether the field is empty or not. This may be 7708 // used to include empty fields in Patch requests. 7709 ForceSendFields []string `json:"-"` 7710 7711 // NullFields is a list of field names (e.g. "Content") to include in 7712 // API requests with the JSON null value. By default, fields with empty 7713 // values are omitted from API requests. However, any field with an 7714 // empty value appearing in NullFields will be sent to the server as 7715 // null. It is an error if a field in this list has a non-empty value. 7716 // This may be used to include null fields in Patch requests. 7717 NullFields []string `json:"-"` 7718} 7719 7720func (s *GoogleCloudVisionV1p3beta1InputConfig) MarshalJSON() ([]byte, error) { 7721 type NoMethod GoogleCloudVisionV1p3beta1InputConfig 7722 raw := NoMethod(*s) 7723 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7724} 7725 7726// GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation: Set of detected 7727// objects with bounding boxes. 7728type GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation struct { 7729 // BoundingPoly: Image region to which this object belongs. This must be 7730 // populated. 7731 BoundingPoly *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPoly,omitempty"` 7732 7733 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". 7734 // For more information, see 7735 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 7736 LanguageCode string `json:"languageCode,omitempty"` 7737 7738 // Mid: Object ID that should align with EntityAnnotation mid. 7739 Mid string `json:"mid,omitempty"` 7740 7741 // Name: Object name, expressed in its `language_code` language. 7742 Name string `json:"name,omitempty"` 7743 7744 // Score: Score of the result. Range [0, 1]. 7745 Score float64 `json:"score,omitempty"` 7746 7747 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 7748 // unconditionally include in API requests. By default, fields with 7749 // empty values are omitted from API requests. However, any non-pointer, 7750 // non-interface field appearing in ForceSendFields will be sent to the 7751 // server regardless of whether the field is empty or not. This may be 7752 // used to include empty fields in Patch requests. 7753 ForceSendFields []string `json:"-"` 7754 7755 // NullFields is a list of field names (e.g. "BoundingPoly") to include 7756 // in API requests with the JSON null value. By default, fields with 7757 // empty values are omitted from API requests. However, any field with 7758 // an empty value appearing in NullFields will be sent to the server as 7759 // null. It is an error if a field in this list has a non-empty value. 7760 // This may be used to include null fields in Patch requests. 7761 NullFields []string `json:"-"` 7762} 7763 7764func (s *GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation) MarshalJSON() ([]byte, error) { 7765 type NoMethod GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation 7766 raw := NoMethod(*s) 7767 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7768} 7769 7770func (s *GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation) UnmarshalJSON(data []byte) error { 7771 type NoMethod GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation 7772 var s1 struct { 7773 Score gensupport.JSONFloat64 `json:"score"` 7774 *NoMethod 7775 } 7776 s1.NoMethod = (*NoMethod)(s) 7777 if err := json.Unmarshal(data, &s1); err != nil { 7778 return err 7779 } 7780 s.Score = float64(s1.Score) 7781 return nil 7782} 7783 7784// GoogleCloudVisionV1p3beta1LocationInfo: Detected entity location 7785// information. 7786type GoogleCloudVisionV1p3beta1LocationInfo struct { 7787 // LatLng: lat/long location coordinates. 7788 LatLng *LatLng `json:"latLng,omitempty"` 7789 7790 // ForceSendFields is a list of field names (e.g. "LatLng") to 7791 // unconditionally include in API requests. By default, fields with 7792 // empty values are omitted from API requests. However, any non-pointer, 7793 // non-interface field appearing in ForceSendFields will be sent to the 7794 // server regardless of whether the field is empty or not. This may be 7795 // used to include empty fields in Patch requests. 7796 ForceSendFields []string `json:"-"` 7797 7798 // NullFields is a list of field names (e.g. "LatLng") to include in API 7799 // requests with the JSON null value. By default, fields with empty 7800 // values are omitted from API requests. However, any field with an 7801 // empty value appearing in NullFields will be sent to the server as 7802 // null. It is an error if a field in this list has a non-empty value. 7803 // This may be used to include null fields in Patch requests. 7804 NullFields []string `json:"-"` 7805} 7806 7807func (s *GoogleCloudVisionV1p3beta1LocationInfo) MarshalJSON() ([]byte, error) { 7808 type NoMethod GoogleCloudVisionV1p3beta1LocationInfo 7809 raw := NoMethod(*s) 7810 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7811} 7812 7813// GoogleCloudVisionV1p3beta1NormalizedVertex: A vertex represents a 2D 7814// point in the image. NOTE: the normalized vertex coordinates are 7815// relative to the original image and range from 0 to 1. 7816type GoogleCloudVisionV1p3beta1NormalizedVertex struct { 7817 // X: X coordinate. 7818 X float64 `json:"x,omitempty"` 7819 7820 // Y: Y coordinate. 7821 Y float64 `json:"y,omitempty"` 7822 7823 // ForceSendFields is a list of field names (e.g. "X") to 7824 // unconditionally include in API requests. By default, fields with 7825 // empty values are omitted from API requests. However, any non-pointer, 7826 // non-interface field appearing in ForceSendFields will be sent to the 7827 // server regardless of whether the field is empty or not. This may be 7828 // used to include empty fields in Patch requests. 7829 ForceSendFields []string `json:"-"` 7830 7831 // NullFields is a list of field names (e.g. "X") to include in API 7832 // requests with the JSON null value. By default, fields with empty 7833 // values are omitted from API requests. However, any field with an 7834 // empty value appearing in NullFields will be sent to the server as 7835 // null. It is an error if a field in this list has a non-empty value. 7836 // This may be used to include null fields in Patch requests. 7837 NullFields []string `json:"-"` 7838} 7839 7840func (s *GoogleCloudVisionV1p3beta1NormalizedVertex) MarshalJSON() ([]byte, error) { 7841 type NoMethod GoogleCloudVisionV1p3beta1NormalizedVertex 7842 raw := NoMethod(*s) 7843 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7844} 7845 7846func (s *GoogleCloudVisionV1p3beta1NormalizedVertex) UnmarshalJSON(data []byte) error { 7847 type NoMethod GoogleCloudVisionV1p3beta1NormalizedVertex 7848 var s1 struct { 7849 X gensupport.JSONFloat64 `json:"x"` 7850 Y gensupport.JSONFloat64 `json:"y"` 7851 *NoMethod 7852 } 7853 s1.NoMethod = (*NoMethod)(s) 7854 if err := json.Unmarshal(data, &s1); err != nil { 7855 return err 7856 } 7857 s.X = float64(s1.X) 7858 s.Y = float64(s1.Y) 7859 return nil 7860} 7861 7862// GoogleCloudVisionV1p3beta1OperationMetadata: Contains metadata for 7863// the BatchAnnotateImages operation. 7864type GoogleCloudVisionV1p3beta1OperationMetadata struct { 7865 // CreateTime: The time when the batch request was received. 7866 CreateTime string `json:"createTime,omitempty"` 7867 7868 // State: Current state of the batch operation. 7869 // 7870 // Possible values: 7871 // "STATE_UNSPECIFIED" - Invalid. 7872 // "CREATED" - Request is received. 7873 // "RUNNING" - Request is actively being processed. 7874 // "DONE" - The batch processing is done. 7875 // "CANCELLED" - The batch processing was cancelled. 7876 State string `json:"state,omitempty"` 7877 7878 // UpdateTime: The time when the operation result was last updated. 7879 UpdateTime string `json:"updateTime,omitempty"` 7880 7881 // ForceSendFields is a list of field names (e.g. "CreateTime") to 7882 // unconditionally include in API requests. By default, fields with 7883 // empty values are omitted from API requests. However, any non-pointer, 7884 // non-interface field appearing in ForceSendFields will be sent to the 7885 // server regardless of whether the field is empty or not. This may be 7886 // used to include empty fields in Patch requests. 7887 ForceSendFields []string `json:"-"` 7888 7889 // NullFields is a list of field names (e.g. "CreateTime") to include in 7890 // API requests with the JSON null value. By default, fields with empty 7891 // values are omitted from API requests. However, any field with an 7892 // empty value appearing in NullFields will be sent to the server as 7893 // null. It is an error if a field in this list has a non-empty value. 7894 // This may be used to include null fields in Patch requests. 7895 NullFields []string `json:"-"` 7896} 7897 7898func (s *GoogleCloudVisionV1p3beta1OperationMetadata) MarshalJSON() ([]byte, error) { 7899 type NoMethod GoogleCloudVisionV1p3beta1OperationMetadata 7900 raw := NoMethod(*s) 7901 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7902} 7903 7904// GoogleCloudVisionV1p3beta1OutputConfig: The desired output location 7905// and metadata. 7906type GoogleCloudVisionV1p3beta1OutputConfig struct { 7907 // BatchSize: The max number of response protos to put into each output 7908 // JSON file on Google Cloud Storage. The valid range is [1, 100]. If 7909 // not specified, the default value is 20. For example, for one pdf file 7910 // with 100 pages, 100 response protos will be generated. If 7911 // `batch_size` = 20, then 5 json files each containing 20 response 7912 // protos will be written under the prefix `gcs_destination`.`uri`. 7913 // Currently, batch_size only applies to GcsDestination, with potential 7914 // future support for other output configurations. 7915 BatchSize int64 `json:"batchSize,omitempty"` 7916 7917 // GcsDestination: The Google Cloud Storage location to write the 7918 // output(s) to. 7919 GcsDestination *GoogleCloudVisionV1p3beta1GcsDestination `json:"gcsDestination,omitempty"` 7920 7921 // ForceSendFields is a list of field names (e.g. "BatchSize") to 7922 // unconditionally include in API requests. By default, fields with 7923 // empty values are omitted from API requests. However, any non-pointer, 7924 // non-interface field appearing in ForceSendFields will be sent to the 7925 // server regardless of whether the field is empty or not. This may be 7926 // used to include empty fields in Patch requests. 7927 ForceSendFields []string `json:"-"` 7928 7929 // NullFields is a list of field names (e.g. "BatchSize") to include in 7930 // API requests with the JSON null value. By default, fields with empty 7931 // values are omitted from API requests. However, any field with an 7932 // empty value appearing in NullFields will be sent to the server as 7933 // null. It is an error if a field in this list has a non-empty value. 7934 // This may be used to include null fields in Patch requests. 7935 NullFields []string `json:"-"` 7936} 7937 7938func (s *GoogleCloudVisionV1p3beta1OutputConfig) MarshalJSON() ([]byte, error) { 7939 type NoMethod GoogleCloudVisionV1p3beta1OutputConfig 7940 raw := NoMethod(*s) 7941 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7942} 7943 7944// GoogleCloudVisionV1p3beta1Page: Detected page from OCR. 7945type GoogleCloudVisionV1p3beta1Page struct { 7946 // Blocks: List of blocks of text, images etc on this page. 7947 Blocks []*GoogleCloudVisionV1p3beta1Block `json:"blocks,omitempty"` 7948 7949 // Confidence: Confidence of the OCR results on the page. Range [0, 1]. 7950 Confidence float64 `json:"confidence,omitempty"` 7951 7952 // Height: Page height. For PDFs the unit is points. For images 7953 // (including TIFFs) the unit is pixels. 7954 Height int64 `json:"height,omitempty"` 7955 7956 // Property: Additional information detected on the page. 7957 Property *GoogleCloudVisionV1p3beta1TextAnnotationTextProperty `json:"property,omitempty"` 7958 7959 // Width: Page width. For PDFs the unit is points. For images (including 7960 // TIFFs) the unit is pixels. 7961 Width int64 `json:"width,omitempty"` 7962 7963 // ForceSendFields is a list of field names (e.g. "Blocks") to 7964 // unconditionally include in API requests. By default, fields with 7965 // empty values are omitted from API requests. However, any non-pointer, 7966 // non-interface field appearing in ForceSendFields will be sent to the 7967 // server regardless of whether the field is empty or not. This may be 7968 // used to include empty fields in Patch requests. 7969 ForceSendFields []string `json:"-"` 7970 7971 // NullFields is a list of field names (e.g. "Blocks") to include in API 7972 // requests with the JSON null value. By default, fields with empty 7973 // values are omitted from API requests. However, any field with an 7974 // empty value appearing in NullFields will be sent to the server as 7975 // null. It is an error if a field in this list has a non-empty value. 7976 // This may be used to include null fields in Patch requests. 7977 NullFields []string `json:"-"` 7978} 7979 7980func (s *GoogleCloudVisionV1p3beta1Page) MarshalJSON() ([]byte, error) { 7981 type NoMethod GoogleCloudVisionV1p3beta1Page 7982 raw := NoMethod(*s) 7983 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7984} 7985 7986func (s *GoogleCloudVisionV1p3beta1Page) UnmarshalJSON(data []byte) error { 7987 type NoMethod GoogleCloudVisionV1p3beta1Page 7988 var s1 struct { 7989 Confidence gensupport.JSONFloat64 `json:"confidence"` 7990 *NoMethod 7991 } 7992 s1.NoMethod = (*NoMethod)(s) 7993 if err := json.Unmarshal(data, &s1); err != nil { 7994 return err 7995 } 7996 s.Confidence = float64(s1.Confidence) 7997 return nil 7998} 7999 8000// GoogleCloudVisionV1p3beta1Paragraph: Structural unit of text 8001// representing a number of words in certain order. 8002type GoogleCloudVisionV1p3beta1Paragraph struct { 8003 // BoundingBox: The bounding box for the paragraph. The vertices are in 8004 // the order of top-left, top-right, bottom-right, bottom-left. When a 8005 // rotation of the bounding box is detected the rotation is represented 8006 // as around the top-left corner as defined when the text is read in the 8007 // 'natural' orientation. For example: * when the text is horizontal it 8008 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 8009 // around the top-left corner it becomes: 2----3 | | 1----0 and the 8010 // vertex order will still be (0, 1, 2, 3). 8011 BoundingBox *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingBox,omitempty"` 8012 8013 // Confidence: Confidence of the OCR results for the paragraph. Range 8014 // [0, 1]. 8015 Confidence float64 `json:"confidence,omitempty"` 8016 8017 // Property: Additional information detected for the paragraph. 8018 Property *GoogleCloudVisionV1p3beta1TextAnnotationTextProperty `json:"property,omitempty"` 8019 8020 // Words: List of all words in this paragraph. 8021 Words []*GoogleCloudVisionV1p3beta1Word `json:"words,omitempty"` 8022 8023 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 8024 // unconditionally include in API requests. By default, fields with 8025 // empty values are omitted from API requests. However, any non-pointer, 8026 // non-interface field appearing in ForceSendFields will be sent to the 8027 // server regardless of whether the field is empty or not. This may be 8028 // used to include empty fields in Patch requests. 8029 ForceSendFields []string `json:"-"` 8030 8031 // NullFields is a list of field names (e.g. "BoundingBox") to include 8032 // in API requests with the JSON null value. By default, fields with 8033 // empty values are omitted from API requests. However, any field with 8034 // an empty value appearing in NullFields will be sent to the server as 8035 // null. It is an error if a field in this list has a non-empty value. 8036 // This may be used to include null fields in Patch requests. 8037 NullFields []string `json:"-"` 8038} 8039 8040func (s *GoogleCloudVisionV1p3beta1Paragraph) MarshalJSON() ([]byte, error) { 8041 type NoMethod GoogleCloudVisionV1p3beta1Paragraph 8042 raw := NoMethod(*s) 8043 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8044} 8045 8046func (s *GoogleCloudVisionV1p3beta1Paragraph) UnmarshalJSON(data []byte) error { 8047 type NoMethod GoogleCloudVisionV1p3beta1Paragraph 8048 var s1 struct { 8049 Confidence gensupport.JSONFloat64 `json:"confidence"` 8050 *NoMethod 8051 } 8052 s1.NoMethod = (*NoMethod)(s) 8053 if err := json.Unmarshal(data, &s1); err != nil { 8054 return err 8055 } 8056 s.Confidence = float64(s1.Confidence) 8057 return nil 8058} 8059 8060// GoogleCloudVisionV1p3beta1Position: A 3D position in the image, used 8061// primarily for Face detection landmarks. A valid Position must have 8062// both x and y coordinates. The position coordinates are in the same 8063// scale as the original image. 8064type GoogleCloudVisionV1p3beta1Position struct { 8065 // X: X coordinate. 8066 X float64 `json:"x,omitempty"` 8067 8068 // Y: Y coordinate. 8069 Y float64 `json:"y,omitempty"` 8070 8071 // Z: Z coordinate (or depth). 8072 Z float64 `json:"z,omitempty"` 8073 8074 // ForceSendFields is a list of field names (e.g. "X") to 8075 // unconditionally include in API requests. By default, fields with 8076 // empty values are omitted from API requests. However, any non-pointer, 8077 // non-interface field appearing in ForceSendFields will be sent to the 8078 // server regardless of whether the field is empty or not. This may be 8079 // used to include empty fields in Patch requests. 8080 ForceSendFields []string `json:"-"` 8081 8082 // NullFields is a list of field names (e.g. "X") to include in API 8083 // requests with the JSON null value. By default, fields with empty 8084 // values are omitted from API requests. However, any field with an 8085 // empty value appearing in NullFields will be sent to the server as 8086 // null. It is an error if a field in this list has a non-empty value. 8087 // This may be used to include null fields in Patch requests. 8088 NullFields []string `json:"-"` 8089} 8090 8091func (s *GoogleCloudVisionV1p3beta1Position) MarshalJSON() ([]byte, error) { 8092 type NoMethod GoogleCloudVisionV1p3beta1Position 8093 raw := NoMethod(*s) 8094 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8095} 8096 8097func (s *GoogleCloudVisionV1p3beta1Position) UnmarshalJSON(data []byte) error { 8098 type NoMethod GoogleCloudVisionV1p3beta1Position 8099 var s1 struct { 8100 X gensupport.JSONFloat64 `json:"x"` 8101 Y gensupport.JSONFloat64 `json:"y"` 8102 Z gensupport.JSONFloat64 `json:"z"` 8103 *NoMethod 8104 } 8105 s1.NoMethod = (*NoMethod)(s) 8106 if err := json.Unmarshal(data, &s1); err != nil { 8107 return err 8108 } 8109 s.X = float64(s1.X) 8110 s.Y = float64(s1.Y) 8111 s.Z = float64(s1.Z) 8112 return nil 8113} 8114 8115// GoogleCloudVisionV1p3beta1Product: A Product contains 8116// ReferenceImages. 8117type GoogleCloudVisionV1p3beta1Product struct { 8118 // Description: User-provided metadata to be stored with this product. 8119 // Must be at most 4096 characters long. 8120 Description string `json:"description,omitempty"` 8121 8122 // DisplayName: The user-provided name for this Product. Must not be 8123 // empty. Must be at most 4096 characters long. 8124 DisplayName string `json:"displayName,omitempty"` 8125 8126 // Name: The resource name of the product. Format is: 8127 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This 8128 // field is ignored when creating a product. 8129 Name string `json:"name,omitempty"` 8130 8131 // ProductCategory: Immutable. The category for the product identified 8132 // by the reference image. This should be one of "homegoods-v2", 8133 // "apparel-v2", "toys-v2", "packagedgoods-v1" or "general-v1". The 8134 // legacy categories "homegoods", "apparel", and "toys" are still 8135 // supported, but these should not be used for new products. 8136 ProductCategory string `json:"productCategory,omitempty"` 8137 8138 // ProductLabels: Key-value pairs that can be attached to a product. At 8139 // query time, constraints can be specified based on the product_labels. 8140 // Note that integer values can be provided as strings, e.g. "1199". 8141 // Only strings with integer values can match a range-based restriction 8142 // which is to be supported soon. Multiple values can be assigned to the 8143 // same key. One product may have up to 500 product_labels. Notice that 8144 // the total number of distinct product_labels over all products in one 8145 // ProductSet cannot exceed 1M, otherwise the product search pipeline 8146 // will refuse to work for that ProductSet. 8147 ProductLabels []*GoogleCloudVisionV1p3beta1ProductKeyValue `json:"productLabels,omitempty"` 8148 8149 // ForceSendFields is a list of field names (e.g. "Description") to 8150 // unconditionally include in API requests. By default, fields with 8151 // empty values are omitted from API requests. However, any non-pointer, 8152 // non-interface field appearing in ForceSendFields will be sent to the 8153 // server regardless of whether the field is empty or not. This may be 8154 // used to include empty fields in Patch requests. 8155 ForceSendFields []string `json:"-"` 8156 8157 // NullFields is a list of field names (e.g. "Description") to include 8158 // in API requests with the JSON null value. By default, fields with 8159 // empty values are omitted from API requests. However, any field with 8160 // an empty value appearing in NullFields will be sent to the server as 8161 // null. It is an error if a field in this list has a non-empty value. 8162 // This may be used to include null fields in Patch requests. 8163 NullFields []string `json:"-"` 8164} 8165 8166func (s *GoogleCloudVisionV1p3beta1Product) MarshalJSON() ([]byte, error) { 8167 type NoMethod GoogleCloudVisionV1p3beta1Product 8168 raw := NoMethod(*s) 8169 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8170} 8171 8172// GoogleCloudVisionV1p3beta1ProductKeyValue: A product label 8173// represented as a key-value pair. 8174type GoogleCloudVisionV1p3beta1ProductKeyValue struct { 8175 // Key: The key of the label attached to the product. Cannot be empty 8176 // and cannot exceed 128 bytes. 8177 Key string `json:"key,omitempty"` 8178 8179 // Value: The value of the label attached to the product. Cannot be 8180 // empty and cannot exceed 128 bytes. 8181 Value string `json:"value,omitempty"` 8182 8183 // ForceSendFields is a list of field names (e.g. "Key") 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. "Key") 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 *GoogleCloudVisionV1p3beta1ProductKeyValue) MarshalJSON() ([]byte, error) { 8201 type NoMethod GoogleCloudVisionV1p3beta1ProductKeyValue 8202 raw := NoMethod(*s) 8203 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8204} 8205 8206// GoogleCloudVisionV1p3beta1ProductSearchResults: Results for a product 8207// search request. 8208type GoogleCloudVisionV1p3beta1ProductSearchResults struct { 8209 // IndexTime: Timestamp of the index which provided these results. 8210 // Products added to the product set and products removed from the 8211 // product set after this time are not reflected in the current results. 8212 IndexTime string `json:"indexTime,omitempty"` 8213 8214 // ProductGroupedResults: List of results grouped by products detected 8215 // in the query image. Each entry corresponds to one bounding polygon in 8216 // the query image, and contains the matching products specific to that 8217 // region. There may be duplicate product matches in the union of all 8218 // the per-product results. 8219 ProductGroupedResults []*GoogleCloudVisionV1p3beta1ProductSearchResultsGroupedResult `json:"productGroupedResults,omitempty"` 8220 8221 // Results: List of results, one for each product match. 8222 Results []*GoogleCloudVisionV1p3beta1ProductSearchResultsResult `json:"results,omitempty"` 8223 8224 // ForceSendFields is a list of field names (e.g. "IndexTime") to 8225 // unconditionally include in API requests. By default, fields with 8226 // empty values are omitted from API requests. However, any non-pointer, 8227 // non-interface field appearing in ForceSendFields will be sent to the 8228 // server regardless of whether the field is empty or not. This may be 8229 // used to include empty fields in Patch requests. 8230 ForceSendFields []string `json:"-"` 8231 8232 // NullFields is a list of field names (e.g. "IndexTime") to include in 8233 // API requests with the JSON null value. By default, fields with empty 8234 // values are omitted from API requests. However, any field with an 8235 // empty value appearing in NullFields will be sent to the server as 8236 // null. It is an error if a field in this list has a non-empty value. 8237 // This may be used to include null fields in Patch requests. 8238 NullFields []string `json:"-"` 8239} 8240 8241func (s *GoogleCloudVisionV1p3beta1ProductSearchResults) MarshalJSON() ([]byte, error) { 8242 type NoMethod GoogleCloudVisionV1p3beta1ProductSearchResults 8243 raw := NoMethod(*s) 8244 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8245} 8246 8247// GoogleCloudVisionV1p3beta1ProductSearchResultsGroupedResult: 8248// Information about the products similar to a single product in a query 8249// image. 8250type GoogleCloudVisionV1p3beta1ProductSearchResultsGroupedResult struct { 8251 // BoundingPoly: The bounding polygon around the product detected in the 8252 // query image. 8253 BoundingPoly *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPoly,omitempty"` 8254 8255 // ObjectAnnotations: List of generic predictions for the object in the 8256 // bounding box. 8257 ObjectAnnotations []*GoogleCloudVisionV1p3beta1ProductSearchResultsObjectAnnotation `json:"objectAnnotations,omitempty"` 8258 8259 // Results: List of results, one for each product match. 8260 Results []*GoogleCloudVisionV1p3beta1ProductSearchResultsResult `json:"results,omitempty"` 8261 8262 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 8263 // unconditionally include in API requests. By default, fields with 8264 // empty values are omitted from API requests. However, any non-pointer, 8265 // non-interface field appearing in ForceSendFields will be sent to the 8266 // server regardless of whether the field is empty or not. This may be 8267 // used to include empty fields in Patch requests. 8268 ForceSendFields []string `json:"-"` 8269 8270 // NullFields is a list of field names (e.g. "BoundingPoly") to include 8271 // in API requests with the JSON null value. By default, fields with 8272 // empty values are omitted from API requests. However, any field with 8273 // an empty value appearing in NullFields will be sent to the server as 8274 // null. It is an error if a field in this list has a non-empty value. 8275 // This may be used to include null fields in Patch requests. 8276 NullFields []string `json:"-"` 8277} 8278 8279func (s *GoogleCloudVisionV1p3beta1ProductSearchResultsGroupedResult) MarshalJSON() ([]byte, error) { 8280 type NoMethod GoogleCloudVisionV1p3beta1ProductSearchResultsGroupedResult 8281 raw := NoMethod(*s) 8282 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8283} 8284 8285// GoogleCloudVisionV1p3beta1ProductSearchResultsObjectAnnotation: 8286// Prediction for what the object in the bounding box is. 8287type GoogleCloudVisionV1p3beta1ProductSearchResultsObjectAnnotation struct { 8288 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". 8289 // For more information, see 8290 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 8291 LanguageCode string `json:"languageCode,omitempty"` 8292 8293 // Mid: Object ID that should align with EntityAnnotation mid. 8294 Mid string `json:"mid,omitempty"` 8295 8296 // Name: Object name, expressed in its `language_code` language. 8297 Name string `json:"name,omitempty"` 8298 8299 // Score: Score of the result. Range [0, 1]. 8300 Score float64 `json:"score,omitempty"` 8301 8302 // ForceSendFields is a list of field names (e.g. "LanguageCode") to 8303 // unconditionally include in API requests. By default, fields with 8304 // empty values are omitted from API requests. However, any non-pointer, 8305 // non-interface field appearing in ForceSendFields will be sent to the 8306 // server regardless of whether the field is empty or not. This may be 8307 // used to include empty fields in Patch requests. 8308 ForceSendFields []string `json:"-"` 8309 8310 // NullFields is a list of field names (e.g. "LanguageCode") to include 8311 // in API requests with the JSON null value. By default, fields with 8312 // empty values are omitted from API requests. However, any field with 8313 // an empty value appearing in NullFields will be sent to the server as 8314 // null. It is an error if a field in this list has a non-empty value. 8315 // This may be used to include null fields in Patch requests. 8316 NullFields []string `json:"-"` 8317} 8318 8319func (s *GoogleCloudVisionV1p3beta1ProductSearchResultsObjectAnnotation) MarshalJSON() ([]byte, error) { 8320 type NoMethod GoogleCloudVisionV1p3beta1ProductSearchResultsObjectAnnotation 8321 raw := NoMethod(*s) 8322 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8323} 8324 8325func (s *GoogleCloudVisionV1p3beta1ProductSearchResultsObjectAnnotation) UnmarshalJSON(data []byte) error { 8326 type NoMethod GoogleCloudVisionV1p3beta1ProductSearchResultsObjectAnnotation 8327 var s1 struct { 8328 Score gensupport.JSONFloat64 `json:"score"` 8329 *NoMethod 8330 } 8331 s1.NoMethod = (*NoMethod)(s) 8332 if err := json.Unmarshal(data, &s1); err != nil { 8333 return err 8334 } 8335 s.Score = float64(s1.Score) 8336 return nil 8337} 8338 8339// GoogleCloudVisionV1p3beta1ProductSearchResultsResult: Information 8340// about a product. 8341type GoogleCloudVisionV1p3beta1ProductSearchResultsResult struct { 8342 // Image: The resource name of the image from the product that is the 8343 // closest match to the query. 8344 Image string `json:"image,omitempty"` 8345 8346 // Product: The Product. 8347 Product *GoogleCloudVisionV1p3beta1Product `json:"product,omitempty"` 8348 8349 // Score: A confidence level on the match, ranging from 0 (no 8350 // confidence) to 1 (full confidence). 8351 Score float64 `json:"score,omitempty"` 8352 8353 // ForceSendFields is a list of field names (e.g. "Image") to 8354 // unconditionally include in API requests. By default, fields with 8355 // empty values are omitted from API requests. However, any non-pointer, 8356 // non-interface field appearing in ForceSendFields will be sent to the 8357 // server regardless of whether the field is empty or not. This may be 8358 // used to include empty fields in Patch requests. 8359 ForceSendFields []string `json:"-"` 8360 8361 // NullFields is a list of field names (e.g. "Image") to include in API 8362 // requests with the JSON null value. By default, fields with empty 8363 // values are omitted from API requests. However, any field with an 8364 // empty value appearing in NullFields will be sent to the server as 8365 // null. It is an error if a field in this list has a non-empty value. 8366 // This may be used to include null fields in Patch requests. 8367 NullFields []string `json:"-"` 8368} 8369 8370func (s *GoogleCloudVisionV1p3beta1ProductSearchResultsResult) MarshalJSON() ([]byte, error) { 8371 type NoMethod GoogleCloudVisionV1p3beta1ProductSearchResultsResult 8372 raw := NoMethod(*s) 8373 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8374} 8375 8376func (s *GoogleCloudVisionV1p3beta1ProductSearchResultsResult) UnmarshalJSON(data []byte) error { 8377 type NoMethod GoogleCloudVisionV1p3beta1ProductSearchResultsResult 8378 var s1 struct { 8379 Score gensupport.JSONFloat64 `json:"score"` 8380 *NoMethod 8381 } 8382 s1.NoMethod = (*NoMethod)(s) 8383 if err := json.Unmarshal(data, &s1); err != nil { 8384 return err 8385 } 8386 s.Score = float64(s1.Score) 8387 return nil 8388} 8389 8390// GoogleCloudVisionV1p3beta1Property: A `Property` consists of a 8391// user-supplied name/value pair. 8392type GoogleCloudVisionV1p3beta1Property struct { 8393 // Name: Name of the property. 8394 Name string `json:"name,omitempty"` 8395 8396 // Uint64Value: Value of numeric properties. 8397 Uint64Value uint64 `json:"uint64Value,omitempty,string"` 8398 8399 // Value: Value of the property. 8400 Value string `json:"value,omitempty"` 8401 8402 // ForceSendFields is a list of field names (e.g. "Name") to 8403 // unconditionally include in API requests. By default, fields with 8404 // empty values are omitted from API requests. However, any non-pointer, 8405 // non-interface field appearing in ForceSendFields will be sent to the 8406 // server regardless of whether the field is empty or not. This may be 8407 // used to include empty fields in Patch requests. 8408 ForceSendFields []string `json:"-"` 8409 8410 // NullFields is a list of field names (e.g. "Name") to include in API 8411 // requests with the JSON null value. By default, fields with empty 8412 // values are omitted from API requests. However, any field with an 8413 // empty value appearing in NullFields will be sent to the server as 8414 // null. It is an error if a field in this list has a non-empty value. 8415 // This may be used to include null fields in Patch requests. 8416 NullFields []string `json:"-"` 8417} 8418 8419func (s *GoogleCloudVisionV1p3beta1Property) MarshalJSON() ([]byte, error) { 8420 type NoMethod GoogleCloudVisionV1p3beta1Property 8421 raw := NoMethod(*s) 8422 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8423} 8424 8425// GoogleCloudVisionV1p3beta1ReferenceImage: A `ReferenceImage` 8426// represents a product image and its associated metadata, such as 8427// bounding boxes. 8428type GoogleCloudVisionV1p3beta1ReferenceImage struct { 8429 // BoundingPolys: Optional. Bounding polygons around the areas of 8430 // interest in the reference image. If this field is empty, the system 8431 // will try to detect regions of interest. At most 10 bounding polygons 8432 // will be used. The provided shape is converted into a non-rotated 8433 // rectangle. Once converted, the small edge of the rectangle must be 8434 // greater than or equal to 300 pixels. The aspect ratio must be 1:4 or 8435 // less (i.e. 1:3 is ok; 1:5 is not). 8436 BoundingPolys []*GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPolys,omitempty"` 8437 8438 // Name: The resource name of the reference image. Format is: 8439 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceIma 8440 // ges/IMAGE_ID`. This field is ignored when creating a reference image. 8441 Name string `json:"name,omitempty"` 8442 8443 // Uri: Required. The Google Cloud Storage URI of the reference image. 8444 // The URI must start with `gs://`. 8445 Uri string `json:"uri,omitempty"` 8446 8447 // ForceSendFields is a list of field names (e.g. "BoundingPolys") to 8448 // unconditionally include in API requests. By default, fields with 8449 // empty values are omitted from API requests. However, any non-pointer, 8450 // non-interface field appearing in ForceSendFields will be sent to the 8451 // server regardless of whether the field is empty or not. This may be 8452 // used to include empty fields in Patch requests. 8453 ForceSendFields []string `json:"-"` 8454 8455 // NullFields is a list of field names (e.g. "BoundingPolys") to include 8456 // in API requests with the JSON null value. By default, fields with 8457 // empty values are omitted from API requests. However, any field with 8458 // an empty value appearing in NullFields will be sent to the server as 8459 // null. It is an error if a field in this list has a non-empty value. 8460 // This may be used to include null fields in Patch requests. 8461 NullFields []string `json:"-"` 8462} 8463 8464func (s *GoogleCloudVisionV1p3beta1ReferenceImage) MarshalJSON() ([]byte, error) { 8465 type NoMethod GoogleCloudVisionV1p3beta1ReferenceImage 8466 raw := NoMethod(*s) 8467 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8468} 8469 8470// GoogleCloudVisionV1p3beta1SafeSearchAnnotation: Set of features 8471// pertaining to the image, computed by computer vision methods over 8472// safe-search verticals (for example, adult, spoof, medical, violence). 8473type GoogleCloudVisionV1p3beta1SafeSearchAnnotation struct { 8474 // Adult: Represents the adult content likelihood for the image. Adult 8475 // content may contain elements such as nudity, pornographic images or 8476 // cartoons, or sexual activities. 8477 // 8478 // Possible values: 8479 // "UNKNOWN" - Unknown likelihood. 8480 // "VERY_UNLIKELY" - It is very unlikely. 8481 // "UNLIKELY" - It is unlikely. 8482 // "POSSIBLE" - It is possible. 8483 // "LIKELY" - It is likely. 8484 // "VERY_LIKELY" - It is very likely. 8485 Adult string `json:"adult,omitempty"` 8486 8487 // Medical: Likelihood that this is a medical image. 8488 // 8489 // Possible values: 8490 // "UNKNOWN" - Unknown likelihood. 8491 // "VERY_UNLIKELY" - It is very unlikely. 8492 // "UNLIKELY" - It is unlikely. 8493 // "POSSIBLE" - It is possible. 8494 // "LIKELY" - It is likely. 8495 // "VERY_LIKELY" - It is very likely. 8496 Medical string `json:"medical,omitempty"` 8497 8498 // Racy: Likelihood that the request image contains racy content. Racy 8499 // content may include (but is not limited to) skimpy or sheer clothing, 8500 // strategically covered nudity, lewd or provocative poses, or close-ups 8501 // of sensitive body areas. 8502 // 8503 // Possible values: 8504 // "UNKNOWN" - Unknown likelihood. 8505 // "VERY_UNLIKELY" - It is very unlikely. 8506 // "UNLIKELY" - It is unlikely. 8507 // "POSSIBLE" - It is possible. 8508 // "LIKELY" - It is likely. 8509 // "VERY_LIKELY" - It is very likely. 8510 Racy string `json:"racy,omitempty"` 8511 8512 // Spoof: Spoof likelihood. The likelihood that an modification was made 8513 // to the image's canonical version to make it appear funny or 8514 // offensive. 8515 // 8516 // Possible values: 8517 // "UNKNOWN" - Unknown likelihood. 8518 // "VERY_UNLIKELY" - It is very unlikely. 8519 // "UNLIKELY" - It is unlikely. 8520 // "POSSIBLE" - It is possible. 8521 // "LIKELY" - It is likely. 8522 // "VERY_LIKELY" - It is very likely. 8523 Spoof string `json:"spoof,omitempty"` 8524 8525 // Violence: Likelihood that this image contains violent content. 8526 // 8527 // Possible values: 8528 // "UNKNOWN" - Unknown likelihood. 8529 // "VERY_UNLIKELY" - It is very unlikely. 8530 // "UNLIKELY" - It is unlikely. 8531 // "POSSIBLE" - It is possible. 8532 // "LIKELY" - It is likely. 8533 // "VERY_LIKELY" - It is very likely. 8534 Violence string `json:"violence,omitempty"` 8535 8536 // ForceSendFields is a list of field names (e.g. "Adult") to 8537 // unconditionally include in API requests. By default, fields with 8538 // empty values are omitted from API requests. However, any non-pointer, 8539 // non-interface field appearing in ForceSendFields will be sent to the 8540 // server regardless of whether the field is empty or not. This may be 8541 // used to include empty fields in Patch requests. 8542 ForceSendFields []string `json:"-"` 8543 8544 // NullFields is a list of field names (e.g. "Adult") to include in API 8545 // requests with the JSON null value. By default, fields with empty 8546 // values are omitted from API requests. However, any field with an 8547 // empty value appearing in NullFields will be sent to the server as 8548 // null. It is an error if a field in this list has a non-empty value. 8549 // This may be used to include null fields in Patch requests. 8550 NullFields []string `json:"-"` 8551} 8552 8553func (s *GoogleCloudVisionV1p3beta1SafeSearchAnnotation) MarshalJSON() ([]byte, error) { 8554 type NoMethod GoogleCloudVisionV1p3beta1SafeSearchAnnotation 8555 raw := NoMethod(*s) 8556 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8557} 8558 8559// GoogleCloudVisionV1p3beta1Symbol: A single symbol representation. 8560type GoogleCloudVisionV1p3beta1Symbol struct { 8561 // BoundingBox: The bounding box for the symbol. The vertices are in the 8562 // order of top-left, top-right, bottom-right, bottom-left. When a 8563 // rotation of the bounding box is detected the rotation is represented 8564 // as around the top-left corner as defined when the text is read in the 8565 // 'natural' orientation. For example: * when the text is horizontal it 8566 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 8567 // around the top-left corner it becomes: 2----3 | | 1----0 and the 8568 // vertex order will still be (0, 1, 2, 3). 8569 BoundingBox *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingBox,omitempty"` 8570 8571 // Confidence: Confidence of the OCR results for the symbol. Range [0, 8572 // 1]. 8573 Confidence float64 `json:"confidence,omitempty"` 8574 8575 // Property: Additional information detected for the symbol. 8576 Property *GoogleCloudVisionV1p3beta1TextAnnotationTextProperty `json:"property,omitempty"` 8577 8578 // Text: The actual UTF-8 representation of the symbol. 8579 Text string `json:"text,omitempty"` 8580 8581 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 8582 // unconditionally include in API requests. By default, fields with 8583 // empty values are omitted from API requests. However, any non-pointer, 8584 // non-interface field appearing in ForceSendFields will be sent to the 8585 // server regardless of whether the field is empty or not. This may be 8586 // used to include empty fields in Patch requests. 8587 ForceSendFields []string `json:"-"` 8588 8589 // NullFields is a list of field names (e.g. "BoundingBox") to include 8590 // in API requests with the JSON null value. By default, fields with 8591 // empty values are omitted from API requests. However, any field with 8592 // an empty value appearing in NullFields will be sent to the server as 8593 // null. It is an error if a field in this list has a non-empty value. 8594 // This may be used to include null fields in Patch requests. 8595 NullFields []string `json:"-"` 8596} 8597 8598func (s *GoogleCloudVisionV1p3beta1Symbol) MarshalJSON() ([]byte, error) { 8599 type NoMethod GoogleCloudVisionV1p3beta1Symbol 8600 raw := NoMethod(*s) 8601 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8602} 8603 8604func (s *GoogleCloudVisionV1p3beta1Symbol) UnmarshalJSON(data []byte) error { 8605 type NoMethod GoogleCloudVisionV1p3beta1Symbol 8606 var s1 struct { 8607 Confidence gensupport.JSONFloat64 `json:"confidence"` 8608 *NoMethod 8609 } 8610 s1.NoMethod = (*NoMethod)(s) 8611 if err := json.Unmarshal(data, &s1); err != nil { 8612 return err 8613 } 8614 s.Confidence = float64(s1.Confidence) 8615 return nil 8616} 8617 8618// GoogleCloudVisionV1p3beta1TextAnnotation: TextAnnotation contains a 8619// structured representation of OCR extracted text. The hierarchy of an 8620// OCR extracted text structure is like this: TextAnnotation -> Page -> 8621// Block -> Paragraph -> Word -> Symbol Each structural component, 8622// starting from Page, may further have their own properties. Properties 8623// describe detected languages, breaks etc.. Please refer to the 8624// TextAnnotation.TextProperty message definition below for more detail. 8625type GoogleCloudVisionV1p3beta1TextAnnotation struct { 8626 // Pages: List of pages detected by OCR. 8627 Pages []*GoogleCloudVisionV1p3beta1Page `json:"pages,omitempty"` 8628 8629 // Text: UTF-8 text detected on the pages. 8630 Text string `json:"text,omitempty"` 8631 8632 // ForceSendFields is a list of field names (e.g. "Pages") to 8633 // unconditionally include in API requests. By default, fields with 8634 // empty values are omitted from API requests. However, any non-pointer, 8635 // non-interface field appearing in ForceSendFields will be sent to the 8636 // server regardless of whether the field is empty or not. This may be 8637 // used to include empty fields in Patch requests. 8638 ForceSendFields []string `json:"-"` 8639 8640 // NullFields is a list of field names (e.g. "Pages") to include in API 8641 // requests with the JSON null value. By default, fields with empty 8642 // values are omitted from API requests. However, any field with an 8643 // empty value appearing in NullFields will be sent to the server as 8644 // null. It is an error if a field in this list has a non-empty value. 8645 // This may be used to include null fields in Patch requests. 8646 NullFields []string `json:"-"` 8647} 8648 8649func (s *GoogleCloudVisionV1p3beta1TextAnnotation) MarshalJSON() ([]byte, error) { 8650 type NoMethod GoogleCloudVisionV1p3beta1TextAnnotation 8651 raw := NoMethod(*s) 8652 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8653} 8654 8655// GoogleCloudVisionV1p3beta1TextAnnotationDetectedBreak: Detected start 8656// or end of a structural component. 8657type GoogleCloudVisionV1p3beta1TextAnnotationDetectedBreak struct { 8658 // IsPrefix: True if break prepends the element. 8659 IsPrefix bool `json:"isPrefix,omitempty"` 8660 8661 // Type: Detected break type. 8662 // 8663 // Possible values: 8664 // "UNKNOWN" - Unknown break label type. 8665 // "SPACE" - Regular space. 8666 // "SURE_SPACE" - Sure space (very wide). 8667 // "EOL_SURE_SPACE" - Line-wrapping break. 8668 // "HYPHEN" - End-line hyphen that is not present in text; does not 8669 // co-occur with `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. 8670 // "LINE_BREAK" - Line break that ends a paragraph. 8671 Type string `json:"type,omitempty"` 8672 8673 // ForceSendFields is a list of field names (e.g. "IsPrefix") to 8674 // unconditionally include in API requests. By default, fields with 8675 // empty values are omitted from API requests. However, any non-pointer, 8676 // non-interface field appearing in ForceSendFields will be sent to the 8677 // server regardless of whether the field is empty or not. This may be 8678 // used to include empty fields in Patch requests. 8679 ForceSendFields []string `json:"-"` 8680 8681 // NullFields is a list of field names (e.g. "IsPrefix") to include in 8682 // API requests with the JSON null value. By default, fields with empty 8683 // values are omitted from API requests. However, any field with an 8684 // empty value appearing in NullFields will be sent to the server as 8685 // null. It is an error if a field in this list has a non-empty value. 8686 // This may be used to include null fields in Patch requests. 8687 NullFields []string `json:"-"` 8688} 8689 8690func (s *GoogleCloudVisionV1p3beta1TextAnnotationDetectedBreak) MarshalJSON() ([]byte, error) { 8691 type NoMethod GoogleCloudVisionV1p3beta1TextAnnotationDetectedBreak 8692 raw := NoMethod(*s) 8693 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8694} 8695 8696// GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage: Detected 8697// language for a structural component. 8698type GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage struct { 8699 // Confidence: Confidence of detected language. Range [0, 1]. 8700 Confidence float64 `json:"confidence,omitempty"` 8701 8702 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". 8703 // For more information, see 8704 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 8705 LanguageCode string `json:"languageCode,omitempty"` 8706 8707 // ForceSendFields is a list of field names (e.g. "Confidence") to 8708 // unconditionally include in API requests. By default, fields with 8709 // empty values are omitted from API requests. However, any non-pointer, 8710 // non-interface field appearing in ForceSendFields will be sent to the 8711 // server regardless of whether the field is empty or not. This may be 8712 // used to include empty fields in Patch requests. 8713 ForceSendFields []string `json:"-"` 8714 8715 // NullFields is a list of field names (e.g. "Confidence") to include in 8716 // API requests with the JSON null value. By default, fields with empty 8717 // values are omitted from API requests. However, any field with an 8718 // empty value appearing in NullFields will be sent to the server as 8719 // null. It is an error if a field in this list has a non-empty value. 8720 // This may be used to include null fields in Patch requests. 8721 NullFields []string `json:"-"` 8722} 8723 8724func (s *GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage) MarshalJSON() ([]byte, error) { 8725 type NoMethod GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage 8726 raw := NoMethod(*s) 8727 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8728} 8729 8730func (s *GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage) UnmarshalJSON(data []byte) error { 8731 type NoMethod GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage 8732 var s1 struct { 8733 Confidence gensupport.JSONFloat64 `json:"confidence"` 8734 *NoMethod 8735 } 8736 s1.NoMethod = (*NoMethod)(s) 8737 if err := json.Unmarshal(data, &s1); err != nil { 8738 return err 8739 } 8740 s.Confidence = float64(s1.Confidence) 8741 return nil 8742} 8743 8744// GoogleCloudVisionV1p3beta1TextAnnotationTextProperty: Additional 8745// information detected on the structural component. 8746type GoogleCloudVisionV1p3beta1TextAnnotationTextProperty struct { 8747 // DetectedBreak: Detected start or end of a text segment. 8748 DetectedBreak *GoogleCloudVisionV1p3beta1TextAnnotationDetectedBreak `json:"detectedBreak,omitempty"` 8749 8750 // DetectedLanguages: A list of detected languages together with 8751 // confidence. 8752 DetectedLanguages []*GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage `json:"detectedLanguages,omitempty"` 8753 8754 // ForceSendFields is a list of field names (e.g. "DetectedBreak") to 8755 // unconditionally include in API requests. By default, fields with 8756 // empty values are omitted from API requests. However, any non-pointer, 8757 // non-interface field appearing in ForceSendFields will be sent to the 8758 // server regardless of whether the field is empty or not. This may be 8759 // used to include empty fields in Patch requests. 8760 ForceSendFields []string `json:"-"` 8761 8762 // NullFields is a list of field names (e.g. "DetectedBreak") to include 8763 // in API requests with the JSON null value. By default, fields with 8764 // empty values are omitted from API requests. However, any field with 8765 // an empty value appearing in NullFields will be sent to the server as 8766 // null. It is an error if a field in this list has a non-empty value. 8767 // This may be used to include null fields in Patch requests. 8768 NullFields []string `json:"-"` 8769} 8770 8771func (s *GoogleCloudVisionV1p3beta1TextAnnotationTextProperty) MarshalJSON() ([]byte, error) { 8772 type NoMethod GoogleCloudVisionV1p3beta1TextAnnotationTextProperty 8773 raw := NoMethod(*s) 8774 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8775} 8776 8777// GoogleCloudVisionV1p3beta1Vertex: A vertex represents a 2D point in 8778// the image. NOTE: the vertex coordinates are in the same scale as the 8779// original image. 8780type GoogleCloudVisionV1p3beta1Vertex struct { 8781 // X: X coordinate. 8782 X int64 `json:"x,omitempty"` 8783 8784 // Y: Y coordinate. 8785 Y int64 `json:"y,omitempty"` 8786 8787 // ForceSendFields is a list of field names (e.g. "X") to 8788 // unconditionally include in API requests. By default, fields with 8789 // empty values are omitted from API requests. However, any non-pointer, 8790 // non-interface field appearing in ForceSendFields will be sent to the 8791 // server regardless of whether the field is empty or not. This may be 8792 // used to include empty fields in Patch requests. 8793 ForceSendFields []string `json:"-"` 8794 8795 // NullFields is a list of field names (e.g. "X") to include in API 8796 // requests with the JSON null value. By default, fields with empty 8797 // values are omitted from API requests. However, any field with an 8798 // empty value appearing in NullFields will be sent to the server as 8799 // null. It is an error if a field in this list has a non-empty value. 8800 // This may be used to include null fields in Patch requests. 8801 NullFields []string `json:"-"` 8802} 8803 8804func (s *GoogleCloudVisionV1p3beta1Vertex) MarshalJSON() ([]byte, error) { 8805 type NoMethod GoogleCloudVisionV1p3beta1Vertex 8806 raw := NoMethod(*s) 8807 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8808} 8809 8810// GoogleCloudVisionV1p3beta1WebDetection: Relevant information for the 8811// image from the Internet. 8812type GoogleCloudVisionV1p3beta1WebDetection struct { 8813 // BestGuessLabels: The service's best guess as to the topic of the 8814 // request image. Inferred from similar images on the open web. 8815 BestGuessLabels []*GoogleCloudVisionV1p3beta1WebDetectionWebLabel `json:"bestGuessLabels,omitempty"` 8816 8817 // FullMatchingImages: Fully matching images from the Internet. Can 8818 // include resized copies of the query image. 8819 FullMatchingImages []*GoogleCloudVisionV1p3beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"` 8820 8821 // PagesWithMatchingImages: Web pages containing the matching images 8822 // from the Internet. 8823 PagesWithMatchingImages []*GoogleCloudVisionV1p3beta1WebDetectionWebPage `json:"pagesWithMatchingImages,omitempty"` 8824 8825 // PartialMatchingImages: Partial matching images from the Internet. 8826 // Those images are similar enough to share some key-point features. For 8827 // example an original image will likely have partial matching for its 8828 // crops. 8829 PartialMatchingImages []*GoogleCloudVisionV1p3beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"` 8830 8831 // VisuallySimilarImages: The visually similar image results. 8832 VisuallySimilarImages []*GoogleCloudVisionV1p3beta1WebDetectionWebImage `json:"visuallySimilarImages,omitempty"` 8833 8834 // WebEntities: Deduced entities from similar images on the Internet. 8835 WebEntities []*GoogleCloudVisionV1p3beta1WebDetectionWebEntity `json:"webEntities,omitempty"` 8836 8837 // ForceSendFields is a list of field names (e.g. "BestGuessLabels") to 8838 // unconditionally include in API requests. By default, fields with 8839 // empty values are omitted from API requests. However, any non-pointer, 8840 // non-interface field appearing in ForceSendFields will be sent to the 8841 // server regardless of whether the field is empty or not. This may be 8842 // used to include empty fields in Patch requests. 8843 ForceSendFields []string `json:"-"` 8844 8845 // NullFields is a list of field names (e.g. "BestGuessLabels") to 8846 // include in API requests with the JSON null value. By default, fields 8847 // with empty values are omitted from API requests. However, any field 8848 // with an empty value appearing in NullFields will be sent to the 8849 // server as null. It is an error if a field in this list has a 8850 // non-empty value. This may be used to include null fields in Patch 8851 // requests. 8852 NullFields []string `json:"-"` 8853} 8854 8855func (s *GoogleCloudVisionV1p3beta1WebDetection) MarshalJSON() ([]byte, error) { 8856 type NoMethod GoogleCloudVisionV1p3beta1WebDetection 8857 raw := NoMethod(*s) 8858 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8859} 8860 8861// GoogleCloudVisionV1p3beta1WebDetectionWebEntity: Entity deduced from 8862// similar images on the Internet. 8863type GoogleCloudVisionV1p3beta1WebDetectionWebEntity struct { 8864 // Description: Canonical description of the entity, in English. 8865 Description string `json:"description,omitempty"` 8866 8867 // EntityId: Opaque entity ID. 8868 EntityId string `json:"entityId,omitempty"` 8869 8870 // Score: Overall relevancy score for the entity. Not normalized and not 8871 // comparable across different image queries. 8872 Score float64 `json:"score,omitempty"` 8873 8874 // ForceSendFields is a list of field names (e.g. "Description") to 8875 // unconditionally include in API requests. By default, fields with 8876 // empty values are omitted from API requests. However, any non-pointer, 8877 // non-interface field appearing in ForceSendFields will be sent to the 8878 // server regardless of whether the field is empty or not. This may be 8879 // used to include empty fields in Patch requests. 8880 ForceSendFields []string `json:"-"` 8881 8882 // NullFields is a list of field names (e.g. "Description") to include 8883 // in API requests with the JSON null value. By default, fields with 8884 // empty values are omitted from API requests. However, any field with 8885 // an empty value appearing in NullFields will be sent to the server as 8886 // null. It is an error if a field in this list has a non-empty value. 8887 // This may be used to include null fields in Patch requests. 8888 NullFields []string `json:"-"` 8889} 8890 8891func (s *GoogleCloudVisionV1p3beta1WebDetectionWebEntity) MarshalJSON() ([]byte, error) { 8892 type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebEntity 8893 raw := NoMethod(*s) 8894 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8895} 8896 8897func (s *GoogleCloudVisionV1p3beta1WebDetectionWebEntity) UnmarshalJSON(data []byte) error { 8898 type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebEntity 8899 var s1 struct { 8900 Score gensupport.JSONFloat64 `json:"score"` 8901 *NoMethod 8902 } 8903 s1.NoMethod = (*NoMethod)(s) 8904 if err := json.Unmarshal(data, &s1); err != nil { 8905 return err 8906 } 8907 s.Score = float64(s1.Score) 8908 return nil 8909} 8910 8911// GoogleCloudVisionV1p3beta1WebDetectionWebImage: Metadata for online 8912// images. 8913type GoogleCloudVisionV1p3beta1WebDetectionWebImage struct { 8914 // Score: (Deprecated) Overall relevancy score for the image. 8915 Score float64 `json:"score,omitempty"` 8916 8917 // Url: The result image URL. 8918 Url string `json:"url,omitempty"` 8919 8920 // ForceSendFields is a list of field names (e.g. "Score") to 8921 // unconditionally include in API requests. By default, fields with 8922 // empty values are omitted from API requests. However, any non-pointer, 8923 // non-interface field appearing in ForceSendFields will be sent to the 8924 // server regardless of whether the field is empty or not. This may be 8925 // used to include empty fields in Patch requests. 8926 ForceSendFields []string `json:"-"` 8927 8928 // NullFields is a list of field names (e.g. "Score") to include in API 8929 // requests with the JSON null value. By default, fields with empty 8930 // values are omitted from API requests. However, any field with an 8931 // empty value appearing in NullFields will be sent to the server as 8932 // null. It is an error if a field in this list has a non-empty value. 8933 // This may be used to include null fields in Patch requests. 8934 NullFields []string `json:"-"` 8935} 8936 8937func (s *GoogleCloudVisionV1p3beta1WebDetectionWebImage) MarshalJSON() ([]byte, error) { 8938 type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebImage 8939 raw := NoMethod(*s) 8940 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8941} 8942 8943func (s *GoogleCloudVisionV1p3beta1WebDetectionWebImage) UnmarshalJSON(data []byte) error { 8944 type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebImage 8945 var s1 struct { 8946 Score gensupport.JSONFloat64 `json:"score"` 8947 *NoMethod 8948 } 8949 s1.NoMethod = (*NoMethod)(s) 8950 if err := json.Unmarshal(data, &s1); err != nil { 8951 return err 8952 } 8953 s.Score = float64(s1.Score) 8954 return nil 8955} 8956 8957// GoogleCloudVisionV1p3beta1WebDetectionWebLabel: Label to provide 8958// extra metadata for the web detection. 8959type GoogleCloudVisionV1p3beta1WebDetectionWebLabel struct { 8960 // Label: Label for extra metadata. 8961 Label string `json:"label,omitempty"` 8962 8963 // LanguageCode: The BCP-47 language code for `label`, such as "en-US" 8964 // or "sr-Latn". For more information, see 8965 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 8966 LanguageCode string `json:"languageCode,omitempty"` 8967 8968 // ForceSendFields is a list of field names (e.g. "Label") to 8969 // unconditionally include in API requests. By default, fields with 8970 // empty values are omitted from API requests. However, any non-pointer, 8971 // non-interface field appearing in ForceSendFields will be sent to the 8972 // server regardless of whether the field is empty or not. This may be 8973 // used to include empty fields in Patch requests. 8974 ForceSendFields []string `json:"-"` 8975 8976 // NullFields is a list of field names (e.g. "Label") to include in API 8977 // requests with the JSON null value. By default, fields with empty 8978 // values are omitted from API requests. However, any field with an 8979 // empty value appearing in NullFields will be sent to the server as 8980 // null. It is an error if a field in this list has a non-empty value. 8981 // This may be used to include null fields in Patch requests. 8982 NullFields []string `json:"-"` 8983} 8984 8985func (s *GoogleCloudVisionV1p3beta1WebDetectionWebLabel) MarshalJSON() ([]byte, error) { 8986 type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebLabel 8987 raw := NoMethod(*s) 8988 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 8989} 8990 8991// GoogleCloudVisionV1p3beta1WebDetectionWebPage: Metadata for web 8992// pages. 8993type GoogleCloudVisionV1p3beta1WebDetectionWebPage struct { 8994 // FullMatchingImages: Fully matching images on the page. Can include 8995 // resized copies of the query image. 8996 FullMatchingImages []*GoogleCloudVisionV1p3beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"` 8997 8998 // PageTitle: Title for the web page, may contain HTML markups. 8999 PageTitle string `json:"pageTitle,omitempty"` 9000 9001 // PartialMatchingImages: Partial matching images on the page. Those 9002 // images are similar enough to share some key-point features. For 9003 // example an original image will likely have partial matching for its 9004 // crops. 9005 PartialMatchingImages []*GoogleCloudVisionV1p3beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"` 9006 9007 // Score: (Deprecated) Overall relevancy score for the web page. 9008 Score float64 `json:"score,omitempty"` 9009 9010 // Url: The result web page URL. 9011 Url string `json:"url,omitempty"` 9012 9013 // ForceSendFields is a list of field names (e.g. "FullMatchingImages") 9014 // to unconditionally include in API requests. By default, fields with 9015 // empty values are omitted from API requests. However, any non-pointer, 9016 // non-interface field appearing in ForceSendFields will be sent to the 9017 // server regardless of whether the field is empty or not. This may be 9018 // used to include empty fields in Patch requests. 9019 ForceSendFields []string `json:"-"` 9020 9021 // NullFields is a list of field names (e.g. "FullMatchingImages") to 9022 // include in API requests with the JSON null value. By default, fields 9023 // with empty values are omitted from API requests. However, any field 9024 // with an empty value appearing in NullFields will be sent to the 9025 // server as null. It is an error if a field in this list has a 9026 // non-empty value. This may be used to include null fields in Patch 9027 // requests. 9028 NullFields []string `json:"-"` 9029} 9030 9031func (s *GoogleCloudVisionV1p3beta1WebDetectionWebPage) MarshalJSON() ([]byte, error) { 9032 type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebPage 9033 raw := NoMethod(*s) 9034 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9035} 9036 9037func (s *GoogleCloudVisionV1p3beta1WebDetectionWebPage) UnmarshalJSON(data []byte) error { 9038 type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebPage 9039 var s1 struct { 9040 Score gensupport.JSONFloat64 `json:"score"` 9041 *NoMethod 9042 } 9043 s1.NoMethod = (*NoMethod)(s) 9044 if err := json.Unmarshal(data, &s1); err != nil { 9045 return err 9046 } 9047 s.Score = float64(s1.Score) 9048 return nil 9049} 9050 9051// GoogleCloudVisionV1p3beta1Word: A word representation. 9052type GoogleCloudVisionV1p3beta1Word struct { 9053 // BoundingBox: The bounding box for the word. The vertices are in the 9054 // order of top-left, top-right, bottom-right, bottom-left. When a 9055 // rotation of the bounding box is detected the rotation is represented 9056 // as around the top-left corner as defined when the text is read in the 9057 // 'natural' orientation. For example: * when the text is horizontal it 9058 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 9059 // around the top-left corner it becomes: 2----3 | | 1----0 and the 9060 // vertex order will still be (0, 1, 2, 3). 9061 BoundingBox *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingBox,omitempty"` 9062 9063 // Confidence: Confidence of the OCR results for the word. Range [0, 1]. 9064 Confidence float64 `json:"confidence,omitempty"` 9065 9066 // Property: Additional information detected for the word. 9067 Property *GoogleCloudVisionV1p3beta1TextAnnotationTextProperty `json:"property,omitempty"` 9068 9069 // Symbols: List of symbols in the word. The order of the symbols 9070 // follows the natural reading order. 9071 Symbols []*GoogleCloudVisionV1p3beta1Symbol `json:"symbols,omitempty"` 9072 9073 // ForceSendFields is a list of field names (e.g. "BoundingBox") 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. "BoundingBox") 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 *GoogleCloudVisionV1p3beta1Word) MarshalJSON() ([]byte, error) { 9091 type NoMethod GoogleCloudVisionV1p3beta1Word 9092 raw := NoMethod(*s) 9093 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9094} 9095 9096func (s *GoogleCloudVisionV1p3beta1Word) UnmarshalJSON(data []byte) error { 9097 type NoMethod GoogleCloudVisionV1p3beta1Word 9098 var s1 struct { 9099 Confidence gensupport.JSONFloat64 `json:"confidence"` 9100 *NoMethod 9101 } 9102 s1.NoMethod = (*NoMethod)(s) 9103 if err := json.Unmarshal(data, &s1); err != nil { 9104 return err 9105 } 9106 s.Confidence = float64(s1.Confidence) 9107 return nil 9108} 9109 9110// GoogleCloudVisionV1p4beta1AnnotateFileResponse: Response to a single 9111// file annotation request. A file may contain one or more images, which 9112// individually have their own responses. 9113type GoogleCloudVisionV1p4beta1AnnotateFileResponse struct { 9114 // Error: If set, represents the error message for the failed request. 9115 // The `responses` field will not be set in this case. 9116 Error *Status `json:"error,omitempty"` 9117 9118 // InputConfig: Information about the file for which this response is 9119 // generated. 9120 InputConfig *GoogleCloudVisionV1p4beta1InputConfig `json:"inputConfig,omitempty"` 9121 9122 // Responses: Individual responses to images found within the file. This 9123 // field will be empty if the `error` field is set. 9124 Responses []*GoogleCloudVisionV1p4beta1AnnotateImageResponse `json:"responses,omitempty"` 9125 9126 // TotalPages: This field gives the total number of pages in the file. 9127 TotalPages int64 `json:"totalPages,omitempty"` 9128 9129 // ForceSendFields is a list of field names (e.g. "Error") to 9130 // unconditionally include in API requests. By default, fields with 9131 // empty values are omitted from API requests. However, any non-pointer, 9132 // non-interface field appearing in ForceSendFields will be sent to the 9133 // server regardless of whether the field is empty or not. This may be 9134 // used to include empty fields in Patch requests. 9135 ForceSendFields []string `json:"-"` 9136 9137 // NullFields is a list of field names (e.g. "Error") to include in API 9138 // requests with the JSON null value. By default, fields with empty 9139 // values are omitted from API requests. However, any field with an 9140 // empty value appearing in NullFields will be sent to the server as 9141 // null. It is an error if a field in this list has a non-empty value. 9142 // This may be used to include null fields in Patch requests. 9143 NullFields []string `json:"-"` 9144} 9145 9146func (s *GoogleCloudVisionV1p4beta1AnnotateFileResponse) MarshalJSON() ([]byte, error) { 9147 type NoMethod GoogleCloudVisionV1p4beta1AnnotateFileResponse 9148 raw := NoMethod(*s) 9149 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9150} 9151 9152// GoogleCloudVisionV1p4beta1AnnotateImageResponse: Response to an image 9153// annotation request. 9154type GoogleCloudVisionV1p4beta1AnnotateImageResponse struct { 9155 // Context: If present, contextual information is needed to understand 9156 // where this image comes from. 9157 Context *GoogleCloudVisionV1p4beta1ImageAnnotationContext `json:"context,omitempty"` 9158 9159 // CropHintsAnnotation: If present, crop hints have completed 9160 // successfully. 9161 CropHintsAnnotation *GoogleCloudVisionV1p4beta1CropHintsAnnotation `json:"cropHintsAnnotation,omitempty"` 9162 9163 // Error: If set, represents the error message for the operation. Note 9164 // that filled-in image annotations are guaranteed to be correct, even 9165 // when `error` is set. 9166 Error *Status `json:"error,omitempty"` 9167 9168 // FaceAnnotations: If present, face detection has completed 9169 // successfully. 9170 FaceAnnotations []*GoogleCloudVisionV1p4beta1FaceAnnotation `json:"faceAnnotations,omitempty"` 9171 9172 // FullTextAnnotation: If present, text (OCR) detection or document 9173 // (OCR) text detection has completed successfully. This annotation 9174 // provides the structural hierarchy for the OCR detected text. 9175 FullTextAnnotation *GoogleCloudVisionV1p4beta1TextAnnotation `json:"fullTextAnnotation,omitempty"` 9176 9177 // ImagePropertiesAnnotation: If present, image properties were 9178 // extracted successfully. 9179 ImagePropertiesAnnotation *GoogleCloudVisionV1p4beta1ImageProperties `json:"imagePropertiesAnnotation,omitempty"` 9180 9181 // LabelAnnotations: If present, label detection has completed 9182 // successfully. 9183 LabelAnnotations []*GoogleCloudVisionV1p4beta1EntityAnnotation `json:"labelAnnotations,omitempty"` 9184 9185 // LandmarkAnnotations: If present, landmark detection has completed 9186 // successfully. 9187 LandmarkAnnotations []*GoogleCloudVisionV1p4beta1EntityAnnotation `json:"landmarkAnnotations,omitempty"` 9188 9189 // LocalizedObjectAnnotations: If present, localized object detection 9190 // has completed successfully. This will be sorted descending by 9191 // confidence score. 9192 LocalizedObjectAnnotations []*GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation `json:"localizedObjectAnnotations,omitempty"` 9193 9194 // LogoAnnotations: If present, logo detection has completed 9195 // successfully. 9196 LogoAnnotations []*GoogleCloudVisionV1p4beta1EntityAnnotation `json:"logoAnnotations,omitempty"` 9197 9198 // ProductSearchResults: If present, product search has completed 9199 // successfully. 9200 ProductSearchResults *GoogleCloudVisionV1p4beta1ProductSearchResults `json:"productSearchResults,omitempty"` 9201 9202 // SafeSearchAnnotation: If present, safe-search annotation has 9203 // completed successfully. 9204 SafeSearchAnnotation *GoogleCloudVisionV1p4beta1SafeSearchAnnotation `json:"safeSearchAnnotation,omitempty"` 9205 9206 // TextAnnotations: If present, text (OCR) detection has completed 9207 // successfully. 9208 TextAnnotations []*GoogleCloudVisionV1p4beta1EntityAnnotation `json:"textAnnotations,omitempty"` 9209 9210 // WebDetection: If present, web detection has completed successfully. 9211 WebDetection *GoogleCloudVisionV1p4beta1WebDetection `json:"webDetection,omitempty"` 9212 9213 // ForceSendFields is a list of field names (e.g. "Context") to 9214 // unconditionally include in API requests. By default, fields with 9215 // empty values are omitted from API requests. However, any non-pointer, 9216 // non-interface field appearing in ForceSendFields will be sent to the 9217 // server regardless of whether the field is empty or not. This may be 9218 // used to include empty fields in Patch requests. 9219 ForceSendFields []string `json:"-"` 9220 9221 // NullFields is a list of field names (e.g. "Context") to include in 9222 // API requests with the JSON null value. By default, fields with empty 9223 // values are omitted from API requests. However, any field with an 9224 // empty value appearing in NullFields will be sent to the server as 9225 // null. It is an error if a field in this list has a non-empty value. 9226 // This may be used to include null fields in Patch requests. 9227 NullFields []string `json:"-"` 9228} 9229 9230func (s *GoogleCloudVisionV1p4beta1AnnotateImageResponse) MarshalJSON() ([]byte, error) { 9231 type NoMethod GoogleCloudVisionV1p4beta1AnnotateImageResponse 9232 raw := NoMethod(*s) 9233 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9234} 9235 9236// GoogleCloudVisionV1p4beta1AsyncAnnotateFileResponse: The response for 9237// a single offline file annotation request. 9238type GoogleCloudVisionV1p4beta1AsyncAnnotateFileResponse struct { 9239 // OutputConfig: The output location and metadata from 9240 // AsyncAnnotateFileRequest. 9241 OutputConfig *GoogleCloudVisionV1p4beta1OutputConfig `json:"outputConfig,omitempty"` 9242 9243 // ForceSendFields is a list of field names (e.g. "OutputConfig") to 9244 // unconditionally include in API requests. By default, fields with 9245 // empty values are omitted from API requests. However, any non-pointer, 9246 // non-interface field appearing in ForceSendFields will be sent to the 9247 // server regardless of whether the field is empty or not. This may be 9248 // used to include empty fields in Patch requests. 9249 ForceSendFields []string `json:"-"` 9250 9251 // NullFields is a list of field names (e.g. "OutputConfig") to include 9252 // in API requests with the JSON null value. By default, fields with 9253 // empty values are omitted from API requests. However, any field with 9254 // an empty value appearing in NullFields will be sent to the server as 9255 // null. It is an error if a field in this list has a non-empty value. 9256 // This may be used to include null fields in Patch requests. 9257 NullFields []string `json:"-"` 9258} 9259 9260func (s *GoogleCloudVisionV1p4beta1AsyncAnnotateFileResponse) MarshalJSON() ([]byte, error) { 9261 type NoMethod GoogleCloudVisionV1p4beta1AsyncAnnotateFileResponse 9262 raw := NoMethod(*s) 9263 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9264} 9265 9266// GoogleCloudVisionV1p4beta1AsyncBatchAnnotateFilesResponse: Response 9267// to an async batch file annotation request. 9268type GoogleCloudVisionV1p4beta1AsyncBatchAnnotateFilesResponse struct { 9269 // Responses: The list of file annotation responses, one for each 9270 // request in AsyncBatchAnnotateFilesRequest. 9271 Responses []*GoogleCloudVisionV1p4beta1AsyncAnnotateFileResponse `json:"responses,omitempty"` 9272 9273 // ForceSendFields is a list of field names (e.g. "Responses") to 9274 // unconditionally include in API requests. By default, fields with 9275 // empty values are omitted from API requests. However, any non-pointer, 9276 // non-interface field appearing in ForceSendFields will be sent to the 9277 // server regardless of whether the field is empty or not. This may be 9278 // used to include empty fields in Patch requests. 9279 ForceSendFields []string `json:"-"` 9280 9281 // NullFields is a list of field names (e.g. "Responses") to include in 9282 // API requests with the JSON null value. By default, fields with empty 9283 // values are omitted from API requests. However, any field with an 9284 // empty value appearing in NullFields will be sent to the server as 9285 // null. It is an error if a field in this list has a non-empty value. 9286 // This may be used to include null fields in Patch requests. 9287 NullFields []string `json:"-"` 9288} 9289 9290func (s *GoogleCloudVisionV1p4beta1AsyncBatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) { 9291 type NoMethod GoogleCloudVisionV1p4beta1AsyncBatchAnnotateFilesResponse 9292 raw := NoMethod(*s) 9293 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9294} 9295 9296// GoogleCloudVisionV1p4beta1AsyncBatchAnnotateImagesResponse: Response 9297// to an async batch image annotation request. 9298type GoogleCloudVisionV1p4beta1AsyncBatchAnnotateImagesResponse struct { 9299 // OutputConfig: The output location and metadata from 9300 // AsyncBatchAnnotateImagesRequest. 9301 OutputConfig *GoogleCloudVisionV1p4beta1OutputConfig `json:"outputConfig,omitempty"` 9302 9303 // ForceSendFields is a list of field names (e.g. "OutputConfig") to 9304 // unconditionally include in API requests. By default, fields with 9305 // empty values are omitted from API requests. However, any non-pointer, 9306 // non-interface field appearing in ForceSendFields will be sent to the 9307 // server regardless of whether the field is empty or not. This may be 9308 // used to include empty fields in Patch requests. 9309 ForceSendFields []string `json:"-"` 9310 9311 // NullFields is a list of field names (e.g. "OutputConfig") to include 9312 // in API requests with the JSON null value. By default, fields with 9313 // empty values are omitted from API requests. However, any field with 9314 // an empty value appearing in NullFields will be sent to the server as 9315 // null. It is an error if a field in this list has a non-empty value. 9316 // This may be used to include null fields in Patch requests. 9317 NullFields []string `json:"-"` 9318} 9319 9320func (s *GoogleCloudVisionV1p4beta1AsyncBatchAnnotateImagesResponse) MarshalJSON() ([]byte, error) { 9321 type NoMethod GoogleCloudVisionV1p4beta1AsyncBatchAnnotateImagesResponse 9322 raw := NoMethod(*s) 9323 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9324} 9325 9326// GoogleCloudVisionV1p4beta1BatchAnnotateFilesResponse: A list of file 9327// annotation responses. 9328type GoogleCloudVisionV1p4beta1BatchAnnotateFilesResponse struct { 9329 // Responses: The list of file annotation responses, each response 9330 // corresponding to each AnnotateFileRequest in 9331 // BatchAnnotateFilesRequest. 9332 Responses []*GoogleCloudVisionV1p4beta1AnnotateFileResponse `json:"responses,omitempty"` 9333 9334 // ForceSendFields is a list of field names (e.g. "Responses") to 9335 // unconditionally include in API requests. By default, fields with 9336 // empty values are omitted from API requests. However, any non-pointer, 9337 // non-interface field appearing in ForceSendFields will be sent to the 9338 // server regardless of whether the field is empty or not. This may be 9339 // used to include empty fields in Patch requests. 9340 ForceSendFields []string `json:"-"` 9341 9342 // NullFields is a list of field names (e.g. "Responses") to include in 9343 // API requests with the JSON null value. By default, fields with empty 9344 // values are omitted from API requests. However, any field with an 9345 // empty value appearing in NullFields will be sent to the server as 9346 // null. It is an error if a field in this list has a non-empty value. 9347 // This may be used to include null fields in Patch requests. 9348 NullFields []string `json:"-"` 9349} 9350 9351func (s *GoogleCloudVisionV1p4beta1BatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) { 9352 type NoMethod GoogleCloudVisionV1p4beta1BatchAnnotateFilesResponse 9353 raw := NoMethod(*s) 9354 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9355} 9356 9357// GoogleCloudVisionV1p4beta1BatchOperationMetadata: Metadata for the 9358// batch operations such as the current state. This is included in the 9359// `metadata` field of the `Operation` returned by the `GetOperation` 9360// call of the `google::longrunning::Operations` service. 9361type GoogleCloudVisionV1p4beta1BatchOperationMetadata struct { 9362 // EndTime: The time when the batch request is finished and 9363 // google.longrunning.Operation.done is set to true. 9364 EndTime string `json:"endTime,omitempty"` 9365 9366 // State: The current state of the batch operation. 9367 // 9368 // Possible values: 9369 // "STATE_UNSPECIFIED" - Invalid. 9370 // "PROCESSING" - Request is actively being processed. 9371 // "SUCCESSFUL" - The request is done and at least one item has been 9372 // successfully processed. 9373 // "FAILED" - The request is done and no item has been successfully 9374 // processed. 9375 // "CANCELLED" - The request is done after the 9376 // longrunning.Operations.CancelOperation has been called by the user. 9377 // Any records that were processed before the cancel command are output 9378 // as specified in the request. 9379 State string `json:"state,omitempty"` 9380 9381 // SubmitTime: The time when the batch request was submitted to the 9382 // server. 9383 SubmitTime string `json:"submitTime,omitempty"` 9384 9385 // ForceSendFields is a list of field names (e.g. "EndTime") to 9386 // unconditionally include in API requests. By default, fields with 9387 // empty values are omitted from API requests. However, any non-pointer, 9388 // non-interface field appearing in ForceSendFields will be sent to the 9389 // server regardless of whether the field is empty or not. This may be 9390 // used to include empty fields in Patch requests. 9391 ForceSendFields []string `json:"-"` 9392 9393 // NullFields is a list of field names (e.g. "EndTime") to include in 9394 // API requests with the JSON null value. By default, fields with empty 9395 // values are omitted from API requests. However, any field with an 9396 // empty value appearing in NullFields will be sent to the server as 9397 // null. It is an error if a field in this list has a non-empty value. 9398 // This may be used to include null fields in Patch requests. 9399 NullFields []string `json:"-"` 9400} 9401 9402func (s *GoogleCloudVisionV1p4beta1BatchOperationMetadata) MarshalJSON() ([]byte, error) { 9403 type NoMethod GoogleCloudVisionV1p4beta1BatchOperationMetadata 9404 raw := NoMethod(*s) 9405 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9406} 9407 9408// GoogleCloudVisionV1p4beta1Block: Logical element on the page. 9409type GoogleCloudVisionV1p4beta1Block struct { 9410 // BlockType: Detected block type (text, image etc) for this block. 9411 // 9412 // Possible values: 9413 // "UNKNOWN" - Unknown block type. 9414 // "TEXT" - Regular text block. 9415 // "TABLE" - Table block. 9416 // "PICTURE" - Image block. 9417 // "RULER" - Horizontal/vertical line box. 9418 // "BARCODE" - Barcode block. 9419 BlockType string `json:"blockType,omitempty"` 9420 9421 // BoundingBox: The bounding box for the block. The vertices are in the 9422 // order of top-left, top-right, bottom-right, bottom-left. When a 9423 // rotation of the bounding box is detected the rotation is represented 9424 // as around the top-left corner as defined when the text is read in the 9425 // 'natural' orientation. For example: * when the text is horizontal it 9426 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 9427 // around the top-left corner it becomes: 2----3 | | 1----0 and the 9428 // vertex order will still be (0, 1, 2, 3). 9429 BoundingBox *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingBox,omitempty"` 9430 9431 // Confidence: Confidence of the OCR results on the block. Range [0, 1]. 9432 Confidence float64 `json:"confidence,omitempty"` 9433 9434 // Paragraphs: List of paragraphs in this block (if this blocks is of 9435 // type text). 9436 Paragraphs []*GoogleCloudVisionV1p4beta1Paragraph `json:"paragraphs,omitempty"` 9437 9438 // Property: Additional information detected for the block. 9439 Property *GoogleCloudVisionV1p4beta1TextAnnotationTextProperty `json:"property,omitempty"` 9440 9441 // ForceSendFields is a list of field names (e.g. "BlockType") to 9442 // unconditionally include in API requests. By default, fields with 9443 // empty values are omitted from API requests. However, any non-pointer, 9444 // non-interface field appearing in ForceSendFields will be sent to the 9445 // server regardless of whether the field is empty or not. This may be 9446 // used to include empty fields in Patch requests. 9447 ForceSendFields []string `json:"-"` 9448 9449 // NullFields is a list of field names (e.g. "BlockType") to include in 9450 // API requests with the JSON null value. By default, fields with empty 9451 // values are omitted from API requests. However, any field with an 9452 // empty value appearing in NullFields will be sent to the server as 9453 // null. It is an error if a field in this list has a non-empty value. 9454 // This may be used to include null fields in Patch requests. 9455 NullFields []string `json:"-"` 9456} 9457 9458func (s *GoogleCloudVisionV1p4beta1Block) MarshalJSON() ([]byte, error) { 9459 type NoMethod GoogleCloudVisionV1p4beta1Block 9460 raw := NoMethod(*s) 9461 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9462} 9463 9464func (s *GoogleCloudVisionV1p4beta1Block) UnmarshalJSON(data []byte) error { 9465 type NoMethod GoogleCloudVisionV1p4beta1Block 9466 var s1 struct { 9467 Confidence gensupport.JSONFloat64 `json:"confidence"` 9468 *NoMethod 9469 } 9470 s1.NoMethod = (*NoMethod)(s) 9471 if err := json.Unmarshal(data, &s1); err != nil { 9472 return err 9473 } 9474 s.Confidence = float64(s1.Confidence) 9475 return nil 9476} 9477 9478// GoogleCloudVisionV1p4beta1BoundingPoly: A bounding polygon for the 9479// detected image annotation. 9480type GoogleCloudVisionV1p4beta1BoundingPoly struct { 9481 // NormalizedVertices: The bounding polygon normalized vertices. 9482 NormalizedVertices []*GoogleCloudVisionV1p4beta1NormalizedVertex `json:"normalizedVertices,omitempty"` 9483 9484 // Vertices: The bounding polygon vertices. 9485 Vertices []*GoogleCloudVisionV1p4beta1Vertex `json:"vertices,omitempty"` 9486 9487 // ForceSendFields is a list of field names (e.g. "NormalizedVertices") 9488 // to unconditionally include in API requests. By default, fields with 9489 // empty values are omitted from API requests. However, any non-pointer, 9490 // non-interface field appearing in ForceSendFields will be sent to the 9491 // server regardless of whether the field is empty or not. This may be 9492 // used to include empty fields in Patch requests. 9493 ForceSendFields []string `json:"-"` 9494 9495 // NullFields is a list of field names (e.g. "NormalizedVertices") to 9496 // include in API requests with the JSON null value. By default, fields 9497 // with empty values are omitted from API requests. However, any field 9498 // with an empty value appearing in NullFields will be sent to the 9499 // server as null. It is an error if a field in this list has a 9500 // non-empty value. This may be used to include null fields in Patch 9501 // requests. 9502 NullFields []string `json:"-"` 9503} 9504 9505func (s *GoogleCloudVisionV1p4beta1BoundingPoly) MarshalJSON() ([]byte, error) { 9506 type NoMethod GoogleCloudVisionV1p4beta1BoundingPoly 9507 raw := NoMethod(*s) 9508 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9509} 9510 9511// GoogleCloudVisionV1p4beta1Celebrity: A Celebrity is a group of Faces 9512// with an identity. 9513type GoogleCloudVisionV1p4beta1Celebrity struct { 9514 // Description: The Celebrity's description. 9515 Description string `json:"description,omitempty"` 9516 9517 // DisplayName: The Celebrity's display name. 9518 DisplayName string `json:"displayName,omitempty"` 9519 9520 // Name: The resource name of the preloaded Celebrity. Has the format 9521 // `builtin/{mid}`. 9522 Name string `json:"name,omitempty"` 9523 9524 // ForceSendFields is a list of field names (e.g. "Description") to 9525 // unconditionally include in API requests. By default, fields with 9526 // empty values are omitted from API requests. However, any non-pointer, 9527 // non-interface field appearing in ForceSendFields will be sent to the 9528 // server regardless of whether the field is empty or not. This may be 9529 // used to include empty fields in Patch requests. 9530 ForceSendFields []string `json:"-"` 9531 9532 // NullFields is a list of field names (e.g. "Description") to include 9533 // in API requests with the JSON null value. By default, fields with 9534 // empty values are omitted from API requests. However, any field with 9535 // an empty value appearing in NullFields will be sent to the server as 9536 // null. It is an error if a field in this list has a non-empty value. 9537 // This may be used to include null fields in Patch requests. 9538 NullFields []string `json:"-"` 9539} 9540 9541func (s *GoogleCloudVisionV1p4beta1Celebrity) MarshalJSON() ([]byte, error) { 9542 type NoMethod GoogleCloudVisionV1p4beta1Celebrity 9543 raw := NoMethod(*s) 9544 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9545} 9546 9547// GoogleCloudVisionV1p4beta1ColorInfo: Color information consists of 9548// RGB channels, score, and the fraction of the image that the color 9549// occupies in the image. 9550type GoogleCloudVisionV1p4beta1ColorInfo struct { 9551 // Color: RGB components of the color. 9552 Color *Color `json:"color,omitempty"` 9553 9554 // PixelFraction: The fraction of pixels the color occupies in the 9555 // image. Value in range [0, 1]. 9556 PixelFraction float64 `json:"pixelFraction,omitempty"` 9557 9558 // Score: Image-specific score for this color. Value in range [0, 1]. 9559 Score float64 `json:"score,omitempty"` 9560 9561 // ForceSendFields is a list of field names (e.g. "Color") to 9562 // unconditionally include in API requests. By default, fields with 9563 // empty values are omitted from API requests. However, any non-pointer, 9564 // non-interface field appearing in ForceSendFields will be sent to the 9565 // server regardless of whether the field is empty or not. This may be 9566 // used to include empty fields in Patch requests. 9567 ForceSendFields []string `json:"-"` 9568 9569 // NullFields is a list of field names (e.g. "Color") to include in API 9570 // requests with the JSON null value. By default, fields with empty 9571 // values are omitted from API requests. However, any field with an 9572 // empty value appearing in NullFields will be sent to the server as 9573 // null. It is an error if a field in this list has a non-empty value. 9574 // This may be used to include null fields in Patch requests. 9575 NullFields []string `json:"-"` 9576} 9577 9578func (s *GoogleCloudVisionV1p4beta1ColorInfo) MarshalJSON() ([]byte, error) { 9579 type NoMethod GoogleCloudVisionV1p4beta1ColorInfo 9580 raw := NoMethod(*s) 9581 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9582} 9583 9584func (s *GoogleCloudVisionV1p4beta1ColorInfo) UnmarshalJSON(data []byte) error { 9585 type NoMethod GoogleCloudVisionV1p4beta1ColorInfo 9586 var s1 struct { 9587 PixelFraction gensupport.JSONFloat64 `json:"pixelFraction"` 9588 Score gensupport.JSONFloat64 `json:"score"` 9589 *NoMethod 9590 } 9591 s1.NoMethod = (*NoMethod)(s) 9592 if err := json.Unmarshal(data, &s1); err != nil { 9593 return err 9594 } 9595 s.PixelFraction = float64(s1.PixelFraction) 9596 s.Score = float64(s1.Score) 9597 return nil 9598} 9599 9600// GoogleCloudVisionV1p4beta1CropHint: Single crop hint that is used to 9601// generate a new crop when serving an image. 9602type GoogleCloudVisionV1p4beta1CropHint struct { 9603 // BoundingPoly: The bounding polygon for the crop region. The 9604 // coordinates of the bounding box are in the original image's scale. 9605 BoundingPoly *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingPoly,omitempty"` 9606 9607 // Confidence: Confidence of this being a salient region. Range [0, 1]. 9608 Confidence float64 `json:"confidence,omitempty"` 9609 9610 // ImportanceFraction: Fraction of importance of this salient region 9611 // with respect to the original image. 9612 ImportanceFraction float64 `json:"importanceFraction,omitempty"` 9613 9614 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 9615 // unconditionally include in API requests. By default, fields with 9616 // empty values are omitted from API requests. However, any non-pointer, 9617 // non-interface field appearing in ForceSendFields will be sent to the 9618 // server regardless of whether the field is empty or not. This may be 9619 // used to include empty fields in Patch requests. 9620 ForceSendFields []string `json:"-"` 9621 9622 // NullFields is a list of field names (e.g. "BoundingPoly") to include 9623 // in API requests with the JSON null value. By default, fields with 9624 // empty values are omitted from API requests. However, any field with 9625 // an empty value appearing in NullFields will be sent to the server as 9626 // null. It is an error if a field in this list has a non-empty value. 9627 // This may be used to include null fields in Patch requests. 9628 NullFields []string `json:"-"` 9629} 9630 9631func (s *GoogleCloudVisionV1p4beta1CropHint) MarshalJSON() ([]byte, error) { 9632 type NoMethod GoogleCloudVisionV1p4beta1CropHint 9633 raw := NoMethod(*s) 9634 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9635} 9636 9637func (s *GoogleCloudVisionV1p4beta1CropHint) UnmarshalJSON(data []byte) error { 9638 type NoMethod GoogleCloudVisionV1p4beta1CropHint 9639 var s1 struct { 9640 Confidence gensupport.JSONFloat64 `json:"confidence"` 9641 ImportanceFraction gensupport.JSONFloat64 `json:"importanceFraction"` 9642 *NoMethod 9643 } 9644 s1.NoMethod = (*NoMethod)(s) 9645 if err := json.Unmarshal(data, &s1); err != nil { 9646 return err 9647 } 9648 s.Confidence = float64(s1.Confidence) 9649 s.ImportanceFraction = float64(s1.ImportanceFraction) 9650 return nil 9651} 9652 9653// GoogleCloudVisionV1p4beta1CropHintsAnnotation: Set of crop hints that 9654// are used to generate new crops when serving images. 9655type GoogleCloudVisionV1p4beta1CropHintsAnnotation struct { 9656 // CropHints: Crop hint results. 9657 CropHints []*GoogleCloudVisionV1p4beta1CropHint `json:"cropHints,omitempty"` 9658 9659 // ForceSendFields is a list of field names (e.g. "CropHints") to 9660 // unconditionally include in API requests. By default, fields with 9661 // empty values are omitted from API requests. However, any non-pointer, 9662 // non-interface field appearing in ForceSendFields will be sent to the 9663 // server regardless of whether the field is empty or not. This may be 9664 // used to include empty fields in Patch requests. 9665 ForceSendFields []string `json:"-"` 9666 9667 // NullFields is a list of field names (e.g. "CropHints") to include in 9668 // API requests with the JSON null value. By default, fields with empty 9669 // values are omitted from API requests. However, any field with an 9670 // empty value appearing in NullFields will be sent to the server as 9671 // null. It is an error if a field in this list has a non-empty value. 9672 // This may be used to include null fields in Patch requests. 9673 NullFields []string `json:"-"` 9674} 9675 9676func (s *GoogleCloudVisionV1p4beta1CropHintsAnnotation) MarshalJSON() ([]byte, error) { 9677 type NoMethod GoogleCloudVisionV1p4beta1CropHintsAnnotation 9678 raw := NoMethod(*s) 9679 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9680} 9681 9682// GoogleCloudVisionV1p4beta1DominantColorsAnnotation: Set of dominant 9683// colors and their corresponding scores. 9684type GoogleCloudVisionV1p4beta1DominantColorsAnnotation struct { 9685 // Colors: RGB color values with their score and pixel fraction. 9686 Colors []*GoogleCloudVisionV1p4beta1ColorInfo `json:"colors,omitempty"` 9687 9688 // ForceSendFields is a list of field names (e.g. "Colors") to 9689 // unconditionally include in API requests. By default, fields with 9690 // empty values are omitted from API requests. However, any non-pointer, 9691 // non-interface field appearing in ForceSendFields will be sent to the 9692 // server regardless of whether the field is empty or not. This may be 9693 // used to include empty fields in Patch requests. 9694 ForceSendFields []string `json:"-"` 9695 9696 // NullFields is a list of field names (e.g. "Colors") to include in API 9697 // requests with the JSON null value. By default, fields with empty 9698 // values are omitted from API requests. However, any field with an 9699 // empty value appearing in NullFields will be sent to the server as 9700 // null. It is an error if a field in this list has a non-empty value. 9701 // This may be used to include null fields in Patch requests. 9702 NullFields []string `json:"-"` 9703} 9704 9705func (s *GoogleCloudVisionV1p4beta1DominantColorsAnnotation) MarshalJSON() ([]byte, error) { 9706 type NoMethod GoogleCloudVisionV1p4beta1DominantColorsAnnotation 9707 raw := NoMethod(*s) 9708 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9709} 9710 9711// GoogleCloudVisionV1p4beta1EntityAnnotation: Set of detected entity 9712// features. 9713type GoogleCloudVisionV1p4beta1EntityAnnotation struct { 9714 // BoundingPoly: Image region to which this entity belongs. Not produced 9715 // for `LABEL_DETECTION` features. 9716 BoundingPoly *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingPoly,omitempty"` 9717 9718 // Confidence: **Deprecated. Use `score` instead.** The accuracy of the 9719 // entity detection in an image. For example, for an image in which the 9720 // "Eiffel Tower" entity is detected, this field represents the 9721 // confidence that there is a tower in the query image. Range [0, 1]. 9722 Confidence float64 `json:"confidence,omitempty"` 9723 9724 // Description: Entity textual description, expressed in its `locale` 9725 // language. 9726 Description string `json:"description,omitempty"` 9727 9728 // Locale: The language code for the locale in which the entity textual 9729 // `description` is expressed. 9730 Locale string `json:"locale,omitempty"` 9731 9732 // Locations: The location information for the detected entity. Multiple 9733 // `LocationInfo` elements can be present because one location may 9734 // indicate the location of the scene in the image, and another location 9735 // may indicate the location of the place where the image was taken. 9736 // Location information is usually present for landmarks. 9737 Locations []*GoogleCloudVisionV1p4beta1LocationInfo `json:"locations,omitempty"` 9738 9739 // Mid: Opaque entity ID. Some IDs may be available in Google Knowledge 9740 // Graph Search API (https://developers.google.com/knowledge-graph/). 9741 Mid string `json:"mid,omitempty"` 9742 9743 // Properties: Some entities may have optional user-supplied `Property` 9744 // (name/value) fields, such a score or string that qualifies the 9745 // entity. 9746 Properties []*GoogleCloudVisionV1p4beta1Property `json:"properties,omitempty"` 9747 9748 // Score: Overall score of the result. Range [0, 1]. 9749 Score float64 `json:"score,omitempty"` 9750 9751 // Topicality: The relevancy of the ICA (Image Content Annotation) label 9752 // to the image. For example, the relevancy of "tower" is likely higher 9753 // to an image containing the detected "Eiffel Tower" than to an image 9754 // containing a detected distant towering building, even though the 9755 // confidence that there is a tower in each image may be the same. Range 9756 // [0, 1]. 9757 Topicality float64 `json:"topicality,omitempty"` 9758 9759 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 9760 // unconditionally include in API requests. By default, fields with 9761 // empty values are omitted from API requests. However, any non-pointer, 9762 // non-interface field appearing in ForceSendFields will be sent to the 9763 // server regardless of whether the field is empty or not. This may be 9764 // used to include empty fields in Patch requests. 9765 ForceSendFields []string `json:"-"` 9766 9767 // NullFields is a list of field names (e.g. "BoundingPoly") to include 9768 // in API requests with the JSON null value. By default, fields with 9769 // empty values are omitted from API requests. However, any field with 9770 // an empty value appearing in NullFields will be sent to the server as 9771 // null. It is an error if a field in this list has a non-empty value. 9772 // This may be used to include null fields in Patch requests. 9773 NullFields []string `json:"-"` 9774} 9775 9776func (s *GoogleCloudVisionV1p4beta1EntityAnnotation) MarshalJSON() ([]byte, error) { 9777 type NoMethod GoogleCloudVisionV1p4beta1EntityAnnotation 9778 raw := NoMethod(*s) 9779 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9780} 9781 9782func (s *GoogleCloudVisionV1p4beta1EntityAnnotation) UnmarshalJSON(data []byte) error { 9783 type NoMethod GoogleCloudVisionV1p4beta1EntityAnnotation 9784 var s1 struct { 9785 Confidence gensupport.JSONFloat64 `json:"confidence"` 9786 Score gensupport.JSONFloat64 `json:"score"` 9787 Topicality gensupport.JSONFloat64 `json:"topicality"` 9788 *NoMethod 9789 } 9790 s1.NoMethod = (*NoMethod)(s) 9791 if err := json.Unmarshal(data, &s1); err != nil { 9792 return err 9793 } 9794 s.Confidence = float64(s1.Confidence) 9795 s.Score = float64(s1.Score) 9796 s.Topicality = float64(s1.Topicality) 9797 return nil 9798} 9799 9800// GoogleCloudVisionV1p4beta1FaceAnnotation: A face annotation object 9801// contains the results of face detection. 9802type GoogleCloudVisionV1p4beta1FaceAnnotation struct { 9803 // AngerLikelihood: Anger likelihood. 9804 // 9805 // Possible values: 9806 // "UNKNOWN" - Unknown likelihood. 9807 // "VERY_UNLIKELY" - It is very unlikely. 9808 // "UNLIKELY" - It is unlikely. 9809 // "POSSIBLE" - It is possible. 9810 // "LIKELY" - It is likely. 9811 // "VERY_LIKELY" - It is very likely. 9812 AngerLikelihood string `json:"angerLikelihood,omitempty"` 9813 9814 // BlurredLikelihood: Blurred likelihood. 9815 // 9816 // Possible values: 9817 // "UNKNOWN" - Unknown likelihood. 9818 // "VERY_UNLIKELY" - It is very unlikely. 9819 // "UNLIKELY" - It is unlikely. 9820 // "POSSIBLE" - It is possible. 9821 // "LIKELY" - It is likely. 9822 // "VERY_LIKELY" - It is very likely. 9823 BlurredLikelihood string `json:"blurredLikelihood,omitempty"` 9824 9825 // BoundingPoly: The bounding polygon around the face. The coordinates 9826 // of the bounding box are in the original image's scale. The bounding 9827 // box is computed to "frame" the face in accordance with human 9828 // expectations. It is based on the landmarker results. Note that one or 9829 // more x and/or y coordinates may not be generated in the 9830 // `BoundingPoly` (the polygon will be unbounded) if only a partial face 9831 // appears in the image to be annotated. 9832 BoundingPoly *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingPoly,omitempty"` 9833 9834 // DetectionConfidence: Detection confidence. Range [0, 1]. 9835 DetectionConfidence float64 `json:"detectionConfidence,omitempty"` 9836 9837 // FdBoundingPoly: The `fd_bounding_poly` bounding polygon is tighter 9838 // than the `boundingPoly`, and encloses only the skin part of the face. 9839 // Typically, it is used to eliminate the face from any image analysis 9840 // that detects the "amount of skin" visible in an image. It is not 9841 // based on the landmarker results, only on the initial face detection, 9842 // hence the fd (face detection) prefix. 9843 FdBoundingPoly *GoogleCloudVisionV1p4beta1BoundingPoly `json:"fdBoundingPoly,omitempty"` 9844 9845 // HeadwearLikelihood: Headwear likelihood. 9846 // 9847 // Possible values: 9848 // "UNKNOWN" - Unknown likelihood. 9849 // "VERY_UNLIKELY" - It is very unlikely. 9850 // "UNLIKELY" - It is unlikely. 9851 // "POSSIBLE" - It is possible. 9852 // "LIKELY" - It is likely. 9853 // "VERY_LIKELY" - It is very likely. 9854 HeadwearLikelihood string `json:"headwearLikelihood,omitempty"` 9855 9856 // JoyLikelihood: Joy likelihood. 9857 // 9858 // Possible values: 9859 // "UNKNOWN" - Unknown likelihood. 9860 // "VERY_UNLIKELY" - It is very unlikely. 9861 // "UNLIKELY" - It is unlikely. 9862 // "POSSIBLE" - It is possible. 9863 // "LIKELY" - It is likely. 9864 // "VERY_LIKELY" - It is very likely. 9865 JoyLikelihood string `json:"joyLikelihood,omitempty"` 9866 9867 // LandmarkingConfidence: Face landmarking confidence. Range [0, 1]. 9868 LandmarkingConfidence float64 `json:"landmarkingConfidence,omitempty"` 9869 9870 // Landmarks: Detected face landmarks. 9871 Landmarks []*GoogleCloudVisionV1p4beta1FaceAnnotationLandmark `json:"landmarks,omitempty"` 9872 9873 // PanAngle: Yaw angle, which indicates the leftward/rightward angle 9874 // that the face is pointing relative to the vertical plane 9875 // perpendicular to the image. Range [-180,180]. 9876 PanAngle float64 `json:"panAngle,omitempty"` 9877 9878 // RecognitionResult: Additional recognition information. Only computed 9879 // if image_context.face_recognition_params is provided, **and** a match 9880 // is found to a Celebrity in the input CelebritySet. This field is 9881 // sorted in order of decreasing confidence values. 9882 RecognitionResult []*GoogleCloudVisionV1p4beta1FaceRecognitionResult `json:"recognitionResult,omitempty"` 9883 9884 // RollAngle: Roll angle, which indicates the amount of 9885 // clockwise/anti-clockwise rotation of the face relative to the image 9886 // vertical about the axis perpendicular to the face. Range [-180,180]. 9887 RollAngle float64 `json:"rollAngle,omitempty"` 9888 9889 // SorrowLikelihood: Sorrow likelihood. 9890 // 9891 // Possible values: 9892 // "UNKNOWN" - Unknown likelihood. 9893 // "VERY_UNLIKELY" - It is very unlikely. 9894 // "UNLIKELY" - It is unlikely. 9895 // "POSSIBLE" - It is possible. 9896 // "LIKELY" - It is likely. 9897 // "VERY_LIKELY" - It is very likely. 9898 SorrowLikelihood string `json:"sorrowLikelihood,omitempty"` 9899 9900 // SurpriseLikelihood: Surprise likelihood. 9901 // 9902 // Possible values: 9903 // "UNKNOWN" - Unknown likelihood. 9904 // "VERY_UNLIKELY" - It is very unlikely. 9905 // "UNLIKELY" - It is unlikely. 9906 // "POSSIBLE" - It is possible. 9907 // "LIKELY" - It is likely. 9908 // "VERY_LIKELY" - It is very likely. 9909 SurpriseLikelihood string `json:"surpriseLikelihood,omitempty"` 9910 9911 // TiltAngle: Pitch angle, which indicates the upwards/downwards angle 9912 // that the face is pointing relative to the image's horizontal plane. 9913 // Range [-180,180]. 9914 TiltAngle float64 `json:"tiltAngle,omitempty"` 9915 9916 // UnderExposedLikelihood: Under-exposed likelihood. 9917 // 9918 // Possible values: 9919 // "UNKNOWN" - Unknown likelihood. 9920 // "VERY_UNLIKELY" - It is very unlikely. 9921 // "UNLIKELY" - It is unlikely. 9922 // "POSSIBLE" - It is possible. 9923 // "LIKELY" - It is likely. 9924 // "VERY_LIKELY" - It is very likely. 9925 UnderExposedLikelihood string `json:"underExposedLikelihood,omitempty"` 9926 9927 // ForceSendFields is a list of field names (e.g. "AngerLikelihood") to 9928 // unconditionally include in API requests. By default, fields with 9929 // empty values are omitted from API requests. However, any non-pointer, 9930 // non-interface field appearing in ForceSendFields will be sent to the 9931 // server regardless of whether the field is empty or not. This may be 9932 // used to include empty fields in Patch requests. 9933 ForceSendFields []string `json:"-"` 9934 9935 // NullFields is a list of field names (e.g. "AngerLikelihood") to 9936 // include in API requests with the JSON null value. By default, fields 9937 // with empty values are omitted from API requests. However, any field 9938 // with an empty value appearing in NullFields will be sent to the 9939 // server as null. It is an error if a field in this list has a 9940 // non-empty value. This may be used to include null fields in Patch 9941 // requests. 9942 NullFields []string `json:"-"` 9943} 9944 9945func (s *GoogleCloudVisionV1p4beta1FaceAnnotation) MarshalJSON() ([]byte, error) { 9946 type NoMethod GoogleCloudVisionV1p4beta1FaceAnnotation 9947 raw := NoMethod(*s) 9948 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 9949} 9950 9951func (s *GoogleCloudVisionV1p4beta1FaceAnnotation) UnmarshalJSON(data []byte) error { 9952 type NoMethod GoogleCloudVisionV1p4beta1FaceAnnotation 9953 var s1 struct { 9954 DetectionConfidence gensupport.JSONFloat64 `json:"detectionConfidence"` 9955 LandmarkingConfidence gensupport.JSONFloat64 `json:"landmarkingConfidence"` 9956 PanAngle gensupport.JSONFloat64 `json:"panAngle"` 9957 RollAngle gensupport.JSONFloat64 `json:"rollAngle"` 9958 TiltAngle gensupport.JSONFloat64 `json:"tiltAngle"` 9959 *NoMethod 9960 } 9961 s1.NoMethod = (*NoMethod)(s) 9962 if err := json.Unmarshal(data, &s1); err != nil { 9963 return err 9964 } 9965 s.DetectionConfidence = float64(s1.DetectionConfidence) 9966 s.LandmarkingConfidence = float64(s1.LandmarkingConfidence) 9967 s.PanAngle = float64(s1.PanAngle) 9968 s.RollAngle = float64(s1.RollAngle) 9969 s.TiltAngle = float64(s1.TiltAngle) 9970 return nil 9971} 9972 9973// GoogleCloudVisionV1p4beta1FaceAnnotationLandmark: A face-specific 9974// landmark (for example, a face feature). 9975type GoogleCloudVisionV1p4beta1FaceAnnotationLandmark struct { 9976 // Position: Face landmark position. 9977 Position *GoogleCloudVisionV1p4beta1Position `json:"position,omitempty"` 9978 9979 // Type: Face landmark type. 9980 // 9981 // Possible values: 9982 // "UNKNOWN_LANDMARK" - Unknown face landmark detected. Should not be 9983 // filled. 9984 // "LEFT_EYE" - Left eye. 9985 // "RIGHT_EYE" - Right eye. 9986 // "LEFT_OF_LEFT_EYEBROW" - Left of left eyebrow. 9987 // "RIGHT_OF_LEFT_EYEBROW" - Right of left eyebrow. 9988 // "LEFT_OF_RIGHT_EYEBROW" - Left of right eyebrow. 9989 // "RIGHT_OF_RIGHT_EYEBROW" - Right of right eyebrow. 9990 // "MIDPOINT_BETWEEN_EYES" - Midpoint between eyes. 9991 // "NOSE_TIP" - Nose tip. 9992 // "UPPER_LIP" - Upper lip. 9993 // "LOWER_LIP" - Lower lip. 9994 // "MOUTH_LEFT" - Mouth left. 9995 // "MOUTH_RIGHT" - Mouth right. 9996 // "MOUTH_CENTER" - Mouth center. 9997 // "NOSE_BOTTOM_RIGHT" - Nose, bottom right. 9998 // "NOSE_BOTTOM_LEFT" - Nose, bottom left. 9999 // "NOSE_BOTTOM_CENTER" - Nose, bottom center. 10000 // "LEFT_EYE_TOP_BOUNDARY" - Left eye, top boundary. 10001 // "LEFT_EYE_RIGHT_CORNER" - Left eye, right corner. 10002 // "LEFT_EYE_BOTTOM_BOUNDARY" - Left eye, bottom boundary. 10003 // "LEFT_EYE_LEFT_CORNER" - Left eye, left corner. 10004 // "RIGHT_EYE_TOP_BOUNDARY" - Right eye, top boundary. 10005 // "RIGHT_EYE_RIGHT_CORNER" - Right eye, right corner. 10006 // "RIGHT_EYE_BOTTOM_BOUNDARY" - Right eye, bottom boundary. 10007 // "RIGHT_EYE_LEFT_CORNER" - Right eye, left corner. 10008 // "LEFT_EYEBROW_UPPER_MIDPOINT" - Left eyebrow, upper midpoint. 10009 // "RIGHT_EYEBROW_UPPER_MIDPOINT" - Right eyebrow, upper midpoint. 10010 // "LEFT_EAR_TRAGION" - Left ear tragion. 10011 // "RIGHT_EAR_TRAGION" - Right ear tragion. 10012 // "LEFT_EYE_PUPIL" - Left eye pupil. 10013 // "RIGHT_EYE_PUPIL" - Right eye pupil. 10014 // "FOREHEAD_GLABELLA" - Forehead glabella. 10015 // "CHIN_GNATHION" - Chin gnathion. 10016 // "CHIN_LEFT_GONION" - Chin left gonion. 10017 // "CHIN_RIGHT_GONION" - Chin right gonion. 10018 // "LEFT_CHEEK_CENTER" - Left cheek center. 10019 // "RIGHT_CHEEK_CENTER" - Right cheek center. 10020 Type string `json:"type,omitempty"` 10021 10022 // ForceSendFields is a list of field names (e.g. "Position") to 10023 // unconditionally include in API requests. By default, fields with 10024 // empty values are omitted from API requests. However, any non-pointer, 10025 // non-interface field appearing in ForceSendFields will be sent to the 10026 // server regardless of whether the field is empty or not. This may be 10027 // used to include empty fields in Patch requests. 10028 ForceSendFields []string `json:"-"` 10029 10030 // NullFields is a list of field names (e.g. "Position") to include in 10031 // API requests with the JSON null value. By default, fields with empty 10032 // values are omitted from API requests. However, any field with an 10033 // empty value appearing in NullFields will be sent to the server as 10034 // null. It is an error if a field in this list has a non-empty value. 10035 // This may be used to include null fields in Patch requests. 10036 NullFields []string `json:"-"` 10037} 10038 10039func (s *GoogleCloudVisionV1p4beta1FaceAnnotationLandmark) MarshalJSON() ([]byte, error) { 10040 type NoMethod GoogleCloudVisionV1p4beta1FaceAnnotationLandmark 10041 raw := NoMethod(*s) 10042 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10043} 10044 10045// GoogleCloudVisionV1p4beta1FaceRecognitionResult: Information about a 10046// face's identity. 10047type GoogleCloudVisionV1p4beta1FaceRecognitionResult struct { 10048 // Celebrity: The Celebrity that this face was matched to. 10049 Celebrity *GoogleCloudVisionV1p4beta1Celebrity `json:"celebrity,omitempty"` 10050 10051 // Confidence: Recognition confidence. Range [0, 1]. 10052 Confidence float64 `json:"confidence,omitempty"` 10053 10054 // ForceSendFields is a list of field names (e.g. "Celebrity") to 10055 // unconditionally include in API requests. By default, fields with 10056 // empty values are omitted from API requests. However, any non-pointer, 10057 // non-interface field appearing in ForceSendFields will be sent to the 10058 // server regardless of whether the field is empty or not. This may be 10059 // used to include empty fields in Patch requests. 10060 ForceSendFields []string `json:"-"` 10061 10062 // NullFields is a list of field names (e.g. "Celebrity") to include in 10063 // API requests with the JSON null value. By default, fields with empty 10064 // values are omitted from API requests. However, any field with an 10065 // empty value appearing in NullFields will be sent to the server as 10066 // null. It is an error if a field in this list has a non-empty value. 10067 // This may be used to include null fields in Patch requests. 10068 NullFields []string `json:"-"` 10069} 10070 10071func (s *GoogleCloudVisionV1p4beta1FaceRecognitionResult) MarshalJSON() ([]byte, error) { 10072 type NoMethod GoogleCloudVisionV1p4beta1FaceRecognitionResult 10073 raw := NoMethod(*s) 10074 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10075} 10076 10077func (s *GoogleCloudVisionV1p4beta1FaceRecognitionResult) UnmarshalJSON(data []byte) error { 10078 type NoMethod GoogleCloudVisionV1p4beta1FaceRecognitionResult 10079 var s1 struct { 10080 Confidence gensupport.JSONFloat64 `json:"confidence"` 10081 *NoMethod 10082 } 10083 s1.NoMethod = (*NoMethod)(s) 10084 if err := json.Unmarshal(data, &s1); err != nil { 10085 return err 10086 } 10087 s.Confidence = float64(s1.Confidence) 10088 return nil 10089} 10090 10091// GoogleCloudVisionV1p4beta1GcsDestination: The Google Cloud Storage 10092// location where the output will be written to. 10093type GoogleCloudVisionV1p4beta1GcsDestination struct { 10094 // Uri: Google Cloud Storage URI prefix where the results will be 10095 // stored. Results will be in JSON format and preceded by its 10096 // corresponding input URI prefix. This field can either represent a gcs 10097 // file prefix or gcs directory. In either case, the uri should be 10098 // unique because in order to get all of the output files, you will need 10099 // to do a wildcard gcs search on the uri prefix you provide. Examples: 10100 // * File Prefix: gs://bucket-name/here/filenameprefix The output files 10101 // will be created in gs://bucket-name/here/ and the names of the output 10102 // files will begin with "filenameprefix". * Directory Prefix: 10103 // gs://bucket-name/some/location/ The output files will be created in 10104 // gs://bucket-name/some/location/ and the names of the output files 10105 // could be anything because there was no filename prefix specified. If 10106 // multiple outputs, each response is still AnnotateFileResponse, each 10107 // of which contains some subset of the full list of 10108 // AnnotateImageResponse. Multiple outputs can happen if, for example, 10109 // the output JSON is too large and overflows into multiple sharded 10110 // files. 10111 Uri string `json:"uri,omitempty"` 10112 10113 // ForceSendFields is a list of field names (e.g. "Uri") to 10114 // unconditionally include in API requests. By default, fields with 10115 // empty values are omitted from API requests. However, any non-pointer, 10116 // non-interface field appearing in ForceSendFields will be sent to the 10117 // server regardless of whether the field is empty or not. This may be 10118 // used to include empty fields in Patch requests. 10119 ForceSendFields []string `json:"-"` 10120 10121 // NullFields is a list of field names (e.g. "Uri") to include in API 10122 // requests with the JSON null value. By default, fields with empty 10123 // values are omitted from API requests. However, any field with an 10124 // empty value appearing in NullFields will be sent to the server as 10125 // null. It is an error if a field in this list has a non-empty value. 10126 // This may be used to include null fields in Patch requests. 10127 NullFields []string `json:"-"` 10128} 10129 10130func (s *GoogleCloudVisionV1p4beta1GcsDestination) MarshalJSON() ([]byte, error) { 10131 type NoMethod GoogleCloudVisionV1p4beta1GcsDestination 10132 raw := NoMethod(*s) 10133 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10134} 10135 10136// GoogleCloudVisionV1p4beta1GcsSource: The Google Cloud Storage 10137// location where the input will be read from. 10138type GoogleCloudVisionV1p4beta1GcsSource struct { 10139 // Uri: Google Cloud Storage URI for the input file. This must only be a 10140 // Google Cloud Storage object. Wildcards are not currently supported. 10141 Uri string `json:"uri,omitempty"` 10142 10143 // ForceSendFields is a list of field names (e.g. "Uri") to 10144 // unconditionally include in API requests. By default, fields with 10145 // empty values are omitted from API requests. However, any non-pointer, 10146 // non-interface field appearing in ForceSendFields will be sent to the 10147 // server regardless of whether the field is empty or not. This may be 10148 // used to include empty fields in Patch requests. 10149 ForceSendFields []string `json:"-"` 10150 10151 // NullFields is a list of field names (e.g. "Uri") to include in API 10152 // requests with the JSON null value. By default, fields with empty 10153 // values are omitted from API requests. However, any field with an 10154 // empty value appearing in NullFields will be sent to the server as 10155 // null. It is an error if a field in this list has a non-empty value. 10156 // This may be used to include null fields in Patch requests. 10157 NullFields []string `json:"-"` 10158} 10159 10160func (s *GoogleCloudVisionV1p4beta1GcsSource) MarshalJSON() ([]byte, error) { 10161 type NoMethod GoogleCloudVisionV1p4beta1GcsSource 10162 raw := NoMethod(*s) 10163 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10164} 10165 10166// GoogleCloudVisionV1p4beta1ImageAnnotationContext: If an image was 10167// produced from a file (e.g. a PDF), this message gives information 10168// about the source of that image. 10169type GoogleCloudVisionV1p4beta1ImageAnnotationContext struct { 10170 // PageNumber: If the file was a PDF or TIFF, this field gives the page 10171 // number within the file used to produce the image. 10172 PageNumber int64 `json:"pageNumber,omitempty"` 10173 10174 // Uri: The URI of the file used to produce the image. 10175 Uri string `json:"uri,omitempty"` 10176 10177 // ForceSendFields is a list of field names (e.g. "PageNumber") to 10178 // unconditionally include in API requests. By default, fields with 10179 // empty values are omitted from API requests. However, any non-pointer, 10180 // non-interface field appearing in ForceSendFields will be sent to the 10181 // server regardless of whether the field is empty or not. This may be 10182 // used to include empty fields in Patch requests. 10183 ForceSendFields []string `json:"-"` 10184 10185 // NullFields is a list of field names (e.g. "PageNumber") to include in 10186 // API requests with the JSON null value. By default, fields with empty 10187 // values are omitted from API requests. However, any field with an 10188 // empty value appearing in NullFields will be sent to the server as 10189 // null. It is an error if a field in this list has a non-empty value. 10190 // This may be used to include null fields in Patch requests. 10191 NullFields []string `json:"-"` 10192} 10193 10194func (s *GoogleCloudVisionV1p4beta1ImageAnnotationContext) MarshalJSON() ([]byte, error) { 10195 type NoMethod GoogleCloudVisionV1p4beta1ImageAnnotationContext 10196 raw := NoMethod(*s) 10197 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10198} 10199 10200// GoogleCloudVisionV1p4beta1ImageProperties: Stores image properties, 10201// such as dominant colors. 10202type GoogleCloudVisionV1p4beta1ImageProperties struct { 10203 // DominantColors: If present, dominant colors completed successfully. 10204 DominantColors *GoogleCloudVisionV1p4beta1DominantColorsAnnotation `json:"dominantColors,omitempty"` 10205 10206 // ForceSendFields is a list of field names (e.g. "DominantColors") to 10207 // unconditionally include in API requests. By default, fields with 10208 // empty values are omitted from API requests. However, any non-pointer, 10209 // non-interface field appearing in ForceSendFields will be sent to the 10210 // server regardless of whether the field is empty or not. This may be 10211 // used to include empty fields in Patch requests. 10212 ForceSendFields []string `json:"-"` 10213 10214 // NullFields is a list of field names (e.g. "DominantColors") to 10215 // include in API requests with the JSON null value. By default, fields 10216 // with empty values are omitted from API requests. However, any field 10217 // with an empty value appearing in NullFields will be sent to the 10218 // server as null. It is an error if a field in this list has a 10219 // non-empty value. This may be used to include null fields in Patch 10220 // requests. 10221 NullFields []string `json:"-"` 10222} 10223 10224func (s *GoogleCloudVisionV1p4beta1ImageProperties) MarshalJSON() ([]byte, error) { 10225 type NoMethod GoogleCloudVisionV1p4beta1ImageProperties 10226 raw := NoMethod(*s) 10227 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10228} 10229 10230// GoogleCloudVisionV1p4beta1ImportProductSetsResponse: Response message 10231// for the `ImportProductSets` method. This message is returned by the 10232// google.longrunning.Operations.GetOperation method in the returned 10233// google.longrunning.Operation.response field. 10234type GoogleCloudVisionV1p4beta1ImportProductSetsResponse struct { 10235 // ReferenceImages: The list of reference_images that are imported 10236 // successfully. 10237 ReferenceImages []*GoogleCloudVisionV1p4beta1ReferenceImage `json:"referenceImages,omitempty"` 10238 10239 // Statuses: The rpc status for each ImportProductSet request, including 10240 // both successes and errors. The number of statuses here matches the 10241 // number of lines in the csv file, and statuses[i] stores the success 10242 // or failure status of processing the i-th line of the csv, starting 10243 // from line 0. 10244 Statuses []*Status `json:"statuses,omitempty"` 10245 10246 // ForceSendFields is a list of field names (e.g. "ReferenceImages") to 10247 // unconditionally include in API requests. By default, fields with 10248 // empty values are omitted from API requests. However, any non-pointer, 10249 // non-interface field appearing in ForceSendFields will be sent to the 10250 // server regardless of whether the field is empty or not. This may be 10251 // used to include empty fields in Patch requests. 10252 ForceSendFields []string `json:"-"` 10253 10254 // NullFields is a list of field names (e.g. "ReferenceImages") to 10255 // include in API requests with the JSON null value. By default, fields 10256 // with empty values are omitted from API requests. However, any field 10257 // with an empty value appearing in NullFields will be sent to the 10258 // server as null. It is an error if a field in this list has a 10259 // non-empty value. This may be used to include null fields in Patch 10260 // requests. 10261 NullFields []string `json:"-"` 10262} 10263 10264func (s *GoogleCloudVisionV1p4beta1ImportProductSetsResponse) MarshalJSON() ([]byte, error) { 10265 type NoMethod GoogleCloudVisionV1p4beta1ImportProductSetsResponse 10266 raw := NoMethod(*s) 10267 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10268} 10269 10270// GoogleCloudVisionV1p4beta1InputConfig: The desired input location and 10271// metadata. 10272type GoogleCloudVisionV1p4beta1InputConfig struct { 10273 // Content: File content, represented as a stream of bytes. Note: As 10274 // with all `bytes` fields, protobuffers use a pure binary 10275 // representation, whereas JSON representations use base64. Currently, 10276 // this field only works for BatchAnnotateFiles requests. It does not 10277 // work for AsyncBatchAnnotateFiles requests. 10278 Content string `json:"content,omitempty"` 10279 10280 // GcsSource: The Google Cloud Storage location to read the input from. 10281 GcsSource *GoogleCloudVisionV1p4beta1GcsSource `json:"gcsSource,omitempty"` 10282 10283 // MimeType: The type of the file. Currently only "application/pdf", 10284 // "image/tiff" and "image/gif" are supported. Wildcards are not 10285 // supported. 10286 MimeType string `json:"mimeType,omitempty"` 10287 10288 // ForceSendFields is a list of field names (e.g. "Content") to 10289 // unconditionally include in API requests. By default, fields with 10290 // empty values are omitted from API requests. However, any non-pointer, 10291 // non-interface field appearing in ForceSendFields will be sent to the 10292 // server regardless of whether the field is empty or not. This may be 10293 // used to include empty fields in Patch requests. 10294 ForceSendFields []string `json:"-"` 10295 10296 // NullFields is a list of field names (e.g. "Content") to include in 10297 // API requests with the JSON null value. By default, fields with empty 10298 // values are omitted from API requests. However, any field with an 10299 // empty value appearing in NullFields will be sent to the server as 10300 // null. It is an error if a field in this list has a non-empty value. 10301 // This may be used to include null fields in Patch requests. 10302 NullFields []string `json:"-"` 10303} 10304 10305func (s *GoogleCloudVisionV1p4beta1InputConfig) MarshalJSON() ([]byte, error) { 10306 type NoMethod GoogleCloudVisionV1p4beta1InputConfig 10307 raw := NoMethod(*s) 10308 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10309} 10310 10311// GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation: Set of detected 10312// objects with bounding boxes. 10313type GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation struct { 10314 // BoundingPoly: Image region to which this object belongs. This must be 10315 // populated. 10316 BoundingPoly *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingPoly,omitempty"` 10317 10318 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". 10319 // For more information, see 10320 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 10321 LanguageCode string `json:"languageCode,omitempty"` 10322 10323 // Mid: Object ID that should align with EntityAnnotation mid. 10324 Mid string `json:"mid,omitempty"` 10325 10326 // Name: Object name, expressed in its `language_code` language. 10327 Name string `json:"name,omitempty"` 10328 10329 // Score: Score of the result. Range [0, 1]. 10330 Score float64 `json:"score,omitempty"` 10331 10332 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 10333 // unconditionally include in API requests. By default, fields with 10334 // empty values are omitted from API requests. However, any non-pointer, 10335 // non-interface field appearing in ForceSendFields will be sent to the 10336 // server regardless of whether the field is empty or not. This may be 10337 // used to include empty fields in Patch requests. 10338 ForceSendFields []string `json:"-"` 10339 10340 // NullFields is a list of field names (e.g. "BoundingPoly") to include 10341 // in API requests with the JSON null value. By default, fields with 10342 // empty values are omitted from API requests. However, any field with 10343 // an empty value appearing in NullFields will be sent to the server as 10344 // null. It is an error if a field in this list has a non-empty value. 10345 // This may be used to include null fields in Patch requests. 10346 NullFields []string `json:"-"` 10347} 10348 10349func (s *GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation) MarshalJSON() ([]byte, error) { 10350 type NoMethod GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation 10351 raw := NoMethod(*s) 10352 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10353} 10354 10355func (s *GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation) UnmarshalJSON(data []byte) error { 10356 type NoMethod GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation 10357 var s1 struct { 10358 Score gensupport.JSONFloat64 `json:"score"` 10359 *NoMethod 10360 } 10361 s1.NoMethod = (*NoMethod)(s) 10362 if err := json.Unmarshal(data, &s1); err != nil { 10363 return err 10364 } 10365 s.Score = float64(s1.Score) 10366 return nil 10367} 10368 10369// GoogleCloudVisionV1p4beta1LocationInfo: Detected entity location 10370// information. 10371type GoogleCloudVisionV1p4beta1LocationInfo struct { 10372 // LatLng: lat/long location coordinates. 10373 LatLng *LatLng `json:"latLng,omitempty"` 10374 10375 // ForceSendFields is a list of field names (e.g. "LatLng") to 10376 // unconditionally include in API requests. By default, fields with 10377 // empty values are omitted from API requests. However, any non-pointer, 10378 // non-interface field appearing in ForceSendFields will be sent to the 10379 // server regardless of whether the field is empty or not. This may be 10380 // used to include empty fields in Patch requests. 10381 ForceSendFields []string `json:"-"` 10382 10383 // NullFields is a list of field names (e.g. "LatLng") to include in API 10384 // requests with the JSON null value. By default, fields with empty 10385 // values are omitted from API requests. However, any field with an 10386 // empty value appearing in NullFields will be sent to the server as 10387 // null. It is an error if a field in this list has a non-empty value. 10388 // This may be used to include null fields in Patch requests. 10389 NullFields []string `json:"-"` 10390} 10391 10392func (s *GoogleCloudVisionV1p4beta1LocationInfo) MarshalJSON() ([]byte, error) { 10393 type NoMethod GoogleCloudVisionV1p4beta1LocationInfo 10394 raw := NoMethod(*s) 10395 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10396} 10397 10398// GoogleCloudVisionV1p4beta1NormalizedVertex: A vertex represents a 2D 10399// point in the image. NOTE: the normalized vertex coordinates are 10400// relative to the original image and range from 0 to 1. 10401type GoogleCloudVisionV1p4beta1NormalizedVertex struct { 10402 // X: X coordinate. 10403 X float64 `json:"x,omitempty"` 10404 10405 // Y: Y coordinate. 10406 Y float64 `json:"y,omitempty"` 10407 10408 // ForceSendFields is a list of field names (e.g. "X") to 10409 // unconditionally include in API requests. By default, fields with 10410 // empty values are omitted from API requests. However, any non-pointer, 10411 // non-interface field appearing in ForceSendFields will be sent to the 10412 // server regardless of whether the field is empty or not. This may be 10413 // used to include empty fields in Patch requests. 10414 ForceSendFields []string `json:"-"` 10415 10416 // NullFields is a list of field names (e.g. "X") to include in API 10417 // requests with the JSON null value. By default, fields with empty 10418 // values are omitted from API requests. However, any field with an 10419 // empty value appearing in NullFields will be sent to the server as 10420 // null. It is an error if a field in this list has a non-empty value. 10421 // This may be used to include null fields in Patch requests. 10422 NullFields []string `json:"-"` 10423} 10424 10425func (s *GoogleCloudVisionV1p4beta1NormalizedVertex) MarshalJSON() ([]byte, error) { 10426 type NoMethod GoogleCloudVisionV1p4beta1NormalizedVertex 10427 raw := NoMethod(*s) 10428 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10429} 10430 10431func (s *GoogleCloudVisionV1p4beta1NormalizedVertex) UnmarshalJSON(data []byte) error { 10432 type NoMethod GoogleCloudVisionV1p4beta1NormalizedVertex 10433 var s1 struct { 10434 X gensupport.JSONFloat64 `json:"x"` 10435 Y gensupport.JSONFloat64 `json:"y"` 10436 *NoMethod 10437 } 10438 s1.NoMethod = (*NoMethod)(s) 10439 if err := json.Unmarshal(data, &s1); err != nil { 10440 return err 10441 } 10442 s.X = float64(s1.X) 10443 s.Y = float64(s1.Y) 10444 return nil 10445} 10446 10447// GoogleCloudVisionV1p4beta1OperationMetadata: Contains metadata for 10448// the BatchAnnotateImages operation. 10449type GoogleCloudVisionV1p4beta1OperationMetadata struct { 10450 // CreateTime: The time when the batch request was received. 10451 CreateTime string `json:"createTime,omitempty"` 10452 10453 // State: Current state of the batch operation. 10454 // 10455 // Possible values: 10456 // "STATE_UNSPECIFIED" - Invalid. 10457 // "CREATED" - Request is received. 10458 // "RUNNING" - Request is actively being processed. 10459 // "DONE" - The batch processing is done. 10460 // "CANCELLED" - The batch processing was cancelled. 10461 State string `json:"state,omitempty"` 10462 10463 // UpdateTime: The time when the operation result was last updated. 10464 UpdateTime string `json:"updateTime,omitempty"` 10465 10466 // ForceSendFields is a list of field names (e.g. "CreateTime") to 10467 // unconditionally include in API requests. By default, fields with 10468 // empty values are omitted from API requests. However, any non-pointer, 10469 // non-interface field appearing in ForceSendFields will be sent to the 10470 // server regardless of whether the field is empty or not. This may be 10471 // used to include empty fields in Patch requests. 10472 ForceSendFields []string `json:"-"` 10473 10474 // NullFields is a list of field names (e.g. "CreateTime") to include in 10475 // API requests with the JSON null value. By default, fields with empty 10476 // values are omitted from API requests. However, any field with an 10477 // empty value appearing in NullFields will be sent to the server as 10478 // null. It is an error if a field in this list has a non-empty value. 10479 // This may be used to include null fields in Patch requests. 10480 NullFields []string `json:"-"` 10481} 10482 10483func (s *GoogleCloudVisionV1p4beta1OperationMetadata) MarshalJSON() ([]byte, error) { 10484 type NoMethod GoogleCloudVisionV1p4beta1OperationMetadata 10485 raw := NoMethod(*s) 10486 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10487} 10488 10489// GoogleCloudVisionV1p4beta1OutputConfig: The desired output location 10490// and metadata. 10491type GoogleCloudVisionV1p4beta1OutputConfig struct { 10492 // BatchSize: The max number of response protos to put into each output 10493 // JSON file on Google Cloud Storage. The valid range is [1, 100]. If 10494 // not specified, the default value is 20. For example, for one pdf file 10495 // with 100 pages, 100 response protos will be generated. If 10496 // `batch_size` = 20, then 5 json files each containing 20 response 10497 // protos will be written under the prefix `gcs_destination`.`uri`. 10498 // Currently, batch_size only applies to GcsDestination, with potential 10499 // future support for other output configurations. 10500 BatchSize int64 `json:"batchSize,omitempty"` 10501 10502 // GcsDestination: The Google Cloud Storage location to write the 10503 // output(s) to. 10504 GcsDestination *GoogleCloudVisionV1p4beta1GcsDestination `json:"gcsDestination,omitempty"` 10505 10506 // ForceSendFields is a list of field names (e.g. "BatchSize") to 10507 // unconditionally include in API requests. By default, fields with 10508 // empty values are omitted from API requests. However, any non-pointer, 10509 // non-interface field appearing in ForceSendFields will be sent to the 10510 // server regardless of whether the field is empty or not. This may be 10511 // used to include empty fields in Patch requests. 10512 ForceSendFields []string `json:"-"` 10513 10514 // NullFields is a list of field names (e.g. "BatchSize") to include in 10515 // API requests with the JSON null value. By default, fields with empty 10516 // values are omitted from API requests. However, any field with an 10517 // empty value appearing in NullFields will be sent to the server as 10518 // null. It is an error if a field in this list has a non-empty value. 10519 // This may be used to include null fields in Patch requests. 10520 NullFields []string `json:"-"` 10521} 10522 10523func (s *GoogleCloudVisionV1p4beta1OutputConfig) MarshalJSON() ([]byte, error) { 10524 type NoMethod GoogleCloudVisionV1p4beta1OutputConfig 10525 raw := NoMethod(*s) 10526 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10527} 10528 10529// GoogleCloudVisionV1p4beta1Page: Detected page from OCR. 10530type GoogleCloudVisionV1p4beta1Page struct { 10531 // Blocks: List of blocks of text, images etc on this page. 10532 Blocks []*GoogleCloudVisionV1p4beta1Block `json:"blocks,omitempty"` 10533 10534 // Confidence: Confidence of the OCR results on the page. Range [0, 1]. 10535 Confidence float64 `json:"confidence,omitempty"` 10536 10537 // Height: Page height. For PDFs the unit is points. For images 10538 // (including TIFFs) the unit is pixels. 10539 Height int64 `json:"height,omitempty"` 10540 10541 // Property: Additional information detected on the page. 10542 Property *GoogleCloudVisionV1p4beta1TextAnnotationTextProperty `json:"property,omitempty"` 10543 10544 // Width: Page width. For PDFs the unit is points. For images (including 10545 // TIFFs) the unit is pixels. 10546 Width int64 `json:"width,omitempty"` 10547 10548 // ForceSendFields is a list of field names (e.g. "Blocks") to 10549 // unconditionally include in API requests. By default, fields with 10550 // empty values are omitted from API requests. However, any non-pointer, 10551 // non-interface field appearing in ForceSendFields will be sent to the 10552 // server regardless of whether the field is empty or not. This may be 10553 // used to include empty fields in Patch requests. 10554 ForceSendFields []string `json:"-"` 10555 10556 // NullFields is a list of field names (e.g. "Blocks") to include in API 10557 // requests with the JSON null value. By default, fields with empty 10558 // values are omitted from API requests. However, any field with an 10559 // empty value appearing in NullFields will be sent to the server as 10560 // null. It is an error if a field in this list has a non-empty value. 10561 // This may be used to include null fields in Patch requests. 10562 NullFields []string `json:"-"` 10563} 10564 10565func (s *GoogleCloudVisionV1p4beta1Page) MarshalJSON() ([]byte, error) { 10566 type NoMethod GoogleCloudVisionV1p4beta1Page 10567 raw := NoMethod(*s) 10568 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10569} 10570 10571func (s *GoogleCloudVisionV1p4beta1Page) UnmarshalJSON(data []byte) error { 10572 type NoMethod GoogleCloudVisionV1p4beta1Page 10573 var s1 struct { 10574 Confidence gensupport.JSONFloat64 `json:"confidence"` 10575 *NoMethod 10576 } 10577 s1.NoMethod = (*NoMethod)(s) 10578 if err := json.Unmarshal(data, &s1); err != nil { 10579 return err 10580 } 10581 s.Confidence = float64(s1.Confidence) 10582 return nil 10583} 10584 10585// GoogleCloudVisionV1p4beta1Paragraph: Structural unit of text 10586// representing a number of words in certain order. 10587type GoogleCloudVisionV1p4beta1Paragraph struct { 10588 // BoundingBox: The bounding box for the paragraph. The vertices are in 10589 // the order of top-left, top-right, bottom-right, bottom-left. When a 10590 // rotation of the bounding box is detected the rotation is represented 10591 // as around the top-left corner as defined when the text is read in the 10592 // 'natural' orientation. For example: * when the text is horizontal it 10593 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 10594 // around the top-left corner it becomes: 2----3 | | 1----0 and the 10595 // vertex order will still be (0, 1, 2, 3). 10596 BoundingBox *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingBox,omitempty"` 10597 10598 // Confidence: Confidence of the OCR results for the paragraph. Range 10599 // [0, 1]. 10600 Confidence float64 `json:"confidence,omitempty"` 10601 10602 // Property: Additional information detected for the paragraph. 10603 Property *GoogleCloudVisionV1p4beta1TextAnnotationTextProperty `json:"property,omitempty"` 10604 10605 // Words: List of all words in this paragraph. 10606 Words []*GoogleCloudVisionV1p4beta1Word `json:"words,omitempty"` 10607 10608 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 10609 // unconditionally include in API requests. By default, fields with 10610 // empty values are omitted from API requests. However, any non-pointer, 10611 // non-interface field appearing in ForceSendFields will be sent to the 10612 // server regardless of whether the field is empty or not. This may be 10613 // used to include empty fields in Patch requests. 10614 ForceSendFields []string `json:"-"` 10615 10616 // NullFields is a list of field names (e.g. "BoundingBox") to include 10617 // in API requests with the JSON null value. By default, fields with 10618 // empty values are omitted from API requests. However, any field with 10619 // an empty value appearing in NullFields will be sent to the server as 10620 // null. It is an error if a field in this list has a non-empty value. 10621 // This may be used to include null fields in Patch requests. 10622 NullFields []string `json:"-"` 10623} 10624 10625func (s *GoogleCloudVisionV1p4beta1Paragraph) MarshalJSON() ([]byte, error) { 10626 type NoMethod GoogleCloudVisionV1p4beta1Paragraph 10627 raw := NoMethod(*s) 10628 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10629} 10630 10631func (s *GoogleCloudVisionV1p4beta1Paragraph) UnmarshalJSON(data []byte) error { 10632 type NoMethod GoogleCloudVisionV1p4beta1Paragraph 10633 var s1 struct { 10634 Confidence gensupport.JSONFloat64 `json:"confidence"` 10635 *NoMethod 10636 } 10637 s1.NoMethod = (*NoMethod)(s) 10638 if err := json.Unmarshal(data, &s1); err != nil { 10639 return err 10640 } 10641 s.Confidence = float64(s1.Confidence) 10642 return nil 10643} 10644 10645// GoogleCloudVisionV1p4beta1Position: A 3D position in the image, used 10646// primarily for Face detection landmarks. A valid Position must have 10647// both x and y coordinates. The position coordinates are in the same 10648// scale as the original image. 10649type GoogleCloudVisionV1p4beta1Position struct { 10650 // X: X coordinate. 10651 X float64 `json:"x,omitempty"` 10652 10653 // Y: Y coordinate. 10654 Y float64 `json:"y,omitempty"` 10655 10656 // Z: Z coordinate (or depth). 10657 Z float64 `json:"z,omitempty"` 10658 10659 // ForceSendFields is a list of field names (e.g. "X") to 10660 // unconditionally include in API requests. By default, fields with 10661 // empty values are omitted from API requests. However, any non-pointer, 10662 // non-interface field appearing in ForceSendFields will be sent to the 10663 // server regardless of whether the field is empty or not. This may be 10664 // used to include empty fields in Patch requests. 10665 ForceSendFields []string `json:"-"` 10666 10667 // NullFields is a list of field names (e.g. "X") to include in API 10668 // requests with the JSON null value. By default, fields with empty 10669 // values are omitted from API requests. However, any field with an 10670 // empty value appearing in NullFields will be sent to the server as 10671 // null. It is an error if a field in this list has a non-empty value. 10672 // This may be used to include null fields in Patch requests. 10673 NullFields []string `json:"-"` 10674} 10675 10676func (s *GoogleCloudVisionV1p4beta1Position) MarshalJSON() ([]byte, error) { 10677 type NoMethod GoogleCloudVisionV1p4beta1Position 10678 raw := NoMethod(*s) 10679 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10680} 10681 10682func (s *GoogleCloudVisionV1p4beta1Position) UnmarshalJSON(data []byte) error { 10683 type NoMethod GoogleCloudVisionV1p4beta1Position 10684 var s1 struct { 10685 X gensupport.JSONFloat64 `json:"x"` 10686 Y gensupport.JSONFloat64 `json:"y"` 10687 Z gensupport.JSONFloat64 `json:"z"` 10688 *NoMethod 10689 } 10690 s1.NoMethod = (*NoMethod)(s) 10691 if err := json.Unmarshal(data, &s1); err != nil { 10692 return err 10693 } 10694 s.X = float64(s1.X) 10695 s.Y = float64(s1.Y) 10696 s.Z = float64(s1.Z) 10697 return nil 10698} 10699 10700// GoogleCloudVisionV1p4beta1Product: A Product contains 10701// ReferenceImages. 10702type GoogleCloudVisionV1p4beta1Product struct { 10703 // Description: User-provided metadata to be stored with this product. 10704 // Must be at most 4096 characters long. 10705 Description string `json:"description,omitempty"` 10706 10707 // DisplayName: The user-provided name for this Product. Must not be 10708 // empty. Must be at most 4096 characters long. 10709 DisplayName string `json:"displayName,omitempty"` 10710 10711 // Name: The resource name of the product. Format is: 10712 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This 10713 // field is ignored when creating a product. 10714 Name string `json:"name,omitempty"` 10715 10716 // ProductCategory: Immutable. The category for the product identified 10717 // by the reference image. This should be one of "homegoods-v2", 10718 // "apparel-v2", "toys-v2", "packagedgoods-v1" or "general-v1". The 10719 // legacy categories "homegoods", "apparel", and "toys" are still 10720 // supported, but these should not be used for new products. 10721 ProductCategory string `json:"productCategory,omitempty"` 10722 10723 // ProductLabels: Key-value pairs that can be attached to a product. At 10724 // query time, constraints can be specified based on the product_labels. 10725 // Note that integer values can be provided as strings, e.g. "1199". 10726 // Only strings with integer values can match a range-based restriction 10727 // which is to be supported soon. Multiple values can be assigned to the 10728 // same key. One product may have up to 500 product_labels. Notice that 10729 // the total number of distinct product_labels over all products in one 10730 // ProductSet cannot exceed 1M, otherwise the product search pipeline 10731 // will refuse to work for that ProductSet. 10732 ProductLabels []*GoogleCloudVisionV1p4beta1ProductKeyValue `json:"productLabels,omitempty"` 10733 10734 // ForceSendFields is a list of field names (e.g. "Description") to 10735 // unconditionally include in API requests. By default, fields with 10736 // empty values are omitted from API requests. However, any non-pointer, 10737 // non-interface field appearing in ForceSendFields will be sent to the 10738 // server regardless of whether the field is empty or not. This may be 10739 // used to include empty fields in Patch requests. 10740 ForceSendFields []string `json:"-"` 10741 10742 // NullFields is a list of field names (e.g. "Description") to include 10743 // in API requests with the JSON null value. By default, fields with 10744 // empty values are omitted from API requests. However, any field with 10745 // an empty value appearing in NullFields will be sent to the server as 10746 // null. It is an error if a field in this list has a non-empty value. 10747 // This may be used to include null fields in Patch requests. 10748 NullFields []string `json:"-"` 10749} 10750 10751func (s *GoogleCloudVisionV1p4beta1Product) MarshalJSON() ([]byte, error) { 10752 type NoMethod GoogleCloudVisionV1p4beta1Product 10753 raw := NoMethod(*s) 10754 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10755} 10756 10757// GoogleCloudVisionV1p4beta1ProductKeyValue: A product label 10758// represented as a key-value pair. 10759type GoogleCloudVisionV1p4beta1ProductKeyValue struct { 10760 // Key: The key of the label attached to the product. Cannot be empty 10761 // and cannot exceed 128 bytes. 10762 Key string `json:"key,omitempty"` 10763 10764 // Value: The value of the label attached to the product. Cannot be 10765 // empty and cannot exceed 128 bytes. 10766 Value string `json:"value,omitempty"` 10767 10768 // ForceSendFields is a list of field names (e.g. "Key") 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. "Key") 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 *GoogleCloudVisionV1p4beta1ProductKeyValue) MarshalJSON() ([]byte, error) { 10786 type NoMethod GoogleCloudVisionV1p4beta1ProductKeyValue 10787 raw := NoMethod(*s) 10788 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10789} 10790 10791// GoogleCloudVisionV1p4beta1ProductSearchResults: Results for a product 10792// search request. 10793type GoogleCloudVisionV1p4beta1ProductSearchResults struct { 10794 // IndexTime: Timestamp of the index which provided these results. 10795 // Products added to the product set and products removed from the 10796 // product set after this time are not reflected in the current results. 10797 IndexTime string `json:"indexTime,omitempty"` 10798 10799 // ProductGroupedResults: List of results grouped by products detected 10800 // in the query image. Each entry corresponds to one bounding polygon in 10801 // the query image, and contains the matching products specific to that 10802 // region. There may be duplicate product matches in the union of all 10803 // the per-product results. 10804 ProductGroupedResults []*GoogleCloudVisionV1p4beta1ProductSearchResultsGroupedResult `json:"productGroupedResults,omitempty"` 10805 10806 // Results: List of results, one for each product match. 10807 Results []*GoogleCloudVisionV1p4beta1ProductSearchResultsResult `json:"results,omitempty"` 10808 10809 // ForceSendFields is a list of field names (e.g. "IndexTime") to 10810 // unconditionally include in API requests. By default, fields with 10811 // empty values are omitted from API requests. However, any non-pointer, 10812 // non-interface field appearing in ForceSendFields will be sent to the 10813 // server regardless of whether the field is empty or not. This may be 10814 // used to include empty fields in Patch requests. 10815 ForceSendFields []string `json:"-"` 10816 10817 // NullFields is a list of field names (e.g. "IndexTime") to include in 10818 // API requests with the JSON null value. By default, fields with empty 10819 // values are omitted from API requests. However, any field with an 10820 // empty value appearing in NullFields will be sent to the server as 10821 // null. It is an error if a field in this list has a non-empty value. 10822 // This may be used to include null fields in Patch requests. 10823 NullFields []string `json:"-"` 10824} 10825 10826func (s *GoogleCloudVisionV1p4beta1ProductSearchResults) MarshalJSON() ([]byte, error) { 10827 type NoMethod GoogleCloudVisionV1p4beta1ProductSearchResults 10828 raw := NoMethod(*s) 10829 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10830} 10831 10832// GoogleCloudVisionV1p4beta1ProductSearchResultsGroupedResult: 10833// Information about the products similar to a single product in a query 10834// image. 10835type GoogleCloudVisionV1p4beta1ProductSearchResultsGroupedResult struct { 10836 // BoundingPoly: The bounding polygon around the product detected in the 10837 // query image. 10838 BoundingPoly *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingPoly,omitempty"` 10839 10840 // ObjectAnnotations: List of generic predictions for the object in the 10841 // bounding box. 10842 ObjectAnnotations []*GoogleCloudVisionV1p4beta1ProductSearchResultsObjectAnnotation `json:"objectAnnotations,omitempty"` 10843 10844 // Results: List of results, one for each product match. 10845 Results []*GoogleCloudVisionV1p4beta1ProductSearchResultsResult `json:"results,omitempty"` 10846 10847 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 10848 // unconditionally include in API requests. By default, fields with 10849 // empty values are omitted from API requests. However, any non-pointer, 10850 // non-interface field appearing in ForceSendFields will be sent to the 10851 // server regardless of whether the field is empty or not. This may be 10852 // used to include empty fields in Patch requests. 10853 ForceSendFields []string `json:"-"` 10854 10855 // NullFields is a list of field names (e.g. "BoundingPoly") to include 10856 // in API requests with the JSON null value. By default, fields with 10857 // empty values are omitted from API requests. However, any field with 10858 // an empty value appearing in NullFields will be sent to the server as 10859 // null. It is an error if a field in this list has a non-empty value. 10860 // This may be used to include null fields in Patch requests. 10861 NullFields []string `json:"-"` 10862} 10863 10864func (s *GoogleCloudVisionV1p4beta1ProductSearchResultsGroupedResult) MarshalJSON() ([]byte, error) { 10865 type NoMethod GoogleCloudVisionV1p4beta1ProductSearchResultsGroupedResult 10866 raw := NoMethod(*s) 10867 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10868} 10869 10870// GoogleCloudVisionV1p4beta1ProductSearchResultsObjectAnnotation: 10871// Prediction for what the object in the bounding box is. 10872type GoogleCloudVisionV1p4beta1ProductSearchResultsObjectAnnotation struct { 10873 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". 10874 // For more information, see 10875 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 10876 LanguageCode string `json:"languageCode,omitempty"` 10877 10878 // Mid: Object ID that should align with EntityAnnotation mid. 10879 Mid string `json:"mid,omitempty"` 10880 10881 // Name: Object name, expressed in its `language_code` language. 10882 Name string `json:"name,omitempty"` 10883 10884 // Score: Score of the result. Range [0, 1]. 10885 Score float64 `json:"score,omitempty"` 10886 10887 // ForceSendFields is a list of field names (e.g. "LanguageCode") to 10888 // unconditionally include in API requests. By default, fields with 10889 // empty values are omitted from API requests. However, any non-pointer, 10890 // non-interface field appearing in ForceSendFields will be sent to the 10891 // server regardless of whether the field is empty or not. This may be 10892 // used to include empty fields in Patch requests. 10893 ForceSendFields []string `json:"-"` 10894 10895 // NullFields is a list of field names (e.g. "LanguageCode") to include 10896 // in API requests with the JSON null value. By default, fields with 10897 // empty values are omitted from API requests. However, any field with 10898 // an empty value appearing in NullFields will be sent to the server as 10899 // null. It is an error if a field in this list has a non-empty value. 10900 // This may be used to include null fields in Patch requests. 10901 NullFields []string `json:"-"` 10902} 10903 10904func (s *GoogleCloudVisionV1p4beta1ProductSearchResultsObjectAnnotation) MarshalJSON() ([]byte, error) { 10905 type NoMethod GoogleCloudVisionV1p4beta1ProductSearchResultsObjectAnnotation 10906 raw := NoMethod(*s) 10907 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10908} 10909 10910func (s *GoogleCloudVisionV1p4beta1ProductSearchResultsObjectAnnotation) UnmarshalJSON(data []byte) error { 10911 type NoMethod GoogleCloudVisionV1p4beta1ProductSearchResultsObjectAnnotation 10912 var s1 struct { 10913 Score gensupport.JSONFloat64 `json:"score"` 10914 *NoMethod 10915 } 10916 s1.NoMethod = (*NoMethod)(s) 10917 if err := json.Unmarshal(data, &s1); err != nil { 10918 return err 10919 } 10920 s.Score = float64(s1.Score) 10921 return nil 10922} 10923 10924// GoogleCloudVisionV1p4beta1ProductSearchResultsResult: Information 10925// about a product. 10926type GoogleCloudVisionV1p4beta1ProductSearchResultsResult struct { 10927 // Image: The resource name of the image from the product that is the 10928 // closest match to the query. 10929 Image string `json:"image,omitempty"` 10930 10931 // Product: The Product. 10932 Product *GoogleCloudVisionV1p4beta1Product `json:"product,omitempty"` 10933 10934 // Score: A confidence level on the match, ranging from 0 (no 10935 // confidence) to 1 (full confidence). 10936 Score float64 `json:"score,omitempty"` 10937 10938 // ForceSendFields is a list of field names (e.g. "Image") to 10939 // unconditionally include in API requests. By default, fields with 10940 // empty values are omitted from API requests. However, any non-pointer, 10941 // non-interface field appearing in ForceSendFields will be sent to the 10942 // server regardless of whether the field is empty or not. This may be 10943 // used to include empty fields in Patch requests. 10944 ForceSendFields []string `json:"-"` 10945 10946 // NullFields is a list of field names (e.g. "Image") to include in API 10947 // requests with the JSON null value. By default, fields with empty 10948 // values are omitted from API requests. However, any field with an 10949 // empty value appearing in NullFields will be sent to the server as 10950 // null. It is an error if a field in this list has a non-empty value. 10951 // This may be used to include null fields in Patch requests. 10952 NullFields []string `json:"-"` 10953} 10954 10955func (s *GoogleCloudVisionV1p4beta1ProductSearchResultsResult) MarshalJSON() ([]byte, error) { 10956 type NoMethod GoogleCloudVisionV1p4beta1ProductSearchResultsResult 10957 raw := NoMethod(*s) 10958 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 10959} 10960 10961func (s *GoogleCloudVisionV1p4beta1ProductSearchResultsResult) UnmarshalJSON(data []byte) error { 10962 type NoMethod GoogleCloudVisionV1p4beta1ProductSearchResultsResult 10963 var s1 struct { 10964 Score gensupport.JSONFloat64 `json:"score"` 10965 *NoMethod 10966 } 10967 s1.NoMethod = (*NoMethod)(s) 10968 if err := json.Unmarshal(data, &s1); err != nil { 10969 return err 10970 } 10971 s.Score = float64(s1.Score) 10972 return nil 10973} 10974 10975// GoogleCloudVisionV1p4beta1Property: A `Property` consists of a 10976// user-supplied name/value pair. 10977type GoogleCloudVisionV1p4beta1Property struct { 10978 // Name: Name of the property. 10979 Name string `json:"name,omitempty"` 10980 10981 // Uint64Value: Value of numeric properties. 10982 Uint64Value uint64 `json:"uint64Value,omitempty,string"` 10983 10984 // Value: Value of the property. 10985 Value string `json:"value,omitempty"` 10986 10987 // ForceSendFields is a list of field names (e.g. "Name") to 10988 // unconditionally include in API requests. By default, fields with 10989 // empty values are omitted from API requests. However, any non-pointer, 10990 // non-interface field appearing in ForceSendFields will be sent to the 10991 // server regardless of whether the field is empty or not. This may be 10992 // used to include empty fields in Patch requests. 10993 ForceSendFields []string `json:"-"` 10994 10995 // NullFields is a list of field names (e.g. "Name") to include in API 10996 // requests with the JSON null value. By default, fields with empty 10997 // values are omitted from API requests. However, any field with an 10998 // empty value appearing in NullFields will be sent to the server as 10999 // null. It is an error if a field in this list has a non-empty value. 11000 // This may be used to include null fields in Patch requests. 11001 NullFields []string `json:"-"` 11002} 11003 11004func (s *GoogleCloudVisionV1p4beta1Property) MarshalJSON() ([]byte, error) { 11005 type NoMethod GoogleCloudVisionV1p4beta1Property 11006 raw := NoMethod(*s) 11007 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11008} 11009 11010// GoogleCloudVisionV1p4beta1ReferenceImage: A `ReferenceImage` 11011// represents a product image and its associated metadata, such as 11012// bounding boxes. 11013type GoogleCloudVisionV1p4beta1ReferenceImage struct { 11014 // BoundingPolys: Optional. Bounding polygons around the areas of 11015 // interest in the reference image. If this field is empty, the system 11016 // will try to detect regions of interest. At most 10 bounding polygons 11017 // will be used. The provided shape is converted into a non-rotated 11018 // rectangle. Once converted, the small edge of the rectangle must be 11019 // greater than or equal to 300 pixels. The aspect ratio must be 1:4 or 11020 // less (i.e. 1:3 is ok; 1:5 is not). 11021 BoundingPolys []*GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingPolys,omitempty"` 11022 11023 // Name: The resource name of the reference image. Format is: 11024 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceIma 11025 // ges/IMAGE_ID`. This field is ignored when creating a reference image. 11026 Name string `json:"name,omitempty"` 11027 11028 // Uri: Required. The Google Cloud Storage URI of the reference image. 11029 // The URI must start with `gs://`. 11030 Uri string `json:"uri,omitempty"` 11031 11032 // ForceSendFields is a list of field names (e.g. "BoundingPolys") to 11033 // unconditionally include in API requests. By default, fields with 11034 // empty values are omitted from API requests. However, any non-pointer, 11035 // non-interface field appearing in ForceSendFields will be sent to the 11036 // server regardless of whether the field is empty or not. This may be 11037 // used to include empty fields in Patch requests. 11038 ForceSendFields []string `json:"-"` 11039 11040 // NullFields is a list of field names (e.g. "BoundingPolys") to include 11041 // in API requests with the JSON null value. By default, fields with 11042 // empty values are omitted from API requests. However, any field with 11043 // an empty value appearing in NullFields will be sent to the server as 11044 // null. It is an error if a field in this list has a non-empty value. 11045 // This may be used to include null fields in Patch requests. 11046 NullFields []string `json:"-"` 11047} 11048 11049func (s *GoogleCloudVisionV1p4beta1ReferenceImage) MarshalJSON() ([]byte, error) { 11050 type NoMethod GoogleCloudVisionV1p4beta1ReferenceImage 11051 raw := NoMethod(*s) 11052 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11053} 11054 11055// GoogleCloudVisionV1p4beta1SafeSearchAnnotation: Set of features 11056// pertaining to the image, computed by computer vision methods over 11057// safe-search verticals (for example, adult, spoof, medical, violence). 11058type GoogleCloudVisionV1p4beta1SafeSearchAnnotation struct { 11059 // Adult: Represents the adult content likelihood for the image. Adult 11060 // content may contain elements such as nudity, pornographic images or 11061 // cartoons, or sexual activities. 11062 // 11063 // Possible values: 11064 // "UNKNOWN" - Unknown likelihood. 11065 // "VERY_UNLIKELY" - It is very unlikely. 11066 // "UNLIKELY" - It is unlikely. 11067 // "POSSIBLE" - It is possible. 11068 // "LIKELY" - It is likely. 11069 // "VERY_LIKELY" - It is very likely. 11070 Adult string `json:"adult,omitempty"` 11071 11072 // Medical: Likelihood that this is a medical image. 11073 // 11074 // Possible values: 11075 // "UNKNOWN" - Unknown likelihood. 11076 // "VERY_UNLIKELY" - It is very unlikely. 11077 // "UNLIKELY" - It is unlikely. 11078 // "POSSIBLE" - It is possible. 11079 // "LIKELY" - It is likely. 11080 // "VERY_LIKELY" - It is very likely. 11081 Medical string `json:"medical,omitempty"` 11082 11083 // Racy: Likelihood that the request image contains racy content. Racy 11084 // content may include (but is not limited to) skimpy or sheer clothing, 11085 // strategically covered nudity, lewd or provocative poses, or close-ups 11086 // of sensitive body areas. 11087 // 11088 // Possible values: 11089 // "UNKNOWN" - Unknown likelihood. 11090 // "VERY_UNLIKELY" - It is very unlikely. 11091 // "UNLIKELY" - It is unlikely. 11092 // "POSSIBLE" - It is possible. 11093 // "LIKELY" - It is likely. 11094 // "VERY_LIKELY" - It is very likely. 11095 Racy string `json:"racy,omitempty"` 11096 11097 // Spoof: Spoof likelihood. The likelihood that an modification was made 11098 // to the image's canonical version to make it appear funny or 11099 // offensive. 11100 // 11101 // Possible values: 11102 // "UNKNOWN" - Unknown likelihood. 11103 // "VERY_UNLIKELY" - It is very unlikely. 11104 // "UNLIKELY" - It is unlikely. 11105 // "POSSIBLE" - It is possible. 11106 // "LIKELY" - It is likely. 11107 // "VERY_LIKELY" - It is very likely. 11108 Spoof string `json:"spoof,omitempty"` 11109 11110 // Violence: Likelihood that this image contains violent content. 11111 // 11112 // Possible values: 11113 // "UNKNOWN" - Unknown likelihood. 11114 // "VERY_UNLIKELY" - It is very unlikely. 11115 // "UNLIKELY" - It is unlikely. 11116 // "POSSIBLE" - It is possible. 11117 // "LIKELY" - It is likely. 11118 // "VERY_LIKELY" - It is very likely. 11119 Violence string `json:"violence,omitempty"` 11120 11121 // ForceSendFields is a list of field names (e.g. "Adult") to 11122 // unconditionally include in API requests. By default, fields with 11123 // empty values are omitted from API requests. However, any non-pointer, 11124 // non-interface field appearing in ForceSendFields will be sent to the 11125 // server regardless of whether the field is empty or not. This may be 11126 // used to include empty fields in Patch requests. 11127 ForceSendFields []string `json:"-"` 11128 11129 // NullFields is a list of field names (e.g. "Adult") to include in API 11130 // requests with the JSON null value. By default, fields with empty 11131 // values are omitted from API requests. However, any field with an 11132 // empty value appearing in NullFields will be sent to the server as 11133 // null. It is an error if a field in this list has a non-empty value. 11134 // This may be used to include null fields in Patch requests. 11135 NullFields []string `json:"-"` 11136} 11137 11138func (s *GoogleCloudVisionV1p4beta1SafeSearchAnnotation) MarshalJSON() ([]byte, error) { 11139 type NoMethod GoogleCloudVisionV1p4beta1SafeSearchAnnotation 11140 raw := NoMethod(*s) 11141 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11142} 11143 11144// GoogleCloudVisionV1p4beta1Symbol: A single symbol representation. 11145type GoogleCloudVisionV1p4beta1Symbol struct { 11146 // BoundingBox: The bounding box for the symbol. The vertices are in the 11147 // order of top-left, top-right, bottom-right, bottom-left. When a 11148 // rotation of the bounding box is detected the rotation is represented 11149 // as around the top-left corner as defined when the text is read in the 11150 // 'natural' orientation. For example: * when the text is horizontal it 11151 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 11152 // around the top-left corner it becomes: 2----3 | | 1----0 and the 11153 // vertex order will still be (0, 1, 2, 3). 11154 BoundingBox *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingBox,omitempty"` 11155 11156 // Confidence: Confidence of the OCR results for the symbol. Range [0, 11157 // 1]. 11158 Confidence float64 `json:"confidence,omitempty"` 11159 11160 // Property: Additional information detected for the symbol. 11161 Property *GoogleCloudVisionV1p4beta1TextAnnotationTextProperty `json:"property,omitempty"` 11162 11163 // Text: The actual UTF-8 representation of the symbol. 11164 Text string `json:"text,omitempty"` 11165 11166 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 11167 // unconditionally include in API requests. By default, fields with 11168 // empty values are omitted from API requests. However, any non-pointer, 11169 // non-interface field appearing in ForceSendFields will be sent to the 11170 // server regardless of whether the field is empty or not. This may be 11171 // used to include empty fields in Patch requests. 11172 ForceSendFields []string `json:"-"` 11173 11174 // NullFields is a list of field names (e.g. "BoundingBox") to include 11175 // in API requests with the JSON null value. By default, fields with 11176 // empty values are omitted from API requests. However, any field with 11177 // an empty value appearing in NullFields will be sent to the server as 11178 // null. It is an error if a field in this list has a non-empty value. 11179 // This may be used to include null fields in Patch requests. 11180 NullFields []string `json:"-"` 11181} 11182 11183func (s *GoogleCloudVisionV1p4beta1Symbol) MarshalJSON() ([]byte, error) { 11184 type NoMethod GoogleCloudVisionV1p4beta1Symbol 11185 raw := NoMethod(*s) 11186 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11187} 11188 11189func (s *GoogleCloudVisionV1p4beta1Symbol) UnmarshalJSON(data []byte) error { 11190 type NoMethod GoogleCloudVisionV1p4beta1Symbol 11191 var s1 struct { 11192 Confidence gensupport.JSONFloat64 `json:"confidence"` 11193 *NoMethod 11194 } 11195 s1.NoMethod = (*NoMethod)(s) 11196 if err := json.Unmarshal(data, &s1); err != nil { 11197 return err 11198 } 11199 s.Confidence = float64(s1.Confidence) 11200 return nil 11201} 11202 11203// GoogleCloudVisionV1p4beta1TextAnnotation: TextAnnotation contains a 11204// structured representation of OCR extracted text. The hierarchy of an 11205// OCR extracted text structure is like this: TextAnnotation -> Page -> 11206// Block -> Paragraph -> Word -> Symbol Each structural component, 11207// starting from Page, may further have their own properties. Properties 11208// describe detected languages, breaks etc.. Please refer to the 11209// TextAnnotation.TextProperty message definition below for more detail. 11210type GoogleCloudVisionV1p4beta1TextAnnotation struct { 11211 // Pages: List of pages detected by OCR. 11212 Pages []*GoogleCloudVisionV1p4beta1Page `json:"pages,omitempty"` 11213 11214 // Text: UTF-8 text detected on the pages. 11215 Text string `json:"text,omitempty"` 11216 11217 // ForceSendFields is a list of field names (e.g. "Pages") to 11218 // unconditionally include in API requests. By default, fields with 11219 // empty values are omitted from API requests. However, any non-pointer, 11220 // non-interface field appearing in ForceSendFields will be sent to the 11221 // server regardless of whether the field is empty or not. This may be 11222 // used to include empty fields in Patch requests. 11223 ForceSendFields []string `json:"-"` 11224 11225 // NullFields is a list of field names (e.g. "Pages") to include in API 11226 // requests with the JSON null value. By default, fields with empty 11227 // values are omitted from API requests. However, any field with an 11228 // empty value appearing in NullFields will be sent to the server as 11229 // null. It is an error if a field in this list has a non-empty value. 11230 // This may be used to include null fields in Patch requests. 11231 NullFields []string `json:"-"` 11232} 11233 11234func (s *GoogleCloudVisionV1p4beta1TextAnnotation) MarshalJSON() ([]byte, error) { 11235 type NoMethod GoogleCloudVisionV1p4beta1TextAnnotation 11236 raw := NoMethod(*s) 11237 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11238} 11239 11240// GoogleCloudVisionV1p4beta1TextAnnotationDetectedBreak: Detected start 11241// or end of a structural component. 11242type GoogleCloudVisionV1p4beta1TextAnnotationDetectedBreak struct { 11243 // IsPrefix: True if break prepends the element. 11244 IsPrefix bool `json:"isPrefix,omitempty"` 11245 11246 // Type: Detected break type. 11247 // 11248 // Possible values: 11249 // "UNKNOWN" - Unknown break label type. 11250 // "SPACE" - Regular space. 11251 // "SURE_SPACE" - Sure space (very wide). 11252 // "EOL_SURE_SPACE" - Line-wrapping break. 11253 // "HYPHEN" - End-line hyphen that is not present in text; does not 11254 // co-occur with `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. 11255 // "LINE_BREAK" - Line break that ends a paragraph. 11256 Type string `json:"type,omitempty"` 11257 11258 // ForceSendFields is a list of field names (e.g. "IsPrefix") to 11259 // unconditionally include in API requests. By default, fields with 11260 // empty values are omitted from API requests. However, any non-pointer, 11261 // non-interface field appearing in ForceSendFields will be sent to the 11262 // server regardless of whether the field is empty or not. This may be 11263 // used to include empty fields in Patch requests. 11264 ForceSendFields []string `json:"-"` 11265 11266 // NullFields is a list of field names (e.g. "IsPrefix") to include in 11267 // API requests with the JSON null value. By default, fields with empty 11268 // values are omitted from API requests. However, any field with an 11269 // empty value appearing in NullFields will be sent to the server as 11270 // null. It is an error if a field in this list has a non-empty value. 11271 // This may be used to include null fields in Patch requests. 11272 NullFields []string `json:"-"` 11273} 11274 11275func (s *GoogleCloudVisionV1p4beta1TextAnnotationDetectedBreak) MarshalJSON() ([]byte, error) { 11276 type NoMethod GoogleCloudVisionV1p4beta1TextAnnotationDetectedBreak 11277 raw := NoMethod(*s) 11278 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11279} 11280 11281// GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage: Detected 11282// language for a structural component. 11283type GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage struct { 11284 // Confidence: Confidence of detected language. Range [0, 1]. 11285 Confidence float64 `json:"confidence,omitempty"` 11286 11287 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". 11288 // For more information, see 11289 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 11290 LanguageCode string `json:"languageCode,omitempty"` 11291 11292 // ForceSendFields is a list of field names (e.g. "Confidence") to 11293 // unconditionally include in API requests. By default, fields with 11294 // empty values are omitted from API requests. However, any non-pointer, 11295 // non-interface field appearing in ForceSendFields will be sent to the 11296 // server regardless of whether the field is empty or not. This may be 11297 // used to include empty fields in Patch requests. 11298 ForceSendFields []string `json:"-"` 11299 11300 // NullFields is a list of field names (e.g. "Confidence") to include in 11301 // API requests with the JSON null value. By default, fields with empty 11302 // values are omitted from API requests. However, any field with an 11303 // empty value appearing in NullFields will be sent to the server as 11304 // null. It is an error if a field in this list has a non-empty value. 11305 // This may be used to include null fields in Patch requests. 11306 NullFields []string `json:"-"` 11307} 11308 11309func (s *GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage) MarshalJSON() ([]byte, error) { 11310 type NoMethod GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage 11311 raw := NoMethod(*s) 11312 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11313} 11314 11315func (s *GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage) UnmarshalJSON(data []byte) error { 11316 type NoMethod GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage 11317 var s1 struct { 11318 Confidence gensupport.JSONFloat64 `json:"confidence"` 11319 *NoMethod 11320 } 11321 s1.NoMethod = (*NoMethod)(s) 11322 if err := json.Unmarshal(data, &s1); err != nil { 11323 return err 11324 } 11325 s.Confidence = float64(s1.Confidence) 11326 return nil 11327} 11328 11329// GoogleCloudVisionV1p4beta1TextAnnotationTextProperty: Additional 11330// information detected on the structural component. 11331type GoogleCloudVisionV1p4beta1TextAnnotationTextProperty struct { 11332 // DetectedBreak: Detected start or end of a text segment. 11333 DetectedBreak *GoogleCloudVisionV1p4beta1TextAnnotationDetectedBreak `json:"detectedBreak,omitempty"` 11334 11335 // DetectedLanguages: A list of detected languages together with 11336 // confidence. 11337 DetectedLanguages []*GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage `json:"detectedLanguages,omitempty"` 11338 11339 // ForceSendFields is a list of field names (e.g. "DetectedBreak") to 11340 // unconditionally include in API requests. By default, fields with 11341 // empty values are omitted from API requests. However, any non-pointer, 11342 // non-interface field appearing in ForceSendFields will be sent to the 11343 // server regardless of whether the field is empty or not. This may be 11344 // used to include empty fields in Patch requests. 11345 ForceSendFields []string `json:"-"` 11346 11347 // NullFields is a list of field names (e.g. "DetectedBreak") to include 11348 // in API requests with the JSON null value. By default, fields with 11349 // empty values are omitted from API requests. However, any field with 11350 // an empty value appearing in NullFields will be sent to the server as 11351 // null. It is an error if a field in this list has a non-empty value. 11352 // This may be used to include null fields in Patch requests. 11353 NullFields []string `json:"-"` 11354} 11355 11356func (s *GoogleCloudVisionV1p4beta1TextAnnotationTextProperty) MarshalJSON() ([]byte, error) { 11357 type NoMethod GoogleCloudVisionV1p4beta1TextAnnotationTextProperty 11358 raw := NoMethod(*s) 11359 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11360} 11361 11362// GoogleCloudVisionV1p4beta1Vertex: A vertex represents a 2D point in 11363// the image. NOTE: the vertex coordinates are in the same scale as the 11364// original image. 11365type GoogleCloudVisionV1p4beta1Vertex struct { 11366 // X: X coordinate. 11367 X int64 `json:"x,omitempty"` 11368 11369 // Y: Y coordinate. 11370 Y int64 `json:"y,omitempty"` 11371 11372 // ForceSendFields is a list of field names (e.g. "X") to 11373 // unconditionally include in API requests. By default, fields with 11374 // empty values are omitted from API requests. However, any non-pointer, 11375 // non-interface field appearing in ForceSendFields will be sent to the 11376 // server regardless of whether the field is empty or not. This may be 11377 // used to include empty fields in Patch requests. 11378 ForceSendFields []string `json:"-"` 11379 11380 // NullFields is a list of field names (e.g. "X") to include in API 11381 // requests with the JSON null value. By default, fields with empty 11382 // values are omitted from API requests. However, any field with an 11383 // empty value appearing in NullFields will be sent to the server as 11384 // null. It is an error if a field in this list has a non-empty value. 11385 // This may be used to include null fields in Patch requests. 11386 NullFields []string `json:"-"` 11387} 11388 11389func (s *GoogleCloudVisionV1p4beta1Vertex) MarshalJSON() ([]byte, error) { 11390 type NoMethod GoogleCloudVisionV1p4beta1Vertex 11391 raw := NoMethod(*s) 11392 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11393} 11394 11395// GoogleCloudVisionV1p4beta1WebDetection: Relevant information for the 11396// image from the Internet. 11397type GoogleCloudVisionV1p4beta1WebDetection struct { 11398 // BestGuessLabels: The service's best guess as to the topic of the 11399 // request image. Inferred from similar images on the open web. 11400 BestGuessLabels []*GoogleCloudVisionV1p4beta1WebDetectionWebLabel `json:"bestGuessLabels,omitempty"` 11401 11402 // FullMatchingImages: Fully matching images from the Internet. Can 11403 // include resized copies of the query image. 11404 FullMatchingImages []*GoogleCloudVisionV1p4beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"` 11405 11406 // PagesWithMatchingImages: Web pages containing the matching images 11407 // from the Internet. 11408 PagesWithMatchingImages []*GoogleCloudVisionV1p4beta1WebDetectionWebPage `json:"pagesWithMatchingImages,omitempty"` 11409 11410 // PartialMatchingImages: Partial matching images from the Internet. 11411 // Those images are similar enough to share some key-point features. For 11412 // example an original image will likely have partial matching for its 11413 // crops. 11414 PartialMatchingImages []*GoogleCloudVisionV1p4beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"` 11415 11416 // VisuallySimilarImages: The visually similar image results. 11417 VisuallySimilarImages []*GoogleCloudVisionV1p4beta1WebDetectionWebImage `json:"visuallySimilarImages,omitempty"` 11418 11419 // WebEntities: Deduced entities from similar images on the Internet. 11420 WebEntities []*GoogleCloudVisionV1p4beta1WebDetectionWebEntity `json:"webEntities,omitempty"` 11421 11422 // ForceSendFields is a list of field names (e.g. "BestGuessLabels") to 11423 // unconditionally include in API requests. By default, fields with 11424 // empty values are omitted from API requests. However, any non-pointer, 11425 // non-interface field appearing in ForceSendFields will be sent to the 11426 // server regardless of whether the field is empty or not. This may be 11427 // used to include empty fields in Patch requests. 11428 ForceSendFields []string `json:"-"` 11429 11430 // NullFields is a list of field names (e.g. "BestGuessLabels") to 11431 // include in API requests with the JSON null value. By default, fields 11432 // with empty values are omitted from API requests. However, any field 11433 // with an empty value appearing in NullFields will be sent to the 11434 // server as null. It is an error if a field in this list has a 11435 // non-empty value. This may be used to include null fields in Patch 11436 // requests. 11437 NullFields []string `json:"-"` 11438} 11439 11440func (s *GoogleCloudVisionV1p4beta1WebDetection) MarshalJSON() ([]byte, error) { 11441 type NoMethod GoogleCloudVisionV1p4beta1WebDetection 11442 raw := NoMethod(*s) 11443 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11444} 11445 11446// GoogleCloudVisionV1p4beta1WebDetectionWebEntity: Entity deduced from 11447// similar images on the Internet. 11448type GoogleCloudVisionV1p4beta1WebDetectionWebEntity struct { 11449 // Description: Canonical description of the entity, in English. 11450 Description string `json:"description,omitempty"` 11451 11452 // EntityId: Opaque entity ID. 11453 EntityId string `json:"entityId,omitempty"` 11454 11455 // Score: Overall relevancy score for the entity. Not normalized and not 11456 // comparable across different image queries. 11457 Score float64 `json:"score,omitempty"` 11458 11459 // ForceSendFields is a list of field names (e.g. "Description") to 11460 // unconditionally include in API requests. By default, fields with 11461 // empty values are omitted from API requests. However, any non-pointer, 11462 // non-interface field appearing in ForceSendFields will be sent to the 11463 // server regardless of whether the field is empty or not. This may be 11464 // used to include empty fields in Patch requests. 11465 ForceSendFields []string `json:"-"` 11466 11467 // NullFields is a list of field names (e.g. "Description") to include 11468 // in API requests with the JSON null value. By default, fields with 11469 // empty values are omitted from API requests. However, any field with 11470 // an empty value appearing in NullFields will be sent to the server as 11471 // null. It is an error if a field in this list has a non-empty value. 11472 // This may be used to include null fields in Patch requests. 11473 NullFields []string `json:"-"` 11474} 11475 11476func (s *GoogleCloudVisionV1p4beta1WebDetectionWebEntity) MarshalJSON() ([]byte, error) { 11477 type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebEntity 11478 raw := NoMethod(*s) 11479 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11480} 11481 11482func (s *GoogleCloudVisionV1p4beta1WebDetectionWebEntity) UnmarshalJSON(data []byte) error { 11483 type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebEntity 11484 var s1 struct { 11485 Score gensupport.JSONFloat64 `json:"score"` 11486 *NoMethod 11487 } 11488 s1.NoMethod = (*NoMethod)(s) 11489 if err := json.Unmarshal(data, &s1); err != nil { 11490 return err 11491 } 11492 s.Score = float64(s1.Score) 11493 return nil 11494} 11495 11496// GoogleCloudVisionV1p4beta1WebDetectionWebImage: Metadata for online 11497// images. 11498type GoogleCloudVisionV1p4beta1WebDetectionWebImage struct { 11499 // Score: (Deprecated) Overall relevancy score for the image. 11500 Score float64 `json:"score,omitempty"` 11501 11502 // Url: The result image URL. 11503 Url string `json:"url,omitempty"` 11504 11505 // ForceSendFields is a list of field names (e.g. "Score") to 11506 // unconditionally include in API requests. By default, fields with 11507 // empty values are omitted from API requests. However, any non-pointer, 11508 // non-interface field appearing in ForceSendFields will be sent to the 11509 // server regardless of whether the field is empty or not. This may be 11510 // used to include empty fields in Patch requests. 11511 ForceSendFields []string `json:"-"` 11512 11513 // NullFields is a list of field names (e.g. "Score") to include in API 11514 // requests with the JSON null value. By default, fields with empty 11515 // values are omitted from API requests. However, any field with an 11516 // empty value appearing in NullFields will be sent to the server as 11517 // null. It is an error if a field in this list has a non-empty value. 11518 // This may be used to include null fields in Patch requests. 11519 NullFields []string `json:"-"` 11520} 11521 11522func (s *GoogleCloudVisionV1p4beta1WebDetectionWebImage) MarshalJSON() ([]byte, error) { 11523 type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebImage 11524 raw := NoMethod(*s) 11525 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11526} 11527 11528func (s *GoogleCloudVisionV1p4beta1WebDetectionWebImage) UnmarshalJSON(data []byte) error { 11529 type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebImage 11530 var s1 struct { 11531 Score gensupport.JSONFloat64 `json:"score"` 11532 *NoMethod 11533 } 11534 s1.NoMethod = (*NoMethod)(s) 11535 if err := json.Unmarshal(data, &s1); err != nil { 11536 return err 11537 } 11538 s.Score = float64(s1.Score) 11539 return nil 11540} 11541 11542// GoogleCloudVisionV1p4beta1WebDetectionWebLabel: Label to provide 11543// extra metadata for the web detection. 11544type GoogleCloudVisionV1p4beta1WebDetectionWebLabel struct { 11545 // Label: Label for extra metadata. 11546 Label string `json:"label,omitempty"` 11547 11548 // LanguageCode: The BCP-47 language code for `label`, such as "en-US" 11549 // or "sr-Latn". For more information, see 11550 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 11551 LanguageCode string `json:"languageCode,omitempty"` 11552 11553 // ForceSendFields is a list of field names (e.g. "Label") to 11554 // unconditionally include in API requests. By default, fields with 11555 // empty values are omitted from API requests. However, any non-pointer, 11556 // non-interface field appearing in ForceSendFields will be sent to the 11557 // server regardless of whether the field is empty or not. This may be 11558 // used to include empty fields in Patch requests. 11559 ForceSendFields []string `json:"-"` 11560 11561 // NullFields is a list of field names (e.g. "Label") to include in API 11562 // requests with the JSON null value. By default, fields with empty 11563 // values are omitted from API requests. However, any field with an 11564 // empty value appearing in NullFields will be sent to the server as 11565 // null. It is an error if a field in this list has a non-empty value. 11566 // This may be used to include null fields in Patch requests. 11567 NullFields []string `json:"-"` 11568} 11569 11570func (s *GoogleCloudVisionV1p4beta1WebDetectionWebLabel) MarshalJSON() ([]byte, error) { 11571 type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebLabel 11572 raw := NoMethod(*s) 11573 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11574} 11575 11576// GoogleCloudVisionV1p4beta1WebDetectionWebPage: Metadata for web 11577// pages. 11578type GoogleCloudVisionV1p4beta1WebDetectionWebPage struct { 11579 // FullMatchingImages: Fully matching images on the page. Can include 11580 // resized copies of the query image. 11581 FullMatchingImages []*GoogleCloudVisionV1p4beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"` 11582 11583 // PageTitle: Title for the web page, may contain HTML markups. 11584 PageTitle string `json:"pageTitle,omitempty"` 11585 11586 // PartialMatchingImages: Partial matching images on the page. Those 11587 // images are similar enough to share some key-point features. For 11588 // example an original image will likely have partial matching for its 11589 // crops. 11590 PartialMatchingImages []*GoogleCloudVisionV1p4beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"` 11591 11592 // Score: (Deprecated) Overall relevancy score for the web page. 11593 Score float64 `json:"score,omitempty"` 11594 11595 // Url: The result web page URL. 11596 Url string `json:"url,omitempty"` 11597 11598 // ForceSendFields is a list of field names (e.g. "FullMatchingImages") 11599 // to unconditionally include in API requests. By default, fields with 11600 // empty values are omitted from API requests. However, any non-pointer, 11601 // non-interface field appearing in ForceSendFields will be sent to the 11602 // server regardless of whether the field is empty or not. This may be 11603 // used to include empty fields in Patch requests. 11604 ForceSendFields []string `json:"-"` 11605 11606 // NullFields is a list of field names (e.g. "FullMatchingImages") to 11607 // include in API requests with the JSON null value. By default, fields 11608 // with empty values are omitted from API requests. However, any field 11609 // with an empty value appearing in NullFields will be sent to the 11610 // server as null. It is an error if a field in this list has a 11611 // non-empty value. This may be used to include null fields in Patch 11612 // requests. 11613 NullFields []string `json:"-"` 11614} 11615 11616func (s *GoogleCloudVisionV1p4beta1WebDetectionWebPage) MarshalJSON() ([]byte, error) { 11617 type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebPage 11618 raw := NoMethod(*s) 11619 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11620} 11621 11622func (s *GoogleCloudVisionV1p4beta1WebDetectionWebPage) UnmarshalJSON(data []byte) error { 11623 type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebPage 11624 var s1 struct { 11625 Score gensupport.JSONFloat64 `json:"score"` 11626 *NoMethod 11627 } 11628 s1.NoMethod = (*NoMethod)(s) 11629 if err := json.Unmarshal(data, &s1); err != nil { 11630 return err 11631 } 11632 s.Score = float64(s1.Score) 11633 return nil 11634} 11635 11636// GoogleCloudVisionV1p4beta1Word: A word representation. 11637type GoogleCloudVisionV1p4beta1Word struct { 11638 // BoundingBox: The bounding box for the word. The vertices are in the 11639 // order of top-left, top-right, bottom-right, bottom-left. When a 11640 // rotation of the bounding box is detected the rotation is represented 11641 // as around the top-left corner as defined when the text is read in the 11642 // 'natural' orientation. For example: * when the text is horizontal it 11643 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 11644 // around the top-left corner it becomes: 2----3 | | 1----0 and the 11645 // vertex order will still be (0, 1, 2, 3). 11646 BoundingBox *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingBox,omitempty"` 11647 11648 // Confidence: Confidence of the OCR results for the word. Range [0, 1]. 11649 Confidence float64 `json:"confidence,omitempty"` 11650 11651 // Property: Additional information detected for the word. 11652 Property *GoogleCloudVisionV1p4beta1TextAnnotationTextProperty `json:"property,omitempty"` 11653 11654 // Symbols: List of symbols in the word. The order of the symbols 11655 // follows the natural reading order. 11656 Symbols []*GoogleCloudVisionV1p4beta1Symbol `json:"symbols,omitempty"` 11657 11658 // ForceSendFields is a list of field names (e.g. "BoundingBox") 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. "BoundingBox") to include 11667 // in API requests with the JSON null value. By default, fields with 11668 // empty values are omitted from API requests. However, any field with 11669 // an empty value appearing in NullFields will be sent to the server as 11670 // null. It is an error if a field in this list has a non-empty value. 11671 // This may be used to include null fields in Patch requests. 11672 NullFields []string `json:"-"` 11673} 11674 11675func (s *GoogleCloudVisionV1p4beta1Word) MarshalJSON() ([]byte, error) { 11676 type NoMethod GoogleCloudVisionV1p4beta1Word 11677 raw := NoMethod(*s) 11678 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11679} 11680 11681func (s *GoogleCloudVisionV1p4beta1Word) UnmarshalJSON(data []byte) error { 11682 type NoMethod GoogleCloudVisionV1p4beta1Word 11683 var s1 struct { 11684 Confidence gensupport.JSONFloat64 `json:"confidence"` 11685 *NoMethod 11686 } 11687 s1.NoMethod = (*NoMethod)(s) 11688 if err := json.Unmarshal(data, &s1); err != nil { 11689 return err 11690 } 11691 s.Confidence = float64(s1.Confidence) 11692 return nil 11693} 11694 11695// GroupedResult: Information about the products similar to a single 11696// product in a query image. 11697type GroupedResult struct { 11698 // BoundingPoly: The bounding polygon around the product detected in the 11699 // query image. 11700 BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"` 11701 11702 // ObjectAnnotations: List of generic predictions for the object in the 11703 // bounding box. 11704 ObjectAnnotations []*ObjectAnnotation `json:"objectAnnotations,omitempty"` 11705 11706 // Results: List of results, one for each product match. 11707 Results []*Result `json:"results,omitempty"` 11708 11709 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 11710 // unconditionally include in API requests. By default, fields with 11711 // empty values are omitted from API requests. However, any non-pointer, 11712 // non-interface field appearing in ForceSendFields will be sent to the 11713 // server regardless of whether the field is empty or not. This may be 11714 // used to include empty fields in Patch requests. 11715 ForceSendFields []string `json:"-"` 11716 11717 // NullFields is a list of field names (e.g. "BoundingPoly") to include 11718 // in API requests with the JSON null value. By default, fields with 11719 // empty values are omitted from API requests. However, any field with 11720 // an empty value appearing in NullFields will be sent to the server as 11721 // null. It is an error if a field in this list has a non-empty value. 11722 // This may be used to include null fields in Patch requests. 11723 NullFields []string `json:"-"` 11724} 11725 11726func (s *GroupedResult) MarshalJSON() ([]byte, error) { 11727 type NoMethod GroupedResult 11728 raw := NoMethod(*s) 11729 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11730} 11731 11732// ImageAnnotationContext: If an image was produced from a file (e.g. a 11733// PDF), this message gives information about the source of that image. 11734type ImageAnnotationContext struct { 11735 // PageNumber: If the file was a PDF or TIFF, this field gives the page 11736 // number within the file used to produce the image. 11737 PageNumber int64 `json:"pageNumber,omitempty"` 11738 11739 // Uri: The URI of the file used to produce the image. 11740 Uri string `json:"uri,omitempty"` 11741 11742 // ForceSendFields is a list of field names (e.g. "PageNumber") to 11743 // unconditionally include in API requests. By default, fields with 11744 // empty values are omitted from API requests. However, any non-pointer, 11745 // non-interface field appearing in ForceSendFields will be sent to the 11746 // server regardless of whether the field is empty or not. This may be 11747 // used to include empty fields in Patch requests. 11748 ForceSendFields []string `json:"-"` 11749 11750 // NullFields is a list of field names (e.g. "PageNumber") to include in 11751 // API requests with the JSON null value. By default, fields with empty 11752 // values are omitted from API requests. However, any field with an 11753 // empty value appearing in NullFields will be sent to the server as 11754 // null. It is an error if a field in this list has a non-empty value. 11755 // This may be used to include null fields in Patch requests. 11756 NullFields []string `json:"-"` 11757} 11758 11759func (s *ImageAnnotationContext) MarshalJSON() ([]byte, error) { 11760 type NoMethod ImageAnnotationContext 11761 raw := NoMethod(*s) 11762 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11763} 11764 11765// ImageProperties: Stores image properties, such as dominant colors. 11766type ImageProperties struct { 11767 // DominantColors: If present, dominant colors completed successfully. 11768 DominantColors *DominantColorsAnnotation `json:"dominantColors,omitempty"` 11769 11770 // ForceSendFields is a list of field names (e.g. "DominantColors") to 11771 // unconditionally include in API requests. By default, fields with 11772 // empty values are omitted from API requests. However, any non-pointer, 11773 // non-interface field appearing in ForceSendFields will be sent to the 11774 // server regardless of whether the field is empty or not. This may be 11775 // used to include empty fields in Patch requests. 11776 ForceSendFields []string `json:"-"` 11777 11778 // NullFields is a list of field names (e.g. "DominantColors") to 11779 // include in API requests with the JSON null value. By default, fields 11780 // with empty values are omitted from API requests. However, any field 11781 // with an empty value appearing in NullFields will be sent to the 11782 // server as null. It is an error if a field in this list has a 11783 // non-empty value. This may be used to include null fields in Patch 11784 // requests. 11785 NullFields []string `json:"-"` 11786} 11787 11788func (s *ImageProperties) MarshalJSON() ([]byte, error) { 11789 type NoMethod ImageProperties 11790 raw := NoMethod(*s) 11791 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11792} 11793 11794// ImportProductSetsResponse: Response message for the 11795// `ImportProductSets` method. This message is returned by the 11796// google.longrunning.Operations.GetOperation method in the returned 11797// google.longrunning.Operation.response field. 11798type ImportProductSetsResponse struct { 11799 // ReferenceImages: The list of reference_images that are imported 11800 // successfully. 11801 ReferenceImages []*ReferenceImage `json:"referenceImages,omitempty"` 11802 11803 // Statuses: The rpc status for each ImportProductSet request, including 11804 // both successes and errors. The number of statuses here matches the 11805 // number of lines in the csv file, and statuses[i] stores the success 11806 // or failure status of processing the i-th line of the csv, starting 11807 // from line 0. 11808 Statuses []*Status `json:"statuses,omitempty"` 11809 11810 // ForceSendFields is a list of field names (e.g. "ReferenceImages") to 11811 // unconditionally include in API requests. By default, fields with 11812 // empty values are omitted from API requests. However, any non-pointer, 11813 // non-interface field appearing in ForceSendFields will be sent to the 11814 // server regardless of whether the field is empty or not. This may be 11815 // used to include empty fields in Patch requests. 11816 ForceSendFields []string `json:"-"` 11817 11818 // NullFields is a list of field names (e.g. "ReferenceImages") to 11819 // include in API requests with the JSON null value. By default, fields 11820 // with empty values are omitted from API requests. However, any field 11821 // with an empty value appearing in NullFields will be sent to the 11822 // server as null. It is an error if a field in this list has a 11823 // non-empty value. This may be used to include null fields in Patch 11824 // requests. 11825 NullFields []string `json:"-"` 11826} 11827 11828func (s *ImportProductSetsResponse) MarshalJSON() ([]byte, error) { 11829 type NoMethod ImportProductSetsResponse 11830 raw := NoMethod(*s) 11831 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11832} 11833 11834// InputConfig: The desired input location and metadata. 11835type InputConfig struct { 11836 // Content: File content, represented as a stream of bytes. Note: As 11837 // with all `bytes` fields, protobuffers use a pure binary 11838 // representation, whereas JSON representations use base64. Currently, 11839 // this field only works for BatchAnnotateFiles requests. It does not 11840 // work for AsyncBatchAnnotateFiles requests. 11841 Content string `json:"content,omitempty"` 11842 11843 // GcsSource: The Google Cloud Storage location to read the input from. 11844 GcsSource *GcsSource `json:"gcsSource,omitempty"` 11845 11846 // MimeType: The type of the file. Currently only "application/pdf", 11847 // "image/tiff" and "image/gif" are supported. Wildcards are not 11848 // supported. 11849 MimeType string `json:"mimeType,omitempty"` 11850 11851 // ForceSendFields is a list of field names (e.g. "Content") to 11852 // unconditionally include in API requests. By default, fields with 11853 // empty values are omitted from API requests. However, any non-pointer, 11854 // non-interface field appearing in ForceSendFields will be sent to the 11855 // server regardless of whether the field is empty or not. This may be 11856 // used to include empty fields in Patch requests. 11857 ForceSendFields []string `json:"-"` 11858 11859 // NullFields is a list of field names (e.g. "Content") to include in 11860 // API requests with the JSON null value. By default, fields with empty 11861 // values are omitted from API requests. However, any field with an 11862 // empty value appearing in NullFields will be sent to the server as 11863 // null. It is an error if a field in this list has a non-empty value. 11864 // This may be used to include null fields in Patch requests. 11865 NullFields []string `json:"-"` 11866} 11867 11868func (s *InputConfig) MarshalJSON() ([]byte, error) { 11869 type NoMethod InputConfig 11870 raw := NoMethod(*s) 11871 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11872} 11873 11874// KeyValue: A product label represented as a key-value pair. 11875type KeyValue struct { 11876 // Key: The key of the label attached to the product. Cannot be empty 11877 // and cannot exceed 128 bytes. 11878 Key string `json:"key,omitempty"` 11879 11880 // Value: The value of the label attached to the product. Cannot be 11881 // empty and cannot exceed 128 bytes. 11882 Value string `json:"value,omitempty"` 11883 11884 // ForceSendFields is a list of field names (e.g. "Key") to 11885 // unconditionally include in API requests. By default, fields with 11886 // empty values are omitted from API requests. However, any non-pointer, 11887 // non-interface field appearing in ForceSendFields will be sent to the 11888 // server regardless of whether the field is empty or not. This may be 11889 // used to include empty fields in Patch requests. 11890 ForceSendFields []string `json:"-"` 11891 11892 // NullFields is a list of field names (e.g. "Key") to include in API 11893 // requests with the JSON null value. By default, fields with empty 11894 // values are omitted from API requests. However, any field with an 11895 // empty value appearing in NullFields will be sent to the server as 11896 // null. It is an error if a field in this list has a non-empty value. 11897 // This may be used to include null fields in Patch requests. 11898 NullFields []string `json:"-"` 11899} 11900 11901func (s *KeyValue) MarshalJSON() ([]byte, error) { 11902 type NoMethod KeyValue 11903 raw := NoMethod(*s) 11904 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11905} 11906 11907// Landmark: A face-specific landmark (for example, a face feature). 11908type Landmark struct { 11909 // Position: Face landmark position. 11910 Position *Position `json:"position,omitempty"` 11911 11912 // Type: Face landmark type. 11913 // 11914 // Possible values: 11915 // "UNKNOWN_LANDMARK" - Unknown face landmark detected. Should not be 11916 // filled. 11917 // "LEFT_EYE" - Left eye. 11918 // "RIGHT_EYE" - Right eye. 11919 // "LEFT_OF_LEFT_EYEBROW" - Left of left eyebrow. 11920 // "RIGHT_OF_LEFT_EYEBROW" - Right of left eyebrow. 11921 // "LEFT_OF_RIGHT_EYEBROW" - Left of right eyebrow. 11922 // "RIGHT_OF_RIGHT_EYEBROW" - Right of right eyebrow. 11923 // "MIDPOINT_BETWEEN_EYES" - Midpoint between eyes. 11924 // "NOSE_TIP" - Nose tip. 11925 // "UPPER_LIP" - Upper lip. 11926 // "LOWER_LIP" - Lower lip. 11927 // "MOUTH_LEFT" - Mouth left. 11928 // "MOUTH_RIGHT" - Mouth right. 11929 // "MOUTH_CENTER" - Mouth center. 11930 // "NOSE_BOTTOM_RIGHT" - Nose, bottom right. 11931 // "NOSE_BOTTOM_LEFT" - Nose, bottom left. 11932 // "NOSE_BOTTOM_CENTER" - Nose, bottom center. 11933 // "LEFT_EYE_TOP_BOUNDARY" - Left eye, top boundary. 11934 // "LEFT_EYE_RIGHT_CORNER" - Left eye, right corner. 11935 // "LEFT_EYE_BOTTOM_BOUNDARY" - Left eye, bottom boundary. 11936 // "LEFT_EYE_LEFT_CORNER" - Left eye, left corner. 11937 // "RIGHT_EYE_TOP_BOUNDARY" - Right eye, top boundary. 11938 // "RIGHT_EYE_RIGHT_CORNER" - Right eye, right corner. 11939 // "RIGHT_EYE_BOTTOM_BOUNDARY" - Right eye, bottom boundary. 11940 // "RIGHT_EYE_LEFT_CORNER" - Right eye, left corner. 11941 // "LEFT_EYEBROW_UPPER_MIDPOINT" - Left eyebrow, upper midpoint. 11942 // "RIGHT_EYEBROW_UPPER_MIDPOINT" - Right eyebrow, upper midpoint. 11943 // "LEFT_EAR_TRAGION" - Left ear tragion. 11944 // "RIGHT_EAR_TRAGION" - Right ear tragion. 11945 // "LEFT_EYE_PUPIL" - Left eye pupil. 11946 // "RIGHT_EYE_PUPIL" - Right eye pupil. 11947 // "FOREHEAD_GLABELLA" - Forehead glabella. 11948 // "CHIN_GNATHION" - Chin gnathion. 11949 // "CHIN_LEFT_GONION" - Chin left gonion. 11950 // "CHIN_RIGHT_GONION" - Chin right gonion. 11951 // "LEFT_CHEEK_CENTER" - Left cheek center. 11952 // "RIGHT_CHEEK_CENTER" - Right cheek center. 11953 Type string `json:"type,omitempty"` 11954 11955 // ForceSendFields is a list of field names (e.g. "Position") to 11956 // unconditionally include in API requests. By default, fields with 11957 // empty values are omitted from API requests. However, any non-pointer, 11958 // non-interface field appearing in ForceSendFields will be sent to the 11959 // server regardless of whether the field is empty or not. This may be 11960 // used to include empty fields in Patch requests. 11961 ForceSendFields []string `json:"-"` 11962 11963 // NullFields is a list of field names (e.g. "Position") to include in 11964 // API requests with the JSON null value. By default, fields with empty 11965 // values are omitted from API requests. However, any field with an 11966 // empty value appearing in NullFields will be sent to the server as 11967 // null. It is an error if a field in this list has a non-empty value. 11968 // This may be used to include null fields in Patch requests. 11969 NullFields []string `json:"-"` 11970} 11971 11972func (s *Landmark) MarshalJSON() ([]byte, error) { 11973 type NoMethod Landmark 11974 raw := NoMethod(*s) 11975 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 11976} 11977 11978// LatLng: An object that represents a latitude/longitude pair. This is 11979// expressed as a pair of doubles to represent degrees latitude and 11980// degrees longitude. Unless specified otherwise, this must conform to 11981// the WGS84 standard. Values must be within normalized ranges. 11982type LatLng struct { 11983 // Latitude: The latitude in degrees. It must be in the range [-90.0, 11984 // +90.0]. 11985 Latitude float64 `json:"latitude,omitempty"` 11986 11987 // Longitude: The longitude in degrees. It must be in the range [-180.0, 11988 // +180.0]. 11989 Longitude float64 `json:"longitude,omitempty"` 11990 11991 // ForceSendFields is a list of field names (e.g. "Latitude") to 11992 // unconditionally include in API requests. By default, fields with 11993 // empty values are omitted from API requests. However, any non-pointer, 11994 // non-interface field appearing in ForceSendFields will be sent to the 11995 // server regardless of whether the field is empty or not. This may be 11996 // used to include empty fields in Patch requests. 11997 ForceSendFields []string `json:"-"` 11998 11999 // NullFields is a list of field names (e.g. "Latitude") to include in 12000 // API requests with the JSON null value. By default, fields with empty 12001 // values are omitted from API requests. However, any field with an 12002 // empty value appearing in NullFields will be sent to the server as 12003 // null. It is an error if a field in this list has a non-empty value. 12004 // This may be used to include null fields in Patch requests. 12005 NullFields []string `json:"-"` 12006} 12007 12008func (s *LatLng) MarshalJSON() ([]byte, error) { 12009 type NoMethod LatLng 12010 raw := NoMethod(*s) 12011 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12012} 12013 12014func (s *LatLng) UnmarshalJSON(data []byte) error { 12015 type NoMethod LatLng 12016 var s1 struct { 12017 Latitude gensupport.JSONFloat64 `json:"latitude"` 12018 Longitude gensupport.JSONFloat64 `json:"longitude"` 12019 *NoMethod 12020 } 12021 s1.NoMethod = (*NoMethod)(s) 12022 if err := json.Unmarshal(data, &s1); err != nil { 12023 return err 12024 } 12025 s.Latitude = float64(s1.Latitude) 12026 s.Longitude = float64(s1.Longitude) 12027 return nil 12028} 12029 12030// LocalizedObjectAnnotation: Set of detected objects with bounding 12031// boxes. 12032type LocalizedObjectAnnotation struct { 12033 // BoundingPoly: Image region to which this object belongs. This must be 12034 // populated. 12035 BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"` 12036 12037 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". 12038 // For more information, see 12039 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 12040 LanguageCode string `json:"languageCode,omitempty"` 12041 12042 // Mid: Object ID that should align with EntityAnnotation mid. 12043 Mid string `json:"mid,omitempty"` 12044 12045 // Name: Object name, expressed in its `language_code` language. 12046 Name string `json:"name,omitempty"` 12047 12048 // Score: Score of the result. Range [0, 1]. 12049 Score float64 `json:"score,omitempty"` 12050 12051 // ForceSendFields is a list of field names (e.g. "BoundingPoly") to 12052 // unconditionally include in API requests. By default, fields with 12053 // empty values are omitted from API requests. However, any non-pointer, 12054 // non-interface field appearing in ForceSendFields will be sent to the 12055 // server regardless of whether the field is empty or not. This may be 12056 // used to include empty fields in Patch requests. 12057 ForceSendFields []string `json:"-"` 12058 12059 // NullFields is a list of field names (e.g. "BoundingPoly") to include 12060 // in API requests with the JSON null value. By default, fields with 12061 // empty values are omitted from API requests. However, any field with 12062 // an empty value appearing in NullFields will be sent to the server as 12063 // null. It is an error if a field in this list has a non-empty value. 12064 // This may be used to include null fields in Patch requests. 12065 NullFields []string `json:"-"` 12066} 12067 12068func (s *LocalizedObjectAnnotation) MarshalJSON() ([]byte, error) { 12069 type NoMethod LocalizedObjectAnnotation 12070 raw := NoMethod(*s) 12071 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12072} 12073 12074func (s *LocalizedObjectAnnotation) UnmarshalJSON(data []byte) error { 12075 type NoMethod LocalizedObjectAnnotation 12076 var s1 struct { 12077 Score gensupport.JSONFloat64 `json:"score"` 12078 *NoMethod 12079 } 12080 s1.NoMethod = (*NoMethod)(s) 12081 if err := json.Unmarshal(data, &s1); err != nil { 12082 return err 12083 } 12084 s.Score = float64(s1.Score) 12085 return nil 12086} 12087 12088// LocationInfo: Detected entity location information. 12089type LocationInfo struct { 12090 // LatLng: lat/long location coordinates. 12091 LatLng *LatLng `json:"latLng,omitempty"` 12092 12093 // ForceSendFields is a list of field names (e.g. "LatLng") to 12094 // unconditionally include in API requests. By default, fields with 12095 // empty values are omitted from API requests. However, any non-pointer, 12096 // non-interface field appearing in ForceSendFields will be sent to the 12097 // server regardless of whether the field is empty or not. This may be 12098 // used to include empty fields in Patch requests. 12099 ForceSendFields []string `json:"-"` 12100 12101 // NullFields is a list of field names (e.g. "LatLng") to include in API 12102 // requests with the JSON null value. By default, fields with empty 12103 // values are omitted from API requests. However, any field with an 12104 // empty value appearing in NullFields will be sent to the server as 12105 // null. It is an error if a field in this list has a non-empty value. 12106 // This may be used to include null fields in Patch requests. 12107 NullFields []string `json:"-"` 12108} 12109 12110func (s *LocationInfo) MarshalJSON() ([]byte, error) { 12111 type NoMethod LocationInfo 12112 raw := NoMethod(*s) 12113 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12114} 12115 12116// NormalizedVertex: A vertex represents a 2D point in the image. NOTE: 12117// the normalized vertex coordinates are relative to the original image 12118// and range from 0 to 1. 12119type NormalizedVertex struct { 12120 // X: X coordinate. 12121 X float64 `json:"x,omitempty"` 12122 12123 // Y: Y coordinate. 12124 Y float64 `json:"y,omitempty"` 12125 12126 // ForceSendFields is a list of field names (e.g. "X") 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. "X") to include in API 12135 // 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 *NormalizedVertex) MarshalJSON() ([]byte, error) { 12144 type NoMethod NormalizedVertex 12145 raw := NoMethod(*s) 12146 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12147} 12148 12149func (s *NormalizedVertex) UnmarshalJSON(data []byte) error { 12150 type NoMethod NormalizedVertex 12151 var s1 struct { 12152 X gensupport.JSONFloat64 `json:"x"` 12153 Y gensupport.JSONFloat64 `json:"y"` 12154 *NoMethod 12155 } 12156 s1.NoMethod = (*NoMethod)(s) 12157 if err := json.Unmarshal(data, &s1); err != nil { 12158 return err 12159 } 12160 s.X = float64(s1.X) 12161 s.Y = float64(s1.Y) 12162 return nil 12163} 12164 12165// ObjectAnnotation: Prediction for what the object in the bounding box 12166// is. 12167type ObjectAnnotation struct { 12168 // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". 12169 // For more information, see 12170 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 12171 LanguageCode string `json:"languageCode,omitempty"` 12172 12173 // Mid: Object ID that should align with EntityAnnotation mid. 12174 Mid string `json:"mid,omitempty"` 12175 12176 // Name: Object name, expressed in its `language_code` language. 12177 Name string `json:"name,omitempty"` 12178 12179 // Score: Score of the result. Range [0, 1]. 12180 Score float64 `json:"score,omitempty"` 12181 12182 // ForceSendFields is a list of field names (e.g. "LanguageCode") to 12183 // unconditionally include in API requests. By default, fields with 12184 // empty values are omitted from API requests. However, any non-pointer, 12185 // non-interface field appearing in ForceSendFields will be sent to the 12186 // server regardless of whether the field is empty or not. This may be 12187 // used to include empty fields in Patch requests. 12188 ForceSendFields []string `json:"-"` 12189 12190 // NullFields is a list of field names (e.g. "LanguageCode") to include 12191 // in API requests with the JSON null value. By default, fields with 12192 // empty values are omitted from API requests. However, any field with 12193 // an empty value appearing in NullFields will be sent to the server as 12194 // null. It is an error if a field in this list has a non-empty value. 12195 // This may be used to include null fields in Patch requests. 12196 NullFields []string `json:"-"` 12197} 12198 12199func (s *ObjectAnnotation) MarshalJSON() ([]byte, error) { 12200 type NoMethod ObjectAnnotation 12201 raw := NoMethod(*s) 12202 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12203} 12204 12205func (s *ObjectAnnotation) UnmarshalJSON(data []byte) error { 12206 type NoMethod ObjectAnnotation 12207 var s1 struct { 12208 Score gensupport.JSONFloat64 `json:"score"` 12209 *NoMethod 12210 } 12211 s1.NoMethod = (*NoMethod)(s) 12212 if err := json.Unmarshal(data, &s1); err != nil { 12213 return err 12214 } 12215 s.Score = float64(s1.Score) 12216 return nil 12217} 12218 12219// Operation: This resource represents a long-running operation that is 12220// the result of a network API call. 12221type Operation struct { 12222 // Done: If the value is `false`, it means the operation is still in 12223 // progress. If `true`, the operation is completed, and either `error` 12224 // or `response` is available. 12225 Done bool `json:"done,omitempty"` 12226 12227 // Error: The error result of the operation in case of failure or 12228 // cancellation. 12229 Error *Status `json:"error,omitempty"` 12230 12231 // Metadata: Service-specific metadata associated with the operation. It 12232 // typically contains progress information and common metadata such as 12233 // create time. Some services might not provide such metadata. Any 12234 // method that returns a long-running operation should document the 12235 // metadata type, if any. 12236 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 12237 12238 // Name: The server-assigned name, which is only unique within the same 12239 // service that originally returns it. If you use the default HTTP 12240 // mapping, the `name` should be a resource name ending with 12241 // `operations/{unique_id}`. 12242 Name string `json:"name,omitempty"` 12243 12244 // Response: The normal response of the operation in case of success. If 12245 // the original method returns no data on success, such as `Delete`, the 12246 // response is `google.protobuf.Empty`. If the original method is 12247 // standard `Get`/`Create`/`Update`, the response should be the 12248 // resource. For other methods, the response should have the type 12249 // `XxxResponse`, where `Xxx` is the original method name. For example, 12250 // if the original method name is `TakeSnapshot()`, the inferred 12251 // response type is `TakeSnapshotResponse`. 12252 Response googleapi.RawMessage `json:"response,omitempty"` 12253 12254 // ServerResponse contains the HTTP response code and headers from the 12255 // server. 12256 googleapi.ServerResponse `json:"-"` 12257 12258 // ForceSendFields is a list of field names (e.g. "Done") to 12259 // unconditionally include in API requests. By default, fields with 12260 // empty values are omitted from API requests. However, any non-pointer, 12261 // non-interface field appearing in ForceSendFields will be sent to the 12262 // server regardless of whether the field is empty or not. This may be 12263 // used to include empty fields in Patch requests. 12264 ForceSendFields []string `json:"-"` 12265 12266 // NullFields is a list of field names (e.g. "Done") to include in API 12267 // requests with the JSON null value. By default, fields with empty 12268 // values are omitted from API requests. However, any field with an 12269 // empty value appearing in NullFields will be sent to the server as 12270 // null. It is an error if a field in this list has a non-empty value. 12271 // This may be used to include null fields in Patch requests. 12272 NullFields []string `json:"-"` 12273} 12274 12275func (s *Operation) MarshalJSON() ([]byte, error) { 12276 type NoMethod Operation 12277 raw := NoMethod(*s) 12278 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12279} 12280 12281// OperationMetadata: Contains metadata for the BatchAnnotateImages 12282// operation. 12283type OperationMetadata struct { 12284 // CreateTime: The time when the batch request was received. 12285 CreateTime string `json:"createTime,omitempty"` 12286 12287 // State: Current state of the batch operation. 12288 // 12289 // Possible values: 12290 // "STATE_UNSPECIFIED" - Invalid. 12291 // "CREATED" - Request is received. 12292 // "RUNNING" - Request is actively being processed. 12293 // "DONE" - The batch processing is done. 12294 // "CANCELLED" - The batch processing was cancelled. 12295 State string `json:"state,omitempty"` 12296 12297 // UpdateTime: The time when the operation result was last updated. 12298 UpdateTime string `json:"updateTime,omitempty"` 12299 12300 // ForceSendFields is a list of field names (e.g. "CreateTime") to 12301 // unconditionally include in API requests. By default, fields with 12302 // empty values are omitted from API requests. However, any non-pointer, 12303 // non-interface field appearing in ForceSendFields will be sent to the 12304 // server regardless of whether the field is empty or not. This may be 12305 // used to include empty fields in Patch requests. 12306 ForceSendFields []string `json:"-"` 12307 12308 // NullFields is a list of field names (e.g. "CreateTime") to include in 12309 // API requests with the JSON null value. By default, fields with empty 12310 // values are omitted from API requests. However, any field with an 12311 // empty value appearing in NullFields will be sent to the server as 12312 // null. It is an error if a field in this list has a non-empty value. 12313 // This may be used to include null fields in Patch requests. 12314 NullFields []string `json:"-"` 12315} 12316 12317func (s *OperationMetadata) MarshalJSON() ([]byte, error) { 12318 type NoMethod OperationMetadata 12319 raw := NoMethod(*s) 12320 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12321} 12322 12323// OutputConfig: The desired output location and metadata. 12324type OutputConfig struct { 12325 // BatchSize: The max number of response protos to put into each output 12326 // JSON file on Google Cloud Storage. The valid range is [1, 100]. If 12327 // not specified, the default value is 20. For example, for one pdf file 12328 // with 100 pages, 100 response protos will be generated. If 12329 // `batch_size` = 20, then 5 json files each containing 20 response 12330 // protos will be written under the prefix `gcs_destination`.`uri`. 12331 // Currently, batch_size only applies to GcsDestination, with potential 12332 // future support for other output configurations. 12333 BatchSize int64 `json:"batchSize,omitempty"` 12334 12335 // GcsDestination: The Google Cloud Storage location to write the 12336 // output(s) to. 12337 GcsDestination *GcsDestination `json:"gcsDestination,omitempty"` 12338 12339 // ForceSendFields is a list of field names (e.g. "BatchSize") to 12340 // unconditionally include in API requests. By default, fields with 12341 // empty values are omitted from API requests. However, any non-pointer, 12342 // non-interface field appearing in ForceSendFields will be sent to the 12343 // server regardless of whether the field is empty or not. This may be 12344 // used to include empty fields in Patch requests. 12345 ForceSendFields []string `json:"-"` 12346 12347 // NullFields is a list of field names (e.g. "BatchSize") to include in 12348 // API requests with the JSON null value. By default, fields with empty 12349 // values are omitted from API requests. However, any field with an 12350 // empty value appearing in NullFields will be sent to the server as 12351 // null. It is an error if a field in this list has a non-empty value. 12352 // This may be used to include null fields in Patch requests. 12353 NullFields []string `json:"-"` 12354} 12355 12356func (s *OutputConfig) MarshalJSON() ([]byte, error) { 12357 type NoMethod OutputConfig 12358 raw := NoMethod(*s) 12359 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12360} 12361 12362// Page: Detected page from OCR. 12363type Page struct { 12364 // Blocks: List of blocks of text, images etc on this page. 12365 Blocks []*Block `json:"blocks,omitempty"` 12366 12367 // Confidence: Confidence of the OCR results on the page. Range [0, 1]. 12368 Confidence float64 `json:"confidence,omitempty"` 12369 12370 // Height: Page height. For PDFs the unit is points. For images 12371 // (including TIFFs) the unit is pixels. 12372 Height int64 `json:"height,omitempty"` 12373 12374 // Property: Additional information detected on the page. 12375 Property *TextProperty `json:"property,omitempty"` 12376 12377 // Width: Page width. For PDFs the unit is points. For images (including 12378 // TIFFs) the unit is pixels. 12379 Width int64 `json:"width,omitempty"` 12380 12381 // ForceSendFields is a list of field names (e.g. "Blocks") to 12382 // unconditionally include in API requests. By default, fields with 12383 // empty values are omitted from API requests. However, any non-pointer, 12384 // non-interface field appearing in ForceSendFields will be sent to the 12385 // server regardless of whether the field is empty or not. This may be 12386 // used to include empty fields in Patch requests. 12387 ForceSendFields []string `json:"-"` 12388 12389 // NullFields is a list of field names (e.g. "Blocks") to include in API 12390 // requests with the JSON null value. By default, fields with empty 12391 // values are omitted from API requests. However, any field with an 12392 // empty value appearing in NullFields will be sent to the server as 12393 // null. It is an error if a field in this list has a non-empty value. 12394 // This may be used to include null fields in Patch requests. 12395 NullFields []string `json:"-"` 12396} 12397 12398func (s *Page) MarshalJSON() ([]byte, error) { 12399 type NoMethod Page 12400 raw := NoMethod(*s) 12401 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12402} 12403 12404func (s *Page) UnmarshalJSON(data []byte) error { 12405 type NoMethod Page 12406 var s1 struct { 12407 Confidence gensupport.JSONFloat64 `json:"confidence"` 12408 *NoMethod 12409 } 12410 s1.NoMethod = (*NoMethod)(s) 12411 if err := json.Unmarshal(data, &s1); err != nil { 12412 return err 12413 } 12414 s.Confidence = float64(s1.Confidence) 12415 return nil 12416} 12417 12418// Paragraph: Structural unit of text representing a number of words in 12419// certain order. 12420type Paragraph struct { 12421 // BoundingBox: The bounding box for the paragraph. The vertices are in 12422 // the order of top-left, top-right, bottom-right, bottom-left. When a 12423 // rotation of the bounding box is detected the rotation is represented 12424 // as around the top-left corner as defined when the text is read in the 12425 // 'natural' orientation. For example: * when the text is horizontal it 12426 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 12427 // around the top-left corner it becomes: 2----3 | | 1----0 and the 12428 // vertex order will still be (0, 1, 2, 3). 12429 BoundingBox *BoundingPoly `json:"boundingBox,omitempty"` 12430 12431 // Confidence: Confidence of the OCR results for the paragraph. Range 12432 // [0, 1]. 12433 Confidence float64 `json:"confidence,omitempty"` 12434 12435 // Property: Additional information detected for the paragraph. 12436 Property *TextProperty `json:"property,omitempty"` 12437 12438 // Words: List of all words in this paragraph. 12439 Words []*Word `json:"words,omitempty"` 12440 12441 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 12442 // unconditionally include in API requests. By default, fields with 12443 // empty values are omitted from API requests. However, any non-pointer, 12444 // non-interface field appearing in ForceSendFields will be sent to the 12445 // server regardless of whether the field is empty or not. This may be 12446 // used to include empty fields in Patch requests. 12447 ForceSendFields []string `json:"-"` 12448 12449 // NullFields is a list of field names (e.g. "BoundingBox") to include 12450 // in API requests with the JSON null value. By default, fields with 12451 // empty values are omitted from API requests. However, any field with 12452 // an empty value appearing in NullFields will be sent to the server as 12453 // null. It is an error if a field in this list has a non-empty value. 12454 // This may be used to include null fields in Patch requests. 12455 NullFields []string `json:"-"` 12456} 12457 12458func (s *Paragraph) MarshalJSON() ([]byte, error) { 12459 type NoMethod Paragraph 12460 raw := NoMethod(*s) 12461 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12462} 12463 12464func (s *Paragraph) UnmarshalJSON(data []byte) error { 12465 type NoMethod Paragraph 12466 var s1 struct { 12467 Confidence gensupport.JSONFloat64 `json:"confidence"` 12468 *NoMethod 12469 } 12470 s1.NoMethod = (*NoMethod)(s) 12471 if err := json.Unmarshal(data, &s1); err != nil { 12472 return err 12473 } 12474 s.Confidence = float64(s1.Confidence) 12475 return nil 12476} 12477 12478// Position: A 3D position in the image, used primarily for Face 12479// detection landmarks. A valid Position must have both x and y 12480// coordinates. The position coordinates are in the same scale as the 12481// original image. 12482type Position struct { 12483 // X: X coordinate. 12484 X float64 `json:"x,omitempty"` 12485 12486 // Y: Y coordinate. 12487 Y float64 `json:"y,omitempty"` 12488 12489 // Z: Z coordinate (or depth). 12490 Z float64 `json:"z,omitempty"` 12491 12492 // ForceSendFields is a list of field names (e.g. "X") to 12493 // unconditionally include in API requests. By default, fields with 12494 // empty values are omitted from API requests. However, any non-pointer, 12495 // non-interface field appearing in ForceSendFields will be sent to the 12496 // server regardless of whether the field is empty or not. This may be 12497 // used to include empty fields in Patch requests. 12498 ForceSendFields []string `json:"-"` 12499 12500 // NullFields is a list of field names (e.g. "X") to include in API 12501 // requests with the JSON null value. By default, fields with empty 12502 // values are omitted from API requests. However, any field with an 12503 // empty value appearing in NullFields will be sent to the server as 12504 // null. It is an error if a field in this list has a non-empty value. 12505 // This may be used to include null fields in Patch requests. 12506 NullFields []string `json:"-"` 12507} 12508 12509func (s *Position) MarshalJSON() ([]byte, error) { 12510 type NoMethod Position 12511 raw := NoMethod(*s) 12512 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12513} 12514 12515func (s *Position) UnmarshalJSON(data []byte) error { 12516 type NoMethod Position 12517 var s1 struct { 12518 X gensupport.JSONFloat64 `json:"x"` 12519 Y gensupport.JSONFloat64 `json:"y"` 12520 Z gensupport.JSONFloat64 `json:"z"` 12521 *NoMethod 12522 } 12523 s1.NoMethod = (*NoMethod)(s) 12524 if err := json.Unmarshal(data, &s1); err != nil { 12525 return err 12526 } 12527 s.X = float64(s1.X) 12528 s.Y = float64(s1.Y) 12529 s.Z = float64(s1.Z) 12530 return nil 12531} 12532 12533// Product: A Product contains ReferenceImages. 12534type Product struct { 12535 // Description: User-provided metadata to be stored with this product. 12536 // Must be at most 4096 characters long. 12537 Description string `json:"description,omitempty"` 12538 12539 // DisplayName: The user-provided name for this Product. Must not be 12540 // empty. Must be at most 4096 characters long. 12541 DisplayName string `json:"displayName,omitempty"` 12542 12543 // Name: The resource name of the product. Format is: 12544 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This 12545 // field is ignored when creating a product. 12546 Name string `json:"name,omitempty"` 12547 12548 // ProductCategory: Immutable. The category for the product identified 12549 // by the reference image. This should be one of "homegoods-v2", 12550 // "apparel-v2", "toys-v2", "packagedgoods-v1" or "general-v1". The 12551 // legacy categories "homegoods", "apparel", and "toys" are still 12552 // supported, but these should not be used for new products. 12553 ProductCategory string `json:"productCategory,omitempty"` 12554 12555 // ProductLabels: Key-value pairs that can be attached to a product. At 12556 // query time, constraints can be specified based on the product_labels. 12557 // Note that integer values can be provided as strings, e.g. "1199". 12558 // Only strings with integer values can match a range-based restriction 12559 // which is to be supported soon. Multiple values can be assigned to the 12560 // same key. One product may have up to 500 product_labels. Notice that 12561 // the total number of distinct product_labels over all products in one 12562 // ProductSet cannot exceed 1M, otherwise the product search pipeline 12563 // will refuse to work for that ProductSet. 12564 ProductLabels []*KeyValue `json:"productLabels,omitempty"` 12565 12566 // ForceSendFields is a list of field names (e.g. "Description") to 12567 // unconditionally include in API requests. By default, fields with 12568 // empty values are omitted from API requests. However, any non-pointer, 12569 // non-interface field appearing in ForceSendFields will be sent to the 12570 // server regardless of whether the field is empty or not. This may be 12571 // used to include empty fields in Patch requests. 12572 ForceSendFields []string `json:"-"` 12573 12574 // NullFields is a list of field names (e.g. "Description") to include 12575 // in API requests with the JSON null value. By default, fields with 12576 // empty values are omitted from API requests. However, any field with 12577 // an empty value appearing in NullFields will be sent to the server as 12578 // null. It is an error if a field in this list has a non-empty value. 12579 // This may be used to include null fields in Patch requests. 12580 NullFields []string `json:"-"` 12581} 12582 12583func (s *Product) MarshalJSON() ([]byte, error) { 12584 type NoMethod Product 12585 raw := NoMethod(*s) 12586 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12587} 12588 12589// ProductSearchResults: Results for a product search request. 12590type ProductSearchResults struct { 12591 // IndexTime: Timestamp of the index which provided these results. 12592 // Products added to the product set and products removed from the 12593 // product set after this time are not reflected in the current results. 12594 IndexTime string `json:"indexTime,omitempty"` 12595 12596 // ProductGroupedResults: List of results grouped by products detected 12597 // in the query image. Each entry corresponds to one bounding polygon in 12598 // the query image, and contains the matching products specific to that 12599 // region. There may be duplicate product matches in the union of all 12600 // the per-product results. 12601 ProductGroupedResults []*GroupedResult `json:"productGroupedResults,omitempty"` 12602 12603 // Results: List of results, one for each product match. 12604 Results []*Result `json:"results,omitempty"` 12605 12606 // ForceSendFields is a list of field names (e.g. "IndexTime") to 12607 // unconditionally include in API requests. By default, fields with 12608 // empty values are omitted from API requests. However, any non-pointer, 12609 // non-interface field appearing in ForceSendFields will be sent to the 12610 // server regardless of whether the field is empty or not. This may be 12611 // used to include empty fields in Patch requests. 12612 ForceSendFields []string `json:"-"` 12613 12614 // NullFields is a list of field names (e.g. "IndexTime") to include in 12615 // API requests with the JSON null value. By default, fields with empty 12616 // values are omitted from API requests. However, any field with an 12617 // empty value appearing in NullFields will be sent to the server as 12618 // null. It is an error if a field in this list has a non-empty value. 12619 // This may be used to include null fields in Patch requests. 12620 NullFields []string `json:"-"` 12621} 12622 12623func (s *ProductSearchResults) MarshalJSON() ([]byte, error) { 12624 type NoMethod ProductSearchResults 12625 raw := NoMethod(*s) 12626 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12627} 12628 12629// Property: A `Property` consists of a user-supplied name/value pair. 12630type Property struct { 12631 // Name: Name of the property. 12632 Name string `json:"name,omitempty"` 12633 12634 // Uint64Value: Value of numeric properties. 12635 Uint64Value uint64 `json:"uint64Value,omitempty,string"` 12636 12637 // Value: Value of the property. 12638 Value string `json:"value,omitempty"` 12639 12640 // ForceSendFields is a list of field names (e.g. "Name") to 12641 // unconditionally include in API requests. By default, fields with 12642 // empty values are omitted from API requests. However, any non-pointer, 12643 // non-interface field appearing in ForceSendFields will be sent to the 12644 // server regardless of whether the field is empty or not. This may be 12645 // used to include empty fields in Patch requests. 12646 ForceSendFields []string `json:"-"` 12647 12648 // NullFields is a list of field names (e.g. "Name") to include in API 12649 // requests with the JSON null value. By default, fields with empty 12650 // values are omitted from API requests. However, any field with an 12651 // empty value appearing in NullFields will be sent to the server as 12652 // null. It is an error if a field in this list has a non-empty value. 12653 // This may be used to include null fields in Patch requests. 12654 NullFields []string `json:"-"` 12655} 12656 12657func (s *Property) MarshalJSON() ([]byte, error) { 12658 type NoMethod Property 12659 raw := NoMethod(*s) 12660 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12661} 12662 12663// ReferenceImage: A `ReferenceImage` represents a product image and its 12664// associated metadata, such as bounding boxes. 12665type ReferenceImage struct { 12666 // BoundingPolys: Optional. Bounding polygons around the areas of 12667 // interest in the reference image. If this field is empty, the system 12668 // will try to detect regions of interest. At most 10 bounding polygons 12669 // will be used. The provided shape is converted into a non-rotated 12670 // rectangle. Once converted, the small edge of the rectangle must be 12671 // greater than or equal to 300 pixels. The aspect ratio must be 1:4 or 12672 // less (i.e. 1:3 is ok; 1:5 is not). 12673 BoundingPolys []*BoundingPoly `json:"boundingPolys,omitempty"` 12674 12675 // Name: The resource name of the reference image. Format is: 12676 // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceIma 12677 // ges/IMAGE_ID`. This field is ignored when creating a reference image. 12678 Name string `json:"name,omitempty"` 12679 12680 // Uri: Required. The Google Cloud Storage URI of the reference image. 12681 // The URI must start with `gs://`. 12682 Uri string `json:"uri,omitempty"` 12683 12684 // ForceSendFields is a list of field names (e.g. "BoundingPolys") to 12685 // unconditionally include in API requests. By default, fields with 12686 // empty values are omitted from API requests. However, any non-pointer, 12687 // non-interface field appearing in ForceSendFields will be sent to the 12688 // server regardless of whether the field is empty or not. This may be 12689 // used to include empty fields in Patch requests. 12690 ForceSendFields []string `json:"-"` 12691 12692 // NullFields is a list of field names (e.g. "BoundingPolys") to include 12693 // in API requests with the JSON null value. By default, fields with 12694 // empty values are omitted from API requests. However, any field with 12695 // an empty value appearing in NullFields will be sent to the server as 12696 // null. It is an error if a field in this list has a non-empty value. 12697 // This may be used to include null fields in Patch requests. 12698 NullFields []string `json:"-"` 12699} 12700 12701func (s *ReferenceImage) MarshalJSON() ([]byte, error) { 12702 type NoMethod ReferenceImage 12703 raw := NoMethod(*s) 12704 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12705} 12706 12707// Result: Information about a product. 12708type Result struct { 12709 // Image: The resource name of the image from the product that is the 12710 // closest match to the query. 12711 Image string `json:"image,omitempty"` 12712 12713 // Product: The Product. 12714 Product *Product `json:"product,omitempty"` 12715 12716 // Score: A confidence level on the match, ranging from 0 (no 12717 // confidence) to 1 (full confidence). 12718 Score float64 `json:"score,omitempty"` 12719 12720 // ForceSendFields is a list of field names (e.g. "Image") to 12721 // unconditionally include in API requests. By default, fields with 12722 // empty values are omitted from API requests. However, any non-pointer, 12723 // non-interface field appearing in ForceSendFields will be sent to the 12724 // server regardless of whether the field is empty or not. This may be 12725 // used to include empty fields in Patch requests. 12726 ForceSendFields []string `json:"-"` 12727 12728 // NullFields is a list of field names (e.g. "Image") to include in API 12729 // requests with the JSON null value. By default, fields with empty 12730 // values are omitted from API requests. However, any field with an 12731 // empty value appearing in NullFields will be sent to the server as 12732 // null. It is an error if a field in this list has a non-empty value. 12733 // This may be used to include null fields in Patch requests. 12734 NullFields []string `json:"-"` 12735} 12736 12737func (s *Result) MarshalJSON() ([]byte, error) { 12738 type NoMethod Result 12739 raw := NoMethod(*s) 12740 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12741} 12742 12743func (s *Result) UnmarshalJSON(data []byte) error { 12744 type NoMethod Result 12745 var s1 struct { 12746 Score gensupport.JSONFloat64 `json:"score"` 12747 *NoMethod 12748 } 12749 s1.NoMethod = (*NoMethod)(s) 12750 if err := json.Unmarshal(data, &s1); err != nil { 12751 return err 12752 } 12753 s.Score = float64(s1.Score) 12754 return nil 12755} 12756 12757// SafeSearchAnnotation: Set of features pertaining to the image, 12758// computed by computer vision methods over safe-search verticals (for 12759// example, adult, spoof, medical, violence). 12760type SafeSearchAnnotation struct { 12761 // Adult: Represents the adult content likelihood for the image. Adult 12762 // content may contain elements such as nudity, pornographic images or 12763 // cartoons, or sexual activities. 12764 // 12765 // Possible values: 12766 // "UNKNOWN" - Unknown likelihood. 12767 // "VERY_UNLIKELY" - It is very unlikely. 12768 // "UNLIKELY" - It is unlikely. 12769 // "POSSIBLE" - It is possible. 12770 // "LIKELY" - It is likely. 12771 // "VERY_LIKELY" - It is very likely. 12772 Adult string `json:"adult,omitempty"` 12773 12774 // Medical: Likelihood that this is a medical image. 12775 // 12776 // Possible values: 12777 // "UNKNOWN" - Unknown likelihood. 12778 // "VERY_UNLIKELY" - It is very unlikely. 12779 // "UNLIKELY" - It is unlikely. 12780 // "POSSIBLE" - It is possible. 12781 // "LIKELY" - It is likely. 12782 // "VERY_LIKELY" - It is very likely. 12783 Medical string `json:"medical,omitempty"` 12784 12785 // Racy: Likelihood that the request image contains racy content. Racy 12786 // content may include (but is not limited to) skimpy or sheer clothing, 12787 // strategically covered nudity, lewd or provocative poses, or close-ups 12788 // of sensitive body areas. 12789 // 12790 // Possible values: 12791 // "UNKNOWN" - Unknown likelihood. 12792 // "VERY_UNLIKELY" - It is very unlikely. 12793 // "UNLIKELY" - It is unlikely. 12794 // "POSSIBLE" - It is possible. 12795 // "LIKELY" - It is likely. 12796 // "VERY_LIKELY" - It is very likely. 12797 Racy string `json:"racy,omitempty"` 12798 12799 // Spoof: Spoof likelihood. The likelihood that an modification was made 12800 // to the image's canonical version to make it appear funny or 12801 // offensive. 12802 // 12803 // Possible values: 12804 // "UNKNOWN" - Unknown likelihood. 12805 // "VERY_UNLIKELY" - It is very unlikely. 12806 // "UNLIKELY" - It is unlikely. 12807 // "POSSIBLE" - It is possible. 12808 // "LIKELY" - It is likely. 12809 // "VERY_LIKELY" - It is very likely. 12810 Spoof string `json:"spoof,omitempty"` 12811 12812 // Violence: Likelihood that this image contains violent content. 12813 // 12814 // Possible values: 12815 // "UNKNOWN" - Unknown likelihood. 12816 // "VERY_UNLIKELY" - It is very unlikely. 12817 // "UNLIKELY" - It is unlikely. 12818 // "POSSIBLE" - It is possible. 12819 // "LIKELY" - It is likely. 12820 // "VERY_LIKELY" - It is very likely. 12821 Violence string `json:"violence,omitempty"` 12822 12823 // ForceSendFields is a list of field names (e.g. "Adult") to 12824 // unconditionally include in API requests. By default, fields with 12825 // empty values are omitted from API requests. However, any non-pointer, 12826 // non-interface field appearing in ForceSendFields will be sent to the 12827 // server regardless of whether the field is empty or not. This may be 12828 // used to include empty fields in Patch requests. 12829 ForceSendFields []string `json:"-"` 12830 12831 // NullFields is a list of field names (e.g. "Adult") to include in API 12832 // requests with the JSON null value. By default, fields with empty 12833 // values are omitted from API requests. However, any field with an 12834 // empty value appearing in NullFields will be sent to the server as 12835 // null. It is an error if a field in this list has a non-empty value. 12836 // This may be used to include null fields in Patch requests. 12837 NullFields []string `json:"-"` 12838} 12839 12840func (s *SafeSearchAnnotation) MarshalJSON() ([]byte, error) { 12841 type NoMethod SafeSearchAnnotation 12842 raw := NoMethod(*s) 12843 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12844} 12845 12846// Status: The `Status` type defines a logical error model that is 12847// suitable for different programming environments, including REST APIs 12848// and RPC APIs. It is used by gRPC (https://github.com/grpc). Each 12849// `Status` message contains three pieces of data: error code, error 12850// message, and error details. You can find out more about this error 12851// model and how to work with it in the API Design Guide 12852// (https://cloud.google.com/apis/design/errors). 12853type Status struct { 12854 // Code: The status code, which should be an enum value of 12855 // google.rpc.Code. 12856 Code int64 `json:"code,omitempty"` 12857 12858 // Details: A list of messages that carry the error details. There is a 12859 // common set of message types for APIs to use. 12860 Details []googleapi.RawMessage `json:"details,omitempty"` 12861 12862 // Message: A developer-facing error message, which should be in 12863 // English. Any user-facing error message should be localized and sent 12864 // in the google.rpc.Status.details field, or localized by the client. 12865 Message string `json:"message,omitempty"` 12866 12867 // ForceSendFields is a list of field names (e.g. "Code") to 12868 // unconditionally include in API requests. By default, fields with 12869 // empty values are omitted from API requests. However, any non-pointer, 12870 // non-interface field appearing in ForceSendFields will be sent to the 12871 // server regardless of whether the field is empty or not. This may be 12872 // used to include empty fields in Patch requests. 12873 ForceSendFields []string `json:"-"` 12874 12875 // NullFields is a list of field names (e.g. "Code") to include in API 12876 // requests with the JSON null value. By default, fields with empty 12877 // values are omitted from API requests. However, any field with an 12878 // empty value appearing in NullFields will be sent to the server as 12879 // null. It is an error if a field in this list has a non-empty value. 12880 // This may be used to include null fields in Patch requests. 12881 NullFields []string `json:"-"` 12882} 12883 12884func (s *Status) MarshalJSON() ([]byte, error) { 12885 type NoMethod Status 12886 raw := NoMethod(*s) 12887 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12888} 12889 12890// Symbol: A single symbol representation. 12891type Symbol struct { 12892 // BoundingBox: The bounding box for the symbol. The vertices are in the 12893 // order of top-left, top-right, bottom-right, bottom-left. When a 12894 // rotation of the bounding box is detected the rotation is represented 12895 // as around the top-left corner as defined when the text is read in the 12896 // 'natural' orientation. For example: * when the text is horizontal it 12897 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 12898 // around the top-left corner it becomes: 2----3 | | 1----0 and the 12899 // vertex order will still be (0, 1, 2, 3). 12900 BoundingBox *BoundingPoly `json:"boundingBox,omitempty"` 12901 12902 // Confidence: Confidence of the OCR results for the symbol. Range [0, 12903 // 1]. 12904 Confidence float64 `json:"confidence,omitempty"` 12905 12906 // Property: Additional information detected for the symbol. 12907 Property *TextProperty `json:"property,omitempty"` 12908 12909 // Text: The actual UTF-8 representation of the symbol. 12910 Text string `json:"text,omitempty"` 12911 12912 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 12913 // unconditionally include in API requests. By default, fields with 12914 // empty values are omitted from API requests. However, any non-pointer, 12915 // non-interface field appearing in ForceSendFields will be sent to the 12916 // server regardless of whether the field is empty or not. This may be 12917 // used to include empty fields in Patch requests. 12918 ForceSendFields []string `json:"-"` 12919 12920 // NullFields is a list of field names (e.g. "BoundingBox") to include 12921 // in API requests with the JSON null value. By default, fields with 12922 // empty values are omitted from API requests. However, any field with 12923 // an empty value appearing in NullFields will be sent to the server as 12924 // null. It is an error if a field in this list has a non-empty value. 12925 // This may be used to include null fields in Patch requests. 12926 NullFields []string `json:"-"` 12927} 12928 12929func (s *Symbol) MarshalJSON() ([]byte, error) { 12930 type NoMethod Symbol 12931 raw := NoMethod(*s) 12932 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12933} 12934 12935func (s *Symbol) UnmarshalJSON(data []byte) error { 12936 type NoMethod Symbol 12937 var s1 struct { 12938 Confidence gensupport.JSONFloat64 `json:"confidence"` 12939 *NoMethod 12940 } 12941 s1.NoMethod = (*NoMethod)(s) 12942 if err := json.Unmarshal(data, &s1); err != nil { 12943 return err 12944 } 12945 s.Confidence = float64(s1.Confidence) 12946 return nil 12947} 12948 12949// TextAnnotation: TextAnnotation contains a structured representation 12950// of OCR extracted text. The hierarchy of an OCR extracted text 12951// structure is like this: TextAnnotation -> Page -> Block -> Paragraph 12952// -> Word -> Symbol Each structural component, starting from Page, may 12953// further have their own properties. Properties describe detected 12954// languages, breaks etc.. Please refer to the 12955// TextAnnotation.TextProperty message definition below for more detail. 12956type TextAnnotation struct { 12957 // Pages: List of pages detected by OCR. 12958 Pages []*Page `json:"pages,omitempty"` 12959 12960 // Text: UTF-8 text detected on the pages. 12961 Text string `json:"text,omitempty"` 12962 12963 // ForceSendFields is a list of field names (e.g. "Pages") to 12964 // unconditionally include in API requests. By default, fields with 12965 // empty values are omitted from API requests. However, any non-pointer, 12966 // non-interface field appearing in ForceSendFields will be sent to the 12967 // server regardless of whether the field is empty or not. This may be 12968 // used to include empty fields in Patch requests. 12969 ForceSendFields []string `json:"-"` 12970 12971 // NullFields is a list of field names (e.g. "Pages") to include in API 12972 // requests with the JSON null value. By default, fields with empty 12973 // values are omitted from API requests. However, any field with an 12974 // empty value appearing in NullFields will be sent to the server as 12975 // null. It is an error if a field in this list has a non-empty value. 12976 // This may be used to include null fields in Patch requests. 12977 NullFields []string `json:"-"` 12978} 12979 12980func (s *TextAnnotation) MarshalJSON() ([]byte, error) { 12981 type NoMethod TextAnnotation 12982 raw := NoMethod(*s) 12983 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 12984} 12985 12986// TextProperty: Additional information detected on the structural 12987// component. 12988type TextProperty struct { 12989 // DetectedBreak: Detected start or end of a text segment. 12990 DetectedBreak *DetectedBreak `json:"detectedBreak,omitempty"` 12991 12992 // DetectedLanguages: A list of detected languages together with 12993 // confidence. 12994 DetectedLanguages []*DetectedLanguage `json:"detectedLanguages,omitempty"` 12995 12996 // ForceSendFields is a list of field names (e.g. "DetectedBreak") to 12997 // unconditionally include in API requests. By default, fields with 12998 // empty values are omitted from API requests. However, any non-pointer, 12999 // non-interface field appearing in ForceSendFields will be sent to the 13000 // server regardless of whether the field is empty or not. This may be 13001 // used to include empty fields in Patch requests. 13002 ForceSendFields []string `json:"-"` 13003 13004 // NullFields is a list of field names (e.g. "DetectedBreak") to include 13005 // in API requests with the JSON null value. By default, fields with 13006 // empty values are omitted from API requests. However, any field with 13007 // an empty value appearing in NullFields will be sent to the server as 13008 // null. It is an error if a field in this list has a non-empty value. 13009 // This may be used to include null fields in Patch requests. 13010 NullFields []string `json:"-"` 13011} 13012 13013func (s *TextProperty) MarshalJSON() ([]byte, error) { 13014 type NoMethod TextProperty 13015 raw := NoMethod(*s) 13016 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 13017} 13018 13019// Vertex: A vertex represents a 2D point in the image. NOTE: the vertex 13020// coordinates are in the same scale as the original image. 13021type Vertex struct { 13022 // X: X coordinate. 13023 X int64 `json:"x,omitempty"` 13024 13025 // Y: Y coordinate. 13026 Y int64 `json:"y,omitempty"` 13027 13028 // ForceSendFields is a list of field names (e.g. "X") to 13029 // unconditionally include in API requests. By default, fields with 13030 // empty values are omitted from API requests. However, any non-pointer, 13031 // non-interface field appearing in ForceSendFields will be sent to the 13032 // server regardless of whether the field is empty or not. This may be 13033 // used to include empty fields in Patch requests. 13034 ForceSendFields []string `json:"-"` 13035 13036 // NullFields is a list of field names (e.g. "X") to include in API 13037 // requests with the JSON null value. By default, fields with empty 13038 // values are omitted from API requests. However, any field with an 13039 // empty value appearing in NullFields will be sent to the server as 13040 // null. It is an error if a field in this list has a non-empty value. 13041 // This may be used to include null fields in Patch requests. 13042 NullFields []string `json:"-"` 13043} 13044 13045func (s *Vertex) MarshalJSON() ([]byte, error) { 13046 type NoMethod Vertex 13047 raw := NoMethod(*s) 13048 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 13049} 13050 13051// WebDetection: Relevant information for the image from the Internet. 13052type WebDetection struct { 13053 // BestGuessLabels: The service's best guess as to the topic of the 13054 // request image. Inferred from similar images on the open web. 13055 BestGuessLabels []*WebLabel `json:"bestGuessLabels,omitempty"` 13056 13057 // FullMatchingImages: Fully matching images from the Internet. Can 13058 // include resized copies of the query image. 13059 FullMatchingImages []*WebImage `json:"fullMatchingImages,omitempty"` 13060 13061 // PagesWithMatchingImages: Web pages containing the matching images 13062 // from the Internet. 13063 PagesWithMatchingImages []*WebPage `json:"pagesWithMatchingImages,omitempty"` 13064 13065 // PartialMatchingImages: Partial matching images from the Internet. 13066 // Those images are similar enough to share some key-point features. For 13067 // example an original image will likely have partial matching for its 13068 // crops. 13069 PartialMatchingImages []*WebImage `json:"partialMatchingImages,omitempty"` 13070 13071 // VisuallySimilarImages: The visually similar image results. 13072 VisuallySimilarImages []*WebImage `json:"visuallySimilarImages,omitempty"` 13073 13074 // WebEntities: Deduced entities from similar images on the Internet. 13075 WebEntities []*WebEntity `json:"webEntities,omitempty"` 13076 13077 // ForceSendFields is a list of field names (e.g. "BestGuessLabels") to 13078 // unconditionally include in API requests. By default, fields with 13079 // empty values are omitted from API requests. However, any non-pointer, 13080 // non-interface field appearing in ForceSendFields will be sent to the 13081 // server regardless of whether the field is empty or not. This may be 13082 // used to include empty fields in Patch requests. 13083 ForceSendFields []string `json:"-"` 13084 13085 // NullFields is a list of field names (e.g. "BestGuessLabels") to 13086 // include in API requests with the JSON null value. By default, fields 13087 // with empty values are omitted from API requests. However, any field 13088 // with an empty value appearing in NullFields will be sent to the 13089 // server as null. It is an error if a field in this list has a 13090 // non-empty value. This may be used to include null fields in Patch 13091 // requests. 13092 NullFields []string `json:"-"` 13093} 13094 13095func (s *WebDetection) MarshalJSON() ([]byte, error) { 13096 type NoMethod WebDetection 13097 raw := NoMethod(*s) 13098 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 13099} 13100 13101// WebEntity: Entity deduced from similar images on the Internet. 13102type WebEntity struct { 13103 // Description: Canonical description of the entity, in English. 13104 Description string `json:"description,omitempty"` 13105 13106 // EntityId: Opaque entity ID. 13107 EntityId string `json:"entityId,omitempty"` 13108 13109 // Score: Overall relevancy score for the entity. Not normalized and not 13110 // comparable across different image queries. 13111 Score float64 `json:"score,omitempty"` 13112 13113 // ForceSendFields is a list of field names (e.g. "Description") to 13114 // unconditionally include in API requests. By default, fields with 13115 // empty values are omitted from API requests. However, any non-pointer, 13116 // non-interface field appearing in ForceSendFields will be sent to the 13117 // server regardless of whether the field is empty or not. This may be 13118 // used to include empty fields in Patch requests. 13119 ForceSendFields []string `json:"-"` 13120 13121 // NullFields is a list of field names (e.g. "Description") to include 13122 // in API requests with the JSON null value. By default, fields with 13123 // empty values are omitted from API requests. However, any field with 13124 // an empty value appearing in NullFields will be sent to the server as 13125 // null. It is an error if a field in this list has a non-empty value. 13126 // This may be used to include null fields in Patch requests. 13127 NullFields []string `json:"-"` 13128} 13129 13130func (s *WebEntity) MarshalJSON() ([]byte, error) { 13131 type NoMethod WebEntity 13132 raw := NoMethod(*s) 13133 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 13134} 13135 13136func (s *WebEntity) UnmarshalJSON(data []byte) error { 13137 type NoMethod WebEntity 13138 var s1 struct { 13139 Score gensupport.JSONFloat64 `json:"score"` 13140 *NoMethod 13141 } 13142 s1.NoMethod = (*NoMethod)(s) 13143 if err := json.Unmarshal(data, &s1); err != nil { 13144 return err 13145 } 13146 s.Score = float64(s1.Score) 13147 return nil 13148} 13149 13150// WebImage: Metadata for online images. 13151type WebImage struct { 13152 // Score: (Deprecated) Overall relevancy score for the image. 13153 Score float64 `json:"score,omitempty"` 13154 13155 // Url: The result image URL. 13156 Url string `json:"url,omitempty"` 13157 13158 // ForceSendFields is a list of field names (e.g. "Score") to 13159 // unconditionally include in API requests. By default, fields with 13160 // empty values are omitted from API requests. However, any non-pointer, 13161 // non-interface field appearing in ForceSendFields will be sent to the 13162 // server regardless of whether the field is empty or not. This may be 13163 // used to include empty fields in Patch requests. 13164 ForceSendFields []string `json:"-"` 13165 13166 // NullFields is a list of field names (e.g. "Score") to include in API 13167 // requests with the JSON null value. By default, fields with empty 13168 // values are omitted from API requests. However, any field with an 13169 // empty value appearing in NullFields will be sent to the server as 13170 // null. It is an error if a field in this list has a non-empty value. 13171 // This may be used to include null fields in Patch requests. 13172 NullFields []string `json:"-"` 13173} 13174 13175func (s *WebImage) MarshalJSON() ([]byte, error) { 13176 type NoMethod WebImage 13177 raw := NoMethod(*s) 13178 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 13179} 13180 13181func (s *WebImage) UnmarshalJSON(data []byte) error { 13182 type NoMethod WebImage 13183 var s1 struct { 13184 Score gensupport.JSONFloat64 `json:"score"` 13185 *NoMethod 13186 } 13187 s1.NoMethod = (*NoMethod)(s) 13188 if err := json.Unmarshal(data, &s1); err != nil { 13189 return err 13190 } 13191 s.Score = float64(s1.Score) 13192 return nil 13193} 13194 13195// WebLabel: Label to provide extra metadata for the web detection. 13196type WebLabel struct { 13197 // Label: Label for extra metadata. 13198 Label string `json:"label,omitempty"` 13199 13200 // LanguageCode: The BCP-47 language code for `label`, such as "en-US" 13201 // or "sr-Latn". For more information, see 13202 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 13203 LanguageCode string `json:"languageCode,omitempty"` 13204 13205 // ForceSendFields is a list of field names (e.g. "Label") to 13206 // unconditionally include in API requests. By default, fields with 13207 // empty values are omitted from API requests. However, any non-pointer, 13208 // non-interface field appearing in ForceSendFields will be sent to the 13209 // server regardless of whether the field is empty or not. This may be 13210 // used to include empty fields in Patch requests. 13211 ForceSendFields []string `json:"-"` 13212 13213 // NullFields is a list of field names (e.g. "Label") to include in API 13214 // requests with the JSON null value. By default, fields with empty 13215 // values are omitted from API requests. However, any field with an 13216 // empty value appearing in NullFields will be sent to the server as 13217 // null. It is an error if a field in this list has a non-empty value. 13218 // This may be used to include null fields in Patch requests. 13219 NullFields []string `json:"-"` 13220} 13221 13222func (s *WebLabel) MarshalJSON() ([]byte, error) { 13223 type NoMethod WebLabel 13224 raw := NoMethod(*s) 13225 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 13226} 13227 13228// WebPage: Metadata for web pages. 13229type WebPage struct { 13230 // FullMatchingImages: Fully matching images on the page. Can include 13231 // resized copies of the query image. 13232 FullMatchingImages []*WebImage `json:"fullMatchingImages,omitempty"` 13233 13234 // PageTitle: Title for the web page, may contain HTML markups. 13235 PageTitle string `json:"pageTitle,omitempty"` 13236 13237 // PartialMatchingImages: Partial matching images on the page. Those 13238 // images are similar enough to share some key-point features. For 13239 // example an original image will likely have partial matching for its 13240 // crops. 13241 PartialMatchingImages []*WebImage `json:"partialMatchingImages,omitempty"` 13242 13243 // Score: (Deprecated) Overall relevancy score for the web page. 13244 Score float64 `json:"score,omitempty"` 13245 13246 // Url: The result web page URL. 13247 Url string `json:"url,omitempty"` 13248 13249 // ForceSendFields is a list of field names (e.g. "FullMatchingImages") 13250 // to unconditionally include in API requests. By default, fields with 13251 // empty values are omitted from API requests. However, any non-pointer, 13252 // non-interface field appearing in ForceSendFields will be sent to the 13253 // server regardless of whether the field is empty or not. This may be 13254 // used to include empty fields in Patch requests. 13255 ForceSendFields []string `json:"-"` 13256 13257 // NullFields is a list of field names (e.g. "FullMatchingImages") to 13258 // include in API requests with the JSON null value. By default, fields 13259 // with empty values are omitted from API requests. However, any field 13260 // with an empty value appearing in NullFields will be sent to the 13261 // server as null. It is an error if a field in this list has a 13262 // non-empty value. This may be used to include null fields in Patch 13263 // requests. 13264 NullFields []string `json:"-"` 13265} 13266 13267func (s *WebPage) MarshalJSON() ([]byte, error) { 13268 type NoMethod WebPage 13269 raw := NoMethod(*s) 13270 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 13271} 13272 13273func (s *WebPage) UnmarshalJSON(data []byte) error { 13274 type NoMethod WebPage 13275 var s1 struct { 13276 Score gensupport.JSONFloat64 `json:"score"` 13277 *NoMethod 13278 } 13279 s1.NoMethod = (*NoMethod)(s) 13280 if err := json.Unmarshal(data, &s1); err != nil { 13281 return err 13282 } 13283 s.Score = float64(s1.Score) 13284 return nil 13285} 13286 13287// Word: A word representation. 13288type Word struct { 13289 // BoundingBox: The bounding box for the word. The vertices are in the 13290 // order of top-left, top-right, bottom-right, bottom-left. When a 13291 // rotation of the bounding box is detected the rotation is represented 13292 // as around the top-left corner as defined when the text is read in the 13293 // 'natural' orientation. For example: * when the text is horizontal it 13294 // might look like: 0----1 | | 3----2 * when it's rotated 180 degrees 13295 // around the top-left corner it becomes: 2----3 | | 1----0 and the 13296 // vertex order will still be (0, 1, 2, 3). 13297 BoundingBox *BoundingPoly `json:"boundingBox,omitempty"` 13298 13299 // Confidence: Confidence of the OCR results for the word. Range [0, 1]. 13300 Confidence float64 `json:"confidence,omitempty"` 13301 13302 // Property: Additional information detected for the word. 13303 Property *TextProperty `json:"property,omitempty"` 13304 13305 // Symbols: List of symbols in the word. The order of the symbols 13306 // follows the natural reading order. 13307 Symbols []*Symbol `json:"symbols,omitempty"` 13308 13309 // ForceSendFields is a list of field names (e.g. "BoundingBox") to 13310 // unconditionally include in API requests. By default, fields with 13311 // empty values are omitted from API requests. However, any non-pointer, 13312 // non-interface field appearing in ForceSendFields will be sent to the 13313 // server regardless of whether the field is empty or not. This may be 13314 // used to include empty fields in Patch requests. 13315 ForceSendFields []string `json:"-"` 13316 13317 // NullFields is a list of field names (e.g. "BoundingBox") to include 13318 // in API requests with the JSON null value. By default, fields with 13319 // empty values are omitted from API requests. However, any field with 13320 // an empty value appearing in NullFields will be sent to the server as 13321 // null. It is an error if a field in this list has a non-empty value. 13322 // This may be used to include null fields in Patch requests. 13323 NullFields []string `json:"-"` 13324} 13325 13326func (s *Word) MarshalJSON() ([]byte, error) { 13327 type NoMethod Word 13328 raw := NoMethod(*s) 13329 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 13330} 13331 13332func (s *Word) UnmarshalJSON(data []byte) error { 13333 type NoMethod Word 13334 var s1 struct { 13335 Confidence gensupport.JSONFloat64 `json:"confidence"` 13336 *NoMethod 13337 } 13338 s1.NoMethod = (*NoMethod)(s) 13339 if err := json.Unmarshal(data, &s1); err != nil { 13340 return err 13341 } 13342 s.Confidence = float64(s1.Confidence) 13343 return nil 13344} 13345 13346// method id "vision.files.annotate": 13347 13348type FilesAnnotateCall struct { 13349 s *Service 13350 googlecloudvisionv1p1beta1batchannotatefilesrequest *GoogleCloudVisionV1p1beta1BatchAnnotateFilesRequest 13351 urlParams_ gensupport.URLParams 13352 ctx_ context.Context 13353 header_ http.Header 13354} 13355 13356// Annotate: Service that performs image detection and annotation for a 13357// batch of files. Now only "application/pdf", "image/tiff" and 13358// "image/gif" are supported. This service will extract at most 5 13359// (customers can specify which 5 in AnnotateFileRequest.pages) frames 13360// (gif) or pages (pdf or tiff) from each file provided and perform 13361// detection and annotation for each image extracted. 13362func (r *FilesService) Annotate(googlecloudvisionv1p1beta1batchannotatefilesrequest *GoogleCloudVisionV1p1beta1BatchAnnotateFilesRequest) *FilesAnnotateCall { 13363 c := &FilesAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13364 c.googlecloudvisionv1p1beta1batchannotatefilesrequest = googlecloudvisionv1p1beta1batchannotatefilesrequest 13365 return c 13366} 13367 13368// Fields allows partial responses to be retrieved. See 13369// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13370// for more information. 13371func (c *FilesAnnotateCall) Fields(s ...googleapi.Field) *FilesAnnotateCall { 13372 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13373 return c 13374} 13375 13376// Context sets the context to be used in this call's Do method. Any 13377// pending HTTP request will be aborted if the provided context is 13378// canceled. 13379func (c *FilesAnnotateCall) Context(ctx context.Context) *FilesAnnotateCall { 13380 c.ctx_ = ctx 13381 return c 13382} 13383 13384// Header returns an http.Header that can be modified by the caller to 13385// add HTTP headers to the request. 13386func (c *FilesAnnotateCall) Header() http.Header { 13387 if c.header_ == nil { 13388 c.header_ = make(http.Header) 13389 } 13390 return c.header_ 13391} 13392 13393func (c *FilesAnnotateCall) doRequest(alt string) (*http.Response, error) { 13394 reqHeaders := make(http.Header) 13395 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 13396 for k, v := range c.header_ { 13397 reqHeaders[k] = v 13398 } 13399 reqHeaders.Set("User-Agent", c.s.userAgent()) 13400 var body io.Reader = nil 13401 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p1beta1batchannotatefilesrequest) 13402 if err != nil { 13403 return nil, err 13404 } 13405 reqHeaders.Set("Content-Type", "application/json") 13406 c.urlParams_.Set("alt", alt) 13407 c.urlParams_.Set("prettyPrint", "false") 13408 urls := googleapi.ResolveRelative(c.s.BasePath, "v1p1beta1/files:annotate") 13409 urls += "?" + c.urlParams_.Encode() 13410 req, err := http.NewRequest("POST", urls, body) 13411 if err != nil { 13412 return nil, err 13413 } 13414 req.Header = reqHeaders 13415 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13416} 13417 13418// Do executes the "vision.files.annotate" call. 13419// Exactly one of *GoogleCloudVisionV1p1beta1BatchAnnotateFilesResponse 13420// or error will be non-nil. Any non-2xx status code is an error. 13421// Response headers are in either 13422// *GoogleCloudVisionV1p1beta1BatchAnnotateFilesResponse.ServerResponse.H 13423// eader or (if a response was returned at all) in 13424// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 13425// whether the returned error was because http.StatusNotModified was 13426// returned. 13427func (c *FilesAnnotateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudVisionV1p1beta1BatchAnnotateFilesResponse, error) { 13428 gensupport.SetOptions(c.urlParams_, opts...) 13429 res, err := c.doRequest("json") 13430 if res != nil && res.StatusCode == http.StatusNotModified { 13431 if res.Body != nil { 13432 res.Body.Close() 13433 } 13434 return nil, &googleapi.Error{ 13435 Code: res.StatusCode, 13436 Header: res.Header, 13437 } 13438 } 13439 if err != nil { 13440 return nil, err 13441 } 13442 defer googleapi.CloseBody(res) 13443 if err := googleapi.CheckResponse(res); err != nil { 13444 return nil, err 13445 } 13446 ret := &GoogleCloudVisionV1p1beta1BatchAnnotateFilesResponse{ 13447 ServerResponse: googleapi.ServerResponse{ 13448 Header: res.Header, 13449 HTTPStatusCode: res.StatusCode, 13450 }, 13451 } 13452 target := &ret 13453 if err := gensupport.DecodeResponse(target, res); err != nil { 13454 return nil, err 13455 } 13456 return ret, nil 13457 // { 13458 // "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.", 13459 // "flatPath": "v1p1beta1/files:annotate", 13460 // "httpMethod": "POST", 13461 // "id": "vision.files.annotate", 13462 // "parameterOrder": [], 13463 // "parameters": {}, 13464 // "path": "v1p1beta1/files:annotate", 13465 // "request": { 13466 // "$ref": "GoogleCloudVisionV1p1beta1BatchAnnotateFilesRequest" 13467 // }, 13468 // "response": { 13469 // "$ref": "GoogleCloudVisionV1p1beta1BatchAnnotateFilesResponse" 13470 // }, 13471 // "scopes": [ 13472 // "https://www.googleapis.com/auth/cloud-platform", 13473 // "https://www.googleapis.com/auth/cloud-vision" 13474 // ] 13475 // } 13476 13477} 13478 13479// method id "vision.files.asyncBatchAnnotate": 13480 13481type FilesAsyncBatchAnnotateCall struct { 13482 s *Service 13483 googlecloudvisionv1p1beta1asyncbatchannotatefilesrequest *GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesRequest 13484 urlParams_ gensupport.URLParams 13485 ctx_ context.Context 13486 header_ http.Header 13487} 13488 13489// AsyncBatchAnnotate: Run asynchronous image detection and annotation 13490// for a list of generic files, such as PDF files, which may contain 13491// multiple pages and multiple images per page. Progress and results can 13492// be retrieved through the `google.longrunning.Operations` interface. 13493// `Operation.metadata` contains `OperationMetadata` (metadata). 13494// `Operation.response` contains `AsyncBatchAnnotateFilesResponse` 13495// (results). 13496func (r *FilesService) AsyncBatchAnnotate(googlecloudvisionv1p1beta1asyncbatchannotatefilesrequest *GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesRequest) *FilesAsyncBatchAnnotateCall { 13497 c := &FilesAsyncBatchAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13498 c.googlecloudvisionv1p1beta1asyncbatchannotatefilesrequest = googlecloudvisionv1p1beta1asyncbatchannotatefilesrequest 13499 return c 13500} 13501 13502// Fields allows partial responses to be retrieved. See 13503// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13504// for more information. 13505func (c *FilesAsyncBatchAnnotateCall) Fields(s ...googleapi.Field) *FilesAsyncBatchAnnotateCall { 13506 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13507 return c 13508} 13509 13510// Context sets the context to be used in this call's Do method. Any 13511// pending HTTP request will be aborted if the provided context is 13512// canceled. 13513func (c *FilesAsyncBatchAnnotateCall) Context(ctx context.Context) *FilesAsyncBatchAnnotateCall { 13514 c.ctx_ = ctx 13515 return c 13516} 13517 13518// Header returns an http.Header that can be modified by the caller to 13519// add HTTP headers to the request. 13520func (c *FilesAsyncBatchAnnotateCall) Header() http.Header { 13521 if c.header_ == nil { 13522 c.header_ = make(http.Header) 13523 } 13524 return c.header_ 13525} 13526 13527func (c *FilesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { 13528 reqHeaders := make(http.Header) 13529 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 13530 for k, v := range c.header_ { 13531 reqHeaders[k] = v 13532 } 13533 reqHeaders.Set("User-Agent", c.s.userAgent()) 13534 var body io.Reader = nil 13535 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p1beta1asyncbatchannotatefilesrequest) 13536 if err != nil { 13537 return nil, err 13538 } 13539 reqHeaders.Set("Content-Type", "application/json") 13540 c.urlParams_.Set("alt", alt) 13541 c.urlParams_.Set("prettyPrint", "false") 13542 urls := googleapi.ResolveRelative(c.s.BasePath, "v1p1beta1/files:asyncBatchAnnotate") 13543 urls += "?" + c.urlParams_.Encode() 13544 req, err := http.NewRequest("POST", urls, body) 13545 if err != nil { 13546 return nil, err 13547 } 13548 req.Header = reqHeaders 13549 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13550} 13551 13552// Do executes the "vision.files.asyncBatchAnnotate" call. 13553// Exactly one of *Operation or error will be non-nil. Any non-2xx 13554// status code is an error. Response headers are in either 13555// *Operation.ServerResponse.Header or (if a response was returned at 13556// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 13557// to check whether the returned error was because 13558// http.StatusNotModified was returned. 13559func (c *FilesAsyncBatchAnnotateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 13560 gensupport.SetOptions(c.urlParams_, opts...) 13561 res, err := c.doRequest("json") 13562 if res != nil && res.StatusCode == http.StatusNotModified { 13563 if res.Body != nil { 13564 res.Body.Close() 13565 } 13566 return nil, &googleapi.Error{ 13567 Code: res.StatusCode, 13568 Header: res.Header, 13569 } 13570 } 13571 if err != nil { 13572 return nil, err 13573 } 13574 defer googleapi.CloseBody(res) 13575 if err := googleapi.CheckResponse(res); err != nil { 13576 return nil, err 13577 } 13578 ret := &Operation{ 13579 ServerResponse: googleapi.ServerResponse{ 13580 Header: res.Header, 13581 HTTPStatusCode: res.StatusCode, 13582 }, 13583 } 13584 target := &ret 13585 if err := gensupport.DecodeResponse(target, res); err != nil { 13586 return nil, err 13587 } 13588 return ret, nil 13589 // { 13590 // "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).", 13591 // "flatPath": "v1p1beta1/files:asyncBatchAnnotate", 13592 // "httpMethod": "POST", 13593 // "id": "vision.files.asyncBatchAnnotate", 13594 // "parameterOrder": [], 13595 // "parameters": {}, 13596 // "path": "v1p1beta1/files:asyncBatchAnnotate", 13597 // "request": { 13598 // "$ref": "GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesRequest" 13599 // }, 13600 // "response": { 13601 // "$ref": "Operation" 13602 // }, 13603 // "scopes": [ 13604 // "https://www.googleapis.com/auth/cloud-platform", 13605 // "https://www.googleapis.com/auth/cloud-vision" 13606 // ] 13607 // } 13608 13609} 13610 13611// method id "vision.images.annotate": 13612 13613type ImagesAnnotateCall struct { 13614 s *Service 13615 googlecloudvisionv1p1beta1batchannotateimagesrequest *GoogleCloudVisionV1p1beta1BatchAnnotateImagesRequest 13616 urlParams_ gensupport.URLParams 13617 ctx_ context.Context 13618 header_ http.Header 13619} 13620 13621// Annotate: Run image detection and annotation for a batch of images. 13622func (r *ImagesService) Annotate(googlecloudvisionv1p1beta1batchannotateimagesrequest *GoogleCloudVisionV1p1beta1BatchAnnotateImagesRequest) *ImagesAnnotateCall { 13623 c := &ImagesAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13624 c.googlecloudvisionv1p1beta1batchannotateimagesrequest = googlecloudvisionv1p1beta1batchannotateimagesrequest 13625 return c 13626} 13627 13628// Fields allows partial responses to be retrieved. See 13629// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13630// for more information. 13631func (c *ImagesAnnotateCall) Fields(s ...googleapi.Field) *ImagesAnnotateCall { 13632 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13633 return c 13634} 13635 13636// Context sets the context to be used in this call's Do method. Any 13637// pending HTTP request will be aborted if the provided context is 13638// canceled. 13639func (c *ImagesAnnotateCall) Context(ctx context.Context) *ImagesAnnotateCall { 13640 c.ctx_ = ctx 13641 return c 13642} 13643 13644// Header returns an http.Header that can be modified by the caller to 13645// add HTTP headers to the request. 13646func (c *ImagesAnnotateCall) Header() http.Header { 13647 if c.header_ == nil { 13648 c.header_ = make(http.Header) 13649 } 13650 return c.header_ 13651} 13652 13653func (c *ImagesAnnotateCall) doRequest(alt string) (*http.Response, error) { 13654 reqHeaders := make(http.Header) 13655 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 13656 for k, v := range c.header_ { 13657 reqHeaders[k] = v 13658 } 13659 reqHeaders.Set("User-Agent", c.s.userAgent()) 13660 var body io.Reader = nil 13661 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p1beta1batchannotateimagesrequest) 13662 if err != nil { 13663 return nil, err 13664 } 13665 reqHeaders.Set("Content-Type", "application/json") 13666 c.urlParams_.Set("alt", alt) 13667 c.urlParams_.Set("prettyPrint", "false") 13668 urls := googleapi.ResolveRelative(c.s.BasePath, "v1p1beta1/images:annotate") 13669 urls += "?" + c.urlParams_.Encode() 13670 req, err := http.NewRequest("POST", urls, body) 13671 if err != nil { 13672 return nil, err 13673 } 13674 req.Header = reqHeaders 13675 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13676} 13677 13678// Do executes the "vision.images.annotate" call. 13679// Exactly one of *GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse 13680// or error will be non-nil. Any non-2xx status code is an error. 13681// Response headers are in either 13682// *GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse.ServerResponse. 13683// Header or (if a response was returned at all) in 13684// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 13685// whether the returned error was because http.StatusNotModified was 13686// returned. 13687func (c *ImagesAnnotateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse, error) { 13688 gensupport.SetOptions(c.urlParams_, opts...) 13689 res, err := c.doRequest("json") 13690 if res != nil && res.StatusCode == http.StatusNotModified { 13691 if res.Body != nil { 13692 res.Body.Close() 13693 } 13694 return nil, &googleapi.Error{ 13695 Code: res.StatusCode, 13696 Header: res.Header, 13697 } 13698 } 13699 if err != nil { 13700 return nil, err 13701 } 13702 defer googleapi.CloseBody(res) 13703 if err := googleapi.CheckResponse(res); err != nil { 13704 return nil, err 13705 } 13706 ret := &GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse{ 13707 ServerResponse: googleapi.ServerResponse{ 13708 Header: res.Header, 13709 HTTPStatusCode: res.StatusCode, 13710 }, 13711 } 13712 target := &ret 13713 if err := gensupport.DecodeResponse(target, res); err != nil { 13714 return nil, err 13715 } 13716 return ret, nil 13717 // { 13718 // "description": "Run image detection and annotation for a batch of images.", 13719 // "flatPath": "v1p1beta1/images:annotate", 13720 // "httpMethod": "POST", 13721 // "id": "vision.images.annotate", 13722 // "parameterOrder": [], 13723 // "parameters": {}, 13724 // "path": "v1p1beta1/images:annotate", 13725 // "request": { 13726 // "$ref": "GoogleCloudVisionV1p1beta1BatchAnnotateImagesRequest" 13727 // }, 13728 // "response": { 13729 // "$ref": "GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse" 13730 // }, 13731 // "scopes": [ 13732 // "https://www.googleapis.com/auth/cloud-platform", 13733 // "https://www.googleapis.com/auth/cloud-vision" 13734 // ] 13735 // } 13736 13737} 13738 13739// method id "vision.images.asyncBatchAnnotate": 13740 13741type ImagesAsyncBatchAnnotateCall struct { 13742 s *Service 13743 googlecloudvisionv1p1beta1asyncbatchannotateimagesrequest *GoogleCloudVisionV1p1beta1AsyncBatchAnnotateImagesRequest 13744 urlParams_ gensupport.URLParams 13745 ctx_ context.Context 13746 header_ http.Header 13747} 13748 13749// AsyncBatchAnnotate: Run asynchronous image detection and annotation 13750// for a list of images. Progress and results can be retrieved through 13751// the `google.longrunning.Operations` interface. `Operation.metadata` 13752// contains `OperationMetadata` (metadata). `Operation.response` 13753// contains `AsyncBatchAnnotateImagesResponse` (results). This service 13754// will write image annotation outputs to json files in customer GCS 13755// bucket, each json file containing BatchAnnotateImagesResponse proto. 13756func (r *ImagesService) AsyncBatchAnnotate(googlecloudvisionv1p1beta1asyncbatchannotateimagesrequest *GoogleCloudVisionV1p1beta1AsyncBatchAnnotateImagesRequest) *ImagesAsyncBatchAnnotateCall { 13757 c := &ImagesAsyncBatchAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13758 c.googlecloudvisionv1p1beta1asyncbatchannotateimagesrequest = googlecloudvisionv1p1beta1asyncbatchannotateimagesrequest 13759 return c 13760} 13761 13762// Fields allows partial responses to be retrieved. See 13763// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13764// for more information. 13765func (c *ImagesAsyncBatchAnnotateCall) Fields(s ...googleapi.Field) *ImagesAsyncBatchAnnotateCall { 13766 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13767 return c 13768} 13769 13770// Context sets the context to be used in this call's Do method. Any 13771// pending HTTP request will be aborted if the provided context is 13772// canceled. 13773func (c *ImagesAsyncBatchAnnotateCall) Context(ctx context.Context) *ImagesAsyncBatchAnnotateCall { 13774 c.ctx_ = ctx 13775 return c 13776} 13777 13778// Header returns an http.Header that can be modified by the caller to 13779// add HTTP headers to the request. 13780func (c *ImagesAsyncBatchAnnotateCall) Header() http.Header { 13781 if c.header_ == nil { 13782 c.header_ = make(http.Header) 13783 } 13784 return c.header_ 13785} 13786 13787func (c *ImagesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { 13788 reqHeaders := make(http.Header) 13789 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 13790 for k, v := range c.header_ { 13791 reqHeaders[k] = v 13792 } 13793 reqHeaders.Set("User-Agent", c.s.userAgent()) 13794 var body io.Reader = nil 13795 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p1beta1asyncbatchannotateimagesrequest) 13796 if err != nil { 13797 return nil, err 13798 } 13799 reqHeaders.Set("Content-Type", "application/json") 13800 c.urlParams_.Set("alt", alt) 13801 c.urlParams_.Set("prettyPrint", "false") 13802 urls := googleapi.ResolveRelative(c.s.BasePath, "v1p1beta1/images:asyncBatchAnnotate") 13803 urls += "?" + c.urlParams_.Encode() 13804 req, err := http.NewRequest("POST", urls, body) 13805 if err != nil { 13806 return nil, err 13807 } 13808 req.Header = reqHeaders 13809 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13810} 13811 13812// Do executes the "vision.images.asyncBatchAnnotate" call. 13813// Exactly one of *Operation or error will be non-nil. Any non-2xx 13814// status code is an error. Response headers are in either 13815// *Operation.ServerResponse.Header or (if a response was returned at 13816// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 13817// to check whether the returned error was because 13818// http.StatusNotModified was returned. 13819func (c *ImagesAsyncBatchAnnotateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 13820 gensupport.SetOptions(c.urlParams_, opts...) 13821 res, err := c.doRequest("json") 13822 if res != nil && res.StatusCode == http.StatusNotModified { 13823 if res.Body != nil { 13824 res.Body.Close() 13825 } 13826 return nil, &googleapi.Error{ 13827 Code: res.StatusCode, 13828 Header: res.Header, 13829 } 13830 } 13831 if err != nil { 13832 return nil, err 13833 } 13834 defer googleapi.CloseBody(res) 13835 if err := googleapi.CheckResponse(res); err != nil { 13836 return nil, err 13837 } 13838 ret := &Operation{ 13839 ServerResponse: googleapi.ServerResponse{ 13840 Header: res.Header, 13841 HTTPStatusCode: res.StatusCode, 13842 }, 13843 } 13844 target := &ret 13845 if err := gensupport.DecodeResponse(target, res); err != nil { 13846 return nil, err 13847 } 13848 return ret, nil 13849 // { 13850 // "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.", 13851 // "flatPath": "v1p1beta1/images:asyncBatchAnnotate", 13852 // "httpMethod": "POST", 13853 // "id": "vision.images.asyncBatchAnnotate", 13854 // "parameterOrder": [], 13855 // "parameters": {}, 13856 // "path": "v1p1beta1/images:asyncBatchAnnotate", 13857 // "request": { 13858 // "$ref": "GoogleCloudVisionV1p1beta1AsyncBatchAnnotateImagesRequest" 13859 // }, 13860 // "response": { 13861 // "$ref": "Operation" 13862 // }, 13863 // "scopes": [ 13864 // "https://www.googleapis.com/auth/cloud-platform", 13865 // "https://www.googleapis.com/auth/cloud-vision" 13866 // ] 13867 // } 13868 13869} 13870 13871// method id "vision.projects.files.annotate": 13872 13873type ProjectsFilesAnnotateCall struct { 13874 s *Service 13875 parent string 13876 googlecloudvisionv1p1beta1batchannotatefilesrequest *GoogleCloudVisionV1p1beta1BatchAnnotateFilesRequest 13877 urlParams_ gensupport.URLParams 13878 ctx_ context.Context 13879 header_ http.Header 13880} 13881 13882// Annotate: Service that performs image detection and annotation for a 13883// batch of files. Now only "application/pdf", "image/tiff" and 13884// "image/gif" are supported. This service will extract at most 5 13885// (customers can specify which 5 in AnnotateFileRequest.pages) frames 13886// (gif) or pages (pdf or tiff) from each file provided and perform 13887// detection and annotation for each image extracted. 13888// 13889// - parent: Optional. Target project and location to make a call. 13890// Format: `projects/{project-id}/locations/{location-id}`. If no 13891// parent is specified, a region will be chosen automatically. 13892// Supported location-ids: `us`: USA country only, `asia`: East asia 13893// areas, like Japan, Taiwan, `eu`: The European Union. Example: 13894// `projects/project-A/locations/eu`. 13895func (r *ProjectsFilesService) Annotate(parent string, googlecloudvisionv1p1beta1batchannotatefilesrequest *GoogleCloudVisionV1p1beta1BatchAnnotateFilesRequest) *ProjectsFilesAnnotateCall { 13896 c := &ProjectsFilesAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13897 c.parent = parent 13898 c.googlecloudvisionv1p1beta1batchannotatefilesrequest = googlecloudvisionv1p1beta1batchannotatefilesrequest 13899 return c 13900} 13901 13902// Fields allows partial responses to be retrieved. See 13903// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13904// for more information. 13905func (c *ProjectsFilesAnnotateCall) Fields(s ...googleapi.Field) *ProjectsFilesAnnotateCall { 13906 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13907 return c 13908} 13909 13910// Context sets the context to be used in this call's Do method. Any 13911// pending HTTP request will be aborted if the provided context is 13912// canceled. 13913func (c *ProjectsFilesAnnotateCall) Context(ctx context.Context) *ProjectsFilesAnnotateCall { 13914 c.ctx_ = ctx 13915 return c 13916} 13917 13918// Header returns an http.Header that can be modified by the caller to 13919// add HTTP headers to the request. 13920func (c *ProjectsFilesAnnotateCall) Header() http.Header { 13921 if c.header_ == nil { 13922 c.header_ = make(http.Header) 13923 } 13924 return c.header_ 13925} 13926 13927func (c *ProjectsFilesAnnotateCall) doRequest(alt string) (*http.Response, error) { 13928 reqHeaders := make(http.Header) 13929 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 13930 for k, v := range c.header_ { 13931 reqHeaders[k] = v 13932 } 13933 reqHeaders.Set("User-Agent", c.s.userAgent()) 13934 var body io.Reader = nil 13935 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p1beta1batchannotatefilesrequest) 13936 if err != nil { 13937 return nil, err 13938 } 13939 reqHeaders.Set("Content-Type", "application/json") 13940 c.urlParams_.Set("alt", alt) 13941 c.urlParams_.Set("prettyPrint", "false") 13942 urls := googleapi.ResolveRelative(c.s.BasePath, "v1p1beta1/{+parent}/files:annotate") 13943 urls += "?" + c.urlParams_.Encode() 13944 req, err := http.NewRequest("POST", urls, body) 13945 if err != nil { 13946 return nil, err 13947 } 13948 req.Header = reqHeaders 13949 googleapi.Expand(req.URL, map[string]string{ 13950 "parent": c.parent, 13951 }) 13952 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13953} 13954 13955// Do executes the "vision.projects.files.annotate" call. 13956// Exactly one of *GoogleCloudVisionV1p1beta1BatchAnnotateFilesResponse 13957// or error will be non-nil. Any non-2xx status code is an error. 13958// Response headers are in either 13959// *GoogleCloudVisionV1p1beta1BatchAnnotateFilesResponse.ServerResponse.H 13960// eader or (if a response was returned at all) in 13961// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 13962// whether the returned error was because http.StatusNotModified was 13963// returned. 13964func (c *ProjectsFilesAnnotateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudVisionV1p1beta1BatchAnnotateFilesResponse, error) { 13965 gensupport.SetOptions(c.urlParams_, opts...) 13966 res, err := c.doRequest("json") 13967 if res != nil && res.StatusCode == http.StatusNotModified { 13968 if res.Body != nil { 13969 res.Body.Close() 13970 } 13971 return nil, &googleapi.Error{ 13972 Code: res.StatusCode, 13973 Header: res.Header, 13974 } 13975 } 13976 if err != nil { 13977 return nil, err 13978 } 13979 defer googleapi.CloseBody(res) 13980 if err := googleapi.CheckResponse(res); err != nil { 13981 return nil, err 13982 } 13983 ret := &GoogleCloudVisionV1p1beta1BatchAnnotateFilesResponse{ 13984 ServerResponse: googleapi.ServerResponse{ 13985 Header: res.Header, 13986 HTTPStatusCode: res.StatusCode, 13987 }, 13988 } 13989 target := &ret 13990 if err := gensupport.DecodeResponse(target, res); err != nil { 13991 return nil, err 13992 } 13993 return ret, nil 13994 // { 13995 // "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.", 13996 // "flatPath": "v1p1beta1/projects/{projectsId}/files:annotate", 13997 // "httpMethod": "POST", 13998 // "id": "vision.projects.files.annotate", 13999 // "parameterOrder": [ 14000 // "parent" 14001 // ], 14002 // "parameters": { 14003 // "parent": { 14004 // "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`.", 14005 // "location": "path", 14006 // "pattern": "^projects/[^/]+$", 14007 // "required": true, 14008 // "type": "string" 14009 // } 14010 // }, 14011 // "path": "v1p1beta1/{+parent}/files:annotate", 14012 // "request": { 14013 // "$ref": "GoogleCloudVisionV1p1beta1BatchAnnotateFilesRequest" 14014 // }, 14015 // "response": { 14016 // "$ref": "GoogleCloudVisionV1p1beta1BatchAnnotateFilesResponse" 14017 // }, 14018 // "scopes": [ 14019 // "https://www.googleapis.com/auth/cloud-platform", 14020 // "https://www.googleapis.com/auth/cloud-vision" 14021 // ] 14022 // } 14023 14024} 14025 14026// method id "vision.projects.files.asyncBatchAnnotate": 14027 14028type ProjectsFilesAsyncBatchAnnotateCall struct { 14029 s *Service 14030 parent string 14031 googlecloudvisionv1p1beta1asyncbatchannotatefilesrequest *GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesRequest 14032 urlParams_ gensupport.URLParams 14033 ctx_ context.Context 14034 header_ http.Header 14035} 14036 14037// AsyncBatchAnnotate: Run asynchronous image detection and annotation 14038// for a list of generic files, such as PDF files, which may contain 14039// multiple pages and multiple images per page. Progress and results can 14040// be retrieved through the `google.longrunning.Operations` interface. 14041// `Operation.metadata` contains `OperationMetadata` (metadata). 14042// `Operation.response` contains `AsyncBatchAnnotateFilesResponse` 14043// (results). 14044// 14045// - parent: Optional. Target project and location to make a call. 14046// Format: `projects/{project-id}/locations/{location-id}`. If no 14047// parent is specified, a region will be chosen automatically. 14048// Supported location-ids: `us`: USA country only, `asia`: East asia 14049// areas, like Japan, Taiwan, `eu`: The European Union. Example: 14050// `projects/project-A/locations/eu`. 14051func (r *ProjectsFilesService) AsyncBatchAnnotate(parent string, googlecloudvisionv1p1beta1asyncbatchannotatefilesrequest *GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesRequest) *ProjectsFilesAsyncBatchAnnotateCall { 14052 c := &ProjectsFilesAsyncBatchAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14053 c.parent = parent 14054 c.googlecloudvisionv1p1beta1asyncbatchannotatefilesrequest = googlecloudvisionv1p1beta1asyncbatchannotatefilesrequest 14055 return c 14056} 14057 14058// Fields allows partial responses to be retrieved. See 14059// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14060// for more information. 14061func (c *ProjectsFilesAsyncBatchAnnotateCall) Fields(s ...googleapi.Field) *ProjectsFilesAsyncBatchAnnotateCall { 14062 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14063 return c 14064} 14065 14066// Context sets the context to be used in this call's Do method. Any 14067// pending HTTP request will be aborted if the provided context is 14068// canceled. 14069func (c *ProjectsFilesAsyncBatchAnnotateCall) Context(ctx context.Context) *ProjectsFilesAsyncBatchAnnotateCall { 14070 c.ctx_ = ctx 14071 return c 14072} 14073 14074// Header returns an http.Header that can be modified by the caller to 14075// add HTTP headers to the request. 14076func (c *ProjectsFilesAsyncBatchAnnotateCall) Header() http.Header { 14077 if c.header_ == nil { 14078 c.header_ = make(http.Header) 14079 } 14080 return c.header_ 14081} 14082 14083func (c *ProjectsFilesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { 14084 reqHeaders := make(http.Header) 14085 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 14086 for k, v := range c.header_ { 14087 reqHeaders[k] = v 14088 } 14089 reqHeaders.Set("User-Agent", c.s.userAgent()) 14090 var body io.Reader = nil 14091 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p1beta1asyncbatchannotatefilesrequest) 14092 if err != nil { 14093 return nil, err 14094 } 14095 reqHeaders.Set("Content-Type", "application/json") 14096 c.urlParams_.Set("alt", alt) 14097 c.urlParams_.Set("prettyPrint", "false") 14098 urls := googleapi.ResolveRelative(c.s.BasePath, "v1p1beta1/{+parent}/files:asyncBatchAnnotate") 14099 urls += "?" + c.urlParams_.Encode() 14100 req, err := http.NewRequest("POST", urls, body) 14101 if err != nil { 14102 return nil, err 14103 } 14104 req.Header = reqHeaders 14105 googleapi.Expand(req.URL, map[string]string{ 14106 "parent": c.parent, 14107 }) 14108 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14109} 14110 14111// Do executes the "vision.projects.files.asyncBatchAnnotate" call. 14112// Exactly one of *Operation or error will be non-nil. Any non-2xx 14113// status code is an error. Response headers are in either 14114// *Operation.ServerResponse.Header or (if a response was returned at 14115// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 14116// to check whether the returned error was because 14117// http.StatusNotModified was returned. 14118func (c *ProjectsFilesAsyncBatchAnnotateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 14119 gensupport.SetOptions(c.urlParams_, opts...) 14120 res, err := c.doRequest("json") 14121 if res != nil && res.StatusCode == http.StatusNotModified { 14122 if res.Body != nil { 14123 res.Body.Close() 14124 } 14125 return nil, &googleapi.Error{ 14126 Code: res.StatusCode, 14127 Header: res.Header, 14128 } 14129 } 14130 if err != nil { 14131 return nil, err 14132 } 14133 defer googleapi.CloseBody(res) 14134 if err := googleapi.CheckResponse(res); err != nil { 14135 return nil, err 14136 } 14137 ret := &Operation{ 14138 ServerResponse: googleapi.ServerResponse{ 14139 Header: res.Header, 14140 HTTPStatusCode: res.StatusCode, 14141 }, 14142 } 14143 target := &ret 14144 if err := gensupport.DecodeResponse(target, res); err != nil { 14145 return nil, err 14146 } 14147 return ret, nil 14148 // { 14149 // "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).", 14150 // "flatPath": "v1p1beta1/projects/{projectsId}/files:asyncBatchAnnotate", 14151 // "httpMethod": "POST", 14152 // "id": "vision.projects.files.asyncBatchAnnotate", 14153 // "parameterOrder": [ 14154 // "parent" 14155 // ], 14156 // "parameters": { 14157 // "parent": { 14158 // "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`.", 14159 // "location": "path", 14160 // "pattern": "^projects/[^/]+$", 14161 // "required": true, 14162 // "type": "string" 14163 // } 14164 // }, 14165 // "path": "v1p1beta1/{+parent}/files:asyncBatchAnnotate", 14166 // "request": { 14167 // "$ref": "GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesRequest" 14168 // }, 14169 // "response": { 14170 // "$ref": "Operation" 14171 // }, 14172 // "scopes": [ 14173 // "https://www.googleapis.com/auth/cloud-platform", 14174 // "https://www.googleapis.com/auth/cloud-vision" 14175 // ] 14176 // } 14177 14178} 14179 14180// method id "vision.projects.images.annotate": 14181 14182type ProjectsImagesAnnotateCall struct { 14183 s *Service 14184 parent string 14185 googlecloudvisionv1p1beta1batchannotateimagesrequest *GoogleCloudVisionV1p1beta1BatchAnnotateImagesRequest 14186 urlParams_ gensupport.URLParams 14187 ctx_ context.Context 14188 header_ http.Header 14189} 14190 14191// Annotate: Run image detection and annotation for a batch of images. 14192// 14193// - parent: Optional. Target project and location to make a call. 14194// Format: `projects/{project-id}/locations/{location-id}`. If no 14195// parent is specified, a region will be chosen automatically. 14196// Supported location-ids: `us`: USA country only, `asia`: East asia 14197// areas, like Japan, Taiwan, `eu`: The European Union. Example: 14198// `projects/project-A/locations/eu`. 14199func (r *ProjectsImagesService) Annotate(parent string, googlecloudvisionv1p1beta1batchannotateimagesrequest *GoogleCloudVisionV1p1beta1BatchAnnotateImagesRequest) *ProjectsImagesAnnotateCall { 14200 c := &ProjectsImagesAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14201 c.parent = parent 14202 c.googlecloudvisionv1p1beta1batchannotateimagesrequest = googlecloudvisionv1p1beta1batchannotateimagesrequest 14203 return c 14204} 14205 14206// Fields allows partial responses to be retrieved. See 14207// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14208// for more information. 14209func (c *ProjectsImagesAnnotateCall) Fields(s ...googleapi.Field) *ProjectsImagesAnnotateCall { 14210 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14211 return c 14212} 14213 14214// Context sets the context to be used in this call's Do method. Any 14215// pending HTTP request will be aborted if the provided context is 14216// canceled. 14217func (c *ProjectsImagesAnnotateCall) Context(ctx context.Context) *ProjectsImagesAnnotateCall { 14218 c.ctx_ = ctx 14219 return c 14220} 14221 14222// Header returns an http.Header that can be modified by the caller to 14223// add HTTP headers to the request. 14224func (c *ProjectsImagesAnnotateCall) Header() http.Header { 14225 if c.header_ == nil { 14226 c.header_ = make(http.Header) 14227 } 14228 return c.header_ 14229} 14230 14231func (c *ProjectsImagesAnnotateCall) doRequest(alt string) (*http.Response, error) { 14232 reqHeaders := make(http.Header) 14233 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 14234 for k, v := range c.header_ { 14235 reqHeaders[k] = v 14236 } 14237 reqHeaders.Set("User-Agent", c.s.userAgent()) 14238 var body io.Reader = nil 14239 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p1beta1batchannotateimagesrequest) 14240 if err != nil { 14241 return nil, err 14242 } 14243 reqHeaders.Set("Content-Type", "application/json") 14244 c.urlParams_.Set("alt", alt) 14245 c.urlParams_.Set("prettyPrint", "false") 14246 urls := googleapi.ResolveRelative(c.s.BasePath, "v1p1beta1/{+parent}/images:annotate") 14247 urls += "?" + c.urlParams_.Encode() 14248 req, err := http.NewRequest("POST", urls, body) 14249 if err != nil { 14250 return nil, err 14251 } 14252 req.Header = reqHeaders 14253 googleapi.Expand(req.URL, map[string]string{ 14254 "parent": c.parent, 14255 }) 14256 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14257} 14258 14259// Do executes the "vision.projects.images.annotate" call. 14260// Exactly one of *GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse 14261// or error will be non-nil. Any non-2xx status code is an error. 14262// Response headers are in either 14263// *GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse.ServerResponse. 14264// Header or (if a response was returned at all) in 14265// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 14266// whether the returned error was because http.StatusNotModified was 14267// returned. 14268func (c *ProjectsImagesAnnotateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse, error) { 14269 gensupport.SetOptions(c.urlParams_, opts...) 14270 res, err := c.doRequest("json") 14271 if res != nil && res.StatusCode == http.StatusNotModified { 14272 if res.Body != nil { 14273 res.Body.Close() 14274 } 14275 return nil, &googleapi.Error{ 14276 Code: res.StatusCode, 14277 Header: res.Header, 14278 } 14279 } 14280 if err != nil { 14281 return nil, err 14282 } 14283 defer googleapi.CloseBody(res) 14284 if err := googleapi.CheckResponse(res); err != nil { 14285 return nil, err 14286 } 14287 ret := &GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse{ 14288 ServerResponse: googleapi.ServerResponse{ 14289 Header: res.Header, 14290 HTTPStatusCode: res.StatusCode, 14291 }, 14292 } 14293 target := &ret 14294 if err := gensupport.DecodeResponse(target, res); err != nil { 14295 return nil, err 14296 } 14297 return ret, nil 14298 // { 14299 // "description": "Run image detection and annotation for a batch of images.", 14300 // "flatPath": "v1p1beta1/projects/{projectsId}/images:annotate", 14301 // "httpMethod": "POST", 14302 // "id": "vision.projects.images.annotate", 14303 // "parameterOrder": [ 14304 // "parent" 14305 // ], 14306 // "parameters": { 14307 // "parent": { 14308 // "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`.", 14309 // "location": "path", 14310 // "pattern": "^projects/[^/]+$", 14311 // "required": true, 14312 // "type": "string" 14313 // } 14314 // }, 14315 // "path": "v1p1beta1/{+parent}/images:annotate", 14316 // "request": { 14317 // "$ref": "GoogleCloudVisionV1p1beta1BatchAnnotateImagesRequest" 14318 // }, 14319 // "response": { 14320 // "$ref": "GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse" 14321 // }, 14322 // "scopes": [ 14323 // "https://www.googleapis.com/auth/cloud-platform", 14324 // "https://www.googleapis.com/auth/cloud-vision" 14325 // ] 14326 // } 14327 14328} 14329 14330// method id "vision.projects.images.asyncBatchAnnotate": 14331 14332type ProjectsImagesAsyncBatchAnnotateCall struct { 14333 s *Service 14334 parent string 14335 googlecloudvisionv1p1beta1asyncbatchannotateimagesrequest *GoogleCloudVisionV1p1beta1AsyncBatchAnnotateImagesRequest 14336 urlParams_ gensupport.URLParams 14337 ctx_ context.Context 14338 header_ http.Header 14339} 14340 14341// AsyncBatchAnnotate: Run asynchronous image detection and annotation 14342// for a list of images. Progress and results can be retrieved through 14343// the `google.longrunning.Operations` interface. `Operation.metadata` 14344// contains `OperationMetadata` (metadata). `Operation.response` 14345// contains `AsyncBatchAnnotateImagesResponse` (results). This service 14346// will write image annotation outputs to json files in customer GCS 14347// bucket, each json file containing BatchAnnotateImagesResponse proto. 14348// 14349// - parent: Optional. Target project and location to make a call. 14350// Format: `projects/{project-id}/locations/{location-id}`. If no 14351// parent is specified, a region will be chosen automatically. 14352// Supported location-ids: `us`: USA country only, `asia`: East asia 14353// areas, like Japan, Taiwan, `eu`: The European Union. Example: 14354// `projects/project-A/locations/eu`. 14355func (r *ProjectsImagesService) AsyncBatchAnnotate(parent string, googlecloudvisionv1p1beta1asyncbatchannotateimagesrequest *GoogleCloudVisionV1p1beta1AsyncBatchAnnotateImagesRequest) *ProjectsImagesAsyncBatchAnnotateCall { 14356 c := &ProjectsImagesAsyncBatchAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14357 c.parent = parent 14358 c.googlecloudvisionv1p1beta1asyncbatchannotateimagesrequest = googlecloudvisionv1p1beta1asyncbatchannotateimagesrequest 14359 return c 14360} 14361 14362// Fields allows partial responses to be retrieved. See 14363// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14364// for more information. 14365func (c *ProjectsImagesAsyncBatchAnnotateCall) Fields(s ...googleapi.Field) *ProjectsImagesAsyncBatchAnnotateCall { 14366 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14367 return c 14368} 14369 14370// Context sets the context to be used in this call's Do method. Any 14371// pending HTTP request will be aborted if the provided context is 14372// canceled. 14373func (c *ProjectsImagesAsyncBatchAnnotateCall) Context(ctx context.Context) *ProjectsImagesAsyncBatchAnnotateCall { 14374 c.ctx_ = ctx 14375 return c 14376} 14377 14378// Header returns an http.Header that can be modified by the caller to 14379// add HTTP headers to the request. 14380func (c *ProjectsImagesAsyncBatchAnnotateCall) Header() http.Header { 14381 if c.header_ == nil { 14382 c.header_ = make(http.Header) 14383 } 14384 return c.header_ 14385} 14386 14387func (c *ProjectsImagesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { 14388 reqHeaders := make(http.Header) 14389 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 14390 for k, v := range c.header_ { 14391 reqHeaders[k] = v 14392 } 14393 reqHeaders.Set("User-Agent", c.s.userAgent()) 14394 var body io.Reader = nil 14395 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p1beta1asyncbatchannotateimagesrequest) 14396 if err != nil { 14397 return nil, err 14398 } 14399 reqHeaders.Set("Content-Type", "application/json") 14400 c.urlParams_.Set("alt", alt) 14401 c.urlParams_.Set("prettyPrint", "false") 14402 urls := googleapi.ResolveRelative(c.s.BasePath, "v1p1beta1/{+parent}/images:asyncBatchAnnotate") 14403 urls += "?" + c.urlParams_.Encode() 14404 req, err := http.NewRequest("POST", urls, body) 14405 if err != nil { 14406 return nil, err 14407 } 14408 req.Header = reqHeaders 14409 googleapi.Expand(req.URL, map[string]string{ 14410 "parent": c.parent, 14411 }) 14412 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14413} 14414 14415// Do executes the "vision.projects.images.asyncBatchAnnotate" call. 14416// Exactly one of *Operation or error will be non-nil. Any non-2xx 14417// status code is an error. Response headers are in either 14418// *Operation.ServerResponse.Header or (if a response was returned at 14419// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 14420// to check whether the returned error was because 14421// http.StatusNotModified was returned. 14422func (c *ProjectsImagesAsyncBatchAnnotateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 14423 gensupport.SetOptions(c.urlParams_, opts...) 14424 res, err := c.doRequest("json") 14425 if res != nil && res.StatusCode == http.StatusNotModified { 14426 if res.Body != nil { 14427 res.Body.Close() 14428 } 14429 return nil, &googleapi.Error{ 14430 Code: res.StatusCode, 14431 Header: res.Header, 14432 } 14433 } 14434 if err != nil { 14435 return nil, err 14436 } 14437 defer googleapi.CloseBody(res) 14438 if err := googleapi.CheckResponse(res); err != nil { 14439 return nil, err 14440 } 14441 ret := &Operation{ 14442 ServerResponse: googleapi.ServerResponse{ 14443 Header: res.Header, 14444 HTTPStatusCode: res.StatusCode, 14445 }, 14446 } 14447 target := &ret 14448 if err := gensupport.DecodeResponse(target, res); err != nil { 14449 return nil, err 14450 } 14451 return ret, nil 14452 // { 14453 // "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.", 14454 // "flatPath": "v1p1beta1/projects/{projectsId}/images:asyncBatchAnnotate", 14455 // "httpMethod": "POST", 14456 // "id": "vision.projects.images.asyncBatchAnnotate", 14457 // "parameterOrder": [ 14458 // "parent" 14459 // ], 14460 // "parameters": { 14461 // "parent": { 14462 // "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`.", 14463 // "location": "path", 14464 // "pattern": "^projects/[^/]+$", 14465 // "required": true, 14466 // "type": "string" 14467 // } 14468 // }, 14469 // "path": "v1p1beta1/{+parent}/images:asyncBatchAnnotate", 14470 // "request": { 14471 // "$ref": "GoogleCloudVisionV1p1beta1AsyncBatchAnnotateImagesRequest" 14472 // }, 14473 // "response": { 14474 // "$ref": "Operation" 14475 // }, 14476 // "scopes": [ 14477 // "https://www.googleapis.com/auth/cloud-platform", 14478 // "https://www.googleapis.com/auth/cloud-vision" 14479 // ] 14480 // } 14481 14482} 14483 14484// method id "vision.projects.locations.files.annotate": 14485 14486type ProjectsLocationsFilesAnnotateCall struct { 14487 s *Service 14488 parent string 14489 googlecloudvisionv1p1beta1batchannotatefilesrequest *GoogleCloudVisionV1p1beta1BatchAnnotateFilesRequest 14490 urlParams_ gensupport.URLParams 14491 ctx_ context.Context 14492 header_ http.Header 14493} 14494 14495// Annotate: Service that performs image detection and annotation for a 14496// batch of files. Now only "application/pdf", "image/tiff" and 14497// "image/gif" are supported. This service will extract at most 5 14498// (customers can specify which 5 in AnnotateFileRequest.pages) frames 14499// (gif) or pages (pdf or tiff) from each file provided and perform 14500// detection and annotation for each image extracted. 14501// 14502// - parent: Optional. Target project and location to make a call. 14503// Format: `projects/{project-id}/locations/{location-id}`. If no 14504// parent is specified, a region will be chosen automatically. 14505// Supported location-ids: `us`: USA country only, `asia`: East asia 14506// areas, like Japan, Taiwan, `eu`: The European Union. Example: 14507// `projects/project-A/locations/eu`. 14508func (r *ProjectsLocationsFilesService) Annotate(parent string, googlecloudvisionv1p1beta1batchannotatefilesrequest *GoogleCloudVisionV1p1beta1BatchAnnotateFilesRequest) *ProjectsLocationsFilesAnnotateCall { 14509 c := &ProjectsLocationsFilesAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14510 c.parent = parent 14511 c.googlecloudvisionv1p1beta1batchannotatefilesrequest = googlecloudvisionv1p1beta1batchannotatefilesrequest 14512 return c 14513} 14514 14515// Fields allows partial responses to be retrieved. See 14516// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14517// for more information. 14518func (c *ProjectsLocationsFilesAnnotateCall) Fields(s ...googleapi.Field) *ProjectsLocationsFilesAnnotateCall { 14519 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14520 return c 14521} 14522 14523// Context sets the context to be used in this call's Do method. Any 14524// pending HTTP request will be aborted if the provided context is 14525// canceled. 14526func (c *ProjectsLocationsFilesAnnotateCall) Context(ctx context.Context) *ProjectsLocationsFilesAnnotateCall { 14527 c.ctx_ = ctx 14528 return c 14529} 14530 14531// Header returns an http.Header that can be modified by the caller to 14532// add HTTP headers to the request. 14533func (c *ProjectsLocationsFilesAnnotateCall) Header() http.Header { 14534 if c.header_ == nil { 14535 c.header_ = make(http.Header) 14536 } 14537 return c.header_ 14538} 14539 14540func (c *ProjectsLocationsFilesAnnotateCall) doRequest(alt string) (*http.Response, error) { 14541 reqHeaders := make(http.Header) 14542 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 14543 for k, v := range c.header_ { 14544 reqHeaders[k] = v 14545 } 14546 reqHeaders.Set("User-Agent", c.s.userAgent()) 14547 var body io.Reader = nil 14548 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p1beta1batchannotatefilesrequest) 14549 if err != nil { 14550 return nil, err 14551 } 14552 reqHeaders.Set("Content-Type", "application/json") 14553 c.urlParams_.Set("alt", alt) 14554 c.urlParams_.Set("prettyPrint", "false") 14555 urls := googleapi.ResolveRelative(c.s.BasePath, "v1p1beta1/{+parent}/files:annotate") 14556 urls += "?" + c.urlParams_.Encode() 14557 req, err := http.NewRequest("POST", urls, body) 14558 if err != nil { 14559 return nil, err 14560 } 14561 req.Header = reqHeaders 14562 googleapi.Expand(req.URL, map[string]string{ 14563 "parent": c.parent, 14564 }) 14565 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14566} 14567 14568// Do executes the "vision.projects.locations.files.annotate" call. 14569// Exactly one of *GoogleCloudVisionV1p1beta1BatchAnnotateFilesResponse 14570// or error will be non-nil. Any non-2xx status code is an error. 14571// Response headers are in either 14572// *GoogleCloudVisionV1p1beta1BatchAnnotateFilesResponse.ServerResponse.H 14573// eader or (if a response was returned at all) in 14574// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 14575// whether the returned error was because http.StatusNotModified was 14576// returned. 14577func (c *ProjectsLocationsFilesAnnotateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudVisionV1p1beta1BatchAnnotateFilesResponse, error) { 14578 gensupport.SetOptions(c.urlParams_, opts...) 14579 res, err := c.doRequest("json") 14580 if res != nil && res.StatusCode == http.StatusNotModified { 14581 if res.Body != nil { 14582 res.Body.Close() 14583 } 14584 return nil, &googleapi.Error{ 14585 Code: res.StatusCode, 14586 Header: res.Header, 14587 } 14588 } 14589 if err != nil { 14590 return nil, err 14591 } 14592 defer googleapi.CloseBody(res) 14593 if err := googleapi.CheckResponse(res); err != nil { 14594 return nil, err 14595 } 14596 ret := &GoogleCloudVisionV1p1beta1BatchAnnotateFilesResponse{ 14597 ServerResponse: googleapi.ServerResponse{ 14598 Header: res.Header, 14599 HTTPStatusCode: res.StatusCode, 14600 }, 14601 } 14602 target := &ret 14603 if err := gensupport.DecodeResponse(target, res); err != nil { 14604 return nil, err 14605 } 14606 return ret, nil 14607 // { 14608 // "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.", 14609 // "flatPath": "v1p1beta1/projects/{projectsId}/locations/{locationsId}/files:annotate", 14610 // "httpMethod": "POST", 14611 // "id": "vision.projects.locations.files.annotate", 14612 // "parameterOrder": [ 14613 // "parent" 14614 // ], 14615 // "parameters": { 14616 // "parent": { 14617 // "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`.", 14618 // "location": "path", 14619 // "pattern": "^projects/[^/]+/locations/[^/]+$", 14620 // "required": true, 14621 // "type": "string" 14622 // } 14623 // }, 14624 // "path": "v1p1beta1/{+parent}/files:annotate", 14625 // "request": { 14626 // "$ref": "GoogleCloudVisionV1p1beta1BatchAnnotateFilesRequest" 14627 // }, 14628 // "response": { 14629 // "$ref": "GoogleCloudVisionV1p1beta1BatchAnnotateFilesResponse" 14630 // }, 14631 // "scopes": [ 14632 // "https://www.googleapis.com/auth/cloud-platform", 14633 // "https://www.googleapis.com/auth/cloud-vision" 14634 // ] 14635 // } 14636 14637} 14638 14639// method id "vision.projects.locations.files.asyncBatchAnnotate": 14640 14641type ProjectsLocationsFilesAsyncBatchAnnotateCall struct { 14642 s *Service 14643 parent string 14644 googlecloudvisionv1p1beta1asyncbatchannotatefilesrequest *GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesRequest 14645 urlParams_ gensupport.URLParams 14646 ctx_ context.Context 14647 header_ http.Header 14648} 14649 14650// AsyncBatchAnnotate: Run asynchronous image detection and annotation 14651// for a list of generic files, such as PDF files, which may contain 14652// multiple pages and multiple images per page. Progress and results can 14653// be retrieved through the `google.longrunning.Operations` interface. 14654// `Operation.metadata` contains `OperationMetadata` (metadata). 14655// `Operation.response` contains `AsyncBatchAnnotateFilesResponse` 14656// (results). 14657// 14658// - parent: Optional. Target project and location to make a call. 14659// Format: `projects/{project-id}/locations/{location-id}`. If no 14660// parent is specified, a region will be chosen automatically. 14661// Supported location-ids: `us`: USA country only, `asia`: East asia 14662// areas, like Japan, Taiwan, `eu`: The European Union. Example: 14663// `projects/project-A/locations/eu`. 14664func (r *ProjectsLocationsFilesService) AsyncBatchAnnotate(parent string, googlecloudvisionv1p1beta1asyncbatchannotatefilesrequest *GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesRequest) *ProjectsLocationsFilesAsyncBatchAnnotateCall { 14665 c := &ProjectsLocationsFilesAsyncBatchAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14666 c.parent = parent 14667 c.googlecloudvisionv1p1beta1asyncbatchannotatefilesrequest = googlecloudvisionv1p1beta1asyncbatchannotatefilesrequest 14668 return c 14669} 14670 14671// Fields allows partial responses to be retrieved. See 14672// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14673// for more information. 14674func (c *ProjectsLocationsFilesAsyncBatchAnnotateCall) Fields(s ...googleapi.Field) *ProjectsLocationsFilesAsyncBatchAnnotateCall { 14675 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14676 return c 14677} 14678 14679// Context sets the context to be used in this call's Do method. Any 14680// pending HTTP request will be aborted if the provided context is 14681// canceled. 14682func (c *ProjectsLocationsFilesAsyncBatchAnnotateCall) Context(ctx context.Context) *ProjectsLocationsFilesAsyncBatchAnnotateCall { 14683 c.ctx_ = ctx 14684 return c 14685} 14686 14687// Header returns an http.Header that can be modified by the caller to 14688// add HTTP headers to the request. 14689func (c *ProjectsLocationsFilesAsyncBatchAnnotateCall) Header() http.Header { 14690 if c.header_ == nil { 14691 c.header_ = make(http.Header) 14692 } 14693 return c.header_ 14694} 14695 14696func (c *ProjectsLocationsFilesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { 14697 reqHeaders := make(http.Header) 14698 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 14699 for k, v := range c.header_ { 14700 reqHeaders[k] = v 14701 } 14702 reqHeaders.Set("User-Agent", c.s.userAgent()) 14703 var body io.Reader = nil 14704 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p1beta1asyncbatchannotatefilesrequest) 14705 if err != nil { 14706 return nil, err 14707 } 14708 reqHeaders.Set("Content-Type", "application/json") 14709 c.urlParams_.Set("alt", alt) 14710 c.urlParams_.Set("prettyPrint", "false") 14711 urls := googleapi.ResolveRelative(c.s.BasePath, "v1p1beta1/{+parent}/files:asyncBatchAnnotate") 14712 urls += "?" + c.urlParams_.Encode() 14713 req, err := http.NewRequest("POST", urls, body) 14714 if err != nil { 14715 return nil, err 14716 } 14717 req.Header = reqHeaders 14718 googleapi.Expand(req.URL, map[string]string{ 14719 "parent": c.parent, 14720 }) 14721 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14722} 14723 14724// Do executes the "vision.projects.locations.files.asyncBatchAnnotate" call. 14725// Exactly one of *Operation or error will be non-nil. Any non-2xx 14726// status code is an error. Response headers are in either 14727// *Operation.ServerResponse.Header or (if a response was returned at 14728// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 14729// to check whether the returned error was because 14730// http.StatusNotModified was returned. 14731func (c *ProjectsLocationsFilesAsyncBatchAnnotateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 14732 gensupport.SetOptions(c.urlParams_, opts...) 14733 res, err := c.doRequest("json") 14734 if res != nil && res.StatusCode == http.StatusNotModified { 14735 if res.Body != nil { 14736 res.Body.Close() 14737 } 14738 return nil, &googleapi.Error{ 14739 Code: res.StatusCode, 14740 Header: res.Header, 14741 } 14742 } 14743 if err != nil { 14744 return nil, err 14745 } 14746 defer googleapi.CloseBody(res) 14747 if err := googleapi.CheckResponse(res); err != nil { 14748 return nil, err 14749 } 14750 ret := &Operation{ 14751 ServerResponse: googleapi.ServerResponse{ 14752 Header: res.Header, 14753 HTTPStatusCode: res.StatusCode, 14754 }, 14755 } 14756 target := &ret 14757 if err := gensupport.DecodeResponse(target, res); err != nil { 14758 return nil, err 14759 } 14760 return ret, nil 14761 // { 14762 // "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).", 14763 // "flatPath": "v1p1beta1/projects/{projectsId}/locations/{locationsId}/files:asyncBatchAnnotate", 14764 // "httpMethod": "POST", 14765 // "id": "vision.projects.locations.files.asyncBatchAnnotate", 14766 // "parameterOrder": [ 14767 // "parent" 14768 // ], 14769 // "parameters": { 14770 // "parent": { 14771 // "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`.", 14772 // "location": "path", 14773 // "pattern": "^projects/[^/]+/locations/[^/]+$", 14774 // "required": true, 14775 // "type": "string" 14776 // } 14777 // }, 14778 // "path": "v1p1beta1/{+parent}/files:asyncBatchAnnotate", 14779 // "request": { 14780 // "$ref": "GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesRequest" 14781 // }, 14782 // "response": { 14783 // "$ref": "Operation" 14784 // }, 14785 // "scopes": [ 14786 // "https://www.googleapis.com/auth/cloud-platform", 14787 // "https://www.googleapis.com/auth/cloud-vision" 14788 // ] 14789 // } 14790 14791} 14792 14793// method id "vision.projects.locations.images.annotate": 14794 14795type ProjectsLocationsImagesAnnotateCall struct { 14796 s *Service 14797 parent string 14798 googlecloudvisionv1p1beta1batchannotateimagesrequest *GoogleCloudVisionV1p1beta1BatchAnnotateImagesRequest 14799 urlParams_ gensupport.URLParams 14800 ctx_ context.Context 14801 header_ http.Header 14802} 14803 14804// Annotate: Run image detection and annotation for a batch of images. 14805// 14806// - parent: Optional. Target project and location to make a call. 14807// Format: `projects/{project-id}/locations/{location-id}`. If no 14808// parent is specified, a region will be chosen automatically. 14809// Supported location-ids: `us`: USA country only, `asia`: East asia 14810// areas, like Japan, Taiwan, `eu`: The European Union. Example: 14811// `projects/project-A/locations/eu`. 14812func (r *ProjectsLocationsImagesService) Annotate(parent string, googlecloudvisionv1p1beta1batchannotateimagesrequest *GoogleCloudVisionV1p1beta1BatchAnnotateImagesRequest) *ProjectsLocationsImagesAnnotateCall { 14813 c := &ProjectsLocationsImagesAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14814 c.parent = parent 14815 c.googlecloudvisionv1p1beta1batchannotateimagesrequest = googlecloudvisionv1p1beta1batchannotateimagesrequest 14816 return c 14817} 14818 14819// Fields allows partial responses to be retrieved. See 14820// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14821// for more information. 14822func (c *ProjectsLocationsImagesAnnotateCall) Fields(s ...googleapi.Field) *ProjectsLocationsImagesAnnotateCall { 14823 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14824 return c 14825} 14826 14827// Context sets the context to be used in this call's Do method. Any 14828// pending HTTP request will be aborted if the provided context is 14829// canceled. 14830func (c *ProjectsLocationsImagesAnnotateCall) Context(ctx context.Context) *ProjectsLocationsImagesAnnotateCall { 14831 c.ctx_ = ctx 14832 return c 14833} 14834 14835// Header returns an http.Header that can be modified by the caller to 14836// add HTTP headers to the request. 14837func (c *ProjectsLocationsImagesAnnotateCall) Header() http.Header { 14838 if c.header_ == nil { 14839 c.header_ = make(http.Header) 14840 } 14841 return c.header_ 14842} 14843 14844func (c *ProjectsLocationsImagesAnnotateCall) doRequest(alt string) (*http.Response, error) { 14845 reqHeaders := make(http.Header) 14846 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 14847 for k, v := range c.header_ { 14848 reqHeaders[k] = v 14849 } 14850 reqHeaders.Set("User-Agent", c.s.userAgent()) 14851 var body io.Reader = nil 14852 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p1beta1batchannotateimagesrequest) 14853 if err != nil { 14854 return nil, err 14855 } 14856 reqHeaders.Set("Content-Type", "application/json") 14857 c.urlParams_.Set("alt", alt) 14858 c.urlParams_.Set("prettyPrint", "false") 14859 urls := googleapi.ResolveRelative(c.s.BasePath, "v1p1beta1/{+parent}/images:annotate") 14860 urls += "?" + c.urlParams_.Encode() 14861 req, err := http.NewRequest("POST", urls, body) 14862 if err != nil { 14863 return nil, err 14864 } 14865 req.Header = reqHeaders 14866 googleapi.Expand(req.URL, map[string]string{ 14867 "parent": c.parent, 14868 }) 14869 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14870} 14871 14872// Do executes the "vision.projects.locations.images.annotate" call. 14873// Exactly one of *GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse 14874// or error will be non-nil. Any non-2xx status code is an error. 14875// Response headers are in either 14876// *GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse.ServerResponse. 14877// Header or (if a response was returned at all) in 14878// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 14879// whether the returned error was because http.StatusNotModified was 14880// returned. 14881func (c *ProjectsLocationsImagesAnnotateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse, error) { 14882 gensupport.SetOptions(c.urlParams_, opts...) 14883 res, err := c.doRequest("json") 14884 if res != nil && res.StatusCode == http.StatusNotModified { 14885 if res.Body != nil { 14886 res.Body.Close() 14887 } 14888 return nil, &googleapi.Error{ 14889 Code: res.StatusCode, 14890 Header: res.Header, 14891 } 14892 } 14893 if err != nil { 14894 return nil, err 14895 } 14896 defer googleapi.CloseBody(res) 14897 if err := googleapi.CheckResponse(res); err != nil { 14898 return nil, err 14899 } 14900 ret := &GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse{ 14901 ServerResponse: googleapi.ServerResponse{ 14902 Header: res.Header, 14903 HTTPStatusCode: res.StatusCode, 14904 }, 14905 } 14906 target := &ret 14907 if err := gensupport.DecodeResponse(target, res); err != nil { 14908 return nil, err 14909 } 14910 return ret, nil 14911 // { 14912 // "description": "Run image detection and annotation for a batch of images.", 14913 // "flatPath": "v1p1beta1/projects/{projectsId}/locations/{locationsId}/images:annotate", 14914 // "httpMethod": "POST", 14915 // "id": "vision.projects.locations.images.annotate", 14916 // "parameterOrder": [ 14917 // "parent" 14918 // ], 14919 // "parameters": { 14920 // "parent": { 14921 // "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`.", 14922 // "location": "path", 14923 // "pattern": "^projects/[^/]+/locations/[^/]+$", 14924 // "required": true, 14925 // "type": "string" 14926 // } 14927 // }, 14928 // "path": "v1p1beta1/{+parent}/images:annotate", 14929 // "request": { 14930 // "$ref": "GoogleCloudVisionV1p1beta1BatchAnnotateImagesRequest" 14931 // }, 14932 // "response": { 14933 // "$ref": "GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse" 14934 // }, 14935 // "scopes": [ 14936 // "https://www.googleapis.com/auth/cloud-platform", 14937 // "https://www.googleapis.com/auth/cloud-vision" 14938 // ] 14939 // } 14940 14941} 14942 14943// method id "vision.projects.locations.images.asyncBatchAnnotate": 14944 14945type ProjectsLocationsImagesAsyncBatchAnnotateCall struct { 14946 s *Service 14947 parent string 14948 googlecloudvisionv1p1beta1asyncbatchannotateimagesrequest *GoogleCloudVisionV1p1beta1AsyncBatchAnnotateImagesRequest 14949 urlParams_ gensupport.URLParams 14950 ctx_ context.Context 14951 header_ http.Header 14952} 14953 14954// AsyncBatchAnnotate: Run asynchronous image detection and annotation 14955// for a list of images. Progress and results can be retrieved through 14956// the `google.longrunning.Operations` interface. `Operation.metadata` 14957// contains `OperationMetadata` (metadata). `Operation.response` 14958// contains `AsyncBatchAnnotateImagesResponse` (results). This service 14959// will write image annotation outputs to json files in customer GCS 14960// bucket, each json file containing BatchAnnotateImagesResponse proto. 14961// 14962// - parent: Optional. Target project and location to make a call. 14963// Format: `projects/{project-id}/locations/{location-id}`. If no 14964// parent is specified, a region will be chosen automatically. 14965// Supported location-ids: `us`: USA country only, `asia`: East asia 14966// areas, like Japan, Taiwan, `eu`: The European Union. Example: 14967// `projects/project-A/locations/eu`. 14968func (r *ProjectsLocationsImagesService) AsyncBatchAnnotate(parent string, googlecloudvisionv1p1beta1asyncbatchannotateimagesrequest *GoogleCloudVisionV1p1beta1AsyncBatchAnnotateImagesRequest) *ProjectsLocationsImagesAsyncBatchAnnotateCall { 14969 c := &ProjectsLocationsImagesAsyncBatchAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14970 c.parent = parent 14971 c.googlecloudvisionv1p1beta1asyncbatchannotateimagesrequest = googlecloudvisionv1p1beta1asyncbatchannotateimagesrequest 14972 return c 14973} 14974 14975// Fields allows partial responses to be retrieved. See 14976// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14977// for more information. 14978func (c *ProjectsLocationsImagesAsyncBatchAnnotateCall) Fields(s ...googleapi.Field) *ProjectsLocationsImagesAsyncBatchAnnotateCall { 14979 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14980 return c 14981} 14982 14983// Context sets the context to be used in this call's Do method. Any 14984// pending HTTP request will be aborted if the provided context is 14985// canceled. 14986func (c *ProjectsLocationsImagesAsyncBatchAnnotateCall) Context(ctx context.Context) *ProjectsLocationsImagesAsyncBatchAnnotateCall { 14987 c.ctx_ = ctx 14988 return c 14989} 14990 14991// Header returns an http.Header that can be modified by the caller to 14992// add HTTP headers to the request. 14993func (c *ProjectsLocationsImagesAsyncBatchAnnotateCall) Header() http.Header { 14994 if c.header_ == nil { 14995 c.header_ = make(http.Header) 14996 } 14997 return c.header_ 14998} 14999 15000func (c *ProjectsLocationsImagesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) { 15001 reqHeaders := make(http.Header) 15002 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 15003 for k, v := range c.header_ { 15004 reqHeaders[k] = v 15005 } 15006 reqHeaders.Set("User-Agent", c.s.userAgent()) 15007 var body io.Reader = nil 15008 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p1beta1asyncbatchannotateimagesrequest) 15009 if err != nil { 15010 return nil, err 15011 } 15012 reqHeaders.Set("Content-Type", "application/json") 15013 c.urlParams_.Set("alt", alt) 15014 c.urlParams_.Set("prettyPrint", "false") 15015 urls := googleapi.ResolveRelative(c.s.BasePath, "v1p1beta1/{+parent}/images:asyncBatchAnnotate") 15016 urls += "?" + c.urlParams_.Encode() 15017 req, err := http.NewRequest("POST", urls, body) 15018 if err != nil { 15019 return nil, err 15020 } 15021 req.Header = reqHeaders 15022 googleapi.Expand(req.URL, map[string]string{ 15023 "parent": c.parent, 15024 }) 15025 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15026} 15027 15028// Do executes the "vision.projects.locations.images.asyncBatchAnnotate" call. 15029// Exactly one of *Operation or error will be non-nil. Any non-2xx 15030// status code is an error. Response headers are in either 15031// *Operation.ServerResponse.Header or (if a response was returned at 15032// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 15033// to check whether the returned error was because 15034// http.StatusNotModified was returned. 15035func (c *ProjectsLocationsImagesAsyncBatchAnnotateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 15036 gensupport.SetOptions(c.urlParams_, opts...) 15037 res, err := c.doRequest("json") 15038 if res != nil && res.StatusCode == http.StatusNotModified { 15039 if res.Body != nil { 15040 res.Body.Close() 15041 } 15042 return nil, &googleapi.Error{ 15043 Code: res.StatusCode, 15044 Header: res.Header, 15045 } 15046 } 15047 if err != nil { 15048 return nil, err 15049 } 15050 defer googleapi.CloseBody(res) 15051 if err := googleapi.CheckResponse(res); err != nil { 15052 return nil, err 15053 } 15054 ret := &Operation{ 15055 ServerResponse: googleapi.ServerResponse{ 15056 Header: res.Header, 15057 HTTPStatusCode: res.StatusCode, 15058 }, 15059 } 15060 target := &ret 15061 if err := gensupport.DecodeResponse(target, res); err != nil { 15062 return nil, err 15063 } 15064 return ret, nil 15065 // { 15066 // "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.", 15067 // "flatPath": "v1p1beta1/projects/{projectsId}/locations/{locationsId}/images:asyncBatchAnnotate", 15068 // "httpMethod": "POST", 15069 // "id": "vision.projects.locations.images.asyncBatchAnnotate", 15070 // "parameterOrder": [ 15071 // "parent" 15072 // ], 15073 // "parameters": { 15074 // "parent": { 15075 // "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`.", 15076 // "location": "path", 15077 // "pattern": "^projects/[^/]+/locations/[^/]+$", 15078 // "required": true, 15079 // "type": "string" 15080 // } 15081 // }, 15082 // "path": "v1p1beta1/{+parent}/images:asyncBatchAnnotate", 15083 // "request": { 15084 // "$ref": "GoogleCloudVisionV1p1beta1AsyncBatchAnnotateImagesRequest" 15085 // }, 15086 // "response": { 15087 // "$ref": "Operation" 15088 // }, 15089 // "scopes": [ 15090 // "https://www.googleapis.com/auth/cloud-platform", 15091 // "https://www.googleapis.com/auth/cloud-vision" 15092 // ] 15093 // } 15094 15095} 15096