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.
 
 
 

7746 lines
312 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/v1p1beta1"
  8. // ...
  9. // visionService, err := vision.New(oauthHttpClient)
  10. package vision // import "google.golang.org/api/vision/v1p1beta1"
  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:v1p1beta1"
  41. const apiName = "vision"
  42. const apiVersion = "v1p1beta1"
  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. // GoogleCloudVisionV1p1beta1AnnotateImageRequest: Request for
  1108. // performing Google Cloud Vision API tasks over a user-provided
  1109. // image, with user-requested features.
  1110. type GoogleCloudVisionV1p1beta1AnnotateImageRequest struct {
  1111. // Features: Requested features.
  1112. Features []*GoogleCloudVisionV1p1beta1Feature `json:"features,omitempty"`
  1113. // Image: The image to be processed.
  1114. Image *GoogleCloudVisionV1p1beta1Image `json:"image,omitempty"`
  1115. // ImageContext: Additional context that may accompany the image.
  1116. ImageContext *GoogleCloudVisionV1p1beta1ImageContext `json:"imageContext,omitempty"`
  1117. // ForceSendFields is a list of field names (e.g. "Features") to
  1118. // unconditionally include in API requests. By default, fields with
  1119. // empty values are omitted from API requests. However, any non-pointer,
  1120. // non-interface field appearing in ForceSendFields will be sent to the
  1121. // server regardless of whether the field is empty or not. This may be
  1122. // used to include empty fields in Patch requests.
  1123. ForceSendFields []string `json:"-"`
  1124. // NullFields is a list of field names (e.g. "Features") to include in
  1125. // API requests with the JSON null value. By default, fields with empty
  1126. // values are omitted from API requests. However, any field with an
  1127. // empty value appearing in NullFields will be sent to the server as
  1128. // null. It is an error if a field in this list has a non-empty value.
  1129. // This may be used to include null fields in Patch requests.
  1130. NullFields []string `json:"-"`
  1131. }
  1132. func (s *GoogleCloudVisionV1p1beta1AnnotateImageRequest) MarshalJSON() ([]byte, error) {
  1133. type NoMethod GoogleCloudVisionV1p1beta1AnnotateImageRequest
  1134. raw := NoMethod(*s)
  1135. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1136. }
  1137. // GoogleCloudVisionV1p1beta1AnnotateImageResponse: Response to an image
  1138. // annotation request.
  1139. type GoogleCloudVisionV1p1beta1AnnotateImageResponse struct {
  1140. // Context: If present, contextual information is needed to understand
  1141. // where this image
  1142. // comes from.
  1143. Context *GoogleCloudVisionV1p1beta1ImageAnnotationContext `json:"context,omitempty"`
  1144. // CropHintsAnnotation: If present, crop hints have completed
  1145. // successfully.
  1146. CropHintsAnnotation *GoogleCloudVisionV1p1beta1CropHintsAnnotation `json:"cropHintsAnnotation,omitempty"`
  1147. // Error: If set, represents the error message for the operation.
  1148. // Note that filled-in image annotations are guaranteed to be
  1149. // correct, even when `error` is set.
  1150. Error *Status `json:"error,omitempty"`
  1151. // FaceAnnotations: If present, face detection has completed
  1152. // successfully.
  1153. FaceAnnotations []*GoogleCloudVisionV1p1beta1FaceAnnotation `json:"faceAnnotations,omitempty"`
  1154. // FullTextAnnotation: If present, text (OCR) detection or document
  1155. // (OCR) text detection has
  1156. // completed successfully.
  1157. // This annotation provides the structural hierarchy for the OCR
  1158. // detected
  1159. // text.
  1160. FullTextAnnotation *GoogleCloudVisionV1p1beta1TextAnnotation `json:"fullTextAnnotation,omitempty"`
  1161. // ImagePropertiesAnnotation: If present, image properties were
  1162. // extracted successfully.
  1163. ImagePropertiesAnnotation *GoogleCloudVisionV1p1beta1ImageProperties `json:"imagePropertiesAnnotation,omitempty"`
  1164. // LabelAnnotations: If present, label detection has completed
  1165. // successfully.
  1166. LabelAnnotations []*GoogleCloudVisionV1p1beta1EntityAnnotation `json:"labelAnnotations,omitempty"`
  1167. // LandmarkAnnotations: If present, landmark detection has completed
  1168. // successfully.
  1169. LandmarkAnnotations []*GoogleCloudVisionV1p1beta1EntityAnnotation `json:"landmarkAnnotations,omitempty"`
  1170. // LogoAnnotations: If present, logo detection has completed
  1171. // successfully.
  1172. LogoAnnotations []*GoogleCloudVisionV1p1beta1EntityAnnotation `json:"logoAnnotations,omitempty"`
  1173. // SafeSearchAnnotation: If present, safe-search annotation has
  1174. // completed successfully.
  1175. SafeSearchAnnotation *GoogleCloudVisionV1p1beta1SafeSearchAnnotation `json:"safeSearchAnnotation,omitempty"`
  1176. // TextAnnotations: If present, text (OCR) detection has completed
  1177. // successfully.
  1178. TextAnnotations []*GoogleCloudVisionV1p1beta1EntityAnnotation `json:"textAnnotations,omitempty"`
  1179. // WebDetection: If present, web detection has completed successfully.
  1180. WebDetection *GoogleCloudVisionV1p1beta1WebDetection `json:"webDetection,omitempty"`
  1181. // ForceSendFields is a list of field names (e.g. "Context") to
  1182. // unconditionally include in API requests. By default, fields with
  1183. // empty values are omitted from API requests. However, any non-pointer,
  1184. // non-interface field appearing in ForceSendFields will be sent to the
  1185. // server regardless of whether the field is empty or not. This may be
  1186. // used to include empty fields in Patch requests.
  1187. ForceSendFields []string `json:"-"`
  1188. // NullFields is a list of field names (e.g. "Context") to include in
  1189. // API requests with the JSON null value. By default, fields with empty
  1190. // values are omitted from API requests. However, any field with an
  1191. // empty value appearing in NullFields will be sent to the server as
  1192. // null. It is an error if a field in this list has a non-empty value.
  1193. // This may be used to include null fields in Patch requests.
  1194. NullFields []string `json:"-"`
  1195. }
  1196. func (s *GoogleCloudVisionV1p1beta1AnnotateImageResponse) MarshalJSON() ([]byte, error) {
  1197. type NoMethod GoogleCloudVisionV1p1beta1AnnotateImageResponse
  1198. raw := NoMethod(*s)
  1199. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1200. }
  1201. // GoogleCloudVisionV1p1beta1AsyncAnnotateFileRequest: An offline file
  1202. // annotation request.
  1203. type GoogleCloudVisionV1p1beta1AsyncAnnotateFileRequest struct {
  1204. // Features: Required. Requested features.
  1205. Features []*GoogleCloudVisionV1p1beta1Feature `json:"features,omitempty"`
  1206. // ImageContext: Additional context that may accompany the image(s) in
  1207. // the file.
  1208. ImageContext *GoogleCloudVisionV1p1beta1ImageContext `json:"imageContext,omitempty"`
  1209. // InputConfig: Required. Information about the input file.
  1210. InputConfig *GoogleCloudVisionV1p1beta1InputConfig `json:"inputConfig,omitempty"`
  1211. // OutputConfig: Required. The desired output location and metadata
  1212. // (e.g. format).
  1213. OutputConfig *GoogleCloudVisionV1p1beta1OutputConfig `json:"outputConfig,omitempty"`
  1214. // ForceSendFields is a list of field names (e.g. "Features") to
  1215. // unconditionally include in API requests. By default, fields with
  1216. // empty values are omitted from API requests. However, any non-pointer,
  1217. // non-interface field appearing in ForceSendFields will be sent to the
  1218. // server regardless of whether the field is empty or not. This may be
  1219. // used to include empty fields in Patch requests.
  1220. ForceSendFields []string `json:"-"`
  1221. // NullFields is a list of field names (e.g. "Features") to include in
  1222. // API requests with the JSON null value. By default, fields with empty
  1223. // values are omitted from API requests. However, any field with an
  1224. // empty value appearing in NullFields will be sent to the server as
  1225. // null. It is an error if a field in this list has a non-empty value.
  1226. // This may be used to include null fields in Patch requests.
  1227. NullFields []string `json:"-"`
  1228. }
  1229. func (s *GoogleCloudVisionV1p1beta1AsyncAnnotateFileRequest) MarshalJSON() ([]byte, error) {
  1230. type NoMethod GoogleCloudVisionV1p1beta1AsyncAnnotateFileRequest
  1231. raw := NoMethod(*s)
  1232. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1233. }
  1234. // GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesRequest: Multiple
  1235. // async file annotation requests are batched into a single
  1236. // service
  1237. // call.
  1238. type GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesRequest struct {
  1239. // Requests: Individual async file annotation requests for this batch.
  1240. Requests []*GoogleCloudVisionV1p1beta1AsyncAnnotateFileRequest `json:"requests,omitempty"`
  1241. // ForceSendFields is a list of field names (e.g. "Requests") to
  1242. // unconditionally include in API requests. By default, fields with
  1243. // empty values are omitted from API requests. However, any non-pointer,
  1244. // non-interface field appearing in ForceSendFields will be sent to the
  1245. // server regardless of whether the field is empty or not. This may be
  1246. // used to include empty fields in Patch requests.
  1247. ForceSendFields []string `json:"-"`
  1248. // NullFields is a list of field names (e.g. "Requests") to include in
  1249. // API requests with the JSON null value. By default, fields with empty
  1250. // values are omitted from API requests. However, any field with an
  1251. // empty value appearing in NullFields will be sent to the server as
  1252. // null. It is an error if a field in this list has a non-empty value.
  1253. // This may be used to include null fields in Patch requests.
  1254. NullFields []string `json:"-"`
  1255. }
  1256. func (s *GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesRequest) MarshalJSON() ([]byte, error) {
  1257. type NoMethod GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesRequest
  1258. raw := NoMethod(*s)
  1259. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1260. }
  1261. // GoogleCloudVisionV1p1beta1BatchAnnotateImagesRequest: Multiple image
  1262. // annotation requests are batched into a single service call.
  1263. type GoogleCloudVisionV1p1beta1BatchAnnotateImagesRequest struct {
  1264. // Requests: Individual image annotation requests for this batch.
  1265. Requests []*GoogleCloudVisionV1p1beta1AnnotateImageRequest `json:"requests,omitempty"`
  1266. // ForceSendFields is a list of field names (e.g. "Requests") to
  1267. // unconditionally include in API requests. By default, fields with
  1268. // empty values are omitted from API requests. However, any non-pointer,
  1269. // non-interface field appearing in ForceSendFields will be sent to the
  1270. // server regardless of whether the field is empty or not. This may be
  1271. // used to include empty fields in Patch requests.
  1272. ForceSendFields []string `json:"-"`
  1273. // NullFields is a list of field names (e.g. "Requests") to include in
  1274. // API requests with the JSON null value. By default, fields with empty
  1275. // values are omitted from API requests. However, any field with an
  1276. // empty value appearing in NullFields will be sent to the server as
  1277. // null. It is an error if a field in this list has a non-empty value.
  1278. // This may be used to include null fields in Patch requests.
  1279. NullFields []string `json:"-"`
  1280. }
  1281. func (s *GoogleCloudVisionV1p1beta1BatchAnnotateImagesRequest) MarshalJSON() ([]byte, error) {
  1282. type NoMethod GoogleCloudVisionV1p1beta1BatchAnnotateImagesRequest
  1283. raw := NoMethod(*s)
  1284. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1285. }
  1286. // GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse: Response to a
  1287. // batch image annotation request.
  1288. type GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse struct {
  1289. // Responses: Individual responses to image annotation requests within
  1290. // the batch.
  1291. Responses []*GoogleCloudVisionV1p1beta1AnnotateImageResponse `json:"responses,omitempty"`
  1292. // ServerResponse contains the HTTP response code and headers from the
  1293. // server.
  1294. googleapi.ServerResponse `json:"-"`
  1295. // ForceSendFields is a list of field names (e.g. "Responses") to
  1296. // unconditionally include in API requests. By default, fields with
  1297. // empty values are omitted from API requests. However, any non-pointer,
  1298. // non-interface field appearing in ForceSendFields will be sent to the
  1299. // server regardless of whether the field is empty or not. This may be
  1300. // used to include empty fields in Patch requests.
  1301. ForceSendFields []string `json:"-"`
  1302. // NullFields is a list of field names (e.g. "Responses") to include in
  1303. // API requests with the JSON null value. By default, fields with empty
  1304. // values are omitted from API requests. However, any field with an
  1305. // empty value appearing in NullFields will be sent to the server as
  1306. // null. It is an error if a field in this list has a non-empty value.
  1307. // This may be used to include null fields in Patch requests.
  1308. NullFields []string `json:"-"`
  1309. }
  1310. func (s *GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse) MarshalJSON() ([]byte, error) {
  1311. type NoMethod GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse
  1312. raw := NoMethod(*s)
  1313. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1314. }
  1315. // GoogleCloudVisionV1p1beta1Block: Logical element on the page.
  1316. type GoogleCloudVisionV1p1beta1Block struct {
  1317. // BlockType: Detected block type (text, image etc) for this block.
  1318. //
  1319. // Possible values:
  1320. // "UNKNOWN" - Unknown block type.
  1321. // "TEXT" - Regular text block.
  1322. // "TABLE" - Table block.
  1323. // "PICTURE" - Image block.
  1324. // "RULER" - Horizontal/vertical line box.
  1325. // "BARCODE" - Barcode block.
  1326. BlockType string `json:"blockType,omitempty"`
  1327. // BoundingBox: The bounding box for the block.
  1328. // The vertices are in the order of top-left, top-right,
  1329. // bottom-right,
  1330. // bottom-left. When a rotation of the bounding box is detected the
  1331. // rotation
  1332. // is represented as around the top-left corner as defined when the text
  1333. // is
  1334. // read in the 'natural' orientation.
  1335. // For example:
  1336. //
  1337. // * when the text is horizontal it might look like:
  1338. //
  1339. // 0----1
  1340. // | |
  1341. // 3----2
  1342. //
  1343. // * when it's rotated 180 degrees around the top-left corner it
  1344. // becomes:
  1345. //
  1346. // 2----3
  1347. // | |
  1348. // 1----0
  1349. //
  1350. // and the vertice order will still be (0, 1, 2, 3).
  1351. BoundingBox *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingBox,omitempty"`
  1352. // Confidence: Confidence of the OCR results on the block. Range [0, 1].
  1353. Confidence float64 `json:"confidence,omitempty"`
  1354. // Paragraphs: List of paragraphs in this block (if this blocks is of
  1355. // type text).
  1356. Paragraphs []*GoogleCloudVisionV1p1beta1Paragraph `json:"paragraphs,omitempty"`
  1357. // Property: Additional information detected for the block.
  1358. Property *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty `json:"property,omitempty"`
  1359. // ForceSendFields is a list of field names (e.g. "BlockType") to
  1360. // unconditionally include in API requests. By default, fields with
  1361. // empty values are omitted from API requests. However, any non-pointer,
  1362. // non-interface field appearing in ForceSendFields will be sent to the
  1363. // server regardless of whether the field is empty or not. This may be
  1364. // used to include empty fields in Patch requests.
  1365. ForceSendFields []string `json:"-"`
  1366. // NullFields is a list of field names (e.g. "BlockType") to include in
  1367. // API requests with the JSON null value. By default, fields with empty
  1368. // values are omitted from API requests. However, any field with an
  1369. // empty value appearing in NullFields will be sent to the server as
  1370. // null. It is an error if a field in this list has a non-empty value.
  1371. // This may be used to include null fields in Patch requests.
  1372. NullFields []string `json:"-"`
  1373. }
  1374. func (s *GoogleCloudVisionV1p1beta1Block) MarshalJSON() ([]byte, error) {
  1375. type NoMethod GoogleCloudVisionV1p1beta1Block
  1376. raw := NoMethod(*s)
  1377. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1378. }
  1379. func (s *GoogleCloudVisionV1p1beta1Block) UnmarshalJSON(data []byte) error {
  1380. type NoMethod GoogleCloudVisionV1p1beta1Block
  1381. var s1 struct {
  1382. Confidence gensupport.JSONFloat64 `json:"confidence"`
  1383. *NoMethod
  1384. }
  1385. s1.NoMethod = (*NoMethod)(s)
  1386. if err := json.Unmarshal(data, &s1); err != nil {
  1387. return err
  1388. }
  1389. s.Confidence = float64(s1.Confidence)
  1390. return nil
  1391. }
  1392. // GoogleCloudVisionV1p1beta1BoundingPoly: A bounding polygon for the
  1393. // detected image annotation.
  1394. type GoogleCloudVisionV1p1beta1BoundingPoly struct {
  1395. // Vertices: The bounding polygon vertices.
  1396. Vertices []*GoogleCloudVisionV1p1beta1Vertex `json:"vertices,omitempty"`
  1397. // ForceSendFields is a list of field names (e.g. "Vertices") to
  1398. // unconditionally include in API requests. By default, fields with
  1399. // empty values are omitted from API requests. However, any non-pointer,
  1400. // non-interface field appearing in ForceSendFields will be sent to the
  1401. // server regardless of whether the field is empty or not. This may be
  1402. // used to include empty fields in Patch requests.
  1403. ForceSendFields []string `json:"-"`
  1404. // NullFields is a list of field names (e.g. "Vertices") to include in
  1405. // API requests with the JSON null value. By default, fields with empty
  1406. // values are omitted from API requests. However, any field with an
  1407. // empty value appearing in NullFields will be sent to the server as
  1408. // null. It is an error if a field in this list has a non-empty value.
  1409. // This may be used to include null fields in Patch requests.
  1410. NullFields []string `json:"-"`
  1411. }
  1412. func (s *GoogleCloudVisionV1p1beta1BoundingPoly) MarshalJSON() ([]byte, error) {
  1413. type NoMethod GoogleCloudVisionV1p1beta1BoundingPoly
  1414. raw := NoMethod(*s)
  1415. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1416. }
  1417. // GoogleCloudVisionV1p1beta1ColorInfo: Color information consists of
  1418. // RGB channels, score, and the fraction of
  1419. // the image that the color occupies in the image.
  1420. type GoogleCloudVisionV1p1beta1ColorInfo struct {
  1421. // Color: RGB components of the color.
  1422. Color *Color `json:"color,omitempty"`
  1423. // PixelFraction: The fraction of pixels the color occupies in the
  1424. // image.
  1425. // Value in range [0, 1].
  1426. PixelFraction float64 `json:"pixelFraction,omitempty"`
  1427. // Score: Image-specific score for this color. Value in range [0, 1].
  1428. Score float64 `json:"score,omitempty"`
  1429. // ForceSendFields is a list of field names (e.g. "Color") to
  1430. // unconditionally include in API requests. By default, fields with
  1431. // empty values are omitted from API requests. However, any non-pointer,
  1432. // non-interface field appearing in ForceSendFields will be sent to the
  1433. // server regardless of whether the field is empty or not. This may be
  1434. // used to include empty fields in Patch requests.
  1435. ForceSendFields []string `json:"-"`
  1436. // NullFields is a list of field names (e.g. "Color") to include in API
  1437. // requests with the JSON null value. By default, fields with empty
  1438. // values are omitted from API requests. However, any field with an
  1439. // empty value appearing in NullFields will be sent to the server as
  1440. // null. It is an error if a field in this list has a non-empty value.
  1441. // This may be used to include null fields in Patch requests.
  1442. NullFields []string `json:"-"`
  1443. }
  1444. func (s *GoogleCloudVisionV1p1beta1ColorInfo) MarshalJSON() ([]byte, error) {
  1445. type NoMethod GoogleCloudVisionV1p1beta1ColorInfo
  1446. raw := NoMethod(*s)
  1447. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1448. }
  1449. func (s *GoogleCloudVisionV1p1beta1ColorInfo) UnmarshalJSON(data []byte) error {
  1450. type NoMethod GoogleCloudVisionV1p1beta1ColorInfo
  1451. var s1 struct {
  1452. PixelFraction gensupport.JSONFloat64 `json:"pixelFraction"`
  1453. Score gensupport.JSONFloat64 `json:"score"`
  1454. *NoMethod
  1455. }
  1456. s1.NoMethod = (*NoMethod)(s)
  1457. if err := json.Unmarshal(data, &s1); err != nil {
  1458. return err
  1459. }
  1460. s.PixelFraction = float64(s1.PixelFraction)
  1461. s.Score = float64(s1.Score)
  1462. return nil
  1463. }
  1464. // GoogleCloudVisionV1p1beta1CropHint: Single crop hint that is used to
  1465. // generate a new crop when serving an image.
  1466. type GoogleCloudVisionV1p1beta1CropHint struct {
  1467. // BoundingPoly: The bounding polygon for the crop region. The
  1468. // coordinates of the bounding
  1469. // box are in the original image's scale, as returned in `ImageParams`.
  1470. BoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingPoly,omitempty"`
  1471. // Confidence: Confidence of this being a salient region. Range [0, 1].
  1472. Confidence float64 `json:"confidence,omitempty"`
  1473. // ImportanceFraction: Fraction of importance of this salient region
  1474. // with respect to the original
  1475. // image.
  1476. ImportanceFraction float64 `json:"importanceFraction,omitempty"`
  1477. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  1478. // unconditionally include in API requests. By default, fields with
  1479. // empty values are omitted from API requests. However, any non-pointer,
  1480. // non-interface field appearing in ForceSendFields will be sent to the
  1481. // server regardless of whether the field is empty or not. This may be
  1482. // used to include empty fields in Patch requests.
  1483. ForceSendFields []string `json:"-"`
  1484. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  1485. // in API requests with the JSON null value. By default, fields with
  1486. // empty values are omitted from API requests. However, any field with
  1487. // an empty value appearing in NullFields will be sent to the server as
  1488. // null. It is an error if a field in this list has a non-empty value.
  1489. // This may be used to include null fields in Patch requests.
  1490. NullFields []string `json:"-"`
  1491. }
  1492. func (s *GoogleCloudVisionV1p1beta1CropHint) MarshalJSON() ([]byte, error) {
  1493. type NoMethod GoogleCloudVisionV1p1beta1CropHint
  1494. raw := NoMethod(*s)
  1495. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1496. }
  1497. func (s *GoogleCloudVisionV1p1beta1CropHint) UnmarshalJSON(data []byte) error {
  1498. type NoMethod GoogleCloudVisionV1p1beta1CropHint
  1499. var s1 struct {
  1500. Confidence gensupport.JSONFloat64 `json:"confidence"`
  1501. ImportanceFraction gensupport.JSONFloat64 `json:"importanceFraction"`
  1502. *NoMethod
  1503. }
  1504. s1.NoMethod = (*NoMethod)(s)
  1505. if err := json.Unmarshal(data, &s1); err != nil {
  1506. return err
  1507. }
  1508. s.Confidence = float64(s1.Confidence)
  1509. s.ImportanceFraction = float64(s1.ImportanceFraction)
  1510. return nil
  1511. }
  1512. // GoogleCloudVisionV1p1beta1CropHintsAnnotation: Set of crop hints that
  1513. // are used to generate new crops when serving images.
  1514. type GoogleCloudVisionV1p1beta1CropHintsAnnotation struct {
  1515. // CropHints: Crop hint results.
  1516. CropHints []*GoogleCloudVisionV1p1beta1CropHint `json:"cropHints,omitempty"`
  1517. // ForceSendFields is a list of field names (e.g. "CropHints") to
  1518. // unconditionally include in API requests. By default, fields with
  1519. // empty values are omitted from API requests. However, any non-pointer,
  1520. // non-interface field appearing in ForceSendFields will be sent to the
  1521. // server regardless of whether the field is empty or not. This may be
  1522. // used to include empty fields in Patch requests.
  1523. ForceSendFields []string `json:"-"`
  1524. // NullFields is a list of field names (e.g. "CropHints") to include in
  1525. // API requests with the JSON null value. By default, fields with empty
  1526. // values are omitted from API requests. However, any field with an
  1527. // empty value appearing in NullFields will be sent to the server as
  1528. // null. It is an error if a field in this list has a non-empty value.
  1529. // This may be used to include null fields in Patch requests.
  1530. NullFields []string `json:"-"`
  1531. }
  1532. func (s *GoogleCloudVisionV1p1beta1CropHintsAnnotation) MarshalJSON() ([]byte, error) {
  1533. type NoMethod GoogleCloudVisionV1p1beta1CropHintsAnnotation
  1534. raw := NoMethod(*s)
  1535. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1536. }
  1537. // GoogleCloudVisionV1p1beta1CropHintsParams: Parameters for crop hints
  1538. // annotation request.
  1539. type GoogleCloudVisionV1p1beta1CropHintsParams struct {
  1540. // AspectRatios: Aspect ratios in floats, representing the ratio of the
  1541. // width to the height
  1542. // of the image. For example, if the desired aspect ratio is 4/3,
  1543. // the
  1544. // corresponding float value should be 1.33333. If not specified,
  1545. // the
  1546. // best possible crop is returned. The number of provided aspect ratios
  1547. // is
  1548. // limited to a maximum of 16; any aspect ratios provided after the 16th
  1549. // are
  1550. // ignored.
  1551. AspectRatios []float64 `json:"aspectRatios,omitempty"`
  1552. // ForceSendFields is a list of field names (e.g. "AspectRatios") to
  1553. // unconditionally include in API requests. By default, fields with
  1554. // empty values are omitted from API requests. However, any non-pointer,
  1555. // non-interface field appearing in ForceSendFields will be sent to the
  1556. // server regardless of whether the field is empty or not. This may be
  1557. // used to include empty fields in Patch requests.
  1558. ForceSendFields []string `json:"-"`
  1559. // NullFields is a list of field names (e.g. "AspectRatios") to include
  1560. // in API requests with the JSON null value. By default, fields with
  1561. // empty values are omitted from API requests. However, any field with
  1562. // an empty value appearing in NullFields will be sent to the server as
  1563. // null. It is an error if a field in this list has a non-empty value.
  1564. // This may be used to include null fields in Patch requests.
  1565. NullFields []string `json:"-"`
  1566. }
  1567. func (s *GoogleCloudVisionV1p1beta1CropHintsParams) MarshalJSON() ([]byte, error) {
  1568. type NoMethod GoogleCloudVisionV1p1beta1CropHintsParams
  1569. raw := NoMethod(*s)
  1570. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1571. }
  1572. // GoogleCloudVisionV1p1beta1DominantColorsAnnotation: Set of dominant
  1573. // colors and their corresponding scores.
  1574. type GoogleCloudVisionV1p1beta1DominantColorsAnnotation struct {
  1575. // Colors: RGB color values with their score and pixel fraction.
  1576. Colors []*GoogleCloudVisionV1p1beta1ColorInfo `json:"colors,omitempty"`
  1577. // ForceSendFields is a list of field names (e.g. "Colors") to
  1578. // unconditionally include in API requests. By default, fields with
  1579. // empty values are omitted from API requests. However, any non-pointer,
  1580. // non-interface field appearing in ForceSendFields will be sent to the
  1581. // server regardless of whether the field is empty or not. This may be
  1582. // used to include empty fields in Patch requests.
  1583. ForceSendFields []string `json:"-"`
  1584. // NullFields is a list of field names (e.g. "Colors") to include in API
  1585. // requests with the JSON null value. By default, fields with empty
  1586. // values are omitted from API requests. However, any field with an
  1587. // empty value appearing in NullFields will be sent to the server as
  1588. // null. It is an error if a field in this list has a non-empty value.
  1589. // This may be used to include null fields in Patch requests.
  1590. NullFields []string `json:"-"`
  1591. }
  1592. func (s *GoogleCloudVisionV1p1beta1DominantColorsAnnotation) MarshalJSON() ([]byte, error) {
  1593. type NoMethod GoogleCloudVisionV1p1beta1DominantColorsAnnotation
  1594. raw := NoMethod(*s)
  1595. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1596. }
  1597. // GoogleCloudVisionV1p1beta1EntityAnnotation: Set of detected entity
  1598. // features.
  1599. type GoogleCloudVisionV1p1beta1EntityAnnotation struct {
  1600. // BoundingPoly: Image region to which this entity belongs. Not
  1601. // produced
  1602. // for `LABEL_DETECTION` features.
  1603. BoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingPoly,omitempty"`
  1604. // Confidence: **Deprecated. Use `score` instead.**
  1605. // The accuracy of the entity detection in an image.
  1606. // For example, for an image in which the "Eiffel Tower" entity is
  1607. // detected,
  1608. // this field represents the confidence that there is a tower in the
  1609. // query
  1610. // image. Range [0, 1].
  1611. Confidence float64 `json:"confidence,omitempty"`
  1612. // Description: Entity textual description, expressed in its `locale`
  1613. // language.
  1614. Description string `json:"description,omitempty"`
  1615. // Locale: The language code for the locale in which the entity
  1616. // textual
  1617. // `description` is expressed.
  1618. Locale string `json:"locale,omitempty"`
  1619. // Locations: The location information for the detected entity.
  1620. // Multiple
  1621. // `LocationInfo` elements can be present because one location
  1622. // may
  1623. // indicate the location of the scene in the image, and another
  1624. // location
  1625. // may indicate the location of the place where the image was
  1626. // taken.
  1627. // Location information is usually present for landmarks.
  1628. Locations []*GoogleCloudVisionV1p1beta1LocationInfo `json:"locations,omitempty"`
  1629. // Mid: Opaque entity ID. Some IDs may be available in
  1630. // [Google Knowledge Graph
  1631. // Search
  1632. // API](https://developers.google.com/knowledge-graph/).
  1633. Mid string `json:"mid,omitempty"`
  1634. // Properties: Some entities may have optional user-supplied `Property`
  1635. // (name/value)
  1636. // fields, such a score or string that qualifies the entity.
  1637. Properties []*GoogleCloudVisionV1p1beta1Property `json:"properties,omitempty"`
  1638. // Score: Overall score of the result. Range [0, 1].
  1639. Score float64 `json:"score,omitempty"`
  1640. // Topicality: The relevancy of the ICA (Image Content Annotation) label
  1641. // to the
  1642. // image. For example, the relevancy of "tower" is likely higher to an
  1643. // image
  1644. // containing the detected "Eiffel Tower" than to an image containing
  1645. // a
  1646. // detected distant towering building, even though the confidence
  1647. // that
  1648. // there is a tower in each image may be the same. Range [0, 1].
  1649. Topicality float64 `json:"topicality,omitempty"`
  1650. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  1651. // unconditionally include in API requests. By default, fields with
  1652. // empty values are omitted from API requests. However, any non-pointer,
  1653. // non-interface field appearing in ForceSendFields will be sent to the
  1654. // server regardless of whether the field is empty or not. This may be
  1655. // used to include empty fields in Patch requests.
  1656. ForceSendFields []string `json:"-"`
  1657. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  1658. // in API requests with the JSON null value. By default, fields with
  1659. // empty values are omitted from API requests. However, any field with
  1660. // an empty value appearing in NullFields will be sent to the server as
  1661. // null. It is an error if a field in this list has a non-empty value.
  1662. // This may be used to include null fields in Patch requests.
  1663. NullFields []string `json:"-"`
  1664. }
  1665. func (s *GoogleCloudVisionV1p1beta1EntityAnnotation) MarshalJSON() ([]byte, error) {
  1666. type NoMethod GoogleCloudVisionV1p1beta1EntityAnnotation
  1667. raw := NoMethod(*s)
  1668. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1669. }
  1670. func (s *GoogleCloudVisionV1p1beta1EntityAnnotation) UnmarshalJSON(data []byte) error {
  1671. type NoMethod GoogleCloudVisionV1p1beta1EntityAnnotation
  1672. var s1 struct {
  1673. Confidence gensupport.JSONFloat64 `json:"confidence"`
  1674. Score gensupport.JSONFloat64 `json:"score"`
  1675. Topicality gensupport.JSONFloat64 `json:"topicality"`
  1676. *NoMethod
  1677. }
  1678. s1.NoMethod = (*NoMethod)(s)
  1679. if err := json.Unmarshal(data, &s1); err != nil {
  1680. return err
  1681. }
  1682. s.Confidence = float64(s1.Confidence)
  1683. s.Score = float64(s1.Score)
  1684. s.Topicality = float64(s1.Topicality)
  1685. return nil
  1686. }
  1687. // GoogleCloudVisionV1p1beta1FaceAnnotation: A face annotation object
  1688. // contains the results of face detection.
  1689. type GoogleCloudVisionV1p1beta1FaceAnnotation struct {
  1690. // AngerLikelihood: Anger likelihood.
  1691. //
  1692. // Possible values:
  1693. // "UNKNOWN" - Unknown likelihood.
  1694. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1695. // specified vertical.
  1696. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1697. // vertical.
  1698. // "POSSIBLE" - It is possible that the image belongs to the specified
  1699. // vertical.
  1700. // "LIKELY" - It is likely that the image belongs to the specified
  1701. // vertical.
  1702. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1703. // specified vertical.
  1704. AngerLikelihood string `json:"angerLikelihood,omitempty"`
  1705. // BlurredLikelihood: Blurred likelihood.
  1706. //
  1707. // Possible values:
  1708. // "UNKNOWN" - Unknown likelihood.
  1709. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1710. // specified vertical.
  1711. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1712. // vertical.
  1713. // "POSSIBLE" - It is possible that the image belongs to the specified
  1714. // vertical.
  1715. // "LIKELY" - It is likely that the image belongs to the specified
  1716. // vertical.
  1717. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1718. // specified vertical.
  1719. BlurredLikelihood string `json:"blurredLikelihood,omitempty"`
  1720. // BoundingPoly: The bounding polygon around the face. The coordinates
  1721. // of the bounding box
  1722. // are in the original image's scale, as returned in `ImageParams`.
  1723. // The bounding box is computed to "frame" the face in accordance with
  1724. // human
  1725. // expectations. It is based on the landmarker results.
  1726. // Note that one or more x and/or y coordinates may not be generated in
  1727. // the
  1728. // `BoundingPoly` (the polygon will be unbounded) if only a partial
  1729. // face
  1730. // appears in the image to be annotated.
  1731. BoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingPoly,omitempty"`
  1732. // DetectionConfidence: Detection confidence. Range [0, 1].
  1733. DetectionConfidence float64 `json:"detectionConfidence,omitempty"`
  1734. // FdBoundingPoly: The `fd_bounding_poly` bounding polygon is tighter
  1735. // than the
  1736. // `boundingPoly`, and encloses only the skin part of the face.
  1737. // Typically, it
  1738. // is used to eliminate the face from any image analysis that detects
  1739. // the
  1740. // "amount of skin" visible in an image. It is not based on
  1741. // the
  1742. // landmarker results, only on the initial face detection, hence
  1743. // the <code>fd</code> (face detection) prefix.
  1744. FdBoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"fdBoundingPoly,omitempty"`
  1745. // HeadwearLikelihood: Headwear likelihood.
  1746. //
  1747. // Possible values:
  1748. // "UNKNOWN" - Unknown likelihood.
  1749. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1750. // specified vertical.
  1751. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1752. // vertical.
  1753. // "POSSIBLE" - It is possible that the image belongs to the specified
  1754. // vertical.
  1755. // "LIKELY" - It is likely that the image belongs to the specified
  1756. // vertical.
  1757. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1758. // specified vertical.
  1759. HeadwearLikelihood string `json:"headwearLikelihood,omitempty"`
  1760. // JoyLikelihood: Joy likelihood.
  1761. //
  1762. // Possible values:
  1763. // "UNKNOWN" - Unknown likelihood.
  1764. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1765. // specified vertical.
  1766. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1767. // vertical.
  1768. // "POSSIBLE" - It is possible that the image belongs to the specified
  1769. // vertical.
  1770. // "LIKELY" - It is likely that the image belongs to the specified
  1771. // vertical.
  1772. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1773. // specified vertical.
  1774. JoyLikelihood string `json:"joyLikelihood,omitempty"`
  1775. // LandmarkingConfidence: Face landmarking confidence. Range [0, 1].
  1776. LandmarkingConfidence float64 `json:"landmarkingConfidence,omitempty"`
  1777. // Landmarks: Detected face landmarks.
  1778. Landmarks []*GoogleCloudVisionV1p1beta1FaceAnnotationLandmark `json:"landmarks,omitempty"`
  1779. // PanAngle: Yaw angle, which indicates the leftward/rightward angle
  1780. // that the face is
  1781. // pointing relative to the vertical plane perpendicular to the image.
  1782. // Range
  1783. // [-180,180].
  1784. PanAngle float64 `json:"panAngle,omitempty"`
  1785. // RollAngle: Roll angle, which indicates the amount of
  1786. // clockwise/anti-clockwise rotation
  1787. // of the face relative to the image vertical about the axis
  1788. // perpendicular to
  1789. // the face. Range [-180,180].
  1790. RollAngle float64 `json:"rollAngle,omitempty"`
  1791. // SorrowLikelihood: Sorrow likelihood.
  1792. //
  1793. // Possible values:
  1794. // "UNKNOWN" - Unknown likelihood.
  1795. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1796. // specified vertical.
  1797. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1798. // vertical.
  1799. // "POSSIBLE" - It is possible that the image belongs to the specified
  1800. // vertical.
  1801. // "LIKELY" - It is likely that the image belongs to the specified
  1802. // vertical.
  1803. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1804. // specified vertical.
  1805. SorrowLikelihood string `json:"sorrowLikelihood,omitempty"`
  1806. // SurpriseLikelihood: Surprise likelihood.
  1807. //
  1808. // Possible values:
  1809. // "UNKNOWN" - Unknown likelihood.
  1810. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1811. // specified vertical.
  1812. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1813. // vertical.
  1814. // "POSSIBLE" - It is possible that the image belongs to the specified
  1815. // vertical.
  1816. // "LIKELY" - It is likely that the image belongs to the specified
  1817. // vertical.
  1818. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1819. // specified vertical.
  1820. SurpriseLikelihood string `json:"surpriseLikelihood,omitempty"`
  1821. // TiltAngle: Pitch angle, which indicates the upwards/downwards angle
  1822. // that the face is
  1823. // pointing relative to the image's horizontal plane. Range [-180,180].
  1824. TiltAngle float64 `json:"tiltAngle,omitempty"`
  1825. // UnderExposedLikelihood: Under-exposed likelihood.
  1826. //
  1827. // Possible values:
  1828. // "UNKNOWN" - Unknown likelihood.
  1829. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1830. // specified vertical.
  1831. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1832. // vertical.
  1833. // "POSSIBLE" - It is possible that the image belongs to the specified
  1834. // vertical.
  1835. // "LIKELY" - It is likely that the image belongs to the specified
  1836. // vertical.
  1837. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1838. // specified vertical.
  1839. UnderExposedLikelihood string `json:"underExposedLikelihood,omitempty"`
  1840. // ForceSendFields is a list of field names (e.g. "AngerLikelihood") to
  1841. // unconditionally include in API requests. By default, fields with
  1842. // empty values are omitted from API requests. However, any non-pointer,
  1843. // non-interface field appearing in ForceSendFields will be sent to the
  1844. // server regardless of whether the field is empty or not. This may be
  1845. // used to include empty fields in Patch requests.
  1846. ForceSendFields []string `json:"-"`
  1847. // NullFields is a list of field names (e.g. "AngerLikelihood") to
  1848. // include in API requests with the JSON null value. By default, fields
  1849. // with empty values are omitted from API requests. However, any field
  1850. // with an empty value appearing in NullFields will be sent to the
  1851. // server as null. It is an error if a field in this list has a
  1852. // non-empty value. This may be used to include null fields in Patch
  1853. // requests.
  1854. NullFields []string `json:"-"`
  1855. }
  1856. func (s *GoogleCloudVisionV1p1beta1FaceAnnotation) MarshalJSON() ([]byte, error) {
  1857. type NoMethod GoogleCloudVisionV1p1beta1FaceAnnotation
  1858. raw := NoMethod(*s)
  1859. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1860. }
  1861. func (s *GoogleCloudVisionV1p1beta1FaceAnnotation) UnmarshalJSON(data []byte) error {
  1862. type NoMethod GoogleCloudVisionV1p1beta1FaceAnnotation
  1863. var s1 struct {
  1864. DetectionConfidence gensupport.JSONFloat64 `json:"detectionConfidence"`
  1865. LandmarkingConfidence gensupport.JSONFloat64 `json:"landmarkingConfidence"`
  1866. PanAngle gensupport.JSONFloat64 `json:"panAngle"`
  1867. RollAngle gensupport.JSONFloat64 `json:"rollAngle"`
  1868. TiltAngle gensupport.JSONFloat64 `json:"tiltAngle"`
  1869. *NoMethod
  1870. }
  1871. s1.NoMethod = (*NoMethod)(s)
  1872. if err := json.Unmarshal(data, &s1); err != nil {
  1873. return err
  1874. }
  1875. s.DetectionConfidence = float64(s1.DetectionConfidence)
  1876. s.LandmarkingConfidence = float64(s1.LandmarkingConfidence)
  1877. s.PanAngle = float64(s1.PanAngle)
  1878. s.RollAngle = float64(s1.RollAngle)
  1879. s.TiltAngle = float64(s1.TiltAngle)
  1880. return nil
  1881. }
  1882. // GoogleCloudVisionV1p1beta1FaceAnnotationLandmark: A face-specific
  1883. // landmark (for example, a face feature).
  1884. type GoogleCloudVisionV1p1beta1FaceAnnotationLandmark struct {
  1885. // Position: Face landmark position.
  1886. Position *GoogleCloudVisionV1p1beta1Position `json:"position,omitempty"`
  1887. // Type: Face landmark type.
  1888. //
  1889. // Possible values:
  1890. // "UNKNOWN_LANDMARK" - Unknown face landmark detected. Should not be
  1891. // filled.
  1892. // "LEFT_EYE" - Left eye.
  1893. // "RIGHT_EYE" - Right eye.
  1894. // "LEFT_OF_LEFT_EYEBROW" - Left of left eyebrow.
  1895. // "RIGHT_OF_LEFT_EYEBROW" - Right of left eyebrow.
  1896. // "LEFT_OF_RIGHT_EYEBROW" - Left of right eyebrow.
  1897. // "RIGHT_OF_RIGHT_EYEBROW" - Right of right eyebrow.
  1898. // "MIDPOINT_BETWEEN_EYES" - Midpoint between eyes.
  1899. // "NOSE_TIP" - Nose tip.
  1900. // "UPPER_LIP" - Upper lip.
  1901. // "LOWER_LIP" - Lower lip.
  1902. // "MOUTH_LEFT" - Mouth left.
  1903. // "MOUTH_RIGHT" - Mouth right.
  1904. // "MOUTH_CENTER" - Mouth center.
  1905. // "NOSE_BOTTOM_RIGHT" - Nose, bottom right.
  1906. // "NOSE_BOTTOM_LEFT" - Nose, bottom left.
  1907. // "NOSE_BOTTOM_CENTER" - Nose, bottom center.
  1908. // "LEFT_EYE_TOP_BOUNDARY" - Left eye, top boundary.
  1909. // "LEFT_EYE_RIGHT_CORNER" - Left eye, right corner.
  1910. // "LEFT_EYE_BOTTOM_BOUNDARY" - Left eye, bottom boundary.
  1911. // "LEFT_EYE_LEFT_CORNER" - Left eye, left corner.
  1912. // "RIGHT_EYE_TOP_BOUNDARY" - Right eye, top boundary.
  1913. // "RIGHT_EYE_RIGHT_CORNER" - Right eye, right corner.
  1914. // "RIGHT_EYE_BOTTOM_BOUNDARY" - Right eye, bottom boundary.
  1915. // "RIGHT_EYE_LEFT_CORNER" - Right eye, left corner.
  1916. // "LEFT_EYEBROW_UPPER_MIDPOINT" - Left eyebrow, upper midpoint.
  1917. // "RIGHT_EYEBROW_UPPER_MIDPOINT" - Right eyebrow, upper midpoint.
  1918. // "LEFT_EAR_TRAGION" - Left ear tragion.
  1919. // "RIGHT_EAR_TRAGION" - Right ear tragion.
  1920. // "LEFT_EYE_PUPIL" - Left eye pupil.
  1921. // "RIGHT_EYE_PUPIL" - Right eye pupil.
  1922. // "FOREHEAD_GLABELLA" - Forehead glabella.
  1923. // "CHIN_GNATHION" - Chin gnathion.
  1924. // "CHIN_LEFT_GONION" - Chin left gonion.
  1925. // "CHIN_RIGHT_GONION" - Chin right gonion.
  1926. Type string `json:"type,omitempty"`
  1927. // ForceSendFields is a list of field names (e.g. "Position") to
  1928. // unconditionally include in API requests. By default, fields with
  1929. // empty values are omitted from API requests. However, any non-pointer,
  1930. // non-interface field appearing in ForceSendFields will be sent to the
  1931. // server regardless of whether the field is empty or not. This may be
  1932. // used to include empty fields in Patch requests.
  1933. ForceSendFields []string `json:"-"`
  1934. // NullFields is a list of field names (e.g. "Position") to include in
  1935. // API requests with the JSON null value. By default, fields with empty
  1936. // values are omitted from API requests. However, any field with an
  1937. // empty value appearing in NullFields will be sent to the server as
  1938. // null. It is an error if a field in this list has a non-empty value.
  1939. // This may be used to include null fields in Patch requests.
  1940. NullFields []string `json:"-"`
  1941. }
  1942. func (s *GoogleCloudVisionV1p1beta1FaceAnnotationLandmark) MarshalJSON() ([]byte, error) {
  1943. type NoMethod GoogleCloudVisionV1p1beta1FaceAnnotationLandmark
  1944. raw := NoMethod(*s)
  1945. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1946. }
  1947. // GoogleCloudVisionV1p1beta1Feature: The type of Google Cloud Vision
  1948. // API detection to perform, and the maximum
  1949. // number of results to return for that type. Multiple `Feature` objects
  1950. // can
  1951. // be specified in the `features` list.
  1952. type GoogleCloudVisionV1p1beta1Feature struct {
  1953. // MaxResults: Maximum number of results of this type. Does not apply
  1954. // to
  1955. // `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`.
  1956. MaxResults int64 `json:"maxResults,omitempty"`
  1957. // Model: Model to use for the feature.
  1958. // Supported values: "builtin/stable" (the default if unset)
  1959. // and
  1960. // "builtin/latest".
  1961. Model string `json:"model,omitempty"`
  1962. // Type: The feature type.
  1963. //
  1964. // Possible values:
  1965. // "TYPE_UNSPECIFIED" - Unspecified feature type.
  1966. // "FACE_DETECTION" - Run face detection.
  1967. // "LANDMARK_DETECTION" - Run landmark detection.
  1968. // "LOGO_DETECTION" - Run logo detection.
  1969. // "LABEL_DETECTION" - Run label detection.
  1970. // "TEXT_DETECTION" - Run text detection / optical character
  1971. // recognition (OCR). Text detection
  1972. // is optimized for areas of text within a larger image; if the image
  1973. // is
  1974. // a document, use `DOCUMENT_TEXT_DETECTION` instead.
  1975. // "DOCUMENT_TEXT_DETECTION" - Run dense text document OCR. Takes
  1976. // precedence when both
  1977. // `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` are present.
  1978. // "SAFE_SEARCH_DETECTION" - Run Safe Search to detect potentially
  1979. // unsafe
  1980. // or undesirable content.
  1981. // "IMAGE_PROPERTIES" - Compute a set of image properties, such as
  1982. // the
  1983. // image's dominant colors.
  1984. // "CROP_HINTS" - Run crop hints.
  1985. // "WEB_DETECTION" - Run web detection.
  1986. Type string `json:"type,omitempty"`
  1987. // ForceSendFields is a list of field names (e.g. "MaxResults") to
  1988. // unconditionally include in API requests. By default, fields with
  1989. // empty values are omitted from API requests. However, any non-pointer,
  1990. // non-interface field appearing in ForceSendFields will be sent to the
  1991. // server regardless of whether the field is empty or not. This may be
  1992. // used to include empty fields in Patch requests.
  1993. ForceSendFields []string `json:"-"`
  1994. // NullFields is a list of field names (e.g. "MaxResults") to include in
  1995. // API requests with the JSON null value. By default, fields with empty
  1996. // values are omitted from API requests. However, any field with an
  1997. // empty value appearing in NullFields will be sent to the server as
  1998. // null. It is an error if a field in this list has a non-empty value.
  1999. // This may be used to include null fields in Patch requests.
  2000. NullFields []string `json:"-"`
  2001. }
  2002. func (s *GoogleCloudVisionV1p1beta1Feature) MarshalJSON() ([]byte, error) {
  2003. type NoMethod GoogleCloudVisionV1p1beta1Feature
  2004. raw := NoMethod(*s)
  2005. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2006. }
  2007. // GoogleCloudVisionV1p1beta1GcsDestination: The Google Cloud Storage
  2008. // location where the output will be written to.
  2009. type GoogleCloudVisionV1p1beta1GcsDestination struct {
  2010. // Uri: Google Cloud Storage URI where the results will be stored.
  2011. // Results will
  2012. // be in JSON format and preceded by its corresponding input URI. This
  2013. // field
  2014. // can either represent a single file, or a prefix for multiple
  2015. // outputs.
  2016. // Prefixes must end in a `/`.
  2017. //
  2018. // Examples:
  2019. //
  2020. // * File: gs://bucket-name/filename.json
  2021. // * Prefix: gs://bucket-name/prefix/here/
  2022. // * File: gs://bucket-name/prefix/here
  2023. //
  2024. // If multiple outputs, each response is still AnnotateFileResponse,
  2025. // each of
  2026. // which contains some subset of the full list of
  2027. // AnnotateImageResponse.
  2028. // Multiple outputs can happen if, for example, the output JSON is too
  2029. // large
  2030. // and overflows into multiple sharded files.
  2031. Uri string `json:"uri,omitempty"`
  2032. // ForceSendFields is a list of field names (e.g. "Uri") to
  2033. // unconditionally include in API requests. By default, fields with
  2034. // empty values are omitted from API requests. However, any non-pointer,
  2035. // non-interface field appearing in ForceSendFields will be sent to the
  2036. // server regardless of whether the field is empty or not. This may be
  2037. // used to include empty fields in Patch requests.
  2038. ForceSendFields []string `json:"-"`
  2039. // NullFields is a list of field names (e.g. "Uri") to include in API
  2040. // requests with the JSON null value. By default, fields with empty
  2041. // values are omitted from API requests. However, any field with an
  2042. // empty value appearing in NullFields will be sent to the server as
  2043. // null. It is an error if a field in this list has a non-empty value.
  2044. // This may be used to include null fields in Patch requests.
  2045. NullFields []string `json:"-"`
  2046. }
  2047. func (s *GoogleCloudVisionV1p1beta1GcsDestination) MarshalJSON() ([]byte, error) {
  2048. type NoMethod GoogleCloudVisionV1p1beta1GcsDestination
  2049. raw := NoMethod(*s)
  2050. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2051. }
  2052. // GoogleCloudVisionV1p1beta1GcsSource: The Google Cloud Storage
  2053. // location where the input will be read from.
  2054. type GoogleCloudVisionV1p1beta1GcsSource struct {
  2055. // Uri: Google Cloud Storage URI for the input file. This must only be
  2056. // a
  2057. // Google Cloud Storage object. Wildcards are not currently supported.
  2058. Uri string `json:"uri,omitempty"`
  2059. // ForceSendFields is a list of field names (e.g. "Uri") to
  2060. // unconditionally include in API requests. By default, fields with
  2061. // empty values are omitted from API requests. However, any non-pointer,
  2062. // non-interface field appearing in ForceSendFields will be sent to the
  2063. // server regardless of whether the field is empty or not. This may be
  2064. // used to include empty fields in Patch requests.
  2065. ForceSendFields []string `json:"-"`
  2066. // NullFields is a list of field names (e.g. "Uri") to include in API
  2067. // requests with the JSON null value. By default, fields with empty
  2068. // values are omitted from API requests. However, any field with an
  2069. // empty value appearing in NullFields will be sent to the server as
  2070. // null. It is an error if a field in this list has a non-empty value.
  2071. // This may be used to include null fields in Patch requests.
  2072. NullFields []string `json:"-"`
  2073. }
  2074. func (s *GoogleCloudVisionV1p1beta1GcsSource) MarshalJSON() ([]byte, error) {
  2075. type NoMethod GoogleCloudVisionV1p1beta1GcsSource
  2076. raw := NoMethod(*s)
  2077. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2078. }
  2079. // GoogleCloudVisionV1p1beta1Image: Client image to perform Google Cloud
  2080. // Vision API tasks over.
  2081. type GoogleCloudVisionV1p1beta1Image struct {
  2082. // Content: Image content, represented as a stream of bytes.
  2083. // Note: As with all `bytes` fields, protobuffers use a pure
  2084. // binary
  2085. // representation, whereas JSON representations use base64.
  2086. Content string `json:"content,omitempty"`
  2087. // Source: Google Cloud Storage image location, or publicly-accessible
  2088. // image
  2089. // URL. If both `content` and `source` are provided for an image,
  2090. // `content`
  2091. // takes precedence and is used to perform the image annotation request.
  2092. Source *GoogleCloudVisionV1p1beta1ImageSource `json:"source,omitempty"`
  2093. // ForceSendFields is a list of field names (e.g. "Content") to
  2094. // unconditionally include in API requests. By default, fields with
  2095. // empty values are omitted from API requests. However, any non-pointer,
  2096. // non-interface field appearing in ForceSendFields will be sent to the
  2097. // server regardless of whether the field is empty or not. This may be
  2098. // used to include empty fields in Patch requests.
  2099. ForceSendFields []string `json:"-"`
  2100. // NullFields is a list of field names (e.g. "Content") to include in
  2101. // API requests with the JSON null value. By default, fields with empty
  2102. // values are omitted from API requests. However, any field with an
  2103. // empty value appearing in NullFields will be sent to the server as
  2104. // null. It is an error if a field in this list has a non-empty value.
  2105. // This may be used to include null fields in Patch requests.
  2106. NullFields []string `json:"-"`
  2107. }
  2108. func (s *GoogleCloudVisionV1p1beta1Image) MarshalJSON() ([]byte, error) {
  2109. type NoMethod GoogleCloudVisionV1p1beta1Image
  2110. raw := NoMethod(*s)
  2111. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2112. }
  2113. // GoogleCloudVisionV1p1beta1ImageAnnotationContext: If an image was
  2114. // produced from a file (e.g. a PDF), this message gives
  2115. // information about the source of that image.
  2116. type GoogleCloudVisionV1p1beta1ImageAnnotationContext struct {
  2117. // PageNumber: If the file was a PDF or TIFF, this field gives the page
  2118. // number within
  2119. // the file used to produce the image.
  2120. PageNumber int64 `json:"pageNumber,omitempty"`
  2121. // Uri: The URI of the file used to produce the image.
  2122. Uri string `json:"uri,omitempty"`
  2123. // ForceSendFields is a list of field names (e.g. "PageNumber") to
  2124. // unconditionally include in API requests. By default, fields with
  2125. // empty values are omitted from API requests. However, any non-pointer,
  2126. // non-interface field appearing in ForceSendFields will be sent to the
  2127. // server regardless of whether the field is empty or not. This may be
  2128. // used to include empty fields in Patch requests.
  2129. ForceSendFields []string `json:"-"`
  2130. // NullFields is a list of field names (e.g. "PageNumber") to include in
  2131. // API requests with the JSON null value. By default, fields with empty
  2132. // values are omitted from API requests. However, any field with an
  2133. // empty value appearing in NullFields will be sent to the server as
  2134. // null. It is an error if a field in this list has a non-empty value.
  2135. // This may be used to include null fields in Patch requests.
  2136. NullFields []string `json:"-"`
  2137. }
  2138. func (s *GoogleCloudVisionV1p1beta1ImageAnnotationContext) MarshalJSON() ([]byte, error) {
  2139. type NoMethod GoogleCloudVisionV1p1beta1ImageAnnotationContext
  2140. raw := NoMethod(*s)
  2141. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2142. }
  2143. // GoogleCloudVisionV1p1beta1ImageContext: Image context and/or
  2144. // feature-specific parameters.
  2145. type GoogleCloudVisionV1p1beta1ImageContext struct {
  2146. // CropHintsParams: Parameters for crop hints annotation request.
  2147. CropHintsParams *GoogleCloudVisionV1p1beta1CropHintsParams `json:"cropHintsParams,omitempty"`
  2148. // LanguageHints: List of languages to use for TEXT_DETECTION. In most
  2149. // cases, an empty value
  2150. // yields the best results since it enables automatic language
  2151. // detection. For
  2152. // languages based on the Latin alphabet, setting `language_hints` is
  2153. // not
  2154. // needed. In rare cases, when the language of the text in the image is
  2155. // known,
  2156. // setting a hint will help get better results (although it will be
  2157. // a
  2158. // significant hindrance if the hint is wrong). Text detection returns
  2159. // an
  2160. // error if one or more of the specified languages is not one of
  2161. // the
  2162. // [supported languages](/vision/docs/languages).
  2163. LanguageHints []string `json:"languageHints,omitempty"`
  2164. // LatLongRect: Not used.
  2165. LatLongRect *GoogleCloudVisionV1p1beta1LatLongRect `json:"latLongRect,omitempty"`
  2166. // WebDetectionParams: Parameters for web detection.
  2167. WebDetectionParams *GoogleCloudVisionV1p1beta1WebDetectionParams `json:"webDetectionParams,omitempty"`
  2168. // ForceSendFields is a list of field names (e.g. "CropHintsParams") to
  2169. // unconditionally include in API requests. By default, fields with
  2170. // empty values are omitted from API requests. However, any non-pointer,
  2171. // non-interface field appearing in ForceSendFields will be sent to the
  2172. // server regardless of whether the field is empty or not. This may be
  2173. // used to include empty fields in Patch requests.
  2174. ForceSendFields []string `json:"-"`
  2175. // NullFields is a list of field names (e.g. "CropHintsParams") to
  2176. // include in API requests with the JSON null value. By default, fields
  2177. // with empty values are omitted from API requests. However, any field
  2178. // with an empty value appearing in NullFields will be sent to the
  2179. // server as null. It is an error if a field in this list has a
  2180. // non-empty value. This may be used to include null fields in Patch
  2181. // requests.
  2182. NullFields []string `json:"-"`
  2183. }
  2184. func (s *GoogleCloudVisionV1p1beta1ImageContext) MarshalJSON() ([]byte, error) {
  2185. type NoMethod GoogleCloudVisionV1p1beta1ImageContext
  2186. raw := NoMethod(*s)
  2187. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2188. }
  2189. // GoogleCloudVisionV1p1beta1ImageProperties: Stores image properties,
  2190. // such as dominant colors.
  2191. type GoogleCloudVisionV1p1beta1ImageProperties struct {
  2192. // DominantColors: If present, dominant colors completed successfully.
  2193. DominantColors *GoogleCloudVisionV1p1beta1DominantColorsAnnotation `json:"dominantColors,omitempty"`
  2194. // ForceSendFields is a list of field names (e.g. "DominantColors") to
  2195. // unconditionally include in API requests. By default, fields with
  2196. // empty values are omitted from API requests. However, any non-pointer,
  2197. // non-interface field appearing in ForceSendFields will be sent to the
  2198. // server regardless of whether the field is empty or not. This may be
  2199. // used to include empty fields in Patch requests.
  2200. ForceSendFields []string `json:"-"`
  2201. // NullFields is a list of field names (e.g. "DominantColors") to
  2202. // include in API requests with the JSON null value. By default, fields
  2203. // with empty values are omitted from API requests. However, any field
  2204. // with an empty value appearing in NullFields will be sent to the
  2205. // server as null. It is an error if a field in this list has a
  2206. // non-empty value. This may be used to include null fields in Patch
  2207. // requests.
  2208. NullFields []string `json:"-"`
  2209. }
  2210. func (s *GoogleCloudVisionV1p1beta1ImageProperties) MarshalJSON() ([]byte, error) {
  2211. type NoMethod GoogleCloudVisionV1p1beta1ImageProperties
  2212. raw := NoMethod(*s)
  2213. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2214. }
  2215. // GoogleCloudVisionV1p1beta1ImageSource: External image source (Google
  2216. // Cloud Storage or web URL image location).
  2217. type GoogleCloudVisionV1p1beta1ImageSource struct {
  2218. // GcsImageUri: **Use `image_uri` instead.**
  2219. //
  2220. // The Google Cloud Storage URI of the
  2221. // form
  2222. // `gs://bucket_name/object_name`. Object versioning is not supported.
  2223. // See
  2224. // [Google Cloud Storage
  2225. // Request
  2226. // URIs](https://cloud.google.com/storage/docs/reference-uris) for more
  2227. // info.
  2228. GcsImageUri string `json:"gcsImageUri,omitempty"`
  2229. // ImageUri: The URI of the source image. Can be either:
  2230. //
  2231. // 1. A Google Cloud Storage URI of the form
  2232. // `gs://bucket_name/object_name`. Object versioning is not
  2233. // supported. See
  2234. // [Google Cloud Storage Request
  2235. // URIs](https://cloud.google.com/storage/docs/reference-uris) for
  2236. // more
  2237. // info.
  2238. //
  2239. // 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images
  2240. // from
  2241. // HTTP/HTTPS URLs, Google cannot guarantee that the request will be
  2242. // completed. Your request may fail if the specified host denies the
  2243. // request (e.g. due to request throttling or DOS prevention), or if
  2244. // Google
  2245. // throttles requests to the site for abuse prevention. You should
  2246. // not
  2247. // depend on externally-hosted images for production
  2248. // applications.
  2249. //
  2250. // When both `gcs_image_uri` and `image_uri` are specified, `image_uri`
  2251. // takes
  2252. // precedence.
  2253. ImageUri string `json:"imageUri,omitempty"`
  2254. // ForceSendFields is a list of field names (e.g. "GcsImageUri") to
  2255. // unconditionally include in API requests. By default, fields with
  2256. // empty values are omitted from API requests. However, any non-pointer,
  2257. // non-interface field appearing in ForceSendFields will be sent to the
  2258. // server regardless of whether the field is empty or not. This may be
  2259. // used to include empty fields in Patch requests.
  2260. ForceSendFields []string `json:"-"`
  2261. // NullFields is a list of field names (e.g. "GcsImageUri") to include
  2262. // in API requests with the JSON null value. By default, fields with
  2263. // empty values are omitted from API requests. However, any field with
  2264. // an empty value appearing in NullFields will be sent to the server as
  2265. // null. It is an error if a field in this list has a non-empty value.
  2266. // This may be used to include null fields in Patch requests.
  2267. NullFields []string `json:"-"`
  2268. }
  2269. func (s *GoogleCloudVisionV1p1beta1ImageSource) MarshalJSON() ([]byte, error) {
  2270. type NoMethod GoogleCloudVisionV1p1beta1ImageSource
  2271. raw := NoMethod(*s)
  2272. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2273. }
  2274. // GoogleCloudVisionV1p1beta1InputConfig: The desired input location and
  2275. // metadata.
  2276. type GoogleCloudVisionV1p1beta1InputConfig struct {
  2277. // GcsSource: The Google Cloud Storage location to read the input from.
  2278. GcsSource *GoogleCloudVisionV1p1beta1GcsSource `json:"gcsSource,omitempty"`
  2279. // MimeType: The type of the file. Currently only "application/pdf" and
  2280. // "image/tiff"
  2281. // are supported. Wildcards are not supported.
  2282. MimeType string `json:"mimeType,omitempty"`
  2283. // ForceSendFields is a list of field names (e.g. "GcsSource") to
  2284. // unconditionally include in API requests. By default, fields with
  2285. // empty values are omitted from API requests. However, any non-pointer,
  2286. // non-interface field appearing in ForceSendFields will be sent to the
  2287. // server regardless of whether the field is empty or not. This may be
  2288. // used to include empty fields in Patch requests.
  2289. ForceSendFields []string `json:"-"`
  2290. // NullFields is a list of field names (e.g. "GcsSource") to include in
  2291. // API requests with the JSON null value. By default, fields with empty
  2292. // values are omitted from API requests. However, any field with an
  2293. // empty value appearing in NullFields will be sent to the server as
  2294. // null. It is an error if a field in this list has a non-empty value.
  2295. // This may be used to include null fields in Patch requests.
  2296. NullFields []string `json:"-"`
  2297. }
  2298. func (s *GoogleCloudVisionV1p1beta1InputConfig) MarshalJSON() ([]byte, error) {
  2299. type NoMethod GoogleCloudVisionV1p1beta1InputConfig
  2300. raw := NoMethod(*s)
  2301. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2302. }
  2303. // GoogleCloudVisionV1p1beta1LatLongRect: Rectangle determined by min
  2304. // and max `LatLng` pairs.
  2305. type GoogleCloudVisionV1p1beta1LatLongRect struct {
  2306. // MaxLatLng: Max lat/long pair.
  2307. MaxLatLng *LatLng `json:"maxLatLng,omitempty"`
  2308. // MinLatLng: Min lat/long pair.
  2309. MinLatLng *LatLng `json:"minLatLng,omitempty"`
  2310. // ForceSendFields is a list of field names (e.g. "MaxLatLng") to
  2311. // unconditionally include in API requests. By default, fields with
  2312. // empty values are omitted from API requests. However, any non-pointer,
  2313. // non-interface field appearing in ForceSendFields will be sent to the
  2314. // server regardless of whether the field is empty or not. This may be
  2315. // used to include empty fields in Patch requests.
  2316. ForceSendFields []string `json:"-"`
  2317. // NullFields is a list of field names (e.g. "MaxLatLng") to include in
  2318. // API requests with the JSON null value. By default, fields with empty
  2319. // values are omitted from API requests. However, any field with an
  2320. // empty value appearing in NullFields will be sent to the server as
  2321. // null. It is an error if a field in this list has a non-empty value.
  2322. // This may be used to include null fields in Patch requests.
  2323. NullFields []string `json:"-"`
  2324. }
  2325. func (s *GoogleCloudVisionV1p1beta1LatLongRect) MarshalJSON() ([]byte, error) {
  2326. type NoMethod GoogleCloudVisionV1p1beta1LatLongRect
  2327. raw := NoMethod(*s)
  2328. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2329. }
  2330. // GoogleCloudVisionV1p1beta1LocationInfo: Detected entity location
  2331. // information.
  2332. type GoogleCloudVisionV1p1beta1LocationInfo struct {
  2333. // LatLng: lat/long location coordinates.
  2334. LatLng *LatLng `json:"latLng,omitempty"`
  2335. // ForceSendFields is a list of field names (e.g. "LatLng") to
  2336. // unconditionally include in API requests. By default, fields with
  2337. // empty values are omitted from API requests. However, any non-pointer,
  2338. // non-interface field appearing in ForceSendFields will be sent to the
  2339. // server regardless of whether the field is empty or not. This may be
  2340. // used to include empty fields in Patch requests.
  2341. ForceSendFields []string `json:"-"`
  2342. // NullFields is a list of field names (e.g. "LatLng") to include in API
  2343. // requests with the JSON null value. By default, fields with empty
  2344. // values are omitted from API requests. However, any field with an
  2345. // empty value appearing in NullFields will be sent to the server as
  2346. // null. It is an error if a field in this list has a non-empty value.
  2347. // This may be used to include null fields in Patch requests.
  2348. NullFields []string `json:"-"`
  2349. }
  2350. func (s *GoogleCloudVisionV1p1beta1LocationInfo) MarshalJSON() ([]byte, error) {
  2351. type NoMethod GoogleCloudVisionV1p1beta1LocationInfo
  2352. raw := NoMethod(*s)
  2353. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2354. }
  2355. // GoogleCloudVisionV1p1beta1OutputConfig: The desired output location
  2356. // and metadata.
  2357. type GoogleCloudVisionV1p1beta1OutputConfig struct {
  2358. // BatchSize: The max number of response protos to put into each output
  2359. // JSON file on
  2360. // Google Cloud Storage.
  2361. // The valid range is [1, 100]. If not specified, the default value is
  2362. // 20.
  2363. //
  2364. // For example, for one pdf file with 100 pages, 100 response protos
  2365. // will
  2366. // be generated. If `batch_size` = 20, then 5 json files each
  2367. // containing 20 response protos will be written under the
  2368. // prefix
  2369. // `gcs_destination`.`uri`.
  2370. //
  2371. // Currently, batch_size only applies to GcsDestination, with potential
  2372. // future
  2373. // support for other output configurations.
  2374. BatchSize int64 `json:"batchSize,omitempty"`
  2375. // GcsDestination: The Google Cloud Storage location to write the
  2376. // output(s) to.
  2377. GcsDestination *GoogleCloudVisionV1p1beta1GcsDestination `json:"gcsDestination,omitempty"`
  2378. // ForceSendFields is a list of field names (e.g. "BatchSize") to
  2379. // unconditionally include in API requests. By default, fields with
  2380. // empty values are omitted from API requests. However, any non-pointer,
  2381. // non-interface field appearing in ForceSendFields will be sent to the
  2382. // server regardless of whether the field is empty or not. This may be
  2383. // used to include empty fields in Patch requests.
  2384. ForceSendFields []string `json:"-"`
  2385. // NullFields is a list of field names (e.g. "BatchSize") to include in
  2386. // API requests with the JSON null value. By default, fields with empty
  2387. // values are omitted from API requests. However, any field with an
  2388. // empty value appearing in NullFields will be sent to the server as
  2389. // null. It is an error if a field in this list has a non-empty value.
  2390. // This may be used to include null fields in Patch requests.
  2391. NullFields []string `json:"-"`
  2392. }
  2393. func (s *GoogleCloudVisionV1p1beta1OutputConfig) MarshalJSON() ([]byte, error) {
  2394. type NoMethod GoogleCloudVisionV1p1beta1OutputConfig
  2395. raw := NoMethod(*s)
  2396. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2397. }
  2398. // GoogleCloudVisionV1p1beta1Page: Detected page from OCR.
  2399. type GoogleCloudVisionV1p1beta1Page struct {
  2400. // Blocks: List of blocks of text, images etc on this page.
  2401. Blocks []*GoogleCloudVisionV1p1beta1Block `json:"blocks,omitempty"`
  2402. // Confidence: Confidence of the OCR results on the page. Range [0, 1].
  2403. Confidence float64 `json:"confidence,omitempty"`
  2404. // Height: Page height. For PDFs the unit is points. For images
  2405. // (including
  2406. // TIFFs) the unit is pixels.
  2407. Height int64 `json:"height,omitempty"`
  2408. // Property: Additional information detected on the page.
  2409. Property *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty `json:"property,omitempty"`
  2410. // Width: Page width. For PDFs the unit is points. For images
  2411. // (including
  2412. // TIFFs) the unit is pixels.
  2413. Width int64 `json:"width,omitempty"`
  2414. // ForceSendFields is a list of field names (e.g. "Blocks") to
  2415. // unconditionally include in API requests. By default, fields with
  2416. // empty values are omitted from API requests. However, any non-pointer,
  2417. // non-interface field appearing in ForceSendFields will be sent to the
  2418. // server regardless of whether the field is empty or not. This may be
  2419. // used to include empty fields in Patch requests.
  2420. ForceSendFields []string `json:"-"`
  2421. // NullFields is a list of field names (e.g. "Blocks") to include in API
  2422. // requests with the JSON null value. By default, fields with empty
  2423. // values are omitted from API requests. However, any field with an
  2424. // empty value appearing in NullFields will be sent to the server as
  2425. // null. It is an error if a field in this list has a non-empty value.
  2426. // This may be used to include null fields in Patch requests.
  2427. NullFields []string `json:"-"`
  2428. }
  2429. func (s *GoogleCloudVisionV1p1beta1Page) MarshalJSON() ([]byte, error) {
  2430. type NoMethod GoogleCloudVisionV1p1beta1Page
  2431. raw := NoMethod(*s)
  2432. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2433. }
  2434. func (s *GoogleCloudVisionV1p1beta1Page) UnmarshalJSON(data []byte) error {
  2435. type NoMethod GoogleCloudVisionV1p1beta1Page
  2436. var s1 struct {
  2437. Confidence gensupport.JSONFloat64 `json:"confidence"`
  2438. *NoMethod
  2439. }
  2440. s1.NoMethod = (*NoMethod)(s)
  2441. if err := json.Unmarshal(data, &s1); err != nil {
  2442. return err
  2443. }
  2444. s.Confidence = float64(s1.Confidence)
  2445. return nil
  2446. }
  2447. // GoogleCloudVisionV1p1beta1Paragraph: Structural unit of text
  2448. // representing a number of words in certain order.
  2449. type GoogleCloudVisionV1p1beta1Paragraph struct {
  2450. // BoundingBox: The bounding box for the paragraph.
  2451. // The vertices are in the order of top-left, top-right,
  2452. // bottom-right,
  2453. // bottom-left. When a rotation of the bounding box is detected the
  2454. // rotation
  2455. // is represented as around the top-left corner as defined when the text
  2456. // is
  2457. // read in the 'natural' orientation.
  2458. // For example:
  2459. // * when the text is horizontal it might look like:
  2460. // 0----1
  2461. // | |
  2462. // 3----2
  2463. // * when it's rotated 180 degrees around the top-left corner it
  2464. // becomes:
  2465. // 2----3
  2466. // | |
  2467. // 1----0
  2468. // and the vertice order will still be (0, 1, 2, 3).
  2469. BoundingBox *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingBox,omitempty"`
  2470. // Confidence: Confidence of the OCR results for the paragraph. Range
  2471. // [0, 1].
  2472. Confidence float64 `json:"confidence,omitempty"`
  2473. // Property: Additional information detected for the paragraph.
  2474. Property *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty `json:"property,omitempty"`
  2475. // Words: List of words in this paragraph.
  2476. Words []*GoogleCloudVisionV1p1beta1Word `json:"words,omitempty"`
  2477. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  2478. // unconditionally include in API requests. By default, fields with
  2479. // empty values are omitted from API requests. However, any non-pointer,
  2480. // non-interface field appearing in ForceSendFields will be sent to the
  2481. // server regardless of whether the field is empty or not. This may be
  2482. // used to include empty fields in Patch requests.
  2483. ForceSendFields []string `json:"-"`
  2484. // NullFields is a list of field names (e.g. "BoundingBox") to include
  2485. // in API requests with the JSON null value. By default, fields with
  2486. // empty values are omitted from API requests. However, any field with
  2487. // an empty value appearing in NullFields will be sent to the server as
  2488. // null. It is an error if a field in this list has a non-empty value.
  2489. // This may be used to include null fields in Patch requests.
  2490. NullFields []string `json:"-"`
  2491. }
  2492. func (s *GoogleCloudVisionV1p1beta1Paragraph) MarshalJSON() ([]byte, error) {
  2493. type NoMethod GoogleCloudVisionV1p1beta1Paragraph
  2494. raw := NoMethod(*s)
  2495. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2496. }
  2497. func (s *GoogleCloudVisionV1p1beta1Paragraph) UnmarshalJSON(data []byte) error {
  2498. type NoMethod GoogleCloudVisionV1p1beta1Paragraph
  2499. var s1 struct {
  2500. Confidence gensupport.JSONFloat64 `json:"confidence"`
  2501. *NoMethod
  2502. }
  2503. s1.NoMethod = (*NoMethod)(s)
  2504. if err := json.Unmarshal(data, &s1); err != nil {
  2505. return err
  2506. }
  2507. s.Confidence = float64(s1.Confidence)
  2508. return nil
  2509. }
  2510. // GoogleCloudVisionV1p1beta1Position: A 3D position in the image, used
  2511. // primarily for Face detection landmarks.
  2512. // A valid Position must have both x and y coordinates.
  2513. // The position coordinates are in the same scale as the original image.
  2514. type GoogleCloudVisionV1p1beta1Position struct {
  2515. // X: X coordinate.
  2516. X float64 `json:"x,omitempty"`
  2517. // Y: Y coordinate.
  2518. Y float64 `json:"y,omitempty"`
  2519. // Z: Z coordinate (or depth).
  2520. Z float64 `json:"z,omitempty"`
  2521. // ForceSendFields is a list of field names (e.g. "X") to
  2522. // unconditionally include in API requests. By default, fields with
  2523. // empty values are omitted from API requests. However, any non-pointer,
  2524. // non-interface field appearing in ForceSendFields will be sent to the
  2525. // server regardless of whether the field is empty or not. This may be
  2526. // used to include empty fields in Patch requests.
  2527. ForceSendFields []string `json:"-"`
  2528. // NullFields is a list of field names (e.g. "X") to include in API
  2529. // requests with the JSON null value. By default, fields with empty
  2530. // values are omitted from API requests. However, any field with an
  2531. // empty value appearing in NullFields will be sent to the server as
  2532. // null. It is an error if a field in this list has a non-empty value.
  2533. // This may be used to include null fields in Patch requests.
  2534. NullFields []string `json:"-"`
  2535. }
  2536. func (s *GoogleCloudVisionV1p1beta1Position) MarshalJSON() ([]byte, error) {
  2537. type NoMethod GoogleCloudVisionV1p1beta1Position
  2538. raw := NoMethod(*s)
  2539. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2540. }
  2541. func (s *GoogleCloudVisionV1p1beta1Position) UnmarshalJSON(data []byte) error {
  2542. type NoMethod GoogleCloudVisionV1p1beta1Position
  2543. var s1 struct {
  2544. X gensupport.JSONFloat64 `json:"x"`
  2545. Y gensupport.JSONFloat64 `json:"y"`
  2546. Z gensupport.JSONFloat64 `json:"z"`
  2547. *NoMethod
  2548. }
  2549. s1.NoMethod = (*NoMethod)(s)
  2550. if err := json.Unmarshal(data, &s1); err != nil {
  2551. return err
  2552. }
  2553. s.X = float64(s1.X)
  2554. s.Y = float64(s1.Y)
  2555. s.Z = float64(s1.Z)
  2556. return nil
  2557. }
  2558. // GoogleCloudVisionV1p1beta1Property: A `Property` consists of a
  2559. // user-supplied name/value pair.
  2560. type GoogleCloudVisionV1p1beta1Property struct {
  2561. // Name: Name of the property.
  2562. Name string `json:"name,omitempty"`
  2563. // Uint64Value: Value of numeric properties.
  2564. Uint64Value uint64 `json:"uint64Value,omitempty,string"`
  2565. // Value: Value of the property.
  2566. Value string `json:"value,omitempty"`
  2567. // ForceSendFields is a list of field names (e.g. "Name") to
  2568. // unconditionally include in API requests. By default, fields with
  2569. // empty values are omitted from API requests. However, any non-pointer,
  2570. // non-interface field appearing in ForceSendFields will be sent to the
  2571. // server regardless of whether the field is empty or not. This may be
  2572. // used to include empty fields in Patch requests.
  2573. ForceSendFields []string `json:"-"`
  2574. // NullFields is a list of field names (e.g. "Name") to include in API
  2575. // requests with the JSON null value. By default, fields with empty
  2576. // values are omitted from API requests. However, any field with an
  2577. // empty value appearing in NullFields will be sent to the server as
  2578. // null. It is an error if a field in this list has a non-empty value.
  2579. // This may be used to include null fields in Patch requests.
  2580. NullFields []string `json:"-"`
  2581. }
  2582. func (s *GoogleCloudVisionV1p1beta1Property) MarshalJSON() ([]byte, error) {
  2583. type NoMethod GoogleCloudVisionV1p1beta1Property
  2584. raw := NoMethod(*s)
  2585. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2586. }
  2587. // GoogleCloudVisionV1p1beta1SafeSearchAnnotation: Set of features
  2588. // pertaining to the image, computed by computer vision
  2589. // methods over safe-search verticals (for example, adult, spoof,
  2590. // medical,
  2591. // violence).
  2592. type GoogleCloudVisionV1p1beta1SafeSearchAnnotation struct {
  2593. // Adult: Represents the adult content likelihood for the image. Adult
  2594. // content may
  2595. // contain elements such as nudity, pornographic images or cartoons,
  2596. // or
  2597. // sexual activities.
  2598. //
  2599. // Possible values:
  2600. // "UNKNOWN" - Unknown likelihood.
  2601. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  2602. // specified vertical.
  2603. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  2604. // vertical.
  2605. // "POSSIBLE" - It is possible that the image belongs to the specified
  2606. // vertical.
  2607. // "LIKELY" - It is likely that the image belongs to the specified
  2608. // vertical.
  2609. // "VERY_LIKELY" - It is very likely that the image belongs to the
  2610. // specified vertical.
  2611. Adult string `json:"adult,omitempty"`
  2612. // Medical: Likelihood that this is a medical image.
  2613. //
  2614. // Possible values:
  2615. // "UNKNOWN" - Unknown likelihood.
  2616. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  2617. // specified vertical.
  2618. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  2619. // vertical.
  2620. // "POSSIBLE" - It is possible that the image belongs to the specified
  2621. // vertical.
  2622. // "LIKELY" - It is likely that the image belongs to the specified
  2623. // vertical.
  2624. // "VERY_LIKELY" - It is very likely that the image belongs to the
  2625. // specified vertical.
  2626. Medical string `json:"medical,omitempty"`
  2627. // Racy: Likelihood that the request image contains racy content. Racy
  2628. // content may
  2629. // include (but is not limited to) skimpy or sheer clothing,
  2630. // strategically
  2631. // covered nudity, lewd or provocative poses, or close-ups of
  2632. // sensitive
  2633. // body areas.
  2634. //
  2635. // Possible values:
  2636. // "UNKNOWN" - Unknown likelihood.
  2637. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  2638. // specified vertical.
  2639. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  2640. // vertical.
  2641. // "POSSIBLE" - It is possible that the image belongs to the specified
  2642. // vertical.
  2643. // "LIKELY" - It is likely that the image belongs to the specified
  2644. // vertical.
  2645. // "VERY_LIKELY" - It is very likely that the image belongs to the
  2646. // specified vertical.
  2647. Racy string `json:"racy,omitempty"`
  2648. // Spoof: Spoof likelihood. The likelihood that an modification
  2649. // was made to the image's canonical version to make it appear
  2650. // funny or offensive.
  2651. //
  2652. // Possible values:
  2653. // "UNKNOWN" - Unknown likelihood.
  2654. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  2655. // specified vertical.
  2656. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  2657. // vertical.
  2658. // "POSSIBLE" - It is possible that the image belongs to the specified
  2659. // vertical.
  2660. // "LIKELY" - It is likely that the image belongs to the specified
  2661. // vertical.
  2662. // "VERY_LIKELY" - It is very likely that the image belongs to the
  2663. // specified vertical.
  2664. Spoof string `json:"spoof,omitempty"`
  2665. // Violence: Likelihood that this image contains violent content.
  2666. //
  2667. // Possible values:
  2668. // "UNKNOWN" - Unknown likelihood.
  2669. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  2670. // specified vertical.
  2671. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  2672. // vertical.
  2673. // "POSSIBLE" - It is possible that the image belongs to the specified
  2674. // vertical.
  2675. // "LIKELY" - It is likely that the image belongs to the specified
  2676. // vertical.
  2677. // "VERY_LIKELY" - It is very likely that the image belongs to the
  2678. // specified vertical.
  2679. Violence string `json:"violence,omitempty"`
  2680. // ForceSendFields is a list of field names (e.g. "Adult") to
  2681. // unconditionally include in API requests. By default, fields with
  2682. // empty values are omitted from API requests. However, any non-pointer,
  2683. // non-interface field appearing in ForceSendFields will be sent to the
  2684. // server regardless of whether the field is empty or not. This may be
  2685. // used to include empty fields in Patch requests.
  2686. ForceSendFields []string `json:"-"`
  2687. // NullFields is a list of field names (e.g. "Adult") to include in API
  2688. // requests with the JSON null value. By default, fields with empty
  2689. // values are omitted from API requests. However, any field with an
  2690. // empty value appearing in NullFields will be sent to the server as
  2691. // null. It is an error if a field in this list has a non-empty value.
  2692. // This may be used to include null fields in Patch requests.
  2693. NullFields []string `json:"-"`
  2694. }
  2695. func (s *GoogleCloudVisionV1p1beta1SafeSearchAnnotation) MarshalJSON() ([]byte, error) {
  2696. type NoMethod GoogleCloudVisionV1p1beta1SafeSearchAnnotation
  2697. raw := NoMethod(*s)
  2698. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2699. }
  2700. // GoogleCloudVisionV1p1beta1Symbol: A single symbol representation.
  2701. type GoogleCloudVisionV1p1beta1Symbol struct {
  2702. // BoundingBox: The bounding box for the symbol.
  2703. // The vertices are in the order of top-left, top-right,
  2704. // bottom-right,
  2705. // bottom-left. When a rotation of the bounding box is detected the
  2706. // rotation
  2707. // is represented as around the top-left corner as defined when the text
  2708. // is
  2709. // read in the 'natural' orientation.
  2710. // For example:
  2711. // * when the text is horizontal it might look like:
  2712. // 0----1
  2713. // | |
  2714. // 3----2
  2715. // * when it's rotated 180 degrees around the top-left corner it
  2716. // becomes:
  2717. // 2----3
  2718. // | |
  2719. // 1----0
  2720. // and the vertice order will still be (0, 1, 2, 3).
  2721. BoundingBox *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingBox,omitempty"`
  2722. // Confidence: Confidence of the OCR results for the symbol. Range [0,
  2723. // 1].
  2724. Confidence float64 `json:"confidence,omitempty"`
  2725. // Property: Additional information detected for the symbol.
  2726. Property *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty `json:"property,omitempty"`
  2727. // Text: The actual UTF-8 representation of the symbol.
  2728. Text string `json:"text,omitempty"`
  2729. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  2730. // unconditionally include in API requests. By default, fields with
  2731. // empty values are omitted from API requests. However, any non-pointer,
  2732. // non-interface field appearing in ForceSendFields will be sent to the
  2733. // server regardless of whether the field is empty or not. This may be
  2734. // used to include empty fields in Patch requests.
  2735. ForceSendFields []string `json:"-"`
  2736. // NullFields is a list of field names (e.g. "BoundingBox") to include
  2737. // in API requests with the JSON null value. By default, fields with
  2738. // empty values are omitted from API requests. However, any field with
  2739. // an empty value appearing in NullFields will be sent to the server as
  2740. // null. It is an error if a field in this list has a non-empty value.
  2741. // This may be used to include null fields in Patch requests.
  2742. NullFields []string `json:"-"`
  2743. }
  2744. func (s *GoogleCloudVisionV1p1beta1Symbol) MarshalJSON() ([]byte, error) {
  2745. type NoMethod GoogleCloudVisionV1p1beta1Symbol
  2746. raw := NoMethod(*s)
  2747. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2748. }
  2749. func (s *GoogleCloudVisionV1p1beta1Symbol) UnmarshalJSON(data []byte) error {
  2750. type NoMethod GoogleCloudVisionV1p1beta1Symbol
  2751. var s1 struct {
  2752. Confidence gensupport.JSONFloat64 `json:"confidence"`
  2753. *NoMethod
  2754. }
  2755. s1.NoMethod = (*NoMethod)(s)
  2756. if err := json.Unmarshal(data, &s1); err != nil {
  2757. return err
  2758. }
  2759. s.Confidence = float64(s1.Confidence)
  2760. return nil
  2761. }
  2762. // GoogleCloudVisionV1p1beta1TextAnnotation: TextAnnotation contains a
  2763. // structured representation of OCR extracted text.
  2764. // The hierarchy of an OCR extracted text structure is like this:
  2765. // TextAnnotation -> Page -> Block -> Paragraph -> Word ->
  2766. // Symbol
  2767. // Each structural component, starting from Page, may further have their
  2768. // own
  2769. // properties. Properties describe detected languages, breaks etc..
  2770. // Please refer
  2771. // to the TextAnnotation.TextProperty message definition below for
  2772. // more
  2773. // detail.
  2774. type GoogleCloudVisionV1p1beta1TextAnnotation struct {
  2775. // Pages: List of pages detected by OCR.
  2776. Pages []*GoogleCloudVisionV1p1beta1Page `json:"pages,omitempty"`
  2777. // Text: UTF-8 text detected on the pages.
  2778. Text string `json:"text,omitempty"`
  2779. // ForceSendFields is a list of field names (e.g. "Pages") to
  2780. // unconditionally include in API requests. By default, fields with
  2781. // empty values are omitted from API requests. However, any non-pointer,
  2782. // non-interface field appearing in ForceSendFields will be sent to the
  2783. // server regardless of whether the field is empty or not. This may be
  2784. // used to include empty fields in Patch requests.
  2785. ForceSendFields []string `json:"-"`
  2786. // NullFields is a list of field names (e.g. "Pages") to include in API
  2787. // requests with the JSON null value. By default, fields with empty
  2788. // values are omitted from API requests. However, any field with an
  2789. // empty value appearing in NullFields will be sent to the server as
  2790. // null. It is an error if a field in this list has a non-empty value.
  2791. // This may be used to include null fields in Patch requests.
  2792. NullFields []string `json:"-"`
  2793. }
  2794. func (s *GoogleCloudVisionV1p1beta1TextAnnotation) MarshalJSON() ([]byte, error) {
  2795. type NoMethod GoogleCloudVisionV1p1beta1TextAnnotation
  2796. raw := NoMethod(*s)
  2797. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2798. }
  2799. // GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak: Detected start
  2800. // or end of a structural component.
  2801. type GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak struct {
  2802. // IsPrefix: True if break prepends the element.
  2803. IsPrefix bool `json:"isPrefix,omitempty"`
  2804. // Type: Detected break type.
  2805. //
  2806. // Possible values:
  2807. // "UNKNOWN" - Unknown break label type.
  2808. // "SPACE" - Regular space.
  2809. // "SURE_SPACE" - Sure space (very wide).
  2810. // "EOL_SURE_SPACE" - Line-wrapping break.
  2811. // "HYPHEN" - End-line hyphen that is not present in text; does not
  2812. // co-occur with
  2813. // `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`.
  2814. // "LINE_BREAK" - Line break that ends a paragraph.
  2815. Type string `json:"type,omitempty"`
  2816. // ForceSendFields is a list of field names (e.g. "IsPrefix") to
  2817. // unconditionally include in API requests. By default, fields with
  2818. // empty values are omitted from API requests. However, any non-pointer,
  2819. // non-interface field appearing in ForceSendFields will be sent to the
  2820. // server regardless of whether the field is empty or not. This may be
  2821. // used to include empty fields in Patch requests.
  2822. ForceSendFields []string `json:"-"`
  2823. // NullFields is a list of field names (e.g. "IsPrefix") to include in
  2824. // API requests with the JSON null value. By default, fields with empty
  2825. // values are omitted from API requests. However, any field with an
  2826. // empty value appearing in NullFields will be sent to the server as
  2827. // null. It is an error if a field in this list has a non-empty value.
  2828. // This may be used to include null fields in Patch requests.
  2829. NullFields []string `json:"-"`
  2830. }
  2831. func (s *GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak) MarshalJSON() ([]byte, error) {
  2832. type NoMethod GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak
  2833. raw := NoMethod(*s)
  2834. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2835. }
  2836. // GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage: Detected
  2837. // language for a structural component.
  2838. type GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage struct {
  2839. // Confidence: Confidence of detected language. Range [0, 1].
  2840. Confidence float64 `json:"confidence,omitempty"`
  2841. // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn".
  2842. // For more
  2843. // information,
  2844. // see
  2845. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  2846. LanguageCode string `json:"languageCode,omitempty"`
  2847. // ForceSendFields is a list of field names (e.g. "Confidence") to
  2848. // unconditionally include in API requests. By default, fields with
  2849. // empty values are omitted from API requests. However, any non-pointer,
  2850. // non-interface field appearing in ForceSendFields will be sent to the
  2851. // server regardless of whether the field is empty or not. This may be
  2852. // used to include empty fields in Patch requests.
  2853. ForceSendFields []string `json:"-"`
  2854. // NullFields is a list of field names (e.g. "Confidence") to include in
  2855. // API requests with the JSON null value. By default, fields with empty
  2856. // values are omitted from API requests. However, any field with an
  2857. // empty value appearing in NullFields will be sent to the server as
  2858. // null. It is an error if a field in this list has a non-empty value.
  2859. // This may be used to include null fields in Patch requests.
  2860. NullFields []string `json:"-"`
  2861. }
  2862. func (s *GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage) MarshalJSON() ([]byte, error) {
  2863. type NoMethod GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage
  2864. raw := NoMethod(*s)
  2865. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2866. }
  2867. func (s *GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage) UnmarshalJSON(data []byte) error {
  2868. type NoMethod GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage
  2869. var s1 struct {
  2870. Confidence gensupport.JSONFloat64 `json:"confidence"`
  2871. *NoMethod
  2872. }
  2873. s1.NoMethod = (*NoMethod)(s)
  2874. if err := json.Unmarshal(data, &s1); err != nil {
  2875. return err
  2876. }
  2877. s.Confidence = float64(s1.Confidence)
  2878. return nil
  2879. }
  2880. // GoogleCloudVisionV1p1beta1TextAnnotationTextProperty: Additional
  2881. // information detected on the structural component.
  2882. type GoogleCloudVisionV1p1beta1TextAnnotationTextProperty struct {
  2883. // DetectedBreak: Detected start or end of a text segment.
  2884. DetectedBreak *GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak `json:"detectedBreak,omitempty"`
  2885. // DetectedLanguages: A list of detected languages together with
  2886. // confidence.
  2887. DetectedLanguages []*GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage `json:"detectedLanguages,omitempty"`
  2888. // ForceSendFields is a list of field names (e.g. "DetectedBreak") to
  2889. // unconditionally include in API requests. By default, fields with
  2890. // empty values are omitted from API requests. However, any non-pointer,
  2891. // non-interface field appearing in ForceSendFields will be sent to the
  2892. // server regardless of whether the field is empty or not. This may be
  2893. // used to include empty fields in Patch requests.
  2894. ForceSendFields []string `json:"-"`
  2895. // NullFields is a list of field names (e.g. "DetectedBreak") to include
  2896. // in API requests with the JSON null value. By default, fields with
  2897. // empty values are omitted from API requests. However, any field with
  2898. // an empty value appearing in NullFields will be sent to the server as
  2899. // null. It is an error if a field in this list has a non-empty value.
  2900. // This may be used to include null fields in Patch requests.
  2901. NullFields []string `json:"-"`
  2902. }
  2903. func (s *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty) MarshalJSON() ([]byte, error) {
  2904. type NoMethod GoogleCloudVisionV1p1beta1TextAnnotationTextProperty
  2905. raw := NoMethod(*s)
  2906. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2907. }
  2908. // GoogleCloudVisionV1p1beta1Vertex: A vertex represents a 2D point in
  2909. // the image.
  2910. // NOTE: the vertex coordinates are in the same scale as the original
  2911. // image.
  2912. type GoogleCloudVisionV1p1beta1Vertex struct {
  2913. // X: X coordinate.
  2914. X int64 `json:"x,omitempty"`
  2915. // Y: Y coordinate.
  2916. Y int64 `json:"y,omitempty"`
  2917. // ForceSendFields is a list of field names (e.g. "X") to
  2918. // unconditionally include in API requests. By default, fields with
  2919. // empty values are omitted from API requests. However, any non-pointer,
  2920. // non-interface field appearing in ForceSendFields will be sent to the
  2921. // server regardless of whether the field is empty or not. This may be
  2922. // used to include empty fields in Patch requests.
  2923. ForceSendFields []string `json:"-"`
  2924. // NullFields is a list of field names (e.g. "X") to include in API
  2925. // requests with the JSON null value. By default, fields with empty
  2926. // values are omitted from API requests. However, any field with an
  2927. // empty value appearing in NullFields will be sent to the server as
  2928. // null. It is an error if a field in this list has a non-empty value.
  2929. // This may be used to include null fields in Patch requests.
  2930. NullFields []string `json:"-"`
  2931. }
  2932. func (s *GoogleCloudVisionV1p1beta1Vertex) MarshalJSON() ([]byte, error) {
  2933. type NoMethod GoogleCloudVisionV1p1beta1Vertex
  2934. raw := NoMethod(*s)
  2935. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2936. }
  2937. // GoogleCloudVisionV1p1beta1WebDetection: Relevant information for the
  2938. // image from the Internet.
  2939. type GoogleCloudVisionV1p1beta1WebDetection struct {
  2940. // BestGuessLabels: The service's best guess as to the topic of the
  2941. // request image.
  2942. // Inferred from similar images on the open web.
  2943. BestGuessLabels []*GoogleCloudVisionV1p1beta1WebDetectionWebLabel `json:"bestGuessLabels,omitempty"`
  2944. // FullMatchingImages: Fully matching images from the Internet.
  2945. // Can include resized copies of the query image.
  2946. FullMatchingImages []*GoogleCloudVisionV1p1beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"`
  2947. // PagesWithMatchingImages: Web pages containing the matching images
  2948. // from the Internet.
  2949. PagesWithMatchingImages []*GoogleCloudVisionV1p1beta1WebDetectionWebPage `json:"pagesWithMatchingImages,omitempty"`
  2950. // PartialMatchingImages: Partial matching images from the
  2951. // Internet.
  2952. // Those images are similar enough to share some key-point features.
  2953. // For
  2954. // example an original image will likely have partial matching for its
  2955. // crops.
  2956. PartialMatchingImages []*GoogleCloudVisionV1p1beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"`
  2957. // VisuallySimilarImages: The visually similar image results.
  2958. VisuallySimilarImages []*GoogleCloudVisionV1p1beta1WebDetectionWebImage `json:"visuallySimilarImages,omitempty"`
  2959. // WebEntities: Deduced entities from similar images on the Internet.
  2960. WebEntities []*GoogleCloudVisionV1p1beta1WebDetectionWebEntity `json:"webEntities,omitempty"`
  2961. // ForceSendFields is a list of field names (e.g. "BestGuessLabels") to
  2962. // unconditionally include in API requests. By default, fields with
  2963. // empty values are omitted from API requests. However, any non-pointer,
  2964. // non-interface field appearing in ForceSendFields will be sent to the
  2965. // server regardless of whether the field is empty or not. This may be
  2966. // used to include empty fields in Patch requests.
  2967. ForceSendFields []string `json:"-"`
  2968. // NullFields is a list of field names (e.g. "BestGuessLabels") to
  2969. // include in API requests with the JSON null value. By default, fields
  2970. // with empty values are omitted from API requests. However, any field
  2971. // with an empty value appearing in NullFields will be sent to the
  2972. // server as null. It is an error if a field in this list has a
  2973. // non-empty value. This may be used to include null fields in Patch
  2974. // requests.
  2975. NullFields []string `json:"-"`
  2976. }
  2977. func (s *GoogleCloudVisionV1p1beta1WebDetection) MarshalJSON() ([]byte, error) {
  2978. type NoMethod GoogleCloudVisionV1p1beta1WebDetection
  2979. raw := NoMethod(*s)
  2980. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2981. }
  2982. // GoogleCloudVisionV1p1beta1WebDetectionParams: Parameters for web
  2983. // detection request.
  2984. type GoogleCloudVisionV1p1beta1WebDetectionParams struct {
  2985. // IncludeGeoResults: Whether to include results derived from the geo
  2986. // information in the image.
  2987. IncludeGeoResults bool `json:"includeGeoResults,omitempty"`
  2988. // ForceSendFields is a list of field names (e.g. "IncludeGeoResults")
  2989. // to unconditionally include in API requests. By default, fields with
  2990. // empty values are omitted from API requests. However, any non-pointer,
  2991. // non-interface field appearing in ForceSendFields will be sent to the
  2992. // server regardless of whether the field is empty or not. This may be
  2993. // used to include empty fields in Patch requests.
  2994. ForceSendFields []string `json:"-"`
  2995. // NullFields is a list of field names (e.g. "IncludeGeoResults") to
  2996. // include in API requests with the JSON null value. By default, fields
  2997. // with empty values are omitted from API requests. However, any field
  2998. // with an empty value appearing in NullFields will be sent to the
  2999. // server as null. It is an error if a field in this list has a
  3000. // non-empty value. This may be used to include null fields in Patch
  3001. // requests.
  3002. NullFields []string `json:"-"`
  3003. }
  3004. func (s *GoogleCloudVisionV1p1beta1WebDetectionParams) MarshalJSON() ([]byte, error) {
  3005. type NoMethod GoogleCloudVisionV1p1beta1WebDetectionParams
  3006. raw := NoMethod(*s)
  3007. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3008. }
  3009. // GoogleCloudVisionV1p1beta1WebDetectionWebEntity: Entity deduced from
  3010. // similar images on the Internet.
  3011. type GoogleCloudVisionV1p1beta1WebDetectionWebEntity struct {
  3012. // Description: Canonical description of the entity, in English.
  3013. Description string `json:"description,omitempty"`
  3014. // EntityId: Opaque entity ID.
  3015. EntityId string `json:"entityId,omitempty"`
  3016. // Score: Overall relevancy score for the entity.
  3017. // Not normalized and not comparable across different image queries.
  3018. Score float64 `json:"score,omitempty"`
  3019. // ForceSendFields is a list of field names (e.g. "Description") to
  3020. // unconditionally include in API requests. By default, fields with
  3021. // empty values are omitted from API requests. However, any non-pointer,
  3022. // non-interface field appearing in ForceSendFields will be sent to the
  3023. // server regardless of whether the field is empty or not. This may be
  3024. // used to include empty fields in Patch requests.
  3025. ForceSendFields []string `json:"-"`
  3026. // NullFields is a list of field names (e.g. "Description") to include
  3027. // in API requests with the JSON null value. By default, fields with
  3028. // empty values are omitted from API requests. However, any field with
  3029. // an empty value appearing in NullFields will be sent to the server as
  3030. // null. It is an error if a field in this list has a non-empty value.
  3031. // This may be used to include null fields in Patch requests.
  3032. NullFields []string `json:"-"`
  3033. }
  3034. func (s *GoogleCloudVisionV1p1beta1WebDetectionWebEntity) MarshalJSON() ([]byte, error) {
  3035. type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebEntity
  3036. raw := NoMethod(*s)
  3037. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3038. }
  3039. func (s *GoogleCloudVisionV1p1beta1WebDetectionWebEntity) UnmarshalJSON(data []byte) error {
  3040. type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebEntity
  3041. var s1 struct {
  3042. Score gensupport.JSONFloat64 `json:"score"`
  3043. *NoMethod
  3044. }
  3045. s1.NoMethod = (*NoMethod)(s)
  3046. if err := json.Unmarshal(data, &s1); err != nil {
  3047. return err
  3048. }
  3049. s.Score = float64(s1.Score)
  3050. return nil
  3051. }
  3052. // GoogleCloudVisionV1p1beta1WebDetectionWebImage: Metadata for online
  3053. // images.
  3054. type GoogleCloudVisionV1p1beta1WebDetectionWebImage struct {
  3055. // Score: (Deprecated) Overall relevancy score for the image.
  3056. Score float64 `json:"score,omitempty"`
  3057. // Url: The result image URL.
  3058. Url string `json:"url,omitempty"`
  3059. // ForceSendFields is a list of field names (e.g. "Score") to
  3060. // unconditionally include in API requests. By default, fields with
  3061. // empty values are omitted from API requests. However, any non-pointer,
  3062. // non-interface field appearing in ForceSendFields will be sent to the
  3063. // server regardless of whether the field is empty or not. This may be
  3064. // used to include empty fields in Patch requests.
  3065. ForceSendFields []string `json:"-"`
  3066. // NullFields is a list of field names (e.g. "Score") to include in API
  3067. // requests with the JSON null value. By default, fields with empty
  3068. // values are omitted from API requests. However, any field with an
  3069. // empty value appearing in NullFields will be sent to the server as
  3070. // null. It is an error if a field in this list has a non-empty value.
  3071. // This may be used to include null fields in Patch requests.
  3072. NullFields []string `json:"-"`
  3073. }
  3074. func (s *GoogleCloudVisionV1p1beta1WebDetectionWebImage) MarshalJSON() ([]byte, error) {
  3075. type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebImage
  3076. raw := NoMethod(*s)
  3077. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3078. }
  3079. func (s *GoogleCloudVisionV1p1beta1WebDetectionWebImage) UnmarshalJSON(data []byte) error {
  3080. type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebImage
  3081. var s1 struct {
  3082. Score gensupport.JSONFloat64 `json:"score"`
  3083. *NoMethod
  3084. }
  3085. s1.NoMethod = (*NoMethod)(s)
  3086. if err := json.Unmarshal(data, &s1); err != nil {
  3087. return err
  3088. }
  3089. s.Score = float64(s1.Score)
  3090. return nil
  3091. }
  3092. // GoogleCloudVisionV1p1beta1WebDetectionWebLabel: Label to provide
  3093. // extra metadata for the web detection.
  3094. type GoogleCloudVisionV1p1beta1WebDetectionWebLabel struct {
  3095. // Label: Label for extra metadata.
  3096. Label string `json:"label,omitempty"`
  3097. // LanguageCode: The BCP-47 language code for `label`, such as "en-US"
  3098. // or "sr-Latn".
  3099. // For more information,
  3100. // see
  3101. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  3102. LanguageCode string `json:"languageCode,omitempty"`
  3103. // ForceSendFields is a list of field names (e.g. "Label") to
  3104. // unconditionally include in API requests. By default, fields with
  3105. // empty values are omitted from API requests. However, any non-pointer,
  3106. // non-interface field appearing in ForceSendFields will be sent to the
  3107. // server regardless of whether the field is empty or not. This may be
  3108. // used to include empty fields in Patch requests.
  3109. ForceSendFields []string `json:"-"`
  3110. // NullFields is a list of field names (e.g. "Label") to include in API
  3111. // requests with the JSON null value. By default, fields with empty
  3112. // values are omitted from API requests. However, any field with an
  3113. // empty value appearing in NullFields will be sent to the server as
  3114. // null. It is an error if a field in this list has a non-empty value.
  3115. // This may be used to include null fields in Patch requests.
  3116. NullFields []string `json:"-"`
  3117. }
  3118. func (s *GoogleCloudVisionV1p1beta1WebDetectionWebLabel) MarshalJSON() ([]byte, error) {
  3119. type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebLabel
  3120. raw := NoMethod(*s)
  3121. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3122. }
  3123. // GoogleCloudVisionV1p1beta1WebDetectionWebPage: Metadata for web
  3124. // pages.
  3125. type GoogleCloudVisionV1p1beta1WebDetectionWebPage struct {
  3126. // FullMatchingImages: Fully matching images on the page.
  3127. // Can include resized copies of the query image.
  3128. FullMatchingImages []*GoogleCloudVisionV1p1beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"`
  3129. // PageTitle: Title for the web page, may contain HTML markups.
  3130. PageTitle string `json:"pageTitle,omitempty"`
  3131. // PartialMatchingImages: Partial matching images on the page.
  3132. // Those images are similar enough to share some key-point features.
  3133. // For
  3134. // example an original image will likely have partial matching for
  3135. // its
  3136. // crops.
  3137. PartialMatchingImages []*GoogleCloudVisionV1p1beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"`
  3138. // Score: (Deprecated) Overall relevancy score for the web page.
  3139. Score float64 `json:"score,omitempty"`
  3140. // Url: The result web page URL.
  3141. Url string `json:"url,omitempty"`
  3142. // ForceSendFields is a list of field names (e.g. "FullMatchingImages")
  3143. // to unconditionally include in API requests. By default, fields with
  3144. // empty values are omitted from API requests. However, any non-pointer,
  3145. // non-interface field appearing in ForceSendFields will be sent to the
  3146. // server regardless of whether the field is empty or not. This may be
  3147. // used to include empty fields in Patch requests.
  3148. ForceSendFields []string `json:"-"`
  3149. // NullFields is a list of field names (e.g. "FullMatchingImages") to
  3150. // include in API requests with the JSON null value. By default, fields
  3151. // with empty values are omitted from API requests. However, any field
  3152. // with an empty value appearing in NullFields will be sent to the
  3153. // server as null. It is an error if a field in this list has a
  3154. // non-empty value. This may be used to include null fields in Patch
  3155. // requests.
  3156. NullFields []string `json:"-"`
  3157. }
  3158. func (s *GoogleCloudVisionV1p1beta1WebDetectionWebPage) MarshalJSON() ([]byte, error) {
  3159. type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebPage
  3160. raw := NoMethod(*s)
  3161. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3162. }
  3163. func (s *GoogleCloudVisionV1p1beta1WebDetectionWebPage) UnmarshalJSON(data []byte) error {
  3164. type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebPage
  3165. var s1 struct {
  3166. Score gensupport.JSONFloat64 `json:"score"`
  3167. *NoMethod
  3168. }
  3169. s1.NoMethod = (*NoMethod)(s)
  3170. if err := json.Unmarshal(data, &s1); err != nil {
  3171. return err
  3172. }
  3173. s.Score = float64(s1.Score)
  3174. return nil
  3175. }
  3176. // GoogleCloudVisionV1p1beta1Word: A word representation.
  3177. type GoogleCloudVisionV1p1beta1Word struct {
  3178. // BoundingBox: The bounding box for the word.
  3179. // The vertices are in the order of top-left, top-right,
  3180. // bottom-right,
  3181. // bottom-left. When a rotation of the bounding box is detected the
  3182. // rotation
  3183. // is represented as around the top-left corner as defined when the text
  3184. // is
  3185. // read in the 'natural' orientation.
  3186. // For example:
  3187. // * when the text is horizontal it might look like:
  3188. // 0----1
  3189. // | |
  3190. // 3----2
  3191. // * when it's rotated 180 degrees around the top-left corner it
  3192. // becomes:
  3193. // 2----3
  3194. // | |
  3195. // 1----0
  3196. // and the vertice order will still be (0, 1, 2, 3).
  3197. BoundingBox *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingBox,omitempty"`
  3198. // Confidence: Confidence of the OCR results for the word. Range [0, 1].
  3199. Confidence float64 `json:"confidence,omitempty"`
  3200. // Property: Additional information detected for the word.
  3201. Property *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty `json:"property,omitempty"`
  3202. // Symbols: List of symbols in the word.
  3203. // The order of the symbols follows the natural reading order.
  3204. Symbols []*GoogleCloudVisionV1p1beta1Symbol `json:"symbols,omitempty"`
  3205. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  3206. // unconditionally include in API requests. By default, fields with
  3207. // empty values are omitted from API requests. However, any non-pointer,
  3208. // non-interface field appearing in ForceSendFields will be sent to the
  3209. // server regardless of whether the field is empty or not. This may be
  3210. // used to include empty fields in Patch requests.
  3211. ForceSendFields []string `json:"-"`
  3212. // NullFields is a list of field names (e.g. "BoundingBox") to include
  3213. // in API requests with the JSON null value. By default, fields with
  3214. // empty values are omitted from API requests. However, any field with
  3215. // an empty value appearing in NullFields will be sent to the server as
  3216. // null. It is an error if a field in this list has a non-empty value.
  3217. // This may be used to include null fields in Patch requests.
  3218. NullFields []string `json:"-"`
  3219. }
  3220. func (s *GoogleCloudVisionV1p1beta1Word) MarshalJSON() ([]byte, error) {
  3221. type NoMethod GoogleCloudVisionV1p1beta1Word
  3222. raw := NoMethod(*s)
  3223. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3224. }
  3225. func (s *GoogleCloudVisionV1p1beta1Word) UnmarshalJSON(data []byte) error {
  3226. type NoMethod GoogleCloudVisionV1p1beta1Word
  3227. var s1 struct {
  3228. Confidence gensupport.JSONFloat64 `json:"confidence"`
  3229. *NoMethod
  3230. }
  3231. s1.NoMethod = (*NoMethod)(s)
  3232. if err := json.Unmarshal(data, &s1); err != nil {
  3233. return err
  3234. }
  3235. s.Confidence = float64(s1.Confidence)
  3236. return nil
  3237. }
  3238. // GoogleCloudVisionV1p2beta1AnnotateFileResponse: Response to a single
  3239. // file annotation request. A file may contain one or more
  3240. // images, which individually have their own responses.
  3241. type GoogleCloudVisionV1p2beta1AnnotateFileResponse struct {
  3242. // InputConfig: Information about the file for which this response is
  3243. // generated.
  3244. InputConfig *GoogleCloudVisionV1p2beta1InputConfig `json:"inputConfig,omitempty"`
  3245. // Responses: Individual responses to images found within the file.
  3246. Responses []*GoogleCloudVisionV1p2beta1AnnotateImageResponse `json:"responses,omitempty"`
  3247. // ForceSendFields is a list of field names (e.g. "InputConfig") to
  3248. // unconditionally include in API requests. By default, fields with
  3249. // empty values are omitted from API requests. However, any non-pointer,
  3250. // non-interface field appearing in ForceSendFields will be sent to the
  3251. // server regardless of whether the field is empty or not. This may be
  3252. // used to include empty fields in Patch requests.
  3253. ForceSendFields []string `json:"-"`
  3254. // NullFields is a list of field names (e.g. "InputConfig") to include
  3255. // in API requests with the JSON null value. By default, fields with
  3256. // empty values are omitted from API requests. However, any field with
  3257. // an empty value appearing in NullFields will be sent to the server as
  3258. // null. It is an error if a field in this list has a non-empty value.
  3259. // This may be used to include null fields in Patch requests.
  3260. NullFields []string `json:"-"`
  3261. }
  3262. func (s *GoogleCloudVisionV1p2beta1AnnotateFileResponse) MarshalJSON() ([]byte, error) {
  3263. type NoMethod GoogleCloudVisionV1p2beta1AnnotateFileResponse
  3264. raw := NoMethod(*s)
  3265. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3266. }
  3267. // GoogleCloudVisionV1p2beta1AnnotateImageResponse: Response to an image
  3268. // annotation request.
  3269. type GoogleCloudVisionV1p2beta1AnnotateImageResponse struct {
  3270. // Context: If present, contextual information is needed to understand
  3271. // where this image
  3272. // comes from.
  3273. Context *GoogleCloudVisionV1p2beta1ImageAnnotationContext `json:"context,omitempty"`
  3274. // CropHintsAnnotation: If present, crop hints have completed
  3275. // successfully.
  3276. CropHintsAnnotation *GoogleCloudVisionV1p2beta1CropHintsAnnotation `json:"cropHintsAnnotation,omitempty"`
  3277. // Error: If set, represents the error message for the operation.
  3278. // Note that filled-in image annotations are guaranteed to be
  3279. // correct, even when `error` is set.
  3280. Error *Status `json:"error,omitempty"`
  3281. // FaceAnnotations: If present, face detection has completed
  3282. // successfully.
  3283. FaceAnnotations []*GoogleCloudVisionV1p2beta1FaceAnnotation `json:"faceAnnotations,omitempty"`
  3284. // FullTextAnnotation: If present, text (OCR) detection or document
  3285. // (OCR) text detection has
  3286. // completed successfully.
  3287. // This annotation provides the structural hierarchy for the OCR
  3288. // detected
  3289. // text.
  3290. FullTextAnnotation *GoogleCloudVisionV1p2beta1TextAnnotation `json:"fullTextAnnotation,omitempty"`
  3291. // ImagePropertiesAnnotation: If present, image properties were
  3292. // extracted successfully.
  3293. ImagePropertiesAnnotation *GoogleCloudVisionV1p2beta1ImageProperties `json:"imagePropertiesAnnotation,omitempty"`
  3294. // LabelAnnotations: If present, label detection has completed
  3295. // successfully.
  3296. LabelAnnotations []*GoogleCloudVisionV1p2beta1EntityAnnotation `json:"labelAnnotations,omitempty"`
  3297. // LandmarkAnnotations: If present, landmark detection has completed
  3298. // successfully.
  3299. LandmarkAnnotations []*GoogleCloudVisionV1p2beta1EntityAnnotation `json:"landmarkAnnotations,omitempty"`
  3300. // LogoAnnotations: If present, logo detection has completed
  3301. // successfully.
  3302. LogoAnnotations []*GoogleCloudVisionV1p2beta1EntityAnnotation `json:"logoAnnotations,omitempty"`
  3303. // SafeSearchAnnotation: If present, safe-search annotation has
  3304. // completed successfully.
  3305. SafeSearchAnnotation *GoogleCloudVisionV1p2beta1SafeSearchAnnotation `json:"safeSearchAnnotation,omitempty"`
  3306. // TextAnnotations: If present, text (OCR) detection has completed
  3307. // successfully.
  3308. TextAnnotations []*GoogleCloudVisionV1p2beta1EntityAnnotation `json:"textAnnotations,omitempty"`
  3309. // WebDetection: If present, web detection has completed successfully.
  3310. WebDetection *GoogleCloudVisionV1p2beta1WebDetection `json:"webDetection,omitempty"`
  3311. // ForceSendFields is a list of field names (e.g. "Context") to
  3312. // unconditionally include in API requests. By default, fields with
  3313. // empty values are omitted from API requests. However, any non-pointer,
  3314. // non-interface field appearing in ForceSendFields will be sent to the
  3315. // server regardless of whether the field is empty or not. This may be
  3316. // used to include empty fields in Patch requests.
  3317. ForceSendFields []string `json:"-"`
  3318. // NullFields is a list of field names (e.g. "Context") to include in
  3319. // API requests with the JSON null value. By default, fields with empty
  3320. // values are omitted from API requests. However, any field with an
  3321. // empty value appearing in NullFields will be sent to the server as
  3322. // null. It is an error if a field in this list has a non-empty value.
  3323. // This may be used to include null fields in Patch requests.
  3324. NullFields []string `json:"-"`
  3325. }
  3326. func (s *GoogleCloudVisionV1p2beta1AnnotateImageResponse) MarshalJSON() ([]byte, error) {
  3327. type NoMethod GoogleCloudVisionV1p2beta1AnnotateImageResponse
  3328. raw := NoMethod(*s)
  3329. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3330. }
  3331. // GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse: The response for
  3332. // a single offline file annotation request.
  3333. type GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse struct {
  3334. // OutputConfig: The output location and metadata from
  3335. // AsyncAnnotateFileRequest.
  3336. OutputConfig *GoogleCloudVisionV1p2beta1OutputConfig `json:"outputConfig,omitempty"`
  3337. // ForceSendFields is a list of field names (e.g. "OutputConfig") to
  3338. // unconditionally include in API requests. By default, fields with
  3339. // empty values are omitted from API requests. However, any non-pointer,
  3340. // non-interface field appearing in ForceSendFields will be sent to the
  3341. // server regardless of whether the field is empty or not. This may be
  3342. // used to include empty fields in Patch requests.
  3343. ForceSendFields []string `json:"-"`
  3344. // NullFields is a list of field names (e.g. "OutputConfig") to include
  3345. // in API requests with the JSON null value. By default, fields with
  3346. // empty values are omitted from API requests. However, any field with
  3347. // an empty value appearing in NullFields will be sent to the server as
  3348. // null. It is an error if a field in this list has a non-empty value.
  3349. // This may be used to include null fields in Patch requests.
  3350. NullFields []string `json:"-"`
  3351. }
  3352. func (s *GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse) MarshalJSON() ([]byte, error) {
  3353. type NoMethod GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse
  3354. raw := NoMethod(*s)
  3355. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3356. }
  3357. // GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse: Response
  3358. // to an async batch file annotation request.
  3359. type GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse struct {
  3360. // Responses: The list of file annotation responses, one for each
  3361. // request in
  3362. // AsyncBatchAnnotateFilesRequest.
  3363. Responses []*GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse `json:"responses,omitempty"`
  3364. // ForceSendFields is a list of field names (e.g. "Responses") to
  3365. // unconditionally include in API requests. By default, fields with
  3366. // empty values are omitted from API requests. However, any non-pointer,
  3367. // non-interface field appearing in ForceSendFields will be sent to the
  3368. // server regardless of whether the field is empty or not. This may be
  3369. // used to include empty fields in Patch requests.
  3370. ForceSendFields []string `json:"-"`
  3371. // NullFields is a list of field names (e.g. "Responses") to include in
  3372. // API requests with the JSON null value. By default, fields with empty
  3373. // values are omitted from API requests. However, any field with an
  3374. // empty value appearing in NullFields will be sent to the server as
  3375. // null. It is an error if a field in this list has a non-empty value.
  3376. // This may be used to include null fields in Patch requests.
  3377. NullFields []string `json:"-"`
  3378. }
  3379. func (s *GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) {
  3380. type NoMethod GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse
  3381. raw := NoMethod(*s)
  3382. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3383. }
  3384. // GoogleCloudVisionV1p2beta1Block: Logical element on the page.
  3385. type GoogleCloudVisionV1p2beta1Block struct {
  3386. // BlockType: Detected block type (text, image etc) for this block.
  3387. //
  3388. // Possible values:
  3389. // "UNKNOWN" - Unknown block type.
  3390. // "TEXT" - Regular text block.
  3391. // "TABLE" - Table block.
  3392. // "PICTURE" - Image block.
  3393. // "RULER" - Horizontal/vertical line box.
  3394. // "BARCODE" - Barcode block.
  3395. BlockType string `json:"blockType,omitempty"`
  3396. // BoundingBox: The bounding box for the block.
  3397. // The vertices are in the order of top-left, top-right,
  3398. // bottom-right,
  3399. // bottom-left. When a rotation of the bounding box is detected the
  3400. // rotation
  3401. // is represented as around the top-left corner as defined when the text
  3402. // is
  3403. // read in the 'natural' orientation.
  3404. // For example:
  3405. //
  3406. // * when the text is horizontal it might look like:
  3407. //
  3408. // 0----1
  3409. // | |
  3410. // 3----2
  3411. //
  3412. // * when it's rotated 180 degrees around the top-left corner it
  3413. // becomes:
  3414. //
  3415. // 2----3
  3416. // | |
  3417. // 1----0
  3418. //
  3419. // and the vertice order will still be (0, 1, 2, 3).
  3420. BoundingBox *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingBox,omitempty"`
  3421. // Confidence: Confidence of the OCR results on the block. Range [0, 1].
  3422. Confidence float64 `json:"confidence,omitempty"`
  3423. // Paragraphs: List of paragraphs in this block (if this blocks is of
  3424. // type text).
  3425. Paragraphs []*GoogleCloudVisionV1p2beta1Paragraph `json:"paragraphs,omitempty"`
  3426. // Property: Additional information detected for the block.
  3427. Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"`
  3428. // ForceSendFields is a list of field names (e.g. "BlockType") to
  3429. // unconditionally include in API requests. By default, fields with
  3430. // empty values are omitted from API requests. However, any non-pointer,
  3431. // non-interface field appearing in ForceSendFields will be sent to the
  3432. // server regardless of whether the field is empty or not. This may be
  3433. // used to include empty fields in Patch requests.
  3434. ForceSendFields []string `json:"-"`
  3435. // NullFields is a list of field names (e.g. "BlockType") to include in
  3436. // API requests with the JSON null value. By default, fields with empty
  3437. // values are omitted from API requests. However, any field with an
  3438. // empty value appearing in NullFields will be sent to the server as
  3439. // null. It is an error if a field in this list has a non-empty value.
  3440. // This may be used to include null fields in Patch requests.
  3441. NullFields []string `json:"-"`
  3442. }
  3443. func (s *GoogleCloudVisionV1p2beta1Block) MarshalJSON() ([]byte, error) {
  3444. type NoMethod GoogleCloudVisionV1p2beta1Block
  3445. raw := NoMethod(*s)
  3446. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3447. }
  3448. func (s *GoogleCloudVisionV1p2beta1Block) UnmarshalJSON(data []byte) error {
  3449. type NoMethod GoogleCloudVisionV1p2beta1Block
  3450. var s1 struct {
  3451. Confidence gensupport.JSONFloat64 `json:"confidence"`
  3452. *NoMethod
  3453. }
  3454. s1.NoMethod = (*NoMethod)(s)
  3455. if err := json.Unmarshal(data, &s1); err != nil {
  3456. return err
  3457. }
  3458. s.Confidence = float64(s1.Confidence)
  3459. return nil
  3460. }
  3461. // GoogleCloudVisionV1p2beta1BoundingPoly: A bounding polygon for the
  3462. // detected image annotation.
  3463. type GoogleCloudVisionV1p2beta1BoundingPoly struct {
  3464. // NormalizedVertices: The bounding polygon normalized vertices.
  3465. NormalizedVertices []*GoogleCloudVisionV1p2beta1NormalizedVertex `json:"normalizedVertices,omitempty"`
  3466. // Vertices: The bounding polygon vertices.
  3467. Vertices []*GoogleCloudVisionV1p2beta1Vertex `json:"vertices,omitempty"`
  3468. // ForceSendFields is a list of field names (e.g. "NormalizedVertices")
  3469. // to unconditionally include in API requests. By default, fields with
  3470. // empty values are omitted from API requests. However, any non-pointer,
  3471. // non-interface field appearing in ForceSendFields will be sent to the
  3472. // server regardless of whether the field is empty or not. This may be
  3473. // used to include empty fields in Patch requests.
  3474. ForceSendFields []string `json:"-"`
  3475. // NullFields is a list of field names (e.g. "NormalizedVertices") to
  3476. // include in API requests with the JSON null value. By default, fields
  3477. // with empty values are omitted from API requests. However, any field
  3478. // with an empty value appearing in NullFields will be sent to the
  3479. // server as null. It is an error if a field in this list has a
  3480. // non-empty value. This may be used to include null fields in Patch
  3481. // requests.
  3482. NullFields []string `json:"-"`
  3483. }
  3484. func (s *GoogleCloudVisionV1p2beta1BoundingPoly) MarshalJSON() ([]byte, error) {
  3485. type NoMethod GoogleCloudVisionV1p2beta1BoundingPoly
  3486. raw := NoMethod(*s)
  3487. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3488. }
  3489. // GoogleCloudVisionV1p2beta1ColorInfo: Color information consists of
  3490. // RGB channels, score, and the fraction of
  3491. // the image that the color occupies in the image.
  3492. type GoogleCloudVisionV1p2beta1ColorInfo struct {
  3493. // Color: RGB components of the color.
  3494. Color *Color `json:"color,omitempty"`
  3495. // PixelFraction: The fraction of pixels the color occupies in the
  3496. // image.
  3497. // Value in range [0, 1].
  3498. PixelFraction float64 `json:"pixelFraction,omitempty"`
  3499. // Score: Image-specific score for this color. Value in range [0, 1].
  3500. Score float64 `json:"score,omitempty"`
  3501. // ForceSendFields is a list of field names (e.g. "Color") to
  3502. // unconditionally include in API requests. By default, fields with
  3503. // empty values are omitted from API requests. However, any non-pointer,
  3504. // non-interface field appearing in ForceSendFields will be sent to the
  3505. // server regardless of whether the field is empty or not. This may be
  3506. // used to include empty fields in Patch requests.
  3507. ForceSendFields []string `json:"-"`
  3508. // NullFields is a list of field names (e.g. "Color") to include in API
  3509. // requests with the JSON null value. By default, fields with empty
  3510. // values are omitted from API requests. However, any field with an
  3511. // empty value appearing in NullFields will be sent to the server as
  3512. // null. It is an error if a field in this list has a non-empty value.
  3513. // This may be used to include null fields in Patch requests.
  3514. NullFields []string `json:"-"`
  3515. }
  3516. func (s *GoogleCloudVisionV1p2beta1ColorInfo) MarshalJSON() ([]byte, error) {
  3517. type NoMethod GoogleCloudVisionV1p2beta1ColorInfo
  3518. raw := NoMethod(*s)
  3519. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3520. }
  3521. func (s *GoogleCloudVisionV1p2beta1ColorInfo) UnmarshalJSON(data []byte) error {
  3522. type NoMethod GoogleCloudVisionV1p2beta1ColorInfo
  3523. var s1 struct {
  3524. PixelFraction gensupport.JSONFloat64 `json:"pixelFraction"`
  3525. Score gensupport.JSONFloat64 `json:"score"`
  3526. *NoMethod
  3527. }
  3528. s1.NoMethod = (*NoMethod)(s)
  3529. if err := json.Unmarshal(data, &s1); err != nil {
  3530. return err
  3531. }
  3532. s.PixelFraction = float64(s1.PixelFraction)
  3533. s.Score = float64(s1.Score)
  3534. return nil
  3535. }
  3536. // GoogleCloudVisionV1p2beta1CropHint: Single crop hint that is used to
  3537. // generate a new crop when serving an image.
  3538. type GoogleCloudVisionV1p2beta1CropHint struct {
  3539. // BoundingPoly: The bounding polygon for the crop region. The
  3540. // coordinates of the bounding
  3541. // box are in the original image's scale, as returned in `ImageParams`.
  3542. BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"`
  3543. // Confidence: Confidence of this being a salient region. Range [0, 1].
  3544. Confidence float64 `json:"confidence,omitempty"`
  3545. // ImportanceFraction: Fraction of importance of this salient region
  3546. // with respect to the original
  3547. // image.
  3548. ImportanceFraction float64 `json:"importanceFraction,omitempty"`
  3549. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  3550. // unconditionally include in API requests. By default, fields with
  3551. // empty values are omitted from API requests. However, any non-pointer,
  3552. // non-interface field appearing in ForceSendFields will be sent to the
  3553. // server regardless of whether the field is empty or not. This may be
  3554. // used to include empty fields in Patch requests.
  3555. ForceSendFields []string `json:"-"`
  3556. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  3557. // in API requests with the JSON null value. By default, fields with
  3558. // empty values are omitted from API requests. However, any field with
  3559. // an empty value appearing in NullFields will be sent to the server as
  3560. // null. It is an error if a field in this list has a non-empty value.
  3561. // This may be used to include null fields in Patch requests.
  3562. NullFields []string `json:"-"`
  3563. }
  3564. func (s *GoogleCloudVisionV1p2beta1CropHint) MarshalJSON() ([]byte, error) {
  3565. type NoMethod GoogleCloudVisionV1p2beta1CropHint
  3566. raw := NoMethod(*s)
  3567. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3568. }
  3569. func (s *GoogleCloudVisionV1p2beta1CropHint) UnmarshalJSON(data []byte) error {
  3570. type NoMethod GoogleCloudVisionV1p2beta1CropHint
  3571. var s1 struct {
  3572. Confidence gensupport.JSONFloat64 `json:"confidence"`
  3573. ImportanceFraction gensupport.JSONFloat64 `json:"importanceFraction"`
  3574. *NoMethod
  3575. }
  3576. s1.NoMethod = (*NoMethod)(s)
  3577. if err := json.Unmarshal(data, &s1); err != nil {
  3578. return err
  3579. }
  3580. s.Confidence = float64(s1.Confidence)
  3581. s.ImportanceFraction = float64(s1.ImportanceFraction)
  3582. return nil
  3583. }
  3584. // GoogleCloudVisionV1p2beta1CropHintsAnnotation: Set of crop hints that
  3585. // are used to generate new crops when serving images.
  3586. type GoogleCloudVisionV1p2beta1CropHintsAnnotation struct {
  3587. // CropHints: Crop hint results.
  3588. CropHints []*GoogleCloudVisionV1p2beta1CropHint `json:"cropHints,omitempty"`
  3589. // ForceSendFields is a list of field names (e.g. "CropHints") to
  3590. // unconditionally include in API requests. By default, fields with
  3591. // empty values are omitted from API requests. However, any non-pointer,
  3592. // non-interface field appearing in ForceSendFields will be sent to the
  3593. // server regardless of whether the field is empty or not. This may be
  3594. // used to include empty fields in Patch requests.
  3595. ForceSendFields []string `json:"-"`
  3596. // NullFields is a list of field names (e.g. "CropHints") to include in
  3597. // API requests with the JSON null value. By default, fields with empty
  3598. // values are omitted from API requests. However, any field with an
  3599. // empty value appearing in NullFields will be sent to the server as
  3600. // null. It is an error if a field in this list has a non-empty value.
  3601. // This may be used to include null fields in Patch requests.
  3602. NullFields []string `json:"-"`
  3603. }
  3604. func (s *GoogleCloudVisionV1p2beta1CropHintsAnnotation) MarshalJSON() ([]byte, error) {
  3605. type NoMethod GoogleCloudVisionV1p2beta1CropHintsAnnotation
  3606. raw := NoMethod(*s)
  3607. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3608. }
  3609. // GoogleCloudVisionV1p2beta1DominantColorsAnnotation: Set of dominant
  3610. // colors and their corresponding scores.
  3611. type GoogleCloudVisionV1p2beta1DominantColorsAnnotation struct {
  3612. // Colors: RGB color values with their score and pixel fraction.
  3613. Colors []*GoogleCloudVisionV1p2beta1ColorInfo `json:"colors,omitempty"`
  3614. // ForceSendFields is a list of field names (e.g. "Colors") to
  3615. // unconditionally include in API requests. By default, fields with
  3616. // empty values are omitted from API requests. However, any non-pointer,
  3617. // non-interface field appearing in ForceSendFields will be sent to the
  3618. // server regardless of whether the field is empty or not. This may be
  3619. // used to include empty fields in Patch requests.
  3620. ForceSendFields []string `json:"-"`
  3621. // NullFields is a list of field names (e.g. "Colors") to include in API
  3622. // requests with the JSON null value. By default, fields with empty
  3623. // values are omitted from API requests. However, any field with an
  3624. // empty value appearing in NullFields will be sent to the server as
  3625. // null. It is an error if a field in this list has a non-empty value.
  3626. // This may be used to include null fields in Patch requests.
  3627. NullFields []string `json:"-"`
  3628. }
  3629. func (s *GoogleCloudVisionV1p2beta1DominantColorsAnnotation) MarshalJSON() ([]byte, error) {
  3630. type NoMethod GoogleCloudVisionV1p2beta1DominantColorsAnnotation
  3631. raw := NoMethod(*s)
  3632. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3633. }
  3634. // GoogleCloudVisionV1p2beta1EntityAnnotation: Set of detected entity
  3635. // features.
  3636. type GoogleCloudVisionV1p2beta1EntityAnnotation struct {
  3637. // BoundingPoly: Image region to which this entity belongs. Not
  3638. // produced
  3639. // for `LABEL_DETECTION` features.
  3640. BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"`
  3641. // Confidence: **Deprecated. Use `score` instead.**
  3642. // The accuracy of the entity detection in an image.
  3643. // For example, for an image in which the "Eiffel Tower" entity is
  3644. // detected,
  3645. // this field represents the confidence that there is a tower in the
  3646. // query
  3647. // image. Range [0, 1].
  3648. Confidence float64 `json:"confidence,omitempty"`
  3649. // Description: Entity textual description, expressed in its `locale`
  3650. // language.
  3651. Description string `json:"description,omitempty"`
  3652. // Locale: The language code for the locale in which the entity
  3653. // textual
  3654. // `description` is expressed.
  3655. Locale string `json:"locale,omitempty"`
  3656. // Locations: The location information for the detected entity.
  3657. // Multiple
  3658. // `LocationInfo` elements can be present because one location
  3659. // may
  3660. // indicate the location of the scene in the image, and another
  3661. // location
  3662. // may indicate the location of the place where the image was
  3663. // taken.
  3664. // Location information is usually present for landmarks.
  3665. Locations []*GoogleCloudVisionV1p2beta1LocationInfo `json:"locations,omitempty"`
  3666. // Mid: Opaque entity ID. Some IDs may be available in
  3667. // [Google Knowledge Graph
  3668. // Search
  3669. // API](https://developers.google.com/knowledge-graph/).
  3670. Mid string `json:"mid,omitempty"`
  3671. // Properties: Some entities may have optional user-supplied `Property`
  3672. // (name/value)
  3673. // fields, such a score or string that qualifies the entity.
  3674. Properties []*GoogleCloudVisionV1p2beta1Property `json:"properties,omitempty"`
  3675. // Score: Overall score of the result. Range [0, 1].
  3676. Score float64 `json:"score,omitempty"`
  3677. // Topicality: The relevancy of the ICA (Image Content Annotation) label
  3678. // to the
  3679. // image. For example, the relevancy of "tower" is likely higher to an
  3680. // image
  3681. // containing the detected "Eiffel Tower" than to an image containing
  3682. // a
  3683. // detected distant towering building, even though the confidence
  3684. // that
  3685. // there is a tower in each image may be the same. Range [0, 1].
  3686. Topicality float64 `json:"topicality,omitempty"`
  3687. // ForceSendFields is a list of field names (e.g. "BoundingPoly") 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. "BoundingPoly") to include
  3695. // in API requests with the JSON null value. By default, fields with
  3696. // empty values are omitted from API requests. However, any field with
  3697. // an empty value appearing in NullFields will be sent to the server as
  3698. // null. It is an error if a field in this list has a non-empty value.
  3699. // This may be used to include null fields in Patch requests.
  3700. NullFields []string `json:"-"`
  3701. }
  3702. func (s *GoogleCloudVisionV1p2beta1EntityAnnotation) MarshalJSON() ([]byte, error) {
  3703. type NoMethod GoogleCloudVisionV1p2beta1EntityAnnotation
  3704. raw := NoMethod(*s)
  3705. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3706. }
  3707. func (s *GoogleCloudVisionV1p2beta1EntityAnnotation) UnmarshalJSON(data []byte) error {
  3708. type NoMethod GoogleCloudVisionV1p2beta1EntityAnnotation
  3709. var s1 struct {
  3710. Confidence gensupport.JSONFloat64 `json:"confidence"`
  3711. Score gensupport.JSONFloat64 `json:"score"`
  3712. Topicality gensupport.JSONFloat64 `json:"topicality"`
  3713. *NoMethod
  3714. }
  3715. s1.NoMethod = (*NoMethod)(s)
  3716. if err := json.Unmarshal(data, &s1); err != nil {
  3717. return err
  3718. }
  3719. s.Confidence = float64(s1.Confidence)
  3720. s.Score = float64(s1.Score)
  3721. s.Topicality = float64(s1.Topicality)
  3722. return nil
  3723. }
  3724. // GoogleCloudVisionV1p2beta1FaceAnnotation: A face annotation object
  3725. // contains the results of face detection.
  3726. type GoogleCloudVisionV1p2beta1FaceAnnotation struct {
  3727. // AngerLikelihood: Anger likelihood.
  3728. //
  3729. // Possible values:
  3730. // "UNKNOWN" - Unknown likelihood.
  3731. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  3732. // specified vertical.
  3733. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  3734. // vertical.
  3735. // "POSSIBLE" - It is possible that the image belongs to the specified
  3736. // vertical.
  3737. // "LIKELY" - It is likely that the image belongs to the specified
  3738. // vertical.
  3739. // "VERY_LIKELY" - It is very likely that the image belongs to the
  3740. // specified vertical.
  3741. AngerLikelihood string `json:"angerLikelihood,omitempty"`
  3742. // BlurredLikelihood: Blurred likelihood.
  3743. //
  3744. // Possible values:
  3745. // "UNKNOWN" - Unknown likelihood.
  3746. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  3747. // specified vertical.
  3748. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  3749. // vertical.
  3750. // "POSSIBLE" - It is possible that the image belongs to the specified
  3751. // vertical.
  3752. // "LIKELY" - It is likely that the image belongs to the specified
  3753. // vertical.
  3754. // "VERY_LIKELY" - It is very likely that the image belongs to the
  3755. // specified vertical.
  3756. BlurredLikelihood string `json:"blurredLikelihood,omitempty"`
  3757. // BoundingPoly: The bounding polygon around the face. The coordinates
  3758. // of the bounding box
  3759. // are in the original image's scale, as returned in `ImageParams`.
  3760. // The bounding box is computed to "frame" the face in accordance with
  3761. // human
  3762. // expectations. It is based on the landmarker results.
  3763. // Note that one or more x and/or y coordinates may not be generated in
  3764. // the
  3765. // `BoundingPoly` (the polygon will be unbounded) if only a partial
  3766. // face
  3767. // appears in the image to be annotated.
  3768. BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"`
  3769. // DetectionConfidence: Detection confidence. Range [0, 1].
  3770. DetectionConfidence float64 `json:"detectionConfidence,omitempty"`
  3771. // FdBoundingPoly: The `fd_bounding_poly` bounding polygon is tighter
  3772. // than the
  3773. // `boundingPoly`, and encloses only the skin part of the face.
  3774. // Typically, it
  3775. // is used to eliminate the face from any image analysis that detects
  3776. // the
  3777. // "amount of skin" visible in an image. It is not based on
  3778. // the
  3779. // landmarker results, only on the initial face detection, hence
  3780. // the <code>fd</code> (face detection) prefix.
  3781. FdBoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"fdBoundingPoly,omitempty"`
  3782. // HeadwearLikelihood: Headwear likelihood.
  3783. //
  3784. // Possible values:
  3785. // "UNKNOWN" - Unknown likelihood.
  3786. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  3787. // specified vertical.
  3788. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  3789. // vertical.
  3790. // "POSSIBLE" - It is possible that the image belongs to the specified
  3791. // vertical.
  3792. // "LIKELY" - It is likely that the image belongs to the specified
  3793. // vertical.
  3794. // "VERY_LIKELY" - It is very likely that the image belongs to the
  3795. // specified vertical.
  3796. HeadwearLikelihood string `json:"headwearLikelihood,omitempty"`
  3797. // JoyLikelihood: Joy likelihood.
  3798. //
  3799. // Possible values:
  3800. // "UNKNOWN" - Unknown likelihood.
  3801. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  3802. // specified vertical.
  3803. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  3804. // vertical.
  3805. // "POSSIBLE" - It is possible that the image belongs to the specified
  3806. // vertical.
  3807. // "LIKELY" - It is likely that the image belongs to the specified
  3808. // vertical.
  3809. // "VERY_LIKELY" - It is very likely that the image belongs to the
  3810. // specified vertical.
  3811. JoyLikelihood string `json:"joyLikelihood,omitempty"`
  3812. // LandmarkingConfidence: Face landmarking confidence. Range [0, 1].
  3813. LandmarkingConfidence float64 `json:"landmarkingConfidence,omitempty"`
  3814. // Landmarks: Detected face landmarks.
  3815. Landmarks []*GoogleCloudVisionV1p2beta1FaceAnnotationLandmark `json:"landmarks,omitempty"`
  3816. // PanAngle: Yaw angle, which indicates the leftward/rightward angle
  3817. // that the face is
  3818. // pointing relative to the vertical plane perpendicular to the image.
  3819. // Range
  3820. // [-180,180].
  3821. PanAngle float64 `json:"panAngle,omitempty"`
  3822. // RollAngle: Roll angle, which indicates the amount of
  3823. // clockwise/anti-clockwise rotation
  3824. // of the face relative to the image vertical about the axis
  3825. // perpendicular to
  3826. // the face. Range [-180,180].
  3827. RollAngle float64 `json:"rollAngle,omitempty"`
  3828. // SorrowLikelihood: Sorrow likelihood.
  3829. //
  3830. // Possible values:
  3831. // "UNKNOWN" - Unknown likelihood.
  3832. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  3833. // specified vertical.
  3834. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  3835. // vertical.
  3836. // "POSSIBLE" - It is possible that the image belongs to the specified
  3837. // vertical.
  3838. // "LIKELY" - It is likely that the image belongs to the specified
  3839. // vertical.
  3840. // "VERY_LIKELY" - It is very likely that the image belongs to the
  3841. // specified vertical.
  3842. SorrowLikelihood string `json:"sorrowLikelihood,omitempty"`
  3843. // SurpriseLikelihood: Surprise likelihood.
  3844. //
  3845. // Possible values:
  3846. // "UNKNOWN" - Unknown likelihood.
  3847. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  3848. // specified vertical.
  3849. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  3850. // vertical.
  3851. // "POSSIBLE" - It is possible that the image belongs to the specified
  3852. // vertical.
  3853. // "LIKELY" - It is likely that the image belongs to the specified
  3854. // vertical.
  3855. // "VERY_LIKELY" - It is very likely that the image belongs to the
  3856. // specified vertical.
  3857. SurpriseLikelihood string `json:"surpriseLikelihood,omitempty"`
  3858. // TiltAngle: Pitch angle, which indicates the upwards/downwards angle
  3859. // that the face is
  3860. // pointing relative to the image's horizontal plane. Range [-180,180].
  3861. TiltAngle float64 `json:"tiltAngle,omitempty"`
  3862. // UnderExposedLikelihood: Under-exposed likelihood.
  3863. //
  3864. // Possible values:
  3865. // "UNKNOWN" - Unknown likelihood.
  3866. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  3867. // specified vertical.
  3868. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  3869. // vertical.
  3870. // "POSSIBLE" - It is possible that the image belongs to the specified
  3871. // vertical.
  3872. // "LIKELY" - It is likely that the image belongs to the specified
  3873. // vertical.
  3874. // "VERY_LIKELY" - It is very likely that the image belongs to the
  3875. // specified vertical.
  3876. UnderExposedLikelihood string `json:"underExposedLikelihood,omitempty"`
  3877. // ForceSendFields is a list of field names (e.g. "AngerLikelihood") to
  3878. // unconditionally include in API requests. By default, fields with
  3879. // empty values are omitted from API requests. However, any non-pointer,
  3880. // non-interface field appearing in ForceSendFields will be sent to the
  3881. // server regardless of whether the field is empty or not. This may be
  3882. // used to include empty fields in Patch requests.
  3883. ForceSendFields []string `json:"-"`
  3884. // NullFields is a list of field names (e.g. "AngerLikelihood") to
  3885. // include in API requests with the JSON null value. By default, fields
  3886. // with empty values are omitted from API requests. However, any field
  3887. // with an empty value appearing in NullFields will be sent to the
  3888. // server as null. It is an error if a field in this list has a
  3889. // non-empty value. This may be used to include null fields in Patch
  3890. // requests.
  3891. NullFields []string `json:"-"`
  3892. }
  3893. func (s *GoogleCloudVisionV1p2beta1FaceAnnotation) MarshalJSON() ([]byte, error) {
  3894. type NoMethod GoogleCloudVisionV1p2beta1FaceAnnotation
  3895. raw := NoMethod(*s)
  3896. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3897. }
  3898. func (s *GoogleCloudVisionV1p2beta1FaceAnnotation) UnmarshalJSON(data []byte) error {
  3899. type NoMethod GoogleCloudVisionV1p2beta1FaceAnnotation
  3900. var s1 struct {
  3901. DetectionConfidence gensupport.JSONFloat64 `json:"detectionConfidence"`
  3902. LandmarkingConfidence gensupport.JSONFloat64 `json:"landmarkingConfidence"`
  3903. PanAngle gensupport.JSONFloat64 `json:"panAngle"`
  3904. RollAngle gensupport.JSONFloat64 `json:"rollAngle"`
  3905. TiltAngle gensupport.JSONFloat64 `json:"tiltAngle"`
  3906. *NoMethod
  3907. }
  3908. s1.NoMethod = (*NoMethod)(s)
  3909. if err := json.Unmarshal(data, &s1); err != nil {
  3910. return err
  3911. }
  3912. s.DetectionConfidence = float64(s1.DetectionConfidence)
  3913. s.LandmarkingConfidence = float64(s1.LandmarkingConfidence)
  3914. s.PanAngle = float64(s1.PanAngle)
  3915. s.RollAngle = float64(s1.RollAngle)
  3916. s.TiltAngle = float64(s1.TiltAngle)
  3917. return nil
  3918. }
  3919. // GoogleCloudVisionV1p2beta1FaceAnnotationLandmark: A face-specific
  3920. // landmark (for example, a face feature).
  3921. type GoogleCloudVisionV1p2beta1FaceAnnotationLandmark struct {
  3922. // Position: Face landmark position.
  3923. Position *GoogleCloudVisionV1p2beta1Position `json:"position,omitempty"`
  3924. // Type: Face landmark type.
  3925. //
  3926. // Possible values:
  3927. // "UNKNOWN_LANDMARK" - Unknown face landmark detected. Should not be
  3928. // filled.
  3929. // "LEFT_EYE" - Left eye.
  3930. // "RIGHT_EYE" - Right eye.
  3931. // "LEFT_OF_LEFT_EYEBROW" - Left of left eyebrow.
  3932. // "RIGHT_OF_LEFT_EYEBROW" - Right of left eyebrow.
  3933. // "LEFT_OF_RIGHT_EYEBROW" - Left of right eyebrow.
  3934. // "RIGHT_OF_RIGHT_EYEBROW" - Right of right eyebrow.
  3935. // "MIDPOINT_BETWEEN_EYES" - Midpoint between eyes.
  3936. // "NOSE_TIP" - Nose tip.
  3937. // "UPPER_LIP" - Upper lip.
  3938. // "LOWER_LIP" - Lower lip.
  3939. // "MOUTH_LEFT" - Mouth left.
  3940. // "MOUTH_RIGHT" - Mouth right.
  3941. // "MOUTH_CENTER" - Mouth center.
  3942. // "NOSE_BOTTOM_RIGHT" - Nose, bottom right.
  3943. // "NOSE_BOTTOM_LEFT" - Nose, bottom left.
  3944. // "NOSE_BOTTOM_CENTER" - Nose, bottom center.
  3945. // "LEFT_EYE_TOP_BOUNDARY" - Left eye, top boundary.
  3946. // "LEFT_EYE_RIGHT_CORNER" - Left eye, right corner.
  3947. // "LEFT_EYE_BOTTOM_BOUNDARY" - Left eye, bottom boundary.
  3948. // "LEFT_EYE_LEFT_CORNER" - Left eye, left corner.
  3949. // "RIGHT_EYE_TOP_BOUNDARY" - Right eye, top boundary.
  3950. // "RIGHT_EYE_RIGHT_CORNER" - Right eye, right corner.
  3951. // "RIGHT_EYE_BOTTOM_BOUNDARY" - Right eye, bottom boundary.
  3952. // "RIGHT_EYE_LEFT_CORNER" - Right eye, left corner.
  3953. // "LEFT_EYEBROW_UPPER_MIDPOINT" - Left eyebrow, upper midpoint.
  3954. // "RIGHT_EYEBROW_UPPER_MIDPOINT" - Right eyebrow, upper midpoint.
  3955. // "LEFT_EAR_TRAGION" - Left ear tragion.
  3956. // "RIGHT_EAR_TRAGION" - Right ear tragion.
  3957. // "LEFT_EYE_PUPIL" - Left eye pupil.
  3958. // "RIGHT_EYE_PUPIL" - Right eye pupil.
  3959. // "FOREHEAD_GLABELLA" - Forehead glabella.
  3960. // "CHIN_GNATHION" - Chin gnathion.
  3961. // "CHIN_LEFT_GONION" - Chin left gonion.
  3962. // "CHIN_RIGHT_GONION" - Chin right gonion.
  3963. Type string `json:"type,omitempty"`
  3964. // ForceSendFields is a list of field names (e.g. "Position") to
  3965. // unconditionally include in API requests. By default, fields with
  3966. // empty values are omitted from API requests. However, any non-pointer,
  3967. // non-interface field appearing in ForceSendFields will be sent to the
  3968. // server regardless of whether the field is empty or not. This may be
  3969. // used to include empty fields in Patch requests.
  3970. ForceSendFields []string `json:"-"`
  3971. // NullFields is a list of field names (e.g. "Position") to include in
  3972. // API requests with the JSON null value. By default, fields with empty
  3973. // values are omitted from API requests. However, any field with an
  3974. // empty value appearing in NullFields will be sent to the server as
  3975. // null. It is an error if a field in this list has a non-empty value.
  3976. // This may be used to include null fields in Patch requests.
  3977. NullFields []string `json:"-"`
  3978. }
  3979. func (s *GoogleCloudVisionV1p2beta1FaceAnnotationLandmark) MarshalJSON() ([]byte, error) {
  3980. type NoMethod GoogleCloudVisionV1p2beta1FaceAnnotationLandmark
  3981. raw := NoMethod(*s)
  3982. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3983. }
  3984. // GoogleCloudVisionV1p2beta1GcsDestination: The Google Cloud Storage
  3985. // location where the output will be written to.
  3986. type GoogleCloudVisionV1p2beta1GcsDestination struct {
  3987. // Uri: Google Cloud Storage URI where the results will be stored.
  3988. // Results will
  3989. // be in JSON format and preceded by its corresponding input URI. This
  3990. // field
  3991. // can either represent a single file, or a prefix for multiple
  3992. // outputs.
  3993. // Prefixes must end in a `/`.
  3994. //
  3995. // Examples:
  3996. //
  3997. // * File: gs://bucket-name/filename.json
  3998. // * Prefix: gs://bucket-name/prefix/here/
  3999. // * File: gs://bucket-name/prefix/here
  4000. //
  4001. // If multiple outputs, each response is still AnnotateFileResponse,
  4002. // each of
  4003. // which contains some subset of the full list of
  4004. // AnnotateImageResponse.
  4005. // Multiple outputs can happen if, for example, the output JSON is too
  4006. // large
  4007. // and overflows into multiple sharded files.
  4008. Uri string `json:"uri,omitempty"`
  4009. // ForceSendFields is a list of field names (e.g. "Uri") to
  4010. // unconditionally include in API requests. By default, fields with
  4011. // empty values are omitted from API requests. However, any non-pointer,
  4012. // non-interface field appearing in ForceSendFields will be sent to the
  4013. // server regardless of whether the field is empty or not. This may be
  4014. // used to include empty fields in Patch requests.
  4015. ForceSendFields []string `json:"-"`
  4016. // NullFields is a list of field names (e.g. "Uri") to include in API
  4017. // requests with the JSON null value. By default, fields with empty
  4018. // values are omitted from API requests. However, any field with an
  4019. // empty value appearing in NullFields will be sent to the server as
  4020. // null. It is an error if a field in this list has a non-empty value.
  4021. // This may be used to include null fields in Patch requests.
  4022. NullFields []string `json:"-"`
  4023. }
  4024. func (s *GoogleCloudVisionV1p2beta1GcsDestination) MarshalJSON() ([]byte, error) {
  4025. type NoMethod GoogleCloudVisionV1p2beta1GcsDestination
  4026. raw := NoMethod(*s)
  4027. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4028. }
  4029. // GoogleCloudVisionV1p2beta1GcsSource: The Google Cloud Storage
  4030. // location where the input will be read from.
  4031. type GoogleCloudVisionV1p2beta1GcsSource struct {
  4032. // Uri: Google Cloud Storage URI for the input file. This must only be
  4033. // a
  4034. // Google Cloud Storage object. Wildcards are not currently supported.
  4035. Uri string `json:"uri,omitempty"`
  4036. // ForceSendFields is a list of field names (e.g. "Uri") to
  4037. // unconditionally include in API requests. By default, fields with
  4038. // empty values are omitted from API requests. However, any non-pointer,
  4039. // non-interface field appearing in ForceSendFields will be sent to the
  4040. // server regardless of whether the field is empty or not. This may be
  4041. // used to include empty fields in Patch requests.
  4042. ForceSendFields []string `json:"-"`
  4043. // NullFields is a list of field names (e.g. "Uri") to include in API
  4044. // requests with the JSON null value. By default, fields with empty
  4045. // values are omitted from API requests. However, any field with an
  4046. // empty value appearing in NullFields will be sent to the server as
  4047. // null. It is an error if a field in this list has a non-empty value.
  4048. // This may be used to include null fields in Patch requests.
  4049. NullFields []string `json:"-"`
  4050. }
  4051. func (s *GoogleCloudVisionV1p2beta1GcsSource) MarshalJSON() ([]byte, error) {
  4052. type NoMethod GoogleCloudVisionV1p2beta1GcsSource
  4053. raw := NoMethod(*s)
  4054. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4055. }
  4056. // GoogleCloudVisionV1p2beta1ImageAnnotationContext: If an image was
  4057. // produced from a file (e.g. a PDF), this message gives
  4058. // information about the source of that image.
  4059. type GoogleCloudVisionV1p2beta1ImageAnnotationContext struct {
  4060. // PageNumber: If the file was a PDF or TIFF, this field gives the page
  4061. // number within
  4062. // the file used to produce the image.
  4063. PageNumber int64 `json:"pageNumber,omitempty"`
  4064. // Uri: The URI of the file used to produce the image.
  4065. Uri string `json:"uri,omitempty"`
  4066. // ForceSendFields is a list of field names (e.g. "PageNumber") to
  4067. // unconditionally include in API requests. By default, fields with
  4068. // empty values are omitted from API requests. However, any non-pointer,
  4069. // non-interface field appearing in ForceSendFields will be sent to the
  4070. // server regardless of whether the field is empty or not. This may be
  4071. // used to include empty fields in Patch requests.
  4072. ForceSendFields []string `json:"-"`
  4073. // NullFields is a list of field names (e.g. "PageNumber") to include in
  4074. // API requests with the JSON null value. By default, fields with empty
  4075. // values are omitted from API requests. However, any field with an
  4076. // empty value appearing in NullFields will be sent to the server as
  4077. // null. It is an error if a field in this list has a non-empty value.
  4078. // This may be used to include null fields in Patch requests.
  4079. NullFields []string `json:"-"`
  4080. }
  4081. func (s *GoogleCloudVisionV1p2beta1ImageAnnotationContext) MarshalJSON() ([]byte, error) {
  4082. type NoMethod GoogleCloudVisionV1p2beta1ImageAnnotationContext
  4083. raw := NoMethod(*s)
  4084. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4085. }
  4086. // GoogleCloudVisionV1p2beta1ImageProperties: Stores image properties,
  4087. // such as dominant colors.
  4088. type GoogleCloudVisionV1p2beta1ImageProperties struct {
  4089. // DominantColors: If present, dominant colors completed successfully.
  4090. DominantColors *GoogleCloudVisionV1p2beta1DominantColorsAnnotation `json:"dominantColors,omitempty"`
  4091. // ForceSendFields is a list of field names (e.g. "DominantColors") to
  4092. // unconditionally include in API requests. By default, fields with
  4093. // empty values are omitted from API requests. However, any non-pointer,
  4094. // non-interface field appearing in ForceSendFields will be sent to the
  4095. // server regardless of whether the field is empty or not. This may be
  4096. // used to include empty fields in Patch requests.
  4097. ForceSendFields []string `json:"-"`
  4098. // NullFields is a list of field names (e.g. "DominantColors") to
  4099. // include in API requests with the JSON null value. By default, fields
  4100. // with empty values are omitted from API requests. However, any field
  4101. // with an empty value appearing in NullFields will be sent to the
  4102. // server as null. It is an error if a field in this list has a
  4103. // non-empty value. This may be used to include null fields in Patch
  4104. // requests.
  4105. NullFields []string `json:"-"`
  4106. }
  4107. func (s *GoogleCloudVisionV1p2beta1ImageProperties) MarshalJSON() ([]byte, error) {
  4108. type NoMethod GoogleCloudVisionV1p2beta1ImageProperties
  4109. raw := NoMethod(*s)
  4110. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4111. }
  4112. // GoogleCloudVisionV1p2beta1InputConfig: The desired input location and
  4113. // metadata.
  4114. type GoogleCloudVisionV1p2beta1InputConfig struct {
  4115. // GcsSource: The Google Cloud Storage location to read the input from.
  4116. GcsSource *GoogleCloudVisionV1p2beta1GcsSource `json:"gcsSource,omitempty"`
  4117. // MimeType: The type of the file. Currently only "application/pdf" and
  4118. // "image/tiff"
  4119. // are supported. Wildcards are not supported.
  4120. MimeType string `json:"mimeType,omitempty"`
  4121. // ForceSendFields is a list of field names (e.g. "GcsSource") to
  4122. // unconditionally include in API requests. By default, fields with
  4123. // empty values are omitted from API requests. However, any non-pointer,
  4124. // non-interface field appearing in ForceSendFields will be sent to the
  4125. // server regardless of whether the field is empty or not. This may be
  4126. // used to include empty fields in Patch requests.
  4127. ForceSendFields []string `json:"-"`
  4128. // NullFields is a list of field names (e.g. "GcsSource") to include in
  4129. // API requests with the JSON null value. By default, fields with empty
  4130. // values are omitted from API requests. However, any field with an
  4131. // empty value appearing in NullFields will be sent to the server as
  4132. // null. It is an error if a field in this list has a non-empty value.
  4133. // This may be used to include null fields in Patch requests.
  4134. NullFields []string `json:"-"`
  4135. }
  4136. func (s *GoogleCloudVisionV1p2beta1InputConfig) MarshalJSON() ([]byte, error) {
  4137. type NoMethod GoogleCloudVisionV1p2beta1InputConfig
  4138. raw := NoMethod(*s)
  4139. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4140. }
  4141. // GoogleCloudVisionV1p2beta1LocationInfo: Detected entity location
  4142. // information.
  4143. type GoogleCloudVisionV1p2beta1LocationInfo struct {
  4144. // LatLng: lat/long location coordinates.
  4145. LatLng *LatLng `json:"latLng,omitempty"`
  4146. // ForceSendFields is a list of field names (e.g. "LatLng") to
  4147. // unconditionally include in API requests. By default, fields with
  4148. // empty values are omitted from API requests. However, any non-pointer,
  4149. // non-interface field appearing in ForceSendFields will be sent to the
  4150. // server regardless of whether the field is empty or not. This may be
  4151. // used to include empty fields in Patch requests.
  4152. ForceSendFields []string `json:"-"`
  4153. // NullFields is a list of field names (e.g. "LatLng") to include in API
  4154. // requests with the JSON null value. By default, fields with empty
  4155. // values are omitted from API requests. However, any field with an
  4156. // empty value appearing in NullFields will be sent to the server as
  4157. // null. It is an error if a field in this list has a non-empty value.
  4158. // This may be used to include null fields in Patch requests.
  4159. NullFields []string `json:"-"`
  4160. }
  4161. func (s *GoogleCloudVisionV1p2beta1LocationInfo) MarshalJSON() ([]byte, error) {
  4162. type NoMethod GoogleCloudVisionV1p2beta1LocationInfo
  4163. raw := NoMethod(*s)
  4164. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4165. }
  4166. // GoogleCloudVisionV1p2beta1NormalizedVertex: A vertex represents a 2D
  4167. // point in the image.
  4168. // NOTE: the normalized vertex coordinates are relative to the original
  4169. // image
  4170. // and range from 0 to 1.
  4171. type GoogleCloudVisionV1p2beta1NormalizedVertex struct {
  4172. // X: X coordinate.
  4173. X float64 `json:"x,omitempty"`
  4174. // Y: Y coordinate.
  4175. Y float64 `json:"y,omitempty"`
  4176. // ForceSendFields is a list of field names (e.g. "X") to
  4177. // unconditionally include in API requests. By default, fields with
  4178. // empty values are omitted from API requests. However, any non-pointer,
  4179. // non-interface field appearing in ForceSendFields will be sent to the
  4180. // server regardless of whether the field is empty or not. This may be
  4181. // used to include empty fields in Patch requests.
  4182. ForceSendFields []string `json:"-"`
  4183. // NullFields is a list of field names (e.g. "X") to include in API
  4184. // requests with the JSON null value. By default, fields with empty
  4185. // values are omitted from API requests. However, any field with an
  4186. // empty value appearing in NullFields will be sent to the server as
  4187. // null. It is an error if a field in this list has a non-empty value.
  4188. // This may be used to include null fields in Patch requests.
  4189. NullFields []string `json:"-"`
  4190. }
  4191. func (s *GoogleCloudVisionV1p2beta1NormalizedVertex) MarshalJSON() ([]byte, error) {
  4192. type NoMethod GoogleCloudVisionV1p2beta1NormalizedVertex
  4193. raw := NoMethod(*s)
  4194. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4195. }
  4196. func (s *GoogleCloudVisionV1p2beta1NormalizedVertex) UnmarshalJSON(data []byte) error {
  4197. type NoMethod GoogleCloudVisionV1p2beta1NormalizedVertex
  4198. var s1 struct {
  4199. X gensupport.JSONFloat64 `json:"x"`
  4200. Y gensupport.JSONFloat64 `json:"y"`
  4201. *NoMethod
  4202. }
  4203. s1.NoMethod = (*NoMethod)(s)
  4204. if err := json.Unmarshal(data, &s1); err != nil {
  4205. return err
  4206. }
  4207. s.X = float64(s1.X)
  4208. s.Y = float64(s1.Y)
  4209. return nil
  4210. }
  4211. // GoogleCloudVisionV1p2beta1OperationMetadata: Contains metadata for
  4212. // the BatchAnnotateImages operation.
  4213. type GoogleCloudVisionV1p2beta1OperationMetadata struct {
  4214. // CreateTime: The time when the batch request was received.
  4215. CreateTime string `json:"createTime,omitempty"`
  4216. // State: Current state of the batch operation.
  4217. //
  4218. // Possible values:
  4219. // "STATE_UNSPECIFIED" - Invalid.
  4220. // "CREATED" - Request is received.
  4221. // "RUNNING" - Request is actively being processed.
  4222. // "DONE" - The batch processing is done.
  4223. // "CANCELLED" - The batch processing was cancelled.
  4224. State string `json:"state,omitempty"`
  4225. // UpdateTime: The time when the operation result was last updated.
  4226. UpdateTime string `json:"updateTime,omitempty"`
  4227. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  4228. // unconditionally include in API requests. By default, fields with
  4229. // empty values are omitted from API requests. However, any non-pointer,
  4230. // non-interface field appearing in ForceSendFields will be sent to the
  4231. // server regardless of whether the field is empty or not. This may be
  4232. // used to include empty fields in Patch requests.
  4233. ForceSendFields []string `json:"-"`
  4234. // NullFields is a list of field names (e.g. "CreateTime") to include in
  4235. // API requests with the JSON null value. By default, fields with empty
  4236. // values are omitted from API requests. However, any field with an
  4237. // empty value appearing in NullFields will be sent to the server as
  4238. // null. It is an error if a field in this list has a non-empty value.
  4239. // This may be used to include null fields in Patch requests.
  4240. NullFields []string `json:"-"`
  4241. }
  4242. func (s *GoogleCloudVisionV1p2beta1OperationMetadata) MarshalJSON() ([]byte, error) {
  4243. type NoMethod GoogleCloudVisionV1p2beta1OperationMetadata
  4244. raw := NoMethod(*s)
  4245. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4246. }
  4247. // GoogleCloudVisionV1p2beta1OutputConfig: The desired output location
  4248. // and metadata.
  4249. type GoogleCloudVisionV1p2beta1OutputConfig struct {
  4250. // BatchSize: The max number of response protos to put into each output
  4251. // JSON file on
  4252. // Google Cloud Storage.
  4253. // The valid range is [1, 100]. If not specified, the default value is
  4254. // 20.
  4255. //
  4256. // For example, for one pdf file with 100 pages, 100 response protos
  4257. // will
  4258. // be generated. If `batch_size` = 20, then 5 json files each
  4259. // containing 20 response protos will be written under the
  4260. // prefix
  4261. // `gcs_destination`.`uri`.
  4262. //
  4263. // Currently, batch_size only applies to GcsDestination, with potential
  4264. // future
  4265. // support for other output configurations.
  4266. BatchSize int64 `json:"batchSize,omitempty"`
  4267. // GcsDestination: The Google Cloud Storage location to write the
  4268. // output(s) to.
  4269. GcsDestination *GoogleCloudVisionV1p2beta1GcsDestination `json:"gcsDestination,omitempty"`
  4270. // ForceSendFields is a list of field names (e.g. "BatchSize") to
  4271. // unconditionally include in API requests. By default, fields with
  4272. // empty values are omitted from API requests. However, any non-pointer,
  4273. // non-interface field appearing in ForceSendFields will be sent to the
  4274. // server regardless of whether the field is empty or not. This may be
  4275. // used to include empty fields in Patch requests.
  4276. ForceSendFields []string `json:"-"`
  4277. // NullFields is a list of field names (e.g. "BatchSize") to include in
  4278. // API requests with the JSON null value. By default, fields with empty
  4279. // values are omitted from API requests. However, any field with an
  4280. // empty value appearing in NullFields will be sent to the server as
  4281. // null. It is an error if a field in this list has a non-empty value.
  4282. // This may be used to include null fields in Patch requests.
  4283. NullFields []string `json:"-"`
  4284. }
  4285. func (s *GoogleCloudVisionV1p2beta1OutputConfig) MarshalJSON() ([]byte, error) {
  4286. type NoMethod GoogleCloudVisionV1p2beta1OutputConfig
  4287. raw := NoMethod(*s)
  4288. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4289. }
  4290. // GoogleCloudVisionV1p2beta1Page: Detected page from OCR.
  4291. type GoogleCloudVisionV1p2beta1Page struct {
  4292. // Blocks: List of blocks of text, images etc on this page.
  4293. Blocks []*GoogleCloudVisionV1p2beta1Block `json:"blocks,omitempty"`
  4294. // Confidence: Confidence of the OCR results on the page. Range [0, 1].
  4295. Confidence float64 `json:"confidence,omitempty"`
  4296. // Height: Page height. For PDFs the unit is points. For images
  4297. // (including
  4298. // TIFFs) the unit is pixels.
  4299. Height int64 `json:"height,omitempty"`
  4300. // Property: Additional information detected on the page.
  4301. Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"`
  4302. // Width: Page width. For PDFs the unit is points. For images
  4303. // (including
  4304. // TIFFs) the unit is pixels.
  4305. Width int64 `json:"width,omitempty"`
  4306. // ForceSendFields is a list of field names (e.g. "Blocks") to
  4307. // unconditionally include in API requests. By default, fields with
  4308. // empty values are omitted from API requests. However, any non-pointer,
  4309. // non-interface field appearing in ForceSendFields will be sent to the
  4310. // server regardless of whether the field is empty or not. This may be
  4311. // used to include empty fields in Patch requests.
  4312. ForceSendFields []string `json:"-"`
  4313. // NullFields is a list of field names (e.g. "Blocks") to include in API
  4314. // requests with the JSON null value. By default, fields with empty
  4315. // values are omitted from API requests. However, any field with an
  4316. // empty value appearing in NullFields will be sent to the server as
  4317. // null. It is an error if a field in this list has a non-empty value.
  4318. // This may be used to include null fields in Patch requests.
  4319. NullFields []string `json:"-"`
  4320. }
  4321. func (s *GoogleCloudVisionV1p2beta1Page) MarshalJSON() ([]byte, error) {
  4322. type NoMethod GoogleCloudVisionV1p2beta1Page
  4323. raw := NoMethod(*s)
  4324. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4325. }
  4326. func (s *GoogleCloudVisionV1p2beta1Page) UnmarshalJSON(data []byte) error {
  4327. type NoMethod GoogleCloudVisionV1p2beta1Page
  4328. var s1 struct {
  4329. Confidence gensupport.JSONFloat64 `json:"confidence"`
  4330. *NoMethod
  4331. }
  4332. s1.NoMethod = (*NoMethod)(s)
  4333. if err := json.Unmarshal(data, &s1); err != nil {
  4334. return err
  4335. }
  4336. s.Confidence = float64(s1.Confidence)
  4337. return nil
  4338. }
  4339. // GoogleCloudVisionV1p2beta1Paragraph: Structural unit of text
  4340. // representing a number of words in certain order.
  4341. type GoogleCloudVisionV1p2beta1Paragraph struct {
  4342. // BoundingBox: The bounding box for the paragraph.
  4343. // The vertices are in the order of top-left, top-right,
  4344. // bottom-right,
  4345. // bottom-left. When a rotation of the bounding box is detected the
  4346. // rotation
  4347. // is represented as around the top-left corner as defined when the text
  4348. // is
  4349. // read in the 'natural' orientation.
  4350. // For example:
  4351. // * when the text is horizontal it might look like:
  4352. // 0----1
  4353. // | |
  4354. // 3----2
  4355. // * when it's rotated 180 degrees around the top-left corner it
  4356. // becomes:
  4357. // 2----3
  4358. // | |
  4359. // 1----0
  4360. // and the vertice order will still be (0, 1, 2, 3).
  4361. BoundingBox *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingBox,omitempty"`
  4362. // Confidence: Confidence of the OCR results for the paragraph. Range
  4363. // [0, 1].
  4364. Confidence float64 `json:"confidence,omitempty"`
  4365. // Property: Additional information detected for the paragraph.
  4366. Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"`
  4367. // Words: List of words in this paragraph.
  4368. Words []*GoogleCloudVisionV1p2beta1Word `json:"words,omitempty"`
  4369. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  4370. // unconditionally include in API requests. By default, fields with
  4371. // empty values are omitted from API requests. However, any non-pointer,
  4372. // non-interface field appearing in ForceSendFields will be sent to the
  4373. // server regardless of whether the field is empty or not. This may be
  4374. // used to include empty fields in Patch requests.
  4375. ForceSendFields []string `json:"-"`
  4376. // NullFields is a list of field names (e.g. "BoundingBox") to include
  4377. // in API requests with the JSON null value. By default, fields with
  4378. // empty values are omitted from API requests. However, any field with
  4379. // an empty value appearing in NullFields will be sent to the server as
  4380. // null. It is an error if a field in this list has a non-empty value.
  4381. // This may be used to include null fields in Patch requests.
  4382. NullFields []string `json:"-"`
  4383. }
  4384. func (s *GoogleCloudVisionV1p2beta1Paragraph) MarshalJSON() ([]byte, error) {
  4385. type NoMethod GoogleCloudVisionV1p2beta1Paragraph
  4386. raw := NoMethod(*s)
  4387. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4388. }
  4389. func (s *GoogleCloudVisionV1p2beta1Paragraph) UnmarshalJSON(data []byte) error {
  4390. type NoMethod GoogleCloudVisionV1p2beta1Paragraph
  4391. var s1 struct {
  4392. Confidence gensupport.JSONFloat64 `json:"confidence"`
  4393. *NoMethod
  4394. }
  4395. s1.NoMethod = (*NoMethod)(s)
  4396. if err := json.Unmarshal(data, &s1); err != nil {
  4397. return err
  4398. }
  4399. s.Confidence = float64(s1.Confidence)
  4400. return nil
  4401. }
  4402. // GoogleCloudVisionV1p2beta1Position: A 3D position in the image, used
  4403. // primarily for Face detection landmarks.
  4404. // A valid Position must have both x and y coordinates.
  4405. // The position coordinates are in the same scale as the original image.
  4406. type GoogleCloudVisionV1p2beta1Position struct {
  4407. // X: X coordinate.
  4408. X float64 `json:"x,omitempty"`
  4409. // Y: Y coordinate.
  4410. Y float64 `json:"y,omitempty"`
  4411. // Z: Z coordinate (or depth).
  4412. Z float64 `json:"z,omitempty"`
  4413. // ForceSendFields is a list of field names (e.g. "X") to
  4414. // unconditionally include in API requests. By default, fields with
  4415. // empty values are omitted from API requests. However, any non-pointer,
  4416. // non-interface field appearing in ForceSendFields will be sent to the
  4417. // server regardless of whether the field is empty or not. This may be
  4418. // used to include empty fields in Patch requests.
  4419. ForceSendFields []string `json:"-"`
  4420. // NullFields is a list of field names (e.g. "X") to include in API
  4421. // requests with the JSON null value. By default, fields with empty
  4422. // values are omitted from API requests. However, any field with an
  4423. // empty value appearing in NullFields will be sent to the server as
  4424. // null. It is an error if a field in this list has a non-empty value.
  4425. // This may be used to include null fields in Patch requests.
  4426. NullFields []string `json:"-"`
  4427. }
  4428. func (s *GoogleCloudVisionV1p2beta1Position) MarshalJSON() ([]byte, error) {
  4429. type NoMethod GoogleCloudVisionV1p2beta1Position
  4430. raw := NoMethod(*s)
  4431. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4432. }
  4433. func (s *GoogleCloudVisionV1p2beta1Position) UnmarshalJSON(data []byte) error {
  4434. type NoMethod GoogleCloudVisionV1p2beta1Position
  4435. var s1 struct {
  4436. X gensupport.JSONFloat64 `json:"x"`
  4437. Y gensupport.JSONFloat64 `json:"y"`
  4438. Z gensupport.JSONFloat64 `json:"z"`
  4439. *NoMethod
  4440. }
  4441. s1.NoMethod = (*NoMethod)(s)
  4442. if err := json.Unmarshal(data, &s1); err != nil {
  4443. return err
  4444. }
  4445. s.X = float64(s1.X)
  4446. s.Y = float64(s1.Y)
  4447. s.Z = float64(s1.Z)
  4448. return nil
  4449. }
  4450. // GoogleCloudVisionV1p2beta1Property: A `Property` consists of a
  4451. // user-supplied name/value pair.
  4452. type GoogleCloudVisionV1p2beta1Property struct {
  4453. // Name: Name of the property.
  4454. Name string `json:"name,omitempty"`
  4455. // Uint64Value: Value of numeric properties.
  4456. Uint64Value uint64 `json:"uint64Value,omitempty,string"`
  4457. // Value: Value of the property.
  4458. Value string `json:"value,omitempty"`
  4459. // ForceSendFields is a list of field names (e.g. "Name") to
  4460. // unconditionally include in API requests. By default, fields with
  4461. // empty values are omitted from API requests. However, any non-pointer,
  4462. // non-interface field appearing in ForceSendFields will be sent to the
  4463. // server regardless of whether the field is empty or not. This may be
  4464. // used to include empty fields in Patch requests.
  4465. ForceSendFields []string `json:"-"`
  4466. // NullFields is a list of field names (e.g. "Name") to include in API
  4467. // requests with the JSON null value. By default, fields with empty
  4468. // values are omitted from API requests. However, any field with an
  4469. // empty value appearing in NullFields will be sent to the server as
  4470. // null. It is an error if a field in this list has a non-empty value.
  4471. // This may be used to include null fields in Patch requests.
  4472. NullFields []string `json:"-"`
  4473. }
  4474. func (s *GoogleCloudVisionV1p2beta1Property) MarshalJSON() ([]byte, error) {
  4475. type NoMethod GoogleCloudVisionV1p2beta1Property
  4476. raw := NoMethod(*s)
  4477. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4478. }
  4479. // GoogleCloudVisionV1p2beta1SafeSearchAnnotation: Set of features
  4480. // pertaining to the image, computed by computer vision
  4481. // methods over safe-search verticals (for example, adult, spoof,
  4482. // medical,
  4483. // violence).
  4484. type GoogleCloudVisionV1p2beta1SafeSearchAnnotation struct {
  4485. // Adult: Represents the adult content likelihood for the image. Adult
  4486. // content may
  4487. // contain elements such as nudity, pornographic images or cartoons,
  4488. // or
  4489. // sexual activities.
  4490. //
  4491. // Possible values:
  4492. // "UNKNOWN" - Unknown likelihood.
  4493. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  4494. // specified vertical.
  4495. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  4496. // vertical.
  4497. // "POSSIBLE" - It is possible that the image belongs to the specified
  4498. // vertical.
  4499. // "LIKELY" - It is likely that the image belongs to the specified
  4500. // vertical.
  4501. // "VERY_LIKELY" - It is very likely that the image belongs to the
  4502. // specified vertical.
  4503. Adult string `json:"adult,omitempty"`
  4504. // Medical: Likelihood that this is a medical image.
  4505. //
  4506. // Possible values:
  4507. // "UNKNOWN" - Unknown likelihood.
  4508. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  4509. // specified vertical.
  4510. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  4511. // vertical.
  4512. // "POSSIBLE" - It is possible that the image belongs to the specified
  4513. // vertical.
  4514. // "LIKELY" - It is likely that the image belongs to the specified
  4515. // vertical.
  4516. // "VERY_LIKELY" - It is very likely that the image belongs to the
  4517. // specified vertical.
  4518. Medical string `json:"medical,omitempty"`
  4519. // Racy: Likelihood that the request image contains racy content. Racy
  4520. // content may
  4521. // include (but is not limited to) skimpy or sheer clothing,
  4522. // strategically
  4523. // covered nudity, lewd or provocative poses, or close-ups of
  4524. // sensitive
  4525. // body areas.
  4526. //
  4527. // Possible values:
  4528. // "UNKNOWN" - Unknown likelihood.
  4529. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  4530. // specified vertical.
  4531. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  4532. // vertical.
  4533. // "POSSIBLE" - It is possible that the image belongs to the specified
  4534. // vertical.
  4535. // "LIKELY" - It is likely that the image belongs to the specified
  4536. // vertical.
  4537. // "VERY_LIKELY" - It is very likely that the image belongs to the
  4538. // specified vertical.
  4539. Racy string `json:"racy,omitempty"`
  4540. // Spoof: Spoof likelihood. The likelihood that an modification
  4541. // was made to the image's canonical version to make it appear
  4542. // funny or offensive.
  4543. //
  4544. // Possible values:
  4545. // "UNKNOWN" - Unknown likelihood.
  4546. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  4547. // specified vertical.
  4548. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  4549. // vertical.
  4550. // "POSSIBLE" - It is possible that the image belongs to the specified
  4551. // vertical.
  4552. // "LIKELY" - It is likely that the image belongs to the specified
  4553. // vertical.
  4554. // "VERY_LIKELY" - It is very likely that the image belongs to the
  4555. // specified vertical.
  4556. Spoof string `json:"spoof,omitempty"`
  4557. // Violence: Likelihood that this image contains violent content.
  4558. //
  4559. // Possible values:
  4560. // "UNKNOWN" - Unknown likelihood.
  4561. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  4562. // specified vertical.
  4563. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  4564. // vertical.
  4565. // "POSSIBLE" - It is possible that the image belongs to the specified
  4566. // vertical.
  4567. // "LIKELY" - It is likely that the image belongs to the specified
  4568. // vertical.
  4569. // "VERY_LIKELY" - It is very likely that the image belongs to the
  4570. // specified vertical.
  4571. Violence string `json:"violence,omitempty"`
  4572. // ForceSendFields is a list of field names (e.g. "Adult") to
  4573. // unconditionally include in API requests. By default, fields with
  4574. // empty values are omitted from API requests. However, any non-pointer,
  4575. // non-interface field appearing in ForceSendFields will be sent to the
  4576. // server regardless of whether the field is empty or not. This may be
  4577. // used to include empty fields in Patch requests.
  4578. ForceSendFields []string `json:"-"`
  4579. // NullFields is a list of field names (e.g. "Adult") to include in API
  4580. // requests with the JSON null value. By default, fields with empty
  4581. // values are omitted from API requests. However, any field with an
  4582. // empty value appearing in NullFields will be sent to the server as
  4583. // null. It is an error if a field in this list has a non-empty value.
  4584. // This may be used to include null fields in Patch requests.
  4585. NullFields []string `json:"-"`
  4586. }
  4587. func (s *GoogleCloudVisionV1p2beta1SafeSearchAnnotation) MarshalJSON() ([]byte, error) {
  4588. type NoMethod GoogleCloudVisionV1p2beta1SafeSearchAnnotation
  4589. raw := NoMethod(*s)
  4590. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4591. }
  4592. // GoogleCloudVisionV1p2beta1Symbol: A single symbol representation.
  4593. type GoogleCloudVisionV1p2beta1Symbol struct {
  4594. // BoundingBox: The bounding box for the symbol.
  4595. // The vertices are in the order of top-left, top-right,
  4596. // bottom-right,
  4597. // bottom-left. When a rotation of the bounding box is detected the
  4598. // rotation
  4599. // is represented as around the top-left corner as defined when the text
  4600. // is
  4601. // read in the 'natural' orientation.
  4602. // For example:
  4603. // * when the text is horizontal it might look like:
  4604. // 0----1
  4605. // | |
  4606. // 3----2
  4607. // * when it's rotated 180 degrees around the top-left corner it
  4608. // becomes:
  4609. // 2----3
  4610. // | |
  4611. // 1----0
  4612. // and the vertice order will still be (0, 1, 2, 3).
  4613. BoundingBox *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingBox,omitempty"`
  4614. // Confidence: Confidence of the OCR results for the symbol. Range [0,
  4615. // 1].
  4616. Confidence float64 `json:"confidence,omitempty"`
  4617. // Property: Additional information detected for the symbol.
  4618. Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"`
  4619. // Text: The actual UTF-8 representation of the symbol.
  4620. Text string `json:"text,omitempty"`
  4621. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  4622. // unconditionally include in API requests. By default, fields with
  4623. // empty values are omitted from API requests. However, any non-pointer,
  4624. // non-interface field appearing in ForceSendFields will be sent to the
  4625. // server regardless of whether the field is empty or not. This may be
  4626. // used to include empty fields in Patch requests.
  4627. ForceSendFields []string `json:"-"`
  4628. // NullFields is a list of field names (e.g. "BoundingBox") to include
  4629. // in API requests with the JSON null value. By default, fields with
  4630. // empty values are omitted from API requests. However, any field with
  4631. // an empty value appearing in NullFields will be sent to the server as
  4632. // null. It is an error if a field in this list has a non-empty value.
  4633. // This may be used to include null fields in Patch requests.
  4634. NullFields []string `json:"-"`
  4635. }
  4636. func (s *GoogleCloudVisionV1p2beta1Symbol) MarshalJSON() ([]byte, error) {
  4637. type NoMethod GoogleCloudVisionV1p2beta1Symbol
  4638. raw := NoMethod(*s)
  4639. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4640. }
  4641. func (s *GoogleCloudVisionV1p2beta1Symbol) UnmarshalJSON(data []byte) error {
  4642. type NoMethod GoogleCloudVisionV1p2beta1Symbol
  4643. var s1 struct {
  4644. Confidence gensupport.JSONFloat64 `json:"confidence"`
  4645. *NoMethod
  4646. }
  4647. s1.NoMethod = (*NoMethod)(s)
  4648. if err := json.Unmarshal(data, &s1); err != nil {
  4649. return err
  4650. }
  4651. s.Confidence = float64(s1.Confidence)
  4652. return nil
  4653. }
  4654. // GoogleCloudVisionV1p2beta1TextAnnotation: TextAnnotation contains a
  4655. // structured representation of OCR extracted text.
  4656. // The hierarchy of an OCR extracted text structure is like this:
  4657. // TextAnnotation -> Page -> Block -> Paragraph -> Word ->
  4658. // Symbol
  4659. // Each structural component, starting from Page, may further have their
  4660. // own
  4661. // properties. Properties describe detected languages, breaks etc..
  4662. // Please refer
  4663. // to the TextAnnotation.TextProperty message definition below for
  4664. // more
  4665. // detail.
  4666. type GoogleCloudVisionV1p2beta1TextAnnotation struct {
  4667. // Pages: List of pages detected by OCR.
  4668. Pages []*GoogleCloudVisionV1p2beta1Page `json:"pages,omitempty"`
  4669. // Text: UTF-8 text detected on the pages.
  4670. Text string `json:"text,omitempty"`
  4671. // ForceSendFields is a list of field names (e.g. "Pages") to
  4672. // unconditionally include in API requests. By default, fields with
  4673. // empty values are omitted from API requests. However, any non-pointer,
  4674. // non-interface field appearing in ForceSendFields will be sent to the
  4675. // server regardless of whether the field is empty or not. This may be
  4676. // used to include empty fields in Patch requests.
  4677. ForceSendFields []string `json:"-"`
  4678. // NullFields is a list of field names (e.g. "Pages") to include in API
  4679. // requests with the JSON null value. By default, fields with empty
  4680. // values are omitted from API requests. However, any field with an
  4681. // empty value appearing in NullFields will be sent to the server as
  4682. // null. It is an error if a field in this list has a non-empty value.
  4683. // This may be used to include null fields in Patch requests.
  4684. NullFields []string `json:"-"`
  4685. }
  4686. func (s *GoogleCloudVisionV1p2beta1TextAnnotation) MarshalJSON() ([]byte, error) {
  4687. type NoMethod GoogleCloudVisionV1p2beta1TextAnnotation
  4688. raw := NoMethod(*s)
  4689. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4690. }
  4691. // GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak: Detected start
  4692. // or end of a structural component.
  4693. type GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak struct {
  4694. // IsPrefix: True if break prepends the element.
  4695. IsPrefix bool `json:"isPrefix,omitempty"`
  4696. // Type: Detected break type.
  4697. //
  4698. // Possible values:
  4699. // "UNKNOWN" - Unknown break label type.
  4700. // "SPACE" - Regular space.
  4701. // "SURE_SPACE" - Sure space (very wide).
  4702. // "EOL_SURE_SPACE" - Line-wrapping break.
  4703. // "HYPHEN" - End-line hyphen that is not present in text; does not
  4704. // co-occur with
  4705. // `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`.
  4706. // "LINE_BREAK" - Line break that ends a paragraph.
  4707. Type string `json:"type,omitempty"`
  4708. // ForceSendFields is a list of field names (e.g. "IsPrefix") to
  4709. // unconditionally include in API requests. By default, fields with
  4710. // empty values are omitted from API requests. However, any non-pointer,
  4711. // non-interface field appearing in ForceSendFields will be sent to the
  4712. // server regardless of whether the field is empty or not. This may be
  4713. // used to include empty fields in Patch requests.
  4714. ForceSendFields []string `json:"-"`
  4715. // NullFields is a list of field names (e.g. "IsPrefix") to include in
  4716. // API requests with the JSON null value. By default, fields with empty
  4717. // values are omitted from API requests. However, any field with an
  4718. // empty value appearing in NullFields will be sent to the server as
  4719. // null. It is an error if a field in this list has a non-empty value.
  4720. // This may be used to include null fields in Patch requests.
  4721. NullFields []string `json:"-"`
  4722. }
  4723. func (s *GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak) MarshalJSON() ([]byte, error) {
  4724. type NoMethod GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak
  4725. raw := NoMethod(*s)
  4726. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4727. }
  4728. // GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage: Detected
  4729. // language for a structural component.
  4730. type GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage struct {
  4731. // Confidence: Confidence of detected language. Range [0, 1].
  4732. Confidence float64 `json:"confidence,omitempty"`
  4733. // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn".
  4734. // For more
  4735. // information,
  4736. // see
  4737. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  4738. LanguageCode string `json:"languageCode,omitempty"`
  4739. // ForceSendFields is a list of field names (e.g. "Confidence") to
  4740. // unconditionally include in API requests. By default, fields with
  4741. // empty values are omitted from API requests. However, any non-pointer,
  4742. // non-interface field appearing in ForceSendFields will be sent to the
  4743. // server regardless of whether the field is empty or not. This may be
  4744. // used to include empty fields in Patch requests.
  4745. ForceSendFields []string `json:"-"`
  4746. // NullFields is a list of field names (e.g. "Confidence") to include in
  4747. // API requests with the JSON null value. By default, fields with empty
  4748. // values are omitted from API requests. However, any field with an
  4749. // empty value appearing in NullFields will be sent to the server as
  4750. // null. It is an error if a field in this list has a non-empty value.
  4751. // This may be used to include null fields in Patch requests.
  4752. NullFields []string `json:"-"`
  4753. }
  4754. func (s *GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage) MarshalJSON() ([]byte, error) {
  4755. type NoMethod GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage
  4756. raw := NoMethod(*s)
  4757. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4758. }
  4759. func (s *GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage) UnmarshalJSON(data []byte) error {
  4760. type NoMethod GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage
  4761. var s1 struct {
  4762. Confidence gensupport.JSONFloat64 `json:"confidence"`
  4763. *NoMethod
  4764. }
  4765. s1.NoMethod = (*NoMethod)(s)
  4766. if err := json.Unmarshal(data, &s1); err != nil {
  4767. return err
  4768. }
  4769. s.Confidence = float64(s1.Confidence)
  4770. return nil
  4771. }
  4772. // GoogleCloudVisionV1p2beta1TextAnnotationTextProperty: Additional
  4773. // information detected on the structural component.
  4774. type GoogleCloudVisionV1p2beta1TextAnnotationTextProperty struct {
  4775. // DetectedBreak: Detected start or end of a text segment.
  4776. DetectedBreak *GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak `json:"detectedBreak,omitempty"`
  4777. // DetectedLanguages: A list of detected languages together with
  4778. // confidence.
  4779. DetectedLanguages []*GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage `json:"detectedLanguages,omitempty"`
  4780. // ForceSendFields is a list of field names (e.g. "DetectedBreak") to
  4781. // unconditionally include in API requests. By default, fields with
  4782. // empty values are omitted from API requests. However, any non-pointer,
  4783. // non-interface field appearing in ForceSendFields will be sent to the
  4784. // server regardless of whether the field is empty or not. This may be
  4785. // used to include empty fields in Patch requests.
  4786. ForceSendFields []string `json:"-"`
  4787. // NullFields is a list of field names (e.g. "DetectedBreak") to include
  4788. // in API requests with the JSON null value. By default, fields with
  4789. // empty values are omitted from API requests. However, any field with
  4790. // an empty value appearing in NullFields will be sent to the server as
  4791. // null. It is an error if a field in this list has a non-empty value.
  4792. // This may be used to include null fields in Patch requests.
  4793. NullFields []string `json:"-"`
  4794. }
  4795. func (s *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty) MarshalJSON() ([]byte, error) {
  4796. type NoMethod GoogleCloudVisionV1p2beta1TextAnnotationTextProperty
  4797. raw := NoMethod(*s)
  4798. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4799. }
  4800. // GoogleCloudVisionV1p2beta1Vertex: A vertex represents a 2D point in
  4801. // the image.
  4802. // NOTE: the vertex coordinates are in the same scale as the original
  4803. // image.
  4804. type GoogleCloudVisionV1p2beta1Vertex struct {
  4805. // X: X coordinate.
  4806. X int64 `json:"x,omitempty"`
  4807. // Y: Y coordinate.
  4808. Y int64 `json:"y,omitempty"`
  4809. // ForceSendFields is a list of field names (e.g. "X") to
  4810. // unconditionally include in API requests. By default, fields with
  4811. // empty values are omitted from API requests. However, any non-pointer,
  4812. // non-interface field appearing in ForceSendFields will be sent to the
  4813. // server regardless of whether the field is empty or not. This may be
  4814. // used to include empty fields in Patch requests.
  4815. ForceSendFields []string `json:"-"`
  4816. // NullFields is a list of field names (e.g. "X") to include in API
  4817. // requests with the JSON null value. By default, fields with empty
  4818. // values are omitted from API requests. However, any field with an
  4819. // empty value appearing in NullFields will be sent to the server as
  4820. // null. It is an error if a field in this list has a non-empty value.
  4821. // This may be used to include null fields in Patch requests.
  4822. NullFields []string `json:"-"`
  4823. }
  4824. func (s *GoogleCloudVisionV1p2beta1Vertex) MarshalJSON() ([]byte, error) {
  4825. type NoMethod GoogleCloudVisionV1p2beta1Vertex
  4826. raw := NoMethod(*s)
  4827. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4828. }
  4829. // GoogleCloudVisionV1p2beta1WebDetection: Relevant information for the
  4830. // image from the Internet.
  4831. type GoogleCloudVisionV1p2beta1WebDetection struct {
  4832. // BestGuessLabels: The service's best guess as to the topic of the
  4833. // request image.
  4834. // Inferred from similar images on the open web.
  4835. BestGuessLabels []*GoogleCloudVisionV1p2beta1WebDetectionWebLabel `json:"bestGuessLabels,omitempty"`
  4836. // FullMatchingImages: Fully matching images from the Internet.
  4837. // Can include resized copies of the query image.
  4838. FullMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"`
  4839. // PagesWithMatchingImages: Web pages containing the matching images
  4840. // from the Internet.
  4841. PagesWithMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebPage `json:"pagesWithMatchingImages,omitempty"`
  4842. // PartialMatchingImages: Partial matching images from the
  4843. // Internet.
  4844. // Those images are similar enough to share some key-point features.
  4845. // For
  4846. // example an original image will likely have partial matching for its
  4847. // crops.
  4848. PartialMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"`
  4849. // VisuallySimilarImages: The visually similar image results.
  4850. VisuallySimilarImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"visuallySimilarImages,omitempty"`
  4851. // WebEntities: Deduced entities from similar images on the Internet.
  4852. WebEntities []*GoogleCloudVisionV1p2beta1WebDetectionWebEntity `json:"webEntities,omitempty"`
  4853. // ForceSendFields is a list of field names (e.g. "BestGuessLabels") to
  4854. // unconditionally include in API requests. By default, fields with
  4855. // empty values are omitted from API requests. However, any non-pointer,
  4856. // non-interface field appearing in ForceSendFields will be sent to the
  4857. // server regardless of whether the field is empty or not. This may be
  4858. // used to include empty fields in Patch requests.
  4859. ForceSendFields []string `json:"-"`
  4860. // NullFields is a list of field names (e.g. "BestGuessLabels") to
  4861. // include in API requests with the JSON null value. By default, fields
  4862. // with empty values are omitted from API requests. However, any field
  4863. // with an empty value appearing in NullFields will be sent to the
  4864. // server as null. It is an error if a field in this list has a
  4865. // non-empty value. This may be used to include null fields in Patch
  4866. // requests.
  4867. NullFields []string `json:"-"`
  4868. }
  4869. func (s *GoogleCloudVisionV1p2beta1WebDetection) MarshalJSON() ([]byte, error) {
  4870. type NoMethod GoogleCloudVisionV1p2beta1WebDetection
  4871. raw := NoMethod(*s)
  4872. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4873. }
  4874. // GoogleCloudVisionV1p2beta1WebDetectionWebEntity: Entity deduced from
  4875. // similar images on the Internet.
  4876. type GoogleCloudVisionV1p2beta1WebDetectionWebEntity struct {
  4877. // Description: Canonical description of the entity, in English.
  4878. Description string `json:"description,omitempty"`
  4879. // EntityId: Opaque entity ID.
  4880. EntityId string `json:"entityId,omitempty"`
  4881. // Score: Overall relevancy score for the entity.
  4882. // Not normalized and not comparable across different image queries.
  4883. Score float64 `json:"score,omitempty"`
  4884. // ForceSendFields is a list of field names (e.g. "Description") to
  4885. // unconditionally include in API requests. By default, fields with
  4886. // empty values are omitted from API requests. However, any non-pointer,
  4887. // non-interface field appearing in ForceSendFields will be sent to the
  4888. // server regardless of whether the field is empty or not. This may be
  4889. // used to include empty fields in Patch requests.
  4890. ForceSendFields []string `json:"-"`
  4891. // NullFields is a list of field names (e.g. "Description") to include
  4892. // in API requests with the JSON null value. By default, fields with
  4893. // empty values are omitted from API requests. However, any field with
  4894. // an empty value appearing in NullFields will be sent to the server as
  4895. // null. It is an error if a field in this list has a non-empty value.
  4896. // This may be used to include null fields in Patch requests.
  4897. NullFields []string `json:"-"`
  4898. }
  4899. func (s *GoogleCloudVisionV1p2beta1WebDetectionWebEntity) MarshalJSON() ([]byte, error) {
  4900. type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebEntity
  4901. raw := NoMethod(*s)
  4902. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4903. }
  4904. func (s *GoogleCloudVisionV1p2beta1WebDetectionWebEntity) UnmarshalJSON(data []byte) error {
  4905. type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebEntity
  4906. var s1 struct {
  4907. Score gensupport.JSONFloat64 `json:"score"`
  4908. *NoMethod
  4909. }
  4910. s1.NoMethod = (*NoMethod)(s)
  4911. if err := json.Unmarshal(data, &s1); err != nil {
  4912. return err
  4913. }
  4914. s.Score = float64(s1.Score)
  4915. return nil
  4916. }
  4917. // GoogleCloudVisionV1p2beta1WebDetectionWebImage: Metadata for online
  4918. // images.
  4919. type GoogleCloudVisionV1p2beta1WebDetectionWebImage struct {
  4920. // Score: (Deprecated) Overall relevancy score for the image.
  4921. Score float64 `json:"score,omitempty"`
  4922. // Url: The result image URL.
  4923. Url string `json:"url,omitempty"`
  4924. // ForceSendFields is a list of field names (e.g. "Score") to
  4925. // unconditionally include in API requests. By default, fields with
  4926. // empty values are omitted from API requests. However, any non-pointer,
  4927. // non-interface field appearing in ForceSendFields will be sent to the
  4928. // server regardless of whether the field is empty or not. This may be
  4929. // used to include empty fields in Patch requests.
  4930. ForceSendFields []string `json:"-"`
  4931. // NullFields is a list of field names (e.g. "Score") to include in API
  4932. // requests with the JSON null value. By default, fields with empty
  4933. // values are omitted from API requests. However, any field with an
  4934. // empty value appearing in NullFields will be sent to the server as
  4935. // null. It is an error if a field in this list has a non-empty value.
  4936. // This may be used to include null fields in Patch requests.
  4937. NullFields []string `json:"-"`
  4938. }
  4939. func (s *GoogleCloudVisionV1p2beta1WebDetectionWebImage) MarshalJSON() ([]byte, error) {
  4940. type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebImage
  4941. raw := NoMethod(*s)
  4942. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4943. }
  4944. func (s *GoogleCloudVisionV1p2beta1WebDetectionWebImage) UnmarshalJSON(data []byte) error {
  4945. type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebImage
  4946. var s1 struct {
  4947. Score gensupport.JSONFloat64 `json:"score"`
  4948. *NoMethod
  4949. }
  4950. s1.NoMethod = (*NoMethod)(s)
  4951. if err := json.Unmarshal(data, &s1); err != nil {
  4952. return err
  4953. }
  4954. s.Score = float64(s1.Score)
  4955. return nil
  4956. }
  4957. // GoogleCloudVisionV1p2beta1WebDetectionWebLabel: Label to provide
  4958. // extra metadata for the web detection.
  4959. type GoogleCloudVisionV1p2beta1WebDetectionWebLabel struct {
  4960. // Label: Label for extra metadata.
  4961. Label string `json:"label,omitempty"`
  4962. // LanguageCode: The BCP-47 language code for `label`, such as "en-US"
  4963. // or "sr-Latn".
  4964. // For more information,
  4965. // see
  4966. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  4967. LanguageCode string `json:"languageCode,omitempty"`
  4968. // ForceSendFields is a list of field names (e.g. "Label") to
  4969. // unconditionally include in API requests. By default, fields with
  4970. // empty values are omitted from API requests. However, any non-pointer,
  4971. // non-interface field appearing in ForceSendFields will be sent to the
  4972. // server regardless of whether the field is empty or not. This may be
  4973. // used to include empty fields in Patch requests.
  4974. ForceSendFields []string `json:"-"`
  4975. // NullFields is a list of field names (e.g. "Label") to include in API
  4976. // requests with the JSON null value. By default, fields with empty
  4977. // values are omitted from API requests. However, any field with an
  4978. // empty value appearing in NullFields will be sent to the server as
  4979. // null. It is an error if a field in this list has a non-empty value.
  4980. // This may be used to include null fields in Patch requests.
  4981. NullFields []string `json:"-"`
  4982. }
  4983. func (s *GoogleCloudVisionV1p2beta1WebDetectionWebLabel) MarshalJSON() ([]byte, error) {
  4984. type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebLabel
  4985. raw := NoMethod(*s)
  4986. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4987. }
  4988. // GoogleCloudVisionV1p2beta1WebDetectionWebPage: Metadata for web
  4989. // pages.
  4990. type GoogleCloudVisionV1p2beta1WebDetectionWebPage struct {
  4991. // FullMatchingImages: Fully matching images on the page.
  4992. // Can include resized copies of the query image.
  4993. FullMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"`
  4994. // PageTitle: Title for the web page, may contain HTML markups.
  4995. PageTitle string `json:"pageTitle,omitempty"`
  4996. // PartialMatchingImages: Partial matching images on the page.
  4997. // Those images are similar enough to share some key-point features.
  4998. // For
  4999. // example an original image will likely have partial matching for
  5000. // its
  5001. // crops.
  5002. PartialMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"`
  5003. // Score: (Deprecated) Overall relevancy score for the web page.
  5004. Score float64 `json:"score,omitempty"`
  5005. // Url: The result web page URL.
  5006. Url string `json:"url,omitempty"`
  5007. // ForceSendFields is a list of field names (e.g. "FullMatchingImages")
  5008. // to unconditionally include in API requests. By default, fields with
  5009. // empty values are omitted from API requests. However, any non-pointer,
  5010. // non-interface field appearing in ForceSendFields will be sent to the
  5011. // server regardless of whether the field is empty or not. This may be
  5012. // used to include empty fields in Patch requests.
  5013. ForceSendFields []string `json:"-"`
  5014. // NullFields is a list of field names (e.g. "FullMatchingImages") to
  5015. // include in API requests with the JSON null value. By default, fields
  5016. // with empty values are omitted from API requests. However, any field
  5017. // with an empty value appearing in NullFields will be sent to the
  5018. // server as null. It is an error if a field in this list has a
  5019. // non-empty value. This may be used to include null fields in Patch
  5020. // requests.
  5021. NullFields []string `json:"-"`
  5022. }
  5023. func (s *GoogleCloudVisionV1p2beta1WebDetectionWebPage) MarshalJSON() ([]byte, error) {
  5024. type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebPage
  5025. raw := NoMethod(*s)
  5026. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5027. }
  5028. func (s *GoogleCloudVisionV1p2beta1WebDetectionWebPage) UnmarshalJSON(data []byte) error {
  5029. type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebPage
  5030. var s1 struct {
  5031. Score gensupport.JSONFloat64 `json:"score"`
  5032. *NoMethod
  5033. }
  5034. s1.NoMethod = (*NoMethod)(s)
  5035. if err := json.Unmarshal(data, &s1); err != nil {
  5036. return err
  5037. }
  5038. s.Score = float64(s1.Score)
  5039. return nil
  5040. }
  5041. // GoogleCloudVisionV1p2beta1Word: A word representation.
  5042. type GoogleCloudVisionV1p2beta1Word struct {
  5043. // BoundingBox: The bounding box for the word.
  5044. // The vertices are in the order of top-left, top-right,
  5045. // bottom-right,
  5046. // bottom-left. When a rotation of the bounding box is detected the
  5047. // rotation
  5048. // is represented as around the top-left corner as defined when the text
  5049. // is
  5050. // read in the 'natural' orientation.
  5051. // For example:
  5052. // * when the text is horizontal it might look like:
  5053. // 0----1
  5054. // | |
  5055. // 3----2
  5056. // * when it's rotated 180 degrees around the top-left corner it
  5057. // becomes:
  5058. // 2----3
  5059. // | |
  5060. // 1----0
  5061. // and the vertice order will still be (0, 1, 2, 3).
  5062. BoundingBox *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingBox,omitempty"`
  5063. // Confidence: Confidence of the OCR results for the word. Range [0, 1].
  5064. Confidence float64 `json:"confidence,omitempty"`
  5065. // Property: Additional information detected for the word.
  5066. Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"`
  5067. // Symbols: List of symbols in the word.
  5068. // The order of the symbols follows the natural reading order.
  5069. Symbols []*GoogleCloudVisionV1p2beta1Symbol `json:"symbols,omitempty"`
  5070. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  5071. // unconditionally include in API requests. By default, fields with
  5072. // empty values are omitted from API requests. However, any non-pointer,
  5073. // non-interface field appearing in ForceSendFields will be sent to the
  5074. // server regardless of whether the field is empty or not. This may be
  5075. // used to include empty fields in Patch requests.
  5076. ForceSendFields []string `json:"-"`
  5077. // NullFields is a list of field names (e.g. "BoundingBox") to include
  5078. // in API requests with the JSON null value. By default, fields with
  5079. // empty values are omitted from API requests. However, any field with
  5080. // an empty value appearing in NullFields will be sent to the server as
  5081. // null. It is an error if a field in this list has a non-empty value.
  5082. // This may be used to include null fields in Patch requests.
  5083. NullFields []string `json:"-"`
  5084. }
  5085. func (s *GoogleCloudVisionV1p2beta1Word) MarshalJSON() ([]byte, error) {
  5086. type NoMethod GoogleCloudVisionV1p2beta1Word
  5087. raw := NoMethod(*s)
  5088. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5089. }
  5090. func (s *GoogleCloudVisionV1p2beta1Word) UnmarshalJSON(data []byte) error {
  5091. type NoMethod GoogleCloudVisionV1p2beta1Word
  5092. var s1 struct {
  5093. Confidence gensupport.JSONFloat64 `json:"confidence"`
  5094. *NoMethod
  5095. }
  5096. s1.NoMethod = (*NoMethod)(s)
  5097. if err := json.Unmarshal(data, &s1); err != nil {
  5098. return err
  5099. }
  5100. s.Confidence = float64(s1.Confidence)
  5101. return nil
  5102. }
  5103. // GoogleCloudVisionV1p3beta1BatchOperationMetadata: Metadata for the
  5104. // batch operations such as the current state.
  5105. //
  5106. // This is included in the `metadata` field of the `Operation` returned
  5107. // by the
  5108. // `GetOperation` call of the `google::longrunning::Operations` service.
  5109. type GoogleCloudVisionV1p3beta1BatchOperationMetadata struct {
  5110. // EndTime: The time when the batch request is finished
  5111. // and
  5112. // google.longrunning.Operation.done is set to true.
  5113. EndTime string `json:"endTime,omitempty"`
  5114. // State: The current state of the batch operation.
  5115. //
  5116. // Possible values:
  5117. // "STATE_UNSPECIFIED" - Invalid.
  5118. // "PROCESSING" - Request is actively being processed.
  5119. // "SUCCESSFUL" - The request is done and at least one item has been
  5120. // successfully
  5121. // processed.
  5122. // "FAILED" - The request is done and no item has been successfully
  5123. // processed.
  5124. // "CANCELLED" - The request is done after the
  5125. // longrunning.Operations.CancelOperation has
  5126. // been called by the user. Any records that were processed before
  5127. // the
  5128. // cancel command are output as specified in the request.
  5129. State string `json:"state,omitempty"`
  5130. // SubmitTime: The time when the batch request was submitted to the
  5131. // server.
  5132. SubmitTime string `json:"submitTime,omitempty"`
  5133. // ForceSendFields is a list of field names (e.g. "EndTime") to
  5134. // unconditionally include in API requests. By default, fields with
  5135. // empty values are omitted from API requests. However, any non-pointer,
  5136. // non-interface field appearing in ForceSendFields will be sent to the
  5137. // server regardless of whether the field is empty or not. This may be
  5138. // used to include empty fields in Patch requests.
  5139. ForceSendFields []string `json:"-"`
  5140. // NullFields is a list of field names (e.g. "EndTime") to include in
  5141. // API requests with the JSON null value. By default, fields with empty
  5142. // values are omitted from API requests. However, any field with an
  5143. // empty value appearing in NullFields will be sent to the server as
  5144. // null. It is an error if a field in this list has a non-empty value.
  5145. // This may be used to include null fields in Patch requests.
  5146. NullFields []string `json:"-"`
  5147. }
  5148. func (s *GoogleCloudVisionV1p3beta1BatchOperationMetadata) MarshalJSON() ([]byte, error) {
  5149. type NoMethod GoogleCloudVisionV1p3beta1BatchOperationMetadata
  5150. raw := NoMethod(*s)
  5151. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5152. }
  5153. // GoogleCloudVisionV1p3beta1BoundingPoly: A bounding polygon for the
  5154. // detected image annotation.
  5155. type GoogleCloudVisionV1p3beta1BoundingPoly struct {
  5156. // NormalizedVertices: The bounding polygon normalized vertices.
  5157. NormalizedVertices []*GoogleCloudVisionV1p3beta1NormalizedVertex `json:"normalizedVertices,omitempty"`
  5158. // Vertices: The bounding polygon vertices.
  5159. Vertices []*GoogleCloudVisionV1p3beta1Vertex `json:"vertices,omitempty"`
  5160. // ForceSendFields is a list of field names (e.g. "NormalizedVertices")
  5161. // to unconditionally include in API requests. By default, fields with
  5162. // empty values are omitted from API requests. However, any non-pointer,
  5163. // non-interface field appearing in ForceSendFields will be sent to the
  5164. // server regardless of whether the field is empty or not. This may be
  5165. // used to include empty fields in Patch requests.
  5166. ForceSendFields []string `json:"-"`
  5167. // NullFields is a list of field names (e.g. "NormalizedVertices") to
  5168. // include in API requests with the JSON null value. By default, fields
  5169. // with empty values are omitted from API requests. However, any field
  5170. // with an empty value appearing in NullFields will be sent to the
  5171. // server as null. It is an error if a field in this list has a
  5172. // non-empty value. This may be used to include null fields in Patch
  5173. // requests.
  5174. NullFields []string `json:"-"`
  5175. }
  5176. func (s *GoogleCloudVisionV1p3beta1BoundingPoly) MarshalJSON() ([]byte, error) {
  5177. type NoMethod GoogleCloudVisionV1p3beta1BoundingPoly
  5178. raw := NoMethod(*s)
  5179. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5180. }
  5181. // GoogleCloudVisionV1p3beta1ImportProductSetsResponse: Response message
  5182. // for the `ImportProductSets` method.
  5183. //
  5184. // This message is returned by
  5185. // the
  5186. // google.longrunning.Operations.GetOperation method in the
  5187. // returned
  5188. // google.longrunning.Operation.response field.
  5189. type GoogleCloudVisionV1p3beta1ImportProductSetsResponse struct {
  5190. // ReferenceImages: The list of reference_images that are imported
  5191. // successfully.
  5192. ReferenceImages []*GoogleCloudVisionV1p3beta1ReferenceImage `json:"referenceImages,omitempty"`
  5193. // Statuses: The rpc status for each ImportProductSet request, including
  5194. // both successes
  5195. // and errors.
  5196. //
  5197. // The number of statuses here matches the number of lines in the csv
  5198. // file,
  5199. // and statuses[i] stores the success or failure status of processing
  5200. // the i-th
  5201. // line of the csv, starting from line 0.
  5202. Statuses []*Status `json:"statuses,omitempty"`
  5203. // ForceSendFields is a list of field names (e.g. "ReferenceImages") to
  5204. // unconditionally include in API requests. By default, fields with
  5205. // empty values are omitted from API requests. However, any non-pointer,
  5206. // non-interface field appearing in ForceSendFields will be sent to the
  5207. // server regardless of whether the field is empty or not. This may be
  5208. // used to include empty fields in Patch requests.
  5209. ForceSendFields []string `json:"-"`
  5210. // NullFields is a list of field names (e.g. "ReferenceImages") to
  5211. // include in API requests with the JSON null value. By default, fields
  5212. // with empty values are omitted from API requests. However, any field
  5213. // with an empty value appearing in NullFields will be sent to the
  5214. // server as null. It is an error if a field in this list has a
  5215. // non-empty value. This may be used to include null fields in Patch
  5216. // requests.
  5217. NullFields []string `json:"-"`
  5218. }
  5219. func (s *GoogleCloudVisionV1p3beta1ImportProductSetsResponse) MarshalJSON() ([]byte, error) {
  5220. type NoMethod GoogleCloudVisionV1p3beta1ImportProductSetsResponse
  5221. raw := NoMethod(*s)
  5222. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5223. }
  5224. // GoogleCloudVisionV1p3beta1NormalizedVertex: A vertex represents a 2D
  5225. // point in the image.
  5226. // NOTE: the normalized vertex coordinates are relative to the original
  5227. // image
  5228. // and range from 0 to 1.
  5229. type GoogleCloudVisionV1p3beta1NormalizedVertex struct {
  5230. // X: X coordinate.
  5231. X float64 `json:"x,omitempty"`
  5232. // Y: Y coordinate.
  5233. Y float64 `json:"y,omitempty"`
  5234. // ForceSendFields is a list of field names (e.g. "X") to
  5235. // unconditionally include in API requests. By default, fields with
  5236. // empty values are omitted from API requests. However, any non-pointer,
  5237. // non-interface field appearing in ForceSendFields will be sent to the
  5238. // server regardless of whether the field is empty or not. This may be
  5239. // used to include empty fields in Patch requests.
  5240. ForceSendFields []string `json:"-"`
  5241. // NullFields is a list of field names (e.g. "X") to include in API
  5242. // requests with the JSON null value. By default, fields with empty
  5243. // values are omitted from API requests. However, any field with an
  5244. // empty value appearing in NullFields will be sent to the server as
  5245. // null. It is an error if a field in this list has a non-empty value.
  5246. // This may be used to include null fields in Patch requests.
  5247. NullFields []string `json:"-"`
  5248. }
  5249. func (s *GoogleCloudVisionV1p3beta1NormalizedVertex) MarshalJSON() ([]byte, error) {
  5250. type NoMethod GoogleCloudVisionV1p3beta1NormalizedVertex
  5251. raw := NoMethod(*s)
  5252. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5253. }
  5254. func (s *GoogleCloudVisionV1p3beta1NormalizedVertex) UnmarshalJSON(data []byte) error {
  5255. type NoMethod GoogleCloudVisionV1p3beta1NormalizedVertex
  5256. var s1 struct {
  5257. X gensupport.JSONFloat64 `json:"x"`
  5258. Y gensupport.JSONFloat64 `json:"y"`
  5259. *NoMethod
  5260. }
  5261. s1.NoMethod = (*NoMethod)(s)
  5262. if err := json.Unmarshal(data, &s1); err != nil {
  5263. return err
  5264. }
  5265. s.X = float64(s1.X)
  5266. s.Y = float64(s1.Y)
  5267. return nil
  5268. }
  5269. // GoogleCloudVisionV1p3beta1ReferenceImage: A `ReferenceImage`
  5270. // represents a product image and its associated metadata,
  5271. // such as bounding boxes.
  5272. type GoogleCloudVisionV1p3beta1ReferenceImage struct {
  5273. // BoundingPolys: Bounding polygons around the areas of interest in the
  5274. // reference image.
  5275. // Optional. If this field is empty, the system will try to detect
  5276. // regions of
  5277. // interest. At most 10 bounding polygons will be used.
  5278. //
  5279. // The provided shape is converted into a non-rotated rectangle.
  5280. // Once
  5281. // converted, the small edge of the rectangle must be greater than or
  5282. // equal
  5283. // to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok;
  5284. // 1:5
  5285. // is not).
  5286. BoundingPolys []*GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPolys,omitempty"`
  5287. // Name: The resource name of the reference image.
  5288. //
  5289. // Format
  5290. // is:
  5291. //
  5292. // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referen
  5293. // ceImages/IMAGE_ID`.
  5294. //
  5295. // This field is ignored when creating a reference image.
  5296. Name string `json:"name,omitempty"`
  5297. // Uri: The Google Cloud Storage URI of the reference image.
  5298. //
  5299. // The URI must start with `gs://`.
  5300. //
  5301. // Required.
  5302. Uri string `json:"uri,omitempty"`
  5303. // ForceSendFields is a list of field names (e.g. "BoundingPolys") to
  5304. // unconditionally include in API requests. By default, fields with
  5305. // empty values are omitted from API requests. However, any non-pointer,
  5306. // non-interface field appearing in ForceSendFields will be sent to the
  5307. // server regardless of whether the field is empty or not. This may be
  5308. // used to include empty fields in Patch requests.
  5309. ForceSendFields []string `json:"-"`
  5310. // NullFields is a list of field names (e.g. "BoundingPolys") to include
  5311. // in API requests with the JSON null value. By default, fields with
  5312. // empty values are omitted from API requests. However, any field with
  5313. // an empty value appearing in NullFields will be sent to the server as
  5314. // null. It is an error if a field in this list has a non-empty value.
  5315. // This may be used to include null fields in Patch requests.
  5316. NullFields []string `json:"-"`
  5317. }
  5318. func (s *GoogleCloudVisionV1p3beta1ReferenceImage) MarshalJSON() ([]byte, error) {
  5319. type NoMethod GoogleCloudVisionV1p3beta1ReferenceImage
  5320. raw := NoMethod(*s)
  5321. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5322. }
  5323. // GoogleCloudVisionV1p3beta1Vertex: A vertex represents a 2D point in
  5324. // the image.
  5325. // NOTE: the vertex coordinates are in the same scale as the original
  5326. // image.
  5327. type GoogleCloudVisionV1p3beta1Vertex struct {
  5328. // X: X coordinate.
  5329. X int64 `json:"x,omitempty"`
  5330. // Y: Y coordinate.
  5331. Y int64 `json:"y,omitempty"`
  5332. // ForceSendFields is a list of field names (e.g. "X") to
  5333. // unconditionally include in API requests. By default, fields with
  5334. // empty values are omitted from API requests. However, any non-pointer,
  5335. // non-interface field appearing in ForceSendFields will be sent to the
  5336. // server regardless of whether the field is empty or not. This may be
  5337. // used to include empty fields in Patch requests.
  5338. ForceSendFields []string `json:"-"`
  5339. // NullFields is a list of field names (e.g. "X") to include in API
  5340. // requests with the JSON null value. By default, fields with empty
  5341. // values are omitted from API requests. However, any field with an
  5342. // empty value appearing in NullFields will be sent to the server as
  5343. // null. It is an error if a field in this list has a non-empty value.
  5344. // This may be used to include null fields in Patch requests.
  5345. NullFields []string `json:"-"`
  5346. }
  5347. func (s *GoogleCloudVisionV1p3beta1Vertex) MarshalJSON() ([]byte, error) {
  5348. type NoMethod GoogleCloudVisionV1p3beta1Vertex
  5349. raw := NoMethod(*s)
  5350. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5351. }
  5352. // ImageAnnotationContext: If an image was produced from a file (e.g. a
  5353. // PDF), this message gives
  5354. // information about the source of that image.
  5355. type ImageAnnotationContext struct {
  5356. // PageNumber: If the file was a PDF or TIFF, this field gives the page
  5357. // number within
  5358. // the file used to produce the image.
  5359. PageNumber int64 `json:"pageNumber,omitempty"`
  5360. // Uri: The URI of the file used to produce the image.
  5361. Uri string `json:"uri,omitempty"`
  5362. // ForceSendFields is a list of field names (e.g. "PageNumber") to
  5363. // unconditionally include in API requests. By default, fields with
  5364. // empty values are omitted from API requests. However, any non-pointer,
  5365. // non-interface field appearing in ForceSendFields will be sent to the
  5366. // server regardless of whether the field is empty or not. This may be
  5367. // used to include empty fields in Patch requests.
  5368. ForceSendFields []string `json:"-"`
  5369. // NullFields is a list of field names (e.g. "PageNumber") to include in
  5370. // API requests with the JSON null value. By default, fields with empty
  5371. // values are omitted from API requests. However, any field with an
  5372. // empty value appearing in NullFields will be sent to the server as
  5373. // null. It is an error if a field in this list has a non-empty value.
  5374. // This may be used to include null fields in Patch requests.
  5375. NullFields []string `json:"-"`
  5376. }
  5377. func (s *ImageAnnotationContext) MarshalJSON() ([]byte, error) {
  5378. type NoMethod ImageAnnotationContext
  5379. raw := NoMethod(*s)
  5380. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5381. }
  5382. // ImageProperties: Stores image properties, such as dominant colors.
  5383. type ImageProperties struct {
  5384. // DominantColors: If present, dominant colors completed successfully.
  5385. DominantColors *DominantColorsAnnotation `json:"dominantColors,omitempty"`
  5386. // ForceSendFields is a list of field names (e.g. "DominantColors") to
  5387. // unconditionally include in API requests. By default, fields with
  5388. // empty values are omitted from API requests. However, any non-pointer,
  5389. // non-interface field appearing in ForceSendFields will be sent to the
  5390. // server regardless of whether the field is empty or not. This may be
  5391. // used to include empty fields in Patch requests.
  5392. ForceSendFields []string `json:"-"`
  5393. // NullFields is a list of field names (e.g. "DominantColors") to
  5394. // include in API requests with the JSON null value. By default, fields
  5395. // with empty values are omitted from API requests. However, any field
  5396. // with an empty value appearing in NullFields will be sent to the
  5397. // server as null. It is an error if a field in this list has a
  5398. // non-empty value. This may be used to include null fields in Patch
  5399. // requests.
  5400. NullFields []string `json:"-"`
  5401. }
  5402. func (s *ImageProperties) MarshalJSON() ([]byte, error) {
  5403. type NoMethod ImageProperties
  5404. raw := NoMethod(*s)
  5405. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5406. }
  5407. // InputConfig: The desired input location and metadata.
  5408. type InputConfig struct {
  5409. // GcsSource: The Google Cloud Storage location to read the input from.
  5410. GcsSource *GcsSource `json:"gcsSource,omitempty"`
  5411. // MimeType: The type of the file. Currently only "application/pdf" and
  5412. // "image/tiff"
  5413. // are supported. Wildcards are not supported.
  5414. MimeType string `json:"mimeType,omitempty"`
  5415. // ForceSendFields is a list of field names (e.g. "GcsSource") to
  5416. // unconditionally include in API requests. By default, fields with
  5417. // empty values are omitted from API requests. However, any non-pointer,
  5418. // non-interface field appearing in ForceSendFields will be sent to the
  5419. // server regardless of whether the field is empty or not. This may be
  5420. // used to include empty fields in Patch requests.
  5421. ForceSendFields []string `json:"-"`
  5422. // NullFields is a list of field names (e.g. "GcsSource") to include in
  5423. // API requests with the JSON null value. By default, fields with empty
  5424. // values are omitted from API requests. However, any field with an
  5425. // empty value appearing in NullFields will be sent to the server as
  5426. // null. It is an error if a field in this list has a non-empty value.
  5427. // This may be used to include null fields in Patch requests.
  5428. NullFields []string `json:"-"`
  5429. }
  5430. func (s *InputConfig) MarshalJSON() ([]byte, error) {
  5431. type NoMethod InputConfig
  5432. raw := NoMethod(*s)
  5433. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5434. }
  5435. // Landmark: A face-specific landmark (for example, a face feature).
  5436. type Landmark struct {
  5437. // Position: Face landmark position.
  5438. Position *Position `json:"position,omitempty"`
  5439. // Type: Face landmark type.
  5440. //
  5441. // Possible values:
  5442. // "UNKNOWN_LANDMARK" - Unknown face landmark detected. Should not be
  5443. // filled.
  5444. // "LEFT_EYE" - Left eye.
  5445. // "RIGHT_EYE" - Right eye.
  5446. // "LEFT_OF_LEFT_EYEBROW" - Left of left eyebrow.
  5447. // "RIGHT_OF_LEFT_EYEBROW" - Right of left eyebrow.
  5448. // "LEFT_OF_RIGHT_EYEBROW" - Left of right eyebrow.
  5449. // "RIGHT_OF_RIGHT_EYEBROW" - Right of right eyebrow.
  5450. // "MIDPOINT_BETWEEN_EYES" - Midpoint between eyes.
  5451. // "NOSE_TIP" - Nose tip.
  5452. // "UPPER_LIP" - Upper lip.
  5453. // "LOWER_LIP" - Lower lip.
  5454. // "MOUTH_LEFT" - Mouth left.
  5455. // "MOUTH_RIGHT" - Mouth right.
  5456. // "MOUTH_CENTER" - Mouth center.
  5457. // "NOSE_BOTTOM_RIGHT" - Nose, bottom right.
  5458. // "NOSE_BOTTOM_LEFT" - Nose, bottom left.
  5459. // "NOSE_BOTTOM_CENTER" - Nose, bottom center.
  5460. // "LEFT_EYE_TOP_BOUNDARY" - Left eye, top boundary.
  5461. // "LEFT_EYE_RIGHT_CORNER" - Left eye, right corner.
  5462. // "LEFT_EYE_BOTTOM_BOUNDARY" - Left eye, bottom boundary.
  5463. // "LEFT_EYE_LEFT_CORNER" - Left eye, left corner.
  5464. // "RIGHT_EYE_TOP_BOUNDARY" - Right eye, top boundary.
  5465. // "RIGHT_EYE_RIGHT_CORNER" - Right eye, right corner.
  5466. // "RIGHT_EYE_BOTTOM_BOUNDARY" - Right eye, bottom boundary.
  5467. // "RIGHT_EYE_LEFT_CORNER" - Right eye, left corner.
  5468. // "LEFT_EYEBROW_UPPER_MIDPOINT" - Left eyebrow, upper midpoint.
  5469. // "RIGHT_EYEBROW_UPPER_MIDPOINT" - Right eyebrow, upper midpoint.
  5470. // "LEFT_EAR_TRAGION" - Left ear tragion.
  5471. // "RIGHT_EAR_TRAGION" - Right ear tragion.
  5472. // "LEFT_EYE_PUPIL" - Left eye pupil.
  5473. // "RIGHT_EYE_PUPIL" - Right eye pupil.
  5474. // "FOREHEAD_GLABELLA" - Forehead glabella.
  5475. // "CHIN_GNATHION" - Chin gnathion.
  5476. // "CHIN_LEFT_GONION" - Chin left gonion.
  5477. // "CHIN_RIGHT_GONION" - Chin right gonion.
  5478. Type string `json:"type,omitempty"`
  5479. // ForceSendFields is a list of field names (e.g. "Position") to
  5480. // unconditionally include in API requests. By default, fields with
  5481. // empty values are omitted from API requests. However, any non-pointer,
  5482. // non-interface field appearing in ForceSendFields will be sent to the
  5483. // server regardless of whether the field is empty or not. This may be
  5484. // used to include empty fields in Patch requests.
  5485. ForceSendFields []string `json:"-"`
  5486. // NullFields is a list of field names (e.g. "Position") to include in
  5487. // API requests with the JSON null value. By default, fields with empty
  5488. // values are omitted from API requests. However, any field with an
  5489. // empty value appearing in NullFields will be sent to the server as
  5490. // null. It is an error if a field in this list has a non-empty value.
  5491. // This may be used to include null fields in Patch requests.
  5492. NullFields []string `json:"-"`
  5493. }
  5494. func (s *Landmark) MarshalJSON() ([]byte, error) {
  5495. type NoMethod Landmark
  5496. raw := NoMethod(*s)
  5497. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5498. }
  5499. // LatLng: An object representing a latitude/longitude pair. This is
  5500. // expressed as a pair
  5501. // of doubles representing degrees latitude and degrees longitude.
  5502. // Unless
  5503. // specified otherwise, this must conform to the
  5504. // <a
  5505. // href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
  5506. // st
  5507. // andard</a>. Values must be within normalized ranges.
  5508. type LatLng struct {
  5509. // Latitude: The latitude in degrees. It must be in the range [-90.0,
  5510. // +90.0].
  5511. Latitude float64 `json:"latitude,omitempty"`
  5512. // Longitude: The longitude in degrees. It must be in the range [-180.0,
  5513. // +180.0].
  5514. Longitude float64 `json:"longitude,omitempty"`
  5515. // ForceSendFields is a list of field names (e.g. "Latitude") to
  5516. // unconditionally include in API requests. By default, fields with
  5517. // empty values are omitted from API requests. However, any non-pointer,
  5518. // non-interface field appearing in ForceSendFields will be sent to the
  5519. // server regardless of whether the field is empty or not. This may be
  5520. // used to include empty fields in Patch requests.
  5521. ForceSendFields []string `json:"-"`
  5522. // NullFields is a list of field names (e.g. "Latitude") to include in
  5523. // API requests with the JSON null value. By default, fields with empty
  5524. // values are omitted from API requests. However, any field with an
  5525. // empty value appearing in NullFields will be sent to the server as
  5526. // null. It is an error if a field in this list has a non-empty value.
  5527. // This may be used to include null fields in Patch requests.
  5528. NullFields []string `json:"-"`
  5529. }
  5530. func (s *LatLng) MarshalJSON() ([]byte, error) {
  5531. type NoMethod LatLng
  5532. raw := NoMethod(*s)
  5533. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5534. }
  5535. func (s *LatLng) UnmarshalJSON(data []byte) error {
  5536. type NoMethod LatLng
  5537. var s1 struct {
  5538. Latitude gensupport.JSONFloat64 `json:"latitude"`
  5539. Longitude gensupport.JSONFloat64 `json:"longitude"`
  5540. *NoMethod
  5541. }
  5542. s1.NoMethod = (*NoMethod)(s)
  5543. if err := json.Unmarshal(data, &s1); err != nil {
  5544. return err
  5545. }
  5546. s.Latitude = float64(s1.Latitude)
  5547. s.Longitude = float64(s1.Longitude)
  5548. return nil
  5549. }
  5550. // LocationInfo: Detected entity location information.
  5551. type LocationInfo struct {
  5552. // LatLng: lat/long location coordinates.
  5553. LatLng *LatLng `json:"latLng,omitempty"`
  5554. // ForceSendFields is a list of field names (e.g. "LatLng") to
  5555. // unconditionally include in API requests. By default, fields with
  5556. // empty values are omitted from API requests. However, any non-pointer,
  5557. // non-interface field appearing in ForceSendFields will be sent to the
  5558. // server regardless of whether the field is empty or not. This may be
  5559. // used to include empty fields in Patch requests.
  5560. ForceSendFields []string `json:"-"`
  5561. // NullFields is a list of field names (e.g. "LatLng") to include in API
  5562. // requests with the JSON null value. By default, fields with empty
  5563. // values are omitted from API requests. However, any field with an
  5564. // empty value appearing in NullFields will be sent to the server as
  5565. // null. It is an error if a field in this list has a non-empty value.
  5566. // This may be used to include null fields in Patch requests.
  5567. NullFields []string `json:"-"`
  5568. }
  5569. func (s *LocationInfo) MarshalJSON() ([]byte, error) {
  5570. type NoMethod LocationInfo
  5571. raw := NoMethod(*s)
  5572. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5573. }
  5574. // NormalizedVertex: A vertex represents a 2D point in the image.
  5575. // NOTE: the normalized vertex coordinates are relative to the original
  5576. // image
  5577. // and range from 0 to 1.
  5578. type NormalizedVertex struct {
  5579. // X: X coordinate.
  5580. X float64 `json:"x,omitempty"`
  5581. // Y: Y coordinate.
  5582. Y float64 `json:"y,omitempty"`
  5583. // ForceSendFields is a list of field names (e.g. "X") to
  5584. // unconditionally include in API requests. By default, fields with
  5585. // empty values are omitted from API requests. However, any non-pointer,
  5586. // non-interface field appearing in ForceSendFields will be sent to the
  5587. // server regardless of whether the field is empty or not. This may be
  5588. // used to include empty fields in Patch requests.
  5589. ForceSendFields []string `json:"-"`
  5590. // NullFields is a list of field names (e.g. "X") to include in API
  5591. // requests with the JSON null value. By default, fields with empty
  5592. // values are omitted from API requests. However, any field with an
  5593. // empty value appearing in NullFields will be sent to the server as
  5594. // null. It is an error if a field in this list has a non-empty value.
  5595. // This may be used to include null fields in Patch requests.
  5596. NullFields []string `json:"-"`
  5597. }
  5598. func (s *NormalizedVertex) MarshalJSON() ([]byte, error) {
  5599. type NoMethod NormalizedVertex
  5600. raw := NoMethod(*s)
  5601. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5602. }
  5603. func (s *NormalizedVertex) UnmarshalJSON(data []byte) error {
  5604. type NoMethod NormalizedVertex
  5605. var s1 struct {
  5606. X gensupport.JSONFloat64 `json:"x"`
  5607. Y gensupport.JSONFloat64 `json:"y"`
  5608. *NoMethod
  5609. }
  5610. s1.NoMethod = (*NoMethod)(s)
  5611. if err := json.Unmarshal(data, &s1); err != nil {
  5612. return err
  5613. }
  5614. s.X = float64(s1.X)
  5615. s.Y = float64(s1.Y)
  5616. return nil
  5617. }
  5618. // Operation: This resource represents a long-running operation that is
  5619. // the result of a
  5620. // network API call.
  5621. type Operation struct {
  5622. // Done: If the value is `false`, it means the operation is still in
  5623. // progress.
  5624. // If `true`, the operation is completed, and either `error` or
  5625. // `response` is
  5626. // available.
  5627. Done bool `json:"done,omitempty"`
  5628. // Error: The error result of the operation in case of failure or
  5629. // cancellation.
  5630. Error *Status `json:"error,omitempty"`
  5631. // Metadata: Service-specific metadata associated with the operation.
  5632. // It typically
  5633. // contains progress information and common metadata such as create
  5634. // time.
  5635. // Some services might not provide such metadata. Any method that
  5636. // returns a
  5637. // long-running operation should document the metadata type, if any.
  5638. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  5639. // Name: The server-assigned name, which is only unique within the same
  5640. // service that
  5641. // originally returns it. If you use the default HTTP mapping,
  5642. // the
  5643. // `name` should have the format of `operations/some/unique/name`.
  5644. Name string `json:"name,omitempty"`
  5645. // Response: The normal response of the operation in case of success.
  5646. // If the original
  5647. // method returns no data on success, such as `Delete`, the response
  5648. // is
  5649. // `google.protobuf.Empty`. If the original method is
  5650. // standard
  5651. // `Get`/`Create`/`Update`, the response should be the resource. For
  5652. // other
  5653. // methods, the response should have the type `XxxResponse`, where
  5654. // `Xxx`
  5655. // is the original method name. For example, if the original method
  5656. // name
  5657. // is `TakeSnapshot()`, the inferred response type
  5658. // is
  5659. // `TakeSnapshotResponse`.
  5660. Response googleapi.RawMessage `json:"response,omitempty"`
  5661. // ServerResponse contains the HTTP response code and headers from the
  5662. // server.
  5663. googleapi.ServerResponse `json:"-"`
  5664. // ForceSendFields is a list of field names (e.g. "Done") to
  5665. // unconditionally include in API requests. By default, fields with
  5666. // empty values are omitted from API requests. However, any non-pointer,
  5667. // non-interface field appearing in ForceSendFields will be sent to the
  5668. // server regardless of whether the field is empty or not. This may be
  5669. // used to include empty fields in Patch requests.
  5670. ForceSendFields []string `json:"-"`
  5671. // NullFields is a list of field names (e.g. "Done") to include in API
  5672. // requests with the JSON null value. By default, fields with empty
  5673. // values are omitted from API requests. However, any field with an
  5674. // empty value appearing in NullFields will be sent to the server as
  5675. // null. It is an error if a field in this list has a non-empty value.
  5676. // This may be used to include null fields in Patch requests.
  5677. NullFields []string `json:"-"`
  5678. }
  5679. func (s *Operation) MarshalJSON() ([]byte, error) {
  5680. type NoMethod Operation
  5681. raw := NoMethod(*s)
  5682. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5683. }
  5684. // OperationMetadata: Contains metadata for the BatchAnnotateImages
  5685. // operation.
  5686. type OperationMetadata struct {
  5687. // CreateTime: The time when the batch request was received.
  5688. CreateTime string `json:"createTime,omitempty"`
  5689. // State: Current state of the batch operation.
  5690. //
  5691. // Possible values:
  5692. // "STATE_UNSPECIFIED" - Invalid.
  5693. // "CREATED" - Request is received.
  5694. // "RUNNING" - Request is actively being processed.
  5695. // "DONE" - The batch processing is done.
  5696. // "CANCELLED" - The batch processing was cancelled.
  5697. State string `json:"state,omitempty"`
  5698. // UpdateTime: The time when the operation result was last updated.
  5699. UpdateTime string `json:"updateTime,omitempty"`
  5700. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  5701. // unconditionally include in API requests. By default, fields with
  5702. // empty values are omitted from API requests. However, any non-pointer,
  5703. // non-interface field appearing in ForceSendFields will be sent to the
  5704. // server regardless of whether the field is empty or not. This may be
  5705. // used to include empty fields in Patch requests.
  5706. ForceSendFields []string `json:"-"`
  5707. // NullFields is a list of field names (e.g. "CreateTime") to include in
  5708. // API requests with the JSON null value. By default, fields with empty
  5709. // values are omitted from API requests. However, any field with an
  5710. // empty value appearing in NullFields will be sent to the server as
  5711. // null. It is an error if a field in this list has a non-empty value.
  5712. // This may be used to include null fields in Patch requests.
  5713. NullFields []string `json:"-"`
  5714. }
  5715. func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
  5716. type NoMethod OperationMetadata
  5717. raw := NoMethod(*s)
  5718. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5719. }
  5720. // OutputConfig: The desired output location and metadata.
  5721. type OutputConfig struct {
  5722. // BatchSize: The max number of response protos to put into each output
  5723. // JSON file on
  5724. // Google Cloud Storage.
  5725. // The valid range is [1, 100]. If not specified, the default value is
  5726. // 20.
  5727. //
  5728. // For example, for one pdf file with 100 pages, 100 response protos
  5729. // will
  5730. // be generated. If `batch_size` = 20, then 5 json files each
  5731. // containing 20 response protos will be written under the
  5732. // prefix
  5733. // `gcs_destination`.`uri`.
  5734. //
  5735. // Currently, batch_size only applies to GcsDestination, with potential
  5736. // future
  5737. // support for other output configurations.
  5738. BatchSize int64 `json:"batchSize,omitempty"`
  5739. // GcsDestination: The Google Cloud Storage location to write the
  5740. // output(s) to.
  5741. GcsDestination *GcsDestination `json:"gcsDestination,omitempty"`
  5742. // ForceSendFields is a list of field names (e.g. "BatchSize") to
  5743. // unconditionally include in API requests. By default, fields with
  5744. // empty values are omitted from API requests. However, any non-pointer,
  5745. // non-interface field appearing in ForceSendFields will be sent to the
  5746. // server regardless of whether the field is empty or not. This may be
  5747. // used to include empty fields in Patch requests.
  5748. ForceSendFields []string `json:"-"`
  5749. // NullFields is a list of field names (e.g. "BatchSize") to include in
  5750. // API requests with the JSON null value. By default, fields with empty
  5751. // values are omitted from API requests. However, any field with an
  5752. // empty value appearing in NullFields will be sent to the server as
  5753. // null. It is an error if a field in this list has a non-empty value.
  5754. // This may be used to include null fields in Patch requests.
  5755. NullFields []string `json:"-"`
  5756. }
  5757. func (s *OutputConfig) MarshalJSON() ([]byte, error) {
  5758. type NoMethod OutputConfig
  5759. raw := NoMethod(*s)
  5760. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5761. }
  5762. // Page: Detected page from OCR.
  5763. type Page struct {
  5764. // Blocks: List of blocks of text, images etc on this page.
  5765. Blocks []*Block `json:"blocks,omitempty"`
  5766. // Confidence: Confidence of the OCR results on the page. Range [0, 1].
  5767. Confidence float64 `json:"confidence,omitempty"`
  5768. // Height: Page height. For PDFs the unit is points. For images
  5769. // (including
  5770. // TIFFs) the unit is pixels.
  5771. Height int64 `json:"height,omitempty"`
  5772. // Property: Additional information detected on the page.
  5773. Property *TextProperty `json:"property,omitempty"`
  5774. // Width: Page width. For PDFs the unit is points. For images
  5775. // (including
  5776. // TIFFs) the unit is pixels.
  5777. Width int64 `json:"width,omitempty"`
  5778. // ForceSendFields is a list of field names (e.g. "Blocks") to
  5779. // unconditionally include in API requests. By default, fields with
  5780. // empty values are omitted from API requests. However, any non-pointer,
  5781. // non-interface field appearing in ForceSendFields will be sent to the
  5782. // server regardless of whether the field is empty or not. This may be
  5783. // used to include empty fields in Patch requests.
  5784. ForceSendFields []string `json:"-"`
  5785. // NullFields is a list of field names (e.g. "Blocks") to include in API
  5786. // requests with the JSON null value. By default, fields with empty
  5787. // values are omitted from API requests. However, any field with an
  5788. // empty value appearing in NullFields will be sent to the server as
  5789. // null. It is an error if a field in this list has a non-empty value.
  5790. // This may be used to include null fields in Patch requests.
  5791. NullFields []string `json:"-"`
  5792. }
  5793. func (s *Page) MarshalJSON() ([]byte, error) {
  5794. type NoMethod Page
  5795. raw := NoMethod(*s)
  5796. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5797. }
  5798. func (s *Page) UnmarshalJSON(data []byte) error {
  5799. type NoMethod Page
  5800. var s1 struct {
  5801. Confidence gensupport.JSONFloat64 `json:"confidence"`
  5802. *NoMethod
  5803. }
  5804. s1.NoMethod = (*NoMethod)(s)
  5805. if err := json.Unmarshal(data, &s1); err != nil {
  5806. return err
  5807. }
  5808. s.Confidence = float64(s1.Confidence)
  5809. return nil
  5810. }
  5811. // Paragraph: Structural unit of text representing a number of words in
  5812. // certain order.
  5813. type Paragraph struct {
  5814. // BoundingBox: The bounding box for the paragraph.
  5815. // The vertices are in the order of top-left, top-right,
  5816. // bottom-right,
  5817. // bottom-left. When a rotation of the bounding box is detected the
  5818. // rotation
  5819. // is represented as around the top-left corner as defined when the text
  5820. // is
  5821. // read in the 'natural' orientation.
  5822. // For example:
  5823. // * when the text is horizontal it might look like:
  5824. // 0----1
  5825. // | |
  5826. // 3----2
  5827. // * when it's rotated 180 degrees around the top-left corner it
  5828. // becomes:
  5829. // 2----3
  5830. // | |
  5831. // 1----0
  5832. // and the vertice order will still be (0, 1, 2, 3).
  5833. BoundingBox *BoundingPoly `json:"boundingBox,omitempty"`
  5834. // Confidence: Confidence of the OCR results for the paragraph. Range
  5835. // [0, 1].
  5836. Confidence float64 `json:"confidence,omitempty"`
  5837. // Property: Additional information detected for the paragraph.
  5838. Property *TextProperty `json:"property,omitempty"`
  5839. // Words: List of words in this paragraph.
  5840. Words []*Word `json:"words,omitempty"`
  5841. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  5842. // unconditionally include in API requests. By default, fields with
  5843. // empty values are omitted from API requests. However, any non-pointer,
  5844. // non-interface field appearing in ForceSendFields will be sent to the
  5845. // server regardless of whether the field is empty or not. This may be
  5846. // used to include empty fields in Patch requests.
  5847. ForceSendFields []string `json:"-"`
  5848. // NullFields is a list of field names (e.g. "BoundingBox") to include
  5849. // in API requests with the JSON null value. By default, fields with
  5850. // empty values are omitted from API requests. However, any field with
  5851. // an empty value appearing in NullFields will be sent to the server as
  5852. // null. It is an error if a field in this list has a non-empty value.
  5853. // This may be used to include null fields in Patch requests.
  5854. NullFields []string `json:"-"`
  5855. }
  5856. func (s *Paragraph) MarshalJSON() ([]byte, error) {
  5857. type NoMethod Paragraph
  5858. raw := NoMethod(*s)
  5859. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5860. }
  5861. func (s *Paragraph) UnmarshalJSON(data []byte) error {
  5862. type NoMethod Paragraph
  5863. var s1 struct {
  5864. Confidence gensupport.JSONFloat64 `json:"confidence"`
  5865. *NoMethod
  5866. }
  5867. s1.NoMethod = (*NoMethod)(s)
  5868. if err := json.Unmarshal(data, &s1); err != nil {
  5869. return err
  5870. }
  5871. s.Confidence = float64(s1.Confidence)
  5872. return nil
  5873. }
  5874. // Position: A 3D position in the image, used primarily for Face
  5875. // detection landmarks.
  5876. // A valid Position must have both x and y coordinates.
  5877. // The position coordinates are in the same scale as the original image.
  5878. type Position struct {
  5879. // X: X coordinate.
  5880. X float64 `json:"x,omitempty"`
  5881. // Y: Y coordinate.
  5882. Y float64 `json:"y,omitempty"`
  5883. // Z: Z coordinate (or depth).
  5884. Z float64 `json:"z,omitempty"`
  5885. // ForceSendFields is a list of field names (e.g. "X") to
  5886. // unconditionally include in API requests. By default, fields with
  5887. // empty values are omitted from API requests. However, any non-pointer,
  5888. // non-interface field appearing in ForceSendFields will be sent to the
  5889. // server regardless of whether the field is empty or not. This may be
  5890. // used to include empty fields in Patch requests.
  5891. ForceSendFields []string `json:"-"`
  5892. // NullFields is a list of field names (e.g. "X") to include in API
  5893. // requests with the JSON null value. By default, fields with empty
  5894. // values are omitted from API requests. However, any field with an
  5895. // empty value appearing in NullFields will be sent to the server as
  5896. // null. It is an error if a field in this list has a non-empty value.
  5897. // This may be used to include null fields in Patch requests.
  5898. NullFields []string `json:"-"`
  5899. }
  5900. func (s *Position) MarshalJSON() ([]byte, error) {
  5901. type NoMethod Position
  5902. raw := NoMethod(*s)
  5903. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5904. }
  5905. func (s *Position) UnmarshalJSON(data []byte) error {
  5906. type NoMethod Position
  5907. var s1 struct {
  5908. X gensupport.JSONFloat64 `json:"x"`
  5909. Y gensupport.JSONFloat64 `json:"y"`
  5910. Z gensupport.JSONFloat64 `json:"z"`
  5911. *NoMethod
  5912. }
  5913. s1.NoMethod = (*NoMethod)(s)
  5914. if err := json.Unmarshal(data, &s1); err != nil {
  5915. return err
  5916. }
  5917. s.X = float64(s1.X)
  5918. s.Y = float64(s1.Y)
  5919. s.Z = float64(s1.Z)
  5920. return nil
  5921. }
  5922. // Property: A `Property` consists of a user-supplied name/value pair.
  5923. type Property struct {
  5924. // Name: Name of the property.
  5925. Name string `json:"name,omitempty"`
  5926. // Uint64Value: Value of numeric properties.
  5927. Uint64Value uint64 `json:"uint64Value,omitempty,string"`
  5928. // Value: Value of the property.
  5929. Value string `json:"value,omitempty"`
  5930. // ForceSendFields is a list of field names (e.g. "Name") to
  5931. // unconditionally include in API requests. By default, fields with
  5932. // empty values are omitted from API requests. However, any non-pointer,
  5933. // non-interface field appearing in ForceSendFields will be sent to the
  5934. // server regardless of whether the field is empty or not. This may be
  5935. // used to include empty fields in Patch requests.
  5936. ForceSendFields []string `json:"-"`
  5937. // NullFields is a list of field names (e.g. "Name") to include in API
  5938. // requests with the JSON null value. By default, fields with empty
  5939. // values are omitted from API requests. However, any field with an
  5940. // empty value appearing in NullFields will be sent to the server as
  5941. // null. It is an error if a field in this list has a non-empty value.
  5942. // This may be used to include null fields in Patch requests.
  5943. NullFields []string `json:"-"`
  5944. }
  5945. func (s *Property) MarshalJSON() ([]byte, error) {
  5946. type NoMethod Property
  5947. raw := NoMethod(*s)
  5948. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5949. }
  5950. // SafeSearchAnnotation: Set of features pertaining to the image,
  5951. // computed by computer vision
  5952. // methods over safe-search verticals (for example, adult, spoof,
  5953. // medical,
  5954. // violence).
  5955. type SafeSearchAnnotation struct {
  5956. // Adult: Represents the adult content likelihood for the image. Adult
  5957. // content may
  5958. // contain elements such as nudity, pornographic images or cartoons,
  5959. // or
  5960. // sexual activities.
  5961. //
  5962. // Possible values:
  5963. // "UNKNOWN" - Unknown likelihood.
  5964. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  5965. // specified vertical.
  5966. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  5967. // vertical.
  5968. // "POSSIBLE" - It is possible that the image belongs to the specified
  5969. // vertical.
  5970. // "LIKELY" - It is likely that the image belongs to the specified
  5971. // vertical.
  5972. // "VERY_LIKELY" - It is very likely that the image belongs to the
  5973. // specified vertical.
  5974. Adult string `json:"adult,omitempty"`
  5975. // Medical: Likelihood that this is a medical image.
  5976. //
  5977. // Possible values:
  5978. // "UNKNOWN" - Unknown likelihood.
  5979. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  5980. // specified vertical.
  5981. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  5982. // vertical.
  5983. // "POSSIBLE" - It is possible that the image belongs to the specified
  5984. // vertical.
  5985. // "LIKELY" - It is likely that the image belongs to the specified
  5986. // vertical.
  5987. // "VERY_LIKELY" - It is very likely that the image belongs to the
  5988. // specified vertical.
  5989. Medical string `json:"medical,omitempty"`
  5990. // Racy: Likelihood that the request image contains racy content. Racy
  5991. // content may
  5992. // include (but is not limited to) skimpy or sheer clothing,
  5993. // strategically
  5994. // covered nudity, lewd or provocative poses, or close-ups of
  5995. // sensitive
  5996. // body areas.
  5997. //
  5998. // Possible values:
  5999. // "UNKNOWN" - Unknown likelihood.
  6000. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  6001. // specified vertical.
  6002. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  6003. // vertical.
  6004. // "POSSIBLE" - It is possible that the image belongs to the specified
  6005. // vertical.
  6006. // "LIKELY" - It is likely that the image belongs to the specified
  6007. // vertical.
  6008. // "VERY_LIKELY" - It is very likely that the image belongs to the
  6009. // specified vertical.
  6010. Racy string `json:"racy,omitempty"`
  6011. // Spoof: Spoof likelihood. The likelihood that an modification
  6012. // was made to the image's canonical version to make it appear
  6013. // funny or offensive.
  6014. //
  6015. // Possible values:
  6016. // "UNKNOWN" - Unknown likelihood.
  6017. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  6018. // specified vertical.
  6019. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  6020. // vertical.
  6021. // "POSSIBLE" - It is possible that the image belongs to the specified
  6022. // vertical.
  6023. // "LIKELY" - It is likely that the image belongs to the specified
  6024. // vertical.
  6025. // "VERY_LIKELY" - It is very likely that the image belongs to the
  6026. // specified vertical.
  6027. Spoof string `json:"spoof,omitempty"`
  6028. // Violence: Likelihood that this image contains violent content.
  6029. //
  6030. // Possible values:
  6031. // "UNKNOWN" - Unknown likelihood.
  6032. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  6033. // specified vertical.
  6034. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  6035. // vertical.
  6036. // "POSSIBLE" - It is possible that the image belongs to the specified
  6037. // vertical.
  6038. // "LIKELY" - It is likely that the image belongs to the specified
  6039. // vertical.
  6040. // "VERY_LIKELY" - It is very likely that the image belongs to the
  6041. // specified vertical.
  6042. Violence string `json:"violence,omitempty"`
  6043. // ForceSendFields is a list of field names (e.g. "Adult") to
  6044. // unconditionally include in API requests. By default, fields with
  6045. // empty values are omitted from API requests. However, any non-pointer,
  6046. // non-interface field appearing in ForceSendFields will be sent to the
  6047. // server regardless of whether the field is empty or not. This may be
  6048. // used to include empty fields in Patch requests.
  6049. ForceSendFields []string `json:"-"`
  6050. // NullFields is a list of field names (e.g. "Adult") to include in API
  6051. // requests with the JSON null value. By default, fields with empty
  6052. // values are omitted from API requests. However, any field with an
  6053. // empty value appearing in NullFields will be sent to the server as
  6054. // null. It is an error if a field in this list has a non-empty value.
  6055. // This may be used to include null fields in Patch requests.
  6056. NullFields []string `json:"-"`
  6057. }
  6058. func (s *SafeSearchAnnotation) MarshalJSON() ([]byte, error) {
  6059. type NoMethod SafeSearchAnnotation
  6060. raw := NoMethod(*s)
  6061. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6062. }
  6063. // Status: The `Status` type defines a logical error model that is
  6064. // suitable for different
  6065. // programming environments, including REST APIs and RPC APIs. It is
  6066. // used by
  6067. // [gRPC](https://github.com/grpc). The error model is designed to
  6068. // be:
  6069. //
  6070. // - Simple to use and understand for most users
  6071. // - Flexible enough to meet unexpected needs
  6072. //
  6073. // # Overview
  6074. //
  6075. // The `Status` message contains three pieces of data: error code, error
  6076. // message,
  6077. // and error details. The error code should be an enum value
  6078. // of
  6079. // google.rpc.Code, but it may accept additional error codes if needed.
  6080. // The
  6081. // error message should be a developer-facing English message that
  6082. // helps
  6083. // developers *understand* and *resolve* the error. If a localized
  6084. // user-facing
  6085. // error message is needed, put the localized message in the error
  6086. // details or
  6087. // localize it in the client. The optional error details may contain
  6088. // arbitrary
  6089. // information about the error. There is a predefined set of error
  6090. // detail types
  6091. // in the package `google.rpc` that can be used for common error
  6092. // conditions.
  6093. //
  6094. // # Language mapping
  6095. //
  6096. // The `Status` message is the logical representation of the error
  6097. // model, but it
  6098. // is not necessarily the actual wire format. When the `Status` message
  6099. // is
  6100. // exposed in different client libraries and different wire protocols,
  6101. // it can be
  6102. // mapped differently. For example, it will likely be mapped to some
  6103. // exceptions
  6104. // in Java, but more likely mapped to some error codes in C.
  6105. //
  6106. // # Other uses
  6107. //
  6108. // The error model and the `Status` message can be used in a variety
  6109. // of
  6110. // environments, either with or without APIs, to provide a
  6111. // consistent developer experience across different
  6112. // environments.
  6113. //
  6114. // Example uses of this error model include:
  6115. //
  6116. // - Partial errors. If a service needs to return partial errors to the
  6117. // client,
  6118. // it may embed the `Status` in the normal response to indicate the
  6119. // partial
  6120. // errors.
  6121. //
  6122. // - Workflow errors. A typical workflow has multiple steps. Each step
  6123. // may
  6124. // have a `Status` message for error reporting.
  6125. //
  6126. // - Batch operations. If a client uses batch request and batch
  6127. // response, the
  6128. // `Status` message should be used directly inside batch response,
  6129. // one for
  6130. // each error sub-response.
  6131. //
  6132. // - Asynchronous operations. If an API call embeds asynchronous
  6133. // operation
  6134. // results in its response, the status of those operations should
  6135. // be
  6136. // represented directly using the `Status` message.
  6137. //
  6138. // - Logging. If some API errors are stored in logs, the message
  6139. // `Status` could
  6140. // be used directly after any stripping needed for security/privacy
  6141. // reasons.
  6142. type Status struct {
  6143. // Code: The status code, which should be an enum value of
  6144. // google.rpc.Code.
  6145. Code int64 `json:"code,omitempty"`
  6146. // Details: A list of messages that carry the error details. There is a
  6147. // common set of
  6148. // message types for APIs to use.
  6149. Details []googleapi.RawMessage `json:"details,omitempty"`
  6150. // Message: A developer-facing error message, which should be in
  6151. // English. Any
  6152. // user-facing error message should be localized and sent in
  6153. // the
  6154. // google.rpc.Status.details field, or localized by the client.
  6155. Message string `json:"message,omitempty"`
  6156. // ForceSendFields is a list of field names (e.g. "Code") to
  6157. // unconditionally include in API requests. By default, fields with
  6158. // empty values are omitted from API requests. However, any non-pointer,
  6159. // non-interface field appearing in ForceSendFields will be sent to the
  6160. // server regardless of whether the field is empty or not. This may be
  6161. // used to include empty fields in Patch requests.
  6162. ForceSendFields []string `json:"-"`
  6163. // NullFields is a list of field names (e.g. "Code") to include in API
  6164. // requests with the JSON null value. By default, fields with empty
  6165. // values are omitted from API requests. However, any field with an
  6166. // empty value appearing in NullFields will be sent to the server as
  6167. // null. It is an error if a field in this list has a non-empty value.
  6168. // This may be used to include null fields in Patch requests.
  6169. NullFields []string `json:"-"`
  6170. }
  6171. func (s *Status) MarshalJSON() ([]byte, error) {
  6172. type NoMethod Status
  6173. raw := NoMethod(*s)
  6174. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6175. }
  6176. // Symbol: A single symbol representation.
  6177. type Symbol struct {
  6178. // BoundingBox: The bounding box for the symbol.
  6179. // The vertices are in the order of top-left, top-right,
  6180. // bottom-right,
  6181. // bottom-left. When a rotation of the bounding box is detected the
  6182. // rotation
  6183. // is represented as around the top-left corner as defined when the text
  6184. // is
  6185. // read in the 'natural' orientation.
  6186. // For example:
  6187. // * when the text is horizontal it might look like:
  6188. // 0----1
  6189. // | |
  6190. // 3----2
  6191. // * when it's rotated 180 degrees around the top-left corner it
  6192. // becomes:
  6193. // 2----3
  6194. // | |
  6195. // 1----0
  6196. // and the vertice order will still be (0, 1, 2, 3).
  6197. BoundingBox *BoundingPoly `json:"boundingBox,omitempty"`
  6198. // Confidence: Confidence of the OCR results for the symbol. Range [0,
  6199. // 1].
  6200. Confidence float64 `json:"confidence,omitempty"`
  6201. // Property: Additional information detected for the symbol.
  6202. Property *TextProperty `json:"property,omitempty"`
  6203. // Text: The actual UTF-8 representation of the symbol.
  6204. Text string `json:"text,omitempty"`
  6205. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  6206. // unconditionally include in API requests. By default, fields with
  6207. // empty values are omitted from API requests. However, any non-pointer,
  6208. // non-interface field appearing in ForceSendFields will be sent to the
  6209. // server regardless of whether the field is empty or not. This may be
  6210. // used to include empty fields in Patch requests.
  6211. ForceSendFields []string `json:"-"`
  6212. // NullFields is a list of field names (e.g. "BoundingBox") to include
  6213. // in API requests with the JSON null value. By default, fields with
  6214. // empty values are omitted from API requests. However, any field with
  6215. // an empty value appearing in NullFields will be sent to the server as
  6216. // null. It is an error if a field in this list has a non-empty value.
  6217. // This may be used to include null fields in Patch requests.
  6218. NullFields []string `json:"-"`
  6219. }
  6220. func (s *Symbol) MarshalJSON() ([]byte, error) {
  6221. type NoMethod Symbol
  6222. raw := NoMethod(*s)
  6223. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6224. }
  6225. func (s *Symbol) UnmarshalJSON(data []byte) error {
  6226. type NoMethod Symbol
  6227. var s1 struct {
  6228. Confidence gensupport.JSONFloat64 `json:"confidence"`
  6229. *NoMethod
  6230. }
  6231. s1.NoMethod = (*NoMethod)(s)
  6232. if err := json.Unmarshal(data, &s1); err != nil {
  6233. return err
  6234. }
  6235. s.Confidence = float64(s1.Confidence)
  6236. return nil
  6237. }
  6238. // TextAnnotation: TextAnnotation contains a structured representation
  6239. // of OCR extracted text.
  6240. // The hierarchy of an OCR extracted text structure is like this:
  6241. // TextAnnotation -> Page -> Block -> Paragraph -> Word ->
  6242. // Symbol
  6243. // Each structural component, starting from Page, may further have their
  6244. // own
  6245. // properties. Properties describe detected languages, breaks etc..
  6246. // Please refer
  6247. // to the TextAnnotation.TextProperty message definition below for
  6248. // more
  6249. // detail.
  6250. type TextAnnotation struct {
  6251. // Pages: List of pages detected by OCR.
  6252. Pages []*Page `json:"pages,omitempty"`
  6253. // Text: UTF-8 text detected on the pages.
  6254. Text string `json:"text,omitempty"`
  6255. // ForceSendFields is a list of field names (e.g. "Pages") to
  6256. // unconditionally include in API requests. By default, fields with
  6257. // empty values are omitted from API requests. However, any non-pointer,
  6258. // non-interface field appearing in ForceSendFields will be sent to the
  6259. // server regardless of whether the field is empty or not. This may be
  6260. // used to include empty fields in Patch requests.
  6261. ForceSendFields []string `json:"-"`
  6262. // NullFields is a list of field names (e.g. "Pages") to include in API
  6263. // requests with the JSON null value. By default, fields with empty
  6264. // values are omitted from API requests. However, any field with an
  6265. // empty value appearing in NullFields will be sent to the server as
  6266. // null. It is an error if a field in this list has a non-empty value.
  6267. // This may be used to include null fields in Patch requests.
  6268. NullFields []string `json:"-"`
  6269. }
  6270. func (s *TextAnnotation) MarshalJSON() ([]byte, error) {
  6271. type NoMethod TextAnnotation
  6272. raw := NoMethod(*s)
  6273. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6274. }
  6275. // TextProperty: Additional information detected on the structural
  6276. // component.
  6277. type TextProperty struct {
  6278. // DetectedBreak: Detected start or end of a text segment.
  6279. DetectedBreak *DetectedBreak `json:"detectedBreak,omitempty"`
  6280. // DetectedLanguages: A list of detected languages together with
  6281. // confidence.
  6282. DetectedLanguages []*DetectedLanguage `json:"detectedLanguages,omitempty"`
  6283. // ForceSendFields is a list of field names (e.g. "DetectedBreak") to
  6284. // unconditionally include in API requests. By default, fields with
  6285. // empty values are omitted from API requests. However, any non-pointer,
  6286. // non-interface field appearing in ForceSendFields will be sent to the
  6287. // server regardless of whether the field is empty or not. This may be
  6288. // used to include empty fields in Patch requests.
  6289. ForceSendFields []string `json:"-"`
  6290. // NullFields is a list of field names (e.g. "DetectedBreak") to include
  6291. // in API requests with the JSON null value. By default, fields with
  6292. // empty values are omitted from API requests. However, any field with
  6293. // an empty value appearing in NullFields will be sent to the server as
  6294. // null. It is an error if a field in this list has a non-empty value.
  6295. // This may be used to include null fields in Patch requests.
  6296. NullFields []string `json:"-"`
  6297. }
  6298. func (s *TextProperty) MarshalJSON() ([]byte, error) {
  6299. type NoMethod TextProperty
  6300. raw := NoMethod(*s)
  6301. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6302. }
  6303. // Vertex: A vertex represents a 2D point in the image.
  6304. // NOTE: the vertex coordinates are in the same scale as the original
  6305. // image.
  6306. type Vertex struct {
  6307. // X: X coordinate.
  6308. X int64 `json:"x,omitempty"`
  6309. // Y: Y coordinate.
  6310. Y int64 `json:"y,omitempty"`
  6311. // ForceSendFields is a list of field names (e.g. "X") to
  6312. // unconditionally include in API requests. By default, fields with
  6313. // empty values are omitted from API requests. However, any non-pointer,
  6314. // non-interface field appearing in ForceSendFields will be sent to the
  6315. // server regardless of whether the field is empty or not. This may be
  6316. // used to include empty fields in Patch requests.
  6317. ForceSendFields []string `json:"-"`
  6318. // NullFields is a list of field names (e.g. "X") to include in API
  6319. // requests with the JSON null value. By default, fields with empty
  6320. // values are omitted from API requests. However, any field with an
  6321. // empty value appearing in NullFields will be sent to the server as
  6322. // null. It is an error if a field in this list has a non-empty value.
  6323. // This may be used to include null fields in Patch requests.
  6324. NullFields []string `json:"-"`
  6325. }
  6326. func (s *Vertex) MarshalJSON() ([]byte, error) {
  6327. type NoMethod Vertex
  6328. raw := NoMethod(*s)
  6329. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6330. }
  6331. // WebDetection: Relevant information for the image from the Internet.
  6332. type WebDetection struct {
  6333. // BestGuessLabels: The service's best guess as to the topic of the
  6334. // request image.
  6335. // Inferred from similar images on the open web.
  6336. BestGuessLabels []*WebLabel `json:"bestGuessLabels,omitempty"`
  6337. // FullMatchingImages: Fully matching images from the Internet.
  6338. // Can include resized copies of the query image.
  6339. FullMatchingImages []*WebImage `json:"fullMatchingImages,omitempty"`
  6340. // PagesWithMatchingImages: Web pages containing the matching images
  6341. // from the Internet.
  6342. PagesWithMatchingImages []*WebPage `json:"pagesWithMatchingImages,omitempty"`
  6343. // PartialMatchingImages: Partial matching images from the
  6344. // Internet.
  6345. // Those images are similar enough to share some key-point features.
  6346. // For
  6347. // example an original image will likely have partial matching for its
  6348. // crops.
  6349. PartialMatchingImages []*WebImage `json:"partialMatchingImages,omitempty"`
  6350. // VisuallySimilarImages: The visually similar image results.
  6351. VisuallySimilarImages []*WebImage `json:"visuallySimilarImages,omitempty"`
  6352. // WebEntities: Deduced entities from similar images on the Internet.
  6353. WebEntities []*WebEntity `json:"webEntities,omitempty"`
  6354. // ForceSendFields is a list of field names (e.g. "BestGuessLabels") to
  6355. // unconditionally include in API requests. By default, fields with
  6356. // empty values are omitted from API requests. However, any non-pointer,
  6357. // non-interface field appearing in ForceSendFields will be sent to the
  6358. // server regardless of whether the field is empty or not. This may be
  6359. // used to include empty fields in Patch requests.
  6360. ForceSendFields []string `json:"-"`
  6361. // NullFields is a list of field names (e.g. "BestGuessLabels") to
  6362. // include in API requests with the JSON null value. By default, fields
  6363. // with empty values are omitted from API requests. However, any field
  6364. // with an empty value appearing in NullFields will be sent to the
  6365. // server as null. It is an error if a field in this list has a
  6366. // non-empty value. This may be used to include null fields in Patch
  6367. // requests.
  6368. NullFields []string `json:"-"`
  6369. }
  6370. func (s *WebDetection) MarshalJSON() ([]byte, error) {
  6371. type NoMethod WebDetection
  6372. raw := NoMethod(*s)
  6373. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6374. }
  6375. // WebEntity: Entity deduced from similar images on the Internet.
  6376. type WebEntity struct {
  6377. // Description: Canonical description of the entity, in English.
  6378. Description string `json:"description,omitempty"`
  6379. // EntityId: Opaque entity ID.
  6380. EntityId string `json:"entityId,omitempty"`
  6381. // Score: Overall relevancy score for the entity.
  6382. // Not normalized and not comparable across different image queries.
  6383. Score float64 `json:"score,omitempty"`
  6384. // ForceSendFields is a list of field names (e.g. "Description") to
  6385. // unconditionally include in API requests. By default, fields with
  6386. // empty values are omitted from API requests. However, any non-pointer,
  6387. // non-interface field appearing in ForceSendFields will be sent to the
  6388. // server regardless of whether the field is empty or not. This may be
  6389. // used to include empty fields in Patch requests.
  6390. ForceSendFields []string `json:"-"`
  6391. // NullFields is a list of field names (e.g. "Description") to include
  6392. // in API requests with the JSON null value. By default, fields with
  6393. // empty values are omitted from API requests. However, any field with
  6394. // an empty value appearing in NullFields will be sent to the server as
  6395. // null. It is an error if a field in this list has a non-empty value.
  6396. // This may be used to include null fields in Patch requests.
  6397. NullFields []string `json:"-"`
  6398. }
  6399. func (s *WebEntity) MarshalJSON() ([]byte, error) {
  6400. type NoMethod WebEntity
  6401. raw := NoMethod(*s)
  6402. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6403. }
  6404. func (s *WebEntity) UnmarshalJSON(data []byte) error {
  6405. type NoMethod WebEntity
  6406. var s1 struct {
  6407. Score gensupport.JSONFloat64 `json:"score"`
  6408. *NoMethod
  6409. }
  6410. s1.NoMethod = (*NoMethod)(s)
  6411. if err := json.Unmarshal(data, &s1); err != nil {
  6412. return err
  6413. }
  6414. s.Score = float64(s1.Score)
  6415. return nil
  6416. }
  6417. // WebImage: Metadata for online images.
  6418. type WebImage struct {
  6419. // Score: (Deprecated) Overall relevancy score for the image.
  6420. Score float64 `json:"score,omitempty"`
  6421. // Url: The result image URL.
  6422. Url string `json:"url,omitempty"`
  6423. // ForceSendFields is a list of field names (e.g. "Score") to
  6424. // unconditionally include in API requests. By default, fields with
  6425. // empty values are omitted from API requests. However, any non-pointer,
  6426. // non-interface field appearing in ForceSendFields will be sent to the
  6427. // server regardless of whether the field is empty or not. This may be
  6428. // used to include empty fields in Patch requests.
  6429. ForceSendFields []string `json:"-"`
  6430. // NullFields is a list of field names (e.g. "Score") to include in API
  6431. // requests with the JSON null value. By default, fields with empty
  6432. // values are omitted from API requests. However, any field with an
  6433. // empty value appearing in NullFields will be sent to the server as
  6434. // null. It is an error if a field in this list has a non-empty value.
  6435. // This may be used to include null fields in Patch requests.
  6436. NullFields []string `json:"-"`
  6437. }
  6438. func (s *WebImage) MarshalJSON() ([]byte, error) {
  6439. type NoMethod WebImage
  6440. raw := NoMethod(*s)
  6441. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6442. }
  6443. func (s *WebImage) UnmarshalJSON(data []byte) error {
  6444. type NoMethod WebImage
  6445. var s1 struct {
  6446. Score gensupport.JSONFloat64 `json:"score"`
  6447. *NoMethod
  6448. }
  6449. s1.NoMethod = (*NoMethod)(s)
  6450. if err := json.Unmarshal(data, &s1); err != nil {
  6451. return err
  6452. }
  6453. s.Score = float64(s1.Score)
  6454. return nil
  6455. }
  6456. // WebLabel: Label to provide extra metadata for the web detection.
  6457. type WebLabel struct {
  6458. // Label: Label for extra metadata.
  6459. Label string `json:"label,omitempty"`
  6460. // LanguageCode: The BCP-47 language code for `label`, such as "en-US"
  6461. // or "sr-Latn".
  6462. // For more information,
  6463. // see
  6464. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  6465. LanguageCode string `json:"languageCode,omitempty"`
  6466. // ForceSendFields is a list of field names (e.g. "Label") to
  6467. // unconditionally include in API requests. By default, fields with
  6468. // empty values are omitted from API requests. However, any non-pointer,
  6469. // non-interface field appearing in ForceSendFields will be sent to the
  6470. // server regardless of whether the field is empty or not. This may be
  6471. // used to include empty fields in Patch requests.
  6472. ForceSendFields []string `json:"-"`
  6473. // NullFields is a list of field names (e.g. "Label") to include in API
  6474. // requests with the JSON null value. By default, fields with empty
  6475. // values are omitted from API requests. However, any field with an
  6476. // empty value appearing in NullFields will be sent to the server as
  6477. // null. It is an error if a field in this list has a non-empty value.
  6478. // This may be used to include null fields in Patch requests.
  6479. NullFields []string `json:"-"`
  6480. }
  6481. func (s *WebLabel) MarshalJSON() ([]byte, error) {
  6482. type NoMethod WebLabel
  6483. raw := NoMethod(*s)
  6484. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6485. }
  6486. // WebPage: Metadata for web pages.
  6487. type WebPage struct {
  6488. // FullMatchingImages: Fully matching images on the page.
  6489. // Can include resized copies of the query image.
  6490. FullMatchingImages []*WebImage `json:"fullMatchingImages,omitempty"`
  6491. // PageTitle: Title for the web page, may contain HTML markups.
  6492. PageTitle string `json:"pageTitle,omitempty"`
  6493. // PartialMatchingImages: Partial matching images on the page.
  6494. // Those images are similar enough to share some key-point features.
  6495. // For
  6496. // example an original image will likely have partial matching for
  6497. // its
  6498. // crops.
  6499. PartialMatchingImages []*WebImage `json:"partialMatchingImages,omitempty"`
  6500. // Score: (Deprecated) Overall relevancy score for the web page.
  6501. Score float64 `json:"score,omitempty"`
  6502. // Url: The result web page URL.
  6503. Url string `json:"url,omitempty"`
  6504. // ForceSendFields is a list of field names (e.g. "FullMatchingImages")
  6505. // to unconditionally include in API requests. By default, fields with
  6506. // empty values are omitted from API requests. However, any non-pointer,
  6507. // non-interface field appearing in ForceSendFields will be sent to the
  6508. // server regardless of whether the field is empty or not. This may be
  6509. // used to include empty fields in Patch requests.
  6510. ForceSendFields []string `json:"-"`
  6511. // NullFields is a list of field names (e.g. "FullMatchingImages") to
  6512. // include in API requests with the JSON null value. By default, fields
  6513. // with empty values are omitted from API requests. However, any field
  6514. // with an empty value appearing in NullFields will be sent to the
  6515. // server as null. It is an error if a field in this list has a
  6516. // non-empty value. This may be used to include null fields in Patch
  6517. // requests.
  6518. NullFields []string `json:"-"`
  6519. }
  6520. func (s *WebPage) MarshalJSON() ([]byte, error) {
  6521. type NoMethod WebPage
  6522. raw := NoMethod(*s)
  6523. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6524. }
  6525. func (s *WebPage) UnmarshalJSON(data []byte) error {
  6526. type NoMethod WebPage
  6527. var s1 struct {
  6528. Score gensupport.JSONFloat64 `json:"score"`
  6529. *NoMethod
  6530. }
  6531. s1.NoMethod = (*NoMethod)(s)
  6532. if err := json.Unmarshal(data, &s1); err != nil {
  6533. return err
  6534. }
  6535. s.Score = float64(s1.Score)
  6536. return nil
  6537. }
  6538. // Word: A word representation.
  6539. type Word struct {
  6540. // BoundingBox: The bounding box for the word.
  6541. // The vertices are in the order of top-left, top-right,
  6542. // bottom-right,
  6543. // bottom-left. When a rotation of the bounding box is detected the
  6544. // rotation
  6545. // is represented as around the top-left corner as defined when the text
  6546. // is
  6547. // read in the 'natural' orientation.
  6548. // For example:
  6549. // * when the text is horizontal it might look like:
  6550. // 0----1
  6551. // | |
  6552. // 3----2
  6553. // * when it's rotated 180 degrees around the top-left corner it
  6554. // becomes:
  6555. // 2----3
  6556. // | |
  6557. // 1----0
  6558. // and the vertice order will still be (0, 1, 2, 3).
  6559. BoundingBox *BoundingPoly `json:"boundingBox,omitempty"`
  6560. // Confidence: Confidence of the OCR results for the word. Range [0, 1].
  6561. Confidence float64 `json:"confidence,omitempty"`
  6562. // Property: Additional information detected for the word.
  6563. Property *TextProperty `json:"property,omitempty"`
  6564. // Symbols: List of symbols in the word.
  6565. // The order of the symbols follows the natural reading order.
  6566. Symbols []*Symbol `json:"symbols,omitempty"`
  6567. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  6568. // unconditionally include in API requests. By default, fields with
  6569. // empty values are omitted from API requests. However, any non-pointer,
  6570. // non-interface field appearing in ForceSendFields will be sent to the
  6571. // server regardless of whether the field is empty or not. This may be
  6572. // used to include empty fields in Patch requests.
  6573. ForceSendFields []string `json:"-"`
  6574. // NullFields is a list of field names (e.g. "BoundingBox") to include
  6575. // in API requests with the JSON null value. By default, fields with
  6576. // empty values are omitted from API requests. However, any field with
  6577. // an empty value appearing in NullFields will be sent to the server as
  6578. // null. It is an error if a field in this list has a non-empty value.
  6579. // This may be used to include null fields in Patch requests.
  6580. NullFields []string `json:"-"`
  6581. }
  6582. func (s *Word) MarshalJSON() ([]byte, error) {
  6583. type NoMethod Word
  6584. raw := NoMethod(*s)
  6585. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6586. }
  6587. func (s *Word) UnmarshalJSON(data []byte) error {
  6588. type NoMethod Word
  6589. var s1 struct {
  6590. Confidence gensupport.JSONFloat64 `json:"confidence"`
  6591. *NoMethod
  6592. }
  6593. s1.NoMethod = (*NoMethod)(s)
  6594. if err := json.Unmarshal(data, &s1); err != nil {
  6595. return err
  6596. }
  6597. s.Confidence = float64(s1.Confidence)
  6598. return nil
  6599. }
  6600. // method id "vision.files.asyncBatchAnnotate":
  6601. type FilesAsyncBatchAnnotateCall struct {
  6602. s *Service
  6603. googlecloudvisionv1p1beta1asyncbatchannotatefilesrequest *GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesRequest
  6604. urlParams_ gensupport.URLParams
  6605. ctx_ context.Context
  6606. header_ http.Header
  6607. }
  6608. // AsyncBatchAnnotate: Run asynchronous image detection and annotation
  6609. // for a list of generic
  6610. // files, such as PDF files, which may contain multiple pages and
  6611. // multiple
  6612. // images per page. Progress and results can be retrieved through
  6613. // the
  6614. // `google.longrunning.Operations` interface.
  6615. // `Operation.metadata` contains `OperationMetadata`
  6616. // (metadata).
  6617. // `Operation.response` contains `AsyncBatchAnnotateFilesResponse`
  6618. // (results).
  6619. func (r *FilesService) AsyncBatchAnnotate(googlecloudvisionv1p1beta1asyncbatchannotatefilesrequest *GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesRequest) *FilesAsyncBatchAnnotateCall {
  6620. c := &FilesAsyncBatchAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6621. c.googlecloudvisionv1p1beta1asyncbatchannotatefilesrequest = googlecloudvisionv1p1beta1asyncbatchannotatefilesrequest
  6622. return c
  6623. }
  6624. // Fields allows partial responses to be retrieved. See
  6625. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6626. // for more information.
  6627. func (c *FilesAsyncBatchAnnotateCall) Fields(s ...googleapi.Field) *FilesAsyncBatchAnnotateCall {
  6628. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6629. return c
  6630. }
  6631. // Context sets the context to be used in this call's Do method. Any
  6632. // pending HTTP request will be aborted if the provided context is
  6633. // canceled.
  6634. func (c *FilesAsyncBatchAnnotateCall) Context(ctx context.Context) *FilesAsyncBatchAnnotateCall {
  6635. c.ctx_ = ctx
  6636. return c
  6637. }
  6638. // Header returns an http.Header that can be modified by the caller to
  6639. // add HTTP headers to the request.
  6640. func (c *FilesAsyncBatchAnnotateCall) Header() http.Header {
  6641. if c.header_ == nil {
  6642. c.header_ = make(http.Header)
  6643. }
  6644. return c.header_
  6645. }
  6646. func (c *FilesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) {
  6647. reqHeaders := make(http.Header)
  6648. for k, v := range c.header_ {
  6649. reqHeaders[k] = v
  6650. }
  6651. reqHeaders.Set("User-Agent", c.s.userAgent())
  6652. var body io.Reader = nil
  6653. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p1beta1asyncbatchannotatefilesrequest)
  6654. if err != nil {
  6655. return nil, err
  6656. }
  6657. reqHeaders.Set("Content-Type", "application/json")
  6658. c.urlParams_.Set("alt", alt)
  6659. urls := googleapi.ResolveRelative(c.s.BasePath, "v1p1beta1/files:asyncBatchAnnotate")
  6660. urls += "?" + c.urlParams_.Encode()
  6661. req, _ := http.NewRequest("POST", urls, body)
  6662. req.Header = reqHeaders
  6663. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6664. }
  6665. // Do executes the "vision.files.asyncBatchAnnotate" call.
  6666. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6667. // status code is an error. Response headers are in either
  6668. // *Operation.ServerResponse.Header or (if a response was returned at
  6669. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6670. // to check whether the returned error was because
  6671. // http.StatusNotModified was returned.
  6672. func (c *FilesAsyncBatchAnnotateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6673. gensupport.SetOptions(c.urlParams_, opts...)
  6674. res, err := c.doRequest("json")
  6675. if res != nil && res.StatusCode == http.StatusNotModified {
  6676. if res.Body != nil {
  6677. res.Body.Close()
  6678. }
  6679. return nil, &googleapi.Error{
  6680. Code: res.StatusCode,
  6681. Header: res.Header,
  6682. }
  6683. }
  6684. if err != nil {
  6685. return nil, err
  6686. }
  6687. defer googleapi.CloseBody(res)
  6688. if err := googleapi.CheckResponse(res); err != nil {
  6689. return nil, err
  6690. }
  6691. ret := &Operation{
  6692. ServerResponse: googleapi.ServerResponse{
  6693. Header: res.Header,
  6694. HTTPStatusCode: res.StatusCode,
  6695. },
  6696. }
  6697. target := &ret
  6698. if err := gensupport.DecodeResponse(target, res); err != nil {
  6699. return nil, err
  6700. }
  6701. return ret, nil
  6702. // {
  6703. // "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).",
  6704. // "flatPath": "v1p1beta1/files:asyncBatchAnnotate",
  6705. // "httpMethod": "POST",
  6706. // "id": "vision.files.asyncBatchAnnotate",
  6707. // "parameterOrder": [],
  6708. // "parameters": {},
  6709. // "path": "v1p1beta1/files:asyncBatchAnnotate",
  6710. // "request": {
  6711. // "$ref": "GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesRequest"
  6712. // },
  6713. // "response": {
  6714. // "$ref": "Operation"
  6715. // },
  6716. // "scopes": [
  6717. // "https://www.googleapis.com/auth/cloud-platform",
  6718. // "https://www.googleapis.com/auth/cloud-vision"
  6719. // ]
  6720. // }
  6721. }
  6722. // method id "vision.images.annotate":
  6723. type ImagesAnnotateCall struct {
  6724. s *Service
  6725. googlecloudvisionv1p1beta1batchannotateimagesrequest *GoogleCloudVisionV1p1beta1BatchAnnotateImagesRequest
  6726. urlParams_ gensupport.URLParams
  6727. ctx_ context.Context
  6728. header_ http.Header
  6729. }
  6730. // Annotate: Run image detection and annotation for a batch of images.
  6731. func (r *ImagesService) Annotate(googlecloudvisionv1p1beta1batchannotateimagesrequest *GoogleCloudVisionV1p1beta1BatchAnnotateImagesRequest) *ImagesAnnotateCall {
  6732. c := &ImagesAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6733. c.googlecloudvisionv1p1beta1batchannotateimagesrequest = googlecloudvisionv1p1beta1batchannotateimagesrequest
  6734. return c
  6735. }
  6736. // Fields allows partial responses to be retrieved. See
  6737. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6738. // for more information.
  6739. func (c *ImagesAnnotateCall) Fields(s ...googleapi.Field) *ImagesAnnotateCall {
  6740. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6741. return c
  6742. }
  6743. // Context sets the context to be used in this call's Do method. Any
  6744. // pending HTTP request will be aborted if the provided context is
  6745. // canceled.
  6746. func (c *ImagesAnnotateCall) Context(ctx context.Context) *ImagesAnnotateCall {
  6747. c.ctx_ = ctx
  6748. return c
  6749. }
  6750. // Header returns an http.Header that can be modified by the caller to
  6751. // add HTTP headers to the request.
  6752. func (c *ImagesAnnotateCall) Header() http.Header {
  6753. if c.header_ == nil {
  6754. c.header_ = make(http.Header)
  6755. }
  6756. return c.header_
  6757. }
  6758. func (c *ImagesAnnotateCall) doRequest(alt string) (*http.Response, error) {
  6759. reqHeaders := make(http.Header)
  6760. for k, v := range c.header_ {
  6761. reqHeaders[k] = v
  6762. }
  6763. reqHeaders.Set("User-Agent", c.s.userAgent())
  6764. var body io.Reader = nil
  6765. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvisionv1p1beta1batchannotateimagesrequest)
  6766. if err != nil {
  6767. return nil, err
  6768. }
  6769. reqHeaders.Set("Content-Type", "application/json")
  6770. c.urlParams_.Set("alt", alt)
  6771. urls := googleapi.ResolveRelative(c.s.BasePath, "v1p1beta1/images:annotate")
  6772. urls += "?" + c.urlParams_.Encode()
  6773. req, _ := http.NewRequest("POST", urls, body)
  6774. req.Header = reqHeaders
  6775. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6776. }
  6777. // Do executes the "vision.images.annotate" call.
  6778. // Exactly one of *GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse
  6779. // or error will be non-nil. Any non-2xx status code is an error.
  6780. // Response headers are in either
  6781. // *GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse.ServerResponse.
  6782. // Header or (if a response was returned at all) in
  6783. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6784. // whether the returned error was because http.StatusNotModified was
  6785. // returned.
  6786. func (c *ImagesAnnotateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse, error) {
  6787. gensupport.SetOptions(c.urlParams_, opts...)
  6788. res, err := c.doRequest("json")
  6789. if res != nil && res.StatusCode == http.StatusNotModified {
  6790. if res.Body != nil {
  6791. res.Body.Close()
  6792. }
  6793. return nil, &googleapi.Error{
  6794. Code: res.StatusCode,
  6795. Header: res.Header,
  6796. }
  6797. }
  6798. if err != nil {
  6799. return nil, err
  6800. }
  6801. defer googleapi.CloseBody(res)
  6802. if err := googleapi.CheckResponse(res); err != nil {
  6803. return nil, err
  6804. }
  6805. ret := &GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse{
  6806. ServerResponse: googleapi.ServerResponse{
  6807. Header: res.Header,
  6808. HTTPStatusCode: res.StatusCode,
  6809. },
  6810. }
  6811. target := &ret
  6812. if err := gensupport.DecodeResponse(target, res); err != nil {
  6813. return nil, err
  6814. }
  6815. return ret, nil
  6816. // {
  6817. // "description": "Run image detection and annotation for a batch of images.",
  6818. // "flatPath": "v1p1beta1/images:annotate",
  6819. // "httpMethod": "POST",
  6820. // "id": "vision.images.annotate",
  6821. // "parameterOrder": [],
  6822. // "parameters": {},
  6823. // "path": "v1p1beta1/images:annotate",
  6824. // "request": {
  6825. // "$ref": "GoogleCloudVisionV1p1beta1BatchAnnotateImagesRequest"
  6826. // },
  6827. // "response": {
  6828. // "$ref": "GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse"
  6829. // },
  6830. // "scopes": [
  6831. // "https://www.googleapis.com/auth/cloud-platform",
  6832. // "https://www.googleapis.com/auth/cloud-vision"
  6833. // ]
  6834. // }
  6835. }