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.
 
 
 

5813 lines
231 KiB

  1. // Package vision provides access to the Cloud Vision API.
  2. //
  3. // See https://cloud.google.com/vision/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/vision/v1p2beta1"
  8. // ...
  9. // visionService, err := vision.New(oauthHttpClient)
  10. package vision // import "google.golang.org/api/vision/v1p2beta1"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "vision:v1p2beta1"
  41. const apiName = "vision"
  42. const apiVersion = "v1p2beta1"
  43. const basePath = "https://vision.googleapis.com/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // View and manage your data across Google Cloud Platform services
  47. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  48. // Apply machine learning models to understand and label images
  49. CloudVisionScope = "https://www.googleapis.com/auth/cloud-vision"
  50. )
  51. func New(client *http.Client) (*Service, error) {
  52. if client == nil {
  53. return nil, errors.New("client is nil")
  54. }
  55. s := &Service{client: client, BasePath: basePath}
  56. s.Files = NewFilesService(s)
  57. s.Images = NewImagesService(s)
  58. return s, nil
  59. }
  60. type Service struct {
  61. client *http.Client
  62. BasePath string // API endpoint base URL
  63. UserAgent string // optional additional User-Agent fragment
  64. Files *FilesService
  65. Images *ImagesService
  66. }
  67. func (s *Service) userAgent() string {
  68. if s.UserAgent == "" {
  69. return googleapi.UserAgent
  70. }
  71. return googleapi.UserAgent + " " + s.UserAgent
  72. }
  73. func NewFilesService(s *Service) *FilesService {
  74. rs := &FilesService{s: s}
  75. return rs
  76. }
  77. type FilesService struct {
  78. s *Service
  79. }
  80. func NewImagesService(s *Service) *ImagesService {
  81. rs := &ImagesService{s: s}
  82. return rs
  83. }
  84. type ImagesService struct {
  85. s *Service
  86. }
  87. // AnnotateFileResponse: Response to a single file annotation request. A
  88. // file may contain one or more
  89. // images, which individually have their own responses.
  90. type AnnotateFileResponse struct {
  91. // InputConfig: Information about the file for which this response is
  92. // generated.
  93. InputConfig *InputConfig `json:"inputConfig,omitempty"`
  94. // Responses: Individual responses to images found within the file.
  95. Responses []*AnnotateImageResponse `json:"responses,omitempty"`
  96. // ForceSendFields is a list of field names (e.g. "InputConfig") to
  97. // unconditionally include in API requests. By default, fields with
  98. // empty values are omitted from API requests. However, any non-pointer,
  99. // non-interface field appearing in ForceSendFields will be sent to the
  100. // server regardless of whether the field is empty or not. This may be
  101. // used to include empty fields in Patch requests.
  102. ForceSendFields []string `json:"-"`
  103. // NullFields is a list of field names (e.g. "InputConfig") to include
  104. // in API requests with the JSON null value. By default, fields with
  105. // empty values are omitted from API requests. However, any field with
  106. // an empty value appearing in NullFields will be sent to the server as
  107. // null. It is an error if a field in this list has a non-empty value.
  108. // This may be used to include null fields in Patch requests.
  109. NullFields []string `json:"-"`
  110. }
  111. func (s *AnnotateFileResponse) MarshalJSON() ([]byte, error) {
  112. type NoMethod AnnotateFileResponse
  113. raw := NoMethod(*s)
  114. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  115. }
  116. // AnnotateImageResponse: Response to an image annotation request.
  117. type AnnotateImageResponse struct {
  118. // Context: If present, contextual information is needed to understand
  119. // where this image
  120. // comes from.
  121. Context *ImageAnnotationContext `json:"context,omitempty"`
  122. // CropHintsAnnotation: If present, crop hints have completed
  123. // successfully.
  124. CropHintsAnnotation *CropHintsAnnotation `json:"cropHintsAnnotation,omitempty"`
  125. // Error: If set, represents the error message for the operation.
  126. // Note that filled-in image annotations are guaranteed to be
  127. // correct, even when `error` is set.
  128. Error *Status `json:"error,omitempty"`
  129. // FaceAnnotations: If present, face detection has completed
  130. // successfully.
  131. FaceAnnotations []*FaceAnnotation `json:"faceAnnotations,omitempty"`
  132. // FullTextAnnotation: If present, text (OCR) detection or document
  133. // (OCR) text detection has
  134. // completed successfully.
  135. // This annotation provides the structural hierarchy for the OCR
  136. // detected
  137. // text.
  138. FullTextAnnotation *TextAnnotation `json:"fullTextAnnotation,omitempty"`
  139. // ImagePropertiesAnnotation: If present, image properties were
  140. // extracted successfully.
  141. ImagePropertiesAnnotation *ImageProperties `json:"imagePropertiesAnnotation,omitempty"`
  142. // LabelAnnotations: If present, label detection has completed
  143. // successfully.
  144. LabelAnnotations []*EntityAnnotation `json:"labelAnnotations,omitempty"`
  145. // LandmarkAnnotations: If present, landmark detection has completed
  146. // successfully.
  147. LandmarkAnnotations []*EntityAnnotation `json:"landmarkAnnotations,omitempty"`
  148. // LogoAnnotations: If present, logo detection has completed
  149. // successfully.
  150. LogoAnnotations []*EntityAnnotation `json:"logoAnnotations,omitempty"`
  151. // SafeSearchAnnotation: If present, safe-search annotation has
  152. // completed successfully.
  153. SafeSearchAnnotation *SafeSearchAnnotation `json:"safeSearchAnnotation,omitempty"`
  154. // TextAnnotations: If present, text (OCR) detection has completed
  155. // successfully.
  156. TextAnnotations []*EntityAnnotation `json:"textAnnotations,omitempty"`
  157. // WebDetection: If present, web detection has completed successfully.
  158. WebDetection *WebDetection `json:"webDetection,omitempty"`
  159. // ForceSendFields is a list of field names (e.g. "Context") to
  160. // unconditionally include in API requests. By default, fields with
  161. // empty values are omitted from API requests. However, any non-pointer,
  162. // non-interface field appearing in ForceSendFields will be sent to the
  163. // server regardless of whether the field is empty or not. This may be
  164. // used to include empty fields in Patch requests.
  165. ForceSendFields []string `json:"-"`
  166. // NullFields is a list of field names (e.g. "Context") to include in
  167. // API requests with the JSON null value. By default, fields with empty
  168. // values are omitted from API requests. However, any field with an
  169. // empty value appearing in NullFields will be sent to the server as
  170. // null. It is an error if a field in this list has a non-empty value.
  171. // This may be used to include null fields in Patch requests.
  172. NullFields []string `json:"-"`
  173. }
  174. func (s *AnnotateImageResponse) MarshalJSON() ([]byte, error) {
  175. type NoMethod AnnotateImageResponse
  176. raw := NoMethod(*s)
  177. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  178. }
  179. // AsyncAnnotateFileResponse: The response for a single offline file
  180. // annotation request.
  181. type AsyncAnnotateFileResponse struct {
  182. // OutputConfig: The output location and metadata from
  183. // AsyncAnnotateFileRequest.
  184. OutputConfig *OutputConfig `json:"outputConfig,omitempty"`
  185. // ForceSendFields is a list of field names (e.g. "OutputConfig") to
  186. // unconditionally include in API requests. By default, fields with
  187. // empty values are omitted from API requests. However, any non-pointer,
  188. // non-interface field appearing in ForceSendFields will be sent to the
  189. // server regardless of whether the field is empty or not. This may be
  190. // used to include empty fields in Patch requests.
  191. ForceSendFields []string `json:"-"`
  192. // NullFields is a list of field names (e.g. "OutputConfig") to include
  193. // in API requests with the JSON null value. By default, fields with
  194. // empty values are omitted from API requests. However, any field with
  195. // an empty value appearing in NullFields will be sent to the server as
  196. // null. It is an error if a field in this list has a non-empty value.
  197. // This may be used to include null fields in Patch requests.
  198. NullFields []string `json:"-"`
  199. }
  200. func (s *AsyncAnnotateFileResponse) MarshalJSON() ([]byte, error) {
  201. type NoMethod AsyncAnnotateFileResponse
  202. raw := NoMethod(*s)
  203. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  204. }
  205. // AsyncBatchAnnotateFilesResponse: Response to an async batch file
  206. // annotation request.
  207. type AsyncBatchAnnotateFilesResponse struct {
  208. // Responses: The list of file annotation responses, one for each
  209. // request in
  210. // AsyncBatchAnnotateFilesRequest.
  211. Responses []*AsyncAnnotateFileResponse `json:"responses,omitempty"`
  212. // ForceSendFields is a list of field names (e.g. "Responses") to
  213. // unconditionally include in API requests. By default, fields with
  214. // empty values are omitted from API requests. However, any non-pointer,
  215. // non-interface field appearing in ForceSendFields will be sent to the
  216. // server regardless of whether the field is empty or not. This may be
  217. // used to include empty fields in Patch requests.
  218. ForceSendFields []string `json:"-"`
  219. // NullFields is a list of field names (e.g. "Responses") to include in
  220. // API requests with the JSON null value. By default, fields with empty
  221. // values are omitted from API requests. However, any field with an
  222. // empty value appearing in NullFields will be sent to the server as
  223. // null. It is an error if a field in this list has a non-empty value.
  224. // This may be used to include null fields in Patch requests.
  225. NullFields []string `json:"-"`
  226. }
  227. func (s *AsyncBatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) {
  228. type NoMethod AsyncBatchAnnotateFilesResponse
  229. raw := NoMethod(*s)
  230. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  231. }
  232. // Block: Logical element on the page.
  233. type Block struct {
  234. // BlockType: Detected block type (text, image etc) for this block.
  235. //
  236. // Possible values:
  237. // "UNKNOWN" - Unknown block type.
  238. // "TEXT" - Regular text block.
  239. // "TABLE" - Table block.
  240. // "PICTURE" - Image block.
  241. // "RULER" - Horizontal/vertical line box.
  242. // "BARCODE" - Barcode block.
  243. BlockType string `json:"blockType,omitempty"`
  244. // BoundingBox: The bounding box for the block.
  245. // The vertices are in the order of top-left, top-right,
  246. // bottom-right,
  247. // bottom-left. When a rotation of the bounding box is detected the
  248. // rotation
  249. // is represented as around the top-left corner as defined when the text
  250. // is
  251. // read in the 'natural' orientation.
  252. // For example:
  253. //
  254. // * when the text is horizontal it might look like:
  255. //
  256. // 0----1
  257. // | |
  258. // 3----2
  259. //
  260. // * when it's rotated 180 degrees around the top-left corner it
  261. // becomes:
  262. //
  263. // 2----3
  264. // | |
  265. // 1----0
  266. //
  267. // and the vertice order will still be (0, 1, 2, 3).
  268. BoundingBox *BoundingPoly `json:"boundingBox,omitempty"`
  269. // Confidence: Confidence of the OCR results on the block. Range [0, 1].
  270. Confidence float64 `json:"confidence,omitempty"`
  271. // Paragraphs: List of paragraphs in this block (if this blocks is of
  272. // type text).
  273. Paragraphs []*Paragraph `json:"paragraphs,omitempty"`
  274. // Property: Additional information detected for the block.
  275. Property *TextProperty `json:"property,omitempty"`
  276. // ForceSendFields is a list of field names (e.g. "BlockType") to
  277. // unconditionally include in API requests. By default, fields with
  278. // empty values are omitted from API requests. However, any non-pointer,
  279. // non-interface field appearing in ForceSendFields will be sent to the
  280. // server regardless of whether the field is empty or not. This may be
  281. // used to include empty fields in Patch requests.
  282. ForceSendFields []string `json:"-"`
  283. // NullFields is a list of field names (e.g. "BlockType") to include in
  284. // API requests with the JSON null value. By default, fields with empty
  285. // values are omitted from API requests. However, any field with an
  286. // empty value appearing in NullFields will be sent to the server as
  287. // null. It is an error if a field in this list has a non-empty value.
  288. // This may be used to include null fields in Patch requests.
  289. NullFields []string `json:"-"`
  290. }
  291. func (s *Block) MarshalJSON() ([]byte, error) {
  292. type NoMethod Block
  293. raw := NoMethod(*s)
  294. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  295. }
  296. func (s *Block) UnmarshalJSON(data []byte) error {
  297. type NoMethod Block
  298. var s1 struct {
  299. Confidence gensupport.JSONFloat64 `json:"confidence"`
  300. *NoMethod
  301. }
  302. s1.NoMethod = (*NoMethod)(s)
  303. if err := json.Unmarshal(data, &s1); err != nil {
  304. return err
  305. }
  306. s.Confidence = float64(s1.Confidence)
  307. return nil
  308. }
  309. // BoundingPoly: A bounding polygon for the detected image annotation.
  310. type BoundingPoly struct {
  311. // NormalizedVertices: The bounding polygon normalized vertices.
  312. NormalizedVertices []*NormalizedVertex `json:"normalizedVertices,omitempty"`
  313. // Vertices: The bounding polygon vertices.
  314. Vertices []*Vertex `json:"vertices,omitempty"`
  315. // ForceSendFields is a list of field names (e.g. "NormalizedVertices")
  316. // to unconditionally include in API requests. By default, fields with
  317. // empty values are omitted from API requests. However, any non-pointer,
  318. // non-interface field appearing in ForceSendFields will be sent to the
  319. // server regardless of whether the field is empty or not. This may be
  320. // used to include empty fields in Patch requests.
  321. ForceSendFields []string `json:"-"`
  322. // NullFields is a list of field names (e.g. "NormalizedVertices") to
  323. // include in API requests with the JSON null value. By default, fields
  324. // with empty values are omitted from API requests. However, any field
  325. // with an empty value appearing in NullFields will be sent to the
  326. // server as null. It is an error if a field in this list has a
  327. // non-empty value. This may be used to include null fields in Patch
  328. // requests.
  329. NullFields []string `json:"-"`
  330. }
  331. func (s *BoundingPoly) MarshalJSON() ([]byte, error) {
  332. type NoMethod BoundingPoly
  333. raw := NoMethod(*s)
  334. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  335. }
  336. // Color: Represents a color in the RGBA color space. This
  337. // representation is designed
  338. // for simplicity of conversion to/from color representations in
  339. // various
  340. // languages over compactness; for example, the fields of this
  341. // representation
  342. // can be trivially provided to the constructor of "java.awt.Color" in
  343. // Java; it
  344. // can also be trivially provided to UIColor's
  345. // "+colorWithRed:green:blue:alpha"
  346. // method in iOS; and, with just a little work, it can be easily
  347. // formatted into
  348. // a CSS "rgba()" string in JavaScript, as well. Here are some
  349. // examples:
  350. //
  351. // Example (Java):
  352. //
  353. // import com.google.type.Color;
  354. //
  355. // // ...
  356. // public static java.awt.Color fromProto(Color protocolor) {
  357. // float alpha = protocolor.hasAlpha()
  358. // ? protocolor.getAlpha().getValue()
  359. // : 1.0;
  360. //
  361. // return new java.awt.Color(
  362. // protocolor.getRed(),
  363. // protocolor.getGreen(),
  364. // protocolor.getBlue(),
  365. // alpha);
  366. // }
  367. //
  368. // public static Color toProto(java.awt.Color color) {
  369. // float red = (float) color.getRed();
  370. // float green = (float) color.getGreen();
  371. // float blue = (float) color.getBlue();
  372. // float denominator = 255.0;
  373. // Color.Builder resultBuilder =
  374. // Color
  375. // .newBuilder()
  376. // .setRed(red / denominator)
  377. // .setGreen(green / denominator)
  378. // .setBlue(blue / denominator);
  379. // int alpha = color.getAlpha();
  380. // if (alpha != 255) {
  381. // result.setAlpha(
  382. // FloatValue
  383. // .newBuilder()
  384. // .setValue(((float) alpha) / denominator)
  385. // .build());
  386. // }
  387. // return resultBuilder.build();
  388. // }
  389. // // ...
  390. //
  391. // Example (iOS / Obj-C):
  392. //
  393. // // ...
  394. // static UIColor* fromProto(Color* protocolor) {
  395. // float red = [protocolor red];
  396. // float green = [protocolor green];
  397. // float blue = [protocolor blue];
  398. // FloatValue* alpha_wrapper = [protocolor alpha];
  399. // float alpha = 1.0;
  400. // if (alpha_wrapper != nil) {
  401. // alpha = [alpha_wrapper value];
  402. // }
  403. // return [UIColor colorWithRed:red green:green blue:blue
  404. // alpha:alpha];
  405. // }
  406. //
  407. // static Color* toProto(UIColor* color) {
  408. // CGFloat red, green, blue, alpha;
  409. // if (![color getRed:&red green:&green blue:&blue
  410. // alpha:&alpha]) {
  411. // return nil;
  412. // }
  413. // Color* result = [Color alloc] init];
  414. // [result setRed:red];
  415. // [result setGreen:green];
  416. // [result setBlue:blue];
  417. // if (alpha <= 0.9999) {
  418. // [result setAlpha:floatWrapperWithValue(alpha)];
  419. // }
  420. // [result autorelease];
  421. // return result;
  422. // }
  423. // // ...
  424. //
  425. // Example (JavaScript):
  426. //
  427. // // ...
  428. //
  429. // var protoToCssColor = function(rgb_color) {
  430. // var redFrac = rgb_color.red || 0.0;
  431. // var greenFrac = rgb_color.green || 0.0;
  432. // var blueFrac = rgb_color.blue || 0.0;
  433. // var red = Math.floor(redFrac * 255);
  434. // var green = Math.floor(greenFrac * 255);
  435. // var blue = Math.floor(blueFrac * 255);
  436. //
  437. // if (!('alpha' in rgb_color)) {
  438. // return rgbToCssColor_(red, green, blue);
  439. // }
  440. //
  441. // var alphaFrac = rgb_color.alpha.value || 0.0;
  442. // var rgbParams = [red, green, blue].join(',');
  443. // return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
  444. // };
  445. //
  446. // var rgbToCssColor_ = function(red, green, blue) {
  447. // var rgbNumber = new Number((red << 16) | (green << 8) | blue);
  448. // var hexString = rgbNumber.toString(16);
  449. // var missingZeros = 6 - hexString.length;
  450. // var resultBuilder = ['#'];
  451. // for (var i = 0; i < missingZeros; i++) {
  452. // resultBuilder.push('0');
  453. // }
  454. // resultBuilder.push(hexString);
  455. // return resultBuilder.join('');
  456. // };
  457. //
  458. // // ...
  459. type Color struct {
  460. // Alpha: The fraction of this color that should be applied to the
  461. // pixel. That is,
  462. // the final pixel color is defined by the equation:
  463. //
  464. // pixel color = alpha * (this color) + (1.0 - alpha) * (background
  465. // color)
  466. //
  467. // This means that a value of 1.0 corresponds to a solid color,
  468. // whereas
  469. // a value of 0.0 corresponds to a completely transparent color.
  470. // This
  471. // uses a wrapper message rather than a simple float scalar so that it
  472. // is
  473. // possible to distinguish between a default value and the value being
  474. // unset.
  475. // If omitted, this color object is to be rendered as a solid color
  476. // (as if the alpha value had been explicitly given with a value of
  477. // 1.0).
  478. Alpha float64 `json:"alpha,omitempty"`
  479. // Blue: The amount of blue in the color as a value in the interval [0,
  480. // 1].
  481. Blue float64 `json:"blue,omitempty"`
  482. // Green: The amount of green in the color as a value in the interval
  483. // [0, 1].
  484. Green float64 `json:"green,omitempty"`
  485. // Red: The amount of red in the color as a value in the interval [0,
  486. // 1].
  487. Red float64 `json:"red,omitempty"`
  488. // ForceSendFields is a list of field names (e.g. "Alpha") to
  489. // unconditionally include in API requests. By default, fields with
  490. // empty values are omitted from API requests. However, any non-pointer,
  491. // non-interface field appearing in ForceSendFields will be sent to the
  492. // server regardless of whether the field is empty or not. This may be
  493. // used to include empty fields in Patch requests.
  494. ForceSendFields []string `json:"-"`
  495. // NullFields is a list of field names (e.g. "Alpha") to include in API
  496. // requests with the JSON null value. By default, fields with empty
  497. // values are omitted from API requests. However, any field with an
  498. // empty value appearing in NullFields will be sent to the server as
  499. // null. It is an error if a field in this list has a non-empty value.
  500. // This may be used to include null fields in Patch requests.
  501. NullFields []string `json:"-"`
  502. }
  503. func (s *Color) MarshalJSON() ([]byte, error) {
  504. type NoMethod Color
  505. raw := NoMethod(*s)
  506. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  507. }
  508. func (s *Color) UnmarshalJSON(data []byte) error {
  509. type NoMethod Color
  510. var s1 struct {
  511. Alpha gensupport.JSONFloat64 `json:"alpha"`
  512. Blue gensupport.JSONFloat64 `json:"blue"`
  513. Green gensupport.JSONFloat64 `json:"green"`
  514. Red gensupport.JSONFloat64 `json:"red"`
  515. *NoMethod
  516. }
  517. s1.NoMethod = (*NoMethod)(s)
  518. if err := json.Unmarshal(data, &s1); err != nil {
  519. return err
  520. }
  521. s.Alpha = float64(s1.Alpha)
  522. s.Blue = float64(s1.Blue)
  523. s.Green = float64(s1.Green)
  524. s.Red = float64(s1.Red)
  525. return nil
  526. }
  527. // ColorInfo: Color information consists of RGB channels, score, and the
  528. // fraction of
  529. // the image that the color occupies in the image.
  530. type ColorInfo struct {
  531. // Color: RGB components of the color.
  532. Color *Color `json:"color,omitempty"`
  533. // PixelFraction: The fraction of pixels the color occupies in the
  534. // image.
  535. // Value in range [0, 1].
  536. PixelFraction float64 `json:"pixelFraction,omitempty"`
  537. // Score: Image-specific score for this color. Value in range [0, 1].
  538. Score float64 `json:"score,omitempty"`
  539. // ForceSendFields is a list of field names (e.g. "Color") to
  540. // unconditionally include in API requests. By default, fields with
  541. // empty values are omitted from API requests. However, any non-pointer,
  542. // non-interface field appearing in ForceSendFields will be sent to the
  543. // server regardless of whether the field is empty or not. This may be
  544. // used to include empty fields in Patch requests.
  545. ForceSendFields []string `json:"-"`
  546. // NullFields is a list of field names (e.g. "Color") to include in API
  547. // requests with the JSON null value. By default, fields with empty
  548. // values are omitted from API requests. However, any field with an
  549. // empty value appearing in NullFields will be sent to the server as
  550. // null. It is an error if a field in this list has a non-empty value.
  551. // This may be used to include null fields in Patch requests.
  552. NullFields []string `json:"-"`
  553. }
  554. func (s *ColorInfo) MarshalJSON() ([]byte, error) {
  555. type NoMethod ColorInfo
  556. raw := NoMethod(*s)
  557. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  558. }
  559. func (s *ColorInfo) UnmarshalJSON(data []byte) error {
  560. type NoMethod ColorInfo
  561. var s1 struct {
  562. PixelFraction gensupport.JSONFloat64 `json:"pixelFraction"`
  563. Score gensupport.JSONFloat64 `json:"score"`
  564. *NoMethod
  565. }
  566. s1.NoMethod = (*NoMethod)(s)
  567. if err := json.Unmarshal(data, &s1); err != nil {
  568. return err
  569. }
  570. s.PixelFraction = float64(s1.PixelFraction)
  571. s.Score = float64(s1.Score)
  572. return nil
  573. }
  574. // CropHint: Single crop hint that is used to generate a new crop when
  575. // serving an image.
  576. type CropHint struct {
  577. // BoundingPoly: The bounding polygon for the crop region. The
  578. // coordinates of the bounding
  579. // box are in the original image's scale, as returned in `ImageParams`.
  580. BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"`
  581. // Confidence: Confidence of this being a salient region. Range [0, 1].
  582. Confidence float64 `json:"confidence,omitempty"`
  583. // ImportanceFraction: Fraction of importance of this salient region
  584. // with respect to the original
  585. // image.
  586. ImportanceFraction float64 `json:"importanceFraction,omitempty"`
  587. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  588. // unconditionally include in API requests. By default, fields with
  589. // empty values are omitted from API requests. However, any non-pointer,
  590. // non-interface field appearing in ForceSendFields will be sent to the
  591. // server regardless of whether the field is empty or not. This may be
  592. // used to include empty fields in Patch requests.
  593. ForceSendFields []string `json:"-"`
  594. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  595. // in API requests with the JSON null value. By default, fields with
  596. // empty values are omitted from API requests. However, any field with
  597. // an empty value appearing in NullFields will be sent to the server as
  598. // null. It is an error if a field in this list has a non-empty value.
  599. // This may be used to include null fields in Patch requests.
  600. NullFields []string `json:"-"`
  601. }
  602. func (s *CropHint) MarshalJSON() ([]byte, error) {
  603. type NoMethod CropHint
  604. raw := NoMethod(*s)
  605. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  606. }
  607. func (s *CropHint) UnmarshalJSON(data []byte) error {
  608. type NoMethod CropHint
  609. var s1 struct {
  610. Confidence gensupport.JSONFloat64 `json:"confidence"`
  611. ImportanceFraction gensupport.JSONFloat64 `json:"importanceFraction"`
  612. *NoMethod
  613. }
  614. s1.NoMethod = (*NoMethod)(s)
  615. if err := json.Unmarshal(data, &s1); err != nil {
  616. return err
  617. }
  618. s.Confidence = float64(s1.Confidence)
  619. s.ImportanceFraction = float64(s1.ImportanceFraction)
  620. return nil
  621. }
  622. // CropHintsAnnotation: Set of crop hints that are used to generate new
  623. // crops when serving images.
  624. type CropHintsAnnotation struct {
  625. // CropHints: Crop hint results.
  626. CropHints []*CropHint `json:"cropHints,omitempty"`
  627. // ForceSendFields is a list of field names (e.g. "CropHints") to
  628. // unconditionally include in API requests. By default, fields with
  629. // empty values are omitted from API requests. However, any non-pointer,
  630. // non-interface field appearing in ForceSendFields will be sent to the
  631. // server regardless of whether the field is empty or not. This may be
  632. // used to include empty fields in Patch requests.
  633. ForceSendFields []string `json:"-"`
  634. // NullFields is a list of field names (e.g. "CropHints") to include in
  635. // API requests with the JSON null value. By default, fields with empty
  636. // values are omitted from API requests. However, any field with an
  637. // empty value appearing in NullFields will be sent to the server as
  638. // null. It is an error if a field in this list has a non-empty value.
  639. // This may be used to include null fields in Patch requests.
  640. NullFields []string `json:"-"`
  641. }
  642. func (s *CropHintsAnnotation) MarshalJSON() ([]byte, error) {
  643. type NoMethod CropHintsAnnotation
  644. raw := NoMethod(*s)
  645. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  646. }
  647. // DetectedBreak: Detected start or end of a structural component.
  648. type DetectedBreak struct {
  649. // IsPrefix: True if break prepends the element.
  650. IsPrefix bool `json:"isPrefix,omitempty"`
  651. // Type: Detected break type.
  652. //
  653. // Possible values:
  654. // "UNKNOWN" - Unknown break label type.
  655. // "SPACE" - Regular space.
  656. // "SURE_SPACE" - Sure space (very wide).
  657. // "EOL_SURE_SPACE" - Line-wrapping break.
  658. // "HYPHEN" - End-line hyphen that is not present in text; does not
  659. // co-occur with
  660. // `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`.
  661. // "LINE_BREAK" - Line break that ends a paragraph.
  662. Type string `json:"type,omitempty"`
  663. // ForceSendFields is a list of field names (e.g. "IsPrefix") to
  664. // unconditionally include in API requests. By default, fields with
  665. // empty values are omitted from API requests. However, any non-pointer,
  666. // non-interface field appearing in ForceSendFields will be sent to the
  667. // server regardless of whether the field is empty or not. This may be
  668. // used to include empty fields in Patch requests.
  669. ForceSendFields []string `json:"-"`
  670. // NullFields is a list of field names (e.g. "IsPrefix") to include in
  671. // API requests with the JSON null value. By default, fields with empty
  672. // values are omitted from API requests. However, any field with an
  673. // empty value appearing in NullFields will be sent to the server as
  674. // null. It is an error if a field in this list has a non-empty value.
  675. // This may be used to include null fields in Patch requests.
  676. NullFields []string `json:"-"`
  677. }
  678. func (s *DetectedBreak) MarshalJSON() ([]byte, error) {
  679. type NoMethod DetectedBreak
  680. raw := NoMethod(*s)
  681. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  682. }
  683. // DetectedLanguage: Detected language for a structural component.
  684. type DetectedLanguage struct {
  685. // Confidence: Confidence of detected language. Range [0, 1].
  686. Confidence float64 `json:"confidence,omitempty"`
  687. // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn".
  688. // For more
  689. // information,
  690. // see
  691. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  692. LanguageCode string `json:"languageCode,omitempty"`
  693. // ForceSendFields is a list of field names (e.g. "Confidence") to
  694. // unconditionally include in API requests. By default, fields with
  695. // empty values are omitted from API requests. However, any non-pointer,
  696. // non-interface field appearing in ForceSendFields will be sent to the
  697. // server regardless of whether the field is empty or not. This may be
  698. // used to include empty fields in Patch requests.
  699. ForceSendFields []string `json:"-"`
  700. // NullFields is a list of field names (e.g. "Confidence") to include in
  701. // API requests with the JSON null value. By default, fields with empty
  702. // values are omitted from API requests. However, any field with an
  703. // empty value appearing in NullFields will be sent to the server as
  704. // null. It is an error if a field in this list has a non-empty value.
  705. // This may be used to include null fields in Patch requests.
  706. NullFields []string `json:"-"`
  707. }
  708. func (s *DetectedLanguage) MarshalJSON() ([]byte, error) {
  709. type NoMethod DetectedLanguage
  710. raw := NoMethod(*s)
  711. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  712. }
  713. func (s *DetectedLanguage) UnmarshalJSON(data []byte) error {
  714. type NoMethod DetectedLanguage
  715. var s1 struct {
  716. Confidence gensupport.JSONFloat64 `json:"confidence"`
  717. *NoMethod
  718. }
  719. s1.NoMethod = (*NoMethod)(s)
  720. if err := json.Unmarshal(data, &s1); err != nil {
  721. return err
  722. }
  723. s.Confidence = float64(s1.Confidence)
  724. return nil
  725. }
  726. // DominantColorsAnnotation: Set of dominant colors and their
  727. // corresponding scores.
  728. type DominantColorsAnnotation struct {
  729. // Colors: RGB color values with their score and pixel fraction.
  730. Colors []*ColorInfo `json:"colors,omitempty"`
  731. // ForceSendFields is a list of field names (e.g. "Colors") to
  732. // unconditionally include in API requests. By default, fields with
  733. // empty values are omitted from API requests. However, any non-pointer,
  734. // non-interface field appearing in ForceSendFields will be sent to the
  735. // server regardless of whether the field is empty or not. This may be
  736. // used to include empty fields in Patch requests.
  737. ForceSendFields []string `json:"-"`
  738. // NullFields is a list of field names (e.g. "Colors") to include in API
  739. // requests with the JSON null value. By default, fields with empty
  740. // values are omitted from API requests. However, any field with an
  741. // empty value appearing in NullFields will be sent to the server as
  742. // null. It is an error if a field in this list has a non-empty value.
  743. // This may be used to include null fields in Patch requests.
  744. NullFields []string `json:"-"`
  745. }
  746. func (s *DominantColorsAnnotation) MarshalJSON() ([]byte, error) {
  747. type NoMethod DominantColorsAnnotation
  748. raw := NoMethod(*s)
  749. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  750. }
  751. // EntityAnnotation: Set of detected entity features.
  752. type EntityAnnotation struct {
  753. // BoundingPoly: Image region to which this entity belongs. Not
  754. // produced
  755. // for `LABEL_DETECTION` features.
  756. BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"`
  757. // Confidence: **Deprecated. Use `score` instead.**
  758. // The accuracy of the entity detection in an image.
  759. // For example, for an image in which the "Eiffel Tower" entity is
  760. // detected,
  761. // this field represents the confidence that there is a tower in the
  762. // query
  763. // image. Range [0, 1].
  764. Confidence float64 `json:"confidence,omitempty"`
  765. // Description: Entity textual description, expressed in its `locale`
  766. // language.
  767. Description string `json:"description,omitempty"`
  768. // Locale: The language code for the locale in which the entity
  769. // textual
  770. // `description` is expressed.
  771. Locale string `json:"locale,omitempty"`
  772. // Locations: The location information for the detected entity.
  773. // Multiple
  774. // `LocationInfo` elements can be present because one location
  775. // may
  776. // indicate the location of the scene in the image, and another
  777. // location
  778. // may indicate the location of the place where the image was
  779. // taken.
  780. // Location information is usually present for landmarks.
  781. Locations []*LocationInfo `json:"locations,omitempty"`
  782. // Mid: Opaque entity ID. Some IDs may be available in
  783. // [Google Knowledge Graph
  784. // Search
  785. // API](https://developers.google.com/knowledge-graph/).
  786. Mid string `json:"mid,omitempty"`
  787. // Properties: Some entities may have optional user-supplied `Property`
  788. // (name/value)
  789. // fields, such a score or string that qualifies the entity.
  790. Properties []*Property `json:"properties,omitempty"`
  791. // Score: Overall score of the result. Range [0, 1].
  792. Score float64 `json:"score,omitempty"`
  793. // Topicality: The relevancy of the ICA (Image Content Annotation) label
  794. // to the
  795. // image. For example, the relevancy of "tower" is likely higher to an
  796. // image
  797. // containing the detected "Eiffel Tower" than to an image containing
  798. // a
  799. // detected distant towering building, even though the confidence
  800. // that
  801. // there is a tower in each image may be the same. Range [0, 1].
  802. Topicality float64 `json:"topicality,omitempty"`
  803. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  804. // unconditionally include in API requests. By default, fields with
  805. // empty values are omitted from API requests. However, any non-pointer,
  806. // non-interface field appearing in ForceSendFields will be sent to the
  807. // server regardless of whether the field is empty or not. This may be
  808. // used to include empty fields in Patch requests.
  809. ForceSendFields []string `json:"-"`
  810. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  811. // in API requests with the JSON null value. By default, fields with
  812. // empty values are omitted from API requests. However, any field with
  813. // an empty value appearing in NullFields will be sent to the server as
  814. // null. It is an error if a field in this list has a non-empty value.
  815. // This may be used to include null fields in Patch requests.
  816. NullFields []string `json:"-"`
  817. }
  818. func (s *EntityAnnotation) MarshalJSON() ([]byte, error) {
  819. type NoMethod EntityAnnotation
  820. raw := NoMethod(*s)
  821. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  822. }
  823. func (s *EntityAnnotation) UnmarshalJSON(data []byte) error {
  824. type NoMethod EntityAnnotation
  825. var s1 struct {
  826. Confidence gensupport.JSONFloat64 `json:"confidence"`
  827. Score gensupport.JSONFloat64 `json:"score"`
  828. Topicality gensupport.JSONFloat64 `json:"topicality"`
  829. *NoMethod
  830. }
  831. s1.NoMethod = (*NoMethod)(s)
  832. if err := json.Unmarshal(data, &s1); err != nil {
  833. return err
  834. }
  835. s.Confidence = float64(s1.Confidence)
  836. s.Score = float64(s1.Score)
  837. s.Topicality = float64(s1.Topicality)
  838. return nil
  839. }
  840. // FaceAnnotation: A face annotation object contains the results of face
  841. // detection.
  842. type FaceAnnotation struct {
  843. // AngerLikelihood: Anger likelihood.
  844. //
  845. // Possible values:
  846. // "UNKNOWN" - Unknown likelihood.
  847. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  848. // specified vertical.
  849. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  850. // vertical.
  851. // "POSSIBLE" - It is possible that the image belongs to the specified
  852. // vertical.
  853. // "LIKELY" - It is likely that the image belongs to the specified
  854. // vertical.
  855. // "VERY_LIKELY" - It is very likely that the image belongs to the
  856. // specified vertical.
  857. AngerLikelihood string `json:"angerLikelihood,omitempty"`
  858. // BlurredLikelihood: Blurred likelihood.
  859. //
  860. // Possible values:
  861. // "UNKNOWN" - Unknown likelihood.
  862. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  863. // specified vertical.
  864. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  865. // vertical.
  866. // "POSSIBLE" - It is possible that the image belongs to the specified
  867. // vertical.
  868. // "LIKELY" - It is likely that the image belongs to the specified
  869. // vertical.
  870. // "VERY_LIKELY" - It is very likely that the image belongs to the
  871. // specified vertical.
  872. BlurredLikelihood string `json:"blurredLikelihood,omitempty"`
  873. // BoundingPoly: The bounding polygon around the face. The coordinates
  874. // of the bounding box
  875. // are in the original image's scale, as returned in `ImageParams`.
  876. // The bounding box is computed to "frame" the face in accordance with
  877. // human
  878. // expectations. It is based on the landmarker results.
  879. // Note that one or more x and/or y coordinates may not be generated in
  880. // the
  881. // `BoundingPoly` (the polygon will be unbounded) if only a partial
  882. // face
  883. // appears in the image to be annotated.
  884. BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"`
  885. // DetectionConfidence: Detection confidence. Range [0, 1].
  886. DetectionConfidence float64 `json:"detectionConfidence,omitempty"`
  887. // FdBoundingPoly: The `fd_bounding_poly` bounding polygon is tighter
  888. // than the
  889. // `boundingPoly`, and encloses only the skin part of the face.
  890. // Typically, it
  891. // is used to eliminate the face from any image analysis that detects
  892. // the
  893. // "amount of skin" visible in an image. It is not based on
  894. // the
  895. // landmarker results, only on the initial face detection, hence
  896. // the <code>fd</code> (face detection) prefix.
  897. FdBoundingPoly *BoundingPoly `json:"fdBoundingPoly,omitempty"`
  898. // HeadwearLikelihood: Headwear likelihood.
  899. //
  900. // Possible values:
  901. // "UNKNOWN" - Unknown likelihood.
  902. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  903. // specified vertical.
  904. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  905. // vertical.
  906. // "POSSIBLE" - It is possible that the image belongs to the specified
  907. // vertical.
  908. // "LIKELY" - It is likely that the image belongs to the specified
  909. // vertical.
  910. // "VERY_LIKELY" - It is very likely that the image belongs to the
  911. // specified vertical.
  912. HeadwearLikelihood string `json:"headwearLikelihood,omitempty"`
  913. // JoyLikelihood: Joy likelihood.
  914. //
  915. // Possible values:
  916. // "UNKNOWN" - Unknown likelihood.
  917. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  918. // specified vertical.
  919. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  920. // vertical.
  921. // "POSSIBLE" - It is possible that the image belongs to the specified
  922. // vertical.
  923. // "LIKELY" - It is likely that the image belongs to the specified
  924. // vertical.
  925. // "VERY_LIKELY" - It is very likely that the image belongs to the
  926. // specified vertical.
  927. JoyLikelihood string `json:"joyLikelihood,omitempty"`
  928. // LandmarkingConfidence: Face landmarking confidence. Range [0, 1].
  929. LandmarkingConfidence float64 `json:"landmarkingConfidence,omitempty"`
  930. // Landmarks: Detected face landmarks.
  931. Landmarks []*Landmark `json:"landmarks,omitempty"`
  932. // PanAngle: Yaw angle, which indicates the leftward/rightward angle
  933. // that the face is
  934. // pointing relative to the vertical plane perpendicular to the image.
  935. // Range
  936. // [-180,180].
  937. PanAngle float64 `json:"panAngle,omitempty"`
  938. // RollAngle: Roll angle, which indicates the amount of
  939. // clockwise/anti-clockwise rotation
  940. // of the face relative to the image vertical about the axis
  941. // perpendicular to
  942. // the face. Range [-180,180].
  943. RollAngle float64 `json:"rollAngle,omitempty"`
  944. // SorrowLikelihood: Sorrow likelihood.
  945. //
  946. // Possible values:
  947. // "UNKNOWN" - Unknown likelihood.
  948. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  949. // specified vertical.
  950. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  951. // vertical.
  952. // "POSSIBLE" - It is possible that the image belongs to the specified
  953. // vertical.
  954. // "LIKELY" - It is likely that the image belongs to the specified
  955. // vertical.
  956. // "VERY_LIKELY" - It is very likely that the image belongs to the
  957. // specified vertical.
  958. SorrowLikelihood string `json:"sorrowLikelihood,omitempty"`
  959. // SurpriseLikelihood: Surprise likelihood.
  960. //
  961. // Possible values:
  962. // "UNKNOWN" - Unknown likelihood.
  963. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  964. // specified vertical.
  965. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  966. // vertical.
  967. // "POSSIBLE" - It is possible that the image belongs to the specified
  968. // vertical.
  969. // "LIKELY" - It is likely that the image belongs to the specified
  970. // vertical.
  971. // "VERY_LIKELY" - It is very likely that the image belongs to the
  972. // specified vertical.
  973. SurpriseLikelihood string `json:"surpriseLikelihood,omitempty"`
  974. // TiltAngle: Pitch angle, which indicates the upwards/downwards angle
  975. // that the face is
  976. // pointing relative to the image's horizontal plane. Range [-180,180].
  977. TiltAngle float64 `json:"tiltAngle,omitempty"`
  978. // UnderExposedLikelihood: Under-exposed likelihood.
  979. //
  980. // Possible values:
  981. // "UNKNOWN" - Unknown likelihood.
  982. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  983. // specified vertical.
  984. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  985. // vertical.
  986. // "POSSIBLE" - It is possible that the image belongs to the specified
  987. // vertical.
  988. // "LIKELY" - It is likely that the image belongs to the specified
  989. // vertical.
  990. // "VERY_LIKELY" - It is very likely that the image belongs to the
  991. // specified vertical.
  992. UnderExposedLikelihood string `json:"underExposedLikelihood,omitempty"`
  993. // ForceSendFields is a list of field names (e.g. "AngerLikelihood") to
  994. // unconditionally include in API requests. By default, fields with
  995. // empty values are omitted from API requests. However, any non-pointer,
  996. // non-interface field appearing in ForceSendFields will be sent to the
  997. // server regardless of whether the field is empty or not. This may be
  998. // used to include empty fields in Patch requests.
  999. ForceSendFields []string `json:"-"`
  1000. // NullFields is a list of field names (e.g. "AngerLikelihood") to
  1001. // include in API requests with the JSON null value. By default, fields
  1002. // with empty values are omitted from API requests. However, any field
  1003. // with an empty value appearing in NullFields will be sent to the
  1004. // server as null. It is an error if a field in this list has a
  1005. // non-empty value. This may be used to include null fields in Patch
  1006. // requests.
  1007. NullFields []string `json:"-"`
  1008. }
  1009. func (s *FaceAnnotation) MarshalJSON() ([]byte, error) {
  1010. type NoMethod FaceAnnotation
  1011. raw := NoMethod(*s)
  1012. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1013. }
  1014. func (s *FaceAnnotation) UnmarshalJSON(data []byte) error {
  1015. type NoMethod FaceAnnotation
  1016. var s1 struct {
  1017. DetectionConfidence gensupport.JSONFloat64 `json:"detectionConfidence"`
  1018. LandmarkingConfidence gensupport.JSONFloat64 `json:"landmarkingConfidence"`
  1019. PanAngle gensupport.JSONFloat64 `json:"panAngle"`
  1020. RollAngle gensupport.JSONFloat64 `json:"rollAngle"`
  1021. TiltAngle gensupport.JSONFloat64 `json:"tiltAngle"`
  1022. *NoMethod
  1023. }
  1024. s1.NoMethod = (*NoMethod)(s)
  1025. if err := json.Unmarshal(data, &s1); err != nil {
  1026. return err
  1027. }
  1028. s.DetectionConfidence = float64(s1.DetectionConfidence)
  1029. s.LandmarkingConfidence = float64(s1.LandmarkingConfidence)
  1030. s.PanAngle = float64(s1.PanAngle)
  1031. s.RollAngle = float64(s1.RollAngle)
  1032. s.TiltAngle = float64(s1.TiltAngle)
  1033. return nil
  1034. }
  1035. // GcsDestination: The Google Cloud Storage location where the output
  1036. // will be written to.
  1037. type GcsDestination struct {
  1038. // Uri: Google Cloud Storage URI where the results will be stored.
  1039. // Results will
  1040. // be in JSON format and preceded by its corresponding input URI. This
  1041. // field
  1042. // can either represent a single file, or a prefix for multiple
  1043. // outputs.
  1044. // Prefixes must end in a `/`.
  1045. //
  1046. // Examples:
  1047. //
  1048. // * File: gs://bucket-name/filename.json
  1049. // * Prefix: gs://bucket-name/prefix/here/
  1050. // * File: gs://bucket-name/prefix/here
  1051. //
  1052. // If multiple outputs, each response is still AnnotateFileResponse,
  1053. // each of
  1054. // which contains some subset of the full list of
  1055. // AnnotateImageResponse.
  1056. // Multiple outputs can happen if, for example, the output JSON is too
  1057. // large
  1058. // and overflows into multiple sharded files.
  1059. Uri string `json:"uri,omitempty"`
  1060. // ForceSendFields is a list of field names (e.g. "Uri") to
  1061. // unconditionally include in API requests. By default, fields with
  1062. // empty values are omitted from API requests. However, any non-pointer,
  1063. // non-interface field appearing in ForceSendFields will be sent to the
  1064. // server regardless of whether the field is empty or not. This may be
  1065. // used to include empty fields in Patch requests.
  1066. ForceSendFields []string `json:"-"`
  1067. // NullFields is a list of field names (e.g. "Uri") to include in API
  1068. // requests with the JSON null value. By default, fields with empty
  1069. // values are omitted from API requests. However, any field with an
  1070. // empty value appearing in NullFields will be sent to the server as
  1071. // null. It is an error if a field in this list has a non-empty value.
  1072. // This may be used to include null fields in Patch requests.
  1073. NullFields []string `json:"-"`
  1074. }
  1075. func (s *GcsDestination) MarshalJSON() ([]byte, error) {
  1076. type NoMethod GcsDestination
  1077. raw := NoMethod(*s)
  1078. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1079. }
  1080. // GcsSource: The Google Cloud Storage location where the input will be
  1081. // read from.
  1082. type GcsSource struct {
  1083. // Uri: Google Cloud Storage URI for the input file. This must only be
  1084. // a
  1085. // Google Cloud Storage object. Wildcards are not currently supported.
  1086. Uri string `json:"uri,omitempty"`
  1087. // ForceSendFields is a list of field names (e.g. "Uri") to
  1088. // unconditionally include in API requests. By default, fields with
  1089. // empty values are omitted from API requests. However, any non-pointer,
  1090. // non-interface field appearing in ForceSendFields will be sent to the
  1091. // server regardless of whether the field is empty or not. This may be
  1092. // used to include empty fields in Patch requests.
  1093. ForceSendFields []string `json:"-"`
  1094. // NullFields is a list of field names (e.g. "Uri") to include in API
  1095. // requests with the JSON null value. By default, fields with empty
  1096. // values are omitted from API requests. However, any field with an
  1097. // empty value appearing in NullFields will be sent to the server as
  1098. // null. It is an error if a field in this list has a non-empty value.
  1099. // This may be used to include null fields in Patch requests.
  1100. NullFields []string `json:"-"`
  1101. }
  1102. func (s *GcsSource) MarshalJSON() ([]byte, error) {
  1103. type NoMethod GcsSource
  1104. raw := NoMethod(*s)
  1105. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1106. }
  1107. // GoogleCloudVisionV1p2beta1AnnotateFileResponse: Response to a single
  1108. // file annotation request. A file may contain one or more
  1109. // images, which individually have their own responses.
  1110. type GoogleCloudVisionV1p2beta1AnnotateFileResponse struct {
  1111. // InputConfig: Information about the file for which this response is
  1112. // generated.
  1113. InputConfig *GoogleCloudVisionV1p2beta1InputConfig `json:"inputConfig,omitempty"`
  1114. // Responses: Individual responses to images found within the file.
  1115. Responses []*GoogleCloudVisionV1p2beta1AnnotateImageResponse `json:"responses,omitempty"`
  1116. // ForceSendFields is a list of field names (e.g. "InputConfig") to
  1117. // unconditionally include in API requests. By default, fields with
  1118. // empty values are omitted from API requests. However, any non-pointer,
  1119. // non-interface field appearing in ForceSendFields will be sent to the
  1120. // server regardless of whether the field is empty or not. This may be
  1121. // used to include empty fields in Patch requests.
  1122. ForceSendFields []string `json:"-"`
  1123. // NullFields is a list of field names (e.g. "InputConfig") to include
  1124. // in API requests with the JSON null value. By default, fields with
  1125. // empty values are omitted from API requests. However, any field with
  1126. // an empty value appearing in NullFields will be sent to the server as
  1127. // null. It is an error if a field in this list has a non-empty value.
  1128. // This may be used to include null fields in Patch requests.
  1129. NullFields []string `json:"-"`
  1130. }
  1131. func (s *GoogleCloudVisionV1p2beta1AnnotateFileResponse) MarshalJSON() ([]byte, error) {
  1132. type NoMethod GoogleCloudVisionV1p2beta1AnnotateFileResponse
  1133. raw := NoMethod(*s)
  1134. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1135. }
  1136. // GoogleCloudVisionV1p2beta1AnnotateImageRequest: Request for
  1137. // performing Google Cloud Vision API tasks over a user-provided
  1138. // image, with user-requested features.
  1139. type GoogleCloudVisionV1p2beta1AnnotateImageRequest struct {
  1140. // Features: Requested features.
  1141. Features []*GoogleCloudVisionV1p2beta1Feature `json:"features,omitempty"`
  1142. // Image: The image to be processed.
  1143. Image *GoogleCloudVisionV1p2beta1Image `json:"image,omitempty"`
  1144. // ImageContext: Additional context that may accompany the image.
  1145. ImageContext *GoogleCloudVisionV1p2beta1ImageContext `json:"imageContext,omitempty"`
  1146. // ForceSendFields is a list of field names (e.g. "Features") to
  1147. // unconditionally include in API requests. By default, fields with
  1148. // empty values are omitted from API requests. However, any non-pointer,
  1149. // non-interface field appearing in ForceSendFields will be sent to the
  1150. // server regardless of whether the field is empty or not. This may be
  1151. // used to include empty fields in Patch requests.
  1152. ForceSendFields []string `json:"-"`
  1153. // NullFields is a list of field names (e.g. "Features") to include in
  1154. // API requests with the JSON null value. By default, fields with empty
  1155. // values are omitted from API requests. However, any field with an
  1156. // empty value appearing in NullFields will be sent to the server as
  1157. // null. It is an error if a field in this list has a non-empty value.
  1158. // This may be used to include null fields in Patch requests.
  1159. NullFields []string `json:"-"`
  1160. }
  1161. func (s *GoogleCloudVisionV1p2beta1AnnotateImageRequest) MarshalJSON() ([]byte, error) {
  1162. type NoMethod GoogleCloudVisionV1p2beta1AnnotateImageRequest
  1163. raw := NoMethod(*s)
  1164. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1165. }
  1166. // GoogleCloudVisionV1p2beta1AnnotateImageResponse: Response to an image
  1167. // annotation request.
  1168. type GoogleCloudVisionV1p2beta1AnnotateImageResponse struct {
  1169. // Context: If present, contextual information is needed to understand
  1170. // where this image
  1171. // comes from.
  1172. Context *GoogleCloudVisionV1p2beta1ImageAnnotationContext `json:"context,omitempty"`
  1173. // CropHintsAnnotation: If present, crop hints have completed
  1174. // successfully.
  1175. CropHintsAnnotation *GoogleCloudVisionV1p2beta1CropHintsAnnotation `json:"cropHintsAnnotation,omitempty"`
  1176. // Error: If set, represents the error message for the operation.
  1177. // Note that filled-in image annotations are guaranteed to be
  1178. // correct, even when `error` is set.
  1179. Error *Status `json:"error,omitempty"`
  1180. // FaceAnnotations: If present, face detection has completed
  1181. // successfully.
  1182. FaceAnnotations []*GoogleCloudVisionV1p2beta1FaceAnnotation `json:"faceAnnotations,omitempty"`
  1183. // FullTextAnnotation: If present, text (OCR) detection or document
  1184. // (OCR) text detection has
  1185. // completed successfully.
  1186. // This annotation provides the structural hierarchy for the OCR
  1187. // detected
  1188. // text.
  1189. FullTextAnnotation *GoogleCloudVisionV1p2beta1TextAnnotation `json:"fullTextAnnotation,omitempty"`
  1190. // ImagePropertiesAnnotation: If present, image properties were
  1191. // extracted successfully.
  1192. ImagePropertiesAnnotation *GoogleCloudVisionV1p2beta1ImageProperties `json:"imagePropertiesAnnotation,omitempty"`
  1193. // LabelAnnotations: If present, label detection has completed
  1194. // successfully.
  1195. LabelAnnotations []*GoogleCloudVisionV1p2beta1EntityAnnotation `json:"labelAnnotations,omitempty"`
  1196. // LandmarkAnnotations: If present, landmark detection has completed
  1197. // successfully.
  1198. LandmarkAnnotations []*GoogleCloudVisionV1p2beta1EntityAnnotation `json:"landmarkAnnotations,omitempty"`
  1199. // LogoAnnotations: If present, logo detection has completed
  1200. // successfully.
  1201. LogoAnnotations []*GoogleCloudVisionV1p2beta1EntityAnnotation `json:"logoAnnotations,omitempty"`
  1202. // SafeSearchAnnotation: If present, safe-search annotation has
  1203. // completed successfully.
  1204. SafeSearchAnnotation *GoogleCloudVisionV1p2beta1SafeSearchAnnotation `json:"safeSearchAnnotation,omitempty"`
  1205. // TextAnnotations: If present, text (OCR) detection has completed
  1206. // successfully.
  1207. TextAnnotations []*GoogleCloudVisionV1p2beta1EntityAnnotation `json:"textAnnotations,omitempty"`
  1208. // WebDetection: If present, web detection has completed successfully.
  1209. WebDetection *GoogleCloudVisionV1p2beta1WebDetection `json:"webDetection,omitempty"`
  1210. // ForceSendFields is a list of field names (e.g. "Context") to
  1211. // unconditionally include in API requests. By default, fields with
  1212. // empty values are omitted from API requests. However, any non-pointer,
  1213. // non-interface field appearing in ForceSendFields will be sent to the
  1214. // server regardless of whether the field is empty or not. This may be
  1215. // used to include empty fields in Patch requests.
  1216. ForceSendFields []string `json:"-"`
  1217. // NullFields is a list of field names (e.g. "Context") to include in
  1218. // API requests with the JSON null value. By default, fields with empty
  1219. // values are omitted from API requests. However, any field with an
  1220. // empty value appearing in NullFields will be sent to the server as
  1221. // null. It is an error if a field in this list has a non-empty value.
  1222. // This may be used to include null fields in Patch requests.
  1223. NullFields []string `json:"-"`
  1224. }
  1225. func (s *GoogleCloudVisionV1p2beta1AnnotateImageResponse) MarshalJSON() ([]byte, error) {
  1226. type NoMethod GoogleCloudVisionV1p2beta1AnnotateImageResponse
  1227. raw := NoMethod(*s)
  1228. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1229. }
  1230. // GoogleCloudVisionV1p2beta1AsyncAnnotateFileRequest: An offline file
  1231. // annotation request.
  1232. type GoogleCloudVisionV1p2beta1AsyncAnnotateFileRequest struct {
  1233. // Features: Required. Requested features.
  1234. Features []*GoogleCloudVisionV1p2beta1Feature `json:"features,omitempty"`
  1235. // ImageContext: Additional context that may accompany the image(s) in
  1236. // the file.
  1237. ImageContext *GoogleCloudVisionV1p2beta1ImageContext `json:"imageContext,omitempty"`
  1238. // InputConfig: Required. Information about the input file.
  1239. InputConfig *GoogleCloudVisionV1p2beta1InputConfig `json:"inputConfig,omitempty"`
  1240. // OutputConfig: Required. The desired output location and metadata
  1241. // (e.g. format).
  1242. OutputConfig *GoogleCloudVisionV1p2beta1OutputConfig `json:"outputConfig,omitempty"`
  1243. // ForceSendFields is a list of field names (e.g. "Features") to
  1244. // unconditionally include in API requests. By default, fields with
  1245. // empty values are omitted from API requests. However, any non-pointer,
  1246. // non-interface field appearing in ForceSendFields will be sent to the
  1247. // server regardless of whether the field is empty or not. This may be
  1248. // used to include empty fields in Patch requests.
  1249. ForceSendFields []string `json:"-"`
  1250. // NullFields is a list of field names (e.g. "Features") to include in
  1251. // API requests with the JSON null value. By default, fields with empty
  1252. // values are omitted from API requests. However, any field with an
  1253. // empty value appearing in NullFields will be sent to the server as
  1254. // null. It is an error if a field in this list has a non-empty value.
  1255. // This may be used to include null fields in Patch requests.
  1256. NullFields []string `json:"-"`
  1257. }
  1258. func (s *GoogleCloudVisionV1p2beta1AsyncAnnotateFileRequest) MarshalJSON() ([]byte, error) {
  1259. type NoMethod GoogleCloudVisionV1p2beta1AsyncAnnotateFileRequest
  1260. raw := NoMethod(*s)
  1261. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1262. }
  1263. // GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse: The response for
  1264. // a single offline file annotation request.
  1265. type GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse struct {
  1266. // OutputConfig: The output location and metadata from
  1267. // AsyncAnnotateFileRequest.
  1268. OutputConfig *GoogleCloudVisionV1p2beta1OutputConfig `json:"outputConfig,omitempty"`
  1269. // ForceSendFields is a list of field names (e.g. "OutputConfig") to
  1270. // unconditionally include in API requests. By default, fields with
  1271. // empty values are omitted from API requests. However, any non-pointer,
  1272. // non-interface field appearing in ForceSendFields will be sent to the
  1273. // server regardless of whether the field is empty or not. This may be
  1274. // used to include empty fields in Patch requests.
  1275. ForceSendFields []string `json:"-"`
  1276. // NullFields is a list of field names (e.g. "OutputConfig") to include
  1277. // in API requests with the JSON null value. By default, fields with
  1278. // empty values are omitted from API requests. However, any field with
  1279. // an empty value appearing in NullFields will be sent to the server as
  1280. // null. It is an error if a field in this list has a non-empty value.
  1281. // This may be used to include null fields in Patch requests.
  1282. NullFields []string `json:"-"`
  1283. }
  1284. func (s *GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse) MarshalJSON() ([]byte, error) {
  1285. type NoMethod GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse
  1286. raw := NoMethod(*s)
  1287. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1288. }
  1289. // GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesRequest: Multiple
  1290. // async file annotation requests are batched into a single
  1291. // service
  1292. // call.
  1293. type GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesRequest struct {
  1294. // Requests: Individual async file annotation requests for this batch.
  1295. Requests []*GoogleCloudVisionV1p2beta1AsyncAnnotateFileRequest `json:"requests,omitempty"`
  1296. // ForceSendFields is a list of field names (e.g. "Requests") to
  1297. // unconditionally include in API requests. By default, fields with
  1298. // empty values are omitted from API requests. However, any non-pointer,
  1299. // non-interface field appearing in ForceSendFields will be sent to the
  1300. // server regardless of whether the field is empty or not. This may be
  1301. // used to include empty fields in Patch requests.
  1302. ForceSendFields []string `json:"-"`
  1303. // NullFields is a list of field names (e.g. "Requests") to include in
  1304. // API requests with the JSON null value. By default, fields with empty
  1305. // values are omitted from API requests. However, any field with an
  1306. // empty value appearing in NullFields will be sent to the server as
  1307. // null. It is an error if a field in this list has a non-empty value.
  1308. // This may be used to include null fields in Patch requests.
  1309. NullFields []string `json:"-"`
  1310. }
  1311. func (s *GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesRequest) MarshalJSON() ([]byte, error) {
  1312. type NoMethod GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesRequest
  1313. raw := NoMethod(*s)
  1314. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1315. }
  1316. // GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse: Response
  1317. // to an async batch file annotation request.
  1318. type GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse struct {
  1319. // Responses: The list of file annotation responses, one for each
  1320. // request in
  1321. // AsyncBatchAnnotateFilesRequest.
  1322. Responses []*GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse `json:"responses,omitempty"`
  1323. // ForceSendFields is a list of field names (e.g. "Responses") to
  1324. // unconditionally include in API requests. By default, fields with
  1325. // empty values are omitted from API requests. However, any non-pointer,
  1326. // non-interface field appearing in ForceSendFields will be sent to the
  1327. // server regardless of whether the field is empty or not. This may be
  1328. // used to include empty fields in Patch requests.
  1329. ForceSendFields []string `json:"-"`
  1330. // NullFields is a list of field names (e.g. "Responses") to include in
  1331. // API requests with the JSON null value. By default, fields with empty
  1332. // values are omitted from API requests. However, any field with an
  1333. // empty value appearing in NullFields will be sent to the server as
  1334. // null. It is an error if a field in this list has a non-empty value.
  1335. // This may be used to include null fields in Patch requests.
  1336. NullFields []string `json:"-"`
  1337. }
  1338. func (s *GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) {
  1339. type NoMethod GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse
  1340. raw := NoMethod(*s)
  1341. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1342. }
  1343. // GoogleCloudVisionV1p2beta1BatchAnnotateImagesRequest: Multiple image
  1344. // annotation requests are batched into a single service call.
  1345. type GoogleCloudVisionV1p2beta1BatchAnnotateImagesRequest struct {
  1346. // Requests: Individual image annotation requests for this batch.
  1347. Requests []*GoogleCloudVisionV1p2beta1AnnotateImageRequest `json:"requests,omitempty"`
  1348. // ForceSendFields is a list of field names (e.g. "Requests") to
  1349. // unconditionally include in API requests. By default, fields with
  1350. // empty values are omitted from API requests. However, any non-pointer,
  1351. // non-interface field appearing in ForceSendFields will be sent to the
  1352. // server regardless of whether the field is empty or not. This may be
  1353. // used to include empty fields in Patch requests.
  1354. ForceSendFields []string `json:"-"`
  1355. // NullFields is a list of field names (e.g. "Requests") to include in
  1356. // API requests with the JSON null value. By default, fields with empty
  1357. // values are omitted from API requests. However, any field with an
  1358. // empty value appearing in NullFields will be sent to the server as
  1359. // null. It is an error if a field in this list has a non-empty value.
  1360. // This may be used to include null fields in Patch requests.
  1361. NullFields []string `json:"-"`
  1362. }
  1363. func (s *GoogleCloudVisionV1p2beta1BatchAnnotateImagesRequest) MarshalJSON() ([]byte, error) {
  1364. type NoMethod GoogleCloudVisionV1p2beta1BatchAnnotateImagesRequest
  1365. raw := NoMethod(*s)
  1366. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1367. }
  1368. // GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse: Response to a
  1369. // batch image annotation request.
  1370. type GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse struct {
  1371. // Responses: Individual responses to image annotation requests within
  1372. // the batch.
  1373. Responses []*GoogleCloudVisionV1p2beta1AnnotateImageResponse `json:"responses,omitempty"`
  1374. // ServerResponse contains the HTTP response code and headers from the
  1375. // server.
  1376. googleapi.ServerResponse `json:"-"`
  1377. // ForceSendFields is a list of field names (e.g. "Responses") to
  1378. // unconditionally include in API requests. By default, fields with
  1379. // empty values are omitted from API requests. However, any non-pointer,
  1380. // non-interface field appearing in ForceSendFields will be sent to the
  1381. // server regardless of whether the field is empty or not. This may be
  1382. // used to include empty fields in Patch requests.
  1383. ForceSendFields []string `json:"-"`
  1384. // NullFields is a list of field names (e.g. "Responses") to include in
  1385. // API requests with the JSON null value. By default, fields with empty
  1386. // values are omitted from API requests. However, any field with an
  1387. // empty value appearing in NullFields will be sent to the server as
  1388. // null. It is an error if a field in this list has a non-empty value.
  1389. // This may be used to include null fields in Patch requests.
  1390. NullFields []string `json:"-"`
  1391. }
  1392. func (s *GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse) MarshalJSON() ([]byte, error) {
  1393. type NoMethod GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse
  1394. raw := NoMethod(*s)
  1395. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1396. }
  1397. // GoogleCloudVisionV1p2beta1Block: Logical element on the page.
  1398. type GoogleCloudVisionV1p2beta1Block struct {
  1399. // BlockType: Detected block type (text, image etc) for this block.
  1400. //
  1401. // Possible values:
  1402. // "UNKNOWN" - Unknown block type.
  1403. // "TEXT" - Regular text block.
  1404. // "TABLE" - Table block.
  1405. // "PICTURE" - Image block.
  1406. // "RULER" - Horizontal/vertical line box.
  1407. // "BARCODE" - Barcode block.
  1408. BlockType string `json:"blockType,omitempty"`
  1409. // BoundingBox: The bounding box for the block.
  1410. // The vertices are in the order of top-left, top-right,
  1411. // bottom-right,
  1412. // bottom-left. When a rotation of the bounding box is detected the
  1413. // rotation
  1414. // is represented as around the top-left corner as defined when the text
  1415. // is
  1416. // read in the 'natural' orientation.
  1417. // For example:
  1418. //
  1419. // * when the text is horizontal it might look like:
  1420. //
  1421. // 0----1
  1422. // | |
  1423. // 3----2
  1424. //
  1425. // * when it's rotated 180 degrees around the top-left corner it
  1426. // becomes:
  1427. //
  1428. // 2----3
  1429. // | |
  1430. // 1----0
  1431. //
  1432. // and the vertice order will still be (0, 1, 2, 3).
  1433. BoundingBox *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingBox,omitempty"`
  1434. // Confidence: Confidence of the OCR results on the block. Range [0, 1].
  1435. Confidence float64 `json:"confidence,omitempty"`
  1436. // Paragraphs: List of paragraphs in this block (if this blocks is of
  1437. // type text).
  1438. Paragraphs []*GoogleCloudVisionV1p2beta1Paragraph `json:"paragraphs,omitempty"`
  1439. // Property: Additional information detected for the block.
  1440. Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"`
  1441. // ForceSendFields is a list of field names (e.g. "BlockType") to
  1442. // unconditionally include in API requests. By default, fields with
  1443. // empty values are omitted from API requests. However, any non-pointer,
  1444. // non-interface field appearing in ForceSendFields will be sent to the
  1445. // server regardless of whether the field is empty or not. This may be
  1446. // used to include empty fields in Patch requests.
  1447. ForceSendFields []string `json:"-"`
  1448. // NullFields is a list of field names (e.g. "BlockType") to include in
  1449. // API requests with the JSON null value. By default, fields with empty
  1450. // values are omitted from API requests. However, any field with an
  1451. // empty value appearing in NullFields will be sent to the server as
  1452. // null. It is an error if a field in this list has a non-empty value.
  1453. // This may be used to include null fields in Patch requests.
  1454. NullFields []string `json:"-"`
  1455. }
  1456. func (s *GoogleCloudVisionV1p2beta1Block) MarshalJSON() ([]byte, error) {
  1457. type NoMethod GoogleCloudVisionV1p2beta1Block
  1458. raw := NoMethod(*s)
  1459. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1460. }
  1461. func (s *GoogleCloudVisionV1p2beta1Block) UnmarshalJSON(data []byte) error {
  1462. type NoMethod GoogleCloudVisionV1p2beta1Block
  1463. var s1 struct {
  1464. Confidence gensupport.JSONFloat64 `json:"confidence"`
  1465. *NoMethod
  1466. }
  1467. s1.NoMethod = (*NoMethod)(s)
  1468. if err := json.Unmarshal(data, &s1); err != nil {
  1469. return err
  1470. }
  1471. s.Confidence = float64(s1.Confidence)
  1472. return nil
  1473. }
  1474. // GoogleCloudVisionV1p2beta1BoundingPoly: A bounding polygon for the
  1475. // detected image annotation.
  1476. type GoogleCloudVisionV1p2beta1BoundingPoly struct {
  1477. // NormalizedVertices: The bounding polygon normalized vertices.
  1478. NormalizedVertices []*GoogleCloudVisionV1p2beta1NormalizedVertex `json:"normalizedVertices,omitempty"`
  1479. // Vertices: The bounding polygon vertices.
  1480. Vertices []*GoogleCloudVisionV1p2beta1Vertex `json:"vertices,omitempty"`
  1481. // ForceSendFields is a list of field names (e.g. "NormalizedVertices")
  1482. // to unconditionally include in API requests. By default, fields with
  1483. // empty values are omitted from API requests. However, any non-pointer,
  1484. // non-interface field appearing in ForceSendFields will be sent to the
  1485. // server regardless of whether the field is empty or not. This may be
  1486. // used to include empty fields in Patch requests.
  1487. ForceSendFields []string `json:"-"`
  1488. // NullFields is a list of field names (e.g. "NormalizedVertices") to
  1489. // include in API requests with the JSON null value. By default, fields
  1490. // with empty values are omitted from API requests. However, any field
  1491. // with an empty value appearing in NullFields will be sent to the
  1492. // server as null. It is an error if a field in this list has a
  1493. // non-empty value. This may be used to include null fields in Patch
  1494. // requests.
  1495. NullFields []string `json:"-"`
  1496. }
  1497. func (s *GoogleCloudVisionV1p2beta1BoundingPoly) MarshalJSON() ([]byte, error) {
  1498. type NoMethod GoogleCloudVisionV1p2beta1BoundingPoly
  1499. raw := NoMethod(*s)
  1500. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1501. }
  1502. // GoogleCloudVisionV1p2beta1ColorInfo: Color information consists of
  1503. // RGB channels, score, and the fraction of
  1504. // the image that the color occupies in the image.
  1505. type GoogleCloudVisionV1p2beta1ColorInfo struct {
  1506. // Color: RGB components of the color.
  1507. Color *Color `json:"color,omitempty"`
  1508. // PixelFraction: The fraction of pixels the color occupies in the
  1509. // image.
  1510. // Value in range [0, 1].
  1511. PixelFraction float64 `json:"pixelFraction,omitempty"`
  1512. // Score: Image-specific score for this color. Value in range [0, 1].
  1513. Score float64 `json:"score,omitempty"`
  1514. // ForceSendFields is a list of field names (e.g. "Color") to
  1515. // unconditionally include in API requests. By default, fields with
  1516. // empty values are omitted from API requests. However, any non-pointer,
  1517. // non-interface field appearing in ForceSendFields will be sent to the
  1518. // server regardless of whether the field is empty or not. This may be
  1519. // used to include empty fields in Patch requests.
  1520. ForceSendFields []string `json:"-"`
  1521. // NullFields is a list of field names (e.g. "Color") to include in API
  1522. // requests with the JSON null value. By default, fields with empty
  1523. // values are omitted from API requests. However, any field with an
  1524. // empty value appearing in NullFields will be sent to the server as
  1525. // null. It is an error if a field in this list has a non-empty value.
  1526. // This may be used to include null fields in Patch requests.
  1527. NullFields []string `json:"-"`
  1528. }
  1529. func (s *GoogleCloudVisionV1p2beta1ColorInfo) MarshalJSON() ([]byte, error) {
  1530. type NoMethod GoogleCloudVisionV1p2beta1ColorInfo
  1531. raw := NoMethod(*s)
  1532. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1533. }
  1534. func (s *GoogleCloudVisionV1p2beta1ColorInfo) UnmarshalJSON(data []byte) error {
  1535. type NoMethod GoogleCloudVisionV1p2beta1ColorInfo
  1536. var s1 struct {
  1537. PixelFraction gensupport.JSONFloat64 `json:"pixelFraction"`
  1538. Score gensupport.JSONFloat64 `json:"score"`
  1539. *NoMethod
  1540. }
  1541. s1.NoMethod = (*NoMethod)(s)
  1542. if err := json.Unmarshal(data, &s1); err != nil {
  1543. return err
  1544. }
  1545. s.PixelFraction = float64(s1.PixelFraction)
  1546. s.Score = float64(s1.Score)
  1547. return nil
  1548. }
  1549. // GoogleCloudVisionV1p2beta1CropHint: Single crop hint that is used to
  1550. // generate a new crop when serving an image.
  1551. type GoogleCloudVisionV1p2beta1CropHint struct {
  1552. // BoundingPoly: The bounding polygon for the crop region. The
  1553. // coordinates of the bounding
  1554. // box are in the original image's scale, as returned in `ImageParams`.
  1555. BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"`
  1556. // Confidence: Confidence of this being a salient region. Range [0, 1].
  1557. Confidence float64 `json:"confidence,omitempty"`
  1558. // ImportanceFraction: Fraction of importance of this salient region
  1559. // with respect to the original
  1560. // image.
  1561. ImportanceFraction float64 `json:"importanceFraction,omitempty"`
  1562. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  1563. // unconditionally include in API requests. By default, fields with
  1564. // empty values are omitted from API requests. However, any non-pointer,
  1565. // non-interface field appearing in ForceSendFields will be sent to the
  1566. // server regardless of whether the field is empty or not. This may be
  1567. // used to include empty fields in Patch requests.
  1568. ForceSendFields []string `json:"-"`
  1569. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  1570. // in API requests with the JSON null value. By default, fields with
  1571. // empty values are omitted from API requests. However, any field with
  1572. // an empty value appearing in NullFields will be sent to the server as
  1573. // null. It is an error if a field in this list has a non-empty value.
  1574. // This may be used to include null fields in Patch requests.
  1575. NullFields []string `json:"-"`
  1576. }
  1577. func (s *GoogleCloudVisionV1p2beta1CropHint) MarshalJSON() ([]byte, error) {
  1578. type NoMethod GoogleCloudVisionV1p2beta1CropHint
  1579. raw := NoMethod(*s)
  1580. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1581. }
  1582. func (s *GoogleCloudVisionV1p2beta1CropHint) UnmarshalJSON(data []byte) error {
  1583. type NoMethod GoogleCloudVisionV1p2beta1CropHint
  1584. var s1 struct {
  1585. Confidence gensupport.JSONFloat64 `json:"confidence"`
  1586. ImportanceFraction gensupport.JSONFloat64 `json:"importanceFraction"`
  1587. *NoMethod
  1588. }
  1589. s1.NoMethod = (*NoMethod)(s)
  1590. if err := json.Unmarshal(data, &s1); err != nil {
  1591. return err
  1592. }
  1593. s.Confidence = float64(s1.Confidence)
  1594. s.ImportanceFraction = float64(s1.ImportanceFraction)
  1595. return nil
  1596. }
  1597. // GoogleCloudVisionV1p2beta1CropHintsAnnotation: Set of crop hints that
  1598. // are used to generate new crops when serving images.
  1599. type GoogleCloudVisionV1p2beta1CropHintsAnnotation struct {
  1600. // CropHints: Crop hint results.
  1601. CropHints []*GoogleCloudVisionV1p2beta1CropHint `json:"cropHints,omitempty"`
  1602. // ForceSendFields is a list of field names (e.g. "CropHints") to
  1603. // unconditionally include in API requests. By default, fields with
  1604. // empty values are omitted from API requests. However, any non-pointer,
  1605. // non-interface field appearing in ForceSendFields will be sent to the
  1606. // server regardless of whether the field is empty or not. This may be
  1607. // used to include empty fields in Patch requests.
  1608. ForceSendFields []string `json:"-"`
  1609. // NullFields is a list of field names (e.g. "CropHints") to include in
  1610. // API requests with the JSON null value. By default, fields with empty
  1611. // values are omitted from API requests. However, any field with an
  1612. // empty value appearing in NullFields will be sent to the server as
  1613. // null. It is an error if a field in this list has a non-empty value.
  1614. // This may be used to include null fields in Patch requests.
  1615. NullFields []string `json:"-"`
  1616. }
  1617. func (s *GoogleCloudVisionV1p2beta1CropHintsAnnotation) MarshalJSON() ([]byte, error) {
  1618. type NoMethod GoogleCloudVisionV1p2beta1CropHintsAnnotation
  1619. raw := NoMethod(*s)
  1620. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1621. }
  1622. // GoogleCloudVisionV1p2beta1CropHintsParams: Parameters for crop hints
  1623. // annotation request.
  1624. type GoogleCloudVisionV1p2beta1CropHintsParams struct {
  1625. // AspectRatios: Aspect ratios in floats, representing the ratio of the
  1626. // width to the height
  1627. // of the image. For example, if the desired aspect ratio is 4/3,
  1628. // the
  1629. // corresponding float value should be 1.33333. If not specified,
  1630. // the
  1631. // best possible crop is returned. The number of provided aspect ratios
  1632. // is
  1633. // limited to a maximum of 16; any aspect ratios provided after the 16th
  1634. // are
  1635. // ignored.
  1636. AspectRatios []float64 `json:"aspectRatios,omitempty"`
  1637. // ForceSendFields is a list of field names (e.g. "AspectRatios") to
  1638. // unconditionally include in API requests. By default, fields with
  1639. // empty values are omitted from API requests. However, any non-pointer,
  1640. // non-interface field appearing in ForceSendFields will be sent to the
  1641. // server regardless of whether the field is empty or not. This may be
  1642. // used to include empty fields in Patch requests.
  1643. ForceSendFields []string `json:"-"`
  1644. // NullFields is a list of field names (e.g. "AspectRatios") to include
  1645. // in API requests with the JSON null value. By default, fields with
  1646. // empty values are omitted from API requests. However, any field with
  1647. // an empty value appearing in NullFields will be sent to the server as
  1648. // null. It is an error if a field in this list has a non-empty value.
  1649. // This may be used to include null fields in Patch requests.
  1650. NullFields []string `json:"-"`
  1651. }
  1652. func (s *GoogleCloudVisionV1p2beta1CropHintsParams) MarshalJSON() ([]byte, error) {
  1653. type NoMethod GoogleCloudVisionV1p2beta1CropHintsParams
  1654. raw := NoMethod(*s)
  1655. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1656. }
  1657. // GoogleCloudVisionV1p2beta1DominantColorsAnnotation: Set of dominant
  1658. // colors and their corresponding scores.
  1659. type GoogleCloudVisionV1p2beta1DominantColorsAnnotation struct {
  1660. // Colors: RGB color values with their score and pixel fraction.
  1661. Colors []*GoogleCloudVisionV1p2beta1ColorInfo `json:"colors,omitempty"`
  1662. // ForceSendFields is a list of field names (e.g. "Colors") to
  1663. // unconditionally include in API requests. By default, fields with
  1664. // empty values are omitted from API requests. However, any non-pointer,
  1665. // non-interface field appearing in ForceSendFields will be sent to the
  1666. // server regardless of whether the field is empty or not. This may be
  1667. // used to include empty fields in Patch requests.
  1668. ForceSendFields []string `json:"-"`
  1669. // NullFields is a list of field names (e.g. "Colors") to include in API
  1670. // requests with the JSON null value. By default, fields with empty
  1671. // values are omitted from API requests. However, any field with an
  1672. // empty value appearing in NullFields will be sent to the server as
  1673. // null. It is an error if a field in this list has a non-empty value.
  1674. // This may be used to include null fields in Patch requests.
  1675. NullFields []string `json:"-"`
  1676. }
  1677. func (s *GoogleCloudVisionV1p2beta1DominantColorsAnnotation) MarshalJSON() ([]byte, error) {
  1678. type NoMethod GoogleCloudVisionV1p2beta1DominantColorsAnnotation
  1679. raw := NoMethod(*s)
  1680. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1681. }
  1682. // GoogleCloudVisionV1p2beta1EntityAnnotation: Set of detected entity
  1683. // features.
  1684. type GoogleCloudVisionV1p2beta1EntityAnnotation struct {
  1685. // BoundingPoly: Image region to which this entity belongs. Not
  1686. // produced
  1687. // for `LABEL_DETECTION` features.
  1688. BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"`
  1689. // Confidence: **Deprecated. Use `score` instead.**
  1690. // The accuracy of the entity detection in an image.
  1691. // For example, for an image in which the "Eiffel Tower" entity is
  1692. // detected,
  1693. // this field represents the confidence that there is a tower in the
  1694. // query
  1695. // image. Range [0, 1].
  1696. Confidence float64 `json:"confidence,omitempty"`
  1697. // Description: Entity textual description, expressed in its `locale`
  1698. // language.
  1699. Description string `json:"description,omitempty"`
  1700. // Locale: The language code for the locale in which the entity
  1701. // textual
  1702. // `description` is expressed.
  1703. Locale string `json:"locale,omitempty"`
  1704. // Locations: The location information for the detected entity.
  1705. // Multiple
  1706. // `LocationInfo` elements can be present because one location
  1707. // may
  1708. // indicate the location of the scene in the image, and another
  1709. // location
  1710. // may indicate the location of the place where the image was
  1711. // taken.
  1712. // Location information is usually present for landmarks.
  1713. Locations []*GoogleCloudVisionV1p2beta1LocationInfo `json:"locations,omitempty"`
  1714. // Mid: Opaque entity ID. Some IDs may be available in
  1715. // [Google Knowledge Graph
  1716. // Search
  1717. // API](https://developers.google.com/knowledge-graph/).
  1718. Mid string `json:"mid,omitempty"`
  1719. // Properties: Some entities may have optional user-supplied `Property`
  1720. // (name/value)
  1721. // fields, such a score or string that qualifies the entity.
  1722. Properties []*GoogleCloudVisionV1p2beta1Property `json:"properties,omitempty"`
  1723. // Score: Overall score of the result. Range [0, 1].
  1724. Score float64 `json:"score,omitempty"`
  1725. // Topicality: The relevancy of the ICA (Image Content Annotation) label
  1726. // to the
  1727. // image. For example, the relevancy of "tower" is likely higher to an
  1728. // image
  1729. // containing the detected "Eiffel Tower" than to an image containing
  1730. // a
  1731. // detected distant towering building, even though the confidence
  1732. // that
  1733. // there is a tower in each image may be the same. Range [0, 1].
  1734. Topicality float64 `json:"topicality,omitempty"`
  1735. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  1736. // unconditionally include in API requests. By default, fields with
  1737. // empty values are omitted from API requests. However, any non-pointer,
  1738. // non-interface field appearing in ForceSendFields will be sent to the
  1739. // server regardless of whether the field is empty or not. This may be
  1740. // used to include empty fields in Patch requests.
  1741. ForceSendFields []string `json:"-"`
  1742. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  1743. // in API requests with the JSON null value. By default, fields with
  1744. // empty values are omitted from API requests. However, any field with
  1745. // an empty value appearing in NullFields will be sent to the server as
  1746. // null. It is an error if a field in this list has a non-empty value.
  1747. // This may be used to include null fields in Patch requests.
  1748. NullFields []string `json:"-"`
  1749. }
  1750. func (s *GoogleCloudVisionV1p2beta1EntityAnnotation) MarshalJSON() ([]byte, error) {
  1751. type NoMethod GoogleCloudVisionV1p2beta1EntityAnnotation
  1752. raw := NoMethod(*s)
  1753. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1754. }
  1755. func (s *GoogleCloudVisionV1p2beta1EntityAnnotation) UnmarshalJSON(data []byte) error {
  1756. type NoMethod GoogleCloudVisionV1p2beta1EntityAnnotation
  1757. var s1 struct {
  1758. Confidence gensupport.JSONFloat64 `json:"confidence"`
  1759. Score gensupport.JSONFloat64 `json:"score"`
  1760. Topicality gensupport.JSONFloat64 `json:"topicality"`
  1761. *NoMethod
  1762. }
  1763. s1.NoMethod = (*NoMethod)(s)
  1764. if err := json.Unmarshal(data, &s1); err != nil {
  1765. return err
  1766. }
  1767. s.Confidence = float64(s1.Confidence)
  1768. s.Score = float64(s1.Score)
  1769. s.Topicality = float64(s1.Topicality)
  1770. return nil
  1771. }
  1772. // GoogleCloudVisionV1p2beta1FaceAnnotation: A face annotation object
  1773. // contains the results of face detection.
  1774. type GoogleCloudVisionV1p2beta1FaceAnnotation struct {
  1775. // AngerLikelihood: Anger likelihood.
  1776. //
  1777. // Possible values:
  1778. // "UNKNOWN" - Unknown likelihood.
  1779. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1780. // specified vertical.
  1781. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1782. // vertical.
  1783. // "POSSIBLE" - It is possible that the image belongs to the specified
  1784. // vertical.
  1785. // "LIKELY" - It is likely that the image belongs to the specified
  1786. // vertical.
  1787. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1788. // specified vertical.
  1789. AngerLikelihood string `json:"angerLikelihood,omitempty"`
  1790. // BlurredLikelihood: Blurred likelihood.
  1791. //
  1792. // Possible values:
  1793. // "UNKNOWN" - Unknown likelihood.
  1794. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1795. // specified vertical.
  1796. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1797. // vertical.
  1798. // "POSSIBLE" - It is possible that the image belongs to the specified
  1799. // vertical.
  1800. // "LIKELY" - It is likely that the image belongs to the specified
  1801. // vertical.
  1802. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1803. // specified vertical.
  1804. BlurredLikelihood string `json:"blurredLikelihood,omitempty"`
  1805. // BoundingPoly: The bounding polygon around the face. The coordinates
  1806. // of the bounding box
  1807. // are in the original image's scale, as returned in `ImageParams`.
  1808. // The bounding box is computed to "frame" the face in accordance with
  1809. // human
  1810. // expectations. It is based on the landmarker results.
  1811. // Note that one or more x and/or y coordinates may not be generated in
  1812. // the
  1813. // `BoundingPoly` (the polygon will be unbounded) if only a partial
  1814. // face
  1815. // appears in the image to be annotated.
  1816. BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"`
  1817. // DetectionConfidence: Detection confidence. Range [0, 1].
  1818. DetectionConfidence float64 `json:"detectionConfidence,omitempty"`
  1819. // FdBoundingPoly: The `fd_bounding_poly` bounding polygon is tighter
  1820. // than the
  1821. // `boundingPoly`, and encloses only the skin part of the face.
  1822. // Typically, it
  1823. // is used to eliminate the face from any image analysis that detects
  1824. // the
  1825. // "amount of skin" visible in an image. It is not based on
  1826. // the
  1827. // landmarker results, only on the initial face detection, hence
  1828. // the <code>fd</code> (face detection) prefix.
  1829. FdBoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"fdBoundingPoly,omitempty"`
  1830. // HeadwearLikelihood: Headwear likelihood.
  1831. //
  1832. // Possible values:
  1833. // "UNKNOWN" - Unknown likelihood.
  1834. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1835. // specified vertical.
  1836. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1837. // vertical.
  1838. // "POSSIBLE" - It is possible that the image belongs to the specified
  1839. // vertical.
  1840. // "LIKELY" - It is likely that the image belongs to the specified
  1841. // vertical.
  1842. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1843. // specified vertical.
  1844. HeadwearLikelihood string `json:"headwearLikelihood,omitempty"`
  1845. // JoyLikelihood: Joy likelihood.
  1846. //
  1847. // Possible values:
  1848. // "UNKNOWN" - Unknown likelihood.
  1849. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1850. // specified vertical.
  1851. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1852. // vertical.
  1853. // "POSSIBLE" - It is possible that the image belongs to the specified
  1854. // vertical.
  1855. // "LIKELY" - It is likely that the image belongs to the specified
  1856. // vertical.
  1857. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1858. // specified vertical.
  1859. JoyLikelihood string `json:"joyLikelihood,omitempty"`
  1860. // LandmarkingConfidence: Face landmarking confidence. Range [0, 1].
  1861. LandmarkingConfidence float64 `json:"landmarkingConfidence,omitempty"`
  1862. // Landmarks: Detected face landmarks.
  1863. Landmarks []*GoogleCloudVisionV1p2beta1FaceAnnotationLandmark `json:"landmarks,omitempty"`
  1864. // PanAngle: Yaw angle, which indicates the leftward/rightward angle
  1865. // that the face is
  1866. // pointing relative to the vertical plane perpendicular to the image.
  1867. // Range
  1868. // [-180,180].
  1869. PanAngle float64 `json:"panAngle,omitempty"`
  1870. // RollAngle: Roll angle, which indicates the amount of
  1871. // clockwise/anti-clockwise rotation
  1872. // of the face relative to the image vertical about the axis
  1873. // perpendicular to
  1874. // the face. Range [-180,180].
  1875. RollAngle float64 `json:"rollAngle,omitempty"`
  1876. // SorrowLikelihood: Sorrow likelihood.
  1877. //
  1878. // Possible values:
  1879. // "UNKNOWN" - Unknown likelihood.
  1880. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1881. // specified vertical.
  1882. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1883. // vertical.
  1884. // "POSSIBLE" - It is possible that the image belongs to the specified
  1885. // vertical.
  1886. // "LIKELY" - It is likely that the image belongs to the specified
  1887. // vertical.
  1888. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1889. // specified vertical.
  1890. SorrowLikelihood string `json:"sorrowLikelihood,omitempty"`
  1891. // SurpriseLikelihood: Surprise likelihood.
  1892. //
  1893. // Possible values:
  1894. // "UNKNOWN" - Unknown likelihood.
  1895. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1896. // specified vertical.
  1897. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1898. // vertical.
  1899. // "POSSIBLE" - It is possible that the image belongs to the specified
  1900. // vertical.
  1901. // "LIKELY" - It is likely that the image belongs to the specified
  1902. // vertical.
  1903. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1904. // specified vertical.
  1905. SurpriseLikelihood string `json:"surpriseLikelihood,omitempty"`
  1906. // TiltAngle: Pitch angle, which indicates the upwards/downwards angle
  1907. // that the face is
  1908. // pointing relative to the image's horizontal plane. Range [-180,180].
  1909. TiltAngle float64 `json:"tiltAngle,omitempty"`
  1910. // UnderExposedLikelihood: Under-exposed likelihood.
  1911. //
  1912. // Possible values:
  1913. // "UNKNOWN" - Unknown likelihood.
  1914. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1915. // specified vertical.
  1916. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1917. // vertical.
  1918. // "POSSIBLE" - It is possible that the image belongs to the specified
  1919. // vertical.
  1920. // "LIKELY" - It is likely that the image belongs to the specified
  1921. // vertical.
  1922. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1923. // specified vertical.
  1924. UnderExposedLikelihood string `json:"underExposedLikelihood,omitempty"`
  1925. // ForceSendFields is a list of field names (e.g. "AngerLikelihood") to
  1926. // unconditionally include in API requests. By default, fields with
  1927. // empty values are omitted from API requests. However, any non-pointer,
  1928. // non-interface field appearing in ForceSendFields will be sent to the
  1929. // server regardless of whether the field is empty or not. This may be
  1930. // used to include empty fields in Patch requests.
  1931. ForceSendFields []string `json:"-"`
  1932. // NullFields is a list of field names (e.g. "AngerLikelihood") to
  1933. // include in API requests with the JSON null value. By default, fields
  1934. // with empty values are omitted from API requests. However, any field
  1935. // with an empty value appearing in NullFields will be sent to the
  1936. // server as null. It is an error if a field in this list has a
  1937. // non-empty value. This may be used to include null fields in Patch
  1938. // requests.
  1939. NullFields []string `json:"-"`
  1940. }
  1941. func (s *GoogleCloudVisionV1p2beta1FaceAnnotation) MarshalJSON() ([]byte, error) {
  1942. type NoMethod GoogleCloudVisionV1p2beta1FaceAnnotation
  1943. raw := NoMethod(*s)
  1944. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1945. }
  1946. func (s *GoogleCloudVisionV1p2beta1FaceAnnotation) UnmarshalJSON(data []byte) error {
  1947. type NoMethod GoogleCloudVisionV1p2beta1FaceAnnotation
  1948. var s1 struct {
  1949. DetectionConfidence gensupport.JSONFloat64 `json:"detectionConfidence"`
  1950. LandmarkingConfidence gensupport.JSONFloat64 `json:"landmarkingConfidence"`
  1951. PanAngle gensupport.JSONFloat64 `json:"panAngle"`
  1952. RollAngle gensupport.JSONFloat64 `json:"rollAngle"`
  1953. TiltAngle gensupport.JSONFloat64 `json:"tiltAngle"`
  1954. *NoMethod
  1955. }
  1956. s1.NoMethod = (*NoMethod)(s)
  1957. if err := json.Unmarshal(data, &s1); err != nil {
  1958. return err
  1959. }
  1960. s.DetectionConfidence = float64(s1.DetectionConfidence)
  1961. s.LandmarkingConfidence = float64(s1.LandmarkingConfidence)
  1962. s.PanAngle = float64(s1.PanAngle)
  1963. s.RollAngle = float64(s1.RollAngle)
  1964. s.TiltAngle = float64(s1.TiltAngle)
  1965. return nil
  1966. }
  1967. // GoogleCloudVisionV1p2beta1FaceAnnotationLandmark: A face-specific
  1968. // landmark (for example, a face feature).
  1969. type GoogleCloudVisionV1p2beta1FaceAnnotationLandmark struct {
  1970. // Position: Face landmark position.
  1971. Position *GoogleCloudVisionV1p2beta1Position `json:"position,omitempty"`
  1972. // Type: Face landmark type.
  1973. //
  1974. // Possible values:
  1975. // "UNKNOWN_LANDMARK" - Unknown face landmark detected. Should not be
  1976. // filled.
  1977. // "LEFT_EYE" - Left eye.
  1978. // "RIGHT_EYE" - Right eye.
  1979. // "LEFT_OF_LEFT_EYEBROW" - Left of left eyebrow.
  1980. // "RIGHT_OF_LEFT_EYEBROW" - Right of left eyebrow.
  1981. // "LEFT_OF_RIGHT_EYEBROW" - Left of right eyebrow.
  1982. // "RIGHT_OF_RIGHT_EYEBROW" - Right of right eyebrow.
  1983. // "MIDPOINT_BETWEEN_EYES" - Midpoint between eyes.
  1984. // "NOSE_TIP" - Nose tip.
  1985. // "UPPER_LIP" - Upper lip.
  1986. // "LOWER_LIP" - Lower lip.
  1987. // "MOUTH_LEFT" - Mouth left.
  1988. // "MOUTH_RIGHT" - Mouth right.
  1989. // "MOUTH_CENTER" - Mouth center.
  1990. // "NOSE_BOTTOM_RIGHT" - Nose, bottom right.
  1991. // "NOSE_BOTTOM_LEFT" - Nose, bottom left.
  1992. // "NOSE_BOTTOM_CENTER" - Nose, bottom center.
  1993. // "LEFT_EYE_TOP_BOUNDARY" - Left eye, top boundary.
  1994. // "LEFT_EYE_RIGHT_CORNER" - Left eye, right corner.
  1995. // "LEFT_EYE_BOTTOM_BOUNDARY" - Left eye, bottom boundary.
  1996. // "LEFT_EYE_LEFT_CORNER" - Left eye, left corner.
  1997. // "RIGHT_EYE_TOP_BOUNDARY" - Right eye, top boundary.
  1998. // "RIGHT_EYE_RIGHT_CORNER" - Right eye, right corner.
  1999. // "RIGHT_EYE_BOTTOM_BOUNDARY" - Right eye, bottom boundary.
  2000. // "RIGHT_EYE_LEFT_CORNER" - Right eye, left corner.
  2001. // "LEFT_EYEBROW_UPPER_MIDPOINT" - Left eyebrow, upper midpoint.
  2002. // "RIGHT_EYEBROW_UPPER_MIDPOINT" - Right eyebrow, upper midpoint.
  2003. // "LEFT_EAR_TRAGION" - Left ear tragion.
  2004. // "RIGHT_EAR_TRAGION" - Right ear tragion.
  2005. // "LEFT_EYE_PUPIL" - Left eye pupil.
  2006. // "RIGHT_EYE_PUPIL" - Right eye pupil.
  2007. // "FOREHEAD_GLABELLA" - Forehead glabella.
  2008. // "CHIN_GNATHION" - Chin gnathion.
  2009. // "CHIN_LEFT_GONION" - Chin left gonion.
  2010. // "CHIN_RIGHT_GONION" - Chin right gonion.
  2011. Type string `json:"type,omitempty"`
  2012. // ForceSendFields is a list of field names (e.g. "Position") to
  2013. // unconditionally include in API requests. By default, fields with
  2014. // empty values are omitted from API requests. However, any non-pointer,
  2015. // non-interface field appearing in ForceSendFields will be sent to the
  2016. // server regardless of whether the field is empty or not. This may be
  2017. // used to include empty fields in Patch requests.
  2018. ForceSendFields []string `json:"-"`
  2019. // NullFields is a list of field names (e.g. "Position") to include in
  2020. // API requests with the JSON null value. By default, fields with empty
  2021. // values are omitted from API requests. However, any field with an
  2022. // empty value appearing in NullFields will be sent to the server as
  2023. // null. It is an error if a field in this list has a non-empty value.
  2024. // This may be used to include null fields in Patch requests.
  2025. NullFields []string `json:"-"`
  2026. }
  2027. func (s *GoogleCloudVisionV1p2beta1FaceAnnotationLandmark) MarshalJSON() ([]byte, error) {
  2028. type NoMethod GoogleCloudVisionV1p2beta1FaceAnnotationLandmark
  2029. raw := NoMethod(*s)
  2030. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2031. }
  2032. // GoogleCloudVisionV1p2beta1Feature: The type of Google Cloud Vision
  2033. // API detection to perform, and the maximum
  2034. // number of results to return for that type. Multiple `Feature` objects
  2035. // can
  2036. // be specified in the `features` list.
  2037. type GoogleCloudVisionV1p2beta1Feature struct {
  2038. // MaxResults: Maximum number of results of this type. Does not apply
  2039. // to
  2040. // `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`.
  2041. MaxResults int64 `json:"maxResults,omitempty"`
  2042. // Model: Model to use for the feature.
  2043. // Supported values: "builtin/stable" (the default if unset)
  2044. // and
  2045. // "builtin/latest".
  2046. Model string `json:"model,omitempty"`
  2047. // Type: The feature type.
  2048. //
  2049. // Possible values:
  2050. // "TYPE_UNSPECIFIED" - Unspecified feature type.
  2051. // "FACE_DETECTION" - Run face detection.
  2052. // "LANDMARK_DETECTION" - Run landmark detection.
  2053. // "LOGO_DETECTION" - Run logo detection.
  2054. // "LABEL_DETECTION" - Run label detection.
  2055. // "TEXT_DETECTION" - Run text detection / optical character
  2056. // recognition (OCR). Text detection
  2057. // is optimized for areas of text within a larger image; if the image
  2058. // is
  2059. // a document, use `DOCUMENT_TEXT_DETECTION` instead.
  2060. // "DOCUMENT_TEXT_DETECTION" - Run dense text document OCR. Takes
  2061. // precedence when both
  2062. // `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` are present.
  2063. // "SAFE_SEARCH_DETECTION" - Run Safe Search to detect potentially
  2064. // unsafe
  2065. // or undesirable content.
  2066. // "IMAGE_PROPERTIES" - Compute a set of image properties, such as
  2067. // the
  2068. // image's dominant colors.
  2069. // "CROP_HINTS" - Run crop hints.
  2070. // "WEB_DETECTION" - Run web detection.
  2071. Type string `json:"type,omitempty"`
  2072. // ForceSendFields is a list of field names (e.g. "MaxResults") to
  2073. // unconditionally include in API requests. By default, fields with
  2074. // empty values are omitted from API requests. However, any non-pointer,
  2075. // non-interface field appearing in ForceSendFields will be sent to the
  2076. // server regardless of whether the field is empty or not. This may be
  2077. // used to include empty fields in Patch requests.
  2078. ForceSendFields []string `json:"-"`
  2079. // NullFields is a list of field names (e.g. "MaxResults") to include in
  2080. // API requests with the JSON null value. By default, fields with empty
  2081. // values are omitted from API requests. However, any field with an
  2082. // empty value appearing in NullFields will be sent to the server as
  2083. // null. It is an error if a field in this list has a non-empty value.
  2084. // This may be used to include null fields in Patch requests.
  2085. NullFields []string `json:"-"`
  2086. }
  2087. func (s *GoogleCloudVisionV1p2beta1Feature) MarshalJSON() ([]byte, error) {
  2088. type NoMethod GoogleCloudVisionV1p2beta1Feature
  2089. raw := NoMethod(*s)
  2090. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2091. }
  2092. // GoogleCloudVisionV1p2beta1GcsDestination: The Google Cloud Storage
  2093. // location where the output will be written to.
  2094. type GoogleCloudVisionV1p2beta1GcsDestination struct {
  2095. // Uri: Google Cloud Storage URI where the results will be stored.
  2096. // Results will
  2097. // be in JSON format and preceded by its corresponding input URI. This
  2098. // field
  2099. // can either represent a single file, or a prefix for multiple
  2100. // outputs.
  2101. // Prefixes must end in a `/`.
  2102. //
  2103. // Examples:
  2104. //
  2105. // * File: gs://bucket-name/filename.json
  2106. // * Prefix: gs://bucket-name/prefix/here/
  2107. // * File: gs://bucket-name/prefix/here
  2108. //
  2109. // If multiple outputs, each response is still AnnotateFileResponse,
  2110. // each of
  2111. // which contains some subset of the full list of
  2112. // AnnotateImageResponse.
  2113. // Multiple outputs can happen if, for example, the output JSON is too
  2114. // large
  2115. // and overflows into multiple sharded files.
  2116. Uri string `json:"uri,omitempty"`
  2117. // ForceSendFields is a list of field names (e.g. "Uri") to
  2118. // unconditionally include in API requests. By default, fields with
  2119. // empty values are omitted from API requests. However, any non-pointer,
  2120. // non-interface field appearing in ForceSendFields will be sent to the
  2121. // server regardless of whether the field is empty or not. This may be
  2122. // used to include empty fields in Patch requests.
  2123. ForceSendFields []string `json:"-"`
  2124. // NullFields is a list of field names (e.g. "Uri") to include in API
  2125. // requests with the JSON null value. By default, fields with empty
  2126. // values are omitted from API requests. However, any field with an
  2127. // empty value appearing in NullFields will be sent to the server as
  2128. // null. It is an error if a field in this list has a non-empty value.
  2129. // This may be used to include null fields in Patch requests.
  2130. NullFields []string `json:"-"`
  2131. }
  2132. func (s *GoogleCloudVisionV1p2beta1GcsDestination) MarshalJSON() ([]byte, error) {
  2133. type NoMethod GoogleCloudVisionV1p2beta1GcsDestination
  2134. raw := NoMethod(*s)
  2135. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2136. }
  2137. // GoogleCloudVisionV1p2beta1GcsSource: The Google Cloud Storage
  2138. // location where the input will be read from.
  2139. type GoogleCloudVisionV1p2beta1GcsSource struct {
  2140. // Uri: Google Cloud Storage URI for the input file. This must only be
  2141. // a
  2142. // Google Cloud Storage object. Wildcards are not currently supported.
  2143. Uri string `json:"uri,omitempty"`
  2144. // ForceSendFields is a list of field names (e.g. "Uri") to
  2145. // unconditionally include in API requests. By default, fields with
  2146. // empty values are omitted from API requests. However, any non-pointer,
  2147. // non-interface field appearing in ForceSendFields will be sent to the
  2148. // server regardless of whether the field is empty or not. This may be
  2149. // used to include empty fields in Patch requests.
  2150. ForceSendFields []string `json:"-"`
  2151. // NullFields is a list of field names (e.g. "Uri") to include in API
  2152. // requests with the JSON null value. By default, fields with empty
  2153. // values are omitted from API requests. However, any field with an
  2154. // empty value appearing in NullFields will be sent to the server as
  2155. // null. It is an error if a field in this list has a non-empty value.
  2156. // This may be used to include null fields in Patch requests.
  2157. NullFields []string `json:"-"`
  2158. }
  2159. func (s *GoogleCloudVisionV1p2beta1GcsSource) MarshalJSON() ([]byte, error) {
  2160. type NoMethod GoogleCloudVisionV1p2beta1GcsSource
  2161. raw := NoMethod(*s)
  2162. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2163. }
  2164. // GoogleCloudVisionV1p2beta1Image: Client image to perform Google Cloud
  2165. // Vision API tasks over.
  2166. type GoogleCloudVisionV1p2beta1Image struct {
  2167. // Content: Image content, represented as a stream of bytes.
  2168. // Note: As with all `bytes` fields, protobuffers use a pure
  2169. // binary
  2170. // representation, whereas JSON representations use base64.
  2171. Content string `json:"content,omitempty"`
  2172. // Source: Google Cloud Storage image location, or publicly-accessible
  2173. // image
  2174. // URL. If both `content` and `source` are provided for an image,
  2175. // `content`
  2176. // takes precedence and is used to perform the image annotation request.
  2177. Source *GoogleCloudVisionV1p2beta1ImageSource `json:"source,omitempty"`
  2178. // ForceSendFields is a list of field names (e.g. "Content") to
  2179. // unconditionally include in API requests. By default, fields with
  2180. // empty values are omitted from API requests. However, any non-pointer,
  2181. // non-interface field appearing in ForceSendFields will be sent to the
  2182. // server regardless of whether the field is empty or not. This may be
  2183. // used to include empty fields in Patch requests.
  2184. ForceSendFields []string `json:"-"`
  2185. // NullFields is a list of field names (e.g. "Content") to include in
  2186. // API requests with the JSON null value. By default, fields with empty
  2187. // values are omitted from API requests. However, any field with an
  2188. // empty value appearing in NullFields will be sent to the server as
  2189. // null. It is an error if a field in this list has a non-empty value.
  2190. // This may be used to include null fields in Patch requests.
  2191. NullFields []string `json:"-"`
  2192. }
  2193. func (s *GoogleCloudVisionV1p2beta1Image) MarshalJSON() ([]byte, error) {
  2194. type NoMethod GoogleCloudVisionV1p2beta1Image
  2195. raw := NoMethod(*s)
  2196. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2197. }
  2198. // GoogleCloudVisionV1p2beta1ImageAnnotationContext: If an image was
  2199. // produced from a file (e.g. a PDF), this message gives
  2200. // information about the source of that image.
  2201. type GoogleCloudVisionV1p2beta1ImageAnnotationContext struct {
  2202. // PageNumber: If the file was a PDF or TIFF, this field gives the page
  2203. // number within
  2204. // the file used to produce the image.
  2205. PageNumber int64 `json:"pageNumber,omitempty"`
  2206. // Uri: The URI of the file used to produce the image.
  2207. Uri string `json:"uri,omitempty"`
  2208. // ForceSendFields is a list of field names (e.g. "PageNumber") to
  2209. // unconditionally include in API requests. By default, fields with
  2210. // empty values are omitted from API requests. However, any non-pointer,
  2211. // non-interface field appearing in ForceSendFields will be sent to the
  2212. // server regardless of whether the field is empty or not. This may be
  2213. // used to include empty fields in Patch requests.
  2214. ForceSendFields []string `json:"-"`
  2215. // NullFields is a list of field names (e.g. "PageNumber") to include in
  2216. // API requests with the JSON null value. By default, fields with empty
  2217. // values are omitted from API requests. However, any field with an
  2218. // empty value appearing in NullFields will be sent to the server as
  2219. // null. It is an error if a field in this list has a non-empty value.
  2220. // This may be used to include null fields in Patch requests.
  2221. NullFields []string `json:"-"`
  2222. }
  2223. func (s *GoogleCloudVisionV1p2beta1ImageAnnotationContext) MarshalJSON() ([]byte, error) {
  2224. type NoMethod GoogleCloudVisionV1p2beta1ImageAnnotationContext
  2225. raw := NoMethod(*s)
  2226. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2227. }
  2228. // GoogleCloudVisionV1p2beta1ImageContext: Image context and/or
  2229. // feature-specific parameters.
  2230. type GoogleCloudVisionV1p2beta1ImageContext struct {
  2231. // CropHintsParams: Parameters for crop hints annotation request.
  2232. CropHintsParams *GoogleCloudVisionV1p2beta1CropHintsParams `json:"cropHintsParams,omitempty"`
  2233. // LanguageHints: List of languages to use for TEXT_DETECTION. In most
  2234. // cases, an empty value
  2235. // yields the best results since it enables automatic language
  2236. // detection. For
  2237. // languages based on the Latin alphabet, setting `language_hints` is
  2238. // not
  2239. // needed. In rare cases, when the language of the text in the image is
  2240. // known,
  2241. // setting a hint will help get better results (although it will be
  2242. // a
  2243. // significant hindrance if the hint is wrong). Text detection returns
  2244. // an
  2245. // error if one or more of the specified languages is not one of
  2246. // the
  2247. // [supported languages](/vision/docs/languages).
  2248. LanguageHints []string `json:"languageHints,omitempty"`
  2249. // LatLongRect: Not used.
  2250. LatLongRect *GoogleCloudVisionV1p2beta1LatLongRect `json:"latLongRect,omitempty"`
  2251. // WebDetectionParams: Parameters for web detection.
  2252. WebDetectionParams *GoogleCloudVisionV1p2beta1WebDetectionParams `json:"webDetectionParams,omitempty"`
  2253. // ForceSendFields is a list of field names (e.g. "CropHintsParams") to
  2254. // unconditionally include in API requests. By default, fields with
  2255. // empty values are omitted from API requests. However, any non-pointer,
  2256. // non-interface field appearing in ForceSendFields will be sent to the
  2257. // server regardless of whether the field is empty or not. This may be
  2258. // used to include empty fields in Patch requests.
  2259. ForceSendFields []string `json:"-"`
  2260. // NullFields is a list of field names (e.g. "CropHintsParams") to
  2261. // include in API requests with the JSON null value. By default, fields
  2262. // with empty values are omitted from API requests. However, any field
  2263. // with an empty value appearing in NullFields will be sent to the
  2264. // server as null. It is an error if a field in this list has a
  2265. // non-empty value. This may be used to include null fields in Patch
  2266. // requests.
  2267. NullFields []string `json:"-"`
  2268. }
  2269. func (s *GoogleCloudVisionV1p2beta1ImageContext) MarshalJSON() ([]byte, error) {
  2270. type NoMethod GoogleCloudVisionV1p2beta1ImageContext
  2271. raw := NoMethod(*s)
  2272. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2273. }
  2274. // GoogleCloudVisionV1p2beta1ImageProperties: Stores image properties,
  2275. // such as dominant colors.
  2276. type GoogleCloudVisionV1p2beta1ImageProperties struct {
  2277. // DominantColors: If present, dominant colors completed successfully.
  2278. DominantColors *GoogleCloudVisionV1p2beta1DominantColorsAnnotation `json:"dominantColors,omitempty"`
  2279. // ForceSendFields is a list of field names (e.g. "DominantColors") to
  2280. // unconditionally include in API requests. By default, fields with
  2281. // empty values are omitted from API requests. However, any non-pointer,
  2282. // non-interface field appearing in ForceSendFields will be sent to the
  2283. // server regardless of whether the field is empty or not. This may be
  2284. // used to include empty fields in Patch requests.
  2285. ForceSendFields []string `json:"-"`
  2286. // NullFields is a list of field names (e.g. "DominantColors") to
  2287. // include in API requests with the JSON null value. By default, fields
  2288. // with empty values are omitted from API requests. However, any field
  2289. // with an empty value appearing in NullFields will be sent to the
  2290. // server as null. It is an error if a field in this list has a
  2291. // non-empty value. This may be used to include null fields in Patch
  2292. // requests.
  2293. NullFields []string `json:"-"`
  2294. }
  2295. func (s *GoogleCloudVisionV1p2beta1ImageProperties) MarshalJSON() ([]byte, error) {
  2296. type NoMethod GoogleCloudVisionV1p2beta1ImageProperties
  2297. raw := NoMethod(*s)
  2298. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2299. }
  2300. // GoogleCloudVisionV1p2beta1ImageSource: External image source (Google
  2301. // Cloud Storage or web URL image location).
  2302. type GoogleCloudVisionV1p2beta1ImageSource struct {
  2303. // GcsImageUri: **Use `image_uri` instead.**
  2304. //
  2305. // The Google Cloud Storage URI of the
  2306. // form
  2307. // `gs://bucket_name/object_name`. Object versioning is not supported.
  2308. // See
  2309. // [Google Cloud Storage
  2310. // Request
  2311. // URIs](https://cloud.google.com/storage/docs/reference-uris) for more
  2312. // info.
  2313. GcsImageUri string `json:"gcsImageUri,omitempty"`
  2314. // ImageUri: The URI of the source image. Can be either:
  2315. //
  2316. // 1. A Google Cloud Storage URI of the form
  2317. // `gs://bucket_name/object_name`. Object versioning is not
  2318. // supported. See
  2319. // [Google Cloud Storage Request
  2320. // URIs](https://cloud.google.com/storage/docs/reference-uris) for
  2321. // more
  2322. // info.
  2323. //
  2324. // 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images
  2325. // from
  2326. // HTTP/HTTPS URLs, Google cannot guarantee that the request will be
  2327. // completed. Your request may fail if the specified host denies the
  2328. // request (e.g. due to request throttling or DOS prevention), or if
  2329. // Google
  2330. // throttles requests to the site for abuse prevention. You should
  2331. // not
  2332. // depend on externally-hosted images for production
  2333. // applications.
  2334. //
  2335. // When both `gcs_image_uri` and `image_uri` are specified, `image_uri`
  2336. // takes
  2337. // precedence.
  2338. ImageUri string `json:"imageUri,omitempty"`
  2339. // ForceSendFields is a list of field names (e.g. "GcsImageUri") to
  2340. // unconditionally include in API requests. By default, fields with
  2341. // empty values are omitted from API requests. However, any non-pointer,
  2342. // non-interface field appearing in ForceSendFields will be sent to the
  2343. // server regardless of whether the field is empty or not. This may be
  2344. // used to include empty fields in Patch requests.
  2345. ForceSendFields []string `json:"-"`
  2346. // NullFields is a list of field names (e.g. "GcsImageUri") to include
  2347. // in API requests with the JSON null value. By default, fields with
  2348. // empty values are omitted from API requests. However, any field with
  2349. // an empty value appearing in NullFields will be sent to the server as
  2350. // null. It is an error if a field in this list has a non-empty value.
  2351. // This may be used to include null fields in Patch requests.
  2352. NullFields []string `json:"-"`
  2353. }
  2354. func (s *GoogleCloudVisionV1p2beta1ImageSource) MarshalJSON() ([]byte, error) {
  2355. type NoMethod GoogleCloudVisionV1p2beta1ImageSource
  2356. raw := NoMethod(*s)
  2357. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2358. }
  2359. // GoogleCloudVisionV1p2beta1InputConfig: The desired input location and
  2360. // metadata.
  2361. type GoogleCloudVisionV1p2beta1InputConfig struct {
  2362. // GcsSource: The Google Cloud Storage location to read the input from.
  2363. GcsSource *GoogleCloudVisionV1p2beta1GcsSource `json:"gcsSource,omitempty"`
  2364. // MimeType: The type of the file. Currently only "application/pdf" and
  2365. // "image/tiff"
  2366. // are supported. Wildcards are not supported.
  2367. MimeType string `json:"mimeType,omitempty"`
  2368. // ForceSendFields is a list of field names (e.g. "GcsSource") to
  2369. // unconditionally include in API requests. By default, fields with
  2370. // empty values are omitted from API requests. However, any non-pointer,
  2371. // non-interface field appearing in ForceSendFields will be sent to the
  2372. // server regardless of whether the field is empty or not. This may be
  2373. // used to include empty fields in Patch requests.
  2374. ForceSendFields []string `json:"-"`
  2375. // NullFields is a list of field names (e.g. "GcsSource") to include in
  2376. // API requests with the JSON null value. By default, fields with empty
  2377. // values are omitted from API requests. However, any field with an
  2378. // empty value appearing in NullFields will be sent to the server as
  2379. // null. It is an error if a field in this list has a non-empty value.
  2380. // This may be used to include null fields in Patch requests.
  2381. NullFields []string `json:"-"`
  2382. }
  2383. func (s *GoogleCloudVisionV1p2beta1InputConfig) MarshalJSON() ([]byte, error) {
  2384. type NoMethod GoogleCloudVisionV1p2beta1InputConfig
  2385. raw := NoMethod(*s)
  2386. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2387. }
  2388. // GoogleCloudVisionV1p2beta1LatLongRect: Rectangle determined by min
  2389. // and max `LatLng` pairs.
  2390. type GoogleCloudVisionV1p2beta1LatLongRect struct {
  2391. // MaxLatLng: Max lat/long pair.
  2392. MaxLatLng *LatLng `json:"maxLatLng,omitempty"`
  2393. // MinLatLng: Min lat/long pair.
  2394. MinLatLng *LatLng `json:"minLatLng,omitempty"`
  2395. // ForceSendFields is a list of field names (e.g. "MaxLatLng") to
  2396. // unconditionally include in API requests. By default, fields with
  2397. // empty values are omitted from API requests. However, any non-pointer,
  2398. // non-interface field appearing in ForceSendFields will be sent to the
  2399. // server regardless of whether the field is empty or not. This may be
  2400. // used to include empty fields in Patch requests.
  2401. ForceSendFields []string `json:"-"`
  2402. // NullFields is a list of field names (e.g. "MaxLatLng") to include in
  2403. // API requests with the JSON null value. By default, fields with empty
  2404. // values are omitted from API requests. However, any field with an
  2405. // empty value appearing in NullFields will be sent to the server as
  2406. // null. It is an error if a field in this list has a non-empty value.
  2407. // This may be used to include null fields in Patch requests.
  2408. NullFields []string `json:"-"`
  2409. }
  2410. func (s *GoogleCloudVisionV1p2beta1LatLongRect) MarshalJSON() ([]byte, error) {
  2411. type NoMethod GoogleCloudVisionV1p2beta1LatLongRect
  2412. raw := NoMethod(*s)
  2413. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2414. }
  2415. // GoogleCloudVisionV1p2beta1LocationInfo: Detected entity location
  2416. // information.
  2417. type GoogleCloudVisionV1p2beta1LocationInfo struct {
  2418. // LatLng: lat/long location coordinates.
  2419. LatLng *LatLng `json:"latLng,omitempty"`
  2420. // ForceSendFields is a list of field names (e.g. "LatLng") to
  2421. // unconditionally include in API requests. By default, fields with
  2422. // empty values are omitted from API requests. However, any non-pointer,
  2423. // non-interface field appearing in ForceSendFields will be sent to the
  2424. // server regardless of whether the field is empty or not. This may be
  2425. // used to include empty fields in Patch requests.
  2426. ForceSendFields []string `json:"-"`
  2427. // NullFields is a list of field names (e.g. "LatLng") to include in API
  2428. // requests with the JSON null value. By default, fields with empty
  2429. // values are omitted from API requests. However, any field with an
  2430. // empty value appearing in NullFields will be sent to the server as
  2431. // null. It is an error if a field in this list has a non-empty value.
  2432. // This may be used to include null fields in Patch requests.
  2433. NullFields []string `json:"-"`
  2434. }
  2435. func (s *GoogleCloudVisionV1p2beta1LocationInfo) MarshalJSON() ([]byte, error) {
  2436. type NoMethod GoogleCloudVisionV1p2beta1LocationInfo
  2437. raw := NoMethod(*s)
  2438. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2439. }
  2440. // GoogleCloudVisionV1p2beta1NormalizedVertex: A vertex represents a 2D
  2441. // point in the image.
  2442. // NOTE: the normalized vertex coordinates are relative to the original
  2443. // image
  2444. // and range from 0 to 1.
  2445. type GoogleCloudVisionV1p2beta1NormalizedVertex struct {
  2446. // X: X coordinate.
  2447. X float64 `json:"x,omitempty"`
  2448. // Y: Y coordinate.
  2449. Y float64 `json:"y,omitempty"`
  2450. // ForceSendFields is a list of field names (e.g. "X") to
  2451. // unconditionally include in API requests. By default, fields with
  2452. // empty values are omitted from API requests. However, any non-pointer,
  2453. // non-interface field appearing in ForceSendFields will be sent to the
  2454. // server regardless of whether the field is empty or not. This may be
  2455. // used to include empty fields in Patch requests.
  2456. ForceSendFields []string `json:"-"`
  2457. // NullFields is a list of field names (e.g. "X") to include in API
  2458. // requests with the JSON null value. By default, fields with empty
  2459. // values are omitted from API requests. However, any field with an
  2460. // empty value appearing in NullFields will be sent to the server as
  2461. // null. It is an error if a field in this list has a non-empty value.
  2462. // This may be used to include null fields in Patch requests.
  2463. NullFields []string `json:"-"`
  2464. }
  2465. func (s *GoogleCloudVisionV1p2beta1NormalizedVertex) MarshalJSON() ([]byte, error) {
  2466. type NoMethod GoogleCloudVisionV1p2beta1NormalizedVertex
  2467. raw := NoMethod(*s)
  2468. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2469. }
  2470. func (s *GoogleCloudVisionV1p2beta1NormalizedVertex) UnmarshalJSON(data []byte) error {
  2471. type NoMethod GoogleCloudVisionV1p2beta1NormalizedVertex
  2472. var s1 struct {
  2473. X gensupport.JSONFloat64 `json:"x"`
  2474. Y gensupport.JSONFloat64 `json:"y"`
  2475. *NoMethod
  2476. }
  2477. s1.NoMethod = (*NoMethod)(s)
  2478. if err := json.Unmarshal(data, &s1); err != nil {
  2479. return err
  2480. }
  2481. s.X = float64(s1.X)
  2482. s.Y = float64(s1.Y)
  2483. return nil
  2484. }
  2485. // GoogleCloudVisionV1p2beta1OperationMetadata: Contains metadata for
  2486. // the BatchAnnotateImages operation.
  2487. type GoogleCloudVisionV1p2beta1OperationMetadata struct {
  2488. // CreateTime: The time when the batch request was received.
  2489. CreateTime string `json:"createTime,omitempty"`
  2490. // State: Current state of the batch operation.
  2491. //
  2492. // Possible values:
  2493. // "STATE_UNSPECIFIED" - Invalid.
  2494. // "CREATED" - Request is received.
  2495. // "RUNNING" - Request is actively being processed.
  2496. // "DONE" - The batch processing is done.
  2497. // "CANCELLED" - The batch processing was cancelled.
  2498. State string `json:"state,omitempty"`
  2499. // UpdateTime: The time when the operation result was last updated.
  2500. UpdateTime string `json:"updateTime,omitempty"`
  2501. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  2502. // unconditionally include in API requests. By default, fields with
  2503. // empty values are omitted from API requests. However, any non-pointer,
  2504. // non-interface field appearing in ForceSendFields will be sent to the
  2505. // server regardless of whether the field is empty or not. This may be
  2506. // used to include empty fields in Patch requests.
  2507. ForceSendFields []string `json:"-"`
  2508. // NullFields is a list of field names (e.g. "CreateTime") to include in
  2509. // API requests with the JSON null value. By default, fields with empty
  2510. // values are omitted from API requests. However, any field with an
  2511. // empty value appearing in NullFields will be sent to the server as
  2512. // null. It is an error if a field in this list has a non-empty value.
  2513. // This may be used to include null fields in Patch requests.
  2514. NullFields []string `json:"-"`
  2515. }
  2516. func (s *GoogleCloudVisionV1p2beta1OperationMetadata) MarshalJSON() ([]byte, error) {
  2517. type NoMethod GoogleCloudVisionV1p2beta1OperationMetadata
  2518. raw := NoMethod(*s)
  2519. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2520. }
  2521. // GoogleCloudVisionV1p2beta1OutputConfig: The desired output location
  2522. // and metadata.
  2523. type GoogleCloudVisionV1p2beta1OutputConfig struct {
  2524. // BatchSize: The max number of response protos to put into each output
  2525. // JSON file on
  2526. // Google Cloud Storage.
  2527. // The valid range is [1, 100]. If not specified, the default value is
  2528. // 20.
  2529. //
  2530. // For example, for one pdf file with 100 pages, 100 response protos
  2531. // will
  2532. // be generated. If `batch_size` = 20, then 5 json files each
  2533. // containing 20 response protos will be written under the
  2534. // prefix
  2535. // `gcs_destination`.`uri`.
  2536. //
  2537. // Currently, batch_size only applies to GcsDestination, with potential
  2538. // future
  2539. // support for other output configurations.
  2540. BatchSize int64 `json:"batchSize,omitempty"`
  2541. // GcsDestination: The Google Cloud Storage location to write the
  2542. // output(s) to.
  2543. GcsDestination *GoogleCloudVisionV1p2beta1GcsDestination `json:"gcsDestination,omitempty"`
  2544. // ForceSendFields is a list of field names (e.g. "BatchSize") to
  2545. // unconditionally include in API requests. By default, fields with
  2546. // empty values are omitted from API requests. However, any non-pointer,
  2547. // non-interface field appearing in ForceSendFields will be sent to the
  2548. // server regardless of whether the field is empty or not. This may be
  2549. // used to include empty fields in Patch requests.
  2550. ForceSendFields []string `json:"-"`
  2551. // NullFields is a list of field names (e.g. "BatchSize") to include in
  2552. // API requests with the JSON null value. By default, fields with empty
  2553. // values are omitted from API requests. However, any field with an
  2554. // empty value appearing in NullFields will be sent to the server as
  2555. // null. It is an error if a field in this list has a non-empty value.
  2556. // This may be used to include null fields in Patch requests.
  2557. NullFields []string `json:"-"`
  2558. }
  2559. func (s *GoogleCloudVisionV1p2beta1OutputConfig) MarshalJSON() ([]byte, error) {
  2560. type NoMethod GoogleCloudVisionV1p2beta1OutputConfig
  2561. raw := NoMethod(*s)
  2562. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2563. }
  2564. // GoogleCloudVisionV1p2beta1Page: Detected page from OCR.
  2565. type GoogleCloudVisionV1p2beta1Page struct {
  2566. // Blocks: List of blocks of text, images etc on this page.
  2567. Blocks []*GoogleCloudVisionV1p2beta1Block `json:"blocks,omitempty"`
  2568. // Confidence: Confidence of the OCR results on the page. Range [0, 1].
  2569. Confidence float64 `json:"confidence,omitempty"`
  2570. // Height: Page height. For PDFs the unit is points. For images
  2571. // (including
  2572. // TIFFs) the unit is pixels.
  2573. Height int64 `json:"height,omitempty"`
  2574. // Property: Additional information detected on the page.
  2575. Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"`
  2576. // Width: Page width. For PDFs the unit is points. For images
  2577. // (including
  2578. // TIFFs) the unit is pixels.
  2579. Width int64 `json:"width,omitempty"`
  2580. // ForceSendFields is a list of field names (e.g. "Blocks") to
  2581. // unconditionally include in API requests. By default, fields with
  2582. // empty values are omitted from API requests. However, any non-pointer,
  2583. // non-interface field appearing in ForceSendFields will be sent to the
  2584. // server regardless of whether the field is empty or not. This may be
  2585. // used to include empty fields in Patch requests.
  2586. ForceSendFields []string `json:"-"`
  2587. // NullFields is a list of field names (e.g. "Blocks") to include in API
  2588. // requests with the JSON null value. By default, fields with empty
  2589. // values are omitted from API requests. However, any field with an
  2590. // empty value appearing in NullFields will be sent to the server as
  2591. // null. It is an error if a field in this list has a non-empty value.
  2592. // This may be used to include null fields in Patch requests.
  2593. NullFields []string `json:"-"`
  2594. }
  2595. func (s *GoogleCloudVisionV1p2beta1Page) MarshalJSON() ([]byte, error) {
  2596. type NoMethod GoogleCloudVisionV1p2beta1Page
  2597. raw := NoMethod(*s)
  2598. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2599. }
  2600. func (s *GoogleCloudVisionV1p2beta1Page) UnmarshalJSON(data []byte) error {
  2601. type NoMethod GoogleCloudVisionV1p2beta1Page
  2602. var s1 struct {
  2603. Confidence gensupport.JSONFloat64 `json:"confidence"`
  2604. *NoMethod
  2605. }
  2606. s1.NoMethod = (*NoMethod)(s)
  2607. if err := json.Unmarshal(data, &s1); err != nil {
  2608. return err
  2609. }
  2610. s.Confidence = float64(s1.Confidence)
  2611. return nil
  2612. }
  2613. // GoogleCloudVisionV1p2beta1Paragraph: Structural unit of text
  2614. // representing a number of words in certain order.
  2615. type GoogleCloudVisionV1p2beta1Paragraph struct {
  2616. // BoundingBox: The bounding box for the paragraph.
  2617. // The vertices are in the order of top-left, top-right,
  2618. // bottom-right,
  2619. // bottom-left. When a rotation of the bounding box is detected the
  2620. // rotation
  2621. // is represented as around the top-left corner as defined when the text
  2622. // is
  2623. // read in the 'natural' orientation.
  2624. // For example:
  2625. // * when the text is horizontal it might look like:
  2626. // 0----1
  2627. // | |
  2628. // 3----2
  2629. // * when it's rotated 180 degrees around the top-left corner it
  2630. // becomes:
  2631. // 2----3
  2632. // | |
  2633. // 1----0
  2634. // and the vertice order will still be (0, 1, 2, 3).
  2635. BoundingBox *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingBox,omitempty"`
  2636. // Confidence: Confidence of the OCR results for the paragraph. Range
  2637. // [0, 1].
  2638. Confidence float64 `json:"confidence,omitempty"`
  2639. // Property: Additional information detected for the paragraph.
  2640. Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"`
  2641. // Words: List of words in this paragraph.
  2642. Words []*GoogleCloudVisionV1p2beta1Word `json:"words,omitempty"`
  2643. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  2644. // unconditionally include in API requests. By default, fields with
  2645. // empty values are omitted from API requests. However, any non-pointer,
  2646. // non-interface field appearing in ForceSendFields will be sent to the
  2647. // server regardless of whether the field is empty or not. This may be
  2648. // used to include empty fields in Patch requests.
  2649. ForceSendFields []string `json:"-"`
  2650. // NullFields is a list of field names (e.g. "BoundingBox") to include
  2651. // in API requests with the JSON null value. By default, fields with
  2652. // empty values are omitted from API requests. However, any field with
  2653. // an empty value appearing in NullFields will be sent to the server as
  2654. // null. It is an error if a field in this list has a non-empty value.
  2655. // This may be used to include null fields in Patch requests.
  2656. NullFields []string `json:"-"`
  2657. }
  2658. func (s *GoogleCloudVisionV1p2beta1Paragraph) MarshalJSON() ([]byte, error) {
  2659. type NoMethod GoogleCloudVisionV1p2beta1Paragraph
  2660. raw := NoMethod(*s)
  2661. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2662. }
  2663. func (s *GoogleCloudVisionV1p2beta1Paragraph) UnmarshalJSON(data []byte) error {
  2664. type NoMethod GoogleCloudVisionV1p2beta1Paragraph
  2665. var s1 struct {
  2666. Confidence gensupport.JSONFloat64 `json:"confidence"`
  2667. *NoMethod
  2668. }
  2669. s1.NoMethod = (*NoMethod)(s)
  2670. if err := json.Unmarshal(data, &s1); err != nil {
  2671. return err
  2672. }
  2673. s.Confidence = float64(s1.Confidence)
  2674. return nil
  2675. }
  2676. // GoogleCloudVisionV1p2beta1Position: A 3D position in the image, used
  2677. // primarily for Face detection landmarks.
  2678. // A valid Position must have both x and y coordinates.
  2679. // The position coordinates are in the same scale as the original image.
  2680. type GoogleCloudVisionV1p2beta1Position struct {
  2681. // X: X coordinate.
  2682. X float64 `json:"x,omitempty"`
  2683. // Y: Y coordinate.
  2684. Y float64 `json:"y,omitempty"`
  2685. // Z: Z coordinate (or depth).
  2686. Z float64 `json:"z,omitempty"`
  2687. // ForceSendFields is a list of field names (e.g. "X") to
  2688. // unconditionally include in API requests. By default, fields with
  2689. // empty values are omitted from API requests. However, any non-pointer,
  2690. // non-interface field appearing in ForceSendFields will be sent to the
  2691. // server regardless of whether the field is empty or not. This may be
  2692. // used to include empty fields in Patch requests.
  2693. ForceSendFields []string `json:"-"`
  2694. // NullFields is a list of field names (e.g. "X") to include in API
  2695. // requests with the JSON null value. By default, fields with empty
  2696. // values are omitted from API requests. However, any field with an
  2697. // empty value appearing in NullFields will be sent to the server as
  2698. // null. It is an error if a field in this list has a non-empty value.
  2699. // This may be used to include null fields in Patch requests.
  2700. NullFields []string `json:"-"`
  2701. }
  2702. func (s *GoogleCloudVisionV1p2beta1Position) MarshalJSON() ([]byte, error) {
  2703. type NoMethod GoogleCloudVisionV1p2beta1Position
  2704. raw := NoMethod(*s)
  2705. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2706. }
  2707. func (s *GoogleCloudVisionV1p2beta1Position) UnmarshalJSON(data []byte) error {
  2708. type NoMethod GoogleCloudVisionV1p2beta1Position
  2709. var s1 struct {
  2710. X gensupport.JSONFloat64 `json:"x"`
  2711. Y gensupport.JSONFloat64 `json:"y"`
  2712. Z gensupport.JSONFloat64 `json:"z"`
  2713. *NoMethod
  2714. }
  2715. s1.NoMethod = (*NoMethod)(s)
  2716. if err := json.Unmarshal(data, &s1); err != nil {
  2717. return err
  2718. }
  2719. s.X = float64(s1.X)
  2720. s.Y = float64(s1.Y)
  2721. s.Z = float64(s1.Z)
  2722. return nil
  2723. }
  2724. // GoogleCloudVisionV1p2beta1Property: A `Property` consists of a
  2725. // user-supplied name/value pair.
  2726. type GoogleCloudVisionV1p2beta1Property struct {
  2727. // Name: Name of the property.
  2728. Name string `json:"name,omitempty"`
  2729. // Uint64Value: Value of numeric properties.
  2730. Uint64Value uint64 `json:"uint64Value,omitempty,string"`
  2731. // Value: Value of the property.
  2732. Value string `json:"value,omitempty"`
  2733. // ForceSendFields is a list of field names (e.g. "Name") to
  2734. // unconditionally include in API requests. By default, fields with
  2735. // empty values are omitted from API requests. However, any non-pointer,
  2736. // non-interface field appearing in ForceSendFields will be sent to the
  2737. // server regardless of whether the field is empty or not. This may be
  2738. // used to include empty fields in Patch requests.
  2739. ForceSendFields []string `json:"-"`
  2740. // NullFields is a list of field names (e.g. "Name") to include in API
  2741. // requests with the JSON null value. By default, fields with empty
  2742. // values are omitted from API requests. However, any field with an
  2743. // empty value appearing in NullFields will be sent to the server as
  2744. // null. It is an error if a field in this list has a non-empty value.
  2745. // This may be used to include null fields in Patch requests.
  2746. NullFields []string `json:"-"`
  2747. }
  2748. func (s *GoogleCloudVisionV1p2beta1Property) MarshalJSON() ([]byte, error) {
  2749. type NoMethod GoogleCloudVisionV1p2beta1Property
  2750. raw := NoMethod(*s)
  2751. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2752. }
  2753. // GoogleCloudVisionV1p2beta1SafeSearchAnnotation: Set of features
  2754. // pertaining to the image, computed by computer vision
  2755. // methods over safe-search verticals (for example, adult, spoof,
  2756. // medical,
  2757. // violence).
  2758. type GoogleCloudVisionV1p2beta1SafeSearchAnnotation struct {
  2759. // Adult: Represents the adult content likelihood for the image. Adult
  2760. // content may
  2761. // contain elements such as nudity, pornographic images or cartoons,
  2762. // or
  2763. // sexual activities.
  2764. //
  2765. // Possible values:
  2766. // "UNKNOWN" - Unknown likelihood.
  2767. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  2768. // specified vertical.
  2769. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  2770. // vertical.
  2771. // "POSSIBLE" - It is possible that the image belongs to the specified
  2772. // vertical.
  2773. // "LIKELY" - It is likely that the image belongs to the specified
  2774. // vertical.
  2775. // "VERY_LIKELY" - It is very likely that the image belongs to the
  2776. // specified vertical.
  2777. Adult string `json:"adult,omitempty"`
  2778. // Medical: Likelihood that this is a medical image.
  2779. //
  2780. // Possible values:
  2781. // "UNKNOWN" - Unknown likelihood.
  2782. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  2783. // specified vertical.
  2784. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  2785. // vertical.
  2786. // "POSSIBLE" - It is possible that the image belongs to the specified
  2787. // vertical.
  2788. // "LIKELY" - It is likely that the image belongs to the specified
  2789. // vertical.
  2790. // "VERY_LIKELY" - It is very likely that the image belongs to the
  2791. // specified vertical.
  2792. Medical string `json:"medical,omitempty"`
  2793. // Racy: Likelihood that the request image contains racy content. Racy
  2794. // content may
  2795. // include (but is not limited to) skimpy or sheer clothing,
  2796. // strategically
  2797. // covered nudity, lewd or provocative poses, or close-ups of
  2798. // sensitive
  2799. // body areas.
  2800. //
  2801. // Possible values:
  2802. // "UNKNOWN" - Unknown likelihood.
  2803. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  2804. // specified vertical.
  2805. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  2806. // vertical.
  2807. // "POSSIBLE" - It is possible that the image belongs to the specified
  2808. // vertical.
  2809. // "LIKELY" - It is likely that the image belongs to the specified
  2810. // vertical.
  2811. // "VERY_LIKELY" - It is very likely that the image belongs to the
  2812. // specified vertical.
  2813. Racy string `json:"racy,omitempty"`
  2814. // Spoof: Spoof likelihood. The likelihood that an modification
  2815. // was made to the image's canonical version to make it appear
  2816. // funny or offensive.
  2817. //
  2818. // Possible values:
  2819. // "UNKNOWN" - Unknown likelihood.
  2820. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  2821. // specified vertical.
  2822. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  2823. // vertical.
  2824. // "POSSIBLE" - It is possible that the image belongs to the specified
  2825. // vertical.
  2826. // "LIKELY" - It is likely that the image belongs to the specified
  2827. // vertical.
  2828. // "VERY_LIKELY" - It is very likely that the image belongs to the
  2829. // specified vertical.
  2830. Spoof string `json:"spoof,omitempty"`
  2831. // Violence: Likelihood that this image contains violent content.
  2832. //
  2833. // Possible values:
  2834. // "UNKNOWN" - Unknown likelihood.
  2835. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  2836. // specified vertical.
  2837. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  2838. // vertical.
  2839. // "POSSIBLE" - It is possible that the image belongs to the specified
  2840. // vertical.
  2841. // "LIKELY" - It is likely that the image belongs to the specified
  2842. // vertical.
  2843. // "VERY_LIKELY" - It is very likely that the image belongs to the
  2844. // specified vertical.
  2845. Violence string `json:"violence,omitempty"`
  2846. // ForceSendFields is a list of field names (e.g. "Adult") to
  2847. // unconditionally include in API requests. By default, fields with
  2848. // empty values are omitted from API requests. However, any non-pointer,
  2849. // non-interface field appearing in ForceSendFields will be sent to the
  2850. // server regardless of whether the field is empty or not. This may be
  2851. // used to include empty fields in Patch requests.
  2852. ForceSendFields []string `json:"-"`
  2853. // NullFields is a list of field names (e.g. "Adult") to include in API
  2854. // requests with the JSON null value. By default, fields with empty
  2855. // values are omitted from API requests. However, any field with an
  2856. // empty value appearing in NullFields will be sent to the server as
  2857. // null. It is an error if a field in this list has a non-empty value.
  2858. // This may be used to include null fields in Patch requests.
  2859. NullFields []string `json:"-"`
  2860. }
  2861. func (s *GoogleCloudVisionV1p2beta1SafeSearchAnnotation) MarshalJSON() ([]byte, error) {
  2862. type NoMethod GoogleCloudVisionV1p2beta1SafeSearchAnnotation
  2863. raw := NoMethod(*s)
  2864. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2865. }
  2866. // GoogleCloudVisionV1p2beta1Symbol: A single symbol representation.
  2867. type GoogleCloudVisionV1p2beta1Symbol struct {
  2868. // BoundingBox: The bounding box for the symbol.
  2869. // The vertices are in the order of top-left, top-right,
  2870. // bottom-right,
  2871. // bottom-left. When a rotation of the bounding box is detected the
  2872. // rotation
  2873. // is represented as around the top-left corner as defined when the text
  2874. // is
  2875. // read in the 'natural' orientation.
  2876. // For example:
  2877. // * when the text is horizontal it might look like:
  2878. // 0----1
  2879. // | |
  2880. // 3----2
  2881. // * when it's rotated 180 degrees around the top-left corner it
  2882. // becomes:
  2883. // 2----3
  2884. // | |
  2885. // 1----0
  2886. // and the vertice order will still be (0, 1, 2, 3).
  2887. BoundingBox *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingBox,omitempty"`
  2888. // Confidence: Confidence of the OCR results for the symbol. Range [0,
  2889. // 1].
  2890. Confidence float64 `json:"confidence,omitempty"`
  2891. // Property: Additional information detected for the symbol.
  2892. Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"`
  2893. // Text: The actual UTF-8 representation of the symbol.
  2894. Text string `json:"text,omitempty"`
  2895. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  2896. // unconditionally include in API requests. By default, fields with
  2897. // empty values are omitted from API requests. However, any non-pointer,
  2898. // non-interface field appearing in ForceSendFields will be sent to the
  2899. // server regardless of whether the field is empty or not. This may be
  2900. // used to include empty fields in Patch requests.
  2901. ForceSendFields []string `json:"-"`
  2902. // NullFields is a list of field names (e.g. "BoundingBox") to include
  2903. // in API requests with the JSON null value. By default, fields with
  2904. // empty values are omitted from API requests. However, any field with
  2905. // an empty value appearing in NullFields will be sent to the server as
  2906. // null. It is an error if a field in this list has a non-empty value.
  2907. // This may be used to include null fields in Patch requests.
  2908. NullFields []string `json:"-"`
  2909. }
  2910. func (s *GoogleCloudVisionV1p2beta1Symbol) MarshalJSON() ([]byte, error) {
  2911. type NoMethod GoogleCloudVisionV1p2beta1Symbol
  2912. raw := NoMethod(*s)
  2913. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2914. }
  2915. func (s *GoogleCloudVisionV1p2beta1Symbol) UnmarshalJSON(data []byte) error {
  2916. type NoMethod GoogleCloudVisionV1p2beta1Symbol
  2917. var s1 struct {
  2918. Confidence gensupport.JSONFloat64 `json:"confidence"`
  2919. *NoMethod
  2920. }
  2921. s1.NoMethod = (*NoMethod)(s)
  2922. if err := json.Unmarshal(data, &s1); err != nil {
  2923. return err
  2924. }
  2925. s.Confidence = float64(s1.Confidence)
  2926. return nil
  2927. }
  2928. // GoogleCloudVisionV1p2beta1TextAnnotation: TextAnnotation contains a
  2929. // structured representation of OCR extracted text.
  2930. // The hierarchy of an OCR extracted text structure is like this:
  2931. // TextAnnotation -> Page -> Block -> Paragraph -> Word ->
  2932. // Symbol
  2933. // Each structural component, starting from Page, may further have their
  2934. // own
  2935. // properties. Properties describe detected languages, breaks etc..
  2936. // Please refer
  2937. // to the TextAnnotation.TextProperty message definition below for
  2938. // more
  2939. // detail.
  2940. type GoogleCloudVisionV1p2beta1TextAnnotation struct {
  2941. // Pages: List of pages detected by OCR.
  2942. Pages []*GoogleCloudVisionV1p2beta1Page `json:"pages,omitempty"`
  2943. // Text: UTF-8 text detected on the pages.
  2944. Text string `json:"text,omitempty"`
  2945. // ForceSendFields is a list of field names (e.g. "Pages") to
  2946. // unconditionally include in API requests. By default, fields with
  2947. // empty values are omitted from API requests. However, any non-pointer,
  2948. // non-interface field appearing in ForceSendFields will be sent to the
  2949. // server regardless of whether the field is empty or not. This may be
  2950. // used to include empty fields in Patch requests.
  2951. ForceSendFields []string `json:"-"`
  2952. // NullFields is a list of field names (e.g. "Pages") to include in API
  2953. // requests with the JSON null value. By default, fields with empty
  2954. // values are omitted from API requests. However, any field with an
  2955. // empty value appearing in NullFields will be sent to the server as
  2956. // null. It is an error if a field in this list has a non-empty value.
  2957. // This may be used to include null fields in Patch requests.
  2958. NullFields []string `json:"-"`
  2959. }
  2960. func (s *GoogleCloudVisionV1p2beta1TextAnnotation) MarshalJSON() ([]byte, error) {
  2961. type NoMethod GoogleCloudVisionV1p2beta1TextAnnotation
  2962. raw := NoMethod(*s)
  2963. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2964. }
  2965. // GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak: Detected start
  2966. // or end of a structural component.
  2967. type GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak struct {
  2968. // IsPrefix: True if break prepends the element.
  2969. IsPrefix bool `json:"isPrefix,omitempty"`
  2970. // Type: Detected break type.
  2971. //
  2972. // Possible values:
  2973. // "UNKNOWN" - Unknown break label type.
  2974. // "SPACE" - Regular space.
  2975. // "SURE_SPACE" - Sure space (very wide).
  2976. // "EOL_SURE_SPACE" - Line-wrapping break.
  2977. // "HYPHEN" - End-line hyphen that is not present in text; does not
  2978. // co-occur with
  2979. // `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`.
  2980. // "LINE_BREAK" - Line break that ends a paragraph.
  2981. Type string `json:"type,omitempty"`
  2982. // ForceSendFields is a list of field names (e.g. "IsPrefix") to
  2983. // unconditionally include in API requests. By default, fields with
  2984. // empty values are omitted from API requests. However, any non-pointer,
  2985. // non-interface field appearing in ForceSendFields will be sent to the
  2986. // server regardless of whether the field is empty or not. This may be
  2987. // used to include empty fields in Patch requests.
  2988. ForceSendFields []string `json:"-"`
  2989. // NullFields is a list of field names (e.g. "IsPrefix") to include in
  2990. // API requests with the JSON null value. By default, fields with empty
  2991. // values are omitted from API requests. However, any field with an
  2992. // empty value appearing in NullFields will be sent to the server as
  2993. // null. It is an error if a field in this list has a non-empty value.
  2994. // This may be used to include null fields in Patch requests.
  2995. NullFields []string `json:"-"`
  2996. }
  2997. func (s *GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak) MarshalJSON() ([]byte, error) {
  2998. type NoMethod GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak
  2999. raw := NoMethod(*s)
  3000. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3001. }
  3002. // GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage: Detected
  3003. // language for a structural component.
  3004. type GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage struct {
  3005. // Confidence: Confidence of detected language. Range [0, 1].
  3006. Confidence float64 `json:"confidence,omitempty"`
  3007. // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn".
  3008. // For more
  3009. // information,
  3010. // see
  3011. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  3012. LanguageCode string `json:"languageCode,omitempty"`
  3013. // ForceSendFields is a list of field names (e.g. "Confidence") to
  3014. // unconditionally include in API requests. By default, fields with
  3015. // empty values are omitted from API requests. However, any non-pointer,
  3016. // non-interface field appearing in ForceSendFields will be sent to the
  3017. // server regardless of whether the field is empty or not. This may be
  3018. // used to include empty fields in Patch requests.
  3019. ForceSendFields []string `json:"-"`
  3020. // NullFields is a list of field names (e.g. "Confidence") to include in
  3021. // API requests with the JSON null value. By default, fields with empty
  3022. // values are omitted from API requests. However, any field with an
  3023. // empty value appearing in NullFields will be sent to the server as
  3024. // null. It is an error if a field in this list has a non-empty value.
  3025. // This may be used to include null fields in Patch requests.
  3026. NullFields []string `json:"-"`
  3027. }
  3028. func (s *GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage) MarshalJSON() ([]byte, error) {
  3029. type NoMethod GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage
  3030. raw := NoMethod(*s)
  3031. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3032. }
  3033. func (s *GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage) UnmarshalJSON(data []byte) error {
  3034. type NoMethod GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage
  3035. var s1 struct {
  3036. Confidence gensupport.JSONFloat64 `json:"confidence"`
  3037. *NoMethod
  3038. }
  3039. s1.NoMethod = (*NoMethod)(s)
  3040. if err := json.Unmarshal(data, &s1); err != nil {
  3041. return err
  3042. }
  3043. s.Confidence = float64(s1.Confidence)
  3044. return nil
  3045. }
  3046. // GoogleCloudVisionV1p2beta1TextAnnotationTextProperty: Additional
  3047. // information detected on the structural component.
  3048. type GoogleCloudVisionV1p2beta1TextAnnotationTextProperty struct {
  3049. // DetectedBreak: Detected start or end of a text segment.
  3050. DetectedBreak *GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak `json:"detectedBreak,omitempty"`
  3051. // DetectedLanguages: A list of detected languages together with
  3052. // confidence.
  3053. DetectedLanguages []*GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage `json:"detectedLanguages,omitempty"`
  3054. // ForceSendFields is a list of field names (e.g. "DetectedBreak") to
  3055. // unconditionally include in API requests. By default, fields with
  3056. // empty values are omitted from API requests. However, any non-pointer,
  3057. // non-interface field appearing in ForceSendFields will be sent to the
  3058. // server regardless of whether the field is empty or not. This may be
  3059. // used to include empty fields in Patch requests.
  3060. ForceSendFields []string `json:"-"`
  3061. // NullFields is a list of field names (e.g. "DetectedBreak") to include
  3062. // in API requests with the JSON null value. By default, fields with
  3063. // empty values are omitted from API requests. However, any field with
  3064. // an empty value appearing in NullFields will be sent to the server as
  3065. // null. It is an error if a field in this list has a non-empty value.
  3066. // This may be used to include null fields in Patch requests.
  3067. NullFields []string `json:"-"`
  3068. }
  3069. func (s *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty) MarshalJSON() ([]byte, error) {
  3070. type NoMethod GoogleCloudVisionV1p2beta1TextAnnotationTextProperty
  3071. raw := NoMethod(*s)
  3072. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3073. }
  3074. // GoogleCloudVisionV1p2beta1Vertex: A vertex represents a 2D point in
  3075. // the image.
  3076. // NOTE: the vertex coordinates are in the same scale as the original
  3077. // image.
  3078. type GoogleCloudVisionV1p2beta1Vertex struct {
  3079. // X: X coordinate.
  3080. X int64 `json:"x,omitempty"`
  3081. // Y: Y coordinate.
  3082. Y int64 `json:"y,omitempty"`
  3083. // ForceSendFields is a list of field names (e.g. "X") to
  3084. // unconditionally include in API requests. By default, fields with
  3085. // empty values are omitted from API requests. However, any non-pointer,
  3086. // non-interface field appearing in ForceSendFields will be sent to the
  3087. // server regardless of whether the field is empty or not. This may be
  3088. // used to include empty fields in Patch requests.
  3089. ForceSendFields []string `json:"-"`
  3090. // NullFields is a list of field names (e.g. "X") to include in API
  3091. // requests with the JSON null value. By default, fields with empty
  3092. // values are omitted from API requests. However, any field with an
  3093. // empty value appearing in NullFields will be sent to the server as
  3094. // null. It is an error if a field in this list has a non-empty value.
  3095. // This may be used to include null fields in Patch requests.
  3096. NullFields []string `json:"-"`
  3097. }
  3098. func (s *GoogleCloudVisionV1p2beta1Vertex) MarshalJSON() ([]byte, error) {
  3099. type NoMethod GoogleCloudVisionV1p2beta1Vertex
  3100. raw := NoMethod(*s)
  3101. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3102. }
  3103. // GoogleCloudVisionV1p2beta1WebDetection: Relevant information for the
  3104. // image from the Internet.
  3105. type GoogleCloudVisionV1p2beta1WebDetection struct {
  3106. // BestGuessLabels: The service's best guess as to the topic of the
  3107. // request image.
  3108. // Inferred from similar images on the open web.
  3109. BestGuessLabels []*GoogleCloudVisionV1p2beta1WebDetectionWebLabel `json:"bestGuessLabels,omitempty"`
  3110. // FullMatchingImages: Fully matching images from the Internet.
  3111. // Can include resized copies of the query image.
  3112. FullMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"`
  3113. // PagesWithMatchingImages: Web pages containing the matching images
  3114. // from the Internet.
  3115. PagesWithMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebPage `json:"pagesWithMatchingImages,omitempty"`
  3116. // PartialMatchingImages: Partial matching images from the
  3117. // Internet.
  3118. // Those images are similar enough to share some key-point features.
  3119. // For
  3120. // example an original image will likely have partial matching for its
  3121. // crops.
  3122. PartialMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"`
  3123. // VisuallySimilarImages: The visually similar image results.
  3124. VisuallySimilarImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"visuallySimilarImages,omitempty"`
  3125. // WebEntities: Deduced entities from similar images on the Internet.
  3126. WebEntities []*GoogleCloudVisionV1p2beta1WebDetectionWebEntity `json:"webEntities,omitempty"`
  3127. // ForceSendFields is a list of field names (e.g. "BestGuessLabels") to
  3128. // unconditionally include in API requests. By default, fields with
  3129. // empty values are omitted from API requests. However, any non-pointer,
  3130. // non-interface field appearing in ForceSendFields will be sent to the
  3131. // server regardless of whether the field is empty or not. This may be
  3132. // used to include empty fields in Patch requests.
  3133. ForceSendFields []string `json:"-"`
  3134. // NullFields is a list of field names (e.g. "BestGuessLabels") to
  3135. // include in API requests with the JSON null value. By default, fields
  3136. // with empty values are omitted from API requests. However, any field
  3137. // with an empty value appearing in NullFields will be sent to the
  3138. // server as null. It is an error if a field in this list has a
  3139. // non-empty value. This may be used to include null fields in Patch
  3140. // requests.
  3141. NullFields []string `json:"-"`
  3142. }
  3143. func (s *GoogleCloudVisionV1p2beta1WebDetection) MarshalJSON() ([]byte, error) {
  3144. type NoMethod GoogleCloudVisionV1p2beta1WebDetection
  3145. raw := NoMethod(*s)
  3146. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3147. }
  3148. // GoogleCloudVisionV1p2beta1WebDetectionParams: Parameters for web
  3149. // detection request.
  3150. type GoogleCloudVisionV1p2beta1WebDetectionParams struct {
  3151. // IncludeGeoResults: Whether to include results derived from the geo
  3152. // information in the image.
  3153. IncludeGeoResults bool `json:"includeGeoResults,omitempty"`
  3154. // ForceSendFields is a list of field names (e.g. "IncludeGeoResults")
  3155. // to unconditionally include in API requests. By default, fields with
  3156. // empty values are omitted from API requests. However, any non-pointer,
  3157. // non-interface field appearing in ForceSendFields will be sent to the
  3158. // server regardless of whether the field is empty or not. This may be
  3159. // used to include empty fields in Patch requests.
  3160. ForceSendFields []string `json:"-"`
  3161. // NullFields is a list of field names (e.g. "IncludeGeoResults") to
  3162. // include in API requests with the JSON null value. By default, fields
  3163. // with empty values are omitted from API requests. However, any field
  3164. // with an empty value appearing in NullFields will be sent to the
  3165. // server as null. It is an error if a field in this list has a
  3166. // non-empty value. This may be used to include null fields in Patch
  3167. // requests.
  3168. NullFields []string `json:"-"`
  3169. }
  3170. func (s *GoogleCloudVisionV1p2beta1WebDetectionParams) MarshalJSON() ([]byte, error) {
  3171. type NoMethod GoogleCloudVisionV1p2beta1WebDetectionParams
  3172. raw := NoMethod(*s)
  3173. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3174. }
  3175. // GoogleCloudVisionV1p2beta1WebDetectionWebEntity: Entity deduced from
  3176. // similar images on the Internet.
  3177. type GoogleCloudVisionV1p2beta1WebDetectionWebEntity struct {
  3178. // Description: Canonical description of the entity, in English.
  3179. Description string `json:"description,omitempty"`
  3180. // EntityId: Opaque entity ID.
  3181. EntityId string `json:"entityId,omitempty"`
  3182. // Score: Overall relevancy score for the entity.
  3183. // Not normalized and not comparable across different image queries.
  3184. Score float64 `json:"score,omitempty"`
  3185. // ForceSendFields is a list of field names (e.g. "Description") to
  3186. // unconditionally include in API requests. By default, fields with
  3187. // empty values are omitted from API requests. However, any non-pointer,
  3188. // non-interface field appearing in ForceSendFields will be sent to the
  3189. // server regardless of whether the field is empty or not. This may be
  3190. // used to include empty fields in Patch requests.
  3191. ForceSendFields []string `json:"-"`
  3192. // NullFields is a list of field names (e.g. "Description") to include
  3193. // in API requests with the JSON null value. By default, fields with
  3194. // empty values are omitted from API requests. However, any field with
  3195. // an empty value appearing in NullFields will be sent to the server as
  3196. // null. It is an error if a field in this list has a non-empty value.
  3197. // This may be used to include null fields in Patch requests.
  3198. NullFields []string `json:"-"`
  3199. }
  3200. func (s *GoogleCloudVisionV1p2beta1WebDetectionWebEntity) MarshalJSON() ([]byte, error) {
  3201. type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebEntity
  3202. raw := NoMethod(*s)
  3203. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3204. }
  3205. func (s *GoogleCloudVisionV1p2beta1WebDetectionWebEntity) UnmarshalJSON(data []byte) error {
  3206. type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebEntity
  3207. var s1 struct {
  3208. Score gensupport.JSONFloat64 `json:"score"`
  3209. *NoMethod
  3210. }
  3211. s1.NoMethod = (*NoMethod)(s)
  3212. if err := json.Unmarshal(data, &s1); err != nil {
  3213. return err
  3214. }
  3215. s.Score = float64(s1.Score)
  3216. return nil
  3217. }
  3218. // GoogleCloudVisionV1p2beta1WebDetectionWebImage: Metadata for online
  3219. // images.
  3220. type GoogleCloudVisionV1p2beta1WebDetectionWebImage struct {
  3221. // Score: (Deprecated) Overall relevancy score for the image.
  3222. Score float64 `json:"score,omitempty"`
  3223. // Url: The result image URL.
  3224. Url string `json:"url,omitempty"`
  3225. // ForceSendFields is a list of field names (e.g. "Score") to
  3226. // unconditionally include in API requests. By default, fields with
  3227. // empty values are omitted from API requests. However, any non-pointer,
  3228. // non-interface field appearing in ForceSendFields will be sent to the
  3229. // server regardless of whether the field is empty or not. This may be
  3230. // used to include empty fields in Patch requests.
  3231. ForceSendFields []string `json:"-"`
  3232. // NullFields is a list of field names (e.g. "Score") to include in API
  3233. // requests with the JSON null value. By default, fields with empty
  3234. // values are omitted from API requests. However, any field with an
  3235. // empty value appearing in NullFields will be sent to the server as
  3236. // null. It is an error if a field in this list has a non-empty value.
  3237. // This may be used to include null fields in Patch requests.
  3238. NullFields []string `json:"-"`
  3239. }
  3240. func (s *GoogleCloudVisionV1p2beta1WebDetectionWebImage) MarshalJSON() ([]byte, error) {
  3241. type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebImage
  3242. raw := NoMethod(*s)
  3243. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3244. }
  3245. func (s *GoogleCloudVisionV1p2beta1WebDetectionWebImage) UnmarshalJSON(data []byte) error {
  3246. type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebImage
  3247. var s1 struct {
  3248. Score gensupport.JSONFloat64 `json:"score"`
  3249. *NoMethod
  3250. }
  3251. s1.NoMethod = (*NoMethod)(s)
  3252. if err := json.Unmarshal(data, &s1); err != nil {
  3253. return err
  3254. }
  3255. s.Score = float64(s1.Score)
  3256. return nil
  3257. }
  3258. // GoogleCloudVisionV1p2beta1WebDetectionWebLabel: Label to provide
  3259. // extra metadata for the web detection.
  3260. type GoogleCloudVisionV1p2beta1WebDetectionWebLabel struct {
  3261. // Label: Label for extra metadata.
  3262. Label string `json:"label,omitempty"`
  3263. // LanguageCode: The BCP-47 language code for `label`, such as "en-US"
  3264. // or "sr-Latn".
  3265. // For more information,
  3266. // see
  3267. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  3268. LanguageCode string `json:"languageCode,omitempty"`
  3269. // ForceSendFields is a list of field names (e.g. "Label") to
  3270. // unconditionally include in API requests. By default, fields with
  3271. // empty values are omitted from API requests. However, any non-pointer,
  3272. // non-interface field appearing in ForceSendFields will be sent to the
  3273. // server regardless of whether the field is empty or not. This may be
  3274. // used to include empty fields in Patch requests.
  3275. ForceSendFields []string `json:"-"`
  3276. // NullFields is a list of field names (e.g. "Label") to include in API
  3277. // requests with the JSON null value. By default, fields with empty
  3278. // values are omitted from API requests. However, any field with an
  3279. // empty value appearing in NullFields will be sent to the server as
  3280. // null. It is an error if a field in this list has a non-empty value.
  3281. // This may be used to include null fields in Patch requests.
  3282. NullFields []string `json:"-"`
  3283. }
  3284. func (s *GoogleCloudVisionV1p2beta1WebDetectionWebLabel) MarshalJSON() ([]byte, error) {
  3285. type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebLabel
  3286. raw := NoMethod(*s)
  3287. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3288. }
  3289. // GoogleCloudVisionV1p2beta1WebDetectionWebPage: Metadata for web
  3290. // pages.
  3291. type GoogleCloudVisionV1p2beta1WebDetectionWebPage struct {
  3292. // FullMatchingImages: Fully matching images on the page.
  3293. // Can include resized copies of the query image.
  3294. FullMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"`
  3295. // PageTitle: Title for the web page, may contain HTML markups.
  3296. PageTitle string `json:"pageTitle,omitempty"`
  3297. // PartialMatchingImages: Partial matching images on the page.
  3298. // Those images are similar enough to share some key-point features.
  3299. // For
  3300. // example an original image will likely have partial matching for
  3301. // its
  3302. // crops.
  3303. PartialMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"`
  3304. // Score: (Deprecated) Overall relevancy score for the web page.
  3305. Score float64 `json:"score,omitempty"`
  3306. // Url: The result web page URL.
  3307. Url string `json:"url,omitempty"`
  3308. // ForceSendFields is a list of field names (e.g. "FullMatchingImages")
  3309. // to unconditionally include in API requests. By default, fields with
  3310. // empty values are omitted from API requests. However, any non-pointer,
  3311. // non-interface field appearing in ForceSendFields will be sent to the
  3312. // server regardless of whether the field is empty or not. This may be
  3313. // used to include empty fields in Patch requests.
  3314. ForceSendFields []string `json:"-"`
  3315. // NullFields is a list of field names (e.g. "FullMatchingImages") to
  3316. // include in API requests with the JSON null value. By default, fields
  3317. // with empty values are omitted from API requests. However, any field
  3318. // with an empty value appearing in NullFields will be sent to the
  3319. // server as null. It is an error if a field in this list has a
  3320. // non-empty value. This may be used to include null fields in Patch
  3321. // requests.
  3322. NullFields []string `json:"-"`
  3323. }
  3324. func (s *GoogleCloudVisionV1p2beta1WebDetectionWebPage) MarshalJSON() ([]byte, error) {
  3325. type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebPage
  3326. raw := NoMethod(*s)
  3327. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3328. }
  3329. func (s *GoogleCloudVisionV1p2beta1WebDetectionWebPage) UnmarshalJSON(data []byte) error {
  3330. type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebPage
  3331. var s1 struct {
  3332. Score gensupport.JSONFloat64 `json:"score"`
  3333. *NoMethod
  3334. }
  3335. s1.NoMethod = (*NoMethod)(s)
  3336. if err := json.Unmarshal(data, &s1); err != nil {
  3337. return err
  3338. }
  3339. s.Score = float64(s1.Score)
  3340. return nil
  3341. }
  3342. // GoogleCloudVisionV1p2beta1Word: A word representation.
  3343. type GoogleCloudVisionV1p2beta1Word struct {
  3344. // BoundingBox: The bounding box for the word.
  3345. // The vertices are in the order of top-left, top-right,
  3346. // bottom-right,
  3347. // bottom-left. When a rotation of the bounding box is detected the
  3348. // rotation
  3349. // is represented as around the top-left corner as defined when the text
  3350. // is
  3351. // read in the 'natural' orientation.
  3352. // For example:
  3353. // * when the text is horizontal it might look like:
  3354. // 0----1
  3355. // | |
  3356. // 3----2
  3357. // * when it's rotated 180 degrees around the top-left corner it
  3358. // becomes:
  3359. // 2----3
  3360. // | |
  3361. // 1----0
  3362. // and the vertice order will still be (0, 1, 2, 3).
  3363. BoundingBox *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingBox,omitempty"`
  3364. // Confidence: Confidence of the OCR results for the word. Range [0, 1].
  3365. Confidence float64 `json:"confidence,omitempty"`
  3366. // Property: Additional information detected for the word.
  3367. Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"`
  3368. // Symbols: List of symbols in the word.
  3369. // The order of the symbols follows the natural reading order.
  3370. Symbols []*GoogleCloudVisionV1p2beta1Symbol `json:"symbols,omitempty"`
  3371. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  3372. // unconditionally include in API requests. By default, fields with
  3373. // empty values are omitted from API requests. However, any non-pointer,
  3374. // non-interface field appearing in ForceSendFields will be sent to the
  3375. // server regardless of whether the field is empty or not. This may be
  3376. // used to include empty fields in Patch requests.
  3377. ForceSendFields []string `json:"-"`
  3378. // NullFields is a list of field names (e.g. "BoundingBox") to include
  3379. // in API requests with the JSON null value. By default, fields with
  3380. // empty values are omitted from API requests. However, any field with
  3381. // an empty value appearing in NullFields will be sent to the server as
  3382. // null. It is an error if a field in this list has a non-empty value.
  3383. // This may be used to include null fields in Patch requests.
  3384. NullFields []string `json:"-"`
  3385. }
  3386. func (s *GoogleCloudVisionV1p2beta1Word) MarshalJSON() ([]byte, error) {
  3387. type NoMethod GoogleCloudVisionV1p2beta1Word
  3388. raw := NoMethod(*s)
  3389. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3390. }
  3391. func (s *GoogleCloudVisionV1p2beta1Word) UnmarshalJSON(data []byte) error {
  3392. type NoMethod GoogleCloudVisionV1p2beta1Word
  3393. var s1 struct {
  3394. Confidence gensupport.JSONFloat64 `json:"confidence"`
  3395. *NoMethod
  3396. }
  3397. s1.NoMethod = (*NoMethod)(s)
  3398. if err := json.Unmarshal(data, &s1); err != nil {
  3399. return err
  3400. }
  3401. s.Confidence = float64(s1.Confidence)
  3402. return nil
  3403. }
  3404. // GoogleCloudVisionV1p3beta1BatchOperationMetadata: Metadata for the
  3405. // batch operations such as the current state.
  3406. //
  3407. // This is included in the `metadata` field of the `Operation` returned
  3408. // by the
  3409. // `GetOperation` call of the `google::longrunning::Operations` service.
  3410. type GoogleCloudVisionV1p3beta1BatchOperationMetadata struct {
  3411. // EndTime: The time when the batch request is finished
  3412. // and
  3413. // google.longrunning.Operation.done is set to true.
  3414. EndTime string `json:"endTime,omitempty"`
  3415. // State: The current state of the batch operation.
  3416. //
  3417. // Possible values:
  3418. // "STATE_UNSPECIFIED" - Invalid.
  3419. // "PROCESSING" - Request is actively being processed.
  3420. // "SUCCESSFUL" - The request is done and at least one item has been
  3421. // successfully
  3422. // processed.
  3423. // "FAILED" - The request is done and no item has been successfully
  3424. // processed.
  3425. // "CANCELLED" - The request is done after the
  3426. // longrunning.Operations.CancelOperation has
  3427. // been called by the user. Any records that were processed before
  3428. // the
  3429. // cancel command are output as specified in the request.
  3430. State string `json:"state,omitempty"`
  3431. // SubmitTime: The time when the batch request was submitted to the
  3432. // server.
  3433. SubmitTime string `json:"submitTime,omitempty"`
  3434. // ForceSendFields is a list of field names (e.g. "EndTime") to
  3435. // unconditionally include in API requests. By default, fields with
  3436. // empty values are omitted from API requests. However, any non-pointer,
  3437. // non-interface field appearing in ForceSendFields will be sent to the
  3438. // server regardless of whether the field is empty or not. This may be
  3439. // used to include empty fields in Patch requests.
  3440. ForceSendFields []string `json:"-"`
  3441. // NullFields is a list of field names (e.g. "EndTime") to include in
  3442. // API requests with the JSON null value. By default, fields with empty
  3443. // values are omitted from API requests. However, any field with an
  3444. // empty value appearing in NullFields will be sent to the server as
  3445. // null. It is an error if a field in this list has a non-empty value.
  3446. // This may be used to include null fields in Patch requests.
  3447. NullFields []string `json:"-"`
  3448. }
  3449. func (s *GoogleCloudVisionV1p3beta1BatchOperationMetadata) MarshalJSON() ([]byte, error) {
  3450. type NoMethod GoogleCloudVisionV1p3beta1BatchOperationMetadata
  3451. raw := NoMethod(*s)
  3452. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3453. }
  3454. // GoogleCloudVisionV1p3beta1BoundingPoly: A bounding polygon for the
  3455. // detected image annotation.
  3456. type GoogleCloudVisionV1p3beta1BoundingPoly struct {
  3457. // NormalizedVertices: The bounding polygon normalized vertices.
  3458. NormalizedVertices []*GoogleCloudVisionV1p3beta1NormalizedVertex `json:"normalizedVertices,omitempty"`
  3459. // Vertices: The bounding polygon vertices.
  3460. Vertices []*GoogleCloudVisionV1p3beta1Vertex `json:"vertices,omitempty"`
  3461. // ForceSendFields is a list of field names (e.g. "NormalizedVertices")
  3462. // to unconditionally include in API requests. By default, fields with
  3463. // empty values are omitted from API requests. However, any non-pointer,
  3464. // non-interface field appearing in ForceSendFields will be sent to the
  3465. // server regardless of whether the field is empty or not. This may be
  3466. // used to include empty fields in Patch requests.
  3467. ForceSendFields []string `json:"-"`
  3468. // NullFields is a list of field names (e.g. "NormalizedVertices") to
  3469. // include in API requests with the JSON null value. By default, fields
  3470. // with empty values are omitted from API requests. However, any field
  3471. // with an empty value appearing in NullFields will be sent to the
  3472. // server as null. It is an error if a field in this list has a
  3473. // non-empty value. This may be used to include null fields in Patch
  3474. // requests.
  3475. NullFields []string `json:"-"`
  3476. }
  3477. func (s *GoogleCloudVisionV1p3beta1BoundingPoly) MarshalJSON() ([]byte, error) {
  3478. type NoMethod GoogleCloudVisionV1p3beta1BoundingPoly
  3479. raw := NoMethod(*s)
  3480. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3481. }
  3482. // GoogleCloudVisionV1p3beta1ImportProductSetsResponse: Response message
  3483. // for the `ImportProductSets` method.
  3484. //
  3485. // This message is returned by
  3486. // the
  3487. // google.longrunning.Operations.GetOperation method in the
  3488. // returned
  3489. // google.longrunning.Operation.response field.
  3490. type GoogleCloudVisionV1p3beta1ImportProductSetsResponse struct {
  3491. // ReferenceImages: The list of reference_images that are imported
  3492. // successfully.
  3493. ReferenceImages []*GoogleCloudVisionV1p3beta1ReferenceImage `json:"referenceImages,omitempty"`
  3494. // Statuses: The rpc status for each ImportProductSet request, including
  3495. // both successes
  3496. // and errors.
  3497. //
  3498. // The number of statuses here matches the number of lines in the csv
  3499. // file,
  3500. // and statuses[i] stores the success or failure status of processing
  3501. // the i-th
  3502. // line of the csv, starting from line 0.
  3503. Statuses []*Status `json:"statuses,omitempty"`
  3504. // ForceSendFields is a list of field names (e.g. "ReferenceImages") to
  3505. // unconditionally include in API requests. By default, fields with
  3506. // empty values are omitted from API requests. However, any non-pointer,
  3507. // non-interface field appearing in ForceSendFields will be sent to the
  3508. // server regardless of whether the field is empty or not. This may be
  3509. // used to include empty fields in Patch requests.
  3510. ForceSendFields []string `json:"-"`
  3511. // NullFields is a list of field names (e.g. "ReferenceImages") to
  3512. // include in API requests with the JSON null value. By default, fields
  3513. // with empty values are omitted from API requests. However, any field
  3514. // with an empty value appearing in NullFields will be sent to the
  3515. // server as null. It is an error if a field in this list has a
  3516. // non-empty value. This may be used to include null fields in Patch
  3517. // requests.
  3518. NullFields []string `json:"-"`
  3519. }
  3520. func (s *GoogleCloudVisionV1p3beta1ImportProductSetsResponse) MarshalJSON() ([]byte, error) {
  3521. type NoMethod GoogleCloudVisionV1p3beta1ImportProductSetsResponse
  3522. raw := NoMethod(*s)
  3523. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3524. }
  3525. // GoogleCloudVisionV1p3beta1NormalizedVertex: A vertex represents a 2D
  3526. // point in the image.
  3527. // NOTE: the normalized vertex coordinates are relative to the original
  3528. // image
  3529. // and range from 0 to 1.
  3530. type GoogleCloudVisionV1p3beta1NormalizedVertex struct {
  3531. // X: X coordinate.
  3532. X float64 `json:"x,omitempty"`
  3533. // Y: Y coordinate.
  3534. Y float64 `json:"y,omitempty"`
  3535. // ForceSendFields is a list of field names (e.g. "X") to
  3536. // unconditionally include in API requests. By default, fields with
  3537. // empty values are omitted from API requests. However, any non-pointer,
  3538. // non-interface field appearing in ForceSendFields will be sent to the
  3539. // server regardless of whether the field is empty or not. This may be
  3540. // used to include empty fields in Patch requests.
  3541. ForceSendFields []string `json:"-"`
  3542. // NullFields is a list of field names (e.g. "X") to include in API
  3543. // requests with the JSON null value. By default, fields with empty
  3544. // values are omitted from API requests. However, any field with an
  3545. // empty value appearing in NullFields will be sent to the server as
  3546. // null. It is an error if a field in this list has a non-empty value.
  3547. // This may be used to include null fields in Patch requests.
  3548. NullFields []string `json:"-"`
  3549. }
  3550. func (s *GoogleCloudVisionV1p3beta1NormalizedVertex) MarshalJSON() ([]byte, error) {
  3551. type NoMethod GoogleCloudVisionV1p3beta1NormalizedVertex
  3552. raw := NoMethod(*s)
  3553. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3554. }
  3555. func (s *GoogleCloudVisionV1p3beta1NormalizedVertex) UnmarshalJSON(data []byte) error {
  3556. type NoMethod GoogleCloudVisionV1p3beta1NormalizedVertex
  3557. var s1 struct {
  3558. X gensupport.JSONFloat64 `json:"x"`
  3559. Y gensupport.JSONFloat64 `json:"y"`
  3560. *NoMethod
  3561. }
  3562. s1.NoMethod = (*NoMethod)(s)
  3563. if err := json.Unmarshal(data, &s1); err != nil {
  3564. return err
  3565. }
  3566. s.X = float64(s1.X)
  3567. s.Y = float64(s1.Y)
  3568. return nil
  3569. }
  3570. // GoogleCloudVisionV1p3beta1ReferenceImage: A `ReferenceImage`
  3571. // represents a product image and its associated metadata,
  3572. // such as bounding boxes.
  3573. type GoogleCloudVisionV1p3beta1ReferenceImage struct {
  3574. // BoundingPolys: Bounding polygons around the areas of interest in the
  3575. // reference image.
  3576. // Optional. If this field is empty, the system will try to detect
  3577. // regions of
  3578. // interest. At most 10 bounding polygons will be used.
  3579. //
  3580. // The provided shape is converted into a non-rotated rectangle.
  3581. // Once
  3582. // converted, the small edge of the rectangle must be greater than or
  3583. // equal
  3584. // to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok;
  3585. // 1:5
  3586. // is not).
  3587. BoundingPolys []*GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPolys,omitempty"`
  3588. // Name: The resource name of the reference image.
  3589. //
  3590. // Format
  3591. // is:
  3592. //
  3593. // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referen
  3594. // ceImages/IMAGE_ID`.
  3595. //
  3596. // This field is ignored when creating a reference image.
  3597. Name string `json:"name,omitempty"`
  3598. // Uri: The Google Cloud Storage URI of the reference image.
  3599. //
  3600. // The URI must start with `gs://`.
  3601. //
  3602. // Required.
  3603. Uri string `json:"uri,omitempty"`
  3604. // ForceSendFields is a list of field names (e.g. "BoundingPolys") to
  3605. // unconditionally include in API requests. By default, fields with
  3606. // empty values are omitted from API requests. However, any non-pointer,
  3607. // non-interface field appearing in ForceSendFields will be sent to the
  3608. // server regardless of whether the field is empty or not. This may be
  3609. // used to include empty fields in Patch requests.
  3610. ForceSendFields []string `json:"-"`
  3611. // NullFields is a list of field names (e.g. "BoundingPolys") to include
  3612. // in API requests with the JSON null value. By default, fields with
  3613. // empty values are omitted from API requests. However, any field with
  3614. // an empty value appearing in NullFields will be sent to the server as
  3615. // null. It is an error if a field in this list has a non-empty value.
  3616. // This may be used to include null fields in Patch requests.
  3617. NullFields []string `json:"-"`
  3618. }
  3619. func (s *GoogleCloudVisionV1p3beta1ReferenceImage) MarshalJSON() ([]byte, error) {
  3620. type NoMethod GoogleCloudVisionV1p3beta1ReferenceImage
  3621. raw := NoMethod(*s)
  3622. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3623. }
  3624. // GoogleCloudVisionV1p3beta1Vertex: A vertex represents a 2D point in
  3625. // the image.
  3626. // NOTE: the vertex coordinates are in the same scale as the original
  3627. // image.
  3628. type GoogleCloudVisionV1p3beta1Vertex struct {
  3629. // X: X coordinate.
  3630. X int64 `json:"x,omitempty"`
  3631. // Y: Y coordinate.
  3632. Y int64 `json:"y,omitempty"`
  3633. // ForceSendFields is a list of field names (e.g. "X") to
  3634. // unconditionally include in API requests. By default, fields with
  3635. // empty values are omitted from API requests. However, any non-pointer,
  3636. // non-interface field appearing in ForceSendFields will be sent to the
  3637. // server regardless of whether the field is empty or not. This may be
  3638. // used to include empty fields in Patch requests.
  3639. ForceSendFields []string `json:"-"`
  3640. // NullFields is a list of field names (e.g. "X") to include in API
  3641. // requests with the JSON null value. By default, fields with empty
  3642. // values are omitted from API requests. However, any field with an
  3643. // empty value appearing in NullFields will be sent to the server as
  3644. // null. It is an error if a field in this list has a non-empty value.
  3645. // This may be used to include null fields in Patch requests.
  3646. NullFields []string `json:"-"`
  3647. }
  3648. func (s *GoogleCloudVisionV1p3beta1Vertex) MarshalJSON() ([]byte, error) {
  3649. type NoMethod GoogleCloudVisionV1p3beta1Vertex
  3650. raw := NoMethod(*s)
  3651. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3652. }
  3653. // ImageAnnotationContext: If an image was produced from a file (e.g. a
  3654. // PDF), this message gives
  3655. // information about the source of that image.
  3656. type ImageAnnotationContext struct {
  3657. // PageNumber: If the file was a PDF or TIFF, this field gives the page
  3658. // number within
  3659. // the file used to produce the image.
  3660. PageNumber int64 `json:"pageNumber,omitempty"`
  3661. // Uri: The URI of the file used to produce the image.
  3662. Uri string `json:"uri,omitempty"`
  3663. // ForceSendFields is a list of field names (e.g. "PageNumber") to
  3664. // unconditionally include in API requests. By default, fields with
  3665. // empty values are omitted from API requests. However, any non-pointer,
  3666. // non-interface field appearing in ForceSendFields will be sent to the
  3667. // server regardless of whether the field is empty or not. This may be
  3668. // used to include empty fields in Patch requests.
  3669. ForceSendFields []string `json:"-"`
  3670. // NullFields is a list of field names (e.g. "PageNumber") to include in
  3671. // API requests with the JSON null value. By default, fields with empty
  3672. // values are omitted from API requests. However, any field with an
  3673. // empty value appearing in NullFields will be sent to the server as
  3674. // null. It is an error if a field in this list has a non-empty value.
  3675. // This may be used to include null fields in Patch requests.
  3676. NullFields []string `json:"-"`
  3677. }
  3678. func (s *ImageAnnotationContext) MarshalJSON() ([]byte, error) {
  3679. type NoMethod ImageAnnotationContext
  3680. raw := NoMethod(*s)
  3681. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3682. }
  3683. // ImageProperties: Stores image properties, such as dominant colors.
  3684. type ImageProperties struct {
  3685. // DominantColors: If present, dominant colors completed successfully.
  3686. DominantColors *DominantColorsAnnotation `json:"dominantColors,omitempty"`
  3687. // ForceSendFields is a list of field names (e.g. "DominantColors") to
  3688. // unconditionally include in API requests. By default, fields with
  3689. // empty values are omitted from API requests. However, any non-pointer,
  3690. // non-interface field appearing in ForceSendFields will be sent to the
  3691. // server regardless of whether the field is empty or not. This may be
  3692. // used to include empty fields in Patch requests.
  3693. ForceSendFields []string `json:"-"`
  3694. // NullFields is a list of field names (e.g. "DominantColors") to
  3695. // include in API requests with the JSON null value. By default, fields
  3696. // with empty values are omitted from API requests. However, any field
  3697. // with an empty value appearing in NullFields will be sent to the
  3698. // server as null. It is an error if a field in this list has a
  3699. // non-empty value. This may be used to include null fields in Patch
  3700. // requests.
  3701. NullFields []string `json:"-"`
  3702. }
  3703. func (s *ImageProperties) MarshalJSON() ([]byte, error) {
  3704. type NoMethod ImageProperties
  3705. raw := NoMethod(*s)
  3706. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3707. }
  3708. // InputConfig: The desired input location and metadata.
  3709. type InputConfig struct {
  3710. // GcsSource: The Google Cloud Storage location to read the input from.
  3711. GcsSource *GcsSource `json:"gcsSource,omitempty"`
  3712. // MimeType: The type of the file. Currently only "application/pdf" and
  3713. // "image/tiff"
  3714. // are supported. Wildcards are not supported.
  3715. MimeType string `json:"mimeType,omitempty"`
  3716. // ForceSendFields is a list of field names (e.g. "GcsSource") to
  3717. // unconditionally include in API requests. By default, fields with
  3718. // empty values are omitted from API requests. However, any non-pointer,
  3719. // non-interface field appearing in ForceSendFields will be sent to the
  3720. // server regardless of whether the field is empty or not. This may be
  3721. // used to include empty fields in Patch requests.
  3722. ForceSendFields []string `json:"-"`
  3723. // NullFields is a list of field names (e.g. "GcsSource") to include in
  3724. // API requests with the JSON null value. By default, fields with empty
  3725. // values are omitted from API requests. However, any field with an
  3726. // empty value appearing in NullFields will be sent to the server as
  3727. // null. It is an error if a field in this list has a non-empty value.
  3728. // This may be used to include null fields in Patch requests.
  3729. NullFields []string `json:"-"`
  3730. }
  3731. func (s *InputConfig) MarshalJSON() ([]byte, error) {
  3732. type NoMethod InputConfig
  3733. raw := NoMethod(*s)
  3734. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3735. }
  3736. // Landmark: A face-specific landmark (for example, a face feature).
  3737. type Landmark struct {
  3738. // Position: Face landmark position.
  3739. Position *Position `json:"position,omitempty"`
  3740. // Type: Face landmark type.
  3741. //
  3742. // Possible values:
  3743. // "UNKNOWN_LANDMARK" - Unknown face landmark detected. Should not be
  3744. // filled.
  3745. // "LEFT_EYE" - Left eye.
  3746. // "RIGHT_EYE" - Right eye.
  3747. // "LEFT_OF_LEFT_EYEBROW" - Left of left eyebrow.
  3748. // "RIGHT_OF_LEFT_EYEBROW" - Right of left eyebrow.
  3749. // "LEFT_OF_RIGHT_EYEBROW" - Left of right eyebrow.
  3750. // "RIGHT_OF_RIGHT_EYEBROW" - Right of right eyebrow.
  3751. // "MIDPOINT_BETWEEN_EYES" - Midpoint between eyes.
  3752. // "NOSE_TIP" - Nose tip.
  3753. // "UPPER_LIP" - Upper lip.
  3754. // "LOWER_LIP" - Lower lip.
  3755. // "MOUTH_LEFT" - Mouth left.
  3756. // "MOUTH_RIGHT" - Mouth right.
  3757. // "MOUTH_CENTER" - Mouth center.
  3758. // "NOSE_BOTTOM_RIGHT" - Nose, bottom right.
  3759. // "NOSE_BOTTOM_LEFT" - Nose, bottom left.
  3760. // "NOSE_BOTTOM_CENTER" - Nose, bottom center.
  3761. // "LEFT_EYE_TOP_BOUNDARY" - Left eye, top boundary.
  3762. // "LEFT_EYE_RIGHT_CORNER" - Left eye, right corner.
  3763. // "LEFT_EYE_BOTTOM_BOUNDARY" - Left eye, bottom boundary.
  3764. // "LEFT_EYE_LEFT_CORNER" - Left eye, left corner.
  3765. // "RIGHT_EYE_TOP_BOUNDARY" - Right eye, top boundary.
  3766. // "RIGHT_EYE_RIGHT_CORNER" - Right eye, right corner.
  3767. // "RIGHT_EYE_BOTTOM_BOUNDARY" - Right eye, bottom boundary.
  3768. // "RIGHT_EYE_LEFT_CORNER" - Right eye, left corner.
  3769. // "LEFT_EYEBROW_UPPER_MIDPOINT" - Left eyebrow, upper midpoint.
  3770. // "RIGHT_EYEBROW_UPPER_MIDPOINT" - Right eyebrow, upper midpoint.
  3771. // "LEFT_EAR_TRAGION" - Left ear tragion.
  3772. // "RIGHT_EAR_TRAGION" - Right ear tragion.
  3773. // "LEFT_EYE_PUPIL" - Left eye pupil.
  3774. // "RIGHT_EYE_PUPIL" - Right eye pupil.
  3775. // "FOREHEAD_GLABELLA" - Forehead glabella.
  3776. // "CHIN_GNATHION" - Chin gnathion.
  3777. // "CHIN_LEFT_GONION" - Chin left gonion.
  3778. // "CHIN_RIGHT_GONION" - Chin right gonion.
  3779. Type string `json:"type,omitempty"`
  3780. // ForceSendFields is a list of field names (e.g. "Position") to
  3781. // unconditionally include in API requests. By default, fields with
  3782. // empty values are omitted from API requests. However, any non-pointer,
  3783. // non-interface field appearing in ForceSendFields will be sent to the
  3784. // server regardless of whether the field is empty or not. This may be
  3785. // used to include empty fields in Patch requests.
  3786. ForceSendFields []string `json:"-"`
  3787. // NullFields is a list of field names (e.g. "Position") to include in
  3788. // API requests with the JSON null value. By default, fields with empty
  3789. // values are omitted from API requests. However, any field with an
  3790. // empty value appearing in NullFields will be sent to the server as
  3791. // null. It is an error if a field in this list has a non-empty value.
  3792. // This may be used to include null fields in Patch requests.
  3793. NullFields []string `json:"-"`
  3794. }
  3795. func (s *Landmark) MarshalJSON() ([]byte, error) {
  3796. type NoMethod Landmark
  3797. raw := NoMethod(*s)
  3798. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3799. }
  3800. // LatLng: An object representing a latitude/longitude pair. This is
  3801. // expressed as a pair
  3802. // of doubles representing degrees latitude and degrees longitude.
  3803. // Unless
  3804. // specified otherwise, this must conform to the
  3805. // <a
  3806. // href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
  3807. // st
  3808. // andard</a>. Values must be within normalized ranges.
  3809. type LatLng struct {
  3810. // Latitude: The latitude in degrees. It must be in the range [-90.0,
  3811. // +90.0].
  3812. Latitude float64 `json:"latitude,omitempty"`
  3813. // Longitude: The longitude in degrees. It must be in the range [-180.0,
  3814. // +180.0].
  3815. Longitude float64 `json:"longitude,omitempty"`
  3816. // ForceSendFields is a list of field names (e.g. "Latitude") to
  3817. // unconditionally include in API requests. By default, fields with
  3818. // empty values are omitted from API requests. However, any non-pointer,
  3819. // non-interface field appearing in ForceSendFields will be sent to the
  3820. // server regardless of whether the field is empty or not. This may be
  3821. // used to include empty fields in Patch requests.
  3822. ForceSendFields []string `json:"-"`
  3823. // NullFields is a list of field names (e.g. "Latitude") to include in
  3824. // API requests with the JSON null value. By default, fields with empty
  3825. // values are omitted from API requests. However, any field with an
  3826. // empty value appearing in NullFields will be sent to the server as
  3827. // null. It is an error if a field in this list has a non-empty value.
  3828. // This may be used to include null fields in Patch requests.
  3829. NullFields []string `json:"-"`
  3830. }
  3831. func (s *LatLng) MarshalJSON() ([]byte, error) {
  3832. type NoMethod LatLng
  3833. raw := NoMethod(*s)
  3834. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3835. }
  3836. func (s *LatLng) UnmarshalJSON(data []byte) error {
  3837. type NoMethod LatLng
  3838. var s1 struct {
  3839. Latitude gensupport.JSONFloat64 `json:"latitude"`
  3840. Longitude gensupport.JSONFloat64 `json:"longitude"`
  3841. *NoMethod
  3842. }
  3843. s1.NoMethod = (*NoMethod)(s)
  3844. if err := json.Unmarshal(data, &s1); err != nil {
  3845. return err
  3846. }
  3847. s.Latitude = float64(s1.Latitude)
  3848. s.Longitude = float64(s1.Longitude)
  3849. return nil
  3850. }
  3851. // LocationInfo: Detected entity location information.
  3852. type LocationInfo struct {
  3853. // LatLng: lat/long location coordinates.
  3854. LatLng *LatLng `json:"latLng,omitempty"`
  3855. // ForceSendFields is a list of field names (e.g. "LatLng") to
  3856. // unconditionally include in API requests. By default, fields with
  3857. // empty values are omitted from API requests. However, any non-pointer,
  3858. // non-interface field appearing in ForceSendFields will be sent to the
  3859. // server regardless of whether the field is empty or not. This may be
  3860. // used to include empty fields in Patch requests.
  3861. ForceSendFields []string `json:"-"`
  3862. // NullFields is a list of field names (e.g. "LatLng") to include in API
  3863. // requests with the JSON null value. By default, fields with empty
  3864. // values are omitted from API requests. However, any field with an
  3865. // empty value appearing in NullFields will be sent to the server as
  3866. // null. It is an error if a field in this list has a non-empty value.
  3867. // This may be used to include null fields in Patch requests.
  3868. NullFields []string `json:"-"`
  3869. }
  3870. func (s *LocationInfo) MarshalJSON() ([]byte, error) {
  3871. type NoMethod LocationInfo
  3872. raw := NoMethod(*s)
  3873. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3874. }
  3875. // NormalizedVertex: A vertex represents a 2D point in the image.
  3876. // NOTE: the normalized vertex coordinates are relative to the original
  3877. // image
  3878. // and range from 0 to 1.
  3879. type NormalizedVertex struct {
  3880. // X: X coordinate.
  3881. X float64 `json:"x,omitempty"`
  3882. // Y: Y coordinate.
  3883. Y float64 `json:"y,omitempty"`
  3884. // ForceSendFields is a list of field names (e.g. "X") to
  3885. // unconditionally include in API requests. By default, fields with
  3886. // empty values are omitted from API requests. However, any non-pointer,
  3887. // non-interface field appearing in ForceSendFields will be sent to the
  3888. // server regardless of whether the field is empty or not. This may be
  3889. // used to include empty fields in Patch requests.
  3890. ForceSendFields []string `json:"-"`
  3891. // NullFields is a list of field names (e.g. "X") to include in API
  3892. // requests with the JSON null value. By default, fields with empty
  3893. // values are omitted from API requests. However, any field with an
  3894. // empty value appearing in NullFields will be sent to the server as
  3895. // null. It is an error if a field in this list has a non-empty value.
  3896. // This may be used to include null fields in Patch requests.
  3897. NullFields []string `json:"-"`
  3898. }
  3899. func (s *NormalizedVertex) MarshalJSON() ([]byte, error) {
  3900. type NoMethod NormalizedVertex
  3901. raw := NoMethod(*s)
  3902. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3903. }
  3904. func (s *NormalizedVertex) UnmarshalJSON(data []byte) error {
  3905. type NoMethod NormalizedVertex
  3906. var s1 struct {
  3907. X gensupport.JSONFloat64 `json:"x"`
  3908. Y gensupport.JSONFloat64 `json:"y"`
  3909. *NoMethod
  3910. }
  3911. s1.NoMethod = (*NoMethod)(s)
  3912. if err := json.Unmarshal(data, &s1); err != nil {
  3913. return err
  3914. }
  3915. s.X = float64(s1.X)
  3916. s.Y = float64(s1.Y)
  3917. return nil
  3918. }
  3919. // Operation: This resource represents a long-running operation that is
  3920. // the result of a
  3921. // network API call.
  3922. type Operation struct {
  3923. // Done: If the value is `false`, it means the operation is still in
  3924. // progress.
  3925. // If `true`, the operation is completed, and either `error` or
  3926. // `response` is
  3927. // available.
  3928. Done bool `json:"done,omitempty"`
  3929. // Error: The error result of the operation in case of failure or
  3930. // cancellation.
  3931. Error *Status `json:"error,omitempty"`
  3932. // Metadata: Service-specific metadata associated with the operation.
  3933. // It typically
  3934. // contains progress information and common metadata such as create
  3935. // time.
  3936. // Some services might not provide such metadata. Any method that
  3937. // returns a
  3938. // long-running operation should document the metadata type, if any.
  3939. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  3940. // Name: The server-assigned name, which is only unique within the same
  3941. // service that
  3942. // originally returns it. If you use the default HTTP mapping,
  3943. // the
  3944. // `name` should have the format of `operations/some/unique/name`.
  3945. Name string `json:"name,omitempty"`
  3946. // Response: The normal response of the operation in case of success.
  3947. // If the original
  3948. // method returns no data on success, such as `Delete`, the response
  3949. // is
  3950. // `google.protobuf.Empty`. If the original method is
  3951. // standard
  3952. // `Get`/`Create`/`Update`, the response should be the resource. For
  3953. // other
  3954. // methods, the response should have the type `XxxResponse`, where
  3955. // `Xxx`
  3956. // is the original method name. For example, if the original method
  3957. // name
  3958. // is `TakeSnapshot()`, the inferred response type
  3959. // is
  3960. // `TakeSnapshotResponse`.
  3961. Response googleapi.RawMessage `json:"response,omitempty"`
  3962. // ServerResponse contains the HTTP response code and headers from the
  3963. // server.
  3964. googleapi.ServerResponse `json:"-"`
  3965. // ForceSendFields is a list of field names (e.g. "Done") to
  3966. // unconditionally include in API requests. By default, fields with
  3967. // empty values are omitted from API requests. However, any non-pointer,
  3968. // non-interface field appearing in ForceSendFields will be sent to the
  3969. // server regardless of whether the field is empty or not. This may be
  3970. // used to include empty fields in Patch requests.
  3971. ForceSendFields []string `json:"-"`
  3972. // NullFields is a list of field names (e.g. "Done") to include in API
  3973. // requests with the JSON null value. By default, fields with empty
  3974. // values are omitted from API requests. However, any field with an
  3975. // empty value appearing in NullFields will be sent to the server as
  3976. // null. It is an error if a field in this list has a non-empty value.
  3977. // This may be used to include null fields in Patch requests.
  3978. NullFields []string `json:"-"`
  3979. }
  3980. func (s *Operation) MarshalJSON() ([]byte, error) {
  3981. type NoMethod Operation
  3982. raw := NoMethod(*s)
  3983. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3984. }
  3985. // OperationMetadata: Contains metadata for the BatchAnnotateImages
  3986. // operation.
  3987. type OperationMetadata struct {
  3988. // CreateTime: The time when the batch request was received.
  3989. CreateTime string `json:"createTime,omitempty"`
  3990. // State: Current state of the batch operation.
  3991. //
  3992. // Possible values:
  3993. // "STATE_UNSPECIFIED" - Invalid.
  3994. // "CREATED" - Request is received.
  3995. // "RUNNING" - Request is actively being processed.
  3996. // "DONE" - The batch processing is done.
  3997. // "CANCELLED" - The batch processing was cancelled.
  3998. State string `json:"state,omitempty"`
  3999. // UpdateTime: The time when the operation result was last updated.
  4000. UpdateTime string `json:"updateTime,omitempty"`
  4001. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  4002. // unconditionally include in API requests. By default, fields with
  4003. // empty values are omitted from API requests. However, any non-pointer,
  4004. // non-interface field appearing in ForceSendFields will be sent to the
  4005. // server regardless of whether the field is empty or not. This may be
  4006. // used to include empty fields in Patch requests.
  4007. ForceSendFields []string `json:"-"`
  4008. // NullFields is a list of field names (e.g. "CreateTime") to include in
  4009. // API requests with the JSON null value. By default, fields with empty
  4010. // values are omitted from API requests. However, any field with an
  4011. // empty value appearing in NullFields will be sent to the server as
  4012. // null. It is an error if a field in this list has a non-empty value.
  4013. // This may be used to include null fields in Patch requests.
  4014. NullFields []string `json:"-"`
  4015. }
  4016. func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
  4017. type NoMethod OperationMetadata
  4018. raw := NoMethod(*s)
  4019. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4020. }
  4021. // OutputConfig: The desired output location and metadata.
  4022. type OutputConfig struct {
  4023. // BatchSize: The max number of response protos to put into each output
  4024. // JSON file on
  4025. // Google Cloud Storage.
  4026. // The valid range is [1, 100]. If not specified, the default value is
  4027. // 20.
  4028. //
  4029. // For example, for one pdf file with 100 pages, 100 response protos
  4030. // will
  4031. // be generated. If `batch_size` = 20, then 5 json files each
  4032. // containing 20 response protos will be written under the
  4033. // prefix
  4034. // `gcs_destination`.`uri`.
  4035. //
  4036. // Currently, batch_size only applies to GcsDestination, with potential
  4037. // future
  4038. // support for other output configurations.
  4039. BatchSize int64 `json:"batchSize,omitempty"`
  4040. // GcsDestination: The Google Cloud Storage location to write the
  4041. // output(s) to.
  4042. GcsDestination *GcsDestination `json:"gcsDestination,omitempty"`
  4043. // ForceSendFields is a list of field names (e.g. "BatchSize") to
  4044. // unconditionally include in API requests. By default, fields with
  4045. // empty values are omitted from API requests. However, any non-pointer,
  4046. // non-interface field appearing in ForceSendFields will be sent to the
  4047. // server regardless of whether the field is empty or not. This may be
  4048. // used to include empty fields in Patch requests.
  4049. ForceSendFields []string `json:"-"`
  4050. // NullFields is a list of field names (e.g. "BatchSize") to include in
  4051. // API requests with the JSON null value. By default, fields with empty
  4052. // values are omitted from API requests. However, any field with an
  4053. // empty value appearing in NullFields will be sent to the server as
  4054. // null. It is an error if a field in this list has a non-empty value.
  4055. // This may be used to include null fields in Patch requests.
  4056. NullFields []string `json:"-"`
  4057. }
  4058. func (s *OutputConfig) MarshalJSON() ([]byte, error) {
  4059. type NoMethod OutputConfig
  4060. raw := NoMethod(*s)
  4061. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4062. }
  4063. // Page: Detected page from OCR.
  4064. type Page struct {
  4065. // Blocks: List of blocks of text, images etc on this page.
  4066. Blocks []*Block `json:"blocks,omitempty"`
  4067. // Confidence: Confidence of the OCR results on the page. Range [0, 1].
  4068. Confidence float64 `json:"confidence,omitempty"`
  4069. // Height: Page height. For PDFs the unit is points. For images
  4070. // (including
  4071. // TIFFs) the unit is pixels.
  4072. Height int64 `json:"height,omitempty"`
  4073. // Property: Additional information detected on the page.
  4074. Property *TextProperty `json:"property,omitempty"`
  4075. // Width: Page width. For PDFs the unit is points. For images
  4076. // (including
  4077. // TIFFs) the unit is pixels.
  4078. Width int64 `json:"width,omitempty"`
  4079. // ForceSendFields is a list of field names (e.g. "Blocks") to
  4080. // unconditionally include in API requests. By default, fields with
  4081. // empty values are omitted from API requests. However, any non-pointer,
  4082. // non-interface field appearing in ForceSendFields will be sent to the
  4083. // server regardless of whether the field is empty or not. This may be
  4084. // used to include empty fields in Patch requests.
  4085. ForceSendFields []string `json:"-"`
  4086. // NullFields is a list of field names (e.g. "Blocks") to include in API
  4087. // requests with the JSON null value. By default, fields with empty
  4088. // values are omitted from API requests. However, any field with an
  4089. // empty value appearing in NullFields will be sent to the server as
  4090. // null. It is an error if a field in this list has a non-empty value.
  4091. // This may be used to include null fields in Patch requests.
  4092. NullFields []string `json:"-"`
  4093. }
  4094. func (s *Page) MarshalJSON() ([]byte, error) {
  4095. type NoMethod Page
  4096. raw := NoMethod(*s)
  4097. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4098. }
  4099. func (s *Page) UnmarshalJSON(data []byte) error {
  4100. type NoMethod Page
  4101. var s1 struct {
  4102. Confidence gensupport.JSONFloat64 `json:"confidence"`
  4103. *NoMethod
  4104. }
  4105. s1.NoMethod = (*NoMethod)(s)
  4106. if err := json.Unmarshal(data, &s1); err != nil {
  4107. return err
  4108. }
  4109. s.Confidence = float64(s1.Confidence)
  4110. return nil
  4111. }
  4112. // Paragraph: Structural unit of text representing a number of words in
  4113. // certain order.
  4114. type Paragraph struct {
  4115. // BoundingBox: The bounding box for the paragraph.
  4116. // The vertices are in the order of top-left, top-right,
  4117. // bottom-right,
  4118. // bottom-left. When a rotation of the bounding box is detected the
  4119. // rotation
  4120. // is represented as around the top-left corner as defined when the text
  4121. // is
  4122. // read in the 'natural' orientation.
  4123. // For example:
  4124. // * when the text is horizontal it might look like:
  4125. // 0----1
  4126. // | |
  4127. // 3----2
  4128. // * when it's rotated 180 degrees around the top-left corner it
  4129. // becomes:
  4130. // 2----3
  4131. // | |
  4132. // 1----0
  4133. // and the vertice order will still be (0, 1, 2, 3).
  4134. BoundingBox *BoundingPoly `json:"boundingBox,omitempty"`
  4135. // Confidence: Confidence of the OCR results for the paragraph. Range
  4136. // [0, 1].
  4137. Confidence float64 `json:"confidence,omitempty"`
  4138. // Property: Additional information detected for the paragraph.
  4139. Property *TextProperty `json:"property,omitempty"`
  4140. // Words: List of words in this paragraph.
  4141. Words []*Word `json:"words,omitempty"`
  4142. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  4143. // unconditionally include in API requests. By default, fields with
  4144. // empty values are omitted from API requests. However, any non-pointer,
  4145. // non-interface field appearing in ForceSendFields will be sent to the
  4146. // server regardless of whether the field is empty or not. This may be
  4147. // used to include empty fields in Patch requests.
  4148. ForceSendFields []string `json:"-"`
  4149. // NullFields is a list of field names (e.g. "BoundingBox") to include
  4150. // in API requests with the JSON null value. By default, fields with
  4151. // empty values are omitted from API requests. However, any field with
  4152. // an empty value appearing in NullFields will be sent to the server as
  4153. // null. It is an error if a field in this list has a non-empty value.
  4154. // This may be used to include null fields in Patch requests.
  4155. NullFields []string `json:"-"`
  4156. }
  4157. func (s *Paragraph) MarshalJSON() ([]byte, error) {
  4158. type NoMethod Paragraph
  4159. raw := NoMethod(*s)
  4160. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4161. }
  4162. func (s *Paragraph) UnmarshalJSON(data []byte) error {
  4163. type NoMethod Paragraph
  4164. var s1 struct {
  4165. Confidence gensupport.JSONFloat64 `json:"confidence"`
  4166. *NoMethod
  4167. }
  4168. s1.NoMethod = (*NoMethod)(s)
  4169. if err := json.Unmarshal(data, &s1); err != nil {
  4170. return err
  4171. }
  4172. s.Confidence = float64(s1.Confidence)
  4173. return nil
  4174. }
  4175. // Position: A 3D position in the image, used primarily for Face
  4176. // detection landmarks.
  4177. // A valid Position must have both x and y coordinates.
  4178. // The position coordinates are in the same scale as the original image.
  4179. type Position struct {
  4180. // X: X coordinate.
  4181. X float64 `json:"x,omitempty"`
  4182. // Y: Y coordinate.
  4183. Y float64 `json:"y,omitempty"`
  4184. // Z: Z coordinate (or depth).
  4185. Z float64 `json:"z,omitempty"`
  4186. // ForceSendFields is a list of field names (e.g. "X") to
  4187. // unconditionally include in API requests. By default, fields with
  4188. // empty values are omitted from API requests. However, any non-pointer,
  4189. // non-interface field appearing in ForceSendFields will be sent to the
  4190. // server regardless of whether the field is empty or not. This may be
  4191. // used to include empty fields in Patch requests.
  4192. ForceSendFields []string `json:"-"`
  4193. // NullFields is a list of field names (e.g. "X") to include in API
  4194. // requests with the JSON null value. By default, fields with empty
  4195. // values are omitted from API requests. However, any field with an
  4196. // empty value appearing in NullFields will be sent to the server as
  4197. // null. It is an error if a field in this list has a non-empty value.
  4198. // This may be used to include null fields in Patch requests.
  4199. NullFields []string `json:"-"`
  4200. }
  4201. func (s *Position) MarshalJSON() ([]byte, error) {
  4202. type NoMethod Position
  4203. raw := NoMethod(*s)
  4204. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4205. }
  4206. func (s *Position) UnmarshalJSON(data []byte) error {
  4207. type NoMethod Position
  4208. var s1 struct {
  4209. X gensupport.JSONFloat64 `json:"x"`
  4210. Y gensupport.JSONFloat64 `json:"y"`
  4211. Z gensupport.JSONFloat64 `json:"z"`
  4212. *NoMethod
  4213. }
  4214. s1.NoMethod = (*NoMethod)(s)
  4215. if err := json.Unmarshal(data, &s1); err != nil {
  4216. return err
  4217. }
  4218. s.X = float64(s1.X)
  4219. s.Y = float64(s1.Y)
  4220. s.Z = float64(s1.Z)
  4221. return nil
  4222. }
  4223. // Property: A `Property` consists of a user-supplied name/value pair.
  4224. type Property struct {
  4225. // Name: Name of the property.
  4226. Name string `json:"name,omitempty"`
  4227. // Uint64Value: Value of numeric properties.
  4228. Uint64Value uint64 `json:"uint64Value,omitempty,string"`
  4229. // Value: Value of the property.
  4230. Value string `json:"value,omitempty"`
  4231. // ForceSendFields is a list of field names (e.g. "Name") to
  4232. // unconditionally include in API requests. By default, fields with
  4233. // empty values are omitted from API requests. However, any non-pointer,
  4234. // non-interface field appearing in ForceSendFields will be sent to the
  4235. // server regardless of whether the field is empty or not. This may be
  4236. // used to include empty fields in Patch requests.
  4237. ForceSendFields []string `json:"-"`
  4238. // NullFields is a list of field names (e.g. "Name") to include in API
  4239. // requests with the JSON null value. By default, fields with empty
  4240. // values are omitted from API requests. However, any field with an
  4241. // empty value appearing in NullFields will be sent to the server as
  4242. // null. It is an error if a field in this list has a non-empty value.
  4243. // This may be used to include null fields in Patch requests.
  4244. NullFields []string `json:"-"`
  4245. }
  4246. func (s *Property) MarshalJSON() ([]byte, error) {
  4247. type NoMethod Property
  4248. raw := NoMethod(*s)
  4249. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4250. }
  4251. // SafeSearchAnnotation: Set of features pertaining to the image,
  4252. // computed by computer vision
  4253. // methods over safe-search verticals (for example, adult, spoof,
  4254. // medical,
  4255. // violence).
  4256. type SafeSearchAnnotation struct {
  4257. // Adult: Represents the adult content likelihood for the image. Adult
  4258. // content may
  4259. // contain elements such as nudity, pornographic images or cartoons,
  4260. // or
  4261. // sexual activities.
  4262. //
  4263. // Possible values:
  4264. // "UNKNOWN" - Unknown likelihood.
  4265. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  4266. // specified vertical.
  4267. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  4268. // vertical.
  4269. // "POSSIBLE" - It is possible that the image belongs to the specified
  4270. // vertical.
  4271. // "LIKELY" - It is likely that the image belongs to the specified
  4272. // vertical.
  4273. // "VERY_LIKELY" - It is very likely that the image belongs to the
  4274. // specified vertical.
  4275. Adult string `json:"adult,omitempty"`
  4276. // Medical: Likelihood that this is a medical image.
  4277. //
  4278. // Possible values:
  4279. // "UNKNOWN" - Unknown likelihood.
  4280. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  4281. // specified vertical.
  4282. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  4283. // vertical.
  4284. // "POSSIBLE" - It is possible that the image belongs to the specified
  4285. // vertical.
  4286. // "LIKELY" - It is likely that the image belongs to the specified
  4287. // vertical.
  4288. // "VERY_LIKELY" - It is very likely that the image belongs to the
  4289. // specified vertical.
  4290. Medical string `json:"medical,omitempty"`
  4291. // Racy: Likelihood that the request image contains racy content. Racy
  4292. // content may
  4293. // include (but is not limited to) skimpy or sheer clothing,
  4294. // strategically
  4295. // covered nudity, lewd or provocative poses, or close-ups of
  4296. // sensitive
  4297. // body areas.
  4298. //
  4299. // Possible values:
  4300. // "UNKNOWN" - Unknown likelihood.
  4301. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  4302. // specified vertical.
  4303. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  4304. // vertical.
  4305. // "POSSIBLE" - It is possible that the image belongs to the specified
  4306. // vertical.
  4307. // "LIKELY" - It is likely that the image belongs to the specified
  4308. // vertical.
  4309. // "VERY_LIKELY" - It is very likely that the image belongs to the
  4310. // specified vertical.
  4311. Racy string `json:"racy,omitempty"`
  4312. // Spoof: Spoof likelihood. The likelihood that an modification
  4313. // was made to the image's canonical version to make it appear
  4314. // funny or offensive.
  4315. //
  4316. // Possible values:
  4317. // "UNKNOWN" - Unknown likelihood.
  4318. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  4319. // specified vertical.
  4320. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  4321. // vertical.
  4322. // "POSSIBLE" - It is possible that the image belongs to the specified
  4323. // vertical.
  4324. // "LIKELY" - It is likely that the image belongs to the specified
  4325. // vertical.
  4326. // "VERY_LIKELY" - It is very likely that the image belongs to the
  4327. // specified vertical.
  4328. Spoof string `json:"spoof,omitempty"`
  4329. // Violence: Likelihood that this image contains violent content.
  4330. //
  4331. // Possible values:
  4332. // "UNKNOWN" - Unknown likelihood.
  4333. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  4334. // specified vertical.
  4335. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  4336. // vertical.
  4337. // "POSSIBLE" - It is possible that the image belongs to the specified
  4338. // vertical.
  4339. // "LIKELY" - It is likely that the image belongs to the specified
  4340. // vertical.
  4341. // "VERY_LIKELY" - It is very likely that the image belongs to the
  4342. // specified vertical.
  4343. Violence string `json:"violence,omitempty"`
  4344. // ForceSendFields is a list of field names (e.g. "Adult") to
  4345. // unconditionally include in API requests. By default, fields with
  4346. // empty values are omitted from API requests. However, any non-pointer,
  4347. // non-interface field appearing in ForceSendFields will be sent to the
  4348. // server regardless of whether the field is empty or not. This may be
  4349. // used to include empty fields in Patch requests.
  4350. ForceSendFields []string `json:"-"`
  4351. // NullFields is a list of field names (e.g. "Adult") to include in API
  4352. // requests with the JSON null value. By default, fields with empty
  4353. // values are omitted from API requests. However, any field with an
  4354. // empty value appearing in NullFields will be sent to the server as
  4355. // null. It is an error if a field in this list has a non-empty value.
  4356. // This may be used to include null fields in Patch requests.
  4357. NullFields []string `json:"-"`
  4358. }
  4359. func (s *SafeSearchAnnotation) MarshalJSON() ([]byte, error) {
  4360. type NoMethod SafeSearchAnnotation
  4361. raw := NoMethod(*s)
  4362. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4363. }
  4364. // Status: The `Status` type defines a logical error model that is
  4365. // suitable for different
  4366. // programming environments, including REST APIs and RPC APIs. It is
  4367. // used by
  4368. // [gRPC](https://github.com/grpc). The error model is designed to
  4369. // be:
  4370. //
  4371. // - Simple to use and understand for most users
  4372. // - Flexible enough to meet unexpected needs
  4373. //
  4374. // # Overview
  4375. //
  4376. // The `Status` message contains three pieces of data: error code, error
  4377. // message,
  4378. // and error details. The error code should be an enum value
  4379. // of
  4380. // google.rpc.Code, but it may accept additional error codes if needed.
  4381. // The
  4382. // error message should be a developer-facing English message that
  4383. // helps
  4384. // developers *understand* and *resolve* the error. If a localized
  4385. // user-facing
  4386. // error message is needed, put the localized message in the error
  4387. // details or
  4388. // localize it in the client. The optional error details may contain
  4389. // arbitrary
  4390. // information about the error. There is a predefined set of error
  4391. // detail types
  4392. // in the package `google.rpc` that can be used for common error
  4393. // conditions.
  4394. //
  4395. // # Language mapping
  4396. //
  4397. // The `Status` message is the logical representation of the error
  4398. // model, but it
  4399. // is not necessarily the actual wire format. When the `Status` message
  4400. // is
  4401. // exposed in different client libraries and different wire protocols,
  4402. // it can be
  4403. // mapped differently. For example, it will likely be mapped to some
  4404. // exceptions
  4405. // in Java, but more likely mapped to some error codes in C.
  4406. //
  4407. // # Other uses
  4408. //
  4409. // The error model and the `Status` message can be used in a variety
  4410. // of
  4411. // environments, either with or without APIs, to provide a
  4412. // consistent developer experience across different
  4413. // environments.
  4414. //
  4415. // Example uses of this error model include:
  4416. //
  4417. // - Partial errors. If a service needs to return partial errors to the
  4418. // client,
  4419. // it may embed the `Status` in the normal response to indicate the
  4420. // partial
  4421. // errors.
  4422. //
  4423. // - Workflow errors. A typical workflow has multiple steps. Each step
  4424. // may
  4425. // have a `Status` message for error reporting.
  4426. //
  4427. // - Batch operations. If a client uses batch request and batch
  4428. // response, the
  4429. // `Status` message should be used directly inside batch response,
  4430. // one for
  4431. // each error sub-response.
  4432. //
  4433. // - Asynchronous operations. If an API call embeds asynchronous
  4434. // operation
  4435. // results in its response, the status of those operations should
  4436. // be
  4437. // represented directly using the `Status` message.
  4438. //
  4439. // - Logging. If some API errors are stored in logs, the message
  4440. // `Status` could
  4441. // be used directly after any stripping needed for security/privacy
  4442. // reasons.
  4443. type Status struct {
  4444. // Code: The status code, which should be an enum value of
  4445. // google.rpc.Code.
  4446. Code int64 `json:"code,omitempty"`
  4447. // Details: A list of messages that carry the error details. There is a
  4448. // common set of
  4449. // message types for APIs to use.
  4450. Details []googleapi.RawMessage `json:"details,omitempty"`
  4451. // Message: A developer-facing error message, which should be in
  4452. // English. Any
  4453. // user-facing error message should be localized and sent in
  4454. // the
  4455. // google.rpc.Status.details field, or localized by the client.
  4456. Message string `json:"message,omitempty"`
  4457. // ForceSendFields is a list of field names (e.g. "Code") to
  4458. // unconditionally include in API requests. By default, fields with
  4459. // empty values are omitted from API requests. However, any non-pointer,
  4460. // non-interface field appearing in ForceSendFields will be sent to the
  4461. // server regardless of whether the field is empty or not. This may be
  4462. // used to include empty fields in Patch requests.
  4463. ForceSendFields []string `json:"-"`
  4464. // NullFields is a list of field names (e.g. "Code") to include in API
  4465. // requests with the JSON null value. By default, fields with empty
  4466. // values are omitted from API requests. However, any field with an
  4467. // empty value appearing in NullFields will be sent to the server as
  4468. // null. It is an error if a field in this list has a non-empty value.
  4469. // This may be used to include null fields in Patch requests.
  4470. NullFields []string `json:"-"`
  4471. }
  4472. func (s *Status) MarshalJSON() ([]byte, error) {
  4473. type NoMethod Status
  4474. raw := NoMethod(*s)
  4475. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4476. }
  4477. // Symbol: A single symbol representation.
  4478. type Symbol struct {
  4479. // BoundingBox: The bounding box for the symbol.
  4480. // The vertices are in the order of top-left, top-right,
  4481. // bottom-right,
  4482. // bottom-left. When a rotation of the bounding box is detected the
  4483. // rotation
  4484. // is represented as around the top-left corner as defined when the text
  4485. // is
  4486. // read in the 'natural' orientation.
  4487. // For example:
  4488. // * when the text is horizontal it might look like:
  4489. // 0----1
  4490. // | |
  4491. // 3----2
  4492. // * when it's rotated 180 degrees around the top-left corner it
  4493. // becomes:
  4494. // 2----3
  4495. // | |
  4496. // 1----0
  4497. // and the vertice order will still be (0, 1, 2, 3).
  4498. BoundingBox *BoundingPoly `json:"boundingBox,omitempty"`
  4499. // Confidence: Confidence of the OCR results for the symbol. Range [0,
  4500. // 1].
  4501. Confidence float64 `json:"confidence,omitempty"`
  4502. // Property: Additional information detected for the symbol.
  4503. Property *TextProperty `json:"property,omitempty"`
  4504. // Text: The actual UTF-8 representation of the symbol.
  4505. Text string `json:"text,omitempty"`
  4506. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  4507. // unconditionally include in API requests. By default, fields with
  4508. // empty values are omitted from API requests. However, any non-pointer,
  4509. // non-interface field appearing in ForceSendFields will be sent to the
  4510. // server regardless of whether the field is empty or not. This may be
  4511. // used to include empty fields in Patch requests.
  4512. ForceSendFields []string `json:"-"`
  4513. // NullFields is a list of field names (e.g. "BoundingBox") to include
  4514. // in API requests with the JSON null value. By default, fields with
  4515. // empty values are omitted from API requests. However, any field with
  4516. // an empty value appearing in NullFields will be sent to the server as
  4517. // null. It is an error if a field in this list has a non-empty value.
  4518. // This may be used to include null fields in Patch requests.
  4519. NullFields []string `json:"-"`
  4520. }
  4521. func (s *Symbol) MarshalJSON() ([]byte, error) {
  4522. type NoMethod Symbol
  4523. raw := NoMethod(*s)
  4524. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4525. }
  4526. func (s *Symbol) UnmarshalJSON(data []byte) error {
  4527. type NoMethod Symbol
  4528. var s1 struct {
  4529. Confidence gensupport.JSONFloat64 `json:"confidence"`
  4530. *NoMethod
  4531. }
  4532. s1.NoMethod = (*NoMethod)(s)
  4533. if err := json.Unmarshal(data, &s1); err != nil {
  4534. return err
  4535. }
  4536. s.Confidence = float64(s1.Confidence)
  4537. return nil
  4538. }
  4539. // TextAnnotation: TextAnnotation contains a structured representation
  4540. // of OCR extracted text.
  4541. // The hierarchy of an OCR extracted text structure is like this:
  4542. // TextAnnotation -> Page -> Block -> Paragraph -> Word ->
  4543. // Symbol
  4544. // Each structural component, starting from Page, may further have their
  4545. // own
  4546. // properties. Properties describe detected languages, breaks etc..
  4547. // Please refer
  4548. // to the TextAnnotation.TextProperty message definition below for
  4549. // more
  4550. // detail.
  4551. type TextAnnotation struct {
  4552. // Pages: List of pages detected by OCR.
  4553. Pages []*Page `json:"pages,omitempty"`
  4554. // Text: UTF-8 text detected on the pages.
  4555. Text string `json:"text,omitempty"`
  4556. // ForceSendFields is a list of field names (e.g. "Pages") to
  4557. // unconditionally include in API requests. By default, fields with
  4558. // empty values are omitted from API requests. However, any non-pointer,
  4559. // non-interface field appearing in ForceSendFields will be sent to the
  4560. // server regardless of whether the field is empty or not. This may be
  4561. // used to include empty fields in Patch requests.
  4562. ForceSendFields []string `json:"-"`
  4563. // NullFields is a list of field names (e.g. "Pages") to include in API
  4564. // requests with the JSON null value. By default, fields with empty
  4565. // values are omitted from API requests. However, any field with an
  4566. // empty value appearing in NullFields will be sent to the server as
  4567. // null. It is an error if a field in this list has a non-empty value.
  4568. // This may be used to include null fields in Patch requests.
  4569. NullFields []string `json:"-"`
  4570. }
  4571. func (s *TextAnnotation) MarshalJSON() ([]byte, error) {
  4572. type NoMethod TextAnnotation
  4573. raw := NoMethod(*s)
  4574. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4575. }
  4576. // TextProperty: Additional information detected on the structural
  4577. // component.
  4578. type TextProperty struct {
  4579. // DetectedBreak: Detected start or end of a text segment.
  4580. DetectedBreak *DetectedBreak `json:"detectedBreak,omitempty"`
  4581. // DetectedLanguages: A list of detected languages together with
  4582. // confidence.
  4583. DetectedLanguages []*DetectedLanguage `json:"detectedLanguages,omitempty"`
  4584. // ForceSendFields is a list of field names (e.g. "DetectedBreak") to
  4585. // unconditionally include in API requests. By default, fields with
  4586. // empty values are omitted from API requests. However, any non-pointer,
  4587. // non-interface field appearing in ForceSendFields will be sent to the
  4588. // server regardless of whether the field is empty or not. This may be
  4589. // used to include empty fields in Patch requests.
  4590. ForceSendFields []string `json:"-"`
  4591. // NullFields is a list of field names (e.g. "DetectedBreak") to include
  4592. // in API requests with the JSON null value. By default, fields with
  4593. // empty values are omitted from API requests. However, any field with
  4594. // an empty value appearing in NullFields will be sent to the server as
  4595. // null. It is an error if a field in this list has a non-empty value.
  4596. // This may be used to include null fields in Patch requests.
  4597. NullFields []string `json:"-"`
  4598. }
  4599. func (s *TextProperty) MarshalJSON() ([]byte, error) {
  4600. type NoMethod TextProperty
  4601. raw := NoMethod(*s)
  4602. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4603. }
  4604. // Vertex: A vertex represents a 2D point in the image.
  4605. // NOTE: the vertex coordinates are in the same scale as the original
  4606. // image.
  4607. type Vertex struct {
  4608. // X: X coordinate.
  4609. X int64 `json:"x,omitempty"`
  4610. // Y: Y coordinate.
  4611. Y int64 `json:"y,omitempty"`
  4612. // ForceSendFields is a list of field names (e.g. "X") to
  4613. // unconditionally include in API requests. By default, fields with
  4614. // empty values are omitted from API requests. However, any non-pointer,
  4615. // non-interface field appearing in ForceSendFields will be sent to the
  4616. // server regardless of whether the field is empty or not. This may be
  4617. // used to include empty fields in Patch requests.
  4618. ForceSendFields []string `json:"-"`
  4619. // NullFields is a list of field names (e.g. "X") to include in API
  4620. // requests with the JSON null value. By default, fields with empty
  4621. // values are omitted from API requests. However, any field with an
  4622. // empty value appearing in NullFields will be sent to the server as
  4623. // null. It is an error if a field in this list has a non-empty value.
  4624. // This may be used to include null fields in Patch requests.
  4625. NullFields []string `json:"-"`
  4626. }
  4627. func (s *Vertex) MarshalJSON() ([]byte, error) {
  4628. type NoMethod Vertex
  4629. raw := NoMethod(*s)
  4630. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4631. }
  4632. // WebDetection: Relevant information for the image from the Internet.
  4633. type WebDetection struct {
  4634. // BestGuessLabels: The service's best guess as to the topic of the
  4635. // request image.
  4636. // Inferred from similar images on the open web.
  4637. BestGuessLabels []*WebLabel `json:"bestGuessLabels,omitempty"`
  4638. // FullMatchingImages: Fully matching images from the Internet.
  4639. // Can include resized copies of the query image.
  4640. FullMatchingImages []*WebImage `json:"fullMatchingImages,omitempty"`
  4641. // PagesWithMatchingImages: Web pages containing the matching images
  4642. // from the Internet.
  4643. PagesWithMatchingImages []*WebPage `json:"pagesWithMatchingImages,omitempty"`
  4644. // PartialMatchingImages: Partial matching images from the
  4645. // Internet.
  4646. // Those images are similar enough to share some key-point features.
  4647. // For
  4648. // example an original image will likely have partial matching for its
  4649. // crops.
  4650. PartialMatchingImages []*WebImage `json:"partialMatchingImages,omitempty"`
  4651. // VisuallySimilarImages: The visually similar image results.
  4652. VisuallySimilarImages []*WebImage `json:"visuallySimilarImages,omitempty"`
  4653. // WebEntities: Deduced entities from similar images on the Internet.
  4654. WebEntities []*WebEntity `json:"webEntities,omitempty"`
  4655. // ForceSendFields is a list of field names (e.g. "BestGuessLabels") to
  4656. // unconditionally include in API requests. By default, fields with
  4657. // empty values are omitted from API requests. However, any non-pointer,
  4658. // non-interface field appearing in ForceSendFields will be sent to the
  4659. // server regardless of whether the field is empty or not. This may be
  4660. // used to include empty fields in Patch requests.
  4661. ForceSendFields []string `json:"-"`
  4662. // NullFields is a list of field names (e.g. "BestGuessLabels") to
  4663. // include in API requests with the JSON null value. By default, fields
  4664. // with empty values are omitted from API requests. However, any field
  4665. // with an empty value appearing in NullFields will be sent to the
  4666. // server as null. It is an error if a field in this list has a
  4667. // non-empty value. This may be used to include null fields in Patch
  4668. // requests.
  4669. NullFields []string `json:"-"`
  4670. }
  4671. func (s *WebDetection) MarshalJSON() ([]byte, error) {
  4672. type NoMethod WebDetection
  4673. raw := NoMethod(*s)
  4674. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4675. }
  4676. // WebEntity: Entity deduced from similar images on the Internet.
  4677. type WebEntity struct {
  4678. // Description: Canonical description of the entity, in English.
  4679. Description string `json:"description,omitempty"`
  4680. // EntityId: Opaque entity ID.
  4681. EntityId string `json:"entityId,omitempty"`
  4682. // Score: Overall relevancy score for the entity.
  4683. // Not normalized and not comparable across different image queries.
  4684. Score float64 `json:"score,omitempty"`
  4685. // ForceSendFields is a list of field names (e.g. "Description") to
  4686. // unconditionally include in API requests. By default, fields with
  4687. // empty values are omitted from API requests. However, any non-pointer,
  4688. // non-interface field appearing in ForceSendFields will be sent to the
  4689. // server regardless of whether the field is empty or not. This may be
  4690. // used to include empty fields in Patch requests.
  4691. ForceSendFields []string `json:"-"`
  4692. // NullFields is a list of field names (e.g. "Description") to include
  4693. // in API requests with the JSON null value. By default, fields with
  4694. // empty values are omitted from API requests. However, any field with
  4695. // an empty value appearing in NullFields will be sent to the server as
  4696. // null. It is an error if a field in this list has a non-empty value.
  4697. // This may be used to include null fields in Patch requests.
  4698. NullFields []string `json:"-"`
  4699. }
  4700. func (s *WebEntity) MarshalJSON() ([]byte, error) {
  4701. type NoMethod WebEntity
  4702. raw := NoMethod(*s)
  4703. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4704. }
  4705. func (s *WebEntity) UnmarshalJSON(data []byte) error {
  4706. type NoMethod WebEntity
  4707. var s1 struct {
  4708. Score gensupport.JSONFloat64 `json:"score"`
  4709. *NoMethod
  4710. }
  4711. s1.NoMethod = (*NoMethod)(s)
  4712. if err := json.Unmarshal(data, &s1); err != nil {
  4713. return err
  4714. }
  4715. s.Score = float64(s1.Score)
  4716. return nil
  4717. }
  4718. // WebImage: Metadata for online images.
  4719. type WebImage struct {
  4720. // Score: (Deprecated) Overall relevancy score for the image.
  4721. Score float64 `json:"score,omitempty"`
  4722. // Url: The result image URL.
  4723. Url string `json:"url,omitempty"`
  4724. // ForceSendFields is a list of field names (e.g. "Score") to
  4725. // unconditionally include in API requests. By default, fields with
  4726. // empty values are omitted from API requests. However, any non-pointer,
  4727. // non-interface field appearing in ForceSendFields will be sent to the
  4728. // server regardless of whether the field is empty or not. This may be
  4729. // used to include empty fields in Patch requests.
  4730. ForceSendFields []string `json:"-"`
  4731. // NullFields is a list of field names (e.g. "Score") to include in API
  4732. // requests with the JSON null value. By default, fields with empty
  4733. // values are omitted from API requests. However, any field with an
  4734. // empty value appearing in NullFields will be sent to the server as
  4735. // null. It is an error if a field in this list has a non-empty value.
  4736. // This may be used to include null fields in Patch requests.
  4737. NullFields []string `json:"-"`
  4738. }
  4739. func (s *WebImage) MarshalJSON() ([]byte, error) {
  4740. type NoMethod WebImage
  4741. raw := NoMethod(*s)
  4742. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4743. }
  4744. func (s *WebImage) UnmarshalJSON(data []byte) error {
  4745. type NoMethod WebImage
  4746. var s1 struct {
  4747. Score gensupport.JSONFloat64 `json:"score"`
  4748. *NoMethod
  4749. }
  4750. s1.NoMethod = (*NoMethod)(s)
  4751. if err := json.Unmarshal(data, &s1); err != nil {
  4752. return err
  4753. }
  4754. s.Score = float64(s1.Score)
  4755. return nil
  4756. }
  4757. // WebLabel: Label to provide extra metadata for the web detection.
  4758. type WebLabel struct {
  4759. // Label: Label for extra metadata.
  4760. Label string `json:"label,omitempty"`
  4761. // LanguageCode: The BCP-47 language code for `label`, such as "en-US"
  4762. // or "sr-Latn".
  4763. // For more information,
  4764. // see
  4765. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  4766. LanguageCode string `json:"languageCode,omitempty"`
  4767. // ForceSendFields is a list of field names (e.g. "Label") to
  4768. // unconditionally include in API requests. By default, fields with
  4769. // empty values are omitted from API requests. However, any non-pointer,
  4770. // non-interface field appearing in ForceSendFields will be sent to the
  4771. // server regardless of whether the field is empty or not. This may be
  4772. // used to include empty fields in Patch requests.
  4773. ForceSendFields []string `json:"-"`
  4774. // NullFields is a list of field names (e.g. "Label") to include in API
  4775. // requests with the JSON null value. By default, fields with empty
  4776. // values are omitted from API requests. However, any field with an
  4777. // empty value appearing in NullFields will be sent to the server as
  4778. // null. It is an error if a field in this list has a non-empty value.
  4779. // This may be used to include null fields in Patch requests.
  4780. NullFields []string `json:"-"`
  4781. }
  4782. func (s *WebLabel) MarshalJSON() ([]byte, error) {
  4783. type NoMethod WebLabel
  4784. raw := NoMethod(*s)
  4785. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4786. }
  4787. // WebPage: Metadata for web pages.
  4788. type WebPage struct {
  4789. // FullMatchingImages: Fully matching images on the page.
  4790. // Can include resized copies of the query image.
  4791. FullMatchingImages []*WebImage `json:"fullMatchingImages,omitempty"`
  4792. // PageTitle: Title for the web page, may contain HTML markups.
  4793. PageTitle string `json:"pageTitle,omitempty"`
  4794. // PartialMatchingImages: Partial matching images on the page.
  4795. // Those images are similar enough to share some key-point features.
  4796. // For
  4797. // example an original image will likely have partial matching for
  4798. // its
  4799. // crops.
  4800. PartialMatchingImages []*WebImage `json:"partialMatchingImages,omitempty"`
  4801. // Score: (Deprecated) Overall relevancy score for the web page.
  4802. Score float64 `json:"score,omitempty"`
  4803. // Url: The result web page URL.
  4804. Url string `json:"url,omitempty"`
  4805. // ForceSendFields is a list of field names (e.g. "FullMatchingImages")
  4806. // to unconditionally include in API requests. By default, fields with
  4807. // empty values are omitted from API requests. However, any non-pointer,
  4808. // non-interface field appearing in ForceSendFields will be sent to the
  4809. // server regardless of whether the field is empty or not. This may be
  4810. // used to include empty fields in Patch requests.
  4811. ForceSendFields []string `json:"-"`
  4812. // NullFields is a list of field names (e.g. "FullMatchingImages") to
  4813. // include in API requests with the JSON null value. By default, fields
  4814. // with empty values are omitted from API requests. However, any field
  4815. // with an empty value appearing in NullFields will be sent to the
  4816. // server as null. It is an error if a field in this list has a
  4817. // non-empty value. This may be used to include null fields in Patch
  4818. // requests.
  4819. NullFields []string `json:"-"`
  4820. }
  4821. func (s *WebPage) MarshalJSON() ([]byte, error) {
  4822. type NoMethod WebPage
  4823. raw := NoMethod(*s)
  4824. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4825. }
  4826. func (s *WebPage) UnmarshalJSON(data []byte) error {
  4827. type NoMethod WebPage
  4828. var s1 struct {
  4829. Score gensupport.JSONFloat64 `json:"score"`
  4830. *NoMethod
  4831. }
  4832. s1.NoMethod = (*NoMethod)(s)
  4833. if err := json.Unmarshal(data, &s1); err != nil {
  4834. return err
  4835. }
  4836. s.Score = float64(s1.Score)
  4837. return nil
  4838. }
  4839. // Word: A word representation.
  4840. type Word struct {
  4841. // BoundingBox: The bounding box for the word.
  4842. // The vertices are in the order of top-left, top-right,
  4843. // bottom-right,
  4844. // bottom-left. When a rotation of the bounding box is detected the
  4845. // rotation
  4846. // is represented as around the top-left corner as defined when the text
  4847. // is
  4848. // read in the 'natural' orientation.
  4849. // For example:
  4850. // * when the text is horizontal it might look like:
  4851. // 0----1
  4852. // | |
  4853. // 3----2
  4854. // * when it's rotated 180 degrees around the top-left corner it
  4855. // becomes:
  4856. // 2----3
  4857. // | |
  4858. // 1----0
  4859. // and the vertice order will still be (0, 1, 2, 3).
  4860. BoundingBox *BoundingPoly `json:"boundingBox,omitempty"`
  4861. // Confidence: Confidence of the OCR results for the word. Range [0, 1].
  4862. Confidence float64 `json:"confidence,omitempty"`
  4863. // Property: Additional information detected for the word.
  4864. Property *TextProperty `json:"property,omitempty"`
  4865. // Symbols: List of symbols in the word.
  4866. // The order of the symbols follows the natural reading order.
  4867. Symbols []*Symbol `json:"symbols,omitempty"`
  4868. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  4869. // unconditionally include in API requests. By default, fields with
  4870. // empty values are omitted from API requests. However, any non-pointer,
  4871. // non-interface field appearing in ForceSendFields will be sent to the
  4872. // server regardless of whether the field is empty or not. This may be
  4873. // used to include empty fields in Patch requests.
  4874. ForceSendFields []string `json:"-"`
  4875. // NullFields is a list of field names (e.g. "BoundingBox") to include
  4876. // in API requests with the JSON null value. By default, fields with
  4877. // empty values are omitted from API requests. However, any field with
  4878. // an empty value appearing in NullFields will be sent to the server as
  4879. // null. It is an error if a field in this list has a non-empty value.
  4880. // This may be used to include null fields in Patch requests.
  4881. NullFields []string `json:"-"`
  4882. }
  4883. func (s *Word) MarshalJSON() ([]byte, error) {
  4884. type NoMethod Word
  4885. raw := NoMethod(*s)
  4886. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4887. }
  4888. func (s *Word) UnmarshalJSON(data []byte) error {
  4889. type NoMethod Word
  4890. var s1 struct {
  4891. Confidence gensupport.JSONFloat64 `json:"confidence"`
  4892. *NoMethod
  4893. }
  4894. s1.NoMethod = (*NoMethod)(s)
  4895. if err := json.Unmarshal(data, &s1); err != nil {
  4896. return err
  4897. }
  4898. s.Confidence = float64(s1.Confidence)
  4899. return nil
  4900. }
  4901. // method id "vision.files.asyncBatchAnnotate":
  4902. type FilesAsyncBatchAnnotateCall struct {
  4903. s *Service
  4904. googlecloudvisionv1p2beta1asyncbatchannotatefilesrequest *GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesRequest
  4905. urlParams_ gensupport.URLParams
  4906. ctx_ context.Context
  4907. header_ http.Header
  4908. }
  4909. // AsyncBatchAnnotate: Run asynchronous image detection and annotation
  4910. // for a list of generic
  4911. // files, such as PDF files, which may contain multiple pages and
  4912. // multiple
  4913. // images per page. Progress and results can be retrieved through
  4914. // the
  4915. // `google.longrunning.Operations` interface.
  4916. // `Operation.metadata` contains `OperationMetadata`
  4917. // (metadata).
  4918. // `Operation.response` contains `AsyncBatchAnnotateFilesResponse`
  4919. // (results).
  4920. func (r *FilesService) AsyncBatchAnnotate(googlecloudvisionv1p2beta1asyncbatchannotatefilesrequest *GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesRequest) *FilesAsyncBatchAnnotateCall {
  4921. c := &FilesAsyncBatchAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4922. c.googlecloudvisionv1p2beta1asyncbatchannotatefilesrequest = googlecloudvisionv1p2beta1asyncbatchannotatefilesrequest
  4923. return c
  4924. }
  4925. // Fields allows partial responses to be retrieved. See
  4926. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4927. // for more information.
  4928. func (c *FilesAsyncBatchAnnotateCall) Fields(s ...googleapi.Field) *FilesAsyncBatchAnnotateCall {
  4929. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4930. return c
  4931. }
  4932. // Context sets the context to be used in this call's Do method. Any
  4933. // pending HTTP request will be aborted if the provided context is
  4934. // canceled.
  4935. func (c *FilesAsyncBatchAnnotateCall) Context(ctx context.Context) *FilesAsyncBatchAnnotateCall {
  4936. c.ctx_ = ctx
  4937. return c
  4938. }
  4939. // Header returns an http.Header that can be modified by the caller to
  4940. // add HTTP headers to the request.
  4941. func (c *FilesAsyncBatchAnnotateCall) Header() http.Header {
  4942. if c.header_ == nil {
  4943. c.header_ = make(http.Header)
  4944. }
  4945. return c.header_
  4946. }
  4947. func (c *FilesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) {
  4948. reqHeaders := make(http.Header)
  4949. for k, v := range c.header_ {
  4950. reqHeaders[k] = v
  4951. }
  4952. reqHeaders.Set("User-Agent", c.s.userAgent())
  4953. var body io.Reader = nil
  4954. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p2beta1asyncbatchannotatefilesrequest)
  4955. if err != nil {
  4956. return nil, err
  4957. }
  4958. reqHeaders.Set("Content-Type", "application/json")
  4959. c.urlParams_.Set("alt", alt)
  4960. urls := googleapi.ResolveRelative(c.s.BasePath, "v1p2beta1/files:asyncBatchAnnotate")
  4961. urls += "?" + c.urlParams_.Encode()
  4962. req, _ := http.NewRequest("POST", urls, body)
  4963. req.Header = reqHeaders
  4964. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4965. }
  4966. // Do executes the "vision.files.asyncBatchAnnotate" call.
  4967. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4968. // status code is an error. Response headers are in either
  4969. // *Operation.ServerResponse.Header or (if a response was returned at
  4970. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4971. // to check whether the returned error was because
  4972. // http.StatusNotModified was returned.
  4973. func (c *FilesAsyncBatchAnnotateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4974. gensupport.SetOptions(c.urlParams_, opts...)
  4975. res, err := c.doRequest("json")
  4976. if res != nil && res.StatusCode == http.StatusNotModified {
  4977. if res.Body != nil {
  4978. res.Body.Close()
  4979. }
  4980. return nil, &googleapi.Error{
  4981. Code: res.StatusCode,
  4982. Header: res.Header,
  4983. }
  4984. }
  4985. if err != nil {
  4986. return nil, err
  4987. }
  4988. defer googleapi.CloseBody(res)
  4989. if err := googleapi.CheckResponse(res); err != nil {
  4990. return nil, err
  4991. }
  4992. ret := &Operation{
  4993. ServerResponse: googleapi.ServerResponse{
  4994. Header: res.Header,
  4995. HTTPStatusCode: res.StatusCode,
  4996. },
  4997. }
  4998. target := &ret
  4999. if err := gensupport.DecodeResponse(target, res); err != nil {
  5000. return nil, err
  5001. }
  5002. return ret, nil
  5003. // {
  5004. // "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).",
  5005. // "flatPath": "v1p2beta1/files:asyncBatchAnnotate",
  5006. // "httpMethod": "POST",
  5007. // "id": "vision.files.asyncBatchAnnotate",
  5008. // "parameterOrder": [],
  5009. // "parameters": {},
  5010. // "path": "v1p2beta1/files:asyncBatchAnnotate",
  5011. // "request": {
  5012. // "$ref": "GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesRequest"
  5013. // },
  5014. // "response": {
  5015. // "$ref": "Operation"
  5016. // },
  5017. // "scopes": [
  5018. // "https://www.googleapis.com/auth/cloud-platform",
  5019. // "https://www.googleapis.com/auth/cloud-vision"
  5020. // ]
  5021. // }
  5022. }
  5023. // method id "vision.images.annotate":
  5024. type ImagesAnnotateCall struct {
  5025. s *Service
  5026. googlecloudvisionv1p2beta1batchannotateimagesrequest *GoogleCloudVisionV1p2beta1BatchAnnotateImagesRequest
  5027. urlParams_ gensupport.URLParams
  5028. ctx_ context.Context
  5029. header_ http.Header
  5030. }
  5031. // Annotate: Run image detection and annotation for a batch of images.
  5032. func (r *ImagesService) Annotate(googlecloudvisionv1p2beta1batchannotateimagesrequest *GoogleCloudVisionV1p2beta1BatchAnnotateImagesRequest) *ImagesAnnotateCall {
  5033. c := &ImagesAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5034. c.googlecloudvisionv1p2beta1batchannotateimagesrequest = googlecloudvisionv1p2beta1batchannotateimagesrequest
  5035. return c
  5036. }
  5037. // Fields allows partial responses to be retrieved. See
  5038. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5039. // for more information.
  5040. func (c *ImagesAnnotateCall) Fields(s ...googleapi.Field) *ImagesAnnotateCall {
  5041. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5042. return c
  5043. }
  5044. // Context sets the context to be used in this call's Do method. Any
  5045. // pending HTTP request will be aborted if the provided context is
  5046. // canceled.
  5047. func (c *ImagesAnnotateCall) Context(ctx context.Context) *ImagesAnnotateCall {
  5048. c.ctx_ = ctx
  5049. return c
  5050. }
  5051. // Header returns an http.Header that can be modified by the caller to
  5052. // add HTTP headers to the request.
  5053. func (c *ImagesAnnotateCall) Header() http.Header {
  5054. if c.header_ == nil {
  5055. c.header_ = make(http.Header)
  5056. }
  5057. return c.header_
  5058. }
  5059. func (c *ImagesAnnotateCall) doRequest(alt string) (*http.Response, error) {
  5060. reqHeaders := make(http.Header)
  5061. for k, v := range c.header_ {
  5062. reqHeaders[k] = v
  5063. }
  5064. reqHeaders.Set("User-Agent", c.s.userAgent())
  5065. var body io.Reader = nil
  5066. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p2beta1batchannotateimagesrequest)
  5067. if err != nil {
  5068. return nil, err
  5069. }
  5070. reqHeaders.Set("Content-Type", "application/json")
  5071. c.urlParams_.Set("alt", alt)
  5072. urls := googleapi.ResolveRelative(c.s.BasePath, "v1p2beta1/images:annotate")
  5073. urls += "?" + c.urlParams_.Encode()
  5074. req, _ := http.NewRequest("POST", urls, body)
  5075. req.Header = reqHeaders
  5076. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5077. }
  5078. // Do executes the "vision.images.annotate" call.
  5079. // Exactly one of *GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse
  5080. // or error will be non-nil. Any non-2xx status code is an error.
  5081. // Response headers are in either
  5082. // *GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse.ServerResponse.
  5083. // Header or (if a response was returned at all) in
  5084. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5085. // whether the returned error was because http.StatusNotModified was
  5086. // returned.
  5087. func (c *ImagesAnnotateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse, error) {
  5088. gensupport.SetOptions(c.urlParams_, opts...)
  5089. res, err := c.doRequest("json")
  5090. if res != nil && res.StatusCode == http.StatusNotModified {
  5091. if res.Body != nil {
  5092. res.Body.Close()
  5093. }
  5094. return nil, &googleapi.Error{
  5095. Code: res.StatusCode,
  5096. Header: res.Header,
  5097. }
  5098. }
  5099. if err != nil {
  5100. return nil, err
  5101. }
  5102. defer googleapi.CloseBody(res)
  5103. if err := googleapi.CheckResponse(res); err != nil {
  5104. return nil, err
  5105. }
  5106. ret := &GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse{
  5107. ServerResponse: googleapi.ServerResponse{
  5108. Header: res.Header,
  5109. HTTPStatusCode: res.StatusCode,
  5110. },
  5111. }
  5112. target := &ret
  5113. if err := gensupport.DecodeResponse(target, res); err != nil {
  5114. return nil, err
  5115. }
  5116. return ret, nil
  5117. // {
  5118. // "description": "Run image detection and annotation for a batch of images.",
  5119. // "flatPath": "v1p2beta1/images:annotate",
  5120. // "httpMethod": "POST",
  5121. // "id": "vision.images.annotate",
  5122. // "parameterOrder": [],
  5123. // "parameters": {},
  5124. // "path": "v1p2beta1/images:annotate",
  5125. // "request": {
  5126. // "$ref": "GoogleCloudVisionV1p2beta1BatchAnnotateImagesRequest"
  5127. // },
  5128. // "response": {
  5129. // "$ref": "GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse"
  5130. // },
  5131. // "scopes": [
  5132. // "https://www.googleapis.com/auth/cloud-platform",
  5133. // "https://www.googleapis.com/auth/cloud-vision"
  5134. // ]
  5135. // }
  5136. }