You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

14123 lines
576 KiB

  1. // Copyright 2019 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. // Code generated file. DO NOT EDIT.
  5. // Package vision provides access to the Cloud Vision API.
  6. //
  7. // This package is DEPRECATED. Use package cloud.google.com/go/vision/apiv1 instead.
  8. //
  9. // For product documentation, see: https://cloud.google.com/vision/
  10. //
  11. // Creating a client
  12. //
  13. // Usage example:
  14. //
  15. // import "google.golang.org/api/vision/v1p2beta1"
  16. // ...
  17. // ctx := context.Background()
  18. // visionService, err := vision.NewService(ctx)
  19. //
  20. // In this example, Google Application Default Credentials are used for authentication.
  21. //
  22. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  23. //
  24. // Other authentication options
  25. //
  26. // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
  27. //
  28. // visionService, err := vision.NewService(ctx, option.WithScopes(vision.CloudVisionScope))
  29. //
  30. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  31. //
  32. // visionService, err := vision.NewService(ctx, option.WithAPIKey("AIza..."))
  33. //
  34. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  35. //
  36. // config := &oauth2.Config{...}
  37. // // ...
  38. // token, err := config.Exchange(ctx, ...)
  39. // visionService, err := vision.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  40. //
  41. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  42. package vision // import "google.golang.org/api/vision/v1p2beta1"
  43. import (
  44. "bytes"
  45. "context"
  46. "encoding/json"
  47. "errors"
  48. "fmt"
  49. "io"
  50. "net/http"
  51. "net/url"
  52. "strconv"
  53. "strings"
  54. gensupport "google.golang.org/api/gensupport"
  55. googleapi "google.golang.org/api/googleapi"
  56. option "google.golang.org/api/option"
  57. htransport "google.golang.org/api/transport/http"
  58. )
  59. // Always reference these packages, just in case the auto-generated code
  60. // below doesn't.
  61. var _ = bytes.NewBuffer
  62. var _ = strconv.Itoa
  63. var _ = fmt.Sprintf
  64. var _ = json.NewDecoder
  65. var _ = io.Copy
  66. var _ = url.Parse
  67. var _ = gensupport.MarshalJSON
  68. var _ = googleapi.Version
  69. var _ = errors.New
  70. var _ = strings.Replace
  71. var _ = context.Canceled
  72. const apiId = "vision:v1p2beta1"
  73. const apiName = "vision"
  74. const apiVersion = "v1p2beta1"
  75. const basePath = "https://vision.googleapis.com/"
  76. // OAuth2 scopes used by this API.
  77. const (
  78. // View and manage your data across Google Cloud Platform services
  79. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  80. // Apply machine learning models to understand and label images
  81. CloudVisionScope = "https://www.googleapis.com/auth/cloud-vision"
  82. )
  83. // NewService creates a new Service.
  84. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  85. scopesOption := option.WithScopes(
  86. "https://www.googleapis.com/auth/cloud-platform",
  87. "https://www.googleapis.com/auth/cloud-vision",
  88. )
  89. // NOTE: prepend, so we don't override user-specified scopes.
  90. opts = append([]option.ClientOption{scopesOption}, opts...)
  91. client, endpoint, err := htransport.NewClient(ctx, opts...)
  92. if err != nil {
  93. return nil, err
  94. }
  95. s, err := New(client)
  96. if err != nil {
  97. return nil, err
  98. }
  99. if endpoint != "" {
  100. s.BasePath = endpoint
  101. }
  102. return s, nil
  103. }
  104. // New creates a new Service. It uses the provided http.Client for requests.
  105. //
  106. // Deprecated: please use NewService instead.
  107. // To provide a custom HTTP client, use option.WithHTTPClient.
  108. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  109. func New(client *http.Client) (*Service, error) {
  110. if client == nil {
  111. return nil, errors.New("client is nil")
  112. }
  113. s := &Service{client: client, BasePath: basePath}
  114. s.Files = NewFilesService(s)
  115. s.Images = NewImagesService(s)
  116. return s, nil
  117. }
  118. type Service struct {
  119. client *http.Client
  120. BasePath string // API endpoint base URL
  121. UserAgent string // optional additional User-Agent fragment
  122. Files *FilesService
  123. Images *ImagesService
  124. }
  125. func (s *Service) userAgent() string {
  126. if s.UserAgent == "" {
  127. return googleapi.UserAgent
  128. }
  129. return googleapi.UserAgent + " " + s.UserAgent
  130. }
  131. func NewFilesService(s *Service) *FilesService {
  132. rs := &FilesService{s: s}
  133. return rs
  134. }
  135. type FilesService struct {
  136. s *Service
  137. }
  138. func NewImagesService(s *Service) *ImagesService {
  139. rs := &ImagesService{s: s}
  140. return rs
  141. }
  142. type ImagesService struct {
  143. s *Service
  144. }
  145. // AnnotateFileResponse: Response to a single file annotation request. A
  146. // file may contain one or more
  147. // images, which individually have their own responses.
  148. type AnnotateFileResponse struct {
  149. // InputConfig: Information about the file for which this response is
  150. // generated.
  151. InputConfig *InputConfig `json:"inputConfig,omitempty"`
  152. // Responses: Individual responses to images found within the file.
  153. Responses []*AnnotateImageResponse `json:"responses,omitempty"`
  154. // ForceSendFields is a list of field names (e.g. "InputConfig") to
  155. // unconditionally include in API requests. By default, fields with
  156. // empty values are omitted from API requests. However, any non-pointer,
  157. // non-interface field appearing in ForceSendFields will be sent to the
  158. // server regardless of whether the field is empty or not. This may be
  159. // used to include empty fields in Patch requests.
  160. ForceSendFields []string `json:"-"`
  161. // NullFields is a list of field names (e.g. "InputConfig") to include
  162. // in API requests with the JSON null value. By default, fields with
  163. // empty values are omitted from API requests. However, any field with
  164. // an empty value appearing in NullFields will be sent to the server as
  165. // null. It is an error if a field in this list has a non-empty value.
  166. // This may be used to include null fields in Patch requests.
  167. NullFields []string `json:"-"`
  168. }
  169. func (s *AnnotateFileResponse) MarshalJSON() ([]byte, error) {
  170. type NoMethod AnnotateFileResponse
  171. raw := NoMethod(*s)
  172. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  173. }
  174. // AnnotateImageResponse: Response to an image annotation request.
  175. type AnnotateImageResponse struct {
  176. // Context: If present, contextual information is needed to understand
  177. // where this image
  178. // comes from.
  179. Context *ImageAnnotationContext `json:"context,omitempty"`
  180. // CropHintsAnnotation: If present, crop hints have completed
  181. // successfully.
  182. CropHintsAnnotation *CropHintsAnnotation `json:"cropHintsAnnotation,omitempty"`
  183. // Error: If set, represents the error message for the operation.
  184. // Note that filled-in image annotations are guaranteed to be
  185. // correct, even when `error` is set.
  186. Error *Status `json:"error,omitempty"`
  187. // FaceAnnotations: If present, face detection has completed
  188. // successfully.
  189. FaceAnnotations []*FaceAnnotation `json:"faceAnnotations,omitempty"`
  190. // FullTextAnnotation: If present, text (OCR) detection or document
  191. // (OCR) text detection has
  192. // completed successfully.
  193. // This annotation provides the structural hierarchy for the OCR
  194. // detected
  195. // text.
  196. FullTextAnnotation *TextAnnotation `json:"fullTextAnnotation,omitempty"`
  197. // ImagePropertiesAnnotation: If present, image properties were
  198. // extracted successfully.
  199. ImagePropertiesAnnotation *ImageProperties `json:"imagePropertiesAnnotation,omitempty"`
  200. // LabelAnnotations: If present, label detection has completed
  201. // successfully.
  202. LabelAnnotations []*EntityAnnotation `json:"labelAnnotations,omitempty"`
  203. // LandmarkAnnotations: If present, landmark detection has completed
  204. // successfully.
  205. LandmarkAnnotations []*EntityAnnotation `json:"landmarkAnnotations,omitempty"`
  206. // LocalizedObjectAnnotations: If present, localized object detection
  207. // has completed successfully.
  208. // This will be sorted descending by confidence score.
  209. LocalizedObjectAnnotations []*LocalizedObjectAnnotation `json:"localizedObjectAnnotations,omitempty"`
  210. // LogoAnnotations: If present, logo detection has completed
  211. // successfully.
  212. LogoAnnotations []*EntityAnnotation `json:"logoAnnotations,omitempty"`
  213. // ProductSearchResults: If present, product search has completed
  214. // successfully.
  215. ProductSearchResults *ProductSearchResults `json:"productSearchResults,omitempty"`
  216. // SafeSearchAnnotation: If present, safe-search annotation has
  217. // completed successfully.
  218. SafeSearchAnnotation *SafeSearchAnnotation `json:"safeSearchAnnotation,omitempty"`
  219. // TextAnnotations: If present, text (OCR) detection has completed
  220. // successfully.
  221. TextAnnotations []*EntityAnnotation `json:"textAnnotations,omitempty"`
  222. // WebDetection: If present, web detection has completed successfully.
  223. WebDetection *WebDetection `json:"webDetection,omitempty"`
  224. // ForceSendFields is a list of field names (e.g. "Context") to
  225. // unconditionally include in API requests. By default, fields with
  226. // empty values are omitted from API requests. However, any non-pointer,
  227. // non-interface field appearing in ForceSendFields will be sent to the
  228. // server regardless of whether the field is empty or not. This may be
  229. // used to include empty fields in Patch requests.
  230. ForceSendFields []string `json:"-"`
  231. // NullFields is a list of field names (e.g. "Context") to include in
  232. // API requests with the JSON null value. By default, fields with empty
  233. // values are omitted from API requests. However, any field with an
  234. // empty value appearing in NullFields will be sent to the server as
  235. // null. It is an error if a field in this list has a non-empty value.
  236. // This may be used to include null fields in Patch requests.
  237. NullFields []string `json:"-"`
  238. }
  239. func (s *AnnotateImageResponse) MarshalJSON() ([]byte, error) {
  240. type NoMethod AnnotateImageResponse
  241. raw := NoMethod(*s)
  242. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  243. }
  244. // AsyncAnnotateFileResponse: The response for a single offline file
  245. // annotation request.
  246. type AsyncAnnotateFileResponse struct {
  247. // OutputConfig: The output location and metadata from
  248. // AsyncAnnotateFileRequest.
  249. OutputConfig *OutputConfig `json:"outputConfig,omitempty"`
  250. // ForceSendFields is a list of field names (e.g. "OutputConfig") to
  251. // unconditionally include in API requests. By default, fields with
  252. // empty values are omitted from API requests. However, any non-pointer,
  253. // non-interface field appearing in ForceSendFields will be sent to the
  254. // server regardless of whether the field is empty or not. This may be
  255. // used to include empty fields in Patch requests.
  256. ForceSendFields []string `json:"-"`
  257. // NullFields is a list of field names (e.g. "OutputConfig") to include
  258. // in API requests with the JSON null value. By default, fields with
  259. // empty values are omitted from API requests. However, any field with
  260. // an empty value appearing in NullFields will be sent to the server as
  261. // null. It is an error if a field in this list has a non-empty value.
  262. // This may be used to include null fields in Patch requests.
  263. NullFields []string `json:"-"`
  264. }
  265. func (s *AsyncAnnotateFileResponse) MarshalJSON() ([]byte, error) {
  266. type NoMethod AsyncAnnotateFileResponse
  267. raw := NoMethod(*s)
  268. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  269. }
  270. // AsyncBatchAnnotateFilesResponse: Response to an async batch file
  271. // annotation request.
  272. type AsyncBatchAnnotateFilesResponse struct {
  273. // Responses: The list of file annotation responses, one for each
  274. // request in
  275. // AsyncBatchAnnotateFilesRequest.
  276. Responses []*AsyncAnnotateFileResponse `json:"responses,omitempty"`
  277. // ForceSendFields is a list of field names (e.g. "Responses") to
  278. // unconditionally include in API requests. By default, fields with
  279. // empty values are omitted from API requests. However, any non-pointer,
  280. // non-interface field appearing in ForceSendFields will be sent to the
  281. // server regardless of whether the field is empty or not. This may be
  282. // used to include empty fields in Patch requests.
  283. ForceSendFields []string `json:"-"`
  284. // NullFields is a list of field names (e.g. "Responses") to include in
  285. // API requests with the JSON null value. By default, fields with empty
  286. // values are omitted from API requests. However, any field with an
  287. // empty value appearing in NullFields will be sent to the server as
  288. // null. It is an error if a field in this list has a non-empty value.
  289. // This may be used to include null fields in Patch requests.
  290. NullFields []string `json:"-"`
  291. }
  292. func (s *AsyncBatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) {
  293. type NoMethod AsyncBatchAnnotateFilesResponse
  294. raw := NoMethod(*s)
  295. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  296. }
  297. // BatchOperationMetadata: Metadata for the batch operations such as the
  298. // current state.
  299. //
  300. // This is included in the `metadata` field of the `Operation` returned
  301. // by the
  302. // `GetOperation` call of the `google::longrunning::Operations` service.
  303. type BatchOperationMetadata struct {
  304. // EndTime: The time when the batch request is finished
  305. // and
  306. // google.longrunning.Operation.done is set to true.
  307. EndTime string `json:"endTime,omitempty"`
  308. // State: The current state of the batch operation.
  309. //
  310. // Possible values:
  311. // "STATE_UNSPECIFIED" - Invalid.
  312. // "PROCESSING" - Request is actively being processed.
  313. // "SUCCESSFUL" - The request is done and at least one item has been
  314. // successfully
  315. // processed.
  316. // "FAILED" - The request is done and no item has been successfully
  317. // processed.
  318. // "CANCELLED" - The request is done after the
  319. // longrunning.Operations.CancelOperation has
  320. // been called by the user. Any records that were processed before
  321. // the
  322. // cancel command are output as specified in the request.
  323. State string `json:"state,omitempty"`
  324. // SubmitTime: The time when the batch request was submitted to the
  325. // server.
  326. SubmitTime string `json:"submitTime,omitempty"`
  327. // ForceSendFields is a list of field names (e.g. "EndTime") to
  328. // unconditionally include in API requests. By default, fields with
  329. // empty values are omitted from API requests. However, any non-pointer,
  330. // non-interface field appearing in ForceSendFields will be sent to the
  331. // server regardless of whether the field is empty or not. This may be
  332. // used to include empty fields in Patch requests.
  333. ForceSendFields []string `json:"-"`
  334. // NullFields is a list of field names (e.g. "EndTime") to include in
  335. // API requests with the JSON null value. By default, fields with empty
  336. // values are omitted from API requests. However, any field with an
  337. // empty value appearing in NullFields will be sent to the server as
  338. // null. It is an error if a field in this list has a non-empty value.
  339. // This may be used to include null fields in Patch requests.
  340. NullFields []string `json:"-"`
  341. }
  342. func (s *BatchOperationMetadata) MarshalJSON() ([]byte, error) {
  343. type NoMethod BatchOperationMetadata
  344. raw := NoMethod(*s)
  345. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  346. }
  347. // Block: Logical element on the page.
  348. type Block struct {
  349. // BlockType: Detected block type (text, image etc) for this block.
  350. //
  351. // Possible values:
  352. // "UNKNOWN" - Unknown block type.
  353. // "TEXT" - Regular text block.
  354. // "TABLE" - Table block.
  355. // "PICTURE" - Image block.
  356. // "RULER" - Horizontal/vertical line box.
  357. // "BARCODE" - Barcode block.
  358. BlockType string `json:"blockType,omitempty"`
  359. // BoundingBox: The bounding box for the block.
  360. // The vertices are in the order of top-left, top-right,
  361. // bottom-right,
  362. // bottom-left. When a rotation of the bounding box is detected the
  363. // rotation
  364. // is represented as around the top-left corner as defined when the text
  365. // is
  366. // read in the 'natural' orientation.
  367. // For example:
  368. //
  369. // * when the text is horizontal it might look like:
  370. //
  371. // 0----1
  372. // | |
  373. // 3----2
  374. //
  375. // * when it's rotated 180 degrees around the top-left corner it
  376. // becomes:
  377. //
  378. // 2----3
  379. // | |
  380. // 1----0
  381. //
  382. // and the vertex order will still be (0, 1, 2, 3).
  383. BoundingBox *BoundingPoly `json:"boundingBox,omitempty"`
  384. // Confidence: Confidence of the OCR results on the block. Range [0, 1].
  385. Confidence float64 `json:"confidence,omitempty"`
  386. // Paragraphs: List of paragraphs in this block (if this blocks is of
  387. // type text).
  388. Paragraphs []*Paragraph `json:"paragraphs,omitempty"`
  389. // Property: Additional information detected for the block.
  390. Property *TextProperty `json:"property,omitempty"`
  391. // ForceSendFields is a list of field names (e.g. "BlockType") to
  392. // unconditionally include in API requests. By default, fields with
  393. // empty values are omitted from API requests. However, any non-pointer,
  394. // non-interface field appearing in ForceSendFields will be sent to the
  395. // server regardless of whether the field is empty or not. This may be
  396. // used to include empty fields in Patch requests.
  397. ForceSendFields []string `json:"-"`
  398. // NullFields is a list of field names (e.g. "BlockType") to include in
  399. // API requests with the JSON null value. By default, fields with empty
  400. // values are omitted from API requests. However, any field with an
  401. // empty value appearing in NullFields will be sent to the server as
  402. // null. It is an error if a field in this list has a non-empty value.
  403. // This may be used to include null fields in Patch requests.
  404. NullFields []string `json:"-"`
  405. }
  406. func (s *Block) MarshalJSON() ([]byte, error) {
  407. type NoMethod Block
  408. raw := NoMethod(*s)
  409. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  410. }
  411. func (s *Block) UnmarshalJSON(data []byte) error {
  412. type NoMethod Block
  413. var s1 struct {
  414. Confidence gensupport.JSONFloat64 `json:"confidence"`
  415. *NoMethod
  416. }
  417. s1.NoMethod = (*NoMethod)(s)
  418. if err := json.Unmarshal(data, &s1); err != nil {
  419. return err
  420. }
  421. s.Confidence = float64(s1.Confidence)
  422. return nil
  423. }
  424. // BoundingPoly: A bounding polygon for the detected image annotation.
  425. type BoundingPoly struct {
  426. // NormalizedVertices: The bounding polygon normalized vertices.
  427. NormalizedVertices []*NormalizedVertex `json:"normalizedVertices,omitempty"`
  428. // Vertices: The bounding polygon vertices.
  429. Vertices []*Vertex `json:"vertices,omitempty"`
  430. // ForceSendFields is a list of field names (e.g. "NormalizedVertices")
  431. // to unconditionally include in API requests. By default, fields with
  432. // empty values are omitted from API requests. However, any non-pointer,
  433. // non-interface field appearing in ForceSendFields will be sent to the
  434. // server regardless of whether the field is empty or not. This may be
  435. // used to include empty fields in Patch requests.
  436. ForceSendFields []string `json:"-"`
  437. // NullFields is a list of field names (e.g. "NormalizedVertices") to
  438. // include in API requests with the JSON null value. By default, fields
  439. // with empty values are omitted from API requests. However, any field
  440. // with an empty value appearing in NullFields will be sent to the
  441. // server as null. It is an error if a field in this list has a
  442. // non-empty value. This may be used to include null fields in Patch
  443. // requests.
  444. NullFields []string `json:"-"`
  445. }
  446. func (s *BoundingPoly) MarshalJSON() ([]byte, error) {
  447. type NoMethod BoundingPoly
  448. raw := NoMethod(*s)
  449. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  450. }
  451. // Color: Represents a color in the RGBA color space. This
  452. // representation is designed
  453. // for simplicity of conversion to/from color representations in
  454. // various
  455. // languages over compactness; for example, the fields of this
  456. // representation
  457. // can be trivially provided to the constructor of "java.awt.Color" in
  458. // Java; it
  459. // can also be trivially provided to UIColor's
  460. // "+colorWithRed:green:blue:alpha"
  461. // method in iOS; and, with just a little work, it can be easily
  462. // formatted into
  463. // a CSS "rgba()" string in JavaScript, as well.
  464. //
  465. // Note: this proto does not carry information about the absolute color
  466. // space
  467. // that should be used to interpret the RGB value (e.g. sRGB, Adobe
  468. // RGB,
  469. // DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the
  470. // sRGB color
  471. // space.
  472. //
  473. // Example (Java):
  474. //
  475. // import com.google.type.Color;
  476. //
  477. // // ...
  478. // public static java.awt.Color fromProto(Color protocolor) {
  479. // float alpha = protocolor.hasAlpha()
  480. // ? protocolor.getAlpha().getValue()
  481. // : 1.0;
  482. //
  483. // return new java.awt.Color(
  484. // protocolor.getRed(),
  485. // protocolor.getGreen(),
  486. // protocolor.getBlue(),
  487. // alpha);
  488. // }
  489. //
  490. // public static Color toProto(java.awt.Color color) {
  491. // float red = (float) color.getRed();
  492. // float green = (float) color.getGreen();
  493. // float blue = (float) color.getBlue();
  494. // float denominator = 255.0;
  495. // Color.Builder resultBuilder =
  496. // Color
  497. // .newBuilder()
  498. // .setRed(red / denominator)
  499. // .setGreen(green / denominator)
  500. // .setBlue(blue / denominator);
  501. // int alpha = color.getAlpha();
  502. // if (alpha != 255) {
  503. // result.setAlpha(
  504. // FloatValue
  505. // .newBuilder()
  506. // .setValue(((float) alpha) / denominator)
  507. // .build());
  508. // }
  509. // return resultBuilder.build();
  510. // }
  511. // // ...
  512. //
  513. // Example (iOS / Obj-C):
  514. //
  515. // // ...
  516. // static UIColor* fromProto(Color* protocolor) {
  517. // float red = [protocolor red];
  518. // float green = [protocolor green];
  519. // float blue = [protocolor blue];
  520. // FloatValue* alpha_wrapper = [protocolor alpha];
  521. // float alpha = 1.0;
  522. // if (alpha_wrapper != nil) {
  523. // alpha = [alpha_wrapper value];
  524. // }
  525. // return [UIColor colorWithRed:red green:green blue:blue
  526. // alpha:alpha];
  527. // }
  528. //
  529. // static Color* toProto(UIColor* color) {
  530. // CGFloat red, green, blue, alpha;
  531. // if (![color getRed:&red green:&green blue:&blue
  532. // alpha:&alpha]) {
  533. // return nil;
  534. // }
  535. // Color* result = [[Color alloc] init];
  536. // [result setRed:red];
  537. // [result setGreen:green];
  538. // [result setBlue:blue];
  539. // if (alpha <= 0.9999) {
  540. // [result setAlpha:floatWrapperWithValue(alpha)];
  541. // }
  542. // [result autorelease];
  543. // return result;
  544. // }
  545. // // ...
  546. //
  547. // Example (JavaScript):
  548. //
  549. // // ...
  550. //
  551. // var protoToCssColor = function(rgb_color) {
  552. // var redFrac = rgb_color.red || 0.0;
  553. // var greenFrac = rgb_color.green || 0.0;
  554. // var blueFrac = rgb_color.blue || 0.0;
  555. // var red = Math.floor(redFrac * 255);
  556. // var green = Math.floor(greenFrac * 255);
  557. // var blue = Math.floor(blueFrac * 255);
  558. //
  559. // if (!('alpha' in rgb_color)) {
  560. // return rgbToCssColor_(red, green, blue);
  561. // }
  562. //
  563. // var alphaFrac = rgb_color.alpha.value || 0.0;
  564. // var rgbParams = [red, green, blue].join(',');
  565. // return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
  566. // };
  567. //
  568. // var rgbToCssColor_ = function(red, green, blue) {
  569. // var rgbNumber = new Number((red << 16) | (green << 8) | blue);
  570. // var hexString = rgbNumber.toString(16);
  571. // var missingZeros = 6 - hexString.length;
  572. // var resultBuilder = ['#'];
  573. // for (var i = 0; i < missingZeros; i++) {
  574. // resultBuilder.push('0');
  575. // }
  576. // resultBuilder.push(hexString);
  577. // return resultBuilder.join('');
  578. // };
  579. //
  580. // // ...
  581. type Color struct {
  582. // Alpha: The fraction of this color that should be applied to the
  583. // pixel. That is,
  584. // the final pixel color is defined by the equation:
  585. //
  586. // pixel color = alpha * (this color) + (1.0 - alpha) * (background
  587. // color)
  588. //
  589. // This means that a value of 1.0 corresponds to a solid color,
  590. // whereas
  591. // a value of 0.0 corresponds to a completely transparent color.
  592. // This
  593. // uses a wrapper message rather than a simple float scalar so that it
  594. // is
  595. // possible to distinguish between a default value and the value being
  596. // unset.
  597. // If omitted, this color object is to be rendered as a solid color
  598. // (as if the alpha value had been explicitly given with a value of
  599. // 1.0).
  600. Alpha float64 `json:"alpha,omitempty"`
  601. // Blue: The amount of blue in the color as a value in the interval [0,
  602. // 1].
  603. Blue float64 `json:"blue,omitempty"`
  604. // Green: The amount of green in the color as a value in the interval
  605. // [0, 1].
  606. Green float64 `json:"green,omitempty"`
  607. // Red: The amount of red in the color as a value in the interval [0,
  608. // 1].
  609. Red float64 `json:"red,omitempty"`
  610. // ForceSendFields is a list of field names (e.g. "Alpha") to
  611. // unconditionally include in API requests. By default, fields with
  612. // empty values are omitted from API requests. However, any non-pointer,
  613. // non-interface field appearing in ForceSendFields will be sent to the
  614. // server regardless of whether the field is empty or not. This may be
  615. // used to include empty fields in Patch requests.
  616. ForceSendFields []string `json:"-"`
  617. // NullFields is a list of field names (e.g. "Alpha") to include in API
  618. // requests with the JSON null value. By default, fields with empty
  619. // values are omitted from API requests. However, any field with an
  620. // empty value appearing in NullFields will be sent to the server as
  621. // null. It is an error if a field in this list has a non-empty value.
  622. // This may be used to include null fields in Patch requests.
  623. NullFields []string `json:"-"`
  624. }
  625. func (s *Color) MarshalJSON() ([]byte, error) {
  626. type NoMethod Color
  627. raw := NoMethod(*s)
  628. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  629. }
  630. func (s *Color) UnmarshalJSON(data []byte) error {
  631. type NoMethod Color
  632. var s1 struct {
  633. Alpha gensupport.JSONFloat64 `json:"alpha"`
  634. Blue gensupport.JSONFloat64 `json:"blue"`
  635. Green gensupport.JSONFloat64 `json:"green"`
  636. Red gensupport.JSONFloat64 `json:"red"`
  637. *NoMethod
  638. }
  639. s1.NoMethod = (*NoMethod)(s)
  640. if err := json.Unmarshal(data, &s1); err != nil {
  641. return err
  642. }
  643. s.Alpha = float64(s1.Alpha)
  644. s.Blue = float64(s1.Blue)
  645. s.Green = float64(s1.Green)
  646. s.Red = float64(s1.Red)
  647. return nil
  648. }
  649. // ColorInfo: Color information consists of RGB channels, score, and the
  650. // fraction of
  651. // the image that the color occupies in the image.
  652. type ColorInfo struct {
  653. // Color: RGB components of the color.
  654. Color *Color `json:"color,omitempty"`
  655. // PixelFraction: The fraction of pixels the color occupies in the
  656. // image.
  657. // Value in range [0, 1].
  658. PixelFraction float64 `json:"pixelFraction,omitempty"`
  659. // Score: Image-specific score for this color. Value in range [0, 1].
  660. Score float64 `json:"score,omitempty"`
  661. // ForceSendFields is a list of field names (e.g. "Color") to
  662. // unconditionally include in API requests. By default, fields with
  663. // empty values are omitted from API requests. However, any non-pointer,
  664. // non-interface field appearing in ForceSendFields will be sent to the
  665. // server regardless of whether the field is empty or not. This may be
  666. // used to include empty fields in Patch requests.
  667. ForceSendFields []string `json:"-"`
  668. // NullFields is a list of field names (e.g. "Color") to include in API
  669. // requests with the JSON null value. By default, fields with empty
  670. // values are omitted from API requests. However, any field with an
  671. // empty value appearing in NullFields will be sent to the server as
  672. // null. It is an error if a field in this list has a non-empty value.
  673. // This may be used to include null fields in Patch requests.
  674. NullFields []string `json:"-"`
  675. }
  676. func (s *ColorInfo) MarshalJSON() ([]byte, error) {
  677. type NoMethod ColorInfo
  678. raw := NoMethod(*s)
  679. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  680. }
  681. func (s *ColorInfo) UnmarshalJSON(data []byte) error {
  682. type NoMethod ColorInfo
  683. var s1 struct {
  684. PixelFraction gensupport.JSONFloat64 `json:"pixelFraction"`
  685. Score gensupport.JSONFloat64 `json:"score"`
  686. *NoMethod
  687. }
  688. s1.NoMethod = (*NoMethod)(s)
  689. if err := json.Unmarshal(data, &s1); err != nil {
  690. return err
  691. }
  692. s.PixelFraction = float64(s1.PixelFraction)
  693. s.Score = float64(s1.Score)
  694. return nil
  695. }
  696. // CropHint: Single crop hint that is used to generate a new crop when
  697. // serving an image.
  698. type CropHint struct {
  699. // BoundingPoly: The bounding polygon for the crop region. The
  700. // coordinates of the bounding
  701. // box are in the original image's scale.
  702. BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"`
  703. // Confidence: Confidence of this being a salient region. Range [0, 1].
  704. Confidence float64 `json:"confidence,omitempty"`
  705. // ImportanceFraction: Fraction of importance of this salient region
  706. // with respect to the original
  707. // image.
  708. ImportanceFraction float64 `json:"importanceFraction,omitempty"`
  709. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  710. // unconditionally include in API requests. By default, fields with
  711. // empty values are omitted from API requests. However, any non-pointer,
  712. // non-interface field appearing in ForceSendFields will be sent to the
  713. // server regardless of whether the field is empty or not. This may be
  714. // used to include empty fields in Patch requests.
  715. ForceSendFields []string `json:"-"`
  716. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  717. // in API requests with the JSON null value. By default, fields with
  718. // empty values are omitted from API requests. However, any field with
  719. // an empty value appearing in NullFields will be sent to the server as
  720. // null. It is an error if a field in this list has a non-empty value.
  721. // This may be used to include null fields in Patch requests.
  722. NullFields []string `json:"-"`
  723. }
  724. func (s *CropHint) MarshalJSON() ([]byte, error) {
  725. type NoMethod CropHint
  726. raw := NoMethod(*s)
  727. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  728. }
  729. func (s *CropHint) UnmarshalJSON(data []byte) error {
  730. type NoMethod CropHint
  731. var s1 struct {
  732. Confidence gensupport.JSONFloat64 `json:"confidence"`
  733. ImportanceFraction gensupport.JSONFloat64 `json:"importanceFraction"`
  734. *NoMethod
  735. }
  736. s1.NoMethod = (*NoMethod)(s)
  737. if err := json.Unmarshal(data, &s1); err != nil {
  738. return err
  739. }
  740. s.Confidence = float64(s1.Confidence)
  741. s.ImportanceFraction = float64(s1.ImportanceFraction)
  742. return nil
  743. }
  744. // CropHintsAnnotation: Set of crop hints that are used to generate new
  745. // crops when serving images.
  746. type CropHintsAnnotation struct {
  747. // CropHints: Crop hint results.
  748. CropHints []*CropHint `json:"cropHints,omitempty"`
  749. // ForceSendFields is a list of field names (e.g. "CropHints") to
  750. // unconditionally include in API requests. By default, fields with
  751. // empty values are omitted from API requests. However, any non-pointer,
  752. // non-interface field appearing in ForceSendFields will be sent to the
  753. // server regardless of whether the field is empty or not. This may be
  754. // used to include empty fields in Patch requests.
  755. ForceSendFields []string `json:"-"`
  756. // NullFields is a list of field names (e.g. "CropHints") to include in
  757. // API requests with the JSON null value. By default, fields with empty
  758. // values are omitted from API requests. However, any field with an
  759. // empty value appearing in NullFields will be sent to the server as
  760. // null. It is an error if a field in this list has a non-empty value.
  761. // This may be used to include null fields in Patch requests.
  762. NullFields []string `json:"-"`
  763. }
  764. func (s *CropHintsAnnotation) MarshalJSON() ([]byte, error) {
  765. type NoMethod CropHintsAnnotation
  766. raw := NoMethod(*s)
  767. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  768. }
  769. // DetectedBreak: Detected start or end of a structural component.
  770. type DetectedBreak struct {
  771. // IsPrefix: True if break prepends the element.
  772. IsPrefix bool `json:"isPrefix,omitempty"`
  773. // Type: Detected break type.
  774. //
  775. // Possible values:
  776. // "UNKNOWN" - Unknown break label type.
  777. // "SPACE" - Regular space.
  778. // "SURE_SPACE" - Sure space (very wide).
  779. // "EOL_SURE_SPACE" - Line-wrapping break.
  780. // "HYPHEN" - End-line hyphen that is not present in text; does not
  781. // co-occur with
  782. // `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`.
  783. // "LINE_BREAK" - Line break that ends a paragraph.
  784. Type string `json:"type,omitempty"`
  785. // ForceSendFields is a list of field names (e.g. "IsPrefix") to
  786. // unconditionally include in API requests. By default, fields with
  787. // empty values are omitted from API requests. However, any non-pointer,
  788. // non-interface field appearing in ForceSendFields will be sent to the
  789. // server regardless of whether the field is empty or not. This may be
  790. // used to include empty fields in Patch requests.
  791. ForceSendFields []string `json:"-"`
  792. // NullFields is a list of field names (e.g. "IsPrefix") to include in
  793. // API requests with the JSON null value. By default, fields with empty
  794. // values are omitted from API requests. However, any field with an
  795. // empty value appearing in NullFields will be sent to the server as
  796. // null. It is an error if a field in this list has a non-empty value.
  797. // This may be used to include null fields in Patch requests.
  798. NullFields []string `json:"-"`
  799. }
  800. func (s *DetectedBreak) MarshalJSON() ([]byte, error) {
  801. type NoMethod DetectedBreak
  802. raw := NoMethod(*s)
  803. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  804. }
  805. // DetectedLanguage: Detected language for a structural component.
  806. type DetectedLanguage struct {
  807. // Confidence: Confidence of detected language. Range [0, 1].
  808. Confidence float64 `json:"confidence,omitempty"`
  809. // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn".
  810. // For more
  811. // information,
  812. // see
  813. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  814. LanguageCode string `json:"languageCode,omitempty"`
  815. // ForceSendFields is a list of field names (e.g. "Confidence") to
  816. // unconditionally include in API requests. By default, fields with
  817. // empty values are omitted from API requests. However, any non-pointer,
  818. // non-interface field appearing in ForceSendFields will be sent to the
  819. // server regardless of whether the field is empty or not. This may be
  820. // used to include empty fields in Patch requests.
  821. ForceSendFields []string `json:"-"`
  822. // NullFields is a list of field names (e.g. "Confidence") to include in
  823. // API requests with the JSON null value. By default, fields with empty
  824. // values are omitted from API requests. However, any field with an
  825. // empty value appearing in NullFields will be sent to the server as
  826. // null. It is an error if a field in this list has a non-empty value.
  827. // This may be used to include null fields in Patch requests.
  828. NullFields []string `json:"-"`
  829. }
  830. func (s *DetectedLanguage) MarshalJSON() ([]byte, error) {
  831. type NoMethod DetectedLanguage
  832. raw := NoMethod(*s)
  833. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  834. }
  835. func (s *DetectedLanguage) UnmarshalJSON(data []byte) error {
  836. type NoMethod DetectedLanguage
  837. var s1 struct {
  838. Confidence gensupport.JSONFloat64 `json:"confidence"`
  839. *NoMethod
  840. }
  841. s1.NoMethod = (*NoMethod)(s)
  842. if err := json.Unmarshal(data, &s1); err != nil {
  843. return err
  844. }
  845. s.Confidence = float64(s1.Confidence)
  846. return nil
  847. }
  848. // DominantColorsAnnotation: Set of dominant colors and their
  849. // corresponding scores.
  850. type DominantColorsAnnotation struct {
  851. // Colors: RGB color values with their score and pixel fraction.
  852. Colors []*ColorInfo `json:"colors,omitempty"`
  853. // ForceSendFields is a list of field names (e.g. "Colors") to
  854. // unconditionally include in API requests. By default, fields with
  855. // empty values are omitted from API requests. However, any non-pointer,
  856. // non-interface field appearing in ForceSendFields will be sent to the
  857. // server regardless of whether the field is empty or not. This may be
  858. // used to include empty fields in Patch requests.
  859. ForceSendFields []string `json:"-"`
  860. // NullFields is a list of field names (e.g. "Colors") to include in API
  861. // requests with the JSON null value. By default, fields with empty
  862. // values are omitted from API requests. However, any field with an
  863. // empty value appearing in NullFields will be sent to the server as
  864. // null. It is an error if a field in this list has a non-empty value.
  865. // This may be used to include null fields in Patch requests.
  866. NullFields []string `json:"-"`
  867. }
  868. func (s *DominantColorsAnnotation) MarshalJSON() ([]byte, error) {
  869. type NoMethod DominantColorsAnnotation
  870. raw := NoMethod(*s)
  871. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  872. }
  873. // EntityAnnotation: Set of detected entity features.
  874. type EntityAnnotation struct {
  875. // BoundingPoly: Image region to which this entity belongs. Not
  876. // produced
  877. // for `LABEL_DETECTION` features.
  878. BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"`
  879. // Confidence: **Deprecated. Use `score` instead.**
  880. // The accuracy of the entity detection in an image.
  881. // For example, for an image in which the "Eiffel Tower" entity is
  882. // detected,
  883. // this field represents the confidence that there is a tower in the
  884. // query
  885. // image. Range [0, 1].
  886. Confidence float64 `json:"confidence,omitempty"`
  887. // Description: Entity textual description, expressed in its `locale`
  888. // language.
  889. Description string `json:"description,omitempty"`
  890. // Locale: The language code for the locale in which the entity
  891. // textual
  892. // `description` is expressed.
  893. Locale string `json:"locale,omitempty"`
  894. // Locations: The location information for the detected entity.
  895. // Multiple
  896. // `LocationInfo` elements can be present because one location
  897. // may
  898. // indicate the location of the scene in the image, and another
  899. // location
  900. // may indicate the location of the place where the image was
  901. // taken.
  902. // Location information is usually present for landmarks.
  903. Locations []*LocationInfo `json:"locations,omitempty"`
  904. // Mid: Opaque entity ID. Some IDs may be available in
  905. // [Google Knowledge Graph
  906. // Search
  907. // API](https://developers.google.com/knowledge-graph/).
  908. Mid string `json:"mid,omitempty"`
  909. // Properties: Some entities may have optional user-supplied `Property`
  910. // (name/value)
  911. // fields, such a score or string that qualifies the entity.
  912. Properties []*Property `json:"properties,omitempty"`
  913. // Score: Overall score of the result. Range [0, 1].
  914. Score float64 `json:"score,omitempty"`
  915. // Topicality: The relevancy of the ICA (Image Content Annotation) label
  916. // to the
  917. // image. For example, the relevancy of "tower" is likely higher to an
  918. // image
  919. // containing the detected "Eiffel Tower" than to an image containing
  920. // a
  921. // detected distant towering building, even though the confidence
  922. // that
  923. // there is a tower in each image may be the same. Range [0, 1].
  924. Topicality float64 `json:"topicality,omitempty"`
  925. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  926. // unconditionally include in API requests. By default, fields with
  927. // empty values are omitted from API requests. However, any non-pointer,
  928. // non-interface field appearing in ForceSendFields will be sent to the
  929. // server regardless of whether the field is empty or not. This may be
  930. // used to include empty fields in Patch requests.
  931. ForceSendFields []string `json:"-"`
  932. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  933. // in API requests with the JSON null value. By default, fields with
  934. // empty values are omitted from API requests. However, any field with
  935. // an empty value appearing in NullFields will be sent to the server as
  936. // null. It is an error if a field in this list has a non-empty value.
  937. // This may be used to include null fields in Patch requests.
  938. NullFields []string `json:"-"`
  939. }
  940. func (s *EntityAnnotation) MarshalJSON() ([]byte, error) {
  941. type NoMethod EntityAnnotation
  942. raw := NoMethod(*s)
  943. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  944. }
  945. func (s *EntityAnnotation) UnmarshalJSON(data []byte) error {
  946. type NoMethod EntityAnnotation
  947. var s1 struct {
  948. Confidence gensupport.JSONFloat64 `json:"confidence"`
  949. Score gensupport.JSONFloat64 `json:"score"`
  950. Topicality gensupport.JSONFloat64 `json:"topicality"`
  951. *NoMethod
  952. }
  953. s1.NoMethod = (*NoMethod)(s)
  954. if err := json.Unmarshal(data, &s1); err != nil {
  955. return err
  956. }
  957. s.Confidence = float64(s1.Confidence)
  958. s.Score = float64(s1.Score)
  959. s.Topicality = float64(s1.Topicality)
  960. return nil
  961. }
  962. // FaceAnnotation: A face annotation object contains the results of face
  963. // detection.
  964. type FaceAnnotation struct {
  965. // AngerLikelihood: Anger likelihood.
  966. //
  967. // Possible values:
  968. // "UNKNOWN" - Unknown likelihood.
  969. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  970. // specified vertical.
  971. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  972. // vertical.
  973. // "POSSIBLE" - It is possible that the image belongs to the specified
  974. // vertical.
  975. // "LIKELY" - It is likely that the image belongs to the specified
  976. // vertical.
  977. // "VERY_LIKELY" - It is very likely that the image belongs to the
  978. // specified vertical.
  979. AngerLikelihood string `json:"angerLikelihood,omitempty"`
  980. // BlurredLikelihood: Blurred likelihood.
  981. //
  982. // Possible values:
  983. // "UNKNOWN" - Unknown likelihood.
  984. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  985. // specified vertical.
  986. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  987. // vertical.
  988. // "POSSIBLE" - It is possible that the image belongs to the specified
  989. // vertical.
  990. // "LIKELY" - It is likely that the image belongs to the specified
  991. // vertical.
  992. // "VERY_LIKELY" - It is very likely that the image belongs to the
  993. // specified vertical.
  994. BlurredLikelihood string `json:"blurredLikelihood,omitempty"`
  995. // BoundingPoly: The bounding polygon around the face. The coordinates
  996. // of the bounding box
  997. // are in the original image's scale.
  998. // The bounding box is computed to "frame" the face in accordance with
  999. // human
  1000. // expectations. It is based on the landmarker results.
  1001. // Note that one or more x and/or y coordinates may not be generated in
  1002. // the
  1003. // `BoundingPoly` (the polygon will be unbounded) if only a partial
  1004. // face
  1005. // appears in the image to be annotated.
  1006. BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"`
  1007. // DetectionConfidence: Detection confidence. Range [0, 1].
  1008. DetectionConfidence float64 `json:"detectionConfidence,omitempty"`
  1009. // FdBoundingPoly: The `fd_bounding_poly` bounding polygon is tighter
  1010. // than the
  1011. // `boundingPoly`, and encloses only the skin part of the face.
  1012. // Typically, it
  1013. // is used to eliminate the face from any image analysis that detects
  1014. // the
  1015. // "amount of skin" visible in an image. It is not based on
  1016. // the
  1017. // landmarker results, only on the initial face detection, hence
  1018. // the <code>fd</code> (face detection) prefix.
  1019. FdBoundingPoly *BoundingPoly `json:"fdBoundingPoly,omitempty"`
  1020. // HeadwearLikelihood: Headwear likelihood.
  1021. //
  1022. // Possible values:
  1023. // "UNKNOWN" - Unknown likelihood.
  1024. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1025. // specified vertical.
  1026. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1027. // vertical.
  1028. // "POSSIBLE" - It is possible that the image belongs to the specified
  1029. // vertical.
  1030. // "LIKELY" - It is likely that the image belongs to the specified
  1031. // vertical.
  1032. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1033. // specified vertical.
  1034. HeadwearLikelihood string `json:"headwearLikelihood,omitempty"`
  1035. // JoyLikelihood: Joy likelihood.
  1036. //
  1037. // Possible values:
  1038. // "UNKNOWN" - Unknown likelihood.
  1039. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1040. // specified vertical.
  1041. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1042. // vertical.
  1043. // "POSSIBLE" - It is possible that the image belongs to the specified
  1044. // vertical.
  1045. // "LIKELY" - It is likely that the image belongs to the specified
  1046. // vertical.
  1047. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1048. // specified vertical.
  1049. JoyLikelihood string `json:"joyLikelihood,omitempty"`
  1050. // LandmarkingConfidence: Face landmarking confidence. Range [0, 1].
  1051. LandmarkingConfidence float64 `json:"landmarkingConfidence,omitempty"`
  1052. // Landmarks: Detected face landmarks.
  1053. Landmarks []*Landmark `json:"landmarks,omitempty"`
  1054. // PanAngle: Yaw angle, which indicates the leftward/rightward angle
  1055. // that the face is
  1056. // pointing relative to the vertical plane perpendicular to the image.
  1057. // Range
  1058. // [-180,180].
  1059. PanAngle float64 `json:"panAngle,omitempty"`
  1060. // RollAngle: Roll angle, which indicates the amount of
  1061. // clockwise/anti-clockwise rotation
  1062. // of the face relative to the image vertical about the axis
  1063. // perpendicular to
  1064. // the face. Range [-180,180].
  1065. RollAngle float64 `json:"rollAngle,omitempty"`
  1066. // SorrowLikelihood: Sorrow likelihood.
  1067. //
  1068. // Possible values:
  1069. // "UNKNOWN" - Unknown likelihood.
  1070. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1071. // specified vertical.
  1072. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1073. // vertical.
  1074. // "POSSIBLE" - It is possible that the image belongs to the specified
  1075. // vertical.
  1076. // "LIKELY" - It is likely that the image belongs to the specified
  1077. // vertical.
  1078. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1079. // specified vertical.
  1080. SorrowLikelihood string `json:"sorrowLikelihood,omitempty"`
  1081. // SurpriseLikelihood: Surprise likelihood.
  1082. //
  1083. // Possible values:
  1084. // "UNKNOWN" - Unknown likelihood.
  1085. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1086. // specified vertical.
  1087. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1088. // vertical.
  1089. // "POSSIBLE" - It is possible that the image belongs to the specified
  1090. // vertical.
  1091. // "LIKELY" - It is likely that the image belongs to the specified
  1092. // vertical.
  1093. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1094. // specified vertical.
  1095. SurpriseLikelihood string `json:"surpriseLikelihood,omitempty"`
  1096. // TiltAngle: Pitch angle, which indicates the upwards/downwards angle
  1097. // that the face is
  1098. // pointing relative to the image's horizontal plane. Range [-180,180].
  1099. TiltAngle float64 `json:"tiltAngle,omitempty"`
  1100. // UnderExposedLikelihood: Under-exposed likelihood.
  1101. //
  1102. // Possible values:
  1103. // "UNKNOWN" - Unknown likelihood.
  1104. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1105. // specified vertical.
  1106. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1107. // vertical.
  1108. // "POSSIBLE" - It is possible that the image belongs to the specified
  1109. // vertical.
  1110. // "LIKELY" - It is likely that the image belongs to the specified
  1111. // vertical.
  1112. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1113. // specified vertical.
  1114. UnderExposedLikelihood string `json:"underExposedLikelihood,omitempty"`
  1115. // ForceSendFields is a list of field names (e.g. "AngerLikelihood") to
  1116. // unconditionally include in API requests. By default, fields with
  1117. // empty values are omitted from API requests. However, any non-pointer,
  1118. // non-interface field appearing in ForceSendFields will be sent to the
  1119. // server regardless of whether the field is empty or not. This may be
  1120. // used to include empty fields in Patch requests.
  1121. ForceSendFields []string `json:"-"`
  1122. // NullFields is a list of field names (e.g. "AngerLikelihood") to
  1123. // include in API requests with the JSON null value. By default, fields
  1124. // with empty values are omitted from API requests. However, any field
  1125. // with an empty value appearing in NullFields will be sent to the
  1126. // server as null. It is an error if a field in this list has a
  1127. // non-empty value. This may be used to include null fields in Patch
  1128. // requests.
  1129. NullFields []string `json:"-"`
  1130. }
  1131. func (s *FaceAnnotation) MarshalJSON() ([]byte, error) {
  1132. type NoMethod FaceAnnotation
  1133. raw := NoMethod(*s)
  1134. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1135. }
  1136. func (s *FaceAnnotation) UnmarshalJSON(data []byte) error {
  1137. type NoMethod FaceAnnotation
  1138. var s1 struct {
  1139. DetectionConfidence gensupport.JSONFloat64 `json:"detectionConfidence"`
  1140. LandmarkingConfidence gensupport.JSONFloat64 `json:"landmarkingConfidence"`
  1141. PanAngle gensupport.JSONFloat64 `json:"panAngle"`
  1142. RollAngle gensupport.JSONFloat64 `json:"rollAngle"`
  1143. TiltAngle gensupport.JSONFloat64 `json:"tiltAngle"`
  1144. *NoMethod
  1145. }
  1146. s1.NoMethod = (*NoMethod)(s)
  1147. if err := json.Unmarshal(data, &s1); err != nil {
  1148. return err
  1149. }
  1150. s.DetectionConfidence = float64(s1.DetectionConfidence)
  1151. s.LandmarkingConfidence = float64(s1.LandmarkingConfidence)
  1152. s.PanAngle = float64(s1.PanAngle)
  1153. s.RollAngle = float64(s1.RollAngle)
  1154. s.TiltAngle = float64(s1.TiltAngle)
  1155. return nil
  1156. }
  1157. // GcsDestination: The Google Cloud Storage location where the output
  1158. // will be written to.
  1159. type GcsDestination struct {
  1160. // Uri: Google Cloud Storage URI where the results will be stored.
  1161. // Results will
  1162. // be in JSON format and preceded by its corresponding input URI. This
  1163. // field
  1164. // can either represent a single file, or a prefix for multiple
  1165. // outputs.
  1166. // Prefixes must end in a `/`.
  1167. //
  1168. // Examples:
  1169. //
  1170. // * File: gs://bucket-name/filename.json
  1171. // * Prefix: gs://bucket-name/prefix/here/
  1172. // * File: gs://bucket-name/prefix/here
  1173. //
  1174. // If multiple outputs, each response is still AnnotateFileResponse,
  1175. // each of
  1176. // which contains some subset of the full list of
  1177. // AnnotateImageResponse.
  1178. // Multiple outputs can happen if, for example, the output JSON is too
  1179. // large
  1180. // and overflows into multiple sharded files.
  1181. Uri string `json:"uri,omitempty"`
  1182. // ForceSendFields is a list of field names (e.g. "Uri") to
  1183. // unconditionally include in API requests. By default, fields with
  1184. // empty values are omitted from API requests. However, any non-pointer,
  1185. // non-interface field appearing in ForceSendFields will be sent to the
  1186. // server regardless of whether the field is empty or not. This may be
  1187. // used to include empty fields in Patch requests.
  1188. ForceSendFields []string `json:"-"`
  1189. // NullFields is a list of field names (e.g. "Uri") to include in API
  1190. // requests with the JSON null value. By default, fields with empty
  1191. // values are omitted from API requests. However, any field with an
  1192. // empty value appearing in NullFields will be sent to the server as
  1193. // null. It is an error if a field in this list has a non-empty value.
  1194. // This may be used to include null fields in Patch requests.
  1195. NullFields []string `json:"-"`
  1196. }
  1197. func (s *GcsDestination) MarshalJSON() ([]byte, error) {
  1198. type NoMethod GcsDestination
  1199. raw := NoMethod(*s)
  1200. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1201. }
  1202. // GcsSource: The Google Cloud Storage location where the input will be
  1203. // read from.
  1204. type GcsSource struct {
  1205. // Uri: Google Cloud Storage URI for the input file. This must only be
  1206. // a
  1207. // Google Cloud Storage object. Wildcards are not currently supported.
  1208. Uri string `json:"uri,omitempty"`
  1209. // ForceSendFields is a list of field names (e.g. "Uri") to
  1210. // unconditionally include in API requests. By default, fields with
  1211. // empty values are omitted from API requests. However, any non-pointer,
  1212. // non-interface field appearing in ForceSendFields will be sent to the
  1213. // server regardless of whether the field is empty or not. This may be
  1214. // used to include empty fields in Patch requests.
  1215. ForceSendFields []string `json:"-"`
  1216. // NullFields is a list of field names (e.g. "Uri") to include in API
  1217. // requests with the JSON null value. By default, fields with empty
  1218. // values are omitted from API requests. However, any field with an
  1219. // empty value appearing in NullFields will be sent to the server as
  1220. // null. It is an error if a field in this list has a non-empty value.
  1221. // This may be used to include null fields in Patch requests.
  1222. NullFields []string `json:"-"`
  1223. }
  1224. func (s *GcsSource) MarshalJSON() ([]byte, error) {
  1225. type NoMethod GcsSource
  1226. raw := NoMethod(*s)
  1227. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1228. }
  1229. // GoogleCloudVisionV1p1beta1AnnotateFileResponse: Response to a single
  1230. // file annotation request. A file may contain one or more
  1231. // images, which individually have their own responses.
  1232. type GoogleCloudVisionV1p1beta1AnnotateFileResponse struct {
  1233. // InputConfig: Information about the file for which this response is
  1234. // generated.
  1235. InputConfig *GoogleCloudVisionV1p1beta1InputConfig `json:"inputConfig,omitempty"`
  1236. // Responses: Individual responses to images found within the file.
  1237. Responses []*GoogleCloudVisionV1p1beta1AnnotateImageResponse `json:"responses,omitempty"`
  1238. // ForceSendFields is a list of field names (e.g. "InputConfig") to
  1239. // unconditionally include in API requests. By default, fields with
  1240. // empty values are omitted from API requests. However, any non-pointer,
  1241. // non-interface field appearing in ForceSendFields will be sent to the
  1242. // server regardless of whether the field is empty or not. This may be
  1243. // used to include empty fields in Patch requests.
  1244. ForceSendFields []string `json:"-"`
  1245. // NullFields is a list of field names (e.g. "InputConfig") to include
  1246. // in API requests with the JSON null value. By default, fields with
  1247. // empty values are omitted from API requests. However, any field with
  1248. // an empty value appearing in NullFields will be sent to the server as
  1249. // null. It is an error if a field in this list has a non-empty value.
  1250. // This may be used to include null fields in Patch requests.
  1251. NullFields []string `json:"-"`
  1252. }
  1253. func (s *GoogleCloudVisionV1p1beta1AnnotateFileResponse) MarshalJSON() ([]byte, error) {
  1254. type NoMethod GoogleCloudVisionV1p1beta1AnnotateFileResponse
  1255. raw := NoMethod(*s)
  1256. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1257. }
  1258. // GoogleCloudVisionV1p1beta1AnnotateImageResponse: Response to an image
  1259. // annotation request.
  1260. type GoogleCloudVisionV1p1beta1AnnotateImageResponse struct {
  1261. // Context: If present, contextual information is needed to understand
  1262. // where this image
  1263. // comes from.
  1264. Context *GoogleCloudVisionV1p1beta1ImageAnnotationContext `json:"context,omitempty"`
  1265. // CropHintsAnnotation: If present, crop hints have completed
  1266. // successfully.
  1267. CropHintsAnnotation *GoogleCloudVisionV1p1beta1CropHintsAnnotation `json:"cropHintsAnnotation,omitempty"`
  1268. // Error: If set, represents the error message for the operation.
  1269. // Note that filled-in image annotations are guaranteed to be
  1270. // correct, even when `error` is set.
  1271. Error *Status `json:"error,omitempty"`
  1272. // FaceAnnotations: If present, face detection has completed
  1273. // successfully.
  1274. FaceAnnotations []*GoogleCloudVisionV1p1beta1FaceAnnotation `json:"faceAnnotations,omitempty"`
  1275. // FullTextAnnotation: If present, text (OCR) detection or document
  1276. // (OCR) text detection has
  1277. // completed successfully.
  1278. // This annotation provides the structural hierarchy for the OCR
  1279. // detected
  1280. // text.
  1281. FullTextAnnotation *GoogleCloudVisionV1p1beta1TextAnnotation `json:"fullTextAnnotation,omitempty"`
  1282. // ImagePropertiesAnnotation: If present, image properties were
  1283. // extracted successfully.
  1284. ImagePropertiesAnnotation *GoogleCloudVisionV1p1beta1ImageProperties `json:"imagePropertiesAnnotation,omitempty"`
  1285. // LabelAnnotations: If present, label detection has completed
  1286. // successfully.
  1287. LabelAnnotations []*GoogleCloudVisionV1p1beta1EntityAnnotation `json:"labelAnnotations,omitempty"`
  1288. // LandmarkAnnotations: If present, landmark detection has completed
  1289. // successfully.
  1290. LandmarkAnnotations []*GoogleCloudVisionV1p1beta1EntityAnnotation `json:"landmarkAnnotations,omitempty"`
  1291. // LocalizedObjectAnnotations: If present, localized object detection
  1292. // has completed successfully.
  1293. // This will be sorted descending by confidence score.
  1294. LocalizedObjectAnnotations []*GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation `json:"localizedObjectAnnotations,omitempty"`
  1295. // LogoAnnotations: If present, logo detection has completed
  1296. // successfully.
  1297. LogoAnnotations []*GoogleCloudVisionV1p1beta1EntityAnnotation `json:"logoAnnotations,omitempty"`
  1298. // ProductSearchResults: If present, product search has completed
  1299. // successfully.
  1300. ProductSearchResults *GoogleCloudVisionV1p1beta1ProductSearchResults `json:"productSearchResults,omitempty"`
  1301. // SafeSearchAnnotation: If present, safe-search annotation has
  1302. // completed successfully.
  1303. SafeSearchAnnotation *GoogleCloudVisionV1p1beta1SafeSearchAnnotation `json:"safeSearchAnnotation,omitempty"`
  1304. // TextAnnotations: If present, text (OCR) detection has completed
  1305. // successfully.
  1306. TextAnnotations []*GoogleCloudVisionV1p1beta1EntityAnnotation `json:"textAnnotations,omitempty"`
  1307. // WebDetection: If present, web detection has completed successfully.
  1308. WebDetection *GoogleCloudVisionV1p1beta1WebDetection `json:"webDetection,omitempty"`
  1309. // ForceSendFields is a list of field names (e.g. "Context") to
  1310. // unconditionally include in API requests. By default, fields with
  1311. // empty values are omitted from API requests. However, any non-pointer,
  1312. // non-interface field appearing in ForceSendFields will be sent to the
  1313. // server regardless of whether the field is empty or not. This may be
  1314. // used to include empty fields in Patch requests.
  1315. ForceSendFields []string `json:"-"`
  1316. // NullFields is a list of field names (e.g. "Context") to include in
  1317. // API requests with the JSON null value. By default, fields with empty
  1318. // values are omitted from API requests. However, any field with an
  1319. // empty value appearing in NullFields will be sent to the server as
  1320. // null. It is an error if a field in this list has a non-empty value.
  1321. // This may be used to include null fields in Patch requests.
  1322. NullFields []string `json:"-"`
  1323. }
  1324. func (s *GoogleCloudVisionV1p1beta1AnnotateImageResponse) MarshalJSON() ([]byte, error) {
  1325. type NoMethod GoogleCloudVisionV1p1beta1AnnotateImageResponse
  1326. raw := NoMethod(*s)
  1327. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1328. }
  1329. // GoogleCloudVisionV1p1beta1AsyncAnnotateFileResponse: The response for
  1330. // a single offline file annotation request.
  1331. type GoogleCloudVisionV1p1beta1AsyncAnnotateFileResponse struct {
  1332. // OutputConfig: The output location and metadata from
  1333. // AsyncAnnotateFileRequest.
  1334. OutputConfig *GoogleCloudVisionV1p1beta1OutputConfig `json:"outputConfig,omitempty"`
  1335. // ForceSendFields is a list of field names (e.g. "OutputConfig") to
  1336. // unconditionally include in API requests. By default, fields with
  1337. // empty values are omitted from API requests. However, any non-pointer,
  1338. // non-interface field appearing in ForceSendFields will be sent to the
  1339. // server regardless of whether the field is empty or not. This may be
  1340. // used to include empty fields in Patch requests.
  1341. ForceSendFields []string `json:"-"`
  1342. // NullFields is a list of field names (e.g. "OutputConfig") to include
  1343. // in API requests with the JSON null value. By default, fields with
  1344. // empty values are omitted from API requests. However, any field with
  1345. // an empty value appearing in NullFields will be sent to the server as
  1346. // null. It is an error if a field in this list has a non-empty value.
  1347. // This may be used to include null fields in Patch requests.
  1348. NullFields []string `json:"-"`
  1349. }
  1350. func (s *GoogleCloudVisionV1p1beta1AsyncAnnotateFileResponse) MarshalJSON() ([]byte, error) {
  1351. type NoMethod GoogleCloudVisionV1p1beta1AsyncAnnotateFileResponse
  1352. raw := NoMethod(*s)
  1353. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1354. }
  1355. // GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesResponse: Response
  1356. // to an async batch file annotation request.
  1357. type GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesResponse struct {
  1358. // Responses: The list of file annotation responses, one for each
  1359. // request in
  1360. // AsyncBatchAnnotateFilesRequest.
  1361. Responses []*GoogleCloudVisionV1p1beta1AsyncAnnotateFileResponse `json:"responses,omitempty"`
  1362. // ForceSendFields is a list of field names (e.g. "Responses") to
  1363. // unconditionally include in API requests. By default, fields with
  1364. // empty values are omitted from API requests. However, any non-pointer,
  1365. // non-interface field appearing in ForceSendFields will be sent to the
  1366. // server regardless of whether the field is empty or not. This may be
  1367. // used to include empty fields in Patch requests.
  1368. ForceSendFields []string `json:"-"`
  1369. // NullFields is a list of field names (e.g. "Responses") to include in
  1370. // API requests with the JSON null value. By default, fields with empty
  1371. // values are omitted from API requests. However, any field with an
  1372. // empty value appearing in NullFields will be sent to the server as
  1373. // null. It is an error if a field in this list has a non-empty value.
  1374. // This may be used to include null fields in Patch requests.
  1375. NullFields []string `json:"-"`
  1376. }
  1377. func (s *GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) {
  1378. type NoMethod GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesResponse
  1379. raw := NoMethod(*s)
  1380. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1381. }
  1382. // GoogleCloudVisionV1p1beta1Block: Logical element on the page.
  1383. type GoogleCloudVisionV1p1beta1Block struct {
  1384. // BlockType: Detected block type (text, image etc) for this block.
  1385. //
  1386. // Possible values:
  1387. // "UNKNOWN" - Unknown block type.
  1388. // "TEXT" - Regular text block.
  1389. // "TABLE" - Table block.
  1390. // "PICTURE" - Image block.
  1391. // "RULER" - Horizontal/vertical line box.
  1392. // "BARCODE" - Barcode block.
  1393. BlockType string `json:"blockType,omitempty"`
  1394. // BoundingBox: The bounding box for the block.
  1395. // The vertices are in the order of top-left, top-right,
  1396. // bottom-right,
  1397. // bottom-left. When a rotation of the bounding box is detected the
  1398. // rotation
  1399. // is represented as around the top-left corner as defined when the text
  1400. // is
  1401. // read in the 'natural' orientation.
  1402. // For example:
  1403. //
  1404. // * when the text is horizontal it might look like:
  1405. //
  1406. // 0----1
  1407. // | |
  1408. // 3----2
  1409. //
  1410. // * when it's rotated 180 degrees around the top-left corner it
  1411. // becomes:
  1412. //
  1413. // 2----3
  1414. // | |
  1415. // 1----0
  1416. //
  1417. // and the vertex order will still be (0, 1, 2, 3).
  1418. BoundingBox *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingBox,omitempty"`
  1419. // Confidence: Confidence of the OCR results on the block. Range [0, 1].
  1420. Confidence float64 `json:"confidence,omitempty"`
  1421. // Paragraphs: List of paragraphs in this block (if this blocks is of
  1422. // type text).
  1423. Paragraphs []*GoogleCloudVisionV1p1beta1Paragraph `json:"paragraphs,omitempty"`
  1424. // Property: Additional information detected for the block.
  1425. Property *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty `json:"property,omitempty"`
  1426. // ForceSendFields is a list of field names (e.g. "BlockType") to
  1427. // unconditionally include in API requests. By default, fields with
  1428. // empty values are omitted from API requests. However, any non-pointer,
  1429. // non-interface field appearing in ForceSendFields will be sent to the
  1430. // server regardless of whether the field is empty or not. This may be
  1431. // used to include empty fields in Patch requests.
  1432. ForceSendFields []string `json:"-"`
  1433. // NullFields is a list of field names (e.g. "BlockType") to include in
  1434. // API requests with the JSON null value. By default, fields with empty
  1435. // values are omitted from API requests. However, any field with an
  1436. // empty value appearing in NullFields will be sent to the server as
  1437. // null. It is an error if a field in this list has a non-empty value.
  1438. // This may be used to include null fields in Patch requests.
  1439. NullFields []string `json:"-"`
  1440. }
  1441. func (s *GoogleCloudVisionV1p1beta1Block) MarshalJSON() ([]byte, error) {
  1442. type NoMethod GoogleCloudVisionV1p1beta1Block
  1443. raw := NoMethod(*s)
  1444. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1445. }
  1446. func (s *GoogleCloudVisionV1p1beta1Block) UnmarshalJSON(data []byte) error {
  1447. type NoMethod GoogleCloudVisionV1p1beta1Block
  1448. var s1 struct {
  1449. Confidence gensupport.JSONFloat64 `json:"confidence"`
  1450. *NoMethod
  1451. }
  1452. s1.NoMethod = (*NoMethod)(s)
  1453. if err := json.Unmarshal(data, &s1); err != nil {
  1454. return err
  1455. }
  1456. s.Confidence = float64(s1.Confidence)
  1457. return nil
  1458. }
  1459. // GoogleCloudVisionV1p1beta1BoundingPoly: A bounding polygon for the
  1460. // detected image annotation.
  1461. type GoogleCloudVisionV1p1beta1BoundingPoly struct {
  1462. // NormalizedVertices: The bounding polygon normalized vertices.
  1463. NormalizedVertices []*GoogleCloudVisionV1p1beta1NormalizedVertex `json:"normalizedVertices,omitempty"`
  1464. // Vertices: The bounding polygon vertices.
  1465. Vertices []*GoogleCloudVisionV1p1beta1Vertex `json:"vertices,omitempty"`
  1466. // ForceSendFields is a list of field names (e.g. "NormalizedVertices")
  1467. // to unconditionally include in API requests. By default, fields with
  1468. // empty values are omitted from API requests. However, any non-pointer,
  1469. // non-interface field appearing in ForceSendFields will be sent to the
  1470. // server regardless of whether the field is empty or not. This may be
  1471. // used to include empty fields in Patch requests.
  1472. ForceSendFields []string `json:"-"`
  1473. // NullFields is a list of field names (e.g. "NormalizedVertices") to
  1474. // include in API requests with the JSON null value. By default, fields
  1475. // with empty values are omitted from API requests. However, any field
  1476. // with an empty value appearing in NullFields will be sent to the
  1477. // server as null. It is an error if a field in this list has a
  1478. // non-empty value. This may be used to include null fields in Patch
  1479. // requests.
  1480. NullFields []string `json:"-"`
  1481. }
  1482. func (s *GoogleCloudVisionV1p1beta1BoundingPoly) MarshalJSON() ([]byte, error) {
  1483. type NoMethod GoogleCloudVisionV1p1beta1BoundingPoly
  1484. raw := NoMethod(*s)
  1485. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1486. }
  1487. // GoogleCloudVisionV1p1beta1ColorInfo: Color information consists of
  1488. // RGB channels, score, and the fraction of
  1489. // the image that the color occupies in the image.
  1490. type GoogleCloudVisionV1p1beta1ColorInfo struct {
  1491. // Color: RGB components of the color.
  1492. Color *Color `json:"color,omitempty"`
  1493. // PixelFraction: The fraction of pixels the color occupies in the
  1494. // image.
  1495. // Value in range [0, 1].
  1496. PixelFraction float64 `json:"pixelFraction,omitempty"`
  1497. // Score: Image-specific score for this color. Value in range [0, 1].
  1498. Score float64 `json:"score,omitempty"`
  1499. // ForceSendFields is a list of field names (e.g. "Color") to
  1500. // unconditionally include in API requests. By default, fields with
  1501. // empty values are omitted from API requests. However, any non-pointer,
  1502. // non-interface field appearing in ForceSendFields will be sent to the
  1503. // server regardless of whether the field is empty or not. This may be
  1504. // used to include empty fields in Patch requests.
  1505. ForceSendFields []string `json:"-"`
  1506. // NullFields is a list of field names (e.g. "Color") to include in API
  1507. // requests with the JSON null value. By default, fields with empty
  1508. // values are omitted from API requests. However, any field with an
  1509. // empty value appearing in NullFields will be sent to the server as
  1510. // null. It is an error if a field in this list has a non-empty value.
  1511. // This may be used to include null fields in Patch requests.
  1512. NullFields []string `json:"-"`
  1513. }
  1514. func (s *GoogleCloudVisionV1p1beta1ColorInfo) MarshalJSON() ([]byte, error) {
  1515. type NoMethod GoogleCloudVisionV1p1beta1ColorInfo
  1516. raw := NoMethod(*s)
  1517. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1518. }
  1519. func (s *GoogleCloudVisionV1p1beta1ColorInfo) UnmarshalJSON(data []byte) error {
  1520. type NoMethod GoogleCloudVisionV1p1beta1ColorInfo
  1521. var s1 struct {
  1522. PixelFraction gensupport.JSONFloat64 `json:"pixelFraction"`
  1523. Score gensupport.JSONFloat64 `json:"score"`
  1524. *NoMethod
  1525. }
  1526. s1.NoMethod = (*NoMethod)(s)
  1527. if err := json.Unmarshal(data, &s1); err != nil {
  1528. return err
  1529. }
  1530. s.PixelFraction = float64(s1.PixelFraction)
  1531. s.Score = float64(s1.Score)
  1532. return nil
  1533. }
  1534. // GoogleCloudVisionV1p1beta1CropHint: Single crop hint that is used to
  1535. // generate a new crop when serving an image.
  1536. type GoogleCloudVisionV1p1beta1CropHint struct {
  1537. // BoundingPoly: The bounding polygon for the crop region. The
  1538. // coordinates of the bounding
  1539. // box are in the original image's scale.
  1540. BoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingPoly,omitempty"`
  1541. // Confidence: Confidence of this being a salient region. Range [0, 1].
  1542. Confidence float64 `json:"confidence,omitempty"`
  1543. // ImportanceFraction: Fraction of importance of this salient region
  1544. // with respect to the original
  1545. // image.
  1546. ImportanceFraction float64 `json:"importanceFraction,omitempty"`
  1547. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  1548. // unconditionally include in API requests. By default, fields with
  1549. // empty values are omitted from API requests. However, any non-pointer,
  1550. // non-interface field appearing in ForceSendFields will be sent to the
  1551. // server regardless of whether the field is empty or not. This may be
  1552. // used to include empty fields in Patch requests.
  1553. ForceSendFields []string `json:"-"`
  1554. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  1555. // in API requests with the JSON null value. By default, fields with
  1556. // empty values are omitted from API requests. However, any field with
  1557. // an empty value appearing in NullFields will be sent to the server as
  1558. // null. It is an error if a field in this list has a non-empty value.
  1559. // This may be used to include null fields in Patch requests.
  1560. NullFields []string `json:"-"`
  1561. }
  1562. func (s *GoogleCloudVisionV1p1beta1CropHint) MarshalJSON() ([]byte, error) {
  1563. type NoMethod GoogleCloudVisionV1p1beta1CropHint
  1564. raw := NoMethod(*s)
  1565. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1566. }
  1567. func (s *GoogleCloudVisionV1p1beta1CropHint) UnmarshalJSON(data []byte) error {
  1568. type NoMethod GoogleCloudVisionV1p1beta1CropHint
  1569. var s1 struct {
  1570. Confidence gensupport.JSONFloat64 `json:"confidence"`
  1571. ImportanceFraction gensupport.JSONFloat64 `json:"importanceFraction"`
  1572. *NoMethod
  1573. }
  1574. s1.NoMethod = (*NoMethod)(s)
  1575. if err := json.Unmarshal(data, &s1); err != nil {
  1576. return err
  1577. }
  1578. s.Confidence = float64(s1.Confidence)
  1579. s.ImportanceFraction = float64(s1.ImportanceFraction)
  1580. return nil
  1581. }
  1582. // GoogleCloudVisionV1p1beta1CropHintsAnnotation: Set of crop hints that
  1583. // are used to generate new crops when serving images.
  1584. type GoogleCloudVisionV1p1beta1CropHintsAnnotation struct {
  1585. // CropHints: Crop hint results.
  1586. CropHints []*GoogleCloudVisionV1p1beta1CropHint `json:"cropHints,omitempty"`
  1587. // ForceSendFields is a list of field names (e.g. "CropHints") to
  1588. // unconditionally include in API requests. By default, fields with
  1589. // empty values are omitted from API requests. However, any non-pointer,
  1590. // non-interface field appearing in ForceSendFields will be sent to the
  1591. // server regardless of whether the field is empty or not. This may be
  1592. // used to include empty fields in Patch requests.
  1593. ForceSendFields []string `json:"-"`
  1594. // NullFields is a list of field names (e.g. "CropHints") to include in
  1595. // API requests with the JSON null value. By default, fields with empty
  1596. // values are omitted from API requests. However, any field with an
  1597. // empty value appearing in NullFields will be sent to the server as
  1598. // null. It is an error if a field in this list has a non-empty value.
  1599. // This may be used to include null fields in Patch requests.
  1600. NullFields []string `json:"-"`
  1601. }
  1602. func (s *GoogleCloudVisionV1p1beta1CropHintsAnnotation) MarshalJSON() ([]byte, error) {
  1603. type NoMethod GoogleCloudVisionV1p1beta1CropHintsAnnotation
  1604. raw := NoMethod(*s)
  1605. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1606. }
  1607. // GoogleCloudVisionV1p1beta1DominantColorsAnnotation: Set of dominant
  1608. // colors and their corresponding scores.
  1609. type GoogleCloudVisionV1p1beta1DominantColorsAnnotation struct {
  1610. // Colors: RGB color values with their score and pixel fraction.
  1611. Colors []*GoogleCloudVisionV1p1beta1ColorInfo `json:"colors,omitempty"`
  1612. // ForceSendFields is a list of field names (e.g. "Colors") to
  1613. // unconditionally include in API requests. By default, fields with
  1614. // empty values are omitted from API requests. However, any non-pointer,
  1615. // non-interface field appearing in ForceSendFields will be sent to the
  1616. // server regardless of whether the field is empty or not. This may be
  1617. // used to include empty fields in Patch requests.
  1618. ForceSendFields []string `json:"-"`
  1619. // NullFields is a list of field names (e.g. "Colors") to include in API
  1620. // requests with the JSON null value. By default, fields with empty
  1621. // values are omitted from API requests. However, any field with an
  1622. // empty value appearing in NullFields will be sent to the server as
  1623. // null. It is an error if a field in this list has a non-empty value.
  1624. // This may be used to include null fields in Patch requests.
  1625. NullFields []string `json:"-"`
  1626. }
  1627. func (s *GoogleCloudVisionV1p1beta1DominantColorsAnnotation) MarshalJSON() ([]byte, error) {
  1628. type NoMethod GoogleCloudVisionV1p1beta1DominantColorsAnnotation
  1629. raw := NoMethod(*s)
  1630. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1631. }
  1632. // GoogleCloudVisionV1p1beta1EntityAnnotation: Set of detected entity
  1633. // features.
  1634. type GoogleCloudVisionV1p1beta1EntityAnnotation struct {
  1635. // BoundingPoly: Image region to which this entity belongs. Not
  1636. // produced
  1637. // for `LABEL_DETECTION` features.
  1638. BoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingPoly,omitempty"`
  1639. // Confidence: **Deprecated. Use `score` instead.**
  1640. // The accuracy of the entity detection in an image.
  1641. // For example, for an image in which the "Eiffel Tower" entity is
  1642. // detected,
  1643. // this field represents the confidence that there is a tower in the
  1644. // query
  1645. // image. Range [0, 1].
  1646. Confidence float64 `json:"confidence,omitempty"`
  1647. // Description: Entity textual description, expressed in its `locale`
  1648. // language.
  1649. Description string `json:"description,omitempty"`
  1650. // Locale: The language code for the locale in which the entity
  1651. // textual
  1652. // `description` is expressed.
  1653. Locale string `json:"locale,omitempty"`
  1654. // Locations: The location information for the detected entity.
  1655. // Multiple
  1656. // `LocationInfo` elements can be present because one location
  1657. // may
  1658. // indicate the location of the scene in the image, and another
  1659. // location
  1660. // may indicate the location of the place where the image was
  1661. // taken.
  1662. // Location information is usually present for landmarks.
  1663. Locations []*GoogleCloudVisionV1p1beta1LocationInfo `json:"locations,omitempty"`
  1664. // Mid: Opaque entity ID. Some IDs may be available in
  1665. // [Google Knowledge Graph
  1666. // Search
  1667. // API](https://developers.google.com/knowledge-graph/).
  1668. Mid string `json:"mid,omitempty"`
  1669. // Properties: Some entities may have optional user-supplied `Property`
  1670. // (name/value)
  1671. // fields, such a score or string that qualifies the entity.
  1672. Properties []*GoogleCloudVisionV1p1beta1Property `json:"properties,omitempty"`
  1673. // Score: Overall score of the result. Range [0, 1].
  1674. Score float64 `json:"score,omitempty"`
  1675. // Topicality: The relevancy of the ICA (Image Content Annotation) label
  1676. // to the
  1677. // image. For example, the relevancy of "tower" is likely higher to an
  1678. // image
  1679. // containing the detected "Eiffel Tower" than to an image containing
  1680. // a
  1681. // detected distant towering building, even though the confidence
  1682. // that
  1683. // there is a tower in each image may be the same. Range [0, 1].
  1684. Topicality float64 `json:"topicality,omitempty"`
  1685. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  1686. // unconditionally include in API requests. By default, fields with
  1687. // empty values are omitted from API requests. However, any non-pointer,
  1688. // non-interface field appearing in ForceSendFields will be sent to the
  1689. // server regardless of whether the field is empty or not. This may be
  1690. // used to include empty fields in Patch requests.
  1691. ForceSendFields []string `json:"-"`
  1692. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  1693. // in API requests with the JSON null value. By default, fields with
  1694. // empty values are omitted from API requests. However, any field with
  1695. // an empty value appearing in NullFields will be sent to the server as
  1696. // null. It is an error if a field in this list has a non-empty value.
  1697. // This may be used to include null fields in Patch requests.
  1698. NullFields []string `json:"-"`
  1699. }
  1700. func (s *GoogleCloudVisionV1p1beta1EntityAnnotation) MarshalJSON() ([]byte, error) {
  1701. type NoMethod GoogleCloudVisionV1p1beta1EntityAnnotation
  1702. raw := NoMethod(*s)
  1703. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1704. }
  1705. func (s *GoogleCloudVisionV1p1beta1EntityAnnotation) UnmarshalJSON(data []byte) error {
  1706. type NoMethod GoogleCloudVisionV1p1beta1EntityAnnotation
  1707. var s1 struct {
  1708. Confidence gensupport.JSONFloat64 `json:"confidence"`
  1709. Score gensupport.JSONFloat64 `json:"score"`
  1710. Topicality gensupport.JSONFloat64 `json:"topicality"`
  1711. *NoMethod
  1712. }
  1713. s1.NoMethod = (*NoMethod)(s)
  1714. if err := json.Unmarshal(data, &s1); err != nil {
  1715. return err
  1716. }
  1717. s.Confidence = float64(s1.Confidence)
  1718. s.Score = float64(s1.Score)
  1719. s.Topicality = float64(s1.Topicality)
  1720. return nil
  1721. }
  1722. // GoogleCloudVisionV1p1beta1FaceAnnotation: A face annotation object
  1723. // contains the results of face detection.
  1724. type GoogleCloudVisionV1p1beta1FaceAnnotation struct {
  1725. // AngerLikelihood: Anger likelihood.
  1726. //
  1727. // Possible values:
  1728. // "UNKNOWN" - Unknown likelihood.
  1729. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1730. // specified vertical.
  1731. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1732. // vertical.
  1733. // "POSSIBLE" - It is possible that the image belongs to the specified
  1734. // vertical.
  1735. // "LIKELY" - It is likely that the image belongs to the specified
  1736. // vertical.
  1737. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1738. // specified vertical.
  1739. AngerLikelihood string `json:"angerLikelihood,omitempty"`
  1740. // BlurredLikelihood: Blurred likelihood.
  1741. //
  1742. // Possible values:
  1743. // "UNKNOWN" - Unknown likelihood.
  1744. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1745. // specified vertical.
  1746. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1747. // vertical.
  1748. // "POSSIBLE" - It is possible that the image belongs to the specified
  1749. // vertical.
  1750. // "LIKELY" - It is likely that the image belongs to the specified
  1751. // vertical.
  1752. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1753. // specified vertical.
  1754. BlurredLikelihood string `json:"blurredLikelihood,omitempty"`
  1755. // BoundingPoly: The bounding polygon around the face. The coordinates
  1756. // of the bounding box
  1757. // are in the original image's scale.
  1758. // The bounding box is computed to "frame" the face in accordance with
  1759. // human
  1760. // expectations. It is based on the landmarker results.
  1761. // Note that one or more x and/or y coordinates may not be generated in
  1762. // the
  1763. // `BoundingPoly` (the polygon will be unbounded) if only a partial
  1764. // face
  1765. // appears in the image to be annotated.
  1766. BoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingPoly,omitempty"`
  1767. // DetectionConfidence: Detection confidence. Range [0, 1].
  1768. DetectionConfidence float64 `json:"detectionConfidence,omitempty"`
  1769. // FdBoundingPoly: The `fd_bounding_poly` bounding polygon is tighter
  1770. // than the
  1771. // `boundingPoly`, and encloses only the skin part of the face.
  1772. // Typically, it
  1773. // is used to eliminate the face from any image analysis that detects
  1774. // the
  1775. // "amount of skin" visible in an image. It is not based on
  1776. // the
  1777. // landmarker results, only on the initial face detection, hence
  1778. // the <code>fd</code> (face detection) prefix.
  1779. FdBoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"fdBoundingPoly,omitempty"`
  1780. // HeadwearLikelihood: Headwear likelihood.
  1781. //
  1782. // Possible values:
  1783. // "UNKNOWN" - Unknown likelihood.
  1784. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1785. // specified vertical.
  1786. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1787. // vertical.
  1788. // "POSSIBLE" - It is possible that the image belongs to the specified
  1789. // vertical.
  1790. // "LIKELY" - It is likely that the image belongs to the specified
  1791. // vertical.
  1792. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1793. // specified vertical.
  1794. HeadwearLikelihood string `json:"headwearLikelihood,omitempty"`
  1795. // JoyLikelihood: Joy likelihood.
  1796. //
  1797. // Possible values:
  1798. // "UNKNOWN" - Unknown likelihood.
  1799. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1800. // specified vertical.
  1801. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1802. // vertical.
  1803. // "POSSIBLE" - It is possible that the image belongs to the specified
  1804. // vertical.
  1805. // "LIKELY" - It is likely that the image belongs to the specified
  1806. // vertical.
  1807. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1808. // specified vertical.
  1809. JoyLikelihood string `json:"joyLikelihood,omitempty"`
  1810. // LandmarkingConfidence: Face landmarking confidence. Range [0, 1].
  1811. LandmarkingConfidence float64 `json:"landmarkingConfidence,omitempty"`
  1812. // Landmarks: Detected face landmarks.
  1813. Landmarks []*GoogleCloudVisionV1p1beta1FaceAnnotationLandmark `json:"landmarks,omitempty"`
  1814. // PanAngle: Yaw angle, which indicates the leftward/rightward angle
  1815. // that the face is
  1816. // pointing relative to the vertical plane perpendicular to the image.
  1817. // Range
  1818. // [-180,180].
  1819. PanAngle float64 `json:"panAngle,omitempty"`
  1820. // RollAngle: Roll angle, which indicates the amount of
  1821. // clockwise/anti-clockwise rotation
  1822. // of the face relative to the image vertical about the axis
  1823. // perpendicular to
  1824. // the face. Range [-180,180].
  1825. RollAngle float64 `json:"rollAngle,omitempty"`
  1826. // SorrowLikelihood: Sorrow likelihood.
  1827. //
  1828. // Possible values:
  1829. // "UNKNOWN" - Unknown likelihood.
  1830. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1831. // specified vertical.
  1832. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1833. // vertical.
  1834. // "POSSIBLE" - It is possible that the image belongs to the specified
  1835. // vertical.
  1836. // "LIKELY" - It is likely that the image belongs to the specified
  1837. // vertical.
  1838. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1839. // specified vertical.
  1840. SorrowLikelihood string `json:"sorrowLikelihood,omitempty"`
  1841. // SurpriseLikelihood: Surprise likelihood.
  1842. //
  1843. // Possible values:
  1844. // "UNKNOWN" - Unknown likelihood.
  1845. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1846. // specified vertical.
  1847. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1848. // vertical.
  1849. // "POSSIBLE" - It is possible that the image belongs to the specified
  1850. // vertical.
  1851. // "LIKELY" - It is likely that the image belongs to the specified
  1852. // vertical.
  1853. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1854. // specified vertical.
  1855. SurpriseLikelihood string `json:"surpriseLikelihood,omitempty"`
  1856. // TiltAngle: Pitch angle, which indicates the upwards/downwards angle
  1857. // that the face is
  1858. // pointing relative to the image's horizontal plane. Range [-180,180].
  1859. TiltAngle float64 `json:"tiltAngle,omitempty"`
  1860. // UnderExposedLikelihood: Under-exposed likelihood.
  1861. //
  1862. // Possible values:
  1863. // "UNKNOWN" - Unknown likelihood.
  1864. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1865. // specified vertical.
  1866. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1867. // vertical.
  1868. // "POSSIBLE" - It is possible that the image belongs to the specified
  1869. // vertical.
  1870. // "LIKELY" - It is likely that the image belongs to the specified
  1871. // vertical.
  1872. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1873. // specified vertical.
  1874. UnderExposedLikelihood string `json:"underExposedLikelihood,omitempty"`
  1875. // ForceSendFields is a list of field names (e.g. "AngerLikelihood") to
  1876. // unconditionally include in API requests. By default, fields with
  1877. // empty values are omitted from API requests. However, any non-pointer,
  1878. // non-interface field appearing in ForceSendFields will be sent to the
  1879. // server regardless of whether the field is empty or not. This may be
  1880. // used to include empty fields in Patch requests.
  1881. ForceSendFields []string `json:"-"`
  1882. // NullFields is a list of field names (e.g. "AngerLikelihood") to
  1883. // include in API requests with the JSON null value. By default, fields
  1884. // with empty values are omitted from API requests. However, any field
  1885. // with an empty value appearing in NullFields will be sent to the
  1886. // server as null. It is an error if a field in this list has a
  1887. // non-empty value. This may be used to include null fields in Patch
  1888. // requests.
  1889. NullFields []string `json:"-"`
  1890. }
  1891. func (s *GoogleCloudVisionV1p1beta1FaceAnnotation) MarshalJSON() ([]byte, error) {
  1892. type NoMethod GoogleCloudVisionV1p1beta1FaceAnnotation
  1893. raw := NoMethod(*s)
  1894. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1895. }
  1896. func (s *GoogleCloudVisionV1p1beta1FaceAnnotation) UnmarshalJSON(data []byte) error {
  1897. type NoMethod GoogleCloudVisionV1p1beta1FaceAnnotation
  1898. var s1 struct {
  1899. DetectionConfidence gensupport.JSONFloat64 `json:"detectionConfidence"`
  1900. LandmarkingConfidence gensupport.JSONFloat64 `json:"landmarkingConfidence"`
  1901. PanAngle gensupport.JSONFloat64 `json:"panAngle"`
  1902. RollAngle gensupport.JSONFloat64 `json:"rollAngle"`
  1903. TiltAngle gensupport.JSONFloat64 `json:"tiltAngle"`
  1904. *NoMethod
  1905. }
  1906. s1.NoMethod = (*NoMethod)(s)
  1907. if err := json.Unmarshal(data, &s1); err != nil {
  1908. return err
  1909. }
  1910. s.DetectionConfidence = float64(s1.DetectionConfidence)
  1911. s.LandmarkingConfidence = float64(s1.LandmarkingConfidence)
  1912. s.PanAngle = float64(s1.PanAngle)
  1913. s.RollAngle = float64(s1.RollAngle)
  1914. s.TiltAngle = float64(s1.TiltAngle)
  1915. return nil
  1916. }
  1917. // GoogleCloudVisionV1p1beta1FaceAnnotationLandmark: A face-specific
  1918. // landmark (for example, a face feature).
  1919. type GoogleCloudVisionV1p1beta1FaceAnnotationLandmark struct {
  1920. // Position: Face landmark position.
  1921. Position *GoogleCloudVisionV1p1beta1Position `json:"position,omitempty"`
  1922. // Type: Face landmark type.
  1923. //
  1924. // Possible values:
  1925. // "UNKNOWN_LANDMARK" - Unknown face landmark detected. Should not be
  1926. // filled.
  1927. // "LEFT_EYE" - Left eye.
  1928. // "RIGHT_EYE" - Right eye.
  1929. // "LEFT_OF_LEFT_EYEBROW" - Left of left eyebrow.
  1930. // "RIGHT_OF_LEFT_EYEBROW" - Right of left eyebrow.
  1931. // "LEFT_OF_RIGHT_EYEBROW" - Left of right eyebrow.
  1932. // "RIGHT_OF_RIGHT_EYEBROW" - Right of right eyebrow.
  1933. // "MIDPOINT_BETWEEN_EYES" - Midpoint between eyes.
  1934. // "NOSE_TIP" - Nose tip.
  1935. // "UPPER_LIP" - Upper lip.
  1936. // "LOWER_LIP" - Lower lip.
  1937. // "MOUTH_LEFT" - Mouth left.
  1938. // "MOUTH_RIGHT" - Mouth right.
  1939. // "MOUTH_CENTER" - Mouth center.
  1940. // "NOSE_BOTTOM_RIGHT" - Nose, bottom right.
  1941. // "NOSE_BOTTOM_LEFT" - Nose, bottom left.
  1942. // "NOSE_BOTTOM_CENTER" - Nose, bottom center.
  1943. // "LEFT_EYE_TOP_BOUNDARY" - Left eye, top boundary.
  1944. // "LEFT_EYE_RIGHT_CORNER" - Left eye, right corner.
  1945. // "LEFT_EYE_BOTTOM_BOUNDARY" - Left eye, bottom boundary.
  1946. // "LEFT_EYE_LEFT_CORNER" - Left eye, left corner.
  1947. // "RIGHT_EYE_TOP_BOUNDARY" - Right eye, top boundary.
  1948. // "RIGHT_EYE_RIGHT_CORNER" - Right eye, right corner.
  1949. // "RIGHT_EYE_BOTTOM_BOUNDARY" - Right eye, bottom boundary.
  1950. // "RIGHT_EYE_LEFT_CORNER" - Right eye, left corner.
  1951. // "LEFT_EYEBROW_UPPER_MIDPOINT" - Left eyebrow, upper midpoint.
  1952. // "RIGHT_EYEBROW_UPPER_MIDPOINT" - Right eyebrow, upper midpoint.
  1953. // "LEFT_EAR_TRAGION" - Left ear tragion.
  1954. // "RIGHT_EAR_TRAGION" - Right ear tragion.
  1955. // "LEFT_EYE_PUPIL" - Left eye pupil.
  1956. // "RIGHT_EYE_PUPIL" - Right eye pupil.
  1957. // "FOREHEAD_GLABELLA" - Forehead glabella.
  1958. // "CHIN_GNATHION" - Chin gnathion.
  1959. // "CHIN_LEFT_GONION" - Chin left gonion.
  1960. // "CHIN_RIGHT_GONION" - Chin right gonion.
  1961. Type string `json:"type,omitempty"`
  1962. // ForceSendFields is a list of field names (e.g. "Position") to
  1963. // unconditionally include in API requests. By default, fields with
  1964. // empty values are omitted from API requests. However, any non-pointer,
  1965. // non-interface field appearing in ForceSendFields will be sent to the
  1966. // server regardless of whether the field is empty or not. This may be
  1967. // used to include empty fields in Patch requests.
  1968. ForceSendFields []string `json:"-"`
  1969. // NullFields is a list of field names (e.g. "Position") to include in
  1970. // API requests with the JSON null value. By default, fields with empty
  1971. // values are omitted from API requests. However, any field with an
  1972. // empty value appearing in NullFields will be sent to the server as
  1973. // null. It is an error if a field in this list has a non-empty value.
  1974. // This may be used to include null fields in Patch requests.
  1975. NullFields []string `json:"-"`
  1976. }
  1977. func (s *GoogleCloudVisionV1p1beta1FaceAnnotationLandmark) MarshalJSON() ([]byte, error) {
  1978. type NoMethod GoogleCloudVisionV1p1beta1FaceAnnotationLandmark
  1979. raw := NoMethod(*s)
  1980. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1981. }
  1982. // GoogleCloudVisionV1p1beta1GcsDestination: The Google Cloud Storage
  1983. // location where the output will be written to.
  1984. type GoogleCloudVisionV1p1beta1GcsDestination struct {
  1985. // Uri: Google Cloud Storage URI where the results will be stored.
  1986. // Results will
  1987. // be in JSON format and preceded by its corresponding input URI. This
  1988. // field
  1989. // can either represent a single file, or a prefix for multiple
  1990. // outputs.
  1991. // Prefixes must end in a `/`.
  1992. //
  1993. // Examples:
  1994. //
  1995. // * File: gs://bucket-name/filename.json
  1996. // * Prefix: gs://bucket-name/prefix/here/
  1997. // * File: gs://bucket-name/prefix/here
  1998. //
  1999. // If multiple outputs, each response is still AnnotateFileResponse,
  2000. // each of
  2001. // which contains some subset of the full list of
  2002. // AnnotateImageResponse.
  2003. // Multiple outputs can happen if, for example, the output JSON is too
  2004. // large
  2005. // and overflows into multiple sharded files.
  2006. Uri string `json:"uri,omitempty"`
  2007. // ForceSendFields is a list of field names (e.g. "Uri") to
  2008. // unconditionally include in API requests. By default, fields with
  2009. // empty values are omitted from API requests. However, any non-pointer,
  2010. // non-interface field appearing in ForceSendFields will be sent to the
  2011. // server regardless of whether the field is empty or not. This may be
  2012. // used to include empty fields in Patch requests.
  2013. ForceSendFields []string `json:"-"`
  2014. // NullFields is a list of field names (e.g. "Uri") to include in API
  2015. // requests with the JSON null value. By default, fields with empty
  2016. // values are omitted from API requests. However, any field with an
  2017. // empty value appearing in NullFields will be sent to the server as
  2018. // null. It is an error if a field in this list has a non-empty value.
  2019. // This may be used to include null fields in Patch requests.
  2020. NullFields []string `json:"-"`
  2021. }
  2022. func (s *GoogleCloudVisionV1p1beta1GcsDestination) MarshalJSON() ([]byte, error) {
  2023. type NoMethod GoogleCloudVisionV1p1beta1GcsDestination
  2024. raw := NoMethod(*s)
  2025. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2026. }
  2027. // GoogleCloudVisionV1p1beta1GcsSource: The Google Cloud Storage
  2028. // location where the input will be read from.
  2029. type GoogleCloudVisionV1p1beta1GcsSource struct {
  2030. // Uri: Google Cloud Storage URI for the input file. This must only be
  2031. // a
  2032. // Google Cloud Storage object. Wildcards are not currently supported.
  2033. Uri string `json:"uri,omitempty"`
  2034. // ForceSendFields is a list of field names (e.g. "Uri") to
  2035. // unconditionally include in API requests. By default, fields with
  2036. // empty values are omitted from API requests. However, any non-pointer,
  2037. // non-interface field appearing in ForceSendFields will be sent to the
  2038. // server regardless of whether the field is empty or not. This may be
  2039. // used to include empty fields in Patch requests.
  2040. ForceSendFields []string `json:"-"`
  2041. // NullFields is a list of field names (e.g. "Uri") to include in API
  2042. // requests with the JSON null value. By default, fields with empty
  2043. // values are omitted from API requests. However, any field with an
  2044. // empty value appearing in NullFields will be sent to the server as
  2045. // null. It is an error if a field in this list has a non-empty value.
  2046. // This may be used to include null fields in Patch requests.
  2047. NullFields []string `json:"-"`
  2048. }
  2049. func (s *GoogleCloudVisionV1p1beta1GcsSource) MarshalJSON() ([]byte, error) {
  2050. type NoMethod GoogleCloudVisionV1p1beta1GcsSource
  2051. raw := NoMethod(*s)
  2052. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2053. }
  2054. // GoogleCloudVisionV1p1beta1ImageAnnotationContext: If an image was
  2055. // produced from a file (e.g. a PDF), this message gives
  2056. // information about the source of that image.
  2057. type GoogleCloudVisionV1p1beta1ImageAnnotationContext struct {
  2058. // PageNumber: If the file was a PDF or TIFF, this field gives the page
  2059. // number within
  2060. // the file used to produce the image.
  2061. PageNumber int64 `json:"pageNumber,omitempty"`
  2062. // Uri: The URI of the file used to produce the image.
  2063. Uri string `json:"uri,omitempty"`
  2064. // ForceSendFields is a list of field names (e.g. "PageNumber") to
  2065. // unconditionally include in API requests. By default, fields with
  2066. // empty values are omitted from API requests. However, any non-pointer,
  2067. // non-interface field appearing in ForceSendFields will be sent to the
  2068. // server regardless of whether the field is empty or not. This may be
  2069. // used to include empty fields in Patch requests.
  2070. ForceSendFields []string `json:"-"`
  2071. // NullFields is a list of field names (e.g. "PageNumber") to include in
  2072. // API requests with the JSON null value. By default, fields with empty
  2073. // values are omitted from API requests. However, any field with an
  2074. // empty value appearing in NullFields will be sent to the server as
  2075. // null. It is an error if a field in this list has a non-empty value.
  2076. // This may be used to include null fields in Patch requests.
  2077. NullFields []string `json:"-"`
  2078. }
  2079. func (s *GoogleCloudVisionV1p1beta1ImageAnnotationContext) MarshalJSON() ([]byte, error) {
  2080. type NoMethod GoogleCloudVisionV1p1beta1ImageAnnotationContext
  2081. raw := NoMethod(*s)
  2082. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2083. }
  2084. // GoogleCloudVisionV1p1beta1ImageProperties: Stores image properties,
  2085. // such as dominant colors.
  2086. type GoogleCloudVisionV1p1beta1ImageProperties struct {
  2087. // DominantColors: If present, dominant colors completed successfully.
  2088. DominantColors *GoogleCloudVisionV1p1beta1DominantColorsAnnotation `json:"dominantColors,omitempty"`
  2089. // ForceSendFields is a list of field names (e.g. "DominantColors") 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. // NullFields is a list of field names (e.g. "DominantColors") to
  2097. // include in API requests with the JSON null value. By default, fields
  2098. // with empty values are omitted from API requests. However, any field
  2099. // with an empty value appearing in NullFields will be sent to the
  2100. // server as null. It is an error if a field in this list has a
  2101. // non-empty value. This may be used to include null fields in Patch
  2102. // requests.
  2103. NullFields []string `json:"-"`
  2104. }
  2105. func (s *GoogleCloudVisionV1p1beta1ImageProperties) MarshalJSON() ([]byte, error) {
  2106. type NoMethod GoogleCloudVisionV1p1beta1ImageProperties
  2107. raw := NoMethod(*s)
  2108. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2109. }
  2110. // GoogleCloudVisionV1p1beta1InputConfig: The desired input location and
  2111. // metadata.
  2112. type GoogleCloudVisionV1p1beta1InputConfig struct {
  2113. // GcsSource: The Google Cloud Storage location to read the input from.
  2114. GcsSource *GoogleCloudVisionV1p1beta1GcsSource `json:"gcsSource,omitempty"`
  2115. // MimeType: The type of the file. Currently only "application/pdf" and
  2116. // "image/tiff"
  2117. // are supported. Wildcards are not supported.
  2118. MimeType string `json:"mimeType,omitempty"`
  2119. // ForceSendFields is a list of field names (e.g. "GcsSource") to
  2120. // unconditionally include in API requests. By default, fields with
  2121. // empty values are omitted from API requests. However, any non-pointer,
  2122. // non-interface field appearing in ForceSendFields will be sent to the
  2123. // server regardless of whether the field is empty or not. This may be
  2124. // used to include empty fields in Patch requests.
  2125. ForceSendFields []string `json:"-"`
  2126. // NullFields is a list of field names (e.g. "GcsSource") to include in
  2127. // API requests with the JSON null value. By default, fields with empty
  2128. // values are omitted from API requests. However, any field with an
  2129. // empty value appearing in NullFields will be sent to the server as
  2130. // null. It is an error if a field in this list has a non-empty value.
  2131. // This may be used to include null fields in Patch requests.
  2132. NullFields []string `json:"-"`
  2133. }
  2134. func (s *GoogleCloudVisionV1p1beta1InputConfig) MarshalJSON() ([]byte, error) {
  2135. type NoMethod GoogleCloudVisionV1p1beta1InputConfig
  2136. raw := NoMethod(*s)
  2137. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2138. }
  2139. // GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation: Set of detected
  2140. // objects with bounding boxes.
  2141. type GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation struct {
  2142. // BoundingPoly: Image region to which this object belongs. This must be
  2143. // populated.
  2144. BoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingPoly,omitempty"`
  2145. // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn".
  2146. // For more
  2147. // information,
  2148. // see
  2149. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  2150. LanguageCode string `json:"languageCode,omitempty"`
  2151. // Mid: Object ID that should align with EntityAnnotation mid.
  2152. Mid string `json:"mid,omitempty"`
  2153. // Name: Object name, expressed in its `language_code` language.
  2154. Name string `json:"name,omitempty"`
  2155. // Score: Score of the result. Range [0, 1].
  2156. Score float64 `json:"score,omitempty"`
  2157. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  2158. // unconditionally include in API requests. By default, fields with
  2159. // empty values are omitted from API requests. However, any non-pointer,
  2160. // non-interface field appearing in ForceSendFields will be sent to the
  2161. // server regardless of whether the field is empty or not. This may be
  2162. // used to include empty fields in Patch requests.
  2163. ForceSendFields []string `json:"-"`
  2164. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  2165. // in API requests with the JSON null value. By default, fields with
  2166. // empty values are omitted from API requests. However, any field with
  2167. // an empty value appearing in NullFields will be sent to the server as
  2168. // null. It is an error if a field in this list has a non-empty value.
  2169. // This may be used to include null fields in Patch requests.
  2170. NullFields []string `json:"-"`
  2171. }
  2172. func (s *GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation) MarshalJSON() ([]byte, error) {
  2173. type NoMethod GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation
  2174. raw := NoMethod(*s)
  2175. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2176. }
  2177. func (s *GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation) UnmarshalJSON(data []byte) error {
  2178. type NoMethod GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation
  2179. var s1 struct {
  2180. Score gensupport.JSONFloat64 `json:"score"`
  2181. *NoMethod
  2182. }
  2183. s1.NoMethod = (*NoMethod)(s)
  2184. if err := json.Unmarshal(data, &s1); err != nil {
  2185. return err
  2186. }
  2187. s.Score = float64(s1.Score)
  2188. return nil
  2189. }
  2190. // GoogleCloudVisionV1p1beta1LocationInfo: Detected entity location
  2191. // information.
  2192. type GoogleCloudVisionV1p1beta1LocationInfo struct {
  2193. // LatLng: lat/long location coordinates.
  2194. LatLng *LatLng `json:"latLng,omitempty"`
  2195. // ForceSendFields is a list of field names (e.g. "LatLng") to
  2196. // unconditionally include in API requests. By default, fields with
  2197. // empty values are omitted from API requests. However, any non-pointer,
  2198. // non-interface field appearing in ForceSendFields will be sent to the
  2199. // server regardless of whether the field is empty or not. This may be
  2200. // used to include empty fields in Patch requests.
  2201. ForceSendFields []string `json:"-"`
  2202. // NullFields is a list of field names (e.g. "LatLng") to include in API
  2203. // requests with the JSON null value. By default, fields with empty
  2204. // values are omitted from API requests. However, any field with an
  2205. // empty value appearing in NullFields will be sent to the server as
  2206. // null. It is an error if a field in this list has a non-empty value.
  2207. // This may be used to include null fields in Patch requests.
  2208. NullFields []string `json:"-"`
  2209. }
  2210. func (s *GoogleCloudVisionV1p1beta1LocationInfo) MarshalJSON() ([]byte, error) {
  2211. type NoMethod GoogleCloudVisionV1p1beta1LocationInfo
  2212. raw := NoMethod(*s)
  2213. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2214. }
  2215. // GoogleCloudVisionV1p1beta1NormalizedVertex: A vertex represents a 2D
  2216. // point in the image.
  2217. // NOTE: the normalized vertex coordinates are relative to the original
  2218. // image
  2219. // and range from 0 to 1.
  2220. type GoogleCloudVisionV1p1beta1NormalizedVertex struct {
  2221. // X: X coordinate.
  2222. X float64 `json:"x,omitempty"`
  2223. // Y: Y coordinate.
  2224. Y float64 `json:"y,omitempty"`
  2225. // ForceSendFields is a list of field names (e.g. "X") to
  2226. // unconditionally include in API requests. By default, fields with
  2227. // empty values are omitted from API requests. However, any non-pointer,
  2228. // non-interface field appearing in ForceSendFields will be sent to the
  2229. // server regardless of whether the field is empty or not. This may be
  2230. // used to include empty fields in Patch requests.
  2231. ForceSendFields []string `json:"-"`
  2232. // NullFields is a list of field names (e.g. "X") to include in API
  2233. // requests with the JSON null value. By default, fields with empty
  2234. // values are omitted from API requests. However, any field with an
  2235. // empty value appearing in NullFields will be sent to the server as
  2236. // null. It is an error if a field in this list has a non-empty value.
  2237. // This may be used to include null fields in Patch requests.
  2238. NullFields []string `json:"-"`
  2239. }
  2240. func (s *GoogleCloudVisionV1p1beta1NormalizedVertex) MarshalJSON() ([]byte, error) {
  2241. type NoMethod GoogleCloudVisionV1p1beta1NormalizedVertex
  2242. raw := NoMethod(*s)
  2243. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2244. }
  2245. func (s *GoogleCloudVisionV1p1beta1NormalizedVertex) UnmarshalJSON(data []byte) error {
  2246. type NoMethod GoogleCloudVisionV1p1beta1NormalizedVertex
  2247. var s1 struct {
  2248. X gensupport.JSONFloat64 `json:"x"`
  2249. Y gensupport.JSONFloat64 `json:"y"`
  2250. *NoMethod
  2251. }
  2252. s1.NoMethod = (*NoMethod)(s)
  2253. if err := json.Unmarshal(data, &s1); err != nil {
  2254. return err
  2255. }
  2256. s.X = float64(s1.X)
  2257. s.Y = float64(s1.Y)
  2258. return nil
  2259. }
  2260. // GoogleCloudVisionV1p1beta1OperationMetadata: Contains metadata for
  2261. // the BatchAnnotateImages operation.
  2262. type GoogleCloudVisionV1p1beta1OperationMetadata struct {
  2263. // CreateTime: The time when the batch request was received.
  2264. CreateTime string `json:"createTime,omitempty"`
  2265. // State: Current state of the batch operation.
  2266. //
  2267. // Possible values:
  2268. // "STATE_UNSPECIFIED" - Invalid.
  2269. // "CREATED" - Request is received.
  2270. // "RUNNING" - Request is actively being processed.
  2271. // "DONE" - The batch processing is done.
  2272. // "CANCELLED" - The batch processing was cancelled.
  2273. State string `json:"state,omitempty"`
  2274. // UpdateTime: The time when the operation result was last updated.
  2275. UpdateTime string `json:"updateTime,omitempty"`
  2276. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  2277. // unconditionally include in API requests. By default, fields with
  2278. // empty values are omitted from API requests. However, any non-pointer,
  2279. // non-interface field appearing in ForceSendFields will be sent to the
  2280. // server regardless of whether the field is empty or not. This may be
  2281. // used to include empty fields in Patch requests.
  2282. ForceSendFields []string `json:"-"`
  2283. // NullFields is a list of field names (e.g. "CreateTime") to include in
  2284. // API requests with the JSON null value. By default, fields with empty
  2285. // values are omitted from API requests. However, any field with an
  2286. // empty value appearing in NullFields will be sent to the server as
  2287. // null. It is an error if a field in this list has a non-empty value.
  2288. // This may be used to include null fields in Patch requests.
  2289. NullFields []string `json:"-"`
  2290. }
  2291. func (s *GoogleCloudVisionV1p1beta1OperationMetadata) MarshalJSON() ([]byte, error) {
  2292. type NoMethod GoogleCloudVisionV1p1beta1OperationMetadata
  2293. raw := NoMethod(*s)
  2294. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2295. }
  2296. // GoogleCloudVisionV1p1beta1OutputConfig: The desired output location
  2297. // and metadata.
  2298. type GoogleCloudVisionV1p1beta1OutputConfig struct {
  2299. // BatchSize: The max number of response protos to put into each output
  2300. // JSON file on
  2301. // Google Cloud Storage.
  2302. // The valid range is [1, 100]. If not specified, the default value is
  2303. // 20.
  2304. //
  2305. // For example, for one pdf file with 100 pages, 100 response protos
  2306. // will
  2307. // be generated. If `batch_size` = 20, then 5 json files each
  2308. // containing 20 response protos will be written under the
  2309. // prefix
  2310. // `gcs_destination`.`uri`.
  2311. //
  2312. // Currently, batch_size only applies to GcsDestination, with potential
  2313. // future
  2314. // support for other output configurations.
  2315. BatchSize int64 `json:"batchSize,omitempty"`
  2316. // GcsDestination: The Google Cloud Storage location to write the
  2317. // output(s) to.
  2318. GcsDestination *GoogleCloudVisionV1p1beta1GcsDestination `json:"gcsDestination,omitempty"`
  2319. // ForceSendFields is a list of field names (e.g. "BatchSize") to
  2320. // unconditionally include in API requests. By default, fields with
  2321. // empty values are omitted from API requests. However, any non-pointer,
  2322. // non-interface field appearing in ForceSendFields will be sent to the
  2323. // server regardless of whether the field is empty or not. This may be
  2324. // used to include empty fields in Patch requests.
  2325. ForceSendFields []string `json:"-"`
  2326. // NullFields is a list of field names (e.g. "BatchSize") to include in
  2327. // API requests with the JSON null value. By default, fields with empty
  2328. // values are omitted from API requests. However, any field with an
  2329. // empty value appearing in NullFields will be sent to the server as
  2330. // null. It is an error if a field in this list has a non-empty value.
  2331. // This may be used to include null fields in Patch requests.
  2332. NullFields []string `json:"-"`
  2333. }
  2334. func (s *GoogleCloudVisionV1p1beta1OutputConfig) MarshalJSON() ([]byte, error) {
  2335. type NoMethod GoogleCloudVisionV1p1beta1OutputConfig
  2336. raw := NoMethod(*s)
  2337. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2338. }
  2339. // GoogleCloudVisionV1p1beta1Page: Detected page from OCR.
  2340. type GoogleCloudVisionV1p1beta1Page struct {
  2341. // Blocks: List of blocks of text, images etc on this page.
  2342. Blocks []*GoogleCloudVisionV1p1beta1Block `json:"blocks,omitempty"`
  2343. // Confidence: Confidence of the OCR results on the page. Range [0, 1].
  2344. Confidence float64 `json:"confidence,omitempty"`
  2345. // Height: Page height. For PDFs the unit is points. For images
  2346. // (including
  2347. // TIFFs) the unit is pixels.
  2348. Height int64 `json:"height,omitempty"`
  2349. // Property: Additional information detected on the page.
  2350. Property *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty `json:"property,omitempty"`
  2351. // Width: Page width. For PDFs the unit is points. For images
  2352. // (including
  2353. // TIFFs) the unit is pixels.
  2354. Width int64 `json:"width,omitempty"`
  2355. // ForceSendFields is a list of field names (e.g. "Blocks") to
  2356. // unconditionally include in API requests. By default, fields with
  2357. // empty values are omitted from API requests. However, any non-pointer,
  2358. // non-interface field appearing in ForceSendFields will be sent to the
  2359. // server regardless of whether the field is empty or not. This may be
  2360. // used to include empty fields in Patch requests.
  2361. ForceSendFields []string `json:"-"`
  2362. // NullFields is a list of field names (e.g. "Blocks") to include in API
  2363. // requests with the JSON null value. By default, fields with empty
  2364. // values are omitted from API requests. However, any field with an
  2365. // empty value appearing in NullFields will be sent to the server as
  2366. // null. It is an error if a field in this list has a non-empty value.
  2367. // This may be used to include null fields in Patch requests.
  2368. NullFields []string `json:"-"`
  2369. }
  2370. func (s *GoogleCloudVisionV1p1beta1Page) MarshalJSON() ([]byte, error) {
  2371. type NoMethod GoogleCloudVisionV1p1beta1Page
  2372. raw := NoMethod(*s)
  2373. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2374. }
  2375. func (s *GoogleCloudVisionV1p1beta1Page) UnmarshalJSON(data []byte) error {
  2376. type NoMethod GoogleCloudVisionV1p1beta1Page
  2377. var s1 struct {
  2378. Confidence gensupport.JSONFloat64 `json:"confidence"`
  2379. *NoMethod
  2380. }
  2381. s1.NoMethod = (*NoMethod)(s)
  2382. if err := json.Unmarshal(data, &s1); err != nil {
  2383. return err
  2384. }
  2385. s.Confidence = float64(s1.Confidence)
  2386. return nil
  2387. }
  2388. // GoogleCloudVisionV1p1beta1Paragraph: Structural unit of text
  2389. // representing a number of words in certain order.
  2390. type GoogleCloudVisionV1p1beta1Paragraph struct {
  2391. // BoundingBox: The bounding box for the paragraph.
  2392. // The vertices are in the order of top-left, top-right,
  2393. // bottom-right,
  2394. // bottom-left. When a rotation of the bounding box is detected the
  2395. // rotation
  2396. // is represented as around the top-left corner as defined when the text
  2397. // is
  2398. // read in the 'natural' orientation.
  2399. // For example:
  2400. // * when the text is horizontal it might look like:
  2401. // 0----1
  2402. // | |
  2403. // 3----2
  2404. // * when it's rotated 180 degrees around the top-left corner it
  2405. // becomes:
  2406. // 2----3
  2407. // | |
  2408. // 1----0
  2409. // and the vertex order will still be (0, 1, 2, 3).
  2410. BoundingBox *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingBox,omitempty"`
  2411. // Confidence: Confidence of the OCR results for the paragraph. Range
  2412. // [0, 1].
  2413. Confidence float64 `json:"confidence,omitempty"`
  2414. // Property: Additional information detected for the paragraph.
  2415. Property *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty `json:"property,omitempty"`
  2416. // Words: List of words in this paragraph.
  2417. Words []*GoogleCloudVisionV1p1beta1Word `json:"words,omitempty"`
  2418. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  2419. // unconditionally include in API requests. By default, fields with
  2420. // empty values are omitted from API requests. However, any non-pointer,
  2421. // non-interface field appearing in ForceSendFields will be sent to the
  2422. // server regardless of whether the field is empty or not. This may be
  2423. // used to include empty fields in Patch requests.
  2424. ForceSendFields []string `json:"-"`
  2425. // NullFields is a list of field names (e.g. "BoundingBox") to include
  2426. // in API requests with the JSON null value. By default, fields with
  2427. // empty values are omitted from API requests. However, any field with
  2428. // an empty value appearing in NullFields will be sent to the server as
  2429. // null. It is an error if a field in this list has a non-empty value.
  2430. // This may be used to include null fields in Patch requests.
  2431. NullFields []string `json:"-"`
  2432. }
  2433. func (s *GoogleCloudVisionV1p1beta1Paragraph) MarshalJSON() ([]byte, error) {
  2434. type NoMethod GoogleCloudVisionV1p1beta1Paragraph
  2435. raw := NoMethod(*s)
  2436. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2437. }
  2438. func (s *GoogleCloudVisionV1p1beta1Paragraph) UnmarshalJSON(data []byte) error {
  2439. type NoMethod GoogleCloudVisionV1p1beta1Paragraph
  2440. var s1 struct {
  2441. Confidence gensupport.JSONFloat64 `json:"confidence"`
  2442. *NoMethod
  2443. }
  2444. s1.NoMethod = (*NoMethod)(s)
  2445. if err := json.Unmarshal(data, &s1); err != nil {
  2446. return err
  2447. }
  2448. s.Confidence = float64(s1.Confidence)
  2449. return nil
  2450. }
  2451. // GoogleCloudVisionV1p1beta1Position: A 3D position in the image, used
  2452. // primarily for Face detection landmarks.
  2453. // A valid Position must have both x and y coordinates.
  2454. // The position coordinates are in the same scale as the original image.
  2455. type GoogleCloudVisionV1p1beta1Position struct {
  2456. // X: X coordinate.
  2457. X float64 `json:"x,omitempty"`
  2458. // Y: Y coordinate.
  2459. Y float64 `json:"y,omitempty"`
  2460. // Z: Z coordinate (or depth).
  2461. Z float64 `json:"z,omitempty"`
  2462. // ForceSendFields is a list of field names (e.g. "X") to
  2463. // unconditionally include in API requests. By default, fields with
  2464. // empty values are omitted from API requests. However, any non-pointer,
  2465. // non-interface field appearing in ForceSendFields will be sent to the
  2466. // server regardless of whether the field is empty or not. This may be
  2467. // used to include empty fields in Patch requests.
  2468. ForceSendFields []string `json:"-"`
  2469. // NullFields is a list of field names (e.g. "X") to include in API
  2470. // requests with the JSON null value. By default, fields with empty
  2471. // values are omitted from API requests. However, any field with an
  2472. // empty value appearing in NullFields will be sent to the server as
  2473. // null. It is an error if a field in this list has a non-empty value.
  2474. // This may be used to include null fields in Patch requests.
  2475. NullFields []string `json:"-"`
  2476. }
  2477. func (s *GoogleCloudVisionV1p1beta1Position) MarshalJSON() ([]byte, error) {
  2478. type NoMethod GoogleCloudVisionV1p1beta1Position
  2479. raw := NoMethod(*s)
  2480. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2481. }
  2482. func (s *GoogleCloudVisionV1p1beta1Position) UnmarshalJSON(data []byte) error {
  2483. type NoMethod GoogleCloudVisionV1p1beta1Position
  2484. var s1 struct {
  2485. X gensupport.JSONFloat64 `json:"x"`
  2486. Y gensupport.JSONFloat64 `json:"y"`
  2487. Z gensupport.JSONFloat64 `json:"z"`
  2488. *NoMethod
  2489. }
  2490. s1.NoMethod = (*NoMethod)(s)
  2491. if err := json.Unmarshal(data, &s1); err != nil {
  2492. return err
  2493. }
  2494. s.X = float64(s1.X)
  2495. s.Y = float64(s1.Y)
  2496. s.Z = float64(s1.Z)
  2497. return nil
  2498. }
  2499. // GoogleCloudVisionV1p1beta1Product: A Product contains
  2500. // ReferenceImages.
  2501. type GoogleCloudVisionV1p1beta1Product struct {
  2502. // Description: User-provided metadata to be stored with this product.
  2503. // Must be at most 4096
  2504. // characters long.
  2505. Description string `json:"description,omitempty"`
  2506. // DisplayName: The user-provided name for this Product. Must not be
  2507. // empty. Must be at most
  2508. // 4096 characters long.
  2509. DisplayName string `json:"displayName,omitempty"`
  2510. // Name: The resource name of the product.
  2511. //
  2512. // Format
  2513. // is:
  2514. // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
  2515. //
  2516. // This field is ignored when creating a product.
  2517. Name string `json:"name,omitempty"`
  2518. // ProductCategory: The category for the product identified by the
  2519. // reference image. This should
  2520. // be either "homegoods", "apparel", or "toys".
  2521. //
  2522. // This field is immutable.
  2523. ProductCategory string `json:"productCategory,omitempty"`
  2524. // ProductLabels: Key-value pairs that can be attached to a product. At
  2525. // query time,
  2526. // constraints can be specified based on the product_labels.
  2527. //
  2528. // Note that integer values can be provided as strings, e.g. "1199".
  2529. // Only
  2530. // strings with integer values can match a range-based restriction which
  2531. // is
  2532. // to be supported soon.
  2533. //
  2534. // Multiple values can be assigned to the same key. One product may have
  2535. // up to
  2536. // 100 product_labels.
  2537. ProductLabels []*GoogleCloudVisionV1p1beta1ProductKeyValue `json:"productLabels,omitempty"`
  2538. // ForceSendFields is a list of field names (e.g. "Description") to
  2539. // unconditionally include in API requests. By default, fields with
  2540. // empty values are omitted from API requests. However, any non-pointer,
  2541. // non-interface field appearing in ForceSendFields will be sent to the
  2542. // server regardless of whether the field is empty or not. This may be
  2543. // used to include empty fields in Patch requests.
  2544. ForceSendFields []string `json:"-"`
  2545. // NullFields is a list of field names (e.g. "Description") to include
  2546. // in API requests with the JSON null value. By default, fields with
  2547. // empty values are omitted from API requests. However, any field with
  2548. // an empty value appearing in NullFields will be sent to the server as
  2549. // null. It is an error if a field in this list has a non-empty value.
  2550. // This may be used to include null fields in Patch requests.
  2551. NullFields []string `json:"-"`
  2552. }
  2553. func (s *GoogleCloudVisionV1p1beta1Product) MarshalJSON() ([]byte, error) {
  2554. type NoMethod GoogleCloudVisionV1p1beta1Product
  2555. raw := NoMethod(*s)
  2556. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2557. }
  2558. // GoogleCloudVisionV1p1beta1ProductKeyValue: A product label
  2559. // represented as a key-value pair.
  2560. type GoogleCloudVisionV1p1beta1ProductKeyValue struct {
  2561. // Key: The key of the label attached to the product. Cannot be empty
  2562. // and cannot
  2563. // exceed 128 bytes.
  2564. Key string `json:"key,omitempty"`
  2565. // Value: The value of the label attached to the product. Cannot be
  2566. // empty and
  2567. // cannot exceed 128 bytes.
  2568. Value string `json:"value,omitempty"`
  2569. // ForceSendFields is a list of field names (e.g. "Key") to
  2570. // unconditionally include in API requests. By default, fields with
  2571. // empty values are omitted from API requests. However, any non-pointer,
  2572. // non-interface field appearing in ForceSendFields will be sent to the
  2573. // server regardless of whether the field is empty or not. This may be
  2574. // used to include empty fields in Patch requests.
  2575. ForceSendFields []string `json:"-"`
  2576. // NullFields is a list of field names (e.g. "Key") to include in API
  2577. // requests with the JSON null value. By default, fields with empty
  2578. // values are omitted from API requests. However, any field with an
  2579. // empty value appearing in NullFields will be sent to the server as
  2580. // null. It is an error if a field in this list has a non-empty value.
  2581. // This may be used to include null fields in Patch requests.
  2582. NullFields []string `json:"-"`
  2583. }
  2584. func (s *GoogleCloudVisionV1p1beta1ProductKeyValue) MarshalJSON() ([]byte, error) {
  2585. type NoMethod GoogleCloudVisionV1p1beta1ProductKeyValue
  2586. raw := NoMethod(*s)
  2587. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2588. }
  2589. // GoogleCloudVisionV1p1beta1ProductSearchResults: Results for a product
  2590. // search request.
  2591. type GoogleCloudVisionV1p1beta1ProductSearchResults struct {
  2592. // IndexTime: Timestamp of the index which provided these results.
  2593. // Changes made after
  2594. // this time are not reflected in the current results.
  2595. IndexTime string `json:"indexTime,omitempty"`
  2596. // ProductGroupedResults: List of results grouped by products detected
  2597. // in the query image. Each entry
  2598. // corresponds to one bounding polygon in the query image, and contains
  2599. // the
  2600. // matching products specific to that region. There may be duplicate
  2601. // product
  2602. // matches in the union of all the per-product results.
  2603. ProductGroupedResults []*GoogleCloudVisionV1p1beta1ProductSearchResultsGroupedResult `json:"productGroupedResults,omitempty"`
  2604. // Results: List of results, one for each product match.
  2605. Results []*GoogleCloudVisionV1p1beta1ProductSearchResultsResult `json:"results,omitempty"`
  2606. // ForceSendFields is a list of field names (e.g. "IndexTime") to
  2607. // unconditionally include in API requests. By default, fields with
  2608. // empty values are omitted from API requests. However, any non-pointer,
  2609. // non-interface field appearing in ForceSendFields will be sent to the
  2610. // server regardless of whether the field is empty or not. This may be
  2611. // used to include empty fields in Patch requests.
  2612. ForceSendFields []string `json:"-"`
  2613. // NullFields is a list of field names (e.g. "IndexTime") to include in
  2614. // API requests with the JSON null value. By default, fields with empty
  2615. // values are omitted from API requests. However, any field with an
  2616. // empty value appearing in NullFields will be sent to the server as
  2617. // null. It is an error if a field in this list has a non-empty value.
  2618. // This may be used to include null fields in Patch requests.
  2619. NullFields []string `json:"-"`
  2620. }
  2621. func (s *GoogleCloudVisionV1p1beta1ProductSearchResults) MarshalJSON() ([]byte, error) {
  2622. type NoMethod GoogleCloudVisionV1p1beta1ProductSearchResults
  2623. raw := NoMethod(*s)
  2624. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2625. }
  2626. // GoogleCloudVisionV1p1beta1ProductSearchResultsGroupedResult:
  2627. // Information about the products similar to a single product in a
  2628. // query
  2629. // image.
  2630. type GoogleCloudVisionV1p1beta1ProductSearchResultsGroupedResult struct {
  2631. // BoundingPoly: The bounding polygon around the product detected in the
  2632. // query image.
  2633. BoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingPoly,omitempty"`
  2634. // Results: List of results, one for each product match.
  2635. Results []*GoogleCloudVisionV1p1beta1ProductSearchResultsResult `json:"results,omitempty"`
  2636. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  2637. // unconditionally include in API requests. By default, fields with
  2638. // empty values are omitted from API requests. However, any non-pointer,
  2639. // non-interface field appearing in ForceSendFields will be sent to the
  2640. // server regardless of whether the field is empty or not. This may be
  2641. // used to include empty fields in Patch requests.
  2642. ForceSendFields []string `json:"-"`
  2643. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  2644. // in API requests with the JSON null value. By default, fields with
  2645. // empty values are omitted from API requests. However, any field with
  2646. // an empty value appearing in NullFields will be sent to the server as
  2647. // null. It is an error if a field in this list has a non-empty value.
  2648. // This may be used to include null fields in Patch requests.
  2649. NullFields []string `json:"-"`
  2650. }
  2651. func (s *GoogleCloudVisionV1p1beta1ProductSearchResultsGroupedResult) MarshalJSON() ([]byte, error) {
  2652. type NoMethod GoogleCloudVisionV1p1beta1ProductSearchResultsGroupedResult
  2653. raw := NoMethod(*s)
  2654. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2655. }
  2656. // GoogleCloudVisionV1p1beta1ProductSearchResultsResult: Information
  2657. // about a product.
  2658. type GoogleCloudVisionV1p1beta1ProductSearchResultsResult struct {
  2659. // Image: The resource name of the image from the product that is the
  2660. // closest match
  2661. // to the query.
  2662. Image string `json:"image,omitempty"`
  2663. // Product: The Product.
  2664. Product *GoogleCloudVisionV1p1beta1Product `json:"product,omitempty"`
  2665. // Score: A confidence level on the match, ranging from 0 (no
  2666. // confidence) to
  2667. // 1 (full confidence).
  2668. Score float64 `json:"score,omitempty"`
  2669. // ForceSendFields is a list of field names (e.g. "Image") to
  2670. // unconditionally include in API requests. By default, fields with
  2671. // empty values are omitted from API requests. However, any non-pointer,
  2672. // non-interface field appearing in ForceSendFields will be sent to the
  2673. // server regardless of whether the field is empty or not. This may be
  2674. // used to include empty fields in Patch requests.
  2675. ForceSendFields []string `json:"-"`
  2676. // NullFields is a list of field names (e.g. "Image") to include in API
  2677. // requests with the JSON null value. By default, fields with empty
  2678. // values are omitted from API requests. However, any field with an
  2679. // empty value appearing in NullFields will be sent to the server as
  2680. // null. It is an error if a field in this list has a non-empty value.
  2681. // This may be used to include null fields in Patch requests.
  2682. NullFields []string `json:"-"`
  2683. }
  2684. func (s *GoogleCloudVisionV1p1beta1ProductSearchResultsResult) MarshalJSON() ([]byte, error) {
  2685. type NoMethod GoogleCloudVisionV1p1beta1ProductSearchResultsResult
  2686. raw := NoMethod(*s)
  2687. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2688. }
  2689. func (s *GoogleCloudVisionV1p1beta1ProductSearchResultsResult) UnmarshalJSON(data []byte) error {
  2690. type NoMethod GoogleCloudVisionV1p1beta1ProductSearchResultsResult
  2691. var s1 struct {
  2692. Score gensupport.JSONFloat64 `json:"score"`
  2693. *NoMethod
  2694. }
  2695. s1.NoMethod = (*NoMethod)(s)
  2696. if err := json.Unmarshal(data, &s1); err != nil {
  2697. return err
  2698. }
  2699. s.Score = float64(s1.Score)
  2700. return nil
  2701. }
  2702. // GoogleCloudVisionV1p1beta1Property: A `Property` consists of a
  2703. // user-supplied name/value pair.
  2704. type GoogleCloudVisionV1p1beta1Property struct {
  2705. // Name: Name of the property.
  2706. Name string `json:"name,omitempty"`
  2707. // Uint64Value: Value of numeric properties.
  2708. Uint64Value uint64 `json:"uint64Value,omitempty,string"`
  2709. // Value: Value of the property.
  2710. Value string `json:"value,omitempty"`
  2711. // ForceSendFields is a list of field names (e.g. "Name") to
  2712. // unconditionally include in API requests. By default, fields with
  2713. // empty values are omitted from API requests. However, any non-pointer,
  2714. // non-interface field appearing in ForceSendFields will be sent to the
  2715. // server regardless of whether the field is empty or not. This may be
  2716. // used to include empty fields in Patch requests.
  2717. ForceSendFields []string `json:"-"`
  2718. // NullFields is a list of field names (e.g. "Name") to include in API
  2719. // requests with the JSON null value. By default, fields with empty
  2720. // values are omitted from API requests. However, any field with an
  2721. // empty value appearing in NullFields will be sent to the server as
  2722. // null. It is an error if a field in this list has a non-empty value.
  2723. // This may be used to include null fields in Patch requests.
  2724. NullFields []string `json:"-"`
  2725. }
  2726. func (s *GoogleCloudVisionV1p1beta1Property) MarshalJSON() ([]byte, error) {
  2727. type NoMethod GoogleCloudVisionV1p1beta1Property
  2728. raw := NoMethod(*s)
  2729. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2730. }
  2731. // GoogleCloudVisionV1p1beta1SafeSearchAnnotation: Set of features
  2732. // pertaining to the image, computed by computer vision
  2733. // methods over safe-search verticals (for example, adult, spoof,
  2734. // medical,
  2735. // violence).
  2736. type GoogleCloudVisionV1p1beta1SafeSearchAnnotation struct {
  2737. // Adult: Represents the adult content likelihood for the image. Adult
  2738. // content may
  2739. // contain elements such as nudity, pornographic images or cartoons,
  2740. // or
  2741. // sexual activities.
  2742. //
  2743. // Possible values:
  2744. // "UNKNOWN" - Unknown likelihood.
  2745. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  2746. // specified vertical.
  2747. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  2748. // vertical.
  2749. // "POSSIBLE" - It is possible that the image belongs to the specified
  2750. // vertical.
  2751. // "LIKELY" - It is likely that the image belongs to the specified
  2752. // vertical.
  2753. // "VERY_LIKELY" - It is very likely that the image belongs to the
  2754. // specified vertical.
  2755. Adult string `json:"adult,omitempty"`
  2756. // Medical: Likelihood that this is a medical image.
  2757. //
  2758. // Possible values:
  2759. // "UNKNOWN" - Unknown likelihood.
  2760. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  2761. // specified vertical.
  2762. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  2763. // vertical.
  2764. // "POSSIBLE" - It is possible that the image belongs to the specified
  2765. // vertical.
  2766. // "LIKELY" - It is likely that the image belongs to the specified
  2767. // vertical.
  2768. // "VERY_LIKELY" - It is very likely that the image belongs to the
  2769. // specified vertical.
  2770. Medical string `json:"medical,omitempty"`
  2771. // Racy: Likelihood that the request image contains racy content. Racy
  2772. // content may
  2773. // include (but is not limited to) skimpy or sheer clothing,
  2774. // strategically
  2775. // covered nudity, lewd or provocative poses, or close-ups of
  2776. // sensitive
  2777. // body areas.
  2778. //
  2779. // Possible values:
  2780. // "UNKNOWN" - Unknown likelihood.
  2781. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  2782. // specified vertical.
  2783. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  2784. // vertical.
  2785. // "POSSIBLE" - It is possible that the image belongs to the specified
  2786. // vertical.
  2787. // "LIKELY" - It is likely that the image belongs to the specified
  2788. // vertical.
  2789. // "VERY_LIKELY" - It is very likely that the image belongs to the
  2790. // specified vertical.
  2791. Racy string `json:"racy,omitempty"`
  2792. // Spoof: Spoof likelihood. The likelihood that an modification
  2793. // was made to the image's canonical version to make it appear
  2794. // funny or offensive.
  2795. //
  2796. // Possible values:
  2797. // "UNKNOWN" - Unknown likelihood.
  2798. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  2799. // specified vertical.
  2800. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  2801. // vertical.
  2802. // "POSSIBLE" - It is possible that the image belongs to the specified
  2803. // vertical.
  2804. // "LIKELY" - It is likely that the image belongs to the specified
  2805. // vertical.
  2806. // "VERY_LIKELY" - It is very likely that the image belongs to the
  2807. // specified vertical.
  2808. Spoof string `json:"spoof,omitempty"`
  2809. // Violence: Likelihood that this image contains violent content.
  2810. //
  2811. // Possible values:
  2812. // "UNKNOWN" - Unknown likelihood.
  2813. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  2814. // specified vertical.
  2815. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  2816. // vertical.
  2817. // "POSSIBLE" - It is possible that the image belongs to the specified
  2818. // vertical.
  2819. // "LIKELY" - It is likely that the image belongs to the specified
  2820. // vertical.
  2821. // "VERY_LIKELY" - It is very likely that the image belongs to the
  2822. // specified vertical.
  2823. Violence string `json:"violence,omitempty"`
  2824. // ForceSendFields is a list of field names (e.g. "Adult") to
  2825. // unconditionally include in API requests. By default, fields with
  2826. // empty values are omitted from API requests. However, any non-pointer,
  2827. // non-interface field appearing in ForceSendFields will be sent to the
  2828. // server regardless of whether the field is empty or not. This may be
  2829. // used to include empty fields in Patch requests.
  2830. ForceSendFields []string `json:"-"`
  2831. // NullFields is a list of field names (e.g. "Adult") to include in API
  2832. // requests with the JSON null value. By default, fields with empty
  2833. // values are omitted from API requests. However, any field with an
  2834. // empty value appearing in NullFields will be sent to the server as
  2835. // null. It is an error if a field in this list has a non-empty value.
  2836. // This may be used to include null fields in Patch requests.
  2837. NullFields []string `json:"-"`
  2838. }
  2839. func (s *GoogleCloudVisionV1p1beta1SafeSearchAnnotation) MarshalJSON() ([]byte, error) {
  2840. type NoMethod GoogleCloudVisionV1p1beta1SafeSearchAnnotation
  2841. raw := NoMethod(*s)
  2842. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2843. }
  2844. // GoogleCloudVisionV1p1beta1Symbol: A single symbol representation.
  2845. type GoogleCloudVisionV1p1beta1Symbol struct {
  2846. // BoundingBox: The bounding box for the symbol.
  2847. // The vertices are in the order of top-left, top-right,
  2848. // bottom-right,
  2849. // bottom-left. When a rotation of the bounding box is detected the
  2850. // rotation
  2851. // is represented as around the top-left corner as defined when the text
  2852. // is
  2853. // read in the 'natural' orientation.
  2854. // For example:
  2855. // * when the text is horizontal it might look like:
  2856. // 0----1
  2857. // | |
  2858. // 3----2
  2859. // * when it's rotated 180 degrees around the top-left corner it
  2860. // becomes:
  2861. // 2----3
  2862. // | |
  2863. // 1----0
  2864. // and the vertice order will still be (0, 1, 2, 3).
  2865. BoundingBox *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingBox,omitempty"`
  2866. // Confidence: Confidence of the OCR results for the symbol. Range [0,
  2867. // 1].
  2868. Confidence float64 `json:"confidence,omitempty"`
  2869. // Property: Additional information detected for the symbol.
  2870. Property *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty `json:"property,omitempty"`
  2871. // Text: The actual UTF-8 representation of the symbol.
  2872. Text string `json:"text,omitempty"`
  2873. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  2874. // unconditionally include in API requests. By default, fields with
  2875. // empty values are omitted from API requests. However, any non-pointer,
  2876. // non-interface field appearing in ForceSendFields will be sent to the
  2877. // server regardless of whether the field is empty or not. This may be
  2878. // used to include empty fields in Patch requests.
  2879. ForceSendFields []string `json:"-"`
  2880. // NullFields is a list of field names (e.g. "BoundingBox") to include
  2881. // in API requests with the JSON null value. By default, fields with
  2882. // empty values are omitted from API requests. However, any field with
  2883. // an empty value appearing in NullFields will be sent to the server as
  2884. // null. It is an error if a field in this list has a non-empty value.
  2885. // This may be used to include null fields in Patch requests.
  2886. NullFields []string `json:"-"`
  2887. }
  2888. func (s *GoogleCloudVisionV1p1beta1Symbol) MarshalJSON() ([]byte, error) {
  2889. type NoMethod GoogleCloudVisionV1p1beta1Symbol
  2890. raw := NoMethod(*s)
  2891. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2892. }
  2893. func (s *GoogleCloudVisionV1p1beta1Symbol) UnmarshalJSON(data []byte) error {
  2894. type NoMethod GoogleCloudVisionV1p1beta1Symbol
  2895. var s1 struct {
  2896. Confidence gensupport.JSONFloat64 `json:"confidence"`
  2897. *NoMethod
  2898. }
  2899. s1.NoMethod = (*NoMethod)(s)
  2900. if err := json.Unmarshal(data, &s1); err != nil {
  2901. return err
  2902. }
  2903. s.Confidence = float64(s1.Confidence)
  2904. return nil
  2905. }
  2906. // GoogleCloudVisionV1p1beta1TextAnnotation: TextAnnotation contains a
  2907. // structured representation of OCR extracted text.
  2908. // The hierarchy of an OCR extracted text structure is like this:
  2909. // TextAnnotation -> Page -> Block -> Paragraph -> Word ->
  2910. // Symbol
  2911. // Each structural component, starting from Page, may further have their
  2912. // own
  2913. // properties. Properties describe detected languages, breaks etc..
  2914. // Please refer
  2915. // to the TextAnnotation.TextProperty message definition below for
  2916. // more
  2917. // detail.
  2918. type GoogleCloudVisionV1p1beta1TextAnnotation struct {
  2919. // Pages: List of pages detected by OCR.
  2920. Pages []*GoogleCloudVisionV1p1beta1Page `json:"pages,omitempty"`
  2921. // Text: UTF-8 text detected on the pages.
  2922. Text string `json:"text,omitempty"`
  2923. // ForceSendFields is a list of field names (e.g. "Pages") to
  2924. // unconditionally include in API requests. By default, fields with
  2925. // empty values are omitted from API requests. However, any non-pointer,
  2926. // non-interface field appearing in ForceSendFields will be sent to the
  2927. // server regardless of whether the field is empty or not. This may be
  2928. // used to include empty fields in Patch requests.
  2929. ForceSendFields []string `json:"-"`
  2930. // NullFields is a list of field names (e.g. "Pages") to include in API
  2931. // requests with the JSON null value. By default, fields with empty
  2932. // values are omitted from API requests. However, any field with an
  2933. // empty value appearing in NullFields will be sent to the server as
  2934. // null. It is an error if a field in this list has a non-empty value.
  2935. // This may be used to include null fields in Patch requests.
  2936. NullFields []string `json:"-"`
  2937. }
  2938. func (s *GoogleCloudVisionV1p1beta1TextAnnotation) MarshalJSON() ([]byte, error) {
  2939. type NoMethod GoogleCloudVisionV1p1beta1TextAnnotation
  2940. raw := NoMethod(*s)
  2941. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2942. }
  2943. // GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak: Detected start
  2944. // or end of a structural component.
  2945. type GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak struct {
  2946. // IsPrefix: True if break prepends the element.
  2947. IsPrefix bool `json:"isPrefix,omitempty"`
  2948. // Type: Detected break type.
  2949. //
  2950. // Possible values:
  2951. // "UNKNOWN" - Unknown break label type.
  2952. // "SPACE" - Regular space.
  2953. // "SURE_SPACE" - Sure space (very wide).
  2954. // "EOL_SURE_SPACE" - Line-wrapping break.
  2955. // "HYPHEN" - End-line hyphen that is not present in text; does not
  2956. // co-occur with
  2957. // `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`.
  2958. // "LINE_BREAK" - Line break that ends a paragraph.
  2959. Type string `json:"type,omitempty"`
  2960. // ForceSendFields is a list of field names (e.g. "IsPrefix") to
  2961. // unconditionally include in API requests. By default, fields with
  2962. // empty values are omitted from API requests. However, any non-pointer,
  2963. // non-interface field appearing in ForceSendFields will be sent to the
  2964. // server regardless of whether the field is empty or not. This may be
  2965. // used to include empty fields in Patch requests.
  2966. ForceSendFields []string `json:"-"`
  2967. // NullFields is a list of field names (e.g. "IsPrefix") to include in
  2968. // API requests with the JSON null value. By default, fields with empty
  2969. // values are omitted from API requests. However, any field with an
  2970. // empty value appearing in NullFields will be sent to the server as
  2971. // null. It is an error if a field in this list has a non-empty value.
  2972. // This may be used to include null fields in Patch requests.
  2973. NullFields []string `json:"-"`
  2974. }
  2975. func (s *GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak) MarshalJSON() ([]byte, error) {
  2976. type NoMethod GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak
  2977. raw := NoMethod(*s)
  2978. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2979. }
  2980. // GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage: Detected
  2981. // language for a structural component.
  2982. type GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage struct {
  2983. // Confidence: Confidence of detected language. Range [0, 1].
  2984. Confidence float64 `json:"confidence,omitempty"`
  2985. // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn".
  2986. // For more
  2987. // information,
  2988. // see
  2989. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  2990. LanguageCode string `json:"languageCode,omitempty"`
  2991. // ForceSendFields is a list of field names (e.g. "Confidence") to
  2992. // unconditionally include in API requests. By default, fields with
  2993. // empty values are omitted from API requests. However, any non-pointer,
  2994. // non-interface field appearing in ForceSendFields will be sent to the
  2995. // server regardless of whether the field is empty or not. This may be
  2996. // used to include empty fields in Patch requests.
  2997. ForceSendFields []string `json:"-"`
  2998. // NullFields is a list of field names (e.g. "Confidence") to include in
  2999. // API requests with the JSON null value. By default, fields with empty
  3000. // values are omitted from API requests. However, any field with an
  3001. // empty value appearing in NullFields will be sent to the server as
  3002. // null. It is an error if a field in this list has a non-empty value.
  3003. // This may be used to include null fields in Patch requests.
  3004. NullFields []string `json:"-"`
  3005. }
  3006. func (s *GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage) MarshalJSON() ([]byte, error) {
  3007. type NoMethod GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage
  3008. raw := NoMethod(*s)
  3009. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3010. }
  3011. func (s *GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage) UnmarshalJSON(data []byte) error {
  3012. type NoMethod GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage
  3013. var s1 struct {
  3014. Confidence gensupport.JSONFloat64 `json:"confidence"`
  3015. *NoMethod
  3016. }
  3017. s1.NoMethod = (*NoMethod)(s)
  3018. if err := json.Unmarshal(data, &s1); err != nil {
  3019. return err
  3020. }
  3021. s.Confidence = float64(s1.Confidence)
  3022. return nil
  3023. }
  3024. // GoogleCloudVisionV1p1beta1TextAnnotationTextProperty: Additional
  3025. // information detected on the structural component.
  3026. type GoogleCloudVisionV1p1beta1TextAnnotationTextProperty struct {
  3027. // DetectedBreak: Detected start or end of a text segment.
  3028. DetectedBreak *GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak `json:"detectedBreak,omitempty"`
  3029. // DetectedLanguages: A list of detected languages together with
  3030. // confidence.
  3031. DetectedLanguages []*GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage `json:"detectedLanguages,omitempty"`
  3032. // ForceSendFields is a list of field names (e.g. "DetectedBreak") to
  3033. // unconditionally include in API requests. By default, fields with
  3034. // empty values are omitted from API requests. However, any non-pointer,
  3035. // non-interface field appearing in ForceSendFields will be sent to the
  3036. // server regardless of whether the field is empty or not. This may be
  3037. // used to include empty fields in Patch requests.
  3038. ForceSendFields []string `json:"-"`
  3039. // NullFields is a list of field names (e.g. "DetectedBreak") to include
  3040. // in API requests with the JSON null value. By default, fields with
  3041. // empty values are omitted from API requests. However, any field with
  3042. // an empty value appearing in NullFields will be sent to the server as
  3043. // null. It is an error if a field in this list has a non-empty value.
  3044. // This may be used to include null fields in Patch requests.
  3045. NullFields []string `json:"-"`
  3046. }
  3047. func (s *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty) MarshalJSON() ([]byte, error) {
  3048. type NoMethod GoogleCloudVisionV1p1beta1TextAnnotationTextProperty
  3049. raw := NoMethod(*s)
  3050. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3051. }
  3052. // GoogleCloudVisionV1p1beta1Vertex: A vertex represents a 2D point in
  3053. // the image.
  3054. // NOTE: the vertex coordinates are in the same scale as the original
  3055. // image.
  3056. type GoogleCloudVisionV1p1beta1Vertex struct {
  3057. // X: X coordinate.
  3058. X int64 `json:"x,omitempty"`
  3059. // Y: Y coordinate.
  3060. Y int64 `json:"y,omitempty"`
  3061. // ForceSendFields is a list of field names (e.g. "X") to
  3062. // unconditionally include in API requests. By default, fields with
  3063. // empty values are omitted from API requests. However, any non-pointer,
  3064. // non-interface field appearing in ForceSendFields will be sent to the
  3065. // server regardless of whether the field is empty or not. This may be
  3066. // used to include empty fields in Patch requests.
  3067. ForceSendFields []string `json:"-"`
  3068. // NullFields is a list of field names (e.g. "X") to include in API
  3069. // requests with the JSON null value. By default, fields with empty
  3070. // values are omitted from API requests. However, any field with an
  3071. // empty value appearing in NullFields will be sent to the server as
  3072. // null. It is an error if a field in this list has a non-empty value.
  3073. // This may be used to include null fields in Patch requests.
  3074. NullFields []string `json:"-"`
  3075. }
  3076. func (s *GoogleCloudVisionV1p1beta1Vertex) MarshalJSON() ([]byte, error) {
  3077. type NoMethod GoogleCloudVisionV1p1beta1Vertex
  3078. raw := NoMethod(*s)
  3079. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3080. }
  3081. // GoogleCloudVisionV1p1beta1WebDetection: Relevant information for the
  3082. // image from the Internet.
  3083. type GoogleCloudVisionV1p1beta1WebDetection struct {
  3084. // BestGuessLabels: The service's best guess as to the topic of the
  3085. // request image.
  3086. // Inferred from similar images on the open web.
  3087. BestGuessLabels []*GoogleCloudVisionV1p1beta1WebDetectionWebLabel `json:"bestGuessLabels,omitempty"`
  3088. // FullMatchingImages: Fully matching images from the Internet.
  3089. // Can include resized copies of the query image.
  3090. FullMatchingImages []*GoogleCloudVisionV1p1beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"`
  3091. // PagesWithMatchingImages: Web pages containing the matching images
  3092. // from the Internet.
  3093. PagesWithMatchingImages []*GoogleCloudVisionV1p1beta1WebDetectionWebPage `json:"pagesWithMatchingImages,omitempty"`
  3094. // PartialMatchingImages: Partial matching images from the
  3095. // Internet.
  3096. // Those images are similar enough to share some key-point features.
  3097. // For
  3098. // example an original image will likely have partial matching for its
  3099. // crops.
  3100. PartialMatchingImages []*GoogleCloudVisionV1p1beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"`
  3101. // VisuallySimilarImages: The visually similar image results.
  3102. VisuallySimilarImages []*GoogleCloudVisionV1p1beta1WebDetectionWebImage `json:"visuallySimilarImages,omitempty"`
  3103. // WebEntities: Deduced entities from similar images on the Internet.
  3104. WebEntities []*GoogleCloudVisionV1p1beta1WebDetectionWebEntity `json:"webEntities,omitempty"`
  3105. // ForceSendFields is a list of field names (e.g. "BestGuessLabels") to
  3106. // unconditionally include in API requests. By default, fields with
  3107. // empty values are omitted from API requests. However, any non-pointer,
  3108. // non-interface field appearing in ForceSendFields will be sent to the
  3109. // server regardless of whether the field is empty or not. This may be
  3110. // used to include empty fields in Patch requests.
  3111. ForceSendFields []string `json:"-"`
  3112. // NullFields is a list of field names (e.g. "BestGuessLabels") to
  3113. // include in API requests with the JSON null value. By default, fields
  3114. // with empty values are omitted from API requests. However, any field
  3115. // with an empty value appearing in NullFields will be sent to the
  3116. // server as null. It is an error if a field in this list has a
  3117. // non-empty value. This may be used to include null fields in Patch
  3118. // requests.
  3119. NullFields []string `json:"-"`
  3120. }
  3121. func (s *GoogleCloudVisionV1p1beta1WebDetection) MarshalJSON() ([]byte, error) {
  3122. type NoMethod GoogleCloudVisionV1p1beta1WebDetection
  3123. raw := NoMethod(*s)
  3124. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3125. }
  3126. // GoogleCloudVisionV1p1beta1WebDetectionWebEntity: Entity deduced from
  3127. // similar images on the Internet.
  3128. type GoogleCloudVisionV1p1beta1WebDetectionWebEntity struct {
  3129. // Description: Canonical description of the entity, in English.
  3130. Description string `json:"description,omitempty"`
  3131. // EntityId: Opaque entity ID.
  3132. EntityId string `json:"entityId,omitempty"`
  3133. // Score: Overall relevancy score for the entity.
  3134. // Not normalized and not comparable across different image queries.
  3135. Score float64 `json:"score,omitempty"`
  3136. // ForceSendFields is a list of field names (e.g. "Description") to
  3137. // unconditionally include in API requests. By default, fields with
  3138. // empty values are omitted from API requests. However, any non-pointer,
  3139. // non-interface field appearing in ForceSendFields will be sent to the
  3140. // server regardless of whether the field is empty or not. This may be
  3141. // used to include empty fields in Patch requests.
  3142. ForceSendFields []string `json:"-"`
  3143. // NullFields is a list of field names (e.g. "Description") to include
  3144. // in API requests with the JSON null value. By default, fields with
  3145. // empty values are omitted from API requests. However, any field with
  3146. // an empty value appearing in NullFields will be sent to the server as
  3147. // null. It is an error if a field in this list has a non-empty value.
  3148. // This may be used to include null fields in Patch requests.
  3149. NullFields []string `json:"-"`
  3150. }
  3151. func (s *GoogleCloudVisionV1p1beta1WebDetectionWebEntity) MarshalJSON() ([]byte, error) {
  3152. type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebEntity
  3153. raw := NoMethod(*s)
  3154. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3155. }
  3156. func (s *GoogleCloudVisionV1p1beta1WebDetectionWebEntity) UnmarshalJSON(data []byte) error {
  3157. type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebEntity
  3158. var s1 struct {
  3159. Score gensupport.JSONFloat64 `json:"score"`
  3160. *NoMethod
  3161. }
  3162. s1.NoMethod = (*NoMethod)(s)
  3163. if err := json.Unmarshal(data, &s1); err != nil {
  3164. return err
  3165. }
  3166. s.Score = float64(s1.Score)
  3167. return nil
  3168. }
  3169. // GoogleCloudVisionV1p1beta1WebDetectionWebImage: Metadata for online
  3170. // images.
  3171. type GoogleCloudVisionV1p1beta1WebDetectionWebImage struct {
  3172. // Score: (Deprecated) Overall relevancy score for the image.
  3173. Score float64 `json:"score,omitempty"`
  3174. // Url: The result image URL.
  3175. Url string `json:"url,omitempty"`
  3176. // ForceSendFields is a list of field names (e.g. "Score") to
  3177. // unconditionally include in API requests. By default, fields with
  3178. // empty values are omitted from API requests. However, any non-pointer,
  3179. // non-interface field appearing in ForceSendFields will be sent to the
  3180. // server regardless of whether the field is empty or not. This may be
  3181. // used to include empty fields in Patch requests.
  3182. ForceSendFields []string `json:"-"`
  3183. // NullFields is a list of field names (e.g. "Score") to include in API
  3184. // requests with the JSON null value. By default, fields with empty
  3185. // values are omitted from API requests. However, any field with an
  3186. // empty value appearing in NullFields will be sent to the server as
  3187. // null. It is an error if a field in this list has a non-empty value.
  3188. // This may be used to include null fields in Patch requests.
  3189. NullFields []string `json:"-"`
  3190. }
  3191. func (s *GoogleCloudVisionV1p1beta1WebDetectionWebImage) MarshalJSON() ([]byte, error) {
  3192. type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebImage
  3193. raw := NoMethod(*s)
  3194. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3195. }
  3196. func (s *GoogleCloudVisionV1p1beta1WebDetectionWebImage) UnmarshalJSON(data []byte) error {
  3197. type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebImage
  3198. var s1 struct {
  3199. Score gensupport.JSONFloat64 `json:"score"`
  3200. *NoMethod
  3201. }
  3202. s1.NoMethod = (*NoMethod)(s)
  3203. if err := json.Unmarshal(data, &s1); err != nil {
  3204. return err
  3205. }
  3206. s.Score = float64(s1.Score)
  3207. return nil
  3208. }
  3209. // GoogleCloudVisionV1p1beta1WebDetectionWebLabel: Label to provide
  3210. // extra metadata for the web detection.
  3211. type GoogleCloudVisionV1p1beta1WebDetectionWebLabel struct {
  3212. // Label: Label for extra metadata.
  3213. Label string `json:"label,omitempty"`
  3214. // LanguageCode: The BCP-47 language code for `label`, such as "en-US"
  3215. // or "sr-Latn".
  3216. // For more information,
  3217. // see
  3218. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  3219. LanguageCode string `json:"languageCode,omitempty"`
  3220. // ForceSendFields is a list of field names (e.g. "Label") to
  3221. // unconditionally include in API requests. By default, fields with
  3222. // empty values are omitted from API requests. However, any non-pointer,
  3223. // non-interface field appearing in ForceSendFields will be sent to the
  3224. // server regardless of whether the field is empty or not. This may be
  3225. // used to include empty fields in Patch requests.
  3226. ForceSendFields []string `json:"-"`
  3227. // NullFields is a list of field names (e.g. "Label") to include in API
  3228. // requests with the JSON null value. By default, fields with empty
  3229. // values are omitted from API requests. However, any field with an
  3230. // empty value appearing in NullFields will be sent to the server as
  3231. // null. It is an error if a field in this list has a non-empty value.
  3232. // This may be used to include null fields in Patch requests.
  3233. NullFields []string `json:"-"`
  3234. }
  3235. func (s *GoogleCloudVisionV1p1beta1WebDetectionWebLabel) MarshalJSON() ([]byte, error) {
  3236. type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebLabel
  3237. raw := NoMethod(*s)
  3238. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3239. }
  3240. // GoogleCloudVisionV1p1beta1WebDetectionWebPage: Metadata for web
  3241. // pages.
  3242. type GoogleCloudVisionV1p1beta1WebDetectionWebPage struct {
  3243. // FullMatchingImages: Fully matching images on the page.
  3244. // Can include resized copies of the query image.
  3245. FullMatchingImages []*GoogleCloudVisionV1p1beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"`
  3246. // PageTitle: Title for the web page, may contain HTML markups.
  3247. PageTitle string `json:"pageTitle,omitempty"`
  3248. // PartialMatchingImages: Partial matching images on the page.
  3249. // Those images are similar enough to share some key-point features.
  3250. // For
  3251. // example an original image will likely have partial matching for
  3252. // its
  3253. // crops.
  3254. PartialMatchingImages []*GoogleCloudVisionV1p1beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"`
  3255. // Score: (Deprecated) Overall relevancy score for the web page.
  3256. Score float64 `json:"score,omitempty"`
  3257. // Url: The result web page URL.
  3258. Url string `json:"url,omitempty"`
  3259. // ForceSendFields is a list of field names (e.g. "FullMatchingImages")
  3260. // to unconditionally include in API requests. By default, fields with
  3261. // empty values are omitted from API requests. However, any non-pointer,
  3262. // non-interface field appearing in ForceSendFields will be sent to the
  3263. // server regardless of whether the field is empty or not. This may be
  3264. // used to include empty fields in Patch requests.
  3265. ForceSendFields []string `json:"-"`
  3266. // NullFields is a list of field names (e.g. "FullMatchingImages") to
  3267. // include in API requests with the JSON null value. By default, fields
  3268. // with empty values are omitted from API requests. However, any field
  3269. // with an empty value appearing in NullFields will be sent to the
  3270. // server as null. It is an error if a field in this list has a
  3271. // non-empty value. This may be used to include null fields in Patch
  3272. // requests.
  3273. NullFields []string `json:"-"`
  3274. }
  3275. func (s *GoogleCloudVisionV1p1beta1WebDetectionWebPage) MarshalJSON() ([]byte, error) {
  3276. type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebPage
  3277. raw := NoMethod(*s)
  3278. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3279. }
  3280. func (s *GoogleCloudVisionV1p1beta1WebDetectionWebPage) UnmarshalJSON(data []byte) error {
  3281. type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebPage
  3282. var s1 struct {
  3283. Score gensupport.JSONFloat64 `json:"score"`
  3284. *NoMethod
  3285. }
  3286. s1.NoMethod = (*NoMethod)(s)
  3287. if err := json.Unmarshal(data, &s1); err != nil {
  3288. return err
  3289. }
  3290. s.Score = float64(s1.Score)
  3291. return nil
  3292. }
  3293. // GoogleCloudVisionV1p1beta1Word: A word representation.
  3294. type GoogleCloudVisionV1p1beta1Word struct {
  3295. // BoundingBox: The bounding box for the word.
  3296. // The vertices are in the order of top-left, top-right,
  3297. // bottom-right,
  3298. // bottom-left. When a rotation of the bounding box is detected the
  3299. // rotation
  3300. // is represented as around the top-left corner as defined when the text
  3301. // is
  3302. // read in the 'natural' orientation.
  3303. // For example:
  3304. // * when the text is horizontal it might look like:
  3305. // 0----1
  3306. // | |
  3307. // 3----2
  3308. // * when it's rotated 180 degrees around the top-left corner it
  3309. // becomes:
  3310. // 2----3
  3311. // | |
  3312. // 1----0
  3313. // and the vertex order will still be (0, 1, 2, 3).
  3314. BoundingBox *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingBox,omitempty"`
  3315. // Confidence: Confidence of the OCR results for the word. Range [0, 1].
  3316. Confidence float64 `json:"confidence,omitempty"`
  3317. // Property: Additional information detected for the word.
  3318. Property *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty `json:"property,omitempty"`
  3319. // Symbols: List of symbols in the word.
  3320. // The order of the symbols follows the natural reading order.
  3321. Symbols []*GoogleCloudVisionV1p1beta1Symbol `json:"symbols,omitempty"`
  3322. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  3323. // unconditionally include in API requests. By default, fields with
  3324. // empty values are omitted from API requests. However, any non-pointer,
  3325. // non-interface field appearing in ForceSendFields will be sent to the
  3326. // server regardless of whether the field is empty or not. This may be
  3327. // used to include empty fields in Patch requests.
  3328. ForceSendFields []string `json:"-"`
  3329. // NullFields is a list of field names (e.g. "BoundingBox") to include
  3330. // in API requests with the JSON null value. By default, fields with
  3331. // empty values are omitted from API requests. However, any field with
  3332. // an empty value appearing in NullFields will be sent to the server as
  3333. // null. It is an error if a field in this list has a non-empty value.
  3334. // This may be used to include null fields in Patch requests.
  3335. NullFields []string `json:"-"`
  3336. }
  3337. func (s *GoogleCloudVisionV1p1beta1Word) MarshalJSON() ([]byte, error) {
  3338. type NoMethod GoogleCloudVisionV1p1beta1Word
  3339. raw := NoMethod(*s)
  3340. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3341. }
  3342. func (s *GoogleCloudVisionV1p1beta1Word) UnmarshalJSON(data []byte) error {
  3343. type NoMethod GoogleCloudVisionV1p1beta1Word
  3344. var s1 struct {
  3345. Confidence gensupport.JSONFloat64 `json:"confidence"`
  3346. *NoMethod
  3347. }
  3348. s1.NoMethod = (*NoMethod)(s)
  3349. if err := json.Unmarshal(data, &s1); err != nil {
  3350. return err
  3351. }
  3352. s.Confidence = float64(s1.Confidence)
  3353. return nil
  3354. }
  3355. // GoogleCloudVisionV1p2beta1AnnotateFileResponse: Response to a single
  3356. // file annotation request. A file may contain one or more
  3357. // images, which individually have their own responses.
  3358. type GoogleCloudVisionV1p2beta1AnnotateFileResponse struct {
  3359. // InputConfig: Information about the file for which this response is
  3360. // generated.
  3361. InputConfig *GoogleCloudVisionV1p2beta1InputConfig `json:"inputConfig,omitempty"`
  3362. // Responses: Individual responses to images found within the file.
  3363. Responses []*GoogleCloudVisionV1p2beta1AnnotateImageResponse `json:"responses,omitempty"`
  3364. // ForceSendFields is a list of field names (e.g. "InputConfig") to
  3365. // unconditionally include in API requests. By default, fields with
  3366. // empty values are omitted from API requests. However, any non-pointer,
  3367. // non-interface field appearing in ForceSendFields will be sent to the
  3368. // server regardless of whether the field is empty or not. This may be
  3369. // used to include empty fields in Patch requests.
  3370. ForceSendFields []string `json:"-"`
  3371. // NullFields is a list of field names (e.g. "InputConfig") to include
  3372. // in API requests with the JSON null value. By default, fields with
  3373. // empty values are omitted from API requests. However, any field with
  3374. // an empty value appearing in NullFields will be sent to the server as
  3375. // null. It is an error if a field in this list has a non-empty value.
  3376. // This may be used to include null fields in Patch requests.
  3377. NullFields []string `json:"-"`
  3378. }
  3379. func (s *GoogleCloudVisionV1p2beta1AnnotateFileResponse) MarshalJSON() ([]byte, error) {
  3380. type NoMethod GoogleCloudVisionV1p2beta1AnnotateFileResponse
  3381. raw := NoMethod(*s)
  3382. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3383. }
  3384. // GoogleCloudVisionV1p2beta1AnnotateImageRequest: Request for
  3385. // performing Google Cloud Vision API tasks over a user-provided
  3386. // image, with user-requested features, and with context information.
  3387. type GoogleCloudVisionV1p2beta1AnnotateImageRequest struct {
  3388. // Features: Requested features.
  3389. Features []*GoogleCloudVisionV1p2beta1Feature `json:"features,omitempty"`
  3390. // Image: The image to be processed.
  3391. Image *GoogleCloudVisionV1p2beta1Image `json:"image,omitempty"`
  3392. // ImageContext: Additional context that may accompany the image.
  3393. ImageContext *GoogleCloudVisionV1p2beta1ImageContext `json:"imageContext,omitempty"`
  3394. // ForceSendFields is a list of field names (e.g. "Features") to
  3395. // unconditionally include in API requests. By default, fields with
  3396. // empty values are omitted from API requests. However, any non-pointer,
  3397. // non-interface field appearing in ForceSendFields will be sent to the
  3398. // server regardless of whether the field is empty or not. This may be
  3399. // used to include empty fields in Patch requests.
  3400. ForceSendFields []string `json:"-"`
  3401. // NullFields is a list of field names (e.g. "Features") to include in
  3402. // API requests with the JSON null value. By default, fields with empty
  3403. // values are omitted from API requests. However, any field with an
  3404. // empty value appearing in NullFields will be sent to the server as
  3405. // null. It is an error if a field in this list has a non-empty value.
  3406. // This may be used to include null fields in Patch requests.
  3407. NullFields []string `json:"-"`
  3408. }
  3409. func (s *GoogleCloudVisionV1p2beta1AnnotateImageRequest) MarshalJSON() ([]byte, error) {
  3410. type NoMethod GoogleCloudVisionV1p2beta1AnnotateImageRequest
  3411. raw := NoMethod(*s)
  3412. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3413. }
  3414. // GoogleCloudVisionV1p2beta1AnnotateImageResponse: Response to an image
  3415. // annotation request.
  3416. type GoogleCloudVisionV1p2beta1AnnotateImageResponse struct {
  3417. // Context: If present, contextual information is needed to understand
  3418. // where this image
  3419. // comes from.
  3420. Context *GoogleCloudVisionV1p2beta1ImageAnnotationContext `json:"context,omitempty"`
  3421. // CropHintsAnnotation: If present, crop hints have completed
  3422. // successfully.
  3423. CropHintsAnnotation *GoogleCloudVisionV1p2beta1CropHintsAnnotation `json:"cropHintsAnnotation,omitempty"`
  3424. // Error: If set, represents the error message for the operation.
  3425. // Note that filled-in image annotations are guaranteed to be
  3426. // correct, even when `error` is set.
  3427. Error *Status `json:"error,omitempty"`
  3428. // FaceAnnotations: If present, face detection has completed
  3429. // successfully.
  3430. FaceAnnotations []*GoogleCloudVisionV1p2beta1FaceAnnotation `json:"faceAnnotations,omitempty"`
  3431. // FullTextAnnotation: If present, text (OCR) detection or document
  3432. // (OCR) text detection has
  3433. // completed successfully.
  3434. // This annotation provides the structural hierarchy for the OCR
  3435. // detected
  3436. // text.
  3437. FullTextAnnotation *GoogleCloudVisionV1p2beta1TextAnnotation `json:"fullTextAnnotation,omitempty"`
  3438. // ImagePropertiesAnnotation: If present, image properties were
  3439. // extracted successfully.
  3440. ImagePropertiesAnnotation *GoogleCloudVisionV1p2beta1ImageProperties `json:"imagePropertiesAnnotation,omitempty"`
  3441. // LabelAnnotations: If present, label detection has completed
  3442. // successfully.
  3443. LabelAnnotations []*GoogleCloudVisionV1p2beta1EntityAnnotation `json:"labelAnnotations,omitempty"`
  3444. // LandmarkAnnotations: If present, landmark detection has completed
  3445. // successfully.
  3446. LandmarkAnnotations []*GoogleCloudVisionV1p2beta1EntityAnnotation `json:"landmarkAnnotations,omitempty"`
  3447. // LocalizedObjectAnnotations: If present, localized object detection
  3448. // has completed successfully.
  3449. // This will be sorted descending by confidence score.
  3450. LocalizedObjectAnnotations []*GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation `json:"localizedObjectAnnotations,omitempty"`
  3451. // LogoAnnotations: If present, logo detection has completed
  3452. // successfully.
  3453. LogoAnnotations []*GoogleCloudVisionV1p2beta1EntityAnnotation `json:"logoAnnotations,omitempty"`
  3454. // ProductSearchResults: If present, product search has completed
  3455. // successfully.
  3456. ProductSearchResults *GoogleCloudVisionV1p2beta1ProductSearchResults `json:"productSearchResults,omitempty"`
  3457. // SafeSearchAnnotation: If present, safe-search annotation has
  3458. // completed successfully.
  3459. SafeSearchAnnotation *GoogleCloudVisionV1p2beta1SafeSearchAnnotation `json:"safeSearchAnnotation,omitempty"`
  3460. // TextAnnotations: If present, text (OCR) detection has completed
  3461. // successfully.
  3462. TextAnnotations []*GoogleCloudVisionV1p2beta1EntityAnnotation `json:"textAnnotations,omitempty"`
  3463. // WebDetection: If present, web detection has completed successfully.
  3464. WebDetection *GoogleCloudVisionV1p2beta1WebDetection `json:"webDetection,omitempty"`
  3465. // ForceSendFields is a list of field names (e.g. "Context") to
  3466. // unconditionally include in API requests. By default, fields with
  3467. // empty values are omitted from API requests. However, any non-pointer,
  3468. // non-interface field appearing in ForceSendFields will be sent to the
  3469. // server regardless of whether the field is empty or not. This may be
  3470. // used to include empty fields in Patch requests.
  3471. ForceSendFields []string `json:"-"`
  3472. // NullFields is a list of field names (e.g. "Context") to include in
  3473. // API requests with the JSON null value. By default, fields with empty
  3474. // values are omitted from API requests. However, any field with an
  3475. // empty value appearing in NullFields will be sent to the server as
  3476. // null. It is an error if a field in this list has a non-empty value.
  3477. // This may be used to include null fields in Patch requests.
  3478. NullFields []string `json:"-"`
  3479. }
  3480. func (s *GoogleCloudVisionV1p2beta1AnnotateImageResponse) MarshalJSON() ([]byte, error) {
  3481. type NoMethod GoogleCloudVisionV1p2beta1AnnotateImageResponse
  3482. raw := NoMethod(*s)
  3483. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3484. }
  3485. // GoogleCloudVisionV1p2beta1AsyncAnnotateFileRequest: An offline file
  3486. // annotation request.
  3487. type GoogleCloudVisionV1p2beta1AsyncAnnotateFileRequest struct {
  3488. // Features: Required. Requested features.
  3489. Features []*GoogleCloudVisionV1p2beta1Feature `json:"features,omitempty"`
  3490. // ImageContext: Additional context that may accompany the image(s) in
  3491. // the file.
  3492. ImageContext *GoogleCloudVisionV1p2beta1ImageContext `json:"imageContext,omitempty"`
  3493. // InputConfig: Required. Information about the input file.
  3494. InputConfig *GoogleCloudVisionV1p2beta1InputConfig `json:"inputConfig,omitempty"`
  3495. // OutputConfig: Required. The desired output location and metadata
  3496. // (e.g. format).
  3497. OutputConfig *GoogleCloudVisionV1p2beta1OutputConfig `json:"outputConfig,omitempty"`
  3498. // ForceSendFields is a list of field names (e.g. "Features") to
  3499. // unconditionally include in API requests. By default, fields with
  3500. // empty values are omitted from API requests. However, any non-pointer,
  3501. // non-interface field appearing in ForceSendFields will be sent to the
  3502. // server regardless of whether the field is empty or not. This may be
  3503. // used to include empty fields in Patch requests.
  3504. ForceSendFields []string `json:"-"`
  3505. // NullFields is a list of field names (e.g. "Features") to include in
  3506. // API requests with the JSON null value. By default, fields with empty
  3507. // values are omitted from API requests. However, any field with an
  3508. // empty value appearing in NullFields will be sent to the server as
  3509. // null. It is an error if a field in this list has a non-empty value.
  3510. // This may be used to include null fields in Patch requests.
  3511. NullFields []string `json:"-"`
  3512. }
  3513. func (s *GoogleCloudVisionV1p2beta1AsyncAnnotateFileRequest) MarshalJSON() ([]byte, error) {
  3514. type NoMethod GoogleCloudVisionV1p2beta1AsyncAnnotateFileRequest
  3515. raw := NoMethod(*s)
  3516. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3517. }
  3518. // GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse: The response for
  3519. // a single offline file annotation request.
  3520. type GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse struct {
  3521. // OutputConfig: The output location and metadata from
  3522. // AsyncAnnotateFileRequest.
  3523. OutputConfig *GoogleCloudVisionV1p2beta1OutputConfig `json:"outputConfig,omitempty"`
  3524. // ForceSendFields is a list of field names (e.g. "OutputConfig") to
  3525. // unconditionally include in API requests. By default, fields with
  3526. // empty values are omitted from API requests. However, any non-pointer,
  3527. // non-interface field appearing in ForceSendFields will be sent to the
  3528. // server regardless of whether the field is empty or not. This may be
  3529. // used to include empty fields in Patch requests.
  3530. ForceSendFields []string `json:"-"`
  3531. // NullFields is a list of field names (e.g. "OutputConfig") to include
  3532. // in API requests with the JSON null value. By default, fields with
  3533. // empty values are omitted from API requests. However, any field with
  3534. // an empty value appearing in NullFields will be sent to the server as
  3535. // null. It is an error if a field in this list has a non-empty value.
  3536. // This may be used to include null fields in Patch requests.
  3537. NullFields []string `json:"-"`
  3538. }
  3539. func (s *GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse) MarshalJSON() ([]byte, error) {
  3540. type NoMethod GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse
  3541. raw := NoMethod(*s)
  3542. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3543. }
  3544. // GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesRequest: Multiple
  3545. // async file annotation requests are batched into a single
  3546. // service
  3547. // call.
  3548. type GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesRequest struct {
  3549. // Requests: Individual async file annotation requests for this batch.
  3550. Requests []*GoogleCloudVisionV1p2beta1AsyncAnnotateFileRequest `json:"requests,omitempty"`
  3551. // ForceSendFields is a list of field names (e.g. "Requests") to
  3552. // unconditionally include in API requests. By default, fields with
  3553. // empty values are omitted from API requests. However, any non-pointer,
  3554. // non-interface field appearing in ForceSendFields will be sent to the
  3555. // server regardless of whether the field is empty or not. This may be
  3556. // used to include empty fields in Patch requests.
  3557. ForceSendFields []string `json:"-"`
  3558. // NullFields is a list of field names (e.g. "Requests") to include in
  3559. // API requests with the JSON null value. By default, fields with empty
  3560. // values are omitted from API requests. However, any field with an
  3561. // empty value appearing in NullFields will be sent to the server as
  3562. // null. It is an error if a field in this list has a non-empty value.
  3563. // This may be used to include null fields in Patch requests.
  3564. NullFields []string `json:"-"`
  3565. }
  3566. func (s *GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesRequest) MarshalJSON() ([]byte, error) {
  3567. type NoMethod GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesRequest
  3568. raw := NoMethod(*s)
  3569. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3570. }
  3571. // GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse: Response
  3572. // to an async batch file annotation request.
  3573. type GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse struct {
  3574. // Responses: The list of file annotation responses, one for each
  3575. // request in
  3576. // AsyncBatchAnnotateFilesRequest.
  3577. Responses []*GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse `json:"responses,omitempty"`
  3578. // ForceSendFields is a list of field names (e.g. "Responses") to
  3579. // unconditionally include in API requests. By default, fields with
  3580. // empty values are omitted from API requests. However, any non-pointer,
  3581. // non-interface field appearing in ForceSendFields will be sent to the
  3582. // server regardless of whether the field is empty or not. This may be
  3583. // used to include empty fields in Patch requests.
  3584. ForceSendFields []string `json:"-"`
  3585. // NullFields is a list of field names (e.g. "Responses") to include in
  3586. // API requests with the JSON null value. By default, fields with empty
  3587. // values are omitted from API requests. However, any field with an
  3588. // empty value appearing in NullFields will be sent to the server as
  3589. // null. It is an error if a field in this list has a non-empty value.
  3590. // This may be used to include null fields in Patch requests.
  3591. NullFields []string `json:"-"`
  3592. }
  3593. func (s *GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) {
  3594. type NoMethod GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse
  3595. raw := NoMethod(*s)
  3596. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3597. }
  3598. // GoogleCloudVisionV1p2beta1BatchAnnotateImagesRequest: Multiple image
  3599. // annotation requests are batched into a single service call.
  3600. type GoogleCloudVisionV1p2beta1BatchAnnotateImagesRequest struct {
  3601. // Requests: Individual image annotation requests for this batch.
  3602. Requests []*GoogleCloudVisionV1p2beta1AnnotateImageRequest `json:"requests,omitempty"`
  3603. // ForceSendFields is a list of field names (e.g. "Requests") to
  3604. // unconditionally include in API requests. By default, fields with
  3605. // empty values are omitted from API requests. However, any non-pointer,
  3606. // non-interface field appearing in ForceSendFields will be sent to the
  3607. // server regardless of whether the field is empty or not. This may be
  3608. // used to include empty fields in Patch requests.
  3609. ForceSendFields []string `json:"-"`
  3610. // NullFields is a list of field names (e.g. "Requests") to include in
  3611. // API requests with the JSON null value. By default, fields with empty
  3612. // values are omitted from API requests. However, any field with an
  3613. // empty value appearing in NullFields will be sent to the server as
  3614. // null. It is an error if a field in this list has a non-empty value.
  3615. // This may be used to include null fields in Patch requests.
  3616. NullFields []string `json:"-"`
  3617. }
  3618. func (s *GoogleCloudVisionV1p2beta1BatchAnnotateImagesRequest) MarshalJSON() ([]byte, error) {
  3619. type NoMethod GoogleCloudVisionV1p2beta1BatchAnnotateImagesRequest
  3620. raw := NoMethod(*s)
  3621. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3622. }
  3623. // GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse: Response to a
  3624. // batch image annotation request.
  3625. type GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse struct {
  3626. // Responses: Individual responses to image annotation requests within
  3627. // the batch.
  3628. Responses []*GoogleCloudVisionV1p2beta1AnnotateImageResponse `json:"responses,omitempty"`
  3629. // ServerResponse contains the HTTP response code and headers from the
  3630. // server.
  3631. googleapi.ServerResponse `json:"-"`
  3632. // ForceSendFields is a list of field names (e.g. "Responses") to
  3633. // unconditionally include in API requests. By default, fields with
  3634. // empty values are omitted from API requests. However, any non-pointer,
  3635. // non-interface field appearing in ForceSendFields will be sent to the
  3636. // server regardless of whether the field is empty or not. This may be
  3637. // used to include empty fields in Patch requests.
  3638. ForceSendFields []string `json:"-"`
  3639. // NullFields is a list of field names (e.g. "Responses") to include in
  3640. // API requests with the JSON null value. By default, fields with empty
  3641. // values are omitted from API requests. However, any field with an
  3642. // empty value appearing in NullFields will be sent to the server as
  3643. // null. It is an error if a field in this list has a non-empty value.
  3644. // This may be used to include null fields in Patch requests.
  3645. NullFields []string `json:"-"`
  3646. }
  3647. func (s *GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse) MarshalJSON() ([]byte, error) {
  3648. type NoMethod GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse
  3649. raw := NoMethod(*s)
  3650. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3651. }
  3652. // GoogleCloudVisionV1p2beta1Block: Logical element on the page.
  3653. type GoogleCloudVisionV1p2beta1Block struct {
  3654. // BlockType: Detected block type (text, image etc) for this block.
  3655. //
  3656. // Possible values:
  3657. // "UNKNOWN" - Unknown block type.
  3658. // "TEXT" - Regular text block.
  3659. // "TABLE" - Table block.
  3660. // "PICTURE" - Image block.
  3661. // "RULER" - Horizontal/vertical line box.
  3662. // "BARCODE" - Barcode block.
  3663. BlockType string `json:"blockType,omitempty"`
  3664. // BoundingBox: The bounding box for the block.
  3665. // The vertices are in the order of top-left, top-right,
  3666. // bottom-right,
  3667. // bottom-left. When a rotation of the bounding box is detected the
  3668. // rotation
  3669. // is represented as around the top-left corner as defined when the text
  3670. // is
  3671. // read in the 'natural' orientation.
  3672. // For example:
  3673. //
  3674. // * when the text is horizontal it might look like:
  3675. //
  3676. // 0----1
  3677. // | |
  3678. // 3----2
  3679. //
  3680. // * when it's rotated 180 degrees around the top-left corner it
  3681. // becomes:
  3682. //
  3683. // 2----3
  3684. // | |
  3685. // 1----0
  3686. //
  3687. // and the vertex order will still be (0, 1, 2, 3).
  3688. BoundingBox *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingBox,omitempty"`
  3689. // Confidence: Confidence of the OCR results on the block. Range [0, 1].
  3690. Confidence float64 `json:"confidence,omitempty"`
  3691. // Paragraphs: List of paragraphs in this block (if this blocks is of
  3692. // type text).
  3693. Paragraphs []*GoogleCloudVisionV1p2beta1Paragraph `json:"paragraphs,omitempty"`
  3694. // Property: Additional information detected for the block.
  3695. Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"`
  3696. // ForceSendFields is a list of field names (e.g. "BlockType") to
  3697. // unconditionally include in API requests. By default, fields with
  3698. // empty values are omitted from API requests. However, any non-pointer,
  3699. // non-interface field appearing in ForceSendFields will be sent to the
  3700. // server regardless of whether the field is empty or not. This may be
  3701. // used to include empty fields in Patch requests.
  3702. ForceSendFields []string `json:"-"`
  3703. // NullFields is a list of field names (e.g. "BlockType") to include in
  3704. // API requests with the JSON null value. By default, fields with empty
  3705. // values are omitted from API requests. However, any field with an
  3706. // empty value appearing in NullFields will be sent to the server as
  3707. // null. It is an error if a field in this list has a non-empty value.
  3708. // This may be used to include null fields in Patch requests.
  3709. NullFields []string `json:"-"`
  3710. }
  3711. func (s *GoogleCloudVisionV1p2beta1Block) MarshalJSON() ([]byte, error) {
  3712. type NoMethod GoogleCloudVisionV1p2beta1Block
  3713. raw := NoMethod(*s)
  3714. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3715. }
  3716. func (s *GoogleCloudVisionV1p2beta1Block) UnmarshalJSON(data []byte) error {
  3717. type NoMethod GoogleCloudVisionV1p2beta1Block
  3718. var s1 struct {
  3719. Confidence gensupport.JSONFloat64 `json:"confidence"`
  3720. *NoMethod
  3721. }
  3722. s1.NoMethod = (*NoMethod)(s)
  3723. if err := json.Unmarshal(data, &s1); err != nil {
  3724. return err
  3725. }
  3726. s.Confidence = float64(s1.Confidence)
  3727. return nil
  3728. }
  3729. // GoogleCloudVisionV1p2beta1BoundingPoly: A bounding polygon for the
  3730. // detected image annotation.
  3731. type GoogleCloudVisionV1p2beta1BoundingPoly struct {
  3732. // NormalizedVertices: The bounding polygon normalized vertices.
  3733. NormalizedVertices []*GoogleCloudVisionV1p2beta1NormalizedVertex `json:"normalizedVertices,omitempty"`
  3734. // Vertices: The bounding polygon vertices.
  3735. Vertices []*GoogleCloudVisionV1p2beta1Vertex `json:"vertices,omitempty"`
  3736. // ForceSendFields is a list of field names (e.g. "NormalizedVertices")
  3737. // to unconditionally include in API requests. By default, fields with
  3738. // empty values are omitted from API requests. However, any non-pointer,
  3739. // non-interface field appearing in ForceSendFields will be sent to the
  3740. // server regardless of whether the field is empty or not. This may be
  3741. // used to include empty fields in Patch requests.
  3742. ForceSendFields []string `json:"-"`
  3743. // NullFields is a list of field names (e.g. "NormalizedVertices") to
  3744. // include in API requests with the JSON null value. By default, fields
  3745. // with empty values are omitted from API requests. However, any field
  3746. // with an empty value appearing in NullFields will be sent to the
  3747. // server as null. It is an error if a field in this list has a
  3748. // non-empty value. This may be used to include null fields in Patch
  3749. // requests.
  3750. NullFields []string `json:"-"`
  3751. }
  3752. func (s *GoogleCloudVisionV1p2beta1BoundingPoly) MarshalJSON() ([]byte, error) {
  3753. type NoMethod GoogleCloudVisionV1p2beta1BoundingPoly
  3754. raw := NoMethod(*s)
  3755. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3756. }
  3757. // GoogleCloudVisionV1p2beta1ColorInfo: Color information consists of
  3758. // RGB channels, score, and the fraction of
  3759. // the image that the color occupies in the image.
  3760. type GoogleCloudVisionV1p2beta1ColorInfo struct {
  3761. // Color: RGB components of the color.
  3762. Color *Color `json:"color,omitempty"`
  3763. // PixelFraction: The fraction of pixels the color occupies in the
  3764. // image.
  3765. // Value in range [0, 1].
  3766. PixelFraction float64 `json:"pixelFraction,omitempty"`
  3767. // Score: Image-specific score for this color. Value in range [0, 1].
  3768. Score float64 `json:"score,omitempty"`
  3769. // ForceSendFields is a list of field names (e.g. "Color") to
  3770. // unconditionally include in API requests. By default, fields with
  3771. // empty values are omitted from API requests. However, any non-pointer,
  3772. // non-interface field appearing in ForceSendFields will be sent to the
  3773. // server regardless of whether the field is empty or not. This may be
  3774. // used to include empty fields in Patch requests.
  3775. ForceSendFields []string `json:"-"`
  3776. // NullFields is a list of field names (e.g. "Color") to include in API
  3777. // requests with the JSON null value. By default, fields with empty
  3778. // values are omitted from API requests. However, any field with an
  3779. // empty value appearing in NullFields will be sent to the server as
  3780. // null. It is an error if a field in this list has a non-empty value.
  3781. // This may be used to include null fields in Patch requests.
  3782. NullFields []string `json:"-"`
  3783. }
  3784. func (s *GoogleCloudVisionV1p2beta1ColorInfo) MarshalJSON() ([]byte, error) {
  3785. type NoMethod GoogleCloudVisionV1p2beta1ColorInfo
  3786. raw := NoMethod(*s)
  3787. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3788. }
  3789. func (s *GoogleCloudVisionV1p2beta1ColorInfo) UnmarshalJSON(data []byte) error {
  3790. type NoMethod GoogleCloudVisionV1p2beta1ColorInfo
  3791. var s1 struct {
  3792. PixelFraction gensupport.JSONFloat64 `json:"pixelFraction"`
  3793. Score gensupport.JSONFloat64 `json:"score"`
  3794. *NoMethod
  3795. }
  3796. s1.NoMethod = (*NoMethod)(s)
  3797. if err := json.Unmarshal(data, &s1); err != nil {
  3798. return err
  3799. }
  3800. s.PixelFraction = float64(s1.PixelFraction)
  3801. s.Score = float64(s1.Score)
  3802. return nil
  3803. }
  3804. // GoogleCloudVisionV1p2beta1CropHint: Single crop hint that is used to
  3805. // generate a new crop when serving an image.
  3806. type GoogleCloudVisionV1p2beta1CropHint struct {
  3807. // BoundingPoly: The bounding polygon for the crop region. The
  3808. // coordinates of the bounding
  3809. // box are in the original image's scale.
  3810. BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"`
  3811. // Confidence: Confidence of this being a salient region. Range [0, 1].
  3812. Confidence float64 `json:"confidence,omitempty"`
  3813. // ImportanceFraction: Fraction of importance of this salient region
  3814. // with respect to the original
  3815. // image.
  3816. ImportanceFraction float64 `json:"importanceFraction,omitempty"`
  3817. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  3818. // unconditionally include in API requests. By default, fields with
  3819. // empty values are omitted from API requests. However, any non-pointer,
  3820. // non-interface field appearing in ForceSendFields will be sent to the
  3821. // server regardless of whether the field is empty or not. This may be
  3822. // used to include empty fields in Patch requests.
  3823. ForceSendFields []string `json:"-"`
  3824. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  3825. // in API requests with the JSON null value. By default, fields with
  3826. // empty values are omitted from API requests. However, any field with
  3827. // an empty value appearing in NullFields will be sent to the server as
  3828. // null. It is an error if a field in this list has a non-empty value.
  3829. // This may be used to include null fields in Patch requests.
  3830. NullFields []string `json:"-"`
  3831. }
  3832. func (s *GoogleCloudVisionV1p2beta1CropHint) MarshalJSON() ([]byte, error) {
  3833. type NoMethod GoogleCloudVisionV1p2beta1CropHint
  3834. raw := NoMethod(*s)
  3835. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3836. }
  3837. func (s *GoogleCloudVisionV1p2beta1CropHint) UnmarshalJSON(data []byte) error {
  3838. type NoMethod GoogleCloudVisionV1p2beta1CropHint
  3839. var s1 struct {
  3840. Confidence gensupport.JSONFloat64 `json:"confidence"`
  3841. ImportanceFraction gensupport.JSONFloat64 `json:"importanceFraction"`
  3842. *NoMethod
  3843. }
  3844. s1.NoMethod = (*NoMethod)(s)
  3845. if err := json.Unmarshal(data, &s1); err != nil {
  3846. return err
  3847. }
  3848. s.Confidence = float64(s1.Confidence)
  3849. s.ImportanceFraction = float64(s1.ImportanceFraction)
  3850. return nil
  3851. }
  3852. // GoogleCloudVisionV1p2beta1CropHintsAnnotation: Set of crop hints that
  3853. // are used to generate new crops when serving images.
  3854. type GoogleCloudVisionV1p2beta1CropHintsAnnotation struct {
  3855. // CropHints: Crop hint results.
  3856. CropHints []*GoogleCloudVisionV1p2beta1CropHint `json:"cropHints,omitempty"`
  3857. // ForceSendFields is a list of field names (e.g. "CropHints") to
  3858. // unconditionally include in API requests. By default, fields with
  3859. // empty values are omitted from API requests. However, any non-pointer,
  3860. // non-interface field appearing in ForceSendFields will be sent to the
  3861. // server regardless of whether the field is empty or not. This may be
  3862. // used to include empty fields in Patch requests.
  3863. ForceSendFields []string `json:"-"`
  3864. // NullFields is a list of field names (e.g. "CropHints") to include in
  3865. // API requests with the JSON null value. By default, fields with empty
  3866. // values are omitted from API requests. However, any field with an
  3867. // empty value appearing in NullFields will be sent to the server as
  3868. // null. It is an error if a field in this list has a non-empty value.
  3869. // This may be used to include null fields in Patch requests.
  3870. NullFields []string `json:"-"`
  3871. }
  3872. func (s *GoogleCloudVisionV1p2beta1CropHintsAnnotation) MarshalJSON() ([]byte, error) {
  3873. type NoMethod GoogleCloudVisionV1p2beta1CropHintsAnnotation
  3874. raw := NoMethod(*s)
  3875. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3876. }
  3877. // GoogleCloudVisionV1p2beta1CropHintsParams: Parameters for crop hints
  3878. // annotation request.
  3879. type GoogleCloudVisionV1p2beta1CropHintsParams struct {
  3880. // AspectRatios: Aspect ratios in floats, representing the ratio of the
  3881. // width to the height
  3882. // of the image. For example, if the desired aspect ratio is 4/3,
  3883. // the
  3884. // corresponding float value should be 1.33333. If not specified,
  3885. // the
  3886. // best possible crop is returned. The number of provided aspect ratios
  3887. // is
  3888. // limited to a maximum of 16; any aspect ratios provided after the 16th
  3889. // are
  3890. // ignored.
  3891. AspectRatios []float64 `json:"aspectRatios,omitempty"`
  3892. // ForceSendFields is a list of field names (e.g. "AspectRatios") to
  3893. // unconditionally include in API requests. By default, fields with
  3894. // empty values are omitted from API requests. However, any non-pointer,
  3895. // non-interface field appearing in ForceSendFields will be sent to the
  3896. // server regardless of whether the field is empty or not. This may be
  3897. // used to include empty fields in Patch requests.
  3898. ForceSendFields []string `json:"-"`
  3899. // NullFields is a list of field names (e.g. "AspectRatios") to include
  3900. // in API requests with the JSON null value. By default, fields with
  3901. // empty values are omitted from API requests. However, any field with
  3902. // an empty value appearing in NullFields will be sent to the server as
  3903. // null. It is an error if a field in this list has a non-empty value.
  3904. // This may be used to include null fields in Patch requests.
  3905. NullFields []string `json:"-"`
  3906. }
  3907. func (s *GoogleCloudVisionV1p2beta1CropHintsParams) MarshalJSON() ([]byte, error) {
  3908. type NoMethod GoogleCloudVisionV1p2beta1CropHintsParams
  3909. raw := NoMethod(*s)
  3910. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3911. }
  3912. // GoogleCloudVisionV1p2beta1DominantColorsAnnotation: Set of dominant
  3913. // colors and their corresponding scores.
  3914. type GoogleCloudVisionV1p2beta1DominantColorsAnnotation struct {
  3915. // Colors: RGB color values with their score and pixel fraction.
  3916. Colors []*GoogleCloudVisionV1p2beta1ColorInfo `json:"colors,omitempty"`
  3917. // ForceSendFields is a list of field names (e.g. "Colors") to
  3918. // unconditionally include in API requests. By default, fields with
  3919. // empty values are omitted from API requests. However, any non-pointer,
  3920. // non-interface field appearing in ForceSendFields will be sent to the
  3921. // server regardless of whether the field is empty or not. This may be
  3922. // used to include empty fields in Patch requests.
  3923. ForceSendFields []string `json:"-"`
  3924. // NullFields is a list of field names (e.g. "Colors") to include in API
  3925. // requests with the JSON null value. By default, fields with empty
  3926. // values are omitted from API requests. However, any field with an
  3927. // empty value appearing in NullFields will be sent to the server as
  3928. // null. It is an error if a field in this list has a non-empty value.
  3929. // This may be used to include null fields in Patch requests.
  3930. NullFields []string `json:"-"`
  3931. }
  3932. func (s *GoogleCloudVisionV1p2beta1DominantColorsAnnotation) MarshalJSON() ([]byte, error) {
  3933. type NoMethod GoogleCloudVisionV1p2beta1DominantColorsAnnotation
  3934. raw := NoMethod(*s)
  3935. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3936. }
  3937. // GoogleCloudVisionV1p2beta1EntityAnnotation: Set of detected entity
  3938. // features.
  3939. type GoogleCloudVisionV1p2beta1EntityAnnotation struct {
  3940. // BoundingPoly: Image region to which this entity belongs. Not
  3941. // produced
  3942. // for `LABEL_DETECTION` features.
  3943. BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"`
  3944. // Confidence: **Deprecated. Use `score` instead.**
  3945. // The accuracy of the entity detection in an image.
  3946. // For example, for an image in which the "Eiffel Tower" entity is
  3947. // detected,
  3948. // this field represents the confidence that there is a tower in the
  3949. // query
  3950. // image. Range [0, 1].
  3951. Confidence float64 `json:"confidence,omitempty"`
  3952. // Description: Entity textual description, expressed in its `locale`
  3953. // language.
  3954. Description string `json:"description,omitempty"`
  3955. // Locale: The language code for the locale in which the entity
  3956. // textual
  3957. // `description` is expressed.
  3958. Locale string `json:"locale,omitempty"`
  3959. // Locations: The location information for the detected entity.
  3960. // Multiple
  3961. // `LocationInfo` elements can be present because one location
  3962. // may
  3963. // indicate the location of the scene in the image, and another
  3964. // location
  3965. // may indicate the location of the place where the image was
  3966. // taken.
  3967. // Location information is usually present for landmarks.
  3968. Locations []*GoogleCloudVisionV1p2beta1LocationInfo `json:"locations,omitempty"`
  3969. // Mid: Opaque entity ID. Some IDs may be available in
  3970. // [Google Knowledge Graph
  3971. // Search
  3972. // API](https://developers.google.com/knowledge-graph/).
  3973. Mid string `json:"mid,omitempty"`
  3974. // Properties: Some entities may have optional user-supplied `Property`
  3975. // (name/value)
  3976. // fields, such a score or string that qualifies the entity.
  3977. Properties []*GoogleCloudVisionV1p2beta1Property `json:"properties,omitempty"`
  3978. // Score: Overall score of the result. Range [0, 1].
  3979. Score float64 `json:"score,omitempty"`
  3980. // Topicality: The relevancy of the ICA (Image Content Annotation) label
  3981. // to the
  3982. // image. For example, the relevancy of "tower" is likely higher to an
  3983. // image
  3984. // containing the detected "Eiffel Tower" than to an image containing
  3985. // a
  3986. // detected distant towering building, even though the confidence
  3987. // that
  3988. // there is a tower in each image may be the same. Range [0, 1].
  3989. Topicality float64 `json:"topicality,omitempty"`
  3990. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  3991. // unconditionally include in API requests. By default, fields with
  3992. // empty values are omitted from API requests. However, any non-pointer,
  3993. // non-interface field appearing in ForceSendFields will be sent to the
  3994. // server regardless of whether the field is empty or not. This may be
  3995. // used to include empty fields in Patch requests.
  3996. ForceSendFields []string `json:"-"`
  3997. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  3998. // in API requests with the JSON null value. By default, fields with
  3999. // empty values are omitted from API requests. However, any field with
  4000. // an empty value appearing in NullFields will be sent to the server as
  4001. // null. It is an error if a field in this list has a non-empty value.
  4002. // This may be used to include null fields in Patch requests.
  4003. NullFields []string `json:"-"`
  4004. }
  4005. func (s *GoogleCloudVisionV1p2beta1EntityAnnotation) MarshalJSON() ([]byte, error) {
  4006. type NoMethod GoogleCloudVisionV1p2beta1EntityAnnotation
  4007. raw := NoMethod(*s)
  4008. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4009. }
  4010. func (s *GoogleCloudVisionV1p2beta1EntityAnnotation) UnmarshalJSON(data []byte) error {
  4011. type NoMethod GoogleCloudVisionV1p2beta1EntityAnnotation
  4012. var s1 struct {
  4013. Confidence gensupport.JSONFloat64 `json:"confidence"`
  4014. Score gensupport.JSONFloat64 `json:"score"`
  4015. Topicality gensupport.JSONFloat64 `json:"topicality"`
  4016. *NoMethod
  4017. }
  4018. s1.NoMethod = (*NoMethod)(s)
  4019. if err := json.Unmarshal(data, &s1); err != nil {
  4020. return err
  4021. }
  4022. s.Confidence = float64(s1.Confidence)
  4023. s.Score = float64(s1.Score)
  4024. s.Topicality = float64(s1.Topicality)
  4025. return nil
  4026. }
  4027. // GoogleCloudVisionV1p2beta1FaceAnnotation: A face annotation object
  4028. // contains the results of face detection.
  4029. type GoogleCloudVisionV1p2beta1FaceAnnotation struct {
  4030. // AngerLikelihood: Anger likelihood.
  4031. //
  4032. // Possible values:
  4033. // "UNKNOWN" - Unknown likelihood.
  4034. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  4035. // specified vertical.
  4036. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  4037. // vertical.
  4038. // "POSSIBLE" - It is possible that the image belongs to the specified
  4039. // vertical.
  4040. // "LIKELY" - It is likely that the image belongs to the specified
  4041. // vertical.
  4042. // "VERY_LIKELY" - It is very likely that the image belongs to the
  4043. // specified vertical.
  4044. AngerLikelihood string `json:"angerLikelihood,omitempty"`
  4045. // BlurredLikelihood: Blurred likelihood.
  4046. //
  4047. // Possible values:
  4048. // "UNKNOWN" - Unknown likelihood.
  4049. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  4050. // specified vertical.
  4051. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  4052. // vertical.
  4053. // "POSSIBLE" - It is possible that the image belongs to the specified
  4054. // vertical.
  4055. // "LIKELY" - It is likely that the image belongs to the specified
  4056. // vertical.
  4057. // "VERY_LIKELY" - It is very likely that the image belongs to the
  4058. // specified vertical.
  4059. BlurredLikelihood string `json:"blurredLikelihood,omitempty"`
  4060. // BoundingPoly: The bounding polygon around the face. The coordinates
  4061. // of the bounding box
  4062. // are in the original image's scale.
  4063. // The bounding box is computed to "frame" the face in accordance with
  4064. // human
  4065. // expectations. It is based on the landmarker results.
  4066. // Note that one or more x and/or y coordinates may not be generated in
  4067. // the
  4068. // `BoundingPoly` (the polygon will be unbounded) if only a partial
  4069. // face
  4070. // appears in the image to be annotated.
  4071. BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"`
  4072. // DetectionConfidence: Detection confidence. Range [0, 1].
  4073. DetectionConfidence float64 `json:"detectionConfidence,omitempty"`
  4074. // FdBoundingPoly: The `fd_bounding_poly` bounding polygon is tighter
  4075. // than the
  4076. // `boundingPoly`, and encloses only the skin part of the face.
  4077. // Typically, it
  4078. // is used to eliminate the face from any image analysis that detects
  4079. // the
  4080. // "amount of skin" visible in an image. It is not based on
  4081. // the
  4082. // landmarker results, only on the initial face detection, hence
  4083. // the <code>fd</code> (face detection) prefix.
  4084. FdBoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"fdBoundingPoly,omitempty"`
  4085. // HeadwearLikelihood: Headwear likelihood.
  4086. //
  4087. // Possible values:
  4088. // "UNKNOWN" - Unknown likelihood.
  4089. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  4090. // specified vertical.
  4091. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  4092. // vertical.
  4093. // "POSSIBLE" - It is possible that the image belongs to the specified
  4094. // vertical.
  4095. // "LIKELY" - It is likely that the image belongs to the specified
  4096. // vertical.
  4097. // "VERY_LIKELY" - It is very likely that the image belongs to the
  4098. // specified vertical.
  4099. HeadwearLikelihood string `json:"headwearLikelihood,omitempty"`
  4100. // JoyLikelihood: Joy likelihood.
  4101. //
  4102. // Possible values:
  4103. // "UNKNOWN" - Unknown likelihood.
  4104. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  4105. // specified vertical.
  4106. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  4107. // vertical.
  4108. // "POSSIBLE" - It is possible that the image belongs to the specified
  4109. // vertical.
  4110. // "LIKELY" - It is likely that the image belongs to the specified
  4111. // vertical.
  4112. // "VERY_LIKELY" - It is very likely that the image belongs to the
  4113. // specified vertical.
  4114. JoyLikelihood string `json:"joyLikelihood,omitempty"`
  4115. // LandmarkingConfidence: Face landmarking confidence. Range [0, 1].
  4116. LandmarkingConfidence float64 `json:"landmarkingConfidence,omitempty"`
  4117. // Landmarks: Detected face landmarks.
  4118. Landmarks []*GoogleCloudVisionV1p2beta1FaceAnnotationLandmark `json:"landmarks,omitempty"`
  4119. // PanAngle: Yaw angle, which indicates the leftward/rightward angle
  4120. // that the face is
  4121. // pointing relative to the vertical plane perpendicular to the image.
  4122. // Range
  4123. // [-180,180].
  4124. PanAngle float64 `json:"panAngle,omitempty"`
  4125. // RollAngle: Roll angle, which indicates the amount of
  4126. // clockwise/anti-clockwise rotation
  4127. // of the face relative to the image vertical about the axis
  4128. // perpendicular to
  4129. // the face. Range [-180,180].
  4130. RollAngle float64 `json:"rollAngle,omitempty"`
  4131. // SorrowLikelihood: Sorrow likelihood.
  4132. //
  4133. // Possible values:
  4134. // "UNKNOWN" - Unknown likelihood.
  4135. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  4136. // specified vertical.
  4137. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  4138. // vertical.
  4139. // "POSSIBLE" - It is possible that the image belongs to the specified
  4140. // vertical.
  4141. // "LIKELY" - It is likely that the image belongs to the specified
  4142. // vertical.
  4143. // "VERY_LIKELY" - It is very likely that the image belongs to the
  4144. // specified vertical.
  4145. SorrowLikelihood string `json:"sorrowLikelihood,omitempty"`
  4146. // SurpriseLikelihood: Surprise likelihood.
  4147. //
  4148. // Possible values:
  4149. // "UNKNOWN" - Unknown likelihood.
  4150. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  4151. // specified vertical.
  4152. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  4153. // vertical.
  4154. // "POSSIBLE" - It is possible that the image belongs to the specified
  4155. // vertical.
  4156. // "LIKELY" - It is likely that the image belongs to the specified
  4157. // vertical.
  4158. // "VERY_LIKELY" - It is very likely that the image belongs to the
  4159. // specified vertical.
  4160. SurpriseLikelihood string `json:"surpriseLikelihood,omitempty"`
  4161. // TiltAngle: Pitch angle, which indicates the upwards/downwards angle
  4162. // that the face is
  4163. // pointing relative to the image's horizontal plane. Range [-180,180].
  4164. TiltAngle float64 `json:"tiltAngle,omitempty"`
  4165. // UnderExposedLikelihood: Under-exposed likelihood.
  4166. //
  4167. // Possible values:
  4168. // "UNKNOWN" - Unknown likelihood.
  4169. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  4170. // specified vertical.
  4171. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  4172. // vertical.
  4173. // "POSSIBLE" - It is possible that the image belongs to the specified
  4174. // vertical.
  4175. // "LIKELY" - It is likely that the image belongs to the specified
  4176. // vertical.
  4177. // "VERY_LIKELY" - It is very likely that the image belongs to the
  4178. // specified vertical.
  4179. UnderExposedLikelihood string `json:"underExposedLikelihood,omitempty"`
  4180. // ForceSendFields is a list of field names (e.g. "AngerLikelihood") to
  4181. // unconditionally include in API requests. By default, fields with
  4182. // empty values are omitted from API requests. However, any non-pointer,
  4183. // non-interface field appearing in ForceSendFields will be sent to the
  4184. // server regardless of whether the field is empty or not. This may be
  4185. // used to include empty fields in Patch requests.
  4186. ForceSendFields []string `json:"-"`
  4187. // NullFields is a list of field names (e.g. "AngerLikelihood") to
  4188. // include in API requests with the JSON null value. By default, fields
  4189. // with empty values are omitted from API requests. However, any field
  4190. // with an empty value appearing in NullFields will be sent to the
  4191. // server as null. It is an error if a field in this list has a
  4192. // non-empty value. This may be used to include null fields in Patch
  4193. // requests.
  4194. NullFields []string `json:"-"`
  4195. }
  4196. func (s *GoogleCloudVisionV1p2beta1FaceAnnotation) MarshalJSON() ([]byte, error) {
  4197. type NoMethod GoogleCloudVisionV1p2beta1FaceAnnotation
  4198. raw := NoMethod(*s)
  4199. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4200. }
  4201. func (s *GoogleCloudVisionV1p2beta1FaceAnnotation) UnmarshalJSON(data []byte) error {
  4202. type NoMethod GoogleCloudVisionV1p2beta1FaceAnnotation
  4203. var s1 struct {
  4204. DetectionConfidence gensupport.JSONFloat64 `json:"detectionConfidence"`
  4205. LandmarkingConfidence gensupport.JSONFloat64 `json:"landmarkingConfidence"`
  4206. PanAngle gensupport.JSONFloat64 `json:"panAngle"`
  4207. RollAngle gensupport.JSONFloat64 `json:"rollAngle"`
  4208. TiltAngle gensupport.JSONFloat64 `json:"tiltAngle"`
  4209. *NoMethod
  4210. }
  4211. s1.NoMethod = (*NoMethod)(s)
  4212. if err := json.Unmarshal(data, &s1); err != nil {
  4213. return err
  4214. }
  4215. s.DetectionConfidence = float64(s1.DetectionConfidence)
  4216. s.LandmarkingConfidence = float64(s1.LandmarkingConfidence)
  4217. s.PanAngle = float64(s1.PanAngle)
  4218. s.RollAngle = float64(s1.RollAngle)
  4219. s.TiltAngle = float64(s1.TiltAngle)
  4220. return nil
  4221. }
  4222. // GoogleCloudVisionV1p2beta1FaceAnnotationLandmark: A face-specific
  4223. // landmark (for example, a face feature).
  4224. type GoogleCloudVisionV1p2beta1FaceAnnotationLandmark struct {
  4225. // Position: Face landmark position.
  4226. Position *GoogleCloudVisionV1p2beta1Position `json:"position,omitempty"`
  4227. // Type: Face landmark type.
  4228. //
  4229. // Possible values:
  4230. // "UNKNOWN_LANDMARK" - Unknown face landmark detected. Should not be
  4231. // filled.
  4232. // "LEFT_EYE" - Left eye.
  4233. // "RIGHT_EYE" - Right eye.
  4234. // "LEFT_OF_LEFT_EYEBROW" - Left of left eyebrow.
  4235. // "RIGHT_OF_LEFT_EYEBROW" - Right of left eyebrow.
  4236. // "LEFT_OF_RIGHT_EYEBROW" - Left of right eyebrow.
  4237. // "RIGHT_OF_RIGHT_EYEBROW" - Right of right eyebrow.
  4238. // "MIDPOINT_BETWEEN_EYES" - Midpoint between eyes.
  4239. // "NOSE_TIP" - Nose tip.
  4240. // "UPPER_LIP" - Upper lip.
  4241. // "LOWER_LIP" - Lower lip.
  4242. // "MOUTH_LEFT" - Mouth left.
  4243. // "MOUTH_RIGHT" - Mouth right.
  4244. // "MOUTH_CENTER" - Mouth center.
  4245. // "NOSE_BOTTOM_RIGHT" - Nose, bottom right.
  4246. // "NOSE_BOTTOM_LEFT" - Nose, bottom left.
  4247. // "NOSE_BOTTOM_CENTER" - Nose, bottom center.
  4248. // "LEFT_EYE_TOP_BOUNDARY" - Left eye, top boundary.
  4249. // "LEFT_EYE_RIGHT_CORNER" - Left eye, right corner.
  4250. // "LEFT_EYE_BOTTOM_BOUNDARY" - Left eye, bottom boundary.
  4251. // "LEFT_EYE_LEFT_CORNER" - Left eye, left corner.
  4252. // "RIGHT_EYE_TOP_BOUNDARY" - Right eye, top boundary.
  4253. // "RIGHT_EYE_RIGHT_CORNER" - Right eye, right corner.
  4254. // "RIGHT_EYE_BOTTOM_BOUNDARY" - Right eye, bottom boundary.
  4255. // "RIGHT_EYE_LEFT_CORNER" - Right eye, left corner.
  4256. // "LEFT_EYEBROW_UPPER_MIDPOINT" - Left eyebrow, upper midpoint.
  4257. // "RIGHT_EYEBROW_UPPER_MIDPOINT" - Right eyebrow, upper midpoint.
  4258. // "LEFT_EAR_TRAGION" - Left ear tragion.
  4259. // "RIGHT_EAR_TRAGION" - Right ear tragion.
  4260. // "LEFT_EYE_PUPIL" - Left eye pupil.
  4261. // "RIGHT_EYE_PUPIL" - Right eye pupil.
  4262. // "FOREHEAD_GLABELLA" - Forehead glabella.
  4263. // "CHIN_GNATHION" - Chin gnathion.
  4264. // "CHIN_LEFT_GONION" - Chin left gonion.
  4265. // "CHIN_RIGHT_GONION" - Chin right gonion.
  4266. Type string `json:"type,omitempty"`
  4267. // ForceSendFields is a list of field names (e.g. "Position") to
  4268. // unconditionally include in API requests. By default, fields with
  4269. // empty values are omitted from API requests. However, any non-pointer,
  4270. // non-interface field appearing in ForceSendFields will be sent to the
  4271. // server regardless of whether the field is empty or not. This may be
  4272. // used to include empty fields in Patch requests.
  4273. ForceSendFields []string `json:"-"`
  4274. // NullFields is a list of field names (e.g. "Position") to include in
  4275. // API requests with the JSON null value. By default, fields with empty
  4276. // values are omitted from API requests. However, any field with an
  4277. // empty value appearing in NullFields will be sent to the server as
  4278. // null. It is an error if a field in this list has a non-empty value.
  4279. // This may be used to include null fields in Patch requests.
  4280. NullFields []string `json:"-"`
  4281. }
  4282. func (s *GoogleCloudVisionV1p2beta1FaceAnnotationLandmark) MarshalJSON() ([]byte, error) {
  4283. type NoMethod GoogleCloudVisionV1p2beta1FaceAnnotationLandmark
  4284. raw := NoMethod(*s)
  4285. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4286. }
  4287. // GoogleCloudVisionV1p2beta1Feature: The type of Google Cloud Vision
  4288. // API detection to perform, and the maximum
  4289. // number of results to return for that type. Multiple `Feature` objects
  4290. // can
  4291. // be specified in the `features` list.
  4292. type GoogleCloudVisionV1p2beta1Feature struct {
  4293. // MaxResults: Maximum number of results of this type. Does not apply
  4294. // to
  4295. // `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`.
  4296. MaxResults int64 `json:"maxResults,omitempty"`
  4297. // Model: Model to use for the feature.
  4298. // Supported values: "builtin/stable" (the default if unset)
  4299. // and
  4300. // "builtin/latest".
  4301. Model string `json:"model,omitempty"`
  4302. // Type: The feature type.
  4303. //
  4304. // Possible values:
  4305. // "TYPE_UNSPECIFIED" - Unspecified feature type.
  4306. // "FACE_DETECTION" - Run face detection.
  4307. // "LANDMARK_DETECTION" - Run landmark detection.
  4308. // "LOGO_DETECTION" - Run logo detection.
  4309. // "LABEL_DETECTION" - Run label detection.
  4310. // "TEXT_DETECTION" - Run text detection / optical character
  4311. // recognition (OCR). Text detection
  4312. // is optimized for areas of text within a larger image; if the image
  4313. // is
  4314. // a document, use `DOCUMENT_TEXT_DETECTION` instead.
  4315. // "DOCUMENT_TEXT_DETECTION" - Run dense text document OCR. Takes
  4316. // precedence when both
  4317. // `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` are present.
  4318. // "SAFE_SEARCH_DETECTION" - Run Safe Search to detect potentially
  4319. // unsafe
  4320. // or undesirable content.
  4321. // "IMAGE_PROPERTIES" - Compute a set of image properties, such as
  4322. // the
  4323. // image's dominant colors.
  4324. // "CROP_HINTS" - Run crop hints.
  4325. // "WEB_DETECTION" - Run web detection.
  4326. // "PRODUCT_SEARCH" - Run Product Search.
  4327. // "OBJECT_LOCALIZATION" - Run localizer for object detection.
  4328. Type string `json:"type,omitempty"`
  4329. // ForceSendFields is a list of field names (e.g. "MaxResults") to
  4330. // unconditionally include in API requests. By default, fields with
  4331. // empty values are omitted from API requests. However, any non-pointer,
  4332. // non-interface field appearing in ForceSendFields will be sent to the
  4333. // server regardless of whether the field is empty or not. This may be
  4334. // used to include empty fields in Patch requests.
  4335. ForceSendFields []string `json:"-"`
  4336. // NullFields is a list of field names (e.g. "MaxResults") to include in
  4337. // API requests with the JSON null value. By default, fields with empty
  4338. // values are omitted from API requests. However, any field with an
  4339. // empty value appearing in NullFields will be sent to the server as
  4340. // null. It is an error if a field in this list has a non-empty value.
  4341. // This may be used to include null fields in Patch requests.
  4342. NullFields []string `json:"-"`
  4343. }
  4344. func (s *GoogleCloudVisionV1p2beta1Feature) MarshalJSON() ([]byte, error) {
  4345. type NoMethod GoogleCloudVisionV1p2beta1Feature
  4346. raw := NoMethod(*s)
  4347. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4348. }
  4349. // GoogleCloudVisionV1p2beta1GcsDestination: The Google Cloud Storage
  4350. // location where the output will be written to.
  4351. type GoogleCloudVisionV1p2beta1GcsDestination struct {
  4352. // Uri: Google Cloud Storage URI where the results will be stored.
  4353. // Results will
  4354. // be in JSON format and preceded by its corresponding input URI. This
  4355. // field
  4356. // can either represent a single file, or a prefix for multiple
  4357. // outputs.
  4358. // Prefixes must end in a `/`.
  4359. //
  4360. // Examples:
  4361. //
  4362. // * File: gs://bucket-name/filename.json
  4363. // * Prefix: gs://bucket-name/prefix/here/
  4364. // * File: gs://bucket-name/prefix/here
  4365. //
  4366. // If multiple outputs, each response is still AnnotateFileResponse,
  4367. // each of
  4368. // which contains some subset of the full list of
  4369. // AnnotateImageResponse.
  4370. // Multiple outputs can happen if, for example, the output JSON is too
  4371. // large
  4372. // and overflows into multiple sharded files.
  4373. Uri string `json:"uri,omitempty"`
  4374. // ForceSendFields is a list of field names (e.g. "Uri") to
  4375. // unconditionally include in API requests. By default, fields with
  4376. // empty values are omitted from API requests. However, any non-pointer,
  4377. // non-interface field appearing in ForceSendFields will be sent to the
  4378. // server regardless of whether the field is empty or not. This may be
  4379. // used to include empty fields in Patch requests.
  4380. ForceSendFields []string `json:"-"`
  4381. // NullFields is a list of field names (e.g. "Uri") to include in API
  4382. // requests with the JSON null value. By default, fields with empty
  4383. // values are omitted from API requests. However, any field with an
  4384. // empty value appearing in NullFields will be sent to the server as
  4385. // null. It is an error if a field in this list has a non-empty value.
  4386. // This may be used to include null fields in Patch requests.
  4387. NullFields []string `json:"-"`
  4388. }
  4389. func (s *GoogleCloudVisionV1p2beta1GcsDestination) MarshalJSON() ([]byte, error) {
  4390. type NoMethod GoogleCloudVisionV1p2beta1GcsDestination
  4391. raw := NoMethod(*s)
  4392. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4393. }
  4394. // GoogleCloudVisionV1p2beta1GcsSource: The Google Cloud Storage
  4395. // location where the input will be read from.
  4396. type GoogleCloudVisionV1p2beta1GcsSource struct {
  4397. // Uri: Google Cloud Storage URI for the input file. This must only be
  4398. // a
  4399. // Google Cloud Storage object. Wildcards are not currently supported.
  4400. Uri string `json:"uri,omitempty"`
  4401. // ForceSendFields is a list of field names (e.g. "Uri") to
  4402. // unconditionally include in API requests. By default, fields with
  4403. // empty values are omitted from API requests. However, any non-pointer,
  4404. // non-interface field appearing in ForceSendFields will be sent to the
  4405. // server regardless of whether the field is empty or not. This may be
  4406. // used to include empty fields in Patch requests.
  4407. ForceSendFields []string `json:"-"`
  4408. // NullFields is a list of field names (e.g. "Uri") to include in API
  4409. // requests with the JSON null value. By default, fields with empty
  4410. // values are omitted from API requests. However, any field with an
  4411. // empty value appearing in NullFields will be sent to the server as
  4412. // null. It is an error if a field in this list has a non-empty value.
  4413. // This may be used to include null fields in Patch requests.
  4414. NullFields []string `json:"-"`
  4415. }
  4416. func (s *GoogleCloudVisionV1p2beta1GcsSource) MarshalJSON() ([]byte, error) {
  4417. type NoMethod GoogleCloudVisionV1p2beta1GcsSource
  4418. raw := NoMethod(*s)
  4419. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4420. }
  4421. // GoogleCloudVisionV1p2beta1Image: Client image to perform Google Cloud
  4422. // Vision API tasks over.
  4423. type GoogleCloudVisionV1p2beta1Image struct {
  4424. // Content: Image content, represented as a stream of bytes.
  4425. // Note: As with all `bytes` fields, protobuffers use a pure
  4426. // binary
  4427. // representation, whereas JSON representations use base64.
  4428. Content string `json:"content,omitempty"`
  4429. // Source: Google Cloud Storage image location, or publicly-accessible
  4430. // image
  4431. // URL. If both `content` and `source` are provided for an image,
  4432. // `content`
  4433. // takes precedence and is used to perform the image annotation request.
  4434. Source *GoogleCloudVisionV1p2beta1ImageSource `json:"source,omitempty"`
  4435. // ForceSendFields is a list of field names (e.g. "Content") to
  4436. // unconditionally include in API requests. By default, fields with
  4437. // empty values are omitted from API requests. However, any non-pointer,
  4438. // non-interface field appearing in ForceSendFields will be sent to the
  4439. // server regardless of whether the field is empty or not. This may be
  4440. // used to include empty fields in Patch requests.
  4441. ForceSendFields []string `json:"-"`
  4442. // NullFields is a list of field names (e.g. "Content") to include in
  4443. // API requests with the JSON null value. By default, fields with empty
  4444. // values are omitted from API requests. However, any field with an
  4445. // empty value appearing in NullFields will be sent to the server as
  4446. // null. It is an error if a field in this list has a non-empty value.
  4447. // This may be used to include null fields in Patch requests.
  4448. NullFields []string `json:"-"`
  4449. }
  4450. func (s *GoogleCloudVisionV1p2beta1Image) MarshalJSON() ([]byte, error) {
  4451. type NoMethod GoogleCloudVisionV1p2beta1Image
  4452. raw := NoMethod(*s)
  4453. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4454. }
  4455. // GoogleCloudVisionV1p2beta1ImageAnnotationContext: If an image was
  4456. // produced from a file (e.g. a PDF), this message gives
  4457. // information about the source of that image.
  4458. type GoogleCloudVisionV1p2beta1ImageAnnotationContext struct {
  4459. // PageNumber: If the file was a PDF or TIFF, this field gives the page
  4460. // number within
  4461. // the file used to produce the image.
  4462. PageNumber int64 `json:"pageNumber,omitempty"`
  4463. // Uri: The URI of the file used to produce the image.
  4464. Uri string `json:"uri,omitempty"`
  4465. // ForceSendFields is a list of field names (e.g. "PageNumber") to
  4466. // unconditionally include in API requests. By default, fields with
  4467. // empty values are omitted from API requests. However, any non-pointer,
  4468. // non-interface field appearing in ForceSendFields will be sent to the
  4469. // server regardless of whether the field is empty or not. This may be
  4470. // used to include empty fields in Patch requests.
  4471. ForceSendFields []string `json:"-"`
  4472. // NullFields is a list of field names (e.g. "PageNumber") to include in
  4473. // API requests with the JSON null value. By default, fields with empty
  4474. // values are omitted from API requests. However, any field with an
  4475. // empty value appearing in NullFields will be sent to the server as
  4476. // null. It is an error if a field in this list has a non-empty value.
  4477. // This may be used to include null fields in Patch requests.
  4478. NullFields []string `json:"-"`
  4479. }
  4480. func (s *GoogleCloudVisionV1p2beta1ImageAnnotationContext) MarshalJSON() ([]byte, error) {
  4481. type NoMethod GoogleCloudVisionV1p2beta1ImageAnnotationContext
  4482. raw := NoMethod(*s)
  4483. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4484. }
  4485. // GoogleCloudVisionV1p2beta1ImageContext: Image context and/or
  4486. // feature-specific parameters.
  4487. type GoogleCloudVisionV1p2beta1ImageContext struct {
  4488. // CropHintsParams: Parameters for crop hints annotation request.
  4489. CropHintsParams *GoogleCloudVisionV1p2beta1CropHintsParams `json:"cropHintsParams,omitempty"`
  4490. // LanguageHints: List of languages to use for TEXT_DETECTION. In most
  4491. // cases, an empty value
  4492. // yields the best results since it enables automatic language
  4493. // detection. For
  4494. // languages based on the Latin alphabet, setting `language_hints` is
  4495. // not
  4496. // needed. In rare cases, when the language of the text in the image is
  4497. // known,
  4498. // setting a hint will help get better results (although it will be
  4499. // a
  4500. // significant hindrance if the hint is wrong). Text detection returns
  4501. // an
  4502. // error if one or more of the specified languages is not one of
  4503. // the
  4504. // [supported languages](/vision/docs/languages).
  4505. LanguageHints []string `json:"languageHints,omitempty"`
  4506. // LatLongRect: Not used.
  4507. LatLongRect *GoogleCloudVisionV1p2beta1LatLongRect `json:"latLongRect,omitempty"`
  4508. // ProductSearchParams: Parameters for product search.
  4509. ProductSearchParams *GoogleCloudVisionV1p2beta1ProductSearchParams `json:"productSearchParams,omitempty"`
  4510. // WebDetectionParams: Parameters for web detection.
  4511. WebDetectionParams *GoogleCloudVisionV1p2beta1WebDetectionParams `json:"webDetectionParams,omitempty"`
  4512. // ForceSendFields is a list of field names (e.g. "CropHintsParams") to
  4513. // unconditionally include in API requests. By default, fields with
  4514. // empty values are omitted from API requests. However, any non-pointer,
  4515. // non-interface field appearing in ForceSendFields will be sent to the
  4516. // server regardless of whether the field is empty or not. This may be
  4517. // used to include empty fields in Patch requests.
  4518. ForceSendFields []string `json:"-"`
  4519. // NullFields is a list of field names (e.g. "CropHintsParams") to
  4520. // include in API requests with the JSON null value. By default, fields
  4521. // with empty values are omitted from API requests. However, any field
  4522. // with an empty value appearing in NullFields will be sent to the
  4523. // server as null. It is an error if a field in this list has a
  4524. // non-empty value. This may be used to include null fields in Patch
  4525. // requests.
  4526. NullFields []string `json:"-"`
  4527. }
  4528. func (s *GoogleCloudVisionV1p2beta1ImageContext) MarshalJSON() ([]byte, error) {
  4529. type NoMethod GoogleCloudVisionV1p2beta1ImageContext
  4530. raw := NoMethod(*s)
  4531. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4532. }
  4533. // GoogleCloudVisionV1p2beta1ImageProperties: Stores image properties,
  4534. // such as dominant colors.
  4535. type GoogleCloudVisionV1p2beta1ImageProperties struct {
  4536. // DominantColors: If present, dominant colors completed successfully.
  4537. DominantColors *GoogleCloudVisionV1p2beta1DominantColorsAnnotation `json:"dominantColors,omitempty"`
  4538. // ForceSendFields is a list of field names (e.g. "DominantColors") to
  4539. // unconditionally include in API requests. By default, fields with
  4540. // empty values are omitted from API requests. However, any non-pointer,
  4541. // non-interface field appearing in ForceSendFields will be sent to the
  4542. // server regardless of whether the field is empty or not. This may be
  4543. // used to include empty fields in Patch requests.
  4544. ForceSendFields []string `json:"-"`
  4545. // NullFields is a list of field names (e.g. "DominantColors") to
  4546. // include in API requests with the JSON null value. By default, fields
  4547. // with empty values are omitted from API requests. However, any field
  4548. // with an empty value appearing in NullFields will be sent to the
  4549. // server as null. It is an error if a field in this list has a
  4550. // non-empty value. This may be used to include null fields in Patch
  4551. // requests.
  4552. NullFields []string `json:"-"`
  4553. }
  4554. func (s *GoogleCloudVisionV1p2beta1ImageProperties) MarshalJSON() ([]byte, error) {
  4555. type NoMethod GoogleCloudVisionV1p2beta1ImageProperties
  4556. raw := NoMethod(*s)
  4557. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4558. }
  4559. // GoogleCloudVisionV1p2beta1ImageSource: External image source (Google
  4560. // Cloud Storage or web URL image location).
  4561. type GoogleCloudVisionV1p2beta1ImageSource struct {
  4562. // GcsImageUri: **Use `image_uri` instead.**
  4563. //
  4564. // The Google Cloud Storage URI of the
  4565. // form
  4566. // `gs://bucket_name/object_name`. Object versioning is not supported.
  4567. // See
  4568. // [Google Cloud Storage
  4569. // Request
  4570. // URIs](https://cloud.google.com/storage/docs/reference-uris) for more
  4571. // info.
  4572. GcsImageUri string `json:"gcsImageUri,omitempty"`
  4573. // ImageUri: The URI of the source image. Can be either:
  4574. //
  4575. // 1. A Google Cloud Storage URI of the form
  4576. // `gs://bucket_name/object_name`. Object versioning is not
  4577. // supported. See
  4578. // [Google Cloud Storage Request
  4579. // URIs](https://cloud.google.com/storage/docs/reference-uris) for
  4580. // more
  4581. // info.
  4582. //
  4583. // 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images
  4584. // from
  4585. // HTTP/HTTPS URLs, Google cannot guarantee that the request will be
  4586. // completed. Your request may fail if the specified host denies the
  4587. // request (e.g. due to request throttling or DOS prevention), or if
  4588. // Google
  4589. // throttles requests to the site for abuse prevention. You should
  4590. // not
  4591. // depend on externally-hosted images for production
  4592. // applications.
  4593. //
  4594. // When both `gcs_image_uri` and `image_uri` are specified, `image_uri`
  4595. // takes
  4596. // precedence.
  4597. ImageUri string `json:"imageUri,omitempty"`
  4598. // ForceSendFields is a list of field names (e.g. "GcsImageUri") to
  4599. // unconditionally include in API requests. By default, fields with
  4600. // empty values are omitted from API requests. However, any non-pointer,
  4601. // non-interface field appearing in ForceSendFields will be sent to the
  4602. // server regardless of whether the field is empty or not. This may be
  4603. // used to include empty fields in Patch requests.
  4604. ForceSendFields []string `json:"-"`
  4605. // NullFields is a list of field names (e.g. "GcsImageUri") to include
  4606. // in API requests with the JSON null value. By default, fields with
  4607. // empty values are omitted from API requests. However, any field with
  4608. // an empty value appearing in NullFields will be sent to the server as
  4609. // null. It is an error if a field in this list has a non-empty value.
  4610. // This may be used to include null fields in Patch requests.
  4611. NullFields []string `json:"-"`
  4612. }
  4613. func (s *GoogleCloudVisionV1p2beta1ImageSource) MarshalJSON() ([]byte, error) {
  4614. type NoMethod GoogleCloudVisionV1p2beta1ImageSource
  4615. raw := NoMethod(*s)
  4616. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4617. }
  4618. // GoogleCloudVisionV1p2beta1InputConfig: The desired input location and
  4619. // metadata.
  4620. type GoogleCloudVisionV1p2beta1InputConfig struct {
  4621. // GcsSource: The Google Cloud Storage location to read the input from.
  4622. GcsSource *GoogleCloudVisionV1p2beta1GcsSource `json:"gcsSource,omitempty"`
  4623. // MimeType: The type of the file. Currently only "application/pdf" and
  4624. // "image/tiff"
  4625. // are supported. Wildcards are not supported.
  4626. MimeType string `json:"mimeType,omitempty"`
  4627. // ForceSendFields is a list of field names (e.g. "GcsSource") to
  4628. // unconditionally include in API requests. By default, fields with
  4629. // empty values are omitted from API requests. However, any non-pointer,
  4630. // non-interface field appearing in ForceSendFields will be sent to the
  4631. // server regardless of whether the field is empty or not. This may be
  4632. // used to include empty fields in Patch requests.
  4633. ForceSendFields []string `json:"-"`
  4634. // NullFields is a list of field names (e.g. "GcsSource") to include in
  4635. // API requests with the JSON null value. By default, fields with empty
  4636. // values are omitted from API requests. However, any field with an
  4637. // empty value appearing in NullFields will be sent to the server as
  4638. // null. It is an error if a field in this list has a non-empty value.
  4639. // This may be used to include null fields in Patch requests.
  4640. NullFields []string `json:"-"`
  4641. }
  4642. func (s *GoogleCloudVisionV1p2beta1InputConfig) MarshalJSON() ([]byte, error) {
  4643. type NoMethod GoogleCloudVisionV1p2beta1InputConfig
  4644. raw := NoMethod(*s)
  4645. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4646. }
  4647. // GoogleCloudVisionV1p2beta1LatLongRect: Rectangle determined by min
  4648. // and max `LatLng` pairs.
  4649. type GoogleCloudVisionV1p2beta1LatLongRect struct {
  4650. // MaxLatLng: Max lat/long pair.
  4651. MaxLatLng *LatLng `json:"maxLatLng,omitempty"`
  4652. // MinLatLng: Min lat/long pair.
  4653. MinLatLng *LatLng `json:"minLatLng,omitempty"`
  4654. // ForceSendFields is a list of field names (e.g. "MaxLatLng") to
  4655. // unconditionally include in API requests. By default, fields with
  4656. // empty values are omitted from API requests. However, any non-pointer,
  4657. // non-interface field appearing in ForceSendFields will be sent to the
  4658. // server regardless of whether the field is empty or not. This may be
  4659. // used to include empty fields in Patch requests.
  4660. ForceSendFields []string `json:"-"`
  4661. // NullFields is a list of field names (e.g. "MaxLatLng") to include in
  4662. // API requests with the JSON null value. By default, fields with empty
  4663. // values are omitted from API requests. However, any field with an
  4664. // empty value appearing in NullFields will be sent to the server as
  4665. // null. It is an error if a field in this list has a non-empty value.
  4666. // This may be used to include null fields in Patch requests.
  4667. NullFields []string `json:"-"`
  4668. }
  4669. func (s *GoogleCloudVisionV1p2beta1LatLongRect) MarshalJSON() ([]byte, error) {
  4670. type NoMethod GoogleCloudVisionV1p2beta1LatLongRect
  4671. raw := NoMethod(*s)
  4672. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4673. }
  4674. // GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation: Set of detected
  4675. // objects with bounding boxes.
  4676. type GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation struct {
  4677. // BoundingPoly: Image region to which this object belongs. This must be
  4678. // populated.
  4679. BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"`
  4680. // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn".
  4681. // For more
  4682. // information,
  4683. // see
  4684. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  4685. LanguageCode string `json:"languageCode,omitempty"`
  4686. // Mid: Object ID that should align with EntityAnnotation mid.
  4687. Mid string `json:"mid,omitempty"`
  4688. // Name: Object name, expressed in its `language_code` language.
  4689. Name string `json:"name,omitempty"`
  4690. // Score: Score of the result. Range [0, 1].
  4691. Score float64 `json:"score,omitempty"`
  4692. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  4693. // unconditionally include in API requests. By default, fields with
  4694. // empty values are omitted from API requests. However, any non-pointer,
  4695. // non-interface field appearing in ForceSendFields will be sent to the
  4696. // server regardless of whether the field is empty or not. This may be
  4697. // used to include empty fields in Patch requests.
  4698. ForceSendFields []string `json:"-"`
  4699. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  4700. // in API requests with the JSON null value. By default, fields with
  4701. // empty values are omitted from API requests. However, any field with
  4702. // an empty value appearing in NullFields will be sent to the server as
  4703. // null. It is an error if a field in this list has a non-empty value.
  4704. // This may be used to include null fields in Patch requests.
  4705. NullFields []string `json:"-"`
  4706. }
  4707. func (s *GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation) MarshalJSON() ([]byte, error) {
  4708. type NoMethod GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation
  4709. raw := NoMethod(*s)
  4710. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4711. }
  4712. func (s *GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation) UnmarshalJSON(data []byte) error {
  4713. type NoMethod GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation
  4714. var s1 struct {
  4715. Score gensupport.JSONFloat64 `json:"score"`
  4716. *NoMethod
  4717. }
  4718. s1.NoMethod = (*NoMethod)(s)
  4719. if err := json.Unmarshal(data, &s1); err != nil {
  4720. return err
  4721. }
  4722. s.Score = float64(s1.Score)
  4723. return nil
  4724. }
  4725. // GoogleCloudVisionV1p2beta1LocationInfo: Detected entity location
  4726. // information.
  4727. type GoogleCloudVisionV1p2beta1LocationInfo struct {
  4728. // LatLng: lat/long location coordinates.
  4729. LatLng *LatLng `json:"latLng,omitempty"`
  4730. // ForceSendFields is a list of field names (e.g. "LatLng") 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. // NullFields is a list of field names (e.g. "LatLng") to include in API
  4738. // requests with the JSON null value. By default, fields with empty
  4739. // values are omitted from API requests. However, any field with an
  4740. // empty value appearing in NullFields will be sent to the server as
  4741. // null. It is an error if a field in this list has a non-empty value.
  4742. // This may be used to include null fields in Patch requests.
  4743. NullFields []string `json:"-"`
  4744. }
  4745. func (s *GoogleCloudVisionV1p2beta1LocationInfo) MarshalJSON() ([]byte, error) {
  4746. type NoMethod GoogleCloudVisionV1p2beta1LocationInfo
  4747. raw := NoMethod(*s)
  4748. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4749. }
  4750. // GoogleCloudVisionV1p2beta1NormalizedVertex: A vertex represents a 2D
  4751. // point in the image.
  4752. // NOTE: the normalized vertex coordinates are relative to the original
  4753. // image
  4754. // and range from 0 to 1.
  4755. type GoogleCloudVisionV1p2beta1NormalizedVertex struct {
  4756. // X: X coordinate.
  4757. X float64 `json:"x,omitempty"`
  4758. // Y: Y coordinate.
  4759. Y float64 `json:"y,omitempty"`
  4760. // ForceSendFields is a list of field names (e.g. "X") to
  4761. // unconditionally include in API requests. By default, fields with
  4762. // empty values are omitted from API requests. However, any non-pointer,
  4763. // non-interface field appearing in ForceSendFields will be sent to the
  4764. // server regardless of whether the field is empty or not. This may be
  4765. // used to include empty fields in Patch requests.
  4766. ForceSendFields []string `json:"-"`
  4767. // NullFields is a list of field names (e.g. "X") to include in API
  4768. // requests with the JSON null value. By default, fields with empty
  4769. // values are omitted from API requests. However, any field with an
  4770. // empty value appearing in NullFields will be sent to the server as
  4771. // null. It is an error if a field in this list has a non-empty value.
  4772. // This may be used to include null fields in Patch requests.
  4773. NullFields []string `json:"-"`
  4774. }
  4775. func (s *GoogleCloudVisionV1p2beta1NormalizedVertex) MarshalJSON() ([]byte, error) {
  4776. type NoMethod GoogleCloudVisionV1p2beta1NormalizedVertex
  4777. raw := NoMethod(*s)
  4778. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4779. }
  4780. func (s *GoogleCloudVisionV1p2beta1NormalizedVertex) UnmarshalJSON(data []byte) error {
  4781. type NoMethod GoogleCloudVisionV1p2beta1NormalizedVertex
  4782. var s1 struct {
  4783. X gensupport.JSONFloat64 `json:"x"`
  4784. Y gensupport.JSONFloat64 `json:"y"`
  4785. *NoMethod
  4786. }
  4787. s1.NoMethod = (*NoMethod)(s)
  4788. if err := json.Unmarshal(data, &s1); err != nil {
  4789. return err
  4790. }
  4791. s.X = float64(s1.X)
  4792. s.Y = float64(s1.Y)
  4793. return nil
  4794. }
  4795. // GoogleCloudVisionV1p2beta1OperationMetadata: Contains metadata for
  4796. // the BatchAnnotateImages operation.
  4797. type GoogleCloudVisionV1p2beta1OperationMetadata struct {
  4798. // CreateTime: The time when the batch request was received.
  4799. CreateTime string `json:"createTime,omitempty"`
  4800. // State: Current state of the batch operation.
  4801. //
  4802. // Possible values:
  4803. // "STATE_UNSPECIFIED" - Invalid.
  4804. // "CREATED" - Request is received.
  4805. // "RUNNING" - Request is actively being processed.
  4806. // "DONE" - The batch processing is done.
  4807. // "CANCELLED" - The batch processing was cancelled.
  4808. State string `json:"state,omitempty"`
  4809. // UpdateTime: The time when the operation result was last updated.
  4810. UpdateTime string `json:"updateTime,omitempty"`
  4811. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  4812. // unconditionally include in API requests. By default, fields with
  4813. // empty values are omitted from API requests. However, any non-pointer,
  4814. // non-interface field appearing in ForceSendFields will be sent to the
  4815. // server regardless of whether the field is empty or not. This may be
  4816. // used to include empty fields in Patch requests.
  4817. ForceSendFields []string `json:"-"`
  4818. // NullFields is a list of field names (e.g. "CreateTime") to include in
  4819. // API requests with the JSON null value. By default, fields with empty
  4820. // values are omitted from API requests. However, any field with an
  4821. // empty value appearing in NullFields will be sent to the server as
  4822. // null. It is an error if a field in this list has a non-empty value.
  4823. // This may be used to include null fields in Patch requests.
  4824. NullFields []string `json:"-"`
  4825. }
  4826. func (s *GoogleCloudVisionV1p2beta1OperationMetadata) MarshalJSON() ([]byte, error) {
  4827. type NoMethod GoogleCloudVisionV1p2beta1OperationMetadata
  4828. raw := NoMethod(*s)
  4829. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4830. }
  4831. // GoogleCloudVisionV1p2beta1OutputConfig: The desired output location
  4832. // and metadata.
  4833. type GoogleCloudVisionV1p2beta1OutputConfig struct {
  4834. // BatchSize: The max number of response protos to put into each output
  4835. // JSON file on
  4836. // Google Cloud Storage.
  4837. // The valid range is [1, 100]. If not specified, the default value is
  4838. // 20.
  4839. //
  4840. // For example, for one pdf file with 100 pages, 100 response protos
  4841. // will
  4842. // be generated. If `batch_size` = 20, then 5 json files each
  4843. // containing 20 response protos will be written under the
  4844. // prefix
  4845. // `gcs_destination`.`uri`.
  4846. //
  4847. // Currently, batch_size only applies to GcsDestination, with potential
  4848. // future
  4849. // support for other output configurations.
  4850. BatchSize int64 `json:"batchSize,omitempty"`
  4851. // GcsDestination: The Google Cloud Storage location to write the
  4852. // output(s) to.
  4853. GcsDestination *GoogleCloudVisionV1p2beta1GcsDestination `json:"gcsDestination,omitempty"`
  4854. // ForceSendFields is a list of field names (e.g. "BatchSize") to
  4855. // unconditionally include in API requests. By default, fields with
  4856. // empty values are omitted from API requests. However, any non-pointer,
  4857. // non-interface field appearing in ForceSendFields will be sent to the
  4858. // server regardless of whether the field is empty or not. This may be
  4859. // used to include empty fields in Patch requests.
  4860. ForceSendFields []string `json:"-"`
  4861. // NullFields is a list of field names (e.g. "BatchSize") to include in
  4862. // API requests with the JSON null value. By default, fields with empty
  4863. // values are omitted from API requests. However, any field with an
  4864. // empty value appearing in NullFields will be sent to the server as
  4865. // null. It is an error if a field in this list has a non-empty value.
  4866. // This may be used to include null fields in Patch requests.
  4867. NullFields []string `json:"-"`
  4868. }
  4869. func (s *GoogleCloudVisionV1p2beta1OutputConfig) MarshalJSON() ([]byte, error) {
  4870. type NoMethod GoogleCloudVisionV1p2beta1OutputConfig
  4871. raw := NoMethod(*s)
  4872. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4873. }
  4874. // GoogleCloudVisionV1p2beta1Page: Detected page from OCR.
  4875. type GoogleCloudVisionV1p2beta1Page struct {
  4876. // Blocks: List of blocks of text, images etc on this page.
  4877. Blocks []*GoogleCloudVisionV1p2beta1Block `json:"blocks,omitempty"`
  4878. // Confidence: Confidence of the OCR results on the page. Range [0, 1].
  4879. Confidence float64 `json:"confidence,omitempty"`
  4880. // Height: Page height. For PDFs the unit is points. For images
  4881. // (including
  4882. // TIFFs) the unit is pixels.
  4883. Height int64 `json:"height,omitempty"`
  4884. // Property: Additional information detected on the page.
  4885. Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"`
  4886. // Width: Page width. For PDFs the unit is points. For images
  4887. // (including
  4888. // TIFFs) the unit is pixels.
  4889. Width int64 `json:"width,omitempty"`
  4890. // ForceSendFields is a list of field names (e.g. "Blocks") to
  4891. // unconditionally include in API requests. By default, fields with
  4892. // empty values are omitted from API requests. However, any non-pointer,
  4893. // non-interface field appearing in ForceSendFields will be sent to the
  4894. // server regardless of whether the field is empty or not. This may be
  4895. // used to include empty fields in Patch requests.
  4896. ForceSendFields []string `json:"-"`
  4897. // NullFields is a list of field names (e.g. "Blocks") to include in API
  4898. // requests with the JSON null value. By default, fields with empty
  4899. // values are omitted from API requests. However, any field with an
  4900. // empty value appearing in NullFields will be sent to the server as
  4901. // null. It is an error if a field in this list has a non-empty value.
  4902. // This may be used to include null fields in Patch requests.
  4903. NullFields []string `json:"-"`
  4904. }
  4905. func (s *GoogleCloudVisionV1p2beta1Page) MarshalJSON() ([]byte, error) {
  4906. type NoMethod GoogleCloudVisionV1p2beta1Page
  4907. raw := NoMethod(*s)
  4908. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4909. }
  4910. func (s *GoogleCloudVisionV1p2beta1Page) UnmarshalJSON(data []byte) error {
  4911. type NoMethod GoogleCloudVisionV1p2beta1Page
  4912. var s1 struct {
  4913. Confidence gensupport.JSONFloat64 `json:"confidence"`
  4914. *NoMethod
  4915. }
  4916. s1.NoMethod = (*NoMethod)(s)
  4917. if err := json.Unmarshal(data, &s1); err != nil {
  4918. return err
  4919. }
  4920. s.Confidence = float64(s1.Confidence)
  4921. return nil
  4922. }
  4923. // GoogleCloudVisionV1p2beta1Paragraph: Structural unit of text
  4924. // representing a number of words in certain order.
  4925. type GoogleCloudVisionV1p2beta1Paragraph struct {
  4926. // BoundingBox: The bounding box for the paragraph.
  4927. // The vertices are in the order of top-left, top-right,
  4928. // bottom-right,
  4929. // bottom-left. When a rotation of the bounding box is detected the
  4930. // rotation
  4931. // is represented as around the top-left corner as defined when the text
  4932. // is
  4933. // read in the 'natural' orientation.
  4934. // For example:
  4935. // * when the text is horizontal it might look like:
  4936. // 0----1
  4937. // | |
  4938. // 3----2
  4939. // * when it's rotated 180 degrees around the top-left corner it
  4940. // becomes:
  4941. // 2----3
  4942. // | |
  4943. // 1----0
  4944. // and the vertex order will still be (0, 1, 2, 3).
  4945. BoundingBox *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingBox,omitempty"`
  4946. // Confidence: Confidence of the OCR results for the paragraph. Range
  4947. // [0, 1].
  4948. Confidence float64 `json:"confidence,omitempty"`
  4949. // Property: Additional information detected for the paragraph.
  4950. Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"`
  4951. // Words: List of words in this paragraph.
  4952. Words []*GoogleCloudVisionV1p2beta1Word `json:"words,omitempty"`
  4953. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  4954. // unconditionally include in API requests. By default, fields with
  4955. // empty values are omitted from API requests. However, any non-pointer,
  4956. // non-interface field appearing in ForceSendFields will be sent to the
  4957. // server regardless of whether the field is empty or not. This may be
  4958. // used to include empty fields in Patch requests.
  4959. ForceSendFields []string `json:"-"`
  4960. // NullFields is a list of field names (e.g. "BoundingBox") to include
  4961. // in API requests with the JSON null value. By default, fields with
  4962. // empty values are omitted from API requests. However, any field with
  4963. // an empty value appearing in NullFields will be sent to the server as
  4964. // null. It is an error if a field in this list has a non-empty value.
  4965. // This may be used to include null fields in Patch requests.
  4966. NullFields []string `json:"-"`
  4967. }
  4968. func (s *GoogleCloudVisionV1p2beta1Paragraph) MarshalJSON() ([]byte, error) {
  4969. type NoMethod GoogleCloudVisionV1p2beta1Paragraph
  4970. raw := NoMethod(*s)
  4971. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4972. }
  4973. func (s *GoogleCloudVisionV1p2beta1Paragraph) UnmarshalJSON(data []byte) error {
  4974. type NoMethod GoogleCloudVisionV1p2beta1Paragraph
  4975. var s1 struct {
  4976. Confidence gensupport.JSONFloat64 `json:"confidence"`
  4977. *NoMethod
  4978. }
  4979. s1.NoMethod = (*NoMethod)(s)
  4980. if err := json.Unmarshal(data, &s1); err != nil {
  4981. return err
  4982. }
  4983. s.Confidence = float64(s1.Confidence)
  4984. return nil
  4985. }
  4986. // GoogleCloudVisionV1p2beta1Position: A 3D position in the image, used
  4987. // primarily for Face detection landmarks.
  4988. // A valid Position must have both x and y coordinates.
  4989. // The position coordinates are in the same scale as the original image.
  4990. type GoogleCloudVisionV1p2beta1Position struct {
  4991. // X: X coordinate.
  4992. X float64 `json:"x,omitempty"`
  4993. // Y: Y coordinate.
  4994. Y float64 `json:"y,omitempty"`
  4995. // Z: Z coordinate (or depth).
  4996. Z float64 `json:"z,omitempty"`
  4997. // ForceSendFields is a list of field names (e.g. "X") to
  4998. // unconditionally include in API requests. By default, fields with
  4999. // empty values are omitted from API requests. However, any non-pointer,
  5000. // non-interface field appearing in ForceSendFields will be sent to the
  5001. // server regardless of whether the field is empty or not. This may be
  5002. // used to include empty fields in Patch requests.
  5003. ForceSendFields []string `json:"-"`
  5004. // NullFields is a list of field names (e.g. "X") to include in API
  5005. // requests with the JSON null value. By default, fields with empty
  5006. // values are omitted from API requests. However, any field with an
  5007. // empty value appearing in NullFields will be sent to the server as
  5008. // null. It is an error if a field in this list has a non-empty value.
  5009. // This may be used to include null fields in Patch requests.
  5010. NullFields []string `json:"-"`
  5011. }
  5012. func (s *GoogleCloudVisionV1p2beta1Position) MarshalJSON() ([]byte, error) {
  5013. type NoMethod GoogleCloudVisionV1p2beta1Position
  5014. raw := NoMethod(*s)
  5015. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5016. }
  5017. func (s *GoogleCloudVisionV1p2beta1Position) UnmarshalJSON(data []byte) error {
  5018. type NoMethod GoogleCloudVisionV1p2beta1Position
  5019. var s1 struct {
  5020. X gensupport.JSONFloat64 `json:"x"`
  5021. Y gensupport.JSONFloat64 `json:"y"`
  5022. Z gensupport.JSONFloat64 `json:"z"`
  5023. *NoMethod
  5024. }
  5025. s1.NoMethod = (*NoMethod)(s)
  5026. if err := json.Unmarshal(data, &s1); err != nil {
  5027. return err
  5028. }
  5029. s.X = float64(s1.X)
  5030. s.Y = float64(s1.Y)
  5031. s.Z = float64(s1.Z)
  5032. return nil
  5033. }
  5034. // GoogleCloudVisionV1p2beta1Product: A Product contains
  5035. // ReferenceImages.
  5036. type GoogleCloudVisionV1p2beta1Product struct {
  5037. // Description: User-provided metadata to be stored with this product.
  5038. // Must be at most 4096
  5039. // characters long.
  5040. Description string `json:"description,omitempty"`
  5041. // DisplayName: The user-provided name for this Product. Must not be
  5042. // empty. Must be at most
  5043. // 4096 characters long.
  5044. DisplayName string `json:"displayName,omitempty"`
  5045. // Name: The resource name of the product.
  5046. //
  5047. // Format
  5048. // is:
  5049. // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
  5050. //
  5051. // This field is ignored when creating a product.
  5052. Name string `json:"name,omitempty"`
  5053. // ProductCategory: The category for the product identified by the
  5054. // reference image. This should
  5055. // be either "homegoods", "apparel", or "toys".
  5056. //
  5057. // This field is immutable.
  5058. ProductCategory string `json:"productCategory,omitempty"`
  5059. // ProductLabels: Key-value pairs that can be attached to a product. At
  5060. // query time,
  5061. // constraints can be specified based on the product_labels.
  5062. //
  5063. // Note that integer values can be provided as strings, e.g. "1199".
  5064. // Only
  5065. // strings with integer values can match a range-based restriction which
  5066. // is
  5067. // to be supported soon.
  5068. //
  5069. // Multiple values can be assigned to the same key. One product may have
  5070. // up to
  5071. // 100 product_labels.
  5072. ProductLabels []*GoogleCloudVisionV1p2beta1ProductKeyValue `json:"productLabels,omitempty"`
  5073. // ForceSendFields is a list of field names (e.g. "Description") to
  5074. // unconditionally include in API requests. By default, fields with
  5075. // empty values are omitted from API requests. However, any non-pointer,
  5076. // non-interface field appearing in ForceSendFields will be sent to the
  5077. // server regardless of whether the field is empty or not. This may be
  5078. // used to include empty fields in Patch requests.
  5079. ForceSendFields []string `json:"-"`
  5080. // NullFields is a list of field names (e.g. "Description") to include
  5081. // in API requests with the JSON null value. By default, fields with
  5082. // empty values are omitted from API requests. However, any field with
  5083. // an empty value appearing in NullFields will be sent to the server as
  5084. // null. It is an error if a field in this list has a non-empty value.
  5085. // This may be used to include null fields in Patch requests.
  5086. NullFields []string `json:"-"`
  5087. }
  5088. func (s *GoogleCloudVisionV1p2beta1Product) MarshalJSON() ([]byte, error) {
  5089. type NoMethod GoogleCloudVisionV1p2beta1Product
  5090. raw := NoMethod(*s)
  5091. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5092. }
  5093. // GoogleCloudVisionV1p2beta1ProductKeyValue: A product label
  5094. // represented as a key-value pair.
  5095. type GoogleCloudVisionV1p2beta1ProductKeyValue struct {
  5096. // Key: The key of the label attached to the product. Cannot be empty
  5097. // and cannot
  5098. // exceed 128 bytes.
  5099. Key string `json:"key,omitempty"`
  5100. // Value: The value of the label attached to the product. Cannot be
  5101. // empty and
  5102. // cannot exceed 128 bytes.
  5103. Value string `json:"value,omitempty"`
  5104. // ForceSendFields is a list of field names (e.g. "Key") to
  5105. // unconditionally include in API requests. By default, fields with
  5106. // empty values are omitted from API requests. However, any non-pointer,
  5107. // non-interface field appearing in ForceSendFields will be sent to the
  5108. // server regardless of whether the field is empty or not. This may be
  5109. // used to include empty fields in Patch requests.
  5110. ForceSendFields []string `json:"-"`
  5111. // NullFields is a list of field names (e.g. "Key") to include in API
  5112. // requests with the JSON null value. By default, fields with empty
  5113. // values are omitted from API requests. However, any field with an
  5114. // empty value appearing in NullFields will be sent to the server as
  5115. // null. It is an error if a field in this list has a non-empty value.
  5116. // This may be used to include null fields in Patch requests.
  5117. NullFields []string `json:"-"`
  5118. }
  5119. func (s *GoogleCloudVisionV1p2beta1ProductKeyValue) MarshalJSON() ([]byte, error) {
  5120. type NoMethod GoogleCloudVisionV1p2beta1ProductKeyValue
  5121. raw := NoMethod(*s)
  5122. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5123. }
  5124. // GoogleCloudVisionV1p2beta1ProductSearchParams: Parameters for a
  5125. // product search request.
  5126. type GoogleCloudVisionV1p2beta1ProductSearchParams struct {
  5127. // BoundingPoly: The bounding polygon around the area of interest in the
  5128. // image.
  5129. // Optional. If it is not specified, system discretion will be applied.
  5130. BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"`
  5131. // Filter: The filtering expression. This can be used to restrict search
  5132. // results based
  5133. // on Product labels. We currently support an AND of OR of
  5134. // key-value
  5135. // expressions, where each expression within an OR must have the same
  5136. // key.
  5137. //
  5138. // For example, "(color = red OR color = blue) AND brand = Google"
  5139. // is
  5140. // acceptable, but not "(color = red OR brand = Google)" or "color:
  5141. // red".
  5142. Filter string `json:"filter,omitempty"`
  5143. // ProductCategories: The list of product categories to search in.
  5144. // Currently, we only consider
  5145. // the first category, and either "homegoods", "apparel", or "toys"
  5146. // should be
  5147. // specified.
  5148. ProductCategories []string `json:"productCategories,omitempty"`
  5149. // ProductSet: The resource name of a ProductSet to be searched for
  5150. // similar images.
  5151. //
  5152. // Format
  5153. // is:
  5154. // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
  5155. ProductSet string `json:"productSet,omitempty"`
  5156. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  5157. // unconditionally include in API requests. By default, fields with
  5158. // empty values are omitted from API requests. However, any non-pointer,
  5159. // non-interface field appearing in ForceSendFields will be sent to the
  5160. // server regardless of whether the field is empty or not. This may be
  5161. // used to include empty fields in Patch requests.
  5162. ForceSendFields []string `json:"-"`
  5163. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  5164. // in API requests with the JSON null value. By default, fields with
  5165. // empty values are omitted from API requests. However, any field with
  5166. // an empty value appearing in NullFields will be sent to the server as
  5167. // null. It is an error if a field in this list has a non-empty value.
  5168. // This may be used to include null fields in Patch requests.
  5169. NullFields []string `json:"-"`
  5170. }
  5171. func (s *GoogleCloudVisionV1p2beta1ProductSearchParams) MarshalJSON() ([]byte, error) {
  5172. type NoMethod GoogleCloudVisionV1p2beta1ProductSearchParams
  5173. raw := NoMethod(*s)
  5174. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5175. }
  5176. // GoogleCloudVisionV1p2beta1ProductSearchResults: Results for a product
  5177. // search request.
  5178. type GoogleCloudVisionV1p2beta1ProductSearchResults struct {
  5179. // IndexTime: Timestamp of the index which provided these results.
  5180. // Changes made after
  5181. // this time are not reflected in the current results.
  5182. IndexTime string `json:"indexTime,omitempty"`
  5183. // ProductGroupedResults: List of results grouped by products detected
  5184. // in the query image. Each entry
  5185. // corresponds to one bounding polygon in the query image, and contains
  5186. // the
  5187. // matching products specific to that region. There may be duplicate
  5188. // product
  5189. // matches in the union of all the per-product results.
  5190. ProductGroupedResults []*GoogleCloudVisionV1p2beta1ProductSearchResultsGroupedResult `json:"productGroupedResults,omitempty"`
  5191. // Results: List of results, one for each product match.
  5192. Results []*GoogleCloudVisionV1p2beta1ProductSearchResultsResult `json:"results,omitempty"`
  5193. // ForceSendFields is a list of field names (e.g. "IndexTime") to
  5194. // unconditionally include in API requests. By default, fields with
  5195. // empty values are omitted from API requests. However, any non-pointer,
  5196. // non-interface field appearing in ForceSendFields will be sent to the
  5197. // server regardless of whether the field is empty or not. This may be
  5198. // used to include empty fields in Patch requests.
  5199. ForceSendFields []string `json:"-"`
  5200. // NullFields is a list of field names (e.g. "IndexTime") to include in
  5201. // API requests with the JSON null value. By default, fields with empty
  5202. // values are omitted from API requests. However, any field with an
  5203. // empty value appearing in NullFields will be sent to the server as
  5204. // null. It is an error if a field in this list has a non-empty value.
  5205. // This may be used to include null fields in Patch requests.
  5206. NullFields []string `json:"-"`
  5207. }
  5208. func (s *GoogleCloudVisionV1p2beta1ProductSearchResults) MarshalJSON() ([]byte, error) {
  5209. type NoMethod GoogleCloudVisionV1p2beta1ProductSearchResults
  5210. raw := NoMethod(*s)
  5211. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5212. }
  5213. // GoogleCloudVisionV1p2beta1ProductSearchResultsGroupedResult:
  5214. // Information about the products similar to a single product in a
  5215. // query
  5216. // image.
  5217. type GoogleCloudVisionV1p2beta1ProductSearchResultsGroupedResult struct {
  5218. // BoundingPoly: The bounding polygon around the product detected in the
  5219. // query image.
  5220. BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"`
  5221. // Results: List of results, one for each product match.
  5222. Results []*GoogleCloudVisionV1p2beta1ProductSearchResultsResult `json:"results,omitempty"`
  5223. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  5224. // unconditionally include in API requests. By default, fields with
  5225. // empty values are omitted from API requests. However, any non-pointer,
  5226. // non-interface field appearing in ForceSendFields will be sent to the
  5227. // server regardless of whether the field is empty or not. This may be
  5228. // used to include empty fields in Patch requests.
  5229. ForceSendFields []string `json:"-"`
  5230. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  5231. // in API requests with the JSON null value. By default, fields with
  5232. // empty values are omitted from API requests. However, any field with
  5233. // an empty value appearing in NullFields will be sent to the server as
  5234. // null. It is an error if a field in this list has a non-empty value.
  5235. // This may be used to include null fields in Patch requests.
  5236. NullFields []string `json:"-"`
  5237. }
  5238. func (s *GoogleCloudVisionV1p2beta1ProductSearchResultsGroupedResult) MarshalJSON() ([]byte, error) {
  5239. type NoMethod GoogleCloudVisionV1p2beta1ProductSearchResultsGroupedResult
  5240. raw := NoMethod(*s)
  5241. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5242. }
  5243. // GoogleCloudVisionV1p2beta1ProductSearchResultsResult: Information
  5244. // about a product.
  5245. type GoogleCloudVisionV1p2beta1ProductSearchResultsResult struct {
  5246. // Image: The resource name of the image from the product that is the
  5247. // closest match
  5248. // to the query.
  5249. Image string `json:"image,omitempty"`
  5250. // Product: The Product.
  5251. Product *GoogleCloudVisionV1p2beta1Product `json:"product,omitempty"`
  5252. // Score: A confidence level on the match, ranging from 0 (no
  5253. // confidence) to
  5254. // 1 (full confidence).
  5255. Score float64 `json:"score,omitempty"`
  5256. // ForceSendFields is a list of field names (e.g. "Image") to
  5257. // unconditionally include in API requests. By default, fields with
  5258. // empty values are omitted from API requests. However, any non-pointer,
  5259. // non-interface field appearing in ForceSendFields will be sent to the
  5260. // server regardless of whether the field is empty or not. This may be
  5261. // used to include empty fields in Patch requests.
  5262. ForceSendFields []string `json:"-"`
  5263. // NullFields is a list of field names (e.g. "Image") to include in API
  5264. // requests with the JSON null value. By default, fields with empty
  5265. // values are omitted from API requests. However, any field with an
  5266. // empty value appearing in NullFields will be sent to the server as
  5267. // null. It is an error if a field in this list has a non-empty value.
  5268. // This may be used to include null fields in Patch requests.
  5269. NullFields []string `json:"-"`
  5270. }
  5271. func (s *GoogleCloudVisionV1p2beta1ProductSearchResultsResult) MarshalJSON() ([]byte, error) {
  5272. type NoMethod GoogleCloudVisionV1p2beta1ProductSearchResultsResult
  5273. raw := NoMethod(*s)
  5274. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5275. }
  5276. func (s *GoogleCloudVisionV1p2beta1ProductSearchResultsResult) UnmarshalJSON(data []byte) error {
  5277. type NoMethod GoogleCloudVisionV1p2beta1ProductSearchResultsResult
  5278. var s1 struct {
  5279. Score gensupport.JSONFloat64 `json:"score"`
  5280. *NoMethod
  5281. }
  5282. s1.NoMethod = (*NoMethod)(s)
  5283. if err := json.Unmarshal(data, &s1); err != nil {
  5284. return err
  5285. }
  5286. s.Score = float64(s1.Score)
  5287. return nil
  5288. }
  5289. // GoogleCloudVisionV1p2beta1Property: A `Property` consists of a
  5290. // user-supplied name/value pair.
  5291. type GoogleCloudVisionV1p2beta1Property struct {
  5292. // Name: Name of the property.
  5293. Name string `json:"name,omitempty"`
  5294. // Uint64Value: Value of numeric properties.
  5295. Uint64Value uint64 `json:"uint64Value,omitempty,string"`
  5296. // Value: Value of the property.
  5297. Value string `json:"value,omitempty"`
  5298. // ForceSendFields is a list of field names (e.g. "Name") to
  5299. // unconditionally include in API requests. By default, fields with
  5300. // empty values are omitted from API requests. However, any non-pointer,
  5301. // non-interface field appearing in ForceSendFields will be sent to the
  5302. // server regardless of whether the field is empty or not. This may be
  5303. // used to include empty fields in Patch requests.
  5304. ForceSendFields []string `json:"-"`
  5305. // NullFields is a list of field names (e.g. "Name") to include in API
  5306. // requests with the JSON null value. By default, fields with empty
  5307. // values are omitted from API requests. However, any field with an
  5308. // empty value appearing in NullFields will be sent to the server as
  5309. // null. It is an error if a field in this list has a non-empty value.
  5310. // This may be used to include null fields in Patch requests.
  5311. NullFields []string `json:"-"`
  5312. }
  5313. func (s *GoogleCloudVisionV1p2beta1Property) MarshalJSON() ([]byte, error) {
  5314. type NoMethod GoogleCloudVisionV1p2beta1Property
  5315. raw := NoMethod(*s)
  5316. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5317. }
  5318. // GoogleCloudVisionV1p2beta1SafeSearchAnnotation: Set of features
  5319. // pertaining to the image, computed by computer vision
  5320. // methods over safe-search verticals (for example, adult, spoof,
  5321. // medical,
  5322. // violence).
  5323. type GoogleCloudVisionV1p2beta1SafeSearchAnnotation struct {
  5324. // Adult: Represents the adult content likelihood for the image. Adult
  5325. // content may
  5326. // contain elements such as nudity, pornographic images or cartoons,
  5327. // or
  5328. // sexual activities.
  5329. //
  5330. // Possible values:
  5331. // "UNKNOWN" - Unknown likelihood.
  5332. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  5333. // specified vertical.
  5334. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  5335. // vertical.
  5336. // "POSSIBLE" - It is possible that the image belongs to the specified
  5337. // vertical.
  5338. // "LIKELY" - It is likely that the image belongs to the specified
  5339. // vertical.
  5340. // "VERY_LIKELY" - It is very likely that the image belongs to the
  5341. // specified vertical.
  5342. Adult string `json:"adult,omitempty"`
  5343. // Medical: Likelihood that this is a medical image.
  5344. //
  5345. // Possible values:
  5346. // "UNKNOWN" - Unknown likelihood.
  5347. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  5348. // specified vertical.
  5349. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  5350. // vertical.
  5351. // "POSSIBLE" - It is possible that the image belongs to the specified
  5352. // vertical.
  5353. // "LIKELY" - It is likely that the image belongs to the specified
  5354. // vertical.
  5355. // "VERY_LIKELY" - It is very likely that the image belongs to the
  5356. // specified vertical.
  5357. Medical string `json:"medical,omitempty"`
  5358. // Racy: Likelihood that the request image contains racy content. Racy
  5359. // content may
  5360. // include (but is not limited to) skimpy or sheer clothing,
  5361. // strategically
  5362. // covered nudity, lewd or provocative poses, or close-ups of
  5363. // sensitive
  5364. // body areas.
  5365. //
  5366. // Possible values:
  5367. // "UNKNOWN" - Unknown likelihood.
  5368. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  5369. // specified vertical.
  5370. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  5371. // vertical.
  5372. // "POSSIBLE" - It is possible that the image belongs to the specified
  5373. // vertical.
  5374. // "LIKELY" - It is likely that the image belongs to the specified
  5375. // vertical.
  5376. // "VERY_LIKELY" - It is very likely that the image belongs to the
  5377. // specified vertical.
  5378. Racy string `json:"racy,omitempty"`
  5379. // Spoof: Spoof likelihood. The likelihood that an modification
  5380. // was made to the image's canonical version to make it appear
  5381. // funny or offensive.
  5382. //
  5383. // Possible values:
  5384. // "UNKNOWN" - Unknown likelihood.
  5385. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  5386. // specified vertical.
  5387. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  5388. // vertical.
  5389. // "POSSIBLE" - It is possible that the image belongs to the specified
  5390. // vertical.
  5391. // "LIKELY" - It is likely that the image belongs to the specified
  5392. // vertical.
  5393. // "VERY_LIKELY" - It is very likely that the image belongs to the
  5394. // specified vertical.
  5395. Spoof string `json:"spoof,omitempty"`
  5396. // Violence: Likelihood that this image contains violent content.
  5397. //
  5398. // Possible values:
  5399. // "UNKNOWN" - Unknown likelihood.
  5400. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  5401. // specified vertical.
  5402. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  5403. // vertical.
  5404. // "POSSIBLE" - It is possible that the image belongs to the specified
  5405. // vertical.
  5406. // "LIKELY" - It is likely that the image belongs to the specified
  5407. // vertical.
  5408. // "VERY_LIKELY" - It is very likely that the image belongs to the
  5409. // specified vertical.
  5410. Violence string `json:"violence,omitempty"`
  5411. // ForceSendFields is a list of field names (e.g. "Adult") to
  5412. // unconditionally include in API requests. By default, fields with
  5413. // empty values are omitted from API requests. However, any non-pointer,
  5414. // non-interface field appearing in ForceSendFields will be sent to the
  5415. // server regardless of whether the field is empty or not. This may be
  5416. // used to include empty fields in Patch requests.
  5417. ForceSendFields []string `json:"-"`
  5418. // NullFields is a list of field names (e.g. "Adult") to include in API
  5419. // requests with the JSON null value. By default, fields with empty
  5420. // values are omitted from API requests. However, any field with an
  5421. // empty value appearing in NullFields will be sent to the server as
  5422. // null. It is an error if a field in this list has a non-empty value.
  5423. // This may be used to include null fields in Patch requests.
  5424. NullFields []string `json:"-"`
  5425. }
  5426. func (s *GoogleCloudVisionV1p2beta1SafeSearchAnnotation) MarshalJSON() ([]byte, error) {
  5427. type NoMethod GoogleCloudVisionV1p2beta1SafeSearchAnnotation
  5428. raw := NoMethod(*s)
  5429. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5430. }
  5431. // GoogleCloudVisionV1p2beta1Symbol: A single symbol representation.
  5432. type GoogleCloudVisionV1p2beta1Symbol struct {
  5433. // BoundingBox: The bounding box for the symbol.
  5434. // The vertices are in the order of top-left, top-right,
  5435. // bottom-right,
  5436. // bottom-left. When a rotation of the bounding box is detected the
  5437. // rotation
  5438. // is represented as around the top-left corner as defined when the text
  5439. // is
  5440. // read in the 'natural' orientation.
  5441. // For example:
  5442. // * when the text is horizontal it might look like:
  5443. // 0----1
  5444. // | |
  5445. // 3----2
  5446. // * when it's rotated 180 degrees around the top-left corner it
  5447. // becomes:
  5448. // 2----3
  5449. // | |
  5450. // 1----0
  5451. // and the vertice order will still be (0, 1, 2, 3).
  5452. BoundingBox *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingBox,omitempty"`
  5453. // Confidence: Confidence of the OCR results for the symbol. Range [0,
  5454. // 1].
  5455. Confidence float64 `json:"confidence,omitempty"`
  5456. // Property: Additional information detected for the symbol.
  5457. Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"`
  5458. // Text: The actual UTF-8 representation of the symbol.
  5459. Text string `json:"text,omitempty"`
  5460. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  5461. // unconditionally include in API requests. By default, fields with
  5462. // empty values are omitted from API requests. However, any non-pointer,
  5463. // non-interface field appearing in ForceSendFields will be sent to the
  5464. // server regardless of whether the field is empty or not. This may be
  5465. // used to include empty fields in Patch requests.
  5466. ForceSendFields []string `json:"-"`
  5467. // NullFields is a list of field names (e.g. "BoundingBox") to include
  5468. // in API requests with the JSON null value. By default, fields with
  5469. // empty values are omitted from API requests. However, any field with
  5470. // an empty value appearing in NullFields will be sent to the server as
  5471. // null. It is an error if a field in this list has a non-empty value.
  5472. // This may be used to include null fields in Patch requests.
  5473. NullFields []string `json:"-"`
  5474. }
  5475. func (s *GoogleCloudVisionV1p2beta1Symbol) MarshalJSON() ([]byte, error) {
  5476. type NoMethod GoogleCloudVisionV1p2beta1Symbol
  5477. raw := NoMethod(*s)
  5478. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5479. }
  5480. func (s *GoogleCloudVisionV1p2beta1Symbol) UnmarshalJSON(data []byte) error {
  5481. type NoMethod GoogleCloudVisionV1p2beta1Symbol
  5482. var s1 struct {
  5483. Confidence gensupport.JSONFloat64 `json:"confidence"`
  5484. *NoMethod
  5485. }
  5486. s1.NoMethod = (*NoMethod)(s)
  5487. if err := json.Unmarshal(data, &s1); err != nil {
  5488. return err
  5489. }
  5490. s.Confidence = float64(s1.Confidence)
  5491. return nil
  5492. }
  5493. // GoogleCloudVisionV1p2beta1TextAnnotation: TextAnnotation contains a
  5494. // structured representation of OCR extracted text.
  5495. // The hierarchy of an OCR extracted text structure is like this:
  5496. // TextAnnotation -> Page -> Block -> Paragraph -> Word ->
  5497. // Symbol
  5498. // Each structural component, starting from Page, may further have their
  5499. // own
  5500. // properties. Properties describe detected languages, breaks etc..
  5501. // Please refer
  5502. // to the TextAnnotation.TextProperty message definition below for
  5503. // more
  5504. // detail.
  5505. type GoogleCloudVisionV1p2beta1TextAnnotation struct {
  5506. // Pages: List of pages detected by OCR.
  5507. Pages []*GoogleCloudVisionV1p2beta1Page `json:"pages,omitempty"`
  5508. // Text: UTF-8 text detected on the pages.
  5509. Text string `json:"text,omitempty"`
  5510. // ForceSendFields is a list of field names (e.g. "Pages") to
  5511. // unconditionally include in API requests. By default, fields with
  5512. // empty values are omitted from API requests. However, any non-pointer,
  5513. // non-interface field appearing in ForceSendFields will be sent to the
  5514. // server regardless of whether the field is empty or not. This may be
  5515. // used to include empty fields in Patch requests.
  5516. ForceSendFields []string `json:"-"`
  5517. // NullFields is a list of field names (e.g. "Pages") to include in API
  5518. // requests with the JSON null value. By default, fields with empty
  5519. // values are omitted from API requests. However, any field with an
  5520. // empty value appearing in NullFields will be sent to the server as
  5521. // null. It is an error if a field in this list has a non-empty value.
  5522. // This may be used to include null fields in Patch requests.
  5523. NullFields []string `json:"-"`
  5524. }
  5525. func (s *GoogleCloudVisionV1p2beta1TextAnnotation) MarshalJSON() ([]byte, error) {
  5526. type NoMethod GoogleCloudVisionV1p2beta1TextAnnotation
  5527. raw := NoMethod(*s)
  5528. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5529. }
  5530. // GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak: Detected start
  5531. // or end of a structural component.
  5532. type GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak struct {
  5533. // IsPrefix: True if break prepends the element.
  5534. IsPrefix bool `json:"isPrefix,omitempty"`
  5535. // Type: Detected break type.
  5536. //
  5537. // Possible values:
  5538. // "UNKNOWN" - Unknown break label type.
  5539. // "SPACE" - Regular space.
  5540. // "SURE_SPACE" - Sure space (very wide).
  5541. // "EOL_SURE_SPACE" - Line-wrapping break.
  5542. // "HYPHEN" - End-line hyphen that is not present in text; does not
  5543. // co-occur with
  5544. // `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`.
  5545. // "LINE_BREAK" - Line break that ends a paragraph.
  5546. Type string `json:"type,omitempty"`
  5547. // ForceSendFields is a list of field names (e.g. "IsPrefix") to
  5548. // unconditionally include in API requests. By default, fields with
  5549. // empty values are omitted from API requests. However, any non-pointer,
  5550. // non-interface field appearing in ForceSendFields will be sent to the
  5551. // server regardless of whether the field is empty or not. This may be
  5552. // used to include empty fields in Patch requests.
  5553. ForceSendFields []string `json:"-"`
  5554. // NullFields is a list of field names (e.g. "IsPrefix") to include in
  5555. // API requests with the JSON null value. By default, fields with empty
  5556. // values are omitted from API requests. However, any field with an
  5557. // empty value appearing in NullFields will be sent to the server as
  5558. // null. It is an error if a field in this list has a non-empty value.
  5559. // This may be used to include null fields in Patch requests.
  5560. NullFields []string `json:"-"`
  5561. }
  5562. func (s *GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak) MarshalJSON() ([]byte, error) {
  5563. type NoMethod GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak
  5564. raw := NoMethod(*s)
  5565. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5566. }
  5567. // GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage: Detected
  5568. // language for a structural component.
  5569. type GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage struct {
  5570. // Confidence: Confidence of detected language. Range [0, 1].
  5571. Confidence float64 `json:"confidence,omitempty"`
  5572. // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn".
  5573. // For more
  5574. // information,
  5575. // see
  5576. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  5577. LanguageCode string `json:"languageCode,omitempty"`
  5578. // ForceSendFields is a list of field names (e.g. "Confidence") to
  5579. // unconditionally include in API requests. By default, fields with
  5580. // empty values are omitted from API requests. However, any non-pointer,
  5581. // non-interface field appearing in ForceSendFields will be sent to the
  5582. // server regardless of whether the field is empty or not. This may be
  5583. // used to include empty fields in Patch requests.
  5584. ForceSendFields []string `json:"-"`
  5585. // NullFields is a list of field names (e.g. "Confidence") to include in
  5586. // API requests with the JSON null value. By default, fields with empty
  5587. // values are omitted from API requests. However, any field with an
  5588. // empty value appearing in NullFields will be sent to the server as
  5589. // null. It is an error if a field in this list has a non-empty value.
  5590. // This may be used to include null fields in Patch requests.
  5591. NullFields []string `json:"-"`
  5592. }
  5593. func (s *GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage) MarshalJSON() ([]byte, error) {
  5594. type NoMethod GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage
  5595. raw := NoMethod(*s)
  5596. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5597. }
  5598. func (s *GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage) UnmarshalJSON(data []byte) error {
  5599. type NoMethod GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage
  5600. var s1 struct {
  5601. Confidence gensupport.JSONFloat64 `json:"confidence"`
  5602. *NoMethod
  5603. }
  5604. s1.NoMethod = (*NoMethod)(s)
  5605. if err := json.Unmarshal(data, &s1); err != nil {
  5606. return err
  5607. }
  5608. s.Confidence = float64(s1.Confidence)
  5609. return nil
  5610. }
  5611. // GoogleCloudVisionV1p2beta1TextAnnotationTextProperty: Additional
  5612. // information detected on the structural component.
  5613. type GoogleCloudVisionV1p2beta1TextAnnotationTextProperty struct {
  5614. // DetectedBreak: Detected start or end of a text segment.
  5615. DetectedBreak *GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak `json:"detectedBreak,omitempty"`
  5616. // DetectedLanguages: A list of detected languages together with
  5617. // confidence.
  5618. DetectedLanguages []*GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage `json:"detectedLanguages,omitempty"`
  5619. // ForceSendFields is a list of field names (e.g. "DetectedBreak") to
  5620. // unconditionally include in API requests. By default, fields with
  5621. // empty values are omitted from API requests. However, any non-pointer,
  5622. // non-interface field appearing in ForceSendFields will be sent to the
  5623. // server regardless of whether the field is empty or not. This may be
  5624. // used to include empty fields in Patch requests.
  5625. ForceSendFields []string `json:"-"`
  5626. // NullFields is a list of field names (e.g. "DetectedBreak") to include
  5627. // in API requests with the JSON null value. By default, fields with
  5628. // empty values are omitted from API requests. However, any field with
  5629. // an empty value appearing in NullFields will be sent to the server as
  5630. // null. It is an error if a field in this list has a non-empty value.
  5631. // This may be used to include null fields in Patch requests.
  5632. NullFields []string `json:"-"`
  5633. }
  5634. func (s *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty) MarshalJSON() ([]byte, error) {
  5635. type NoMethod GoogleCloudVisionV1p2beta1TextAnnotationTextProperty
  5636. raw := NoMethod(*s)
  5637. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5638. }
  5639. // GoogleCloudVisionV1p2beta1Vertex: A vertex represents a 2D point in
  5640. // the image.
  5641. // NOTE: the vertex coordinates are in the same scale as the original
  5642. // image.
  5643. type GoogleCloudVisionV1p2beta1Vertex struct {
  5644. // X: X coordinate.
  5645. X int64 `json:"x,omitempty"`
  5646. // Y: Y coordinate.
  5647. Y int64 `json:"y,omitempty"`
  5648. // ForceSendFields is a list of field names (e.g. "X") to
  5649. // unconditionally include in API requests. By default, fields with
  5650. // empty values are omitted from API requests. However, any non-pointer,
  5651. // non-interface field appearing in ForceSendFields will be sent to the
  5652. // server regardless of whether the field is empty or not. This may be
  5653. // used to include empty fields in Patch requests.
  5654. ForceSendFields []string `json:"-"`
  5655. // NullFields is a list of field names (e.g. "X") to include in API
  5656. // requests with the JSON null value. By default, fields with empty
  5657. // values are omitted from API requests. However, any field with an
  5658. // empty value appearing in NullFields will be sent to the server as
  5659. // null. It is an error if a field in this list has a non-empty value.
  5660. // This may be used to include null fields in Patch requests.
  5661. NullFields []string `json:"-"`
  5662. }
  5663. func (s *GoogleCloudVisionV1p2beta1Vertex) MarshalJSON() ([]byte, error) {
  5664. type NoMethod GoogleCloudVisionV1p2beta1Vertex
  5665. raw := NoMethod(*s)
  5666. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5667. }
  5668. // GoogleCloudVisionV1p2beta1WebDetection: Relevant information for the
  5669. // image from the Internet.
  5670. type GoogleCloudVisionV1p2beta1WebDetection struct {
  5671. // BestGuessLabels: The service's best guess as to the topic of the
  5672. // request image.
  5673. // Inferred from similar images on the open web.
  5674. BestGuessLabels []*GoogleCloudVisionV1p2beta1WebDetectionWebLabel `json:"bestGuessLabels,omitempty"`
  5675. // FullMatchingImages: Fully matching images from the Internet.
  5676. // Can include resized copies of the query image.
  5677. FullMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"`
  5678. // PagesWithMatchingImages: Web pages containing the matching images
  5679. // from the Internet.
  5680. PagesWithMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebPage `json:"pagesWithMatchingImages,omitempty"`
  5681. // PartialMatchingImages: Partial matching images from the
  5682. // Internet.
  5683. // Those images are similar enough to share some key-point features.
  5684. // For
  5685. // example an original image will likely have partial matching for its
  5686. // crops.
  5687. PartialMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"`
  5688. // VisuallySimilarImages: The visually similar image results.
  5689. VisuallySimilarImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"visuallySimilarImages,omitempty"`
  5690. // WebEntities: Deduced entities from similar images on the Internet.
  5691. WebEntities []*GoogleCloudVisionV1p2beta1WebDetectionWebEntity `json:"webEntities,omitempty"`
  5692. // ForceSendFields is a list of field names (e.g. "BestGuessLabels") to
  5693. // unconditionally include in API requests. By default, fields with
  5694. // empty values are omitted from API requests. However, any non-pointer,
  5695. // non-interface field appearing in ForceSendFields will be sent to the
  5696. // server regardless of whether the field is empty or not. This may be
  5697. // used to include empty fields in Patch requests.
  5698. ForceSendFields []string `json:"-"`
  5699. // NullFields is a list of field names (e.g. "BestGuessLabels") to
  5700. // include in API requests with the JSON null value. By default, fields
  5701. // with empty values are omitted from API requests. However, any field
  5702. // with an empty value appearing in NullFields will be sent to the
  5703. // server as null. It is an error if a field in this list has a
  5704. // non-empty value. This may be used to include null fields in Patch
  5705. // requests.
  5706. NullFields []string `json:"-"`
  5707. }
  5708. func (s *GoogleCloudVisionV1p2beta1WebDetection) MarshalJSON() ([]byte, error) {
  5709. type NoMethod GoogleCloudVisionV1p2beta1WebDetection
  5710. raw := NoMethod(*s)
  5711. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5712. }
  5713. // GoogleCloudVisionV1p2beta1WebDetectionParams: Parameters for web
  5714. // detection request.
  5715. type GoogleCloudVisionV1p2beta1WebDetectionParams struct {
  5716. // IncludeGeoResults: Whether to include results derived from the geo
  5717. // information in the image.
  5718. IncludeGeoResults bool `json:"includeGeoResults,omitempty"`
  5719. // ForceSendFields is a list of field names (e.g. "IncludeGeoResults")
  5720. // to unconditionally include in API requests. By default, fields with
  5721. // empty values are omitted from API requests. However, any non-pointer,
  5722. // non-interface field appearing in ForceSendFields will be sent to the
  5723. // server regardless of whether the field is empty or not. This may be
  5724. // used to include empty fields in Patch requests.
  5725. ForceSendFields []string `json:"-"`
  5726. // NullFields is a list of field names (e.g. "IncludeGeoResults") to
  5727. // include in API requests with the JSON null value. By default, fields
  5728. // with empty values are omitted from API requests. However, any field
  5729. // with an empty value appearing in NullFields will be sent to the
  5730. // server as null. It is an error if a field in this list has a
  5731. // non-empty value. This may be used to include null fields in Patch
  5732. // requests.
  5733. NullFields []string `json:"-"`
  5734. }
  5735. func (s *GoogleCloudVisionV1p2beta1WebDetectionParams) MarshalJSON() ([]byte, error) {
  5736. type NoMethod GoogleCloudVisionV1p2beta1WebDetectionParams
  5737. raw := NoMethod(*s)
  5738. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5739. }
  5740. // GoogleCloudVisionV1p2beta1WebDetectionWebEntity: Entity deduced from
  5741. // similar images on the Internet.
  5742. type GoogleCloudVisionV1p2beta1WebDetectionWebEntity struct {
  5743. // Description: Canonical description of the entity, in English.
  5744. Description string `json:"description,omitempty"`
  5745. // EntityId: Opaque entity ID.
  5746. EntityId string `json:"entityId,omitempty"`
  5747. // Score: Overall relevancy score for the entity.
  5748. // Not normalized and not comparable across different image queries.
  5749. Score float64 `json:"score,omitempty"`
  5750. // ForceSendFields is a list of field names (e.g. "Description") to
  5751. // unconditionally include in API requests. By default, fields with
  5752. // empty values are omitted from API requests. However, any non-pointer,
  5753. // non-interface field appearing in ForceSendFields will be sent to the
  5754. // server regardless of whether the field is empty or not. This may be
  5755. // used to include empty fields in Patch requests.
  5756. ForceSendFields []string `json:"-"`
  5757. // NullFields is a list of field names (e.g. "Description") to include
  5758. // in API requests with the JSON null value. By default, fields with
  5759. // empty values are omitted from API requests. However, any field with
  5760. // an empty value appearing in NullFields will be sent to the server as
  5761. // null. It is an error if a field in this list has a non-empty value.
  5762. // This may be used to include null fields in Patch requests.
  5763. NullFields []string `json:"-"`
  5764. }
  5765. func (s *GoogleCloudVisionV1p2beta1WebDetectionWebEntity) MarshalJSON() ([]byte, error) {
  5766. type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebEntity
  5767. raw := NoMethod(*s)
  5768. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5769. }
  5770. func (s *GoogleCloudVisionV1p2beta1WebDetectionWebEntity) UnmarshalJSON(data []byte) error {
  5771. type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebEntity
  5772. var s1 struct {
  5773. Score gensupport.JSONFloat64 `json:"score"`
  5774. *NoMethod
  5775. }
  5776. s1.NoMethod = (*NoMethod)(s)
  5777. if err := json.Unmarshal(data, &s1); err != nil {
  5778. return err
  5779. }
  5780. s.Score = float64(s1.Score)
  5781. return nil
  5782. }
  5783. // GoogleCloudVisionV1p2beta1WebDetectionWebImage: Metadata for online
  5784. // images.
  5785. type GoogleCloudVisionV1p2beta1WebDetectionWebImage struct {
  5786. // Score: (Deprecated) Overall relevancy score for the image.
  5787. Score float64 `json:"score,omitempty"`
  5788. // Url: The result image URL.
  5789. Url string `json:"url,omitempty"`
  5790. // ForceSendFields is a list of field names (e.g. "Score") to
  5791. // unconditionally include in API requests. By default, fields with
  5792. // empty values are omitted from API requests. However, any non-pointer,
  5793. // non-interface field appearing in ForceSendFields will be sent to the
  5794. // server regardless of whether the field is empty or not. This may be
  5795. // used to include empty fields in Patch requests.
  5796. ForceSendFields []string `json:"-"`
  5797. // NullFields is a list of field names (e.g. "Score") to include in API
  5798. // requests with the JSON null value. By default, fields with empty
  5799. // values are omitted from API requests. However, any field with an
  5800. // empty value appearing in NullFields will be sent to the server as
  5801. // null. It is an error if a field in this list has a non-empty value.
  5802. // This may be used to include null fields in Patch requests.
  5803. NullFields []string `json:"-"`
  5804. }
  5805. func (s *GoogleCloudVisionV1p2beta1WebDetectionWebImage) MarshalJSON() ([]byte, error) {
  5806. type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebImage
  5807. raw := NoMethod(*s)
  5808. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5809. }
  5810. func (s *GoogleCloudVisionV1p2beta1WebDetectionWebImage) UnmarshalJSON(data []byte) error {
  5811. type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebImage
  5812. var s1 struct {
  5813. Score gensupport.JSONFloat64 `json:"score"`
  5814. *NoMethod
  5815. }
  5816. s1.NoMethod = (*NoMethod)(s)
  5817. if err := json.Unmarshal(data, &s1); err != nil {
  5818. return err
  5819. }
  5820. s.Score = float64(s1.Score)
  5821. return nil
  5822. }
  5823. // GoogleCloudVisionV1p2beta1WebDetectionWebLabel: Label to provide
  5824. // extra metadata for the web detection.
  5825. type GoogleCloudVisionV1p2beta1WebDetectionWebLabel struct {
  5826. // Label: Label for extra metadata.
  5827. Label string `json:"label,omitempty"`
  5828. // LanguageCode: The BCP-47 language code for `label`, such as "en-US"
  5829. // or "sr-Latn".
  5830. // For more information,
  5831. // see
  5832. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  5833. LanguageCode string `json:"languageCode,omitempty"`
  5834. // ForceSendFields is a list of field names (e.g. "Label") to
  5835. // unconditionally include in API requests. By default, fields with
  5836. // empty values are omitted from API requests. However, any non-pointer,
  5837. // non-interface field appearing in ForceSendFields will be sent to the
  5838. // server regardless of whether the field is empty or not. This may be
  5839. // used to include empty fields in Patch requests.
  5840. ForceSendFields []string `json:"-"`
  5841. // NullFields is a list of field names (e.g. "Label") to include in API
  5842. // 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. func (s *GoogleCloudVisionV1p2beta1WebDetectionWebLabel) MarshalJSON() ([]byte, error) {
  5850. type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebLabel
  5851. raw := NoMethod(*s)
  5852. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5853. }
  5854. // GoogleCloudVisionV1p2beta1WebDetectionWebPage: Metadata for web
  5855. // pages.
  5856. type GoogleCloudVisionV1p2beta1WebDetectionWebPage struct {
  5857. // FullMatchingImages: Fully matching images on the page.
  5858. // Can include resized copies of the query image.
  5859. FullMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"`
  5860. // PageTitle: Title for the web page, may contain HTML markups.
  5861. PageTitle string `json:"pageTitle,omitempty"`
  5862. // PartialMatchingImages: Partial matching images on the page.
  5863. // Those images are similar enough to share some key-point features.
  5864. // For
  5865. // example an original image will likely have partial matching for
  5866. // its
  5867. // crops.
  5868. PartialMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"`
  5869. // Score: (Deprecated) Overall relevancy score for the web page.
  5870. Score float64 `json:"score,omitempty"`
  5871. // Url: The result web page URL.
  5872. Url string `json:"url,omitempty"`
  5873. // ForceSendFields is a list of field names (e.g. "FullMatchingImages")
  5874. // to unconditionally include in API requests. By default, fields with
  5875. // empty values are omitted from API requests. However, any non-pointer,
  5876. // non-interface field appearing in ForceSendFields will be sent to the
  5877. // server regardless of whether the field is empty or not. This may be
  5878. // used to include empty fields in Patch requests.
  5879. ForceSendFields []string `json:"-"`
  5880. // NullFields is a list of field names (e.g. "FullMatchingImages") to
  5881. // include in API requests with the JSON null value. By default, fields
  5882. // with empty values are omitted from API requests. However, any field
  5883. // with an empty value appearing in NullFields will be sent to the
  5884. // server as null. It is an error if a field in this list has a
  5885. // non-empty value. This may be used to include null fields in Patch
  5886. // requests.
  5887. NullFields []string `json:"-"`
  5888. }
  5889. func (s *GoogleCloudVisionV1p2beta1WebDetectionWebPage) MarshalJSON() ([]byte, error) {
  5890. type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebPage
  5891. raw := NoMethod(*s)
  5892. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5893. }
  5894. func (s *GoogleCloudVisionV1p2beta1WebDetectionWebPage) UnmarshalJSON(data []byte) error {
  5895. type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebPage
  5896. var s1 struct {
  5897. Score gensupport.JSONFloat64 `json:"score"`
  5898. *NoMethod
  5899. }
  5900. s1.NoMethod = (*NoMethod)(s)
  5901. if err := json.Unmarshal(data, &s1); err != nil {
  5902. return err
  5903. }
  5904. s.Score = float64(s1.Score)
  5905. return nil
  5906. }
  5907. // GoogleCloudVisionV1p2beta1Word: A word representation.
  5908. type GoogleCloudVisionV1p2beta1Word struct {
  5909. // BoundingBox: The bounding box for the word.
  5910. // The vertices are in the order of top-left, top-right,
  5911. // bottom-right,
  5912. // bottom-left. When a rotation of the bounding box is detected the
  5913. // rotation
  5914. // is represented as around the top-left corner as defined when the text
  5915. // is
  5916. // read in the 'natural' orientation.
  5917. // For example:
  5918. // * when the text is horizontal it might look like:
  5919. // 0----1
  5920. // | |
  5921. // 3----2
  5922. // * when it's rotated 180 degrees around the top-left corner it
  5923. // becomes:
  5924. // 2----3
  5925. // | |
  5926. // 1----0
  5927. // and the vertex order will still be (0, 1, 2, 3).
  5928. BoundingBox *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingBox,omitempty"`
  5929. // Confidence: Confidence of the OCR results for the word. Range [0, 1].
  5930. Confidence float64 `json:"confidence,omitempty"`
  5931. // Property: Additional information detected for the word.
  5932. Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"`
  5933. // Symbols: List of symbols in the word.
  5934. // The order of the symbols follows the natural reading order.
  5935. Symbols []*GoogleCloudVisionV1p2beta1Symbol `json:"symbols,omitempty"`
  5936. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  5937. // unconditionally include in API requests. By default, fields with
  5938. // empty values are omitted from API requests. However, any non-pointer,
  5939. // non-interface field appearing in ForceSendFields will be sent to the
  5940. // server regardless of whether the field is empty or not. This may be
  5941. // used to include empty fields in Patch requests.
  5942. ForceSendFields []string `json:"-"`
  5943. // NullFields is a list of field names (e.g. "BoundingBox") to include
  5944. // in API requests with the JSON null value. By default, fields with
  5945. // empty values are omitted from API requests. However, any field with
  5946. // an empty value appearing in NullFields will be sent to the server as
  5947. // null. It is an error if a field in this list has a non-empty value.
  5948. // This may be used to include null fields in Patch requests.
  5949. NullFields []string `json:"-"`
  5950. }
  5951. func (s *GoogleCloudVisionV1p2beta1Word) MarshalJSON() ([]byte, error) {
  5952. type NoMethod GoogleCloudVisionV1p2beta1Word
  5953. raw := NoMethod(*s)
  5954. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5955. }
  5956. func (s *GoogleCloudVisionV1p2beta1Word) UnmarshalJSON(data []byte) error {
  5957. type NoMethod GoogleCloudVisionV1p2beta1Word
  5958. var s1 struct {
  5959. Confidence gensupport.JSONFloat64 `json:"confidence"`
  5960. *NoMethod
  5961. }
  5962. s1.NoMethod = (*NoMethod)(s)
  5963. if err := json.Unmarshal(data, &s1); err != nil {
  5964. return err
  5965. }
  5966. s.Confidence = float64(s1.Confidence)
  5967. return nil
  5968. }
  5969. // GoogleCloudVisionV1p3beta1AnnotateFileResponse: Response to a single
  5970. // file annotation request. A file may contain one or more
  5971. // images, which individually have their own responses.
  5972. type GoogleCloudVisionV1p3beta1AnnotateFileResponse struct {
  5973. // InputConfig: Information about the file for which this response is
  5974. // generated.
  5975. InputConfig *GoogleCloudVisionV1p3beta1InputConfig `json:"inputConfig,omitempty"`
  5976. // Responses: Individual responses to images found within the file.
  5977. Responses []*GoogleCloudVisionV1p3beta1AnnotateImageResponse `json:"responses,omitempty"`
  5978. // ForceSendFields is a list of field names (e.g. "InputConfig") to
  5979. // unconditionally include in API requests. By default, fields with
  5980. // empty values are omitted from API requests. However, any non-pointer,
  5981. // non-interface field appearing in ForceSendFields will be sent to the
  5982. // server regardless of whether the field is empty or not. This may be
  5983. // used to include empty fields in Patch requests.
  5984. ForceSendFields []string `json:"-"`
  5985. // NullFields is a list of field names (e.g. "InputConfig") to include
  5986. // in API requests with the JSON null value. By default, fields with
  5987. // empty values are omitted from API requests. However, any field with
  5988. // an empty value appearing in NullFields will be sent to the server as
  5989. // null. It is an error if a field in this list has a non-empty value.
  5990. // This may be used to include null fields in Patch requests.
  5991. NullFields []string `json:"-"`
  5992. }
  5993. func (s *GoogleCloudVisionV1p3beta1AnnotateFileResponse) MarshalJSON() ([]byte, error) {
  5994. type NoMethod GoogleCloudVisionV1p3beta1AnnotateFileResponse
  5995. raw := NoMethod(*s)
  5996. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5997. }
  5998. // GoogleCloudVisionV1p3beta1AnnotateImageResponse: Response to an image
  5999. // annotation request.
  6000. type GoogleCloudVisionV1p3beta1AnnotateImageResponse struct {
  6001. // Context: If present, contextual information is needed to understand
  6002. // where this image
  6003. // comes from.
  6004. Context *GoogleCloudVisionV1p3beta1ImageAnnotationContext `json:"context,omitempty"`
  6005. // CropHintsAnnotation: If present, crop hints have completed
  6006. // successfully.
  6007. CropHintsAnnotation *GoogleCloudVisionV1p3beta1CropHintsAnnotation `json:"cropHintsAnnotation,omitempty"`
  6008. // Error: If set, represents the error message for the operation.
  6009. // Note that filled-in image annotations are guaranteed to be
  6010. // correct, even when `error` is set.
  6011. Error *Status `json:"error,omitempty"`
  6012. // FaceAnnotations: If present, face detection has completed
  6013. // successfully.
  6014. FaceAnnotations []*GoogleCloudVisionV1p3beta1FaceAnnotation `json:"faceAnnotations,omitempty"`
  6015. // FullTextAnnotation: If present, text (OCR) detection or document
  6016. // (OCR) text detection has
  6017. // completed successfully.
  6018. // This annotation provides the structural hierarchy for the OCR
  6019. // detected
  6020. // text.
  6021. FullTextAnnotation *GoogleCloudVisionV1p3beta1TextAnnotation `json:"fullTextAnnotation,omitempty"`
  6022. // ImagePropertiesAnnotation: If present, image properties were
  6023. // extracted successfully.
  6024. ImagePropertiesAnnotation *GoogleCloudVisionV1p3beta1ImageProperties `json:"imagePropertiesAnnotation,omitempty"`
  6025. // LabelAnnotations: If present, label detection has completed
  6026. // successfully.
  6027. LabelAnnotations []*GoogleCloudVisionV1p3beta1EntityAnnotation `json:"labelAnnotations,omitempty"`
  6028. // LandmarkAnnotations: If present, landmark detection has completed
  6029. // successfully.
  6030. LandmarkAnnotations []*GoogleCloudVisionV1p3beta1EntityAnnotation `json:"landmarkAnnotations,omitempty"`
  6031. // LocalizedObjectAnnotations: If present, localized object detection
  6032. // has completed successfully.
  6033. // This will be sorted descending by confidence score.
  6034. LocalizedObjectAnnotations []*GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation `json:"localizedObjectAnnotations,omitempty"`
  6035. // LogoAnnotations: If present, logo detection has completed
  6036. // successfully.
  6037. LogoAnnotations []*GoogleCloudVisionV1p3beta1EntityAnnotation `json:"logoAnnotations,omitempty"`
  6038. // ProductSearchResults: If present, product search has completed
  6039. // successfully.
  6040. ProductSearchResults *GoogleCloudVisionV1p3beta1ProductSearchResults `json:"productSearchResults,omitempty"`
  6041. // SafeSearchAnnotation: If present, safe-search annotation has
  6042. // completed successfully.
  6043. SafeSearchAnnotation *GoogleCloudVisionV1p3beta1SafeSearchAnnotation `json:"safeSearchAnnotation,omitempty"`
  6044. // TextAnnotations: If present, text (OCR) detection has completed
  6045. // successfully.
  6046. TextAnnotations []*GoogleCloudVisionV1p3beta1EntityAnnotation `json:"textAnnotations,omitempty"`
  6047. // WebDetection: If present, web detection has completed successfully.
  6048. WebDetection *GoogleCloudVisionV1p3beta1WebDetection `json:"webDetection,omitempty"`
  6049. // ForceSendFields is a list of field names (e.g. "Context") to
  6050. // unconditionally include in API requests. By default, fields with
  6051. // empty values are omitted from API requests. However, any non-pointer,
  6052. // non-interface field appearing in ForceSendFields will be sent to the
  6053. // server regardless of whether the field is empty or not. This may be
  6054. // used to include empty fields in Patch requests.
  6055. ForceSendFields []string `json:"-"`
  6056. // NullFields is a list of field names (e.g. "Context") to include in
  6057. // API requests with the JSON null value. By default, fields with empty
  6058. // values are omitted from API requests. However, any field with an
  6059. // empty value appearing in NullFields will be sent to the server as
  6060. // null. It is an error if a field in this list has a non-empty value.
  6061. // This may be used to include null fields in Patch requests.
  6062. NullFields []string `json:"-"`
  6063. }
  6064. func (s *GoogleCloudVisionV1p3beta1AnnotateImageResponse) MarshalJSON() ([]byte, error) {
  6065. type NoMethod GoogleCloudVisionV1p3beta1AnnotateImageResponse
  6066. raw := NoMethod(*s)
  6067. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6068. }
  6069. // GoogleCloudVisionV1p3beta1AsyncAnnotateFileResponse: The response for
  6070. // a single offline file annotation request.
  6071. type GoogleCloudVisionV1p3beta1AsyncAnnotateFileResponse struct {
  6072. // OutputConfig: The output location and metadata from
  6073. // AsyncAnnotateFileRequest.
  6074. OutputConfig *GoogleCloudVisionV1p3beta1OutputConfig `json:"outputConfig,omitempty"`
  6075. // ForceSendFields is a list of field names (e.g. "OutputConfig") to
  6076. // unconditionally include in API requests. By default, fields with
  6077. // empty values are omitted from API requests. However, any non-pointer,
  6078. // non-interface field appearing in ForceSendFields will be sent to the
  6079. // server regardless of whether the field is empty or not. This may be
  6080. // used to include empty fields in Patch requests.
  6081. ForceSendFields []string `json:"-"`
  6082. // NullFields is a list of field names (e.g. "OutputConfig") to include
  6083. // in API requests with the JSON null value. By default, fields with
  6084. // empty values are omitted from API requests. However, any field with
  6085. // an empty value appearing in NullFields will be sent to the server as
  6086. // null. It is an error if a field in this list has a non-empty value.
  6087. // This may be used to include null fields in Patch requests.
  6088. NullFields []string `json:"-"`
  6089. }
  6090. func (s *GoogleCloudVisionV1p3beta1AsyncAnnotateFileResponse) MarshalJSON() ([]byte, error) {
  6091. type NoMethod GoogleCloudVisionV1p3beta1AsyncAnnotateFileResponse
  6092. raw := NoMethod(*s)
  6093. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6094. }
  6095. // GoogleCloudVisionV1p3beta1AsyncBatchAnnotateFilesResponse: Response
  6096. // to an async batch file annotation request.
  6097. type GoogleCloudVisionV1p3beta1AsyncBatchAnnotateFilesResponse struct {
  6098. // Responses: The list of file annotation responses, one for each
  6099. // request in
  6100. // AsyncBatchAnnotateFilesRequest.
  6101. Responses []*GoogleCloudVisionV1p3beta1AsyncAnnotateFileResponse `json:"responses,omitempty"`
  6102. // ForceSendFields is a list of field names (e.g. "Responses") to
  6103. // unconditionally include in API requests. By default, fields with
  6104. // empty values are omitted from API requests. However, any non-pointer,
  6105. // non-interface field appearing in ForceSendFields will be sent to the
  6106. // server regardless of whether the field is empty or not. This may be
  6107. // used to include empty fields in Patch requests.
  6108. ForceSendFields []string `json:"-"`
  6109. // NullFields is a list of field names (e.g. "Responses") to include in
  6110. // API requests with the JSON null value. By default, fields with empty
  6111. // values are omitted from API requests. However, any field with an
  6112. // empty value appearing in NullFields will be sent to the server as
  6113. // null. It is an error if a field in this list has a non-empty value.
  6114. // This may be used to include null fields in Patch requests.
  6115. NullFields []string `json:"-"`
  6116. }
  6117. func (s *GoogleCloudVisionV1p3beta1AsyncBatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) {
  6118. type NoMethod GoogleCloudVisionV1p3beta1AsyncBatchAnnotateFilesResponse
  6119. raw := NoMethod(*s)
  6120. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6121. }
  6122. // GoogleCloudVisionV1p3beta1BatchOperationMetadata: Metadata for the
  6123. // batch operations such as the current state.
  6124. //
  6125. // This is included in the `metadata` field of the `Operation` returned
  6126. // by the
  6127. // `GetOperation` call of the `google::longrunning::Operations` service.
  6128. type GoogleCloudVisionV1p3beta1BatchOperationMetadata struct {
  6129. // EndTime: The time when the batch request is finished
  6130. // and
  6131. // google.longrunning.Operation.done is set to true.
  6132. EndTime string `json:"endTime,omitempty"`
  6133. // State: The current state of the batch operation.
  6134. //
  6135. // Possible values:
  6136. // "STATE_UNSPECIFIED" - Invalid.
  6137. // "PROCESSING" - Request is actively being processed.
  6138. // "SUCCESSFUL" - The request is done and at least one item has been
  6139. // successfully
  6140. // processed.
  6141. // "FAILED" - The request is done and no item has been successfully
  6142. // processed.
  6143. // "CANCELLED" - The request is done after the
  6144. // longrunning.Operations.CancelOperation has
  6145. // been called by the user. Any records that were processed before
  6146. // the
  6147. // cancel command are output as specified in the request.
  6148. State string `json:"state,omitempty"`
  6149. // SubmitTime: The time when the batch request was submitted to the
  6150. // server.
  6151. SubmitTime string `json:"submitTime,omitempty"`
  6152. // ForceSendFields is a list of field names (e.g. "EndTime") to
  6153. // unconditionally include in API requests. By default, fields with
  6154. // empty values are omitted from API requests. However, any non-pointer,
  6155. // non-interface field appearing in ForceSendFields will be sent to the
  6156. // server regardless of whether the field is empty or not. This may be
  6157. // used to include empty fields in Patch requests.
  6158. ForceSendFields []string `json:"-"`
  6159. // NullFields is a list of field names (e.g. "EndTime") to include in
  6160. // API requests with the JSON null value. By default, fields with empty
  6161. // values are omitted from API requests. However, any field with an
  6162. // empty value appearing in NullFields will be sent to the server as
  6163. // null. It is an error if a field in this list has a non-empty value.
  6164. // This may be used to include null fields in Patch requests.
  6165. NullFields []string `json:"-"`
  6166. }
  6167. func (s *GoogleCloudVisionV1p3beta1BatchOperationMetadata) MarshalJSON() ([]byte, error) {
  6168. type NoMethod GoogleCloudVisionV1p3beta1BatchOperationMetadata
  6169. raw := NoMethod(*s)
  6170. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6171. }
  6172. // GoogleCloudVisionV1p3beta1Block: Logical element on the page.
  6173. type GoogleCloudVisionV1p3beta1Block struct {
  6174. // BlockType: Detected block type (text, image etc) for this block.
  6175. //
  6176. // Possible values:
  6177. // "UNKNOWN" - Unknown block type.
  6178. // "TEXT" - Regular text block.
  6179. // "TABLE" - Table block.
  6180. // "PICTURE" - Image block.
  6181. // "RULER" - Horizontal/vertical line box.
  6182. // "BARCODE" - Barcode block.
  6183. BlockType string `json:"blockType,omitempty"`
  6184. // BoundingBox: The bounding box for the block.
  6185. // The vertices are in the order of top-left, top-right,
  6186. // bottom-right,
  6187. // bottom-left. When a rotation of the bounding box is detected the
  6188. // rotation
  6189. // is represented as around the top-left corner as defined when the text
  6190. // is
  6191. // read in the 'natural' orientation.
  6192. // For example:
  6193. //
  6194. // * when the text is horizontal it might look like:
  6195. //
  6196. // 0----1
  6197. // | |
  6198. // 3----2
  6199. //
  6200. // * when it's rotated 180 degrees around the top-left corner it
  6201. // becomes:
  6202. //
  6203. // 2----3
  6204. // | |
  6205. // 1----0
  6206. //
  6207. // and the vertex order will still be (0, 1, 2, 3).
  6208. BoundingBox *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingBox,omitempty"`
  6209. // Confidence: Confidence of the OCR results on the block. Range [0, 1].
  6210. Confidence float64 `json:"confidence,omitempty"`
  6211. // Paragraphs: List of paragraphs in this block (if this blocks is of
  6212. // type text).
  6213. Paragraphs []*GoogleCloudVisionV1p3beta1Paragraph `json:"paragraphs,omitempty"`
  6214. // Property: Additional information detected for the block.
  6215. Property *GoogleCloudVisionV1p3beta1TextAnnotationTextProperty `json:"property,omitempty"`
  6216. // ForceSendFields is a list of field names (e.g. "BlockType") to
  6217. // unconditionally include in API requests. By default, fields with
  6218. // empty values are omitted from API requests. However, any non-pointer,
  6219. // non-interface field appearing in ForceSendFields will be sent to the
  6220. // server regardless of whether the field is empty or not. This may be
  6221. // used to include empty fields in Patch requests.
  6222. ForceSendFields []string `json:"-"`
  6223. // NullFields is a list of field names (e.g. "BlockType") to include in
  6224. // API requests with the JSON null value. By default, fields with empty
  6225. // values are omitted from API requests. However, any field with an
  6226. // empty value appearing in NullFields will be sent to the server as
  6227. // null. It is an error if a field in this list has a non-empty value.
  6228. // This may be used to include null fields in Patch requests.
  6229. NullFields []string `json:"-"`
  6230. }
  6231. func (s *GoogleCloudVisionV1p3beta1Block) MarshalJSON() ([]byte, error) {
  6232. type NoMethod GoogleCloudVisionV1p3beta1Block
  6233. raw := NoMethod(*s)
  6234. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6235. }
  6236. func (s *GoogleCloudVisionV1p3beta1Block) UnmarshalJSON(data []byte) error {
  6237. type NoMethod GoogleCloudVisionV1p3beta1Block
  6238. var s1 struct {
  6239. Confidence gensupport.JSONFloat64 `json:"confidence"`
  6240. *NoMethod
  6241. }
  6242. s1.NoMethod = (*NoMethod)(s)
  6243. if err := json.Unmarshal(data, &s1); err != nil {
  6244. return err
  6245. }
  6246. s.Confidence = float64(s1.Confidence)
  6247. return nil
  6248. }
  6249. // GoogleCloudVisionV1p3beta1BoundingPoly: A bounding polygon for the
  6250. // detected image annotation.
  6251. type GoogleCloudVisionV1p3beta1BoundingPoly struct {
  6252. // NormalizedVertices: The bounding polygon normalized vertices.
  6253. NormalizedVertices []*GoogleCloudVisionV1p3beta1NormalizedVertex `json:"normalizedVertices,omitempty"`
  6254. // Vertices: The bounding polygon vertices.
  6255. Vertices []*GoogleCloudVisionV1p3beta1Vertex `json:"vertices,omitempty"`
  6256. // ForceSendFields is a list of field names (e.g. "NormalizedVertices")
  6257. // to unconditionally include in API requests. By default, fields with
  6258. // empty values are omitted from API requests. However, any non-pointer,
  6259. // non-interface field appearing in ForceSendFields will be sent to the
  6260. // server regardless of whether the field is empty or not. This may be
  6261. // used to include empty fields in Patch requests.
  6262. ForceSendFields []string `json:"-"`
  6263. // NullFields is a list of field names (e.g. "NormalizedVertices") to
  6264. // include in API requests with the JSON null value. By default, fields
  6265. // with empty values are omitted from API requests. However, any field
  6266. // with an empty value appearing in NullFields will be sent to the
  6267. // server as null. It is an error if a field in this list has a
  6268. // non-empty value. This may be used to include null fields in Patch
  6269. // requests.
  6270. NullFields []string `json:"-"`
  6271. }
  6272. func (s *GoogleCloudVisionV1p3beta1BoundingPoly) MarshalJSON() ([]byte, error) {
  6273. type NoMethod GoogleCloudVisionV1p3beta1BoundingPoly
  6274. raw := NoMethod(*s)
  6275. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6276. }
  6277. // GoogleCloudVisionV1p3beta1ColorInfo: Color information consists of
  6278. // RGB channels, score, and the fraction of
  6279. // the image that the color occupies in the image.
  6280. type GoogleCloudVisionV1p3beta1ColorInfo struct {
  6281. // Color: RGB components of the color.
  6282. Color *Color `json:"color,omitempty"`
  6283. // PixelFraction: The fraction of pixels the color occupies in the
  6284. // image.
  6285. // Value in range [0, 1].
  6286. PixelFraction float64 `json:"pixelFraction,omitempty"`
  6287. // Score: Image-specific score for this color. Value in range [0, 1].
  6288. Score float64 `json:"score,omitempty"`
  6289. // ForceSendFields is a list of field names (e.g. "Color") to
  6290. // unconditionally include in API requests. By default, fields with
  6291. // empty values are omitted from API requests. However, any non-pointer,
  6292. // non-interface field appearing in ForceSendFields will be sent to the
  6293. // server regardless of whether the field is empty or not. This may be
  6294. // used to include empty fields in Patch requests.
  6295. ForceSendFields []string `json:"-"`
  6296. // NullFields is a list of field names (e.g. "Color") to include in API
  6297. // requests with the JSON null value. By default, fields with empty
  6298. // values are omitted from API requests. However, any field with an
  6299. // empty value appearing in NullFields will be sent to the server as
  6300. // null. It is an error if a field in this list has a non-empty value.
  6301. // This may be used to include null fields in Patch requests.
  6302. NullFields []string `json:"-"`
  6303. }
  6304. func (s *GoogleCloudVisionV1p3beta1ColorInfo) MarshalJSON() ([]byte, error) {
  6305. type NoMethod GoogleCloudVisionV1p3beta1ColorInfo
  6306. raw := NoMethod(*s)
  6307. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6308. }
  6309. func (s *GoogleCloudVisionV1p3beta1ColorInfo) UnmarshalJSON(data []byte) error {
  6310. type NoMethod GoogleCloudVisionV1p3beta1ColorInfo
  6311. var s1 struct {
  6312. PixelFraction gensupport.JSONFloat64 `json:"pixelFraction"`
  6313. Score gensupport.JSONFloat64 `json:"score"`
  6314. *NoMethod
  6315. }
  6316. s1.NoMethod = (*NoMethod)(s)
  6317. if err := json.Unmarshal(data, &s1); err != nil {
  6318. return err
  6319. }
  6320. s.PixelFraction = float64(s1.PixelFraction)
  6321. s.Score = float64(s1.Score)
  6322. return nil
  6323. }
  6324. // GoogleCloudVisionV1p3beta1CropHint: Single crop hint that is used to
  6325. // generate a new crop when serving an image.
  6326. type GoogleCloudVisionV1p3beta1CropHint struct {
  6327. // BoundingPoly: The bounding polygon for the crop region. The
  6328. // coordinates of the bounding
  6329. // box are in the original image's scale.
  6330. BoundingPoly *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPoly,omitempty"`
  6331. // Confidence: Confidence of this being a salient region. Range [0, 1].
  6332. Confidence float64 `json:"confidence,omitempty"`
  6333. // ImportanceFraction: Fraction of importance of this salient region
  6334. // with respect to the original
  6335. // image.
  6336. ImportanceFraction float64 `json:"importanceFraction,omitempty"`
  6337. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  6338. // unconditionally include in API requests. By default, fields with
  6339. // empty values are omitted from API requests. However, any non-pointer,
  6340. // non-interface field appearing in ForceSendFields will be sent to the
  6341. // server regardless of whether the field is empty or not. This may be
  6342. // used to include empty fields in Patch requests.
  6343. ForceSendFields []string `json:"-"`
  6344. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  6345. // in API requests with the JSON null value. By default, fields with
  6346. // empty values are omitted from API requests. However, any field with
  6347. // an empty value appearing in NullFields will be sent to the server as
  6348. // null. It is an error if a field in this list has a non-empty value.
  6349. // This may be used to include null fields in Patch requests.
  6350. NullFields []string `json:"-"`
  6351. }
  6352. func (s *GoogleCloudVisionV1p3beta1CropHint) MarshalJSON() ([]byte, error) {
  6353. type NoMethod GoogleCloudVisionV1p3beta1CropHint
  6354. raw := NoMethod(*s)
  6355. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6356. }
  6357. func (s *GoogleCloudVisionV1p3beta1CropHint) UnmarshalJSON(data []byte) error {
  6358. type NoMethod GoogleCloudVisionV1p3beta1CropHint
  6359. var s1 struct {
  6360. Confidence gensupport.JSONFloat64 `json:"confidence"`
  6361. ImportanceFraction gensupport.JSONFloat64 `json:"importanceFraction"`
  6362. *NoMethod
  6363. }
  6364. s1.NoMethod = (*NoMethod)(s)
  6365. if err := json.Unmarshal(data, &s1); err != nil {
  6366. return err
  6367. }
  6368. s.Confidence = float64(s1.Confidence)
  6369. s.ImportanceFraction = float64(s1.ImportanceFraction)
  6370. return nil
  6371. }
  6372. // GoogleCloudVisionV1p3beta1CropHintsAnnotation: Set of crop hints that
  6373. // are used to generate new crops when serving images.
  6374. type GoogleCloudVisionV1p3beta1CropHintsAnnotation struct {
  6375. // CropHints: Crop hint results.
  6376. CropHints []*GoogleCloudVisionV1p3beta1CropHint `json:"cropHints,omitempty"`
  6377. // ForceSendFields is a list of field names (e.g. "CropHints") to
  6378. // unconditionally include in API requests. By default, fields with
  6379. // empty values are omitted from API requests. However, any non-pointer,
  6380. // non-interface field appearing in ForceSendFields will be sent to the
  6381. // server regardless of whether the field is empty or not. This may be
  6382. // used to include empty fields in Patch requests.
  6383. ForceSendFields []string `json:"-"`
  6384. // NullFields is a list of field names (e.g. "CropHints") to include in
  6385. // API requests with the JSON null value. By default, fields with empty
  6386. // values are omitted from API requests. However, any field with an
  6387. // empty value appearing in NullFields will be sent to the server as
  6388. // null. It is an error if a field in this list has a non-empty value.
  6389. // This may be used to include null fields in Patch requests.
  6390. NullFields []string `json:"-"`
  6391. }
  6392. func (s *GoogleCloudVisionV1p3beta1CropHintsAnnotation) MarshalJSON() ([]byte, error) {
  6393. type NoMethod GoogleCloudVisionV1p3beta1CropHintsAnnotation
  6394. raw := NoMethod(*s)
  6395. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6396. }
  6397. // GoogleCloudVisionV1p3beta1DominantColorsAnnotation: Set of dominant
  6398. // colors and their corresponding scores.
  6399. type GoogleCloudVisionV1p3beta1DominantColorsAnnotation struct {
  6400. // Colors: RGB color values with their score and pixel fraction.
  6401. Colors []*GoogleCloudVisionV1p3beta1ColorInfo `json:"colors,omitempty"`
  6402. // ForceSendFields is a list of field names (e.g. "Colors") to
  6403. // unconditionally include in API requests. By default, fields with
  6404. // empty values are omitted from API requests. However, any non-pointer,
  6405. // non-interface field appearing in ForceSendFields will be sent to the
  6406. // server regardless of whether the field is empty or not. This may be
  6407. // used to include empty fields in Patch requests.
  6408. ForceSendFields []string `json:"-"`
  6409. // NullFields is a list of field names (e.g. "Colors") to include in API
  6410. // requests with the JSON null value. By default, fields with empty
  6411. // values are omitted from API requests. However, any field with an
  6412. // empty value appearing in NullFields will be sent to the server as
  6413. // null. It is an error if a field in this list has a non-empty value.
  6414. // This may be used to include null fields in Patch requests.
  6415. NullFields []string `json:"-"`
  6416. }
  6417. func (s *GoogleCloudVisionV1p3beta1DominantColorsAnnotation) MarshalJSON() ([]byte, error) {
  6418. type NoMethod GoogleCloudVisionV1p3beta1DominantColorsAnnotation
  6419. raw := NoMethod(*s)
  6420. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6421. }
  6422. // GoogleCloudVisionV1p3beta1EntityAnnotation: Set of detected entity
  6423. // features.
  6424. type GoogleCloudVisionV1p3beta1EntityAnnotation struct {
  6425. // BoundingPoly: Image region to which this entity belongs. Not
  6426. // produced
  6427. // for `LABEL_DETECTION` features.
  6428. BoundingPoly *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPoly,omitempty"`
  6429. // Confidence: **Deprecated. Use `score` instead.**
  6430. // The accuracy of the entity detection in an image.
  6431. // For example, for an image in which the "Eiffel Tower" entity is
  6432. // detected,
  6433. // this field represents the confidence that there is a tower in the
  6434. // query
  6435. // image. Range [0, 1].
  6436. Confidence float64 `json:"confidence,omitempty"`
  6437. // Description: Entity textual description, expressed in its `locale`
  6438. // language.
  6439. Description string `json:"description,omitempty"`
  6440. // Locale: The language code for the locale in which the entity
  6441. // textual
  6442. // `description` is expressed.
  6443. Locale string `json:"locale,omitempty"`
  6444. // Locations: The location information for the detected entity.
  6445. // Multiple
  6446. // `LocationInfo` elements can be present because one location
  6447. // may
  6448. // indicate the location of the scene in the image, and another
  6449. // location
  6450. // may indicate the location of the place where the image was
  6451. // taken.
  6452. // Location information is usually present for landmarks.
  6453. Locations []*GoogleCloudVisionV1p3beta1LocationInfo `json:"locations,omitempty"`
  6454. // Mid: Opaque entity ID. Some IDs may be available in
  6455. // [Google Knowledge Graph
  6456. // Search
  6457. // API](https://developers.google.com/knowledge-graph/).
  6458. Mid string `json:"mid,omitempty"`
  6459. // Properties: Some entities may have optional user-supplied `Property`
  6460. // (name/value)
  6461. // fields, such a score or string that qualifies the entity.
  6462. Properties []*GoogleCloudVisionV1p3beta1Property `json:"properties,omitempty"`
  6463. // Score: Overall score of the result. Range [0, 1].
  6464. Score float64 `json:"score,omitempty"`
  6465. // Topicality: The relevancy of the ICA (Image Content Annotation) label
  6466. // to the
  6467. // image. For example, the relevancy of "tower" is likely higher to an
  6468. // image
  6469. // containing the detected "Eiffel Tower" than to an image containing
  6470. // a
  6471. // detected distant towering building, even though the confidence
  6472. // that
  6473. // there is a tower in each image may be the same. Range [0, 1].
  6474. Topicality float64 `json:"topicality,omitempty"`
  6475. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  6476. // unconditionally include in API requests. By default, fields with
  6477. // empty values are omitted from API requests. However, any non-pointer,
  6478. // non-interface field appearing in ForceSendFields will be sent to the
  6479. // server regardless of whether the field is empty or not. This may be
  6480. // used to include empty fields in Patch requests.
  6481. ForceSendFields []string `json:"-"`
  6482. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  6483. // in API requests with the JSON null value. By default, fields with
  6484. // empty values are omitted from API requests. However, any field with
  6485. // an empty value appearing in NullFields will be sent to the server as
  6486. // null. It is an error if a field in this list has a non-empty value.
  6487. // This may be used to include null fields in Patch requests.
  6488. NullFields []string `json:"-"`
  6489. }
  6490. func (s *GoogleCloudVisionV1p3beta1EntityAnnotation) MarshalJSON() ([]byte, error) {
  6491. type NoMethod GoogleCloudVisionV1p3beta1EntityAnnotation
  6492. raw := NoMethod(*s)
  6493. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6494. }
  6495. func (s *GoogleCloudVisionV1p3beta1EntityAnnotation) UnmarshalJSON(data []byte) error {
  6496. type NoMethod GoogleCloudVisionV1p3beta1EntityAnnotation
  6497. var s1 struct {
  6498. Confidence gensupport.JSONFloat64 `json:"confidence"`
  6499. Score gensupport.JSONFloat64 `json:"score"`
  6500. Topicality gensupport.JSONFloat64 `json:"topicality"`
  6501. *NoMethod
  6502. }
  6503. s1.NoMethod = (*NoMethod)(s)
  6504. if err := json.Unmarshal(data, &s1); err != nil {
  6505. return err
  6506. }
  6507. s.Confidence = float64(s1.Confidence)
  6508. s.Score = float64(s1.Score)
  6509. s.Topicality = float64(s1.Topicality)
  6510. return nil
  6511. }
  6512. // GoogleCloudVisionV1p3beta1FaceAnnotation: A face annotation object
  6513. // contains the results of face detection.
  6514. type GoogleCloudVisionV1p3beta1FaceAnnotation struct {
  6515. // AngerLikelihood: Anger likelihood.
  6516. //
  6517. // Possible values:
  6518. // "UNKNOWN" - Unknown likelihood.
  6519. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  6520. // specified vertical.
  6521. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  6522. // vertical.
  6523. // "POSSIBLE" - It is possible that the image belongs to the specified
  6524. // vertical.
  6525. // "LIKELY" - It is likely that the image belongs to the specified
  6526. // vertical.
  6527. // "VERY_LIKELY" - It is very likely that the image belongs to the
  6528. // specified vertical.
  6529. AngerLikelihood string `json:"angerLikelihood,omitempty"`
  6530. // BlurredLikelihood: Blurred likelihood.
  6531. //
  6532. // Possible values:
  6533. // "UNKNOWN" - Unknown likelihood.
  6534. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  6535. // specified vertical.
  6536. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  6537. // vertical.
  6538. // "POSSIBLE" - It is possible that the image belongs to the specified
  6539. // vertical.
  6540. // "LIKELY" - It is likely that the image belongs to the specified
  6541. // vertical.
  6542. // "VERY_LIKELY" - It is very likely that the image belongs to the
  6543. // specified vertical.
  6544. BlurredLikelihood string `json:"blurredLikelihood,omitempty"`
  6545. // BoundingPoly: The bounding polygon around the face. The coordinates
  6546. // of the bounding box
  6547. // are in the original image's scale.
  6548. // The bounding box is computed to "frame" the face in accordance with
  6549. // human
  6550. // expectations. It is based on the landmarker results.
  6551. // Note that one or more x and/or y coordinates may not be generated in
  6552. // the
  6553. // `BoundingPoly` (the polygon will be unbounded) if only a partial
  6554. // face
  6555. // appears in the image to be annotated.
  6556. BoundingPoly *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPoly,omitempty"`
  6557. // DetectionConfidence: Detection confidence. Range [0, 1].
  6558. DetectionConfidence float64 `json:"detectionConfidence,omitempty"`
  6559. // FdBoundingPoly: The `fd_bounding_poly` bounding polygon is tighter
  6560. // than the
  6561. // `boundingPoly`, and encloses only the skin part of the face.
  6562. // Typically, it
  6563. // is used to eliminate the face from any image analysis that detects
  6564. // the
  6565. // "amount of skin" visible in an image. It is not based on
  6566. // the
  6567. // landmarker results, only on the initial face detection, hence
  6568. // the <code>fd</code> (face detection) prefix.
  6569. FdBoundingPoly *GoogleCloudVisionV1p3beta1BoundingPoly `json:"fdBoundingPoly,omitempty"`
  6570. // HeadwearLikelihood: Headwear likelihood.
  6571. //
  6572. // Possible values:
  6573. // "UNKNOWN" - Unknown likelihood.
  6574. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  6575. // specified vertical.
  6576. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  6577. // vertical.
  6578. // "POSSIBLE" - It is possible that the image belongs to the specified
  6579. // vertical.
  6580. // "LIKELY" - It is likely that the image belongs to the specified
  6581. // vertical.
  6582. // "VERY_LIKELY" - It is very likely that the image belongs to the
  6583. // specified vertical.
  6584. HeadwearLikelihood string `json:"headwearLikelihood,omitempty"`
  6585. // JoyLikelihood: Joy likelihood.
  6586. //
  6587. // Possible values:
  6588. // "UNKNOWN" - Unknown likelihood.
  6589. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  6590. // specified vertical.
  6591. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  6592. // vertical.
  6593. // "POSSIBLE" - It is possible that the image belongs to the specified
  6594. // vertical.
  6595. // "LIKELY" - It is likely that the image belongs to the specified
  6596. // vertical.
  6597. // "VERY_LIKELY" - It is very likely that the image belongs to the
  6598. // specified vertical.
  6599. JoyLikelihood string `json:"joyLikelihood,omitempty"`
  6600. // LandmarkingConfidence: Face landmarking confidence. Range [0, 1].
  6601. LandmarkingConfidence float64 `json:"landmarkingConfidence,omitempty"`
  6602. // Landmarks: Detected face landmarks.
  6603. Landmarks []*GoogleCloudVisionV1p3beta1FaceAnnotationLandmark `json:"landmarks,omitempty"`
  6604. // PanAngle: Yaw angle, which indicates the leftward/rightward angle
  6605. // that the face is
  6606. // pointing relative to the vertical plane perpendicular to the image.
  6607. // Range
  6608. // [-180,180].
  6609. PanAngle float64 `json:"panAngle,omitempty"`
  6610. // RollAngle: Roll angle, which indicates the amount of
  6611. // clockwise/anti-clockwise rotation
  6612. // of the face relative to the image vertical about the axis
  6613. // perpendicular to
  6614. // the face. Range [-180,180].
  6615. RollAngle float64 `json:"rollAngle,omitempty"`
  6616. // SorrowLikelihood: Sorrow likelihood.
  6617. //
  6618. // Possible values:
  6619. // "UNKNOWN" - Unknown likelihood.
  6620. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  6621. // specified vertical.
  6622. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  6623. // vertical.
  6624. // "POSSIBLE" - It is possible that the image belongs to the specified
  6625. // vertical.
  6626. // "LIKELY" - It is likely that the image belongs to the specified
  6627. // vertical.
  6628. // "VERY_LIKELY" - It is very likely that the image belongs to the
  6629. // specified vertical.
  6630. SorrowLikelihood string `json:"sorrowLikelihood,omitempty"`
  6631. // SurpriseLikelihood: Surprise likelihood.
  6632. //
  6633. // Possible values:
  6634. // "UNKNOWN" - Unknown likelihood.
  6635. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  6636. // specified vertical.
  6637. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  6638. // vertical.
  6639. // "POSSIBLE" - It is possible that the image belongs to the specified
  6640. // vertical.
  6641. // "LIKELY" - It is likely that the image belongs to the specified
  6642. // vertical.
  6643. // "VERY_LIKELY" - It is very likely that the image belongs to the
  6644. // specified vertical.
  6645. SurpriseLikelihood string `json:"surpriseLikelihood,omitempty"`
  6646. // TiltAngle: Pitch angle, which indicates the upwards/downwards angle
  6647. // that the face is
  6648. // pointing relative to the image's horizontal plane. Range [-180,180].
  6649. TiltAngle float64 `json:"tiltAngle,omitempty"`
  6650. // UnderExposedLikelihood: Under-exposed likelihood.
  6651. //
  6652. // Possible values:
  6653. // "UNKNOWN" - Unknown likelihood.
  6654. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  6655. // specified vertical.
  6656. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  6657. // vertical.
  6658. // "POSSIBLE" - It is possible that the image belongs to the specified
  6659. // vertical.
  6660. // "LIKELY" - It is likely that the image belongs to the specified
  6661. // vertical.
  6662. // "VERY_LIKELY" - It is very likely that the image belongs to the
  6663. // specified vertical.
  6664. UnderExposedLikelihood string `json:"underExposedLikelihood,omitempty"`
  6665. // ForceSendFields is a list of field names (e.g. "AngerLikelihood") to
  6666. // unconditionally include in API requests. By default, fields with
  6667. // empty values are omitted from API requests. However, any non-pointer,
  6668. // non-interface field appearing in ForceSendFields will be sent to the
  6669. // server regardless of whether the field is empty or not. This may be
  6670. // used to include empty fields in Patch requests.
  6671. ForceSendFields []string `json:"-"`
  6672. // NullFields is a list of field names (e.g. "AngerLikelihood") to
  6673. // include in API requests with the JSON null value. By default, fields
  6674. // with empty values are omitted from API requests. However, any field
  6675. // with an empty value appearing in NullFields will be sent to the
  6676. // server as null. It is an error if a field in this list has a
  6677. // non-empty value. This may be used to include null fields in Patch
  6678. // requests.
  6679. NullFields []string `json:"-"`
  6680. }
  6681. func (s *GoogleCloudVisionV1p3beta1FaceAnnotation) MarshalJSON() ([]byte, error) {
  6682. type NoMethod GoogleCloudVisionV1p3beta1FaceAnnotation
  6683. raw := NoMethod(*s)
  6684. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6685. }
  6686. func (s *GoogleCloudVisionV1p3beta1FaceAnnotation) UnmarshalJSON(data []byte) error {
  6687. type NoMethod GoogleCloudVisionV1p3beta1FaceAnnotation
  6688. var s1 struct {
  6689. DetectionConfidence gensupport.JSONFloat64 `json:"detectionConfidence"`
  6690. LandmarkingConfidence gensupport.JSONFloat64 `json:"landmarkingConfidence"`
  6691. PanAngle gensupport.JSONFloat64 `json:"panAngle"`
  6692. RollAngle gensupport.JSONFloat64 `json:"rollAngle"`
  6693. TiltAngle gensupport.JSONFloat64 `json:"tiltAngle"`
  6694. *NoMethod
  6695. }
  6696. s1.NoMethod = (*NoMethod)(s)
  6697. if err := json.Unmarshal(data, &s1); err != nil {
  6698. return err
  6699. }
  6700. s.DetectionConfidence = float64(s1.DetectionConfidence)
  6701. s.LandmarkingConfidence = float64(s1.LandmarkingConfidence)
  6702. s.PanAngle = float64(s1.PanAngle)
  6703. s.RollAngle = float64(s1.RollAngle)
  6704. s.TiltAngle = float64(s1.TiltAngle)
  6705. return nil
  6706. }
  6707. // GoogleCloudVisionV1p3beta1FaceAnnotationLandmark: A face-specific
  6708. // landmark (for example, a face feature).
  6709. type GoogleCloudVisionV1p3beta1FaceAnnotationLandmark struct {
  6710. // Position: Face landmark position.
  6711. Position *GoogleCloudVisionV1p3beta1Position `json:"position,omitempty"`
  6712. // Type: Face landmark type.
  6713. //
  6714. // Possible values:
  6715. // "UNKNOWN_LANDMARK" - Unknown face landmark detected. Should not be
  6716. // filled.
  6717. // "LEFT_EYE" - Left eye.
  6718. // "RIGHT_EYE" - Right eye.
  6719. // "LEFT_OF_LEFT_EYEBROW" - Left of left eyebrow.
  6720. // "RIGHT_OF_LEFT_EYEBROW" - Right of left eyebrow.
  6721. // "LEFT_OF_RIGHT_EYEBROW" - Left of right eyebrow.
  6722. // "RIGHT_OF_RIGHT_EYEBROW" - Right of right eyebrow.
  6723. // "MIDPOINT_BETWEEN_EYES" - Midpoint between eyes.
  6724. // "NOSE_TIP" - Nose tip.
  6725. // "UPPER_LIP" - Upper lip.
  6726. // "LOWER_LIP" - Lower lip.
  6727. // "MOUTH_LEFT" - Mouth left.
  6728. // "MOUTH_RIGHT" - Mouth right.
  6729. // "MOUTH_CENTER" - Mouth center.
  6730. // "NOSE_BOTTOM_RIGHT" - Nose, bottom right.
  6731. // "NOSE_BOTTOM_LEFT" - Nose, bottom left.
  6732. // "NOSE_BOTTOM_CENTER" - Nose, bottom center.
  6733. // "LEFT_EYE_TOP_BOUNDARY" - Left eye, top boundary.
  6734. // "LEFT_EYE_RIGHT_CORNER" - Left eye, right corner.
  6735. // "LEFT_EYE_BOTTOM_BOUNDARY" - Left eye, bottom boundary.
  6736. // "LEFT_EYE_LEFT_CORNER" - Left eye, left corner.
  6737. // "RIGHT_EYE_TOP_BOUNDARY" - Right eye, top boundary.
  6738. // "RIGHT_EYE_RIGHT_CORNER" - Right eye, right corner.
  6739. // "RIGHT_EYE_BOTTOM_BOUNDARY" - Right eye, bottom boundary.
  6740. // "RIGHT_EYE_LEFT_CORNER" - Right eye, left corner.
  6741. // "LEFT_EYEBROW_UPPER_MIDPOINT" - Left eyebrow, upper midpoint.
  6742. // "RIGHT_EYEBROW_UPPER_MIDPOINT" - Right eyebrow, upper midpoint.
  6743. // "LEFT_EAR_TRAGION" - Left ear tragion.
  6744. // "RIGHT_EAR_TRAGION" - Right ear tragion.
  6745. // "LEFT_EYE_PUPIL" - Left eye pupil.
  6746. // "RIGHT_EYE_PUPIL" - Right eye pupil.
  6747. // "FOREHEAD_GLABELLA" - Forehead glabella.
  6748. // "CHIN_GNATHION" - Chin gnathion.
  6749. // "CHIN_LEFT_GONION" - Chin left gonion.
  6750. // "CHIN_RIGHT_GONION" - Chin right gonion.
  6751. Type string `json:"type,omitempty"`
  6752. // ForceSendFields is a list of field names (e.g. "Position") to
  6753. // unconditionally include in API requests. By default, fields with
  6754. // empty values are omitted from API requests. However, any non-pointer,
  6755. // non-interface field appearing in ForceSendFields will be sent to the
  6756. // server regardless of whether the field is empty or not. This may be
  6757. // used to include empty fields in Patch requests.
  6758. ForceSendFields []string `json:"-"`
  6759. // NullFields is a list of field names (e.g. "Position") to include in
  6760. // API requests with the JSON null value. By default, fields with empty
  6761. // values are omitted from API requests. However, any field with an
  6762. // empty value appearing in NullFields will be sent to the server as
  6763. // null. It is an error if a field in this list has a non-empty value.
  6764. // This may be used to include null fields in Patch requests.
  6765. NullFields []string `json:"-"`
  6766. }
  6767. func (s *GoogleCloudVisionV1p3beta1FaceAnnotationLandmark) MarshalJSON() ([]byte, error) {
  6768. type NoMethod GoogleCloudVisionV1p3beta1FaceAnnotationLandmark
  6769. raw := NoMethod(*s)
  6770. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6771. }
  6772. // GoogleCloudVisionV1p3beta1GcsDestination: The Google Cloud Storage
  6773. // location where the output will be written to.
  6774. type GoogleCloudVisionV1p3beta1GcsDestination struct {
  6775. // Uri: Google Cloud Storage URI where the results will be stored.
  6776. // Results will
  6777. // be in JSON format and preceded by its corresponding input URI. This
  6778. // field
  6779. // can either represent a single file, or a prefix for multiple
  6780. // outputs.
  6781. // Prefixes must end in a `/`.
  6782. //
  6783. // Examples:
  6784. //
  6785. // * File: gs://bucket-name/filename.json
  6786. // * Prefix: gs://bucket-name/prefix/here/
  6787. // * File: gs://bucket-name/prefix/here
  6788. //
  6789. // If multiple outputs, each response is still AnnotateFileResponse,
  6790. // each of
  6791. // which contains some subset of the full list of
  6792. // AnnotateImageResponse.
  6793. // Multiple outputs can happen if, for example, the output JSON is too
  6794. // large
  6795. // and overflows into multiple sharded files.
  6796. Uri string `json:"uri,omitempty"`
  6797. // ForceSendFields is a list of field names (e.g. "Uri") to
  6798. // unconditionally include in API requests. By default, fields with
  6799. // empty values are omitted from API requests. However, any non-pointer,
  6800. // non-interface field appearing in ForceSendFields will be sent to the
  6801. // server regardless of whether the field is empty or not. This may be
  6802. // used to include empty fields in Patch requests.
  6803. ForceSendFields []string `json:"-"`
  6804. // NullFields is a list of field names (e.g. "Uri") to include in API
  6805. // requests with the JSON null value. By default, fields with empty
  6806. // values are omitted from API requests. However, any field with an
  6807. // empty value appearing in NullFields will be sent to the server as
  6808. // null. It is an error if a field in this list has a non-empty value.
  6809. // This may be used to include null fields in Patch requests.
  6810. NullFields []string `json:"-"`
  6811. }
  6812. func (s *GoogleCloudVisionV1p3beta1GcsDestination) MarshalJSON() ([]byte, error) {
  6813. type NoMethod GoogleCloudVisionV1p3beta1GcsDestination
  6814. raw := NoMethod(*s)
  6815. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6816. }
  6817. // GoogleCloudVisionV1p3beta1GcsSource: The Google Cloud Storage
  6818. // location where the input will be read from.
  6819. type GoogleCloudVisionV1p3beta1GcsSource struct {
  6820. // Uri: Google Cloud Storage URI for the input file. This must only be
  6821. // a
  6822. // Google Cloud Storage object. Wildcards are not currently supported.
  6823. Uri string `json:"uri,omitempty"`
  6824. // ForceSendFields is a list of field names (e.g. "Uri") to
  6825. // unconditionally include in API requests. By default, fields with
  6826. // empty values are omitted from API requests. However, any non-pointer,
  6827. // non-interface field appearing in ForceSendFields will be sent to the
  6828. // server regardless of whether the field is empty or not. This may be
  6829. // used to include empty fields in Patch requests.
  6830. ForceSendFields []string `json:"-"`
  6831. // NullFields is a list of field names (e.g. "Uri") to include in API
  6832. // requests with the JSON null value. By default, fields with empty
  6833. // values are omitted from API requests. However, any field with an
  6834. // empty value appearing in NullFields will be sent to the server as
  6835. // null. It is an error if a field in this list has a non-empty value.
  6836. // This may be used to include null fields in Patch requests.
  6837. NullFields []string `json:"-"`
  6838. }
  6839. func (s *GoogleCloudVisionV1p3beta1GcsSource) MarshalJSON() ([]byte, error) {
  6840. type NoMethod GoogleCloudVisionV1p3beta1GcsSource
  6841. raw := NoMethod(*s)
  6842. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6843. }
  6844. // GoogleCloudVisionV1p3beta1ImageAnnotationContext: If an image was
  6845. // produced from a file (e.g. a PDF), this message gives
  6846. // information about the source of that image.
  6847. type GoogleCloudVisionV1p3beta1ImageAnnotationContext struct {
  6848. // PageNumber: If the file was a PDF or TIFF, this field gives the page
  6849. // number within
  6850. // the file used to produce the image.
  6851. PageNumber int64 `json:"pageNumber,omitempty"`
  6852. // Uri: The URI of the file used to produce the image.
  6853. Uri string `json:"uri,omitempty"`
  6854. // ForceSendFields is a list of field names (e.g. "PageNumber") to
  6855. // unconditionally include in API requests. By default, fields with
  6856. // empty values are omitted from API requests. However, any non-pointer,
  6857. // non-interface field appearing in ForceSendFields will be sent to the
  6858. // server regardless of whether the field is empty or not. This may be
  6859. // used to include empty fields in Patch requests.
  6860. ForceSendFields []string `json:"-"`
  6861. // NullFields is a list of field names (e.g. "PageNumber") to include in
  6862. // API requests with the JSON null value. By default, fields with empty
  6863. // values are omitted from API requests. However, any field with an
  6864. // empty value appearing in NullFields will be sent to the server as
  6865. // null. It is an error if a field in this list has a non-empty value.
  6866. // This may be used to include null fields in Patch requests.
  6867. NullFields []string `json:"-"`
  6868. }
  6869. func (s *GoogleCloudVisionV1p3beta1ImageAnnotationContext) MarshalJSON() ([]byte, error) {
  6870. type NoMethod GoogleCloudVisionV1p3beta1ImageAnnotationContext
  6871. raw := NoMethod(*s)
  6872. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6873. }
  6874. // GoogleCloudVisionV1p3beta1ImageProperties: Stores image properties,
  6875. // such as dominant colors.
  6876. type GoogleCloudVisionV1p3beta1ImageProperties struct {
  6877. // DominantColors: If present, dominant colors completed successfully.
  6878. DominantColors *GoogleCloudVisionV1p3beta1DominantColorsAnnotation `json:"dominantColors,omitempty"`
  6879. // ForceSendFields is a list of field names (e.g. "DominantColors") to
  6880. // unconditionally include in API requests. By default, fields with
  6881. // empty values are omitted from API requests. However, any non-pointer,
  6882. // non-interface field appearing in ForceSendFields will be sent to the
  6883. // server regardless of whether the field is empty or not. This may be
  6884. // used to include empty fields in Patch requests.
  6885. ForceSendFields []string `json:"-"`
  6886. // NullFields is a list of field names (e.g. "DominantColors") to
  6887. // include in API requests with the JSON null value. By default, fields
  6888. // with empty values are omitted from API requests. However, any field
  6889. // with an empty value appearing in NullFields will be sent to the
  6890. // server as null. It is an error if a field in this list has a
  6891. // non-empty value. This may be used to include null fields in Patch
  6892. // requests.
  6893. NullFields []string `json:"-"`
  6894. }
  6895. func (s *GoogleCloudVisionV1p3beta1ImageProperties) MarshalJSON() ([]byte, error) {
  6896. type NoMethod GoogleCloudVisionV1p3beta1ImageProperties
  6897. raw := NoMethod(*s)
  6898. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6899. }
  6900. // GoogleCloudVisionV1p3beta1ImportProductSetsResponse: Response message
  6901. // for the `ImportProductSets` method.
  6902. //
  6903. // This message is returned by
  6904. // the
  6905. // google.longrunning.Operations.GetOperation method in the
  6906. // returned
  6907. // google.longrunning.Operation.response field.
  6908. type GoogleCloudVisionV1p3beta1ImportProductSetsResponse struct {
  6909. // ReferenceImages: The list of reference_images that are imported
  6910. // successfully.
  6911. ReferenceImages []*GoogleCloudVisionV1p3beta1ReferenceImage `json:"referenceImages,omitempty"`
  6912. // Statuses: The rpc status for each ImportProductSet request, including
  6913. // both successes
  6914. // and errors.
  6915. //
  6916. // The number of statuses here matches the number of lines in the csv
  6917. // file,
  6918. // and statuses[i] stores the success or failure status of processing
  6919. // the i-th
  6920. // line of the csv, starting from line 0.
  6921. Statuses []*Status `json:"statuses,omitempty"`
  6922. // ForceSendFields is a list of field names (e.g. "ReferenceImages") to
  6923. // unconditionally include in API requests. By default, fields with
  6924. // empty values are omitted from API requests. However, any non-pointer,
  6925. // non-interface field appearing in ForceSendFields will be sent to the
  6926. // server regardless of whether the field is empty or not. This may be
  6927. // used to include empty fields in Patch requests.
  6928. ForceSendFields []string `json:"-"`
  6929. // NullFields is a list of field names (e.g. "ReferenceImages") to
  6930. // include in API requests with the JSON null value. By default, fields
  6931. // with empty values are omitted from API requests. However, any field
  6932. // with an empty value appearing in NullFields will be sent to the
  6933. // server as null. It is an error if a field in this list has a
  6934. // non-empty value. This may be used to include null fields in Patch
  6935. // requests.
  6936. NullFields []string `json:"-"`
  6937. }
  6938. func (s *GoogleCloudVisionV1p3beta1ImportProductSetsResponse) MarshalJSON() ([]byte, error) {
  6939. type NoMethod GoogleCloudVisionV1p3beta1ImportProductSetsResponse
  6940. raw := NoMethod(*s)
  6941. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6942. }
  6943. // GoogleCloudVisionV1p3beta1InputConfig: The desired input location and
  6944. // metadata.
  6945. type GoogleCloudVisionV1p3beta1InputConfig struct {
  6946. // GcsSource: The Google Cloud Storage location to read the input from.
  6947. GcsSource *GoogleCloudVisionV1p3beta1GcsSource `json:"gcsSource,omitempty"`
  6948. // MimeType: The type of the file. Currently only "application/pdf" and
  6949. // "image/tiff"
  6950. // are supported. Wildcards are not supported.
  6951. MimeType string `json:"mimeType,omitempty"`
  6952. // ForceSendFields is a list of field names (e.g. "GcsSource") to
  6953. // unconditionally include in API requests. By default, fields with
  6954. // empty values are omitted from API requests. However, any non-pointer,
  6955. // non-interface field appearing in ForceSendFields will be sent to the
  6956. // server regardless of whether the field is empty or not. This may be
  6957. // used to include empty fields in Patch requests.
  6958. ForceSendFields []string `json:"-"`
  6959. // NullFields is a list of field names (e.g. "GcsSource") to include in
  6960. // API requests with the JSON null value. By default, fields with empty
  6961. // values are omitted from API requests. However, any field with an
  6962. // empty value appearing in NullFields will be sent to the server as
  6963. // null. It is an error if a field in this list has a non-empty value.
  6964. // This may be used to include null fields in Patch requests.
  6965. NullFields []string `json:"-"`
  6966. }
  6967. func (s *GoogleCloudVisionV1p3beta1InputConfig) MarshalJSON() ([]byte, error) {
  6968. type NoMethod GoogleCloudVisionV1p3beta1InputConfig
  6969. raw := NoMethod(*s)
  6970. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6971. }
  6972. // GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation: Set of detected
  6973. // objects with bounding boxes.
  6974. type GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation struct {
  6975. // BoundingPoly: Image region to which this object belongs. This must be
  6976. // populated.
  6977. BoundingPoly *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPoly,omitempty"`
  6978. // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn".
  6979. // For more
  6980. // information,
  6981. // see
  6982. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  6983. LanguageCode string `json:"languageCode,omitempty"`
  6984. // Mid: Object ID that should align with EntityAnnotation mid.
  6985. Mid string `json:"mid,omitempty"`
  6986. // Name: Object name, expressed in its `language_code` language.
  6987. Name string `json:"name,omitempty"`
  6988. // Score: Score of the result. Range [0, 1].
  6989. Score float64 `json:"score,omitempty"`
  6990. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  6991. // 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. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  6998. // in API requests with the JSON null value. By default, fields with
  6999. // empty values are omitted from API requests. However, any field with
  7000. // an empty value appearing in NullFields will be sent to the server as
  7001. // null. It is an error if a field in this list has a non-empty value.
  7002. // This may be used to include null fields in Patch requests.
  7003. NullFields []string `json:"-"`
  7004. }
  7005. func (s *GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation) MarshalJSON() ([]byte, error) {
  7006. type NoMethod GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation
  7007. raw := NoMethod(*s)
  7008. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7009. }
  7010. func (s *GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation) UnmarshalJSON(data []byte) error {
  7011. type NoMethod GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation
  7012. var s1 struct {
  7013. Score gensupport.JSONFloat64 `json:"score"`
  7014. *NoMethod
  7015. }
  7016. s1.NoMethod = (*NoMethod)(s)
  7017. if err := json.Unmarshal(data, &s1); err != nil {
  7018. return err
  7019. }
  7020. s.Score = float64(s1.Score)
  7021. return nil
  7022. }
  7023. // GoogleCloudVisionV1p3beta1LocationInfo: Detected entity location
  7024. // information.
  7025. type GoogleCloudVisionV1p3beta1LocationInfo struct {
  7026. // LatLng: lat/long location coordinates.
  7027. LatLng *LatLng `json:"latLng,omitempty"`
  7028. // ForceSendFields is a list of field names (e.g. "LatLng") 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. // NullFields is a list of field names (e.g. "LatLng") to include in API
  7036. // requests with the JSON null value. By default, fields with empty
  7037. // values are omitted from API requests. However, any field with an
  7038. // empty value appearing in NullFields will be sent to the server as
  7039. // null. It is an error if a field in this list has a non-empty value.
  7040. // This may be used to include null fields in Patch requests.
  7041. NullFields []string `json:"-"`
  7042. }
  7043. func (s *GoogleCloudVisionV1p3beta1LocationInfo) MarshalJSON() ([]byte, error) {
  7044. type NoMethod GoogleCloudVisionV1p3beta1LocationInfo
  7045. raw := NoMethod(*s)
  7046. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7047. }
  7048. // GoogleCloudVisionV1p3beta1NormalizedVertex: A vertex represents a 2D
  7049. // point in the image.
  7050. // NOTE: the normalized vertex coordinates are relative to the original
  7051. // image
  7052. // and range from 0 to 1.
  7053. type GoogleCloudVisionV1p3beta1NormalizedVertex struct {
  7054. // X: X coordinate.
  7055. X float64 `json:"x,omitempty"`
  7056. // Y: Y coordinate.
  7057. Y float64 `json:"y,omitempty"`
  7058. // ForceSendFields is a list of field names (e.g. "X") to
  7059. // unconditionally include in API requests. By default, fields with
  7060. // empty values are omitted from API requests. However, any non-pointer,
  7061. // non-interface field appearing in ForceSendFields will be sent to the
  7062. // server regardless of whether the field is empty or not. This may be
  7063. // used to include empty fields in Patch requests.
  7064. ForceSendFields []string `json:"-"`
  7065. // NullFields is a list of field names (e.g. "X") to include in API
  7066. // requests with the JSON null value. By default, fields with empty
  7067. // values are omitted from API requests. However, any field with an
  7068. // empty value appearing in NullFields will be sent to the server as
  7069. // null. It is an error if a field in this list has a non-empty value.
  7070. // This may be used to include null fields in Patch requests.
  7071. NullFields []string `json:"-"`
  7072. }
  7073. func (s *GoogleCloudVisionV1p3beta1NormalizedVertex) MarshalJSON() ([]byte, error) {
  7074. type NoMethod GoogleCloudVisionV1p3beta1NormalizedVertex
  7075. raw := NoMethod(*s)
  7076. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7077. }
  7078. func (s *GoogleCloudVisionV1p3beta1NormalizedVertex) UnmarshalJSON(data []byte) error {
  7079. type NoMethod GoogleCloudVisionV1p3beta1NormalizedVertex
  7080. var s1 struct {
  7081. X gensupport.JSONFloat64 `json:"x"`
  7082. Y gensupport.JSONFloat64 `json:"y"`
  7083. *NoMethod
  7084. }
  7085. s1.NoMethod = (*NoMethod)(s)
  7086. if err := json.Unmarshal(data, &s1); err != nil {
  7087. return err
  7088. }
  7089. s.X = float64(s1.X)
  7090. s.Y = float64(s1.Y)
  7091. return nil
  7092. }
  7093. // GoogleCloudVisionV1p3beta1OperationMetadata: Contains metadata for
  7094. // the BatchAnnotateImages operation.
  7095. type GoogleCloudVisionV1p3beta1OperationMetadata struct {
  7096. // CreateTime: The time when the batch request was received.
  7097. CreateTime string `json:"createTime,omitempty"`
  7098. // State: Current state of the batch operation.
  7099. //
  7100. // Possible values:
  7101. // "STATE_UNSPECIFIED" - Invalid.
  7102. // "CREATED" - Request is received.
  7103. // "RUNNING" - Request is actively being processed.
  7104. // "DONE" - The batch processing is done.
  7105. // "CANCELLED" - The batch processing was cancelled.
  7106. State string `json:"state,omitempty"`
  7107. // UpdateTime: The time when the operation result was last updated.
  7108. UpdateTime string `json:"updateTime,omitempty"`
  7109. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  7110. // unconditionally include in API requests. By default, fields with
  7111. // empty values are omitted from API requests. However, any non-pointer,
  7112. // non-interface field appearing in ForceSendFields will be sent to the
  7113. // server regardless of whether the field is empty or not. This may be
  7114. // used to include empty fields in Patch requests.
  7115. ForceSendFields []string `json:"-"`
  7116. // NullFields is a list of field names (e.g. "CreateTime") to include in
  7117. // API requests with the JSON null value. By default, fields with empty
  7118. // values are omitted from API requests. However, any field with an
  7119. // empty value appearing in NullFields will be sent to the server as
  7120. // null. It is an error if a field in this list has a non-empty value.
  7121. // This may be used to include null fields in Patch requests.
  7122. NullFields []string `json:"-"`
  7123. }
  7124. func (s *GoogleCloudVisionV1p3beta1OperationMetadata) MarshalJSON() ([]byte, error) {
  7125. type NoMethod GoogleCloudVisionV1p3beta1OperationMetadata
  7126. raw := NoMethod(*s)
  7127. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7128. }
  7129. // GoogleCloudVisionV1p3beta1OutputConfig: The desired output location
  7130. // and metadata.
  7131. type GoogleCloudVisionV1p3beta1OutputConfig struct {
  7132. // BatchSize: The max number of response protos to put into each output
  7133. // JSON file on
  7134. // Google Cloud Storage.
  7135. // The valid range is [1, 100]. If not specified, the default value is
  7136. // 20.
  7137. //
  7138. // For example, for one pdf file with 100 pages, 100 response protos
  7139. // will
  7140. // be generated. If `batch_size` = 20, then 5 json files each
  7141. // containing 20 response protos will be written under the
  7142. // prefix
  7143. // `gcs_destination`.`uri`.
  7144. //
  7145. // Currently, batch_size only applies to GcsDestination, with potential
  7146. // future
  7147. // support for other output configurations.
  7148. BatchSize int64 `json:"batchSize,omitempty"`
  7149. // GcsDestination: The Google Cloud Storage location to write the
  7150. // output(s) to.
  7151. GcsDestination *GoogleCloudVisionV1p3beta1GcsDestination `json:"gcsDestination,omitempty"`
  7152. // ForceSendFields is a list of field names (e.g. "BatchSize") to
  7153. // unconditionally include in API requests. By default, fields with
  7154. // empty values are omitted from API requests. However, any non-pointer,
  7155. // non-interface field appearing in ForceSendFields will be sent to the
  7156. // server regardless of whether the field is empty or not. This may be
  7157. // used to include empty fields in Patch requests.
  7158. ForceSendFields []string `json:"-"`
  7159. // NullFields is a list of field names (e.g. "BatchSize") to include in
  7160. // API requests with the JSON null value. By default, fields with empty
  7161. // values are omitted from API requests. However, any field with an
  7162. // empty value appearing in NullFields will be sent to the server as
  7163. // null. It is an error if a field in this list has a non-empty value.
  7164. // This may be used to include null fields in Patch requests.
  7165. NullFields []string `json:"-"`
  7166. }
  7167. func (s *GoogleCloudVisionV1p3beta1OutputConfig) MarshalJSON() ([]byte, error) {
  7168. type NoMethod GoogleCloudVisionV1p3beta1OutputConfig
  7169. raw := NoMethod(*s)
  7170. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7171. }
  7172. // GoogleCloudVisionV1p3beta1Page: Detected page from OCR.
  7173. type GoogleCloudVisionV1p3beta1Page struct {
  7174. // Blocks: List of blocks of text, images etc on this page.
  7175. Blocks []*GoogleCloudVisionV1p3beta1Block `json:"blocks,omitempty"`
  7176. // Confidence: Confidence of the OCR results on the page. Range [0, 1].
  7177. Confidence float64 `json:"confidence,omitempty"`
  7178. // Height: Page height. For PDFs the unit is points. For images
  7179. // (including
  7180. // TIFFs) the unit is pixels.
  7181. Height int64 `json:"height,omitempty"`
  7182. // Property: Additional information detected on the page.
  7183. Property *GoogleCloudVisionV1p3beta1TextAnnotationTextProperty `json:"property,omitempty"`
  7184. // Width: Page width. For PDFs the unit is points. For images
  7185. // (including
  7186. // TIFFs) the unit is pixels.
  7187. Width int64 `json:"width,omitempty"`
  7188. // ForceSendFields is a list of field names (e.g. "Blocks") to
  7189. // unconditionally include in API requests. By default, fields with
  7190. // empty values are omitted from API requests. However, any non-pointer,
  7191. // non-interface field appearing in ForceSendFields will be sent to the
  7192. // server regardless of whether the field is empty or not. This may be
  7193. // used to include empty fields in Patch requests.
  7194. ForceSendFields []string `json:"-"`
  7195. // NullFields is a list of field names (e.g. "Blocks") to include in API
  7196. // requests with the JSON null value. By default, fields with empty
  7197. // values are omitted from API requests. However, any field with an
  7198. // empty value appearing in NullFields will be sent to the server as
  7199. // null. It is an error if a field in this list has a non-empty value.
  7200. // This may be used to include null fields in Patch requests.
  7201. NullFields []string `json:"-"`
  7202. }
  7203. func (s *GoogleCloudVisionV1p3beta1Page) MarshalJSON() ([]byte, error) {
  7204. type NoMethod GoogleCloudVisionV1p3beta1Page
  7205. raw := NoMethod(*s)
  7206. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7207. }
  7208. func (s *GoogleCloudVisionV1p3beta1Page) UnmarshalJSON(data []byte) error {
  7209. type NoMethod GoogleCloudVisionV1p3beta1Page
  7210. var s1 struct {
  7211. Confidence gensupport.JSONFloat64 `json:"confidence"`
  7212. *NoMethod
  7213. }
  7214. s1.NoMethod = (*NoMethod)(s)
  7215. if err := json.Unmarshal(data, &s1); err != nil {
  7216. return err
  7217. }
  7218. s.Confidence = float64(s1.Confidence)
  7219. return nil
  7220. }
  7221. // GoogleCloudVisionV1p3beta1Paragraph: Structural unit of text
  7222. // representing a number of words in certain order.
  7223. type GoogleCloudVisionV1p3beta1Paragraph struct {
  7224. // BoundingBox: The bounding box for the paragraph.
  7225. // The vertices are in the order of top-left, top-right,
  7226. // bottom-right,
  7227. // bottom-left. When a rotation of the bounding box is detected the
  7228. // rotation
  7229. // is represented as around the top-left corner as defined when the text
  7230. // is
  7231. // read in the 'natural' orientation.
  7232. // For example:
  7233. // * when the text is horizontal it might look like:
  7234. // 0----1
  7235. // | |
  7236. // 3----2
  7237. // * when it's rotated 180 degrees around the top-left corner it
  7238. // becomes:
  7239. // 2----3
  7240. // | |
  7241. // 1----0
  7242. // and the vertex order will still be (0, 1, 2, 3).
  7243. BoundingBox *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingBox,omitempty"`
  7244. // Confidence: Confidence of the OCR results for the paragraph. Range
  7245. // [0, 1].
  7246. Confidence float64 `json:"confidence,omitempty"`
  7247. // Property: Additional information detected for the paragraph.
  7248. Property *GoogleCloudVisionV1p3beta1TextAnnotationTextProperty `json:"property,omitempty"`
  7249. // Words: List of words in this paragraph.
  7250. Words []*GoogleCloudVisionV1p3beta1Word `json:"words,omitempty"`
  7251. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  7252. // unconditionally include in API requests. By default, fields with
  7253. // empty values are omitted from API requests. However, any non-pointer,
  7254. // non-interface field appearing in ForceSendFields will be sent to the
  7255. // server regardless of whether the field is empty or not. This may be
  7256. // used to include empty fields in Patch requests.
  7257. ForceSendFields []string `json:"-"`
  7258. // NullFields is a list of field names (e.g. "BoundingBox") to include
  7259. // in API requests with the JSON null value. By default, fields with
  7260. // empty values are omitted from API requests. However, any field with
  7261. // an empty value appearing in NullFields will be sent to the server as
  7262. // null. It is an error if a field in this list has a non-empty value.
  7263. // This may be used to include null fields in Patch requests.
  7264. NullFields []string `json:"-"`
  7265. }
  7266. func (s *GoogleCloudVisionV1p3beta1Paragraph) MarshalJSON() ([]byte, error) {
  7267. type NoMethod GoogleCloudVisionV1p3beta1Paragraph
  7268. raw := NoMethod(*s)
  7269. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7270. }
  7271. func (s *GoogleCloudVisionV1p3beta1Paragraph) UnmarshalJSON(data []byte) error {
  7272. type NoMethod GoogleCloudVisionV1p3beta1Paragraph
  7273. var s1 struct {
  7274. Confidence gensupport.JSONFloat64 `json:"confidence"`
  7275. *NoMethod
  7276. }
  7277. s1.NoMethod = (*NoMethod)(s)
  7278. if err := json.Unmarshal(data, &s1); err != nil {
  7279. return err
  7280. }
  7281. s.Confidence = float64(s1.Confidence)
  7282. return nil
  7283. }
  7284. // GoogleCloudVisionV1p3beta1Position: A 3D position in the image, used
  7285. // primarily for Face detection landmarks.
  7286. // A valid Position must have both x and y coordinates.
  7287. // The position coordinates are in the same scale as the original image.
  7288. type GoogleCloudVisionV1p3beta1Position struct {
  7289. // X: X coordinate.
  7290. X float64 `json:"x,omitempty"`
  7291. // Y: Y coordinate.
  7292. Y float64 `json:"y,omitempty"`
  7293. // Z: Z coordinate (or depth).
  7294. Z float64 `json:"z,omitempty"`
  7295. // ForceSendFields is a list of field names (e.g. "X") to
  7296. // unconditionally include in API requests. By default, fields with
  7297. // empty values are omitted from API requests. However, any non-pointer,
  7298. // non-interface field appearing in ForceSendFields will be sent to the
  7299. // server regardless of whether the field is empty or not. This may be
  7300. // used to include empty fields in Patch requests.
  7301. ForceSendFields []string `json:"-"`
  7302. // NullFields is a list of field names (e.g. "X") to include in API
  7303. // requests with the JSON null value. By default, fields with empty
  7304. // values are omitted from API requests. However, any field with an
  7305. // empty value appearing in NullFields will be sent to the server as
  7306. // null. It is an error if a field in this list has a non-empty value.
  7307. // This may be used to include null fields in Patch requests.
  7308. NullFields []string `json:"-"`
  7309. }
  7310. func (s *GoogleCloudVisionV1p3beta1Position) MarshalJSON() ([]byte, error) {
  7311. type NoMethod GoogleCloudVisionV1p3beta1Position
  7312. raw := NoMethod(*s)
  7313. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7314. }
  7315. func (s *GoogleCloudVisionV1p3beta1Position) UnmarshalJSON(data []byte) error {
  7316. type NoMethod GoogleCloudVisionV1p3beta1Position
  7317. var s1 struct {
  7318. X gensupport.JSONFloat64 `json:"x"`
  7319. Y gensupport.JSONFloat64 `json:"y"`
  7320. Z gensupport.JSONFloat64 `json:"z"`
  7321. *NoMethod
  7322. }
  7323. s1.NoMethod = (*NoMethod)(s)
  7324. if err := json.Unmarshal(data, &s1); err != nil {
  7325. return err
  7326. }
  7327. s.X = float64(s1.X)
  7328. s.Y = float64(s1.Y)
  7329. s.Z = float64(s1.Z)
  7330. return nil
  7331. }
  7332. // GoogleCloudVisionV1p3beta1Product: A Product contains
  7333. // ReferenceImages.
  7334. type GoogleCloudVisionV1p3beta1Product struct {
  7335. // Description: User-provided metadata to be stored with this product.
  7336. // Must be at most 4096
  7337. // characters long.
  7338. Description string `json:"description,omitempty"`
  7339. // DisplayName: The user-provided name for this Product. Must not be
  7340. // empty. Must be at most
  7341. // 4096 characters long.
  7342. DisplayName string `json:"displayName,omitempty"`
  7343. // Name: The resource name of the product.
  7344. //
  7345. // Format
  7346. // is:
  7347. // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
  7348. //
  7349. // This field is ignored when creating a product.
  7350. Name string `json:"name,omitempty"`
  7351. // ProductCategory: The category for the product identified by the
  7352. // reference image. This should
  7353. // be either "homegoods", "apparel", or "toys".
  7354. //
  7355. // This field is immutable.
  7356. ProductCategory string `json:"productCategory,omitempty"`
  7357. // ProductLabels: Key-value pairs that can be attached to a product. At
  7358. // query time,
  7359. // constraints can be specified based on the product_labels.
  7360. //
  7361. // Note that integer values can be provided as strings, e.g. "1199".
  7362. // Only
  7363. // strings with integer values can match a range-based restriction which
  7364. // is
  7365. // to be supported soon.
  7366. //
  7367. // Multiple values can be assigned to the same key. One product may have
  7368. // up to
  7369. // 100 product_labels.
  7370. ProductLabels []*GoogleCloudVisionV1p3beta1ProductKeyValue `json:"productLabels,omitempty"`
  7371. // ForceSendFields is a list of field names (e.g. "Description") to
  7372. // unconditionally include in API requests. By default, fields with
  7373. // empty values are omitted from API requests. However, any non-pointer,
  7374. // non-interface field appearing in ForceSendFields will be sent to the
  7375. // server regardless of whether the field is empty or not. This may be
  7376. // used to include empty fields in Patch requests.
  7377. ForceSendFields []string `json:"-"`
  7378. // NullFields is a list of field names (e.g. "Description") to include
  7379. // in API requests with the JSON null value. By default, fields with
  7380. // empty values are omitted from API requests. However, any field with
  7381. // an empty value appearing in NullFields will be sent to the server as
  7382. // null. It is an error if a field in this list has a non-empty value.
  7383. // This may be used to include null fields in Patch requests.
  7384. NullFields []string `json:"-"`
  7385. }
  7386. func (s *GoogleCloudVisionV1p3beta1Product) MarshalJSON() ([]byte, error) {
  7387. type NoMethod GoogleCloudVisionV1p3beta1Product
  7388. raw := NoMethod(*s)
  7389. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7390. }
  7391. // GoogleCloudVisionV1p3beta1ProductKeyValue: A product label
  7392. // represented as a key-value pair.
  7393. type GoogleCloudVisionV1p3beta1ProductKeyValue struct {
  7394. // Key: The key of the label attached to the product. Cannot be empty
  7395. // and cannot
  7396. // exceed 128 bytes.
  7397. Key string `json:"key,omitempty"`
  7398. // Value: The value of the label attached to the product. Cannot be
  7399. // empty and
  7400. // cannot exceed 128 bytes.
  7401. Value string `json:"value,omitempty"`
  7402. // ForceSendFields is a list of field names (e.g. "Key") to
  7403. // unconditionally include in API requests. By default, fields with
  7404. // empty values are omitted from API requests. However, any non-pointer,
  7405. // non-interface field appearing in ForceSendFields will be sent to the
  7406. // server regardless of whether the field is empty or not. This may be
  7407. // used to include empty fields in Patch requests.
  7408. ForceSendFields []string `json:"-"`
  7409. // NullFields is a list of field names (e.g. "Key") to include in API
  7410. // requests with the JSON null value. By default, fields with empty
  7411. // values are omitted from API requests. However, any field with an
  7412. // empty value appearing in NullFields will be sent to the server as
  7413. // null. It is an error if a field in this list has a non-empty value.
  7414. // This may be used to include null fields in Patch requests.
  7415. NullFields []string `json:"-"`
  7416. }
  7417. func (s *GoogleCloudVisionV1p3beta1ProductKeyValue) MarshalJSON() ([]byte, error) {
  7418. type NoMethod GoogleCloudVisionV1p3beta1ProductKeyValue
  7419. raw := NoMethod(*s)
  7420. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7421. }
  7422. // GoogleCloudVisionV1p3beta1ProductSearchResults: Results for a product
  7423. // search request.
  7424. type GoogleCloudVisionV1p3beta1ProductSearchResults struct {
  7425. // IndexTime: Timestamp of the index which provided these results.
  7426. // Changes made after
  7427. // this time are not reflected in the current results.
  7428. IndexTime string `json:"indexTime,omitempty"`
  7429. // ProductGroupedResults: List of results grouped by products detected
  7430. // in the query image. Each entry
  7431. // corresponds to one bounding polygon in the query image, and contains
  7432. // the
  7433. // matching products specific to that region. There may be duplicate
  7434. // product
  7435. // matches in the union of all the per-product results.
  7436. ProductGroupedResults []*GoogleCloudVisionV1p3beta1ProductSearchResultsGroupedResult `json:"productGroupedResults,omitempty"`
  7437. // Results: List of results, one for each product match.
  7438. Results []*GoogleCloudVisionV1p3beta1ProductSearchResultsResult `json:"results,omitempty"`
  7439. // ForceSendFields is a list of field names (e.g. "IndexTime") to
  7440. // unconditionally include in API requests. By default, fields with
  7441. // empty values are omitted from API requests. However, any non-pointer,
  7442. // non-interface field appearing in ForceSendFields will be sent to the
  7443. // server regardless of whether the field is empty or not. This may be
  7444. // used to include empty fields in Patch requests.
  7445. ForceSendFields []string `json:"-"`
  7446. // NullFields is a list of field names (e.g. "IndexTime") to include in
  7447. // API requests with the JSON null value. By default, fields with empty
  7448. // values are omitted from API requests. However, any field with an
  7449. // empty value appearing in NullFields will be sent to the server as
  7450. // null. It is an error if a field in this list has a non-empty value.
  7451. // This may be used to include null fields in Patch requests.
  7452. NullFields []string `json:"-"`
  7453. }
  7454. func (s *GoogleCloudVisionV1p3beta1ProductSearchResults) MarshalJSON() ([]byte, error) {
  7455. type NoMethod GoogleCloudVisionV1p3beta1ProductSearchResults
  7456. raw := NoMethod(*s)
  7457. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7458. }
  7459. // GoogleCloudVisionV1p3beta1ProductSearchResultsGroupedResult:
  7460. // Information about the products similar to a single product in a
  7461. // query
  7462. // image.
  7463. type GoogleCloudVisionV1p3beta1ProductSearchResultsGroupedResult struct {
  7464. // BoundingPoly: The bounding polygon around the product detected in the
  7465. // query image.
  7466. BoundingPoly *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPoly,omitempty"`
  7467. // Results: List of results, one for each product match.
  7468. Results []*GoogleCloudVisionV1p3beta1ProductSearchResultsResult `json:"results,omitempty"`
  7469. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  7470. // unconditionally include in API requests. By default, fields with
  7471. // empty values are omitted from API requests. However, any non-pointer,
  7472. // non-interface field appearing in ForceSendFields will be sent to the
  7473. // server regardless of whether the field is empty or not. This may be
  7474. // used to include empty fields in Patch requests.
  7475. ForceSendFields []string `json:"-"`
  7476. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  7477. // in API requests with the JSON null value. By default, fields with
  7478. // empty values are omitted from API requests. However, any field with
  7479. // an empty value appearing in NullFields will be sent to the server as
  7480. // null. It is an error if a field in this list has a non-empty value.
  7481. // This may be used to include null fields in Patch requests.
  7482. NullFields []string `json:"-"`
  7483. }
  7484. func (s *GoogleCloudVisionV1p3beta1ProductSearchResultsGroupedResult) MarshalJSON() ([]byte, error) {
  7485. type NoMethod GoogleCloudVisionV1p3beta1ProductSearchResultsGroupedResult
  7486. raw := NoMethod(*s)
  7487. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7488. }
  7489. // GoogleCloudVisionV1p3beta1ProductSearchResultsResult: Information
  7490. // about a product.
  7491. type GoogleCloudVisionV1p3beta1ProductSearchResultsResult struct {
  7492. // Image: The resource name of the image from the product that is the
  7493. // closest match
  7494. // to the query.
  7495. Image string `json:"image,omitempty"`
  7496. // Product: The Product.
  7497. Product *GoogleCloudVisionV1p3beta1Product `json:"product,omitempty"`
  7498. // Score: A confidence level on the match, ranging from 0 (no
  7499. // confidence) to
  7500. // 1 (full confidence).
  7501. Score float64 `json:"score,omitempty"`
  7502. // ForceSendFields is a list of field names (e.g. "Image") to
  7503. // unconditionally include in API requests. By default, fields with
  7504. // empty values are omitted from API requests. However, any non-pointer,
  7505. // non-interface field appearing in ForceSendFields will be sent to the
  7506. // server regardless of whether the field is empty or not. This may be
  7507. // used to include empty fields in Patch requests.
  7508. ForceSendFields []string `json:"-"`
  7509. // NullFields is a list of field names (e.g. "Image") to include in API
  7510. // requests with the JSON null value. By default, fields with empty
  7511. // values are omitted from API requests. However, any field with an
  7512. // empty value appearing in NullFields will be sent to the server as
  7513. // null. It is an error if a field in this list has a non-empty value.
  7514. // This may be used to include null fields in Patch requests.
  7515. NullFields []string `json:"-"`
  7516. }
  7517. func (s *GoogleCloudVisionV1p3beta1ProductSearchResultsResult) MarshalJSON() ([]byte, error) {
  7518. type NoMethod GoogleCloudVisionV1p3beta1ProductSearchResultsResult
  7519. raw := NoMethod(*s)
  7520. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7521. }
  7522. func (s *GoogleCloudVisionV1p3beta1ProductSearchResultsResult) UnmarshalJSON(data []byte) error {
  7523. type NoMethod GoogleCloudVisionV1p3beta1ProductSearchResultsResult
  7524. var s1 struct {
  7525. Score gensupport.JSONFloat64 `json:"score"`
  7526. *NoMethod
  7527. }
  7528. s1.NoMethod = (*NoMethod)(s)
  7529. if err := json.Unmarshal(data, &s1); err != nil {
  7530. return err
  7531. }
  7532. s.Score = float64(s1.Score)
  7533. return nil
  7534. }
  7535. // GoogleCloudVisionV1p3beta1Property: A `Property` consists of a
  7536. // user-supplied name/value pair.
  7537. type GoogleCloudVisionV1p3beta1Property struct {
  7538. // Name: Name of the property.
  7539. Name string `json:"name,omitempty"`
  7540. // Uint64Value: Value of numeric properties.
  7541. Uint64Value uint64 `json:"uint64Value,omitempty,string"`
  7542. // Value: Value of the property.
  7543. Value string `json:"value,omitempty"`
  7544. // ForceSendFields is a list of field names (e.g. "Name") to
  7545. // unconditionally include in API requests. By default, fields with
  7546. // empty values are omitted from API requests. However, any non-pointer,
  7547. // non-interface field appearing in ForceSendFields will be sent to the
  7548. // server regardless of whether the field is empty or not. This may be
  7549. // used to include empty fields in Patch requests.
  7550. ForceSendFields []string `json:"-"`
  7551. // NullFields is a list of field names (e.g. "Name") to include in API
  7552. // requests with the JSON null value. By default, fields with empty
  7553. // values are omitted from API requests. However, any field with an
  7554. // empty value appearing in NullFields will be sent to the server as
  7555. // null. It is an error if a field in this list has a non-empty value.
  7556. // This may be used to include null fields in Patch requests.
  7557. NullFields []string `json:"-"`
  7558. }
  7559. func (s *GoogleCloudVisionV1p3beta1Property) MarshalJSON() ([]byte, error) {
  7560. type NoMethod GoogleCloudVisionV1p3beta1Property
  7561. raw := NoMethod(*s)
  7562. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7563. }
  7564. // GoogleCloudVisionV1p3beta1ReferenceImage: A `ReferenceImage`
  7565. // represents a product image and its associated metadata,
  7566. // such as bounding boxes.
  7567. type GoogleCloudVisionV1p3beta1ReferenceImage struct {
  7568. // BoundingPolys: Bounding polygons around the areas of interest in the
  7569. // reference image.
  7570. // Optional. If this field is empty, the system will try to detect
  7571. // regions of
  7572. // interest. At most 10 bounding polygons will be used.
  7573. //
  7574. // The provided shape is converted into a non-rotated rectangle.
  7575. // Once
  7576. // converted, the small edge of the rectangle must be greater than or
  7577. // equal
  7578. // to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok;
  7579. // 1:5
  7580. // is not).
  7581. BoundingPolys []*GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPolys,omitempty"`
  7582. // Name: The resource name of the reference image.
  7583. //
  7584. // Format
  7585. // is:
  7586. //
  7587. // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referen
  7588. // ceImages/IMAGE_ID`.
  7589. //
  7590. // This field is ignored when creating a reference image.
  7591. Name string `json:"name,omitempty"`
  7592. // Uri: The Google Cloud Storage URI of the reference image.
  7593. //
  7594. // The URI must start with `gs://`.
  7595. //
  7596. // Required.
  7597. Uri string `json:"uri,omitempty"`
  7598. // ForceSendFields is a list of field names (e.g. "BoundingPolys") to
  7599. // unconditionally include in API requests. By default, fields with
  7600. // empty values are omitted from API requests. However, any non-pointer,
  7601. // non-interface field appearing in ForceSendFields will be sent to the
  7602. // server regardless of whether the field is empty or not. This may be
  7603. // used to include empty fields in Patch requests.
  7604. ForceSendFields []string `json:"-"`
  7605. // NullFields is a list of field names (e.g. "BoundingPolys") to include
  7606. // in API requests with the JSON null value. By default, fields with
  7607. // empty values are omitted from API requests. However, any field with
  7608. // an empty value appearing in NullFields will be sent to the server as
  7609. // null. It is an error if a field in this list has a non-empty value.
  7610. // This may be used to include null fields in Patch requests.
  7611. NullFields []string `json:"-"`
  7612. }
  7613. func (s *GoogleCloudVisionV1p3beta1ReferenceImage) MarshalJSON() ([]byte, error) {
  7614. type NoMethod GoogleCloudVisionV1p3beta1ReferenceImage
  7615. raw := NoMethod(*s)
  7616. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7617. }
  7618. // GoogleCloudVisionV1p3beta1SafeSearchAnnotation: Set of features
  7619. // pertaining to the image, computed by computer vision
  7620. // methods over safe-search verticals (for example, adult, spoof,
  7621. // medical,
  7622. // violence).
  7623. type GoogleCloudVisionV1p3beta1SafeSearchAnnotation struct {
  7624. // Adult: Represents the adult content likelihood for the image. Adult
  7625. // content may
  7626. // contain elements such as nudity, pornographic images or cartoons,
  7627. // or
  7628. // sexual activities.
  7629. //
  7630. // Possible values:
  7631. // "UNKNOWN" - Unknown likelihood.
  7632. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  7633. // specified vertical.
  7634. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  7635. // vertical.
  7636. // "POSSIBLE" - It is possible that the image belongs to the specified
  7637. // vertical.
  7638. // "LIKELY" - It is likely that the image belongs to the specified
  7639. // vertical.
  7640. // "VERY_LIKELY" - It is very likely that the image belongs to the
  7641. // specified vertical.
  7642. Adult string `json:"adult,omitempty"`
  7643. // Medical: Likelihood that this is a medical image.
  7644. //
  7645. // Possible values:
  7646. // "UNKNOWN" - Unknown likelihood.
  7647. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  7648. // specified vertical.
  7649. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  7650. // vertical.
  7651. // "POSSIBLE" - It is possible that the image belongs to the specified
  7652. // vertical.
  7653. // "LIKELY" - It is likely that the image belongs to the specified
  7654. // vertical.
  7655. // "VERY_LIKELY" - It is very likely that the image belongs to the
  7656. // specified vertical.
  7657. Medical string `json:"medical,omitempty"`
  7658. // Racy: Likelihood that the request image contains racy content. Racy
  7659. // content may
  7660. // include (but is not limited to) skimpy or sheer clothing,
  7661. // strategically
  7662. // covered nudity, lewd or provocative poses, or close-ups of
  7663. // sensitive
  7664. // body areas.
  7665. //
  7666. // Possible values:
  7667. // "UNKNOWN" - Unknown likelihood.
  7668. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  7669. // specified vertical.
  7670. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  7671. // vertical.
  7672. // "POSSIBLE" - It is possible that the image belongs to the specified
  7673. // vertical.
  7674. // "LIKELY" - It is likely that the image belongs to the specified
  7675. // vertical.
  7676. // "VERY_LIKELY" - It is very likely that the image belongs to the
  7677. // specified vertical.
  7678. Racy string `json:"racy,omitempty"`
  7679. // Spoof: Spoof likelihood. The likelihood that an modification
  7680. // was made to the image's canonical version to make it appear
  7681. // funny or offensive.
  7682. //
  7683. // Possible values:
  7684. // "UNKNOWN" - Unknown likelihood.
  7685. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  7686. // specified vertical.
  7687. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  7688. // vertical.
  7689. // "POSSIBLE" - It is possible that the image belongs to the specified
  7690. // vertical.
  7691. // "LIKELY" - It is likely that the image belongs to the specified
  7692. // vertical.
  7693. // "VERY_LIKELY" - It is very likely that the image belongs to the
  7694. // specified vertical.
  7695. Spoof string `json:"spoof,omitempty"`
  7696. // Violence: Likelihood that this image contains violent content.
  7697. //
  7698. // Possible values:
  7699. // "UNKNOWN" - Unknown likelihood.
  7700. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  7701. // specified vertical.
  7702. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  7703. // vertical.
  7704. // "POSSIBLE" - It is possible that the image belongs to the specified
  7705. // vertical.
  7706. // "LIKELY" - It is likely that the image belongs to the specified
  7707. // vertical.
  7708. // "VERY_LIKELY" - It is very likely that the image belongs to the
  7709. // specified vertical.
  7710. Violence string `json:"violence,omitempty"`
  7711. // ForceSendFields is a list of field names (e.g. "Adult") to
  7712. // unconditionally include in API requests. By default, fields with
  7713. // empty values are omitted from API requests. However, any non-pointer,
  7714. // non-interface field appearing in ForceSendFields will be sent to the
  7715. // server regardless of whether the field is empty or not. This may be
  7716. // used to include empty fields in Patch requests.
  7717. ForceSendFields []string `json:"-"`
  7718. // NullFields is a list of field names (e.g. "Adult") to include in API
  7719. // requests with the JSON null value. By default, fields with empty
  7720. // values are omitted from API requests. However, any field with an
  7721. // empty value appearing in NullFields will be sent to the server as
  7722. // null. It is an error if a field in this list has a non-empty value.
  7723. // This may be used to include null fields in Patch requests.
  7724. NullFields []string `json:"-"`
  7725. }
  7726. func (s *GoogleCloudVisionV1p3beta1SafeSearchAnnotation) MarshalJSON() ([]byte, error) {
  7727. type NoMethod GoogleCloudVisionV1p3beta1SafeSearchAnnotation
  7728. raw := NoMethod(*s)
  7729. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7730. }
  7731. // GoogleCloudVisionV1p3beta1Symbol: A single symbol representation.
  7732. type GoogleCloudVisionV1p3beta1Symbol struct {
  7733. // BoundingBox: The bounding box for the symbol.
  7734. // The vertices are in the order of top-left, top-right,
  7735. // bottom-right,
  7736. // bottom-left. When a rotation of the bounding box is detected the
  7737. // rotation
  7738. // is represented as around the top-left corner as defined when the text
  7739. // is
  7740. // read in the 'natural' orientation.
  7741. // For example:
  7742. // * when the text is horizontal it might look like:
  7743. // 0----1
  7744. // | |
  7745. // 3----2
  7746. // * when it's rotated 180 degrees around the top-left corner it
  7747. // becomes:
  7748. // 2----3
  7749. // | |
  7750. // 1----0
  7751. // and the vertice order will still be (0, 1, 2, 3).
  7752. BoundingBox *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingBox,omitempty"`
  7753. // Confidence: Confidence of the OCR results for the symbol. Range [0,
  7754. // 1].
  7755. Confidence float64 `json:"confidence,omitempty"`
  7756. // Property: Additional information detected for the symbol.
  7757. Property *GoogleCloudVisionV1p3beta1TextAnnotationTextProperty `json:"property,omitempty"`
  7758. // Text: The actual UTF-8 representation of the symbol.
  7759. Text string `json:"text,omitempty"`
  7760. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  7761. // unconditionally include in API requests. By default, fields with
  7762. // empty values are omitted from API requests. However, any non-pointer,
  7763. // non-interface field appearing in ForceSendFields will be sent to the
  7764. // server regardless of whether the field is empty or not. This may be
  7765. // used to include empty fields in Patch requests.
  7766. ForceSendFields []string `json:"-"`
  7767. // NullFields is a list of field names (e.g. "BoundingBox") to include
  7768. // in API requests with the JSON null value. By default, fields with
  7769. // empty values are omitted from API requests. However, any field with
  7770. // an empty value appearing in NullFields will be sent to the server as
  7771. // null. It is an error if a field in this list has a non-empty value.
  7772. // This may be used to include null fields in Patch requests.
  7773. NullFields []string `json:"-"`
  7774. }
  7775. func (s *GoogleCloudVisionV1p3beta1Symbol) MarshalJSON() ([]byte, error) {
  7776. type NoMethod GoogleCloudVisionV1p3beta1Symbol
  7777. raw := NoMethod(*s)
  7778. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7779. }
  7780. func (s *GoogleCloudVisionV1p3beta1Symbol) UnmarshalJSON(data []byte) error {
  7781. type NoMethod GoogleCloudVisionV1p3beta1Symbol
  7782. var s1 struct {
  7783. Confidence gensupport.JSONFloat64 `json:"confidence"`
  7784. *NoMethod
  7785. }
  7786. s1.NoMethod = (*NoMethod)(s)
  7787. if err := json.Unmarshal(data, &s1); err != nil {
  7788. return err
  7789. }
  7790. s.Confidence = float64(s1.Confidence)
  7791. return nil
  7792. }
  7793. // GoogleCloudVisionV1p3beta1TextAnnotation: TextAnnotation contains a
  7794. // structured representation of OCR extracted text.
  7795. // The hierarchy of an OCR extracted text structure is like this:
  7796. // TextAnnotation -> Page -> Block -> Paragraph -> Word ->
  7797. // Symbol
  7798. // Each structural component, starting from Page, may further have their
  7799. // own
  7800. // properties. Properties describe detected languages, breaks etc..
  7801. // Please refer
  7802. // to the TextAnnotation.TextProperty message definition below for
  7803. // more
  7804. // detail.
  7805. type GoogleCloudVisionV1p3beta1TextAnnotation struct {
  7806. // Pages: List of pages detected by OCR.
  7807. Pages []*GoogleCloudVisionV1p3beta1Page `json:"pages,omitempty"`
  7808. // Text: UTF-8 text detected on the pages.
  7809. Text string `json:"text,omitempty"`
  7810. // ForceSendFields is a list of field names (e.g. "Pages") to
  7811. // unconditionally include in API requests. By default, fields with
  7812. // empty values are omitted from API requests. However, any non-pointer,
  7813. // non-interface field appearing in ForceSendFields will be sent to the
  7814. // server regardless of whether the field is empty or not. This may be
  7815. // used to include empty fields in Patch requests.
  7816. ForceSendFields []string `json:"-"`
  7817. // NullFields is a list of field names (e.g. "Pages") to include in API
  7818. // requests with the JSON null value. By default, fields with empty
  7819. // values are omitted from API requests. However, any field with an
  7820. // empty value appearing in NullFields will be sent to the server as
  7821. // null. It is an error if a field in this list has a non-empty value.
  7822. // This may be used to include null fields in Patch requests.
  7823. NullFields []string `json:"-"`
  7824. }
  7825. func (s *GoogleCloudVisionV1p3beta1TextAnnotation) MarshalJSON() ([]byte, error) {
  7826. type NoMethod GoogleCloudVisionV1p3beta1TextAnnotation
  7827. raw := NoMethod(*s)
  7828. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7829. }
  7830. // GoogleCloudVisionV1p3beta1TextAnnotationDetectedBreak: Detected start
  7831. // or end of a structural component.
  7832. type GoogleCloudVisionV1p3beta1TextAnnotationDetectedBreak struct {
  7833. // IsPrefix: True if break prepends the element.
  7834. IsPrefix bool `json:"isPrefix,omitempty"`
  7835. // Type: Detected break type.
  7836. //
  7837. // Possible values:
  7838. // "UNKNOWN" - Unknown break label type.
  7839. // "SPACE" - Regular space.
  7840. // "SURE_SPACE" - Sure space (very wide).
  7841. // "EOL_SURE_SPACE" - Line-wrapping break.
  7842. // "HYPHEN" - End-line hyphen that is not present in text; does not
  7843. // co-occur with
  7844. // `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`.
  7845. // "LINE_BREAK" - Line break that ends a paragraph.
  7846. Type string `json:"type,omitempty"`
  7847. // ForceSendFields is a list of field names (e.g. "IsPrefix") to
  7848. // unconditionally include in API requests. By default, fields with
  7849. // empty values are omitted from API requests. However, any non-pointer,
  7850. // non-interface field appearing in ForceSendFields will be sent to the
  7851. // server regardless of whether the field is empty or not. This may be
  7852. // used to include empty fields in Patch requests.
  7853. ForceSendFields []string `json:"-"`
  7854. // NullFields is a list of field names (e.g. "IsPrefix") to include in
  7855. // API requests with the JSON null value. By default, fields with empty
  7856. // values are omitted from API requests. However, any field with an
  7857. // empty value appearing in NullFields will be sent to the server as
  7858. // null. It is an error if a field in this list has a non-empty value.
  7859. // This may be used to include null fields in Patch requests.
  7860. NullFields []string `json:"-"`
  7861. }
  7862. func (s *GoogleCloudVisionV1p3beta1TextAnnotationDetectedBreak) MarshalJSON() ([]byte, error) {
  7863. type NoMethod GoogleCloudVisionV1p3beta1TextAnnotationDetectedBreak
  7864. raw := NoMethod(*s)
  7865. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7866. }
  7867. // GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage: Detected
  7868. // language for a structural component.
  7869. type GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage struct {
  7870. // Confidence: Confidence of detected language. Range [0, 1].
  7871. Confidence float64 `json:"confidence,omitempty"`
  7872. // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn".
  7873. // For more
  7874. // information,
  7875. // see
  7876. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  7877. LanguageCode string `json:"languageCode,omitempty"`
  7878. // ForceSendFields is a list of field names (e.g. "Confidence") to
  7879. // unconditionally include in API requests. By default, fields with
  7880. // empty values are omitted from API requests. However, any non-pointer,
  7881. // non-interface field appearing in ForceSendFields will be sent to the
  7882. // server regardless of whether the field is empty or not. This may be
  7883. // used to include empty fields in Patch requests.
  7884. ForceSendFields []string `json:"-"`
  7885. // NullFields is a list of field names (e.g. "Confidence") to include in
  7886. // API requests with the JSON null value. By default, fields with empty
  7887. // values are omitted from API requests. However, any field with an
  7888. // empty value appearing in NullFields will be sent to the server as
  7889. // null. It is an error if a field in this list has a non-empty value.
  7890. // This may be used to include null fields in Patch requests.
  7891. NullFields []string `json:"-"`
  7892. }
  7893. func (s *GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage) MarshalJSON() ([]byte, error) {
  7894. type NoMethod GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage
  7895. raw := NoMethod(*s)
  7896. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7897. }
  7898. func (s *GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage) UnmarshalJSON(data []byte) error {
  7899. type NoMethod GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage
  7900. var s1 struct {
  7901. Confidence gensupport.JSONFloat64 `json:"confidence"`
  7902. *NoMethod
  7903. }
  7904. s1.NoMethod = (*NoMethod)(s)
  7905. if err := json.Unmarshal(data, &s1); err != nil {
  7906. return err
  7907. }
  7908. s.Confidence = float64(s1.Confidence)
  7909. return nil
  7910. }
  7911. // GoogleCloudVisionV1p3beta1TextAnnotationTextProperty: Additional
  7912. // information detected on the structural component.
  7913. type GoogleCloudVisionV1p3beta1TextAnnotationTextProperty struct {
  7914. // DetectedBreak: Detected start or end of a text segment.
  7915. DetectedBreak *GoogleCloudVisionV1p3beta1TextAnnotationDetectedBreak `json:"detectedBreak,omitempty"`
  7916. // DetectedLanguages: A list of detected languages together with
  7917. // confidence.
  7918. DetectedLanguages []*GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage `json:"detectedLanguages,omitempty"`
  7919. // ForceSendFields is a list of field names (e.g. "DetectedBreak") to
  7920. // unconditionally include in API requests. By default, fields with
  7921. // empty values are omitted from API requests. However, any non-pointer,
  7922. // non-interface field appearing in ForceSendFields will be sent to the
  7923. // server regardless of whether the field is empty or not. This may be
  7924. // used to include empty fields in Patch requests.
  7925. ForceSendFields []string `json:"-"`
  7926. // NullFields is a list of field names (e.g. "DetectedBreak") to include
  7927. // in API requests with the JSON null value. By default, fields with
  7928. // empty values are omitted from API requests. However, any field with
  7929. // an empty value appearing in NullFields will be sent to the server as
  7930. // null. It is an error if a field in this list has a non-empty value.
  7931. // This may be used to include null fields in Patch requests.
  7932. NullFields []string `json:"-"`
  7933. }
  7934. func (s *GoogleCloudVisionV1p3beta1TextAnnotationTextProperty) MarshalJSON() ([]byte, error) {
  7935. type NoMethod GoogleCloudVisionV1p3beta1TextAnnotationTextProperty
  7936. raw := NoMethod(*s)
  7937. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7938. }
  7939. // GoogleCloudVisionV1p3beta1Vertex: A vertex represents a 2D point in
  7940. // the image.
  7941. // NOTE: the vertex coordinates are in the same scale as the original
  7942. // image.
  7943. type GoogleCloudVisionV1p3beta1Vertex struct {
  7944. // X: X coordinate.
  7945. X int64 `json:"x,omitempty"`
  7946. // Y: Y coordinate.
  7947. Y int64 `json:"y,omitempty"`
  7948. // ForceSendFields is a list of field names (e.g. "X") to
  7949. // unconditionally include in API requests. By default, fields with
  7950. // empty values are omitted from API requests. However, any non-pointer,
  7951. // non-interface field appearing in ForceSendFields will be sent to the
  7952. // server regardless of whether the field is empty or not. This may be
  7953. // used to include empty fields in Patch requests.
  7954. ForceSendFields []string `json:"-"`
  7955. // NullFields is a list of field names (e.g. "X") to include in API
  7956. // requests with the JSON null value. By default, fields with empty
  7957. // values are omitted from API requests. However, any field with an
  7958. // empty value appearing in NullFields will be sent to the server as
  7959. // null. It is an error if a field in this list has a non-empty value.
  7960. // This may be used to include null fields in Patch requests.
  7961. NullFields []string `json:"-"`
  7962. }
  7963. func (s *GoogleCloudVisionV1p3beta1Vertex) MarshalJSON() ([]byte, error) {
  7964. type NoMethod GoogleCloudVisionV1p3beta1Vertex
  7965. raw := NoMethod(*s)
  7966. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7967. }
  7968. // GoogleCloudVisionV1p3beta1WebDetection: Relevant information for the
  7969. // image from the Internet.
  7970. type GoogleCloudVisionV1p3beta1WebDetection struct {
  7971. // BestGuessLabels: The service's best guess as to the topic of the
  7972. // request image.
  7973. // Inferred from similar images on the open web.
  7974. BestGuessLabels []*GoogleCloudVisionV1p3beta1WebDetectionWebLabel `json:"bestGuessLabels,omitempty"`
  7975. // FullMatchingImages: Fully matching images from the Internet.
  7976. // Can include resized copies of the query image.
  7977. FullMatchingImages []*GoogleCloudVisionV1p3beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"`
  7978. // PagesWithMatchingImages: Web pages containing the matching images
  7979. // from the Internet.
  7980. PagesWithMatchingImages []*GoogleCloudVisionV1p3beta1WebDetectionWebPage `json:"pagesWithMatchingImages,omitempty"`
  7981. // PartialMatchingImages: Partial matching images from the
  7982. // Internet.
  7983. // Those images are similar enough to share some key-point features.
  7984. // For
  7985. // example an original image will likely have partial matching for its
  7986. // crops.
  7987. PartialMatchingImages []*GoogleCloudVisionV1p3beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"`
  7988. // VisuallySimilarImages: The visually similar image results.
  7989. VisuallySimilarImages []*GoogleCloudVisionV1p3beta1WebDetectionWebImage `json:"visuallySimilarImages,omitempty"`
  7990. // WebEntities: Deduced entities from similar images on the Internet.
  7991. WebEntities []*GoogleCloudVisionV1p3beta1WebDetectionWebEntity `json:"webEntities,omitempty"`
  7992. // ForceSendFields is a list of field names (e.g. "BestGuessLabels") to
  7993. // unconditionally include in API requests. By default, fields with
  7994. // empty values are omitted from API requests. However, any non-pointer,
  7995. // non-interface field appearing in ForceSendFields will be sent to the
  7996. // server regardless of whether the field is empty or not. This may be
  7997. // used to include empty fields in Patch requests.
  7998. ForceSendFields []string `json:"-"`
  7999. // NullFields is a list of field names (e.g. "BestGuessLabels") to
  8000. // include in API requests with the JSON null value. By default, fields
  8001. // with empty values are omitted from API requests. However, any field
  8002. // with an empty value appearing in NullFields will be sent to the
  8003. // server as null. It is an error if a field in this list has a
  8004. // non-empty value. This may be used to include null fields in Patch
  8005. // requests.
  8006. NullFields []string `json:"-"`
  8007. }
  8008. func (s *GoogleCloudVisionV1p3beta1WebDetection) MarshalJSON() ([]byte, error) {
  8009. type NoMethod GoogleCloudVisionV1p3beta1WebDetection
  8010. raw := NoMethod(*s)
  8011. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8012. }
  8013. // GoogleCloudVisionV1p3beta1WebDetectionWebEntity: Entity deduced from
  8014. // similar images on the Internet.
  8015. type GoogleCloudVisionV1p3beta1WebDetectionWebEntity struct {
  8016. // Description: Canonical description of the entity, in English.
  8017. Description string `json:"description,omitempty"`
  8018. // EntityId: Opaque entity ID.
  8019. EntityId string `json:"entityId,omitempty"`
  8020. // Score: Overall relevancy score for the entity.
  8021. // Not normalized and not comparable across different image queries.
  8022. Score float64 `json:"score,omitempty"`
  8023. // ForceSendFields is a list of field names (e.g. "Description") 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. // NullFields is a list of field names (e.g. "Description") to include
  8031. // in API requests with the JSON null value. By default, fields with
  8032. // empty values are omitted from API requests. However, any field with
  8033. // an empty value appearing in NullFields will be sent to the server as
  8034. // null. It is an error if a field in this list has a non-empty value.
  8035. // This may be used to include null fields in Patch requests.
  8036. NullFields []string `json:"-"`
  8037. }
  8038. func (s *GoogleCloudVisionV1p3beta1WebDetectionWebEntity) MarshalJSON() ([]byte, error) {
  8039. type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebEntity
  8040. raw := NoMethod(*s)
  8041. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8042. }
  8043. func (s *GoogleCloudVisionV1p3beta1WebDetectionWebEntity) UnmarshalJSON(data []byte) error {
  8044. type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebEntity
  8045. var s1 struct {
  8046. Score gensupport.JSONFloat64 `json:"score"`
  8047. *NoMethod
  8048. }
  8049. s1.NoMethod = (*NoMethod)(s)
  8050. if err := json.Unmarshal(data, &s1); err != nil {
  8051. return err
  8052. }
  8053. s.Score = float64(s1.Score)
  8054. return nil
  8055. }
  8056. // GoogleCloudVisionV1p3beta1WebDetectionWebImage: Metadata for online
  8057. // images.
  8058. type GoogleCloudVisionV1p3beta1WebDetectionWebImage struct {
  8059. // Score: (Deprecated) Overall relevancy score for the image.
  8060. Score float64 `json:"score,omitempty"`
  8061. // Url: The result image URL.
  8062. Url string `json:"url,omitempty"`
  8063. // ForceSendFields is a list of field names (e.g. "Score") to
  8064. // unconditionally include in API requests. By default, fields with
  8065. // empty values are omitted from API requests. However, any non-pointer,
  8066. // non-interface field appearing in ForceSendFields will be sent to the
  8067. // server regardless of whether the field is empty or not. This may be
  8068. // used to include empty fields in Patch requests.
  8069. ForceSendFields []string `json:"-"`
  8070. // NullFields is a list of field names (e.g. "Score") to include in API
  8071. // requests with the JSON null value. By default, fields with empty
  8072. // values are omitted from API requests. However, any field with an
  8073. // empty value appearing in NullFields will be sent to the server as
  8074. // null. It is an error if a field in this list has a non-empty value.
  8075. // This may be used to include null fields in Patch requests.
  8076. NullFields []string `json:"-"`
  8077. }
  8078. func (s *GoogleCloudVisionV1p3beta1WebDetectionWebImage) MarshalJSON() ([]byte, error) {
  8079. type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebImage
  8080. raw := NoMethod(*s)
  8081. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8082. }
  8083. func (s *GoogleCloudVisionV1p3beta1WebDetectionWebImage) UnmarshalJSON(data []byte) error {
  8084. type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebImage
  8085. var s1 struct {
  8086. Score gensupport.JSONFloat64 `json:"score"`
  8087. *NoMethod
  8088. }
  8089. s1.NoMethod = (*NoMethod)(s)
  8090. if err := json.Unmarshal(data, &s1); err != nil {
  8091. return err
  8092. }
  8093. s.Score = float64(s1.Score)
  8094. return nil
  8095. }
  8096. // GoogleCloudVisionV1p3beta1WebDetectionWebLabel: Label to provide
  8097. // extra metadata for the web detection.
  8098. type GoogleCloudVisionV1p3beta1WebDetectionWebLabel struct {
  8099. // Label: Label for extra metadata.
  8100. Label string `json:"label,omitempty"`
  8101. // LanguageCode: The BCP-47 language code for `label`, such as "en-US"
  8102. // or "sr-Latn".
  8103. // For more information,
  8104. // see
  8105. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  8106. LanguageCode string `json:"languageCode,omitempty"`
  8107. // ForceSendFields is a list of field names (e.g. "Label") to
  8108. // unconditionally include in API requests. By default, fields with
  8109. // empty values are omitted from API requests. However, any non-pointer,
  8110. // non-interface field appearing in ForceSendFields will be sent to the
  8111. // server regardless of whether the field is empty or not. This may be
  8112. // used to include empty fields in Patch requests.
  8113. ForceSendFields []string `json:"-"`
  8114. // NullFields is a list of field names (e.g. "Label") to include in API
  8115. // requests with the JSON null value. By default, fields with empty
  8116. // values are omitted from API requests. However, any field with an
  8117. // empty value appearing in NullFields will be sent to the server as
  8118. // null. It is an error if a field in this list has a non-empty value.
  8119. // This may be used to include null fields in Patch requests.
  8120. NullFields []string `json:"-"`
  8121. }
  8122. func (s *GoogleCloudVisionV1p3beta1WebDetectionWebLabel) MarshalJSON() ([]byte, error) {
  8123. type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebLabel
  8124. raw := NoMethod(*s)
  8125. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8126. }
  8127. // GoogleCloudVisionV1p3beta1WebDetectionWebPage: Metadata for web
  8128. // pages.
  8129. type GoogleCloudVisionV1p3beta1WebDetectionWebPage struct {
  8130. // FullMatchingImages: Fully matching images on the page.
  8131. // Can include resized copies of the query image.
  8132. FullMatchingImages []*GoogleCloudVisionV1p3beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"`
  8133. // PageTitle: Title for the web page, may contain HTML markups.
  8134. PageTitle string `json:"pageTitle,omitempty"`
  8135. // PartialMatchingImages: Partial matching images on the page.
  8136. // Those images are similar enough to share some key-point features.
  8137. // For
  8138. // example an original image will likely have partial matching for
  8139. // its
  8140. // crops.
  8141. PartialMatchingImages []*GoogleCloudVisionV1p3beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"`
  8142. // Score: (Deprecated) Overall relevancy score for the web page.
  8143. Score float64 `json:"score,omitempty"`
  8144. // Url: The result web page URL.
  8145. Url string `json:"url,omitempty"`
  8146. // ForceSendFields is a list of field names (e.g. "FullMatchingImages")
  8147. // to unconditionally include in API requests. By default, fields with
  8148. // empty values are omitted from API requests. However, any non-pointer,
  8149. // non-interface field appearing in ForceSendFields will be sent to the
  8150. // server regardless of whether the field is empty or not. This may be
  8151. // used to include empty fields in Patch requests.
  8152. ForceSendFields []string `json:"-"`
  8153. // NullFields is a list of field names (e.g. "FullMatchingImages") to
  8154. // include in API requests with the JSON null value. By default, fields
  8155. // with empty values are omitted from API requests. However, any field
  8156. // with an empty value appearing in NullFields will be sent to the
  8157. // server as null. It is an error if a field in this list has a
  8158. // non-empty value. This may be used to include null fields in Patch
  8159. // requests.
  8160. NullFields []string `json:"-"`
  8161. }
  8162. func (s *GoogleCloudVisionV1p3beta1WebDetectionWebPage) MarshalJSON() ([]byte, error) {
  8163. type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebPage
  8164. raw := NoMethod(*s)
  8165. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8166. }
  8167. func (s *GoogleCloudVisionV1p3beta1WebDetectionWebPage) UnmarshalJSON(data []byte) error {
  8168. type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebPage
  8169. var s1 struct {
  8170. Score gensupport.JSONFloat64 `json:"score"`
  8171. *NoMethod
  8172. }
  8173. s1.NoMethod = (*NoMethod)(s)
  8174. if err := json.Unmarshal(data, &s1); err != nil {
  8175. return err
  8176. }
  8177. s.Score = float64(s1.Score)
  8178. return nil
  8179. }
  8180. // GoogleCloudVisionV1p3beta1Word: A word representation.
  8181. type GoogleCloudVisionV1p3beta1Word struct {
  8182. // BoundingBox: The bounding box for the word.
  8183. // The vertices are in the order of top-left, top-right,
  8184. // bottom-right,
  8185. // bottom-left. When a rotation of the bounding box is detected the
  8186. // rotation
  8187. // is represented as around the top-left corner as defined when the text
  8188. // is
  8189. // read in the 'natural' orientation.
  8190. // For example:
  8191. // * when the text is horizontal it might look like:
  8192. // 0----1
  8193. // | |
  8194. // 3----2
  8195. // * when it's rotated 180 degrees around the top-left corner it
  8196. // becomes:
  8197. // 2----3
  8198. // | |
  8199. // 1----0
  8200. // and the vertex order will still be (0, 1, 2, 3).
  8201. BoundingBox *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingBox,omitempty"`
  8202. // Confidence: Confidence of the OCR results for the word. Range [0, 1].
  8203. Confidence float64 `json:"confidence,omitempty"`
  8204. // Property: Additional information detected for the word.
  8205. Property *GoogleCloudVisionV1p3beta1TextAnnotationTextProperty `json:"property,omitempty"`
  8206. // Symbols: List of symbols in the word.
  8207. // The order of the symbols follows the natural reading order.
  8208. Symbols []*GoogleCloudVisionV1p3beta1Symbol `json:"symbols,omitempty"`
  8209. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  8210. // unconditionally include in API requests. By default, fields with
  8211. // empty values are omitted from API requests. However, any non-pointer,
  8212. // non-interface field appearing in ForceSendFields will be sent to the
  8213. // server regardless of whether the field is empty or not. This may be
  8214. // used to include empty fields in Patch requests.
  8215. ForceSendFields []string `json:"-"`
  8216. // NullFields is a list of field names (e.g. "BoundingBox") to include
  8217. // in API requests with the JSON null value. By default, fields with
  8218. // empty values are omitted from API requests. However, any field with
  8219. // an empty value appearing in NullFields will be sent to the server as
  8220. // null. It is an error if a field in this list has a non-empty value.
  8221. // This may be used to include null fields in Patch requests.
  8222. NullFields []string `json:"-"`
  8223. }
  8224. func (s *GoogleCloudVisionV1p3beta1Word) MarshalJSON() ([]byte, error) {
  8225. type NoMethod GoogleCloudVisionV1p3beta1Word
  8226. raw := NoMethod(*s)
  8227. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8228. }
  8229. func (s *GoogleCloudVisionV1p3beta1Word) UnmarshalJSON(data []byte) error {
  8230. type NoMethod GoogleCloudVisionV1p3beta1Word
  8231. var s1 struct {
  8232. Confidence gensupport.JSONFloat64 `json:"confidence"`
  8233. *NoMethod
  8234. }
  8235. s1.NoMethod = (*NoMethod)(s)
  8236. if err := json.Unmarshal(data, &s1); err != nil {
  8237. return err
  8238. }
  8239. s.Confidence = float64(s1.Confidence)
  8240. return nil
  8241. }
  8242. // GoogleCloudVisionV1p4beta1AnnotateFileResponse: Response to a single
  8243. // file annotation request. A file may contain one or more
  8244. // images, which individually have their own responses.
  8245. type GoogleCloudVisionV1p4beta1AnnotateFileResponse struct {
  8246. // InputConfig: Information about the file for which this response is
  8247. // generated.
  8248. InputConfig *GoogleCloudVisionV1p4beta1InputConfig `json:"inputConfig,omitempty"`
  8249. // Responses: Individual responses to images found within the file.
  8250. Responses []*GoogleCloudVisionV1p4beta1AnnotateImageResponse `json:"responses,omitempty"`
  8251. // TotalPages: This field gives the total number of pages in the file.
  8252. TotalPages int64 `json:"totalPages,omitempty"`
  8253. // ForceSendFields is a list of field names (e.g. "InputConfig") to
  8254. // unconditionally include in API requests. By default, fields with
  8255. // empty values are omitted from API requests. However, any non-pointer,
  8256. // non-interface field appearing in ForceSendFields will be sent to the
  8257. // server regardless of whether the field is empty or not. This may be
  8258. // used to include empty fields in Patch requests.
  8259. ForceSendFields []string `json:"-"`
  8260. // NullFields is a list of field names (e.g. "InputConfig") to include
  8261. // in API requests with the JSON null value. By default, fields with
  8262. // empty values are omitted from API requests. However, any field with
  8263. // an empty value appearing in NullFields will be sent to the server as
  8264. // null. It is an error if a field in this list has a non-empty value.
  8265. // This may be used to include null fields in Patch requests.
  8266. NullFields []string `json:"-"`
  8267. }
  8268. func (s *GoogleCloudVisionV1p4beta1AnnotateFileResponse) MarshalJSON() ([]byte, error) {
  8269. type NoMethod GoogleCloudVisionV1p4beta1AnnotateFileResponse
  8270. raw := NoMethod(*s)
  8271. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8272. }
  8273. // GoogleCloudVisionV1p4beta1AnnotateImageResponse: Response to an image
  8274. // annotation request.
  8275. type GoogleCloudVisionV1p4beta1AnnotateImageResponse struct {
  8276. // Context: If present, contextual information is needed to understand
  8277. // where this image
  8278. // comes from.
  8279. Context *GoogleCloudVisionV1p4beta1ImageAnnotationContext `json:"context,omitempty"`
  8280. // CropHintsAnnotation: If present, crop hints have completed
  8281. // successfully.
  8282. CropHintsAnnotation *GoogleCloudVisionV1p4beta1CropHintsAnnotation `json:"cropHintsAnnotation,omitempty"`
  8283. // Error: If set, represents the error message for the operation.
  8284. // Note that filled-in image annotations are guaranteed to be
  8285. // correct, even when `error` is set.
  8286. Error *Status `json:"error,omitempty"`
  8287. // FaceAnnotations: If present, face detection has completed
  8288. // successfully.
  8289. FaceAnnotations []*GoogleCloudVisionV1p4beta1FaceAnnotation `json:"faceAnnotations,omitempty"`
  8290. // FullTextAnnotation: If present, text (OCR) detection or document
  8291. // (OCR) text detection has
  8292. // completed successfully.
  8293. // This annotation provides the structural hierarchy for the OCR
  8294. // detected
  8295. // text.
  8296. FullTextAnnotation *GoogleCloudVisionV1p4beta1TextAnnotation `json:"fullTextAnnotation,omitempty"`
  8297. // ImagePropertiesAnnotation: If present, image properties were
  8298. // extracted successfully.
  8299. ImagePropertiesAnnotation *GoogleCloudVisionV1p4beta1ImageProperties `json:"imagePropertiesAnnotation,omitempty"`
  8300. // LabelAnnotations: If present, label detection has completed
  8301. // successfully.
  8302. LabelAnnotations []*GoogleCloudVisionV1p4beta1EntityAnnotation `json:"labelAnnotations,omitempty"`
  8303. // LandmarkAnnotations: If present, landmark detection has completed
  8304. // successfully.
  8305. LandmarkAnnotations []*GoogleCloudVisionV1p4beta1EntityAnnotation `json:"landmarkAnnotations,omitempty"`
  8306. // LocalizedObjectAnnotations: If present, localized object detection
  8307. // has completed successfully.
  8308. // This will be sorted descending by confidence score.
  8309. LocalizedObjectAnnotations []*GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation `json:"localizedObjectAnnotations,omitempty"`
  8310. // LogoAnnotations: If present, logo detection has completed
  8311. // successfully.
  8312. LogoAnnotations []*GoogleCloudVisionV1p4beta1EntityAnnotation `json:"logoAnnotations,omitempty"`
  8313. // ProductSearchResults: If present, product search has completed
  8314. // successfully.
  8315. ProductSearchResults *GoogleCloudVisionV1p4beta1ProductSearchResults `json:"productSearchResults,omitempty"`
  8316. // SafeSearchAnnotation: If present, safe-search annotation has
  8317. // completed successfully.
  8318. SafeSearchAnnotation *GoogleCloudVisionV1p4beta1SafeSearchAnnotation `json:"safeSearchAnnotation,omitempty"`
  8319. // TextAnnotations: If present, text (OCR) detection has completed
  8320. // successfully.
  8321. TextAnnotations []*GoogleCloudVisionV1p4beta1EntityAnnotation `json:"textAnnotations,omitempty"`
  8322. // WebDetection: If present, web detection has completed successfully.
  8323. WebDetection *GoogleCloudVisionV1p4beta1WebDetection `json:"webDetection,omitempty"`
  8324. // ForceSendFields is a list of field names (e.g. "Context") to
  8325. // unconditionally include in API requests. By default, fields with
  8326. // empty values are omitted from API requests. However, any non-pointer,
  8327. // non-interface field appearing in ForceSendFields will be sent to the
  8328. // server regardless of whether the field is empty or not. This may be
  8329. // used to include empty fields in Patch requests.
  8330. ForceSendFields []string `json:"-"`
  8331. // NullFields is a list of field names (e.g. "Context") to include in
  8332. // API requests with the JSON null value. By default, fields with empty
  8333. // values are omitted from API requests. However, any field with an
  8334. // empty value appearing in NullFields will be sent to the server as
  8335. // null. It is an error if a field in this list has a non-empty value.
  8336. // This may be used to include null fields in Patch requests.
  8337. NullFields []string `json:"-"`
  8338. }
  8339. func (s *GoogleCloudVisionV1p4beta1AnnotateImageResponse) MarshalJSON() ([]byte, error) {
  8340. type NoMethod GoogleCloudVisionV1p4beta1AnnotateImageResponse
  8341. raw := NoMethod(*s)
  8342. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8343. }
  8344. // GoogleCloudVisionV1p4beta1AsyncAnnotateFileResponse: The response for
  8345. // a single offline file annotation request.
  8346. type GoogleCloudVisionV1p4beta1AsyncAnnotateFileResponse struct {
  8347. // OutputConfig: The output location and metadata from
  8348. // AsyncAnnotateFileRequest.
  8349. OutputConfig *GoogleCloudVisionV1p4beta1OutputConfig `json:"outputConfig,omitempty"`
  8350. // ForceSendFields is a list of field names (e.g. "OutputConfig") to
  8351. // unconditionally include in API requests. By default, fields with
  8352. // empty values are omitted from API requests. However, any non-pointer,
  8353. // non-interface field appearing in ForceSendFields will be sent to the
  8354. // server regardless of whether the field is empty or not. This may be
  8355. // used to include empty fields in Patch requests.
  8356. ForceSendFields []string `json:"-"`
  8357. // NullFields is a list of field names (e.g. "OutputConfig") to include
  8358. // in API requests with the JSON null value. By default, fields with
  8359. // empty values are omitted from API requests. However, any field with
  8360. // an empty value appearing in NullFields will be sent to the server as
  8361. // null. It is an error if a field in this list has a non-empty value.
  8362. // This may be used to include null fields in Patch requests.
  8363. NullFields []string `json:"-"`
  8364. }
  8365. func (s *GoogleCloudVisionV1p4beta1AsyncAnnotateFileResponse) MarshalJSON() ([]byte, error) {
  8366. type NoMethod GoogleCloudVisionV1p4beta1AsyncAnnotateFileResponse
  8367. raw := NoMethod(*s)
  8368. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8369. }
  8370. // GoogleCloudVisionV1p4beta1AsyncBatchAnnotateFilesResponse: Response
  8371. // to an async batch file annotation request.
  8372. type GoogleCloudVisionV1p4beta1AsyncBatchAnnotateFilesResponse struct {
  8373. // Responses: The list of file annotation responses, one for each
  8374. // request in
  8375. // AsyncBatchAnnotateFilesRequest.
  8376. Responses []*GoogleCloudVisionV1p4beta1AsyncAnnotateFileResponse `json:"responses,omitempty"`
  8377. // ForceSendFields is a list of field names (e.g. "Responses") to
  8378. // unconditionally include in API requests. By default, fields with
  8379. // empty values are omitted from API requests. However, any non-pointer,
  8380. // non-interface field appearing in ForceSendFields will be sent to the
  8381. // server regardless of whether the field is empty or not. This may be
  8382. // used to include empty fields in Patch requests.
  8383. ForceSendFields []string `json:"-"`
  8384. // NullFields is a list of field names (e.g. "Responses") to include in
  8385. // API requests with the JSON null value. By default, fields with empty
  8386. // values are omitted from API requests. However, any field with an
  8387. // empty value appearing in NullFields will be sent to the server as
  8388. // null. It is an error if a field in this list has a non-empty value.
  8389. // This may be used to include null fields in Patch requests.
  8390. NullFields []string `json:"-"`
  8391. }
  8392. func (s *GoogleCloudVisionV1p4beta1AsyncBatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) {
  8393. type NoMethod GoogleCloudVisionV1p4beta1AsyncBatchAnnotateFilesResponse
  8394. raw := NoMethod(*s)
  8395. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8396. }
  8397. // GoogleCloudVisionV1p4beta1AsyncBatchAnnotateImagesResponse: Response
  8398. // to an async batch image annotation request.
  8399. type GoogleCloudVisionV1p4beta1AsyncBatchAnnotateImagesResponse struct {
  8400. // OutputConfig: The output location and metadata from
  8401. // AsyncBatchAnnotateImagesRequest.
  8402. OutputConfig *GoogleCloudVisionV1p4beta1OutputConfig `json:"outputConfig,omitempty"`
  8403. // ForceSendFields is a list of field names (e.g. "OutputConfig") to
  8404. // unconditionally include in API requests. By default, fields with
  8405. // empty values are omitted from API requests. However, any non-pointer,
  8406. // non-interface field appearing in ForceSendFields will be sent to the
  8407. // server regardless of whether the field is empty or not. This may be
  8408. // used to include empty fields in Patch requests.
  8409. ForceSendFields []string `json:"-"`
  8410. // NullFields is a list of field names (e.g. "OutputConfig") to include
  8411. // in API requests with the JSON null value. By default, fields with
  8412. // empty values are omitted from API requests. However, any field with
  8413. // an 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. func (s *GoogleCloudVisionV1p4beta1AsyncBatchAnnotateImagesResponse) MarshalJSON() ([]byte, error) {
  8419. type NoMethod GoogleCloudVisionV1p4beta1AsyncBatchAnnotateImagesResponse
  8420. raw := NoMethod(*s)
  8421. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8422. }
  8423. // GoogleCloudVisionV1p4beta1BatchAnnotateFilesResponse: A list of file
  8424. // annotation responses.
  8425. type GoogleCloudVisionV1p4beta1BatchAnnotateFilesResponse struct {
  8426. // Responses: The list of file annotation responses, each response
  8427. // corresponding to each
  8428. // AnnotateFileRequest in BatchAnnotateFilesRequest.
  8429. Responses []*GoogleCloudVisionV1p4beta1AnnotateFileResponse `json:"responses,omitempty"`
  8430. // ForceSendFields is a list of field names (e.g. "Responses") to
  8431. // unconditionally include in API requests. By default, fields with
  8432. // empty values are omitted from API requests. However, any non-pointer,
  8433. // non-interface field appearing in ForceSendFields will be sent to the
  8434. // server regardless of whether the field is empty or not. This may be
  8435. // used to include empty fields in Patch requests.
  8436. ForceSendFields []string `json:"-"`
  8437. // NullFields is a list of field names (e.g. "Responses") to include in
  8438. // API requests with the JSON null value. By default, fields with empty
  8439. // values are omitted from API requests. However, any field with an
  8440. // empty value appearing in NullFields will be sent to the server as
  8441. // null. It is an error if a field in this list has a non-empty value.
  8442. // This may be used to include null fields in Patch requests.
  8443. NullFields []string `json:"-"`
  8444. }
  8445. func (s *GoogleCloudVisionV1p4beta1BatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) {
  8446. type NoMethod GoogleCloudVisionV1p4beta1BatchAnnotateFilesResponse
  8447. raw := NoMethod(*s)
  8448. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8449. }
  8450. // GoogleCloudVisionV1p4beta1BatchOperationMetadata: Metadata for the
  8451. // batch operations such as the current state.
  8452. //
  8453. // This is included in the `metadata` field of the `Operation` returned
  8454. // by the
  8455. // `GetOperation` call of the `google::longrunning::Operations` service.
  8456. type GoogleCloudVisionV1p4beta1BatchOperationMetadata struct {
  8457. // EndTime: The time when the batch request is finished
  8458. // and
  8459. // google.longrunning.Operation.done is set to true.
  8460. EndTime string `json:"endTime,omitempty"`
  8461. // State: The current state of the batch operation.
  8462. //
  8463. // Possible values:
  8464. // "STATE_UNSPECIFIED" - Invalid.
  8465. // "PROCESSING" - Request is actively being processed.
  8466. // "SUCCESSFUL" - The request is done and at least one item has been
  8467. // successfully
  8468. // processed.
  8469. // "FAILED" - The request is done and no item has been successfully
  8470. // processed.
  8471. // "CANCELLED" - The request is done after the
  8472. // longrunning.Operations.CancelOperation has
  8473. // been called by the user. Any records that were processed before
  8474. // the
  8475. // cancel command are output as specified in the request.
  8476. State string `json:"state,omitempty"`
  8477. // SubmitTime: The time when the batch request was submitted to the
  8478. // server.
  8479. SubmitTime string `json:"submitTime,omitempty"`
  8480. // ForceSendFields is a list of field names (e.g. "EndTime") to
  8481. // unconditionally include in API requests. By default, fields with
  8482. // empty values are omitted from API requests. However, any non-pointer,
  8483. // non-interface field appearing in ForceSendFields will be sent to the
  8484. // server regardless of whether the field is empty or not. This may be
  8485. // used to include empty fields in Patch requests.
  8486. ForceSendFields []string `json:"-"`
  8487. // NullFields is a list of field names (e.g. "EndTime") to include in
  8488. // API requests with the JSON null value. By default, fields with empty
  8489. // values are omitted from API requests. However, any field with an
  8490. // empty value appearing in NullFields will be sent to the server as
  8491. // null. It is an error if a field in this list has a non-empty value.
  8492. // This may be used to include null fields in Patch requests.
  8493. NullFields []string `json:"-"`
  8494. }
  8495. func (s *GoogleCloudVisionV1p4beta1BatchOperationMetadata) MarshalJSON() ([]byte, error) {
  8496. type NoMethod GoogleCloudVisionV1p4beta1BatchOperationMetadata
  8497. raw := NoMethod(*s)
  8498. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8499. }
  8500. // GoogleCloudVisionV1p4beta1Block: Logical element on the page.
  8501. type GoogleCloudVisionV1p4beta1Block struct {
  8502. // BlockType: Detected block type (text, image etc) for this block.
  8503. //
  8504. // Possible values:
  8505. // "UNKNOWN" - Unknown block type.
  8506. // "TEXT" - Regular text block.
  8507. // "TABLE" - Table block.
  8508. // "PICTURE" - Image block.
  8509. // "RULER" - Horizontal/vertical line box.
  8510. // "BARCODE" - Barcode block.
  8511. BlockType string `json:"blockType,omitempty"`
  8512. // BoundingBox: The bounding box for the block.
  8513. // The vertices are in the order of top-left, top-right,
  8514. // bottom-right,
  8515. // bottom-left. When a rotation of the bounding box is detected the
  8516. // rotation
  8517. // is represented as around the top-left corner as defined when the text
  8518. // is
  8519. // read in the 'natural' orientation.
  8520. // For example:
  8521. //
  8522. // * when the text is horizontal it might look like:
  8523. //
  8524. // 0----1
  8525. // | |
  8526. // 3----2
  8527. //
  8528. // * when it's rotated 180 degrees around the top-left corner it
  8529. // becomes:
  8530. //
  8531. // 2----3
  8532. // | |
  8533. // 1----0
  8534. //
  8535. // and the vertex order will still be (0, 1, 2, 3).
  8536. BoundingBox *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingBox,omitempty"`
  8537. // Confidence: Confidence of the OCR results on the block. Range [0, 1].
  8538. Confidence float64 `json:"confidence,omitempty"`
  8539. // Paragraphs: List of paragraphs in this block (if this blocks is of
  8540. // type text).
  8541. Paragraphs []*GoogleCloudVisionV1p4beta1Paragraph `json:"paragraphs,omitempty"`
  8542. // Property: Additional information detected for the block.
  8543. Property *GoogleCloudVisionV1p4beta1TextAnnotationTextProperty `json:"property,omitempty"`
  8544. // ForceSendFields is a list of field names (e.g. "BlockType") to
  8545. // unconditionally include in API requests. By default, fields with
  8546. // empty values are omitted from API requests. However, any non-pointer,
  8547. // non-interface field appearing in ForceSendFields will be sent to the
  8548. // server regardless of whether the field is empty or not. This may be
  8549. // used to include empty fields in Patch requests.
  8550. ForceSendFields []string `json:"-"`
  8551. // NullFields is a list of field names (e.g. "BlockType") to include in
  8552. // API requests with the JSON null value. By default, fields with empty
  8553. // values are omitted from API requests. However, any field with an
  8554. // empty value appearing in NullFields will be sent to the server as
  8555. // null. It is an error if a field in this list has a non-empty value.
  8556. // This may be used to include null fields in Patch requests.
  8557. NullFields []string `json:"-"`
  8558. }
  8559. func (s *GoogleCloudVisionV1p4beta1Block) MarshalJSON() ([]byte, error) {
  8560. type NoMethod GoogleCloudVisionV1p4beta1Block
  8561. raw := NoMethod(*s)
  8562. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8563. }
  8564. func (s *GoogleCloudVisionV1p4beta1Block) UnmarshalJSON(data []byte) error {
  8565. type NoMethod GoogleCloudVisionV1p4beta1Block
  8566. var s1 struct {
  8567. Confidence gensupport.JSONFloat64 `json:"confidence"`
  8568. *NoMethod
  8569. }
  8570. s1.NoMethod = (*NoMethod)(s)
  8571. if err := json.Unmarshal(data, &s1); err != nil {
  8572. return err
  8573. }
  8574. s.Confidence = float64(s1.Confidence)
  8575. return nil
  8576. }
  8577. // GoogleCloudVisionV1p4beta1BoundingPoly: A bounding polygon for the
  8578. // detected image annotation.
  8579. type GoogleCloudVisionV1p4beta1BoundingPoly struct {
  8580. // NormalizedVertices: The bounding polygon normalized vertices.
  8581. NormalizedVertices []*GoogleCloudVisionV1p4beta1NormalizedVertex `json:"normalizedVertices,omitempty"`
  8582. // Vertices: The bounding polygon vertices.
  8583. Vertices []*GoogleCloudVisionV1p4beta1Vertex `json:"vertices,omitempty"`
  8584. // ForceSendFields is a list of field names (e.g. "NormalizedVertices")
  8585. // to unconditionally include in API requests. By default, fields with
  8586. // empty values are omitted from API requests. However, any non-pointer,
  8587. // non-interface field appearing in ForceSendFields will be sent to the
  8588. // server regardless of whether the field is empty or not. This may be
  8589. // used to include empty fields in Patch requests.
  8590. ForceSendFields []string `json:"-"`
  8591. // NullFields is a list of field names (e.g. "NormalizedVertices") to
  8592. // include in API requests with the JSON null value. By default, fields
  8593. // with empty values are omitted from API requests. However, any field
  8594. // with an empty value appearing in NullFields will be sent to the
  8595. // server as null. It is an error if a field in this list has a
  8596. // non-empty value. This may be used to include null fields in Patch
  8597. // requests.
  8598. NullFields []string `json:"-"`
  8599. }
  8600. func (s *GoogleCloudVisionV1p4beta1BoundingPoly) MarshalJSON() ([]byte, error) {
  8601. type NoMethod GoogleCloudVisionV1p4beta1BoundingPoly
  8602. raw := NoMethod(*s)
  8603. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8604. }
  8605. // GoogleCloudVisionV1p4beta1ColorInfo: Color information consists of
  8606. // RGB channels, score, and the fraction of
  8607. // the image that the color occupies in the image.
  8608. type GoogleCloudVisionV1p4beta1ColorInfo struct {
  8609. // Color: RGB components of the color.
  8610. Color *Color `json:"color,omitempty"`
  8611. // PixelFraction: The fraction of pixels the color occupies in the
  8612. // image.
  8613. // Value in range [0, 1].
  8614. PixelFraction float64 `json:"pixelFraction,omitempty"`
  8615. // Score: Image-specific score for this color. Value in range [0, 1].
  8616. Score float64 `json:"score,omitempty"`
  8617. // ForceSendFields is a list of field names (e.g. "Color") to
  8618. // unconditionally include in API requests. By default, fields with
  8619. // empty values are omitted from API requests. However, any non-pointer,
  8620. // non-interface field appearing in ForceSendFields will be sent to the
  8621. // server regardless of whether the field is empty or not. This may be
  8622. // used to include empty fields in Patch requests.
  8623. ForceSendFields []string `json:"-"`
  8624. // NullFields is a list of field names (e.g. "Color") to include in API
  8625. // requests with the JSON null value. By default, fields with empty
  8626. // values are omitted from API requests. However, any field with an
  8627. // empty value appearing in NullFields will be sent to the server as
  8628. // null. It is an error if a field in this list has a non-empty value.
  8629. // This may be used to include null fields in Patch requests.
  8630. NullFields []string `json:"-"`
  8631. }
  8632. func (s *GoogleCloudVisionV1p4beta1ColorInfo) MarshalJSON() ([]byte, error) {
  8633. type NoMethod GoogleCloudVisionV1p4beta1ColorInfo
  8634. raw := NoMethod(*s)
  8635. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8636. }
  8637. func (s *GoogleCloudVisionV1p4beta1ColorInfo) UnmarshalJSON(data []byte) error {
  8638. type NoMethod GoogleCloudVisionV1p4beta1ColorInfo
  8639. var s1 struct {
  8640. PixelFraction gensupport.JSONFloat64 `json:"pixelFraction"`
  8641. Score gensupport.JSONFloat64 `json:"score"`
  8642. *NoMethod
  8643. }
  8644. s1.NoMethod = (*NoMethod)(s)
  8645. if err := json.Unmarshal(data, &s1); err != nil {
  8646. return err
  8647. }
  8648. s.PixelFraction = float64(s1.PixelFraction)
  8649. s.Score = float64(s1.Score)
  8650. return nil
  8651. }
  8652. // GoogleCloudVisionV1p4beta1CropHint: Single crop hint that is used to
  8653. // generate a new crop when serving an image.
  8654. type GoogleCloudVisionV1p4beta1CropHint struct {
  8655. // BoundingPoly: The bounding polygon for the crop region. The
  8656. // coordinates of the bounding
  8657. // box are in the original image's scale.
  8658. BoundingPoly *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingPoly,omitempty"`
  8659. // Confidence: Confidence of this being a salient region. Range [0, 1].
  8660. Confidence float64 `json:"confidence,omitempty"`
  8661. // ImportanceFraction: Fraction of importance of this salient region
  8662. // with respect to the original
  8663. // image.
  8664. ImportanceFraction float64 `json:"importanceFraction,omitempty"`
  8665. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  8666. // unconditionally include in API requests. By default, fields with
  8667. // empty values are omitted from API requests. However, any non-pointer,
  8668. // non-interface field appearing in ForceSendFields will be sent to the
  8669. // server regardless of whether the field is empty or not. This may be
  8670. // used to include empty fields in Patch requests.
  8671. ForceSendFields []string `json:"-"`
  8672. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  8673. // in API requests with the JSON null value. By default, fields with
  8674. // empty values are omitted from API requests. However, any field with
  8675. // an empty value appearing in NullFields will be sent to the server as
  8676. // null. It is an error if a field in this list has a non-empty value.
  8677. // This may be used to include null fields in Patch requests.
  8678. NullFields []string `json:"-"`
  8679. }
  8680. func (s *GoogleCloudVisionV1p4beta1CropHint) MarshalJSON() ([]byte, error) {
  8681. type NoMethod GoogleCloudVisionV1p4beta1CropHint
  8682. raw := NoMethod(*s)
  8683. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8684. }
  8685. func (s *GoogleCloudVisionV1p4beta1CropHint) UnmarshalJSON(data []byte) error {
  8686. type NoMethod GoogleCloudVisionV1p4beta1CropHint
  8687. var s1 struct {
  8688. Confidence gensupport.JSONFloat64 `json:"confidence"`
  8689. ImportanceFraction gensupport.JSONFloat64 `json:"importanceFraction"`
  8690. *NoMethod
  8691. }
  8692. s1.NoMethod = (*NoMethod)(s)
  8693. if err := json.Unmarshal(data, &s1); err != nil {
  8694. return err
  8695. }
  8696. s.Confidence = float64(s1.Confidence)
  8697. s.ImportanceFraction = float64(s1.ImportanceFraction)
  8698. return nil
  8699. }
  8700. // GoogleCloudVisionV1p4beta1CropHintsAnnotation: Set of crop hints that
  8701. // are used to generate new crops when serving images.
  8702. type GoogleCloudVisionV1p4beta1CropHintsAnnotation struct {
  8703. // CropHints: Crop hint results.
  8704. CropHints []*GoogleCloudVisionV1p4beta1CropHint `json:"cropHints,omitempty"`
  8705. // ForceSendFields is a list of field names (e.g. "CropHints") to
  8706. // unconditionally include in API requests. By default, fields with
  8707. // empty values are omitted from API requests. However, any non-pointer,
  8708. // non-interface field appearing in ForceSendFields will be sent to the
  8709. // server regardless of whether the field is empty or not. This may be
  8710. // used to include empty fields in Patch requests.
  8711. ForceSendFields []string `json:"-"`
  8712. // NullFields is a list of field names (e.g. "CropHints") to include in
  8713. // API requests with the JSON null value. By default, fields with empty
  8714. // values are omitted from API requests. However, any field with an
  8715. // empty value appearing in NullFields will be sent to the server as
  8716. // null. It is an error if a field in this list has a non-empty value.
  8717. // This may be used to include null fields in Patch requests.
  8718. NullFields []string `json:"-"`
  8719. }
  8720. func (s *GoogleCloudVisionV1p4beta1CropHintsAnnotation) MarshalJSON() ([]byte, error) {
  8721. type NoMethod GoogleCloudVisionV1p4beta1CropHintsAnnotation
  8722. raw := NoMethod(*s)
  8723. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8724. }
  8725. // GoogleCloudVisionV1p4beta1DominantColorsAnnotation: Set of dominant
  8726. // colors and their corresponding scores.
  8727. type GoogleCloudVisionV1p4beta1DominantColorsAnnotation struct {
  8728. // Colors: RGB color values with their score and pixel fraction.
  8729. Colors []*GoogleCloudVisionV1p4beta1ColorInfo `json:"colors,omitempty"`
  8730. // ForceSendFields is a list of field names (e.g. "Colors") to
  8731. // unconditionally include in API requests. By default, fields with
  8732. // empty values are omitted from API requests. However, any non-pointer,
  8733. // non-interface field appearing in ForceSendFields will be sent to the
  8734. // server regardless of whether the field is empty or not. This may be
  8735. // used to include empty fields in Patch requests.
  8736. ForceSendFields []string `json:"-"`
  8737. // NullFields is a list of field names (e.g. "Colors") to include in API
  8738. // requests with the JSON null value. By default, fields with empty
  8739. // values are omitted from API requests. However, any field with an
  8740. // empty value appearing in NullFields will be sent to the server as
  8741. // null. It is an error if a field in this list has a non-empty value.
  8742. // This may be used to include null fields in Patch requests.
  8743. NullFields []string `json:"-"`
  8744. }
  8745. func (s *GoogleCloudVisionV1p4beta1DominantColorsAnnotation) MarshalJSON() ([]byte, error) {
  8746. type NoMethod GoogleCloudVisionV1p4beta1DominantColorsAnnotation
  8747. raw := NoMethod(*s)
  8748. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8749. }
  8750. // GoogleCloudVisionV1p4beta1EntityAnnotation: Set of detected entity
  8751. // features.
  8752. type GoogleCloudVisionV1p4beta1EntityAnnotation struct {
  8753. // BoundingPoly: Image region to which this entity belongs. Not
  8754. // produced
  8755. // for `LABEL_DETECTION` features.
  8756. BoundingPoly *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingPoly,omitempty"`
  8757. // Confidence: **Deprecated. Use `score` instead.**
  8758. // The accuracy of the entity detection in an image.
  8759. // For example, for an image in which the "Eiffel Tower" entity is
  8760. // detected,
  8761. // this field represents the confidence that there is a tower in the
  8762. // query
  8763. // image. Range [0, 1].
  8764. Confidence float64 `json:"confidence,omitempty"`
  8765. // Description: Entity textual description, expressed in its `locale`
  8766. // language.
  8767. Description string `json:"description,omitempty"`
  8768. // Locale: The language code for the locale in which the entity
  8769. // textual
  8770. // `description` is expressed.
  8771. Locale string `json:"locale,omitempty"`
  8772. // Locations: The location information for the detected entity.
  8773. // Multiple
  8774. // `LocationInfo` elements can be present because one location
  8775. // may
  8776. // indicate the location of the scene in the image, and another
  8777. // location
  8778. // may indicate the location of the place where the image was
  8779. // taken.
  8780. // Location information is usually present for landmarks.
  8781. Locations []*GoogleCloudVisionV1p4beta1LocationInfo `json:"locations,omitempty"`
  8782. // Mid: Opaque entity ID. Some IDs may be available in
  8783. // [Google Knowledge Graph
  8784. // Search
  8785. // API](https://developers.google.com/knowledge-graph/).
  8786. Mid string `json:"mid,omitempty"`
  8787. // Properties: Some entities may have optional user-supplied `Property`
  8788. // (name/value)
  8789. // fields, such a score or string that qualifies the entity.
  8790. Properties []*GoogleCloudVisionV1p4beta1Property `json:"properties,omitempty"`
  8791. // Score: Overall score of the result. Range [0, 1].
  8792. Score float64 `json:"score,omitempty"`
  8793. // Topicality: The relevancy of the ICA (Image Content Annotation) label
  8794. // to the
  8795. // image. For example, the relevancy of "tower" is likely higher to an
  8796. // image
  8797. // containing the detected "Eiffel Tower" than to an image containing
  8798. // a
  8799. // detected distant towering building, even though the confidence
  8800. // that
  8801. // there is a tower in each image may be the same. Range [0, 1].
  8802. Topicality float64 `json:"topicality,omitempty"`
  8803. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  8804. // unconditionally include in API requests. By default, fields with
  8805. // empty values are omitted from API requests. However, any non-pointer,
  8806. // non-interface field appearing in ForceSendFields will be sent to the
  8807. // server regardless of whether the field is empty or not. This may be
  8808. // used to include empty fields in Patch requests.
  8809. ForceSendFields []string `json:"-"`
  8810. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  8811. // in API requests with the JSON null value. By default, fields with
  8812. // empty values are omitted from API requests. However, any field with
  8813. // an empty value appearing in NullFields will be sent to the server as
  8814. // null. It is an error if a field in this list has a non-empty value.
  8815. // This may be used to include null fields in Patch requests.
  8816. NullFields []string `json:"-"`
  8817. }
  8818. func (s *GoogleCloudVisionV1p4beta1EntityAnnotation) MarshalJSON() ([]byte, error) {
  8819. type NoMethod GoogleCloudVisionV1p4beta1EntityAnnotation
  8820. raw := NoMethod(*s)
  8821. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8822. }
  8823. func (s *GoogleCloudVisionV1p4beta1EntityAnnotation) UnmarshalJSON(data []byte) error {
  8824. type NoMethod GoogleCloudVisionV1p4beta1EntityAnnotation
  8825. var s1 struct {
  8826. Confidence gensupport.JSONFloat64 `json:"confidence"`
  8827. Score gensupport.JSONFloat64 `json:"score"`
  8828. Topicality gensupport.JSONFloat64 `json:"topicality"`
  8829. *NoMethod
  8830. }
  8831. s1.NoMethod = (*NoMethod)(s)
  8832. if err := json.Unmarshal(data, &s1); err != nil {
  8833. return err
  8834. }
  8835. s.Confidence = float64(s1.Confidence)
  8836. s.Score = float64(s1.Score)
  8837. s.Topicality = float64(s1.Topicality)
  8838. return nil
  8839. }
  8840. // GoogleCloudVisionV1p4beta1FaceAnnotation: A face annotation object
  8841. // contains the results of face detection.
  8842. type GoogleCloudVisionV1p4beta1FaceAnnotation struct {
  8843. // AngerLikelihood: Anger likelihood.
  8844. //
  8845. // Possible values:
  8846. // "UNKNOWN" - Unknown likelihood.
  8847. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  8848. // specified vertical.
  8849. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  8850. // vertical.
  8851. // "POSSIBLE" - It is possible that the image belongs to the specified
  8852. // vertical.
  8853. // "LIKELY" - It is likely that the image belongs to the specified
  8854. // vertical.
  8855. // "VERY_LIKELY" - It is very likely that the image belongs to the
  8856. // specified vertical.
  8857. AngerLikelihood string `json:"angerLikelihood,omitempty"`
  8858. // BlurredLikelihood: Blurred likelihood.
  8859. //
  8860. // Possible values:
  8861. // "UNKNOWN" - Unknown likelihood.
  8862. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  8863. // specified vertical.
  8864. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  8865. // vertical.
  8866. // "POSSIBLE" - It is possible that the image belongs to the specified
  8867. // vertical.
  8868. // "LIKELY" - It is likely that the image belongs to the specified
  8869. // vertical.
  8870. // "VERY_LIKELY" - It is very likely that the image belongs to the
  8871. // specified vertical.
  8872. BlurredLikelihood string `json:"blurredLikelihood,omitempty"`
  8873. // BoundingPoly: The bounding polygon around the face. The coordinates
  8874. // of the bounding box
  8875. // are in the original image's scale.
  8876. // The bounding box is computed to "frame" the face in accordance with
  8877. // human
  8878. // expectations. It is based on the landmarker results.
  8879. // Note that one or more x and/or y coordinates may not be generated in
  8880. // the
  8881. // `BoundingPoly` (the polygon will be unbounded) if only a partial
  8882. // face
  8883. // appears in the image to be annotated.
  8884. BoundingPoly *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingPoly,omitempty"`
  8885. // DetectionConfidence: Detection confidence. Range [0, 1].
  8886. DetectionConfidence float64 `json:"detectionConfidence,omitempty"`
  8887. // FdBoundingPoly: The `fd_bounding_poly` bounding polygon is tighter
  8888. // than the
  8889. // `boundingPoly`, and encloses only the skin part of the face.
  8890. // Typically, it
  8891. // is used to eliminate the face from any image analysis that detects
  8892. // the
  8893. // "amount of skin" visible in an image. It is not based on
  8894. // the
  8895. // landmarker results, only on the initial face detection, hence
  8896. // the <code>fd</code> (face detection) prefix.
  8897. FdBoundingPoly *GoogleCloudVisionV1p4beta1BoundingPoly `json:"fdBoundingPoly,omitempty"`
  8898. // HeadwearLikelihood: Headwear likelihood.
  8899. //
  8900. // Possible values:
  8901. // "UNKNOWN" - Unknown likelihood.
  8902. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  8903. // specified vertical.
  8904. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  8905. // vertical.
  8906. // "POSSIBLE" - It is possible that the image belongs to the specified
  8907. // vertical.
  8908. // "LIKELY" - It is likely that the image belongs to the specified
  8909. // vertical.
  8910. // "VERY_LIKELY" - It is very likely that the image belongs to the
  8911. // specified vertical.
  8912. HeadwearLikelihood string `json:"headwearLikelihood,omitempty"`
  8913. // JoyLikelihood: Joy likelihood.
  8914. //
  8915. // Possible values:
  8916. // "UNKNOWN" - Unknown likelihood.
  8917. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  8918. // specified vertical.
  8919. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  8920. // vertical.
  8921. // "POSSIBLE" - It is possible that the image belongs to the specified
  8922. // vertical.
  8923. // "LIKELY" - It is likely that the image belongs to the specified
  8924. // vertical.
  8925. // "VERY_LIKELY" - It is very likely that the image belongs to the
  8926. // specified vertical.
  8927. JoyLikelihood string `json:"joyLikelihood,omitempty"`
  8928. // LandmarkingConfidence: Face landmarking confidence. Range [0, 1].
  8929. LandmarkingConfidence float64 `json:"landmarkingConfidence,omitempty"`
  8930. // Landmarks: Detected face landmarks.
  8931. Landmarks []*GoogleCloudVisionV1p4beta1FaceAnnotationLandmark `json:"landmarks,omitempty"`
  8932. // PanAngle: Yaw angle, which indicates the leftward/rightward angle
  8933. // that the face is
  8934. // pointing relative to the vertical plane perpendicular to the image.
  8935. // Range
  8936. // [-180,180].
  8937. PanAngle float64 `json:"panAngle,omitempty"`
  8938. // RollAngle: Roll angle, which indicates the amount of
  8939. // clockwise/anti-clockwise rotation
  8940. // of the face relative to the image vertical about the axis
  8941. // perpendicular to
  8942. // the face. Range [-180,180].
  8943. RollAngle float64 `json:"rollAngle,omitempty"`
  8944. // SorrowLikelihood: Sorrow likelihood.
  8945. //
  8946. // Possible values:
  8947. // "UNKNOWN" - Unknown likelihood.
  8948. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  8949. // specified vertical.
  8950. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  8951. // vertical.
  8952. // "POSSIBLE" - It is possible that the image belongs to the specified
  8953. // vertical.
  8954. // "LIKELY" - It is likely that the image belongs to the specified
  8955. // vertical.
  8956. // "VERY_LIKELY" - It is very likely that the image belongs to the
  8957. // specified vertical.
  8958. SorrowLikelihood string `json:"sorrowLikelihood,omitempty"`
  8959. // SurpriseLikelihood: Surprise likelihood.
  8960. //
  8961. // Possible values:
  8962. // "UNKNOWN" - Unknown likelihood.
  8963. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  8964. // specified vertical.
  8965. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  8966. // vertical.
  8967. // "POSSIBLE" - It is possible that the image belongs to the specified
  8968. // vertical.
  8969. // "LIKELY" - It is likely that the image belongs to the specified
  8970. // vertical.
  8971. // "VERY_LIKELY" - It is very likely that the image belongs to the
  8972. // specified vertical.
  8973. SurpriseLikelihood string `json:"surpriseLikelihood,omitempty"`
  8974. // TiltAngle: Pitch angle, which indicates the upwards/downwards angle
  8975. // that the face is
  8976. // pointing relative to the image's horizontal plane. Range [-180,180].
  8977. TiltAngle float64 `json:"tiltAngle,omitempty"`
  8978. // UnderExposedLikelihood: Under-exposed likelihood.
  8979. //
  8980. // Possible values:
  8981. // "UNKNOWN" - Unknown likelihood.
  8982. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  8983. // specified vertical.
  8984. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  8985. // vertical.
  8986. // "POSSIBLE" - It is possible that the image belongs to the specified
  8987. // vertical.
  8988. // "LIKELY" - It is likely that the image belongs to the specified
  8989. // vertical.
  8990. // "VERY_LIKELY" - It is very likely that the image belongs to the
  8991. // specified vertical.
  8992. UnderExposedLikelihood string `json:"underExposedLikelihood,omitempty"`
  8993. // ForceSendFields is a list of field names (e.g. "AngerLikelihood") to
  8994. // unconditionally include in API requests. By default, fields with
  8995. // empty values are omitted from API requests. However, any non-pointer,
  8996. // non-interface field appearing in ForceSendFields will be sent to the
  8997. // server regardless of whether the field is empty or not. This may be
  8998. // used to include empty fields in Patch requests.
  8999. ForceSendFields []string `json:"-"`
  9000. // NullFields is a list of field names (e.g. "AngerLikelihood") to
  9001. // include in API requests with the JSON null value. By default, fields
  9002. // with empty values are omitted from API requests. However, any field
  9003. // with an empty value appearing in NullFields will be sent to the
  9004. // server as null. It is an error if a field in this list has a
  9005. // non-empty value. This may be used to include null fields in Patch
  9006. // requests.
  9007. NullFields []string `json:"-"`
  9008. }
  9009. func (s *GoogleCloudVisionV1p4beta1FaceAnnotation) MarshalJSON() ([]byte, error) {
  9010. type NoMethod GoogleCloudVisionV1p4beta1FaceAnnotation
  9011. raw := NoMethod(*s)
  9012. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9013. }
  9014. func (s *GoogleCloudVisionV1p4beta1FaceAnnotation) UnmarshalJSON(data []byte) error {
  9015. type NoMethod GoogleCloudVisionV1p4beta1FaceAnnotation
  9016. var s1 struct {
  9017. DetectionConfidence gensupport.JSONFloat64 `json:"detectionConfidence"`
  9018. LandmarkingConfidence gensupport.JSONFloat64 `json:"landmarkingConfidence"`
  9019. PanAngle gensupport.JSONFloat64 `json:"panAngle"`
  9020. RollAngle gensupport.JSONFloat64 `json:"rollAngle"`
  9021. TiltAngle gensupport.JSONFloat64 `json:"tiltAngle"`
  9022. *NoMethod
  9023. }
  9024. s1.NoMethod = (*NoMethod)(s)
  9025. if err := json.Unmarshal(data, &s1); err != nil {
  9026. return err
  9027. }
  9028. s.DetectionConfidence = float64(s1.DetectionConfidence)
  9029. s.LandmarkingConfidence = float64(s1.LandmarkingConfidence)
  9030. s.PanAngle = float64(s1.PanAngle)
  9031. s.RollAngle = float64(s1.RollAngle)
  9032. s.TiltAngle = float64(s1.TiltAngle)
  9033. return nil
  9034. }
  9035. // GoogleCloudVisionV1p4beta1FaceAnnotationLandmark: A face-specific
  9036. // landmark (for example, a face feature).
  9037. type GoogleCloudVisionV1p4beta1FaceAnnotationLandmark struct {
  9038. // Position: Face landmark position.
  9039. Position *GoogleCloudVisionV1p4beta1Position `json:"position,omitempty"`
  9040. // Type: Face landmark type.
  9041. //
  9042. // Possible values:
  9043. // "UNKNOWN_LANDMARK" - Unknown face landmark detected. Should not be
  9044. // filled.
  9045. // "LEFT_EYE" - Left eye.
  9046. // "RIGHT_EYE" - Right eye.
  9047. // "LEFT_OF_LEFT_EYEBROW" - Left of left eyebrow.
  9048. // "RIGHT_OF_LEFT_EYEBROW" - Right of left eyebrow.
  9049. // "LEFT_OF_RIGHT_EYEBROW" - Left of right eyebrow.
  9050. // "RIGHT_OF_RIGHT_EYEBROW" - Right of right eyebrow.
  9051. // "MIDPOINT_BETWEEN_EYES" - Midpoint between eyes.
  9052. // "NOSE_TIP" - Nose tip.
  9053. // "UPPER_LIP" - Upper lip.
  9054. // "LOWER_LIP" - Lower lip.
  9055. // "MOUTH_LEFT" - Mouth left.
  9056. // "MOUTH_RIGHT" - Mouth right.
  9057. // "MOUTH_CENTER" - Mouth center.
  9058. // "NOSE_BOTTOM_RIGHT" - Nose, bottom right.
  9059. // "NOSE_BOTTOM_LEFT" - Nose, bottom left.
  9060. // "NOSE_BOTTOM_CENTER" - Nose, bottom center.
  9061. // "LEFT_EYE_TOP_BOUNDARY" - Left eye, top boundary.
  9062. // "LEFT_EYE_RIGHT_CORNER" - Left eye, right corner.
  9063. // "LEFT_EYE_BOTTOM_BOUNDARY" - Left eye, bottom boundary.
  9064. // "LEFT_EYE_LEFT_CORNER" - Left eye, left corner.
  9065. // "RIGHT_EYE_TOP_BOUNDARY" - Right eye, top boundary.
  9066. // "RIGHT_EYE_RIGHT_CORNER" - Right eye, right corner.
  9067. // "RIGHT_EYE_BOTTOM_BOUNDARY" - Right eye, bottom boundary.
  9068. // "RIGHT_EYE_LEFT_CORNER" - Right eye, left corner.
  9069. // "LEFT_EYEBROW_UPPER_MIDPOINT" - Left eyebrow, upper midpoint.
  9070. // "RIGHT_EYEBROW_UPPER_MIDPOINT" - Right eyebrow, upper midpoint.
  9071. // "LEFT_EAR_TRAGION" - Left ear tragion.
  9072. // "RIGHT_EAR_TRAGION" - Right ear tragion.
  9073. // "LEFT_EYE_PUPIL" - Left eye pupil.
  9074. // "RIGHT_EYE_PUPIL" - Right eye pupil.
  9075. // "FOREHEAD_GLABELLA" - Forehead glabella.
  9076. // "CHIN_GNATHION" - Chin gnathion.
  9077. // "CHIN_LEFT_GONION" - Chin left gonion.
  9078. // "CHIN_RIGHT_GONION" - Chin right gonion.
  9079. Type string `json:"type,omitempty"`
  9080. // ForceSendFields is a list of field names (e.g. "Position") to
  9081. // unconditionally include in API requests. By default, fields with
  9082. // empty values are omitted from API requests. However, any non-pointer,
  9083. // non-interface field appearing in ForceSendFields will be sent to the
  9084. // server regardless of whether the field is empty or not. This may be
  9085. // used to include empty fields in Patch requests.
  9086. ForceSendFields []string `json:"-"`
  9087. // NullFields is a list of field names (e.g. "Position") to include in
  9088. // API requests with the JSON null value. By default, fields with empty
  9089. // values are omitted from API requests. However, any field with an
  9090. // empty value appearing in NullFields will be sent to the server as
  9091. // null. It is an error if a field in this list has a non-empty value.
  9092. // This may be used to include null fields in Patch requests.
  9093. NullFields []string `json:"-"`
  9094. }
  9095. func (s *GoogleCloudVisionV1p4beta1FaceAnnotationLandmark) MarshalJSON() ([]byte, error) {
  9096. type NoMethod GoogleCloudVisionV1p4beta1FaceAnnotationLandmark
  9097. raw := NoMethod(*s)
  9098. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9099. }
  9100. // GoogleCloudVisionV1p4beta1GcsDestination: The Google Cloud Storage
  9101. // location where the output will be written to.
  9102. type GoogleCloudVisionV1p4beta1GcsDestination struct {
  9103. // Uri: Google Cloud Storage URI where the results will be stored.
  9104. // Results will
  9105. // be in JSON format and preceded by its corresponding input URI. This
  9106. // field
  9107. // can either represent a single file, or a prefix for multiple
  9108. // outputs.
  9109. // Prefixes must end in a `/`.
  9110. //
  9111. // Examples:
  9112. //
  9113. // * File: gs://bucket-name/filename.json
  9114. // * Prefix: gs://bucket-name/prefix/here/
  9115. // * File: gs://bucket-name/prefix/here
  9116. //
  9117. // If multiple outputs, each response is still AnnotateFileResponse,
  9118. // each of
  9119. // which contains some subset of the full list of
  9120. // AnnotateImageResponse.
  9121. // Multiple outputs can happen if, for example, the output JSON is too
  9122. // large
  9123. // and overflows into multiple sharded files.
  9124. Uri string `json:"uri,omitempty"`
  9125. // ForceSendFields is a list of field names (e.g. "Uri") to
  9126. // unconditionally include in API requests. By default, fields with
  9127. // empty values are omitted from API requests. However, any non-pointer,
  9128. // non-interface field appearing in ForceSendFields will be sent to the
  9129. // server regardless of whether the field is empty or not. This may be
  9130. // used to include empty fields in Patch requests.
  9131. ForceSendFields []string `json:"-"`
  9132. // NullFields is a list of field names (e.g. "Uri") to include in API
  9133. // requests with the JSON null value. By default, fields with empty
  9134. // values are omitted from API requests. However, any field with an
  9135. // empty value appearing in NullFields will be sent to the server as
  9136. // null. It is an error if a field in this list has a non-empty value.
  9137. // This may be used to include null fields in Patch requests.
  9138. NullFields []string `json:"-"`
  9139. }
  9140. func (s *GoogleCloudVisionV1p4beta1GcsDestination) MarshalJSON() ([]byte, error) {
  9141. type NoMethod GoogleCloudVisionV1p4beta1GcsDestination
  9142. raw := NoMethod(*s)
  9143. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9144. }
  9145. // GoogleCloudVisionV1p4beta1GcsSource: The Google Cloud Storage
  9146. // location where the input will be read from.
  9147. type GoogleCloudVisionV1p4beta1GcsSource struct {
  9148. // Uri: Google Cloud Storage URI for the input file. This must only be
  9149. // a
  9150. // Google Cloud Storage object. Wildcards are not currently supported.
  9151. Uri string `json:"uri,omitempty"`
  9152. // ForceSendFields is a list of field names (e.g. "Uri") to
  9153. // unconditionally include in API requests. By default, fields with
  9154. // empty values are omitted from API requests. However, any non-pointer,
  9155. // non-interface field appearing in ForceSendFields will be sent to the
  9156. // server regardless of whether the field is empty or not. This may be
  9157. // used to include empty fields in Patch requests.
  9158. ForceSendFields []string `json:"-"`
  9159. // NullFields is a list of field names (e.g. "Uri") to include in API
  9160. // requests with the JSON null value. By default, fields with empty
  9161. // values are omitted from API requests. However, any field with an
  9162. // empty value appearing in NullFields will be sent to the server as
  9163. // null. It is an error if a field in this list has a non-empty value.
  9164. // This may be used to include null fields in Patch requests.
  9165. NullFields []string `json:"-"`
  9166. }
  9167. func (s *GoogleCloudVisionV1p4beta1GcsSource) MarshalJSON() ([]byte, error) {
  9168. type NoMethod GoogleCloudVisionV1p4beta1GcsSource
  9169. raw := NoMethod(*s)
  9170. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9171. }
  9172. // GoogleCloudVisionV1p4beta1ImageAnnotationContext: If an image was
  9173. // produced from a file (e.g. a PDF), this message gives
  9174. // information about the source of that image.
  9175. type GoogleCloudVisionV1p4beta1ImageAnnotationContext struct {
  9176. // PageNumber: If the file was a PDF or TIFF, this field gives the page
  9177. // number within
  9178. // the file used to produce the image.
  9179. PageNumber int64 `json:"pageNumber,omitempty"`
  9180. // Uri: The URI of the file used to produce the image.
  9181. Uri string `json:"uri,omitempty"`
  9182. // ForceSendFields is a list of field names (e.g. "PageNumber") to
  9183. // unconditionally include in API requests. By default, fields with
  9184. // empty values are omitted from API requests. However, any non-pointer,
  9185. // non-interface field appearing in ForceSendFields will be sent to the
  9186. // server regardless of whether the field is empty or not. This may be
  9187. // used to include empty fields in Patch requests.
  9188. ForceSendFields []string `json:"-"`
  9189. // NullFields is a list of field names (e.g. "PageNumber") to include in
  9190. // API requests with the JSON null value. By default, fields with empty
  9191. // values are omitted from API requests. However, any field with an
  9192. // empty value appearing in NullFields will be sent to the server as
  9193. // null. It is an error if a field in this list has a non-empty value.
  9194. // This may be used to include null fields in Patch requests.
  9195. NullFields []string `json:"-"`
  9196. }
  9197. func (s *GoogleCloudVisionV1p4beta1ImageAnnotationContext) MarshalJSON() ([]byte, error) {
  9198. type NoMethod GoogleCloudVisionV1p4beta1ImageAnnotationContext
  9199. raw := NoMethod(*s)
  9200. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9201. }
  9202. // GoogleCloudVisionV1p4beta1ImageProperties: Stores image properties,
  9203. // such as dominant colors.
  9204. type GoogleCloudVisionV1p4beta1ImageProperties struct {
  9205. // DominantColors: If present, dominant colors completed successfully.
  9206. DominantColors *GoogleCloudVisionV1p4beta1DominantColorsAnnotation `json:"dominantColors,omitempty"`
  9207. // ForceSendFields is a list of field names (e.g. "DominantColors") to
  9208. // unconditionally include in API requests. By default, fields with
  9209. // empty values are omitted from API requests. However, any non-pointer,
  9210. // non-interface field appearing in ForceSendFields will be sent to the
  9211. // server regardless of whether the field is empty or not. This may be
  9212. // used to include empty fields in Patch requests.
  9213. ForceSendFields []string `json:"-"`
  9214. // NullFields is a list of field names (e.g. "DominantColors") to
  9215. // include in API requests with the JSON null value. By default, fields
  9216. // with empty values are omitted from API requests. However, any field
  9217. // with an empty value appearing in NullFields will be sent to the
  9218. // server as null. It is an error if a field in this list has a
  9219. // non-empty value. This may be used to include null fields in Patch
  9220. // requests.
  9221. NullFields []string `json:"-"`
  9222. }
  9223. func (s *GoogleCloudVisionV1p4beta1ImageProperties) MarshalJSON() ([]byte, error) {
  9224. type NoMethod GoogleCloudVisionV1p4beta1ImageProperties
  9225. raw := NoMethod(*s)
  9226. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9227. }
  9228. // GoogleCloudVisionV1p4beta1ImportProductSetsResponse: Response message
  9229. // for the `ImportProductSets` method.
  9230. //
  9231. // This message is returned by
  9232. // the
  9233. // google.longrunning.Operations.GetOperation method in the
  9234. // returned
  9235. // google.longrunning.Operation.response field.
  9236. type GoogleCloudVisionV1p4beta1ImportProductSetsResponse struct {
  9237. // ReferenceImages: The list of reference_images that are imported
  9238. // successfully.
  9239. ReferenceImages []*GoogleCloudVisionV1p4beta1ReferenceImage `json:"referenceImages,omitempty"`
  9240. // Statuses: The rpc status for each ImportProductSet request, including
  9241. // both successes
  9242. // and errors.
  9243. //
  9244. // The number of statuses here matches the number of lines in the csv
  9245. // file,
  9246. // and statuses[i] stores the success or failure status of processing
  9247. // the i-th
  9248. // line of the csv, starting from line 0.
  9249. Statuses []*Status `json:"statuses,omitempty"`
  9250. // ForceSendFields is a list of field names (e.g. "ReferenceImages") to
  9251. // unconditionally include in API requests. By default, fields with
  9252. // empty values are omitted from API requests. However, any non-pointer,
  9253. // non-interface field appearing in ForceSendFields will be sent to the
  9254. // server regardless of whether the field is empty or not. This may be
  9255. // used to include empty fields in Patch requests.
  9256. ForceSendFields []string `json:"-"`
  9257. // NullFields is a list of field names (e.g. "ReferenceImages") to
  9258. // include in API requests with the JSON null value. By default, fields
  9259. // with empty values are omitted from API requests. However, any field
  9260. // with an empty value appearing in NullFields will be sent to the
  9261. // server as null. It is an error if a field in this list has a
  9262. // non-empty value. This may be used to include null fields in Patch
  9263. // requests.
  9264. NullFields []string `json:"-"`
  9265. }
  9266. func (s *GoogleCloudVisionV1p4beta1ImportProductSetsResponse) MarshalJSON() ([]byte, error) {
  9267. type NoMethod GoogleCloudVisionV1p4beta1ImportProductSetsResponse
  9268. raw := NoMethod(*s)
  9269. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9270. }
  9271. // GoogleCloudVisionV1p4beta1InputConfig: The desired input location and
  9272. // metadata.
  9273. type GoogleCloudVisionV1p4beta1InputConfig struct {
  9274. // Content: File content, represented as a stream of bytes.
  9275. // Note: As with all `bytes` fields, protobuffers use a pure
  9276. // binary
  9277. // representation, whereas JSON representations use base64.
  9278. //
  9279. // Currently, this field only works for BatchAnnotateFiles requests. It
  9280. // does
  9281. // not work for AsyncBatchAnnotateFiles requests.
  9282. Content string `json:"content,omitempty"`
  9283. // GcsSource: The Google Cloud Storage location to read the input from.
  9284. GcsSource *GoogleCloudVisionV1p4beta1GcsSource `json:"gcsSource,omitempty"`
  9285. // MimeType: The type of the file. Currently only "application/pdf" and
  9286. // "image/tiff"
  9287. // are supported. Wildcards are not supported.
  9288. MimeType string `json:"mimeType,omitempty"`
  9289. // ForceSendFields is a list of field names (e.g. "Content") to
  9290. // unconditionally include in API requests. By default, fields with
  9291. // empty values are omitted from API requests. However, any non-pointer,
  9292. // non-interface field appearing in ForceSendFields will be sent to the
  9293. // server regardless of whether the field is empty or not. This may be
  9294. // used to include empty fields in Patch requests.
  9295. ForceSendFields []string `json:"-"`
  9296. // NullFields is a list of field names (e.g. "Content") to include in
  9297. // API requests with the JSON null value. By default, fields with empty
  9298. // values are omitted from API requests. However, any field with an
  9299. // empty value appearing in NullFields will be sent to the server as
  9300. // null. It is an error if a field in this list has a non-empty value.
  9301. // This may be used to include null fields in Patch requests.
  9302. NullFields []string `json:"-"`
  9303. }
  9304. func (s *GoogleCloudVisionV1p4beta1InputConfig) MarshalJSON() ([]byte, error) {
  9305. type NoMethod GoogleCloudVisionV1p4beta1InputConfig
  9306. raw := NoMethod(*s)
  9307. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9308. }
  9309. // GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation: Set of detected
  9310. // objects with bounding boxes.
  9311. type GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation struct {
  9312. // BoundingPoly: Image region to which this object belongs. This must be
  9313. // populated.
  9314. BoundingPoly *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingPoly,omitempty"`
  9315. // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn".
  9316. // For more
  9317. // information,
  9318. // see
  9319. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  9320. LanguageCode string `json:"languageCode,omitempty"`
  9321. // Mid: Object ID that should align with EntityAnnotation mid.
  9322. Mid string `json:"mid,omitempty"`
  9323. // Name: Object name, expressed in its `language_code` language.
  9324. Name string `json:"name,omitempty"`
  9325. // Score: Score of the result. Range [0, 1].
  9326. Score float64 `json:"score,omitempty"`
  9327. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  9328. // unconditionally include in API requests. By default, fields with
  9329. // empty values are omitted from API requests. However, any non-pointer,
  9330. // non-interface field appearing in ForceSendFields will be sent to the
  9331. // server regardless of whether the field is empty or not. This may be
  9332. // used to include empty fields in Patch requests.
  9333. ForceSendFields []string `json:"-"`
  9334. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  9335. // in API requests with the JSON null value. By default, fields with
  9336. // empty values are omitted from API requests. However, any field with
  9337. // an empty value appearing in NullFields will be sent to the server as
  9338. // null. It is an error if a field in this list has a non-empty value.
  9339. // This may be used to include null fields in Patch requests.
  9340. NullFields []string `json:"-"`
  9341. }
  9342. func (s *GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation) MarshalJSON() ([]byte, error) {
  9343. type NoMethod GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation
  9344. raw := NoMethod(*s)
  9345. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9346. }
  9347. func (s *GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation) UnmarshalJSON(data []byte) error {
  9348. type NoMethod GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation
  9349. var s1 struct {
  9350. Score gensupport.JSONFloat64 `json:"score"`
  9351. *NoMethod
  9352. }
  9353. s1.NoMethod = (*NoMethod)(s)
  9354. if err := json.Unmarshal(data, &s1); err != nil {
  9355. return err
  9356. }
  9357. s.Score = float64(s1.Score)
  9358. return nil
  9359. }
  9360. // GoogleCloudVisionV1p4beta1LocationInfo: Detected entity location
  9361. // information.
  9362. type GoogleCloudVisionV1p4beta1LocationInfo struct {
  9363. // LatLng: lat/long location coordinates.
  9364. LatLng *LatLng `json:"latLng,omitempty"`
  9365. // ForceSendFields is a list of field names (e.g. "LatLng") to
  9366. // unconditionally include in API requests. By default, fields with
  9367. // empty values are omitted from API requests. However, any non-pointer,
  9368. // non-interface field appearing in ForceSendFields will be sent to the
  9369. // server regardless of whether the field is empty or not. This may be
  9370. // used to include empty fields in Patch requests.
  9371. ForceSendFields []string `json:"-"`
  9372. // NullFields is a list of field names (e.g. "LatLng") to include in API
  9373. // requests with the JSON null value. By default, fields with empty
  9374. // values are omitted from API requests. However, any field with an
  9375. // empty value appearing in NullFields will be sent to the server as
  9376. // null. It is an error if a field in this list has a non-empty value.
  9377. // This may be used to include null fields in Patch requests.
  9378. NullFields []string `json:"-"`
  9379. }
  9380. func (s *GoogleCloudVisionV1p4beta1LocationInfo) MarshalJSON() ([]byte, error) {
  9381. type NoMethod GoogleCloudVisionV1p4beta1LocationInfo
  9382. raw := NoMethod(*s)
  9383. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9384. }
  9385. // GoogleCloudVisionV1p4beta1NormalizedVertex: A vertex represents a 2D
  9386. // point in the image.
  9387. // NOTE: the normalized vertex coordinates are relative to the original
  9388. // image
  9389. // and range from 0 to 1.
  9390. type GoogleCloudVisionV1p4beta1NormalizedVertex struct {
  9391. // X: X coordinate.
  9392. X float64 `json:"x,omitempty"`
  9393. // Y: Y coordinate.
  9394. Y float64 `json:"y,omitempty"`
  9395. // ForceSendFields is a list of field names (e.g. "X") to
  9396. // unconditionally include in API requests. By default, fields with
  9397. // empty values are omitted from API requests. However, any non-pointer,
  9398. // non-interface field appearing in ForceSendFields will be sent to the
  9399. // server regardless of whether the field is empty or not. This may be
  9400. // used to include empty fields in Patch requests.
  9401. ForceSendFields []string `json:"-"`
  9402. // NullFields is a list of field names (e.g. "X") to include in API
  9403. // requests with the JSON null value. By default, fields with empty
  9404. // values are omitted from API requests. However, any field with an
  9405. // empty value appearing in NullFields will be sent to the server as
  9406. // null. It is an error if a field in this list has a non-empty value.
  9407. // This may be used to include null fields in Patch requests.
  9408. NullFields []string `json:"-"`
  9409. }
  9410. func (s *GoogleCloudVisionV1p4beta1NormalizedVertex) MarshalJSON() ([]byte, error) {
  9411. type NoMethod GoogleCloudVisionV1p4beta1NormalizedVertex
  9412. raw := NoMethod(*s)
  9413. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9414. }
  9415. func (s *GoogleCloudVisionV1p4beta1NormalizedVertex) UnmarshalJSON(data []byte) error {
  9416. type NoMethod GoogleCloudVisionV1p4beta1NormalizedVertex
  9417. var s1 struct {
  9418. X gensupport.JSONFloat64 `json:"x"`
  9419. Y gensupport.JSONFloat64 `json:"y"`
  9420. *NoMethod
  9421. }
  9422. s1.NoMethod = (*NoMethod)(s)
  9423. if err := json.Unmarshal(data, &s1); err != nil {
  9424. return err
  9425. }
  9426. s.X = float64(s1.X)
  9427. s.Y = float64(s1.Y)
  9428. return nil
  9429. }
  9430. // GoogleCloudVisionV1p4beta1OperationMetadata: Contains metadata for
  9431. // the BatchAnnotateImages operation.
  9432. type GoogleCloudVisionV1p4beta1OperationMetadata struct {
  9433. // CreateTime: The time when the batch request was received.
  9434. CreateTime string `json:"createTime,omitempty"`
  9435. // State: Current state of the batch operation.
  9436. //
  9437. // Possible values:
  9438. // "STATE_UNSPECIFIED" - Invalid.
  9439. // "CREATED" - Request is received.
  9440. // "RUNNING" - Request is actively being processed.
  9441. // "DONE" - The batch processing is done.
  9442. // "CANCELLED" - The batch processing was cancelled.
  9443. State string `json:"state,omitempty"`
  9444. // UpdateTime: The time when the operation result was last updated.
  9445. UpdateTime string `json:"updateTime,omitempty"`
  9446. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  9447. // unconditionally include in API requests. By default, fields with
  9448. // empty values are omitted from API requests. However, any non-pointer,
  9449. // non-interface field appearing in ForceSendFields will be sent to the
  9450. // server regardless of whether the field is empty or not. This may be
  9451. // used to include empty fields in Patch requests.
  9452. ForceSendFields []string `json:"-"`
  9453. // NullFields is a list of field names (e.g. "CreateTime") to include in
  9454. // API requests with the JSON null value. By default, fields with empty
  9455. // values are omitted from API requests. However, any field with an
  9456. // empty value appearing in NullFields will be sent to the server as
  9457. // null. It is an error if a field in this list has a non-empty value.
  9458. // This may be used to include null fields in Patch requests.
  9459. NullFields []string `json:"-"`
  9460. }
  9461. func (s *GoogleCloudVisionV1p4beta1OperationMetadata) MarshalJSON() ([]byte, error) {
  9462. type NoMethod GoogleCloudVisionV1p4beta1OperationMetadata
  9463. raw := NoMethod(*s)
  9464. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9465. }
  9466. // GoogleCloudVisionV1p4beta1OutputConfig: The desired output location
  9467. // and metadata.
  9468. type GoogleCloudVisionV1p4beta1OutputConfig struct {
  9469. // BatchSize: The max number of response protos to put into each output
  9470. // JSON file on
  9471. // Google Cloud Storage.
  9472. // The valid range is [1, 100]. If not specified, the default value is
  9473. // 20.
  9474. //
  9475. // For example, for one pdf file with 100 pages, 100 response protos
  9476. // will
  9477. // be generated. If `batch_size` = 20, then 5 json files each
  9478. // containing 20 response protos will be written under the
  9479. // prefix
  9480. // `gcs_destination`.`uri`.
  9481. //
  9482. // Currently, batch_size only applies to GcsDestination, with potential
  9483. // future
  9484. // support for other output configurations.
  9485. BatchSize int64 `json:"batchSize,omitempty"`
  9486. // GcsDestination: The Google Cloud Storage location to write the
  9487. // output(s) to.
  9488. GcsDestination *GoogleCloudVisionV1p4beta1GcsDestination `json:"gcsDestination,omitempty"`
  9489. // ForceSendFields is a list of field names (e.g. "BatchSize") to
  9490. // unconditionally include in API requests. By default, fields with
  9491. // empty values are omitted from API requests. However, any non-pointer,
  9492. // non-interface field appearing in ForceSendFields will be sent to the
  9493. // server regardless of whether the field is empty or not. This may be
  9494. // used to include empty fields in Patch requests.
  9495. ForceSendFields []string `json:"-"`
  9496. // NullFields is a list of field names (e.g. "BatchSize") to include in
  9497. // API requests with the JSON null value. By default, fields with empty
  9498. // values are omitted from API requests. However, any field with an
  9499. // empty value appearing in NullFields will be sent to the server as
  9500. // null. It is an error if a field in this list has a non-empty value.
  9501. // This may be used to include null fields in Patch requests.
  9502. NullFields []string `json:"-"`
  9503. }
  9504. func (s *GoogleCloudVisionV1p4beta1OutputConfig) MarshalJSON() ([]byte, error) {
  9505. type NoMethod GoogleCloudVisionV1p4beta1OutputConfig
  9506. raw := NoMethod(*s)
  9507. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9508. }
  9509. // GoogleCloudVisionV1p4beta1Page: Detected page from OCR.
  9510. type GoogleCloudVisionV1p4beta1Page struct {
  9511. // Blocks: List of blocks of text, images etc on this page.
  9512. Blocks []*GoogleCloudVisionV1p4beta1Block `json:"blocks,omitempty"`
  9513. // Confidence: Confidence of the OCR results on the page. Range [0, 1].
  9514. Confidence float64 `json:"confidence,omitempty"`
  9515. // Height: Page height. For PDFs the unit is points. For images
  9516. // (including
  9517. // TIFFs) the unit is pixels.
  9518. Height int64 `json:"height,omitempty"`
  9519. // Property: Additional information detected on the page.
  9520. Property *GoogleCloudVisionV1p4beta1TextAnnotationTextProperty `json:"property,omitempty"`
  9521. // Width: Page width. For PDFs the unit is points. For images
  9522. // (including
  9523. // TIFFs) the unit is pixels.
  9524. Width int64 `json:"width,omitempty"`
  9525. // ForceSendFields is a list of field names (e.g. "Blocks") to
  9526. // unconditionally include in API requests. By default, fields with
  9527. // empty values are omitted from API requests. However, any non-pointer,
  9528. // non-interface field appearing in ForceSendFields will be sent to the
  9529. // server regardless of whether the field is empty or not. This may be
  9530. // used to include empty fields in Patch requests.
  9531. ForceSendFields []string `json:"-"`
  9532. // NullFields is a list of field names (e.g. "Blocks") to include in API
  9533. // requests with the JSON null value. By default, fields with empty
  9534. // values are omitted from API requests. However, any field with an
  9535. // 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. func (s *GoogleCloudVisionV1p4beta1Page) MarshalJSON() ([]byte, error) {
  9541. type NoMethod GoogleCloudVisionV1p4beta1Page
  9542. raw := NoMethod(*s)
  9543. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9544. }
  9545. func (s *GoogleCloudVisionV1p4beta1Page) UnmarshalJSON(data []byte) error {
  9546. type NoMethod GoogleCloudVisionV1p4beta1Page
  9547. var s1 struct {
  9548. Confidence gensupport.JSONFloat64 `json:"confidence"`
  9549. *NoMethod
  9550. }
  9551. s1.NoMethod = (*NoMethod)(s)
  9552. if err := json.Unmarshal(data, &s1); err != nil {
  9553. return err
  9554. }
  9555. s.Confidence = float64(s1.Confidence)
  9556. return nil
  9557. }
  9558. // GoogleCloudVisionV1p4beta1Paragraph: Structural unit of text
  9559. // representing a number of words in certain order.
  9560. type GoogleCloudVisionV1p4beta1Paragraph struct {
  9561. // BoundingBox: The bounding box for the paragraph.
  9562. // The vertices are in the order of top-left, top-right,
  9563. // bottom-right,
  9564. // bottom-left. When a rotation of the bounding box is detected the
  9565. // rotation
  9566. // is represented as around the top-left corner as defined when the text
  9567. // is
  9568. // read in the 'natural' orientation.
  9569. // For example:
  9570. // * when the text is horizontal it might look like:
  9571. // 0----1
  9572. // | |
  9573. // 3----2
  9574. // * when it's rotated 180 degrees around the top-left corner it
  9575. // becomes:
  9576. // 2----3
  9577. // | |
  9578. // 1----0
  9579. // and the vertex order will still be (0, 1, 2, 3).
  9580. BoundingBox *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingBox,omitempty"`
  9581. // Confidence: Confidence of the OCR results for the paragraph. Range
  9582. // [0, 1].
  9583. Confidence float64 `json:"confidence,omitempty"`
  9584. // Property: Additional information detected for the paragraph.
  9585. Property *GoogleCloudVisionV1p4beta1TextAnnotationTextProperty `json:"property,omitempty"`
  9586. // Words: List of words in this paragraph.
  9587. Words []*GoogleCloudVisionV1p4beta1Word `json:"words,omitempty"`
  9588. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  9589. // unconditionally include in API requests. By default, fields with
  9590. // empty values are omitted from API requests. However, any non-pointer,
  9591. // non-interface field appearing in ForceSendFields will be sent to the
  9592. // server regardless of whether the field is empty or not. This may be
  9593. // used to include empty fields in Patch requests.
  9594. ForceSendFields []string `json:"-"`
  9595. // NullFields is a list of field names (e.g. "BoundingBox") to include
  9596. // in API requests with the JSON null value. By default, fields with
  9597. // empty values are omitted from API requests. However, any field with
  9598. // an empty value appearing in NullFields will be sent to the server as
  9599. // null. It is an error if a field in this list has a non-empty value.
  9600. // This may be used to include null fields in Patch requests.
  9601. NullFields []string `json:"-"`
  9602. }
  9603. func (s *GoogleCloudVisionV1p4beta1Paragraph) MarshalJSON() ([]byte, error) {
  9604. type NoMethod GoogleCloudVisionV1p4beta1Paragraph
  9605. raw := NoMethod(*s)
  9606. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9607. }
  9608. func (s *GoogleCloudVisionV1p4beta1Paragraph) UnmarshalJSON(data []byte) error {
  9609. type NoMethod GoogleCloudVisionV1p4beta1Paragraph
  9610. var s1 struct {
  9611. Confidence gensupport.JSONFloat64 `json:"confidence"`
  9612. *NoMethod
  9613. }
  9614. s1.NoMethod = (*NoMethod)(s)
  9615. if err := json.Unmarshal(data, &s1); err != nil {
  9616. return err
  9617. }
  9618. s.Confidence = float64(s1.Confidence)
  9619. return nil
  9620. }
  9621. // GoogleCloudVisionV1p4beta1Position: A 3D position in the image, used
  9622. // primarily for Face detection landmarks.
  9623. // A valid Position must have both x and y coordinates.
  9624. // The position coordinates are in the same scale as the original image.
  9625. type GoogleCloudVisionV1p4beta1Position struct {
  9626. // X: X coordinate.
  9627. X float64 `json:"x,omitempty"`
  9628. // Y: Y coordinate.
  9629. Y float64 `json:"y,omitempty"`
  9630. // Z: Z coordinate (or depth).
  9631. Z float64 `json:"z,omitempty"`
  9632. // ForceSendFields is a list of field names (e.g. "X") to
  9633. // unconditionally include in API requests. By default, fields with
  9634. // empty values are omitted from API requests. However, any non-pointer,
  9635. // non-interface field appearing in ForceSendFields will be sent to the
  9636. // server regardless of whether the field is empty or not. This may be
  9637. // used to include empty fields in Patch requests.
  9638. ForceSendFields []string `json:"-"`
  9639. // NullFields is a list of field names (e.g. "X") to include in API
  9640. // requests with the JSON null value. By default, fields with empty
  9641. // values are omitted from API requests. However, any field with an
  9642. // empty value appearing in NullFields will be sent to the server as
  9643. // null. It is an error if a field in this list has a non-empty value.
  9644. // This may be used to include null fields in Patch requests.
  9645. NullFields []string `json:"-"`
  9646. }
  9647. func (s *GoogleCloudVisionV1p4beta1Position) MarshalJSON() ([]byte, error) {
  9648. type NoMethod GoogleCloudVisionV1p4beta1Position
  9649. raw := NoMethod(*s)
  9650. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9651. }
  9652. func (s *GoogleCloudVisionV1p4beta1Position) UnmarshalJSON(data []byte) error {
  9653. type NoMethod GoogleCloudVisionV1p4beta1Position
  9654. var s1 struct {
  9655. X gensupport.JSONFloat64 `json:"x"`
  9656. Y gensupport.JSONFloat64 `json:"y"`
  9657. Z gensupport.JSONFloat64 `json:"z"`
  9658. *NoMethod
  9659. }
  9660. s1.NoMethod = (*NoMethod)(s)
  9661. if err := json.Unmarshal(data, &s1); err != nil {
  9662. return err
  9663. }
  9664. s.X = float64(s1.X)
  9665. s.Y = float64(s1.Y)
  9666. s.Z = float64(s1.Z)
  9667. return nil
  9668. }
  9669. // GoogleCloudVisionV1p4beta1Product: A Product contains
  9670. // ReferenceImages.
  9671. type GoogleCloudVisionV1p4beta1Product struct {
  9672. // Description: User-provided metadata to be stored with this product.
  9673. // Must be at most 4096
  9674. // characters long.
  9675. Description string `json:"description,omitempty"`
  9676. // DisplayName: The user-provided name for this Product. Must not be
  9677. // empty. Must be at most
  9678. // 4096 characters long.
  9679. DisplayName string `json:"displayName,omitempty"`
  9680. // Name: The resource name of the product.
  9681. //
  9682. // Format
  9683. // is:
  9684. // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
  9685. //
  9686. // This field is ignored when creating a product.
  9687. Name string `json:"name,omitempty"`
  9688. // ProductCategory: The category for the product identified by the
  9689. // reference image. This should
  9690. // be either "homegoods", "apparel", or "toys".
  9691. //
  9692. // This field is immutable.
  9693. ProductCategory string `json:"productCategory,omitempty"`
  9694. // ProductLabels: Key-value pairs that can be attached to a product. At
  9695. // query time,
  9696. // constraints can be specified based on the product_labels.
  9697. //
  9698. // Note that integer values can be provided as strings, e.g. "1199".
  9699. // Only
  9700. // strings with integer values can match a range-based restriction which
  9701. // is
  9702. // to be supported soon.
  9703. //
  9704. // Multiple values can be assigned to the same key. One product may have
  9705. // up to
  9706. // 100 product_labels.
  9707. ProductLabels []*GoogleCloudVisionV1p4beta1ProductKeyValue `json:"productLabels,omitempty"`
  9708. // ForceSendFields is a list of field names (e.g. "Description") to
  9709. // unconditionally include in API requests. By default, fields with
  9710. // empty values are omitted from API requests. However, any non-pointer,
  9711. // non-interface field appearing in ForceSendFields will be sent to the
  9712. // server regardless of whether the field is empty or not. This may be
  9713. // used to include empty fields in Patch requests.
  9714. ForceSendFields []string `json:"-"`
  9715. // NullFields is a list of field names (e.g. "Description") to include
  9716. // in API requests with the JSON null value. By default, fields with
  9717. // empty values are omitted from API requests. However, any field with
  9718. // an empty value appearing in NullFields will be sent to the server as
  9719. // null. It is an error if a field in this list has a non-empty value.
  9720. // This may be used to include null fields in Patch requests.
  9721. NullFields []string `json:"-"`
  9722. }
  9723. func (s *GoogleCloudVisionV1p4beta1Product) MarshalJSON() ([]byte, error) {
  9724. type NoMethod GoogleCloudVisionV1p4beta1Product
  9725. raw := NoMethod(*s)
  9726. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9727. }
  9728. // GoogleCloudVisionV1p4beta1ProductKeyValue: A product label
  9729. // represented as a key-value pair.
  9730. type GoogleCloudVisionV1p4beta1ProductKeyValue struct {
  9731. // Key: The key of the label attached to the product. Cannot be empty
  9732. // and cannot
  9733. // exceed 128 bytes.
  9734. Key string `json:"key,omitempty"`
  9735. // Value: The value of the label attached to the product. Cannot be
  9736. // empty and
  9737. // cannot exceed 128 bytes.
  9738. Value string `json:"value,omitempty"`
  9739. // ForceSendFields is a list of field names (e.g. "Key") to
  9740. // unconditionally include in API requests. By default, fields with
  9741. // empty values are omitted from API requests. However, any non-pointer,
  9742. // non-interface field appearing in ForceSendFields will be sent to the
  9743. // server regardless of whether the field is empty or not. This may be
  9744. // used to include empty fields in Patch requests.
  9745. ForceSendFields []string `json:"-"`
  9746. // NullFields is a list of field names (e.g. "Key") to include in API
  9747. // requests with the JSON null value. By default, fields with empty
  9748. // values are omitted from API requests. However, any field with an
  9749. // empty value appearing in NullFields will be sent to the server as
  9750. // null. It is an error if a field in this list has a non-empty value.
  9751. // This may be used to include null fields in Patch requests.
  9752. NullFields []string `json:"-"`
  9753. }
  9754. func (s *GoogleCloudVisionV1p4beta1ProductKeyValue) MarshalJSON() ([]byte, error) {
  9755. type NoMethod GoogleCloudVisionV1p4beta1ProductKeyValue
  9756. raw := NoMethod(*s)
  9757. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9758. }
  9759. // GoogleCloudVisionV1p4beta1ProductSearchResults: Results for a product
  9760. // search request.
  9761. type GoogleCloudVisionV1p4beta1ProductSearchResults struct {
  9762. // IndexTime: Timestamp of the index which provided these results.
  9763. // Changes made after
  9764. // this time are not reflected in the current results.
  9765. IndexTime string `json:"indexTime,omitempty"`
  9766. // ProductGroupedResults: List of results grouped by products detected
  9767. // in the query image. Each entry
  9768. // corresponds to one bounding polygon in the query image, and contains
  9769. // the
  9770. // matching products specific to that region. There may be duplicate
  9771. // product
  9772. // matches in the union of all the per-product results.
  9773. ProductGroupedResults []*GoogleCloudVisionV1p4beta1ProductSearchResultsGroupedResult `json:"productGroupedResults,omitempty"`
  9774. // Results: List of results, one for each product match.
  9775. Results []*GoogleCloudVisionV1p4beta1ProductSearchResultsResult `json:"results,omitempty"`
  9776. // ForceSendFields is a list of field names (e.g. "IndexTime") to
  9777. // unconditionally include in API requests. By default, fields with
  9778. // empty values are omitted from API requests. However, any non-pointer,
  9779. // non-interface field appearing in ForceSendFields will be sent to the
  9780. // server regardless of whether the field is empty or not. This may be
  9781. // used to include empty fields in Patch requests.
  9782. ForceSendFields []string `json:"-"`
  9783. // NullFields is a list of field names (e.g. "IndexTime") to include in
  9784. // API requests with the JSON null value. By default, fields with empty
  9785. // values are omitted from API requests. However, any field with an
  9786. // empty value appearing in NullFields will be sent to the server as
  9787. // null. It is an error if a field in this list has a non-empty value.
  9788. // This may be used to include null fields in Patch requests.
  9789. NullFields []string `json:"-"`
  9790. }
  9791. func (s *GoogleCloudVisionV1p4beta1ProductSearchResults) MarshalJSON() ([]byte, error) {
  9792. type NoMethod GoogleCloudVisionV1p4beta1ProductSearchResults
  9793. raw := NoMethod(*s)
  9794. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9795. }
  9796. // GoogleCloudVisionV1p4beta1ProductSearchResultsGroupedResult:
  9797. // Information about the products similar to a single product in a
  9798. // query
  9799. // image.
  9800. type GoogleCloudVisionV1p4beta1ProductSearchResultsGroupedResult struct {
  9801. // BoundingPoly: The bounding polygon around the product detected in the
  9802. // query image.
  9803. BoundingPoly *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingPoly,omitempty"`
  9804. // Results: List of results, one for each product match.
  9805. Results []*GoogleCloudVisionV1p4beta1ProductSearchResultsResult `json:"results,omitempty"`
  9806. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  9807. // unconditionally include in API requests. By default, fields with
  9808. // empty values are omitted from API requests. However, any non-pointer,
  9809. // non-interface field appearing in ForceSendFields will be sent to the
  9810. // server regardless of whether the field is empty or not. This may be
  9811. // used to include empty fields in Patch requests.
  9812. ForceSendFields []string `json:"-"`
  9813. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  9814. // in API requests with the JSON null value. By default, fields with
  9815. // empty values are omitted from API requests. However, any field with
  9816. // an empty value appearing in NullFields will be sent to the server as
  9817. // null. It is an error if a field in this list has a non-empty value.
  9818. // This may be used to include null fields in Patch requests.
  9819. NullFields []string `json:"-"`
  9820. }
  9821. func (s *GoogleCloudVisionV1p4beta1ProductSearchResultsGroupedResult) MarshalJSON() ([]byte, error) {
  9822. type NoMethod GoogleCloudVisionV1p4beta1ProductSearchResultsGroupedResult
  9823. raw := NoMethod(*s)
  9824. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9825. }
  9826. // GoogleCloudVisionV1p4beta1ProductSearchResultsResult: Information
  9827. // about a product.
  9828. type GoogleCloudVisionV1p4beta1ProductSearchResultsResult struct {
  9829. // Image: The resource name of the image from the product that is the
  9830. // closest match
  9831. // to the query.
  9832. Image string `json:"image,omitempty"`
  9833. // Product: The Product.
  9834. Product *GoogleCloudVisionV1p4beta1Product `json:"product,omitempty"`
  9835. // Score: A confidence level on the match, ranging from 0 (no
  9836. // confidence) to
  9837. // 1 (full confidence).
  9838. Score float64 `json:"score,omitempty"`
  9839. // ForceSendFields is a list of field names (e.g. "Image") to
  9840. // unconditionally include in API requests. By default, fields with
  9841. // empty values are omitted from API requests. However, any non-pointer,
  9842. // non-interface field appearing in ForceSendFields will be sent to the
  9843. // server regardless of whether the field is empty or not. This may be
  9844. // used to include empty fields in Patch requests.
  9845. ForceSendFields []string `json:"-"`
  9846. // NullFields is a list of field names (e.g. "Image") to include in API
  9847. // requests with the JSON null value. By default, fields with empty
  9848. // values are omitted from API requests. However, any field with an
  9849. // empty value appearing in NullFields will be sent to the server as
  9850. // null. It is an error if a field in this list has a non-empty value.
  9851. // This may be used to include null fields in Patch requests.
  9852. NullFields []string `json:"-"`
  9853. }
  9854. func (s *GoogleCloudVisionV1p4beta1ProductSearchResultsResult) MarshalJSON() ([]byte, error) {
  9855. type NoMethod GoogleCloudVisionV1p4beta1ProductSearchResultsResult
  9856. raw := NoMethod(*s)
  9857. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9858. }
  9859. func (s *GoogleCloudVisionV1p4beta1ProductSearchResultsResult) UnmarshalJSON(data []byte) error {
  9860. type NoMethod GoogleCloudVisionV1p4beta1ProductSearchResultsResult
  9861. var s1 struct {
  9862. Score gensupport.JSONFloat64 `json:"score"`
  9863. *NoMethod
  9864. }
  9865. s1.NoMethod = (*NoMethod)(s)
  9866. if err := json.Unmarshal(data, &s1); err != nil {
  9867. return err
  9868. }
  9869. s.Score = float64(s1.Score)
  9870. return nil
  9871. }
  9872. // GoogleCloudVisionV1p4beta1Property: A `Property` consists of a
  9873. // user-supplied name/value pair.
  9874. type GoogleCloudVisionV1p4beta1Property struct {
  9875. // Name: Name of the property.
  9876. Name string `json:"name,omitempty"`
  9877. // Uint64Value: Value of numeric properties.
  9878. Uint64Value uint64 `json:"uint64Value,omitempty,string"`
  9879. // Value: Value of the property.
  9880. Value string `json:"value,omitempty"`
  9881. // ForceSendFields is a list of field names (e.g. "Name") to
  9882. // unconditionally include in API requests. By default, fields with
  9883. // empty values are omitted from API requests. However, any non-pointer,
  9884. // non-interface field appearing in ForceSendFields will be sent to the
  9885. // server regardless of whether the field is empty or not. This may be
  9886. // used to include empty fields in Patch requests.
  9887. ForceSendFields []string `json:"-"`
  9888. // NullFields is a list of field names (e.g. "Name") to include in API
  9889. // requests with the JSON null value. By default, fields with empty
  9890. // values are omitted from API requests. However, any field with an
  9891. // empty value appearing in NullFields will be sent to the server as
  9892. // null. It is an error if a field in this list has a non-empty value.
  9893. // This may be used to include null fields in Patch requests.
  9894. NullFields []string `json:"-"`
  9895. }
  9896. func (s *GoogleCloudVisionV1p4beta1Property) MarshalJSON() ([]byte, error) {
  9897. type NoMethod GoogleCloudVisionV1p4beta1Property
  9898. raw := NoMethod(*s)
  9899. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9900. }
  9901. // GoogleCloudVisionV1p4beta1ReferenceImage: A `ReferenceImage`
  9902. // represents a product image and its associated metadata,
  9903. // such as bounding boxes.
  9904. type GoogleCloudVisionV1p4beta1ReferenceImage struct {
  9905. // BoundingPolys: Bounding polygons around the areas of interest in the
  9906. // reference image.
  9907. // Optional. If this field is empty, the system will try to detect
  9908. // regions of
  9909. // interest. At most 10 bounding polygons will be used.
  9910. //
  9911. // The provided shape is converted into a non-rotated rectangle.
  9912. // Once
  9913. // converted, the small edge of the rectangle must be greater than or
  9914. // equal
  9915. // to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok;
  9916. // 1:5
  9917. // is not).
  9918. BoundingPolys []*GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingPolys,omitempty"`
  9919. // Name: The resource name of the reference image.
  9920. //
  9921. // Format
  9922. // is:
  9923. //
  9924. // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referen
  9925. // ceImages/IMAGE_ID`.
  9926. //
  9927. // This field is ignored when creating a reference image.
  9928. Name string `json:"name,omitempty"`
  9929. // Uri: The Google Cloud Storage URI of the reference image.
  9930. //
  9931. // The URI must start with `gs://`.
  9932. //
  9933. // Required.
  9934. Uri string `json:"uri,omitempty"`
  9935. // ForceSendFields is a list of field names (e.g. "BoundingPolys") to
  9936. // unconditionally include in API requests. By default, fields with
  9937. // empty values are omitted from API requests. However, any non-pointer,
  9938. // non-interface field appearing in ForceSendFields will be sent to the
  9939. // server regardless of whether the field is empty or not. This may be
  9940. // used to include empty fields in Patch requests.
  9941. ForceSendFields []string `json:"-"`
  9942. // NullFields is a list of field names (e.g. "BoundingPolys") to include
  9943. // in API requests with the JSON null value. By default, fields with
  9944. // empty values are omitted from API requests. However, any field with
  9945. // an empty value appearing in NullFields will be sent to the server as
  9946. // null. It is an error if a field in this list has a non-empty value.
  9947. // This may be used to include null fields in Patch requests.
  9948. NullFields []string `json:"-"`
  9949. }
  9950. func (s *GoogleCloudVisionV1p4beta1ReferenceImage) MarshalJSON() ([]byte, error) {
  9951. type NoMethod GoogleCloudVisionV1p4beta1ReferenceImage
  9952. raw := NoMethod(*s)
  9953. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9954. }
  9955. // GoogleCloudVisionV1p4beta1SafeSearchAnnotation: Set of features
  9956. // pertaining to the image, computed by computer vision
  9957. // methods over safe-search verticals (for example, adult, spoof,
  9958. // medical,
  9959. // violence).
  9960. type GoogleCloudVisionV1p4beta1SafeSearchAnnotation struct {
  9961. // Adult: Represents the adult content likelihood for the image. Adult
  9962. // content may
  9963. // contain elements such as nudity, pornographic images or cartoons,
  9964. // or
  9965. // sexual activities.
  9966. //
  9967. // Possible values:
  9968. // "UNKNOWN" - Unknown likelihood.
  9969. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  9970. // specified vertical.
  9971. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  9972. // vertical.
  9973. // "POSSIBLE" - It is possible that the image belongs to the specified
  9974. // vertical.
  9975. // "LIKELY" - It is likely that the image belongs to the specified
  9976. // vertical.
  9977. // "VERY_LIKELY" - It is very likely that the image belongs to the
  9978. // specified vertical.
  9979. Adult string `json:"adult,omitempty"`
  9980. // Medical: Likelihood that this is a medical image.
  9981. //
  9982. // Possible values:
  9983. // "UNKNOWN" - Unknown likelihood.
  9984. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  9985. // specified vertical.
  9986. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  9987. // vertical.
  9988. // "POSSIBLE" - It is possible that the image belongs to the specified
  9989. // vertical.
  9990. // "LIKELY" - It is likely that the image belongs to the specified
  9991. // vertical.
  9992. // "VERY_LIKELY" - It is very likely that the image belongs to the
  9993. // specified vertical.
  9994. Medical string `json:"medical,omitempty"`
  9995. // Racy: Likelihood that the request image contains racy content. Racy
  9996. // content may
  9997. // include (but is not limited to) skimpy or sheer clothing,
  9998. // strategically
  9999. // covered nudity, lewd or provocative poses, or close-ups of
  10000. // sensitive
  10001. // body areas.
  10002. //
  10003. // Possible values:
  10004. // "UNKNOWN" - Unknown likelihood.
  10005. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  10006. // specified vertical.
  10007. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  10008. // vertical.
  10009. // "POSSIBLE" - It is possible that the image belongs to the specified
  10010. // vertical.
  10011. // "LIKELY" - It is likely that the image belongs to the specified
  10012. // vertical.
  10013. // "VERY_LIKELY" - It is very likely that the image belongs to the
  10014. // specified vertical.
  10015. Racy string `json:"racy,omitempty"`
  10016. // Spoof: Spoof likelihood. The likelihood that an modification
  10017. // was made to the image's canonical version to make it appear
  10018. // funny or offensive.
  10019. //
  10020. // Possible values:
  10021. // "UNKNOWN" - Unknown likelihood.
  10022. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  10023. // specified vertical.
  10024. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  10025. // vertical.
  10026. // "POSSIBLE" - It is possible that the image belongs to the specified
  10027. // vertical.
  10028. // "LIKELY" - It is likely that the image belongs to the specified
  10029. // vertical.
  10030. // "VERY_LIKELY" - It is very likely that the image belongs to the
  10031. // specified vertical.
  10032. Spoof string `json:"spoof,omitempty"`
  10033. // Violence: Likelihood that this image contains violent content.
  10034. //
  10035. // Possible values:
  10036. // "UNKNOWN" - Unknown likelihood.
  10037. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  10038. // specified vertical.
  10039. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  10040. // vertical.
  10041. // "POSSIBLE" - It is possible that the image belongs to the specified
  10042. // vertical.
  10043. // "LIKELY" - It is likely that the image belongs to the specified
  10044. // vertical.
  10045. // "VERY_LIKELY" - It is very likely that the image belongs to the
  10046. // specified vertical.
  10047. Violence string `json:"violence,omitempty"`
  10048. // ForceSendFields is a list of field names (e.g. "Adult") to
  10049. // unconditionally include in API requests. By default, fields with
  10050. // empty values are omitted from API requests. However, any non-pointer,
  10051. // non-interface field appearing in ForceSendFields will be sent to the
  10052. // server regardless of whether the field is empty or not. This may be
  10053. // used to include empty fields in Patch requests.
  10054. ForceSendFields []string `json:"-"`
  10055. // NullFields is a list of field names (e.g. "Adult") to include in API
  10056. // requests with the JSON null value. By default, fields with empty
  10057. // values are omitted from API requests. However, any field with an
  10058. // empty value appearing in NullFields will be sent to the server as
  10059. // null. It is an error if a field in this list has a non-empty value.
  10060. // This may be used to include null fields in Patch requests.
  10061. NullFields []string `json:"-"`
  10062. }
  10063. func (s *GoogleCloudVisionV1p4beta1SafeSearchAnnotation) MarshalJSON() ([]byte, error) {
  10064. type NoMethod GoogleCloudVisionV1p4beta1SafeSearchAnnotation
  10065. raw := NoMethod(*s)
  10066. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10067. }
  10068. // GoogleCloudVisionV1p4beta1Symbol: A single symbol representation.
  10069. type GoogleCloudVisionV1p4beta1Symbol struct {
  10070. // BoundingBox: The bounding box for the symbol.
  10071. // The vertices are in the order of top-left, top-right,
  10072. // bottom-right,
  10073. // bottom-left. When a rotation of the bounding box is detected the
  10074. // rotation
  10075. // is represented as around the top-left corner as defined when the text
  10076. // is
  10077. // read in the 'natural' orientation.
  10078. // For example:
  10079. // * when the text is horizontal it might look like:
  10080. // 0----1
  10081. // | |
  10082. // 3----2
  10083. // * when it's rotated 180 degrees around the top-left corner it
  10084. // becomes:
  10085. // 2----3
  10086. // | |
  10087. // 1----0
  10088. // and the vertice order will still be (0, 1, 2, 3).
  10089. BoundingBox *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingBox,omitempty"`
  10090. // Confidence: Confidence of the OCR results for the symbol. Range [0,
  10091. // 1].
  10092. Confidence float64 `json:"confidence,omitempty"`
  10093. // Property: Additional information detected for the symbol.
  10094. Property *GoogleCloudVisionV1p4beta1TextAnnotationTextProperty `json:"property,omitempty"`
  10095. // Text: The actual UTF-8 representation of the symbol.
  10096. Text string `json:"text,omitempty"`
  10097. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  10098. // unconditionally include in API requests. By default, fields with
  10099. // empty values are omitted from API requests. However, any non-pointer,
  10100. // non-interface field appearing in ForceSendFields will be sent to the
  10101. // server regardless of whether the field is empty or not. This may be
  10102. // used to include empty fields in Patch requests.
  10103. ForceSendFields []string `json:"-"`
  10104. // NullFields is a list of field names (e.g. "BoundingBox") to include
  10105. // in API requests with the JSON null value. By default, fields with
  10106. // empty values are omitted from API requests. However, any field with
  10107. // an empty value appearing in NullFields will be sent to the server as
  10108. // null. It is an error if a field in this list has a non-empty value.
  10109. // This may be used to include null fields in Patch requests.
  10110. NullFields []string `json:"-"`
  10111. }
  10112. func (s *GoogleCloudVisionV1p4beta1Symbol) MarshalJSON() ([]byte, error) {
  10113. type NoMethod GoogleCloudVisionV1p4beta1Symbol
  10114. raw := NoMethod(*s)
  10115. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10116. }
  10117. func (s *GoogleCloudVisionV1p4beta1Symbol) UnmarshalJSON(data []byte) error {
  10118. type NoMethod GoogleCloudVisionV1p4beta1Symbol
  10119. var s1 struct {
  10120. Confidence gensupport.JSONFloat64 `json:"confidence"`
  10121. *NoMethod
  10122. }
  10123. s1.NoMethod = (*NoMethod)(s)
  10124. if err := json.Unmarshal(data, &s1); err != nil {
  10125. return err
  10126. }
  10127. s.Confidence = float64(s1.Confidence)
  10128. return nil
  10129. }
  10130. // GoogleCloudVisionV1p4beta1TextAnnotation: TextAnnotation contains a
  10131. // structured representation of OCR extracted text.
  10132. // The hierarchy of an OCR extracted text structure is like this:
  10133. // TextAnnotation -> Page -> Block -> Paragraph -> Word ->
  10134. // Symbol
  10135. // Each structural component, starting from Page, may further have their
  10136. // own
  10137. // properties. Properties describe detected languages, breaks etc..
  10138. // Please refer
  10139. // to the TextAnnotation.TextProperty message definition below for
  10140. // more
  10141. // detail.
  10142. type GoogleCloudVisionV1p4beta1TextAnnotation struct {
  10143. // Pages: List of pages detected by OCR.
  10144. Pages []*GoogleCloudVisionV1p4beta1Page `json:"pages,omitempty"`
  10145. // Text: UTF-8 text detected on the pages.
  10146. Text string `json:"text,omitempty"`
  10147. // ForceSendFields is a list of field names (e.g. "Pages") to
  10148. // unconditionally include in API requests. By default, fields with
  10149. // empty values are omitted from API requests. However, any non-pointer,
  10150. // non-interface field appearing in ForceSendFields will be sent to the
  10151. // server regardless of whether the field is empty or not. This may be
  10152. // used to include empty fields in Patch requests.
  10153. ForceSendFields []string `json:"-"`
  10154. // NullFields is a list of field names (e.g. "Pages") to include in API
  10155. // requests with the JSON null value. By default, fields with empty
  10156. // values are omitted from API requests. However, any field with an
  10157. // empty value appearing in NullFields will be sent to the server as
  10158. // null. It is an error if a field in this list has a non-empty value.
  10159. // This may be used to include null fields in Patch requests.
  10160. NullFields []string `json:"-"`
  10161. }
  10162. func (s *GoogleCloudVisionV1p4beta1TextAnnotation) MarshalJSON() ([]byte, error) {
  10163. type NoMethod GoogleCloudVisionV1p4beta1TextAnnotation
  10164. raw := NoMethod(*s)
  10165. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10166. }
  10167. // GoogleCloudVisionV1p4beta1TextAnnotationDetectedBreak: Detected start
  10168. // or end of a structural component.
  10169. type GoogleCloudVisionV1p4beta1TextAnnotationDetectedBreak struct {
  10170. // IsPrefix: True if break prepends the element.
  10171. IsPrefix bool `json:"isPrefix,omitempty"`
  10172. // Type: Detected break type.
  10173. //
  10174. // Possible values:
  10175. // "UNKNOWN" - Unknown break label type.
  10176. // "SPACE" - Regular space.
  10177. // "SURE_SPACE" - Sure space (very wide).
  10178. // "EOL_SURE_SPACE" - Line-wrapping break.
  10179. // "HYPHEN" - End-line hyphen that is not present in text; does not
  10180. // co-occur with
  10181. // `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`.
  10182. // "LINE_BREAK" - Line break that ends a paragraph.
  10183. Type string `json:"type,omitempty"`
  10184. // ForceSendFields is a list of field names (e.g. "IsPrefix") to
  10185. // unconditionally include in API requests. By default, fields with
  10186. // empty values are omitted from API requests. However, any non-pointer,
  10187. // non-interface field appearing in ForceSendFields will be sent to the
  10188. // server regardless of whether the field is empty or not. This may be
  10189. // used to include empty fields in Patch requests.
  10190. ForceSendFields []string `json:"-"`
  10191. // NullFields is a list of field names (e.g. "IsPrefix") to include in
  10192. // API requests with the JSON null value. By default, fields with empty
  10193. // values are omitted from API requests. However, any field with an
  10194. // empty value appearing in NullFields will be sent to the server as
  10195. // null. It is an error if a field in this list has a non-empty value.
  10196. // This may be used to include null fields in Patch requests.
  10197. NullFields []string `json:"-"`
  10198. }
  10199. func (s *GoogleCloudVisionV1p4beta1TextAnnotationDetectedBreak) MarshalJSON() ([]byte, error) {
  10200. type NoMethod GoogleCloudVisionV1p4beta1TextAnnotationDetectedBreak
  10201. raw := NoMethod(*s)
  10202. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10203. }
  10204. // GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage: Detected
  10205. // language for a structural component.
  10206. type GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage struct {
  10207. // Confidence: Confidence of detected language. Range [0, 1].
  10208. Confidence float64 `json:"confidence,omitempty"`
  10209. // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn".
  10210. // For more
  10211. // information,
  10212. // see
  10213. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  10214. LanguageCode string `json:"languageCode,omitempty"`
  10215. // ForceSendFields is a list of field names (e.g. "Confidence") to
  10216. // unconditionally include in API requests. By default, fields with
  10217. // empty values are omitted from API requests. However, any non-pointer,
  10218. // non-interface field appearing in ForceSendFields will be sent to the
  10219. // server regardless of whether the field is empty or not. This may be
  10220. // used to include empty fields in Patch requests.
  10221. ForceSendFields []string `json:"-"`
  10222. // NullFields is a list of field names (e.g. "Confidence") to include in
  10223. // API requests with the JSON null value. By default, fields with empty
  10224. // values are omitted from API requests. However, any field with an
  10225. // empty value appearing in NullFields will be sent to the server as
  10226. // null. It is an error if a field in this list has a non-empty value.
  10227. // This may be used to include null fields in Patch requests.
  10228. NullFields []string `json:"-"`
  10229. }
  10230. func (s *GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage) MarshalJSON() ([]byte, error) {
  10231. type NoMethod GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage
  10232. raw := NoMethod(*s)
  10233. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10234. }
  10235. func (s *GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage) UnmarshalJSON(data []byte) error {
  10236. type NoMethod GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage
  10237. var s1 struct {
  10238. Confidence gensupport.JSONFloat64 `json:"confidence"`
  10239. *NoMethod
  10240. }
  10241. s1.NoMethod = (*NoMethod)(s)
  10242. if err := json.Unmarshal(data, &s1); err != nil {
  10243. return err
  10244. }
  10245. s.Confidence = float64(s1.Confidence)
  10246. return nil
  10247. }
  10248. // GoogleCloudVisionV1p4beta1TextAnnotationTextProperty: Additional
  10249. // information detected on the structural component.
  10250. type GoogleCloudVisionV1p4beta1TextAnnotationTextProperty struct {
  10251. // DetectedBreak: Detected start or end of a text segment.
  10252. DetectedBreak *GoogleCloudVisionV1p4beta1TextAnnotationDetectedBreak `json:"detectedBreak,omitempty"`
  10253. // DetectedLanguages: A list of detected languages together with
  10254. // confidence.
  10255. DetectedLanguages []*GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage `json:"detectedLanguages,omitempty"`
  10256. // ForceSendFields is a list of field names (e.g. "DetectedBreak") to
  10257. // unconditionally include in API requests. By default, fields with
  10258. // empty values are omitted from API requests. However, any non-pointer,
  10259. // non-interface field appearing in ForceSendFields will be sent to the
  10260. // server regardless of whether the field is empty or not. This may be
  10261. // used to include empty fields in Patch requests.
  10262. ForceSendFields []string `json:"-"`
  10263. // NullFields is a list of field names (e.g. "DetectedBreak") to include
  10264. // in API requests with the JSON null value. By default, fields with
  10265. // empty values are omitted from API requests. However, any field with
  10266. // an empty value appearing in NullFields will be sent to the server as
  10267. // null. It is an error if a field in this list has a non-empty value.
  10268. // This may be used to include null fields in Patch requests.
  10269. NullFields []string `json:"-"`
  10270. }
  10271. func (s *GoogleCloudVisionV1p4beta1TextAnnotationTextProperty) MarshalJSON() ([]byte, error) {
  10272. type NoMethod GoogleCloudVisionV1p4beta1TextAnnotationTextProperty
  10273. raw := NoMethod(*s)
  10274. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10275. }
  10276. // GoogleCloudVisionV1p4beta1Vertex: A vertex represents a 2D point in
  10277. // the image.
  10278. // NOTE: the vertex coordinates are in the same scale as the original
  10279. // image.
  10280. type GoogleCloudVisionV1p4beta1Vertex struct {
  10281. // X: X coordinate.
  10282. X int64 `json:"x,omitempty"`
  10283. // Y: Y coordinate.
  10284. Y int64 `json:"y,omitempty"`
  10285. // ForceSendFields is a list of field names (e.g. "X") to
  10286. // unconditionally include in API requests. By default, fields with
  10287. // empty values are omitted from API requests. However, any non-pointer,
  10288. // non-interface field appearing in ForceSendFields will be sent to the
  10289. // server regardless of whether the field is empty or not. This may be
  10290. // used to include empty fields in Patch requests.
  10291. ForceSendFields []string `json:"-"`
  10292. // NullFields is a list of field names (e.g. "X") to include in API
  10293. // requests with the JSON null value. By default, fields with empty
  10294. // values are omitted from API requests. However, any field with an
  10295. // empty value appearing in NullFields will be sent to the server as
  10296. // null. It is an error if a field in this list has a non-empty value.
  10297. // This may be used to include null fields in Patch requests.
  10298. NullFields []string `json:"-"`
  10299. }
  10300. func (s *GoogleCloudVisionV1p4beta1Vertex) MarshalJSON() ([]byte, error) {
  10301. type NoMethod GoogleCloudVisionV1p4beta1Vertex
  10302. raw := NoMethod(*s)
  10303. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10304. }
  10305. // GoogleCloudVisionV1p4beta1WebDetection: Relevant information for the
  10306. // image from the Internet.
  10307. type GoogleCloudVisionV1p4beta1WebDetection struct {
  10308. // BestGuessLabels: The service's best guess as to the topic of the
  10309. // request image.
  10310. // Inferred from similar images on the open web.
  10311. BestGuessLabels []*GoogleCloudVisionV1p4beta1WebDetectionWebLabel `json:"bestGuessLabels,omitempty"`
  10312. // FullMatchingImages: Fully matching images from the Internet.
  10313. // Can include resized copies of the query image.
  10314. FullMatchingImages []*GoogleCloudVisionV1p4beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"`
  10315. // PagesWithMatchingImages: Web pages containing the matching images
  10316. // from the Internet.
  10317. PagesWithMatchingImages []*GoogleCloudVisionV1p4beta1WebDetectionWebPage `json:"pagesWithMatchingImages,omitempty"`
  10318. // PartialMatchingImages: Partial matching images from the
  10319. // Internet.
  10320. // Those images are similar enough to share some key-point features.
  10321. // For
  10322. // example an original image will likely have partial matching for its
  10323. // crops.
  10324. PartialMatchingImages []*GoogleCloudVisionV1p4beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"`
  10325. // VisuallySimilarImages: The visually similar image results.
  10326. VisuallySimilarImages []*GoogleCloudVisionV1p4beta1WebDetectionWebImage `json:"visuallySimilarImages,omitempty"`
  10327. // WebEntities: Deduced entities from similar images on the Internet.
  10328. WebEntities []*GoogleCloudVisionV1p4beta1WebDetectionWebEntity `json:"webEntities,omitempty"`
  10329. // ForceSendFields is a list of field names (e.g. "BestGuessLabels") to
  10330. // unconditionally include in API requests. By default, fields with
  10331. // empty values are omitted from API requests. However, any non-pointer,
  10332. // non-interface field appearing in ForceSendFields will be sent to the
  10333. // server regardless of whether the field is empty or not. This may be
  10334. // used to include empty fields in Patch requests.
  10335. ForceSendFields []string `json:"-"`
  10336. // NullFields is a list of field names (e.g. "BestGuessLabels") to
  10337. // include in API requests with the JSON null value. By default, fields
  10338. // with empty values are omitted from API requests. However, any field
  10339. // with an empty value appearing in NullFields will be sent to the
  10340. // server as null. It is an error if a field in this list has a
  10341. // non-empty value. This may be used to include null fields in Patch
  10342. // requests.
  10343. NullFields []string `json:"-"`
  10344. }
  10345. func (s *GoogleCloudVisionV1p4beta1WebDetection) MarshalJSON() ([]byte, error) {
  10346. type NoMethod GoogleCloudVisionV1p4beta1WebDetection
  10347. raw := NoMethod(*s)
  10348. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10349. }
  10350. // GoogleCloudVisionV1p4beta1WebDetectionWebEntity: Entity deduced from
  10351. // similar images on the Internet.
  10352. type GoogleCloudVisionV1p4beta1WebDetectionWebEntity struct {
  10353. // Description: Canonical description of the entity, in English.
  10354. Description string `json:"description,omitempty"`
  10355. // EntityId: Opaque entity ID.
  10356. EntityId string `json:"entityId,omitempty"`
  10357. // Score: Overall relevancy score for the entity.
  10358. // Not normalized and not comparable across different image queries.
  10359. Score float64 `json:"score,omitempty"`
  10360. // ForceSendFields is a list of field names (e.g. "Description") to
  10361. // unconditionally include in API requests. By default, fields with
  10362. // empty values are omitted from API requests. However, any non-pointer,
  10363. // non-interface field appearing in ForceSendFields will be sent to the
  10364. // server regardless of whether the field is empty or not. This may be
  10365. // used to include empty fields in Patch requests.
  10366. ForceSendFields []string `json:"-"`
  10367. // NullFields is a list of field names (e.g. "Description") to include
  10368. // in API requests with the JSON null value. By default, fields with
  10369. // empty values are omitted from API requests. However, any field with
  10370. // an empty value appearing in NullFields will be sent to the server as
  10371. // null. It is an error if a field in this list has a non-empty value.
  10372. // This may be used to include null fields in Patch requests.
  10373. NullFields []string `json:"-"`
  10374. }
  10375. func (s *GoogleCloudVisionV1p4beta1WebDetectionWebEntity) MarshalJSON() ([]byte, error) {
  10376. type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebEntity
  10377. raw := NoMethod(*s)
  10378. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10379. }
  10380. func (s *GoogleCloudVisionV1p4beta1WebDetectionWebEntity) UnmarshalJSON(data []byte) error {
  10381. type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebEntity
  10382. var s1 struct {
  10383. Score gensupport.JSONFloat64 `json:"score"`
  10384. *NoMethod
  10385. }
  10386. s1.NoMethod = (*NoMethod)(s)
  10387. if err := json.Unmarshal(data, &s1); err != nil {
  10388. return err
  10389. }
  10390. s.Score = float64(s1.Score)
  10391. return nil
  10392. }
  10393. // GoogleCloudVisionV1p4beta1WebDetectionWebImage: Metadata for online
  10394. // images.
  10395. type GoogleCloudVisionV1p4beta1WebDetectionWebImage struct {
  10396. // Score: (Deprecated) Overall relevancy score for the image.
  10397. Score float64 `json:"score,omitempty"`
  10398. // Url: The result image URL.
  10399. Url string `json:"url,omitempty"`
  10400. // ForceSendFields is a list of field names (e.g. "Score") to
  10401. // unconditionally include in API requests. By default, fields with
  10402. // empty values are omitted from API requests. However, any non-pointer,
  10403. // non-interface field appearing in ForceSendFields will be sent to the
  10404. // server regardless of whether the field is empty or not. This may be
  10405. // used to include empty fields in Patch requests.
  10406. ForceSendFields []string `json:"-"`
  10407. // NullFields is a list of field names (e.g. "Score") to include in API
  10408. // requests with the JSON null value. By default, fields with empty
  10409. // values are omitted from API requests. However, any field with an
  10410. // empty value appearing in NullFields will be sent to the server as
  10411. // null. It is an error if a field in this list has a non-empty value.
  10412. // This may be used to include null fields in Patch requests.
  10413. NullFields []string `json:"-"`
  10414. }
  10415. func (s *GoogleCloudVisionV1p4beta1WebDetectionWebImage) MarshalJSON() ([]byte, error) {
  10416. type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebImage
  10417. raw := NoMethod(*s)
  10418. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10419. }
  10420. func (s *GoogleCloudVisionV1p4beta1WebDetectionWebImage) UnmarshalJSON(data []byte) error {
  10421. type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebImage
  10422. var s1 struct {
  10423. Score gensupport.JSONFloat64 `json:"score"`
  10424. *NoMethod
  10425. }
  10426. s1.NoMethod = (*NoMethod)(s)
  10427. if err := json.Unmarshal(data, &s1); err != nil {
  10428. return err
  10429. }
  10430. s.Score = float64(s1.Score)
  10431. return nil
  10432. }
  10433. // GoogleCloudVisionV1p4beta1WebDetectionWebLabel: Label to provide
  10434. // extra metadata for the web detection.
  10435. type GoogleCloudVisionV1p4beta1WebDetectionWebLabel struct {
  10436. // Label: Label for extra metadata.
  10437. Label string `json:"label,omitempty"`
  10438. // LanguageCode: The BCP-47 language code for `label`, such as "en-US"
  10439. // or "sr-Latn".
  10440. // For more information,
  10441. // see
  10442. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  10443. LanguageCode string `json:"languageCode,omitempty"`
  10444. // ForceSendFields is a list of field names (e.g. "Label") to
  10445. // unconditionally include in API requests. By default, fields with
  10446. // empty values are omitted from API requests. However, any non-pointer,
  10447. // non-interface field appearing in ForceSendFields will be sent to the
  10448. // server regardless of whether the field is empty or not. This may be
  10449. // used to include empty fields in Patch requests.
  10450. ForceSendFields []string `json:"-"`
  10451. // NullFields is a list of field names (e.g. "Label") to include in API
  10452. // requests with the JSON null value. By default, fields with empty
  10453. // values are omitted from API requests. However, any field with an
  10454. // empty value appearing in NullFields will be sent to the server as
  10455. // null. It is an error if a field in this list has a non-empty value.
  10456. // This may be used to include null fields in Patch requests.
  10457. NullFields []string `json:"-"`
  10458. }
  10459. func (s *GoogleCloudVisionV1p4beta1WebDetectionWebLabel) MarshalJSON() ([]byte, error) {
  10460. type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebLabel
  10461. raw := NoMethod(*s)
  10462. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10463. }
  10464. // GoogleCloudVisionV1p4beta1WebDetectionWebPage: Metadata for web
  10465. // pages.
  10466. type GoogleCloudVisionV1p4beta1WebDetectionWebPage struct {
  10467. // FullMatchingImages: Fully matching images on the page.
  10468. // Can include resized copies of the query image.
  10469. FullMatchingImages []*GoogleCloudVisionV1p4beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"`
  10470. // PageTitle: Title for the web page, may contain HTML markups.
  10471. PageTitle string `json:"pageTitle,omitempty"`
  10472. // PartialMatchingImages: Partial matching images on the page.
  10473. // Those images are similar enough to share some key-point features.
  10474. // For
  10475. // example an original image will likely have partial matching for
  10476. // its
  10477. // crops.
  10478. PartialMatchingImages []*GoogleCloudVisionV1p4beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"`
  10479. // Score: (Deprecated) Overall relevancy score for the web page.
  10480. Score float64 `json:"score,omitempty"`
  10481. // Url: The result web page URL.
  10482. Url string `json:"url,omitempty"`
  10483. // ForceSendFields is a list of field names (e.g. "FullMatchingImages")
  10484. // to unconditionally include in API requests. By default, fields with
  10485. // empty values are omitted from API requests. However, any non-pointer,
  10486. // non-interface field appearing in ForceSendFields will be sent to the
  10487. // server regardless of whether the field is empty or not. This may be
  10488. // used to include empty fields in Patch requests.
  10489. ForceSendFields []string `json:"-"`
  10490. // NullFields is a list of field names (e.g. "FullMatchingImages") to
  10491. // include in API requests with the JSON null value. By default, fields
  10492. // with empty values are omitted from API requests. However, any field
  10493. // with an empty value appearing in NullFields will be sent to the
  10494. // server as null. It is an error if a field in this list has a
  10495. // non-empty value. This may be used to include null fields in Patch
  10496. // requests.
  10497. NullFields []string `json:"-"`
  10498. }
  10499. func (s *GoogleCloudVisionV1p4beta1WebDetectionWebPage) MarshalJSON() ([]byte, error) {
  10500. type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebPage
  10501. raw := NoMethod(*s)
  10502. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10503. }
  10504. func (s *GoogleCloudVisionV1p4beta1WebDetectionWebPage) UnmarshalJSON(data []byte) error {
  10505. type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebPage
  10506. var s1 struct {
  10507. Score gensupport.JSONFloat64 `json:"score"`
  10508. *NoMethod
  10509. }
  10510. s1.NoMethod = (*NoMethod)(s)
  10511. if err := json.Unmarshal(data, &s1); err != nil {
  10512. return err
  10513. }
  10514. s.Score = float64(s1.Score)
  10515. return nil
  10516. }
  10517. // GoogleCloudVisionV1p4beta1Word: A word representation.
  10518. type GoogleCloudVisionV1p4beta1Word struct {
  10519. // BoundingBox: The bounding box for the word.
  10520. // The vertices are in the order of top-left, top-right,
  10521. // bottom-right,
  10522. // bottom-left. When a rotation of the bounding box is detected the
  10523. // rotation
  10524. // is represented as around the top-left corner as defined when the text
  10525. // is
  10526. // read in the 'natural' orientation.
  10527. // For example:
  10528. // * when the text is horizontal it might look like:
  10529. // 0----1
  10530. // | |
  10531. // 3----2
  10532. // * when it's rotated 180 degrees around the top-left corner it
  10533. // becomes:
  10534. // 2----3
  10535. // | |
  10536. // 1----0
  10537. // and the vertex order will still be (0, 1, 2, 3).
  10538. BoundingBox *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingBox,omitempty"`
  10539. // Confidence: Confidence of the OCR results for the word. Range [0, 1].
  10540. Confidence float64 `json:"confidence,omitempty"`
  10541. // Property: Additional information detected for the word.
  10542. Property *GoogleCloudVisionV1p4beta1TextAnnotationTextProperty `json:"property,omitempty"`
  10543. // Symbols: List of symbols in the word.
  10544. // The order of the symbols follows the natural reading order.
  10545. Symbols []*GoogleCloudVisionV1p4beta1Symbol `json:"symbols,omitempty"`
  10546. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  10547. // unconditionally include in API requests. By default, fields with
  10548. // empty values are omitted from API requests. However, any non-pointer,
  10549. // non-interface field appearing in ForceSendFields will be sent to the
  10550. // server regardless of whether the field is empty or not. This may be
  10551. // used to include empty fields in Patch requests.
  10552. ForceSendFields []string `json:"-"`
  10553. // NullFields is a list of field names (e.g. "BoundingBox") to include
  10554. // in API requests with the JSON null value. By default, fields with
  10555. // empty values are omitted from API requests. However, any field with
  10556. // an empty value appearing in NullFields will be sent to the server as
  10557. // null. It is an error if a field in this list has a non-empty value.
  10558. // This may be used to include null fields in Patch requests.
  10559. NullFields []string `json:"-"`
  10560. }
  10561. func (s *GoogleCloudVisionV1p4beta1Word) MarshalJSON() ([]byte, error) {
  10562. type NoMethod GoogleCloudVisionV1p4beta1Word
  10563. raw := NoMethod(*s)
  10564. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10565. }
  10566. func (s *GoogleCloudVisionV1p4beta1Word) UnmarshalJSON(data []byte) error {
  10567. type NoMethod GoogleCloudVisionV1p4beta1Word
  10568. var s1 struct {
  10569. Confidence gensupport.JSONFloat64 `json:"confidence"`
  10570. *NoMethod
  10571. }
  10572. s1.NoMethod = (*NoMethod)(s)
  10573. if err := json.Unmarshal(data, &s1); err != nil {
  10574. return err
  10575. }
  10576. s.Confidence = float64(s1.Confidence)
  10577. return nil
  10578. }
  10579. // GroupedResult: Information about the products similar to a single
  10580. // product in a query
  10581. // image.
  10582. type GroupedResult struct {
  10583. // BoundingPoly: The bounding polygon around the product detected in the
  10584. // query image.
  10585. BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"`
  10586. // Results: List of results, one for each product match.
  10587. Results []*Result `json:"results,omitempty"`
  10588. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  10589. // unconditionally include in API requests. By default, fields with
  10590. // empty values are omitted from API requests. However, any non-pointer,
  10591. // non-interface field appearing in ForceSendFields will be sent to the
  10592. // server regardless of whether the field is empty or not. This may be
  10593. // used to include empty fields in Patch requests.
  10594. ForceSendFields []string `json:"-"`
  10595. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  10596. // in API requests with the JSON null value. By default, fields with
  10597. // empty values are omitted from API requests. However, any field with
  10598. // an empty value appearing in NullFields will be sent to the server as
  10599. // null. It is an error if a field in this list has a non-empty value.
  10600. // This may be used to include null fields in Patch requests.
  10601. NullFields []string `json:"-"`
  10602. }
  10603. func (s *GroupedResult) MarshalJSON() ([]byte, error) {
  10604. type NoMethod GroupedResult
  10605. raw := NoMethod(*s)
  10606. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10607. }
  10608. // ImageAnnotationContext: If an image was produced from a file (e.g. a
  10609. // PDF), this message gives
  10610. // information about the source of that image.
  10611. type ImageAnnotationContext struct {
  10612. // PageNumber: If the file was a PDF or TIFF, this field gives the page
  10613. // number within
  10614. // the file used to produce the image.
  10615. PageNumber int64 `json:"pageNumber,omitempty"`
  10616. // Uri: The URI of the file used to produce the image.
  10617. Uri string `json:"uri,omitempty"`
  10618. // ForceSendFields is a list of field names (e.g. "PageNumber") to
  10619. // unconditionally include in API requests. By default, fields with
  10620. // empty values are omitted from API requests. However, any non-pointer,
  10621. // non-interface field appearing in ForceSendFields will be sent to the
  10622. // server regardless of whether the field is empty or not. This may be
  10623. // used to include empty fields in Patch requests.
  10624. ForceSendFields []string `json:"-"`
  10625. // NullFields is a list of field names (e.g. "PageNumber") to include in
  10626. // API requests with the JSON null value. By default, fields with empty
  10627. // values are omitted from API requests. However, any field with an
  10628. // empty value appearing in NullFields will be sent to the server as
  10629. // null. It is an error if a field in this list has a non-empty value.
  10630. // This may be used to include null fields in Patch requests.
  10631. NullFields []string `json:"-"`
  10632. }
  10633. func (s *ImageAnnotationContext) MarshalJSON() ([]byte, error) {
  10634. type NoMethod ImageAnnotationContext
  10635. raw := NoMethod(*s)
  10636. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10637. }
  10638. // ImageProperties: Stores image properties, such as dominant colors.
  10639. type ImageProperties struct {
  10640. // DominantColors: If present, dominant colors completed successfully.
  10641. DominantColors *DominantColorsAnnotation `json:"dominantColors,omitempty"`
  10642. // ForceSendFields is a list of field names (e.g. "DominantColors") to
  10643. // unconditionally include in API requests. By default, fields with
  10644. // empty values are omitted from API requests. However, any non-pointer,
  10645. // non-interface field appearing in ForceSendFields will be sent to the
  10646. // server regardless of whether the field is empty or not. This may be
  10647. // used to include empty fields in Patch requests.
  10648. ForceSendFields []string `json:"-"`
  10649. // NullFields is a list of field names (e.g. "DominantColors") to
  10650. // include in API requests with the JSON null value. By default, fields
  10651. // with empty values are omitted from API requests. However, any field
  10652. // with an empty value appearing in NullFields will be sent to the
  10653. // server as null. It is an error if a field in this list has a
  10654. // non-empty value. This may be used to include null fields in Patch
  10655. // requests.
  10656. NullFields []string `json:"-"`
  10657. }
  10658. func (s *ImageProperties) MarshalJSON() ([]byte, error) {
  10659. type NoMethod ImageProperties
  10660. raw := NoMethod(*s)
  10661. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10662. }
  10663. // ImportProductSetsResponse: Response message for the
  10664. // `ImportProductSets` method.
  10665. //
  10666. // This message is returned by
  10667. // the
  10668. // google.longrunning.Operations.GetOperation method in the
  10669. // returned
  10670. // google.longrunning.Operation.response field.
  10671. type ImportProductSetsResponse struct {
  10672. // ReferenceImages: The list of reference_images that are imported
  10673. // successfully.
  10674. ReferenceImages []*ReferenceImage `json:"referenceImages,omitempty"`
  10675. // Statuses: The rpc status for each ImportProductSet request, including
  10676. // both successes
  10677. // and errors.
  10678. //
  10679. // The number of statuses here matches the number of lines in the csv
  10680. // file,
  10681. // and statuses[i] stores the success or failure status of processing
  10682. // the i-th
  10683. // line of the csv, starting from line 0.
  10684. Statuses []*Status `json:"statuses,omitempty"`
  10685. // ForceSendFields is a list of field names (e.g. "ReferenceImages") to
  10686. // unconditionally include in API requests. By default, fields with
  10687. // empty values are omitted from API requests. However, any non-pointer,
  10688. // non-interface field appearing in ForceSendFields will be sent to the
  10689. // server regardless of whether the field is empty or not. This may be
  10690. // used to include empty fields in Patch requests.
  10691. ForceSendFields []string `json:"-"`
  10692. // NullFields is a list of field names (e.g. "ReferenceImages") to
  10693. // include in API requests with the JSON null value. By default, fields
  10694. // with empty values are omitted from API requests. However, any field
  10695. // with an empty value appearing in NullFields will be sent to the
  10696. // server as null. It is an error if a field in this list has a
  10697. // non-empty value. This may be used to include null fields in Patch
  10698. // requests.
  10699. NullFields []string `json:"-"`
  10700. }
  10701. func (s *ImportProductSetsResponse) MarshalJSON() ([]byte, error) {
  10702. type NoMethod ImportProductSetsResponse
  10703. raw := NoMethod(*s)
  10704. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10705. }
  10706. // InputConfig: The desired input location and metadata.
  10707. type InputConfig struct {
  10708. // GcsSource: The Google Cloud Storage location to read the input from.
  10709. GcsSource *GcsSource `json:"gcsSource,omitempty"`
  10710. // MimeType: The type of the file. Currently only "application/pdf" and
  10711. // "image/tiff"
  10712. // are supported. Wildcards are not supported.
  10713. MimeType string `json:"mimeType,omitempty"`
  10714. // ForceSendFields is a list of field names (e.g. "GcsSource") to
  10715. // unconditionally include in API requests. By default, fields with
  10716. // empty values are omitted from API requests. However, any non-pointer,
  10717. // non-interface field appearing in ForceSendFields will be sent to the
  10718. // server regardless of whether the field is empty or not. This may be
  10719. // used to include empty fields in Patch requests.
  10720. ForceSendFields []string `json:"-"`
  10721. // NullFields is a list of field names (e.g. "GcsSource") to include in
  10722. // API requests with the JSON null value. By default, fields with empty
  10723. // values are omitted from API requests. However, any field with an
  10724. // empty value appearing in NullFields will be sent to the server as
  10725. // null. It is an error if a field in this list has a non-empty value.
  10726. // This may be used to include null fields in Patch requests.
  10727. NullFields []string `json:"-"`
  10728. }
  10729. func (s *InputConfig) MarshalJSON() ([]byte, error) {
  10730. type NoMethod InputConfig
  10731. raw := NoMethod(*s)
  10732. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10733. }
  10734. // KeyValue: A product label represented as a key-value pair.
  10735. type KeyValue struct {
  10736. // Key: The key of the label attached to the product. Cannot be empty
  10737. // and cannot
  10738. // exceed 128 bytes.
  10739. Key string `json:"key,omitempty"`
  10740. // Value: The value of the label attached to the product. Cannot be
  10741. // empty and
  10742. // cannot exceed 128 bytes.
  10743. Value string `json:"value,omitempty"`
  10744. // ForceSendFields is a list of field names (e.g. "Key") to
  10745. // unconditionally include in API requests. By default, fields with
  10746. // empty values are omitted from API requests. However, any non-pointer,
  10747. // non-interface field appearing in ForceSendFields will be sent to the
  10748. // server regardless of whether the field is empty or not. This may be
  10749. // used to include empty fields in Patch requests.
  10750. ForceSendFields []string `json:"-"`
  10751. // NullFields is a list of field names (e.g. "Key") to include in API
  10752. // requests with the JSON null value. By default, fields with empty
  10753. // values are omitted from API requests. However, any field with an
  10754. // empty value appearing in NullFields will be sent to the server as
  10755. // null. It is an error if a field in this list has a non-empty value.
  10756. // This may be used to include null fields in Patch requests.
  10757. NullFields []string `json:"-"`
  10758. }
  10759. func (s *KeyValue) MarshalJSON() ([]byte, error) {
  10760. type NoMethod KeyValue
  10761. raw := NoMethod(*s)
  10762. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10763. }
  10764. // Landmark: A face-specific landmark (for example, a face feature).
  10765. type Landmark struct {
  10766. // Position: Face landmark position.
  10767. Position *Position `json:"position,omitempty"`
  10768. // Type: Face landmark type.
  10769. //
  10770. // Possible values:
  10771. // "UNKNOWN_LANDMARK" - Unknown face landmark detected. Should not be
  10772. // filled.
  10773. // "LEFT_EYE" - Left eye.
  10774. // "RIGHT_EYE" - Right eye.
  10775. // "LEFT_OF_LEFT_EYEBROW" - Left of left eyebrow.
  10776. // "RIGHT_OF_LEFT_EYEBROW" - Right of left eyebrow.
  10777. // "LEFT_OF_RIGHT_EYEBROW" - Left of right eyebrow.
  10778. // "RIGHT_OF_RIGHT_EYEBROW" - Right of right eyebrow.
  10779. // "MIDPOINT_BETWEEN_EYES" - Midpoint between eyes.
  10780. // "NOSE_TIP" - Nose tip.
  10781. // "UPPER_LIP" - Upper lip.
  10782. // "LOWER_LIP" - Lower lip.
  10783. // "MOUTH_LEFT" - Mouth left.
  10784. // "MOUTH_RIGHT" - Mouth right.
  10785. // "MOUTH_CENTER" - Mouth center.
  10786. // "NOSE_BOTTOM_RIGHT" - Nose, bottom right.
  10787. // "NOSE_BOTTOM_LEFT" - Nose, bottom left.
  10788. // "NOSE_BOTTOM_CENTER" - Nose, bottom center.
  10789. // "LEFT_EYE_TOP_BOUNDARY" - Left eye, top boundary.
  10790. // "LEFT_EYE_RIGHT_CORNER" - Left eye, right corner.
  10791. // "LEFT_EYE_BOTTOM_BOUNDARY" - Left eye, bottom boundary.
  10792. // "LEFT_EYE_LEFT_CORNER" - Left eye, left corner.
  10793. // "RIGHT_EYE_TOP_BOUNDARY" - Right eye, top boundary.
  10794. // "RIGHT_EYE_RIGHT_CORNER" - Right eye, right corner.
  10795. // "RIGHT_EYE_BOTTOM_BOUNDARY" - Right eye, bottom boundary.
  10796. // "RIGHT_EYE_LEFT_CORNER" - Right eye, left corner.
  10797. // "LEFT_EYEBROW_UPPER_MIDPOINT" - Left eyebrow, upper midpoint.
  10798. // "RIGHT_EYEBROW_UPPER_MIDPOINT" - Right eyebrow, upper midpoint.
  10799. // "LEFT_EAR_TRAGION" - Left ear tragion.
  10800. // "RIGHT_EAR_TRAGION" - Right ear tragion.
  10801. // "LEFT_EYE_PUPIL" - Left eye pupil.
  10802. // "RIGHT_EYE_PUPIL" - Right eye pupil.
  10803. // "FOREHEAD_GLABELLA" - Forehead glabella.
  10804. // "CHIN_GNATHION" - Chin gnathion.
  10805. // "CHIN_LEFT_GONION" - Chin left gonion.
  10806. // "CHIN_RIGHT_GONION" - Chin right gonion.
  10807. Type string `json:"type,omitempty"`
  10808. // ForceSendFields is a list of field names (e.g. "Position") to
  10809. // unconditionally include in API requests. By default, fields with
  10810. // empty values are omitted from API requests. However, any non-pointer,
  10811. // non-interface field appearing in ForceSendFields will be sent to the
  10812. // server regardless of whether the field is empty or not. This may be
  10813. // used to include empty fields in Patch requests.
  10814. ForceSendFields []string `json:"-"`
  10815. // NullFields is a list of field names (e.g. "Position") to include in
  10816. // API requests with the JSON null value. By default, fields with empty
  10817. // values are omitted from API requests. However, any field with an
  10818. // empty value appearing in NullFields will be sent to the server as
  10819. // null. It is an error if a field in this list has a non-empty value.
  10820. // This may be used to include null fields in Patch requests.
  10821. NullFields []string `json:"-"`
  10822. }
  10823. func (s *Landmark) MarshalJSON() ([]byte, error) {
  10824. type NoMethod Landmark
  10825. raw := NoMethod(*s)
  10826. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10827. }
  10828. // LatLng: An object representing a latitude/longitude pair. This is
  10829. // expressed as a pair
  10830. // of doubles representing degrees latitude and degrees longitude.
  10831. // Unless
  10832. // specified otherwise, this must conform to the
  10833. // <a
  10834. // href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
  10835. // st
  10836. // andard</a>. Values must be within normalized ranges.
  10837. type LatLng struct {
  10838. // Latitude: The latitude in degrees. It must be in the range [-90.0,
  10839. // +90.0].
  10840. Latitude float64 `json:"latitude,omitempty"`
  10841. // Longitude: The longitude in degrees. It must be in the range [-180.0,
  10842. // +180.0].
  10843. Longitude float64 `json:"longitude,omitempty"`
  10844. // ForceSendFields is a list of field names (e.g. "Latitude") to
  10845. // unconditionally include in API requests. By default, fields with
  10846. // empty values are omitted from API requests. However, any non-pointer,
  10847. // non-interface field appearing in ForceSendFields will be sent to the
  10848. // server regardless of whether the field is empty or not. This may be
  10849. // used to include empty fields in Patch requests.
  10850. ForceSendFields []string `json:"-"`
  10851. // NullFields is a list of field names (e.g. "Latitude") to include in
  10852. // API requests with the JSON null value. By default, fields with empty
  10853. // values are omitted from API requests. However, any field with an
  10854. // empty value appearing in NullFields will be sent to the server as
  10855. // null. It is an error if a field in this list has a non-empty value.
  10856. // This may be used to include null fields in Patch requests.
  10857. NullFields []string `json:"-"`
  10858. }
  10859. func (s *LatLng) MarshalJSON() ([]byte, error) {
  10860. type NoMethod LatLng
  10861. raw := NoMethod(*s)
  10862. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10863. }
  10864. func (s *LatLng) UnmarshalJSON(data []byte) error {
  10865. type NoMethod LatLng
  10866. var s1 struct {
  10867. Latitude gensupport.JSONFloat64 `json:"latitude"`
  10868. Longitude gensupport.JSONFloat64 `json:"longitude"`
  10869. *NoMethod
  10870. }
  10871. s1.NoMethod = (*NoMethod)(s)
  10872. if err := json.Unmarshal(data, &s1); err != nil {
  10873. return err
  10874. }
  10875. s.Latitude = float64(s1.Latitude)
  10876. s.Longitude = float64(s1.Longitude)
  10877. return nil
  10878. }
  10879. // LocalizedObjectAnnotation: Set of detected objects with bounding
  10880. // boxes.
  10881. type LocalizedObjectAnnotation struct {
  10882. // BoundingPoly: Image region to which this object belongs. This must be
  10883. // populated.
  10884. BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"`
  10885. // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn".
  10886. // For more
  10887. // information,
  10888. // see
  10889. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  10890. LanguageCode string `json:"languageCode,omitempty"`
  10891. // Mid: Object ID that should align with EntityAnnotation mid.
  10892. Mid string `json:"mid,omitempty"`
  10893. // Name: Object name, expressed in its `language_code` language.
  10894. Name string `json:"name,omitempty"`
  10895. // Score: Score of the result. Range [0, 1].
  10896. Score float64 `json:"score,omitempty"`
  10897. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  10898. // unconditionally include in API requests. By default, fields with
  10899. // empty values are omitted from API requests. However, any non-pointer,
  10900. // non-interface field appearing in ForceSendFields will be sent to the
  10901. // server regardless of whether the field is empty or not. This may be
  10902. // used to include empty fields in Patch requests.
  10903. ForceSendFields []string `json:"-"`
  10904. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  10905. // in API requests with the JSON null value. By default, fields with
  10906. // empty values are omitted from API requests. However, any field with
  10907. // an empty value appearing in NullFields will be sent to the server as
  10908. // null. It is an error if a field in this list has a non-empty value.
  10909. // This may be used to include null fields in Patch requests.
  10910. NullFields []string `json:"-"`
  10911. }
  10912. func (s *LocalizedObjectAnnotation) MarshalJSON() ([]byte, error) {
  10913. type NoMethod LocalizedObjectAnnotation
  10914. raw := NoMethod(*s)
  10915. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10916. }
  10917. func (s *LocalizedObjectAnnotation) UnmarshalJSON(data []byte) error {
  10918. type NoMethod LocalizedObjectAnnotation
  10919. var s1 struct {
  10920. Score gensupport.JSONFloat64 `json:"score"`
  10921. *NoMethod
  10922. }
  10923. s1.NoMethod = (*NoMethod)(s)
  10924. if err := json.Unmarshal(data, &s1); err != nil {
  10925. return err
  10926. }
  10927. s.Score = float64(s1.Score)
  10928. return nil
  10929. }
  10930. // LocationInfo: Detected entity location information.
  10931. type LocationInfo struct {
  10932. // LatLng: lat/long location coordinates.
  10933. LatLng *LatLng `json:"latLng,omitempty"`
  10934. // ForceSendFields is a list of field names (e.g. "LatLng") to
  10935. // unconditionally include in API requests. By default, fields with
  10936. // empty values are omitted from API requests. However, any non-pointer,
  10937. // non-interface field appearing in ForceSendFields will be sent to the
  10938. // server regardless of whether the field is empty or not. This may be
  10939. // used to include empty fields in Patch requests.
  10940. ForceSendFields []string `json:"-"`
  10941. // NullFields is a list of field names (e.g. "LatLng") to include in API
  10942. // requests with the JSON null value. By default, fields with empty
  10943. // values are omitted from API requests. However, any field with an
  10944. // empty value appearing in NullFields will be sent to the server as
  10945. // null. It is an error if a field in this list has a non-empty value.
  10946. // This may be used to include null fields in Patch requests.
  10947. NullFields []string `json:"-"`
  10948. }
  10949. func (s *LocationInfo) MarshalJSON() ([]byte, error) {
  10950. type NoMethod LocationInfo
  10951. raw := NoMethod(*s)
  10952. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10953. }
  10954. // NormalizedVertex: A vertex represents a 2D point in the image.
  10955. // NOTE: the normalized vertex coordinates are relative to the original
  10956. // image
  10957. // and range from 0 to 1.
  10958. type NormalizedVertex struct {
  10959. // X: X coordinate.
  10960. X float64 `json:"x,omitempty"`
  10961. // Y: Y coordinate.
  10962. Y float64 `json:"y,omitempty"`
  10963. // ForceSendFields is a list of field names (e.g. "X") to
  10964. // unconditionally include in API requests. By default, fields with
  10965. // empty values are omitted from API requests. However, any non-pointer,
  10966. // non-interface field appearing in ForceSendFields will be sent to the
  10967. // server regardless of whether the field is empty or not. This may be
  10968. // used to include empty fields in Patch requests.
  10969. ForceSendFields []string `json:"-"`
  10970. // NullFields is a list of field names (e.g. "X") to include in API
  10971. // requests with the JSON null value. By default, fields with empty
  10972. // values are omitted from API requests. However, any field with an
  10973. // empty value appearing in NullFields will be sent to the server as
  10974. // null. It is an error if a field in this list has a non-empty value.
  10975. // This may be used to include null fields in Patch requests.
  10976. NullFields []string `json:"-"`
  10977. }
  10978. func (s *NormalizedVertex) MarshalJSON() ([]byte, error) {
  10979. type NoMethod NormalizedVertex
  10980. raw := NoMethod(*s)
  10981. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10982. }
  10983. func (s *NormalizedVertex) UnmarshalJSON(data []byte) error {
  10984. type NoMethod NormalizedVertex
  10985. var s1 struct {
  10986. X gensupport.JSONFloat64 `json:"x"`
  10987. Y gensupport.JSONFloat64 `json:"y"`
  10988. *NoMethod
  10989. }
  10990. s1.NoMethod = (*NoMethod)(s)
  10991. if err := json.Unmarshal(data, &s1); err != nil {
  10992. return err
  10993. }
  10994. s.X = float64(s1.X)
  10995. s.Y = float64(s1.Y)
  10996. return nil
  10997. }
  10998. // Operation: This resource represents a long-running operation that is
  10999. // the result of a
  11000. // network API call.
  11001. type Operation struct {
  11002. // Done: If the value is `false`, it means the operation is still in
  11003. // progress.
  11004. // If `true`, the operation is completed, and either `error` or
  11005. // `response` is
  11006. // available.
  11007. Done bool `json:"done,omitempty"`
  11008. // Error: The error result of the operation in case of failure or
  11009. // cancellation.
  11010. Error *Status `json:"error,omitempty"`
  11011. // Metadata: Service-specific metadata associated with the operation.
  11012. // It typically
  11013. // contains progress information and common metadata such as create
  11014. // time.
  11015. // Some services might not provide such metadata. Any method that
  11016. // returns a
  11017. // long-running operation should document the metadata type, if any.
  11018. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  11019. // Name: The server-assigned name, which is only unique within the same
  11020. // service that
  11021. // originally returns it. If you use the default HTTP mapping,
  11022. // the
  11023. // `name` should have the format of `operations/some/unique/name`.
  11024. Name string `json:"name,omitempty"`
  11025. // Response: The normal response of the operation in case of success.
  11026. // If the original
  11027. // method returns no data on success, such as `Delete`, the response
  11028. // is
  11029. // `google.protobuf.Empty`. If the original method is
  11030. // standard
  11031. // `Get`/`Create`/`Update`, the response should be the resource. For
  11032. // other
  11033. // methods, the response should have the type `XxxResponse`, where
  11034. // `Xxx`
  11035. // is the original method name. For example, if the original method
  11036. // name
  11037. // is `TakeSnapshot()`, the inferred response type
  11038. // is
  11039. // `TakeSnapshotResponse`.
  11040. Response googleapi.RawMessage `json:"response,omitempty"`
  11041. // ServerResponse contains the HTTP response code and headers from the
  11042. // server.
  11043. googleapi.ServerResponse `json:"-"`
  11044. // ForceSendFields is a list of field names (e.g. "Done") to
  11045. // unconditionally include in API requests. By default, fields with
  11046. // empty values are omitted from API requests. However, any non-pointer,
  11047. // non-interface field appearing in ForceSendFields will be sent to the
  11048. // server regardless of whether the field is empty or not. This may be
  11049. // used to include empty fields in Patch requests.
  11050. ForceSendFields []string `json:"-"`
  11051. // NullFields is a list of field names (e.g. "Done") to include in API
  11052. // requests with the JSON null value. By default, fields with empty
  11053. // values are omitted from API requests. However, any field with an
  11054. // empty value appearing in NullFields will be sent to the server as
  11055. // null. It is an error if a field in this list has a non-empty value.
  11056. // This may be used to include null fields in Patch requests.
  11057. NullFields []string `json:"-"`
  11058. }
  11059. func (s *Operation) MarshalJSON() ([]byte, error) {
  11060. type NoMethod Operation
  11061. raw := NoMethod(*s)
  11062. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11063. }
  11064. // OperationMetadata: Contains metadata for the BatchAnnotateImages
  11065. // operation.
  11066. type OperationMetadata struct {
  11067. // CreateTime: The time when the batch request was received.
  11068. CreateTime string `json:"createTime,omitempty"`
  11069. // State: Current state of the batch operation.
  11070. //
  11071. // Possible values:
  11072. // "STATE_UNSPECIFIED" - Invalid.
  11073. // "CREATED" - Request is received.
  11074. // "RUNNING" - Request is actively being processed.
  11075. // "DONE" - The batch processing is done.
  11076. // "CANCELLED" - The batch processing was cancelled.
  11077. State string `json:"state,omitempty"`
  11078. // UpdateTime: The time when the operation result was last updated.
  11079. UpdateTime string `json:"updateTime,omitempty"`
  11080. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  11081. // unconditionally include in API requests. By default, fields with
  11082. // empty values are omitted from API requests. However, any non-pointer,
  11083. // non-interface field appearing in ForceSendFields will be sent to the
  11084. // server regardless of whether the field is empty or not. This may be
  11085. // used to include empty fields in Patch requests.
  11086. ForceSendFields []string `json:"-"`
  11087. // NullFields is a list of field names (e.g. "CreateTime") to include in
  11088. // API requests with the JSON null value. By default, fields with empty
  11089. // values are omitted from API requests. However, any field with an
  11090. // empty value appearing in NullFields will be sent to the server as
  11091. // null. It is an error if a field in this list has a non-empty value.
  11092. // This may be used to include null fields in Patch requests.
  11093. NullFields []string `json:"-"`
  11094. }
  11095. func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
  11096. type NoMethod OperationMetadata
  11097. raw := NoMethod(*s)
  11098. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11099. }
  11100. // OutputConfig: The desired output location and metadata.
  11101. type OutputConfig struct {
  11102. // BatchSize: The max number of response protos to put into each output
  11103. // JSON file on
  11104. // Google Cloud Storage.
  11105. // The valid range is [1, 100]. If not specified, the default value is
  11106. // 20.
  11107. //
  11108. // For example, for one pdf file with 100 pages, 100 response protos
  11109. // will
  11110. // be generated. If `batch_size` = 20, then 5 json files each
  11111. // containing 20 response protos will be written under the
  11112. // prefix
  11113. // `gcs_destination`.`uri`.
  11114. //
  11115. // Currently, batch_size only applies to GcsDestination, with potential
  11116. // future
  11117. // support for other output configurations.
  11118. BatchSize int64 `json:"batchSize,omitempty"`
  11119. // GcsDestination: The Google Cloud Storage location to write the
  11120. // output(s) to.
  11121. GcsDestination *GcsDestination `json:"gcsDestination,omitempty"`
  11122. // ForceSendFields is a list of field names (e.g. "BatchSize") to
  11123. // unconditionally include in API requests. By default, fields with
  11124. // empty values are omitted from API requests. However, any non-pointer,
  11125. // non-interface field appearing in ForceSendFields will be sent to the
  11126. // server regardless of whether the field is empty or not. This may be
  11127. // used to include empty fields in Patch requests.
  11128. ForceSendFields []string `json:"-"`
  11129. // NullFields is a list of field names (e.g. "BatchSize") to include in
  11130. // API 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. func (s *OutputConfig) MarshalJSON() ([]byte, error) {
  11138. type NoMethod OutputConfig
  11139. raw := NoMethod(*s)
  11140. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11141. }
  11142. // Page: Detected page from OCR.
  11143. type Page struct {
  11144. // Blocks: List of blocks of text, images etc on this page.
  11145. Blocks []*Block `json:"blocks,omitempty"`
  11146. // Confidence: Confidence of the OCR results on the page. Range [0, 1].
  11147. Confidence float64 `json:"confidence,omitempty"`
  11148. // Height: Page height. For PDFs the unit is points. For images
  11149. // (including
  11150. // TIFFs) the unit is pixels.
  11151. Height int64 `json:"height,omitempty"`
  11152. // Property: Additional information detected on the page.
  11153. Property *TextProperty `json:"property,omitempty"`
  11154. // Width: Page width. For PDFs the unit is points. For images
  11155. // (including
  11156. // TIFFs) the unit is pixels.
  11157. Width int64 `json:"width,omitempty"`
  11158. // ForceSendFields is a list of field names (e.g. "Blocks") to
  11159. // unconditionally include in API requests. By default, fields with
  11160. // empty values are omitted from API requests. However, any non-pointer,
  11161. // non-interface field appearing in ForceSendFields will be sent to the
  11162. // server regardless of whether the field is empty or not. This may be
  11163. // used to include empty fields in Patch requests.
  11164. ForceSendFields []string `json:"-"`
  11165. // NullFields is a list of field names (e.g. "Blocks") to include in API
  11166. // requests with the JSON null value. By default, fields with empty
  11167. // values are omitted from API requests. However, any field with an
  11168. // empty value appearing in NullFields will be sent to the server as
  11169. // null. It is an error if a field in this list has a non-empty value.
  11170. // This may be used to include null fields in Patch requests.
  11171. NullFields []string `json:"-"`
  11172. }
  11173. func (s *Page) MarshalJSON() ([]byte, error) {
  11174. type NoMethod Page
  11175. raw := NoMethod(*s)
  11176. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11177. }
  11178. func (s *Page) UnmarshalJSON(data []byte) error {
  11179. type NoMethod Page
  11180. var s1 struct {
  11181. Confidence gensupport.JSONFloat64 `json:"confidence"`
  11182. *NoMethod
  11183. }
  11184. s1.NoMethod = (*NoMethod)(s)
  11185. if err := json.Unmarshal(data, &s1); err != nil {
  11186. return err
  11187. }
  11188. s.Confidence = float64(s1.Confidence)
  11189. return nil
  11190. }
  11191. // Paragraph: Structural unit of text representing a number of words in
  11192. // certain order.
  11193. type Paragraph struct {
  11194. // BoundingBox: The bounding box for the paragraph.
  11195. // The vertices are in the order of top-left, top-right,
  11196. // bottom-right,
  11197. // bottom-left. When a rotation of the bounding box is detected the
  11198. // rotation
  11199. // is represented as around the top-left corner as defined when the text
  11200. // is
  11201. // read in the 'natural' orientation.
  11202. // For example:
  11203. // * when the text is horizontal it might look like:
  11204. // 0----1
  11205. // | |
  11206. // 3----2
  11207. // * when it's rotated 180 degrees around the top-left corner it
  11208. // becomes:
  11209. // 2----3
  11210. // | |
  11211. // 1----0
  11212. // and the vertex order will still be (0, 1, 2, 3).
  11213. BoundingBox *BoundingPoly `json:"boundingBox,omitempty"`
  11214. // Confidence: Confidence of the OCR results for the paragraph. Range
  11215. // [0, 1].
  11216. Confidence float64 `json:"confidence,omitempty"`
  11217. // Property: Additional information detected for the paragraph.
  11218. Property *TextProperty `json:"property,omitempty"`
  11219. // Words: List of words in this paragraph.
  11220. Words []*Word `json:"words,omitempty"`
  11221. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  11222. // unconditionally include in API requests. By default, fields with
  11223. // empty values are omitted from API requests. However, any non-pointer,
  11224. // non-interface field appearing in ForceSendFields will be sent to the
  11225. // server regardless of whether the field is empty or not. This may be
  11226. // used to include empty fields in Patch requests.
  11227. ForceSendFields []string `json:"-"`
  11228. // NullFields is a list of field names (e.g. "BoundingBox") to include
  11229. // in API requests with the JSON null value. By default, fields with
  11230. // empty values are omitted from API requests. However, any field with
  11231. // an empty value appearing in NullFields will be sent to the server as
  11232. // null. It is an error if a field in this list has a non-empty value.
  11233. // This may be used to include null fields in Patch requests.
  11234. NullFields []string `json:"-"`
  11235. }
  11236. func (s *Paragraph) MarshalJSON() ([]byte, error) {
  11237. type NoMethod Paragraph
  11238. raw := NoMethod(*s)
  11239. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11240. }
  11241. func (s *Paragraph) UnmarshalJSON(data []byte) error {
  11242. type NoMethod Paragraph
  11243. var s1 struct {
  11244. Confidence gensupport.JSONFloat64 `json:"confidence"`
  11245. *NoMethod
  11246. }
  11247. s1.NoMethod = (*NoMethod)(s)
  11248. if err := json.Unmarshal(data, &s1); err != nil {
  11249. return err
  11250. }
  11251. s.Confidence = float64(s1.Confidence)
  11252. return nil
  11253. }
  11254. // Position: A 3D position in the image, used primarily for Face
  11255. // detection landmarks.
  11256. // A valid Position must have both x and y coordinates.
  11257. // The position coordinates are in the same scale as the original image.
  11258. type Position struct {
  11259. // X: X coordinate.
  11260. X float64 `json:"x,omitempty"`
  11261. // Y: Y coordinate.
  11262. Y float64 `json:"y,omitempty"`
  11263. // Z: Z coordinate (or depth).
  11264. Z float64 `json:"z,omitempty"`
  11265. // ForceSendFields is a list of field names (e.g. "X") to
  11266. // unconditionally include in API requests. By default, fields with
  11267. // empty values are omitted from API requests. However, any non-pointer,
  11268. // non-interface field appearing in ForceSendFields will be sent to the
  11269. // server regardless of whether the field is empty or not. This may be
  11270. // used to include empty fields in Patch requests.
  11271. ForceSendFields []string `json:"-"`
  11272. // NullFields is a list of field names (e.g. "X") to include in API
  11273. // requests with the JSON null value. By default, fields with empty
  11274. // values are omitted from API requests. However, any field with an
  11275. // empty value appearing in NullFields will be sent to the server as
  11276. // null. It is an error if a field in this list has a non-empty value.
  11277. // This may be used to include null fields in Patch requests.
  11278. NullFields []string `json:"-"`
  11279. }
  11280. func (s *Position) MarshalJSON() ([]byte, error) {
  11281. type NoMethod Position
  11282. raw := NoMethod(*s)
  11283. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11284. }
  11285. func (s *Position) UnmarshalJSON(data []byte) error {
  11286. type NoMethod Position
  11287. var s1 struct {
  11288. X gensupport.JSONFloat64 `json:"x"`
  11289. Y gensupport.JSONFloat64 `json:"y"`
  11290. Z gensupport.JSONFloat64 `json:"z"`
  11291. *NoMethod
  11292. }
  11293. s1.NoMethod = (*NoMethod)(s)
  11294. if err := json.Unmarshal(data, &s1); err != nil {
  11295. return err
  11296. }
  11297. s.X = float64(s1.X)
  11298. s.Y = float64(s1.Y)
  11299. s.Z = float64(s1.Z)
  11300. return nil
  11301. }
  11302. // Product: A Product contains ReferenceImages.
  11303. type Product struct {
  11304. // Description: User-provided metadata to be stored with this product.
  11305. // Must be at most 4096
  11306. // characters long.
  11307. Description string `json:"description,omitempty"`
  11308. // DisplayName: The user-provided name for this Product. Must not be
  11309. // empty. Must be at most
  11310. // 4096 characters long.
  11311. DisplayName string `json:"displayName,omitempty"`
  11312. // Name: The resource name of the product.
  11313. //
  11314. // Format
  11315. // is:
  11316. // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
  11317. //
  11318. // This field is ignored when creating a product.
  11319. Name string `json:"name,omitempty"`
  11320. // ProductCategory: The category for the product identified by the
  11321. // reference image. This should
  11322. // be either "homegoods", "apparel", or "toys".
  11323. //
  11324. // This field is immutable.
  11325. ProductCategory string `json:"productCategory,omitempty"`
  11326. // ProductLabels: Key-value pairs that can be attached to a product. At
  11327. // query time,
  11328. // constraints can be specified based on the product_labels.
  11329. //
  11330. // Note that integer values can be provided as strings, e.g. "1199".
  11331. // Only
  11332. // strings with integer values can match a range-based restriction which
  11333. // is
  11334. // to be supported soon.
  11335. //
  11336. // Multiple values can be assigned to the same key. One product may have
  11337. // up to
  11338. // 100 product_labels.
  11339. ProductLabels []*KeyValue `json:"productLabels,omitempty"`
  11340. // ForceSendFields is a list of field names (e.g. "Description") to
  11341. // unconditionally include in API requests. By default, fields with
  11342. // empty values are omitted from API requests. However, any non-pointer,
  11343. // non-interface field appearing in ForceSendFields will be sent to the
  11344. // server regardless of whether the field is empty or not. This may be
  11345. // used to include empty fields in Patch requests.
  11346. ForceSendFields []string `json:"-"`
  11347. // NullFields is a list of field names (e.g. "Description") 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. func (s *Product) MarshalJSON() ([]byte, error) {
  11356. type NoMethod Product
  11357. raw := NoMethod(*s)
  11358. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11359. }
  11360. // ProductSearchResults: Results for a product search request.
  11361. type ProductSearchResults struct {
  11362. // IndexTime: Timestamp of the index which provided these results.
  11363. // Changes made after
  11364. // this time are not reflected in the current results.
  11365. IndexTime string `json:"indexTime,omitempty"`
  11366. // ProductGroupedResults: List of results grouped by products detected
  11367. // in the query image. Each entry
  11368. // corresponds to one bounding polygon in the query image, and contains
  11369. // the
  11370. // matching products specific to that region. There may be duplicate
  11371. // product
  11372. // matches in the union of all the per-product results.
  11373. ProductGroupedResults []*GroupedResult `json:"productGroupedResults,omitempty"`
  11374. // Results: List of results, one for each product match.
  11375. Results []*Result `json:"results,omitempty"`
  11376. // ForceSendFields is a list of field names (e.g. "IndexTime") to
  11377. // unconditionally include in API requests. By default, fields with
  11378. // empty values are omitted from API requests. However, any non-pointer,
  11379. // non-interface field appearing in ForceSendFields will be sent to the
  11380. // server regardless of whether the field is empty or not. This may be
  11381. // used to include empty fields in Patch requests.
  11382. ForceSendFields []string `json:"-"`
  11383. // NullFields is a list of field names (e.g. "IndexTime") to include in
  11384. // API requests with the JSON null value. By default, fields with empty
  11385. // values are omitted from API requests. However, any field with an
  11386. // empty value appearing in NullFields will be sent to the server as
  11387. // null. It is an error if a field in this list has a non-empty value.
  11388. // This may be used to include null fields in Patch requests.
  11389. NullFields []string `json:"-"`
  11390. }
  11391. func (s *ProductSearchResults) MarshalJSON() ([]byte, error) {
  11392. type NoMethod ProductSearchResults
  11393. raw := NoMethod(*s)
  11394. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11395. }
  11396. // Property: A `Property` consists of a user-supplied name/value pair.
  11397. type Property struct {
  11398. // Name: Name of the property.
  11399. Name string `json:"name,omitempty"`
  11400. // Uint64Value: Value of numeric properties.
  11401. Uint64Value uint64 `json:"uint64Value,omitempty,string"`
  11402. // Value: Value of the property.
  11403. Value string `json:"value,omitempty"`
  11404. // ForceSendFields is a list of field names (e.g. "Name") to
  11405. // unconditionally include in API requests. By default, fields with
  11406. // empty values are omitted from API requests. However, any non-pointer,
  11407. // non-interface field appearing in ForceSendFields will be sent to the
  11408. // server regardless of whether the field is empty or not. This may be
  11409. // used to include empty fields in Patch requests.
  11410. ForceSendFields []string `json:"-"`
  11411. // NullFields is a list of field names (e.g. "Name") to include in API
  11412. // requests with the JSON null value. By default, fields with empty
  11413. // values are omitted from API requests. However, any field with an
  11414. // empty value appearing in NullFields will be sent to the server as
  11415. // null. It is an error if a field in this list has a non-empty value.
  11416. // This may be used to include null fields in Patch requests.
  11417. NullFields []string `json:"-"`
  11418. }
  11419. func (s *Property) MarshalJSON() ([]byte, error) {
  11420. type NoMethod Property
  11421. raw := NoMethod(*s)
  11422. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11423. }
  11424. // ReferenceImage: A `ReferenceImage` represents a product image and its
  11425. // associated metadata,
  11426. // such as bounding boxes.
  11427. type ReferenceImage struct {
  11428. // BoundingPolys: Bounding polygons around the areas of interest in the
  11429. // reference image.
  11430. // Optional. If this field is empty, the system will try to detect
  11431. // regions of
  11432. // interest. At most 10 bounding polygons will be used.
  11433. //
  11434. // The provided shape is converted into a non-rotated rectangle.
  11435. // Once
  11436. // converted, the small edge of the rectangle must be greater than or
  11437. // equal
  11438. // to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok;
  11439. // 1:5
  11440. // is not).
  11441. BoundingPolys []*BoundingPoly `json:"boundingPolys,omitempty"`
  11442. // Name: The resource name of the reference image.
  11443. //
  11444. // Format
  11445. // is:
  11446. //
  11447. // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referen
  11448. // ceImages/IMAGE_ID`.
  11449. //
  11450. // This field is ignored when creating a reference image.
  11451. Name string `json:"name,omitempty"`
  11452. // Uri: The Google Cloud Storage URI of the reference image.
  11453. //
  11454. // The URI must start with `gs://`.
  11455. //
  11456. // Required.
  11457. Uri string `json:"uri,omitempty"`
  11458. // ForceSendFields is a list of field names (e.g. "BoundingPolys") to
  11459. // unconditionally include in API requests. By default, fields with
  11460. // empty values are omitted from API requests. However, any non-pointer,
  11461. // non-interface field appearing in ForceSendFields will be sent to the
  11462. // server regardless of whether the field is empty or not. This may be
  11463. // used to include empty fields in Patch requests.
  11464. ForceSendFields []string `json:"-"`
  11465. // NullFields is a list of field names (e.g. "BoundingPolys") to include
  11466. // in API requests with the JSON null value. By default, fields with
  11467. // empty values are omitted from API requests. However, any field with
  11468. // an empty value appearing in NullFields will be sent to the server as
  11469. // null. It is an error if a field in this list has a non-empty value.
  11470. // This may be used to include null fields in Patch requests.
  11471. NullFields []string `json:"-"`
  11472. }
  11473. func (s *ReferenceImage) MarshalJSON() ([]byte, error) {
  11474. type NoMethod ReferenceImage
  11475. raw := NoMethod(*s)
  11476. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11477. }
  11478. // Result: Information about a product.
  11479. type Result struct {
  11480. // Image: The resource name of the image from the product that is the
  11481. // closest match
  11482. // to the query.
  11483. Image string `json:"image,omitempty"`
  11484. // Product: The Product.
  11485. Product *Product `json:"product,omitempty"`
  11486. // Score: A confidence level on the match, ranging from 0 (no
  11487. // confidence) to
  11488. // 1 (full confidence).
  11489. Score float64 `json:"score,omitempty"`
  11490. // ForceSendFields is a list of field names (e.g. "Image") to
  11491. // unconditionally include in API requests. By default, fields with
  11492. // empty values are omitted from API requests. However, any non-pointer,
  11493. // non-interface field appearing in ForceSendFields will be sent to the
  11494. // server regardless of whether the field is empty or not. This may be
  11495. // used to include empty fields in Patch requests.
  11496. ForceSendFields []string `json:"-"`
  11497. // NullFields is a list of field names (e.g. "Image") to include in API
  11498. // requests with the JSON null value. By default, fields with empty
  11499. // values are omitted from API requests. However, any field with an
  11500. // empty value appearing in NullFields will be sent to the server as
  11501. // null. It is an error if a field in this list has a non-empty value.
  11502. // This may be used to include null fields in Patch requests.
  11503. NullFields []string `json:"-"`
  11504. }
  11505. func (s *Result) MarshalJSON() ([]byte, error) {
  11506. type NoMethod Result
  11507. raw := NoMethod(*s)
  11508. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11509. }
  11510. func (s *Result) UnmarshalJSON(data []byte) error {
  11511. type NoMethod Result
  11512. var s1 struct {
  11513. Score gensupport.JSONFloat64 `json:"score"`
  11514. *NoMethod
  11515. }
  11516. s1.NoMethod = (*NoMethod)(s)
  11517. if err := json.Unmarshal(data, &s1); err != nil {
  11518. return err
  11519. }
  11520. s.Score = float64(s1.Score)
  11521. return nil
  11522. }
  11523. // SafeSearchAnnotation: Set of features pertaining to the image,
  11524. // computed by computer vision
  11525. // methods over safe-search verticals (for example, adult, spoof,
  11526. // medical,
  11527. // violence).
  11528. type SafeSearchAnnotation struct {
  11529. // Adult: Represents the adult content likelihood for the image. Adult
  11530. // content may
  11531. // contain elements such as nudity, pornographic images or cartoons,
  11532. // or
  11533. // sexual activities.
  11534. //
  11535. // Possible values:
  11536. // "UNKNOWN" - Unknown likelihood.
  11537. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  11538. // specified vertical.
  11539. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  11540. // vertical.
  11541. // "POSSIBLE" - It is possible that the image belongs to the specified
  11542. // vertical.
  11543. // "LIKELY" - It is likely that the image belongs to the specified
  11544. // vertical.
  11545. // "VERY_LIKELY" - It is very likely that the image belongs to the
  11546. // specified vertical.
  11547. Adult string `json:"adult,omitempty"`
  11548. // Medical: Likelihood that this is a medical image.
  11549. //
  11550. // Possible values:
  11551. // "UNKNOWN" - Unknown likelihood.
  11552. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  11553. // specified vertical.
  11554. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  11555. // vertical.
  11556. // "POSSIBLE" - It is possible that the image belongs to the specified
  11557. // vertical.
  11558. // "LIKELY" - It is likely that the image belongs to the specified
  11559. // vertical.
  11560. // "VERY_LIKELY" - It is very likely that the image belongs to the
  11561. // specified vertical.
  11562. Medical string `json:"medical,omitempty"`
  11563. // Racy: Likelihood that the request image contains racy content. Racy
  11564. // content may
  11565. // include (but is not limited to) skimpy or sheer clothing,
  11566. // strategically
  11567. // covered nudity, lewd or provocative poses, or close-ups of
  11568. // sensitive
  11569. // body areas.
  11570. //
  11571. // Possible values:
  11572. // "UNKNOWN" - Unknown likelihood.
  11573. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  11574. // specified vertical.
  11575. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  11576. // vertical.
  11577. // "POSSIBLE" - It is possible that the image belongs to the specified
  11578. // vertical.
  11579. // "LIKELY" - It is likely that the image belongs to the specified
  11580. // vertical.
  11581. // "VERY_LIKELY" - It is very likely that the image belongs to the
  11582. // specified vertical.
  11583. Racy string `json:"racy,omitempty"`
  11584. // Spoof: Spoof likelihood. The likelihood that an modification
  11585. // was made to the image's canonical version to make it appear
  11586. // funny or offensive.
  11587. //
  11588. // Possible values:
  11589. // "UNKNOWN" - Unknown likelihood.
  11590. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  11591. // specified vertical.
  11592. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  11593. // vertical.
  11594. // "POSSIBLE" - It is possible that the image belongs to the specified
  11595. // vertical.
  11596. // "LIKELY" - It is likely that the image belongs to the specified
  11597. // vertical.
  11598. // "VERY_LIKELY" - It is very likely that the image belongs to the
  11599. // specified vertical.
  11600. Spoof string `json:"spoof,omitempty"`
  11601. // Violence: Likelihood that this image contains violent content.
  11602. //
  11603. // Possible values:
  11604. // "UNKNOWN" - Unknown likelihood.
  11605. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  11606. // specified vertical.
  11607. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  11608. // vertical.
  11609. // "POSSIBLE" - It is possible that the image belongs to the specified
  11610. // vertical.
  11611. // "LIKELY" - It is likely that the image belongs to the specified
  11612. // vertical.
  11613. // "VERY_LIKELY" - It is very likely that the image belongs to the
  11614. // specified vertical.
  11615. Violence string `json:"violence,omitempty"`
  11616. // ForceSendFields is a list of field names (e.g. "Adult") to
  11617. // unconditionally include in API requests. By default, fields with
  11618. // empty values are omitted from API requests. However, any non-pointer,
  11619. // non-interface field appearing in ForceSendFields will be sent to the
  11620. // server regardless of whether the field is empty or not. This may be
  11621. // used to include empty fields in Patch requests.
  11622. ForceSendFields []string `json:"-"`
  11623. // NullFields is a list of field names (e.g. "Adult") to include in API
  11624. // requests with the JSON null value. By default, fields with empty
  11625. // values are omitted from API requests. However, any field with an
  11626. // empty value appearing in NullFields will be sent to the server as
  11627. // null. It is an error if a field in this list has a non-empty value.
  11628. // This may be used to include null fields in Patch requests.
  11629. NullFields []string `json:"-"`
  11630. }
  11631. func (s *SafeSearchAnnotation) MarshalJSON() ([]byte, error) {
  11632. type NoMethod SafeSearchAnnotation
  11633. raw := NoMethod(*s)
  11634. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11635. }
  11636. // Status: The `Status` type defines a logical error model that is
  11637. // suitable for
  11638. // different programming environments, including REST APIs and RPC APIs.
  11639. // It is
  11640. // used by [gRPC](https://github.com/grpc). The error model is designed
  11641. // to be:
  11642. //
  11643. // - Simple to use and understand for most users
  11644. // - Flexible enough to meet unexpected needs
  11645. //
  11646. // # Overview
  11647. //
  11648. // The `Status` message contains three pieces of data: error code,
  11649. // error
  11650. // message, and error details. The error code should be an enum value
  11651. // of
  11652. // google.rpc.Code, but it may accept additional error codes if needed.
  11653. // The
  11654. // error message should be a developer-facing English message that
  11655. // helps
  11656. // developers *understand* and *resolve* the error. If a localized
  11657. // user-facing
  11658. // error message is needed, put the localized message in the error
  11659. // details or
  11660. // localize it in the client. The optional error details may contain
  11661. // arbitrary
  11662. // information about the error. There is a predefined set of error
  11663. // detail types
  11664. // in the package `google.rpc` that can be used for common error
  11665. // conditions.
  11666. //
  11667. // # Language mapping
  11668. //
  11669. // The `Status` message is the logical representation of the error
  11670. // model, but it
  11671. // is not necessarily the actual wire format. When the `Status` message
  11672. // is
  11673. // exposed in different client libraries and different wire protocols,
  11674. // it can be
  11675. // mapped differently. For example, it will likely be mapped to some
  11676. // exceptions
  11677. // in Java, but more likely mapped to some error codes in C.
  11678. //
  11679. // # Other uses
  11680. //
  11681. // The error model and the `Status` message can be used in a variety
  11682. // of
  11683. // environments, either with or without APIs, to provide a
  11684. // consistent developer experience across different
  11685. // environments.
  11686. //
  11687. // Example uses of this error model include:
  11688. //
  11689. // - Partial errors. If a service needs to return partial errors to the
  11690. // client,
  11691. // it may embed the `Status` in the normal response to indicate the
  11692. // partial
  11693. // errors.
  11694. //
  11695. // - Workflow errors. A typical workflow has multiple steps. Each step
  11696. // may
  11697. // have a `Status` message for error reporting.
  11698. //
  11699. // - Batch operations. If a client uses batch request and batch
  11700. // response, the
  11701. // `Status` message should be used directly inside batch response,
  11702. // one for
  11703. // each error sub-response.
  11704. //
  11705. // - Asynchronous operations. If an API call embeds asynchronous
  11706. // operation
  11707. // results in its response, the status of those operations should
  11708. // be
  11709. // represented directly using the `Status` message.
  11710. //
  11711. // - Logging. If some API errors are stored in logs, the message
  11712. // `Status` could
  11713. // be used directly after any stripping needed for security/privacy
  11714. // reasons.
  11715. type Status struct {
  11716. // Code: The status code, which should be an enum value of
  11717. // google.rpc.Code.
  11718. Code int64 `json:"code,omitempty"`
  11719. // Details: A list of messages that carry the error details. There is a
  11720. // common set of
  11721. // message types for APIs to use.
  11722. Details []googleapi.RawMessage `json:"details,omitempty"`
  11723. // Message: A developer-facing error message, which should be in
  11724. // English. Any
  11725. // user-facing error message should be localized and sent in
  11726. // the
  11727. // google.rpc.Status.details field, or localized by the client.
  11728. Message string `json:"message,omitempty"`
  11729. // ForceSendFields is a list of field names (e.g. "Code") to
  11730. // unconditionally include in API requests. By default, fields with
  11731. // empty values are omitted from API requests. However, any non-pointer,
  11732. // non-interface field appearing in ForceSendFields will be sent to the
  11733. // server regardless of whether the field is empty or not. This may be
  11734. // used to include empty fields in Patch requests.
  11735. ForceSendFields []string `json:"-"`
  11736. // NullFields is a list of field names (e.g. "Code") to include in API
  11737. // requests with the JSON null value. By default, fields with empty
  11738. // values are omitted from API requests. However, any field with an
  11739. // empty value appearing in NullFields will be sent to the server as
  11740. // null. It is an error if a field in this list has a non-empty value.
  11741. // This may be used to include null fields in Patch requests.
  11742. NullFields []string `json:"-"`
  11743. }
  11744. func (s *Status) MarshalJSON() ([]byte, error) {
  11745. type NoMethod Status
  11746. raw := NoMethod(*s)
  11747. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11748. }
  11749. // Symbol: A single symbol representation.
  11750. type Symbol struct {
  11751. // BoundingBox: The bounding box for the symbol.
  11752. // The vertices are in the order of top-left, top-right,
  11753. // bottom-right,
  11754. // bottom-left. When a rotation of the bounding box is detected the
  11755. // rotation
  11756. // is represented as around the top-left corner as defined when the text
  11757. // is
  11758. // read in the 'natural' orientation.
  11759. // For example:
  11760. // * when the text is horizontal it might look like:
  11761. // 0----1
  11762. // | |
  11763. // 3----2
  11764. // * when it's rotated 180 degrees around the top-left corner it
  11765. // becomes:
  11766. // 2----3
  11767. // | |
  11768. // 1----0
  11769. // and the vertice order will still be (0, 1, 2, 3).
  11770. BoundingBox *BoundingPoly `json:"boundingBox,omitempty"`
  11771. // Confidence: Confidence of the OCR results for the symbol. Range [0,
  11772. // 1].
  11773. Confidence float64 `json:"confidence,omitempty"`
  11774. // Property: Additional information detected for the symbol.
  11775. Property *TextProperty `json:"property,omitempty"`
  11776. // Text: The actual UTF-8 representation of the symbol.
  11777. Text string `json:"text,omitempty"`
  11778. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  11779. // unconditionally include in API requests. By default, fields with
  11780. // empty values are omitted from API requests. However, any non-pointer,
  11781. // non-interface field appearing in ForceSendFields will be sent to the
  11782. // server regardless of whether the field is empty or not. This may be
  11783. // used to include empty fields in Patch requests.
  11784. ForceSendFields []string `json:"-"`
  11785. // NullFields is a list of field names (e.g. "BoundingBox") to include
  11786. // in API requests with the JSON null value. By default, fields with
  11787. // empty values are omitted from API requests. However, any field with
  11788. // an empty value appearing in NullFields will be sent to the server as
  11789. // null. It is an error if a field in this list has a non-empty value.
  11790. // This may be used to include null fields in Patch requests.
  11791. NullFields []string `json:"-"`
  11792. }
  11793. func (s *Symbol) MarshalJSON() ([]byte, error) {
  11794. type NoMethod Symbol
  11795. raw := NoMethod(*s)
  11796. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11797. }
  11798. func (s *Symbol) UnmarshalJSON(data []byte) error {
  11799. type NoMethod Symbol
  11800. var s1 struct {
  11801. Confidence gensupport.JSONFloat64 `json:"confidence"`
  11802. *NoMethod
  11803. }
  11804. s1.NoMethod = (*NoMethod)(s)
  11805. if err := json.Unmarshal(data, &s1); err != nil {
  11806. return err
  11807. }
  11808. s.Confidence = float64(s1.Confidence)
  11809. return nil
  11810. }
  11811. // TextAnnotation: TextAnnotation contains a structured representation
  11812. // of OCR extracted text.
  11813. // The hierarchy of an OCR extracted text structure is like this:
  11814. // TextAnnotation -> Page -> Block -> Paragraph -> Word ->
  11815. // Symbol
  11816. // Each structural component, starting from Page, may further have their
  11817. // own
  11818. // properties. Properties describe detected languages, breaks etc..
  11819. // Please refer
  11820. // to the TextAnnotation.TextProperty message definition below for
  11821. // more
  11822. // detail.
  11823. type TextAnnotation struct {
  11824. // Pages: List of pages detected by OCR.
  11825. Pages []*Page `json:"pages,omitempty"`
  11826. // Text: UTF-8 text detected on the pages.
  11827. Text string `json:"text,omitempty"`
  11828. // ForceSendFields is a list of field names (e.g. "Pages") to
  11829. // unconditionally include in API requests. By default, fields with
  11830. // empty values are omitted from API requests. However, any non-pointer,
  11831. // non-interface field appearing in ForceSendFields will be sent to the
  11832. // server regardless of whether the field is empty or not. This may be
  11833. // used to include empty fields in Patch requests.
  11834. ForceSendFields []string `json:"-"`
  11835. // NullFields is a list of field names (e.g. "Pages") to include in API
  11836. // requests with the JSON null value. By default, fields with empty
  11837. // values are omitted from API requests. However, any field with an
  11838. // empty value appearing in NullFields will be sent to the server as
  11839. // null. It is an error if a field in this list has a non-empty value.
  11840. // This may be used to include null fields in Patch requests.
  11841. NullFields []string `json:"-"`
  11842. }
  11843. func (s *TextAnnotation) MarshalJSON() ([]byte, error) {
  11844. type NoMethod TextAnnotation
  11845. raw := NoMethod(*s)
  11846. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11847. }
  11848. // TextProperty: Additional information detected on the structural
  11849. // component.
  11850. type TextProperty struct {
  11851. // DetectedBreak: Detected start or end of a text segment.
  11852. DetectedBreak *DetectedBreak `json:"detectedBreak,omitempty"`
  11853. // DetectedLanguages: A list of detected languages together with
  11854. // confidence.
  11855. DetectedLanguages []*DetectedLanguage `json:"detectedLanguages,omitempty"`
  11856. // ForceSendFields is a list of field names (e.g. "DetectedBreak") to
  11857. // unconditionally include in API requests. By default, fields with
  11858. // empty values are omitted from API requests. However, any non-pointer,
  11859. // non-interface field appearing in ForceSendFields will be sent to the
  11860. // server regardless of whether the field is empty or not. This may be
  11861. // used to include empty fields in Patch requests.
  11862. ForceSendFields []string `json:"-"`
  11863. // NullFields is a list of field names (e.g. "DetectedBreak") to include
  11864. // in API requests with the JSON null value. By default, fields with
  11865. // empty values are omitted from API requests. However, any field with
  11866. // an empty value appearing in NullFields will be sent to the server as
  11867. // null. It is an error if a field in this list has a non-empty value.
  11868. // This may be used to include null fields in Patch requests.
  11869. NullFields []string `json:"-"`
  11870. }
  11871. func (s *TextProperty) MarshalJSON() ([]byte, error) {
  11872. type NoMethod TextProperty
  11873. raw := NoMethod(*s)
  11874. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11875. }
  11876. // Vertex: A vertex represents a 2D point in the image.
  11877. // NOTE: the vertex coordinates are in the same scale as the original
  11878. // image.
  11879. type Vertex struct {
  11880. // X: X coordinate.
  11881. X int64 `json:"x,omitempty"`
  11882. // Y: Y coordinate.
  11883. Y int64 `json:"y,omitempty"`
  11884. // ForceSendFields is a list of field names (e.g. "X") 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. // NullFields is a list of field names (e.g. "X") to include in API
  11892. // requests with the JSON null value. By default, fields with empty
  11893. // values are omitted from API requests. However, any field with an
  11894. // empty value appearing in NullFields will be sent to the server as
  11895. // null. It is an error if a field in this list has a non-empty value.
  11896. // This may be used to include null fields in Patch requests.
  11897. NullFields []string `json:"-"`
  11898. }
  11899. func (s *Vertex) MarshalJSON() ([]byte, error) {
  11900. type NoMethod Vertex
  11901. raw := NoMethod(*s)
  11902. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11903. }
  11904. // WebDetection: Relevant information for the image from the Internet.
  11905. type WebDetection struct {
  11906. // BestGuessLabels: The service's best guess as to the topic of the
  11907. // request image.
  11908. // Inferred from similar images on the open web.
  11909. BestGuessLabels []*WebLabel `json:"bestGuessLabels,omitempty"`
  11910. // FullMatchingImages: Fully matching images from the Internet.
  11911. // Can include resized copies of the query image.
  11912. FullMatchingImages []*WebImage `json:"fullMatchingImages,omitempty"`
  11913. // PagesWithMatchingImages: Web pages containing the matching images
  11914. // from the Internet.
  11915. PagesWithMatchingImages []*WebPage `json:"pagesWithMatchingImages,omitempty"`
  11916. // PartialMatchingImages: Partial matching images from the
  11917. // Internet.
  11918. // Those images are similar enough to share some key-point features.
  11919. // For
  11920. // example an original image will likely have partial matching for its
  11921. // crops.
  11922. PartialMatchingImages []*WebImage `json:"partialMatchingImages,omitempty"`
  11923. // VisuallySimilarImages: The visually similar image results.
  11924. VisuallySimilarImages []*WebImage `json:"visuallySimilarImages,omitempty"`
  11925. // WebEntities: Deduced entities from similar images on the Internet.
  11926. WebEntities []*WebEntity `json:"webEntities,omitempty"`
  11927. // ForceSendFields is a list of field names (e.g. "BestGuessLabels") to
  11928. // unconditionally include in API requests. By default, fields with
  11929. // empty values are omitted from API requests. However, any non-pointer,
  11930. // non-interface field appearing in ForceSendFields will be sent to the
  11931. // server regardless of whether the field is empty or not. This may be
  11932. // used to include empty fields in Patch requests.
  11933. ForceSendFields []string `json:"-"`
  11934. // NullFields is a list of field names (e.g. "BestGuessLabels") to
  11935. // include in API requests with the JSON null value. By default, fields
  11936. // with empty values are omitted from API requests. However, any field
  11937. // with an empty value appearing in NullFields will be sent to the
  11938. // server as null. It is an error if a field in this list has a
  11939. // non-empty value. This may be used to include null fields in Patch
  11940. // requests.
  11941. NullFields []string `json:"-"`
  11942. }
  11943. func (s *WebDetection) MarshalJSON() ([]byte, error) {
  11944. type NoMethod WebDetection
  11945. raw := NoMethod(*s)
  11946. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11947. }
  11948. // WebEntity: Entity deduced from similar images on the Internet.
  11949. type WebEntity struct {
  11950. // Description: Canonical description of the entity, in English.
  11951. Description string `json:"description,omitempty"`
  11952. // EntityId: Opaque entity ID.
  11953. EntityId string `json:"entityId,omitempty"`
  11954. // Score: Overall relevancy score for the entity.
  11955. // Not normalized and not comparable across different image queries.
  11956. Score float64 `json:"score,omitempty"`
  11957. // ForceSendFields is a list of field names (e.g. "Description") to
  11958. // unconditionally include in API requests. By default, fields with
  11959. // empty values are omitted from API requests. However, any non-pointer,
  11960. // non-interface field appearing in ForceSendFields will be sent to the
  11961. // server regardless of whether the field is empty or not. This may be
  11962. // used to include empty fields in Patch requests.
  11963. ForceSendFields []string `json:"-"`
  11964. // NullFields is a list of field names (e.g. "Description") to include
  11965. // in API requests with the JSON null value. By default, fields with
  11966. // empty values are omitted from API requests. However, any field with
  11967. // an empty value appearing in NullFields will be sent to the server as
  11968. // null. It is an error if a field in this list has a non-empty value.
  11969. // This may be used to include null fields in Patch requests.
  11970. NullFields []string `json:"-"`
  11971. }
  11972. func (s *WebEntity) MarshalJSON() ([]byte, error) {
  11973. type NoMethod WebEntity
  11974. raw := NoMethod(*s)
  11975. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11976. }
  11977. func (s *WebEntity) UnmarshalJSON(data []byte) error {
  11978. type NoMethod WebEntity
  11979. var s1 struct {
  11980. Score gensupport.JSONFloat64 `json:"score"`
  11981. *NoMethod
  11982. }
  11983. s1.NoMethod = (*NoMethod)(s)
  11984. if err := json.Unmarshal(data, &s1); err != nil {
  11985. return err
  11986. }
  11987. s.Score = float64(s1.Score)
  11988. return nil
  11989. }
  11990. // WebImage: Metadata for online images.
  11991. type WebImage struct {
  11992. // Score: (Deprecated) Overall relevancy score for the image.
  11993. Score float64 `json:"score,omitempty"`
  11994. // Url: The result image URL.
  11995. Url string `json:"url,omitempty"`
  11996. // ForceSendFields is a list of field names (e.g. "Score") to
  11997. // unconditionally include in API requests. By default, fields with
  11998. // empty values are omitted from API requests. However, any non-pointer,
  11999. // non-interface field appearing in ForceSendFields will be sent to the
  12000. // server regardless of whether the field is empty or not. This may be
  12001. // used to include empty fields in Patch requests.
  12002. ForceSendFields []string `json:"-"`
  12003. // NullFields is a list of field names (e.g. "Score") to include in API
  12004. // requests with the JSON null value. By default, fields with empty
  12005. // values are omitted from API requests. However, any field with an
  12006. // empty value appearing in NullFields will be sent to the server as
  12007. // null. It is an error if a field in this list has a non-empty value.
  12008. // This may be used to include null fields in Patch requests.
  12009. NullFields []string `json:"-"`
  12010. }
  12011. func (s *WebImage) MarshalJSON() ([]byte, error) {
  12012. type NoMethod WebImage
  12013. raw := NoMethod(*s)
  12014. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12015. }
  12016. func (s *WebImage) UnmarshalJSON(data []byte) error {
  12017. type NoMethod WebImage
  12018. var s1 struct {
  12019. Score gensupport.JSONFloat64 `json:"score"`
  12020. *NoMethod
  12021. }
  12022. s1.NoMethod = (*NoMethod)(s)
  12023. if err := json.Unmarshal(data, &s1); err != nil {
  12024. return err
  12025. }
  12026. s.Score = float64(s1.Score)
  12027. return nil
  12028. }
  12029. // WebLabel: Label to provide extra metadata for the web detection.
  12030. type WebLabel struct {
  12031. // Label: Label for extra metadata.
  12032. Label string `json:"label,omitempty"`
  12033. // LanguageCode: The BCP-47 language code for `label`, such as "en-US"
  12034. // or "sr-Latn".
  12035. // For more information,
  12036. // see
  12037. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  12038. LanguageCode string `json:"languageCode,omitempty"`
  12039. // ForceSendFields is a list of field names (e.g. "Label") to
  12040. // unconditionally include in API requests. By default, fields with
  12041. // empty values are omitted from API requests. However, any non-pointer,
  12042. // non-interface field appearing in ForceSendFields will be sent to the
  12043. // server regardless of whether the field is empty or not. This may be
  12044. // used to include empty fields in Patch requests.
  12045. ForceSendFields []string `json:"-"`
  12046. // NullFields is a list of field names (e.g. "Label") to include in API
  12047. // requests with the JSON null value. By default, fields with empty
  12048. // values are omitted from API requests. However, any field with an
  12049. // empty value appearing in NullFields will be sent to the server as
  12050. // null. It is an error if a field in this list has a non-empty value.
  12051. // This may be used to include null fields in Patch requests.
  12052. NullFields []string `json:"-"`
  12053. }
  12054. func (s *WebLabel) MarshalJSON() ([]byte, error) {
  12055. type NoMethod WebLabel
  12056. raw := NoMethod(*s)
  12057. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12058. }
  12059. // WebPage: Metadata for web pages.
  12060. type WebPage struct {
  12061. // FullMatchingImages: Fully matching images on the page.
  12062. // Can include resized copies of the query image.
  12063. FullMatchingImages []*WebImage `json:"fullMatchingImages,omitempty"`
  12064. // PageTitle: Title for the web page, may contain HTML markups.
  12065. PageTitle string `json:"pageTitle,omitempty"`
  12066. // PartialMatchingImages: Partial matching images on the page.
  12067. // Those images are similar enough to share some key-point features.
  12068. // For
  12069. // example an original image will likely have partial matching for
  12070. // its
  12071. // crops.
  12072. PartialMatchingImages []*WebImage `json:"partialMatchingImages,omitempty"`
  12073. // Score: (Deprecated) Overall relevancy score for the web page.
  12074. Score float64 `json:"score,omitempty"`
  12075. // Url: The result web page URL.
  12076. Url string `json:"url,omitempty"`
  12077. // ForceSendFields is a list of field names (e.g. "FullMatchingImages")
  12078. // to unconditionally include in API requests. By default, fields with
  12079. // empty values are omitted from API requests. However, any non-pointer,
  12080. // non-interface field appearing in ForceSendFields will be sent to the
  12081. // server regardless of whether the field is empty or not. This may be
  12082. // used to include empty fields in Patch requests.
  12083. ForceSendFields []string `json:"-"`
  12084. // NullFields is a list of field names (e.g. "FullMatchingImages") to
  12085. // include in API requests with the JSON null value. By default, fields
  12086. // with empty values are omitted from API requests. However, any field
  12087. // with an empty value appearing in NullFields will be sent to the
  12088. // server as null. It is an error if a field in this list has a
  12089. // non-empty value. This may be used to include null fields in Patch
  12090. // requests.
  12091. NullFields []string `json:"-"`
  12092. }
  12093. func (s *WebPage) MarshalJSON() ([]byte, error) {
  12094. type NoMethod WebPage
  12095. raw := NoMethod(*s)
  12096. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12097. }
  12098. func (s *WebPage) UnmarshalJSON(data []byte) error {
  12099. type NoMethod WebPage
  12100. var s1 struct {
  12101. Score gensupport.JSONFloat64 `json:"score"`
  12102. *NoMethod
  12103. }
  12104. s1.NoMethod = (*NoMethod)(s)
  12105. if err := json.Unmarshal(data, &s1); err != nil {
  12106. return err
  12107. }
  12108. s.Score = float64(s1.Score)
  12109. return nil
  12110. }
  12111. // Word: A word representation.
  12112. type Word struct {
  12113. // BoundingBox: The bounding box for the word.
  12114. // The vertices are in the order of top-left, top-right,
  12115. // bottom-right,
  12116. // bottom-left. When a rotation of the bounding box is detected the
  12117. // rotation
  12118. // is represented as around the top-left corner as defined when the text
  12119. // is
  12120. // read in the 'natural' orientation.
  12121. // For example:
  12122. // * when the text is horizontal it might look like:
  12123. // 0----1
  12124. // | |
  12125. // 3----2
  12126. // * when it's rotated 180 degrees around the top-left corner it
  12127. // becomes:
  12128. // 2----3
  12129. // | |
  12130. // 1----0
  12131. // and the vertex order will still be (0, 1, 2, 3).
  12132. BoundingBox *BoundingPoly `json:"boundingBox,omitempty"`
  12133. // Confidence: Confidence of the OCR results for the word. Range [0, 1].
  12134. Confidence float64 `json:"confidence,omitempty"`
  12135. // Property: Additional information detected for the word.
  12136. Property *TextProperty `json:"property,omitempty"`
  12137. // Symbols: List of symbols in the word.
  12138. // The order of the symbols follows the natural reading order.
  12139. Symbols []*Symbol `json:"symbols,omitempty"`
  12140. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  12141. // unconditionally include in API requests. By default, fields with
  12142. // empty values are omitted from API requests. However, any non-pointer,
  12143. // non-interface field appearing in ForceSendFields will be sent to the
  12144. // server regardless of whether the field is empty or not. This may be
  12145. // used to include empty fields in Patch requests.
  12146. ForceSendFields []string `json:"-"`
  12147. // NullFields is a list of field names (e.g. "BoundingBox") to include
  12148. // in API requests with the JSON null value. By default, fields with
  12149. // empty values are omitted from API requests. However, any field with
  12150. // an empty value appearing in NullFields will be sent to the server as
  12151. // null. It is an error if a field in this list has a non-empty value.
  12152. // This may be used to include null fields in Patch requests.
  12153. NullFields []string `json:"-"`
  12154. }
  12155. func (s *Word) MarshalJSON() ([]byte, error) {
  12156. type NoMethod Word
  12157. raw := NoMethod(*s)
  12158. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12159. }
  12160. func (s *Word) UnmarshalJSON(data []byte) error {
  12161. type NoMethod Word
  12162. var s1 struct {
  12163. Confidence gensupport.JSONFloat64 `json:"confidence"`
  12164. *NoMethod
  12165. }
  12166. s1.NoMethod = (*NoMethod)(s)
  12167. if err := json.Unmarshal(data, &s1); err != nil {
  12168. return err
  12169. }
  12170. s.Confidence = float64(s1.Confidence)
  12171. return nil
  12172. }
  12173. // method id "vision.files.asyncBatchAnnotate":
  12174. type FilesAsyncBatchAnnotateCall struct {
  12175. s *Service
  12176. googlecloudvisionv1p2beta1asyncbatchannotatefilesrequest *GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesRequest
  12177. urlParams_ gensupport.URLParams
  12178. ctx_ context.Context
  12179. header_ http.Header
  12180. }
  12181. // AsyncBatchAnnotate: Run asynchronous image detection and annotation
  12182. // for a list of generic
  12183. // files, such as PDF files, which may contain multiple pages and
  12184. // multiple
  12185. // images per page. Progress and results can be retrieved through
  12186. // the
  12187. // `google.longrunning.Operations` interface.
  12188. // `Operation.metadata` contains `OperationMetadata`
  12189. // (metadata).
  12190. // `Operation.response` contains `AsyncBatchAnnotateFilesResponse`
  12191. // (results).
  12192. func (r *FilesService) AsyncBatchAnnotate(googlecloudvisionv1p2beta1asyncbatchannotatefilesrequest *GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesRequest) *FilesAsyncBatchAnnotateCall {
  12193. c := &FilesAsyncBatchAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12194. c.googlecloudvisionv1p2beta1asyncbatchannotatefilesrequest = googlecloudvisionv1p2beta1asyncbatchannotatefilesrequest
  12195. return c
  12196. }
  12197. // Fields allows partial responses to be retrieved. See
  12198. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12199. // for more information.
  12200. func (c *FilesAsyncBatchAnnotateCall) Fields(s ...googleapi.Field) *FilesAsyncBatchAnnotateCall {
  12201. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12202. return c
  12203. }
  12204. // Context sets the context to be used in this call's Do method. Any
  12205. // pending HTTP request will be aborted if the provided context is
  12206. // canceled.
  12207. func (c *FilesAsyncBatchAnnotateCall) Context(ctx context.Context) *FilesAsyncBatchAnnotateCall {
  12208. c.ctx_ = ctx
  12209. return c
  12210. }
  12211. // Header returns an http.Header that can be modified by the caller to
  12212. // add HTTP headers to the request.
  12213. func (c *FilesAsyncBatchAnnotateCall) Header() http.Header {
  12214. if c.header_ == nil {
  12215. c.header_ = make(http.Header)
  12216. }
  12217. return c.header_
  12218. }
  12219. func (c *FilesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) {
  12220. reqHeaders := make(http.Header)
  12221. for k, v := range c.header_ {
  12222. reqHeaders[k] = v
  12223. }
  12224. reqHeaders.Set("User-Agent", c.s.userAgent())
  12225. var body io.Reader = nil
  12226. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p2beta1asyncbatchannotatefilesrequest)
  12227. if err != nil {
  12228. return nil, err
  12229. }
  12230. reqHeaders.Set("Content-Type", "application/json")
  12231. c.urlParams_.Set("alt", alt)
  12232. c.urlParams_.Set("prettyPrint", "false")
  12233. urls := googleapi.ResolveRelative(c.s.BasePath, "v1p2beta1/files:asyncBatchAnnotate")
  12234. urls += "?" + c.urlParams_.Encode()
  12235. req, err := http.NewRequest("POST", urls, body)
  12236. if err != nil {
  12237. return nil, err
  12238. }
  12239. req.Header = reqHeaders
  12240. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12241. }
  12242. // Do executes the "vision.files.asyncBatchAnnotate" call.
  12243. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  12244. // status code is an error. Response headers are in either
  12245. // *Operation.ServerResponse.Header or (if a response was returned at
  12246. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12247. // to check whether the returned error was because
  12248. // http.StatusNotModified was returned.
  12249. func (c *FilesAsyncBatchAnnotateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  12250. gensupport.SetOptions(c.urlParams_, opts...)
  12251. res, err := c.doRequest("json")
  12252. if res != nil && res.StatusCode == http.StatusNotModified {
  12253. if res.Body != nil {
  12254. res.Body.Close()
  12255. }
  12256. return nil, &googleapi.Error{
  12257. Code: res.StatusCode,
  12258. Header: res.Header,
  12259. }
  12260. }
  12261. if err != nil {
  12262. return nil, err
  12263. }
  12264. defer googleapi.CloseBody(res)
  12265. if err := googleapi.CheckResponse(res); err != nil {
  12266. return nil, err
  12267. }
  12268. ret := &Operation{
  12269. ServerResponse: googleapi.ServerResponse{
  12270. Header: res.Header,
  12271. HTTPStatusCode: res.StatusCode,
  12272. },
  12273. }
  12274. target := &ret
  12275. if err := gensupport.DecodeResponse(target, res); err != nil {
  12276. return nil, err
  12277. }
  12278. return ret, nil
  12279. // {
  12280. // "description": "Run asynchronous image detection and annotation for a list of generic\nfiles, such as PDF files, which may contain multiple pages and multiple\nimages per page. Progress and results can be retrieved through the\n`google.longrunning.Operations` interface.\n`Operation.metadata` contains `OperationMetadata` (metadata).\n`Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results).",
  12281. // "flatPath": "v1p2beta1/files:asyncBatchAnnotate",
  12282. // "httpMethod": "POST",
  12283. // "id": "vision.files.asyncBatchAnnotate",
  12284. // "parameterOrder": [],
  12285. // "parameters": {},
  12286. // "path": "v1p2beta1/files:asyncBatchAnnotate",
  12287. // "request": {
  12288. // "$ref": "GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesRequest"
  12289. // },
  12290. // "response": {
  12291. // "$ref": "Operation"
  12292. // },
  12293. // "scopes": [
  12294. // "https://www.googleapis.com/auth/cloud-platform",
  12295. // "https://www.googleapis.com/auth/cloud-vision"
  12296. // ]
  12297. // }
  12298. }
  12299. // method id "vision.images.annotate":
  12300. type ImagesAnnotateCall struct {
  12301. s *Service
  12302. googlecloudvisionv1p2beta1batchannotateimagesrequest *GoogleCloudVisionV1p2beta1BatchAnnotateImagesRequest
  12303. urlParams_ gensupport.URLParams
  12304. ctx_ context.Context
  12305. header_ http.Header
  12306. }
  12307. // Annotate: Run image detection and annotation for a batch of images.
  12308. func (r *ImagesService) Annotate(googlecloudvisionv1p2beta1batchannotateimagesrequest *GoogleCloudVisionV1p2beta1BatchAnnotateImagesRequest) *ImagesAnnotateCall {
  12309. c := &ImagesAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12310. c.googlecloudvisionv1p2beta1batchannotateimagesrequest = googlecloudvisionv1p2beta1batchannotateimagesrequest
  12311. return c
  12312. }
  12313. // Fields allows partial responses to be retrieved. See
  12314. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12315. // for more information.
  12316. func (c *ImagesAnnotateCall) Fields(s ...googleapi.Field) *ImagesAnnotateCall {
  12317. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12318. return c
  12319. }
  12320. // Context sets the context to be used in this call's Do method. Any
  12321. // pending HTTP request will be aborted if the provided context is
  12322. // canceled.
  12323. func (c *ImagesAnnotateCall) Context(ctx context.Context) *ImagesAnnotateCall {
  12324. c.ctx_ = ctx
  12325. return c
  12326. }
  12327. // Header returns an http.Header that can be modified by the caller to
  12328. // add HTTP headers to the request.
  12329. func (c *ImagesAnnotateCall) Header() http.Header {
  12330. if c.header_ == nil {
  12331. c.header_ = make(http.Header)
  12332. }
  12333. return c.header_
  12334. }
  12335. func (c *ImagesAnnotateCall) doRequest(alt string) (*http.Response, error) {
  12336. reqHeaders := make(http.Header)
  12337. for k, v := range c.header_ {
  12338. reqHeaders[k] = v
  12339. }
  12340. reqHeaders.Set("User-Agent", c.s.userAgent())
  12341. var body io.Reader = nil
  12342. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p2beta1batchannotateimagesrequest)
  12343. if err != nil {
  12344. return nil, err
  12345. }
  12346. reqHeaders.Set("Content-Type", "application/json")
  12347. c.urlParams_.Set("alt", alt)
  12348. c.urlParams_.Set("prettyPrint", "false")
  12349. urls := googleapi.ResolveRelative(c.s.BasePath, "v1p2beta1/images:annotate")
  12350. urls += "?" + c.urlParams_.Encode()
  12351. req, err := http.NewRequest("POST", urls, body)
  12352. if err != nil {
  12353. return nil, err
  12354. }
  12355. req.Header = reqHeaders
  12356. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12357. }
  12358. // Do executes the "vision.images.annotate" call.
  12359. // Exactly one of *GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse
  12360. // or error will be non-nil. Any non-2xx status code is an error.
  12361. // Response headers are in either
  12362. // *GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse.ServerResponse.
  12363. // Header or (if a response was returned at all) in
  12364. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  12365. // whether the returned error was because http.StatusNotModified was
  12366. // returned.
  12367. func (c *ImagesAnnotateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse, error) {
  12368. gensupport.SetOptions(c.urlParams_, opts...)
  12369. res, err := c.doRequest("json")
  12370. if res != nil && res.StatusCode == http.StatusNotModified {
  12371. if res.Body != nil {
  12372. res.Body.Close()
  12373. }
  12374. return nil, &googleapi.Error{
  12375. Code: res.StatusCode,
  12376. Header: res.Header,
  12377. }
  12378. }
  12379. if err != nil {
  12380. return nil, err
  12381. }
  12382. defer googleapi.CloseBody(res)
  12383. if err := googleapi.CheckResponse(res); err != nil {
  12384. return nil, err
  12385. }
  12386. ret := &GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse{
  12387. ServerResponse: googleapi.ServerResponse{
  12388. Header: res.Header,
  12389. HTTPStatusCode: res.StatusCode,
  12390. },
  12391. }
  12392. target := &ret
  12393. if err := gensupport.DecodeResponse(target, res); err != nil {
  12394. return nil, err
  12395. }
  12396. return ret, nil
  12397. // {
  12398. // "description": "Run image detection and annotation for a batch of images.",
  12399. // "flatPath": "v1p2beta1/images:annotate",
  12400. // "httpMethod": "POST",
  12401. // "id": "vision.images.annotate",
  12402. // "parameterOrder": [],
  12403. // "parameters": {},
  12404. // "path": "v1p2beta1/images:annotate",
  12405. // "request": {
  12406. // "$ref": "GoogleCloudVisionV1p2beta1BatchAnnotateImagesRequest"
  12407. // },
  12408. // "response": {
  12409. // "$ref": "GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse"
  12410. // },
  12411. // "scopes": [
  12412. // "https://www.googleapis.com/auth/cloud-platform",
  12413. // "https://www.googleapis.com/auth/cloud-vision"
  12414. // ]
  12415. // }
  12416. }