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.
 
 
 

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