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.
 
 
 

18516 lines
725 KiB

  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package vision provides access to the Cloud Vision API.
  6. //
  7. // This package is DEPRECATED. Use package cloud.google.com/go/vision/apiv1 instead.
  8. //
  9. // For product documentation, see: https://cloud.google.com/vision/
  10. //
  11. // Creating a client
  12. //
  13. // Usage example:
  14. //
  15. // import "google.golang.org/api/vision/v1"
  16. // ...
  17. // ctx := context.Background()
  18. // visionService, err := vision.NewService(ctx)
  19. //
  20. // In this example, Google Application Default Credentials are used for authentication.
  21. //
  22. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  23. //
  24. // Other authentication options
  25. //
  26. // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
  27. //
  28. // visionService, err := vision.NewService(ctx, option.WithScopes(vision.CloudVisionScope))
  29. //
  30. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  31. //
  32. // visionService, err := vision.NewService(ctx, option.WithAPIKey("AIza..."))
  33. //
  34. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  35. //
  36. // config := &oauth2.Config{...}
  37. // // ...
  38. // token, err := config.Exchange(ctx, ...)
  39. // visionService, err := vision.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  40. //
  41. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  42. package vision // import "google.golang.org/api/vision/v1"
  43. import (
  44. "bytes"
  45. "context"
  46. "encoding/json"
  47. "errors"
  48. "fmt"
  49. "io"
  50. "net/http"
  51. "net/url"
  52. "strconv"
  53. "strings"
  54. gensupport "google.golang.org/api/gensupport"
  55. googleapi "google.golang.org/api/googleapi"
  56. option "google.golang.org/api/option"
  57. htransport "google.golang.org/api/transport/http"
  58. )
  59. // Always reference these packages, just in case the auto-generated code
  60. // below doesn't.
  61. var _ = bytes.NewBuffer
  62. var _ = strconv.Itoa
  63. var _ = fmt.Sprintf
  64. var _ = json.NewDecoder
  65. var _ = io.Copy
  66. var _ = url.Parse
  67. var _ = gensupport.MarshalJSON
  68. var _ = googleapi.Version
  69. var _ = errors.New
  70. var _ = strings.Replace
  71. var _ = context.Canceled
  72. const apiId = "vision:v1"
  73. const apiName = "vision"
  74. const apiVersion = "v1"
  75. const basePath = "https://vision.googleapis.com/"
  76. // OAuth2 scopes used by this API.
  77. const (
  78. // View and manage your data across Google Cloud Platform services
  79. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  80. // Apply machine learning models to understand and label images
  81. CloudVisionScope = "https://www.googleapis.com/auth/cloud-vision"
  82. )
  83. // NewService creates a new Service.
  84. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  85. scopesOption := option.WithScopes(
  86. "https://www.googleapis.com/auth/cloud-platform",
  87. "https://www.googleapis.com/auth/cloud-vision",
  88. )
  89. // NOTE: prepend, so we don't override user-specified scopes.
  90. opts = append([]option.ClientOption{scopesOption}, opts...)
  91. client, endpoint, err := htransport.NewClient(ctx, opts...)
  92. if err != nil {
  93. return nil, err
  94. }
  95. s, err := New(client)
  96. if err != nil {
  97. return nil, err
  98. }
  99. if endpoint != "" {
  100. s.BasePath = endpoint
  101. }
  102. return s, nil
  103. }
  104. // New creates a new Service. It uses the provided http.Client for requests.
  105. //
  106. // Deprecated: please use NewService instead.
  107. // To provide a custom HTTP client, use option.WithHTTPClient.
  108. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  109. func New(client *http.Client) (*Service, error) {
  110. if client == nil {
  111. return nil, errors.New("client is nil")
  112. }
  113. s := &Service{client: client, BasePath: basePath}
  114. s.Files = NewFilesService(s)
  115. s.Images = NewImagesService(s)
  116. s.Locations = NewLocationsService(s)
  117. s.Operations = NewOperationsService(s)
  118. s.Projects = NewProjectsService(s)
  119. return s, nil
  120. }
  121. type Service struct {
  122. client *http.Client
  123. BasePath string // API endpoint base URL
  124. UserAgent string // optional additional User-Agent fragment
  125. Files *FilesService
  126. Images *ImagesService
  127. Locations *LocationsService
  128. Operations *OperationsService
  129. Projects *ProjectsService
  130. }
  131. func (s *Service) userAgent() string {
  132. if s.UserAgent == "" {
  133. return googleapi.UserAgent
  134. }
  135. return googleapi.UserAgent + " " + s.UserAgent
  136. }
  137. func NewFilesService(s *Service) *FilesService {
  138. rs := &FilesService{s: s}
  139. return rs
  140. }
  141. type FilesService struct {
  142. s *Service
  143. }
  144. func NewImagesService(s *Service) *ImagesService {
  145. rs := &ImagesService{s: s}
  146. return rs
  147. }
  148. type ImagesService struct {
  149. s *Service
  150. }
  151. func NewLocationsService(s *Service) *LocationsService {
  152. rs := &LocationsService{s: s}
  153. rs.Operations = NewLocationsOperationsService(s)
  154. return rs
  155. }
  156. type LocationsService struct {
  157. s *Service
  158. Operations *LocationsOperationsService
  159. }
  160. func NewLocationsOperationsService(s *Service) *LocationsOperationsService {
  161. rs := &LocationsOperationsService{s: s}
  162. return rs
  163. }
  164. type LocationsOperationsService struct {
  165. s *Service
  166. }
  167. func NewOperationsService(s *Service) *OperationsService {
  168. rs := &OperationsService{s: s}
  169. return rs
  170. }
  171. type OperationsService struct {
  172. s *Service
  173. }
  174. func NewProjectsService(s *Service) *ProjectsService {
  175. rs := &ProjectsService{s: s}
  176. rs.Locations = NewProjectsLocationsService(s)
  177. return rs
  178. }
  179. type ProjectsService struct {
  180. s *Service
  181. Locations *ProjectsLocationsService
  182. }
  183. func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
  184. rs := &ProjectsLocationsService{s: s}
  185. rs.ProductSets = NewProjectsLocationsProductSetsService(s)
  186. rs.Products = NewProjectsLocationsProductsService(s)
  187. return rs
  188. }
  189. type ProjectsLocationsService struct {
  190. s *Service
  191. ProductSets *ProjectsLocationsProductSetsService
  192. Products *ProjectsLocationsProductsService
  193. }
  194. func NewProjectsLocationsProductSetsService(s *Service) *ProjectsLocationsProductSetsService {
  195. rs := &ProjectsLocationsProductSetsService{s: s}
  196. rs.Products = NewProjectsLocationsProductSetsProductsService(s)
  197. return rs
  198. }
  199. type ProjectsLocationsProductSetsService struct {
  200. s *Service
  201. Products *ProjectsLocationsProductSetsProductsService
  202. }
  203. func NewProjectsLocationsProductSetsProductsService(s *Service) *ProjectsLocationsProductSetsProductsService {
  204. rs := &ProjectsLocationsProductSetsProductsService{s: s}
  205. return rs
  206. }
  207. type ProjectsLocationsProductSetsProductsService struct {
  208. s *Service
  209. }
  210. func NewProjectsLocationsProductsService(s *Service) *ProjectsLocationsProductsService {
  211. rs := &ProjectsLocationsProductsService{s: s}
  212. rs.ReferenceImages = NewProjectsLocationsProductsReferenceImagesService(s)
  213. return rs
  214. }
  215. type ProjectsLocationsProductsService struct {
  216. s *Service
  217. ReferenceImages *ProjectsLocationsProductsReferenceImagesService
  218. }
  219. func NewProjectsLocationsProductsReferenceImagesService(s *Service) *ProjectsLocationsProductsReferenceImagesService {
  220. rs := &ProjectsLocationsProductsReferenceImagesService{s: s}
  221. return rs
  222. }
  223. type ProjectsLocationsProductsReferenceImagesService struct {
  224. s *Service
  225. }
  226. // AddProductToProductSetRequest: Request message for the
  227. // `AddProductToProductSet` method.
  228. type AddProductToProductSetRequest struct {
  229. // Product: The resource name for the Product to be added to this
  230. // ProductSet.
  231. //
  232. // Format is:
  233. // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
  234. Product string `json:"product,omitempty"`
  235. // ForceSendFields is a list of field names (e.g. "Product") to
  236. // unconditionally include in API requests. By default, fields with
  237. // empty values are omitted from API requests. However, any non-pointer,
  238. // non-interface field appearing in ForceSendFields will be sent to the
  239. // server regardless of whether the field is empty or not. This may be
  240. // used to include empty fields in Patch requests.
  241. ForceSendFields []string `json:"-"`
  242. // NullFields is a list of field names (e.g. "Product") to include in
  243. // API requests with the JSON null value. By default, fields with empty
  244. // values are omitted from API requests. However, any field with an
  245. // empty value appearing in NullFields will be sent to the server as
  246. // null. It is an error if a field in this list has a non-empty value.
  247. // This may be used to include null fields in Patch requests.
  248. NullFields []string `json:"-"`
  249. }
  250. func (s *AddProductToProductSetRequest) MarshalJSON() ([]byte, error) {
  251. type NoMethod AddProductToProductSetRequest
  252. raw := NoMethod(*s)
  253. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  254. }
  255. // AnnotateFileResponse: Response to a single file annotation request. A
  256. // file may contain one or more
  257. // images, which individually have their own responses.
  258. type AnnotateFileResponse struct {
  259. // InputConfig: Information about the file for which this response is
  260. // generated.
  261. InputConfig *InputConfig `json:"inputConfig,omitempty"`
  262. // Responses: Individual responses to images found within the file.
  263. Responses []*AnnotateImageResponse `json:"responses,omitempty"`
  264. // ForceSendFields is a list of field names (e.g. "InputConfig") to
  265. // unconditionally include in API requests. By default, fields with
  266. // empty values are omitted from API requests. However, any non-pointer,
  267. // non-interface field appearing in ForceSendFields will be sent to the
  268. // server regardless of whether the field is empty or not. This may be
  269. // used to include empty fields in Patch requests.
  270. ForceSendFields []string `json:"-"`
  271. // NullFields is a list of field names (e.g. "InputConfig") to include
  272. // in API requests with the JSON null value. By default, fields with
  273. // empty values are omitted from API requests. However, any field with
  274. // an empty value appearing in NullFields will be sent to the server as
  275. // null. It is an error if a field in this list has a non-empty value.
  276. // This may be used to include null fields in Patch requests.
  277. NullFields []string `json:"-"`
  278. }
  279. func (s *AnnotateFileResponse) MarshalJSON() ([]byte, error) {
  280. type NoMethod AnnotateFileResponse
  281. raw := NoMethod(*s)
  282. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  283. }
  284. // AnnotateImageRequest: Request for performing Google Cloud Vision API
  285. // tasks over a user-provided
  286. // image, with user-requested features, and with context information.
  287. type AnnotateImageRequest struct {
  288. // Features: Requested features.
  289. Features []*Feature `json:"features,omitempty"`
  290. // Image: The image to be processed.
  291. Image *Image `json:"image,omitempty"`
  292. // ImageContext: Additional context that may accompany the image.
  293. ImageContext *ImageContext `json:"imageContext,omitempty"`
  294. // ForceSendFields is a list of field names (e.g. "Features") to
  295. // unconditionally include in API requests. By default, fields with
  296. // empty values are omitted from API requests. However, any non-pointer,
  297. // non-interface field appearing in ForceSendFields will be sent to the
  298. // server regardless of whether the field is empty or not. This may be
  299. // used to include empty fields in Patch requests.
  300. ForceSendFields []string `json:"-"`
  301. // NullFields is a list of field names (e.g. "Features") to include in
  302. // API requests with the JSON null value. By default, fields with empty
  303. // values are omitted from API requests. However, any field with an
  304. // empty value appearing in NullFields will be sent to the server as
  305. // null. It is an error if a field in this list has a non-empty value.
  306. // This may be used to include null fields in Patch requests.
  307. NullFields []string `json:"-"`
  308. }
  309. func (s *AnnotateImageRequest) MarshalJSON() ([]byte, error) {
  310. type NoMethod AnnotateImageRequest
  311. raw := NoMethod(*s)
  312. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  313. }
  314. // AnnotateImageResponse: Response to an image annotation request.
  315. type AnnotateImageResponse struct {
  316. // Context: If present, contextual information is needed to understand
  317. // where this image
  318. // comes from.
  319. Context *ImageAnnotationContext `json:"context,omitempty"`
  320. // CropHintsAnnotation: If present, crop hints have completed
  321. // successfully.
  322. CropHintsAnnotation *CropHintsAnnotation `json:"cropHintsAnnotation,omitempty"`
  323. // Error: If set, represents the error message for the operation.
  324. // Note that filled-in image annotations are guaranteed to be
  325. // correct, even when `error` is set.
  326. Error *Status `json:"error,omitempty"`
  327. // FaceAnnotations: If present, face detection has completed
  328. // successfully.
  329. FaceAnnotations []*FaceAnnotation `json:"faceAnnotations,omitempty"`
  330. // FullTextAnnotation: If present, text (OCR) detection or document
  331. // (OCR) text detection has
  332. // completed successfully.
  333. // This annotation provides the structural hierarchy for the OCR
  334. // detected
  335. // text.
  336. FullTextAnnotation *TextAnnotation `json:"fullTextAnnotation,omitempty"`
  337. // ImagePropertiesAnnotation: If present, image properties were
  338. // extracted successfully.
  339. ImagePropertiesAnnotation *ImageProperties `json:"imagePropertiesAnnotation,omitempty"`
  340. // LabelAnnotations: If present, label detection has completed
  341. // successfully.
  342. LabelAnnotations []*EntityAnnotation `json:"labelAnnotations,omitempty"`
  343. // LandmarkAnnotations: If present, landmark detection has completed
  344. // successfully.
  345. LandmarkAnnotations []*EntityAnnotation `json:"landmarkAnnotations,omitempty"`
  346. // LocalizedObjectAnnotations: If present, localized object detection
  347. // has completed successfully.
  348. // This will be sorted descending by confidence score.
  349. LocalizedObjectAnnotations []*LocalizedObjectAnnotation `json:"localizedObjectAnnotations,omitempty"`
  350. // LogoAnnotations: If present, logo detection has completed
  351. // successfully.
  352. LogoAnnotations []*EntityAnnotation `json:"logoAnnotations,omitempty"`
  353. // ProductSearchResults: If present, product search has completed
  354. // successfully.
  355. ProductSearchResults *ProductSearchResults `json:"productSearchResults,omitempty"`
  356. // SafeSearchAnnotation: If present, safe-search annotation has
  357. // completed successfully.
  358. SafeSearchAnnotation *SafeSearchAnnotation `json:"safeSearchAnnotation,omitempty"`
  359. // TextAnnotations: If present, text (OCR) detection has completed
  360. // successfully.
  361. TextAnnotations []*EntityAnnotation `json:"textAnnotations,omitempty"`
  362. // WebDetection: If present, web detection has completed successfully.
  363. WebDetection *WebDetection `json:"webDetection,omitempty"`
  364. // ForceSendFields is a list of field names (e.g. "Context") to
  365. // unconditionally include in API requests. By default, fields with
  366. // empty values are omitted from API requests. However, any non-pointer,
  367. // non-interface field appearing in ForceSendFields will be sent to the
  368. // server regardless of whether the field is empty or not. This may be
  369. // used to include empty fields in Patch requests.
  370. ForceSendFields []string `json:"-"`
  371. // NullFields is a list of field names (e.g. "Context") to include in
  372. // API requests with the JSON null value. By default, fields with empty
  373. // values are omitted from API requests. However, any field with an
  374. // empty value appearing in NullFields will be sent to the server as
  375. // null. It is an error if a field in this list has a non-empty value.
  376. // This may be used to include null fields in Patch requests.
  377. NullFields []string `json:"-"`
  378. }
  379. func (s *AnnotateImageResponse) MarshalJSON() ([]byte, error) {
  380. type NoMethod AnnotateImageResponse
  381. raw := NoMethod(*s)
  382. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  383. }
  384. // AsyncAnnotateFileRequest: An offline file annotation request.
  385. type AsyncAnnotateFileRequest struct {
  386. // Features: Required. Requested features.
  387. Features []*Feature `json:"features,omitempty"`
  388. // ImageContext: Additional context that may accompany the image(s) in
  389. // the file.
  390. ImageContext *ImageContext `json:"imageContext,omitempty"`
  391. // InputConfig: Required. Information about the input file.
  392. InputConfig *InputConfig `json:"inputConfig,omitempty"`
  393. // OutputConfig: Required. The desired output location and metadata
  394. // (e.g. format).
  395. OutputConfig *OutputConfig `json:"outputConfig,omitempty"`
  396. // ForceSendFields is a list of field names (e.g. "Features") to
  397. // unconditionally include in API requests. By default, fields with
  398. // empty values are omitted from API requests. However, any non-pointer,
  399. // non-interface field appearing in ForceSendFields will be sent to the
  400. // server regardless of whether the field is empty or not. This may be
  401. // used to include empty fields in Patch requests.
  402. ForceSendFields []string `json:"-"`
  403. // NullFields is a list of field names (e.g. "Features") to include in
  404. // API requests with the JSON null value. By default, fields with empty
  405. // values are omitted from API requests. However, any field with an
  406. // empty value appearing in NullFields will be sent to the server as
  407. // null. It is an error if a field in this list has a non-empty value.
  408. // This may be used to include null fields in Patch requests.
  409. NullFields []string `json:"-"`
  410. }
  411. func (s *AsyncAnnotateFileRequest) MarshalJSON() ([]byte, error) {
  412. type NoMethod AsyncAnnotateFileRequest
  413. raw := NoMethod(*s)
  414. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  415. }
  416. // AsyncAnnotateFileResponse: The response for a single offline file
  417. // annotation request.
  418. type AsyncAnnotateFileResponse struct {
  419. // OutputConfig: The output location and metadata from
  420. // AsyncAnnotateFileRequest.
  421. OutputConfig *OutputConfig `json:"outputConfig,omitempty"`
  422. // ForceSendFields is a list of field names (e.g. "OutputConfig") to
  423. // unconditionally include in API requests. By default, fields with
  424. // empty values are omitted from API requests. However, any non-pointer,
  425. // non-interface field appearing in ForceSendFields will be sent to the
  426. // server regardless of whether the field is empty or not. This may be
  427. // used to include empty fields in Patch requests.
  428. ForceSendFields []string `json:"-"`
  429. // NullFields is a list of field names (e.g. "OutputConfig") to include
  430. // in API requests with the JSON null value. By default, fields with
  431. // empty values are omitted from API requests. However, any field with
  432. // an empty value appearing in NullFields will be sent to the server as
  433. // null. It is an error if a field in this list has a non-empty value.
  434. // This may be used to include null fields in Patch requests.
  435. NullFields []string `json:"-"`
  436. }
  437. func (s *AsyncAnnotateFileResponse) MarshalJSON() ([]byte, error) {
  438. type NoMethod AsyncAnnotateFileResponse
  439. raw := NoMethod(*s)
  440. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  441. }
  442. // AsyncBatchAnnotateFilesRequest: Multiple async file annotation
  443. // requests are batched into a single service
  444. // call.
  445. type AsyncBatchAnnotateFilesRequest struct {
  446. // Requests: Individual async file annotation requests for this batch.
  447. Requests []*AsyncAnnotateFileRequest `json:"requests,omitempty"`
  448. // ForceSendFields is a list of field names (e.g. "Requests") to
  449. // unconditionally include in API requests. By default, fields with
  450. // empty values are omitted from API requests. However, any non-pointer,
  451. // non-interface field appearing in ForceSendFields will be sent to the
  452. // server regardless of whether the field is empty or not. This may be
  453. // used to include empty fields in Patch requests.
  454. ForceSendFields []string `json:"-"`
  455. // NullFields is a list of field names (e.g. "Requests") to include in
  456. // API requests with the JSON null value. By default, fields with empty
  457. // values are omitted from API requests. However, any field with an
  458. // empty value appearing in NullFields will be sent to the server as
  459. // null. It is an error if a field in this list has a non-empty value.
  460. // This may be used to include null fields in Patch requests.
  461. NullFields []string `json:"-"`
  462. }
  463. func (s *AsyncBatchAnnotateFilesRequest) MarshalJSON() ([]byte, error) {
  464. type NoMethod AsyncBatchAnnotateFilesRequest
  465. raw := NoMethod(*s)
  466. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  467. }
  468. // AsyncBatchAnnotateFilesResponse: Response to an async batch file
  469. // annotation request.
  470. type AsyncBatchAnnotateFilesResponse struct {
  471. // Responses: The list of file annotation responses, one for each
  472. // request in
  473. // AsyncBatchAnnotateFilesRequest.
  474. Responses []*AsyncAnnotateFileResponse `json:"responses,omitempty"`
  475. // ForceSendFields is a list of field names (e.g. "Responses") to
  476. // unconditionally include in API requests. By default, fields with
  477. // empty values are omitted from API requests. However, any non-pointer,
  478. // non-interface field appearing in ForceSendFields will be sent to the
  479. // server regardless of whether the field is empty or not. This may be
  480. // used to include empty fields in Patch requests.
  481. ForceSendFields []string `json:"-"`
  482. // NullFields is a list of field names (e.g. "Responses") to include in
  483. // API requests with the JSON null value. By default, fields with empty
  484. // values are omitted from API requests. However, any field with an
  485. // empty value appearing in NullFields will be sent to the server as
  486. // null. It is an error if a field in this list has a non-empty value.
  487. // This may be used to include null fields in Patch requests.
  488. NullFields []string `json:"-"`
  489. }
  490. func (s *AsyncBatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) {
  491. type NoMethod AsyncBatchAnnotateFilesResponse
  492. raw := NoMethod(*s)
  493. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  494. }
  495. // BatchAnnotateImagesRequest: Multiple image annotation requests are
  496. // batched into a single service call.
  497. type BatchAnnotateImagesRequest struct {
  498. // Requests: Individual image annotation requests for this batch.
  499. Requests []*AnnotateImageRequest `json:"requests,omitempty"`
  500. // ForceSendFields is a list of field names (e.g. "Requests") to
  501. // unconditionally include in API requests. By default, fields with
  502. // empty values are omitted from API requests. However, any non-pointer,
  503. // non-interface field appearing in ForceSendFields will be sent to the
  504. // server regardless of whether the field is empty or not. This may be
  505. // used to include empty fields in Patch requests.
  506. ForceSendFields []string `json:"-"`
  507. // NullFields is a list of field names (e.g. "Requests") to include in
  508. // API requests with the JSON null value. By default, fields with empty
  509. // values are omitted from API requests. However, any field with an
  510. // empty value appearing in NullFields will be sent to the server as
  511. // null. It is an error if a field in this list has a non-empty value.
  512. // This may be used to include null fields in Patch requests.
  513. NullFields []string `json:"-"`
  514. }
  515. func (s *BatchAnnotateImagesRequest) MarshalJSON() ([]byte, error) {
  516. type NoMethod BatchAnnotateImagesRequest
  517. raw := NoMethod(*s)
  518. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  519. }
  520. // BatchAnnotateImagesResponse: Response to a batch image annotation
  521. // request.
  522. type BatchAnnotateImagesResponse struct {
  523. // Responses: Individual responses to image annotation requests within
  524. // the batch.
  525. Responses []*AnnotateImageResponse `json:"responses,omitempty"`
  526. // ServerResponse contains the HTTP response code and headers from the
  527. // server.
  528. googleapi.ServerResponse `json:"-"`
  529. // ForceSendFields is a list of field names (e.g. "Responses") to
  530. // unconditionally include in API requests. By default, fields with
  531. // empty values are omitted from API requests. However, any non-pointer,
  532. // non-interface field appearing in ForceSendFields will be sent to the
  533. // server regardless of whether the field is empty or not. This may be
  534. // used to include empty fields in Patch requests.
  535. ForceSendFields []string `json:"-"`
  536. // NullFields is a list of field names (e.g. "Responses") to include in
  537. // API requests with the JSON null value. By default, fields with empty
  538. // values are omitted from API requests. However, any field with an
  539. // empty value appearing in NullFields will be sent to the server as
  540. // null. It is an error if a field in this list has a non-empty value.
  541. // This may be used to include null fields in Patch requests.
  542. NullFields []string `json:"-"`
  543. }
  544. func (s *BatchAnnotateImagesResponse) MarshalJSON() ([]byte, error) {
  545. type NoMethod BatchAnnotateImagesResponse
  546. raw := NoMethod(*s)
  547. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  548. }
  549. // BatchOperationMetadata: Metadata for the batch operations such as the
  550. // current state.
  551. //
  552. // This is included in the `metadata` field of the `Operation` returned
  553. // by the
  554. // `GetOperation` call of the `google::longrunning::Operations` service.
  555. type BatchOperationMetadata struct {
  556. // EndTime: The time when the batch request is finished
  557. // and
  558. // google.longrunning.Operation.done is set to true.
  559. EndTime string `json:"endTime,omitempty"`
  560. // State: The current state of the batch operation.
  561. //
  562. // Possible values:
  563. // "STATE_UNSPECIFIED" - Invalid.
  564. // "PROCESSING" - Request is actively being processed.
  565. // "SUCCESSFUL" - The request is done and at least one item has been
  566. // successfully
  567. // processed.
  568. // "FAILED" - The request is done and no item has been successfully
  569. // processed.
  570. // "CANCELLED" - The request is done after the
  571. // longrunning.Operations.CancelOperation has
  572. // been called by the user. Any records that were processed before
  573. // the
  574. // cancel command are output as specified in the request.
  575. State string `json:"state,omitempty"`
  576. // SubmitTime: The time when the batch request was submitted to the
  577. // server.
  578. SubmitTime string `json:"submitTime,omitempty"`
  579. // ForceSendFields is a list of field names (e.g. "EndTime") to
  580. // unconditionally include in API requests. By default, fields with
  581. // empty values are omitted from API requests. However, any non-pointer,
  582. // non-interface field appearing in ForceSendFields will be sent to the
  583. // server regardless of whether the field is empty or not. This may be
  584. // used to include empty fields in Patch requests.
  585. ForceSendFields []string `json:"-"`
  586. // NullFields is a list of field names (e.g. "EndTime") to include in
  587. // API requests with the JSON null value. By default, fields with empty
  588. // values are omitted from API requests. However, any field with an
  589. // empty value appearing in NullFields will be sent to the server as
  590. // null. It is an error if a field in this list has a non-empty value.
  591. // This may be used to include null fields in Patch requests.
  592. NullFields []string `json:"-"`
  593. }
  594. func (s *BatchOperationMetadata) MarshalJSON() ([]byte, error) {
  595. type NoMethod BatchOperationMetadata
  596. raw := NoMethod(*s)
  597. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  598. }
  599. // Block: Logical element on the page.
  600. type Block struct {
  601. // BlockType: Detected block type (text, image etc) for this block.
  602. //
  603. // Possible values:
  604. // "UNKNOWN" - Unknown block type.
  605. // "TEXT" - Regular text block.
  606. // "TABLE" - Table block.
  607. // "PICTURE" - Image block.
  608. // "RULER" - Horizontal/vertical line box.
  609. // "BARCODE" - Barcode block.
  610. BlockType string `json:"blockType,omitempty"`
  611. // BoundingBox: The bounding box for the block.
  612. // The vertices are in the order of top-left, top-right,
  613. // bottom-right,
  614. // bottom-left. When a rotation of the bounding box is detected the
  615. // rotation
  616. // is represented as around the top-left corner as defined when the text
  617. // is
  618. // read in the 'natural' orientation.
  619. // For example:
  620. //
  621. // * when the text is horizontal it might look like:
  622. //
  623. // 0----1
  624. // | |
  625. // 3----2
  626. //
  627. // * when it's rotated 180 degrees around the top-left corner it
  628. // becomes:
  629. //
  630. // 2----3
  631. // | |
  632. // 1----0
  633. //
  634. // and the vertex order will still be (0, 1, 2, 3).
  635. BoundingBox *BoundingPoly `json:"boundingBox,omitempty"`
  636. // Confidence: Confidence of the OCR results on the block. Range [0, 1].
  637. Confidence float64 `json:"confidence,omitempty"`
  638. // Paragraphs: List of paragraphs in this block (if this blocks is of
  639. // type text).
  640. Paragraphs []*Paragraph `json:"paragraphs,omitempty"`
  641. // Property: Additional information detected for the block.
  642. Property *TextProperty `json:"property,omitempty"`
  643. // ForceSendFields is a list of field names (e.g. "BlockType") to
  644. // unconditionally include in API requests. By default, fields with
  645. // empty values are omitted from API requests. However, any non-pointer,
  646. // non-interface field appearing in ForceSendFields will be sent to the
  647. // server regardless of whether the field is empty or not. This may be
  648. // used to include empty fields in Patch requests.
  649. ForceSendFields []string `json:"-"`
  650. // NullFields is a list of field names (e.g. "BlockType") to include in
  651. // API requests with the JSON null value. By default, fields with empty
  652. // values are omitted from API requests. However, any field with an
  653. // empty value appearing in NullFields will be sent to the server as
  654. // null. It is an error if a field in this list has a non-empty value.
  655. // This may be used to include null fields in Patch requests.
  656. NullFields []string `json:"-"`
  657. }
  658. func (s *Block) MarshalJSON() ([]byte, error) {
  659. type NoMethod Block
  660. raw := NoMethod(*s)
  661. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  662. }
  663. func (s *Block) UnmarshalJSON(data []byte) error {
  664. type NoMethod Block
  665. var s1 struct {
  666. Confidence gensupport.JSONFloat64 `json:"confidence"`
  667. *NoMethod
  668. }
  669. s1.NoMethod = (*NoMethod)(s)
  670. if err := json.Unmarshal(data, &s1); err != nil {
  671. return err
  672. }
  673. s.Confidence = float64(s1.Confidence)
  674. return nil
  675. }
  676. // BoundingPoly: A bounding polygon for the detected image annotation.
  677. type BoundingPoly struct {
  678. // NormalizedVertices: The bounding polygon normalized vertices.
  679. NormalizedVertices []*NormalizedVertex `json:"normalizedVertices,omitempty"`
  680. // Vertices: The bounding polygon vertices.
  681. Vertices []*Vertex `json:"vertices,omitempty"`
  682. // ForceSendFields is a list of field names (e.g. "NormalizedVertices")
  683. // to unconditionally include in API requests. By default, fields with
  684. // empty values are omitted from API requests. However, any non-pointer,
  685. // non-interface field appearing in ForceSendFields will be sent to the
  686. // server regardless of whether the field is empty or not. This may be
  687. // used to include empty fields in Patch requests.
  688. ForceSendFields []string `json:"-"`
  689. // NullFields is a list of field names (e.g. "NormalizedVertices") to
  690. // include in API requests with the JSON null value. By default, fields
  691. // with empty values are omitted from API requests. However, any field
  692. // with an empty value appearing in NullFields will be sent to the
  693. // server as null. It is an error if a field in this list has a
  694. // non-empty value. This may be used to include null fields in Patch
  695. // requests.
  696. NullFields []string `json:"-"`
  697. }
  698. func (s *BoundingPoly) MarshalJSON() ([]byte, error) {
  699. type NoMethod BoundingPoly
  700. raw := NoMethod(*s)
  701. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  702. }
  703. // CancelOperationRequest: The request message for
  704. // Operations.CancelOperation.
  705. type CancelOperationRequest struct {
  706. }
  707. // Color: Represents a color in the RGBA color space. This
  708. // representation is designed
  709. // for simplicity of conversion to/from color representations in
  710. // various
  711. // languages over compactness; for example, the fields of this
  712. // representation
  713. // can be trivially provided to the constructor of "java.awt.Color" in
  714. // Java; it
  715. // can also be trivially provided to UIColor's
  716. // "+colorWithRed:green:blue:alpha"
  717. // method in iOS; and, with just a little work, it can be easily
  718. // formatted into
  719. // a CSS "rgba()" string in JavaScript, as well.
  720. //
  721. // Note: this proto does not carry information about the absolute color
  722. // space
  723. // that should be used to interpret the RGB value (e.g. sRGB, Adobe
  724. // RGB,
  725. // DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the
  726. // sRGB color
  727. // space.
  728. //
  729. // Example (Java):
  730. //
  731. // import com.google.type.Color;
  732. //
  733. // // ...
  734. // public static java.awt.Color fromProto(Color protocolor) {
  735. // float alpha = protocolor.hasAlpha()
  736. // ? protocolor.getAlpha().getValue()
  737. // : 1.0;
  738. //
  739. // return new java.awt.Color(
  740. // protocolor.getRed(),
  741. // protocolor.getGreen(),
  742. // protocolor.getBlue(),
  743. // alpha);
  744. // }
  745. //
  746. // public static Color toProto(java.awt.Color color) {
  747. // float red = (float) color.getRed();
  748. // float green = (float) color.getGreen();
  749. // float blue = (float) color.getBlue();
  750. // float denominator = 255.0;
  751. // Color.Builder resultBuilder =
  752. // Color
  753. // .newBuilder()
  754. // .setRed(red / denominator)
  755. // .setGreen(green / denominator)
  756. // .setBlue(blue / denominator);
  757. // int alpha = color.getAlpha();
  758. // if (alpha != 255) {
  759. // result.setAlpha(
  760. // FloatValue
  761. // .newBuilder()
  762. // .setValue(((float) alpha) / denominator)
  763. // .build());
  764. // }
  765. // return resultBuilder.build();
  766. // }
  767. // // ...
  768. //
  769. // Example (iOS / Obj-C):
  770. //
  771. // // ...
  772. // static UIColor* fromProto(Color* protocolor) {
  773. // float red = [protocolor red];
  774. // float green = [protocolor green];
  775. // float blue = [protocolor blue];
  776. // FloatValue* alpha_wrapper = [protocolor alpha];
  777. // float alpha = 1.0;
  778. // if (alpha_wrapper != nil) {
  779. // alpha = [alpha_wrapper value];
  780. // }
  781. // return [UIColor colorWithRed:red green:green blue:blue
  782. // alpha:alpha];
  783. // }
  784. //
  785. // static Color* toProto(UIColor* color) {
  786. // CGFloat red, green, blue, alpha;
  787. // if (![color getRed:&red green:&green blue:&blue
  788. // alpha:&alpha]) {
  789. // return nil;
  790. // }
  791. // Color* result = [[Color alloc] init];
  792. // [result setRed:red];
  793. // [result setGreen:green];
  794. // [result setBlue:blue];
  795. // if (alpha <= 0.9999) {
  796. // [result setAlpha:floatWrapperWithValue(alpha)];
  797. // }
  798. // [result autorelease];
  799. // return result;
  800. // }
  801. // // ...
  802. //
  803. // Example (JavaScript):
  804. //
  805. // // ...
  806. //
  807. // var protoToCssColor = function(rgb_color) {
  808. // var redFrac = rgb_color.red || 0.0;
  809. // var greenFrac = rgb_color.green || 0.0;
  810. // var blueFrac = rgb_color.blue || 0.0;
  811. // var red = Math.floor(redFrac * 255);
  812. // var green = Math.floor(greenFrac * 255);
  813. // var blue = Math.floor(blueFrac * 255);
  814. //
  815. // if (!('alpha' in rgb_color)) {
  816. // return rgbToCssColor_(red, green, blue);
  817. // }
  818. //
  819. // var alphaFrac = rgb_color.alpha.value || 0.0;
  820. // var rgbParams = [red, green, blue].join(',');
  821. // return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
  822. // };
  823. //
  824. // var rgbToCssColor_ = function(red, green, blue) {
  825. // var rgbNumber = new Number((red << 16) | (green << 8) | blue);
  826. // var hexString = rgbNumber.toString(16);
  827. // var missingZeros = 6 - hexString.length;
  828. // var resultBuilder = ['#'];
  829. // for (var i = 0; i < missingZeros; i++) {
  830. // resultBuilder.push('0');
  831. // }
  832. // resultBuilder.push(hexString);
  833. // return resultBuilder.join('');
  834. // };
  835. //
  836. // // ...
  837. type Color struct {
  838. // Alpha: The fraction of this color that should be applied to the
  839. // pixel. That is,
  840. // the final pixel color is defined by the equation:
  841. //
  842. // pixel color = alpha * (this color) + (1.0 - alpha) * (background
  843. // color)
  844. //
  845. // This means that a value of 1.0 corresponds to a solid color,
  846. // whereas
  847. // a value of 0.0 corresponds to a completely transparent color.
  848. // This
  849. // uses a wrapper message rather than a simple float scalar so that it
  850. // is
  851. // possible to distinguish between a default value and the value being
  852. // unset.
  853. // If omitted, this color object is to be rendered as a solid color
  854. // (as if the alpha value had been explicitly given with a value of
  855. // 1.0).
  856. Alpha float64 `json:"alpha,omitempty"`
  857. // Blue: The amount of blue in the color as a value in the interval [0,
  858. // 1].
  859. Blue float64 `json:"blue,omitempty"`
  860. // Green: The amount of green in the color as a value in the interval
  861. // [0, 1].
  862. Green float64 `json:"green,omitempty"`
  863. // Red: The amount of red in the color as a value in the interval [0,
  864. // 1].
  865. Red float64 `json:"red,omitempty"`
  866. // ForceSendFields is a list of field names (e.g. "Alpha") to
  867. // unconditionally include in API requests. By default, fields with
  868. // empty values are omitted from API requests. However, any non-pointer,
  869. // non-interface field appearing in ForceSendFields will be sent to the
  870. // server regardless of whether the field is empty or not. This may be
  871. // used to include empty fields in Patch requests.
  872. ForceSendFields []string `json:"-"`
  873. // NullFields is a list of field names (e.g. "Alpha") to include in API
  874. // requests with the JSON null value. By default, fields with empty
  875. // values are omitted from API requests. However, any field with an
  876. // empty value appearing in NullFields will be sent to the server as
  877. // null. It is an error if a field in this list has a non-empty value.
  878. // This may be used to include null fields in Patch requests.
  879. NullFields []string `json:"-"`
  880. }
  881. func (s *Color) MarshalJSON() ([]byte, error) {
  882. type NoMethod Color
  883. raw := NoMethod(*s)
  884. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  885. }
  886. func (s *Color) UnmarshalJSON(data []byte) error {
  887. type NoMethod Color
  888. var s1 struct {
  889. Alpha gensupport.JSONFloat64 `json:"alpha"`
  890. Blue gensupport.JSONFloat64 `json:"blue"`
  891. Green gensupport.JSONFloat64 `json:"green"`
  892. Red gensupport.JSONFloat64 `json:"red"`
  893. *NoMethod
  894. }
  895. s1.NoMethod = (*NoMethod)(s)
  896. if err := json.Unmarshal(data, &s1); err != nil {
  897. return err
  898. }
  899. s.Alpha = float64(s1.Alpha)
  900. s.Blue = float64(s1.Blue)
  901. s.Green = float64(s1.Green)
  902. s.Red = float64(s1.Red)
  903. return nil
  904. }
  905. // ColorInfo: Color information consists of RGB channels, score, and the
  906. // fraction of
  907. // the image that the color occupies in the image.
  908. type ColorInfo struct {
  909. // Color: RGB components of the color.
  910. Color *Color `json:"color,omitempty"`
  911. // PixelFraction: The fraction of pixels the color occupies in the
  912. // image.
  913. // Value in range [0, 1].
  914. PixelFraction float64 `json:"pixelFraction,omitempty"`
  915. // Score: Image-specific score for this color. Value in range [0, 1].
  916. Score float64 `json:"score,omitempty"`
  917. // ForceSendFields is a list of field names (e.g. "Color") to
  918. // unconditionally include in API requests. By default, fields with
  919. // empty values are omitted from API requests. However, any non-pointer,
  920. // non-interface field appearing in ForceSendFields will be sent to the
  921. // server regardless of whether the field is empty or not. This may be
  922. // used to include empty fields in Patch requests.
  923. ForceSendFields []string `json:"-"`
  924. // NullFields is a list of field names (e.g. "Color") to include in API
  925. // requests with the JSON null value. By default, fields with empty
  926. // values are omitted from API requests. However, any field with an
  927. // empty value appearing in NullFields will be sent to the server as
  928. // null. It is an error if a field in this list has a non-empty value.
  929. // This may be used to include null fields in Patch requests.
  930. NullFields []string `json:"-"`
  931. }
  932. func (s *ColorInfo) MarshalJSON() ([]byte, error) {
  933. type NoMethod ColorInfo
  934. raw := NoMethod(*s)
  935. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  936. }
  937. func (s *ColorInfo) UnmarshalJSON(data []byte) error {
  938. type NoMethod ColorInfo
  939. var s1 struct {
  940. PixelFraction gensupport.JSONFloat64 `json:"pixelFraction"`
  941. Score gensupport.JSONFloat64 `json:"score"`
  942. *NoMethod
  943. }
  944. s1.NoMethod = (*NoMethod)(s)
  945. if err := json.Unmarshal(data, &s1); err != nil {
  946. return err
  947. }
  948. s.PixelFraction = float64(s1.PixelFraction)
  949. s.Score = float64(s1.Score)
  950. return nil
  951. }
  952. // CropHint: Single crop hint that is used to generate a new crop when
  953. // serving an image.
  954. type CropHint struct {
  955. // BoundingPoly: The bounding polygon for the crop region. The
  956. // coordinates of the bounding
  957. // box are in the original image's scale.
  958. BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"`
  959. // Confidence: Confidence of this being a salient region. Range [0, 1].
  960. Confidence float64 `json:"confidence,omitempty"`
  961. // ImportanceFraction: Fraction of importance of this salient region
  962. // with respect to the original
  963. // image.
  964. ImportanceFraction float64 `json:"importanceFraction,omitempty"`
  965. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  966. // unconditionally include in API requests. By default, fields with
  967. // empty values are omitted from API requests. However, any non-pointer,
  968. // non-interface field appearing in ForceSendFields will be sent to the
  969. // server regardless of whether the field is empty or not. This may be
  970. // used to include empty fields in Patch requests.
  971. ForceSendFields []string `json:"-"`
  972. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  973. // in API requests with the JSON null value. By default, fields with
  974. // empty values are omitted from API requests. However, any field with
  975. // an empty value appearing in NullFields will be sent to the server as
  976. // null. It is an error if a field in this list has a non-empty value.
  977. // This may be used to include null fields in Patch requests.
  978. NullFields []string `json:"-"`
  979. }
  980. func (s *CropHint) MarshalJSON() ([]byte, error) {
  981. type NoMethod CropHint
  982. raw := NoMethod(*s)
  983. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  984. }
  985. func (s *CropHint) UnmarshalJSON(data []byte) error {
  986. type NoMethod CropHint
  987. var s1 struct {
  988. Confidence gensupport.JSONFloat64 `json:"confidence"`
  989. ImportanceFraction gensupport.JSONFloat64 `json:"importanceFraction"`
  990. *NoMethod
  991. }
  992. s1.NoMethod = (*NoMethod)(s)
  993. if err := json.Unmarshal(data, &s1); err != nil {
  994. return err
  995. }
  996. s.Confidence = float64(s1.Confidence)
  997. s.ImportanceFraction = float64(s1.ImportanceFraction)
  998. return nil
  999. }
  1000. // CropHintsAnnotation: Set of crop hints that are used to generate new
  1001. // crops when serving images.
  1002. type CropHintsAnnotation struct {
  1003. // CropHints: Crop hint results.
  1004. CropHints []*CropHint `json:"cropHints,omitempty"`
  1005. // ForceSendFields is a list of field names (e.g. "CropHints") to
  1006. // unconditionally include in API requests. By default, fields with
  1007. // empty values are omitted from API requests. However, any non-pointer,
  1008. // non-interface field appearing in ForceSendFields will be sent to the
  1009. // server regardless of whether the field is empty or not. This may be
  1010. // used to include empty fields in Patch requests.
  1011. ForceSendFields []string `json:"-"`
  1012. // NullFields is a list of field names (e.g. "CropHints") to include in
  1013. // API requests with the JSON null value. By default, fields with empty
  1014. // values are omitted from API requests. However, any field with an
  1015. // empty value appearing in NullFields will be sent to the server as
  1016. // null. It is an error if a field in this list has a non-empty value.
  1017. // This may be used to include null fields in Patch requests.
  1018. NullFields []string `json:"-"`
  1019. }
  1020. func (s *CropHintsAnnotation) MarshalJSON() ([]byte, error) {
  1021. type NoMethod CropHintsAnnotation
  1022. raw := NoMethod(*s)
  1023. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1024. }
  1025. // CropHintsParams: Parameters for crop hints annotation request.
  1026. type CropHintsParams struct {
  1027. // AspectRatios: Aspect ratios in floats, representing the ratio of the
  1028. // width to the height
  1029. // of the image. For example, if the desired aspect ratio is 4/3,
  1030. // the
  1031. // corresponding float value should be 1.33333. If not specified,
  1032. // the
  1033. // best possible crop is returned. The number of provided aspect ratios
  1034. // is
  1035. // limited to a maximum of 16; any aspect ratios provided after the 16th
  1036. // are
  1037. // ignored.
  1038. AspectRatios []float64 `json:"aspectRatios,omitempty"`
  1039. // ForceSendFields is a list of field names (e.g. "AspectRatios") to
  1040. // unconditionally include in API requests. By default, fields with
  1041. // empty values are omitted from API requests. However, any non-pointer,
  1042. // non-interface field appearing in ForceSendFields will be sent to the
  1043. // server regardless of whether the field is empty or not. This may be
  1044. // used to include empty fields in Patch requests.
  1045. ForceSendFields []string `json:"-"`
  1046. // NullFields is a list of field names (e.g. "AspectRatios") to include
  1047. // in API requests with the JSON null value. By default, fields with
  1048. // empty values are omitted from API requests. However, any field with
  1049. // an empty value appearing in NullFields will be sent to the server as
  1050. // null. It is an error if a field in this list has a non-empty value.
  1051. // This may be used to include null fields in Patch requests.
  1052. NullFields []string `json:"-"`
  1053. }
  1054. func (s *CropHintsParams) MarshalJSON() ([]byte, error) {
  1055. type NoMethod CropHintsParams
  1056. raw := NoMethod(*s)
  1057. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1058. }
  1059. // DetectedBreak: Detected start or end of a structural component.
  1060. type DetectedBreak struct {
  1061. // IsPrefix: True if break prepends the element.
  1062. IsPrefix bool `json:"isPrefix,omitempty"`
  1063. // Type: Detected break type.
  1064. //
  1065. // Possible values:
  1066. // "UNKNOWN" - Unknown break label type.
  1067. // "SPACE" - Regular space.
  1068. // "SURE_SPACE" - Sure space (very wide).
  1069. // "EOL_SURE_SPACE" - Line-wrapping break.
  1070. // "HYPHEN" - End-line hyphen that is not present in text; does not
  1071. // co-occur with
  1072. // `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`.
  1073. // "LINE_BREAK" - Line break that ends a paragraph.
  1074. Type string `json:"type,omitempty"`
  1075. // ForceSendFields is a list of field names (e.g. "IsPrefix") to
  1076. // unconditionally include in API requests. By default, fields with
  1077. // empty values are omitted from API requests. However, any non-pointer,
  1078. // non-interface field appearing in ForceSendFields will be sent to the
  1079. // server regardless of whether the field is empty or not. This may be
  1080. // used to include empty fields in Patch requests.
  1081. ForceSendFields []string `json:"-"`
  1082. // NullFields is a list of field names (e.g. "IsPrefix") to include in
  1083. // API requests with the JSON null value. By default, fields with empty
  1084. // values are omitted from API requests. However, any field with an
  1085. // empty value appearing in NullFields will be sent to the server as
  1086. // null. It is an error if a field in this list has a non-empty value.
  1087. // This may be used to include null fields in Patch requests.
  1088. NullFields []string `json:"-"`
  1089. }
  1090. func (s *DetectedBreak) MarshalJSON() ([]byte, error) {
  1091. type NoMethod DetectedBreak
  1092. raw := NoMethod(*s)
  1093. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1094. }
  1095. // DetectedLanguage: Detected language for a structural component.
  1096. type DetectedLanguage struct {
  1097. // Confidence: Confidence of detected language. Range [0, 1].
  1098. Confidence float64 `json:"confidence,omitempty"`
  1099. // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn".
  1100. // For more
  1101. // information,
  1102. // see
  1103. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  1104. LanguageCode string `json:"languageCode,omitempty"`
  1105. // ForceSendFields is a list of field names (e.g. "Confidence") to
  1106. // unconditionally include in API requests. By default, fields with
  1107. // empty values are omitted from API requests. However, any non-pointer,
  1108. // non-interface field appearing in ForceSendFields will be sent to the
  1109. // server regardless of whether the field is empty or not. This may be
  1110. // used to include empty fields in Patch requests.
  1111. ForceSendFields []string `json:"-"`
  1112. // NullFields is a list of field names (e.g. "Confidence") to include in
  1113. // API requests with the JSON null value. By default, fields with empty
  1114. // values are omitted from API requests. However, any field with an
  1115. // empty value appearing in NullFields will be sent to the server as
  1116. // null. It is an error if a field in this list has a non-empty value.
  1117. // This may be used to include null fields in Patch requests.
  1118. NullFields []string `json:"-"`
  1119. }
  1120. func (s *DetectedLanguage) MarshalJSON() ([]byte, error) {
  1121. type NoMethod DetectedLanguage
  1122. raw := NoMethod(*s)
  1123. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1124. }
  1125. func (s *DetectedLanguage) UnmarshalJSON(data []byte) error {
  1126. type NoMethod DetectedLanguage
  1127. var s1 struct {
  1128. Confidence gensupport.JSONFloat64 `json:"confidence"`
  1129. *NoMethod
  1130. }
  1131. s1.NoMethod = (*NoMethod)(s)
  1132. if err := json.Unmarshal(data, &s1); err != nil {
  1133. return err
  1134. }
  1135. s.Confidence = float64(s1.Confidence)
  1136. return nil
  1137. }
  1138. // DominantColorsAnnotation: Set of dominant colors and their
  1139. // corresponding scores.
  1140. type DominantColorsAnnotation struct {
  1141. // Colors: RGB color values with their score and pixel fraction.
  1142. Colors []*ColorInfo `json:"colors,omitempty"`
  1143. // ForceSendFields is a list of field names (e.g. "Colors") to
  1144. // unconditionally include in API requests. By default, fields with
  1145. // empty values are omitted from API requests. However, any non-pointer,
  1146. // non-interface field appearing in ForceSendFields will be sent to the
  1147. // server regardless of whether the field is empty or not. This may be
  1148. // used to include empty fields in Patch requests.
  1149. ForceSendFields []string `json:"-"`
  1150. // NullFields is a list of field names (e.g. "Colors") to include in API
  1151. // requests with the JSON null value. By default, fields with empty
  1152. // values are omitted from API requests. However, any field with an
  1153. // empty value appearing in NullFields will be sent to the server as
  1154. // null. It is an error if a field in this list has a non-empty value.
  1155. // This may be used to include null fields in Patch requests.
  1156. NullFields []string `json:"-"`
  1157. }
  1158. func (s *DominantColorsAnnotation) MarshalJSON() ([]byte, error) {
  1159. type NoMethod DominantColorsAnnotation
  1160. raw := NoMethod(*s)
  1161. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1162. }
  1163. // Empty: A generic empty message that you can re-use to avoid defining
  1164. // duplicated
  1165. // empty messages in your APIs. A typical example is to use it as the
  1166. // request
  1167. // or the response type of an API method. For instance:
  1168. //
  1169. // service Foo {
  1170. // rpc Bar(google.protobuf.Empty) returns
  1171. // (google.protobuf.Empty);
  1172. // }
  1173. //
  1174. // The JSON representation for `Empty` is empty JSON object `{}`.
  1175. type Empty struct {
  1176. // ServerResponse contains the HTTP response code and headers from the
  1177. // server.
  1178. googleapi.ServerResponse `json:"-"`
  1179. }
  1180. // EntityAnnotation: Set of detected entity features.
  1181. type EntityAnnotation struct {
  1182. // BoundingPoly: Image region to which this entity belongs. Not
  1183. // produced
  1184. // for `LABEL_DETECTION` features.
  1185. BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"`
  1186. // Confidence: **Deprecated. Use `score` instead.**
  1187. // The accuracy of the entity detection in an image.
  1188. // For example, for an image in which the "Eiffel Tower" entity is
  1189. // detected,
  1190. // this field represents the confidence that there is a tower in the
  1191. // query
  1192. // image. Range [0, 1].
  1193. Confidence float64 `json:"confidence,omitempty"`
  1194. // Description: Entity textual description, expressed in its `locale`
  1195. // language.
  1196. Description string `json:"description,omitempty"`
  1197. // Locale: The language code for the locale in which the entity
  1198. // textual
  1199. // `description` is expressed.
  1200. Locale string `json:"locale,omitempty"`
  1201. // Locations: The location information for the detected entity.
  1202. // Multiple
  1203. // `LocationInfo` elements can be present because one location
  1204. // may
  1205. // indicate the location of the scene in the image, and another
  1206. // location
  1207. // may indicate the location of the place where the image was
  1208. // taken.
  1209. // Location information is usually present for landmarks.
  1210. Locations []*LocationInfo `json:"locations,omitempty"`
  1211. // Mid: Opaque entity ID. Some IDs may be available in
  1212. // [Google Knowledge Graph
  1213. // Search
  1214. // API](https://developers.google.com/knowledge-graph/).
  1215. Mid string `json:"mid,omitempty"`
  1216. // Properties: Some entities may have optional user-supplied `Property`
  1217. // (name/value)
  1218. // fields, such a score or string that qualifies the entity.
  1219. Properties []*Property `json:"properties,omitempty"`
  1220. // Score: Overall score of the result. Range [0, 1].
  1221. Score float64 `json:"score,omitempty"`
  1222. // Topicality: The relevancy of the ICA (Image Content Annotation) label
  1223. // to the
  1224. // image. For example, the relevancy of "tower" is likely higher to an
  1225. // image
  1226. // containing the detected "Eiffel Tower" than to an image containing
  1227. // a
  1228. // detected distant towering building, even though the confidence
  1229. // that
  1230. // there is a tower in each image may be the same. Range [0, 1].
  1231. Topicality float64 `json:"topicality,omitempty"`
  1232. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  1233. // unconditionally include in API requests. By default, fields with
  1234. // empty values are omitted from API requests. However, any non-pointer,
  1235. // non-interface field appearing in ForceSendFields will be sent to the
  1236. // server regardless of whether the field is empty or not. This may be
  1237. // used to include empty fields in Patch requests.
  1238. ForceSendFields []string `json:"-"`
  1239. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  1240. // in API requests with the JSON null value. By default, fields with
  1241. // empty values are omitted from API requests. However, any field with
  1242. // an empty value appearing in NullFields will be sent to the server as
  1243. // null. It is an error if a field in this list has a non-empty value.
  1244. // This may be used to include null fields in Patch requests.
  1245. NullFields []string `json:"-"`
  1246. }
  1247. func (s *EntityAnnotation) MarshalJSON() ([]byte, error) {
  1248. type NoMethod EntityAnnotation
  1249. raw := NoMethod(*s)
  1250. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1251. }
  1252. func (s *EntityAnnotation) UnmarshalJSON(data []byte) error {
  1253. type NoMethod EntityAnnotation
  1254. var s1 struct {
  1255. Confidence gensupport.JSONFloat64 `json:"confidence"`
  1256. Score gensupport.JSONFloat64 `json:"score"`
  1257. Topicality gensupport.JSONFloat64 `json:"topicality"`
  1258. *NoMethod
  1259. }
  1260. s1.NoMethod = (*NoMethod)(s)
  1261. if err := json.Unmarshal(data, &s1); err != nil {
  1262. return err
  1263. }
  1264. s.Confidence = float64(s1.Confidence)
  1265. s.Score = float64(s1.Score)
  1266. s.Topicality = float64(s1.Topicality)
  1267. return nil
  1268. }
  1269. // FaceAnnotation: A face annotation object contains the results of face
  1270. // detection.
  1271. type FaceAnnotation struct {
  1272. // AngerLikelihood: Anger likelihood.
  1273. //
  1274. // Possible values:
  1275. // "UNKNOWN" - Unknown likelihood.
  1276. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1277. // specified vertical.
  1278. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1279. // vertical.
  1280. // "POSSIBLE" - It is possible that the image belongs to the specified
  1281. // vertical.
  1282. // "LIKELY" - It is likely that the image belongs to the specified
  1283. // vertical.
  1284. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1285. // specified vertical.
  1286. AngerLikelihood string `json:"angerLikelihood,omitempty"`
  1287. // BlurredLikelihood: Blurred likelihood.
  1288. //
  1289. // Possible values:
  1290. // "UNKNOWN" - Unknown likelihood.
  1291. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1292. // specified vertical.
  1293. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1294. // vertical.
  1295. // "POSSIBLE" - It is possible that the image belongs to the specified
  1296. // vertical.
  1297. // "LIKELY" - It is likely that the image belongs to the specified
  1298. // vertical.
  1299. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1300. // specified vertical.
  1301. BlurredLikelihood string `json:"blurredLikelihood,omitempty"`
  1302. // BoundingPoly: The bounding polygon around the face. The coordinates
  1303. // of the bounding box
  1304. // are in the original image's scale.
  1305. // The bounding box is computed to "frame" the face in accordance with
  1306. // human
  1307. // expectations. It is based on the landmarker results.
  1308. // Note that one or more x and/or y coordinates may not be generated in
  1309. // the
  1310. // `BoundingPoly` (the polygon will be unbounded) if only a partial
  1311. // face
  1312. // appears in the image to be annotated.
  1313. BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"`
  1314. // DetectionConfidence: Detection confidence. Range [0, 1].
  1315. DetectionConfidence float64 `json:"detectionConfidence,omitempty"`
  1316. // FdBoundingPoly: The `fd_bounding_poly` bounding polygon is tighter
  1317. // than the
  1318. // `boundingPoly`, and encloses only the skin part of the face.
  1319. // Typically, it
  1320. // is used to eliminate the face from any image analysis that detects
  1321. // the
  1322. // "amount of skin" visible in an image. It is not based on
  1323. // the
  1324. // landmarker results, only on the initial face detection, hence
  1325. // the <code>fd</code> (face detection) prefix.
  1326. FdBoundingPoly *BoundingPoly `json:"fdBoundingPoly,omitempty"`
  1327. // HeadwearLikelihood: Headwear likelihood.
  1328. //
  1329. // Possible values:
  1330. // "UNKNOWN" - Unknown likelihood.
  1331. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1332. // specified vertical.
  1333. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1334. // vertical.
  1335. // "POSSIBLE" - It is possible that the image belongs to the specified
  1336. // vertical.
  1337. // "LIKELY" - It is likely that the image belongs to the specified
  1338. // vertical.
  1339. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1340. // specified vertical.
  1341. HeadwearLikelihood string `json:"headwearLikelihood,omitempty"`
  1342. // JoyLikelihood: Joy likelihood.
  1343. //
  1344. // Possible values:
  1345. // "UNKNOWN" - Unknown likelihood.
  1346. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1347. // specified vertical.
  1348. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1349. // vertical.
  1350. // "POSSIBLE" - It is possible that the image belongs to the specified
  1351. // vertical.
  1352. // "LIKELY" - It is likely that the image belongs to the specified
  1353. // vertical.
  1354. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1355. // specified vertical.
  1356. JoyLikelihood string `json:"joyLikelihood,omitempty"`
  1357. // LandmarkingConfidence: Face landmarking confidence. Range [0, 1].
  1358. LandmarkingConfidence float64 `json:"landmarkingConfidence,omitempty"`
  1359. // Landmarks: Detected face landmarks.
  1360. Landmarks []*Landmark `json:"landmarks,omitempty"`
  1361. // PanAngle: Yaw angle, which indicates the leftward/rightward angle
  1362. // that the face is
  1363. // pointing relative to the vertical plane perpendicular to the image.
  1364. // Range
  1365. // [-180,180].
  1366. PanAngle float64 `json:"panAngle,omitempty"`
  1367. // RollAngle: Roll angle, which indicates the amount of
  1368. // clockwise/anti-clockwise rotation
  1369. // of the face relative to the image vertical about the axis
  1370. // perpendicular to
  1371. // the face. Range [-180,180].
  1372. RollAngle float64 `json:"rollAngle,omitempty"`
  1373. // SorrowLikelihood: Sorrow likelihood.
  1374. //
  1375. // Possible values:
  1376. // "UNKNOWN" - Unknown likelihood.
  1377. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1378. // specified vertical.
  1379. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1380. // vertical.
  1381. // "POSSIBLE" - It is possible that the image belongs to the specified
  1382. // vertical.
  1383. // "LIKELY" - It is likely that the image belongs to the specified
  1384. // vertical.
  1385. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1386. // specified vertical.
  1387. SorrowLikelihood string `json:"sorrowLikelihood,omitempty"`
  1388. // SurpriseLikelihood: Surprise likelihood.
  1389. //
  1390. // Possible values:
  1391. // "UNKNOWN" - Unknown likelihood.
  1392. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1393. // specified vertical.
  1394. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1395. // vertical.
  1396. // "POSSIBLE" - It is possible that the image belongs to the specified
  1397. // vertical.
  1398. // "LIKELY" - It is likely that the image belongs to the specified
  1399. // vertical.
  1400. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1401. // specified vertical.
  1402. SurpriseLikelihood string `json:"surpriseLikelihood,omitempty"`
  1403. // TiltAngle: Pitch angle, which indicates the upwards/downwards angle
  1404. // that the face is
  1405. // pointing relative to the image's horizontal plane. Range [-180,180].
  1406. TiltAngle float64 `json:"tiltAngle,omitempty"`
  1407. // UnderExposedLikelihood: Under-exposed likelihood.
  1408. //
  1409. // Possible values:
  1410. // "UNKNOWN" - Unknown likelihood.
  1411. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  1412. // specified vertical.
  1413. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  1414. // vertical.
  1415. // "POSSIBLE" - It is possible that the image belongs to the specified
  1416. // vertical.
  1417. // "LIKELY" - It is likely that the image belongs to the specified
  1418. // vertical.
  1419. // "VERY_LIKELY" - It is very likely that the image belongs to the
  1420. // specified vertical.
  1421. UnderExposedLikelihood string `json:"underExposedLikelihood,omitempty"`
  1422. // ForceSendFields is a list of field names (e.g. "AngerLikelihood") to
  1423. // unconditionally include in API requests. By default, fields with
  1424. // empty values are omitted from API requests. However, any non-pointer,
  1425. // non-interface field appearing in ForceSendFields will be sent to the
  1426. // server regardless of whether the field is empty or not. This may be
  1427. // used to include empty fields in Patch requests.
  1428. ForceSendFields []string `json:"-"`
  1429. // NullFields is a list of field names (e.g. "AngerLikelihood") to
  1430. // include in API requests with the JSON null value. By default, fields
  1431. // with empty values are omitted from API requests. However, any field
  1432. // with an empty value appearing in NullFields will be sent to the
  1433. // server as null. It is an error if a field in this list has a
  1434. // non-empty value. This may be used to include null fields in Patch
  1435. // requests.
  1436. NullFields []string `json:"-"`
  1437. }
  1438. func (s *FaceAnnotation) MarshalJSON() ([]byte, error) {
  1439. type NoMethod FaceAnnotation
  1440. raw := NoMethod(*s)
  1441. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1442. }
  1443. func (s *FaceAnnotation) UnmarshalJSON(data []byte) error {
  1444. type NoMethod FaceAnnotation
  1445. var s1 struct {
  1446. DetectionConfidence gensupport.JSONFloat64 `json:"detectionConfidence"`
  1447. LandmarkingConfidence gensupport.JSONFloat64 `json:"landmarkingConfidence"`
  1448. PanAngle gensupport.JSONFloat64 `json:"panAngle"`
  1449. RollAngle gensupport.JSONFloat64 `json:"rollAngle"`
  1450. TiltAngle gensupport.JSONFloat64 `json:"tiltAngle"`
  1451. *NoMethod
  1452. }
  1453. s1.NoMethod = (*NoMethod)(s)
  1454. if err := json.Unmarshal(data, &s1); err != nil {
  1455. return err
  1456. }
  1457. s.DetectionConfidence = float64(s1.DetectionConfidence)
  1458. s.LandmarkingConfidence = float64(s1.LandmarkingConfidence)
  1459. s.PanAngle = float64(s1.PanAngle)
  1460. s.RollAngle = float64(s1.RollAngle)
  1461. s.TiltAngle = float64(s1.TiltAngle)
  1462. return nil
  1463. }
  1464. // Feature: The type of Google Cloud Vision API detection to perform,
  1465. // and the maximum
  1466. // number of results to return for that type. Multiple `Feature` objects
  1467. // can
  1468. // be specified in the `features` list.
  1469. type Feature struct {
  1470. // MaxResults: Maximum number of results of this type. Does not apply
  1471. // to
  1472. // `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`.
  1473. MaxResults int64 `json:"maxResults,omitempty"`
  1474. // Model: Model to use for the feature.
  1475. // Supported values: "builtin/stable" (the default if unset)
  1476. // and
  1477. // "builtin/latest".
  1478. Model string `json:"model,omitempty"`
  1479. // Type: The feature type.
  1480. //
  1481. // Possible values:
  1482. // "TYPE_UNSPECIFIED" - Unspecified feature type.
  1483. // "FACE_DETECTION" - Run face detection.
  1484. // "LANDMARK_DETECTION" - Run landmark detection.
  1485. // "LOGO_DETECTION" - Run logo detection.
  1486. // "LABEL_DETECTION" - Run label detection.
  1487. // "TEXT_DETECTION" - Run text detection / optical character
  1488. // recognition (OCR). Text detection
  1489. // is optimized for areas of text within a larger image; if the image
  1490. // is
  1491. // a document, use `DOCUMENT_TEXT_DETECTION` instead.
  1492. // "DOCUMENT_TEXT_DETECTION" - Run dense text document OCR. Takes
  1493. // precedence when both
  1494. // `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` are present.
  1495. // "SAFE_SEARCH_DETECTION" - Run Safe Search to detect potentially
  1496. // unsafe
  1497. // or undesirable content.
  1498. // "IMAGE_PROPERTIES" - Compute a set of image properties, such as
  1499. // the
  1500. // image's dominant colors.
  1501. // "CROP_HINTS" - Run crop hints.
  1502. // "WEB_DETECTION" - Run web detection.
  1503. // "PRODUCT_SEARCH" - Run Product Search.
  1504. // "OBJECT_LOCALIZATION" - Run localizer for object detection.
  1505. Type string `json:"type,omitempty"`
  1506. // ForceSendFields is a list of field names (e.g. "MaxResults") to
  1507. // unconditionally include in API requests. By default, fields with
  1508. // empty values are omitted from API requests. However, any non-pointer,
  1509. // non-interface field appearing in ForceSendFields will be sent to the
  1510. // server regardless of whether the field is empty or not. This may be
  1511. // used to include empty fields in Patch requests.
  1512. ForceSendFields []string `json:"-"`
  1513. // NullFields is a list of field names (e.g. "MaxResults") to include in
  1514. // API requests with the JSON null value. By default, fields with empty
  1515. // values are omitted from API requests. However, any field with an
  1516. // empty value appearing in NullFields will be sent to the server as
  1517. // null. It is an error if a field in this list has a non-empty value.
  1518. // This may be used to include null fields in Patch requests.
  1519. NullFields []string `json:"-"`
  1520. }
  1521. func (s *Feature) MarshalJSON() ([]byte, error) {
  1522. type NoMethod Feature
  1523. raw := NoMethod(*s)
  1524. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1525. }
  1526. // GcsDestination: The Google Cloud Storage location where the output
  1527. // will be written to.
  1528. type GcsDestination struct {
  1529. // Uri: Google Cloud Storage URI where the results will be stored.
  1530. // Results will
  1531. // be in JSON format and preceded by its corresponding input URI. This
  1532. // field
  1533. // can either represent a single file, or a prefix for multiple
  1534. // outputs.
  1535. // Prefixes must end in a `/`.
  1536. //
  1537. // Examples:
  1538. //
  1539. // * File: gs://bucket-name/filename.json
  1540. // * Prefix: gs://bucket-name/prefix/here/
  1541. // * File: gs://bucket-name/prefix/here
  1542. //
  1543. // If multiple outputs, each response is still AnnotateFileResponse,
  1544. // each of
  1545. // which contains some subset of the full list of
  1546. // AnnotateImageResponse.
  1547. // Multiple outputs can happen if, for example, the output JSON is too
  1548. // large
  1549. // and overflows into multiple sharded files.
  1550. Uri string `json:"uri,omitempty"`
  1551. // ForceSendFields is a list of field names (e.g. "Uri") to
  1552. // unconditionally include in API requests. By default, fields with
  1553. // empty values are omitted from API requests. However, any non-pointer,
  1554. // non-interface field appearing in ForceSendFields will be sent to the
  1555. // server regardless of whether the field is empty or not. This may be
  1556. // used to include empty fields in Patch requests.
  1557. ForceSendFields []string `json:"-"`
  1558. // NullFields is a list of field names (e.g. "Uri") to include in API
  1559. // requests with the JSON null value. By default, fields with empty
  1560. // values are omitted from API requests. However, any field with an
  1561. // empty value appearing in NullFields will be sent to the server as
  1562. // null. It is an error if a field in this list has a non-empty value.
  1563. // This may be used to include null fields in Patch requests.
  1564. NullFields []string `json:"-"`
  1565. }
  1566. func (s *GcsDestination) MarshalJSON() ([]byte, error) {
  1567. type NoMethod GcsDestination
  1568. raw := NoMethod(*s)
  1569. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1570. }
  1571. // GcsSource: The Google Cloud Storage location where the input will be
  1572. // read from.
  1573. type GcsSource struct {
  1574. // Uri: Google Cloud Storage URI for the input file. This must only be
  1575. // a
  1576. // Google Cloud Storage object. Wildcards are not currently supported.
  1577. Uri string `json:"uri,omitempty"`
  1578. // ForceSendFields is a list of field names (e.g. "Uri") to
  1579. // unconditionally include in API requests. By default, fields with
  1580. // empty values are omitted from API requests. However, any non-pointer,
  1581. // non-interface field appearing in ForceSendFields will be sent to the
  1582. // server regardless of whether the field is empty or not. This may be
  1583. // used to include empty fields in Patch requests.
  1584. ForceSendFields []string `json:"-"`
  1585. // NullFields is a list of field names (e.g. "Uri") to include in API
  1586. // requests with the JSON null value. By default, fields with empty
  1587. // values are omitted from API requests. However, any field with an
  1588. // empty value appearing in NullFields will be sent to the server as
  1589. // null. It is an error if a field in this list has a non-empty value.
  1590. // This may be used to include null fields in Patch requests.
  1591. NullFields []string `json:"-"`
  1592. }
  1593. func (s *GcsSource) MarshalJSON() ([]byte, error) {
  1594. type NoMethod GcsSource
  1595. raw := NoMethod(*s)
  1596. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1597. }
  1598. // GoogleCloudVisionV1p1beta1AnnotateFileResponse: Response to a single
  1599. // file annotation request. A file may contain one or more
  1600. // images, which individually have their own responses.
  1601. type GoogleCloudVisionV1p1beta1AnnotateFileResponse struct {
  1602. // InputConfig: Information about the file for which this response is
  1603. // generated.
  1604. InputConfig *GoogleCloudVisionV1p1beta1InputConfig `json:"inputConfig,omitempty"`
  1605. // Responses: Individual responses to images found within the file.
  1606. Responses []*GoogleCloudVisionV1p1beta1AnnotateImageResponse `json:"responses,omitempty"`
  1607. // ForceSendFields is a list of field names (e.g. "InputConfig") to
  1608. // unconditionally include in API requests. By default, fields with
  1609. // empty values are omitted from API requests. However, any non-pointer,
  1610. // non-interface field appearing in ForceSendFields will be sent to the
  1611. // server regardless of whether the field is empty or not. This may be
  1612. // used to include empty fields in Patch requests.
  1613. ForceSendFields []string `json:"-"`
  1614. // NullFields is a list of field names (e.g. "InputConfig") to include
  1615. // in API requests with the JSON null value. By default, fields with
  1616. // empty values are omitted from API requests. However, any field with
  1617. // an empty value appearing in NullFields will be sent to the server as
  1618. // null. It is an error if a field in this list has a non-empty value.
  1619. // This may be used to include null fields in Patch requests.
  1620. NullFields []string `json:"-"`
  1621. }
  1622. func (s *GoogleCloudVisionV1p1beta1AnnotateFileResponse) MarshalJSON() ([]byte, error) {
  1623. type NoMethod GoogleCloudVisionV1p1beta1AnnotateFileResponse
  1624. raw := NoMethod(*s)
  1625. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1626. }
  1627. // GoogleCloudVisionV1p1beta1AnnotateImageResponse: Response to an image
  1628. // annotation request.
  1629. type GoogleCloudVisionV1p1beta1AnnotateImageResponse struct {
  1630. // Context: If present, contextual information is needed to understand
  1631. // where this image
  1632. // comes from.
  1633. Context *GoogleCloudVisionV1p1beta1ImageAnnotationContext `json:"context,omitempty"`
  1634. // CropHintsAnnotation: If present, crop hints have completed
  1635. // successfully.
  1636. CropHintsAnnotation *GoogleCloudVisionV1p1beta1CropHintsAnnotation `json:"cropHintsAnnotation,omitempty"`
  1637. // Error: If set, represents the error message for the operation.
  1638. // Note that filled-in image annotations are guaranteed to be
  1639. // correct, even when `error` is set.
  1640. Error *Status `json:"error,omitempty"`
  1641. // FaceAnnotations: If present, face detection has completed
  1642. // successfully.
  1643. FaceAnnotations []*GoogleCloudVisionV1p1beta1FaceAnnotation `json:"faceAnnotations,omitempty"`
  1644. // FullTextAnnotation: If present, text (OCR) detection or document
  1645. // (OCR) text detection has
  1646. // completed successfully.
  1647. // This annotation provides the structural hierarchy for the OCR
  1648. // detected
  1649. // text.
  1650. FullTextAnnotation *GoogleCloudVisionV1p1beta1TextAnnotation `json:"fullTextAnnotation,omitempty"`
  1651. // ImagePropertiesAnnotation: If present, image properties were
  1652. // extracted successfully.
  1653. ImagePropertiesAnnotation *GoogleCloudVisionV1p1beta1ImageProperties `json:"imagePropertiesAnnotation,omitempty"`
  1654. // LabelAnnotations: If present, label detection has completed
  1655. // successfully.
  1656. LabelAnnotations []*GoogleCloudVisionV1p1beta1EntityAnnotation `json:"labelAnnotations,omitempty"`
  1657. // LandmarkAnnotations: If present, landmark detection has completed
  1658. // successfully.
  1659. LandmarkAnnotations []*GoogleCloudVisionV1p1beta1EntityAnnotation `json:"landmarkAnnotations,omitempty"`
  1660. // LocalizedObjectAnnotations: If present, localized object detection
  1661. // has completed successfully.
  1662. // This will be sorted descending by confidence score.
  1663. LocalizedObjectAnnotations []*GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation `json:"localizedObjectAnnotations,omitempty"`
  1664. // LogoAnnotations: If present, logo detection has completed
  1665. // successfully.
  1666. LogoAnnotations []*GoogleCloudVisionV1p1beta1EntityAnnotation `json:"logoAnnotations,omitempty"`
  1667. // ProductSearchResults: If present, product search has completed
  1668. // successfully.
  1669. ProductSearchResults *GoogleCloudVisionV1p1beta1ProductSearchResults `json:"productSearchResults,omitempty"`
  1670. // SafeSearchAnnotation: If present, safe-search annotation has
  1671. // completed successfully.
  1672. SafeSearchAnnotation *GoogleCloudVisionV1p1beta1SafeSearchAnnotation `json:"safeSearchAnnotation,omitempty"`
  1673. // TextAnnotations: If present, text (OCR) detection has completed
  1674. // successfully.
  1675. TextAnnotations []*GoogleCloudVisionV1p1beta1EntityAnnotation `json:"textAnnotations,omitempty"`
  1676. // WebDetection: If present, web detection has completed successfully.
  1677. WebDetection *GoogleCloudVisionV1p1beta1WebDetection `json:"webDetection,omitempty"`
  1678. // ForceSendFields is a list of field names (e.g. "Context") to
  1679. // unconditionally include in API requests. By default, fields with
  1680. // empty values are omitted from API requests. However, any non-pointer,
  1681. // non-interface field appearing in ForceSendFields will be sent to the
  1682. // server regardless of whether the field is empty or not. This may be
  1683. // used to include empty fields in Patch requests.
  1684. ForceSendFields []string `json:"-"`
  1685. // NullFields is a list of field names (e.g. "Context") to include in
  1686. // API requests with the JSON null value. By default, fields with empty
  1687. // values are omitted from API requests. However, any field with an
  1688. // empty value appearing in NullFields will be sent to the server as
  1689. // null. It is an error if a field in this list has a non-empty value.
  1690. // This may be used to include null fields in Patch requests.
  1691. NullFields []string `json:"-"`
  1692. }
  1693. func (s *GoogleCloudVisionV1p1beta1AnnotateImageResponse) MarshalJSON() ([]byte, error) {
  1694. type NoMethod GoogleCloudVisionV1p1beta1AnnotateImageResponse
  1695. raw := NoMethod(*s)
  1696. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1697. }
  1698. // GoogleCloudVisionV1p1beta1AsyncAnnotateFileResponse: The response for
  1699. // a single offline file annotation request.
  1700. type GoogleCloudVisionV1p1beta1AsyncAnnotateFileResponse struct {
  1701. // OutputConfig: The output location and metadata from
  1702. // AsyncAnnotateFileRequest.
  1703. OutputConfig *GoogleCloudVisionV1p1beta1OutputConfig `json:"outputConfig,omitempty"`
  1704. // ForceSendFields is a list of field names (e.g. "OutputConfig") to
  1705. // unconditionally include in API requests. By default, fields with
  1706. // empty values are omitted from API requests. However, any non-pointer,
  1707. // non-interface field appearing in ForceSendFields will be sent to the
  1708. // server regardless of whether the field is empty or not. This may be
  1709. // used to include empty fields in Patch requests.
  1710. ForceSendFields []string `json:"-"`
  1711. // NullFields is a list of field names (e.g. "OutputConfig") to include
  1712. // in API requests with the JSON null value. By default, fields with
  1713. // empty values are omitted from API requests. However, any field with
  1714. // an empty value appearing in NullFields will be sent to the server as
  1715. // null. It is an error if a field in this list has a non-empty value.
  1716. // This may be used to include null fields in Patch requests.
  1717. NullFields []string `json:"-"`
  1718. }
  1719. func (s *GoogleCloudVisionV1p1beta1AsyncAnnotateFileResponse) MarshalJSON() ([]byte, error) {
  1720. type NoMethod GoogleCloudVisionV1p1beta1AsyncAnnotateFileResponse
  1721. raw := NoMethod(*s)
  1722. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1723. }
  1724. // GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesResponse: Response
  1725. // to an async batch file annotation request.
  1726. type GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesResponse struct {
  1727. // Responses: The list of file annotation responses, one for each
  1728. // request in
  1729. // AsyncBatchAnnotateFilesRequest.
  1730. Responses []*GoogleCloudVisionV1p1beta1AsyncAnnotateFileResponse `json:"responses,omitempty"`
  1731. // ForceSendFields is a list of field names (e.g. "Responses") to
  1732. // unconditionally include in API requests. By default, fields with
  1733. // empty values are omitted from API requests. However, any non-pointer,
  1734. // non-interface field appearing in ForceSendFields will be sent to the
  1735. // server regardless of whether the field is empty or not. This may be
  1736. // used to include empty fields in Patch requests.
  1737. ForceSendFields []string `json:"-"`
  1738. // NullFields is a list of field names (e.g. "Responses") to include in
  1739. // API requests with the JSON null value. By default, fields with empty
  1740. // values are omitted from API requests. However, any field with an
  1741. // empty value appearing in NullFields will be sent to the server as
  1742. // null. It is an error if a field in this list has a non-empty value.
  1743. // This may be used to include null fields in Patch requests.
  1744. NullFields []string `json:"-"`
  1745. }
  1746. func (s *GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) {
  1747. type NoMethod GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesResponse
  1748. raw := NoMethod(*s)
  1749. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1750. }
  1751. // GoogleCloudVisionV1p1beta1Block: Logical element on the page.
  1752. type GoogleCloudVisionV1p1beta1Block struct {
  1753. // BlockType: Detected block type (text, image etc) for this block.
  1754. //
  1755. // Possible values:
  1756. // "UNKNOWN" - Unknown block type.
  1757. // "TEXT" - Regular text block.
  1758. // "TABLE" - Table block.
  1759. // "PICTURE" - Image block.
  1760. // "RULER" - Horizontal/vertical line box.
  1761. // "BARCODE" - Barcode block.
  1762. BlockType string `json:"blockType,omitempty"`
  1763. // BoundingBox: The bounding box for the block.
  1764. // The vertices are in the order of top-left, top-right,
  1765. // bottom-right,
  1766. // bottom-left. When a rotation of the bounding box is detected the
  1767. // rotation
  1768. // is represented as around the top-left corner as defined when the text
  1769. // is
  1770. // read in the 'natural' orientation.
  1771. // For example:
  1772. //
  1773. // * when the text is horizontal it might look like:
  1774. //
  1775. // 0----1
  1776. // | |
  1777. // 3----2
  1778. //
  1779. // * when it's rotated 180 degrees around the top-left corner it
  1780. // becomes:
  1781. //
  1782. // 2----3
  1783. // | |
  1784. // 1----0
  1785. //
  1786. // and the vertex order will still be (0, 1, 2, 3).
  1787. BoundingBox *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingBox,omitempty"`
  1788. // Confidence: Confidence of the OCR results on the block. Range [0, 1].
  1789. Confidence float64 `json:"confidence,omitempty"`
  1790. // Paragraphs: List of paragraphs in this block (if this blocks is of
  1791. // type text).
  1792. Paragraphs []*GoogleCloudVisionV1p1beta1Paragraph `json:"paragraphs,omitempty"`
  1793. // Property: Additional information detected for the block.
  1794. Property *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty `json:"property,omitempty"`
  1795. // ForceSendFields is a list of field names (e.g. "BlockType") to
  1796. // unconditionally include in API requests. By default, fields with
  1797. // empty values are omitted from API requests. However, any non-pointer,
  1798. // non-interface field appearing in ForceSendFields will be sent to the
  1799. // server regardless of whether the field is empty or not. This may be
  1800. // used to include empty fields in Patch requests.
  1801. ForceSendFields []string `json:"-"`
  1802. // NullFields is a list of field names (e.g. "BlockType") to include in
  1803. // API requests with the JSON null value. By default, fields with empty
  1804. // values are omitted from API requests. However, any field with an
  1805. // empty value appearing in NullFields will be sent to the server as
  1806. // null. It is an error if a field in this list has a non-empty value.
  1807. // This may be used to include null fields in Patch requests.
  1808. NullFields []string `json:"-"`
  1809. }
  1810. func (s *GoogleCloudVisionV1p1beta1Block) MarshalJSON() ([]byte, error) {
  1811. type NoMethod GoogleCloudVisionV1p1beta1Block
  1812. raw := NoMethod(*s)
  1813. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1814. }
  1815. func (s *GoogleCloudVisionV1p1beta1Block) UnmarshalJSON(data []byte) error {
  1816. type NoMethod GoogleCloudVisionV1p1beta1Block
  1817. var s1 struct {
  1818. Confidence gensupport.JSONFloat64 `json:"confidence"`
  1819. *NoMethod
  1820. }
  1821. s1.NoMethod = (*NoMethod)(s)
  1822. if err := json.Unmarshal(data, &s1); err != nil {
  1823. return err
  1824. }
  1825. s.Confidence = float64(s1.Confidence)
  1826. return nil
  1827. }
  1828. // GoogleCloudVisionV1p1beta1BoundingPoly: A bounding polygon for the
  1829. // detected image annotation.
  1830. type GoogleCloudVisionV1p1beta1BoundingPoly struct {
  1831. // NormalizedVertices: The bounding polygon normalized vertices.
  1832. NormalizedVertices []*GoogleCloudVisionV1p1beta1NormalizedVertex `json:"normalizedVertices,omitempty"`
  1833. // Vertices: The bounding polygon vertices.
  1834. Vertices []*GoogleCloudVisionV1p1beta1Vertex `json:"vertices,omitempty"`
  1835. // ForceSendFields is a list of field names (e.g. "NormalizedVertices")
  1836. // to unconditionally include in API requests. By default, fields with
  1837. // empty values are omitted from API requests. However, any non-pointer,
  1838. // non-interface field appearing in ForceSendFields will be sent to the
  1839. // server regardless of whether the field is empty or not. This may be
  1840. // used to include empty fields in Patch requests.
  1841. ForceSendFields []string `json:"-"`
  1842. // NullFields is a list of field names (e.g. "NormalizedVertices") to
  1843. // include in API requests with the JSON null value. By default, fields
  1844. // with empty values are omitted from API requests. However, any field
  1845. // with an empty value appearing in NullFields will be sent to the
  1846. // server as null. It is an error if a field in this list has a
  1847. // non-empty value. This may be used to include null fields in Patch
  1848. // requests.
  1849. NullFields []string `json:"-"`
  1850. }
  1851. func (s *GoogleCloudVisionV1p1beta1BoundingPoly) MarshalJSON() ([]byte, error) {
  1852. type NoMethod GoogleCloudVisionV1p1beta1BoundingPoly
  1853. raw := NoMethod(*s)
  1854. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1855. }
  1856. // GoogleCloudVisionV1p1beta1ColorInfo: Color information consists of
  1857. // RGB channels, score, and the fraction of
  1858. // the image that the color occupies in the image.
  1859. type GoogleCloudVisionV1p1beta1ColorInfo struct {
  1860. // Color: RGB components of the color.
  1861. Color *Color `json:"color,omitempty"`
  1862. // PixelFraction: The fraction of pixels the color occupies in the
  1863. // image.
  1864. // Value in range [0, 1].
  1865. PixelFraction float64 `json:"pixelFraction,omitempty"`
  1866. // Score: Image-specific score for this color. Value in range [0, 1].
  1867. Score float64 `json:"score,omitempty"`
  1868. // ForceSendFields is a list of field names (e.g. "Color") to
  1869. // unconditionally include in API requests. By default, fields with
  1870. // empty values are omitted from API requests. However, any non-pointer,
  1871. // non-interface field appearing in ForceSendFields will be sent to the
  1872. // server regardless of whether the field is empty or not. This may be
  1873. // used to include empty fields in Patch requests.
  1874. ForceSendFields []string `json:"-"`
  1875. // NullFields is a list of field names (e.g. "Color") to include in API
  1876. // requests with the JSON null value. By default, fields with empty
  1877. // values are omitted from API requests. However, any field with an
  1878. // empty value appearing in NullFields will be sent to the server as
  1879. // null. It is an error if a field in this list has a non-empty value.
  1880. // This may be used to include null fields in Patch requests.
  1881. NullFields []string `json:"-"`
  1882. }
  1883. func (s *GoogleCloudVisionV1p1beta1ColorInfo) MarshalJSON() ([]byte, error) {
  1884. type NoMethod GoogleCloudVisionV1p1beta1ColorInfo
  1885. raw := NoMethod(*s)
  1886. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1887. }
  1888. func (s *GoogleCloudVisionV1p1beta1ColorInfo) UnmarshalJSON(data []byte) error {
  1889. type NoMethod GoogleCloudVisionV1p1beta1ColorInfo
  1890. var s1 struct {
  1891. PixelFraction gensupport.JSONFloat64 `json:"pixelFraction"`
  1892. Score gensupport.JSONFloat64 `json:"score"`
  1893. *NoMethod
  1894. }
  1895. s1.NoMethod = (*NoMethod)(s)
  1896. if err := json.Unmarshal(data, &s1); err != nil {
  1897. return err
  1898. }
  1899. s.PixelFraction = float64(s1.PixelFraction)
  1900. s.Score = float64(s1.Score)
  1901. return nil
  1902. }
  1903. // GoogleCloudVisionV1p1beta1CropHint: Single crop hint that is used to
  1904. // generate a new crop when serving an image.
  1905. type GoogleCloudVisionV1p1beta1CropHint struct {
  1906. // BoundingPoly: The bounding polygon for the crop region. The
  1907. // coordinates of the bounding
  1908. // box are in the original image's scale.
  1909. BoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingPoly,omitempty"`
  1910. // Confidence: Confidence of this being a salient region. Range [0, 1].
  1911. Confidence float64 `json:"confidence,omitempty"`
  1912. // ImportanceFraction: Fraction of importance of this salient region
  1913. // with respect to the original
  1914. // image.
  1915. ImportanceFraction float64 `json:"importanceFraction,omitempty"`
  1916. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  1917. // unconditionally include in API requests. By default, fields with
  1918. // empty values are omitted from API requests. However, any non-pointer,
  1919. // non-interface field appearing in ForceSendFields will be sent to the
  1920. // server regardless of whether the field is empty or not. This may be
  1921. // used to include empty fields in Patch requests.
  1922. ForceSendFields []string `json:"-"`
  1923. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  1924. // in API requests with the JSON null value. By default, fields with
  1925. // empty values are omitted from API requests. However, any field with
  1926. // an empty value appearing in NullFields will be sent to the server as
  1927. // null. It is an error if a field in this list has a non-empty value.
  1928. // This may be used to include null fields in Patch requests.
  1929. NullFields []string `json:"-"`
  1930. }
  1931. func (s *GoogleCloudVisionV1p1beta1CropHint) MarshalJSON() ([]byte, error) {
  1932. type NoMethod GoogleCloudVisionV1p1beta1CropHint
  1933. raw := NoMethod(*s)
  1934. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1935. }
  1936. func (s *GoogleCloudVisionV1p1beta1CropHint) UnmarshalJSON(data []byte) error {
  1937. type NoMethod GoogleCloudVisionV1p1beta1CropHint
  1938. var s1 struct {
  1939. Confidence gensupport.JSONFloat64 `json:"confidence"`
  1940. ImportanceFraction gensupport.JSONFloat64 `json:"importanceFraction"`
  1941. *NoMethod
  1942. }
  1943. s1.NoMethod = (*NoMethod)(s)
  1944. if err := json.Unmarshal(data, &s1); err != nil {
  1945. return err
  1946. }
  1947. s.Confidence = float64(s1.Confidence)
  1948. s.ImportanceFraction = float64(s1.ImportanceFraction)
  1949. return nil
  1950. }
  1951. // GoogleCloudVisionV1p1beta1CropHintsAnnotation: Set of crop hints that
  1952. // are used to generate new crops when serving images.
  1953. type GoogleCloudVisionV1p1beta1CropHintsAnnotation struct {
  1954. // CropHints: Crop hint results.
  1955. CropHints []*GoogleCloudVisionV1p1beta1CropHint `json:"cropHints,omitempty"`
  1956. // ForceSendFields is a list of field names (e.g. "CropHints") to
  1957. // unconditionally include in API requests. By default, fields with
  1958. // empty values are omitted from API requests. However, any non-pointer,
  1959. // non-interface field appearing in ForceSendFields will be sent to the
  1960. // server regardless of whether the field is empty or not. This may be
  1961. // used to include empty fields in Patch requests.
  1962. ForceSendFields []string `json:"-"`
  1963. // NullFields is a list of field names (e.g. "CropHints") to include in
  1964. // API requests with the JSON null value. By default, fields with empty
  1965. // values are omitted from API requests. However, any field with an
  1966. // empty value appearing in NullFields will be sent to the server as
  1967. // null. It is an error if a field in this list has a non-empty value.
  1968. // This may be used to include null fields in Patch requests.
  1969. NullFields []string `json:"-"`
  1970. }
  1971. func (s *GoogleCloudVisionV1p1beta1CropHintsAnnotation) MarshalJSON() ([]byte, error) {
  1972. type NoMethod GoogleCloudVisionV1p1beta1CropHintsAnnotation
  1973. raw := NoMethod(*s)
  1974. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1975. }
  1976. // GoogleCloudVisionV1p1beta1DominantColorsAnnotation: Set of dominant
  1977. // colors and their corresponding scores.
  1978. type GoogleCloudVisionV1p1beta1DominantColorsAnnotation struct {
  1979. // Colors: RGB color values with their score and pixel fraction.
  1980. Colors []*GoogleCloudVisionV1p1beta1ColorInfo `json:"colors,omitempty"`
  1981. // ForceSendFields is a list of field names (e.g. "Colors") to
  1982. // unconditionally include in API requests. By default, fields with
  1983. // empty values are omitted from API requests. However, any non-pointer,
  1984. // non-interface field appearing in ForceSendFields will be sent to the
  1985. // server regardless of whether the field is empty or not. This may be
  1986. // used to include empty fields in Patch requests.
  1987. ForceSendFields []string `json:"-"`
  1988. // NullFields is a list of field names (e.g. "Colors") to include in API
  1989. // requests with the JSON null value. By default, fields with empty
  1990. // values are omitted from API requests. However, any field with an
  1991. // empty value appearing in NullFields will be sent to the server as
  1992. // null. It is an error if a field in this list has a non-empty value.
  1993. // This may be used to include null fields in Patch requests.
  1994. NullFields []string `json:"-"`
  1995. }
  1996. func (s *GoogleCloudVisionV1p1beta1DominantColorsAnnotation) MarshalJSON() ([]byte, error) {
  1997. type NoMethod GoogleCloudVisionV1p1beta1DominantColorsAnnotation
  1998. raw := NoMethod(*s)
  1999. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2000. }
  2001. // GoogleCloudVisionV1p1beta1EntityAnnotation: Set of detected entity
  2002. // features.
  2003. type GoogleCloudVisionV1p1beta1EntityAnnotation struct {
  2004. // BoundingPoly: Image region to which this entity belongs. Not
  2005. // produced
  2006. // for `LABEL_DETECTION` features.
  2007. BoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingPoly,omitempty"`
  2008. // Confidence: **Deprecated. Use `score` instead.**
  2009. // The accuracy of the entity detection in an image.
  2010. // For example, for an image in which the "Eiffel Tower" entity is
  2011. // detected,
  2012. // this field represents the confidence that there is a tower in the
  2013. // query
  2014. // image. Range [0, 1].
  2015. Confidence float64 `json:"confidence,omitempty"`
  2016. // Description: Entity textual description, expressed in its `locale`
  2017. // language.
  2018. Description string `json:"description,omitempty"`
  2019. // Locale: The language code for the locale in which the entity
  2020. // textual
  2021. // `description` is expressed.
  2022. Locale string `json:"locale,omitempty"`
  2023. // Locations: The location information for the detected entity.
  2024. // Multiple
  2025. // `LocationInfo` elements can be present because one location
  2026. // may
  2027. // indicate the location of the scene in the image, and another
  2028. // location
  2029. // may indicate the location of the place where the image was
  2030. // taken.
  2031. // Location information is usually present for landmarks.
  2032. Locations []*GoogleCloudVisionV1p1beta1LocationInfo `json:"locations,omitempty"`
  2033. // Mid: Opaque entity ID. Some IDs may be available in
  2034. // [Google Knowledge Graph
  2035. // Search
  2036. // API](https://developers.google.com/knowledge-graph/).
  2037. Mid string `json:"mid,omitempty"`
  2038. // Properties: Some entities may have optional user-supplied `Property`
  2039. // (name/value)
  2040. // fields, such a score or string that qualifies the entity.
  2041. Properties []*GoogleCloudVisionV1p1beta1Property `json:"properties,omitempty"`
  2042. // Score: Overall score of the result. Range [0, 1].
  2043. Score float64 `json:"score,omitempty"`
  2044. // Topicality: The relevancy of the ICA (Image Content Annotation) label
  2045. // to the
  2046. // image. For example, the relevancy of "tower" is likely higher to an
  2047. // image
  2048. // containing the detected "Eiffel Tower" than to an image containing
  2049. // a
  2050. // detected distant towering building, even though the confidence
  2051. // that
  2052. // there is a tower in each image may be the same. Range [0, 1].
  2053. Topicality float64 `json:"topicality,omitempty"`
  2054. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  2055. // unconditionally include in API requests. By default, fields with
  2056. // empty values are omitted from API requests. However, any non-pointer,
  2057. // non-interface field appearing in ForceSendFields will be sent to the
  2058. // server regardless of whether the field is empty or not. This may be
  2059. // used to include empty fields in Patch requests.
  2060. ForceSendFields []string `json:"-"`
  2061. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  2062. // in API requests with the JSON null value. By default, fields with
  2063. // empty values are omitted from API requests. However, any field with
  2064. // an empty value appearing in NullFields will be sent to the server as
  2065. // null. It is an error if a field in this list has a non-empty value.
  2066. // This may be used to include null fields in Patch requests.
  2067. NullFields []string `json:"-"`
  2068. }
  2069. func (s *GoogleCloudVisionV1p1beta1EntityAnnotation) MarshalJSON() ([]byte, error) {
  2070. type NoMethod GoogleCloudVisionV1p1beta1EntityAnnotation
  2071. raw := NoMethod(*s)
  2072. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2073. }
  2074. func (s *GoogleCloudVisionV1p1beta1EntityAnnotation) UnmarshalJSON(data []byte) error {
  2075. type NoMethod GoogleCloudVisionV1p1beta1EntityAnnotation
  2076. var s1 struct {
  2077. Confidence gensupport.JSONFloat64 `json:"confidence"`
  2078. Score gensupport.JSONFloat64 `json:"score"`
  2079. Topicality gensupport.JSONFloat64 `json:"topicality"`
  2080. *NoMethod
  2081. }
  2082. s1.NoMethod = (*NoMethod)(s)
  2083. if err := json.Unmarshal(data, &s1); err != nil {
  2084. return err
  2085. }
  2086. s.Confidence = float64(s1.Confidence)
  2087. s.Score = float64(s1.Score)
  2088. s.Topicality = float64(s1.Topicality)
  2089. return nil
  2090. }
  2091. // GoogleCloudVisionV1p1beta1FaceAnnotation: A face annotation object
  2092. // contains the results of face detection.
  2093. type GoogleCloudVisionV1p1beta1FaceAnnotation struct {
  2094. // AngerLikelihood: Anger likelihood.
  2095. //
  2096. // Possible values:
  2097. // "UNKNOWN" - Unknown likelihood.
  2098. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  2099. // specified vertical.
  2100. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  2101. // vertical.
  2102. // "POSSIBLE" - It is possible that the image belongs to the specified
  2103. // vertical.
  2104. // "LIKELY" - It is likely that the image belongs to the specified
  2105. // vertical.
  2106. // "VERY_LIKELY" - It is very likely that the image belongs to the
  2107. // specified vertical.
  2108. AngerLikelihood string `json:"angerLikelihood,omitempty"`
  2109. // BlurredLikelihood: Blurred likelihood.
  2110. //
  2111. // Possible values:
  2112. // "UNKNOWN" - Unknown likelihood.
  2113. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  2114. // specified vertical.
  2115. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  2116. // vertical.
  2117. // "POSSIBLE" - It is possible that the image belongs to the specified
  2118. // vertical.
  2119. // "LIKELY" - It is likely that the image belongs to the specified
  2120. // vertical.
  2121. // "VERY_LIKELY" - It is very likely that the image belongs to the
  2122. // specified vertical.
  2123. BlurredLikelihood string `json:"blurredLikelihood,omitempty"`
  2124. // BoundingPoly: The bounding polygon around the face. The coordinates
  2125. // of the bounding box
  2126. // are in the original image's scale.
  2127. // The bounding box is computed to "frame" the face in accordance with
  2128. // human
  2129. // expectations. It is based on the landmarker results.
  2130. // Note that one or more x and/or y coordinates may not be generated in
  2131. // the
  2132. // `BoundingPoly` (the polygon will be unbounded) if only a partial
  2133. // face
  2134. // appears in the image to be annotated.
  2135. BoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingPoly,omitempty"`
  2136. // DetectionConfidence: Detection confidence. Range [0, 1].
  2137. DetectionConfidence float64 `json:"detectionConfidence,omitempty"`
  2138. // FdBoundingPoly: The `fd_bounding_poly` bounding polygon is tighter
  2139. // than the
  2140. // `boundingPoly`, and encloses only the skin part of the face.
  2141. // Typically, it
  2142. // is used to eliminate the face from any image analysis that detects
  2143. // the
  2144. // "amount of skin" visible in an image. It is not based on
  2145. // the
  2146. // landmarker results, only on the initial face detection, hence
  2147. // the <code>fd</code> (face detection) prefix.
  2148. FdBoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"fdBoundingPoly,omitempty"`
  2149. // HeadwearLikelihood: Headwear likelihood.
  2150. //
  2151. // Possible values:
  2152. // "UNKNOWN" - Unknown likelihood.
  2153. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  2154. // specified vertical.
  2155. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  2156. // vertical.
  2157. // "POSSIBLE" - It is possible that the image belongs to the specified
  2158. // vertical.
  2159. // "LIKELY" - It is likely that the image belongs to the specified
  2160. // vertical.
  2161. // "VERY_LIKELY" - It is very likely that the image belongs to the
  2162. // specified vertical.
  2163. HeadwearLikelihood string `json:"headwearLikelihood,omitempty"`
  2164. // JoyLikelihood: Joy likelihood.
  2165. //
  2166. // Possible values:
  2167. // "UNKNOWN" - Unknown likelihood.
  2168. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  2169. // specified vertical.
  2170. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  2171. // vertical.
  2172. // "POSSIBLE" - It is possible that the image belongs to the specified
  2173. // vertical.
  2174. // "LIKELY" - It is likely that the image belongs to the specified
  2175. // vertical.
  2176. // "VERY_LIKELY" - It is very likely that the image belongs to the
  2177. // specified vertical.
  2178. JoyLikelihood string `json:"joyLikelihood,omitempty"`
  2179. // LandmarkingConfidence: Face landmarking confidence. Range [0, 1].
  2180. LandmarkingConfidence float64 `json:"landmarkingConfidence,omitempty"`
  2181. // Landmarks: Detected face landmarks.
  2182. Landmarks []*GoogleCloudVisionV1p1beta1FaceAnnotationLandmark `json:"landmarks,omitempty"`
  2183. // PanAngle: Yaw angle, which indicates the leftward/rightward angle
  2184. // that the face is
  2185. // pointing relative to the vertical plane perpendicular to the image.
  2186. // Range
  2187. // [-180,180].
  2188. PanAngle float64 `json:"panAngle,omitempty"`
  2189. // RollAngle: Roll angle, which indicates the amount of
  2190. // clockwise/anti-clockwise rotation
  2191. // of the face relative to the image vertical about the axis
  2192. // perpendicular to
  2193. // the face. Range [-180,180].
  2194. RollAngle float64 `json:"rollAngle,omitempty"`
  2195. // SorrowLikelihood: Sorrow likelihood.
  2196. //
  2197. // Possible values:
  2198. // "UNKNOWN" - Unknown likelihood.
  2199. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  2200. // specified vertical.
  2201. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  2202. // vertical.
  2203. // "POSSIBLE" - It is possible that the image belongs to the specified
  2204. // vertical.
  2205. // "LIKELY" - It is likely that the image belongs to the specified
  2206. // vertical.
  2207. // "VERY_LIKELY" - It is very likely that the image belongs to the
  2208. // specified vertical.
  2209. SorrowLikelihood string `json:"sorrowLikelihood,omitempty"`
  2210. // SurpriseLikelihood: Surprise likelihood.
  2211. //
  2212. // Possible values:
  2213. // "UNKNOWN" - Unknown likelihood.
  2214. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  2215. // specified vertical.
  2216. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  2217. // vertical.
  2218. // "POSSIBLE" - It is possible that the image belongs to the specified
  2219. // vertical.
  2220. // "LIKELY" - It is likely that the image belongs to the specified
  2221. // vertical.
  2222. // "VERY_LIKELY" - It is very likely that the image belongs to the
  2223. // specified vertical.
  2224. SurpriseLikelihood string `json:"surpriseLikelihood,omitempty"`
  2225. // TiltAngle: Pitch angle, which indicates the upwards/downwards angle
  2226. // that the face is
  2227. // pointing relative to the image's horizontal plane. Range [-180,180].
  2228. TiltAngle float64 `json:"tiltAngle,omitempty"`
  2229. // UnderExposedLikelihood: Under-exposed likelihood.
  2230. //
  2231. // Possible values:
  2232. // "UNKNOWN" - Unknown likelihood.
  2233. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  2234. // specified vertical.
  2235. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  2236. // vertical.
  2237. // "POSSIBLE" - It is possible that the image belongs to the specified
  2238. // vertical.
  2239. // "LIKELY" - It is likely that the image belongs to the specified
  2240. // vertical.
  2241. // "VERY_LIKELY" - It is very likely that the image belongs to the
  2242. // specified vertical.
  2243. UnderExposedLikelihood string `json:"underExposedLikelihood,omitempty"`
  2244. // ForceSendFields is a list of field names (e.g. "AngerLikelihood") 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. "AngerLikelihood") 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 *GoogleCloudVisionV1p1beta1FaceAnnotation) MarshalJSON() ([]byte, error) {
  2261. type NoMethod GoogleCloudVisionV1p1beta1FaceAnnotation
  2262. raw := NoMethod(*s)
  2263. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2264. }
  2265. func (s *GoogleCloudVisionV1p1beta1FaceAnnotation) UnmarshalJSON(data []byte) error {
  2266. type NoMethod GoogleCloudVisionV1p1beta1FaceAnnotation
  2267. var s1 struct {
  2268. DetectionConfidence gensupport.JSONFloat64 `json:"detectionConfidence"`
  2269. LandmarkingConfidence gensupport.JSONFloat64 `json:"landmarkingConfidence"`
  2270. PanAngle gensupport.JSONFloat64 `json:"panAngle"`
  2271. RollAngle gensupport.JSONFloat64 `json:"rollAngle"`
  2272. TiltAngle gensupport.JSONFloat64 `json:"tiltAngle"`
  2273. *NoMethod
  2274. }
  2275. s1.NoMethod = (*NoMethod)(s)
  2276. if err := json.Unmarshal(data, &s1); err != nil {
  2277. return err
  2278. }
  2279. s.DetectionConfidence = float64(s1.DetectionConfidence)
  2280. s.LandmarkingConfidence = float64(s1.LandmarkingConfidence)
  2281. s.PanAngle = float64(s1.PanAngle)
  2282. s.RollAngle = float64(s1.RollAngle)
  2283. s.TiltAngle = float64(s1.TiltAngle)
  2284. return nil
  2285. }
  2286. // GoogleCloudVisionV1p1beta1FaceAnnotationLandmark: A face-specific
  2287. // landmark (for example, a face feature).
  2288. type GoogleCloudVisionV1p1beta1FaceAnnotationLandmark struct {
  2289. // Position: Face landmark position.
  2290. Position *GoogleCloudVisionV1p1beta1Position `json:"position,omitempty"`
  2291. // Type: Face landmark type.
  2292. //
  2293. // Possible values:
  2294. // "UNKNOWN_LANDMARK" - Unknown face landmark detected. Should not be
  2295. // filled.
  2296. // "LEFT_EYE" - Left eye.
  2297. // "RIGHT_EYE" - Right eye.
  2298. // "LEFT_OF_LEFT_EYEBROW" - Left of left eyebrow.
  2299. // "RIGHT_OF_LEFT_EYEBROW" - Right of left eyebrow.
  2300. // "LEFT_OF_RIGHT_EYEBROW" - Left of right eyebrow.
  2301. // "RIGHT_OF_RIGHT_EYEBROW" - Right of right eyebrow.
  2302. // "MIDPOINT_BETWEEN_EYES" - Midpoint between eyes.
  2303. // "NOSE_TIP" - Nose tip.
  2304. // "UPPER_LIP" - Upper lip.
  2305. // "LOWER_LIP" - Lower lip.
  2306. // "MOUTH_LEFT" - Mouth left.
  2307. // "MOUTH_RIGHT" - Mouth right.
  2308. // "MOUTH_CENTER" - Mouth center.
  2309. // "NOSE_BOTTOM_RIGHT" - Nose, bottom right.
  2310. // "NOSE_BOTTOM_LEFT" - Nose, bottom left.
  2311. // "NOSE_BOTTOM_CENTER" - Nose, bottom center.
  2312. // "LEFT_EYE_TOP_BOUNDARY" - Left eye, top boundary.
  2313. // "LEFT_EYE_RIGHT_CORNER" - Left eye, right corner.
  2314. // "LEFT_EYE_BOTTOM_BOUNDARY" - Left eye, bottom boundary.
  2315. // "LEFT_EYE_LEFT_CORNER" - Left eye, left corner.
  2316. // "RIGHT_EYE_TOP_BOUNDARY" - Right eye, top boundary.
  2317. // "RIGHT_EYE_RIGHT_CORNER" - Right eye, right corner.
  2318. // "RIGHT_EYE_BOTTOM_BOUNDARY" - Right eye, bottom boundary.
  2319. // "RIGHT_EYE_LEFT_CORNER" - Right eye, left corner.
  2320. // "LEFT_EYEBROW_UPPER_MIDPOINT" - Left eyebrow, upper midpoint.
  2321. // "RIGHT_EYEBROW_UPPER_MIDPOINT" - Right eyebrow, upper midpoint.
  2322. // "LEFT_EAR_TRAGION" - Left ear tragion.
  2323. // "RIGHT_EAR_TRAGION" - Right ear tragion.
  2324. // "LEFT_EYE_PUPIL" - Left eye pupil.
  2325. // "RIGHT_EYE_PUPIL" - Right eye pupil.
  2326. // "FOREHEAD_GLABELLA" - Forehead glabella.
  2327. // "CHIN_GNATHION" - Chin gnathion.
  2328. // "CHIN_LEFT_GONION" - Chin left gonion.
  2329. // "CHIN_RIGHT_GONION" - Chin right gonion.
  2330. Type string `json:"type,omitempty"`
  2331. // ForceSendFields is a list of field names (e.g. "Position") to
  2332. // unconditionally include in API requests. By default, fields with
  2333. // empty values are omitted from API requests. However, any non-pointer,
  2334. // non-interface field appearing in ForceSendFields will be sent to the
  2335. // server regardless of whether the field is empty or not. This may be
  2336. // used to include empty fields in Patch requests.
  2337. ForceSendFields []string `json:"-"`
  2338. // NullFields is a list of field names (e.g. "Position") to include in
  2339. // API requests with the JSON null value. By default, fields with empty
  2340. // values are omitted from API requests. However, any field with an
  2341. // empty value appearing in NullFields will be sent to the server as
  2342. // null. It is an error if a field in this list has a non-empty value.
  2343. // This may be used to include null fields in Patch requests.
  2344. NullFields []string `json:"-"`
  2345. }
  2346. func (s *GoogleCloudVisionV1p1beta1FaceAnnotationLandmark) MarshalJSON() ([]byte, error) {
  2347. type NoMethod GoogleCloudVisionV1p1beta1FaceAnnotationLandmark
  2348. raw := NoMethod(*s)
  2349. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2350. }
  2351. // GoogleCloudVisionV1p1beta1GcsDestination: The Google Cloud Storage
  2352. // location where the output will be written to.
  2353. type GoogleCloudVisionV1p1beta1GcsDestination struct {
  2354. // Uri: Google Cloud Storage URI where the results will be stored.
  2355. // Results will
  2356. // be in JSON format and preceded by its corresponding input URI. This
  2357. // field
  2358. // can either represent a single file, or a prefix for multiple
  2359. // outputs.
  2360. // Prefixes must end in a `/`.
  2361. //
  2362. // Examples:
  2363. //
  2364. // * File: gs://bucket-name/filename.json
  2365. // * Prefix: gs://bucket-name/prefix/here/
  2366. // * File: gs://bucket-name/prefix/here
  2367. //
  2368. // If multiple outputs, each response is still AnnotateFileResponse,
  2369. // each of
  2370. // which contains some subset of the full list of
  2371. // AnnotateImageResponse.
  2372. // Multiple outputs can happen if, for example, the output JSON is too
  2373. // large
  2374. // and overflows into multiple sharded files.
  2375. Uri string `json:"uri,omitempty"`
  2376. // ForceSendFields is a list of field names (e.g. "Uri") to
  2377. // unconditionally include in API requests. By default, fields with
  2378. // empty values are omitted from API requests. However, any non-pointer,
  2379. // non-interface field appearing in ForceSendFields will be sent to the
  2380. // server regardless of whether the field is empty or not. This may be
  2381. // used to include empty fields in Patch requests.
  2382. ForceSendFields []string `json:"-"`
  2383. // NullFields is a list of field names (e.g. "Uri") to include in API
  2384. // requests with the JSON null value. By default, fields with empty
  2385. // values are omitted from API requests. However, any field with an
  2386. // empty value appearing in NullFields will be sent to the server as
  2387. // null. It is an error if a field in this list has a non-empty value.
  2388. // This may be used to include null fields in Patch requests.
  2389. NullFields []string `json:"-"`
  2390. }
  2391. func (s *GoogleCloudVisionV1p1beta1GcsDestination) MarshalJSON() ([]byte, error) {
  2392. type NoMethod GoogleCloudVisionV1p1beta1GcsDestination
  2393. raw := NoMethod(*s)
  2394. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2395. }
  2396. // GoogleCloudVisionV1p1beta1GcsSource: The Google Cloud Storage
  2397. // location where the input will be read from.
  2398. type GoogleCloudVisionV1p1beta1GcsSource struct {
  2399. // Uri: Google Cloud Storage URI for the input file. This must only be
  2400. // a
  2401. // Google Cloud Storage object. Wildcards are not currently supported.
  2402. Uri string `json:"uri,omitempty"`
  2403. // ForceSendFields is a list of field names (e.g. "Uri") to
  2404. // unconditionally include in API requests. By default, fields with
  2405. // empty values are omitted from API requests. However, any non-pointer,
  2406. // non-interface field appearing in ForceSendFields will be sent to the
  2407. // server regardless of whether the field is empty or not. This may be
  2408. // used to include empty fields in Patch requests.
  2409. ForceSendFields []string `json:"-"`
  2410. // NullFields is a list of field names (e.g. "Uri") to include in API
  2411. // requests with the JSON null value. By default, fields with empty
  2412. // values are omitted from API requests. However, any field with an
  2413. // empty value appearing in NullFields will be sent to the server as
  2414. // null. It is an error if a field in this list has a non-empty value.
  2415. // This may be used to include null fields in Patch requests.
  2416. NullFields []string `json:"-"`
  2417. }
  2418. func (s *GoogleCloudVisionV1p1beta1GcsSource) MarshalJSON() ([]byte, error) {
  2419. type NoMethod GoogleCloudVisionV1p1beta1GcsSource
  2420. raw := NoMethod(*s)
  2421. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2422. }
  2423. // GoogleCloudVisionV1p1beta1ImageAnnotationContext: If an image was
  2424. // produced from a file (e.g. a PDF), this message gives
  2425. // information about the source of that image.
  2426. type GoogleCloudVisionV1p1beta1ImageAnnotationContext struct {
  2427. // PageNumber: If the file was a PDF or TIFF, this field gives the page
  2428. // number within
  2429. // the file used to produce the image.
  2430. PageNumber int64 `json:"pageNumber,omitempty"`
  2431. // Uri: The URI of the file used to produce the image.
  2432. Uri string `json:"uri,omitempty"`
  2433. // ForceSendFields is a list of field names (e.g. "PageNumber") to
  2434. // unconditionally include in API requests. By default, fields with
  2435. // empty values are omitted from API requests. However, any non-pointer,
  2436. // non-interface field appearing in ForceSendFields will be sent to the
  2437. // server regardless of whether the field is empty or not. This may be
  2438. // used to include empty fields in Patch requests.
  2439. ForceSendFields []string `json:"-"`
  2440. // NullFields is a list of field names (e.g. "PageNumber") to include in
  2441. // API requests with the JSON null value. By default, fields with empty
  2442. // values are omitted from API requests. However, any field with an
  2443. // empty value appearing in NullFields will be sent to the server as
  2444. // null. It is an error if a field in this list has a non-empty value.
  2445. // This may be used to include null fields in Patch requests.
  2446. NullFields []string `json:"-"`
  2447. }
  2448. func (s *GoogleCloudVisionV1p1beta1ImageAnnotationContext) MarshalJSON() ([]byte, error) {
  2449. type NoMethod GoogleCloudVisionV1p1beta1ImageAnnotationContext
  2450. raw := NoMethod(*s)
  2451. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2452. }
  2453. // GoogleCloudVisionV1p1beta1ImageProperties: Stores image properties,
  2454. // such as dominant colors.
  2455. type GoogleCloudVisionV1p1beta1ImageProperties struct {
  2456. // DominantColors: If present, dominant colors completed successfully.
  2457. DominantColors *GoogleCloudVisionV1p1beta1DominantColorsAnnotation `json:"dominantColors,omitempty"`
  2458. // ForceSendFields is a list of field names (e.g. "DominantColors") to
  2459. // unconditionally include in API requests. By default, fields with
  2460. // empty values are omitted from API requests. However, any non-pointer,
  2461. // non-interface field appearing in ForceSendFields will be sent to the
  2462. // server regardless of whether the field is empty or not. This may be
  2463. // used to include empty fields in Patch requests.
  2464. ForceSendFields []string `json:"-"`
  2465. // NullFields is a list of field names (e.g. "DominantColors") to
  2466. // include in API requests with the JSON null value. By default, fields
  2467. // with empty values are omitted from API requests. However, any field
  2468. // with an empty value appearing in NullFields will be sent to the
  2469. // server as null. It is an error if a field in this list has a
  2470. // non-empty value. This may be used to include null fields in Patch
  2471. // requests.
  2472. NullFields []string `json:"-"`
  2473. }
  2474. func (s *GoogleCloudVisionV1p1beta1ImageProperties) MarshalJSON() ([]byte, error) {
  2475. type NoMethod GoogleCloudVisionV1p1beta1ImageProperties
  2476. raw := NoMethod(*s)
  2477. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2478. }
  2479. // GoogleCloudVisionV1p1beta1InputConfig: The desired input location and
  2480. // metadata.
  2481. type GoogleCloudVisionV1p1beta1InputConfig struct {
  2482. // GcsSource: The Google Cloud Storage location to read the input from.
  2483. GcsSource *GoogleCloudVisionV1p1beta1GcsSource `json:"gcsSource,omitempty"`
  2484. // MimeType: The type of the file. Currently only "application/pdf" and
  2485. // "image/tiff"
  2486. // are supported. Wildcards are not supported.
  2487. MimeType string `json:"mimeType,omitempty"`
  2488. // ForceSendFields is a list of field names (e.g. "GcsSource") to
  2489. // unconditionally include in API requests. By default, fields with
  2490. // empty values are omitted from API requests. However, any non-pointer,
  2491. // non-interface field appearing in ForceSendFields will be sent to the
  2492. // server regardless of whether the field is empty or not. This may be
  2493. // used to include empty fields in Patch requests.
  2494. ForceSendFields []string `json:"-"`
  2495. // NullFields is a list of field names (e.g. "GcsSource") to include in
  2496. // API requests with the JSON null value. By default, fields with empty
  2497. // values are omitted from API requests. However, any field with an
  2498. // empty value appearing in NullFields will be sent to the server as
  2499. // null. It is an error if a field in this list has a non-empty value.
  2500. // This may be used to include null fields in Patch requests.
  2501. NullFields []string `json:"-"`
  2502. }
  2503. func (s *GoogleCloudVisionV1p1beta1InputConfig) MarshalJSON() ([]byte, error) {
  2504. type NoMethod GoogleCloudVisionV1p1beta1InputConfig
  2505. raw := NoMethod(*s)
  2506. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2507. }
  2508. // GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation: Set of detected
  2509. // objects with bounding boxes.
  2510. type GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation struct {
  2511. // BoundingPoly: Image region to which this object belongs. This must be
  2512. // populated.
  2513. BoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingPoly,omitempty"`
  2514. // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn".
  2515. // For more
  2516. // information,
  2517. // see
  2518. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  2519. LanguageCode string `json:"languageCode,omitempty"`
  2520. // Mid: Object ID that should align with EntityAnnotation mid.
  2521. Mid string `json:"mid,omitempty"`
  2522. // Name: Object name, expressed in its `language_code` language.
  2523. Name string `json:"name,omitempty"`
  2524. // Score: Score of the result. Range [0, 1].
  2525. Score float64 `json:"score,omitempty"`
  2526. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  2527. // unconditionally include in API requests. By default, fields with
  2528. // empty values are omitted from API requests. However, any non-pointer,
  2529. // non-interface field appearing in ForceSendFields will be sent to the
  2530. // server regardless of whether the field is empty or not. This may be
  2531. // used to include empty fields in Patch requests.
  2532. ForceSendFields []string `json:"-"`
  2533. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  2534. // in API requests with the JSON null value. By default, fields with
  2535. // empty values are omitted from API requests. However, any field with
  2536. // an empty value appearing in NullFields will be sent to the server as
  2537. // null. It is an error if a field in this list has a non-empty value.
  2538. // This may be used to include null fields in Patch requests.
  2539. NullFields []string `json:"-"`
  2540. }
  2541. func (s *GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation) MarshalJSON() ([]byte, error) {
  2542. type NoMethod GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation
  2543. raw := NoMethod(*s)
  2544. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2545. }
  2546. func (s *GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation) UnmarshalJSON(data []byte) error {
  2547. type NoMethod GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation
  2548. var s1 struct {
  2549. Score gensupport.JSONFloat64 `json:"score"`
  2550. *NoMethod
  2551. }
  2552. s1.NoMethod = (*NoMethod)(s)
  2553. if err := json.Unmarshal(data, &s1); err != nil {
  2554. return err
  2555. }
  2556. s.Score = float64(s1.Score)
  2557. return nil
  2558. }
  2559. // GoogleCloudVisionV1p1beta1LocationInfo: Detected entity location
  2560. // information.
  2561. type GoogleCloudVisionV1p1beta1LocationInfo struct {
  2562. // LatLng: lat/long location coordinates.
  2563. LatLng *LatLng `json:"latLng,omitempty"`
  2564. // ForceSendFields is a list of field names (e.g. "LatLng") to
  2565. // unconditionally include in API requests. By default, fields with
  2566. // empty values are omitted from API requests. However, any non-pointer,
  2567. // non-interface field appearing in ForceSendFields will be sent to the
  2568. // server regardless of whether the field is empty or not. This may be
  2569. // used to include empty fields in Patch requests.
  2570. ForceSendFields []string `json:"-"`
  2571. // NullFields is a list of field names (e.g. "LatLng") to include in API
  2572. // requests with the JSON null value. By default, fields with empty
  2573. // values are omitted from API requests. However, any field with an
  2574. // empty value appearing in NullFields will be sent to the server as
  2575. // null. It is an error if a field in this list has a non-empty value.
  2576. // This may be used to include null fields in Patch requests.
  2577. NullFields []string `json:"-"`
  2578. }
  2579. func (s *GoogleCloudVisionV1p1beta1LocationInfo) MarshalJSON() ([]byte, error) {
  2580. type NoMethod GoogleCloudVisionV1p1beta1LocationInfo
  2581. raw := NoMethod(*s)
  2582. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2583. }
  2584. // GoogleCloudVisionV1p1beta1NormalizedVertex: A vertex represents a 2D
  2585. // point in the image.
  2586. // NOTE: the normalized vertex coordinates are relative to the original
  2587. // image
  2588. // and range from 0 to 1.
  2589. type GoogleCloudVisionV1p1beta1NormalizedVertex struct {
  2590. // X: X coordinate.
  2591. X float64 `json:"x,omitempty"`
  2592. // Y: Y coordinate.
  2593. Y float64 `json:"y,omitempty"`
  2594. // ForceSendFields is a list of field names (e.g. "X") to
  2595. // unconditionally include in API requests. By default, fields with
  2596. // empty values are omitted from API requests. However, any non-pointer,
  2597. // non-interface field appearing in ForceSendFields will be sent to the
  2598. // server regardless of whether the field is empty or not. This may be
  2599. // used to include empty fields in Patch requests.
  2600. ForceSendFields []string `json:"-"`
  2601. // NullFields is a list of field names (e.g. "X") to include in API
  2602. // requests with the JSON null value. By default, fields with empty
  2603. // values are omitted from API requests. However, any field with an
  2604. // empty value appearing in NullFields will be sent to the server as
  2605. // null. It is an error if a field in this list has a non-empty value.
  2606. // This may be used to include null fields in Patch requests.
  2607. NullFields []string `json:"-"`
  2608. }
  2609. func (s *GoogleCloudVisionV1p1beta1NormalizedVertex) MarshalJSON() ([]byte, error) {
  2610. type NoMethod GoogleCloudVisionV1p1beta1NormalizedVertex
  2611. raw := NoMethod(*s)
  2612. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2613. }
  2614. func (s *GoogleCloudVisionV1p1beta1NormalizedVertex) UnmarshalJSON(data []byte) error {
  2615. type NoMethod GoogleCloudVisionV1p1beta1NormalizedVertex
  2616. var s1 struct {
  2617. X gensupport.JSONFloat64 `json:"x"`
  2618. Y gensupport.JSONFloat64 `json:"y"`
  2619. *NoMethod
  2620. }
  2621. s1.NoMethod = (*NoMethod)(s)
  2622. if err := json.Unmarshal(data, &s1); err != nil {
  2623. return err
  2624. }
  2625. s.X = float64(s1.X)
  2626. s.Y = float64(s1.Y)
  2627. return nil
  2628. }
  2629. // GoogleCloudVisionV1p1beta1OperationMetadata: Contains metadata for
  2630. // the BatchAnnotateImages operation.
  2631. type GoogleCloudVisionV1p1beta1OperationMetadata struct {
  2632. // CreateTime: The time when the batch request was received.
  2633. CreateTime string `json:"createTime,omitempty"`
  2634. // State: Current state of the batch operation.
  2635. //
  2636. // Possible values:
  2637. // "STATE_UNSPECIFIED" - Invalid.
  2638. // "CREATED" - Request is received.
  2639. // "RUNNING" - Request is actively being processed.
  2640. // "DONE" - The batch processing is done.
  2641. // "CANCELLED" - The batch processing was cancelled.
  2642. State string `json:"state,omitempty"`
  2643. // UpdateTime: The time when the operation result was last updated.
  2644. UpdateTime string `json:"updateTime,omitempty"`
  2645. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  2646. // unconditionally include in API requests. By default, fields with
  2647. // empty values are omitted from API requests. However, any non-pointer,
  2648. // non-interface field appearing in ForceSendFields will be sent to the
  2649. // server regardless of whether the field is empty or not. This may be
  2650. // used to include empty fields in Patch requests.
  2651. ForceSendFields []string `json:"-"`
  2652. // NullFields is a list of field names (e.g. "CreateTime") to include in
  2653. // API requests with the JSON null value. By default, fields with empty
  2654. // values are omitted from API requests. However, any field with an
  2655. // empty value appearing in NullFields will be sent to the server as
  2656. // null. It is an error if a field in this list has a non-empty value.
  2657. // This may be used to include null fields in Patch requests.
  2658. NullFields []string `json:"-"`
  2659. }
  2660. func (s *GoogleCloudVisionV1p1beta1OperationMetadata) MarshalJSON() ([]byte, error) {
  2661. type NoMethod GoogleCloudVisionV1p1beta1OperationMetadata
  2662. raw := NoMethod(*s)
  2663. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2664. }
  2665. // GoogleCloudVisionV1p1beta1OutputConfig: The desired output location
  2666. // and metadata.
  2667. type GoogleCloudVisionV1p1beta1OutputConfig struct {
  2668. // BatchSize: The max number of response protos to put into each output
  2669. // JSON file on
  2670. // Google Cloud Storage.
  2671. // The valid range is [1, 100]. If not specified, the default value is
  2672. // 20.
  2673. //
  2674. // For example, for one pdf file with 100 pages, 100 response protos
  2675. // will
  2676. // be generated. If `batch_size` = 20, then 5 json files each
  2677. // containing 20 response protos will be written under the
  2678. // prefix
  2679. // `gcs_destination`.`uri`.
  2680. //
  2681. // Currently, batch_size only applies to GcsDestination, with potential
  2682. // future
  2683. // support for other output configurations.
  2684. BatchSize int64 `json:"batchSize,omitempty"`
  2685. // GcsDestination: The Google Cloud Storage location to write the
  2686. // output(s) to.
  2687. GcsDestination *GoogleCloudVisionV1p1beta1GcsDestination `json:"gcsDestination,omitempty"`
  2688. // ForceSendFields is a list of field names (e.g. "BatchSize") to
  2689. // unconditionally include in API requests. By default, fields with
  2690. // empty values are omitted from API requests. However, any non-pointer,
  2691. // non-interface field appearing in ForceSendFields will be sent to the
  2692. // server regardless of whether the field is empty or not. This may be
  2693. // used to include empty fields in Patch requests.
  2694. ForceSendFields []string `json:"-"`
  2695. // NullFields is a list of field names (e.g. "BatchSize") to include in
  2696. // API requests with the JSON null value. By default, fields with empty
  2697. // values are omitted from API requests. However, any field with an
  2698. // empty value appearing in NullFields will be sent to the server as
  2699. // null. It is an error if a field in this list has a non-empty value.
  2700. // This may be used to include null fields in Patch requests.
  2701. NullFields []string `json:"-"`
  2702. }
  2703. func (s *GoogleCloudVisionV1p1beta1OutputConfig) MarshalJSON() ([]byte, error) {
  2704. type NoMethod GoogleCloudVisionV1p1beta1OutputConfig
  2705. raw := NoMethod(*s)
  2706. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2707. }
  2708. // GoogleCloudVisionV1p1beta1Page: Detected page from OCR.
  2709. type GoogleCloudVisionV1p1beta1Page struct {
  2710. // Blocks: List of blocks of text, images etc on this page.
  2711. Blocks []*GoogleCloudVisionV1p1beta1Block `json:"blocks,omitempty"`
  2712. // Confidence: Confidence of the OCR results on the page. Range [0, 1].
  2713. Confidence float64 `json:"confidence,omitempty"`
  2714. // Height: Page height. For PDFs the unit is points. For images
  2715. // (including
  2716. // TIFFs) the unit is pixels.
  2717. Height int64 `json:"height,omitempty"`
  2718. // Property: Additional information detected on the page.
  2719. Property *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty `json:"property,omitempty"`
  2720. // Width: Page width. For PDFs the unit is points. For images
  2721. // (including
  2722. // TIFFs) the unit is pixels.
  2723. Width int64 `json:"width,omitempty"`
  2724. // ForceSendFields is a list of field names (e.g. "Blocks") to
  2725. // unconditionally include in API requests. By default, fields with
  2726. // empty values are omitted from API requests. However, any non-pointer,
  2727. // non-interface field appearing in ForceSendFields will be sent to the
  2728. // server regardless of whether the field is empty or not. This may be
  2729. // used to include empty fields in Patch requests.
  2730. ForceSendFields []string `json:"-"`
  2731. // NullFields is a list of field names (e.g. "Blocks") to include in API
  2732. // requests with the JSON null value. By default, fields with empty
  2733. // values are omitted from API requests. However, any field with an
  2734. // empty value appearing in NullFields will be sent to the server as
  2735. // null. It is an error if a field in this list has a non-empty value.
  2736. // This may be used to include null fields in Patch requests.
  2737. NullFields []string `json:"-"`
  2738. }
  2739. func (s *GoogleCloudVisionV1p1beta1Page) MarshalJSON() ([]byte, error) {
  2740. type NoMethod GoogleCloudVisionV1p1beta1Page
  2741. raw := NoMethod(*s)
  2742. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2743. }
  2744. func (s *GoogleCloudVisionV1p1beta1Page) UnmarshalJSON(data []byte) error {
  2745. type NoMethod GoogleCloudVisionV1p1beta1Page
  2746. var s1 struct {
  2747. Confidence gensupport.JSONFloat64 `json:"confidence"`
  2748. *NoMethod
  2749. }
  2750. s1.NoMethod = (*NoMethod)(s)
  2751. if err := json.Unmarshal(data, &s1); err != nil {
  2752. return err
  2753. }
  2754. s.Confidence = float64(s1.Confidence)
  2755. return nil
  2756. }
  2757. // GoogleCloudVisionV1p1beta1Paragraph: Structural unit of text
  2758. // representing a number of words in certain order.
  2759. type GoogleCloudVisionV1p1beta1Paragraph struct {
  2760. // BoundingBox: The bounding box for the paragraph.
  2761. // The vertices are in the order of top-left, top-right,
  2762. // bottom-right,
  2763. // bottom-left. When a rotation of the bounding box is detected the
  2764. // rotation
  2765. // is represented as around the top-left corner as defined when the text
  2766. // is
  2767. // read in the 'natural' orientation.
  2768. // For example:
  2769. // * when the text is horizontal it might look like:
  2770. // 0----1
  2771. // | |
  2772. // 3----2
  2773. // * when it's rotated 180 degrees around the top-left corner it
  2774. // becomes:
  2775. // 2----3
  2776. // | |
  2777. // 1----0
  2778. // and the vertex order will still be (0, 1, 2, 3).
  2779. BoundingBox *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingBox,omitempty"`
  2780. // Confidence: Confidence of the OCR results for the paragraph. Range
  2781. // [0, 1].
  2782. Confidence float64 `json:"confidence,omitempty"`
  2783. // Property: Additional information detected for the paragraph.
  2784. Property *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty `json:"property,omitempty"`
  2785. // Words: List of words in this paragraph.
  2786. Words []*GoogleCloudVisionV1p1beta1Word `json:"words,omitempty"`
  2787. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  2788. // unconditionally include in API requests. By default, fields with
  2789. // empty values are omitted from API requests. However, any non-pointer,
  2790. // non-interface field appearing in ForceSendFields will be sent to the
  2791. // server regardless of whether the field is empty or not. This may be
  2792. // used to include empty fields in Patch requests.
  2793. ForceSendFields []string `json:"-"`
  2794. // NullFields is a list of field names (e.g. "BoundingBox") to include
  2795. // in API requests with the JSON null value. By default, fields with
  2796. // empty values are omitted from API requests. However, any field with
  2797. // an empty value appearing in NullFields will be sent to the server as
  2798. // null. It is an error if a field in this list has a non-empty value.
  2799. // This may be used to include null fields in Patch requests.
  2800. NullFields []string `json:"-"`
  2801. }
  2802. func (s *GoogleCloudVisionV1p1beta1Paragraph) MarshalJSON() ([]byte, error) {
  2803. type NoMethod GoogleCloudVisionV1p1beta1Paragraph
  2804. raw := NoMethod(*s)
  2805. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2806. }
  2807. func (s *GoogleCloudVisionV1p1beta1Paragraph) UnmarshalJSON(data []byte) error {
  2808. type NoMethod GoogleCloudVisionV1p1beta1Paragraph
  2809. var s1 struct {
  2810. Confidence gensupport.JSONFloat64 `json:"confidence"`
  2811. *NoMethod
  2812. }
  2813. s1.NoMethod = (*NoMethod)(s)
  2814. if err := json.Unmarshal(data, &s1); err != nil {
  2815. return err
  2816. }
  2817. s.Confidence = float64(s1.Confidence)
  2818. return nil
  2819. }
  2820. // GoogleCloudVisionV1p1beta1Position: A 3D position in the image, used
  2821. // primarily for Face detection landmarks.
  2822. // A valid Position must have both x and y coordinates.
  2823. // The position coordinates are in the same scale as the original image.
  2824. type GoogleCloudVisionV1p1beta1Position struct {
  2825. // X: X coordinate.
  2826. X float64 `json:"x,omitempty"`
  2827. // Y: Y coordinate.
  2828. Y float64 `json:"y,omitempty"`
  2829. // Z: Z coordinate (or depth).
  2830. Z float64 `json:"z,omitempty"`
  2831. // ForceSendFields is a list of field names (e.g. "X") to
  2832. // unconditionally include in API requests. By default, fields with
  2833. // empty values are omitted from API requests. However, any non-pointer,
  2834. // non-interface field appearing in ForceSendFields will be sent to the
  2835. // server regardless of whether the field is empty or not. This may be
  2836. // used to include empty fields in Patch requests.
  2837. ForceSendFields []string `json:"-"`
  2838. // NullFields is a list of field names (e.g. "X") to include in API
  2839. // requests with the JSON null value. By default, fields with empty
  2840. // values are omitted from API requests. However, any field with an
  2841. // empty value appearing in NullFields will be sent to the server as
  2842. // null. It is an error if a field in this list has a non-empty value.
  2843. // This may be used to include null fields in Patch requests.
  2844. NullFields []string `json:"-"`
  2845. }
  2846. func (s *GoogleCloudVisionV1p1beta1Position) MarshalJSON() ([]byte, error) {
  2847. type NoMethod GoogleCloudVisionV1p1beta1Position
  2848. raw := NoMethod(*s)
  2849. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2850. }
  2851. func (s *GoogleCloudVisionV1p1beta1Position) UnmarshalJSON(data []byte) error {
  2852. type NoMethod GoogleCloudVisionV1p1beta1Position
  2853. var s1 struct {
  2854. X gensupport.JSONFloat64 `json:"x"`
  2855. Y gensupport.JSONFloat64 `json:"y"`
  2856. Z gensupport.JSONFloat64 `json:"z"`
  2857. *NoMethod
  2858. }
  2859. s1.NoMethod = (*NoMethod)(s)
  2860. if err := json.Unmarshal(data, &s1); err != nil {
  2861. return err
  2862. }
  2863. s.X = float64(s1.X)
  2864. s.Y = float64(s1.Y)
  2865. s.Z = float64(s1.Z)
  2866. return nil
  2867. }
  2868. // GoogleCloudVisionV1p1beta1Product: A Product contains
  2869. // ReferenceImages.
  2870. type GoogleCloudVisionV1p1beta1Product struct {
  2871. // Description: User-provided metadata to be stored with this product.
  2872. // Must be at most 4096
  2873. // characters long.
  2874. Description string `json:"description,omitempty"`
  2875. // DisplayName: The user-provided name for this Product. Must not be
  2876. // empty. Must be at most
  2877. // 4096 characters long.
  2878. DisplayName string `json:"displayName,omitempty"`
  2879. // Name: The resource name of the product.
  2880. //
  2881. // Format
  2882. // is:
  2883. // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
  2884. //
  2885. // This field is ignored when creating a product.
  2886. Name string `json:"name,omitempty"`
  2887. // ProductCategory: The category for the product identified by the
  2888. // reference image. This should
  2889. // be either "homegoods", "apparel", or "toys".
  2890. //
  2891. // This field is immutable.
  2892. ProductCategory string `json:"productCategory,omitempty"`
  2893. // ProductLabels: Key-value pairs that can be attached to a product. At
  2894. // query time,
  2895. // constraints can be specified based on the product_labels.
  2896. //
  2897. // Note that integer values can be provided as strings, e.g. "1199".
  2898. // Only
  2899. // strings with integer values can match a range-based restriction which
  2900. // is
  2901. // to be supported soon.
  2902. //
  2903. // Multiple values can be assigned to the same key. One product may have
  2904. // up to
  2905. // 100 product_labels.
  2906. ProductLabels []*GoogleCloudVisionV1p1beta1ProductKeyValue `json:"productLabels,omitempty"`
  2907. // ForceSendFields is a list of field names (e.g. "Description") to
  2908. // unconditionally include in API requests. By default, fields with
  2909. // empty values are omitted from API requests. However, any non-pointer,
  2910. // non-interface field appearing in ForceSendFields will be sent to the
  2911. // server regardless of whether the field is empty or not. This may be
  2912. // used to include empty fields in Patch requests.
  2913. ForceSendFields []string `json:"-"`
  2914. // NullFields is a list of field names (e.g. "Description") to include
  2915. // in API requests with the JSON null value. By default, fields with
  2916. // empty values are omitted from API requests. However, any field with
  2917. // an empty value appearing in NullFields will be sent to the server as
  2918. // null. It is an error if a field in this list has a non-empty value.
  2919. // This may be used to include null fields in Patch requests.
  2920. NullFields []string `json:"-"`
  2921. }
  2922. func (s *GoogleCloudVisionV1p1beta1Product) MarshalJSON() ([]byte, error) {
  2923. type NoMethod GoogleCloudVisionV1p1beta1Product
  2924. raw := NoMethod(*s)
  2925. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2926. }
  2927. // GoogleCloudVisionV1p1beta1ProductKeyValue: A product label
  2928. // represented as a key-value pair.
  2929. type GoogleCloudVisionV1p1beta1ProductKeyValue struct {
  2930. // Key: The key of the label attached to the product. Cannot be empty
  2931. // and cannot
  2932. // exceed 128 bytes.
  2933. Key string `json:"key,omitempty"`
  2934. // Value: The value of the label attached to the product. Cannot be
  2935. // empty and
  2936. // cannot exceed 128 bytes.
  2937. Value string `json:"value,omitempty"`
  2938. // ForceSendFields is a list of field names (e.g. "Key") to
  2939. // unconditionally include in API requests. By default, fields with
  2940. // empty values are omitted from API requests. However, any non-pointer,
  2941. // non-interface field appearing in ForceSendFields will be sent to the
  2942. // server regardless of whether the field is empty or not. This may be
  2943. // used to include empty fields in Patch requests.
  2944. ForceSendFields []string `json:"-"`
  2945. // NullFields is a list of field names (e.g. "Key") to include in API
  2946. // requests with the JSON null value. By default, fields with empty
  2947. // values are omitted from API requests. However, any field with an
  2948. // empty value appearing in NullFields will be sent to the server as
  2949. // null. It is an error if a field in this list has a non-empty value.
  2950. // This may be used to include null fields in Patch requests.
  2951. NullFields []string `json:"-"`
  2952. }
  2953. func (s *GoogleCloudVisionV1p1beta1ProductKeyValue) MarshalJSON() ([]byte, error) {
  2954. type NoMethod GoogleCloudVisionV1p1beta1ProductKeyValue
  2955. raw := NoMethod(*s)
  2956. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2957. }
  2958. // GoogleCloudVisionV1p1beta1ProductSearchResults: Results for a product
  2959. // search request.
  2960. type GoogleCloudVisionV1p1beta1ProductSearchResults struct {
  2961. // IndexTime: Timestamp of the index which provided these results.
  2962. // Changes made after
  2963. // this time are not reflected in the current results.
  2964. IndexTime string `json:"indexTime,omitempty"`
  2965. // ProductGroupedResults: List of results grouped by products detected
  2966. // in the query image. Each entry
  2967. // corresponds to one bounding polygon in the query image, and contains
  2968. // the
  2969. // matching products specific to that region. There may be duplicate
  2970. // product
  2971. // matches in the union of all the per-product results.
  2972. ProductGroupedResults []*GoogleCloudVisionV1p1beta1ProductSearchResultsGroupedResult `json:"productGroupedResults,omitempty"`
  2973. // Results: List of results, one for each product match.
  2974. Results []*GoogleCloudVisionV1p1beta1ProductSearchResultsResult `json:"results,omitempty"`
  2975. // ForceSendFields is a list of field names (e.g. "IndexTime") to
  2976. // unconditionally include in API requests. By default, fields with
  2977. // empty values are omitted from API requests. However, any non-pointer,
  2978. // non-interface field appearing in ForceSendFields will be sent to the
  2979. // server regardless of whether the field is empty or not. This may be
  2980. // used to include empty fields in Patch requests.
  2981. ForceSendFields []string `json:"-"`
  2982. // NullFields is a list of field names (e.g. "IndexTime") to include in
  2983. // API requests with the JSON null value. By default, fields with empty
  2984. // values are omitted from API requests. However, any field with an
  2985. // empty value appearing in NullFields will be sent to the server as
  2986. // null. It is an error if a field in this list has a non-empty value.
  2987. // This may be used to include null fields in Patch requests.
  2988. NullFields []string `json:"-"`
  2989. }
  2990. func (s *GoogleCloudVisionV1p1beta1ProductSearchResults) MarshalJSON() ([]byte, error) {
  2991. type NoMethod GoogleCloudVisionV1p1beta1ProductSearchResults
  2992. raw := NoMethod(*s)
  2993. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2994. }
  2995. // GoogleCloudVisionV1p1beta1ProductSearchResultsGroupedResult:
  2996. // Information about the products similar to a single product in a
  2997. // query
  2998. // image.
  2999. type GoogleCloudVisionV1p1beta1ProductSearchResultsGroupedResult struct {
  3000. // BoundingPoly: The bounding polygon around the product detected in the
  3001. // query image.
  3002. BoundingPoly *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingPoly,omitempty"`
  3003. // Results: List of results, one for each product match.
  3004. Results []*GoogleCloudVisionV1p1beta1ProductSearchResultsResult `json:"results,omitempty"`
  3005. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  3006. // unconditionally include in API requests. By default, fields with
  3007. // empty values are omitted from API requests. However, any non-pointer,
  3008. // non-interface field appearing in ForceSendFields will be sent to the
  3009. // server regardless of whether the field is empty or not. This may be
  3010. // used to include empty fields in Patch requests.
  3011. ForceSendFields []string `json:"-"`
  3012. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  3013. // in API requests with the JSON null value. By default, fields with
  3014. // empty values are omitted from API requests. However, any field with
  3015. // an empty value appearing in NullFields will be sent to the server as
  3016. // null. It is an error if a field in this list has a non-empty value.
  3017. // This may be used to include null fields in Patch requests.
  3018. NullFields []string `json:"-"`
  3019. }
  3020. func (s *GoogleCloudVisionV1p1beta1ProductSearchResultsGroupedResult) MarshalJSON() ([]byte, error) {
  3021. type NoMethod GoogleCloudVisionV1p1beta1ProductSearchResultsGroupedResult
  3022. raw := NoMethod(*s)
  3023. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3024. }
  3025. // GoogleCloudVisionV1p1beta1ProductSearchResultsResult: Information
  3026. // about a product.
  3027. type GoogleCloudVisionV1p1beta1ProductSearchResultsResult struct {
  3028. // Image: The resource name of the image from the product that is the
  3029. // closest match
  3030. // to the query.
  3031. Image string `json:"image,omitempty"`
  3032. // Product: The Product.
  3033. Product *GoogleCloudVisionV1p1beta1Product `json:"product,omitempty"`
  3034. // Score: A confidence level on the match, ranging from 0 (no
  3035. // confidence) to
  3036. // 1 (full confidence).
  3037. Score float64 `json:"score,omitempty"`
  3038. // ForceSendFields is a list of field names (e.g. "Image") to
  3039. // unconditionally include in API requests. By default, fields with
  3040. // empty values are omitted from API requests. However, any non-pointer,
  3041. // non-interface field appearing in ForceSendFields will be sent to the
  3042. // server regardless of whether the field is empty or not. This may be
  3043. // used to include empty fields in Patch requests.
  3044. ForceSendFields []string `json:"-"`
  3045. // NullFields is a list of field names (e.g. "Image") to include in API
  3046. // requests with the JSON null value. By default, fields with empty
  3047. // values are omitted from API requests. However, any field with an
  3048. // empty value appearing in NullFields will be sent to the server as
  3049. // null. It is an error if a field in this list has a non-empty value.
  3050. // This may be used to include null fields in Patch requests.
  3051. NullFields []string `json:"-"`
  3052. }
  3053. func (s *GoogleCloudVisionV1p1beta1ProductSearchResultsResult) MarshalJSON() ([]byte, error) {
  3054. type NoMethod GoogleCloudVisionV1p1beta1ProductSearchResultsResult
  3055. raw := NoMethod(*s)
  3056. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3057. }
  3058. func (s *GoogleCloudVisionV1p1beta1ProductSearchResultsResult) UnmarshalJSON(data []byte) error {
  3059. type NoMethod GoogleCloudVisionV1p1beta1ProductSearchResultsResult
  3060. var s1 struct {
  3061. Score gensupport.JSONFloat64 `json:"score"`
  3062. *NoMethod
  3063. }
  3064. s1.NoMethod = (*NoMethod)(s)
  3065. if err := json.Unmarshal(data, &s1); err != nil {
  3066. return err
  3067. }
  3068. s.Score = float64(s1.Score)
  3069. return nil
  3070. }
  3071. // GoogleCloudVisionV1p1beta1Property: A `Property` consists of a
  3072. // user-supplied name/value pair.
  3073. type GoogleCloudVisionV1p1beta1Property struct {
  3074. // Name: Name of the property.
  3075. Name string `json:"name,omitempty"`
  3076. // Uint64Value: Value of numeric properties.
  3077. Uint64Value uint64 `json:"uint64Value,omitempty,string"`
  3078. // Value: Value of the property.
  3079. Value string `json:"value,omitempty"`
  3080. // ForceSendFields is a list of field names (e.g. "Name") to
  3081. // unconditionally include in API requests. By default, fields with
  3082. // empty values are omitted from API requests. However, any non-pointer,
  3083. // non-interface field appearing in ForceSendFields will be sent to the
  3084. // server regardless of whether the field is empty or not. This may be
  3085. // used to include empty fields in Patch requests.
  3086. ForceSendFields []string `json:"-"`
  3087. // NullFields is a list of field names (e.g. "Name") to include in API
  3088. // requests with the JSON null value. By default, fields with empty
  3089. // values are omitted from API requests. However, any field with an
  3090. // empty value appearing in NullFields will be sent to the server as
  3091. // null. It is an error if a field in this list has a non-empty value.
  3092. // This may be used to include null fields in Patch requests.
  3093. NullFields []string `json:"-"`
  3094. }
  3095. func (s *GoogleCloudVisionV1p1beta1Property) MarshalJSON() ([]byte, error) {
  3096. type NoMethod GoogleCloudVisionV1p1beta1Property
  3097. raw := NoMethod(*s)
  3098. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3099. }
  3100. // GoogleCloudVisionV1p1beta1SafeSearchAnnotation: Set of features
  3101. // pertaining to the image, computed by computer vision
  3102. // methods over safe-search verticals (for example, adult, spoof,
  3103. // medical,
  3104. // violence).
  3105. type GoogleCloudVisionV1p1beta1SafeSearchAnnotation struct {
  3106. // Adult: Represents the adult content likelihood for the image. Adult
  3107. // content may
  3108. // contain elements such as nudity, pornographic images or cartoons,
  3109. // or
  3110. // sexual activities.
  3111. //
  3112. // Possible values:
  3113. // "UNKNOWN" - Unknown likelihood.
  3114. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  3115. // specified vertical.
  3116. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  3117. // vertical.
  3118. // "POSSIBLE" - It is possible that the image belongs to the specified
  3119. // vertical.
  3120. // "LIKELY" - It is likely that the image belongs to the specified
  3121. // vertical.
  3122. // "VERY_LIKELY" - It is very likely that the image belongs to the
  3123. // specified vertical.
  3124. Adult string `json:"adult,omitempty"`
  3125. // Medical: Likelihood that this is a medical image.
  3126. //
  3127. // Possible values:
  3128. // "UNKNOWN" - Unknown likelihood.
  3129. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  3130. // specified vertical.
  3131. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  3132. // vertical.
  3133. // "POSSIBLE" - It is possible that the image belongs to the specified
  3134. // vertical.
  3135. // "LIKELY" - It is likely that the image belongs to the specified
  3136. // vertical.
  3137. // "VERY_LIKELY" - It is very likely that the image belongs to the
  3138. // specified vertical.
  3139. Medical string `json:"medical,omitempty"`
  3140. // Racy: Likelihood that the request image contains racy content. Racy
  3141. // content may
  3142. // include (but is not limited to) skimpy or sheer clothing,
  3143. // strategically
  3144. // covered nudity, lewd or provocative poses, or close-ups of
  3145. // sensitive
  3146. // body areas.
  3147. //
  3148. // Possible values:
  3149. // "UNKNOWN" - Unknown likelihood.
  3150. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  3151. // specified vertical.
  3152. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  3153. // vertical.
  3154. // "POSSIBLE" - It is possible that the image belongs to the specified
  3155. // vertical.
  3156. // "LIKELY" - It is likely that the image belongs to the specified
  3157. // vertical.
  3158. // "VERY_LIKELY" - It is very likely that the image belongs to the
  3159. // specified vertical.
  3160. Racy string `json:"racy,omitempty"`
  3161. // Spoof: Spoof likelihood. The likelihood that an modification
  3162. // was made to the image's canonical version to make it appear
  3163. // funny or offensive.
  3164. //
  3165. // Possible values:
  3166. // "UNKNOWN" - Unknown likelihood.
  3167. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  3168. // specified vertical.
  3169. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  3170. // vertical.
  3171. // "POSSIBLE" - It is possible that the image belongs to the specified
  3172. // vertical.
  3173. // "LIKELY" - It is likely that the image belongs to the specified
  3174. // vertical.
  3175. // "VERY_LIKELY" - It is very likely that the image belongs to the
  3176. // specified vertical.
  3177. Spoof string `json:"spoof,omitempty"`
  3178. // Violence: Likelihood that this image contains violent content.
  3179. //
  3180. // Possible values:
  3181. // "UNKNOWN" - Unknown likelihood.
  3182. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  3183. // specified vertical.
  3184. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  3185. // vertical.
  3186. // "POSSIBLE" - It is possible that the image belongs to the specified
  3187. // vertical.
  3188. // "LIKELY" - It is likely that the image belongs to the specified
  3189. // vertical.
  3190. // "VERY_LIKELY" - It is very likely that the image belongs to the
  3191. // specified vertical.
  3192. Violence string `json:"violence,omitempty"`
  3193. // ForceSendFields is a list of field names (e.g. "Adult") to
  3194. // unconditionally include in API requests. By default, fields with
  3195. // empty values are omitted from API requests. However, any non-pointer,
  3196. // non-interface field appearing in ForceSendFields will be sent to the
  3197. // server regardless of whether the field is empty or not. This may be
  3198. // used to include empty fields in Patch requests.
  3199. ForceSendFields []string `json:"-"`
  3200. // NullFields is a list of field names (e.g. "Adult") to include in API
  3201. // requests with the JSON null value. By default, fields with empty
  3202. // values are omitted from API requests. However, any field with an
  3203. // empty value appearing in NullFields will be sent to the server as
  3204. // null. It is an error if a field in this list has a non-empty value.
  3205. // This may be used to include null fields in Patch requests.
  3206. NullFields []string `json:"-"`
  3207. }
  3208. func (s *GoogleCloudVisionV1p1beta1SafeSearchAnnotation) MarshalJSON() ([]byte, error) {
  3209. type NoMethod GoogleCloudVisionV1p1beta1SafeSearchAnnotation
  3210. raw := NoMethod(*s)
  3211. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3212. }
  3213. // GoogleCloudVisionV1p1beta1Symbol: A single symbol representation.
  3214. type GoogleCloudVisionV1p1beta1Symbol struct {
  3215. // BoundingBox: The bounding box for the symbol.
  3216. // The vertices are in the order of top-left, top-right,
  3217. // bottom-right,
  3218. // bottom-left. When a rotation of the bounding box is detected the
  3219. // rotation
  3220. // is represented as around the top-left corner as defined when the text
  3221. // is
  3222. // read in the 'natural' orientation.
  3223. // For example:
  3224. // * when the text is horizontal it might look like:
  3225. // 0----1
  3226. // | |
  3227. // 3----2
  3228. // * when it's rotated 180 degrees around the top-left corner it
  3229. // becomes:
  3230. // 2----3
  3231. // | |
  3232. // 1----0
  3233. // and the vertice order will still be (0, 1, 2, 3).
  3234. BoundingBox *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingBox,omitempty"`
  3235. // Confidence: Confidence of the OCR results for the symbol. Range [0,
  3236. // 1].
  3237. Confidence float64 `json:"confidence,omitempty"`
  3238. // Property: Additional information detected for the symbol.
  3239. Property *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty `json:"property,omitempty"`
  3240. // Text: The actual UTF-8 representation of the symbol.
  3241. Text string `json:"text,omitempty"`
  3242. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  3243. // unconditionally include in API requests. By default, fields with
  3244. // empty values are omitted from API requests. However, any non-pointer,
  3245. // non-interface field appearing in ForceSendFields will be sent to the
  3246. // server regardless of whether the field is empty or not. This may be
  3247. // used to include empty fields in Patch requests.
  3248. ForceSendFields []string `json:"-"`
  3249. // NullFields is a list of field names (e.g. "BoundingBox") to include
  3250. // in API requests with the JSON null value. By default, fields with
  3251. // empty values are omitted from API requests. However, any field with
  3252. // an empty value appearing in NullFields will be sent to the server as
  3253. // null. It is an error if a field in this list has a non-empty value.
  3254. // This may be used to include null fields in Patch requests.
  3255. NullFields []string `json:"-"`
  3256. }
  3257. func (s *GoogleCloudVisionV1p1beta1Symbol) MarshalJSON() ([]byte, error) {
  3258. type NoMethod GoogleCloudVisionV1p1beta1Symbol
  3259. raw := NoMethod(*s)
  3260. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3261. }
  3262. func (s *GoogleCloudVisionV1p1beta1Symbol) UnmarshalJSON(data []byte) error {
  3263. type NoMethod GoogleCloudVisionV1p1beta1Symbol
  3264. var s1 struct {
  3265. Confidence gensupport.JSONFloat64 `json:"confidence"`
  3266. *NoMethod
  3267. }
  3268. s1.NoMethod = (*NoMethod)(s)
  3269. if err := json.Unmarshal(data, &s1); err != nil {
  3270. return err
  3271. }
  3272. s.Confidence = float64(s1.Confidence)
  3273. return nil
  3274. }
  3275. // GoogleCloudVisionV1p1beta1TextAnnotation: TextAnnotation contains a
  3276. // structured representation of OCR extracted text.
  3277. // The hierarchy of an OCR extracted text structure is like this:
  3278. // TextAnnotation -> Page -> Block -> Paragraph -> Word ->
  3279. // Symbol
  3280. // Each structural component, starting from Page, may further have their
  3281. // own
  3282. // properties. Properties describe detected languages, breaks etc..
  3283. // Please refer
  3284. // to the TextAnnotation.TextProperty message definition below for
  3285. // more
  3286. // detail.
  3287. type GoogleCloudVisionV1p1beta1TextAnnotation struct {
  3288. // Pages: List of pages detected by OCR.
  3289. Pages []*GoogleCloudVisionV1p1beta1Page `json:"pages,omitempty"`
  3290. // Text: UTF-8 text detected on the pages.
  3291. Text string `json:"text,omitempty"`
  3292. // ForceSendFields is a list of field names (e.g. "Pages") to
  3293. // unconditionally include in API requests. By default, fields with
  3294. // empty values are omitted from API requests. However, any non-pointer,
  3295. // non-interface field appearing in ForceSendFields will be sent to the
  3296. // server regardless of whether the field is empty or not. This may be
  3297. // used to include empty fields in Patch requests.
  3298. ForceSendFields []string `json:"-"`
  3299. // NullFields is a list of field names (e.g. "Pages") to include in API
  3300. // requests with the JSON null value. By default, fields with empty
  3301. // values are omitted from API requests. However, any field with an
  3302. // empty value appearing in NullFields will be sent to the server as
  3303. // null. It is an error if a field in this list has a non-empty value.
  3304. // This may be used to include null fields in Patch requests.
  3305. NullFields []string `json:"-"`
  3306. }
  3307. func (s *GoogleCloudVisionV1p1beta1TextAnnotation) MarshalJSON() ([]byte, error) {
  3308. type NoMethod GoogleCloudVisionV1p1beta1TextAnnotation
  3309. raw := NoMethod(*s)
  3310. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3311. }
  3312. // GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak: Detected start
  3313. // or end of a structural component.
  3314. type GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak struct {
  3315. // IsPrefix: True if break prepends the element.
  3316. IsPrefix bool `json:"isPrefix,omitempty"`
  3317. // Type: Detected break type.
  3318. //
  3319. // Possible values:
  3320. // "UNKNOWN" - Unknown break label type.
  3321. // "SPACE" - Regular space.
  3322. // "SURE_SPACE" - Sure space (very wide).
  3323. // "EOL_SURE_SPACE" - Line-wrapping break.
  3324. // "HYPHEN" - End-line hyphen that is not present in text; does not
  3325. // co-occur with
  3326. // `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`.
  3327. // "LINE_BREAK" - Line break that ends a paragraph.
  3328. Type string `json:"type,omitempty"`
  3329. // ForceSendFields is a list of field names (e.g. "IsPrefix") to
  3330. // unconditionally include in API requests. By default, fields with
  3331. // empty values are omitted from API requests. However, any non-pointer,
  3332. // non-interface field appearing in ForceSendFields will be sent to the
  3333. // server regardless of whether the field is empty or not. This may be
  3334. // used to include empty fields in Patch requests.
  3335. ForceSendFields []string `json:"-"`
  3336. // NullFields is a list of field names (e.g. "IsPrefix") to include in
  3337. // API requests with the JSON null value. By default, fields with empty
  3338. // values are omitted from API requests. However, any field with an
  3339. // empty value appearing in NullFields will be sent to the server as
  3340. // null. It is an error if a field in this list has a non-empty value.
  3341. // This may be used to include null fields in Patch requests.
  3342. NullFields []string `json:"-"`
  3343. }
  3344. func (s *GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak) MarshalJSON() ([]byte, error) {
  3345. type NoMethod GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak
  3346. raw := NoMethod(*s)
  3347. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3348. }
  3349. // GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage: Detected
  3350. // language for a structural component.
  3351. type GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage struct {
  3352. // Confidence: Confidence of detected language. Range [0, 1].
  3353. Confidence float64 `json:"confidence,omitempty"`
  3354. // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn".
  3355. // For more
  3356. // information,
  3357. // see
  3358. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  3359. LanguageCode string `json:"languageCode,omitempty"`
  3360. // ForceSendFields is a list of field names (e.g. "Confidence") to
  3361. // unconditionally include in API requests. By default, fields with
  3362. // empty values are omitted from API requests. However, any non-pointer,
  3363. // non-interface field appearing in ForceSendFields will be sent to the
  3364. // server regardless of whether the field is empty or not. This may be
  3365. // used to include empty fields in Patch requests.
  3366. ForceSendFields []string `json:"-"`
  3367. // NullFields is a list of field names (e.g. "Confidence") to include in
  3368. // API requests with the JSON null value. By default, fields with empty
  3369. // values are omitted from API requests. However, any field with an
  3370. // empty value appearing in NullFields will be sent to the server as
  3371. // null. It is an error if a field in this list has a non-empty value.
  3372. // This may be used to include null fields in Patch requests.
  3373. NullFields []string `json:"-"`
  3374. }
  3375. func (s *GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage) MarshalJSON() ([]byte, error) {
  3376. type NoMethod GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage
  3377. raw := NoMethod(*s)
  3378. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3379. }
  3380. func (s *GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage) UnmarshalJSON(data []byte) error {
  3381. type NoMethod GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage
  3382. var s1 struct {
  3383. Confidence gensupport.JSONFloat64 `json:"confidence"`
  3384. *NoMethod
  3385. }
  3386. s1.NoMethod = (*NoMethod)(s)
  3387. if err := json.Unmarshal(data, &s1); err != nil {
  3388. return err
  3389. }
  3390. s.Confidence = float64(s1.Confidence)
  3391. return nil
  3392. }
  3393. // GoogleCloudVisionV1p1beta1TextAnnotationTextProperty: Additional
  3394. // information detected on the structural component.
  3395. type GoogleCloudVisionV1p1beta1TextAnnotationTextProperty struct {
  3396. // DetectedBreak: Detected start or end of a text segment.
  3397. DetectedBreak *GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak `json:"detectedBreak,omitempty"`
  3398. // DetectedLanguages: A list of detected languages together with
  3399. // confidence.
  3400. DetectedLanguages []*GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage `json:"detectedLanguages,omitempty"`
  3401. // ForceSendFields is a list of field names (e.g. "DetectedBreak") to
  3402. // unconditionally include in API requests. By default, fields with
  3403. // empty values are omitted from API requests. However, any non-pointer,
  3404. // non-interface field appearing in ForceSendFields will be sent to the
  3405. // server regardless of whether the field is empty or not. This may be
  3406. // used to include empty fields in Patch requests.
  3407. ForceSendFields []string `json:"-"`
  3408. // NullFields is a list of field names (e.g. "DetectedBreak") to include
  3409. // in API requests with the JSON null value. By default, fields with
  3410. // empty values are omitted from API requests. However, any field with
  3411. // an empty value appearing in NullFields will be sent to the server as
  3412. // null. It is an error if a field in this list has a non-empty value.
  3413. // This may be used to include null fields in Patch requests.
  3414. NullFields []string `json:"-"`
  3415. }
  3416. func (s *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty) MarshalJSON() ([]byte, error) {
  3417. type NoMethod GoogleCloudVisionV1p1beta1TextAnnotationTextProperty
  3418. raw := NoMethod(*s)
  3419. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3420. }
  3421. // GoogleCloudVisionV1p1beta1Vertex: A vertex represents a 2D point in
  3422. // the image.
  3423. // NOTE: the vertex coordinates are in the same scale as the original
  3424. // image.
  3425. type GoogleCloudVisionV1p1beta1Vertex struct {
  3426. // X: X coordinate.
  3427. X int64 `json:"x,omitempty"`
  3428. // Y: Y coordinate.
  3429. Y int64 `json:"y,omitempty"`
  3430. // ForceSendFields is a list of field names (e.g. "X") to
  3431. // unconditionally include in API requests. By default, fields with
  3432. // empty values are omitted from API requests. However, any non-pointer,
  3433. // non-interface field appearing in ForceSendFields will be sent to the
  3434. // server regardless of whether the field is empty or not. This may be
  3435. // used to include empty fields in Patch requests.
  3436. ForceSendFields []string `json:"-"`
  3437. // NullFields is a list of field names (e.g. "X") to include in API
  3438. // requests with the JSON null value. By default, fields with empty
  3439. // values are omitted from API requests. However, any field with an
  3440. // empty value appearing in NullFields will be sent to the server as
  3441. // null. It is an error if a field in this list has a non-empty value.
  3442. // This may be used to include null fields in Patch requests.
  3443. NullFields []string `json:"-"`
  3444. }
  3445. func (s *GoogleCloudVisionV1p1beta1Vertex) MarshalJSON() ([]byte, error) {
  3446. type NoMethod GoogleCloudVisionV1p1beta1Vertex
  3447. raw := NoMethod(*s)
  3448. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3449. }
  3450. // GoogleCloudVisionV1p1beta1WebDetection: Relevant information for the
  3451. // image from the Internet.
  3452. type GoogleCloudVisionV1p1beta1WebDetection struct {
  3453. // BestGuessLabels: The service's best guess as to the topic of the
  3454. // request image.
  3455. // Inferred from similar images on the open web.
  3456. BestGuessLabels []*GoogleCloudVisionV1p1beta1WebDetectionWebLabel `json:"bestGuessLabels,omitempty"`
  3457. // FullMatchingImages: Fully matching images from the Internet.
  3458. // Can include resized copies of the query image.
  3459. FullMatchingImages []*GoogleCloudVisionV1p1beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"`
  3460. // PagesWithMatchingImages: Web pages containing the matching images
  3461. // from the Internet.
  3462. PagesWithMatchingImages []*GoogleCloudVisionV1p1beta1WebDetectionWebPage `json:"pagesWithMatchingImages,omitempty"`
  3463. // PartialMatchingImages: Partial matching images from the
  3464. // Internet.
  3465. // Those images are similar enough to share some key-point features.
  3466. // For
  3467. // example an original image will likely have partial matching for its
  3468. // crops.
  3469. PartialMatchingImages []*GoogleCloudVisionV1p1beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"`
  3470. // VisuallySimilarImages: The visually similar image results.
  3471. VisuallySimilarImages []*GoogleCloudVisionV1p1beta1WebDetectionWebImage `json:"visuallySimilarImages,omitempty"`
  3472. // WebEntities: Deduced entities from similar images on the Internet.
  3473. WebEntities []*GoogleCloudVisionV1p1beta1WebDetectionWebEntity `json:"webEntities,omitempty"`
  3474. // ForceSendFields is a list of field names (e.g. "BestGuessLabels") to
  3475. // unconditionally include in API requests. By default, fields with
  3476. // empty values are omitted from API requests. However, any non-pointer,
  3477. // non-interface field appearing in ForceSendFields will be sent to the
  3478. // server regardless of whether the field is empty or not. This may be
  3479. // used to include empty fields in Patch requests.
  3480. ForceSendFields []string `json:"-"`
  3481. // NullFields is a list of field names (e.g. "BestGuessLabels") to
  3482. // include in API requests with the JSON null value. By default, fields
  3483. // with empty values are omitted from API requests. However, any field
  3484. // with an empty value appearing in NullFields will be sent to the
  3485. // server as null. It is an error if a field in this list has a
  3486. // non-empty value. This may be used to include null fields in Patch
  3487. // requests.
  3488. NullFields []string `json:"-"`
  3489. }
  3490. func (s *GoogleCloudVisionV1p1beta1WebDetection) MarshalJSON() ([]byte, error) {
  3491. type NoMethod GoogleCloudVisionV1p1beta1WebDetection
  3492. raw := NoMethod(*s)
  3493. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3494. }
  3495. // GoogleCloudVisionV1p1beta1WebDetectionWebEntity: Entity deduced from
  3496. // similar images on the Internet.
  3497. type GoogleCloudVisionV1p1beta1WebDetectionWebEntity struct {
  3498. // Description: Canonical description of the entity, in English.
  3499. Description string `json:"description,omitempty"`
  3500. // EntityId: Opaque entity ID.
  3501. EntityId string `json:"entityId,omitempty"`
  3502. // Score: Overall relevancy score for the entity.
  3503. // Not normalized and not comparable across different image queries.
  3504. Score float64 `json:"score,omitempty"`
  3505. // ForceSendFields is a list of field names (e.g. "Description") to
  3506. // unconditionally include in API requests. By default, fields with
  3507. // empty values are omitted from API requests. However, any non-pointer,
  3508. // non-interface field appearing in ForceSendFields will be sent to the
  3509. // server regardless of whether the field is empty or not. This may be
  3510. // used to include empty fields in Patch requests.
  3511. ForceSendFields []string `json:"-"`
  3512. // NullFields is a list of field names (e.g. "Description") to include
  3513. // in API requests with the JSON null value. By default, fields with
  3514. // empty values are omitted from API requests. However, any field with
  3515. // an empty value appearing in NullFields will be sent to the server as
  3516. // null. It is an error if a field in this list has a non-empty value.
  3517. // This may be used to include null fields in Patch requests.
  3518. NullFields []string `json:"-"`
  3519. }
  3520. func (s *GoogleCloudVisionV1p1beta1WebDetectionWebEntity) MarshalJSON() ([]byte, error) {
  3521. type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebEntity
  3522. raw := NoMethod(*s)
  3523. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3524. }
  3525. func (s *GoogleCloudVisionV1p1beta1WebDetectionWebEntity) UnmarshalJSON(data []byte) error {
  3526. type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebEntity
  3527. var s1 struct {
  3528. Score gensupport.JSONFloat64 `json:"score"`
  3529. *NoMethod
  3530. }
  3531. s1.NoMethod = (*NoMethod)(s)
  3532. if err := json.Unmarshal(data, &s1); err != nil {
  3533. return err
  3534. }
  3535. s.Score = float64(s1.Score)
  3536. return nil
  3537. }
  3538. // GoogleCloudVisionV1p1beta1WebDetectionWebImage: Metadata for online
  3539. // images.
  3540. type GoogleCloudVisionV1p1beta1WebDetectionWebImage struct {
  3541. // Score: (Deprecated) Overall relevancy score for the image.
  3542. Score float64 `json:"score,omitempty"`
  3543. // Url: The result image URL.
  3544. Url string `json:"url,omitempty"`
  3545. // ForceSendFields is a list of field names (e.g. "Score") to
  3546. // unconditionally include in API requests. By default, fields with
  3547. // empty values are omitted from API requests. However, any non-pointer,
  3548. // non-interface field appearing in ForceSendFields will be sent to the
  3549. // server regardless of whether the field is empty or not. This may be
  3550. // used to include empty fields in Patch requests.
  3551. ForceSendFields []string `json:"-"`
  3552. // NullFields is a list of field names (e.g. "Score") to include in API
  3553. // requests with the JSON null value. By default, fields with empty
  3554. // values are omitted from API requests. However, any field with an
  3555. // empty value appearing in NullFields will be sent to the server as
  3556. // null. It is an error if a field in this list has a non-empty value.
  3557. // This may be used to include null fields in Patch requests.
  3558. NullFields []string `json:"-"`
  3559. }
  3560. func (s *GoogleCloudVisionV1p1beta1WebDetectionWebImage) MarshalJSON() ([]byte, error) {
  3561. type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebImage
  3562. raw := NoMethod(*s)
  3563. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3564. }
  3565. func (s *GoogleCloudVisionV1p1beta1WebDetectionWebImage) UnmarshalJSON(data []byte) error {
  3566. type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebImage
  3567. var s1 struct {
  3568. Score gensupport.JSONFloat64 `json:"score"`
  3569. *NoMethod
  3570. }
  3571. s1.NoMethod = (*NoMethod)(s)
  3572. if err := json.Unmarshal(data, &s1); err != nil {
  3573. return err
  3574. }
  3575. s.Score = float64(s1.Score)
  3576. return nil
  3577. }
  3578. // GoogleCloudVisionV1p1beta1WebDetectionWebLabel: Label to provide
  3579. // extra metadata for the web detection.
  3580. type GoogleCloudVisionV1p1beta1WebDetectionWebLabel struct {
  3581. // Label: Label for extra metadata.
  3582. Label string `json:"label,omitempty"`
  3583. // LanguageCode: The BCP-47 language code for `label`, such as "en-US"
  3584. // or "sr-Latn".
  3585. // For more information,
  3586. // see
  3587. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  3588. LanguageCode string `json:"languageCode,omitempty"`
  3589. // ForceSendFields is a list of field names (e.g. "Label") to
  3590. // unconditionally include in API requests. By default, fields with
  3591. // empty values are omitted from API requests. However, any non-pointer,
  3592. // non-interface field appearing in ForceSendFields will be sent to the
  3593. // server regardless of whether the field is empty or not. This may be
  3594. // used to include empty fields in Patch requests.
  3595. ForceSendFields []string `json:"-"`
  3596. // NullFields is a list of field names (e.g. "Label") to include in API
  3597. // requests with the JSON null value. By default, fields with empty
  3598. // values are omitted from API requests. However, any field with an
  3599. // empty value appearing in NullFields will be sent to the server as
  3600. // null. It is an error if a field in this list has a non-empty value.
  3601. // This may be used to include null fields in Patch requests.
  3602. NullFields []string `json:"-"`
  3603. }
  3604. func (s *GoogleCloudVisionV1p1beta1WebDetectionWebLabel) MarshalJSON() ([]byte, error) {
  3605. type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebLabel
  3606. raw := NoMethod(*s)
  3607. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3608. }
  3609. // GoogleCloudVisionV1p1beta1WebDetectionWebPage: Metadata for web
  3610. // pages.
  3611. type GoogleCloudVisionV1p1beta1WebDetectionWebPage struct {
  3612. // FullMatchingImages: Fully matching images on the page.
  3613. // Can include resized copies of the query image.
  3614. FullMatchingImages []*GoogleCloudVisionV1p1beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"`
  3615. // PageTitle: Title for the web page, may contain HTML markups.
  3616. PageTitle string `json:"pageTitle,omitempty"`
  3617. // PartialMatchingImages: Partial matching images on the page.
  3618. // Those images are similar enough to share some key-point features.
  3619. // For
  3620. // example an original image will likely have partial matching for
  3621. // its
  3622. // crops.
  3623. PartialMatchingImages []*GoogleCloudVisionV1p1beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"`
  3624. // Score: (Deprecated) Overall relevancy score for the web page.
  3625. Score float64 `json:"score,omitempty"`
  3626. // Url: The result web page URL.
  3627. Url string `json:"url,omitempty"`
  3628. // ForceSendFields is a list of field names (e.g. "FullMatchingImages")
  3629. // to unconditionally include in API requests. By default, fields with
  3630. // empty values are omitted from API requests. However, any non-pointer,
  3631. // non-interface field appearing in ForceSendFields will be sent to the
  3632. // server regardless of whether the field is empty or not. This may be
  3633. // used to include empty fields in Patch requests.
  3634. ForceSendFields []string `json:"-"`
  3635. // NullFields is a list of field names (e.g. "FullMatchingImages") to
  3636. // include in API requests with the JSON null value. By default, fields
  3637. // with empty values are omitted from API requests. However, any field
  3638. // with an empty value appearing in NullFields will be sent to the
  3639. // server as null. It is an error if a field in this list has a
  3640. // non-empty value. This may be used to include null fields in Patch
  3641. // requests.
  3642. NullFields []string `json:"-"`
  3643. }
  3644. func (s *GoogleCloudVisionV1p1beta1WebDetectionWebPage) MarshalJSON() ([]byte, error) {
  3645. type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebPage
  3646. raw := NoMethod(*s)
  3647. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3648. }
  3649. func (s *GoogleCloudVisionV1p1beta1WebDetectionWebPage) UnmarshalJSON(data []byte) error {
  3650. type NoMethod GoogleCloudVisionV1p1beta1WebDetectionWebPage
  3651. var s1 struct {
  3652. Score gensupport.JSONFloat64 `json:"score"`
  3653. *NoMethod
  3654. }
  3655. s1.NoMethod = (*NoMethod)(s)
  3656. if err := json.Unmarshal(data, &s1); err != nil {
  3657. return err
  3658. }
  3659. s.Score = float64(s1.Score)
  3660. return nil
  3661. }
  3662. // GoogleCloudVisionV1p1beta1Word: A word representation.
  3663. type GoogleCloudVisionV1p1beta1Word struct {
  3664. // BoundingBox: The bounding box for the word.
  3665. // The vertices are in the order of top-left, top-right,
  3666. // bottom-right,
  3667. // bottom-left. When a rotation of the bounding box is detected the
  3668. // rotation
  3669. // is represented as around the top-left corner as defined when the text
  3670. // is
  3671. // read in the 'natural' orientation.
  3672. // For example:
  3673. // * when the text is horizontal it might look like:
  3674. // 0----1
  3675. // | |
  3676. // 3----2
  3677. // * when it's rotated 180 degrees around the top-left corner it
  3678. // becomes:
  3679. // 2----3
  3680. // | |
  3681. // 1----0
  3682. // and the vertex order will still be (0, 1, 2, 3).
  3683. BoundingBox *GoogleCloudVisionV1p1beta1BoundingPoly `json:"boundingBox,omitempty"`
  3684. // Confidence: Confidence of the OCR results for the word. Range [0, 1].
  3685. Confidence float64 `json:"confidence,omitempty"`
  3686. // Property: Additional information detected for the word.
  3687. Property *GoogleCloudVisionV1p1beta1TextAnnotationTextProperty `json:"property,omitempty"`
  3688. // Symbols: List of symbols in the word.
  3689. // The order of the symbols follows the natural reading order.
  3690. Symbols []*GoogleCloudVisionV1p1beta1Symbol `json:"symbols,omitempty"`
  3691. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  3692. // unconditionally include in API requests. By default, fields with
  3693. // empty values are omitted from API requests. However, any non-pointer,
  3694. // non-interface field appearing in ForceSendFields will be sent to the
  3695. // server regardless of whether the field is empty or not. This may be
  3696. // used to include empty fields in Patch requests.
  3697. ForceSendFields []string `json:"-"`
  3698. // NullFields is a list of field names (e.g. "BoundingBox") to include
  3699. // in API requests with the JSON null value. By default, fields with
  3700. // empty values are omitted from API requests. However, any field with
  3701. // an empty value appearing in NullFields will be sent to the server as
  3702. // null. It is an error if a field in this list has a non-empty value.
  3703. // This may be used to include null fields in Patch requests.
  3704. NullFields []string `json:"-"`
  3705. }
  3706. func (s *GoogleCloudVisionV1p1beta1Word) MarshalJSON() ([]byte, error) {
  3707. type NoMethod GoogleCloudVisionV1p1beta1Word
  3708. raw := NoMethod(*s)
  3709. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3710. }
  3711. func (s *GoogleCloudVisionV1p1beta1Word) UnmarshalJSON(data []byte) error {
  3712. type NoMethod GoogleCloudVisionV1p1beta1Word
  3713. var s1 struct {
  3714. Confidence gensupport.JSONFloat64 `json:"confidence"`
  3715. *NoMethod
  3716. }
  3717. s1.NoMethod = (*NoMethod)(s)
  3718. if err := json.Unmarshal(data, &s1); err != nil {
  3719. return err
  3720. }
  3721. s.Confidence = float64(s1.Confidence)
  3722. return nil
  3723. }
  3724. // GoogleCloudVisionV1p2beta1AnnotateFileResponse: Response to a single
  3725. // file annotation request. A file may contain one or more
  3726. // images, which individually have their own responses.
  3727. type GoogleCloudVisionV1p2beta1AnnotateFileResponse struct {
  3728. // InputConfig: Information about the file for which this response is
  3729. // generated.
  3730. InputConfig *GoogleCloudVisionV1p2beta1InputConfig `json:"inputConfig,omitempty"`
  3731. // Responses: Individual responses to images found within the file.
  3732. Responses []*GoogleCloudVisionV1p2beta1AnnotateImageResponse `json:"responses,omitempty"`
  3733. // ForceSendFields is a list of field names (e.g. "InputConfig") to
  3734. // unconditionally include in API requests. By default, fields with
  3735. // empty values are omitted from API requests. However, any non-pointer,
  3736. // non-interface field appearing in ForceSendFields will be sent to the
  3737. // server regardless of whether the field is empty or not. This may be
  3738. // used to include empty fields in Patch requests.
  3739. ForceSendFields []string `json:"-"`
  3740. // NullFields is a list of field names (e.g. "InputConfig") to include
  3741. // in API requests with the JSON null value. By default, fields with
  3742. // empty values are omitted from API requests. However, any field with
  3743. // an empty value appearing in NullFields will be sent to the server as
  3744. // null. It is an error if a field in this list has a non-empty value.
  3745. // This may be used to include null fields in Patch requests.
  3746. NullFields []string `json:"-"`
  3747. }
  3748. func (s *GoogleCloudVisionV1p2beta1AnnotateFileResponse) MarshalJSON() ([]byte, error) {
  3749. type NoMethod GoogleCloudVisionV1p2beta1AnnotateFileResponse
  3750. raw := NoMethod(*s)
  3751. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3752. }
  3753. // GoogleCloudVisionV1p2beta1AnnotateImageResponse: Response to an image
  3754. // annotation request.
  3755. type GoogleCloudVisionV1p2beta1AnnotateImageResponse struct {
  3756. // Context: If present, contextual information is needed to understand
  3757. // where this image
  3758. // comes from.
  3759. Context *GoogleCloudVisionV1p2beta1ImageAnnotationContext `json:"context,omitempty"`
  3760. // CropHintsAnnotation: If present, crop hints have completed
  3761. // successfully.
  3762. CropHintsAnnotation *GoogleCloudVisionV1p2beta1CropHintsAnnotation `json:"cropHintsAnnotation,omitempty"`
  3763. // Error: If set, represents the error message for the operation.
  3764. // Note that filled-in image annotations are guaranteed to be
  3765. // correct, even when `error` is set.
  3766. Error *Status `json:"error,omitempty"`
  3767. // FaceAnnotations: If present, face detection has completed
  3768. // successfully.
  3769. FaceAnnotations []*GoogleCloudVisionV1p2beta1FaceAnnotation `json:"faceAnnotations,omitempty"`
  3770. // FullTextAnnotation: If present, text (OCR) detection or document
  3771. // (OCR) text detection has
  3772. // completed successfully.
  3773. // This annotation provides the structural hierarchy for the OCR
  3774. // detected
  3775. // text.
  3776. FullTextAnnotation *GoogleCloudVisionV1p2beta1TextAnnotation `json:"fullTextAnnotation,omitempty"`
  3777. // ImagePropertiesAnnotation: If present, image properties were
  3778. // extracted successfully.
  3779. ImagePropertiesAnnotation *GoogleCloudVisionV1p2beta1ImageProperties `json:"imagePropertiesAnnotation,omitempty"`
  3780. // LabelAnnotations: If present, label detection has completed
  3781. // successfully.
  3782. LabelAnnotations []*GoogleCloudVisionV1p2beta1EntityAnnotation `json:"labelAnnotations,omitempty"`
  3783. // LandmarkAnnotations: If present, landmark detection has completed
  3784. // successfully.
  3785. LandmarkAnnotations []*GoogleCloudVisionV1p2beta1EntityAnnotation `json:"landmarkAnnotations,omitempty"`
  3786. // LocalizedObjectAnnotations: If present, localized object detection
  3787. // has completed successfully.
  3788. // This will be sorted descending by confidence score.
  3789. LocalizedObjectAnnotations []*GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation `json:"localizedObjectAnnotations,omitempty"`
  3790. // LogoAnnotations: If present, logo detection has completed
  3791. // successfully.
  3792. LogoAnnotations []*GoogleCloudVisionV1p2beta1EntityAnnotation `json:"logoAnnotations,omitempty"`
  3793. // ProductSearchResults: If present, product search has completed
  3794. // successfully.
  3795. ProductSearchResults *GoogleCloudVisionV1p2beta1ProductSearchResults `json:"productSearchResults,omitempty"`
  3796. // SafeSearchAnnotation: If present, safe-search annotation has
  3797. // completed successfully.
  3798. SafeSearchAnnotation *GoogleCloudVisionV1p2beta1SafeSearchAnnotation `json:"safeSearchAnnotation,omitempty"`
  3799. // TextAnnotations: If present, text (OCR) detection has completed
  3800. // successfully.
  3801. TextAnnotations []*GoogleCloudVisionV1p2beta1EntityAnnotation `json:"textAnnotations,omitempty"`
  3802. // WebDetection: If present, web detection has completed successfully.
  3803. WebDetection *GoogleCloudVisionV1p2beta1WebDetection `json:"webDetection,omitempty"`
  3804. // ForceSendFields is a list of field names (e.g. "Context") to
  3805. // unconditionally include in API requests. By default, fields with
  3806. // empty values are omitted from API requests. However, any non-pointer,
  3807. // non-interface field appearing in ForceSendFields will be sent to the
  3808. // server regardless of whether the field is empty or not. This may be
  3809. // used to include empty fields in Patch requests.
  3810. ForceSendFields []string `json:"-"`
  3811. // NullFields is a list of field names (e.g. "Context") to include in
  3812. // API requests with the JSON null value. By default, fields with empty
  3813. // values are omitted from API requests. However, any field with an
  3814. // empty value appearing in NullFields will be sent to the server as
  3815. // null. It is an error if a field in this list has a non-empty value.
  3816. // This may be used to include null fields in Patch requests.
  3817. NullFields []string `json:"-"`
  3818. }
  3819. func (s *GoogleCloudVisionV1p2beta1AnnotateImageResponse) MarshalJSON() ([]byte, error) {
  3820. type NoMethod GoogleCloudVisionV1p2beta1AnnotateImageResponse
  3821. raw := NoMethod(*s)
  3822. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3823. }
  3824. // GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse: The response for
  3825. // a single offline file annotation request.
  3826. type GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse struct {
  3827. // OutputConfig: The output location and metadata from
  3828. // AsyncAnnotateFileRequest.
  3829. OutputConfig *GoogleCloudVisionV1p2beta1OutputConfig `json:"outputConfig,omitempty"`
  3830. // ForceSendFields is a list of field names (e.g. "OutputConfig") to
  3831. // unconditionally include in API requests. By default, fields with
  3832. // empty values are omitted from API requests. However, any non-pointer,
  3833. // non-interface field appearing in ForceSendFields will be sent to the
  3834. // server regardless of whether the field is empty or not. This may be
  3835. // used to include empty fields in Patch requests.
  3836. ForceSendFields []string `json:"-"`
  3837. // NullFields is a list of field names (e.g. "OutputConfig") to include
  3838. // in API requests with the JSON null value. By default, fields with
  3839. // empty values are omitted from API requests. However, any field with
  3840. // an empty value appearing in NullFields will be sent to the server as
  3841. // null. It is an error if a field in this list has a non-empty value.
  3842. // This may be used to include null fields in Patch requests.
  3843. NullFields []string `json:"-"`
  3844. }
  3845. func (s *GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse) MarshalJSON() ([]byte, error) {
  3846. type NoMethod GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse
  3847. raw := NoMethod(*s)
  3848. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3849. }
  3850. // GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse: Response
  3851. // to an async batch file annotation request.
  3852. type GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse struct {
  3853. // Responses: The list of file annotation responses, one for each
  3854. // request in
  3855. // AsyncBatchAnnotateFilesRequest.
  3856. Responses []*GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse `json:"responses,omitempty"`
  3857. // ForceSendFields is a list of field names (e.g. "Responses") to
  3858. // unconditionally include in API requests. By default, fields with
  3859. // empty values are omitted from API requests. However, any non-pointer,
  3860. // non-interface field appearing in ForceSendFields will be sent to the
  3861. // server regardless of whether the field is empty or not. This may be
  3862. // used to include empty fields in Patch requests.
  3863. ForceSendFields []string `json:"-"`
  3864. // NullFields is a list of field names (e.g. "Responses") to include in
  3865. // API requests with the JSON null value. By default, fields with empty
  3866. // values are omitted from API requests. However, any field with an
  3867. // empty value appearing in NullFields will be sent to the server as
  3868. // null. It is an error if a field in this list has a non-empty value.
  3869. // This may be used to include null fields in Patch requests.
  3870. NullFields []string `json:"-"`
  3871. }
  3872. func (s *GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) {
  3873. type NoMethod GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse
  3874. raw := NoMethod(*s)
  3875. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3876. }
  3877. // GoogleCloudVisionV1p2beta1Block: Logical element on the page.
  3878. type GoogleCloudVisionV1p2beta1Block struct {
  3879. // BlockType: Detected block type (text, image etc) for this block.
  3880. //
  3881. // Possible values:
  3882. // "UNKNOWN" - Unknown block type.
  3883. // "TEXT" - Regular text block.
  3884. // "TABLE" - Table block.
  3885. // "PICTURE" - Image block.
  3886. // "RULER" - Horizontal/vertical line box.
  3887. // "BARCODE" - Barcode block.
  3888. BlockType string `json:"blockType,omitempty"`
  3889. // BoundingBox: The bounding box for the block.
  3890. // The vertices are in the order of top-left, top-right,
  3891. // bottom-right,
  3892. // bottom-left. When a rotation of the bounding box is detected the
  3893. // rotation
  3894. // is represented as around the top-left corner as defined when the text
  3895. // is
  3896. // read in the 'natural' orientation.
  3897. // For example:
  3898. //
  3899. // * when the text is horizontal it might look like:
  3900. //
  3901. // 0----1
  3902. // | |
  3903. // 3----2
  3904. //
  3905. // * when it's rotated 180 degrees around the top-left corner it
  3906. // becomes:
  3907. //
  3908. // 2----3
  3909. // | |
  3910. // 1----0
  3911. //
  3912. // and the vertex order will still be (0, 1, 2, 3).
  3913. BoundingBox *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingBox,omitempty"`
  3914. // Confidence: Confidence of the OCR results on the block. Range [0, 1].
  3915. Confidence float64 `json:"confidence,omitempty"`
  3916. // Paragraphs: List of paragraphs in this block (if this blocks is of
  3917. // type text).
  3918. Paragraphs []*GoogleCloudVisionV1p2beta1Paragraph `json:"paragraphs,omitempty"`
  3919. // Property: Additional information detected for the block.
  3920. Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"`
  3921. // ForceSendFields is a list of field names (e.g. "BlockType") to
  3922. // unconditionally include in API requests. By default, fields with
  3923. // empty values are omitted from API requests. However, any non-pointer,
  3924. // non-interface field appearing in ForceSendFields will be sent to the
  3925. // server regardless of whether the field is empty or not. This may be
  3926. // used to include empty fields in Patch requests.
  3927. ForceSendFields []string `json:"-"`
  3928. // NullFields is a list of field names (e.g. "BlockType") to include in
  3929. // API requests with the JSON null value. By default, fields with empty
  3930. // values are omitted from API requests. However, any field with an
  3931. // empty value appearing in NullFields will be sent to the server as
  3932. // null. It is an error if a field in this list has a non-empty value.
  3933. // This may be used to include null fields in Patch requests.
  3934. NullFields []string `json:"-"`
  3935. }
  3936. func (s *GoogleCloudVisionV1p2beta1Block) MarshalJSON() ([]byte, error) {
  3937. type NoMethod GoogleCloudVisionV1p2beta1Block
  3938. raw := NoMethod(*s)
  3939. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3940. }
  3941. func (s *GoogleCloudVisionV1p2beta1Block) UnmarshalJSON(data []byte) error {
  3942. type NoMethod GoogleCloudVisionV1p2beta1Block
  3943. var s1 struct {
  3944. Confidence gensupport.JSONFloat64 `json:"confidence"`
  3945. *NoMethod
  3946. }
  3947. s1.NoMethod = (*NoMethod)(s)
  3948. if err := json.Unmarshal(data, &s1); err != nil {
  3949. return err
  3950. }
  3951. s.Confidence = float64(s1.Confidence)
  3952. return nil
  3953. }
  3954. // GoogleCloudVisionV1p2beta1BoundingPoly: A bounding polygon for the
  3955. // detected image annotation.
  3956. type GoogleCloudVisionV1p2beta1BoundingPoly struct {
  3957. // NormalizedVertices: The bounding polygon normalized vertices.
  3958. NormalizedVertices []*GoogleCloudVisionV1p2beta1NormalizedVertex `json:"normalizedVertices,omitempty"`
  3959. // Vertices: The bounding polygon vertices.
  3960. Vertices []*GoogleCloudVisionV1p2beta1Vertex `json:"vertices,omitempty"`
  3961. // ForceSendFields is a list of field names (e.g. "NormalizedVertices")
  3962. // to unconditionally include in API requests. By default, fields with
  3963. // empty values are omitted from API requests. However, any non-pointer,
  3964. // non-interface field appearing in ForceSendFields will be sent to the
  3965. // server regardless of whether the field is empty or not. This may be
  3966. // used to include empty fields in Patch requests.
  3967. ForceSendFields []string `json:"-"`
  3968. // NullFields is a list of field names (e.g. "NormalizedVertices") to
  3969. // include in API requests with the JSON null value. By default, fields
  3970. // with empty values are omitted from API requests. However, any field
  3971. // with an empty value appearing in NullFields will be sent to the
  3972. // server as null. It is an error if a field in this list has a
  3973. // non-empty value. This may be used to include null fields in Patch
  3974. // requests.
  3975. NullFields []string `json:"-"`
  3976. }
  3977. func (s *GoogleCloudVisionV1p2beta1BoundingPoly) MarshalJSON() ([]byte, error) {
  3978. type NoMethod GoogleCloudVisionV1p2beta1BoundingPoly
  3979. raw := NoMethod(*s)
  3980. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3981. }
  3982. // GoogleCloudVisionV1p2beta1ColorInfo: Color information consists of
  3983. // RGB channels, score, and the fraction of
  3984. // the image that the color occupies in the image.
  3985. type GoogleCloudVisionV1p2beta1ColorInfo struct {
  3986. // Color: RGB components of the color.
  3987. Color *Color `json:"color,omitempty"`
  3988. // PixelFraction: The fraction of pixels the color occupies in the
  3989. // image.
  3990. // Value in range [0, 1].
  3991. PixelFraction float64 `json:"pixelFraction,omitempty"`
  3992. // Score: Image-specific score for this color. Value in range [0, 1].
  3993. Score float64 `json:"score,omitempty"`
  3994. // ForceSendFields is a list of field names (e.g. "Color") to
  3995. // unconditionally include in API requests. By default, fields with
  3996. // empty values are omitted from API requests. However, any non-pointer,
  3997. // non-interface field appearing in ForceSendFields will be sent to the
  3998. // server regardless of whether the field is empty or not. This may be
  3999. // used to include empty fields in Patch requests.
  4000. ForceSendFields []string `json:"-"`
  4001. // NullFields is a list of field names (e.g. "Color") to include in API
  4002. // requests with the JSON null value. By default, fields with empty
  4003. // values are omitted from API requests. However, any field with an
  4004. // empty value appearing in NullFields will be sent to the server as
  4005. // null. It is an error if a field in this list has a non-empty value.
  4006. // This may be used to include null fields in Patch requests.
  4007. NullFields []string `json:"-"`
  4008. }
  4009. func (s *GoogleCloudVisionV1p2beta1ColorInfo) MarshalJSON() ([]byte, error) {
  4010. type NoMethod GoogleCloudVisionV1p2beta1ColorInfo
  4011. raw := NoMethod(*s)
  4012. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4013. }
  4014. func (s *GoogleCloudVisionV1p2beta1ColorInfo) UnmarshalJSON(data []byte) error {
  4015. type NoMethod GoogleCloudVisionV1p2beta1ColorInfo
  4016. var s1 struct {
  4017. PixelFraction gensupport.JSONFloat64 `json:"pixelFraction"`
  4018. Score gensupport.JSONFloat64 `json:"score"`
  4019. *NoMethod
  4020. }
  4021. s1.NoMethod = (*NoMethod)(s)
  4022. if err := json.Unmarshal(data, &s1); err != nil {
  4023. return err
  4024. }
  4025. s.PixelFraction = float64(s1.PixelFraction)
  4026. s.Score = float64(s1.Score)
  4027. return nil
  4028. }
  4029. // GoogleCloudVisionV1p2beta1CropHint: Single crop hint that is used to
  4030. // generate a new crop when serving an image.
  4031. type GoogleCloudVisionV1p2beta1CropHint struct {
  4032. // BoundingPoly: The bounding polygon for the crop region. The
  4033. // coordinates of the bounding
  4034. // box are in the original image's scale.
  4035. BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"`
  4036. // Confidence: Confidence of this being a salient region. Range [0, 1].
  4037. Confidence float64 `json:"confidence,omitempty"`
  4038. // ImportanceFraction: Fraction of importance of this salient region
  4039. // with respect to the original
  4040. // image.
  4041. ImportanceFraction float64 `json:"importanceFraction,omitempty"`
  4042. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  4043. // unconditionally include in API requests. By default, fields with
  4044. // empty values are omitted from API requests. However, any non-pointer,
  4045. // non-interface field appearing in ForceSendFields will be sent to the
  4046. // server regardless of whether the field is empty or not. This may be
  4047. // used to include empty fields in Patch requests.
  4048. ForceSendFields []string `json:"-"`
  4049. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  4050. // in API requests with the JSON null value. By default, fields with
  4051. // empty values are omitted from API requests. However, any field with
  4052. // an empty value appearing in NullFields will be sent to the server as
  4053. // null. It is an error if a field in this list has a non-empty value.
  4054. // This may be used to include null fields in Patch requests.
  4055. NullFields []string `json:"-"`
  4056. }
  4057. func (s *GoogleCloudVisionV1p2beta1CropHint) MarshalJSON() ([]byte, error) {
  4058. type NoMethod GoogleCloudVisionV1p2beta1CropHint
  4059. raw := NoMethod(*s)
  4060. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4061. }
  4062. func (s *GoogleCloudVisionV1p2beta1CropHint) UnmarshalJSON(data []byte) error {
  4063. type NoMethod GoogleCloudVisionV1p2beta1CropHint
  4064. var s1 struct {
  4065. Confidence gensupport.JSONFloat64 `json:"confidence"`
  4066. ImportanceFraction gensupport.JSONFloat64 `json:"importanceFraction"`
  4067. *NoMethod
  4068. }
  4069. s1.NoMethod = (*NoMethod)(s)
  4070. if err := json.Unmarshal(data, &s1); err != nil {
  4071. return err
  4072. }
  4073. s.Confidence = float64(s1.Confidence)
  4074. s.ImportanceFraction = float64(s1.ImportanceFraction)
  4075. return nil
  4076. }
  4077. // GoogleCloudVisionV1p2beta1CropHintsAnnotation: Set of crop hints that
  4078. // are used to generate new crops when serving images.
  4079. type GoogleCloudVisionV1p2beta1CropHintsAnnotation struct {
  4080. // CropHints: Crop hint results.
  4081. CropHints []*GoogleCloudVisionV1p2beta1CropHint `json:"cropHints,omitempty"`
  4082. // ForceSendFields is a list of field names (e.g. "CropHints") to
  4083. // unconditionally include in API requests. By default, fields with
  4084. // empty values are omitted from API requests. However, any non-pointer,
  4085. // non-interface field appearing in ForceSendFields will be sent to the
  4086. // server regardless of whether the field is empty or not. This may be
  4087. // used to include empty fields in Patch requests.
  4088. ForceSendFields []string `json:"-"`
  4089. // NullFields is a list of field names (e.g. "CropHints") to include in
  4090. // API requests with the JSON null value. By default, fields with empty
  4091. // values are omitted from API requests. However, any field with an
  4092. // empty value appearing in NullFields will be sent to the server as
  4093. // null. It is an error if a field in this list has a non-empty value.
  4094. // This may be used to include null fields in Patch requests.
  4095. NullFields []string `json:"-"`
  4096. }
  4097. func (s *GoogleCloudVisionV1p2beta1CropHintsAnnotation) MarshalJSON() ([]byte, error) {
  4098. type NoMethod GoogleCloudVisionV1p2beta1CropHintsAnnotation
  4099. raw := NoMethod(*s)
  4100. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4101. }
  4102. // GoogleCloudVisionV1p2beta1DominantColorsAnnotation: Set of dominant
  4103. // colors and their corresponding scores.
  4104. type GoogleCloudVisionV1p2beta1DominantColorsAnnotation struct {
  4105. // Colors: RGB color values with their score and pixel fraction.
  4106. Colors []*GoogleCloudVisionV1p2beta1ColorInfo `json:"colors,omitempty"`
  4107. // ForceSendFields is a list of field names (e.g. "Colors") to
  4108. // unconditionally include in API requests. By default, fields with
  4109. // empty values are omitted from API requests. However, any non-pointer,
  4110. // non-interface field appearing in ForceSendFields will be sent to the
  4111. // server regardless of whether the field is empty or not. This may be
  4112. // used to include empty fields in Patch requests.
  4113. ForceSendFields []string `json:"-"`
  4114. // NullFields is a list of field names (e.g. "Colors") to include in API
  4115. // requests with the JSON null value. By default, fields with empty
  4116. // values are omitted from API requests. However, any field with an
  4117. // empty value appearing in NullFields will be sent to the server as
  4118. // null. It is an error if a field in this list has a non-empty value.
  4119. // This may be used to include null fields in Patch requests.
  4120. NullFields []string `json:"-"`
  4121. }
  4122. func (s *GoogleCloudVisionV1p2beta1DominantColorsAnnotation) MarshalJSON() ([]byte, error) {
  4123. type NoMethod GoogleCloudVisionV1p2beta1DominantColorsAnnotation
  4124. raw := NoMethod(*s)
  4125. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4126. }
  4127. // GoogleCloudVisionV1p2beta1EntityAnnotation: Set of detected entity
  4128. // features.
  4129. type GoogleCloudVisionV1p2beta1EntityAnnotation struct {
  4130. // BoundingPoly: Image region to which this entity belongs. Not
  4131. // produced
  4132. // for `LABEL_DETECTION` features.
  4133. BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"`
  4134. // Confidence: **Deprecated. Use `score` instead.**
  4135. // The accuracy of the entity detection in an image.
  4136. // For example, for an image in which the "Eiffel Tower" entity is
  4137. // detected,
  4138. // this field represents the confidence that there is a tower in the
  4139. // query
  4140. // image. Range [0, 1].
  4141. Confidence float64 `json:"confidence,omitempty"`
  4142. // Description: Entity textual description, expressed in its `locale`
  4143. // language.
  4144. Description string `json:"description,omitempty"`
  4145. // Locale: The language code for the locale in which the entity
  4146. // textual
  4147. // `description` is expressed.
  4148. Locale string `json:"locale,omitempty"`
  4149. // Locations: The location information for the detected entity.
  4150. // Multiple
  4151. // `LocationInfo` elements can be present because one location
  4152. // may
  4153. // indicate the location of the scene in the image, and another
  4154. // location
  4155. // may indicate the location of the place where the image was
  4156. // taken.
  4157. // Location information is usually present for landmarks.
  4158. Locations []*GoogleCloudVisionV1p2beta1LocationInfo `json:"locations,omitempty"`
  4159. // Mid: Opaque entity ID. Some IDs may be available in
  4160. // [Google Knowledge Graph
  4161. // Search
  4162. // API](https://developers.google.com/knowledge-graph/).
  4163. Mid string `json:"mid,omitempty"`
  4164. // Properties: Some entities may have optional user-supplied `Property`
  4165. // (name/value)
  4166. // fields, such a score or string that qualifies the entity.
  4167. Properties []*GoogleCloudVisionV1p2beta1Property `json:"properties,omitempty"`
  4168. // Score: Overall score of the result. Range [0, 1].
  4169. Score float64 `json:"score,omitempty"`
  4170. // Topicality: The relevancy of the ICA (Image Content Annotation) label
  4171. // to the
  4172. // image. For example, the relevancy of "tower" is likely higher to an
  4173. // image
  4174. // containing the detected "Eiffel Tower" than to an image containing
  4175. // a
  4176. // detected distant towering building, even though the confidence
  4177. // that
  4178. // there is a tower in each image may be the same. Range [0, 1].
  4179. Topicality float64 `json:"topicality,omitempty"`
  4180. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  4181. // unconditionally include in API requests. By default, fields with
  4182. // empty values are omitted from API requests. However, any non-pointer,
  4183. // non-interface field appearing in ForceSendFields will be sent to the
  4184. // server regardless of whether the field is empty or not. This may be
  4185. // used to include empty fields in Patch requests.
  4186. ForceSendFields []string `json:"-"`
  4187. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  4188. // in API requests with the JSON null value. By default, fields with
  4189. // empty values are omitted from API requests. However, any field with
  4190. // an empty value appearing in NullFields will be sent to the server as
  4191. // null. It is an error if a field in this list has a non-empty value.
  4192. // This may be used to include null fields in Patch requests.
  4193. NullFields []string `json:"-"`
  4194. }
  4195. func (s *GoogleCloudVisionV1p2beta1EntityAnnotation) MarshalJSON() ([]byte, error) {
  4196. type NoMethod GoogleCloudVisionV1p2beta1EntityAnnotation
  4197. raw := NoMethod(*s)
  4198. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4199. }
  4200. func (s *GoogleCloudVisionV1p2beta1EntityAnnotation) UnmarshalJSON(data []byte) error {
  4201. type NoMethod GoogleCloudVisionV1p2beta1EntityAnnotation
  4202. var s1 struct {
  4203. Confidence gensupport.JSONFloat64 `json:"confidence"`
  4204. Score gensupport.JSONFloat64 `json:"score"`
  4205. Topicality gensupport.JSONFloat64 `json:"topicality"`
  4206. *NoMethod
  4207. }
  4208. s1.NoMethod = (*NoMethod)(s)
  4209. if err := json.Unmarshal(data, &s1); err != nil {
  4210. return err
  4211. }
  4212. s.Confidence = float64(s1.Confidence)
  4213. s.Score = float64(s1.Score)
  4214. s.Topicality = float64(s1.Topicality)
  4215. return nil
  4216. }
  4217. // GoogleCloudVisionV1p2beta1FaceAnnotation: A face annotation object
  4218. // contains the results of face detection.
  4219. type GoogleCloudVisionV1p2beta1FaceAnnotation struct {
  4220. // AngerLikelihood: Anger likelihood.
  4221. //
  4222. // Possible values:
  4223. // "UNKNOWN" - Unknown likelihood.
  4224. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  4225. // specified vertical.
  4226. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  4227. // vertical.
  4228. // "POSSIBLE" - It is possible that the image belongs to the specified
  4229. // vertical.
  4230. // "LIKELY" - It is likely that the image belongs to the specified
  4231. // vertical.
  4232. // "VERY_LIKELY" - It is very likely that the image belongs to the
  4233. // specified vertical.
  4234. AngerLikelihood string `json:"angerLikelihood,omitempty"`
  4235. // BlurredLikelihood: Blurred likelihood.
  4236. //
  4237. // Possible values:
  4238. // "UNKNOWN" - Unknown likelihood.
  4239. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  4240. // specified vertical.
  4241. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  4242. // vertical.
  4243. // "POSSIBLE" - It is possible that the image belongs to the specified
  4244. // vertical.
  4245. // "LIKELY" - It is likely that the image belongs to the specified
  4246. // vertical.
  4247. // "VERY_LIKELY" - It is very likely that the image belongs to the
  4248. // specified vertical.
  4249. BlurredLikelihood string `json:"blurredLikelihood,omitempty"`
  4250. // BoundingPoly: The bounding polygon around the face. The coordinates
  4251. // of the bounding box
  4252. // are in the original image's scale.
  4253. // The bounding box is computed to "frame" the face in accordance with
  4254. // human
  4255. // expectations. It is based on the landmarker results.
  4256. // Note that one or more x and/or y coordinates may not be generated in
  4257. // the
  4258. // `BoundingPoly` (the polygon will be unbounded) if only a partial
  4259. // face
  4260. // appears in the image to be annotated.
  4261. BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"`
  4262. // DetectionConfidence: Detection confidence. Range [0, 1].
  4263. DetectionConfidence float64 `json:"detectionConfidence,omitempty"`
  4264. // FdBoundingPoly: The `fd_bounding_poly` bounding polygon is tighter
  4265. // than the
  4266. // `boundingPoly`, and encloses only the skin part of the face.
  4267. // Typically, it
  4268. // is used to eliminate the face from any image analysis that detects
  4269. // the
  4270. // "amount of skin" visible in an image. It is not based on
  4271. // the
  4272. // landmarker results, only on the initial face detection, hence
  4273. // the <code>fd</code> (face detection) prefix.
  4274. FdBoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"fdBoundingPoly,omitempty"`
  4275. // HeadwearLikelihood: Headwear likelihood.
  4276. //
  4277. // Possible values:
  4278. // "UNKNOWN" - Unknown likelihood.
  4279. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  4280. // specified vertical.
  4281. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  4282. // vertical.
  4283. // "POSSIBLE" - It is possible that the image belongs to the specified
  4284. // vertical.
  4285. // "LIKELY" - It is likely that the image belongs to the specified
  4286. // vertical.
  4287. // "VERY_LIKELY" - It is very likely that the image belongs to the
  4288. // specified vertical.
  4289. HeadwearLikelihood string `json:"headwearLikelihood,omitempty"`
  4290. // JoyLikelihood: Joy likelihood.
  4291. //
  4292. // Possible values:
  4293. // "UNKNOWN" - Unknown likelihood.
  4294. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  4295. // specified vertical.
  4296. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  4297. // vertical.
  4298. // "POSSIBLE" - It is possible that the image belongs to the specified
  4299. // vertical.
  4300. // "LIKELY" - It is likely that the image belongs to the specified
  4301. // vertical.
  4302. // "VERY_LIKELY" - It is very likely that the image belongs to the
  4303. // specified vertical.
  4304. JoyLikelihood string `json:"joyLikelihood,omitempty"`
  4305. // LandmarkingConfidence: Face landmarking confidence. Range [0, 1].
  4306. LandmarkingConfidence float64 `json:"landmarkingConfidence,omitempty"`
  4307. // Landmarks: Detected face landmarks.
  4308. Landmarks []*GoogleCloudVisionV1p2beta1FaceAnnotationLandmark `json:"landmarks,omitempty"`
  4309. // PanAngle: Yaw angle, which indicates the leftward/rightward angle
  4310. // that the face is
  4311. // pointing relative to the vertical plane perpendicular to the image.
  4312. // Range
  4313. // [-180,180].
  4314. PanAngle float64 `json:"panAngle,omitempty"`
  4315. // RollAngle: Roll angle, which indicates the amount of
  4316. // clockwise/anti-clockwise rotation
  4317. // of the face relative to the image vertical about the axis
  4318. // perpendicular to
  4319. // the face. Range [-180,180].
  4320. RollAngle float64 `json:"rollAngle,omitempty"`
  4321. // SorrowLikelihood: Sorrow likelihood.
  4322. //
  4323. // Possible values:
  4324. // "UNKNOWN" - Unknown likelihood.
  4325. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  4326. // specified vertical.
  4327. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  4328. // vertical.
  4329. // "POSSIBLE" - It is possible that the image belongs to the specified
  4330. // vertical.
  4331. // "LIKELY" - It is likely that the image belongs to the specified
  4332. // vertical.
  4333. // "VERY_LIKELY" - It is very likely that the image belongs to the
  4334. // specified vertical.
  4335. SorrowLikelihood string `json:"sorrowLikelihood,omitempty"`
  4336. // SurpriseLikelihood: Surprise likelihood.
  4337. //
  4338. // Possible values:
  4339. // "UNKNOWN" - Unknown likelihood.
  4340. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  4341. // specified vertical.
  4342. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  4343. // vertical.
  4344. // "POSSIBLE" - It is possible that the image belongs to the specified
  4345. // vertical.
  4346. // "LIKELY" - It is likely that the image belongs to the specified
  4347. // vertical.
  4348. // "VERY_LIKELY" - It is very likely that the image belongs to the
  4349. // specified vertical.
  4350. SurpriseLikelihood string `json:"surpriseLikelihood,omitempty"`
  4351. // TiltAngle: Pitch angle, which indicates the upwards/downwards angle
  4352. // that the face is
  4353. // pointing relative to the image's horizontal plane. Range [-180,180].
  4354. TiltAngle float64 `json:"tiltAngle,omitempty"`
  4355. // UnderExposedLikelihood: Under-exposed likelihood.
  4356. //
  4357. // Possible values:
  4358. // "UNKNOWN" - Unknown likelihood.
  4359. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  4360. // specified vertical.
  4361. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  4362. // vertical.
  4363. // "POSSIBLE" - It is possible that the image belongs to the specified
  4364. // vertical.
  4365. // "LIKELY" - It is likely that the image belongs to the specified
  4366. // vertical.
  4367. // "VERY_LIKELY" - It is very likely that the image belongs to the
  4368. // specified vertical.
  4369. UnderExposedLikelihood string `json:"underExposedLikelihood,omitempty"`
  4370. // ForceSendFields is a list of field names (e.g. "AngerLikelihood") to
  4371. // unconditionally include in API requests. By default, fields with
  4372. // empty values are omitted from API requests. However, any non-pointer,
  4373. // non-interface field appearing in ForceSendFields will be sent to the
  4374. // server regardless of whether the field is empty or not. This may be
  4375. // used to include empty fields in Patch requests.
  4376. ForceSendFields []string `json:"-"`
  4377. // NullFields is a list of field names (e.g. "AngerLikelihood") to
  4378. // include in API requests with the JSON null value. By default, fields
  4379. // with empty values are omitted from API requests. However, any field
  4380. // with an empty value appearing in NullFields will be sent to the
  4381. // server as null. It is an error if a field in this list has a
  4382. // non-empty value. This may be used to include null fields in Patch
  4383. // requests.
  4384. NullFields []string `json:"-"`
  4385. }
  4386. func (s *GoogleCloudVisionV1p2beta1FaceAnnotation) MarshalJSON() ([]byte, error) {
  4387. type NoMethod GoogleCloudVisionV1p2beta1FaceAnnotation
  4388. raw := NoMethod(*s)
  4389. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4390. }
  4391. func (s *GoogleCloudVisionV1p2beta1FaceAnnotation) UnmarshalJSON(data []byte) error {
  4392. type NoMethod GoogleCloudVisionV1p2beta1FaceAnnotation
  4393. var s1 struct {
  4394. DetectionConfidence gensupport.JSONFloat64 `json:"detectionConfidence"`
  4395. LandmarkingConfidence gensupport.JSONFloat64 `json:"landmarkingConfidence"`
  4396. PanAngle gensupport.JSONFloat64 `json:"panAngle"`
  4397. RollAngle gensupport.JSONFloat64 `json:"rollAngle"`
  4398. TiltAngle gensupport.JSONFloat64 `json:"tiltAngle"`
  4399. *NoMethod
  4400. }
  4401. s1.NoMethod = (*NoMethod)(s)
  4402. if err := json.Unmarshal(data, &s1); err != nil {
  4403. return err
  4404. }
  4405. s.DetectionConfidence = float64(s1.DetectionConfidence)
  4406. s.LandmarkingConfidence = float64(s1.LandmarkingConfidence)
  4407. s.PanAngle = float64(s1.PanAngle)
  4408. s.RollAngle = float64(s1.RollAngle)
  4409. s.TiltAngle = float64(s1.TiltAngle)
  4410. return nil
  4411. }
  4412. // GoogleCloudVisionV1p2beta1FaceAnnotationLandmark: A face-specific
  4413. // landmark (for example, a face feature).
  4414. type GoogleCloudVisionV1p2beta1FaceAnnotationLandmark struct {
  4415. // Position: Face landmark position.
  4416. Position *GoogleCloudVisionV1p2beta1Position `json:"position,omitempty"`
  4417. // Type: Face landmark type.
  4418. //
  4419. // Possible values:
  4420. // "UNKNOWN_LANDMARK" - Unknown face landmark detected. Should not be
  4421. // filled.
  4422. // "LEFT_EYE" - Left eye.
  4423. // "RIGHT_EYE" - Right eye.
  4424. // "LEFT_OF_LEFT_EYEBROW" - Left of left eyebrow.
  4425. // "RIGHT_OF_LEFT_EYEBROW" - Right of left eyebrow.
  4426. // "LEFT_OF_RIGHT_EYEBROW" - Left of right eyebrow.
  4427. // "RIGHT_OF_RIGHT_EYEBROW" - Right of right eyebrow.
  4428. // "MIDPOINT_BETWEEN_EYES" - Midpoint between eyes.
  4429. // "NOSE_TIP" - Nose tip.
  4430. // "UPPER_LIP" - Upper lip.
  4431. // "LOWER_LIP" - Lower lip.
  4432. // "MOUTH_LEFT" - Mouth left.
  4433. // "MOUTH_RIGHT" - Mouth right.
  4434. // "MOUTH_CENTER" - Mouth center.
  4435. // "NOSE_BOTTOM_RIGHT" - Nose, bottom right.
  4436. // "NOSE_BOTTOM_LEFT" - Nose, bottom left.
  4437. // "NOSE_BOTTOM_CENTER" - Nose, bottom center.
  4438. // "LEFT_EYE_TOP_BOUNDARY" - Left eye, top boundary.
  4439. // "LEFT_EYE_RIGHT_CORNER" - Left eye, right corner.
  4440. // "LEFT_EYE_BOTTOM_BOUNDARY" - Left eye, bottom boundary.
  4441. // "LEFT_EYE_LEFT_CORNER" - Left eye, left corner.
  4442. // "RIGHT_EYE_TOP_BOUNDARY" - Right eye, top boundary.
  4443. // "RIGHT_EYE_RIGHT_CORNER" - Right eye, right corner.
  4444. // "RIGHT_EYE_BOTTOM_BOUNDARY" - Right eye, bottom boundary.
  4445. // "RIGHT_EYE_LEFT_CORNER" - Right eye, left corner.
  4446. // "LEFT_EYEBROW_UPPER_MIDPOINT" - Left eyebrow, upper midpoint.
  4447. // "RIGHT_EYEBROW_UPPER_MIDPOINT" - Right eyebrow, upper midpoint.
  4448. // "LEFT_EAR_TRAGION" - Left ear tragion.
  4449. // "RIGHT_EAR_TRAGION" - Right ear tragion.
  4450. // "LEFT_EYE_PUPIL" - Left eye pupil.
  4451. // "RIGHT_EYE_PUPIL" - Right eye pupil.
  4452. // "FOREHEAD_GLABELLA" - Forehead glabella.
  4453. // "CHIN_GNATHION" - Chin gnathion.
  4454. // "CHIN_LEFT_GONION" - Chin left gonion.
  4455. // "CHIN_RIGHT_GONION" - Chin right gonion.
  4456. Type string `json:"type,omitempty"`
  4457. // ForceSendFields is a list of field names (e.g. "Position") to
  4458. // unconditionally include in API requests. By default, fields with
  4459. // empty values are omitted from API requests. However, any non-pointer,
  4460. // non-interface field appearing in ForceSendFields will be sent to the
  4461. // server regardless of whether the field is empty or not. This may be
  4462. // used to include empty fields in Patch requests.
  4463. ForceSendFields []string `json:"-"`
  4464. // NullFields is a list of field names (e.g. "Position") to include in
  4465. // API requests with the JSON null value. By default, fields with empty
  4466. // values are omitted from API requests. However, any field with an
  4467. // empty value appearing in NullFields will be sent to the server as
  4468. // null. It is an error if a field in this list has a non-empty value.
  4469. // This may be used to include null fields in Patch requests.
  4470. NullFields []string `json:"-"`
  4471. }
  4472. func (s *GoogleCloudVisionV1p2beta1FaceAnnotationLandmark) MarshalJSON() ([]byte, error) {
  4473. type NoMethod GoogleCloudVisionV1p2beta1FaceAnnotationLandmark
  4474. raw := NoMethod(*s)
  4475. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4476. }
  4477. // GoogleCloudVisionV1p2beta1GcsDestination: The Google Cloud Storage
  4478. // location where the output will be written to.
  4479. type GoogleCloudVisionV1p2beta1GcsDestination struct {
  4480. // Uri: Google Cloud Storage URI where the results will be stored.
  4481. // Results will
  4482. // be in JSON format and preceded by its corresponding input URI. This
  4483. // field
  4484. // can either represent a single file, or a prefix for multiple
  4485. // outputs.
  4486. // Prefixes must end in a `/`.
  4487. //
  4488. // Examples:
  4489. //
  4490. // * File: gs://bucket-name/filename.json
  4491. // * Prefix: gs://bucket-name/prefix/here/
  4492. // * File: gs://bucket-name/prefix/here
  4493. //
  4494. // If multiple outputs, each response is still AnnotateFileResponse,
  4495. // each of
  4496. // which contains some subset of the full list of
  4497. // AnnotateImageResponse.
  4498. // Multiple outputs can happen if, for example, the output JSON is too
  4499. // large
  4500. // and overflows into multiple sharded files.
  4501. Uri string `json:"uri,omitempty"`
  4502. // ForceSendFields is a list of field names (e.g. "Uri") to
  4503. // unconditionally include in API requests. By default, fields with
  4504. // empty values are omitted from API requests. However, any non-pointer,
  4505. // non-interface field appearing in ForceSendFields will be sent to the
  4506. // server regardless of whether the field is empty or not. This may be
  4507. // used to include empty fields in Patch requests.
  4508. ForceSendFields []string `json:"-"`
  4509. // NullFields is a list of field names (e.g. "Uri") to include in API
  4510. // requests with the JSON null value. By default, fields with empty
  4511. // values are omitted from API requests. However, any field with an
  4512. // empty value appearing in NullFields will be sent to the server as
  4513. // null. It is an error if a field in this list has a non-empty value.
  4514. // This may be used to include null fields in Patch requests.
  4515. NullFields []string `json:"-"`
  4516. }
  4517. func (s *GoogleCloudVisionV1p2beta1GcsDestination) MarshalJSON() ([]byte, error) {
  4518. type NoMethod GoogleCloudVisionV1p2beta1GcsDestination
  4519. raw := NoMethod(*s)
  4520. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4521. }
  4522. // GoogleCloudVisionV1p2beta1GcsSource: The Google Cloud Storage
  4523. // location where the input will be read from.
  4524. type GoogleCloudVisionV1p2beta1GcsSource struct {
  4525. // Uri: Google Cloud Storage URI for the input file. This must only be
  4526. // a
  4527. // Google Cloud Storage object. Wildcards are not currently supported.
  4528. Uri string `json:"uri,omitempty"`
  4529. // ForceSendFields is a list of field names (e.g. "Uri") to
  4530. // unconditionally include in API requests. By default, fields with
  4531. // empty values are omitted from API requests. However, any non-pointer,
  4532. // non-interface field appearing in ForceSendFields will be sent to the
  4533. // server regardless of whether the field is empty or not. This may be
  4534. // used to include empty fields in Patch requests.
  4535. ForceSendFields []string `json:"-"`
  4536. // NullFields is a list of field names (e.g. "Uri") to include in API
  4537. // requests with the JSON null value. By default, fields with empty
  4538. // values are omitted from API requests. However, any field with an
  4539. // empty value appearing in NullFields will be sent to the server as
  4540. // null. It is an error if a field in this list has a non-empty value.
  4541. // This may be used to include null fields in Patch requests.
  4542. NullFields []string `json:"-"`
  4543. }
  4544. func (s *GoogleCloudVisionV1p2beta1GcsSource) MarshalJSON() ([]byte, error) {
  4545. type NoMethod GoogleCloudVisionV1p2beta1GcsSource
  4546. raw := NoMethod(*s)
  4547. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4548. }
  4549. // GoogleCloudVisionV1p2beta1ImageAnnotationContext: If an image was
  4550. // produced from a file (e.g. a PDF), this message gives
  4551. // information about the source of that image.
  4552. type GoogleCloudVisionV1p2beta1ImageAnnotationContext struct {
  4553. // PageNumber: If the file was a PDF or TIFF, this field gives the page
  4554. // number within
  4555. // the file used to produce the image.
  4556. PageNumber int64 `json:"pageNumber,omitempty"`
  4557. // Uri: The URI of the file used to produce the image.
  4558. Uri string `json:"uri,omitempty"`
  4559. // ForceSendFields is a list of field names (e.g. "PageNumber") to
  4560. // unconditionally include in API requests. By default, fields with
  4561. // empty values are omitted from API requests. However, any non-pointer,
  4562. // non-interface field appearing in ForceSendFields will be sent to the
  4563. // server regardless of whether the field is empty or not. This may be
  4564. // used to include empty fields in Patch requests.
  4565. ForceSendFields []string `json:"-"`
  4566. // NullFields is a list of field names (e.g. "PageNumber") to include in
  4567. // API requests with the JSON null value. By default, fields with empty
  4568. // values are omitted from API requests. However, any field with an
  4569. // empty value appearing in NullFields will be sent to the server as
  4570. // null. It is an error if a field in this list has a non-empty value.
  4571. // This may be used to include null fields in Patch requests.
  4572. NullFields []string `json:"-"`
  4573. }
  4574. func (s *GoogleCloudVisionV1p2beta1ImageAnnotationContext) MarshalJSON() ([]byte, error) {
  4575. type NoMethod GoogleCloudVisionV1p2beta1ImageAnnotationContext
  4576. raw := NoMethod(*s)
  4577. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4578. }
  4579. // GoogleCloudVisionV1p2beta1ImageProperties: Stores image properties,
  4580. // such as dominant colors.
  4581. type GoogleCloudVisionV1p2beta1ImageProperties struct {
  4582. // DominantColors: If present, dominant colors completed successfully.
  4583. DominantColors *GoogleCloudVisionV1p2beta1DominantColorsAnnotation `json:"dominantColors,omitempty"`
  4584. // ForceSendFields is a list of field names (e.g. "DominantColors") to
  4585. // unconditionally include in API requests. By default, fields with
  4586. // empty values are omitted from API requests. However, any non-pointer,
  4587. // non-interface field appearing in ForceSendFields will be sent to the
  4588. // server regardless of whether the field is empty or not. This may be
  4589. // used to include empty fields in Patch requests.
  4590. ForceSendFields []string `json:"-"`
  4591. // NullFields is a list of field names (e.g. "DominantColors") to
  4592. // include in API requests with the JSON null value. By default, fields
  4593. // with empty values are omitted from API requests. However, any field
  4594. // with an empty value appearing in NullFields will be sent to the
  4595. // server as null. It is an error if a field in this list has a
  4596. // non-empty value. This may be used to include null fields in Patch
  4597. // requests.
  4598. NullFields []string `json:"-"`
  4599. }
  4600. func (s *GoogleCloudVisionV1p2beta1ImageProperties) MarshalJSON() ([]byte, error) {
  4601. type NoMethod GoogleCloudVisionV1p2beta1ImageProperties
  4602. raw := NoMethod(*s)
  4603. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4604. }
  4605. // GoogleCloudVisionV1p2beta1InputConfig: The desired input location and
  4606. // metadata.
  4607. type GoogleCloudVisionV1p2beta1InputConfig struct {
  4608. // GcsSource: The Google Cloud Storage location to read the input from.
  4609. GcsSource *GoogleCloudVisionV1p2beta1GcsSource `json:"gcsSource,omitempty"`
  4610. // MimeType: The type of the file. Currently only "application/pdf" and
  4611. // "image/tiff"
  4612. // are supported. Wildcards are not supported.
  4613. MimeType string `json:"mimeType,omitempty"`
  4614. // ForceSendFields is a list of field names (e.g. "GcsSource") to
  4615. // unconditionally include in API requests. By default, fields with
  4616. // empty values are omitted from API requests. However, any non-pointer,
  4617. // non-interface field appearing in ForceSendFields will be sent to the
  4618. // server regardless of whether the field is empty or not. This may be
  4619. // used to include empty fields in Patch requests.
  4620. ForceSendFields []string `json:"-"`
  4621. // NullFields is a list of field names (e.g. "GcsSource") to include in
  4622. // API requests with the JSON null value. By default, fields with empty
  4623. // values are omitted from API requests. However, any field with an
  4624. // empty value appearing in NullFields will be sent to the server as
  4625. // null. It is an error if a field in this list has a non-empty value.
  4626. // This may be used to include null fields in Patch requests.
  4627. NullFields []string `json:"-"`
  4628. }
  4629. func (s *GoogleCloudVisionV1p2beta1InputConfig) MarshalJSON() ([]byte, error) {
  4630. type NoMethod GoogleCloudVisionV1p2beta1InputConfig
  4631. raw := NoMethod(*s)
  4632. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4633. }
  4634. // GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation: Set of detected
  4635. // objects with bounding boxes.
  4636. type GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation struct {
  4637. // BoundingPoly: Image region to which this object belongs. This must be
  4638. // populated.
  4639. BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"`
  4640. // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn".
  4641. // For more
  4642. // information,
  4643. // see
  4644. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  4645. LanguageCode string `json:"languageCode,omitempty"`
  4646. // Mid: Object ID that should align with EntityAnnotation mid.
  4647. Mid string `json:"mid,omitempty"`
  4648. // Name: Object name, expressed in its `language_code` language.
  4649. Name string `json:"name,omitempty"`
  4650. // Score: Score of the result. Range [0, 1].
  4651. Score float64 `json:"score,omitempty"`
  4652. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  4653. // unconditionally include in API requests. By default, fields with
  4654. // empty values are omitted from API requests. However, any non-pointer,
  4655. // non-interface field appearing in ForceSendFields will be sent to the
  4656. // server regardless of whether the field is empty or not. This may be
  4657. // used to include empty fields in Patch requests.
  4658. ForceSendFields []string `json:"-"`
  4659. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  4660. // in API requests with the JSON null value. By default, fields with
  4661. // empty values are omitted from API requests. However, any field with
  4662. // an empty value appearing in NullFields will be sent to the server as
  4663. // null. It is an error if a field in this list has a non-empty value.
  4664. // This may be used to include null fields in Patch requests.
  4665. NullFields []string `json:"-"`
  4666. }
  4667. func (s *GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation) MarshalJSON() ([]byte, error) {
  4668. type NoMethod GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation
  4669. raw := NoMethod(*s)
  4670. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4671. }
  4672. func (s *GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation) UnmarshalJSON(data []byte) error {
  4673. type NoMethod GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation
  4674. var s1 struct {
  4675. Score gensupport.JSONFloat64 `json:"score"`
  4676. *NoMethod
  4677. }
  4678. s1.NoMethod = (*NoMethod)(s)
  4679. if err := json.Unmarshal(data, &s1); err != nil {
  4680. return err
  4681. }
  4682. s.Score = float64(s1.Score)
  4683. return nil
  4684. }
  4685. // GoogleCloudVisionV1p2beta1LocationInfo: Detected entity location
  4686. // information.
  4687. type GoogleCloudVisionV1p2beta1LocationInfo struct {
  4688. // LatLng: lat/long location coordinates.
  4689. LatLng *LatLng `json:"latLng,omitempty"`
  4690. // ForceSendFields is a list of field names (e.g. "LatLng") to
  4691. // unconditionally include in API requests. By default, fields with
  4692. // empty values are omitted from API requests. However, any non-pointer,
  4693. // non-interface field appearing in ForceSendFields will be sent to the
  4694. // server regardless of whether the field is empty or not. This may be
  4695. // used to include empty fields in Patch requests.
  4696. ForceSendFields []string `json:"-"`
  4697. // NullFields is a list of field names (e.g. "LatLng") to include in API
  4698. // requests with the JSON null value. By default, fields with empty
  4699. // values are omitted from API requests. However, any field with an
  4700. // empty value appearing in NullFields will be sent to the server as
  4701. // null. It is an error if a field in this list has a non-empty value.
  4702. // This may be used to include null fields in Patch requests.
  4703. NullFields []string `json:"-"`
  4704. }
  4705. func (s *GoogleCloudVisionV1p2beta1LocationInfo) MarshalJSON() ([]byte, error) {
  4706. type NoMethod GoogleCloudVisionV1p2beta1LocationInfo
  4707. raw := NoMethod(*s)
  4708. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4709. }
  4710. // GoogleCloudVisionV1p2beta1NormalizedVertex: A vertex represents a 2D
  4711. // point in the image.
  4712. // NOTE: the normalized vertex coordinates are relative to the original
  4713. // image
  4714. // and range from 0 to 1.
  4715. type GoogleCloudVisionV1p2beta1NormalizedVertex struct {
  4716. // X: X coordinate.
  4717. X float64 `json:"x,omitempty"`
  4718. // Y: Y coordinate.
  4719. Y float64 `json:"y,omitempty"`
  4720. // ForceSendFields is a list of field names (e.g. "X") to
  4721. // unconditionally include in API requests. By default, fields with
  4722. // empty values are omitted from API requests. However, any non-pointer,
  4723. // non-interface field appearing in ForceSendFields will be sent to the
  4724. // server regardless of whether the field is empty or not. This may be
  4725. // used to include empty fields in Patch requests.
  4726. ForceSendFields []string `json:"-"`
  4727. // NullFields is a list of field names (e.g. "X") to include in API
  4728. // requests with the JSON null value. By default, fields with empty
  4729. // values are omitted from API requests. However, any field with an
  4730. // empty value appearing in NullFields will be sent to the server as
  4731. // null. It is an error if a field in this list has a non-empty value.
  4732. // This may be used to include null fields in Patch requests.
  4733. NullFields []string `json:"-"`
  4734. }
  4735. func (s *GoogleCloudVisionV1p2beta1NormalizedVertex) MarshalJSON() ([]byte, error) {
  4736. type NoMethod GoogleCloudVisionV1p2beta1NormalizedVertex
  4737. raw := NoMethod(*s)
  4738. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4739. }
  4740. func (s *GoogleCloudVisionV1p2beta1NormalizedVertex) UnmarshalJSON(data []byte) error {
  4741. type NoMethod GoogleCloudVisionV1p2beta1NormalizedVertex
  4742. var s1 struct {
  4743. X gensupport.JSONFloat64 `json:"x"`
  4744. Y gensupport.JSONFloat64 `json:"y"`
  4745. *NoMethod
  4746. }
  4747. s1.NoMethod = (*NoMethod)(s)
  4748. if err := json.Unmarshal(data, &s1); err != nil {
  4749. return err
  4750. }
  4751. s.X = float64(s1.X)
  4752. s.Y = float64(s1.Y)
  4753. return nil
  4754. }
  4755. // GoogleCloudVisionV1p2beta1OperationMetadata: Contains metadata for
  4756. // the BatchAnnotateImages operation.
  4757. type GoogleCloudVisionV1p2beta1OperationMetadata struct {
  4758. // CreateTime: The time when the batch request was received.
  4759. CreateTime string `json:"createTime,omitempty"`
  4760. // State: Current state of the batch operation.
  4761. //
  4762. // Possible values:
  4763. // "STATE_UNSPECIFIED" - Invalid.
  4764. // "CREATED" - Request is received.
  4765. // "RUNNING" - Request is actively being processed.
  4766. // "DONE" - The batch processing is done.
  4767. // "CANCELLED" - The batch processing was cancelled.
  4768. State string `json:"state,omitempty"`
  4769. // UpdateTime: The time when the operation result was last updated.
  4770. UpdateTime string `json:"updateTime,omitempty"`
  4771. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  4772. // unconditionally include in API requests. By default, fields with
  4773. // empty values are omitted from API requests. However, any non-pointer,
  4774. // non-interface field appearing in ForceSendFields will be sent to the
  4775. // server regardless of whether the field is empty or not. This may be
  4776. // used to include empty fields in Patch requests.
  4777. ForceSendFields []string `json:"-"`
  4778. // NullFields is a list of field names (e.g. "CreateTime") to include in
  4779. // API requests with the JSON null value. By default, fields with empty
  4780. // values are omitted from API requests. However, any field with an
  4781. // empty value appearing in NullFields will be sent to the server as
  4782. // null. It is an error if a field in this list has a non-empty value.
  4783. // This may be used to include null fields in Patch requests.
  4784. NullFields []string `json:"-"`
  4785. }
  4786. func (s *GoogleCloudVisionV1p2beta1OperationMetadata) MarshalJSON() ([]byte, error) {
  4787. type NoMethod GoogleCloudVisionV1p2beta1OperationMetadata
  4788. raw := NoMethod(*s)
  4789. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4790. }
  4791. // GoogleCloudVisionV1p2beta1OutputConfig: The desired output location
  4792. // and metadata.
  4793. type GoogleCloudVisionV1p2beta1OutputConfig struct {
  4794. // BatchSize: The max number of response protos to put into each output
  4795. // JSON file on
  4796. // Google Cloud Storage.
  4797. // The valid range is [1, 100]. If not specified, the default value is
  4798. // 20.
  4799. //
  4800. // For example, for one pdf file with 100 pages, 100 response protos
  4801. // will
  4802. // be generated. If `batch_size` = 20, then 5 json files each
  4803. // containing 20 response protos will be written under the
  4804. // prefix
  4805. // `gcs_destination`.`uri`.
  4806. //
  4807. // Currently, batch_size only applies to GcsDestination, with potential
  4808. // future
  4809. // support for other output configurations.
  4810. BatchSize int64 `json:"batchSize,omitempty"`
  4811. // GcsDestination: The Google Cloud Storage location to write the
  4812. // output(s) to.
  4813. GcsDestination *GoogleCloudVisionV1p2beta1GcsDestination `json:"gcsDestination,omitempty"`
  4814. // ForceSendFields is a list of field names (e.g. "BatchSize") to
  4815. // unconditionally include in API requests. By default, fields with
  4816. // empty values are omitted from API requests. However, any non-pointer,
  4817. // non-interface field appearing in ForceSendFields will be sent to the
  4818. // server regardless of whether the field is empty or not. This may be
  4819. // used to include empty fields in Patch requests.
  4820. ForceSendFields []string `json:"-"`
  4821. // NullFields is a list of field names (e.g. "BatchSize") to include in
  4822. // API requests with the JSON null value. By default, fields with empty
  4823. // values are omitted from API requests. However, any field with an
  4824. // empty value appearing in NullFields will be sent to the server as
  4825. // null. It is an error if a field in this list has a non-empty value.
  4826. // This may be used to include null fields in Patch requests.
  4827. NullFields []string `json:"-"`
  4828. }
  4829. func (s *GoogleCloudVisionV1p2beta1OutputConfig) MarshalJSON() ([]byte, error) {
  4830. type NoMethod GoogleCloudVisionV1p2beta1OutputConfig
  4831. raw := NoMethod(*s)
  4832. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4833. }
  4834. // GoogleCloudVisionV1p2beta1Page: Detected page from OCR.
  4835. type GoogleCloudVisionV1p2beta1Page struct {
  4836. // Blocks: List of blocks of text, images etc on this page.
  4837. Blocks []*GoogleCloudVisionV1p2beta1Block `json:"blocks,omitempty"`
  4838. // Confidence: Confidence of the OCR results on the page. Range [0, 1].
  4839. Confidence float64 `json:"confidence,omitempty"`
  4840. // Height: Page height. For PDFs the unit is points. For images
  4841. // (including
  4842. // TIFFs) the unit is pixels.
  4843. Height int64 `json:"height,omitempty"`
  4844. // Property: Additional information detected on the page.
  4845. Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"`
  4846. // Width: Page width. For PDFs the unit is points. For images
  4847. // (including
  4848. // TIFFs) the unit is pixels.
  4849. Width int64 `json:"width,omitempty"`
  4850. // ForceSendFields is a list of field names (e.g. "Blocks") to
  4851. // unconditionally include in API requests. By default, fields with
  4852. // empty values are omitted from API requests. However, any non-pointer,
  4853. // non-interface field appearing in ForceSendFields will be sent to the
  4854. // server regardless of whether the field is empty or not. This may be
  4855. // used to include empty fields in Patch requests.
  4856. ForceSendFields []string `json:"-"`
  4857. // NullFields is a list of field names (e.g. "Blocks") to include in API
  4858. // requests with the JSON null value. By default, fields with empty
  4859. // values are omitted from API requests. However, any field with an
  4860. // empty value appearing in NullFields will be sent to the server as
  4861. // null. It is an error if a field in this list has a non-empty value.
  4862. // This may be used to include null fields in Patch requests.
  4863. NullFields []string `json:"-"`
  4864. }
  4865. func (s *GoogleCloudVisionV1p2beta1Page) MarshalJSON() ([]byte, error) {
  4866. type NoMethod GoogleCloudVisionV1p2beta1Page
  4867. raw := NoMethod(*s)
  4868. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4869. }
  4870. func (s *GoogleCloudVisionV1p2beta1Page) UnmarshalJSON(data []byte) error {
  4871. type NoMethod GoogleCloudVisionV1p2beta1Page
  4872. var s1 struct {
  4873. Confidence gensupport.JSONFloat64 `json:"confidence"`
  4874. *NoMethod
  4875. }
  4876. s1.NoMethod = (*NoMethod)(s)
  4877. if err := json.Unmarshal(data, &s1); err != nil {
  4878. return err
  4879. }
  4880. s.Confidence = float64(s1.Confidence)
  4881. return nil
  4882. }
  4883. // GoogleCloudVisionV1p2beta1Paragraph: Structural unit of text
  4884. // representing a number of words in certain order.
  4885. type GoogleCloudVisionV1p2beta1Paragraph struct {
  4886. // BoundingBox: The bounding box for the paragraph.
  4887. // The vertices are in the order of top-left, top-right,
  4888. // bottom-right,
  4889. // bottom-left. When a rotation of the bounding box is detected the
  4890. // rotation
  4891. // is represented as around the top-left corner as defined when the text
  4892. // is
  4893. // read in the 'natural' orientation.
  4894. // For example:
  4895. // * when the text is horizontal it might look like:
  4896. // 0----1
  4897. // | |
  4898. // 3----2
  4899. // * when it's rotated 180 degrees around the top-left corner it
  4900. // becomes:
  4901. // 2----3
  4902. // | |
  4903. // 1----0
  4904. // and the vertex order will still be (0, 1, 2, 3).
  4905. BoundingBox *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingBox,omitempty"`
  4906. // Confidence: Confidence of the OCR results for the paragraph. Range
  4907. // [0, 1].
  4908. Confidence float64 `json:"confidence,omitempty"`
  4909. // Property: Additional information detected for the paragraph.
  4910. Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"`
  4911. // Words: List of words in this paragraph.
  4912. Words []*GoogleCloudVisionV1p2beta1Word `json:"words,omitempty"`
  4913. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  4914. // unconditionally include in API requests. By default, fields with
  4915. // empty values are omitted from API requests. However, any non-pointer,
  4916. // non-interface field appearing in ForceSendFields will be sent to the
  4917. // server regardless of whether the field is empty or not. This may be
  4918. // used to include empty fields in Patch requests.
  4919. ForceSendFields []string `json:"-"`
  4920. // NullFields is a list of field names (e.g. "BoundingBox") to include
  4921. // in API requests with the JSON null value. By default, fields with
  4922. // empty values are omitted from API requests. However, any field with
  4923. // an empty value appearing in NullFields will be sent to the server as
  4924. // null. It is an error if a field in this list has a non-empty value.
  4925. // This may be used to include null fields in Patch requests.
  4926. NullFields []string `json:"-"`
  4927. }
  4928. func (s *GoogleCloudVisionV1p2beta1Paragraph) MarshalJSON() ([]byte, error) {
  4929. type NoMethod GoogleCloudVisionV1p2beta1Paragraph
  4930. raw := NoMethod(*s)
  4931. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4932. }
  4933. func (s *GoogleCloudVisionV1p2beta1Paragraph) UnmarshalJSON(data []byte) error {
  4934. type NoMethod GoogleCloudVisionV1p2beta1Paragraph
  4935. var s1 struct {
  4936. Confidence gensupport.JSONFloat64 `json:"confidence"`
  4937. *NoMethod
  4938. }
  4939. s1.NoMethod = (*NoMethod)(s)
  4940. if err := json.Unmarshal(data, &s1); err != nil {
  4941. return err
  4942. }
  4943. s.Confidence = float64(s1.Confidence)
  4944. return nil
  4945. }
  4946. // GoogleCloudVisionV1p2beta1Position: A 3D position in the image, used
  4947. // primarily for Face detection landmarks.
  4948. // A valid Position must have both x and y coordinates.
  4949. // The position coordinates are in the same scale as the original image.
  4950. type GoogleCloudVisionV1p2beta1Position struct {
  4951. // X: X coordinate.
  4952. X float64 `json:"x,omitempty"`
  4953. // Y: Y coordinate.
  4954. Y float64 `json:"y,omitempty"`
  4955. // Z: Z coordinate (or depth).
  4956. Z float64 `json:"z,omitempty"`
  4957. // ForceSendFields is a list of field names (e.g. "X") to
  4958. // unconditionally include in API requests. By default, fields with
  4959. // empty values are omitted from API requests. However, any non-pointer,
  4960. // non-interface field appearing in ForceSendFields will be sent to the
  4961. // server regardless of whether the field is empty or not. This may be
  4962. // used to include empty fields in Patch requests.
  4963. ForceSendFields []string `json:"-"`
  4964. // NullFields is a list of field names (e.g. "X") to include in API
  4965. // requests with the JSON null value. By default, fields with empty
  4966. // values are omitted from API requests. However, any field with an
  4967. // empty value appearing in NullFields will be sent to the server as
  4968. // null. It is an error if a field in this list has a non-empty value.
  4969. // This may be used to include null fields in Patch requests.
  4970. NullFields []string `json:"-"`
  4971. }
  4972. func (s *GoogleCloudVisionV1p2beta1Position) MarshalJSON() ([]byte, error) {
  4973. type NoMethod GoogleCloudVisionV1p2beta1Position
  4974. raw := NoMethod(*s)
  4975. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4976. }
  4977. func (s *GoogleCloudVisionV1p2beta1Position) UnmarshalJSON(data []byte) error {
  4978. type NoMethod GoogleCloudVisionV1p2beta1Position
  4979. var s1 struct {
  4980. X gensupport.JSONFloat64 `json:"x"`
  4981. Y gensupport.JSONFloat64 `json:"y"`
  4982. Z gensupport.JSONFloat64 `json:"z"`
  4983. *NoMethod
  4984. }
  4985. s1.NoMethod = (*NoMethod)(s)
  4986. if err := json.Unmarshal(data, &s1); err != nil {
  4987. return err
  4988. }
  4989. s.X = float64(s1.X)
  4990. s.Y = float64(s1.Y)
  4991. s.Z = float64(s1.Z)
  4992. return nil
  4993. }
  4994. // GoogleCloudVisionV1p2beta1Product: A Product contains
  4995. // ReferenceImages.
  4996. type GoogleCloudVisionV1p2beta1Product struct {
  4997. // Description: User-provided metadata to be stored with this product.
  4998. // Must be at most 4096
  4999. // characters long.
  5000. Description string `json:"description,omitempty"`
  5001. // DisplayName: The user-provided name for this Product. Must not be
  5002. // empty. Must be at most
  5003. // 4096 characters long.
  5004. DisplayName string `json:"displayName,omitempty"`
  5005. // Name: The resource name of the product.
  5006. //
  5007. // Format
  5008. // is:
  5009. // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
  5010. //
  5011. // This field is ignored when creating a product.
  5012. Name string `json:"name,omitempty"`
  5013. // ProductCategory: The category for the product identified by the
  5014. // reference image. This should
  5015. // be either "homegoods", "apparel", or "toys".
  5016. //
  5017. // This field is immutable.
  5018. ProductCategory string `json:"productCategory,omitempty"`
  5019. // ProductLabels: Key-value pairs that can be attached to a product. At
  5020. // query time,
  5021. // constraints can be specified based on the product_labels.
  5022. //
  5023. // Note that integer values can be provided as strings, e.g. "1199".
  5024. // Only
  5025. // strings with integer values can match a range-based restriction which
  5026. // is
  5027. // to be supported soon.
  5028. //
  5029. // Multiple values can be assigned to the same key. One product may have
  5030. // up to
  5031. // 100 product_labels.
  5032. ProductLabels []*GoogleCloudVisionV1p2beta1ProductKeyValue `json:"productLabels,omitempty"`
  5033. // ForceSendFields is a list of field names (e.g. "Description") to
  5034. // unconditionally include in API requests. By default, fields with
  5035. // empty values are omitted from API requests. However, any non-pointer,
  5036. // non-interface field appearing in ForceSendFields will be sent to the
  5037. // server regardless of whether the field is empty or not. This may be
  5038. // used to include empty fields in Patch requests.
  5039. ForceSendFields []string `json:"-"`
  5040. // NullFields is a list of field names (e.g. "Description") to include
  5041. // in API requests with the JSON null value. By default, fields with
  5042. // empty values are omitted from API requests. However, any field with
  5043. // an empty value appearing in NullFields will be sent to the server as
  5044. // null. It is an error if a field in this list has a non-empty value.
  5045. // This may be used to include null fields in Patch requests.
  5046. NullFields []string `json:"-"`
  5047. }
  5048. func (s *GoogleCloudVisionV1p2beta1Product) MarshalJSON() ([]byte, error) {
  5049. type NoMethod GoogleCloudVisionV1p2beta1Product
  5050. raw := NoMethod(*s)
  5051. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5052. }
  5053. // GoogleCloudVisionV1p2beta1ProductKeyValue: A product label
  5054. // represented as a key-value pair.
  5055. type GoogleCloudVisionV1p2beta1ProductKeyValue struct {
  5056. // Key: The key of the label attached to the product. Cannot be empty
  5057. // and cannot
  5058. // exceed 128 bytes.
  5059. Key string `json:"key,omitempty"`
  5060. // Value: The value of the label attached to the product. Cannot be
  5061. // empty and
  5062. // cannot exceed 128 bytes.
  5063. Value string `json:"value,omitempty"`
  5064. // ForceSendFields is a list of field names (e.g. "Key") to
  5065. // unconditionally include in API requests. By default, fields with
  5066. // empty values are omitted from API requests. However, any non-pointer,
  5067. // non-interface field appearing in ForceSendFields will be sent to the
  5068. // server regardless of whether the field is empty or not. This may be
  5069. // used to include empty fields in Patch requests.
  5070. ForceSendFields []string `json:"-"`
  5071. // NullFields is a list of field names (e.g. "Key") to include in API
  5072. // requests with the JSON null value. By default, fields with empty
  5073. // values are omitted from API requests. However, any field with an
  5074. // empty value appearing in NullFields will be sent to the server as
  5075. // null. It is an error if a field in this list has a non-empty value.
  5076. // This may be used to include null fields in Patch requests.
  5077. NullFields []string `json:"-"`
  5078. }
  5079. func (s *GoogleCloudVisionV1p2beta1ProductKeyValue) MarshalJSON() ([]byte, error) {
  5080. type NoMethod GoogleCloudVisionV1p2beta1ProductKeyValue
  5081. raw := NoMethod(*s)
  5082. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5083. }
  5084. // GoogleCloudVisionV1p2beta1ProductSearchResults: Results for a product
  5085. // search request.
  5086. type GoogleCloudVisionV1p2beta1ProductSearchResults struct {
  5087. // IndexTime: Timestamp of the index which provided these results.
  5088. // Changes made after
  5089. // this time are not reflected in the current results.
  5090. IndexTime string `json:"indexTime,omitempty"`
  5091. // ProductGroupedResults: List of results grouped by products detected
  5092. // in the query image. Each entry
  5093. // corresponds to one bounding polygon in the query image, and contains
  5094. // the
  5095. // matching products specific to that region. There may be duplicate
  5096. // product
  5097. // matches in the union of all the per-product results.
  5098. ProductGroupedResults []*GoogleCloudVisionV1p2beta1ProductSearchResultsGroupedResult `json:"productGroupedResults,omitempty"`
  5099. // Results: List of results, one for each product match.
  5100. Results []*GoogleCloudVisionV1p2beta1ProductSearchResultsResult `json:"results,omitempty"`
  5101. // ForceSendFields is a list of field names (e.g. "IndexTime") to
  5102. // unconditionally include in API requests. By default, fields with
  5103. // empty values are omitted from API requests. However, any non-pointer,
  5104. // non-interface field appearing in ForceSendFields will be sent to the
  5105. // server regardless of whether the field is empty or not. This may be
  5106. // used to include empty fields in Patch requests.
  5107. ForceSendFields []string `json:"-"`
  5108. // NullFields is a list of field names (e.g. "IndexTime") to include in
  5109. // API requests with the JSON null value. By default, fields with empty
  5110. // values are omitted from API requests. However, any field with an
  5111. // empty value appearing in NullFields will be sent to the server as
  5112. // null. It is an error if a field in this list has a non-empty value.
  5113. // This may be used to include null fields in Patch requests.
  5114. NullFields []string `json:"-"`
  5115. }
  5116. func (s *GoogleCloudVisionV1p2beta1ProductSearchResults) MarshalJSON() ([]byte, error) {
  5117. type NoMethod GoogleCloudVisionV1p2beta1ProductSearchResults
  5118. raw := NoMethod(*s)
  5119. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5120. }
  5121. // GoogleCloudVisionV1p2beta1ProductSearchResultsGroupedResult:
  5122. // Information about the products similar to a single product in a
  5123. // query
  5124. // image.
  5125. type GoogleCloudVisionV1p2beta1ProductSearchResultsGroupedResult struct {
  5126. // BoundingPoly: The bounding polygon around the product detected in the
  5127. // query image.
  5128. BoundingPoly *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingPoly,omitempty"`
  5129. // Results: List of results, one for each product match.
  5130. Results []*GoogleCloudVisionV1p2beta1ProductSearchResultsResult `json:"results,omitempty"`
  5131. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  5132. // unconditionally include in API requests. By default, fields with
  5133. // empty values are omitted from API requests. However, any non-pointer,
  5134. // non-interface field appearing in ForceSendFields will be sent to the
  5135. // server regardless of whether the field is empty or not. This may be
  5136. // used to include empty fields in Patch requests.
  5137. ForceSendFields []string `json:"-"`
  5138. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  5139. // in API requests with the JSON null value. By default, fields with
  5140. // empty values are omitted from API requests. However, any field with
  5141. // an empty value appearing in NullFields will be sent to the server as
  5142. // null. It is an error if a field in this list has a non-empty value.
  5143. // This may be used to include null fields in Patch requests.
  5144. NullFields []string `json:"-"`
  5145. }
  5146. func (s *GoogleCloudVisionV1p2beta1ProductSearchResultsGroupedResult) MarshalJSON() ([]byte, error) {
  5147. type NoMethod GoogleCloudVisionV1p2beta1ProductSearchResultsGroupedResult
  5148. raw := NoMethod(*s)
  5149. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5150. }
  5151. // GoogleCloudVisionV1p2beta1ProductSearchResultsResult: Information
  5152. // about a product.
  5153. type GoogleCloudVisionV1p2beta1ProductSearchResultsResult struct {
  5154. // Image: The resource name of the image from the product that is the
  5155. // closest match
  5156. // to the query.
  5157. Image string `json:"image,omitempty"`
  5158. // Product: The Product.
  5159. Product *GoogleCloudVisionV1p2beta1Product `json:"product,omitempty"`
  5160. // Score: A confidence level on the match, ranging from 0 (no
  5161. // confidence) to
  5162. // 1 (full confidence).
  5163. Score float64 `json:"score,omitempty"`
  5164. // ForceSendFields is a list of field names (e.g. "Image") to
  5165. // unconditionally include in API requests. By default, fields with
  5166. // empty values are omitted from API requests. However, any non-pointer,
  5167. // non-interface field appearing in ForceSendFields will be sent to the
  5168. // server regardless of whether the field is empty or not. This may be
  5169. // used to include empty fields in Patch requests.
  5170. ForceSendFields []string `json:"-"`
  5171. // NullFields is a list of field names (e.g. "Image") to include in API
  5172. // requests with the JSON null value. By default, fields with empty
  5173. // values are omitted from API requests. However, any field with an
  5174. // empty value appearing in NullFields will be sent to the server as
  5175. // null. It is an error if a field in this list has a non-empty value.
  5176. // This may be used to include null fields in Patch requests.
  5177. NullFields []string `json:"-"`
  5178. }
  5179. func (s *GoogleCloudVisionV1p2beta1ProductSearchResultsResult) MarshalJSON() ([]byte, error) {
  5180. type NoMethod GoogleCloudVisionV1p2beta1ProductSearchResultsResult
  5181. raw := NoMethod(*s)
  5182. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5183. }
  5184. func (s *GoogleCloudVisionV1p2beta1ProductSearchResultsResult) UnmarshalJSON(data []byte) error {
  5185. type NoMethod GoogleCloudVisionV1p2beta1ProductSearchResultsResult
  5186. var s1 struct {
  5187. Score gensupport.JSONFloat64 `json:"score"`
  5188. *NoMethod
  5189. }
  5190. s1.NoMethod = (*NoMethod)(s)
  5191. if err := json.Unmarshal(data, &s1); err != nil {
  5192. return err
  5193. }
  5194. s.Score = float64(s1.Score)
  5195. return nil
  5196. }
  5197. // GoogleCloudVisionV1p2beta1Property: A `Property` consists of a
  5198. // user-supplied name/value pair.
  5199. type GoogleCloudVisionV1p2beta1Property struct {
  5200. // Name: Name of the property.
  5201. Name string `json:"name,omitempty"`
  5202. // Uint64Value: Value of numeric properties.
  5203. Uint64Value uint64 `json:"uint64Value,omitempty,string"`
  5204. // Value: Value of the property.
  5205. Value string `json:"value,omitempty"`
  5206. // ForceSendFields is a list of field names (e.g. "Name") to
  5207. // unconditionally include in API requests. By default, fields with
  5208. // empty values are omitted from API requests. However, any non-pointer,
  5209. // non-interface field appearing in ForceSendFields will be sent to the
  5210. // server regardless of whether the field is empty or not. This may be
  5211. // used to include empty fields in Patch requests.
  5212. ForceSendFields []string `json:"-"`
  5213. // NullFields is a list of field names (e.g. "Name") to include in API
  5214. // requests with the JSON null value. By default, fields with empty
  5215. // values are omitted from API requests. However, any field with an
  5216. // empty value appearing in NullFields will be sent to the server as
  5217. // null. It is an error if a field in this list has a non-empty value.
  5218. // This may be used to include null fields in Patch requests.
  5219. NullFields []string `json:"-"`
  5220. }
  5221. func (s *GoogleCloudVisionV1p2beta1Property) MarshalJSON() ([]byte, error) {
  5222. type NoMethod GoogleCloudVisionV1p2beta1Property
  5223. raw := NoMethod(*s)
  5224. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5225. }
  5226. // GoogleCloudVisionV1p2beta1SafeSearchAnnotation: Set of features
  5227. // pertaining to the image, computed by computer vision
  5228. // methods over safe-search verticals (for example, adult, spoof,
  5229. // medical,
  5230. // violence).
  5231. type GoogleCloudVisionV1p2beta1SafeSearchAnnotation struct {
  5232. // Adult: Represents the adult content likelihood for the image. Adult
  5233. // content may
  5234. // contain elements such as nudity, pornographic images or cartoons,
  5235. // or
  5236. // sexual activities.
  5237. //
  5238. // Possible values:
  5239. // "UNKNOWN" - Unknown likelihood.
  5240. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  5241. // specified vertical.
  5242. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  5243. // vertical.
  5244. // "POSSIBLE" - It is possible that the image belongs to the specified
  5245. // vertical.
  5246. // "LIKELY" - It is likely that the image belongs to the specified
  5247. // vertical.
  5248. // "VERY_LIKELY" - It is very likely that the image belongs to the
  5249. // specified vertical.
  5250. Adult string `json:"adult,omitempty"`
  5251. // Medical: Likelihood that this is a medical image.
  5252. //
  5253. // Possible values:
  5254. // "UNKNOWN" - Unknown likelihood.
  5255. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  5256. // specified vertical.
  5257. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  5258. // vertical.
  5259. // "POSSIBLE" - It is possible that the image belongs to the specified
  5260. // vertical.
  5261. // "LIKELY" - It is likely that the image belongs to the specified
  5262. // vertical.
  5263. // "VERY_LIKELY" - It is very likely that the image belongs to the
  5264. // specified vertical.
  5265. Medical string `json:"medical,omitempty"`
  5266. // Racy: Likelihood that the request image contains racy content. Racy
  5267. // content may
  5268. // include (but is not limited to) skimpy or sheer clothing,
  5269. // strategically
  5270. // covered nudity, lewd or provocative poses, or close-ups of
  5271. // sensitive
  5272. // body areas.
  5273. //
  5274. // Possible values:
  5275. // "UNKNOWN" - Unknown likelihood.
  5276. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  5277. // specified vertical.
  5278. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  5279. // vertical.
  5280. // "POSSIBLE" - It is possible that the image belongs to the specified
  5281. // vertical.
  5282. // "LIKELY" - It is likely that the image belongs to the specified
  5283. // vertical.
  5284. // "VERY_LIKELY" - It is very likely that the image belongs to the
  5285. // specified vertical.
  5286. Racy string `json:"racy,omitempty"`
  5287. // Spoof: Spoof likelihood. The likelihood that an modification
  5288. // was made to the image's canonical version to make it appear
  5289. // funny or offensive.
  5290. //
  5291. // Possible values:
  5292. // "UNKNOWN" - Unknown likelihood.
  5293. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  5294. // specified vertical.
  5295. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  5296. // vertical.
  5297. // "POSSIBLE" - It is possible that the image belongs to the specified
  5298. // vertical.
  5299. // "LIKELY" - It is likely that the image belongs to the specified
  5300. // vertical.
  5301. // "VERY_LIKELY" - It is very likely that the image belongs to the
  5302. // specified vertical.
  5303. Spoof string `json:"spoof,omitempty"`
  5304. // Violence: Likelihood that this image contains violent content.
  5305. //
  5306. // Possible values:
  5307. // "UNKNOWN" - Unknown likelihood.
  5308. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  5309. // specified vertical.
  5310. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  5311. // vertical.
  5312. // "POSSIBLE" - It is possible that the image belongs to the specified
  5313. // vertical.
  5314. // "LIKELY" - It is likely that the image belongs to the specified
  5315. // vertical.
  5316. // "VERY_LIKELY" - It is very likely that the image belongs to the
  5317. // specified vertical.
  5318. Violence string `json:"violence,omitempty"`
  5319. // ForceSendFields is a list of field names (e.g. "Adult") to
  5320. // unconditionally include in API requests. By default, fields with
  5321. // empty values are omitted from API requests. However, any non-pointer,
  5322. // non-interface field appearing in ForceSendFields will be sent to the
  5323. // server regardless of whether the field is empty or not. This may be
  5324. // used to include empty fields in Patch requests.
  5325. ForceSendFields []string `json:"-"`
  5326. // NullFields is a list of field names (e.g. "Adult") to include in API
  5327. // requests with the JSON null value. By default, fields with empty
  5328. // values are omitted from API requests. However, any field with an
  5329. // empty value appearing in NullFields will be sent to the server as
  5330. // null. It is an error if a field in this list has a non-empty value.
  5331. // This may be used to include null fields in Patch requests.
  5332. NullFields []string `json:"-"`
  5333. }
  5334. func (s *GoogleCloudVisionV1p2beta1SafeSearchAnnotation) MarshalJSON() ([]byte, error) {
  5335. type NoMethod GoogleCloudVisionV1p2beta1SafeSearchAnnotation
  5336. raw := NoMethod(*s)
  5337. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5338. }
  5339. // GoogleCloudVisionV1p2beta1Symbol: A single symbol representation.
  5340. type GoogleCloudVisionV1p2beta1Symbol struct {
  5341. // BoundingBox: The bounding box for the symbol.
  5342. // The vertices are in the order of top-left, top-right,
  5343. // bottom-right,
  5344. // bottom-left. When a rotation of the bounding box is detected the
  5345. // rotation
  5346. // is represented as around the top-left corner as defined when the text
  5347. // is
  5348. // read in the 'natural' orientation.
  5349. // For example:
  5350. // * when the text is horizontal it might look like:
  5351. // 0----1
  5352. // | |
  5353. // 3----2
  5354. // * when it's rotated 180 degrees around the top-left corner it
  5355. // becomes:
  5356. // 2----3
  5357. // | |
  5358. // 1----0
  5359. // and the vertice order will still be (0, 1, 2, 3).
  5360. BoundingBox *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingBox,omitempty"`
  5361. // Confidence: Confidence of the OCR results for the symbol. Range [0,
  5362. // 1].
  5363. Confidence float64 `json:"confidence,omitempty"`
  5364. // Property: Additional information detected for the symbol.
  5365. Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"`
  5366. // Text: The actual UTF-8 representation of the symbol.
  5367. Text string `json:"text,omitempty"`
  5368. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  5369. // unconditionally include in API requests. By default, fields with
  5370. // empty values are omitted from API requests. However, any non-pointer,
  5371. // non-interface field appearing in ForceSendFields will be sent to the
  5372. // server regardless of whether the field is empty or not. This may be
  5373. // used to include empty fields in Patch requests.
  5374. ForceSendFields []string `json:"-"`
  5375. // NullFields is a list of field names (e.g. "BoundingBox") to include
  5376. // in API requests with the JSON null value. By default, fields with
  5377. // empty values are omitted from API requests. However, any field with
  5378. // an empty value appearing in NullFields will be sent to the server as
  5379. // null. It is an error if a field in this list has a non-empty value.
  5380. // This may be used to include null fields in Patch requests.
  5381. NullFields []string `json:"-"`
  5382. }
  5383. func (s *GoogleCloudVisionV1p2beta1Symbol) MarshalJSON() ([]byte, error) {
  5384. type NoMethod GoogleCloudVisionV1p2beta1Symbol
  5385. raw := NoMethod(*s)
  5386. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5387. }
  5388. func (s *GoogleCloudVisionV1p2beta1Symbol) UnmarshalJSON(data []byte) error {
  5389. type NoMethod GoogleCloudVisionV1p2beta1Symbol
  5390. var s1 struct {
  5391. Confidence gensupport.JSONFloat64 `json:"confidence"`
  5392. *NoMethod
  5393. }
  5394. s1.NoMethod = (*NoMethod)(s)
  5395. if err := json.Unmarshal(data, &s1); err != nil {
  5396. return err
  5397. }
  5398. s.Confidence = float64(s1.Confidence)
  5399. return nil
  5400. }
  5401. // GoogleCloudVisionV1p2beta1TextAnnotation: TextAnnotation contains a
  5402. // structured representation of OCR extracted text.
  5403. // The hierarchy of an OCR extracted text structure is like this:
  5404. // TextAnnotation -> Page -> Block -> Paragraph -> Word ->
  5405. // Symbol
  5406. // Each structural component, starting from Page, may further have their
  5407. // own
  5408. // properties. Properties describe detected languages, breaks etc..
  5409. // Please refer
  5410. // to the TextAnnotation.TextProperty message definition below for
  5411. // more
  5412. // detail.
  5413. type GoogleCloudVisionV1p2beta1TextAnnotation struct {
  5414. // Pages: List of pages detected by OCR.
  5415. Pages []*GoogleCloudVisionV1p2beta1Page `json:"pages,omitempty"`
  5416. // Text: UTF-8 text detected on the pages.
  5417. Text string `json:"text,omitempty"`
  5418. // ForceSendFields is a list of field names (e.g. "Pages") to
  5419. // unconditionally include in API requests. By default, fields with
  5420. // empty values are omitted from API requests. However, any non-pointer,
  5421. // non-interface field appearing in ForceSendFields will be sent to the
  5422. // server regardless of whether the field is empty or not. This may be
  5423. // used to include empty fields in Patch requests.
  5424. ForceSendFields []string `json:"-"`
  5425. // NullFields is a list of field names (e.g. "Pages") to include in API
  5426. // requests with the JSON null value. By default, fields with empty
  5427. // values are omitted from API requests. However, any field with an
  5428. // empty value appearing in NullFields will be sent to the server as
  5429. // null. It is an error if a field in this list has a non-empty value.
  5430. // This may be used to include null fields in Patch requests.
  5431. NullFields []string `json:"-"`
  5432. }
  5433. func (s *GoogleCloudVisionV1p2beta1TextAnnotation) MarshalJSON() ([]byte, error) {
  5434. type NoMethod GoogleCloudVisionV1p2beta1TextAnnotation
  5435. raw := NoMethod(*s)
  5436. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5437. }
  5438. // GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak: Detected start
  5439. // or end of a structural component.
  5440. type GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak struct {
  5441. // IsPrefix: True if break prepends the element.
  5442. IsPrefix bool `json:"isPrefix,omitempty"`
  5443. // Type: Detected break type.
  5444. //
  5445. // Possible values:
  5446. // "UNKNOWN" - Unknown break label type.
  5447. // "SPACE" - Regular space.
  5448. // "SURE_SPACE" - Sure space (very wide).
  5449. // "EOL_SURE_SPACE" - Line-wrapping break.
  5450. // "HYPHEN" - End-line hyphen that is not present in text; does not
  5451. // co-occur with
  5452. // `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`.
  5453. // "LINE_BREAK" - Line break that ends a paragraph.
  5454. Type string `json:"type,omitempty"`
  5455. // ForceSendFields is a list of field names (e.g. "IsPrefix") to
  5456. // unconditionally include in API requests. By default, fields with
  5457. // empty values are omitted from API requests. However, any non-pointer,
  5458. // non-interface field appearing in ForceSendFields will be sent to the
  5459. // server regardless of whether the field is empty or not. This may be
  5460. // used to include empty fields in Patch requests.
  5461. ForceSendFields []string `json:"-"`
  5462. // NullFields is a list of field names (e.g. "IsPrefix") to include in
  5463. // API requests with the JSON null value. By default, fields with empty
  5464. // values are omitted from API requests. However, any field with an
  5465. // empty value appearing in NullFields will be sent to the server as
  5466. // null. It is an error if a field in this list has a non-empty value.
  5467. // This may be used to include null fields in Patch requests.
  5468. NullFields []string `json:"-"`
  5469. }
  5470. func (s *GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak) MarshalJSON() ([]byte, error) {
  5471. type NoMethod GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak
  5472. raw := NoMethod(*s)
  5473. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5474. }
  5475. // GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage: Detected
  5476. // language for a structural component.
  5477. type GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage struct {
  5478. // Confidence: Confidence of detected language. Range [0, 1].
  5479. Confidence float64 `json:"confidence,omitempty"`
  5480. // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn".
  5481. // For more
  5482. // information,
  5483. // see
  5484. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  5485. LanguageCode string `json:"languageCode,omitempty"`
  5486. // ForceSendFields is a list of field names (e.g. "Confidence") to
  5487. // unconditionally include in API requests. By default, fields with
  5488. // empty values are omitted from API requests. However, any non-pointer,
  5489. // non-interface field appearing in ForceSendFields will be sent to the
  5490. // server regardless of whether the field is empty or not. This may be
  5491. // used to include empty fields in Patch requests.
  5492. ForceSendFields []string `json:"-"`
  5493. // NullFields is a list of field names (e.g. "Confidence") to include in
  5494. // API requests with the JSON null value. By default, fields with empty
  5495. // values are omitted from API requests. However, any field with an
  5496. // empty value appearing in NullFields will be sent to the server as
  5497. // null. It is an error if a field in this list has a non-empty value.
  5498. // This may be used to include null fields in Patch requests.
  5499. NullFields []string `json:"-"`
  5500. }
  5501. func (s *GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage) MarshalJSON() ([]byte, error) {
  5502. type NoMethod GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage
  5503. raw := NoMethod(*s)
  5504. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5505. }
  5506. func (s *GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage) UnmarshalJSON(data []byte) error {
  5507. type NoMethod GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage
  5508. var s1 struct {
  5509. Confidence gensupport.JSONFloat64 `json:"confidence"`
  5510. *NoMethod
  5511. }
  5512. s1.NoMethod = (*NoMethod)(s)
  5513. if err := json.Unmarshal(data, &s1); err != nil {
  5514. return err
  5515. }
  5516. s.Confidence = float64(s1.Confidence)
  5517. return nil
  5518. }
  5519. // GoogleCloudVisionV1p2beta1TextAnnotationTextProperty: Additional
  5520. // information detected on the structural component.
  5521. type GoogleCloudVisionV1p2beta1TextAnnotationTextProperty struct {
  5522. // DetectedBreak: Detected start or end of a text segment.
  5523. DetectedBreak *GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak `json:"detectedBreak,omitempty"`
  5524. // DetectedLanguages: A list of detected languages together with
  5525. // confidence.
  5526. DetectedLanguages []*GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage `json:"detectedLanguages,omitempty"`
  5527. // ForceSendFields is a list of field names (e.g. "DetectedBreak") to
  5528. // unconditionally include in API requests. By default, fields with
  5529. // empty values are omitted from API requests. However, any non-pointer,
  5530. // non-interface field appearing in ForceSendFields will be sent to the
  5531. // server regardless of whether the field is empty or not. This may be
  5532. // used to include empty fields in Patch requests.
  5533. ForceSendFields []string `json:"-"`
  5534. // NullFields is a list of field names (e.g. "DetectedBreak") to include
  5535. // in API requests with the JSON null value. By default, fields with
  5536. // empty values are omitted from API requests. However, any field with
  5537. // an empty value appearing in NullFields will be sent to the server as
  5538. // null. It is an error if a field in this list has a non-empty value.
  5539. // This may be used to include null fields in Patch requests.
  5540. NullFields []string `json:"-"`
  5541. }
  5542. func (s *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty) MarshalJSON() ([]byte, error) {
  5543. type NoMethod GoogleCloudVisionV1p2beta1TextAnnotationTextProperty
  5544. raw := NoMethod(*s)
  5545. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5546. }
  5547. // GoogleCloudVisionV1p2beta1Vertex: A vertex represents a 2D point in
  5548. // the image.
  5549. // NOTE: the vertex coordinates are in the same scale as the original
  5550. // image.
  5551. type GoogleCloudVisionV1p2beta1Vertex struct {
  5552. // X: X coordinate.
  5553. X int64 `json:"x,omitempty"`
  5554. // Y: Y coordinate.
  5555. Y int64 `json:"y,omitempty"`
  5556. // ForceSendFields is a list of field names (e.g. "X") to
  5557. // unconditionally include in API requests. By default, fields with
  5558. // empty values are omitted from API requests. However, any non-pointer,
  5559. // non-interface field appearing in ForceSendFields will be sent to the
  5560. // server regardless of whether the field is empty or not. This may be
  5561. // used to include empty fields in Patch requests.
  5562. ForceSendFields []string `json:"-"`
  5563. // NullFields is a list of field names (e.g. "X") to include in API
  5564. // requests with the JSON null value. By default, fields with empty
  5565. // values are omitted from API requests. However, any field with an
  5566. // empty value appearing in NullFields will be sent to the server as
  5567. // null. It is an error if a field in this list has a non-empty value.
  5568. // This may be used to include null fields in Patch requests.
  5569. NullFields []string `json:"-"`
  5570. }
  5571. func (s *GoogleCloudVisionV1p2beta1Vertex) MarshalJSON() ([]byte, error) {
  5572. type NoMethod GoogleCloudVisionV1p2beta1Vertex
  5573. raw := NoMethod(*s)
  5574. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5575. }
  5576. // GoogleCloudVisionV1p2beta1WebDetection: Relevant information for the
  5577. // image from the Internet.
  5578. type GoogleCloudVisionV1p2beta1WebDetection struct {
  5579. // BestGuessLabels: The service's best guess as to the topic of the
  5580. // request image.
  5581. // Inferred from similar images on the open web.
  5582. BestGuessLabels []*GoogleCloudVisionV1p2beta1WebDetectionWebLabel `json:"bestGuessLabels,omitempty"`
  5583. // FullMatchingImages: Fully matching images from the Internet.
  5584. // Can include resized copies of the query image.
  5585. FullMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"`
  5586. // PagesWithMatchingImages: Web pages containing the matching images
  5587. // from the Internet.
  5588. PagesWithMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebPage `json:"pagesWithMatchingImages,omitempty"`
  5589. // PartialMatchingImages: Partial matching images from the
  5590. // Internet.
  5591. // Those images are similar enough to share some key-point features.
  5592. // For
  5593. // example an original image will likely have partial matching for its
  5594. // crops.
  5595. PartialMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"`
  5596. // VisuallySimilarImages: The visually similar image results.
  5597. VisuallySimilarImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"visuallySimilarImages,omitempty"`
  5598. // WebEntities: Deduced entities from similar images on the Internet.
  5599. WebEntities []*GoogleCloudVisionV1p2beta1WebDetectionWebEntity `json:"webEntities,omitempty"`
  5600. // ForceSendFields is a list of field names (e.g. "BestGuessLabels") to
  5601. // unconditionally include in API requests. By default, fields with
  5602. // empty values are omitted from API requests. However, any non-pointer,
  5603. // non-interface field appearing in ForceSendFields will be sent to the
  5604. // server regardless of whether the field is empty or not. This may be
  5605. // used to include empty fields in Patch requests.
  5606. ForceSendFields []string `json:"-"`
  5607. // NullFields is a list of field names (e.g. "BestGuessLabels") to
  5608. // include in API requests with the JSON null value. By default, fields
  5609. // with empty values are omitted from API requests. However, any field
  5610. // with an empty value appearing in NullFields will be sent to the
  5611. // server as null. It is an error if a field in this list has a
  5612. // non-empty value. This may be used to include null fields in Patch
  5613. // requests.
  5614. NullFields []string `json:"-"`
  5615. }
  5616. func (s *GoogleCloudVisionV1p2beta1WebDetection) MarshalJSON() ([]byte, error) {
  5617. type NoMethod GoogleCloudVisionV1p2beta1WebDetection
  5618. raw := NoMethod(*s)
  5619. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5620. }
  5621. // GoogleCloudVisionV1p2beta1WebDetectionWebEntity: Entity deduced from
  5622. // similar images on the Internet.
  5623. type GoogleCloudVisionV1p2beta1WebDetectionWebEntity struct {
  5624. // Description: Canonical description of the entity, in English.
  5625. Description string `json:"description,omitempty"`
  5626. // EntityId: Opaque entity ID.
  5627. EntityId string `json:"entityId,omitempty"`
  5628. // Score: Overall relevancy score for the entity.
  5629. // Not normalized and not comparable across different image queries.
  5630. Score float64 `json:"score,omitempty"`
  5631. // ForceSendFields is a list of field names (e.g. "Description") to
  5632. // unconditionally include in API requests. By default, fields with
  5633. // empty values are omitted from API requests. However, any non-pointer,
  5634. // non-interface field appearing in ForceSendFields will be sent to the
  5635. // server regardless of whether the field is empty or not. This may be
  5636. // used to include empty fields in Patch requests.
  5637. ForceSendFields []string `json:"-"`
  5638. // NullFields is a list of field names (e.g. "Description") to include
  5639. // in API requests with the JSON null value. By default, fields with
  5640. // empty values are omitted from API requests. However, any field with
  5641. // an empty value appearing in NullFields will be sent to the server as
  5642. // null. It is an error if a field in this list has a non-empty value.
  5643. // This may be used to include null fields in Patch requests.
  5644. NullFields []string `json:"-"`
  5645. }
  5646. func (s *GoogleCloudVisionV1p2beta1WebDetectionWebEntity) MarshalJSON() ([]byte, error) {
  5647. type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebEntity
  5648. raw := NoMethod(*s)
  5649. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5650. }
  5651. func (s *GoogleCloudVisionV1p2beta1WebDetectionWebEntity) UnmarshalJSON(data []byte) error {
  5652. type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebEntity
  5653. var s1 struct {
  5654. Score gensupport.JSONFloat64 `json:"score"`
  5655. *NoMethod
  5656. }
  5657. s1.NoMethod = (*NoMethod)(s)
  5658. if err := json.Unmarshal(data, &s1); err != nil {
  5659. return err
  5660. }
  5661. s.Score = float64(s1.Score)
  5662. return nil
  5663. }
  5664. // GoogleCloudVisionV1p2beta1WebDetectionWebImage: Metadata for online
  5665. // images.
  5666. type GoogleCloudVisionV1p2beta1WebDetectionWebImage struct {
  5667. // Score: (Deprecated) Overall relevancy score for the image.
  5668. Score float64 `json:"score,omitempty"`
  5669. // Url: The result image URL.
  5670. Url string `json:"url,omitempty"`
  5671. // ForceSendFields is a list of field names (e.g. "Score") to
  5672. // unconditionally include in API requests. By default, fields with
  5673. // empty values are omitted from API requests. However, any non-pointer,
  5674. // non-interface field appearing in ForceSendFields will be sent to the
  5675. // server regardless of whether the field is empty or not. This may be
  5676. // used to include empty fields in Patch requests.
  5677. ForceSendFields []string `json:"-"`
  5678. // NullFields is a list of field names (e.g. "Score") to include in API
  5679. // requests with the JSON null value. By default, fields with empty
  5680. // values are omitted from API requests. However, any field with an
  5681. // empty value appearing in NullFields will be sent to the server as
  5682. // null. It is an error if a field in this list has a non-empty value.
  5683. // This may be used to include null fields in Patch requests.
  5684. NullFields []string `json:"-"`
  5685. }
  5686. func (s *GoogleCloudVisionV1p2beta1WebDetectionWebImage) MarshalJSON() ([]byte, error) {
  5687. type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebImage
  5688. raw := NoMethod(*s)
  5689. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5690. }
  5691. func (s *GoogleCloudVisionV1p2beta1WebDetectionWebImage) UnmarshalJSON(data []byte) error {
  5692. type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebImage
  5693. var s1 struct {
  5694. Score gensupport.JSONFloat64 `json:"score"`
  5695. *NoMethod
  5696. }
  5697. s1.NoMethod = (*NoMethod)(s)
  5698. if err := json.Unmarshal(data, &s1); err != nil {
  5699. return err
  5700. }
  5701. s.Score = float64(s1.Score)
  5702. return nil
  5703. }
  5704. // GoogleCloudVisionV1p2beta1WebDetectionWebLabel: Label to provide
  5705. // extra metadata for the web detection.
  5706. type GoogleCloudVisionV1p2beta1WebDetectionWebLabel struct {
  5707. // Label: Label for extra metadata.
  5708. Label string `json:"label,omitempty"`
  5709. // LanguageCode: The BCP-47 language code for `label`, such as "en-US"
  5710. // or "sr-Latn".
  5711. // For more information,
  5712. // see
  5713. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  5714. LanguageCode string `json:"languageCode,omitempty"`
  5715. // ForceSendFields is a list of field names (e.g. "Label") to
  5716. // unconditionally include in API requests. By default, fields with
  5717. // empty values are omitted from API requests. However, any non-pointer,
  5718. // non-interface field appearing in ForceSendFields will be sent to the
  5719. // server regardless of whether the field is empty or not. This may be
  5720. // used to include empty fields in Patch requests.
  5721. ForceSendFields []string `json:"-"`
  5722. // NullFields is a list of field names (e.g. "Label") to include in API
  5723. // requests with the JSON null value. By default, fields with empty
  5724. // values are omitted from API requests. However, any field with an
  5725. // empty value appearing in NullFields will be sent to the server as
  5726. // null. It is an error if a field in this list has a non-empty value.
  5727. // This may be used to include null fields in Patch requests.
  5728. NullFields []string `json:"-"`
  5729. }
  5730. func (s *GoogleCloudVisionV1p2beta1WebDetectionWebLabel) MarshalJSON() ([]byte, error) {
  5731. type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebLabel
  5732. raw := NoMethod(*s)
  5733. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5734. }
  5735. // GoogleCloudVisionV1p2beta1WebDetectionWebPage: Metadata for web
  5736. // pages.
  5737. type GoogleCloudVisionV1p2beta1WebDetectionWebPage struct {
  5738. // FullMatchingImages: Fully matching images on the page.
  5739. // Can include resized copies of the query image.
  5740. FullMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"`
  5741. // PageTitle: Title for the web page, may contain HTML markups.
  5742. PageTitle string `json:"pageTitle,omitempty"`
  5743. // PartialMatchingImages: Partial matching images on the page.
  5744. // Those images are similar enough to share some key-point features.
  5745. // For
  5746. // example an original image will likely have partial matching for
  5747. // its
  5748. // crops.
  5749. PartialMatchingImages []*GoogleCloudVisionV1p2beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"`
  5750. // Score: (Deprecated) Overall relevancy score for the web page.
  5751. Score float64 `json:"score,omitempty"`
  5752. // Url: The result web page URL.
  5753. Url string `json:"url,omitempty"`
  5754. // ForceSendFields is a list of field names (e.g. "FullMatchingImages")
  5755. // to unconditionally include in API requests. By default, fields with
  5756. // empty values are omitted from API requests. However, any non-pointer,
  5757. // non-interface field appearing in ForceSendFields will be sent to the
  5758. // server regardless of whether the field is empty or not. This may be
  5759. // used to include empty fields in Patch requests.
  5760. ForceSendFields []string `json:"-"`
  5761. // NullFields is a list of field names (e.g. "FullMatchingImages") to
  5762. // include in API requests with the JSON null value. By default, fields
  5763. // with empty values are omitted from API requests. However, any field
  5764. // with an empty value appearing in NullFields will be sent to the
  5765. // server as null. It is an error if a field in this list has a
  5766. // non-empty value. This may be used to include null fields in Patch
  5767. // requests.
  5768. NullFields []string `json:"-"`
  5769. }
  5770. func (s *GoogleCloudVisionV1p2beta1WebDetectionWebPage) MarshalJSON() ([]byte, error) {
  5771. type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebPage
  5772. raw := NoMethod(*s)
  5773. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5774. }
  5775. func (s *GoogleCloudVisionV1p2beta1WebDetectionWebPage) UnmarshalJSON(data []byte) error {
  5776. type NoMethod GoogleCloudVisionV1p2beta1WebDetectionWebPage
  5777. var s1 struct {
  5778. Score gensupport.JSONFloat64 `json:"score"`
  5779. *NoMethod
  5780. }
  5781. s1.NoMethod = (*NoMethod)(s)
  5782. if err := json.Unmarshal(data, &s1); err != nil {
  5783. return err
  5784. }
  5785. s.Score = float64(s1.Score)
  5786. return nil
  5787. }
  5788. // GoogleCloudVisionV1p2beta1Word: A word representation.
  5789. type GoogleCloudVisionV1p2beta1Word struct {
  5790. // BoundingBox: The bounding box for the word.
  5791. // The vertices are in the order of top-left, top-right,
  5792. // bottom-right,
  5793. // bottom-left. When a rotation of the bounding box is detected the
  5794. // rotation
  5795. // is represented as around the top-left corner as defined when the text
  5796. // is
  5797. // read in the 'natural' orientation.
  5798. // For example:
  5799. // * when the text is horizontal it might look like:
  5800. // 0----1
  5801. // | |
  5802. // 3----2
  5803. // * when it's rotated 180 degrees around the top-left corner it
  5804. // becomes:
  5805. // 2----3
  5806. // | |
  5807. // 1----0
  5808. // and the vertex order will still be (0, 1, 2, 3).
  5809. BoundingBox *GoogleCloudVisionV1p2beta1BoundingPoly `json:"boundingBox,omitempty"`
  5810. // Confidence: Confidence of the OCR results for the word. Range [0, 1].
  5811. Confidence float64 `json:"confidence,omitempty"`
  5812. // Property: Additional information detected for the word.
  5813. Property *GoogleCloudVisionV1p2beta1TextAnnotationTextProperty `json:"property,omitempty"`
  5814. // Symbols: List of symbols in the word.
  5815. // The order of the symbols follows the natural reading order.
  5816. Symbols []*GoogleCloudVisionV1p2beta1Symbol `json:"symbols,omitempty"`
  5817. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  5818. // unconditionally include in API requests. By default, fields with
  5819. // empty values are omitted from API requests. However, any non-pointer,
  5820. // non-interface field appearing in ForceSendFields will be sent to the
  5821. // server regardless of whether the field is empty or not. This may be
  5822. // used to include empty fields in Patch requests.
  5823. ForceSendFields []string `json:"-"`
  5824. // NullFields is a list of field names (e.g. "BoundingBox") to include
  5825. // in API requests with the JSON null value. By default, fields with
  5826. // empty values are omitted from API requests. However, any field with
  5827. // an empty value appearing in NullFields will be sent to the server as
  5828. // null. It is an error if a field in this list has a non-empty value.
  5829. // This may be used to include null fields in Patch requests.
  5830. NullFields []string `json:"-"`
  5831. }
  5832. func (s *GoogleCloudVisionV1p2beta1Word) MarshalJSON() ([]byte, error) {
  5833. type NoMethod GoogleCloudVisionV1p2beta1Word
  5834. raw := NoMethod(*s)
  5835. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5836. }
  5837. func (s *GoogleCloudVisionV1p2beta1Word) UnmarshalJSON(data []byte) error {
  5838. type NoMethod GoogleCloudVisionV1p2beta1Word
  5839. var s1 struct {
  5840. Confidence gensupport.JSONFloat64 `json:"confidence"`
  5841. *NoMethod
  5842. }
  5843. s1.NoMethod = (*NoMethod)(s)
  5844. if err := json.Unmarshal(data, &s1); err != nil {
  5845. return err
  5846. }
  5847. s.Confidence = float64(s1.Confidence)
  5848. return nil
  5849. }
  5850. // GoogleCloudVisionV1p3beta1AnnotateFileResponse: Response to a single
  5851. // file annotation request. A file may contain one or more
  5852. // images, which individually have their own responses.
  5853. type GoogleCloudVisionV1p3beta1AnnotateFileResponse struct {
  5854. // InputConfig: Information about the file for which this response is
  5855. // generated.
  5856. InputConfig *GoogleCloudVisionV1p3beta1InputConfig `json:"inputConfig,omitempty"`
  5857. // Responses: Individual responses to images found within the file.
  5858. Responses []*GoogleCloudVisionV1p3beta1AnnotateImageResponse `json:"responses,omitempty"`
  5859. // ForceSendFields is a list of field names (e.g. "InputConfig") to
  5860. // unconditionally include in API requests. By default, fields with
  5861. // empty values are omitted from API requests. However, any non-pointer,
  5862. // non-interface field appearing in ForceSendFields will be sent to the
  5863. // server regardless of whether the field is empty or not. This may be
  5864. // used to include empty fields in Patch requests.
  5865. ForceSendFields []string `json:"-"`
  5866. // NullFields is a list of field names (e.g. "InputConfig") to include
  5867. // in API requests with the JSON null value. By default, fields with
  5868. // empty values are omitted from API requests. However, any field with
  5869. // an empty value appearing in NullFields will be sent to the server as
  5870. // null. It is an error if a field in this list has a non-empty value.
  5871. // This may be used to include null fields in Patch requests.
  5872. NullFields []string `json:"-"`
  5873. }
  5874. func (s *GoogleCloudVisionV1p3beta1AnnotateFileResponse) MarshalJSON() ([]byte, error) {
  5875. type NoMethod GoogleCloudVisionV1p3beta1AnnotateFileResponse
  5876. raw := NoMethod(*s)
  5877. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5878. }
  5879. // GoogleCloudVisionV1p3beta1AnnotateImageResponse: Response to an image
  5880. // annotation request.
  5881. type GoogleCloudVisionV1p3beta1AnnotateImageResponse struct {
  5882. // Context: If present, contextual information is needed to understand
  5883. // where this image
  5884. // comes from.
  5885. Context *GoogleCloudVisionV1p3beta1ImageAnnotationContext `json:"context,omitempty"`
  5886. // CropHintsAnnotation: If present, crop hints have completed
  5887. // successfully.
  5888. CropHintsAnnotation *GoogleCloudVisionV1p3beta1CropHintsAnnotation `json:"cropHintsAnnotation,omitempty"`
  5889. // Error: If set, represents the error message for the operation.
  5890. // Note that filled-in image annotations are guaranteed to be
  5891. // correct, even when `error` is set.
  5892. Error *Status `json:"error,omitempty"`
  5893. // FaceAnnotations: If present, face detection has completed
  5894. // successfully.
  5895. FaceAnnotations []*GoogleCloudVisionV1p3beta1FaceAnnotation `json:"faceAnnotations,omitempty"`
  5896. // FullTextAnnotation: If present, text (OCR) detection or document
  5897. // (OCR) text detection has
  5898. // completed successfully.
  5899. // This annotation provides the structural hierarchy for the OCR
  5900. // detected
  5901. // text.
  5902. FullTextAnnotation *GoogleCloudVisionV1p3beta1TextAnnotation `json:"fullTextAnnotation,omitempty"`
  5903. // ImagePropertiesAnnotation: If present, image properties were
  5904. // extracted successfully.
  5905. ImagePropertiesAnnotation *GoogleCloudVisionV1p3beta1ImageProperties `json:"imagePropertiesAnnotation,omitempty"`
  5906. // LabelAnnotations: If present, label detection has completed
  5907. // successfully.
  5908. LabelAnnotations []*GoogleCloudVisionV1p3beta1EntityAnnotation `json:"labelAnnotations,omitempty"`
  5909. // LandmarkAnnotations: If present, landmark detection has completed
  5910. // successfully.
  5911. LandmarkAnnotations []*GoogleCloudVisionV1p3beta1EntityAnnotation `json:"landmarkAnnotations,omitempty"`
  5912. // LocalizedObjectAnnotations: If present, localized object detection
  5913. // has completed successfully.
  5914. // This will be sorted descending by confidence score.
  5915. LocalizedObjectAnnotations []*GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation `json:"localizedObjectAnnotations,omitempty"`
  5916. // LogoAnnotations: If present, logo detection has completed
  5917. // successfully.
  5918. LogoAnnotations []*GoogleCloudVisionV1p3beta1EntityAnnotation `json:"logoAnnotations,omitempty"`
  5919. // ProductSearchResults: If present, product search has completed
  5920. // successfully.
  5921. ProductSearchResults *GoogleCloudVisionV1p3beta1ProductSearchResults `json:"productSearchResults,omitempty"`
  5922. // SafeSearchAnnotation: If present, safe-search annotation has
  5923. // completed successfully.
  5924. SafeSearchAnnotation *GoogleCloudVisionV1p3beta1SafeSearchAnnotation `json:"safeSearchAnnotation,omitempty"`
  5925. // TextAnnotations: If present, text (OCR) detection has completed
  5926. // successfully.
  5927. TextAnnotations []*GoogleCloudVisionV1p3beta1EntityAnnotation `json:"textAnnotations,omitempty"`
  5928. // WebDetection: If present, web detection has completed successfully.
  5929. WebDetection *GoogleCloudVisionV1p3beta1WebDetection `json:"webDetection,omitempty"`
  5930. // ForceSendFields is a list of field names (e.g. "Context") to
  5931. // unconditionally include in API requests. By default, fields with
  5932. // empty values are omitted from API requests. However, any non-pointer,
  5933. // non-interface field appearing in ForceSendFields will be sent to the
  5934. // server regardless of whether the field is empty or not. This may be
  5935. // used to include empty fields in Patch requests.
  5936. ForceSendFields []string `json:"-"`
  5937. // NullFields is a list of field names (e.g. "Context") to include in
  5938. // API requests with the JSON null value. By default, fields with empty
  5939. // values are omitted from API requests. However, any field with an
  5940. // empty value appearing in NullFields will be sent to the server as
  5941. // null. It is an error if a field in this list has a non-empty value.
  5942. // This may be used to include null fields in Patch requests.
  5943. NullFields []string `json:"-"`
  5944. }
  5945. func (s *GoogleCloudVisionV1p3beta1AnnotateImageResponse) MarshalJSON() ([]byte, error) {
  5946. type NoMethod GoogleCloudVisionV1p3beta1AnnotateImageResponse
  5947. raw := NoMethod(*s)
  5948. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5949. }
  5950. // GoogleCloudVisionV1p3beta1AsyncAnnotateFileResponse: The response for
  5951. // a single offline file annotation request.
  5952. type GoogleCloudVisionV1p3beta1AsyncAnnotateFileResponse struct {
  5953. // OutputConfig: The output location and metadata from
  5954. // AsyncAnnotateFileRequest.
  5955. OutputConfig *GoogleCloudVisionV1p3beta1OutputConfig `json:"outputConfig,omitempty"`
  5956. // ForceSendFields is a list of field names (e.g. "OutputConfig") to
  5957. // unconditionally include in API requests. By default, fields with
  5958. // empty values are omitted from API requests. However, any non-pointer,
  5959. // non-interface field appearing in ForceSendFields will be sent to the
  5960. // server regardless of whether the field is empty or not. This may be
  5961. // used to include empty fields in Patch requests.
  5962. ForceSendFields []string `json:"-"`
  5963. // NullFields is a list of field names (e.g. "OutputConfig") to include
  5964. // in API requests with the JSON null value. By default, fields with
  5965. // empty values are omitted from API requests. However, any field with
  5966. // an empty value appearing in NullFields will be sent to the server as
  5967. // null. It is an error if a field in this list has a non-empty value.
  5968. // This may be used to include null fields in Patch requests.
  5969. NullFields []string `json:"-"`
  5970. }
  5971. func (s *GoogleCloudVisionV1p3beta1AsyncAnnotateFileResponse) MarshalJSON() ([]byte, error) {
  5972. type NoMethod GoogleCloudVisionV1p3beta1AsyncAnnotateFileResponse
  5973. raw := NoMethod(*s)
  5974. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5975. }
  5976. // GoogleCloudVisionV1p3beta1AsyncBatchAnnotateFilesResponse: Response
  5977. // to an async batch file annotation request.
  5978. type GoogleCloudVisionV1p3beta1AsyncBatchAnnotateFilesResponse struct {
  5979. // Responses: The list of file annotation responses, one for each
  5980. // request in
  5981. // AsyncBatchAnnotateFilesRequest.
  5982. Responses []*GoogleCloudVisionV1p3beta1AsyncAnnotateFileResponse `json:"responses,omitempty"`
  5983. // ForceSendFields is a list of field names (e.g. "Responses") to
  5984. // unconditionally include in API requests. By default, fields with
  5985. // empty values are omitted from API requests. However, any non-pointer,
  5986. // non-interface field appearing in ForceSendFields will be sent to the
  5987. // server regardless of whether the field is empty or not. This may be
  5988. // used to include empty fields in Patch requests.
  5989. ForceSendFields []string `json:"-"`
  5990. // NullFields is a list of field names (e.g. "Responses") to include in
  5991. // API requests with the JSON null value. By default, fields with empty
  5992. // values are omitted from API requests. However, any field with an
  5993. // empty value appearing in NullFields will be sent to the server as
  5994. // null. It is an error if a field in this list has a non-empty value.
  5995. // This may be used to include null fields in Patch requests.
  5996. NullFields []string `json:"-"`
  5997. }
  5998. func (s *GoogleCloudVisionV1p3beta1AsyncBatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) {
  5999. type NoMethod GoogleCloudVisionV1p3beta1AsyncBatchAnnotateFilesResponse
  6000. raw := NoMethod(*s)
  6001. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6002. }
  6003. // GoogleCloudVisionV1p3beta1BatchOperationMetadata: Metadata for the
  6004. // batch operations such as the current state.
  6005. //
  6006. // This is included in the `metadata` field of the `Operation` returned
  6007. // by the
  6008. // `GetOperation` call of the `google::longrunning::Operations` service.
  6009. type GoogleCloudVisionV1p3beta1BatchOperationMetadata struct {
  6010. // EndTime: The time when the batch request is finished
  6011. // and
  6012. // google.longrunning.Operation.done is set to true.
  6013. EndTime string `json:"endTime,omitempty"`
  6014. // State: The current state of the batch operation.
  6015. //
  6016. // Possible values:
  6017. // "STATE_UNSPECIFIED" - Invalid.
  6018. // "PROCESSING" - Request is actively being processed.
  6019. // "SUCCESSFUL" - The request is done and at least one item has been
  6020. // successfully
  6021. // processed.
  6022. // "FAILED" - The request is done and no item has been successfully
  6023. // processed.
  6024. // "CANCELLED" - The request is done after the
  6025. // longrunning.Operations.CancelOperation has
  6026. // been called by the user. Any records that were processed before
  6027. // the
  6028. // cancel command are output as specified in the request.
  6029. State string `json:"state,omitempty"`
  6030. // SubmitTime: The time when the batch request was submitted to the
  6031. // server.
  6032. SubmitTime string `json:"submitTime,omitempty"`
  6033. // ForceSendFields is a list of field names (e.g. "EndTime") to
  6034. // unconditionally include in API requests. By default, fields with
  6035. // empty values are omitted from API requests. However, any non-pointer,
  6036. // non-interface field appearing in ForceSendFields will be sent to the
  6037. // server regardless of whether the field is empty or not. This may be
  6038. // used to include empty fields in Patch requests.
  6039. ForceSendFields []string `json:"-"`
  6040. // NullFields is a list of field names (e.g. "EndTime") to include in
  6041. // API requests with the JSON null value. By default, fields with empty
  6042. // values are omitted from API requests. However, any field with an
  6043. // empty value appearing in NullFields will be sent to the server as
  6044. // null. It is an error if a field in this list has a non-empty value.
  6045. // This may be used to include null fields in Patch requests.
  6046. NullFields []string `json:"-"`
  6047. }
  6048. func (s *GoogleCloudVisionV1p3beta1BatchOperationMetadata) MarshalJSON() ([]byte, error) {
  6049. type NoMethod GoogleCloudVisionV1p3beta1BatchOperationMetadata
  6050. raw := NoMethod(*s)
  6051. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6052. }
  6053. // GoogleCloudVisionV1p3beta1Block: Logical element on the page.
  6054. type GoogleCloudVisionV1p3beta1Block struct {
  6055. // BlockType: Detected block type (text, image etc) for this block.
  6056. //
  6057. // Possible values:
  6058. // "UNKNOWN" - Unknown block type.
  6059. // "TEXT" - Regular text block.
  6060. // "TABLE" - Table block.
  6061. // "PICTURE" - Image block.
  6062. // "RULER" - Horizontal/vertical line box.
  6063. // "BARCODE" - Barcode block.
  6064. BlockType string `json:"blockType,omitempty"`
  6065. // BoundingBox: The bounding box for the block.
  6066. // The vertices are in the order of top-left, top-right,
  6067. // bottom-right,
  6068. // bottom-left. When a rotation of the bounding box is detected the
  6069. // rotation
  6070. // is represented as around the top-left corner as defined when the text
  6071. // is
  6072. // read in the 'natural' orientation.
  6073. // For example:
  6074. //
  6075. // * when the text is horizontal it might look like:
  6076. //
  6077. // 0----1
  6078. // | |
  6079. // 3----2
  6080. //
  6081. // * when it's rotated 180 degrees around the top-left corner it
  6082. // becomes:
  6083. //
  6084. // 2----3
  6085. // | |
  6086. // 1----0
  6087. //
  6088. // and the vertex order will still be (0, 1, 2, 3).
  6089. BoundingBox *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingBox,omitempty"`
  6090. // Confidence: Confidence of the OCR results on the block. Range [0, 1].
  6091. Confidence float64 `json:"confidence,omitempty"`
  6092. // Paragraphs: List of paragraphs in this block (if this blocks is of
  6093. // type text).
  6094. Paragraphs []*GoogleCloudVisionV1p3beta1Paragraph `json:"paragraphs,omitempty"`
  6095. // Property: Additional information detected for the block.
  6096. Property *GoogleCloudVisionV1p3beta1TextAnnotationTextProperty `json:"property,omitempty"`
  6097. // ForceSendFields is a list of field names (e.g. "BlockType") to
  6098. // unconditionally include in API requests. By default, fields with
  6099. // empty values are omitted from API requests. However, any non-pointer,
  6100. // non-interface field appearing in ForceSendFields will be sent to the
  6101. // server regardless of whether the field is empty or not. This may be
  6102. // used to include empty fields in Patch requests.
  6103. ForceSendFields []string `json:"-"`
  6104. // NullFields is a list of field names (e.g. "BlockType") to include in
  6105. // API requests with the JSON null value. By default, fields with empty
  6106. // values are omitted from API requests. However, any field with an
  6107. // empty value appearing in NullFields will be sent to the server as
  6108. // null. It is an error if a field in this list has a non-empty value.
  6109. // This may be used to include null fields in Patch requests.
  6110. NullFields []string `json:"-"`
  6111. }
  6112. func (s *GoogleCloudVisionV1p3beta1Block) MarshalJSON() ([]byte, error) {
  6113. type NoMethod GoogleCloudVisionV1p3beta1Block
  6114. raw := NoMethod(*s)
  6115. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6116. }
  6117. func (s *GoogleCloudVisionV1p3beta1Block) UnmarshalJSON(data []byte) error {
  6118. type NoMethod GoogleCloudVisionV1p3beta1Block
  6119. var s1 struct {
  6120. Confidence gensupport.JSONFloat64 `json:"confidence"`
  6121. *NoMethod
  6122. }
  6123. s1.NoMethod = (*NoMethod)(s)
  6124. if err := json.Unmarshal(data, &s1); err != nil {
  6125. return err
  6126. }
  6127. s.Confidence = float64(s1.Confidence)
  6128. return nil
  6129. }
  6130. // GoogleCloudVisionV1p3beta1BoundingPoly: A bounding polygon for the
  6131. // detected image annotation.
  6132. type GoogleCloudVisionV1p3beta1BoundingPoly struct {
  6133. // NormalizedVertices: The bounding polygon normalized vertices.
  6134. NormalizedVertices []*GoogleCloudVisionV1p3beta1NormalizedVertex `json:"normalizedVertices,omitempty"`
  6135. // Vertices: The bounding polygon vertices.
  6136. Vertices []*GoogleCloudVisionV1p3beta1Vertex `json:"vertices,omitempty"`
  6137. // ForceSendFields is a list of field names (e.g. "NormalizedVertices")
  6138. // to unconditionally include in API requests. By default, fields with
  6139. // empty values are omitted from API requests. However, any non-pointer,
  6140. // non-interface field appearing in ForceSendFields will be sent to the
  6141. // server regardless of whether the field is empty or not. This may be
  6142. // used to include empty fields in Patch requests.
  6143. ForceSendFields []string `json:"-"`
  6144. // NullFields is a list of field names (e.g. "NormalizedVertices") to
  6145. // include in API requests with the JSON null value. By default, fields
  6146. // with empty values are omitted from API requests. However, any field
  6147. // with an empty value appearing in NullFields will be sent to the
  6148. // server as null. It is an error if a field in this list has a
  6149. // non-empty value. This may be used to include null fields in Patch
  6150. // requests.
  6151. NullFields []string `json:"-"`
  6152. }
  6153. func (s *GoogleCloudVisionV1p3beta1BoundingPoly) MarshalJSON() ([]byte, error) {
  6154. type NoMethod GoogleCloudVisionV1p3beta1BoundingPoly
  6155. raw := NoMethod(*s)
  6156. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6157. }
  6158. // GoogleCloudVisionV1p3beta1ColorInfo: Color information consists of
  6159. // RGB channels, score, and the fraction of
  6160. // the image that the color occupies in the image.
  6161. type GoogleCloudVisionV1p3beta1ColorInfo struct {
  6162. // Color: RGB components of the color.
  6163. Color *Color `json:"color,omitempty"`
  6164. // PixelFraction: The fraction of pixels the color occupies in the
  6165. // image.
  6166. // Value in range [0, 1].
  6167. PixelFraction float64 `json:"pixelFraction,omitempty"`
  6168. // Score: Image-specific score for this color. Value in range [0, 1].
  6169. Score float64 `json:"score,omitempty"`
  6170. // ForceSendFields is a list of field names (e.g. "Color") to
  6171. // unconditionally include in API requests. By default, fields with
  6172. // empty values are omitted from API requests. However, any non-pointer,
  6173. // non-interface field appearing in ForceSendFields will be sent to the
  6174. // server regardless of whether the field is empty or not. This may be
  6175. // used to include empty fields in Patch requests.
  6176. ForceSendFields []string `json:"-"`
  6177. // NullFields is a list of field names (e.g. "Color") to include in API
  6178. // requests with the JSON null value. By default, fields with empty
  6179. // values are omitted from API requests. However, any field with an
  6180. // empty value appearing in NullFields will be sent to the server as
  6181. // null. It is an error if a field in this list has a non-empty value.
  6182. // This may be used to include null fields in Patch requests.
  6183. NullFields []string `json:"-"`
  6184. }
  6185. func (s *GoogleCloudVisionV1p3beta1ColorInfo) MarshalJSON() ([]byte, error) {
  6186. type NoMethod GoogleCloudVisionV1p3beta1ColorInfo
  6187. raw := NoMethod(*s)
  6188. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6189. }
  6190. func (s *GoogleCloudVisionV1p3beta1ColorInfo) UnmarshalJSON(data []byte) error {
  6191. type NoMethod GoogleCloudVisionV1p3beta1ColorInfo
  6192. var s1 struct {
  6193. PixelFraction gensupport.JSONFloat64 `json:"pixelFraction"`
  6194. Score gensupport.JSONFloat64 `json:"score"`
  6195. *NoMethod
  6196. }
  6197. s1.NoMethod = (*NoMethod)(s)
  6198. if err := json.Unmarshal(data, &s1); err != nil {
  6199. return err
  6200. }
  6201. s.PixelFraction = float64(s1.PixelFraction)
  6202. s.Score = float64(s1.Score)
  6203. return nil
  6204. }
  6205. // GoogleCloudVisionV1p3beta1CropHint: Single crop hint that is used to
  6206. // generate a new crop when serving an image.
  6207. type GoogleCloudVisionV1p3beta1CropHint struct {
  6208. // BoundingPoly: The bounding polygon for the crop region. The
  6209. // coordinates of the bounding
  6210. // box are in the original image's scale.
  6211. BoundingPoly *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPoly,omitempty"`
  6212. // Confidence: Confidence of this being a salient region. Range [0, 1].
  6213. Confidence float64 `json:"confidence,omitempty"`
  6214. // ImportanceFraction: Fraction of importance of this salient region
  6215. // with respect to the original
  6216. // image.
  6217. ImportanceFraction float64 `json:"importanceFraction,omitempty"`
  6218. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  6219. // unconditionally include in API requests. By default, fields with
  6220. // empty values are omitted from API requests. However, any non-pointer,
  6221. // non-interface field appearing in ForceSendFields will be sent to the
  6222. // server regardless of whether the field is empty or not. This may be
  6223. // used to include empty fields in Patch requests.
  6224. ForceSendFields []string `json:"-"`
  6225. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  6226. // in API requests with the JSON null value. By default, fields with
  6227. // empty values are omitted from API requests. However, any field with
  6228. // an empty value appearing in NullFields will be sent to the server as
  6229. // null. It is an error if a field in this list has a non-empty value.
  6230. // This may be used to include null fields in Patch requests.
  6231. NullFields []string `json:"-"`
  6232. }
  6233. func (s *GoogleCloudVisionV1p3beta1CropHint) MarshalJSON() ([]byte, error) {
  6234. type NoMethod GoogleCloudVisionV1p3beta1CropHint
  6235. raw := NoMethod(*s)
  6236. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6237. }
  6238. func (s *GoogleCloudVisionV1p3beta1CropHint) UnmarshalJSON(data []byte) error {
  6239. type NoMethod GoogleCloudVisionV1p3beta1CropHint
  6240. var s1 struct {
  6241. Confidence gensupport.JSONFloat64 `json:"confidence"`
  6242. ImportanceFraction gensupport.JSONFloat64 `json:"importanceFraction"`
  6243. *NoMethod
  6244. }
  6245. s1.NoMethod = (*NoMethod)(s)
  6246. if err := json.Unmarshal(data, &s1); err != nil {
  6247. return err
  6248. }
  6249. s.Confidence = float64(s1.Confidence)
  6250. s.ImportanceFraction = float64(s1.ImportanceFraction)
  6251. return nil
  6252. }
  6253. // GoogleCloudVisionV1p3beta1CropHintsAnnotation: Set of crop hints that
  6254. // are used to generate new crops when serving images.
  6255. type GoogleCloudVisionV1p3beta1CropHintsAnnotation struct {
  6256. // CropHints: Crop hint results.
  6257. CropHints []*GoogleCloudVisionV1p3beta1CropHint `json:"cropHints,omitempty"`
  6258. // ForceSendFields is a list of field names (e.g. "CropHints") to
  6259. // unconditionally include in API requests. By default, fields with
  6260. // empty values are omitted from API requests. However, any non-pointer,
  6261. // non-interface field appearing in ForceSendFields will be sent to the
  6262. // server regardless of whether the field is empty or not. This may be
  6263. // used to include empty fields in Patch requests.
  6264. ForceSendFields []string `json:"-"`
  6265. // NullFields is a list of field names (e.g. "CropHints") to include in
  6266. // API requests with the JSON null value. By default, fields with empty
  6267. // values are omitted from API requests. However, any field with an
  6268. // empty value appearing in NullFields will be sent to the server as
  6269. // null. It is an error if a field in this list has a non-empty value.
  6270. // This may be used to include null fields in Patch requests.
  6271. NullFields []string `json:"-"`
  6272. }
  6273. func (s *GoogleCloudVisionV1p3beta1CropHintsAnnotation) MarshalJSON() ([]byte, error) {
  6274. type NoMethod GoogleCloudVisionV1p3beta1CropHintsAnnotation
  6275. raw := NoMethod(*s)
  6276. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6277. }
  6278. // GoogleCloudVisionV1p3beta1DominantColorsAnnotation: Set of dominant
  6279. // colors and their corresponding scores.
  6280. type GoogleCloudVisionV1p3beta1DominantColorsAnnotation struct {
  6281. // Colors: RGB color values with their score and pixel fraction.
  6282. Colors []*GoogleCloudVisionV1p3beta1ColorInfo `json:"colors,omitempty"`
  6283. // ForceSendFields is a list of field names (e.g. "Colors") to
  6284. // unconditionally include in API requests. By default, fields with
  6285. // empty values are omitted from API requests. However, any non-pointer,
  6286. // non-interface field appearing in ForceSendFields will be sent to the
  6287. // server regardless of whether the field is empty or not. This may be
  6288. // used to include empty fields in Patch requests.
  6289. ForceSendFields []string `json:"-"`
  6290. // NullFields is a list of field names (e.g. "Colors") to include in API
  6291. // requests with the JSON null value. By default, fields with empty
  6292. // values are omitted from API requests. However, any field with an
  6293. // empty value appearing in NullFields will be sent to the server as
  6294. // null. It is an error if a field in this list has a non-empty value.
  6295. // This may be used to include null fields in Patch requests.
  6296. NullFields []string `json:"-"`
  6297. }
  6298. func (s *GoogleCloudVisionV1p3beta1DominantColorsAnnotation) MarshalJSON() ([]byte, error) {
  6299. type NoMethod GoogleCloudVisionV1p3beta1DominantColorsAnnotation
  6300. raw := NoMethod(*s)
  6301. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6302. }
  6303. // GoogleCloudVisionV1p3beta1EntityAnnotation: Set of detected entity
  6304. // features.
  6305. type GoogleCloudVisionV1p3beta1EntityAnnotation struct {
  6306. // BoundingPoly: Image region to which this entity belongs. Not
  6307. // produced
  6308. // for `LABEL_DETECTION` features.
  6309. BoundingPoly *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPoly,omitempty"`
  6310. // Confidence: **Deprecated. Use `score` instead.**
  6311. // The accuracy of the entity detection in an image.
  6312. // For example, for an image in which the "Eiffel Tower" entity is
  6313. // detected,
  6314. // this field represents the confidence that there is a tower in the
  6315. // query
  6316. // image. Range [0, 1].
  6317. Confidence float64 `json:"confidence,omitempty"`
  6318. // Description: Entity textual description, expressed in its `locale`
  6319. // language.
  6320. Description string `json:"description,omitempty"`
  6321. // Locale: The language code for the locale in which the entity
  6322. // textual
  6323. // `description` is expressed.
  6324. Locale string `json:"locale,omitempty"`
  6325. // Locations: The location information for the detected entity.
  6326. // Multiple
  6327. // `LocationInfo` elements can be present because one location
  6328. // may
  6329. // indicate the location of the scene in the image, and another
  6330. // location
  6331. // may indicate the location of the place where the image was
  6332. // taken.
  6333. // Location information is usually present for landmarks.
  6334. Locations []*GoogleCloudVisionV1p3beta1LocationInfo `json:"locations,omitempty"`
  6335. // Mid: Opaque entity ID. Some IDs may be available in
  6336. // [Google Knowledge Graph
  6337. // Search
  6338. // API](https://developers.google.com/knowledge-graph/).
  6339. Mid string `json:"mid,omitempty"`
  6340. // Properties: Some entities may have optional user-supplied `Property`
  6341. // (name/value)
  6342. // fields, such a score or string that qualifies the entity.
  6343. Properties []*GoogleCloudVisionV1p3beta1Property `json:"properties,omitempty"`
  6344. // Score: Overall score of the result. Range [0, 1].
  6345. Score float64 `json:"score,omitempty"`
  6346. // Topicality: The relevancy of the ICA (Image Content Annotation) label
  6347. // to the
  6348. // image. For example, the relevancy of "tower" is likely higher to an
  6349. // image
  6350. // containing the detected "Eiffel Tower" than to an image containing
  6351. // a
  6352. // detected distant towering building, even though the confidence
  6353. // that
  6354. // there is a tower in each image may be the same. Range [0, 1].
  6355. Topicality float64 `json:"topicality,omitempty"`
  6356. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  6357. // unconditionally include in API requests. By default, fields with
  6358. // empty values are omitted from API requests. However, any non-pointer,
  6359. // non-interface field appearing in ForceSendFields will be sent to the
  6360. // server regardless of whether the field is empty or not. This may be
  6361. // used to include empty fields in Patch requests.
  6362. ForceSendFields []string `json:"-"`
  6363. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  6364. // in API requests with the JSON null value. By default, fields with
  6365. // empty values are omitted from API requests. However, any field with
  6366. // an empty value appearing in NullFields will be sent to the server as
  6367. // null. It is an error if a field in this list has a non-empty value.
  6368. // This may be used to include null fields in Patch requests.
  6369. NullFields []string `json:"-"`
  6370. }
  6371. func (s *GoogleCloudVisionV1p3beta1EntityAnnotation) MarshalJSON() ([]byte, error) {
  6372. type NoMethod GoogleCloudVisionV1p3beta1EntityAnnotation
  6373. raw := NoMethod(*s)
  6374. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6375. }
  6376. func (s *GoogleCloudVisionV1p3beta1EntityAnnotation) UnmarshalJSON(data []byte) error {
  6377. type NoMethod GoogleCloudVisionV1p3beta1EntityAnnotation
  6378. var s1 struct {
  6379. Confidence gensupport.JSONFloat64 `json:"confidence"`
  6380. Score gensupport.JSONFloat64 `json:"score"`
  6381. Topicality gensupport.JSONFloat64 `json:"topicality"`
  6382. *NoMethod
  6383. }
  6384. s1.NoMethod = (*NoMethod)(s)
  6385. if err := json.Unmarshal(data, &s1); err != nil {
  6386. return err
  6387. }
  6388. s.Confidence = float64(s1.Confidence)
  6389. s.Score = float64(s1.Score)
  6390. s.Topicality = float64(s1.Topicality)
  6391. return nil
  6392. }
  6393. // GoogleCloudVisionV1p3beta1FaceAnnotation: A face annotation object
  6394. // contains the results of face detection.
  6395. type GoogleCloudVisionV1p3beta1FaceAnnotation struct {
  6396. // AngerLikelihood: Anger likelihood.
  6397. //
  6398. // Possible values:
  6399. // "UNKNOWN" - Unknown likelihood.
  6400. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  6401. // specified vertical.
  6402. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  6403. // vertical.
  6404. // "POSSIBLE" - It is possible that the image belongs to the specified
  6405. // vertical.
  6406. // "LIKELY" - It is likely that the image belongs to the specified
  6407. // vertical.
  6408. // "VERY_LIKELY" - It is very likely that the image belongs to the
  6409. // specified vertical.
  6410. AngerLikelihood string `json:"angerLikelihood,omitempty"`
  6411. // BlurredLikelihood: Blurred likelihood.
  6412. //
  6413. // Possible values:
  6414. // "UNKNOWN" - Unknown likelihood.
  6415. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  6416. // specified vertical.
  6417. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  6418. // vertical.
  6419. // "POSSIBLE" - It is possible that the image belongs to the specified
  6420. // vertical.
  6421. // "LIKELY" - It is likely that the image belongs to the specified
  6422. // vertical.
  6423. // "VERY_LIKELY" - It is very likely that the image belongs to the
  6424. // specified vertical.
  6425. BlurredLikelihood string `json:"blurredLikelihood,omitempty"`
  6426. // BoundingPoly: The bounding polygon around the face. The coordinates
  6427. // of the bounding box
  6428. // are in the original image's scale.
  6429. // The bounding box is computed to "frame" the face in accordance with
  6430. // human
  6431. // expectations. It is based on the landmarker results.
  6432. // Note that one or more x and/or y coordinates may not be generated in
  6433. // the
  6434. // `BoundingPoly` (the polygon will be unbounded) if only a partial
  6435. // face
  6436. // appears in the image to be annotated.
  6437. BoundingPoly *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPoly,omitempty"`
  6438. // DetectionConfidence: Detection confidence. Range [0, 1].
  6439. DetectionConfidence float64 `json:"detectionConfidence,omitempty"`
  6440. // FdBoundingPoly: The `fd_bounding_poly` bounding polygon is tighter
  6441. // than the
  6442. // `boundingPoly`, and encloses only the skin part of the face.
  6443. // Typically, it
  6444. // is used to eliminate the face from any image analysis that detects
  6445. // the
  6446. // "amount of skin" visible in an image. It is not based on
  6447. // the
  6448. // landmarker results, only on the initial face detection, hence
  6449. // the <code>fd</code> (face detection) prefix.
  6450. FdBoundingPoly *GoogleCloudVisionV1p3beta1BoundingPoly `json:"fdBoundingPoly,omitempty"`
  6451. // HeadwearLikelihood: Headwear likelihood.
  6452. //
  6453. // Possible values:
  6454. // "UNKNOWN" - Unknown likelihood.
  6455. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  6456. // specified vertical.
  6457. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  6458. // vertical.
  6459. // "POSSIBLE" - It is possible that the image belongs to the specified
  6460. // vertical.
  6461. // "LIKELY" - It is likely that the image belongs to the specified
  6462. // vertical.
  6463. // "VERY_LIKELY" - It is very likely that the image belongs to the
  6464. // specified vertical.
  6465. HeadwearLikelihood string `json:"headwearLikelihood,omitempty"`
  6466. // JoyLikelihood: Joy likelihood.
  6467. //
  6468. // Possible values:
  6469. // "UNKNOWN" - Unknown likelihood.
  6470. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  6471. // specified vertical.
  6472. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  6473. // vertical.
  6474. // "POSSIBLE" - It is possible that the image belongs to the specified
  6475. // vertical.
  6476. // "LIKELY" - It is likely that the image belongs to the specified
  6477. // vertical.
  6478. // "VERY_LIKELY" - It is very likely that the image belongs to the
  6479. // specified vertical.
  6480. JoyLikelihood string `json:"joyLikelihood,omitempty"`
  6481. // LandmarkingConfidence: Face landmarking confidence. Range [0, 1].
  6482. LandmarkingConfidence float64 `json:"landmarkingConfidence,omitempty"`
  6483. // Landmarks: Detected face landmarks.
  6484. Landmarks []*GoogleCloudVisionV1p3beta1FaceAnnotationLandmark `json:"landmarks,omitempty"`
  6485. // PanAngle: Yaw angle, which indicates the leftward/rightward angle
  6486. // that the face is
  6487. // pointing relative to the vertical plane perpendicular to the image.
  6488. // Range
  6489. // [-180,180].
  6490. PanAngle float64 `json:"panAngle,omitempty"`
  6491. // RollAngle: Roll angle, which indicates the amount of
  6492. // clockwise/anti-clockwise rotation
  6493. // of the face relative to the image vertical about the axis
  6494. // perpendicular to
  6495. // the face. Range [-180,180].
  6496. RollAngle float64 `json:"rollAngle,omitempty"`
  6497. // SorrowLikelihood: Sorrow likelihood.
  6498. //
  6499. // Possible values:
  6500. // "UNKNOWN" - Unknown likelihood.
  6501. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  6502. // specified vertical.
  6503. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  6504. // vertical.
  6505. // "POSSIBLE" - It is possible that the image belongs to the specified
  6506. // vertical.
  6507. // "LIKELY" - It is likely that the image belongs to the specified
  6508. // vertical.
  6509. // "VERY_LIKELY" - It is very likely that the image belongs to the
  6510. // specified vertical.
  6511. SorrowLikelihood string `json:"sorrowLikelihood,omitempty"`
  6512. // SurpriseLikelihood: Surprise likelihood.
  6513. //
  6514. // Possible values:
  6515. // "UNKNOWN" - Unknown likelihood.
  6516. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  6517. // specified vertical.
  6518. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  6519. // vertical.
  6520. // "POSSIBLE" - It is possible that the image belongs to the specified
  6521. // vertical.
  6522. // "LIKELY" - It is likely that the image belongs to the specified
  6523. // vertical.
  6524. // "VERY_LIKELY" - It is very likely that the image belongs to the
  6525. // specified vertical.
  6526. SurpriseLikelihood string `json:"surpriseLikelihood,omitempty"`
  6527. // TiltAngle: Pitch angle, which indicates the upwards/downwards angle
  6528. // that the face is
  6529. // pointing relative to the image's horizontal plane. Range [-180,180].
  6530. TiltAngle float64 `json:"tiltAngle,omitempty"`
  6531. // UnderExposedLikelihood: Under-exposed likelihood.
  6532. //
  6533. // Possible values:
  6534. // "UNKNOWN" - Unknown likelihood.
  6535. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  6536. // specified vertical.
  6537. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  6538. // vertical.
  6539. // "POSSIBLE" - It is possible that the image belongs to the specified
  6540. // vertical.
  6541. // "LIKELY" - It is likely that the image belongs to the specified
  6542. // vertical.
  6543. // "VERY_LIKELY" - It is very likely that the image belongs to the
  6544. // specified vertical.
  6545. UnderExposedLikelihood string `json:"underExposedLikelihood,omitempty"`
  6546. // ForceSendFields is a list of field names (e.g. "AngerLikelihood") to
  6547. // unconditionally include in API requests. By default, fields with
  6548. // empty values are omitted from API requests. However, any non-pointer,
  6549. // non-interface field appearing in ForceSendFields will be sent to the
  6550. // server regardless of whether the field is empty or not. This may be
  6551. // used to include empty fields in Patch requests.
  6552. ForceSendFields []string `json:"-"`
  6553. // NullFields is a list of field names (e.g. "AngerLikelihood") to
  6554. // include in API requests with the JSON null value. By default, fields
  6555. // with empty values are omitted from API requests. However, any field
  6556. // with an empty value appearing in NullFields will be sent to the
  6557. // server as null. It is an error if a field in this list has a
  6558. // non-empty value. This may be used to include null fields in Patch
  6559. // requests.
  6560. NullFields []string `json:"-"`
  6561. }
  6562. func (s *GoogleCloudVisionV1p3beta1FaceAnnotation) MarshalJSON() ([]byte, error) {
  6563. type NoMethod GoogleCloudVisionV1p3beta1FaceAnnotation
  6564. raw := NoMethod(*s)
  6565. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6566. }
  6567. func (s *GoogleCloudVisionV1p3beta1FaceAnnotation) UnmarshalJSON(data []byte) error {
  6568. type NoMethod GoogleCloudVisionV1p3beta1FaceAnnotation
  6569. var s1 struct {
  6570. DetectionConfidence gensupport.JSONFloat64 `json:"detectionConfidence"`
  6571. LandmarkingConfidence gensupport.JSONFloat64 `json:"landmarkingConfidence"`
  6572. PanAngle gensupport.JSONFloat64 `json:"panAngle"`
  6573. RollAngle gensupport.JSONFloat64 `json:"rollAngle"`
  6574. TiltAngle gensupport.JSONFloat64 `json:"tiltAngle"`
  6575. *NoMethod
  6576. }
  6577. s1.NoMethod = (*NoMethod)(s)
  6578. if err := json.Unmarshal(data, &s1); err != nil {
  6579. return err
  6580. }
  6581. s.DetectionConfidence = float64(s1.DetectionConfidence)
  6582. s.LandmarkingConfidence = float64(s1.LandmarkingConfidence)
  6583. s.PanAngle = float64(s1.PanAngle)
  6584. s.RollAngle = float64(s1.RollAngle)
  6585. s.TiltAngle = float64(s1.TiltAngle)
  6586. return nil
  6587. }
  6588. // GoogleCloudVisionV1p3beta1FaceAnnotationLandmark: A face-specific
  6589. // landmark (for example, a face feature).
  6590. type GoogleCloudVisionV1p3beta1FaceAnnotationLandmark struct {
  6591. // Position: Face landmark position.
  6592. Position *GoogleCloudVisionV1p3beta1Position `json:"position,omitempty"`
  6593. // Type: Face landmark type.
  6594. //
  6595. // Possible values:
  6596. // "UNKNOWN_LANDMARK" - Unknown face landmark detected. Should not be
  6597. // filled.
  6598. // "LEFT_EYE" - Left eye.
  6599. // "RIGHT_EYE" - Right eye.
  6600. // "LEFT_OF_LEFT_EYEBROW" - Left of left eyebrow.
  6601. // "RIGHT_OF_LEFT_EYEBROW" - Right of left eyebrow.
  6602. // "LEFT_OF_RIGHT_EYEBROW" - Left of right eyebrow.
  6603. // "RIGHT_OF_RIGHT_EYEBROW" - Right of right eyebrow.
  6604. // "MIDPOINT_BETWEEN_EYES" - Midpoint between eyes.
  6605. // "NOSE_TIP" - Nose tip.
  6606. // "UPPER_LIP" - Upper lip.
  6607. // "LOWER_LIP" - Lower lip.
  6608. // "MOUTH_LEFT" - Mouth left.
  6609. // "MOUTH_RIGHT" - Mouth right.
  6610. // "MOUTH_CENTER" - Mouth center.
  6611. // "NOSE_BOTTOM_RIGHT" - Nose, bottom right.
  6612. // "NOSE_BOTTOM_LEFT" - Nose, bottom left.
  6613. // "NOSE_BOTTOM_CENTER" - Nose, bottom center.
  6614. // "LEFT_EYE_TOP_BOUNDARY" - Left eye, top boundary.
  6615. // "LEFT_EYE_RIGHT_CORNER" - Left eye, right corner.
  6616. // "LEFT_EYE_BOTTOM_BOUNDARY" - Left eye, bottom boundary.
  6617. // "LEFT_EYE_LEFT_CORNER" - Left eye, left corner.
  6618. // "RIGHT_EYE_TOP_BOUNDARY" - Right eye, top boundary.
  6619. // "RIGHT_EYE_RIGHT_CORNER" - Right eye, right corner.
  6620. // "RIGHT_EYE_BOTTOM_BOUNDARY" - Right eye, bottom boundary.
  6621. // "RIGHT_EYE_LEFT_CORNER" - Right eye, left corner.
  6622. // "LEFT_EYEBROW_UPPER_MIDPOINT" - Left eyebrow, upper midpoint.
  6623. // "RIGHT_EYEBROW_UPPER_MIDPOINT" - Right eyebrow, upper midpoint.
  6624. // "LEFT_EAR_TRAGION" - Left ear tragion.
  6625. // "RIGHT_EAR_TRAGION" - Right ear tragion.
  6626. // "LEFT_EYE_PUPIL" - Left eye pupil.
  6627. // "RIGHT_EYE_PUPIL" - Right eye pupil.
  6628. // "FOREHEAD_GLABELLA" - Forehead glabella.
  6629. // "CHIN_GNATHION" - Chin gnathion.
  6630. // "CHIN_LEFT_GONION" - Chin left gonion.
  6631. // "CHIN_RIGHT_GONION" - Chin right gonion.
  6632. Type string `json:"type,omitempty"`
  6633. // ForceSendFields is a list of field names (e.g. "Position") to
  6634. // unconditionally include in API requests. By default, fields with
  6635. // empty values are omitted from API requests. However, any non-pointer,
  6636. // non-interface field appearing in ForceSendFields will be sent to the
  6637. // server regardless of whether the field is empty or not. This may be
  6638. // used to include empty fields in Patch requests.
  6639. ForceSendFields []string `json:"-"`
  6640. // NullFields is a list of field names (e.g. "Position") to include in
  6641. // API requests with the JSON null value. By default, fields with empty
  6642. // values are omitted from API requests. However, any field with an
  6643. // empty value appearing in NullFields will be sent to the server as
  6644. // null. It is an error if a field in this list has a non-empty value.
  6645. // This may be used to include null fields in Patch requests.
  6646. NullFields []string `json:"-"`
  6647. }
  6648. func (s *GoogleCloudVisionV1p3beta1FaceAnnotationLandmark) MarshalJSON() ([]byte, error) {
  6649. type NoMethod GoogleCloudVisionV1p3beta1FaceAnnotationLandmark
  6650. raw := NoMethod(*s)
  6651. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6652. }
  6653. // GoogleCloudVisionV1p3beta1GcsDestination: The Google Cloud Storage
  6654. // location where the output will be written to.
  6655. type GoogleCloudVisionV1p3beta1GcsDestination struct {
  6656. // Uri: Google Cloud Storage URI where the results will be stored.
  6657. // Results will
  6658. // be in JSON format and preceded by its corresponding input URI. This
  6659. // field
  6660. // can either represent a single file, or a prefix for multiple
  6661. // outputs.
  6662. // Prefixes must end in a `/`.
  6663. //
  6664. // Examples:
  6665. //
  6666. // * File: gs://bucket-name/filename.json
  6667. // * Prefix: gs://bucket-name/prefix/here/
  6668. // * File: gs://bucket-name/prefix/here
  6669. //
  6670. // If multiple outputs, each response is still AnnotateFileResponse,
  6671. // each of
  6672. // which contains some subset of the full list of
  6673. // AnnotateImageResponse.
  6674. // Multiple outputs can happen if, for example, the output JSON is too
  6675. // large
  6676. // and overflows into multiple sharded files.
  6677. Uri string `json:"uri,omitempty"`
  6678. // ForceSendFields is a list of field names (e.g. "Uri") to
  6679. // unconditionally include in API requests. By default, fields with
  6680. // empty values are omitted from API requests. However, any non-pointer,
  6681. // non-interface field appearing in ForceSendFields will be sent to the
  6682. // server regardless of whether the field is empty or not. This may be
  6683. // used to include empty fields in Patch requests.
  6684. ForceSendFields []string `json:"-"`
  6685. // NullFields is a list of field names (e.g. "Uri") to include in API
  6686. // requests with the JSON null value. By default, fields with empty
  6687. // values are omitted from API requests. However, any field with an
  6688. // empty value appearing in NullFields will be sent to the server as
  6689. // null. It is an error if a field in this list has a non-empty value.
  6690. // This may be used to include null fields in Patch requests.
  6691. NullFields []string `json:"-"`
  6692. }
  6693. func (s *GoogleCloudVisionV1p3beta1GcsDestination) MarshalJSON() ([]byte, error) {
  6694. type NoMethod GoogleCloudVisionV1p3beta1GcsDestination
  6695. raw := NoMethod(*s)
  6696. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6697. }
  6698. // GoogleCloudVisionV1p3beta1GcsSource: The Google Cloud Storage
  6699. // location where the input will be read from.
  6700. type GoogleCloudVisionV1p3beta1GcsSource struct {
  6701. // Uri: Google Cloud Storage URI for the input file. This must only be
  6702. // a
  6703. // Google Cloud Storage object. Wildcards are not currently supported.
  6704. Uri string `json:"uri,omitempty"`
  6705. // ForceSendFields is a list of field names (e.g. "Uri") to
  6706. // unconditionally include in API requests. By default, fields with
  6707. // empty values are omitted from API requests. However, any non-pointer,
  6708. // non-interface field appearing in ForceSendFields will be sent to the
  6709. // server regardless of whether the field is empty or not. This may be
  6710. // used to include empty fields in Patch requests.
  6711. ForceSendFields []string `json:"-"`
  6712. // NullFields is a list of field names (e.g. "Uri") to include in API
  6713. // requests with the JSON null value. By default, fields with empty
  6714. // values are omitted from API requests. However, any field with an
  6715. // empty value appearing in NullFields will be sent to the server as
  6716. // null. It is an error if a field in this list has a non-empty value.
  6717. // This may be used to include null fields in Patch requests.
  6718. NullFields []string `json:"-"`
  6719. }
  6720. func (s *GoogleCloudVisionV1p3beta1GcsSource) MarshalJSON() ([]byte, error) {
  6721. type NoMethod GoogleCloudVisionV1p3beta1GcsSource
  6722. raw := NoMethod(*s)
  6723. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6724. }
  6725. // GoogleCloudVisionV1p3beta1ImageAnnotationContext: If an image was
  6726. // produced from a file (e.g. a PDF), this message gives
  6727. // information about the source of that image.
  6728. type GoogleCloudVisionV1p3beta1ImageAnnotationContext struct {
  6729. // PageNumber: If the file was a PDF or TIFF, this field gives the page
  6730. // number within
  6731. // the file used to produce the image.
  6732. PageNumber int64 `json:"pageNumber,omitempty"`
  6733. // Uri: The URI of the file used to produce the image.
  6734. Uri string `json:"uri,omitempty"`
  6735. // ForceSendFields is a list of field names (e.g. "PageNumber") to
  6736. // unconditionally include in API requests. By default, fields with
  6737. // empty values are omitted from API requests. However, any non-pointer,
  6738. // non-interface field appearing in ForceSendFields will be sent to the
  6739. // server regardless of whether the field is empty or not. This may be
  6740. // used to include empty fields in Patch requests.
  6741. ForceSendFields []string `json:"-"`
  6742. // NullFields is a list of field names (e.g. "PageNumber") to include in
  6743. // API requests with the JSON null value. By default, fields with empty
  6744. // values are omitted from API requests. However, any field with an
  6745. // empty value appearing in NullFields will be sent to the server as
  6746. // null. It is an error if a field in this list has a non-empty value.
  6747. // This may be used to include null fields in Patch requests.
  6748. NullFields []string `json:"-"`
  6749. }
  6750. func (s *GoogleCloudVisionV1p3beta1ImageAnnotationContext) MarshalJSON() ([]byte, error) {
  6751. type NoMethod GoogleCloudVisionV1p3beta1ImageAnnotationContext
  6752. raw := NoMethod(*s)
  6753. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6754. }
  6755. // GoogleCloudVisionV1p3beta1ImageProperties: Stores image properties,
  6756. // such as dominant colors.
  6757. type GoogleCloudVisionV1p3beta1ImageProperties struct {
  6758. // DominantColors: If present, dominant colors completed successfully.
  6759. DominantColors *GoogleCloudVisionV1p3beta1DominantColorsAnnotation `json:"dominantColors,omitempty"`
  6760. // ForceSendFields is a list of field names (e.g. "DominantColors") to
  6761. // unconditionally include in API requests. By default, fields with
  6762. // empty values are omitted from API requests. However, any non-pointer,
  6763. // non-interface field appearing in ForceSendFields will be sent to the
  6764. // server regardless of whether the field is empty or not. This may be
  6765. // used to include empty fields in Patch requests.
  6766. ForceSendFields []string `json:"-"`
  6767. // NullFields is a list of field names (e.g. "DominantColors") to
  6768. // include in API requests with the JSON null value. By default, fields
  6769. // with empty values are omitted from API requests. However, any field
  6770. // with an empty value appearing in NullFields will be sent to the
  6771. // server as null. It is an error if a field in this list has a
  6772. // non-empty value. This may be used to include null fields in Patch
  6773. // requests.
  6774. NullFields []string `json:"-"`
  6775. }
  6776. func (s *GoogleCloudVisionV1p3beta1ImageProperties) MarshalJSON() ([]byte, error) {
  6777. type NoMethod GoogleCloudVisionV1p3beta1ImageProperties
  6778. raw := NoMethod(*s)
  6779. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6780. }
  6781. // GoogleCloudVisionV1p3beta1ImportProductSetsResponse: Response message
  6782. // for the `ImportProductSets` method.
  6783. //
  6784. // This message is returned by
  6785. // the
  6786. // google.longrunning.Operations.GetOperation method in the
  6787. // returned
  6788. // google.longrunning.Operation.response field.
  6789. type GoogleCloudVisionV1p3beta1ImportProductSetsResponse struct {
  6790. // ReferenceImages: The list of reference_images that are imported
  6791. // successfully.
  6792. ReferenceImages []*GoogleCloudVisionV1p3beta1ReferenceImage `json:"referenceImages,omitempty"`
  6793. // Statuses: The rpc status for each ImportProductSet request, including
  6794. // both successes
  6795. // and errors.
  6796. //
  6797. // The number of statuses here matches the number of lines in the csv
  6798. // file,
  6799. // and statuses[i] stores the success or failure status of processing
  6800. // the i-th
  6801. // line of the csv, starting from line 0.
  6802. Statuses []*Status `json:"statuses,omitempty"`
  6803. // ForceSendFields is a list of field names (e.g. "ReferenceImages") to
  6804. // unconditionally include in API requests. By default, fields with
  6805. // empty values are omitted from API requests. However, any non-pointer,
  6806. // non-interface field appearing in ForceSendFields will be sent to the
  6807. // server regardless of whether the field is empty or not. This may be
  6808. // used to include empty fields in Patch requests.
  6809. ForceSendFields []string `json:"-"`
  6810. // NullFields is a list of field names (e.g. "ReferenceImages") to
  6811. // include in API requests with the JSON null value. By default, fields
  6812. // with empty values are omitted from API requests. However, any field
  6813. // with an empty value appearing in NullFields will be sent to the
  6814. // server as null. It is an error if a field in this list has a
  6815. // non-empty value. This may be used to include null fields in Patch
  6816. // requests.
  6817. NullFields []string `json:"-"`
  6818. }
  6819. func (s *GoogleCloudVisionV1p3beta1ImportProductSetsResponse) MarshalJSON() ([]byte, error) {
  6820. type NoMethod GoogleCloudVisionV1p3beta1ImportProductSetsResponse
  6821. raw := NoMethod(*s)
  6822. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6823. }
  6824. // GoogleCloudVisionV1p3beta1InputConfig: The desired input location and
  6825. // metadata.
  6826. type GoogleCloudVisionV1p3beta1InputConfig struct {
  6827. // GcsSource: The Google Cloud Storage location to read the input from.
  6828. GcsSource *GoogleCloudVisionV1p3beta1GcsSource `json:"gcsSource,omitempty"`
  6829. // MimeType: The type of the file. Currently only "application/pdf" and
  6830. // "image/tiff"
  6831. // are supported. Wildcards are not supported.
  6832. MimeType string `json:"mimeType,omitempty"`
  6833. // ForceSendFields is a list of field names (e.g. "GcsSource") to
  6834. // unconditionally include in API requests. By default, fields with
  6835. // empty values are omitted from API requests. However, any non-pointer,
  6836. // non-interface field appearing in ForceSendFields will be sent to the
  6837. // server regardless of whether the field is empty or not. This may be
  6838. // used to include empty fields in Patch requests.
  6839. ForceSendFields []string `json:"-"`
  6840. // NullFields is a list of field names (e.g. "GcsSource") to include in
  6841. // API requests with the JSON null value. By default, fields with empty
  6842. // values are omitted from API requests. However, any field with an
  6843. // empty value appearing in NullFields will be sent to the server as
  6844. // null. It is an error if a field in this list has a non-empty value.
  6845. // This may be used to include null fields in Patch requests.
  6846. NullFields []string `json:"-"`
  6847. }
  6848. func (s *GoogleCloudVisionV1p3beta1InputConfig) MarshalJSON() ([]byte, error) {
  6849. type NoMethod GoogleCloudVisionV1p3beta1InputConfig
  6850. raw := NoMethod(*s)
  6851. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6852. }
  6853. // GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation: Set of detected
  6854. // objects with bounding boxes.
  6855. type GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation struct {
  6856. // BoundingPoly: Image region to which this object belongs. This must be
  6857. // populated.
  6858. BoundingPoly *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPoly,omitempty"`
  6859. // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn".
  6860. // For more
  6861. // information,
  6862. // see
  6863. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  6864. LanguageCode string `json:"languageCode,omitempty"`
  6865. // Mid: Object ID that should align with EntityAnnotation mid.
  6866. Mid string `json:"mid,omitempty"`
  6867. // Name: Object name, expressed in its `language_code` language.
  6868. Name string `json:"name,omitempty"`
  6869. // Score: Score of the result. Range [0, 1].
  6870. Score float64 `json:"score,omitempty"`
  6871. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  6872. // unconditionally include in API requests. By default, fields with
  6873. // empty values are omitted from API requests. However, any non-pointer,
  6874. // non-interface field appearing in ForceSendFields will be sent to the
  6875. // server regardless of whether the field is empty or not. This may be
  6876. // used to include empty fields in Patch requests.
  6877. ForceSendFields []string `json:"-"`
  6878. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  6879. // in API requests with the JSON null value. By default, fields with
  6880. // empty values are omitted from API requests. However, any field with
  6881. // an empty value appearing in NullFields will be sent to the server as
  6882. // null. It is an error if a field in this list has a non-empty value.
  6883. // This may be used to include null fields in Patch requests.
  6884. NullFields []string `json:"-"`
  6885. }
  6886. func (s *GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation) MarshalJSON() ([]byte, error) {
  6887. type NoMethod GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation
  6888. raw := NoMethod(*s)
  6889. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6890. }
  6891. func (s *GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation) UnmarshalJSON(data []byte) error {
  6892. type NoMethod GoogleCloudVisionV1p3beta1LocalizedObjectAnnotation
  6893. var s1 struct {
  6894. Score gensupport.JSONFloat64 `json:"score"`
  6895. *NoMethod
  6896. }
  6897. s1.NoMethod = (*NoMethod)(s)
  6898. if err := json.Unmarshal(data, &s1); err != nil {
  6899. return err
  6900. }
  6901. s.Score = float64(s1.Score)
  6902. return nil
  6903. }
  6904. // GoogleCloudVisionV1p3beta1LocationInfo: Detected entity location
  6905. // information.
  6906. type GoogleCloudVisionV1p3beta1LocationInfo struct {
  6907. // LatLng: lat/long location coordinates.
  6908. LatLng *LatLng `json:"latLng,omitempty"`
  6909. // ForceSendFields is a list of field names (e.g. "LatLng") to
  6910. // unconditionally include in API requests. By default, fields with
  6911. // empty values are omitted from API requests. However, any non-pointer,
  6912. // non-interface field appearing in ForceSendFields will be sent to the
  6913. // server regardless of whether the field is empty or not. This may be
  6914. // used to include empty fields in Patch requests.
  6915. ForceSendFields []string `json:"-"`
  6916. // NullFields is a list of field names (e.g. "LatLng") to include in API
  6917. // requests with the JSON null value. By default, fields with empty
  6918. // values are omitted from API requests. However, any field with an
  6919. // empty value appearing in NullFields will be sent to the server as
  6920. // null. It is an error if a field in this list has a non-empty value.
  6921. // This may be used to include null fields in Patch requests.
  6922. NullFields []string `json:"-"`
  6923. }
  6924. func (s *GoogleCloudVisionV1p3beta1LocationInfo) MarshalJSON() ([]byte, error) {
  6925. type NoMethod GoogleCloudVisionV1p3beta1LocationInfo
  6926. raw := NoMethod(*s)
  6927. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6928. }
  6929. // GoogleCloudVisionV1p3beta1NormalizedVertex: A vertex represents a 2D
  6930. // point in the image.
  6931. // NOTE: the normalized vertex coordinates are relative to the original
  6932. // image
  6933. // and range from 0 to 1.
  6934. type GoogleCloudVisionV1p3beta1NormalizedVertex struct {
  6935. // X: X coordinate.
  6936. X float64 `json:"x,omitempty"`
  6937. // Y: Y coordinate.
  6938. Y float64 `json:"y,omitempty"`
  6939. // ForceSendFields is a list of field names (e.g. "X") to
  6940. // unconditionally include in API requests. By default, fields with
  6941. // empty values are omitted from API requests. However, any non-pointer,
  6942. // non-interface field appearing in ForceSendFields will be sent to the
  6943. // server regardless of whether the field is empty or not. This may be
  6944. // used to include empty fields in Patch requests.
  6945. ForceSendFields []string `json:"-"`
  6946. // NullFields is a list of field names (e.g. "X") to include in API
  6947. // requests with the JSON null value. By default, fields with empty
  6948. // values are omitted from API requests. However, any field with an
  6949. // empty value appearing in NullFields will be sent to the server as
  6950. // null. It is an error if a field in this list has a non-empty value.
  6951. // This may be used to include null fields in Patch requests.
  6952. NullFields []string `json:"-"`
  6953. }
  6954. func (s *GoogleCloudVisionV1p3beta1NormalizedVertex) MarshalJSON() ([]byte, error) {
  6955. type NoMethod GoogleCloudVisionV1p3beta1NormalizedVertex
  6956. raw := NoMethod(*s)
  6957. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6958. }
  6959. func (s *GoogleCloudVisionV1p3beta1NormalizedVertex) UnmarshalJSON(data []byte) error {
  6960. type NoMethod GoogleCloudVisionV1p3beta1NormalizedVertex
  6961. var s1 struct {
  6962. X gensupport.JSONFloat64 `json:"x"`
  6963. Y gensupport.JSONFloat64 `json:"y"`
  6964. *NoMethod
  6965. }
  6966. s1.NoMethod = (*NoMethod)(s)
  6967. if err := json.Unmarshal(data, &s1); err != nil {
  6968. return err
  6969. }
  6970. s.X = float64(s1.X)
  6971. s.Y = float64(s1.Y)
  6972. return nil
  6973. }
  6974. // GoogleCloudVisionV1p3beta1OperationMetadata: Contains metadata for
  6975. // the BatchAnnotateImages operation.
  6976. type GoogleCloudVisionV1p3beta1OperationMetadata struct {
  6977. // CreateTime: The time when the batch request was received.
  6978. CreateTime string `json:"createTime,omitempty"`
  6979. // State: Current state of the batch operation.
  6980. //
  6981. // Possible values:
  6982. // "STATE_UNSPECIFIED" - Invalid.
  6983. // "CREATED" - Request is received.
  6984. // "RUNNING" - Request is actively being processed.
  6985. // "DONE" - The batch processing is done.
  6986. // "CANCELLED" - The batch processing was cancelled.
  6987. State string `json:"state,omitempty"`
  6988. // UpdateTime: The time when the operation result was last updated.
  6989. UpdateTime string `json:"updateTime,omitempty"`
  6990. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  6991. // unconditionally include in API requests. By default, fields with
  6992. // empty values are omitted from API requests. However, any non-pointer,
  6993. // non-interface field appearing in ForceSendFields will be sent to the
  6994. // server regardless of whether the field is empty or not. This may be
  6995. // used to include empty fields in Patch requests.
  6996. ForceSendFields []string `json:"-"`
  6997. // NullFields is a list of field names (e.g. "CreateTime") to include in
  6998. // API requests with the JSON null value. By default, fields with empty
  6999. // values are omitted from API requests. However, any field with an
  7000. // empty value appearing in NullFields will be sent to the server as
  7001. // null. It is an error if a field in this list has a non-empty value.
  7002. // This may be used to include null fields in Patch requests.
  7003. NullFields []string `json:"-"`
  7004. }
  7005. func (s *GoogleCloudVisionV1p3beta1OperationMetadata) MarshalJSON() ([]byte, error) {
  7006. type NoMethod GoogleCloudVisionV1p3beta1OperationMetadata
  7007. raw := NoMethod(*s)
  7008. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7009. }
  7010. // GoogleCloudVisionV1p3beta1OutputConfig: The desired output location
  7011. // and metadata.
  7012. type GoogleCloudVisionV1p3beta1OutputConfig struct {
  7013. // BatchSize: The max number of response protos to put into each output
  7014. // JSON file on
  7015. // Google Cloud Storage.
  7016. // The valid range is [1, 100]. If not specified, the default value is
  7017. // 20.
  7018. //
  7019. // For example, for one pdf file with 100 pages, 100 response protos
  7020. // will
  7021. // be generated. If `batch_size` = 20, then 5 json files each
  7022. // containing 20 response protos will be written under the
  7023. // prefix
  7024. // `gcs_destination`.`uri`.
  7025. //
  7026. // Currently, batch_size only applies to GcsDestination, with potential
  7027. // future
  7028. // support for other output configurations.
  7029. BatchSize int64 `json:"batchSize,omitempty"`
  7030. // GcsDestination: The Google Cloud Storage location to write the
  7031. // output(s) to.
  7032. GcsDestination *GoogleCloudVisionV1p3beta1GcsDestination `json:"gcsDestination,omitempty"`
  7033. // ForceSendFields is a list of field names (e.g. "BatchSize") to
  7034. // unconditionally include in API requests. By default, fields with
  7035. // empty values are omitted from API requests. However, any non-pointer,
  7036. // non-interface field appearing in ForceSendFields will be sent to the
  7037. // server regardless of whether the field is empty or not. This may be
  7038. // used to include empty fields in Patch requests.
  7039. ForceSendFields []string `json:"-"`
  7040. // NullFields is a list of field names (e.g. "BatchSize") to include in
  7041. // API requests with the JSON null value. By default, fields with empty
  7042. // values are omitted from API requests. However, any field with an
  7043. // empty value appearing in NullFields will be sent to the server as
  7044. // null. It is an error if a field in this list has a non-empty value.
  7045. // This may be used to include null fields in Patch requests.
  7046. NullFields []string `json:"-"`
  7047. }
  7048. func (s *GoogleCloudVisionV1p3beta1OutputConfig) MarshalJSON() ([]byte, error) {
  7049. type NoMethod GoogleCloudVisionV1p3beta1OutputConfig
  7050. raw := NoMethod(*s)
  7051. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7052. }
  7053. // GoogleCloudVisionV1p3beta1Page: Detected page from OCR.
  7054. type GoogleCloudVisionV1p3beta1Page struct {
  7055. // Blocks: List of blocks of text, images etc on this page.
  7056. Blocks []*GoogleCloudVisionV1p3beta1Block `json:"blocks,omitempty"`
  7057. // Confidence: Confidence of the OCR results on the page. Range [0, 1].
  7058. Confidence float64 `json:"confidence,omitempty"`
  7059. // Height: Page height. For PDFs the unit is points. For images
  7060. // (including
  7061. // TIFFs) the unit is pixels.
  7062. Height int64 `json:"height,omitempty"`
  7063. // Property: Additional information detected on the page.
  7064. Property *GoogleCloudVisionV1p3beta1TextAnnotationTextProperty `json:"property,omitempty"`
  7065. // Width: Page width. For PDFs the unit is points. For images
  7066. // (including
  7067. // TIFFs) the unit is pixels.
  7068. Width int64 `json:"width,omitempty"`
  7069. // ForceSendFields is a list of field names (e.g. "Blocks") to
  7070. // unconditionally include in API requests. By default, fields with
  7071. // empty values are omitted from API requests. However, any non-pointer,
  7072. // non-interface field appearing in ForceSendFields will be sent to the
  7073. // server regardless of whether the field is empty or not. This may be
  7074. // used to include empty fields in Patch requests.
  7075. ForceSendFields []string `json:"-"`
  7076. // NullFields is a list of field names (e.g. "Blocks") to include in API
  7077. // requests with the JSON null value. By default, fields with empty
  7078. // values are omitted from API requests. However, any field with an
  7079. // empty value appearing in NullFields will be sent to the server as
  7080. // null. It is an error if a field in this list has a non-empty value.
  7081. // This may be used to include null fields in Patch requests.
  7082. NullFields []string `json:"-"`
  7083. }
  7084. func (s *GoogleCloudVisionV1p3beta1Page) MarshalJSON() ([]byte, error) {
  7085. type NoMethod GoogleCloudVisionV1p3beta1Page
  7086. raw := NoMethod(*s)
  7087. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7088. }
  7089. func (s *GoogleCloudVisionV1p3beta1Page) UnmarshalJSON(data []byte) error {
  7090. type NoMethod GoogleCloudVisionV1p3beta1Page
  7091. var s1 struct {
  7092. Confidence gensupport.JSONFloat64 `json:"confidence"`
  7093. *NoMethod
  7094. }
  7095. s1.NoMethod = (*NoMethod)(s)
  7096. if err := json.Unmarshal(data, &s1); err != nil {
  7097. return err
  7098. }
  7099. s.Confidence = float64(s1.Confidence)
  7100. return nil
  7101. }
  7102. // GoogleCloudVisionV1p3beta1Paragraph: Structural unit of text
  7103. // representing a number of words in certain order.
  7104. type GoogleCloudVisionV1p3beta1Paragraph struct {
  7105. // BoundingBox: The bounding box for the paragraph.
  7106. // The vertices are in the order of top-left, top-right,
  7107. // bottom-right,
  7108. // bottom-left. When a rotation of the bounding box is detected the
  7109. // rotation
  7110. // is represented as around the top-left corner as defined when the text
  7111. // is
  7112. // read in the 'natural' orientation.
  7113. // For example:
  7114. // * when the text is horizontal it might look like:
  7115. // 0----1
  7116. // | |
  7117. // 3----2
  7118. // * when it's rotated 180 degrees around the top-left corner it
  7119. // becomes:
  7120. // 2----3
  7121. // | |
  7122. // 1----0
  7123. // and the vertex order will still be (0, 1, 2, 3).
  7124. BoundingBox *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingBox,omitempty"`
  7125. // Confidence: Confidence of the OCR results for the paragraph. Range
  7126. // [0, 1].
  7127. Confidence float64 `json:"confidence,omitempty"`
  7128. // Property: Additional information detected for the paragraph.
  7129. Property *GoogleCloudVisionV1p3beta1TextAnnotationTextProperty `json:"property,omitempty"`
  7130. // Words: List of words in this paragraph.
  7131. Words []*GoogleCloudVisionV1p3beta1Word `json:"words,omitempty"`
  7132. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  7133. // unconditionally include in API requests. By default, fields with
  7134. // empty values are omitted from API requests. However, any non-pointer,
  7135. // non-interface field appearing in ForceSendFields will be sent to the
  7136. // server regardless of whether the field is empty or not. This may be
  7137. // used to include empty fields in Patch requests.
  7138. ForceSendFields []string `json:"-"`
  7139. // NullFields is a list of field names (e.g. "BoundingBox") to include
  7140. // in API requests with the JSON null value. By default, fields with
  7141. // empty values are omitted from API requests. However, any field with
  7142. // an empty value appearing in NullFields will be sent to the server as
  7143. // null. It is an error if a field in this list has a non-empty value.
  7144. // This may be used to include null fields in Patch requests.
  7145. NullFields []string `json:"-"`
  7146. }
  7147. func (s *GoogleCloudVisionV1p3beta1Paragraph) MarshalJSON() ([]byte, error) {
  7148. type NoMethod GoogleCloudVisionV1p3beta1Paragraph
  7149. raw := NoMethod(*s)
  7150. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7151. }
  7152. func (s *GoogleCloudVisionV1p3beta1Paragraph) UnmarshalJSON(data []byte) error {
  7153. type NoMethod GoogleCloudVisionV1p3beta1Paragraph
  7154. var s1 struct {
  7155. Confidence gensupport.JSONFloat64 `json:"confidence"`
  7156. *NoMethod
  7157. }
  7158. s1.NoMethod = (*NoMethod)(s)
  7159. if err := json.Unmarshal(data, &s1); err != nil {
  7160. return err
  7161. }
  7162. s.Confidence = float64(s1.Confidence)
  7163. return nil
  7164. }
  7165. // GoogleCloudVisionV1p3beta1Position: A 3D position in the image, used
  7166. // primarily for Face detection landmarks.
  7167. // A valid Position must have both x and y coordinates.
  7168. // The position coordinates are in the same scale as the original image.
  7169. type GoogleCloudVisionV1p3beta1Position struct {
  7170. // X: X coordinate.
  7171. X float64 `json:"x,omitempty"`
  7172. // Y: Y coordinate.
  7173. Y float64 `json:"y,omitempty"`
  7174. // Z: Z coordinate (or depth).
  7175. Z float64 `json:"z,omitempty"`
  7176. // ForceSendFields is a list of field names (e.g. "X") to
  7177. // unconditionally include in API requests. By default, fields with
  7178. // empty values are omitted from API requests. However, any non-pointer,
  7179. // non-interface field appearing in ForceSendFields will be sent to the
  7180. // server regardless of whether the field is empty or not. This may be
  7181. // used to include empty fields in Patch requests.
  7182. ForceSendFields []string `json:"-"`
  7183. // NullFields is a list of field names (e.g. "X") to include in API
  7184. // requests with the JSON null value. By default, fields with empty
  7185. // values are omitted from API requests. However, any field with an
  7186. // empty value appearing in NullFields will be sent to the server as
  7187. // null. It is an error if a field in this list has a non-empty value.
  7188. // This may be used to include null fields in Patch requests.
  7189. NullFields []string `json:"-"`
  7190. }
  7191. func (s *GoogleCloudVisionV1p3beta1Position) MarshalJSON() ([]byte, error) {
  7192. type NoMethod GoogleCloudVisionV1p3beta1Position
  7193. raw := NoMethod(*s)
  7194. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7195. }
  7196. func (s *GoogleCloudVisionV1p3beta1Position) UnmarshalJSON(data []byte) error {
  7197. type NoMethod GoogleCloudVisionV1p3beta1Position
  7198. var s1 struct {
  7199. X gensupport.JSONFloat64 `json:"x"`
  7200. Y gensupport.JSONFloat64 `json:"y"`
  7201. Z gensupport.JSONFloat64 `json:"z"`
  7202. *NoMethod
  7203. }
  7204. s1.NoMethod = (*NoMethod)(s)
  7205. if err := json.Unmarshal(data, &s1); err != nil {
  7206. return err
  7207. }
  7208. s.X = float64(s1.X)
  7209. s.Y = float64(s1.Y)
  7210. s.Z = float64(s1.Z)
  7211. return nil
  7212. }
  7213. // GoogleCloudVisionV1p3beta1Product: A Product contains
  7214. // ReferenceImages.
  7215. type GoogleCloudVisionV1p3beta1Product struct {
  7216. // Description: User-provided metadata to be stored with this product.
  7217. // Must be at most 4096
  7218. // characters long.
  7219. Description string `json:"description,omitempty"`
  7220. // DisplayName: The user-provided name for this Product. Must not be
  7221. // empty. Must be at most
  7222. // 4096 characters long.
  7223. DisplayName string `json:"displayName,omitempty"`
  7224. // Name: The resource name of the product.
  7225. //
  7226. // Format
  7227. // is:
  7228. // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
  7229. //
  7230. // This field is ignored when creating a product.
  7231. Name string `json:"name,omitempty"`
  7232. // ProductCategory: The category for the product identified by the
  7233. // reference image. This should
  7234. // be either "homegoods", "apparel", or "toys".
  7235. //
  7236. // This field is immutable.
  7237. ProductCategory string `json:"productCategory,omitempty"`
  7238. // ProductLabels: Key-value pairs that can be attached to a product. At
  7239. // query time,
  7240. // constraints can be specified based on the product_labels.
  7241. //
  7242. // Note that integer values can be provided as strings, e.g. "1199".
  7243. // Only
  7244. // strings with integer values can match a range-based restriction which
  7245. // is
  7246. // to be supported soon.
  7247. //
  7248. // Multiple values can be assigned to the same key. One product may have
  7249. // up to
  7250. // 100 product_labels.
  7251. ProductLabels []*GoogleCloudVisionV1p3beta1ProductKeyValue `json:"productLabels,omitempty"`
  7252. // ForceSendFields is a list of field names (e.g. "Description") to
  7253. // unconditionally include in API requests. By default, fields with
  7254. // empty values are omitted from API requests. However, any non-pointer,
  7255. // non-interface field appearing in ForceSendFields will be sent to the
  7256. // server regardless of whether the field is empty or not. This may be
  7257. // used to include empty fields in Patch requests.
  7258. ForceSendFields []string `json:"-"`
  7259. // NullFields is a list of field names (e.g. "Description") to include
  7260. // in API requests with the JSON null value. By default, fields with
  7261. // empty values are omitted from API requests. However, any field with
  7262. // an empty value appearing in NullFields will be sent to the server as
  7263. // null. It is an error if a field in this list has a non-empty value.
  7264. // This may be used to include null fields in Patch requests.
  7265. NullFields []string `json:"-"`
  7266. }
  7267. func (s *GoogleCloudVisionV1p3beta1Product) MarshalJSON() ([]byte, error) {
  7268. type NoMethod GoogleCloudVisionV1p3beta1Product
  7269. raw := NoMethod(*s)
  7270. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7271. }
  7272. // GoogleCloudVisionV1p3beta1ProductKeyValue: A product label
  7273. // represented as a key-value pair.
  7274. type GoogleCloudVisionV1p3beta1ProductKeyValue struct {
  7275. // Key: The key of the label attached to the product. Cannot be empty
  7276. // and cannot
  7277. // exceed 128 bytes.
  7278. Key string `json:"key,omitempty"`
  7279. // Value: The value of the label attached to the product. Cannot be
  7280. // empty and
  7281. // cannot exceed 128 bytes.
  7282. Value string `json:"value,omitempty"`
  7283. // ForceSendFields is a list of field names (e.g. "Key") to
  7284. // unconditionally include in API requests. By default, fields with
  7285. // empty values are omitted from API requests. However, any non-pointer,
  7286. // non-interface field appearing in ForceSendFields will be sent to the
  7287. // server regardless of whether the field is empty or not. This may be
  7288. // used to include empty fields in Patch requests.
  7289. ForceSendFields []string `json:"-"`
  7290. // NullFields is a list of field names (e.g. "Key") to include in API
  7291. // requests with the JSON null value. By default, fields with empty
  7292. // values are omitted from API requests. However, any field with an
  7293. // empty value appearing in NullFields will be sent to the server as
  7294. // null. It is an error if a field in this list has a non-empty value.
  7295. // This may be used to include null fields in Patch requests.
  7296. NullFields []string `json:"-"`
  7297. }
  7298. func (s *GoogleCloudVisionV1p3beta1ProductKeyValue) MarshalJSON() ([]byte, error) {
  7299. type NoMethod GoogleCloudVisionV1p3beta1ProductKeyValue
  7300. raw := NoMethod(*s)
  7301. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7302. }
  7303. // GoogleCloudVisionV1p3beta1ProductSearchResults: Results for a product
  7304. // search request.
  7305. type GoogleCloudVisionV1p3beta1ProductSearchResults struct {
  7306. // IndexTime: Timestamp of the index which provided these results.
  7307. // Changes made after
  7308. // this time are not reflected in the current results.
  7309. IndexTime string `json:"indexTime,omitempty"`
  7310. // ProductGroupedResults: List of results grouped by products detected
  7311. // in the query image. Each entry
  7312. // corresponds to one bounding polygon in the query image, and contains
  7313. // the
  7314. // matching products specific to that region. There may be duplicate
  7315. // product
  7316. // matches in the union of all the per-product results.
  7317. ProductGroupedResults []*GoogleCloudVisionV1p3beta1ProductSearchResultsGroupedResult `json:"productGroupedResults,omitempty"`
  7318. // Results: List of results, one for each product match.
  7319. Results []*GoogleCloudVisionV1p3beta1ProductSearchResultsResult `json:"results,omitempty"`
  7320. // ForceSendFields is a list of field names (e.g. "IndexTime") to
  7321. // unconditionally include in API requests. By default, fields with
  7322. // empty values are omitted from API requests. However, any non-pointer,
  7323. // non-interface field appearing in ForceSendFields will be sent to the
  7324. // server regardless of whether the field is empty or not. This may be
  7325. // used to include empty fields in Patch requests.
  7326. ForceSendFields []string `json:"-"`
  7327. // NullFields is a list of field names (e.g. "IndexTime") to include in
  7328. // API requests with the JSON null value. By default, fields with empty
  7329. // values are omitted from API requests. However, any field with an
  7330. // empty value appearing in NullFields will be sent to the server as
  7331. // null. It is an error if a field in this list has a non-empty value.
  7332. // This may be used to include null fields in Patch requests.
  7333. NullFields []string `json:"-"`
  7334. }
  7335. func (s *GoogleCloudVisionV1p3beta1ProductSearchResults) MarshalJSON() ([]byte, error) {
  7336. type NoMethod GoogleCloudVisionV1p3beta1ProductSearchResults
  7337. raw := NoMethod(*s)
  7338. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7339. }
  7340. // GoogleCloudVisionV1p3beta1ProductSearchResultsGroupedResult:
  7341. // Information about the products similar to a single product in a
  7342. // query
  7343. // image.
  7344. type GoogleCloudVisionV1p3beta1ProductSearchResultsGroupedResult struct {
  7345. // BoundingPoly: The bounding polygon around the product detected in the
  7346. // query image.
  7347. BoundingPoly *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPoly,omitempty"`
  7348. // Results: List of results, one for each product match.
  7349. Results []*GoogleCloudVisionV1p3beta1ProductSearchResultsResult `json:"results,omitempty"`
  7350. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  7351. // unconditionally include in API requests. By default, fields with
  7352. // empty values are omitted from API requests. However, any non-pointer,
  7353. // non-interface field appearing in ForceSendFields will be sent to the
  7354. // server regardless of whether the field is empty or not. This may be
  7355. // used to include empty fields in Patch requests.
  7356. ForceSendFields []string `json:"-"`
  7357. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  7358. // in API requests with the JSON null value. By default, fields with
  7359. // empty values are omitted from API requests. However, any field with
  7360. // an empty value appearing in NullFields will be sent to the server as
  7361. // null. It is an error if a field in this list has a non-empty value.
  7362. // This may be used to include null fields in Patch requests.
  7363. NullFields []string `json:"-"`
  7364. }
  7365. func (s *GoogleCloudVisionV1p3beta1ProductSearchResultsGroupedResult) MarshalJSON() ([]byte, error) {
  7366. type NoMethod GoogleCloudVisionV1p3beta1ProductSearchResultsGroupedResult
  7367. raw := NoMethod(*s)
  7368. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7369. }
  7370. // GoogleCloudVisionV1p3beta1ProductSearchResultsResult: Information
  7371. // about a product.
  7372. type GoogleCloudVisionV1p3beta1ProductSearchResultsResult struct {
  7373. // Image: The resource name of the image from the product that is the
  7374. // closest match
  7375. // to the query.
  7376. Image string `json:"image,omitempty"`
  7377. // Product: The Product.
  7378. Product *GoogleCloudVisionV1p3beta1Product `json:"product,omitempty"`
  7379. // Score: A confidence level on the match, ranging from 0 (no
  7380. // confidence) to
  7381. // 1 (full confidence).
  7382. Score float64 `json:"score,omitempty"`
  7383. // ForceSendFields is a list of field names (e.g. "Image") to
  7384. // unconditionally include in API requests. By default, fields with
  7385. // empty values are omitted from API requests. However, any non-pointer,
  7386. // non-interface field appearing in ForceSendFields will be sent to the
  7387. // server regardless of whether the field is empty or not. This may be
  7388. // used to include empty fields in Patch requests.
  7389. ForceSendFields []string `json:"-"`
  7390. // NullFields is a list of field names (e.g. "Image") to include in API
  7391. // requests with the JSON null value. By default, fields with empty
  7392. // values are omitted from API requests. However, any field with an
  7393. // empty value appearing in NullFields will be sent to the server as
  7394. // null. It is an error if a field in this list has a non-empty value.
  7395. // This may be used to include null fields in Patch requests.
  7396. NullFields []string `json:"-"`
  7397. }
  7398. func (s *GoogleCloudVisionV1p3beta1ProductSearchResultsResult) MarshalJSON() ([]byte, error) {
  7399. type NoMethod GoogleCloudVisionV1p3beta1ProductSearchResultsResult
  7400. raw := NoMethod(*s)
  7401. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7402. }
  7403. func (s *GoogleCloudVisionV1p3beta1ProductSearchResultsResult) UnmarshalJSON(data []byte) error {
  7404. type NoMethod GoogleCloudVisionV1p3beta1ProductSearchResultsResult
  7405. var s1 struct {
  7406. Score gensupport.JSONFloat64 `json:"score"`
  7407. *NoMethod
  7408. }
  7409. s1.NoMethod = (*NoMethod)(s)
  7410. if err := json.Unmarshal(data, &s1); err != nil {
  7411. return err
  7412. }
  7413. s.Score = float64(s1.Score)
  7414. return nil
  7415. }
  7416. // GoogleCloudVisionV1p3beta1Property: A `Property` consists of a
  7417. // user-supplied name/value pair.
  7418. type GoogleCloudVisionV1p3beta1Property struct {
  7419. // Name: Name of the property.
  7420. Name string `json:"name,omitempty"`
  7421. // Uint64Value: Value of numeric properties.
  7422. Uint64Value uint64 `json:"uint64Value,omitempty,string"`
  7423. // Value: Value of the property.
  7424. Value string `json:"value,omitempty"`
  7425. // ForceSendFields is a list of field names (e.g. "Name") to
  7426. // unconditionally include in API requests. By default, fields with
  7427. // empty values are omitted from API requests. However, any non-pointer,
  7428. // non-interface field appearing in ForceSendFields will be sent to the
  7429. // server regardless of whether the field is empty or not. This may be
  7430. // used to include empty fields in Patch requests.
  7431. ForceSendFields []string `json:"-"`
  7432. // NullFields is a list of field names (e.g. "Name") to include in API
  7433. // requests with the JSON null value. By default, fields with empty
  7434. // values are omitted from API requests. However, any field with an
  7435. // empty value appearing in NullFields will be sent to the server as
  7436. // null. It is an error if a field in this list has a non-empty value.
  7437. // This may be used to include null fields in Patch requests.
  7438. NullFields []string `json:"-"`
  7439. }
  7440. func (s *GoogleCloudVisionV1p3beta1Property) MarshalJSON() ([]byte, error) {
  7441. type NoMethod GoogleCloudVisionV1p3beta1Property
  7442. raw := NoMethod(*s)
  7443. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7444. }
  7445. // GoogleCloudVisionV1p3beta1ReferenceImage: A `ReferenceImage`
  7446. // represents a product image and its associated metadata,
  7447. // such as bounding boxes.
  7448. type GoogleCloudVisionV1p3beta1ReferenceImage struct {
  7449. // BoundingPolys: Bounding polygons around the areas of interest in the
  7450. // reference image.
  7451. // Optional. If this field is empty, the system will try to detect
  7452. // regions of
  7453. // interest. At most 10 bounding polygons will be used.
  7454. //
  7455. // The provided shape is converted into a non-rotated rectangle.
  7456. // Once
  7457. // converted, the small edge of the rectangle must be greater than or
  7458. // equal
  7459. // to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok;
  7460. // 1:5
  7461. // is not).
  7462. BoundingPolys []*GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingPolys,omitempty"`
  7463. // Name: The resource name of the reference image.
  7464. //
  7465. // Format
  7466. // is:
  7467. //
  7468. // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referen
  7469. // ceImages/IMAGE_ID`.
  7470. //
  7471. // This field is ignored when creating a reference image.
  7472. Name string `json:"name,omitempty"`
  7473. // Uri: The Google Cloud Storage URI of the reference image.
  7474. //
  7475. // The URI must start with `gs://`.
  7476. //
  7477. // Required.
  7478. Uri string `json:"uri,omitempty"`
  7479. // ForceSendFields is a list of field names (e.g. "BoundingPolys") to
  7480. // unconditionally include in API requests. By default, fields with
  7481. // empty values are omitted from API requests. However, any non-pointer,
  7482. // non-interface field appearing in ForceSendFields will be sent to the
  7483. // server regardless of whether the field is empty or not. This may be
  7484. // used to include empty fields in Patch requests.
  7485. ForceSendFields []string `json:"-"`
  7486. // NullFields is a list of field names (e.g. "BoundingPolys") to include
  7487. // in API requests with the JSON null value. By default, fields with
  7488. // empty values are omitted from API requests. However, any field with
  7489. // an empty value appearing in NullFields will be sent to the server as
  7490. // null. It is an error if a field in this list has a non-empty value.
  7491. // This may be used to include null fields in Patch requests.
  7492. NullFields []string `json:"-"`
  7493. }
  7494. func (s *GoogleCloudVisionV1p3beta1ReferenceImage) MarshalJSON() ([]byte, error) {
  7495. type NoMethod GoogleCloudVisionV1p3beta1ReferenceImage
  7496. raw := NoMethod(*s)
  7497. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7498. }
  7499. // GoogleCloudVisionV1p3beta1SafeSearchAnnotation: Set of features
  7500. // pertaining to the image, computed by computer vision
  7501. // methods over safe-search verticals (for example, adult, spoof,
  7502. // medical,
  7503. // violence).
  7504. type GoogleCloudVisionV1p3beta1SafeSearchAnnotation struct {
  7505. // Adult: Represents the adult content likelihood for the image. Adult
  7506. // content may
  7507. // contain elements such as nudity, pornographic images or cartoons,
  7508. // or
  7509. // sexual activities.
  7510. //
  7511. // Possible values:
  7512. // "UNKNOWN" - Unknown likelihood.
  7513. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  7514. // specified vertical.
  7515. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  7516. // vertical.
  7517. // "POSSIBLE" - It is possible that the image belongs to the specified
  7518. // vertical.
  7519. // "LIKELY" - It is likely that the image belongs to the specified
  7520. // vertical.
  7521. // "VERY_LIKELY" - It is very likely that the image belongs to the
  7522. // specified vertical.
  7523. Adult string `json:"adult,omitempty"`
  7524. // Medical: Likelihood that this is a medical image.
  7525. //
  7526. // Possible values:
  7527. // "UNKNOWN" - Unknown likelihood.
  7528. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  7529. // specified vertical.
  7530. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  7531. // vertical.
  7532. // "POSSIBLE" - It is possible that the image belongs to the specified
  7533. // vertical.
  7534. // "LIKELY" - It is likely that the image belongs to the specified
  7535. // vertical.
  7536. // "VERY_LIKELY" - It is very likely that the image belongs to the
  7537. // specified vertical.
  7538. Medical string `json:"medical,omitempty"`
  7539. // Racy: Likelihood that the request image contains racy content. Racy
  7540. // content may
  7541. // include (but is not limited to) skimpy or sheer clothing,
  7542. // strategically
  7543. // covered nudity, lewd or provocative poses, or close-ups of
  7544. // sensitive
  7545. // body areas.
  7546. //
  7547. // Possible values:
  7548. // "UNKNOWN" - Unknown likelihood.
  7549. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  7550. // specified vertical.
  7551. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  7552. // vertical.
  7553. // "POSSIBLE" - It is possible that the image belongs to the specified
  7554. // vertical.
  7555. // "LIKELY" - It is likely that the image belongs to the specified
  7556. // vertical.
  7557. // "VERY_LIKELY" - It is very likely that the image belongs to the
  7558. // specified vertical.
  7559. Racy string `json:"racy,omitempty"`
  7560. // Spoof: Spoof likelihood. The likelihood that an modification
  7561. // was made to the image's canonical version to make it appear
  7562. // funny or offensive.
  7563. //
  7564. // Possible values:
  7565. // "UNKNOWN" - Unknown likelihood.
  7566. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  7567. // specified vertical.
  7568. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  7569. // vertical.
  7570. // "POSSIBLE" - It is possible that the image belongs to the specified
  7571. // vertical.
  7572. // "LIKELY" - It is likely that the image belongs to the specified
  7573. // vertical.
  7574. // "VERY_LIKELY" - It is very likely that the image belongs to the
  7575. // specified vertical.
  7576. Spoof string `json:"spoof,omitempty"`
  7577. // Violence: Likelihood that this image contains violent content.
  7578. //
  7579. // Possible values:
  7580. // "UNKNOWN" - Unknown likelihood.
  7581. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  7582. // specified vertical.
  7583. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  7584. // vertical.
  7585. // "POSSIBLE" - It is possible that the image belongs to the specified
  7586. // vertical.
  7587. // "LIKELY" - It is likely that the image belongs to the specified
  7588. // vertical.
  7589. // "VERY_LIKELY" - It is very likely that the image belongs to the
  7590. // specified vertical.
  7591. Violence string `json:"violence,omitempty"`
  7592. // ForceSendFields is a list of field names (e.g. "Adult") to
  7593. // unconditionally include in API requests. By default, fields with
  7594. // empty values are omitted from API requests. However, any non-pointer,
  7595. // non-interface field appearing in ForceSendFields will be sent to the
  7596. // server regardless of whether the field is empty or not. This may be
  7597. // used to include empty fields in Patch requests.
  7598. ForceSendFields []string `json:"-"`
  7599. // NullFields is a list of field names (e.g. "Adult") to include in API
  7600. // requests with the JSON null value. By default, fields with empty
  7601. // values are omitted from API requests. However, any field with an
  7602. // empty value appearing in NullFields will be sent to the server as
  7603. // null. It is an error if a field in this list has a non-empty value.
  7604. // This may be used to include null fields in Patch requests.
  7605. NullFields []string `json:"-"`
  7606. }
  7607. func (s *GoogleCloudVisionV1p3beta1SafeSearchAnnotation) MarshalJSON() ([]byte, error) {
  7608. type NoMethod GoogleCloudVisionV1p3beta1SafeSearchAnnotation
  7609. raw := NoMethod(*s)
  7610. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7611. }
  7612. // GoogleCloudVisionV1p3beta1Symbol: A single symbol representation.
  7613. type GoogleCloudVisionV1p3beta1Symbol struct {
  7614. // BoundingBox: The bounding box for the symbol.
  7615. // The vertices are in the order of top-left, top-right,
  7616. // bottom-right,
  7617. // bottom-left. When a rotation of the bounding box is detected the
  7618. // rotation
  7619. // is represented as around the top-left corner as defined when the text
  7620. // is
  7621. // read in the 'natural' orientation.
  7622. // For example:
  7623. // * when the text is horizontal it might look like:
  7624. // 0----1
  7625. // | |
  7626. // 3----2
  7627. // * when it's rotated 180 degrees around the top-left corner it
  7628. // becomes:
  7629. // 2----3
  7630. // | |
  7631. // 1----0
  7632. // and the vertice order will still be (0, 1, 2, 3).
  7633. BoundingBox *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingBox,omitempty"`
  7634. // Confidence: Confidence of the OCR results for the symbol. Range [0,
  7635. // 1].
  7636. Confidence float64 `json:"confidence,omitempty"`
  7637. // Property: Additional information detected for the symbol.
  7638. Property *GoogleCloudVisionV1p3beta1TextAnnotationTextProperty `json:"property,omitempty"`
  7639. // Text: The actual UTF-8 representation of the symbol.
  7640. Text string `json:"text,omitempty"`
  7641. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  7642. // unconditionally include in API requests. By default, fields with
  7643. // empty values are omitted from API requests. However, any non-pointer,
  7644. // non-interface field appearing in ForceSendFields will be sent to the
  7645. // server regardless of whether the field is empty or not. This may be
  7646. // used to include empty fields in Patch requests.
  7647. ForceSendFields []string `json:"-"`
  7648. // NullFields is a list of field names (e.g. "BoundingBox") to include
  7649. // in API requests with the JSON null value. By default, fields with
  7650. // empty values are omitted from API requests. However, any field with
  7651. // an empty value appearing in NullFields will be sent to the server as
  7652. // null. It is an error if a field in this list has a non-empty value.
  7653. // This may be used to include null fields in Patch requests.
  7654. NullFields []string `json:"-"`
  7655. }
  7656. func (s *GoogleCloudVisionV1p3beta1Symbol) MarshalJSON() ([]byte, error) {
  7657. type NoMethod GoogleCloudVisionV1p3beta1Symbol
  7658. raw := NoMethod(*s)
  7659. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7660. }
  7661. func (s *GoogleCloudVisionV1p3beta1Symbol) UnmarshalJSON(data []byte) error {
  7662. type NoMethod GoogleCloudVisionV1p3beta1Symbol
  7663. var s1 struct {
  7664. Confidence gensupport.JSONFloat64 `json:"confidence"`
  7665. *NoMethod
  7666. }
  7667. s1.NoMethod = (*NoMethod)(s)
  7668. if err := json.Unmarshal(data, &s1); err != nil {
  7669. return err
  7670. }
  7671. s.Confidence = float64(s1.Confidence)
  7672. return nil
  7673. }
  7674. // GoogleCloudVisionV1p3beta1TextAnnotation: TextAnnotation contains a
  7675. // structured representation of OCR extracted text.
  7676. // The hierarchy of an OCR extracted text structure is like this:
  7677. // TextAnnotation -> Page -> Block -> Paragraph -> Word ->
  7678. // Symbol
  7679. // Each structural component, starting from Page, may further have their
  7680. // own
  7681. // properties. Properties describe detected languages, breaks etc..
  7682. // Please refer
  7683. // to the TextAnnotation.TextProperty message definition below for
  7684. // more
  7685. // detail.
  7686. type GoogleCloudVisionV1p3beta1TextAnnotation struct {
  7687. // Pages: List of pages detected by OCR.
  7688. Pages []*GoogleCloudVisionV1p3beta1Page `json:"pages,omitempty"`
  7689. // Text: UTF-8 text detected on the pages.
  7690. Text string `json:"text,omitempty"`
  7691. // ForceSendFields is a list of field names (e.g. "Pages") to
  7692. // unconditionally include in API requests. By default, fields with
  7693. // empty values are omitted from API requests. However, any non-pointer,
  7694. // non-interface field appearing in ForceSendFields will be sent to the
  7695. // server regardless of whether the field is empty or not. This may be
  7696. // used to include empty fields in Patch requests.
  7697. ForceSendFields []string `json:"-"`
  7698. // NullFields is a list of field names (e.g. "Pages") to include in API
  7699. // requests with the JSON null value. By default, fields with empty
  7700. // values are omitted from API requests. However, any field with an
  7701. // empty value appearing in NullFields will be sent to the server as
  7702. // null. It is an error if a field in this list has a non-empty value.
  7703. // This may be used to include null fields in Patch requests.
  7704. NullFields []string `json:"-"`
  7705. }
  7706. func (s *GoogleCloudVisionV1p3beta1TextAnnotation) MarshalJSON() ([]byte, error) {
  7707. type NoMethod GoogleCloudVisionV1p3beta1TextAnnotation
  7708. raw := NoMethod(*s)
  7709. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7710. }
  7711. // GoogleCloudVisionV1p3beta1TextAnnotationDetectedBreak: Detected start
  7712. // or end of a structural component.
  7713. type GoogleCloudVisionV1p3beta1TextAnnotationDetectedBreak struct {
  7714. // IsPrefix: True if break prepends the element.
  7715. IsPrefix bool `json:"isPrefix,omitempty"`
  7716. // Type: Detected break type.
  7717. //
  7718. // Possible values:
  7719. // "UNKNOWN" - Unknown break label type.
  7720. // "SPACE" - Regular space.
  7721. // "SURE_SPACE" - Sure space (very wide).
  7722. // "EOL_SURE_SPACE" - Line-wrapping break.
  7723. // "HYPHEN" - End-line hyphen that is not present in text; does not
  7724. // co-occur with
  7725. // `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`.
  7726. // "LINE_BREAK" - Line break that ends a paragraph.
  7727. Type string `json:"type,omitempty"`
  7728. // ForceSendFields is a list of field names (e.g. "IsPrefix") to
  7729. // unconditionally include in API requests. By default, fields with
  7730. // empty values are omitted from API requests. However, any non-pointer,
  7731. // non-interface field appearing in ForceSendFields will be sent to the
  7732. // server regardless of whether the field is empty or not. This may be
  7733. // used to include empty fields in Patch requests.
  7734. ForceSendFields []string `json:"-"`
  7735. // NullFields is a list of field names (e.g. "IsPrefix") to include in
  7736. // API requests with the JSON null value. By default, fields with empty
  7737. // values are omitted from API requests. However, any field with an
  7738. // empty value appearing in NullFields will be sent to the server as
  7739. // null. It is an error if a field in this list has a non-empty value.
  7740. // This may be used to include null fields in Patch requests.
  7741. NullFields []string `json:"-"`
  7742. }
  7743. func (s *GoogleCloudVisionV1p3beta1TextAnnotationDetectedBreak) MarshalJSON() ([]byte, error) {
  7744. type NoMethod GoogleCloudVisionV1p3beta1TextAnnotationDetectedBreak
  7745. raw := NoMethod(*s)
  7746. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7747. }
  7748. // GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage: Detected
  7749. // language for a structural component.
  7750. type GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage struct {
  7751. // Confidence: Confidence of detected language. Range [0, 1].
  7752. Confidence float64 `json:"confidence,omitempty"`
  7753. // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn".
  7754. // For more
  7755. // information,
  7756. // see
  7757. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  7758. LanguageCode string `json:"languageCode,omitempty"`
  7759. // ForceSendFields is a list of field names (e.g. "Confidence") to
  7760. // unconditionally include in API requests. By default, fields with
  7761. // empty values are omitted from API requests. However, any non-pointer,
  7762. // non-interface field appearing in ForceSendFields will be sent to the
  7763. // server regardless of whether the field is empty or not. This may be
  7764. // used to include empty fields in Patch requests.
  7765. ForceSendFields []string `json:"-"`
  7766. // NullFields is a list of field names (e.g. "Confidence") to include in
  7767. // API requests with the JSON null value. By default, fields with empty
  7768. // values are omitted from API requests. However, any field with an
  7769. // empty value appearing in NullFields will be sent to the server as
  7770. // null. It is an error if a field in this list has a non-empty value.
  7771. // This may be used to include null fields in Patch requests.
  7772. NullFields []string `json:"-"`
  7773. }
  7774. func (s *GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage) MarshalJSON() ([]byte, error) {
  7775. type NoMethod GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage
  7776. raw := NoMethod(*s)
  7777. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7778. }
  7779. func (s *GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage) UnmarshalJSON(data []byte) error {
  7780. type NoMethod GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage
  7781. var s1 struct {
  7782. Confidence gensupport.JSONFloat64 `json:"confidence"`
  7783. *NoMethod
  7784. }
  7785. s1.NoMethod = (*NoMethod)(s)
  7786. if err := json.Unmarshal(data, &s1); err != nil {
  7787. return err
  7788. }
  7789. s.Confidence = float64(s1.Confidence)
  7790. return nil
  7791. }
  7792. // GoogleCloudVisionV1p3beta1TextAnnotationTextProperty: Additional
  7793. // information detected on the structural component.
  7794. type GoogleCloudVisionV1p3beta1TextAnnotationTextProperty struct {
  7795. // DetectedBreak: Detected start or end of a text segment.
  7796. DetectedBreak *GoogleCloudVisionV1p3beta1TextAnnotationDetectedBreak `json:"detectedBreak,omitempty"`
  7797. // DetectedLanguages: A list of detected languages together with
  7798. // confidence.
  7799. DetectedLanguages []*GoogleCloudVisionV1p3beta1TextAnnotationDetectedLanguage `json:"detectedLanguages,omitempty"`
  7800. // ForceSendFields is a list of field names (e.g. "DetectedBreak") to
  7801. // unconditionally include in API requests. By default, fields with
  7802. // empty values are omitted from API requests. However, any non-pointer,
  7803. // non-interface field appearing in ForceSendFields will be sent to the
  7804. // server regardless of whether the field is empty or not. This may be
  7805. // used to include empty fields in Patch requests.
  7806. ForceSendFields []string `json:"-"`
  7807. // NullFields is a list of field names (e.g. "DetectedBreak") to include
  7808. // in API requests with the JSON null value. By default, fields with
  7809. // empty values are omitted from API requests. However, any field with
  7810. // an empty value appearing in NullFields will be sent to the server as
  7811. // null. It is an error if a field in this list has a non-empty value.
  7812. // This may be used to include null fields in Patch requests.
  7813. NullFields []string `json:"-"`
  7814. }
  7815. func (s *GoogleCloudVisionV1p3beta1TextAnnotationTextProperty) MarshalJSON() ([]byte, error) {
  7816. type NoMethod GoogleCloudVisionV1p3beta1TextAnnotationTextProperty
  7817. raw := NoMethod(*s)
  7818. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7819. }
  7820. // GoogleCloudVisionV1p3beta1Vertex: A vertex represents a 2D point in
  7821. // the image.
  7822. // NOTE: the vertex coordinates are in the same scale as the original
  7823. // image.
  7824. type GoogleCloudVisionV1p3beta1Vertex struct {
  7825. // X: X coordinate.
  7826. X int64 `json:"x,omitempty"`
  7827. // Y: Y coordinate.
  7828. Y int64 `json:"y,omitempty"`
  7829. // ForceSendFields is a list of field names (e.g. "X") to
  7830. // unconditionally include in API requests. By default, fields with
  7831. // empty values are omitted from API requests. However, any non-pointer,
  7832. // non-interface field appearing in ForceSendFields will be sent to the
  7833. // server regardless of whether the field is empty or not. This may be
  7834. // used to include empty fields in Patch requests.
  7835. ForceSendFields []string `json:"-"`
  7836. // NullFields is a list of field names (e.g. "X") to include in API
  7837. // requests with the JSON null value. By default, fields with empty
  7838. // values are omitted from API requests. However, any field with an
  7839. // empty value appearing in NullFields will be sent to the server as
  7840. // null. It is an error if a field in this list has a non-empty value.
  7841. // This may be used to include null fields in Patch requests.
  7842. NullFields []string `json:"-"`
  7843. }
  7844. func (s *GoogleCloudVisionV1p3beta1Vertex) MarshalJSON() ([]byte, error) {
  7845. type NoMethod GoogleCloudVisionV1p3beta1Vertex
  7846. raw := NoMethod(*s)
  7847. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7848. }
  7849. // GoogleCloudVisionV1p3beta1WebDetection: Relevant information for the
  7850. // image from the Internet.
  7851. type GoogleCloudVisionV1p3beta1WebDetection struct {
  7852. // BestGuessLabels: The service's best guess as to the topic of the
  7853. // request image.
  7854. // Inferred from similar images on the open web.
  7855. BestGuessLabels []*GoogleCloudVisionV1p3beta1WebDetectionWebLabel `json:"bestGuessLabels,omitempty"`
  7856. // FullMatchingImages: Fully matching images from the Internet.
  7857. // Can include resized copies of the query image.
  7858. FullMatchingImages []*GoogleCloudVisionV1p3beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"`
  7859. // PagesWithMatchingImages: Web pages containing the matching images
  7860. // from the Internet.
  7861. PagesWithMatchingImages []*GoogleCloudVisionV1p3beta1WebDetectionWebPage `json:"pagesWithMatchingImages,omitempty"`
  7862. // PartialMatchingImages: Partial matching images from the
  7863. // Internet.
  7864. // Those images are similar enough to share some key-point features.
  7865. // For
  7866. // example an original image will likely have partial matching for its
  7867. // crops.
  7868. PartialMatchingImages []*GoogleCloudVisionV1p3beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"`
  7869. // VisuallySimilarImages: The visually similar image results.
  7870. VisuallySimilarImages []*GoogleCloudVisionV1p3beta1WebDetectionWebImage `json:"visuallySimilarImages,omitempty"`
  7871. // WebEntities: Deduced entities from similar images on the Internet.
  7872. WebEntities []*GoogleCloudVisionV1p3beta1WebDetectionWebEntity `json:"webEntities,omitempty"`
  7873. // ForceSendFields is a list of field names (e.g. "BestGuessLabels") to
  7874. // unconditionally include in API requests. By default, fields with
  7875. // empty values are omitted from API requests. However, any non-pointer,
  7876. // non-interface field appearing in ForceSendFields will be sent to the
  7877. // server regardless of whether the field is empty or not. This may be
  7878. // used to include empty fields in Patch requests.
  7879. ForceSendFields []string `json:"-"`
  7880. // NullFields is a list of field names (e.g. "BestGuessLabels") to
  7881. // include in API requests with the JSON null value. By default, fields
  7882. // with empty values are omitted from API requests. However, any field
  7883. // with an empty value appearing in NullFields will be sent to the
  7884. // server as null. It is an error if a field in this list has a
  7885. // non-empty value. This may be used to include null fields in Patch
  7886. // requests.
  7887. NullFields []string `json:"-"`
  7888. }
  7889. func (s *GoogleCloudVisionV1p3beta1WebDetection) MarshalJSON() ([]byte, error) {
  7890. type NoMethod GoogleCloudVisionV1p3beta1WebDetection
  7891. raw := NoMethod(*s)
  7892. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7893. }
  7894. // GoogleCloudVisionV1p3beta1WebDetectionWebEntity: Entity deduced from
  7895. // similar images on the Internet.
  7896. type GoogleCloudVisionV1p3beta1WebDetectionWebEntity struct {
  7897. // Description: Canonical description of the entity, in English.
  7898. Description string `json:"description,omitempty"`
  7899. // EntityId: Opaque entity ID.
  7900. EntityId string `json:"entityId,omitempty"`
  7901. // Score: Overall relevancy score for the entity.
  7902. // Not normalized and not comparable across different image queries.
  7903. Score float64 `json:"score,omitempty"`
  7904. // ForceSendFields is a list of field names (e.g. "Description") to
  7905. // unconditionally include in API requests. By default, fields with
  7906. // empty values are omitted from API requests. However, any non-pointer,
  7907. // non-interface field appearing in ForceSendFields will be sent to the
  7908. // server regardless of whether the field is empty or not. This may be
  7909. // used to include empty fields in Patch requests.
  7910. ForceSendFields []string `json:"-"`
  7911. // NullFields is a list of field names (e.g. "Description") to include
  7912. // in API requests with the JSON null value. By default, fields with
  7913. // empty values are omitted from API requests. However, any field with
  7914. // an empty value appearing in NullFields will be sent to the server as
  7915. // null. It is an error if a field in this list has a non-empty value.
  7916. // This may be used to include null fields in Patch requests.
  7917. NullFields []string `json:"-"`
  7918. }
  7919. func (s *GoogleCloudVisionV1p3beta1WebDetectionWebEntity) MarshalJSON() ([]byte, error) {
  7920. type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebEntity
  7921. raw := NoMethod(*s)
  7922. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7923. }
  7924. func (s *GoogleCloudVisionV1p3beta1WebDetectionWebEntity) UnmarshalJSON(data []byte) error {
  7925. type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebEntity
  7926. var s1 struct {
  7927. Score gensupport.JSONFloat64 `json:"score"`
  7928. *NoMethod
  7929. }
  7930. s1.NoMethod = (*NoMethod)(s)
  7931. if err := json.Unmarshal(data, &s1); err != nil {
  7932. return err
  7933. }
  7934. s.Score = float64(s1.Score)
  7935. return nil
  7936. }
  7937. // GoogleCloudVisionV1p3beta1WebDetectionWebImage: Metadata for online
  7938. // images.
  7939. type GoogleCloudVisionV1p3beta1WebDetectionWebImage struct {
  7940. // Score: (Deprecated) Overall relevancy score for the image.
  7941. Score float64 `json:"score,omitempty"`
  7942. // Url: The result image URL.
  7943. Url string `json:"url,omitempty"`
  7944. // ForceSendFields is a list of field names (e.g. "Score") to
  7945. // unconditionally include in API requests. By default, fields with
  7946. // empty values are omitted from API requests. However, any non-pointer,
  7947. // non-interface field appearing in ForceSendFields will be sent to the
  7948. // server regardless of whether the field is empty or not. This may be
  7949. // used to include empty fields in Patch requests.
  7950. ForceSendFields []string `json:"-"`
  7951. // NullFields is a list of field names (e.g. "Score") to include in API
  7952. // requests with the JSON null value. By default, fields with empty
  7953. // values are omitted from API requests. However, any field with an
  7954. // empty value appearing in NullFields will be sent to the server as
  7955. // null. It is an error if a field in this list has a non-empty value.
  7956. // This may be used to include null fields in Patch requests.
  7957. NullFields []string `json:"-"`
  7958. }
  7959. func (s *GoogleCloudVisionV1p3beta1WebDetectionWebImage) MarshalJSON() ([]byte, error) {
  7960. type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebImage
  7961. raw := NoMethod(*s)
  7962. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7963. }
  7964. func (s *GoogleCloudVisionV1p3beta1WebDetectionWebImage) UnmarshalJSON(data []byte) error {
  7965. type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebImage
  7966. var s1 struct {
  7967. Score gensupport.JSONFloat64 `json:"score"`
  7968. *NoMethod
  7969. }
  7970. s1.NoMethod = (*NoMethod)(s)
  7971. if err := json.Unmarshal(data, &s1); err != nil {
  7972. return err
  7973. }
  7974. s.Score = float64(s1.Score)
  7975. return nil
  7976. }
  7977. // GoogleCloudVisionV1p3beta1WebDetectionWebLabel: Label to provide
  7978. // extra metadata for the web detection.
  7979. type GoogleCloudVisionV1p3beta1WebDetectionWebLabel struct {
  7980. // Label: Label for extra metadata.
  7981. Label string `json:"label,omitempty"`
  7982. // LanguageCode: The BCP-47 language code for `label`, such as "en-US"
  7983. // or "sr-Latn".
  7984. // For more information,
  7985. // see
  7986. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  7987. LanguageCode string `json:"languageCode,omitempty"`
  7988. // ForceSendFields is a list of field names (e.g. "Label") to
  7989. // unconditionally include in API requests. By default, fields with
  7990. // empty values are omitted from API requests. However, any non-pointer,
  7991. // non-interface field appearing in ForceSendFields will be sent to the
  7992. // server regardless of whether the field is empty or not. This may be
  7993. // used to include empty fields in Patch requests.
  7994. ForceSendFields []string `json:"-"`
  7995. // NullFields is a list of field names (e.g. "Label") to include in API
  7996. // requests with the JSON null value. By default, fields with empty
  7997. // values are omitted from API requests. However, any field with an
  7998. // empty value appearing in NullFields will be sent to the server as
  7999. // null. It is an error if a field in this list has a non-empty value.
  8000. // This may be used to include null fields in Patch requests.
  8001. NullFields []string `json:"-"`
  8002. }
  8003. func (s *GoogleCloudVisionV1p3beta1WebDetectionWebLabel) MarshalJSON() ([]byte, error) {
  8004. type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebLabel
  8005. raw := NoMethod(*s)
  8006. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8007. }
  8008. // GoogleCloudVisionV1p3beta1WebDetectionWebPage: Metadata for web
  8009. // pages.
  8010. type GoogleCloudVisionV1p3beta1WebDetectionWebPage struct {
  8011. // FullMatchingImages: Fully matching images on the page.
  8012. // Can include resized copies of the query image.
  8013. FullMatchingImages []*GoogleCloudVisionV1p3beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"`
  8014. // PageTitle: Title for the web page, may contain HTML markups.
  8015. PageTitle string `json:"pageTitle,omitempty"`
  8016. // PartialMatchingImages: Partial matching images on the page.
  8017. // Those images are similar enough to share some key-point features.
  8018. // For
  8019. // example an original image will likely have partial matching for
  8020. // its
  8021. // crops.
  8022. PartialMatchingImages []*GoogleCloudVisionV1p3beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"`
  8023. // Score: (Deprecated) Overall relevancy score for the web page.
  8024. Score float64 `json:"score,omitempty"`
  8025. // Url: The result web page URL.
  8026. Url string `json:"url,omitempty"`
  8027. // ForceSendFields is a list of field names (e.g. "FullMatchingImages")
  8028. // to unconditionally include in API requests. By default, fields with
  8029. // empty values are omitted from API requests. However, any non-pointer,
  8030. // non-interface field appearing in ForceSendFields will be sent to the
  8031. // server regardless of whether the field is empty or not. This may be
  8032. // used to include empty fields in Patch requests.
  8033. ForceSendFields []string `json:"-"`
  8034. // NullFields is a list of field names (e.g. "FullMatchingImages") to
  8035. // include in API requests with the JSON null value. By default, fields
  8036. // with empty values are omitted from API requests. However, any field
  8037. // with an empty value appearing in NullFields will be sent to the
  8038. // server as null. It is an error if a field in this list has a
  8039. // non-empty value. This may be used to include null fields in Patch
  8040. // requests.
  8041. NullFields []string `json:"-"`
  8042. }
  8043. func (s *GoogleCloudVisionV1p3beta1WebDetectionWebPage) MarshalJSON() ([]byte, error) {
  8044. type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebPage
  8045. raw := NoMethod(*s)
  8046. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8047. }
  8048. func (s *GoogleCloudVisionV1p3beta1WebDetectionWebPage) UnmarshalJSON(data []byte) error {
  8049. type NoMethod GoogleCloudVisionV1p3beta1WebDetectionWebPage
  8050. var s1 struct {
  8051. Score gensupport.JSONFloat64 `json:"score"`
  8052. *NoMethod
  8053. }
  8054. s1.NoMethod = (*NoMethod)(s)
  8055. if err := json.Unmarshal(data, &s1); err != nil {
  8056. return err
  8057. }
  8058. s.Score = float64(s1.Score)
  8059. return nil
  8060. }
  8061. // GoogleCloudVisionV1p3beta1Word: A word representation.
  8062. type GoogleCloudVisionV1p3beta1Word struct {
  8063. // BoundingBox: The bounding box for the word.
  8064. // The vertices are in the order of top-left, top-right,
  8065. // bottom-right,
  8066. // bottom-left. When a rotation of the bounding box is detected the
  8067. // rotation
  8068. // is represented as around the top-left corner as defined when the text
  8069. // is
  8070. // read in the 'natural' orientation.
  8071. // For example:
  8072. // * when the text is horizontal it might look like:
  8073. // 0----1
  8074. // | |
  8075. // 3----2
  8076. // * when it's rotated 180 degrees around the top-left corner it
  8077. // becomes:
  8078. // 2----3
  8079. // | |
  8080. // 1----0
  8081. // and the vertex order will still be (0, 1, 2, 3).
  8082. BoundingBox *GoogleCloudVisionV1p3beta1BoundingPoly `json:"boundingBox,omitempty"`
  8083. // Confidence: Confidence of the OCR results for the word. Range [0, 1].
  8084. Confidence float64 `json:"confidence,omitempty"`
  8085. // Property: Additional information detected for the word.
  8086. Property *GoogleCloudVisionV1p3beta1TextAnnotationTextProperty `json:"property,omitempty"`
  8087. // Symbols: List of symbols in the word.
  8088. // The order of the symbols follows the natural reading order.
  8089. Symbols []*GoogleCloudVisionV1p3beta1Symbol `json:"symbols,omitempty"`
  8090. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  8091. // unconditionally include in API requests. By default, fields with
  8092. // empty values are omitted from API requests. However, any non-pointer,
  8093. // non-interface field appearing in ForceSendFields will be sent to the
  8094. // server regardless of whether the field is empty or not. This may be
  8095. // used to include empty fields in Patch requests.
  8096. ForceSendFields []string `json:"-"`
  8097. // NullFields is a list of field names (e.g. "BoundingBox") to include
  8098. // in API requests with the JSON null value. By default, fields with
  8099. // empty values are omitted from API requests. However, any field with
  8100. // an empty value appearing in NullFields will be sent to the server as
  8101. // null. It is an error if a field in this list has a non-empty value.
  8102. // This may be used to include null fields in Patch requests.
  8103. NullFields []string `json:"-"`
  8104. }
  8105. func (s *GoogleCloudVisionV1p3beta1Word) MarshalJSON() ([]byte, error) {
  8106. type NoMethod GoogleCloudVisionV1p3beta1Word
  8107. raw := NoMethod(*s)
  8108. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8109. }
  8110. func (s *GoogleCloudVisionV1p3beta1Word) UnmarshalJSON(data []byte) error {
  8111. type NoMethod GoogleCloudVisionV1p3beta1Word
  8112. var s1 struct {
  8113. Confidence gensupport.JSONFloat64 `json:"confidence"`
  8114. *NoMethod
  8115. }
  8116. s1.NoMethod = (*NoMethod)(s)
  8117. if err := json.Unmarshal(data, &s1); err != nil {
  8118. return err
  8119. }
  8120. s.Confidence = float64(s1.Confidence)
  8121. return nil
  8122. }
  8123. // GoogleCloudVisionV1p4beta1AnnotateFileResponse: Response to a single
  8124. // file annotation request. A file may contain one or more
  8125. // images, which individually have their own responses.
  8126. type GoogleCloudVisionV1p4beta1AnnotateFileResponse struct {
  8127. // InputConfig: Information about the file for which this response is
  8128. // generated.
  8129. InputConfig *GoogleCloudVisionV1p4beta1InputConfig `json:"inputConfig,omitempty"`
  8130. // Responses: Individual responses to images found within the file.
  8131. Responses []*GoogleCloudVisionV1p4beta1AnnotateImageResponse `json:"responses,omitempty"`
  8132. // TotalPages: This field gives the total number of pages in the file.
  8133. TotalPages int64 `json:"totalPages,omitempty"`
  8134. // ForceSendFields is a list of field names (e.g. "InputConfig") to
  8135. // unconditionally include in API requests. By default, fields with
  8136. // empty values are omitted from API requests. However, any non-pointer,
  8137. // non-interface field appearing in ForceSendFields will be sent to the
  8138. // server regardless of whether the field is empty or not. This may be
  8139. // used to include empty fields in Patch requests.
  8140. ForceSendFields []string `json:"-"`
  8141. // NullFields is a list of field names (e.g. "InputConfig") to include
  8142. // in API requests with the JSON null value. By default, fields with
  8143. // empty values are omitted from API requests. However, any field with
  8144. // an empty value appearing in NullFields will be sent to the server as
  8145. // null. It is an error if a field in this list has a non-empty value.
  8146. // This may be used to include null fields in Patch requests.
  8147. NullFields []string `json:"-"`
  8148. }
  8149. func (s *GoogleCloudVisionV1p4beta1AnnotateFileResponse) MarshalJSON() ([]byte, error) {
  8150. type NoMethod GoogleCloudVisionV1p4beta1AnnotateFileResponse
  8151. raw := NoMethod(*s)
  8152. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8153. }
  8154. // GoogleCloudVisionV1p4beta1AnnotateImageResponse: Response to an image
  8155. // annotation request.
  8156. type GoogleCloudVisionV1p4beta1AnnotateImageResponse struct {
  8157. // Context: If present, contextual information is needed to understand
  8158. // where this image
  8159. // comes from.
  8160. Context *GoogleCloudVisionV1p4beta1ImageAnnotationContext `json:"context,omitempty"`
  8161. // CropHintsAnnotation: If present, crop hints have completed
  8162. // successfully.
  8163. CropHintsAnnotation *GoogleCloudVisionV1p4beta1CropHintsAnnotation `json:"cropHintsAnnotation,omitempty"`
  8164. // Error: If set, represents the error message for the operation.
  8165. // Note that filled-in image annotations are guaranteed to be
  8166. // correct, even when `error` is set.
  8167. Error *Status `json:"error,omitempty"`
  8168. // FaceAnnotations: If present, face detection has completed
  8169. // successfully.
  8170. FaceAnnotations []*GoogleCloudVisionV1p4beta1FaceAnnotation `json:"faceAnnotations,omitempty"`
  8171. // FullTextAnnotation: If present, text (OCR) detection or document
  8172. // (OCR) text detection has
  8173. // completed successfully.
  8174. // This annotation provides the structural hierarchy for the OCR
  8175. // detected
  8176. // text.
  8177. FullTextAnnotation *GoogleCloudVisionV1p4beta1TextAnnotation `json:"fullTextAnnotation,omitempty"`
  8178. // ImagePropertiesAnnotation: If present, image properties were
  8179. // extracted successfully.
  8180. ImagePropertiesAnnotation *GoogleCloudVisionV1p4beta1ImageProperties `json:"imagePropertiesAnnotation,omitempty"`
  8181. // LabelAnnotations: If present, label detection has completed
  8182. // successfully.
  8183. LabelAnnotations []*GoogleCloudVisionV1p4beta1EntityAnnotation `json:"labelAnnotations,omitempty"`
  8184. // LandmarkAnnotations: If present, landmark detection has completed
  8185. // successfully.
  8186. LandmarkAnnotations []*GoogleCloudVisionV1p4beta1EntityAnnotation `json:"landmarkAnnotations,omitempty"`
  8187. // LocalizedObjectAnnotations: If present, localized object detection
  8188. // has completed successfully.
  8189. // This will be sorted descending by confidence score.
  8190. LocalizedObjectAnnotations []*GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation `json:"localizedObjectAnnotations,omitempty"`
  8191. // LogoAnnotations: If present, logo detection has completed
  8192. // successfully.
  8193. LogoAnnotations []*GoogleCloudVisionV1p4beta1EntityAnnotation `json:"logoAnnotations,omitempty"`
  8194. // ProductSearchResults: If present, product search has completed
  8195. // successfully.
  8196. ProductSearchResults *GoogleCloudVisionV1p4beta1ProductSearchResults `json:"productSearchResults,omitempty"`
  8197. // SafeSearchAnnotation: If present, safe-search annotation has
  8198. // completed successfully.
  8199. SafeSearchAnnotation *GoogleCloudVisionV1p4beta1SafeSearchAnnotation `json:"safeSearchAnnotation,omitempty"`
  8200. // TextAnnotations: If present, text (OCR) detection has completed
  8201. // successfully.
  8202. TextAnnotations []*GoogleCloudVisionV1p4beta1EntityAnnotation `json:"textAnnotations,omitempty"`
  8203. // WebDetection: If present, web detection has completed successfully.
  8204. WebDetection *GoogleCloudVisionV1p4beta1WebDetection `json:"webDetection,omitempty"`
  8205. // ForceSendFields is a list of field names (e.g. "Context") to
  8206. // unconditionally include in API requests. By default, fields with
  8207. // empty values are omitted from API requests. However, any non-pointer,
  8208. // non-interface field appearing in ForceSendFields will be sent to the
  8209. // server regardless of whether the field is empty or not. This may be
  8210. // used to include empty fields in Patch requests.
  8211. ForceSendFields []string `json:"-"`
  8212. // NullFields is a list of field names (e.g. "Context") to include in
  8213. // API requests with the JSON null value. By default, fields with empty
  8214. // values are omitted from API requests. However, any field with an
  8215. // empty value appearing in NullFields will be sent to the server as
  8216. // null. It is an error if a field in this list has a non-empty value.
  8217. // This may be used to include null fields in Patch requests.
  8218. NullFields []string `json:"-"`
  8219. }
  8220. func (s *GoogleCloudVisionV1p4beta1AnnotateImageResponse) MarshalJSON() ([]byte, error) {
  8221. type NoMethod GoogleCloudVisionV1p4beta1AnnotateImageResponse
  8222. raw := NoMethod(*s)
  8223. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8224. }
  8225. // GoogleCloudVisionV1p4beta1AsyncAnnotateFileResponse: The response for
  8226. // a single offline file annotation request.
  8227. type GoogleCloudVisionV1p4beta1AsyncAnnotateFileResponse struct {
  8228. // OutputConfig: The output location and metadata from
  8229. // AsyncAnnotateFileRequest.
  8230. OutputConfig *GoogleCloudVisionV1p4beta1OutputConfig `json:"outputConfig,omitempty"`
  8231. // ForceSendFields is a list of field names (e.g. "OutputConfig") to
  8232. // unconditionally include in API requests. By default, fields with
  8233. // empty values are omitted from API requests. However, any non-pointer,
  8234. // non-interface field appearing in ForceSendFields will be sent to the
  8235. // server regardless of whether the field is empty or not. This may be
  8236. // used to include empty fields in Patch requests.
  8237. ForceSendFields []string `json:"-"`
  8238. // NullFields is a list of field names (e.g. "OutputConfig") to include
  8239. // in API requests with the JSON null value. By default, fields with
  8240. // empty values are omitted from API requests. However, any field with
  8241. // an empty value appearing in NullFields will be sent to the server as
  8242. // null. It is an error if a field in this list has a non-empty value.
  8243. // This may be used to include null fields in Patch requests.
  8244. NullFields []string `json:"-"`
  8245. }
  8246. func (s *GoogleCloudVisionV1p4beta1AsyncAnnotateFileResponse) MarshalJSON() ([]byte, error) {
  8247. type NoMethod GoogleCloudVisionV1p4beta1AsyncAnnotateFileResponse
  8248. raw := NoMethod(*s)
  8249. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8250. }
  8251. // GoogleCloudVisionV1p4beta1AsyncBatchAnnotateFilesResponse: Response
  8252. // to an async batch file annotation request.
  8253. type GoogleCloudVisionV1p4beta1AsyncBatchAnnotateFilesResponse struct {
  8254. // Responses: The list of file annotation responses, one for each
  8255. // request in
  8256. // AsyncBatchAnnotateFilesRequest.
  8257. Responses []*GoogleCloudVisionV1p4beta1AsyncAnnotateFileResponse `json:"responses,omitempty"`
  8258. // ForceSendFields is a list of field names (e.g. "Responses") to
  8259. // unconditionally include in API requests. By default, fields with
  8260. // empty values are omitted from API requests. However, any non-pointer,
  8261. // non-interface field appearing in ForceSendFields will be sent to the
  8262. // server regardless of whether the field is empty or not. This may be
  8263. // used to include empty fields in Patch requests.
  8264. ForceSendFields []string `json:"-"`
  8265. // NullFields is a list of field names (e.g. "Responses") to include in
  8266. // API requests with the JSON null value. By default, fields with empty
  8267. // values are omitted from API requests. However, any field with an
  8268. // empty value appearing in NullFields will be sent to the server as
  8269. // null. It is an error if a field in this list has a non-empty value.
  8270. // This may be used to include null fields in Patch requests.
  8271. NullFields []string `json:"-"`
  8272. }
  8273. func (s *GoogleCloudVisionV1p4beta1AsyncBatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) {
  8274. type NoMethod GoogleCloudVisionV1p4beta1AsyncBatchAnnotateFilesResponse
  8275. raw := NoMethod(*s)
  8276. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8277. }
  8278. // GoogleCloudVisionV1p4beta1AsyncBatchAnnotateImagesResponse: Response
  8279. // to an async batch image annotation request.
  8280. type GoogleCloudVisionV1p4beta1AsyncBatchAnnotateImagesResponse struct {
  8281. // OutputConfig: The output location and metadata from
  8282. // AsyncBatchAnnotateImagesRequest.
  8283. OutputConfig *GoogleCloudVisionV1p4beta1OutputConfig `json:"outputConfig,omitempty"`
  8284. // ForceSendFields is a list of field names (e.g. "OutputConfig") to
  8285. // unconditionally include in API requests. By default, fields with
  8286. // empty values are omitted from API requests. However, any non-pointer,
  8287. // non-interface field appearing in ForceSendFields will be sent to the
  8288. // server regardless of whether the field is empty or not. This may be
  8289. // used to include empty fields in Patch requests.
  8290. ForceSendFields []string `json:"-"`
  8291. // NullFields is a list of field names (e.g. "OutputConfig") to include
  8292. // in API requests with the JSON null value. By default, fields with
  8293. // empty values are omitted from API requests. However, any field with
  8294. // an empty value appearing in NullFields will be sent to the server as
  8295. // null. It is an error if a field in this list has a non-empty value.
  8296. // This may be used to include null fields in Patch requests.
  8297. NullFields []string `json:"-"`
  8298. }
  8299. func (s *GoogleCloudVisionV1p4beta1AsyncBatchAnnotateImagesResponse) MarshalJSON() ([]byte, error) {
  8300. type NoMethod GoogleCloudVisionV1p4beta1AsyncBatchAnnotateImagesResponse
  8301. raw := NoMethod(*s)
  8302. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8303. }
  8304. // GoogleCloudVisionV1p4beta1BatchAnnotateFilesResponse: A list of file
  8305. // annotation responses.
  8306. type GoogleCloudVisionV1p4beta1BatchAnnotateFilesResponse struct {
  8307. // Responses: The list of file annotation responses, each response
  8308. // corresponding to each
  8309. // AnnotateFileRequest in BatchAnnotateFilesRequest.
  8310. Responses []*GoogleCloudVisionV1p4beta1AnnotateFileResponse `json:"responses,omitempty"`
  8311. // ForceSendFields is a list of field names (e.g. "Responses") to
  8312. // unconditionally include in API requests. By default, fields with
  8313. // empty values are omitted from API requests. However, any non-pointer,
  8314. // non-interface field appearing in ForceSendFields will be sent to the
  8315. // server regardless of whether the field is empty or not. This may be
  8316. // used to include empty fields in Patch requests.
  8317. ForceSendFields []string `json:"-"`
  8318. // NullFields is a list of field names (e.g. "Responses") to include in
  8319. // API requests with the JSON null value. By default, fields with empty
  8320. // values are omitted from API requests. However, any field with an
  8321. // empty value appearing in NullFields will be sent to the server as
  8322. // null. It is an error if a field in this list has a non-empty value.
  8323. // This may be used to include null fields in Patch requests.
  8324. NullFields []string `json:"-"`
  8325. }
  8326. func (s *GoogleCloudVisionV1p4beta1BatchAnnotateFilesResponse) MarshalJSON() ([]byte, error) {
  8327. type NoMethod GoogleCloudVisionV1p4beta1BatchAnnotateFilesResponse
  8328. raw := NoMethod(*s)
  8329. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8330. }
  8331. // GoogleCloudVisionV1p4beta1BatchOperationMetadata: Metadata for the
  8332. // batch operations such as the current state.
  8333. //
  8334. // This is included in the `metadata` field of the `Operation` returned
  8335. // by the
  8336. // `GetOperation` call of the `google::longrunning::Operations` service.
  8337. type GoogleCloudVisionV1p4beta1BatchOperationMetadata struct {
  8338. // EndTime: The time when the batch request is finished
  8339. // and
  8340. // google.longrunning.Operation.done is set to true.
  8341. EndTime string `json:"endTime,omitempty"`
  8342. // State: The current state of the batch operation.
  8343. //
  8344. // Possible values:
  8345. // "STATE_UNSPECIFIED" - Invalid.
  8346. // "PROCESSING" - Request is actively being processed.
  8347. // "SUCCESSFUL" - The request is done and at least one item has been
  8348. // successfully
  8349. // processed.
  8350. // "FAILED" - The request is done and no item has been successfully
  8351. // processed.
  8352. // "CANCELLED" - The request is done after the
  8353. // longrunning.Operations.CancelOperation has
  8354. // been called by the user. Any records that were processed before
  8355. // the
  8356. // cancel command are output as specified in the request.
  8357. State string `json:"state,omitempty"`
  8358. // SubmitTime: The time when the batch request was submitted to the
  8359. // server.
  8360. SubmitTime string `json:"submitTime,omitempty"`
  8361. // ForceSendFields is a list of field names (e.g. "EndTime") to
  8362. // unconditionally include in API requests. By default, fields with
  8363. // empty values are omitted from API requests. However, any non-pointer,
  8364. // non-interface field appearing in ForceSendFields will be sent to the
  8365. // server regardless of whether the field is empty or not. This may be
  8366. // used to include empty fields in Patch requests.
  8367. ForceSendFields []string `json:"-"`
  8368. // NullFields is a list of field names (e.g. "EndTime") to include in
  8369. // API requests with the JSON null value. By default, fields with empty
  8370. // values are omitted from API requests. However, any field with an
  8371. // empty value appearing in NullFields will be sent to the server as
  8372. // null. It is an error if a field in this list has a non-empty value.
  8373. // This may be used to include null fields in Patch requests.
  8374. NullFields []string `json:"-"`
  8375. }
  8376. func (s *GoogleCloudVisionV1p4beta1BatchOperationMetadata) MarshalJSON() ([]byte, error) {
  8377. type NoMethod GoogleCloudVisionV1p4beta1BatchOperationMetadata
  8378. raw := NoMethod(*s)
  8379. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8380. }
  8381. // GoogleCloudVisionV1p4beta1Block: Logical element on the page.
  8382. type GoogleCloudVisionV1p4beta1Block struct {
  8383. // BlockType: Detected block type (text, image etc) for this block.
  8384. //
  8385. // Possible values:
  8386. // "UNKNOWN" - Unknown block type.
  8387. // "TEXT" - Regular text block.
  8388. // "TABLE" - Table block.
  8389. // "PICTURE" - Image block.
  8390. // "RULER" - Horizontal/vertical line box.
  8391. // "BARCODE" - Barcode block.
  8392. BlockType string `json:"blockType,omitempty"`
  8393. // BoundingBox: The bounding box for the block.
  8394. // The vertices are in the order of top-left, top-right,
  8395. // bottom-right,
  8396. // bottom-left. When a rotation of the bounding box is detected the
  8397. // rotation
  8398. // is represented as around the top-left corner as defined when the text
  8399. // is
  8400. // read in the 'natural' orientation.
  8401. // For example:
  8402. //
  8403. // * when the text is horizontal it might look like:
  8404. //
  8405. // 0----1
  8406. // | |
  8407. // 3----2
  8408. //
  8409. // * when it's rotated 180 degrees around the top-left corner it
  8410. // becomes:
  8411. //
  8412. // 2----3
  8413. // | |
  8414. // 1----0
  8415. //
  8416. // and the vertex order will still be (0, 1, 2, 3).
  8417. BoundingBox *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingBox,omitempty"`
  8418. // Confidence: Confidence of the OCR results on the block. Range [0, 1].
  8419. Confidence float64 `json:"confidence,omitempty"`
  8420. // Paragraphs: List of paragraphs in this block (if this blocks is of
  8421. // type text).
  8422. Paragraphs []*GoogleCloudVisionV1p4beta1Paragraph `json:"paragraphs,omitempty"`
  8423. // Property: Additional information detected for the block.
  8424. Property *GoogleCloudVisionV1p4beta1TextAnnotationTextProperty `json:"property,omitempty"`
  8425. // ForceSendFields is a list of field names (e.g. "BlockType") to
  8426. // unconditionally include in API requests. By default, fields with
  8427. // empty values are omitted from API requests. However, any non-pointer,
  8428. // non-interface field appearing in ForceSendFields will be sent to the
  8429. // server regardless of whether the field is empty or not. This may be
  8430. // used to include empty fields in Patch requests.
  8431. ForceSendFields []string `json:"-"`
  8432. // NullFields is a list of field names (e.g. "BlockType") to include in
  8433. // API requests with the JSON null value. By default, fields with empty
  8434. // values are omitted from API requests. However, any field with an
  8435. // empty value appearing in NullFields will be sent to the server as
  8436. // null. It is an error if a field in this list has a non-empty value.
  8437. // This may be used to include null fields in Patch requests.
  8438. NullFields []string `json:"-"`
  8439. }
  8440. func (s *GoogleCloudVisionV1p4beta1Block) MarshalJSON() ([]byte, error) {
  8441. type NoMethod GoogleCloudVisionV1p4beta1Block
  8442. raw := NoMethod(*s)
  8443. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8444. }
  8445. func (s *GoogleCloudVisionV1p4beta1Block) UnmarshalJSON(data []byte) error {
  8446. type NoMethod GoogleCloudVisionV1p4beta1Block
  8447. var s1 struct {
  8448. Confidence gensupport.JSONFloat64 `json:"confidence"`
  8449. *NoMethod
  8450. }
  8451. s1.NoMethod = (*NoMethod)(s)
  8452. if err := json.Unmarshal(data, &s1); err != nil {
  8453. return err
  8454. }
  8455. s.Confidence = float64(s1.Confidence)
  8456. return nil
  8457. }
  8458. // GoogleCloudVisionV1p4beta1BoundingPoly: A bounding polygon for the
  8459. // detected image annotation.
  8460. type GoogleCloudVisionV1p4beta1BoundingPoly struct {
  8461. // NormalizedVertices: The bounding polygon normalized vertices.
  8462. NormalizedVertices []*GoogleCloudVisionV1p4beta1NormalizedVertex `json:"normalizedVertices,omitempty"`
  8463. // Vertices: The bounding polygon vertices.
  8464. Vertices []*GoogleCloudVisionV1p4beta1Vertex `json:"vertices,omitempty"`
  8465. // ForceSendFields is a list of field names (e.g. "NormalizedVertices")
  8466. // to unconditionally include in API requests. By default, fields with
  8467. // empty values are omitted from API requests. However, any non-pointer,
  8468. // non-interface field appearing in ForceSendFields will be sent to the
  8469. // server regardless of whether the field is empty or not. This may be
  8470. // used to include empty fields in Patch requests.
  8471. ForceSendFields []string `json:"-"`
  8472. // NullFields is a list of field names (e.g. "NormalizedVertices") to
  8473. // include in API requests with the JSON null value. By default, fields
  8474. // with empty values are omitted from API requests. However, any field
  8475. // with an empty value appearing in NullFields will be sent to the
  8476. // server as null. It is an error if a field in this list has a
  8477. // non-empty value. This may be used to include null fields in Patch
  8478. // requests.
  8479. NullFields []string `json:"-"`
  8480. }
  8481. func (s *GoogleCloudVisionV1p4beta1BoundingPoly) MarshalJSON() ([]byte, error) {
  8482. type NoMethod GoogleCloudVisionV1p4beta1BoundingPoly
  8483. raw := NoMethod(*s)
  8484. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8485. }
  8486. // GoogleCloudVisionV1p4beta1ColorInfo: Color information consists of
  8487. // RGB channels, score, and the fraction of
  8488. // the image that the color occupies in the image.
  8489. type GoogleCloudVisionV1p4beta1ColorInfo struct {
  8490. // Color: RGB components of the color.
  8491. Color *Color `json:"color,omitempty"`
  8492. // PixelFraction: The fraction of pixels the color occupies in the
  8493. // image.
  8494. // Value in range [0, 1].
  8495. PixelFraction float64 `json:"pixelFraction,omitempty"`
  8496. // Score: Image-specific score for this color. Value in range [0, 1].
  8497. Score float64 `json:"score,omitempty"`
  8498. // ForceSendFields is a list of field names (e.g. "Color") to
  8499. // unconditionally include in API requests. By default, fields with
  8500. // empty values are omitted from API requests. However, any non-pointer,
  8501. // non-interface field appearing in ForceSendFields will be sent to the
  8502. // server regardless of whether the field is empty or not. This may be
  8503. // used to include empty fields in Patch requests.
  8504. ForceSendFields []string `json:"-"`
  8505. // NullFields is a list of field names (e.g. "Color") to include in API
  8506. // requests with the JSON null value. By default, fields with empty
  8507. // values are omitted from API requests. However, any field with an
  8508. // empty value appearing in NullFields will be sent to the server as
  8509. // null. It is an error if a field in this list has a non-empty value.
  8510. // This may be used to include null fields in Patch requests.
  8511. NullFields []string `json:"-"`
  8512. }
  8513. func (s *GoogleCloudVisionV1p4beta1ColorInfo) MarshalJSON() ([]byte, error) {
  8514. type NoMethod GoogleCloudVisionV1p4beta1ColorInfo
  8515. raw := NoMethod(*s)
  8516. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8517. }
  8518. func (s *GoogleCloudVisionV1p4beta1ColorInfo) UnmarshalJSON(data []byte) error {
  8519. type NoMethod GoogleCloudVisionV1p4beta1ColorInfo
  8520. var s1 struct {
  8521. PixelFraction gensupport.JSONFloat64 `json:"pixelFraction"`
  8522. Score gensupport.JSONFloat64 `json:"score"`
  8523. *NoMethod
  8524. }
  8525. s1.NoMethod = (*NoMethod)(s)
  8526. if err := json.Unmarshal(data, &s1); err != nil {
  8527. return err
  8528. }
  8529. s.PixelFraction = float64(s1.PixelFraction)
  8530. s.Score = float64(s1.Score)
  8531. return nil
  8532. }
  8533. // GoogleCloudVisionV1p4beta1CropHint: Single crop hint that is used to
  8534. // generate a new crop when serving an image.
  8535. type GoogleCloudVisionV1p4beta1CropHint struct {
  8536. // BoundingPoly: The bounding polygon for the crop region. The
  8537. // coordinates of the bounding
  8538. // box are in the original image's scale.
  8539. BoundingPoly *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingPoly,omitempty"`
  8540. // Confidence: Confidence of this being a salient region. Range [0, 1].
  8541. Confidence float64 `json:"confidence,omitempty"`
  8542. // ImportanceFraction: Fraction of importance of this salient region
  8543. // with respect to the original
  8544. // image.
  8545. ImportanceFraction float64 `json:"importanceFraction,omitempty"`
  8546. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  8547. // unconditionally include in API requests. By default, fields with
  8548. // empty values are omitted from API requests. However, any non-pointer,
  8549. // non-interface field appearing in ForceSendFields will be sent to the
  8550. // server regardless of whether the field is empty or not. This may be
  8551. // used to include empty fields in Patch requests.
  8552. ForceSendFields []string `json:"-"`
  8553. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  8554. // in API requests with the JSON null value. By default, fields with
  8555. // empty values are omitted from API requests. However, any field with
  8556. // an empty value appearing in NullFields will be sent to the server as
  8557. // null. It is an error if a field in this list has a non-empty value.
  8558. // This may be used to include null fields in Patch requests.
  8559. NullFields []string `json:"-"`
  8560. }
  8561. func (s *GoogleCloudVisionV1p4beta1CropHint) MarshalJSON() ([]byte, error) {
  8562. type NoMethod GoogleCloudVisionV1p4beta1CropHint
  8563. raw := NoMethod(*s)
  8564. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8565. }
  8566. func (s *GoogleCloudVisionV1p4beta1CropHint) UnmarshalJSON(data []byte) error {
  8567. type NoMethod GoogleCloudVisionV1p4beta1CropHint
  8568. var s1 struct {
  8569. Confidence gensupport.JSONFloat64 `json:"confidence"`
  8570. ImportanceFraction gensupport.JSONFloat64 `json:"importanceFraction"`
  8571. *NoMethod
  8572. }
  8573. s1.NoMethod = (*NoMethod)(s)
  8574. if err := json.Unmarshal(data, &s1); err != nil {
  8575. return err
  8576. }
  8577. s.Confidence = float64(s1.Confidence)
  8578. s.ImportanceFraction = float64(s1.ImportanceFraction)
  8579. return nil
  8580. }
  8581. // GoogleCloudVisionV1p4beta1CropHintsAnnotation: Set of crop hints that
  8582. // are used to generate new crops when serving images.
  8583. type GoogleCloudVisionV1p4beta1CropHintsAnnotation struct {
  8584. // CropHints: Crop hint results.
  8585. CropHints []*GoogleCloudVisionV1p4beta1CropHint `json:"cropHints,omitempty"`
  8586. // ForceSendFields is a list of field names (e.g. "CropHints") to
  8587. // unconditionally include in API requests. By default, fields with
  8588. // empty values are omitted from API requests. However, any non-pointer,
  8589. // non-interface field appearing in ForceSendFields will be sent to the
  8590. // server regardless of whether the field is empty or not. This may be
  8591. // used to include empty fields in Patch requests.
  8592. ForceSendFields []string `json:"-"`
  8593. // NullFields is a list of field names (e.g. "CropHints") to include in
  8594. // API requests with the JSON null value. By default, fields with empty
  8595. // values are omitted from API requests. However, any field with an
  8596. // empty value appearing in NullFields will be sent to the server as
  8597. // null. It is an error if a field in this list has a non-empty value.
  8598. // This may be used to include null fields in Patch requests.
  8599. NullFields []string `json:"-"`
  8600. }
  8601. func (s *GoogleCloudVisionV1p4beta1CropHintsAnnotation) MarshalJSON() ([]byte, error) {
  8602. type NoMethod GoogleCloudVisionV1p4beta1CropHintsAnnotation
  8603. raw := NoMethod(*s)
  8604. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8605. }
  8606. // GoogleCloudVisionV1p4beta1DominantColorsAnnotation: Set of dominant
  8607. // colors and their corresponding scores.
  8608. type GoogleCloudVisionV1p4beta1DominantColorsAnnotation struct {
  8609. // Colors: RGB color values with their score and pixel fraction.
  8610. Colors []*GoogleCloudVisionV1p4beta1ColorInfo `json:"colors,omitempty"`
  8611. // ForceSendFields is a list of field names (e.g. "Colors") to
  8612. // unconditionally include in API requests. By default, fields with
  8613. // empty values are omitted from API requests. However, any non-pointer,
  8614. // non-interface field appearing in ForceSendFields will be sent to the
  8615. // server regardless of whether the field is empty or not. This may be
  8616. // used to include empty fields in Patch requests.
  8617. ForceSendFields []string `json:"-"`
  8618. // NullFields is a list of field names (e.g. "Colors") to include in API
  8619. // requests with the JSON null value. By default, fields with empty
  8620. // values are omitted from API requests. However, any field with an
  8621. // empty value appearing in NullFields will be sent to the server as
  8622. // null. It is an error if a field in this list has a non-empty value.
  8623. // This may be used to include null fields in Patch requests.
  8624. NullFields []string `json:"-"`
  8625. }
  8626. func (s *GoogleCloudVisionV1p4beta1DominantColorsAnnotation) MarshalJSON() ([]byte, error) {
  8627. type NoMethod GoogleCloudVisionV1p4beta1DominantColorsAnnotation
  8628. raw := NoMethod(*s)
  8629. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8630. }
  8631. // GoogleCloudVisionV1p4beta1EntityAnnotation: Set of detected entity
  8632. // features.
  8633. type GoogleCloudVisionV1p4beta1EntityAnnotation struct {
  8634. // BoundingPoly: Image region to which this entity belongs. Not
  8635. // produced
  8636. // for `LABEL_DETECTION` features.
  8637. BoundingPoly *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingPoly,omitempty"`
  8638. // Confidence: **Deprecated. Use `score` instead.**
  8639. // The accuracy of the entity detection in an image.
  8640. // For example, for an image in which the "Eiffel Tower" entity is
  8641. // detected,
  8642. // this field represents the confidence that there is a tower in the
  8643. // query
  8644. // image. Range [0, 1].
  8645. Confidence float64 `json:"confidence,omitempty"`
  8646. // Description: Entity textual description, expressed in its `locale`
  8647. // language.
  8648. Description string `json:"description,omitempty"`
  8649. // Locale: The language code for the locale in which the entity
  8650. // textual
  8651. // `description` is expressed.
  8652. Locale string `json:"locale,omitempty"`
  8653. // Locations: The location information for the detected entity.
  8654. // Multiple
  8655. // `LocationInfo` elements can be present because one location
  8656. // may
  8657. // indicate the location of the scene in the image, and another
  8658. // location
  8659. // may indicate the location of the place where the image was
  8660. // taken.
  8661. // Location information is usually present for landmarks.
  8662. Locations []*GoogleCloudVisionV1p4beta1LocationInfo `json:"locations,omitempty"`
  8663. // Mid: Opaque entity ID. Some IDs may be available in
  8664. // [Google Knowledge Graph
  8665. // Search
  8666. // API](https://developers.google.com/knowledge-graph/).
  8667. Mid string `json:"mid,omitempty"`
  8668. // Properties: Some entities may have optional user-supplied `Property`
  8669. // (name/value)
  8670. // fields, such a score or string that qualifies the entity.
  8671. Properties []*GoogleCloudVisionV1p4beta1Property `json:"properties,omitempty"`
  8672. // Score: Overall score of the result. Range [0, 1].
  8673. Score float64 `json:"score,omitempty"`
  8674. // Topicality: The relevancy of the ICA (Image Content Annotation) label
  8675. // to the
  8676. // image. For example, the relevancy of "tower" is likely higher to an
  8677. // image
  8678. // containing the detected "Eiffel Tower" than to an image containing
  8679. // a
  8680. // detected distant towering building, even though the confidence
  8681. // that
  8682. // there is a tower in each image may be the same. Range [0, 1].
  8683. Topicality float64 `json:"topicality,omitempty"`
  8684. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  8685. // unconditionally include in API requests. By default, fields with
  8686. // empty values are omitted from API requests. However, any non-pointer,
  8687. // non-interface field appearing in ForceSendFields will be sent to the
  8688. // server regardless of whether the field is empty or not. This may be
  8689. // used to include empty fields in Patch requests.
  8690. ForceSendFields []string `json:"-"`
  8691. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  8692. // in API requests with the JSON null value. By default, fields with
  8693. // empty values are omitted from API requests. However, any field with
  8694. // an empty value appearing in NullFields will be sent to the server as
  8695. // null. It is an error if a field in this list has a non-empty value.
  8696. // This may be used to include null fields in Patch requests.
  8697. NullFields []string `json:"-"`
  8698. }
  8699. func (s *GoogleCloudVisionV1p4beta1EntityAnnotation) MarshalJSON() ([]byte, error) {
  8700. type NoMethod GoogleCloudVisionV1p4beta1EntityAnnotation
  8701. raw := NoMethod(*s)
  8702. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8703. }
  8704. func (s *GoogleCloudVisionV1p4beta1EntityAnnotation) UnmarshalJSON(data []byte) error {
  8705. type NoMethod GoogleCloudVisionV1p4beta1EntityAnnotation
  8706. var s1 struct {
  8707. Confidence gensupport.JSONFloat64 `json:"confidence"`
  8708. Score gensupport.JSONFloat64 `json:"score"`
  8709. Topicality gensupport.JSONFloat64 `json:"topicality"`
  8710. *NoMethod
  8711. }
  8712. s1.NoMethod = (*NoMethod)(s)
  8713. if err := json.Unmarshal(data, &s1); err != nil {
  8714. return err
  8715. }
  8716. s.Confidence = float64(s1.Confidence)
  8717. s.Score = float64(s1.Score)
  8718. s.Topicality = float64(s1.Topicality)
  8719. return nil
  8720. }
  8721. // GoogleCloudVisionV1p4beta1FaceAnnotation: A face annotation object
  8722. // contains the results of face detection.
  8723. type GoogleCloudVisionV1p4beta1FaceAnnotation struct {
  8724. // AngerLikelihood: Anger likelihood.
  8725. //
  8726. // Possible values:
  8727. // "UNKNOWN" - Unknown likelihood.
  8728. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  8729. // specified vertical.
  8730. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  8731. // vertical.
  8732. // "POSSIBLE" - It is possible that the image belongs to the specified
  8733. // vertical.
  8734. // "LIKELY" - It is likely that the image belongs to the specified
  8735. // vertical.
  8736. // "VERY_LIKELY" - It is very likely that the image belongs to the
  8737. // specified vertical.
  8738. AngerLikelihood string `json:"angerLikelihood,omitempty"`
  8739. // BlurredLikelihood: Blurred likelihood.
  8740. //
  8741. // Possible values:
  8742. // "UNKNOWN" - Unknown likelihood.
  8743. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  8744. // specified vertical.
  8745. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  8746. // vertical.
  8747. // "POSSIBLE" - It is possible that the image belongs to the specified
  8748. // vertical.
  8749. // "LIKELY" - It is likely that the image belongs to the specified
  8750. // vertical.
  8751. // "VERY_LIKELY" - It is very likely that the image belongs to the
  8752. // specified vertical.
  8753. BlurredLikelihood string `json:"blurredLikelihood,omitempty"`
  8754. // BoundingPoly: The bounding polygon around the face. The coordinates
  8755. // of the bounding box
  8756. // are in the original image's scale.
  8757. // The bounding box is computed to "frame" the face in accordance with
  8758. // human
  8759. // expectations. It is based on the landmarker results.
  8760. // Note that one or more x and/or y coordinates may not be generated in
  8761. // the
  8762. // `BoundingPoly` (the polygon will be unbounded) if only a partial
  8763. // face
  8764. // appears in the image to be annotated.
  8765. BoundingPoly *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingPoly,omitempty"`
  8766. // DetectionConfidence: Detection confidence. Range [0, 1].
  8767. DetectionConfidence float64 `json:"detectionConfidence,omitempty"`
  8768. // FdBoundingPoly: The `fd_bounding_poly` bounding polygon is tighter
  8769. // than the
  8770. // `boundingPoly`, and encloses only the skin part of the face.
  8771. // Typically, it
  8772. // is used to eliminate the face from any image analysis that detects
  8773. // the
  8774. // "amount of skin" visible in an image. It is not based on
  8775. // the
  8776. // landmarker results, only on the initial face detection, hence
  8777. // the <code>fd</code> (face detection) prefix.
  8778. FdBoundingPoly *GoogleCloudVisionV1p4beta1BoundingPoly `json:"fdBoundingPoly,omitempty"`
  8779. // HeadwearLikelihood: Headwear likelihood.
  8780. //
  8781. // Possible values:
  8782. // "UNKNOWN" - Unknown likelihood.
  8783. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  8784. // specified vertical.
  8785. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  8786. // vertical.
  8787. // "POSSIBLE" - It is possible that the image belongs to the specified
  8788. // vertical.
  8789. // "LIKELY" - It is likely that the image belongs to the specified
  8790. // vertical.
  8791. // "VERY_LIKELY" - It is very likely that the image belongs to the
  8792. // specified vertical.
  8793. HeadwearLikelihood string `json:"headwearLikelihood,omitempty"`
  8794. // JoyLikelihood: Joy likelihood.
  8795. //
  8796. // Possible values:
  8797. // "UNKNOWN" - Unknown likelihood.
  8798. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  8799. // specified vertical.
  8800. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  8801. // vertical.
  8802. // "POSSIBLE" - It is possible that the image belongs to the specified
  8803. // vertical.
  8804. // "LIKELY" - It is likely that the image belongs to the specified
  8805. // vertical.
  8806. // "VERY_LIKELY" - It is very likely that the image belongs to the
  8807. // specified vertical.
  8808. JoyLikelihood string `json:"joyLikelihood,omitempty"`
  8809. // LandmarkingConfidence: Face landmarking confidence. Range [0, 1].
  8810. LandmarkingConfidence float64 `json:"landmarkingConfidence,omitempty"`
  8811. // Landmarks: Detected face landmarks.
  8812. Landmarks []*GoogleCloudVisionV1p4beta1FaceAnnotationLandmark `json:"landmarks,omitempty"`
  8813. // PanAngle: Yaw angle, which indicates the leftward/rightward angle
  8814. // that the face is
  8815. // pointing relative to the vertical plane perpendicular to the image.
  8816. // Range
  8817. // [-180,180].
  8818. PanAngle float64 `json:"panAngle,omitempty"`
  8819. // RollAngle: Roll angle, which indicates the amount of
  8820. // clockwise/anti-clockwise rotation
  8821. // of the face relative to the image vertical about the axis
  8822. // perpendicular to
  8823. // the face. Range [-180,180].
  8824. RollAngle float64 `json:"rollAngle,omitempty"`
  8825. // SorrowLikelihood: Sorrow likelihood.
  8826. //
  8827. // Possible values:
  8828. // "UNKNOWN" - Unknown likelihood.
  8829. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  8830. // specified vertical.
  8831. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  8832. // vertical.
  8833. // "POSSIBLE" - It is possible that the image belongs to the specified
  8834. // vertical.
  8835. // "LIKELY" - It is likely that the image belongs to the specified
  8836. // vertical.
  8837. // "VERY_LIKELY" - It is very likely that the image belongs to the
  8838. // specified vertical.
  8839. SorrowLikelihood string `json:"sorrowLikelihood,omitempty"`
  8840. // SurpriseLikelihood: Surprise likelihood.
  8841. //
  8842. // Possible values:
  8843. // "UNKNOWN" - Unknown likelihood.
  8844. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  8845. // specified vertical.
  8846. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  8847. // vertical.
  8848. // "POSSIBLE" - It is possible that the image belongs to the specified
  8849. // vertical.
  8850. // "LIKELY" - It is likely that the image belongs to the specified
  8851. // vertical.
  8852. // "VERY_LIKELY" - It is very likely that the image belongs to the
  8853. // specified vertical.
  8854. SurpriseLikelihood string `json:"surpriseLikelihood,omitempty"`
  8855. // TiltAngle: Pitch angle, which indicates the upwards/downwards angle
  8856. // that the face is
  8857. // pointing relative to the image's horizontal plane. Range [-180,180].
  8858. TiltAngle float64 `json:"tiltAngle,omitempty"`
  8859. // UnderExposedLikelihood: Under-exposed likelihood.
  8860. //
  8861. // Possible values:
  8862. // "UNKNOWN" - Unknown likelihood.
  8863. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  8864. // specified vertical.
  8865. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  8866. // vertical.
  8867. // "POSSIBLE" - It is possible that the image belongs to the specified
  8868. // vertical.
  8869. // "LIKELY" - It is likely that the image belongs to the specified
  8870. // vertical.
  8871. // "VERY_LIKELY" - It is very likely that the image belongs to the
  8872. // specified vertical.
  8873. UnderExposedLikelihood string `json:"underExposedLikelihood,omitempty"`
  8874. // ForceSendFields is a list of field names (e.g. "AngerLikelihood") to
  8875. // unconditionally include in API requests. By default, fields with
  8876. // empty values are omitted from API requests. However, any non-pointer,
  8877. // non-interface field appearing in ForceSendFields will be sent to the
  8878. // server regardless of whether the field is empty or not. This may be
  8879. // used to include empty fields in Patch requests.
  8880. ForceSendFields []string `json:"-"`
  8881. // NullFields is a list of field names (e.g. "AngerLikelihood") to
  8882. // include in API requests with the JSON null value. By default, fields
  8883. // with empty values are omitted from API requests. However, any field
  8884. // with an empty value appearing in NullFields will be sent to the
  8885. // server as null. It is an error if a field in this list has a
  8886. // non-empty value. This may be used to include null fields in Patch
  8887. // requests.
  8888. NullFields []string `json:"-"`
  8889. }
  8890. func (s *GoogleCloudVisionV1p4beta1FaceAnnotation) MarshalJSON() ([]byte, error) {
  8891. type NoMethod GoogleCloudVisionV1p4beta1FaceAnnotation
  8892. raw := NoMethod(*s)
  8893. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8894. }
  8895. func (s *GoogleCloudVisionV1p4beta1FaceAnnotation) UnmarshalJSON(data []byte) error {
  8896. type NoMethod GoogleCloudVisionV1p4beta1FaceAnnotation
  8897. var s1 struct {
  8898. DetectionConfidence gensupport.JSONFloat64 `json:"detectionConfidence"`
  8899. LandmarkingConfidence gensupport.JSONFloat64 `json:"landmarkingConfidence"`
  8900. PanAngle gensupport.JSONFloat64 `json:"panAngle"`
  8901. RollAngle gensupport.JSONFloat64 `json:"rollAngle"`
  8902. TiltAngle gensupport.JSONFloat64 `json:"tiltAngle"`
  8903. *NoMethod
  8904. }
  8905. s1.NoMethod = (*NoMethod)(s)
  8906. if err := json.Unmarshal(data, &s1); err != nil {
  8907. return err
  8908. }
  8909. s.DetectionConfidence = float64(s1.DetectionConfidence)
  8910. s.LandmarkingConfidence = float64(s1.LandmarkingConfidence)
  8911. s.PanAngle = float64(s1.PanAngle)
  8912. s.RollAngle = float64(s1.RollAngle)
  8913. s.TiltAngle = float64(s1.TiltAngle)
  8914. return nil
  8915. }
  8916. // GoogleCloudVisionV1p4beta1FaceAnnotationLandmark: A face-specific
  8917. // landmark (for example, a face feature).
  8918. type GoogleCloudVisionV1p4beta1FaceAnnotationLandmark struct {
  8919. // Position: Face landmark position.
  8920. Position *GoogleCloudVisionV1p4beta1Position `json:"position,omitempty"`
  8921. // Type: Face landmark type.
  8922. //
  8923. // Possible values:
  8924. // "UNKNOWN_LANDMARK" - Unknown face landmark detected. Should not be
  8925. // filled.
  8926. // "LEFT_EYE" - Left eye.
  8927. // "RIGHT_EYE" - Right eye.
  8928. // "LEFT_OF_LEFT_EYEBROW" - Left of left eyebrow.
  8929. // "RIGHT_OF_LEFT_EYEBROW" - Right of left eyebrow.
  8930. // "LEFT_OF_RIGHT_EYEBROW" - Left of right eyebrow.
  8931. // "RIGHT_OF_RIGHT_EYEBROW" - Right of right eyebrow.
  8932. // "MIDPOINT_BETWEEN_EYES" - Midpoint between eyes.
  8933. // "NOSE_TIP" - Nose tip.
  8934. // "UPPER_LIP" - Upper lip.
  8935. // "LOWER_LIP" - Lower lip.
  8936. // "MOUTH_LEFT" - Mouth left.
  8937. // "MOUTH_RIGHT" - Mouth right.
  8938. // "MOUTH_CENTER" - Mouth center.
  8939. // "NOSE_BOTTOM_RIGHT" - Nose, bottom right.
  8940. // "NOSE_BOTTOM_LEFT" - Nose, bottom left.
  8941. // "NOSE_BOTTOM_CENTER" - Nose, bottom center.
  8942. // "LEFT_EYE_TOP_BOUNDARY" - Left eye, top boundary.
  8943. // "LEFT_EYE_RIGHT_CORNER" - Left eye, right corner.
  8944. // "LEFT_EYE_BOTTOM_BOUNDARY" - Left eye, bottom boundary.
  8945. // "LEFT_EYE_LEFT_CORNER" - Left eye, left corner.
  8946. // "RIGHT_EYE_TOP_BOUNDARY" - Right eye, top boundary.
  8947. // "RIGHT_EYE_RIGHT_CORNER" - Right eye, right corner.
  8948. // "RIGHT_EYE_BOTTOM_BOUNDARY" - Right eye, bottom boundary.
  8949. // "RIGHT_EYE_LEFT_CORNER" - Right eye, left corner.
  8950. // "LEFT_EYEBROW_UPPER_MIDPOINT" - Left eyebrow, upper midpoint.
  8951. // "RIGHT_EYEBROW_UPPER_MIDPOINT" - Right eyebrow, upper midpoint.
  8952. // "LEFT_EAR_TRAGION" - Left ear tragion.
  8953. // "RIGHT_EAR_TRAGION" - Right ear tragion.
  8954. // "LEFT_EYE_PUPIL" - Left eye pupil.
  8955. // "RIGHT_EYE_PUPIL" - Right eye pupil.
  8956. // "FOREHEAD_GLABELLA" - Forehead glabella.
  8957. // "CHIN_GNATHION" - Chin gnathion.
  8958. // "CHIN_LEFT_GONION" - Chin left gonion.
  8959. // "CHIN_RIGHT_GONION" - Chin right gonion.
  8960. Type string `json:"type,omitempty"`
  8961. // ForceSendFields is a list of field names (e.g. "Position") to
  8962. // unconditionally include in API requests. By default, fields with
  8963. // empty values are omitted from API requests. However, any non-pointer,
  8964. // non-interface field appearing in ForceSendFields will be sent to the
  8965. // server regardless of whether the field is empty or not. This may be
  8966. // used to include empty fields in Patch requests.
  8967. ForceSendFields []string `json:"-"`
  8968. // NullFields is a list of field names (e.g. "Position") to include in
  8969. // API requests with the JSON null value. By default, fields with empty
  8970. // values are omitted from API requests. However, any field with an
  8971. // empty value appearing in NullFields will be sent to the server as
  8972. // null. It is an error if a field in this list has a non-empty value.
  8973. // This may be used to include null fields in Patch requests.
  8974. NullFields []string `json:"-"`
  8975. }
  8976. func (s *GoogleCloudVisionV1p4beta1FaceAnnotationLandmark) MarshalJSON() ([]byte, error) {
  8977. type NoMethod GoogleCloudVisionV1p4beta1FaceAnnotationLandmark
  8978. raw := NoMethod(*s)
  8979. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8980. }
  8981. // GoogleCloudVisionV1p4beta1GcsDestination: The Google Cloud Storage
  8982. // location where the output will be written to.
  8983. type GoogleCloudVisionV1p4beta1GcsDestination struct {
  8984. // Uri: Google Cloud Storage URI where the results will be stored.
  8985. // Results will
  8986. // be in JSON format and preceded by its corresponding input URI. This
  8987. // field
  8988. // can either represent a single file, or a prefix for multiple
  8989. // outputs.
  8990. // Prefixes must end in a `/`.
  8991. //
  8992. // Examples:
  8993. //
  8994. // * File: gs://bucket-name/filename.json
  8995. // * Prefix: gs://bucket-name/prefix/here/
  8996. // * File: gs://bucket-name/prefix/here
  8997. //
  8998. // If multiple outputs, each response is still AnnotateFileResponse,
  8999. // each of
  9000. // which contains some subset of the full list of
  9001. // AnnotateImageResponse.
  9002. // Multiple outputs can happen if, for example, the output JSON is too
  9003. // large
  9004. // and overflows into multiple sharded files.
  9005. Uri string `json:"uri,omitempty"`
  9006. // ForceSendFields is a list of field names (e.g. "Uri") to
  9007. // unconditionally include in API requests. By default, fields with
  9008. // empty values are omitted from API requests. However, any non-pointer,
  9009. // non-interface field appearing in ForceSendFields will be sent to the
  9010. // server regardless of whether the field is empty or not. This may be
  9011. // used to include empty fields in Patch requests.
  9012. ForceSendFields []string `json:"-"`
  9013. // NullFields is a list of field names (e.g. "Uri") to include in API
  9014. // requests with the JSON null value. By default, fields with empty
  9015. // values are omitted from API requests. However, any field with an
  9016. // empty value appearing in NullFields will be sent to the server as
  9017. // null. It is an error if a field in this list has a non-empty value.
  9018. // This may be used to include null fields in Patch requests.
  9019. NullFields []string `json:"-"`
  9020. }
  9021. func (s *GoogleCloudVisionV1p4beta1GcsDestination) MarshalJSON() ([]byte, error) {
  9022. type NoMethod GoogleCloudVisionV1p4beta1GcsDestination
  9023. raw := NoMethod(*s)
  9024. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9025. }
  9026. // GoogleCloudVisionV1p4beta1GcsSource: The Google Cloud Storage
  9027. // location where the input will be read from.
  9028. type GoogleCloudVisionV1p4beta1GcsSource struct {
  9029. // Uri: Google Cloud Storage URI for the input file. This must only be
  9030. // a
  9031. // Google Cloud Storage object. Wildcards are not currently supported.
  9032. Uri string `json:"uri,omitempty"`
  9033. // ForceSendFields is a list of field names (e.g. "Uri") to
  9034. // unconditionally include in API requests. By default, fields with
  9035. // empty values are omitted from API requests. However, any non-pointer,
  9036. // non-interface field appearing in ForceSendFields will be sent to the
  9037. // server regardless of whether the field is empty or not. This may be
  9038. // used to include empty fields in Patch requests.
  9039. ForceSendFields []string `json:"-"`
  9040. // NullFields is a list of field names (e.g. "Uri") to include in API
  9041. // requests with the JSON null value. By default, fields with empty
  9042. // values are omitted from API requests. However, any field with an
  9043. // empty value appearing in NullFields will be sent to the server as
  9044. // null. It is an error if a field in this list has a non-empty value.
  9045. // This may be used to include null fields in Patch requests.
  9046. NullFields []string `json:"-"`
  9047. }
  9048. func (s *GoogleCloudVisionV1p4beta1GcsSource) MarshalJSON() ([]byte, error) {
  9049. type NoMethod GoogleCloudVisionV1p4beta1GcsSource
  9050. raw := NoMethod(*s)
  9051. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9052. }
  9053. // GoogleCloudVisionV1p4beta1ImageAnnotationContext: If an image was
  9054. // produced from a file (e.g. a PDF), this message gives
  9055. // information about the source of that image.
  9056. type GoogleCloudVisionV1p4beta1ImageAnnotationContext struct {
  9057. // PageNumber: If the file was a PDF or TIFF, this field gives the page
  9058. // number within
  9059. // the file used to produce the image.
  9060. PageNumber int64 `json:"pageNumber,omitempty"`
  9061. // Uri: The URI of the file used to produce the image.
  9062. Uri string `json:"uri,omitempty"`
  9063. // ForceSendFields is a list of field names (e.g. "PageNumber") to
  9064. // unconditionally include in API requests. By default, fields with
  9065. // empty values are omitted from API requests. However, any non-pointer,
  9066. // non-interface field appearing in ForceSendFields will be sent to the
  9067. // server regardless of whether the field is empty or not. This may be
  9068. // used to include empty fields in Patch requests.
  9069. ForceSendFields []string `json:"-"`
  9070. // NullFields is a list of field names (e.g. "PageNumber") to include in
  9071. // API requests with the JSON null value. By default, fields with empty
  9072. // values are omitted from API requests. However, any field with an
  9073. // empty value appearing in NullFields will be sent to the server as
  9074. // null. It is an error if a field in this list has a non-empty value.
  9075. // This may be used to include null fields in Patch requests.
  9076. NullFields []string `json:"-"`
  9077. }
  9078. func (s *GoogleCloudVisionV1p4beta1ImageAnnotationContext) MarshalJSON() ([]byte, error) {
  9079. type NoMethod GoogleCloudVisionV1p4beta1ImageAnnotationContext
  9080. raw := NoMethod(*s)
  9081. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9082. }
  9083. // GoogleCloudVisionV1p4beta1ImageProperties: Stores image properties,
  9084. // such as dominant colors.
  9085. type GoogleCloudVisionV1p4beta1ImageProperties struct {
  9086. // DominantColors: If present, dominant colors completed successfully.
  9087. DominantColors *GoogleCloudVisionV1p4beta1DominantColorsAnnotation `json:"dominantColors,omitempty"`
  9088. // ForceSendFields is a list of field names (e.g. "DominantColors") to
  9089. // unconditionally include in API requests. By default, fields with
  9090. // empty values are omitted from API requests. However, any non-pointer,
  9091. // non-interface field appearing in ForceSendFields will be sent to the
  9092. // server regardless of whether the field is empty or not. This may be
  9093. // used to include empty fields in Patch requests.
  9094. ForceSendFields []string `json:"-"`
  9095. // NullFields is a list of field names (e.g. "DominantColors") to
  9096. // include in API requests with the JSON null value. By default, fields
  9097. // with empty values are omitted from API requests. However, any field
  9098. // with an empty value appearing in NullFields will be sent to the
  9099. // server as null. It is an error if a field in this list has a
  9100. // non-empty value. This may be used to include null fields in Patch
  9101. // requests.
  9102. NullFields []string `json:"-"`
  9103. }
  9104. func (s *GoogleCloudVisionV1p4beta1ImageProperties) MarshalJSON() ([]byte, error) {
  9105. type NoMethod GoogleCloudVisionV1p4beta1ImageProperties
  9106. raw := NoMethod(*s)
  9107. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9108. }
  9109. // GoogleCloudVisionV1p4beta1ImportProductSetsResponse: Response message
  9110. // for the `ImportProductSets` method.
  9111. //
  9112. // This message is returned by
  9113. // the
  9114. // google.longrunning.Operations.GetOperation method in the
  9115. // returned
  9116. // google.longrunning.Operation.response field.
  9117. type GoogleCloudVisionV1p4beta1ImportProductSetsResponse struct {
  9118. // ReferenceImages: The list of reference_images that are imported
  9119. // successfully.
  9120. ReferenceImages []*GoogleCloudVisionV1p4beta1ReferenceImage `json:"referenceImages,omitempty"`
  9121. // Statuses: The rpc status for each ImportProductSet request, including
  9122. // both successes
  9123. // and errors.
  9124. //
  9125. // The number of statuses here matches the number of lines in the csv
  9126. // file,
  9127. // and statuses[i] stores the success or failure status of processing
  9128. // the i-th
  9129. // line of the csv, starting from line 0.
  9130. Statuses []*Status `json:"statuses,omitempty"`
  9131. // ForceSendFields is a list of field names (e.g. "ReferenceImages") to
  9132. // unconditionally include in API requests. By default, fields with
  9133. // empty values are omitted from API requests. However, any non-pointer,
  9134. // non-interface field appearing in ForceSendFields will be sent to the
  9135. // server regardless of whether the field is empty or not. This may be
  9136. // used to include empty fields in Patch requests.
  9137. ForceSendFields []string `json:"-"`
  9138. // NullFields is a list of field names (e.g. "ReferenceImages") to
  9139. // include in API requests with the JSON null value. By default, fields
  9140. // with empty values are omitted from API requests. However, any field
  9141. // with an empty value appearing in NullFields will be sent to the
  9142. // server as null. It is an error if a field in this list has a
  9143. // non-empty value. This may be used to include null fields in Patch
  9144. // requests.
  9145. NullFields []string `json:"-"`
  9146. }
  9147. func (s *GoogleCloudVisionV1p4beta1ImportProductSetsResponse) MarshalJSON() ([]byte, error) {
  9148. type NoMethod GoogleCloudVisionV1p4beta1ImportProductSetsResponse
  9149. raw := NoMethod(*s)
  9150. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9151. }
  9152. // GoogleCloudVisionV1p4beta1InputConfig: The desired input location and
  9153. // metadata.
  9154. type GoogleCloudVisionV1p4beta1InputConfig struct {
  9155. // Content: File content, represented as a stream of bytes.
  9156. // Note: As with all `bytes` fields, protobuffers use a pure
  9157. // binary
  9158. // representation, whereas JSON representations use base64.
  9159. //
  9160. // Currently, this field only works for BatchAnnotateFiles requests. It
  9161. // does
  9162. // not work for AsyncBatchAnnotateFiles requests.
  9163. Content string `json:"content,omitempty"`
  9164. // GcsSource: The Google Cloud Storage location to read the input from.
  9165. GcsSource *GoogleCloudVisionV1p4beta1GcsSource `json:"gcsSource,omitempty"`
  9166. // MimeType: The type of the file. Currently only "application/pdf" and
  9167. // "image/tiff"
  9168. // are supported. Wildcards are not supported.
  9169. MimeType string `json:"mimeType,omitempty"`
  9170. // ForceSendFields is a list of field names (e.g. "Content") to
  9171. // unconditionally include in API requests. By default, fields with
  9172. // empty values are omitted from API requests. However, any non-pointer,
  9173. // non-interface field appearing in ForceSendFields will be sent to the
  9174. // server regardless of whether the field is empty or not. This may be
  9175. // used to include empty fields in Patch requests.
  9176. ForceSendFields []string `json:"-"`
  9177. // NullFields is a list of field names (e.g. "Content") to include in
  9178. // API requests with the JSON null value. By default, fields with empty
  9179. // values are omitted from API requests. However, any field with an
  9180. // empty value appearing in NullFields will be sent to the server as
  9181. // null. It is an error if a field in this list has a non-empty value.
  9182. // This may be used to include null fields in Patch requests.
  9183. NullFields []string `json:"-"`
  9184. }
  9185. func (s *GoogleCloudVisionV1p4beta1InputConfig) MarshalJSON() ([]byte, error) {
  9186. type NoMethod GoogleCloudVisionV1p4beta1InputConfig
  9187. raw := NoMethod(*s)
  9188. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9189. }
  9190. // GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation: Set of detected
  9191. // objects with bounding boxes.
  9192. type GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation struct {
  9193. // BoundingPoly: Image region to which this object belongs. This must be
  9194. // populated.
  9195. BoundingPoly *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingPoly,omitempty"`
  9196. // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn".
  9197. // For more
  9198. // information,
  9199. // see
  9200. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  9201. LanguageCode string `json:"languageCode,omitempty"`
  9202. // Mid: Object ID that should align with EntityAnnotation mid.
  9203. Mid string `json:"mid,omitempty"`
  9204. // Name: Object name, expressed in its `language_code` language.
  9205. Name string `json:"name,omitempty"`
  9206. // Score: Score of the result. Range [0, 1].
  9207. Score float64 `json:"score,omitempty"`
  9208. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  9209. // unconditionally include in API requests. By default, fields with
  9210. // empty values are omitted from API requests. However, any non-pointer,
  9211. // non-interface field appearing in ForceSendFields will be sent to the
  9212. // server regardless of whether the field is empty or not. This may be
  9213. // used to include empty fields in Patch requests.
  9214. ForceSendFields []string `json:"-"`
  9215. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  9216. // in API requests with the JSON null value. By default, fields with
  9217. // empty values are omitted from API requests. However, any field with
  9218. // an empty value appearing in NullFields will be sent to the server as
  9219. // null. It is an error if a field in this list has a non-empty value.
  9220. // This may be used to include null fields in Patch requests.
  9221. NullFields []string `json:"-"`
  9222. }
  9223. func (s *GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation) MarshalJSON() ([]byte, error) {
  9224. type NoMethod GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation
  9225. raw := NoMethod(*s)
  9226. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9227. }
  9228. func (s *GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation) UnmarshalJSON(data []byte) error {
  9229. type NoMethod GoogleCloudVisionV1p4beta1LocalizedObjectAnnotation
  9230. var s1 struct {
  9231. Score gensupport.JSONFloat64 `json:"score"`
  9232. *NoMethod
  9233. }
  9234. s1.NoMethod = (*NoMethod)(s)
  9235. if err := json.Unmarshal(data, &s1); err != nil {
  9236. return err
  9237. }
  9238. s.Score = float64(s1.Score)
  9239. return nil
  9240. }
  9241. // GoogleCloudVisionV1p4beta1LocationInfo: Detected entity location
  9242. // information.
  9243. type GoogleCloudVisionV1p4beta1LocationInfo struct {
  9244. // LatLng: lat/long location coordinates.
  9245. LatLng *LatLng `json:"latLng,omitempty"`
  9246. // ForceSendFields is a list of field names (e.g. "LatLng") to
  9247. // unconditionally include in API requests. By default, fields with
  9248. // empty values are omitted from API requests. However, any non-pointer,
  9249. // non-interface field appearing in ForceSendFields will be sent to the
  9250. // server regardless of whether the field is empty or not. This may be
  9251. // used to include empty fields in Patch requests.
  9252. ForceSendFields []string `json:"-"`
  9253. // NullFields is a list of field names (e.g. "LatLng") to include in API
  9254. // requests with the JSON null value. By default, fields with empty
  9255. // values are omitted from API requests. However, any field with an
  9256. // empty value appearing in NullFields will be sent to the server as
  9257. // null. It is an error if a field in this list has a non-empty value.
  9258. // This may be used to include null fields in Patch requests.
  9259. NullFields []string `json:"-"`
  9260. }
  9261. func (s *GoogleCloudVisionV1p4beta1LocationInfo) MarshalJSON() ([]byte, error) {
  9262. type NoMethod GoogleCloudVisionV1p4beta1LocationInfo
  9263. raw := NoMethod(*s)
  9264. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9265. }
  9266. // GoogleCloudVisionV1p4beta1NormalizedVertex: A vertex represents a 2D
  9267. // point in the image.
  9268. // NOTE: the normalized vertex coordinates are relative to the original
  9269. // image
  9270. // and range from 0 to 1.
  9271. type GoogleCloudVisionV1p4beta1NormalizedVertex struct {
  9272. // X: X coordinate.
  9273. X float64 `json:"x,omitempty"`
  9274. // Y: Y coordinate.
  9275. Y float64 `json:"y,omitempty"`
  9276. // ForceSendFields is a list of field names (e.g. "X") to
  9277. // unconditionally include in API requests. By default, fields with
  9278. // empty values are omitted from API requests. However, any non-pointer,
  9279. // non-interface field appearing in ForceSendFields will be sent to the
  9280. // server regardless of whether the field is empty or not. This may be
  9281. // used to include empty fields in Patch requests.
  9282. ForceSendFields []string `json:"-"`
  9283. // NullFields is a list of field names (e.g. "X") to include in API
  9284. // requests with the JSON null value. By default, fields with empty
  9285. // values are omitted from API requests. However, any field with an
  9286. // empty value appearing in NullFields will be sent to the server as
  9287. // null. It is an error if a field in this list has a non-empty value.
  9288. // This may be used to include null fields in Patch requests.
  9289. NullFields []string `json:"-"`
  9290. }
  9291. func (s *GoogleCloudVisionV1p4beta1NormalizedVertex) MarshalJSON() ([]byte, error) {
  9292. type NoMethod GoogleCloudVisionV1p4beta1NormalizedVertex
  9293. raw := NoMethod(*s)
  9294. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9295. }
  9296. func (s *GoogleCloudVisionV1p4beta1NormalizedVertex) UnmarshalJSON(data []byte) error {
  9297. type NoMethod GoogleCloudVisionV1p4beta1NormalizedVertex
  9298. var s1 struct {
  9299. X gensupport.JSONFloat64 `json:"x"`
  9300. Y gensupport.JSONFloat64 `json:"y"`
  9301. *NoMethod
  9302. }
  9303. s1.NoMethod = (*NoMethod)(s)
  9304. if err := json.Unmarshal(data, &s1); err != nil {
  9305. return err
  9306. }
  9307. s.X = float64(s1.X)
  9308. s.Y = float64(s1.Y)
  9309. return nil
  9310. }
  9311. // GoogleCloudVisionV1p4beta1OperationMetadata: Contains metadata for
  9312. // the BatchAnnotateImages operation.
  9313. type GoogleCloudVisionV1p4beta1OperationMetadata struct {
  9314. // CreateTime: The time when the batch request was received.
  9315. CreateTime string `json:"createTime,omitempty"`
  9316. // State: Current state of the batch operation.
  9317. //
  9318. // Possible values:
  9319. // "STATE_UNSPECIFIED" - Invalid.
  9320. // "CREATED" - Request is received.
  9321. // "RUNNING" - Request is actively being processed.
  9322. // "DONE" - The batch processing is done.
  9323. // "CANCELLED" - The batch processing was cancelled.
  9324. State string `json:"state,omitempty"`
  9325. // UpdateTime: The time when the operation result was last updated.
  9326. UpdateTime string `json:"updateTime,omitempty"`
  9327. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  9328. // unconditionally include in API requests. By default, fields with
  9329. // empty values are omitted from API requests. However, any non-pointer,
  9330. // non-interface field appearing in ForceSendFields will be sent to the
  9331. // server regardless of whether the field is empty or not. This may be
  9332. // used to include empty fields in Patch requests.
  9333. ForceSendFields []string `json:"-"`
  9334. // NullFields is a list of field names (e.g. "CreateTime") to include in
  9335. // API requests with the JSON null value. By default, fields with empty
  9336. // values are omitted from API requests. However, any field with an
  9337. // empty value appearing in NullFields will be sent to the server as
  9338. // null. It is an error if a field in this list has a non-empty value.
  9339. // This may be used to include null fields in Patch requests.
  9340. NullFields []string `json:"-"`
  9341. }
  9342. func (s *GoogleCloudVisionV1p4beta1OperationMetadata) MarshalJSON() ([]byte, error) {
  9343. type NoMethod GoogleCloudVisionV1p4beta1OperationMetadata
  9344. raw := NoMethod(*s)
  9345. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9346. }
  9347. // GoogleCloudVisionV1p4beta1OutputConfig: The desired output location
  9348. // and metadata.
  9349. type GoogleCloudVisionV1p4beta1OutputConfig struct {
  9350. // BatchSize: The max number of response protos to put into each output
  9351. // JSON file on
  9352. // Google Cloud Storage.
  9353. // The valid range is [1, 100]. If not specified, the default value is
  9354. // 20.
  9355. //
  9356. // For example, for one pdf file with 100 pages, 100 response protos
  9357. // will
  9358. // be generated. If `batch_size` = 20, then 5 json files each
  9359. // containing 20 response protos will be written under the
  9360. // prefix
  9361. // `gcs_destination`.`uri`.
  9362. //
  9363. // Currently, batch_size only applies to GcsDestination, with potential
  9364. // future
  9365. // support for other output configurations.
  9366. BatchSize int64 `json:"batchSize,omitempty"`
  9367. // GcsDestination: The Google Cloud Storage location to write the
  9368. // output(s) to.
  9369. GcsDestination *GoogleCloudVisionV1p4beta1GcsDestination `json:"gcsDestination,omitempty"`
  9370. // ForceSendFields is a list of field names (e.g. "BatchSize") to
  9371. // unconditionally include in API requests. By default, fields with
  9372. // empty values are omitted from API requests. However, any non-pointer,
  9373. // non-interface field appearing in ForceSendFields will be sent to the
  9374. // server regardless of whether the field is empty or not. This may be
  9375. // used to include empty fields in Patch requests.
  9376. ForceSendFields []string `json:"-"`
  9377. // NullFields is a list of field names (e.g. "BatchSize") to include in
  9378. // API requests with the JSON null value. By default, fields with empty
  9379. // values are omitted from API requests. However, any field with an
  9380. // empty value appearing in NullFields will be sent to the server as
  9381. // null. It is an error if a field in this list has a non-empty value.
  9382. // This may be used to include null fields in Patch requests.
  9383. NullFields []string `json:"-"`
  9384. }
  9385. func (s *GoogleCloudVisionV1p4beta1OutputConfig) MarshalJSON() ([]byte, error) {
  9386. type NoMethod GoogleCloudVisionV1p4beta1OutputConfig
  9387. raw := NoMethod(*s)
  9388. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9389. }
  9390. // GoogleCloudVisionV1p4beta1Page: Detected page from OCR.
  9391. type GoogleCloudVisionV1p4beta1Page struct {
  9392. // Blocks: List of blocks of text, images etc on this page.
  9393. Blocks []*GoogleCloudVisionV1p4beta1Block `json:"blocks,omitempty"`
  9394. // Confidence: Confidence of the OCR results on the page. Range [0, 1].
  9395. Confidence float64 `json:"confidence,omitempty"`
  9396. // Height: Page height. For PDFs the unit is points. For images
  9397. // (including
  9398. // TIFFs) the unit is pixels.
  9399. Height int64 `json:"height,omitempty"`
  9400. // Property: Additional information detected on the page.
  9401. Property *GoogleCloudVisionV1p4beta1TextAnnotationTextProperty `json:"property,omitempty"`
  9402. // Width: Page width. For PDFs the unit is points. For images
  9403. // (including
  9404. // TIFFs) the unit is pixels.
  9405. Width int64 `json:"width,omitempty"`
  9406. // ForceSendFields is a list of field names (e.g. "Blocks") to
  9407. // unconditionally include in API requests. By default, fields with
  9408. // empty values are omitted from API requests. However, any non-pointer,
  9409. // non-interface field appearing in ForceSendFields will be sent to the
  9410. // server regardless of whether the field is empty or not. This may be
  9411. // used to include empty fields in Patch requests.
  9412. ForceSendFields []string `json:"-"`
  9413. // NullFields is a list of field names (e.g. "Blocks") to include in API
  9414. // requests with the JSON null value. By default, fields with empty
  9415. // values are omitted from API requests. However, any field with an
  9416. // empty value appearing in NullFields will be sent to the server as
  9417. // null. It is an error if a field in this list has a non-empty value.
  9418. // This may be used to include null fields in Patch requests.
  9419. NullFields []string `json:"-"`
  9420. }
  9421. func (s *GoogleCloudVisionV1p4beta1Page) MarshalJSON() ([]byte, error) {
  9422. type NoMethod GoogleCloudVisionV1p4beta1Page
  9423. raw := NoMethod(*s)
  9424. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9425. }
  9426. func (s *GoogleCloudVisionV1p4beta1Page) UnmarshalJSON(data []byte) error {
  9427. type NoMethod GoogleCloudVisionV1p4beta1Page
  9428. var s1 struct {
  9429. Confidence gensupport.JSONFloat64 `json:"confidence"`
  9430. *NoMethod
  9431. }
  9432. s1.NoMethod = (*NoMethod)(s)
  9433. if err := json.Unmarshal(data, &s1); err != nil {
  9434. return err
  9435. }
  9436. s.Confidence = float64(s1.Confidence)
  9437. return nil
  9438. }
  9439. // GoogleCloudVisionV1p4beta1Paragraph: Structural unit of text
  9440. // representing a number of words in certain order.
  9441. type GoogleCloudVisionV1p4beta1Paragraph struct {
  9442. // BoundingBox: The bounding box for the paragraph.
  9443. // The vertices are in the order of top-left, top-right,
  9444. // bottom-right,
  9445. // bottom-left. When a rotation of the bounding box is detected the
  9446. // rotation
  9447. // is represented as around the top-left corner as defined when the text
  9448. // is
  9449. // read in the 'natural' orientation.
  9450. // For example:
  9451. // * when the text is horizontal it might look like:
  9452. // 0----1
  9453. // | |
  9454. // 3----2
  9455. // * when it's rotated 180 degrees around the top-left corner it
  9456. // becomes:
  9457. // 2----3
  9458. // | |
  9459. // 1----0
  9460. // and the vertex order will still be (0, 1, 2, 3).
  9461. BoundingBox *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingBox,omitempty"`
  9462. // Confidence: Confidence of the OCR results for the paragraph. Range
  9463. // [0, 1].
  9464. Confidence float64 `json:"confidence,omitempty"`
  9465. // Property: Additional information detected for the paragraph.
  9466. Property *GoogleCloudVisionV1p4beta1TextAnnotationTextProperty `json:"property,omitempty"`
  9467. // Words: List of words in this paragraph.
  9468. Words []*GoogleCloudVisionV1p4beta1Word `json:"words,omitempty"`
  9469. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  9470. // unconditionally include in API requests. By default, fields with
  9471. // empty values are omitted from API requests. However, any non-pointer,
  9472. // non-interface field appearing in ForceSendFields will be sent to the
  9473. // server regardless of whether the field is empty or not. This may be
  9474. // used to include empty fields in Patch requests.
  9475. ForceSendFields []string `json:"-"`
  9476. // NullFields is a list of field names (e.g. "BoundingBox") to include
  9477. // in API requests with the JSON null value. By default, fields with
  9478. // empty values are omitted from API requests. However, any field with
  9479. // an empty value appearing in NullFields will be sent to the server as
  9480. // null. It is an error if a field in this list has a non-empty value.
  9481. // This may be used to include null fields in Patch requests.
  9482. NullFields []string `json:"-"`
  9483. }
  9484. func (s *GoogleCloudVisionV1p4beta1Paragraph) MarshalJSON() ([]byte, error) {
  9485. type NoMethod GoogleCloudVisionV1p4beta1Paragraph
  9486. raw := NoMethod(*s)
  9487. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9488. }
  9489. func (s *GoogleCloudVisionV1p4beta1Paragraph) UnmarshalJSON(data []byte) error {
  9490. type NoMethod GoogleCloudVisionV1p4beta1Paragraph
  9491. var s1 struct {
  9492. Confidence gensupport.JSONFloat64 `json:"confidence"`
  9493. *NoMethod
  9494. }
  9495. s1.NoMethod = (*NoMethod)(s)
  9496. if err := json.Unmarshal(data, &s1); err != nil {
  9497. return err
  9498. }
  9499. s.Confidence = float64(s1.Confidence)
  9500. return nil
  9501. }
  9502. // GoogleCloudVisionV1p4beta1Position: A 3D position in the image, used
  9503. // primarily for Face detection landmarks.
  9504. // A valid Position must have both x and y coordinates.
  9505. // The position coordinates are in the same scale as the original image.
  9506. type GoogleCloudVisionV1p4beta1Position struct {
  9507. // X: X coordinate.
  9508. X float64 `json:"x,omitempty"`
  9509. // Y: Y coordinate.
  9510. Y float64 `json:"y,omitempty"`
  9511. // Z: Z coordinate (or depth).
  9512. Z float64 `json:"z,omitempty"`
  9513. // ForceSendFields is a list of field names (e.g. "X") to
  9514. // unconditionally include in API requests. By default, fields with
  9515. // empty values are omitted from API requests. However, any non-pointer,
  9516. // non-interface field appearing in ForceSendFields will be sent to the
  9517. // server regardless of whether the field is empty or not. This may be
  9518. // used to include empty fields in Patch requests.
  9519. ForceSendFields []string `json:"-"`
  9520. // NullFields is a list of field names (e.g. "X") to include in API
  9521. // requests with the JSON null value. By default, fields with empty
  9522. // values are omitted from API requests. However, any field with an
  9523. // empty value appearing in NullFields will be sent to the server as
  9524. // null. It is an error if a field in this list has a non-empty value.
  9525. // This may be used to include null fields in Patch requests.
  9526. NullFields []string `json:"-"`
  9527. }
  9528. func (s *GoogleCloudVisionV1p4beta1Position) MarshalJSON() ([]byte, error) {
  9529. type NoMethod GoogleCloudVisionV1p4beta1Position
  9530. raw := NoMethod(*s)
  9531. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9532. }
  9533. func (s *GoogleCloudVisionV1p4beta1Position) UnmarshalJSON(data []byte) error {
  9534. type NoMethod GoogleCloudVisionV1p4beta1Position
  9535. var s1 struct {
  9536. X gensupport.JSONFloat64 `json:"x"`
  9537. Y gensupport.JSONFloat64 `json:"y"`
  9538. Z gensupport.JSONFloat64 `json:"z"`
  9539. *NoMethod
  9540. }
  9541. s1.NoMethod = (*NoMethod)(s)
  9542. if err := json.Unmarshal(data, &s1); err != nil {
  9543. return err
  9544. }
  9545. s.X = float64(s1.X)
  9546. s.Y = float64(s1.Y)
  9547. s.Z = float64(s1.Z)
  9548. return nil
  9549. }
  9550. // GoogleCloudVisionV1p4beta1Product: A Product contains
  9551. // ReferenceImages.
  9552. type GoogleCloudVisionV1p4beta1Product struct {
  9553. // Description: User-provided metadata to be stored with this product.
  9554. // Must be at most 4096
  9555. // characters long.
  9556. Description string `json:"description,omitempty"`
  9557. // DisplayName: The user-provided name for this Product. Must not be
  9558. // empty. Must be at most
  9559. // 4096 characters long.
  9560. DisplayName string `json:"displayName,omitempty"`
  9561. // Name: The resource name of the product.
  9562. //
  9563. // Format
  9564. // is:
  9565. // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
  9566. //
  9567. // This field is ignored when creating a product.
  9568. Name string `json:"name,omitempty"`
  9569. // ProductCategory: The category for the product identified by the
  9570. // reference image. This should
  9571. // be either "homegoods", "apparel", or "toys".
  9572. //
  9573. // This field is immutable.
  9574. ProductCategory string `json:"productCategory,omitempty"`
  9575. // ProductLabels: Key-value pairs that can be attached to a product. At
  9576. // query time,
  9577. // constraints can be specified based on the product_labels.
  9578. //
  9579. // Note that integer values can be provided as strings, e.g. "1199".
  9580. // Only
  9581. // strings with integer values can match a range-based restriction which
  9582. // is
  9583. // to be supported soon.
  9584. //
  9585. // Multiple values can be assigned to the same key. One product may have
  9586. // up to
  9587. // 100 product_labels.
  9588. ProductLabels []*GoogleCloudVisionV1p4beta1ProductKeyValue `json:"productLabels,omitempty"`
  9589. // ForceSendFields is a list of field names (e.g. "Description") to
  9590. // unconditionally include in API requests. By default, fields with
  9591. // empty values are omitted from API requests. However, any non-pointer,
  9592. // non-interface field appearing in ForceSendFields will be sent to the
  9593. // server regardless of whether the field is empty or not. This may be
  9594. // used to include empty fields in Patch requests.
  9595. ForceSendFields []string `json:"-"`
  9596. // NullFields is a list of field names (e.g. "Description") to include
  9597. // in API requests with the JSON null value. By default, fields with
  9598. // empty values are omitted from API requests. However, any field with
  9599. // an empty value appearing in NullFields will be sent to the server as
  9600. // null. It is an error if a field in this list has a non-empty value.
  9601. // This may be used to include null fields in Patch requests.
  9602. NullFields []string `json:"-"`
  9603. }
  9604. func (s *GoogleCloudVisionV1p4beta1Product) MarshalJSON() ([]byte, error) {
  9605. type NoMethod GoogleCloudVisionV1p4beta1Product
  9606. raw := NoMethod(*s)
  9607. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9608. }
  9609. // GoogleCloudVisionV1p4beta1ProductKeyValue: A product label
  9610. // represented as a key-value pair.
  9611. type GoogleCloudVisionV1p4beta1ProductKeyValue struct {
  9612. // Key: The key of the label attached to the product. Cannot be empty
  9613. // and cannot
  9614. // exceed 128 bytes.
  9615. Key string `json:"key,omitempty"`
  9616. // Value: The value of the label attached to the product. Cannot be
  9617. // empty and
  9618. // cannot exceed 128 bytes.
  9619. Value string `json:"value,omitempty"`
  9620. // ForceSendFields is a list of field names (e.g. "Key") to
  9621. // unconditionally include in API requests. By default, fields with
  9622. // empty values are omitted from API requests. However, any non-pointer,
  9623. // non-interface field appearing in ForceSendFields will be sent to the
  9624. // server regardless of whether the field is empty or not. This may be
  9625. // used to include empty fields in Patch requests.
  9626. ForceSendFields []string `json:"-"`
  9627. // NullFields is a list of field names (e.g. "Key") to include in API
  9628. // requests with the JSON null value. By default, fields with empty
  9629. // values are omitted from API requests. However, any field with an
  9630. // empty value appearing in NullFields will be sent to the server as
  9631. // null. It is an error if a field in this list has a non-empty value.
  9632. // This may be used to include null fields in Patch requests.
  9633. NullFields []string `json:"-"`
  9634. }
  9635. func (s *GoogleCloudVisionV1p4beta1ProductKeyValue) MarshalJSON() ([]byte, error) {
  9636. type NoMethod GoogleCloudVisionV1p4beta1ProductKeyValue
  9637. raw := NoMethod(*s)
  9638. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9639. }
  9640. // GoogleCloudVisionV1p4beta1ProductSearchResults: Results for a product
  9641. // search request.
  9642. type GoogleCloudVisionV1p4beta1ProductSearchResults struct {
  9643. // IndexTime: Timestamp of the index which provided these results.
  9644. // Changes made after
  9645. // this time are not reflected in the current results.
  9646. IndexTime string `json:"indexTime,omitempty"`
  9647. // ProductGroupedResults: List of results grouped by products detected
  9648. // in the query image. Each entry
  9649. // corresponds to one bounding polygon in the query image, and contains
  9650. // the
  9651. // matching products specific to that region. There may be duplicate
  9652. // product
  9653. // matches in the union of all the per-product results.
  9654. ProductGroupedResults []*GoogleCloudVisionV1p4beta1ProductSearchResultsGroupedResult `json:"productGroupedResults,omitempty"`
  9655. // Results: List of results, one for each product match.
  9656. Results []*GoogleCloudVisionV1p4beta1ProductSearchResultsResult `json:"results,omitempty"`
  9657. // ForceSendFields is a list of field names (e.g. "IndexTime") to
  9658. // unconditionally include in API requests. By default, fields with
  9659. // empty values are omitted from API requests. However, any non-pointer,
  9660. // non-interface field appearing in ForceSendFields will be sent to the
  9661. // server regardless of whether the field is empty or not. This may be
  9662. // used to include empty fields in Patch requests.
  9663. ForceSendFields []string `json:"-"`
  9664. // NullFields is a list of field names (e.g. "IndexTime") to include in
  9665. // API requests with the JSON null value. By default, fields with empty
  9666. // values are omitted from API requests. However, any field with an
  9667. // empty value appearing in NullFields will be sent to the server as
  9668. // null. It is an error if a field in this list has a non-empty value.
  9669. // This may be used to include null fields in Patch requests.
  9670. NullFields []string `json:"-"`
  9671. }
  9672. func (s *GoogleCloudVisionV1p4beta1ProductSearchResults) MarshalJSON() ([]byte, error) {
  9673. type NoMethod GoogleCloudVisionV1p4beta1ProductSearchResults
  9674. raw := NoMethod(*s)
  9675. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9676. }
  9677. // GoogleCloudVisionV1p4beta1ProductSearchResultsGroupedResult:
  9678. // Information about the products similar to a single product in a
  9679. // query
  9680. // image.
  9681. type GoogleCloudVisionV1p4beta1ProductSearchResultsGroupedResult struct {
  9682. // BoundingPoly: The bounding polygon around the product detected in the
  9683. // query image.
  9684. BoundingPoly *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingPoly,omitempty"`
  9685. // Results: List of results, one for each product match.
  9686. Results []*GoogleCloudVisionV1p4beta1ProductSearchResultsResult `json:"results,omitempty"`
  9687. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  9688. // unconditionally include in API requests. By default, fields with
  9689. // empty values are omitted from API requests. However, any non-pointer,
  9690. // non-interface field appearing in ForceSendFields will be sent to the
  9691. // server regardless of whether the field is empty or not. This may be
  9692. // used to include empty fields in Patch requests.
  9693. ForceSendFields []string `json:"-"`
  9694. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  9695. // in API requests with the JSON null value. By default, fields with
  9696. // empty values are omitted from API requests. However, any field with
  9697. // an empty value appearing in NullFields will be sent to the server as
  9698. // null. It is an error if a field in this list has a non-empty value.
  9699. // This may be used to include null fields in Patch requests.
  9700. NullFields []string `json:"-"`
  9701. }
  9702. func (s *GoogleCloudVisionV1p4beta1ProductSearchResultsGroupedResult) MarshalJSON() ([]byte, error) {
  9703. type NoMethod GoogleCloudVisionV1p4beta1ProductSearchResultsGroupedResult
  9704. raw := NoMethod(*s)
  9705. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9706. }
  9707. // GoogleCloudVisionV1p4beta1ProductSearchResultsResult: Information
  9708. // about a product.
  9709. type GoogleCloudVisionV1p4beta1ProductSearchResultsResult struct {
  9710. // Image: The resource name of the image from the product that is the
  9711. // closest match
  9712. // to the query.
  9713. Image string `json:"image,omitempty"`
  9714. // Product: The Product.
  9715. Product *GoogleCloudVisionV1p4beta1Product `json:"product,omitempty"`
  9716. // Score: A confidence level on the match, ranging from 0 (no
  9717. // confidence) to
  9718. // 1 (full confidence).
  9719. Score float64 `json:"score,omitempty"`
  9720. // ForceSendFields is a list of field names (e.g. "Image") to
  9721. // unconditionally include in API requests. By default, fields with
  9722. // empty values are omitted from API requests. However, any non-pointer,
  9723. // non-interface field appearing in ForceSendFields will be sent to the
  9724. // server regardless of whether the field is empty or not. This may be
  9725. // used to include empty fields in Patch requests.
  9726. ForceSendFields []string `json:"-"`
  9727. // NullFields is a list of field names (e.g. "Image") to include in API
  9728. // requests with the JSON null value. By default, fields with empty
  9729. // values are omitted from API requests. However, any field with an
  9730. // empty value appearing in NullFields will be sent to the server as
  9731. // null. It is an error if a field in this list has a non-empty value.
  9732. // This may be used to include null fields in Patch requests.
  9733. NullFields []string `json:"-"`
  9734. }
  9735. func (s *GoogleCloudVisionV1p4beta1ProductSearchResultsResult) MarshalJSON() ([]byte, error) {
  9736. type NoMethod GoogleCloudVisionV1p4beta1ProductSearchResultsResult
  9737. raw := NoMethod(*s)
  9738. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9739. }
  9740. func (s *GoogleCloudVisionV1p4beta1ProductSearchResultsResult) UnmarshalJSON(data []byte) error {
  9741. type NoMethod GoogleCloudVisionV1p4beta1ProductSearchResultsResult
  9742. var s1 struct {
  9743. Score gensupport.JSONFloat64 `json:"score"`
  9744. *NoMethod
  9745. }
  9746. s1.NoMethod = (*NoMethod)(s)
  9747. if err := json.Unmarshal(data, &s1); err != nil {
  9748. return err
  9749. }
  9750. s.Score = float64(s1.Score)
  9751. return nil
  9752. }
  9753. // GoogleCloudVisionV1p4beta1Property: A `Property` consists of a
  9754. // user-supplied name/value pair.
  9755. type GoogleCloudVisionV1p4beta1Property struct {
  9756. // Name: Name of the property.
  9757. Name string `json:"name,omitempty"`
  9758. // Uint64Value: Value of numeric properties.
  9759. Uint64Value uint64 `json:"uint64Value,omitempty,string"`
  9760. // Value: Value of the property.
  9761. Value string `json:"value,omitempty"`
  9762. // ForceSendFields is a list of field names (e.g. "Name") to
  9763. // unconditionally include in API requests. By default, fields with
  9764. // empty values are omitted from API requests. However, any non-pointer,
  9765. // non-interface field appearing in ForceSendFields will be sent to the
  9766. // server regardless of whether the field is empty or not. This may be
  9767. // used to include empty fields in Patch requests.
  9768. ForceSendFields []string `json:"-"`
  9769. // NullFields is a list of field names (e.g. "Name") to include in API
  9770. // requests with the JSON null value. By default, fields with empty
  9771. // values are omitted from API requests. However, any field with an
  9772. // empty value appearing in NullFields will be sent to the server as
  9773. // null. It is an error if a field in this list has a non-empty value.
  9774. // This may be used to include null fields in Patch requests.
  9775. NullFields []string `json:"-"`
  9776. }
  9777. func (s *GoogleCloudVisionV1p4beta1Property) MarshalJSON() ([]byte, error) {
  9778. type NoMethod GoogleCloudVisionV1p4beta1Property
  9779. raw := NoMethod(*s)
  9780. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9781. }
  9782. // GoogleCloudVisionV1p4beta1ReferenceImage: A `ReferenceImage`
  9783. // represents a product image and its associated metadata,
  9784. // such as bounding boxes.
  9785. type GoogleCloudVisionV1p4beta1ReferenceImage struct {
  9786. // BoundingPolys: Bounding polygons around the areas of interest in the
  9787. // reference image.
  9788. // Optional. If this field is empty, the system will try to detect
  9789. // regions of
  9790. // interest. At most 10 bounding polygons will be used.
  9791. //
  9792. // The provided shape is converted into a non-rotated rectangle.
  9793. // Once
  9794. // converted, the small edge of the rectangle must be greater than or
  9795. // equal
  9796. // to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok;
  9797. // 1:5
  9798. // is not).
  9799. BoundingPolys []*GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingPolys,omitempty"`
  9800. // Name: The resource name of the reference image.
  9801. //
  9802. // Format
  9803. // is:
  9804. //
  9805. // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referen
  9806. // ceImages/IMAGE_ID`.
  9807. //
  9808. // This field is ignored when creating a reference image.
  9809. Name string `json:"name,omitempty"`
  9810. // Uri: The Google Cloud Storage URI of the reference image.
  9811. //
  9812. // The URI must start with `gs://`.
  9813. //
  9814. // Required.
  9815. Uri string `json:"uri,omitempty"`
  9816. // ForceSendFields is a list of field names (e.g. "BoundingPolys") to
  9817. // unconditionally include in API requests. By default, fields with
  9818. // empty values are omitted from API requests. However, any non-pointer,
  9819. // non-interface field appearing in ForceSendFields will be sent to the
  9820. // server regardless of whether the field is empty or not. This may be
  9821. // used to include empty fields in Patch requests.
  9822. ForceSendFields []string `json:"-"`
  9823. // NullFields is a list of field names (e.g. "BoundingPolys") to include
  9824. // in API requests with the JSON null value. By default, fields with
  9825. // empty values are omitted from API requests. However, any field with
  9826. // an empty value appearing in NullFields will be sent to the server as
  9827. // null. It is an error if a field in this list has a non-empty value.
  9828. // This may be used to include null fields in Patch requests.
  9829. NullFields []string `json:"-"`
  9830. }
  9831. func (s *GoogleCloudVisionV1p4beta1ReferenceImage) MarshalJSON() ([]byte, error) {
  9832. type NoMethod GoogleCloudVisionV1p4beta1ReferenceImage
  9833. raw := NoMethod(*s)
  9834. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9835. }
  9836. // GoogleCloudVisionV1p4beta1SafeSearchAnnotation: Set of features
  9837. // pertaining to the image, computed by computer vision
  9838. // methods over safe-search verticals (for example, adult, spoof,
  9839. // medical,
  9840. // violence).
  9841. type GoogleCloudVisionV1p4beta1SafeSearchAnnotation struct {
  9842. // Adult: Represents the adult content likelihood for the image. Adult
  9843. // content may
  9844. // contain elements such as nudity, pornographic images or cartoons,
  9845. // or
  9846. // sexual activities.
  9847. //
  9848. // Possible values:
  9849. // "UNKNOWN" - Unknown likelihood.
  9850. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  9851. // specified vertical.
  9852. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  9853. // vertical.
  9854. // "POSSIBLE" - It is possible that the image belongs to the specified
  9855. // vertical.
  9856. // "LIKELY" - It is likely that the image belongs to the specified
  9857. // vertical.
  9858. // "VERY_LIKELY" - It is very likely that the image belongs to the
  9859. // specified vertical.
  9860. Adult string `json:"adult,omitempty"`
  9861. // Medical: Likelihood that this is a medical image.
  9862. //
  9863. // Possible values:
  9864. // "UNKNOWN" - Unknown likelihood.
  9865. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  9866. // specified vertical.
  9867. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  9868. // vertical.
  9869. // "POSSIBLE" - It is possible that the image belongs to the specified
  9870. // vertical.
  9871. // "LIKELY" - It is likely that the image belongs to the specified
  9872. // vertical.
  9873. // "VERY_LIKELY" - It is very likely that the image belongs to the
  9874. // specified vertical.
  9875. Medical string `json:"medical,omitempty"`
  9876. // Racy: Likelihood that the request image contains racy content. Racy
  9877. // content may
  9878. // include (but is not limited to) skimpy or sheer clothing,
  9879. // strategically
  9880. // covered nudity, lewd or provocative poses, or close-ups of
  9881. // sensitive
  9882. // body areas.
  9883. //
  9884. // Possible values:
  9885. // "UNKNOWN" - Unknown likelihood.
  9886. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  9887. // specified vertical.
  9888. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  9889. // vertical.
  9890. // "POSSIBLE" - It is possible that the image belongs to the specified
  9891. // vertical.
  9892. // "LIKELY" - It is likely that the image belongs to the specified
  9893. // vertical.
  9894. // "VERY_LIKELY" - It is very likely that the image belongs to the
  9895. // specified vertical.
  9896. Racy string `json:"racy,omitempty"`
  9897. // Spoof: Spoof likelihood. The likelihood that an modification
  9898. // was made to the image's canonical version to make it appear
  9899. // funny or offensive.
  9900. //
  9901. // Possible values:
  9902. // "UNKNOWN" - Unknown likelihood.
  9903. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  9904. // specified vertical.
  9905. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  9906. // vertical.
  9907. // "POSSIBLE" - It is possible that the image belongs to the specified
  9908. // vertical.
  9909. // "LIKELY" - It is likely that the image belongs to the specified
  9910. // vertical.
  9911. // "VERY_LIKELY" - It is very likely that the image belongs to the
  9912. // specified vertical.
  9913. Spoof string `json:"spoof,omitempty"`
  9914. // Violence: Likelihood that this image contains violent content.
  9915. //
  9916. // Possible values:
  9917. // "UNKNOWN" - Unknown likelihood.
  9918. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  9919. // specified vertical.
  9920. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  9921. // vertical.
  9922. // "POSSIBLE" - It is possible that the image belongs to the specified
  9923. // vertical.
  9924. // "LIKELY" - It is likely that the image belongs to the specified
  9925. // vertical.
  9926. // "VERY_LIKELY" - It is very likely that the image belongs to the
  9927. // specified vertical.
  9928. Violence string `json:"violence,omitempty"`
  9929. // ForceSendFields is a list of field names (e.g. "Adult") to
  9930. // unconditionally include in API requests. By default, fields with
  9931. // empty values are omitted from API requests. However, any non-pointer,
  9932. // non-interface field appearing in ForceSendFields will be sent to the
  9933. // server regardless of whether the field is empty or not. This may be
  9934. // used to include empty fields in Patch requests.
  9935. ForceSendFields []string `json:"-"`
  9936. // NullFields is a list of field names (e.g. "Adult") to include in API
  9937. // requests with the JSON null value. By default, fields with empty
  9938. // values are omitted from API requests. However, any field with an
  9939. // empty value appearing in NullFields will be sent to the server as
  9940. // null. It is an error if a field in this list has a non-empty value.
  9941. // This may be used to include null fields in Patch requests.
  9942. NullFields []string `json:"-"`
  9943. }
  9944. func (s *GoogleCloudVisionV1p4beta1SafeSearchAnnotation) MarshalJSON() ([]byte, error) {
  9945. type NoMethod GoogleCloudVisionV1p4beta1SafeSearchAnnotation
  9946. raw := NoMethod(*s)
  9947. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9948. }
  9949. // GoogleCloudVisionV1p4beta1Symbol: A single symbol representation.
  9950. type GoogleCloudVisionV1p4beta1Symbol struct {
  9951. // BoundingBox: The bounding box for the symbol.
  9952. // The vertices are in the order of top-left, top-right,
  9953. // bottom-right,
  9954. // bottom-left. When a rotation of the bounding box is detected the
  9955. // rotation
  9956. // is represented as around the top-left corner as defined when the text
  9957. // is
  9958. // read in the 'natural' orientation.
  9959. // For example:
  9960. // * when the text is horizontal it might look like:
  9961. // 0----1
  9962. // | |
  9963. // 3----2
  9964. // * when it's rotated 180 degrees around the top-left corner it
  9965. // becomes:
  9966. // 2----3
  9967. // | |
  9968. // 1----0
  9969. // and the vertice order will still be (0, 1, 2, 3).
  9970. BoundingBox *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingBox,omitempty"`
  9971. // Confidence: Confidence of the OCR results for the symbol. Range [0,
  9972. // 1].
  9973. Confidence float64 `json:"confidence,omitempty"`
  9974. // Property: Additional information detected for the symbol.
  9975. Property *GoogleCloudVisionV1p4beta1TextAnnotationTextProperty `json:"property,omitempty"`
  9976. // Text: The actual UTF-8 representation of the symbol.
  9977. Text string `json:"text,omitempty"`
  9978. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  9979. // unconditionally include in API requests. By default, fields with
  9980. // empty values are omitted from API requests. However, any non-pointer,
  9981. // non-interface field appearing in ForceSendFields will be sent to the
  9982. // server regardless of whether the field is empty or not. This may be
  9983. // used to include empty fields in Patch requests.
  9984. ForceSendFields []string `json:"-"`
  9985. // NullFields is a list of field names (e.g. "BoundingBox") to include
  9986. // in API requests with the JSON null value. By default, fields with
  9987. // empty values are omitted from API requests. However, any field with
  9988. // an empty value appearing in NullFields will be sent to the server as
  9989. // null. It is an error if a field in this list has a non-empty value.
  9990. // This may be used to include null fields in Patch requests.
  9991. NullFields []string `json:"-"`
  9992. }
  9993. func (s *GoogleCloudVisionV1p4beta1Symbol) MarshalJSON() ([]byte, error) {
  9994. type NoMethod GoogleCloudVisionV1p4beta1Symbol
  9995. raw := NoMethod(*s)
  9996. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9997. }
  9998. func (s *GoogleCloudVisionV1p4beta1Symbol) UnmarshalJSON(data []byte) error {
  9999. type NoMethod GoogleCloudVisionV1p4beta1Symbol
  10000. var s1 struct {
  10001. Confidence gensupport.JSONFloat64 `json:"confidence"`
  10002. *NoMethod
  10003. }
  10004. s1.NoMethod = (*NoMethod)(s)
  10005. if err := json.Unmarshal(data, &s1); err != nil {
  10006. return err
  10007. }
  10008. s.Confidence = float64(s1.Confidence)
  10009. return nil
  10010. }
  10011. // GoogleCloudVisionV1p4beta1TextAnnotation: TextAnnotation contains a
  10012. // structured representation of OCR extracted text.
  10013. // The hierarchy of an OCR extracted text structure is like this:
  10014. // TextAnnotation -> Page -> Block -> Paragraph -> Word ->
  10015. // Symbol
  10016. // Each structural component, starting from Page, may further have their
  10017. // own
  10018. // properties. Properties describe detected languages, breaks etc..
  10019. // Please refer
  10020. // to the TextAnnotation.TextProperty message definition below for
  10021. // more
  10022. // detail.
  10023. type GoogleCloudVisionV1p4beta1TextAnnotation struct {
  10024. // Pages: List of pages detected by OCR.
  10025. Pages []*GoogleCloudVisionV1p4beta1Page `json:"pages,omitempty"`
  10026. // Text: UTF-8 text detected on the pages.
  10027. Text string `json:"text,omitempty"`
  10028. // ForceSendFields is a list of field names (e.g. "Pages") to
  10029. // unconditionally include in API requests. By default, fields with
  10030. // empty values are omitted from API requests. However, any non-pointer,
  10031. // non-interface field appearing in ForceSendFields will be sent to the
  10032. // server regardless of whether the field is empty or not. This may be
  10033. // used to include empty fields in Patch requests.
  10034. ForceSendFields []string `json:"-"`
  10035. // NullFields is a list of field names (e.g. "Pages") to include in API
  10036. // requests with the JSON null value. By default, fields with empty
  10037. // values are omitted from API requests. However, any field with an
  10038. // empty value appearing in NullFields will be sent to the server as
  10039. // null. It is an error if a field in this list has a non-empty value.
  10040. // This may be used to include null fields in Patch requests.
  10041. NullFields []string `json:"-"`
  10042. }
  10043. func (s *GoogleCloudVisionV1p4beta1TextAnnotation) MarshalJSON() ([]byte, error) {
  10044. type NoMethod GoogleCloudVisionV1p4beta1TextAnnotation
  10045. raw := NoMethod(*s)
  10046. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10047. }
  10048. // GoogleCloudVisionV1p4beta1TextAnnotationDetectedBreak: Detected start
  10049. // or end of a structural component.
  10050. type GoogleCloudVisionV1p4beta1TextAnnotationDetectedBreak struct {
  10051. // IsPrefix: True if break prepends the element.
  10052. IsPrefix bool `json:"isPrefix,omitempty"`
  10053. // Type: Detected break type.
  10054. //
  10055. // Possible values:
  10056. // "UNKNOWN" - Unknown break label type.
  10057. // "SPACE" - Regular space.
  10058. // "SURE_SPACE" - Sure space (very wide).
  10059. // "EOL_SURE_SPACE" - Line-wrapping break.
  10060. // "HYPHEN" - End-line hyphen that is not present in text; does not
  10061. // co-occur with
  10062. // `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`.
  10063. // "LINE_BREAK" - Line break that ends a paragraph.
  10064. Type string `json:"type,omitempty"`
  10065. // ForceSendFields is a list of field names (e.g. "IsPrefix") to
  10066. // unconditionally include in API requests. By default, fields with
  10067. // empty values are omitted from API requests. However, any non-pointer,
  10068. // non-interface field appearing in ForceSendFields will be sent to the
  10069. // server regardless of whether the field is empty or not. This may be
  10070. // used to include empty fields in Patch requests.
  10071. ForceSendFields []string `json:"-"`
  10072. // NullFields is a list of field names (e.g. "IsPrefix") to include in
  10073. // API requests with the JSON null value. By default, fields with empty
  10074. // values are omitted from API requests. However, any field with an
  10075. // empty value appearing in NullFields will be sent to the server as
  10076. // null. It is an error if a field in this list has a non-empty value.
  10077. // This may be used to include null fields in Patch requests.
  10078. NullFields []string `json:"-"`
  10079. }
  10080. func (s *GoogleCloudVisionV1p4beta1TextAnnotationDetectedBreak) MarshalJSON() ([]byte, error) {
  10081. type NoMethod GoogleCloudVisionV1p4beta1TextAnnotationDetectedBreak
  10082. raw := NoMethod(*s)
  10083. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10084. }
  10085. // GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage: Detected
  10086. // language for a structural component.
  10087. type GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage struct {
  10088. // Confidence: Confidence of detected language. Range [0, 1].
  10089. Confidence float64 `json:"confidence,omitempty"`
  10090. // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn".
  10091. // For more
  10092. // information,
  10093. // see
  10094. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  10095. LanguageCode string `json:"languageCode,omitempty"`
  10096. // ForceSendFields is a list of field names (e.g. "Confidence") to
  10097. // unconditionally include in API requests. By default, fields with
  10098. // empty values are omitted from API requests. However, any non-pointer,
  10099. // non-interface field appearing in ForceSendFields will be sent to the
  10100. // server regardless of whether the field is empty or not. This may be
  10101. // used to include empty fields in Patch requests.
  10102. ForceSendFields []string `json:"-"`
  10103. // NullFields is a list of field names (e.g. "Confidence") to include in
  10104. // API requests with the JSON null value. By default, fields with empty
  10105. // values are omitted from API requests. However, any field with an
  10106. // empty value appearing in NullFields will be sent to the server as
  10107. // null. It is an error if a field in this list has a non-empty value.
  10108. // This may be used to include null fields in Patch requests.
  10109. NullFields []string `json:"-"`
  10110. }
  10111. func (s *GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage) MarshalJSON() ([]byte, error) {
  10112. type NoMethod GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage
  10113. raw := NoMethod(*s)
  10114. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10115. }
  10116. func (s *GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage) UnmarshalJSON(data []byte) error {
  10117. type NoMethod GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage
  10118. var s1 struct {
  10119. Confidence gensupport.JSONFloat64 `json:"confidence"`
  10120. *NoMethod
  10121. }
  10122. s1.NoMethod = (*NoMethod)(s)
  10123. if err := json.Unmarshal(data, &s1); err != nil {
  10124. return err
  10125. }
  10126. s.Confidence = float64(s1.Confidence)
  10127. return nil
  10128. }
  10129. // GoogleCloudVisionV1p4beta1TextAnnotationTextProperty: Additional
  10130. // information detected on the structural component.
  10131. type GoogleCloudVisionV1p4beta1TextAnnotationTextProperty struct {
  10132. // DetectedBreak: Detected start or end of a text segment.
  10133. DetectedBreak *GoogleCloudVisionV1p4beta1TextAnnotationDetectedBreak `json:"detectedBreak,omitempty"`
  10134. // DetectedLanguages: A list of detected languages together with
  10135. // confidence.
  10136. DetectedLanguages []*GoogleCloudVisionV1p4beta1TextAnnotationDetectedLanguage `json:"detectedLanguages,omitempty"`
  10137. // ForceSendFields is a list of field names (e.g. "DetectedBreak") to
  10138. // unconditionally include in API requests. By default, fields with
  10139. // empty values are omitted from API requests. However, any non-pointer,
  10140. // non-interface field appearing in ForceSendFields will be sent to the
  10141. // server regardless of whether the field is empty or not. This may be
  10142. // used to include empty fields in Patch requests.
  10143. ForceSendFields []string `json:"-"`
  10144. // NullFields is a list of field names (e.g. "DetectedBreak") to include
  10145. // in API requests with the JSON null value. By default, fields with
  10146. // empty values are omitted from API requests. However, any field with
  10147. // an empty value appearing in NullFields will be sent to the server as
  10148. // null. It is an error if a field in this list has a non-empty value.
  10149. // This may be used to include null fields in Patch requests.
  10150. NullFields []string `json:"-"`
  10151. }
  10152. func (s *GoogleCloudVisionV1p4beta1TextAnnotationTextProperty) MarshalJSON() ([]byte, error) {
  10153. type NoMethod GoogleCloudVisionV1p4beta1TextAnnotationTextProperty
  10154. raw := NoMethod(*s)
  10155. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10156. }
  10157. // GoogleCloudVisionV1p4beta1Vertex: A vertex represents a 2D point in
  10158. // the image.
  10159. // NOTE: the vertex coordinates are in the same scale as the original
  10160. // image.
  10161. type GoogleCloudVisionV1p4beta1Vertex struct {
  10162. // X: X coordinate.
  10163. X int64 `json:"x,omitempty"`
  10164. // Y: Y coordinate.
  10165. Y int64 `json:"y,omitempty"`
  10166. // ForceSendFields is a list of field names (e.g. "X") to
  10167. // unconditionally include in API requests. By default, fields with
  10168. // empty values are omitted from API requests. However, any non-pointer,
  10169. // non-interface field appearing in ForceSendFields will be sent to the
  10170. // server regardless of whether the field is empty or not. This may be
  10171. // used to include empty fields in Patch requests.
  10172. ForceSendFields []string `json:"-"`
  10173. // NullFields is a list of field names (e.g. "X") to include in API
  10174. // requests with the JSON null value. By default, fields with empty
  10175. // values are omitted from API requests. However, any field with an
  10176. // empty value appearing in NullFields will be sent to the server as
  10177. // null. It is an error if a field in this list has a non-empty value.
  10178. // This may be used to include null fields in Patch requests.
  10179. NullFields []string `json:"-"`
  10180. }
  10181. func (s *GoogleCloudVisionV1p4beta1Vertex) MarshalJSON() ([]byte, error) {
  10182. type NoMethod GoogleCloudVisionV1p4beta1Vertex
  10183. raw := NoMethod(*s)
  10184. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10185. }
  10186. // GoogleCloudVisionV1p4beta1WebDetection: Relevant information for the
  10187. // image from the Internet.
  10188. type GoogleCloudVisionV1p4beta1WebDetection struct {
  10189. // BestGuessLabels: The service's best guess as to the topic of the
  10190. // request image.
  10191. // Inferred from similar images on the open web.
  10192. BestGuessLabels []*GoogleCloudVisionV1p4beta1WebDetectionWebLabel `json:"bestGuessLabels,omitempty"`
  10193. // FullMatchingImages: Fully matching images from the Internet.
  10194. // Can include resized copies of the query image.
  10195. FullMatchingImages []*GoogleCloudVisionV1p4beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"`
  10196. // PagesWithMatchingImages: Web pages containing the matching images
  10197. // from the Internet.
  10198. PagesWithMatchingImages []*GoogleCloudVisionV1p4beta1WebDetectionWebPage `json:"pagesWithMatchingImages,omitempty"`
  10199. // PartialMatchingImages: Partial matching images from the
  10200. // Internet.
  10201. // Those images are similar enough to share some key-point features.
  10202. // For
  10203. // example an original image will likely have partial matching for its
  10204. // crops.
  10205. PartialMatchingImages []*GoogleCloudVisionV1p4beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"`
  10206. // VisuallySimilarImages: The visually similar image results.
  10207. VisuallySimilarImages []*GoogleCloudVisionV1p4beta1WebDetectionWebImage `json:"visuallySimilarImages,omitempty"`
  10208. // WebEntities: Deduced entities from similar images on the Internet.
  10209. WebEntities []*GoogleCloudVisionV1p4beta1WebDetectionWebEntity `json:"webEntities,omitempty"`
  10210. // ForceSendFields is a list of field names (e.g. "BestGuessLabels") to
  10211. // unconditionally include in API requests. By default, fields with
  10212. // empty values are omitted from API requests. However, any non-pointer,
  10213. // non-interface field appearing in ForceSendFields will be sent to the
  10214. // server regardless of whether the field is empty or not. This may be
  10215. // used to include empty fields in Patch requests.
  10216. ForceSendFields []string `json:"-"`
  10217. // NullFields is a list of field names (e.g. "BestGuessLabels") to
  10218. // include in API requests with the JSON null value. By default, fields
  10219. // with empty values are omitted from API requests. However, any field
  10220. // with an empty value appearing in NullFields will be sent to the
  10221. // server as null. It is an error if a field in this list has a
  10222. // non-empty value. This may be used to include null fields in Patch
  10223. // requests.
  10224. NullFields []string `json:"-"`
  10225. }
  10226. func (s *GoogleCloudVisionV1p4beta1WebDetection) MarshalJSON() ([]byte, error) {
  10227. type NoMethod GoogleCloudVisionV1p4beta1WebDetection
  10228. raw := NoMethod(*s)
  10229. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10230. }
  10231. // GoogleCloudVisionV1p4beta1WebDetectionWebEntity: Entity deduced from
  10232. // similar images on the Internet.
  10233. type GoogleCloudVisionV1p4beta1WebDetectionWebEntity struct {
  10234. // Description: Canonical description of the entity, in English.
  10235. Description string `json:"description,omitempty"`
  10236. // EntityId: Opaque entity ID.
  10237. EntityId string `json:"entityId,omitempty"`
  10238. // Score: Overall relevancy score for the entity.
  10239. // Not normalized and not comparable across different image queries.
  10240. Score float64 `json:"score,omitempty"`
  10241. // ForceSendFields is a list of field names (e.g. "Description") to
  10242. // unconditionally include in API requests. By default, fields with
  10243. // empty values are omitted from API requests. However, any non-pointer,
  10244. // non-interface field appearing in ForceSendFields will be sent to the
  10245. // server regardless of whether the field is empty or not. This may be
  10246. // used to include empty fields in Patch requests.
  10247. ForceSendFields []string `json:"-"`
  10248. // NullFields is a list of field names (e.g. "Description") to include
  10249. // in API requests with the JSON null value. By default, fields with
  10250. // empty values are omitted from API requests. However, any field with
  10251. // an empty value appearing in NullFields will be sent to the server as
  10252. // null. It is an error if a field in this list has a non-empty value.
  10253. // This may be used to include null fields in Patch requests.
  10254. NullFields []string `json:"-"`
  10255. }
  10256. func (s *GoogleCloudVisionV1p4beta1WebDetectionWebEntity) MarshalJSON() ([]byte, error) {
  10257. type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebEntity
  10258. raw := NoMethod(*s)
  10259. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10260. }
  10261. func (s *GoogleCloudVisionV1p4beta1WebDetectionWebEntity) UnmarshalJSON(data []byte) error {
  10262. type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebEntity
  10263. var s1 struct {
  10264. Score gensupport.JSONFloat64 `json:"score"`
  10265. *NoMethod
  10266. }
  10267. s1.NoMethod = (*NoMethod)(s)
  10268. if err := json.Unmarshal(data, &s1); err != nil {
  10269. return err
  10270. }
  10271. s.Score = float64(s1.Score)
  10272. return nil
  10273. }
  10274. // GoogleCloudVisionV1p4beta1WebDetectionWebImage: Metadata for online
  10275. // images.
  10276. type GoogleCloudVisionV1p4beta1WebDetectionWebImage struct {
  10277. // Score: (Deprecated) Overall relevancy score for the image.
  10278. Score float64 `json:"score,omitempty"`
  10279. // Url: The result image URL.
  10280. Url string `json:"url,omitempty"`
  10281. // ForceSendFields is a list of field names (e.g. "Score") to
  10282. // unconditionally include in API requests. By default, fields with
  10283. // empty values are omitted from API requests. However, any non-pointer,
  10284. // non-interface field appearing in ForceSendFields will be sent to the
  10285. // server regardless of whether the field is empty or not. This may be
  10286. // used to include empty fields in Patch requests.
  10287. ForceSendFields []string `json:"-"`
  10288. // NullFields is a list of field names (e.g. "Score") to include in API
  10289. // requests with the JSON null value. By default, fields with empty
  10290. // values are omitted from API requests. However, any field with an
  10291. // empty value appearing in NullFields will be sent to the server as
  10292. // null. It is an error if a field in this list has a non-empty value.
  10293. // This may be used to include null fields in Patch requests.
  10294. NullFields []string `json:"-"`
  10295. }
  10296. func (s *GoogleCloudVisionV1p4beta1WebDetectionWebImage) MarshalJSON() ([]byte, error) {
  10297. type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebImage
  10298. raw := NoMethod(*s)
  10299. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10300. }
  10301. func (s *GoogleCloudVisionV1p4beta1WebDetectionWebImage) UnmarshalJSON(data []byte) error {
  10302. type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebImage
  10303. var s1 struct {
  10304. Score gensupport.JSONFloat64 `json:"score"`
  10305. *NoMethod
  10306. }
  10307. s1.NoMethod = (*NoMethod)(s)
  10308. if err := json.Unmarshal(data, &s1); err != nil {
  10309. return err
  10310. }
  10311. s.Score = float64(s1.Score)
  10312. return nil
  10313. }
  10314. // GoogleCloudVisionV1p4beta1WebDetectionWebLabel: Label to provide
  10315. // extra metadata for the web detection.
  10316. type GoogleCloudVisionV1p4beta1WebDetectionWebLabel struct {
  10317. // Label: Label for extra metadata.
  10318. Label string `json:"label,omitempty"`
  10319. // LanguageCode: The BCP-47 language code for `label`, such as "en-US"
  10320. // or "sr-Latn".
  10321. // For more information,
  10322. // see
  10323. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  10324. LanguageCode string `json:"languageCode,omitempty"`
  10325. // ForceSendFields is a list of field names (e.g. "Label") to
  10326. // unconditionally include in API requests. By default, fields with
  10327. // empty values are omitted from API requests. However, any non-pointer,
  10328. // non-interface field appearing in ForceSendFields will be sent to the
  10329. // server regardless of whether the field is empty or not. This may be
  10330. // used to include empty fields in Patch requests.
  10331. ForceSendFields []string `json:"-"`
  10332. // NullFields is a list of field names (e.g. "Label") to include in API
  10333. // requests with the JSON null value. By default, fields with empty
  10334. // values are omitted from API requests. However, any field with an
  10335. // empty value appearing in NullFields will be sent to the server as
  10336. // null. It is an error if a field in this list has a non-empty value.
  10337. // This may be used to include null fields in Patch requests.
  10338. NullFields []string `json:"-"`
  10339. }
  10340. func (s *GoogleCloudVisionV1p4beta1WebDetectionWebLabel) MarshalJSON() ([]byte, error) {
  10341. type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebLabel
  10342. raw := NoMethod(*s)
  10343. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10344. }
  10345. // GoogleCloudVisionV1p4beta1WebDetectionWebPage: Metadata for web
  10346. // pages.
  10347. type GoogleCloudVisionV1p4beta1WebDetectionWebPage struct {
  10348. // FullMatchingImages: Fully matching images on the page.
  10349. // Can include resized copies of the query image.
  10350. FullMatchingImages []*GoogleCloudVisionV1p4beta1WebDetectionWebImage `json:"fullMatchingImages,omitempty"`
  10351. // PageTitle: Title for the web page, may contain HTML markups.
  10352. PageTitle string `json:"pageTitle,omitempty"`
  10353. // PartialMatchingImages: Partial matching images on the page.
  10354. // Those images are similar enough to share some key-point features.
  10355. // For
  10356. // example an original image will likely have partial matching for
  10357. // its
  10358. // crops.
  10359. PartialMatchingImages []*GoogleCloudVisionV1p4beta1WebDetectionWebImage `json:"partialMatchingImages,omitempty"`
  10360. // Score: (Deprecated) Overall relevancy score for the web page.
  10361. Score float64 `json:"score,omitempty"`
  10362. // Url: The result web page URL.
  10363. Url string `json:"url,omitempty"`
  10364. // ForceSendFields is a list of field names (e.g. "FullMatchingImages")
  10365. // to unconditionally include in API requests. By default, fields with
  10366. // empty values are omitted from API requests. However, any non-pointer,
  10367. // non-interface field appearing in ForceSendFields will be sent to the
  10368. // server regardless of whether the field is empty or not. This may be
  10369. // used to include empty fields in Patch requests.
  10370. ForceSendFields []string `json:"-"`
  10371. // NullFields is a list of field names (e.g. "FullMatchingImages") to
  10372. // include in API requests with the JSON null value. By default, fields
  10373. // with empty values are omitted from API requests. However, any field
  10374. // with an empty value appearing in NullFields will be sent to the
  10375. // server as null. It is an error if a field in this list has a
  10376. // non-empty value. This may be used to include null fields in Patch
  10377. // requests.
  10378. NullFields []string `json:"-"`
  10379. }
  10380. func (s *GoogleCloudVisionV1p4beta1WebDetectionWebPage) MarshalJSON() ([]byte, error) {
  10381. type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebPage
  10382. raw := NoMethod(*s)
  10383. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10384. }
  10385. func (s *GoogleCloudVisionV1p4beta1WebDetectionWebPage) UnmarshalJSON(data []byte) error {
  10386. type NoMethod GoogleCloudVisionV1p4beta1WebDetectionWebPage
  10387. var s1 struct {
  10388. Score gensupport.JSONFloat64 `json:"score"`
  10389. *NoMethod
  10390. }
  10391. s1.NoMethod = (*NoMethod)(s)
  10392. if err := json.Unmarshal(data, &s1); err != nil {
  10393. return err
  10394. }
  10395. s.Score = float64(s1.Score)
  10396. return nil
  10397. }
  10398. // GoogleCloudVisionV1p4beta1Word: A word representation.
  10399. type GoogleCloudVisionV1p4beta1Word struct {
  10400. // BoundingBox: The bounding box for the word.
  10401. // The vertices are in the order of top-left, top-right,
  10402. // bottom-right,
  10403. // bottom-left. When a rotation of the bounding box is detected the
  10404. // rotation
  10405. // is represented as around the top-left corner as defined when the text
  10406. // is
  10407. // read in the 'natural' orientation.
  10408. // For example:
  10409. // * when the text is horizontal it might look like:
  10410. // 0----1
  10411. // | |
  10412. // 3----2
  10413. // * when it's rotated 180 degrees around the top-left corner it
  10414. // becomes:
  10415. // 2----3
  10416. // | |
  10417. // 1----0
  10418. // and the vertex order will still be (0, 1, 2, 3).
  10419. BoundingBox *GoogleCloudVisionV1p4beta1BoundingPoly `json:"boundingBox,omitempty"`
  10420. // Confidence: Confidence of the OCR results for the word. Range [0, 1].
  10421. Confidence float64 `json:"confidence,omitempty"`
  10422. // Property: Additional information detected for the word.
  10423. Property *GoogleCloudVisionV1p4beta1TextAnnotationTextProperty `json:"property,omitempty"`
  10424. // Symbols: List of symbols in the word.
  10425. // The order of the symbols follows the natural reading order.
  10426. Symbols []*GoogleCloudVisionV1p4beta1Symbol `json:"symbols,omitempty"`
  10427. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  10428. // unconditionally include in API requests. By default, fields with
  10429. // empty values are omitted from API requests. However, any non-pointer,
  10430. // non-interface field appearing in ForceSendFields will be sent to the
  10431. // server regardless of whether the field is empty or not. This may be
  10432. // used to include empty fields in Patch requests.
  10433. ForceSendFields []string `json:"-"`
  10434. // NullFields is a list of field names (e.g. "BoundingBox") to include
  10435. // in API requests with the JSON null value. By default, fields with
  10436. // empty values are omitted from API requests. However, any field with
  10437. // an empty value appearing in NullFields will be sent to the server as
  10438. // null. It is an error if a field in this list has a non-empty value.
  10439. // This may be used to include null fields in Patch requests.
  10440. NullFields []string `json:"-"`
  10441. }
  10442. func (s *GoogleCloudVisionV1p4beta1Word) MarshalJSON() ([]byte, error) {
  10443. type NoMethod GoogleCloudVisionV1p4beta1Word
  10444. raw := NoMethod(*s)
  10445. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10446. }
  10447. func (s *GoogleCloudVisionV1p4beta1Word) UnmarshalJSON(data []byte) error {
  10448. type NoMethod GoogleCloudVisionV1p4beta1Word
  10449. var s1 struct {
  10450. Confidence gensupport.JSONFloat64 `json:"confidence"`
  10451. *NoMethod
  10452. }
  10453. s1.NoMethod = (*NoMethod)(s)
  10454. if err := json.Unmarshal(data, &s1); err != nil {
  10455. return err
  10456. }
  10457. s.Confidence = float64(s1.Confidence)
  10458. return nil
  10459. }
  10460. // GroupedResult: Information about the products similar to a single
  10461. // product in a query
  10462. // image.
  10463. type GroupedResult struct {
  10464. // BoundingPoly: The bounding polygon around the product detected in the
  10465. // query image.
  10466. BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"`
  10467. // Results: List of results, one for each product match.
  10468. Results []*Result `json:"results,omitempty"`
  10469. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  10470. // unconditionally include in API requests. By default, fields with
  10471. // empty values are omitted from API requests. However, any non-pointer,
  10472. // non-interface field appearing in ForceSendFields will be sent to the
  10473. // server regardless of whether the field is empty or not. This may be
  10474. // used to include empty fields in Patch requests.
  10475. ForceSendFields []string `json:"-"`
  10476. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  10477. // in API requests with the JSON null value. By default, fields with
  10478. // empty values are omitted from API requests. However, any field with
  10479. // an empty value appearing in NullFields will be sent to the server as
  10480. // null. It is an error if a field in this list has a non-empty value.
  10481. // This may be used to include null fields in Patch requests.
  10482. NullFields []string `json:"-"`
  10483. }
  10484. func (s *GroupedResult) MarshalJSON() ([]byte, error) {
  10485. type NoMethod GroupedResult
  10486. raw := NoMethod(*s)
  10487. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10488. }
  10489. // Image: Client image to perform Google Cloud Vision API tasks over.
  10490. type Image struct {
  10491. // Content: Image content, represented as a stream of bytes.
  10492. // Note: As with all `bytes` fields, protobuffers use a pure
  10493. // binary
  10494. // representation, whereas JSON representations use base64.
  10495. Content string `json:"content,omitempty"`
  10496. // Source: Google Cloud Storage image location, or publicly-accessible
  10497. // image
  10498. // URL. If both `content` and `source` are provided for an image,
  10499. // `content`
  10500. // takes precedence and is used to perform the image annotation request.
  10501. Source *ImageSource `json:"source,omitempty"`
  10502. // ForceSendFields is a list of field names (e.g. "Content") to
  10503. // unconditionally include in API requests. By default, fields with
  10504. // empty values are omitted from API requests. However, any non-pointer,
  10505. // non-interface field appearing in ForceSendFields will be sent to the
  10506. // server regardless of whether the field is empty or not. This may be
  10507. // used to include empty fields in Patch requests.
  10508. ForceSendFields []string `json:"-"`
  10509. // NullFields is a list of field names (e.g. "Content") to include in
  10510. // API requests with the JSON null value. By default, fields with empty
  10511. // values are omitted from API requests. However, any field with an
  10512. // empty value appearing in NullFields will be sent to the server as
  10513. // null. It is an error if a field in this list has a non-empty value.
  10514. // This may be used to include null fields in Patch requests.
  10515. NullFields []string `json:"-"`
  10516. }
  10517. func (s *Image) MarshalJSON() ([]byte, error) {
  10518. type NoMethod Image
  10519. raw := NoMethod(*s)
  10520. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10521. }
  10522. // ImageAnnotationContext: If an image was produced from a file (e.g. a
  10523. // PDF), this message gives
  10524. // information about the source of that image.
  10525. type ImageAnnotationContext struct {
  10526. // PageNumber: If the file was a PDF or TIFF, this field gives the page
  10527. // number within
  10528. // the file used to produce the image.
  10529. PageNumber int64 `json:"pageNumber,omitempty"`
  10530. // Uri: The URI of the file used to produce the image.
  10531. Uri string `json:"uri,omitempty"`
  10532. // ForceSendFields is a list of field names (e.g. "PageNumber") to
  10533. // unconditionally include in API requests. By default, fields with
  10534. // empty values are omitted from API requests. However, any non-pointer,
  10535. // non-interface field appearing in ForceSendFields will be sent to the
  10536. // server regardless of whether the field is empty or not. This may be
  10537. // used to include empty fields in Patch requests.
  10538. ForceSendFields []string `json:"-"`
  10539. // NullFields is a list of field names (e.g. "PageNumber") to include in
  10540. // API requests with the JSON null value. By default, fields with empty
  10541. // values are omitted from API requests. However, any field with an
  10542. // empty value appearing in NullFields will be sent to the server as
  10543. // null. It is an error if a field in this list has a non-empty value.
  10544. // This may be used to include null fields in Patch requests.
  10545. NullFields []string `json:"-"`
  10546. }
  10547. func (s *ImageAnnotationContext) MarshalJSON() ([]byte, error) {
  10548. type NoMethod ImageAnnotationContext
  10549. raw := NoMethod(*s)
  10550. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10551. }
  10552. // ImageContext: Image context and/or feature-specific parameters.
  10553. type ImageContext struct {
  10554. // CropHintsParams: Parameters for crop hints annotation request.
  10555. CropHintsParams *CropHintsParams `json:"cropHintsParams,omitempty"`
  10556. // LanguageHints: List of languages to use for TEXT_DETECTION. In most
  10557. // cases, an empty value
  10558. // yields the best results since it enables automatic language
  10559. // detection. For
  10560. // languages based on the Latin alphabet, setting `language_hints` is
  10561. // not
  10562. // needed. In rare cases, when the language of the text in the image is
  10563. // known,
  10564. // setting a hint will help get better results (although it will be
  10565. // a
  10566. // significant hindrance if the hint is wrong). Text detection returns
  10567. // an
  10568. // error if one or more of the specified languages is not one of
  10569. // the
  10570. // [supported languages](/vision/docs/languages).
  10571. LanguageHints []string `json:"languageHints,omitempty"`
  10572. // LatLongRect: Not used.
  10573. LatLongRect *LatLongRect `json:"latLongRect,omitempty"`
  10574. // ProductSearchParams: Parameters for product search.
  10575. ProductSearchParams *ProductSearchParams `json:"productSearchParams,omitempty"`
  10576. // WebDetectionParams: Parameters for web detection.
  10577. WebDetectionParams *WebDetectionParams `json:"webDetectionParams,omitempty"`
  10578. // ForceSendFields is a list of field names (e.g. "CropHintsParams") to
  10579. // unconditionally include in API requests. By default, fields with
  10580. // empty values are omitted from API requests. However, any non-pointer,
  10581. // non-interface field appearing in ForceSendFields will be sent to the
  10582. // server regardless of whether the field is empty or not. This may be
  10583. // used to include empty fields in Patch requests.
  10584. ForceSendFields []string `json:"-"`
  10585. // NullFields is a list of field names (e.g. "CropHintsParams") to
  10586. // include in API requests with the JSON null value. By default, fields
  10587. // with empty values are omitted from API requests. However, any field
  10588. // with an empty value appearing in NullFields will be sent to the
  10589. // server as null. It is an error if a field in this list has a
  10590. // non-empty value. This may be used to include null fields in Patch
  10591. // requests.
  10592. NullFields []string `json:"-"`
  10593. }
  10594. func (s *ImageContext) MarshalJSON() ([]byte, error) {
  10595. type NoMethod ImageContext
  10596. raw := NoMethod(*s)
  10597. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10598. }
  10599. // ImageProperties: Stores image properties, such as dominant colors.
  10600. type ImageProperties struct {
  10601. // DominantColors: If present, dominant colors completed successfully.
  10602. DominantColors *DominantColorsAnnotation `json:"dominantColors,omitempty"`
  10603. // ForceSendFields is a list of field names (e.g. "DominantColors") to
  10604. // unconditionally include in API requests. By default, fields with
  10605. // empty values are omitted from API requests. However, any non-pointer,
  10606. // non-interface field appearing in ForceSendFields will be sent to the
  10607. // server regardless of whether the field is empty or not. This may be
  10608. // used to include empty fields in Patch requests.
  10609. ForceSendFields []string `json:"-"`
  10610. // NullFields is a list of field names (e.g. "DominantColors") to
  10611. // include in API requests with the JSON null value. By default, fields
  10612. // with empty values are omitted from API requests. However, any field
  10613. // with an empty value appearing in NullFields will be sent to the
  10614. // server as null. It is an error if a field in this list has a
  10615. // non-empty value. This may be used to include null fields in Patch
  10616. // requests.
  10617. NullFields []string `json:"-"`
  10618. }
  10619. func (s *ImageProperties) MarshalJSON() ([]byte, error) {
  10620. type NoMethod ImageProperties
  10621. raw := NoMethod(*s)
  10622. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10623. }
  10624. // ImageSource: External image source (Google Cloud Storage or web URL
  10625. // image location).
  10626. type ImageSource struct {
  10627. // GcsImageUri: **Use `image_uri` instead.**
  10628. //
  10629. // The Google Cloud Storage URI of the
  10630. // form
  10631. // `gs://bucket_name/object_name`. Object versioning is not supported.
  10632. // See
  10633. // [Google Cloud Storage
  10634. // Request
  10635. // URIs](https://cloud.google.com/storage/docs/reference-uris) for more
  10636. // info.
  10637. GcsImageUri string `json:"gcsImageUri,omitempty"`
  10638. // ImageUri: The URI of the source image. Can be either:
  10639. //
  10640. // 1. A Google Cloud Storage URI of the form
  10641. // `gs://bucket_name/object_name`. Object versioning is not
  10642. // supported. See
  10643. // [Google Cloud Storage Request
  10644. // URIs](https://cloud.google.com/storage/docs/reference-uris) for
  10645. // more
  10646. // info.
  10647. //
  10648. // 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images
  10649. // from
  10650. // HTTP/HTTPS URLs, Google cannot guarantee that the request will be
  10651. // completed. Your request may fail if the specified host denies the
  10652. // request (e.g. due to request throttling or DOS prevention), or if
  10653. // Google
  10654. // throttles requests to the site for abuse prevention. You should
  10655. // not
  10656. // depend on externally-hosted images for production
  10657. // applications.
  10658. //
  10659. // When both `gcs_image_uri` and `image_uri` are specified, `image_uri`
  10660. // takes
  10661. // precedence.
  10662. ImageUri string `json:"imageUri,omitempty"`
  10663. // ForceSendFields is a list of field names (e.g. "GcsImageUri") to
  10664. // unconditionally include in API requests. By default, fields with
  10665. // empty values are omitted from API requests. However, any non-pointer,
  10666. // non-interface field appearing in ForceSendFields will be sent to the
  10667. // server regardless of whether the field is empty or not. This may be
  10668. // used to include empty fields in Patch requests.
  10669. ForceSendFields []string `json:"-"`
  10670. // NullFields is a list of field names (e.g. "GcsImageUri") to include
  10671. // in API requests with the JSON null value. By default, fields with
  10672. // empty values are omitted from API requests. However, any field with
  10673. // an empty value appearing in NullFields will be sent to the server as
  10674. // null. It is an error if a field in this list has a non-empty value.
  10675. // This may be used to include null fields in Patch requests.
  10676. NullFields []string `json:"-"`
  10677. }
  10678. func (s *ImageSource) MarshalJSON() ([]byte, error) {
  10679. type NoMethod ImageSource
  10680. raw := NoMethod(*s)
  10681. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10682. }
  10683. // ImportProductSetsGcsSource: The Google Cloud Storage location for a
  10684. // csv file which preserves a list of
  10685. // ImportProductSetRequests in each line.
  10686. type ImportProductSetsGcsSource struct {
  10687. // CsvFileUri: The Google Cloud Storage URI of the input csv file.
  10688. //
  10689. // The URI must start with `gs://`.
  10690. //
  10691. // The format of the input csv file should be one image per line.
  10692. // In each line, there are 8 columns.
  10693. //
  10694. // 1. image-uri
  10695. // 2. image-id
  10696. // 3. product-set-id
  10697. // 4. product-id
  10698. // 5. product-category
  10699. // 6. product-display-name
  10700. // 7. labels
  10701. // 8. bounding-poly
  10702. //
  10703. // The `image-uri`, `product-set-id`, `product-id`, and
  10704. // `product-category`
  10705. // columns are required. All other columns are optional.
  10706. //
  10707. // If the `ProductSet` or `Product` specified by the `product-set-id`
  10708. // and
  10709. // `product-id` values does not exist, then the system will create a
  10710. // new
  10711. // `ProductSet` or `Product` for the image. In this case,
  10712. // the
  10713. // `product-display-name` column refers to
  10714. // display_name, the
  10715. // `product-category` column refers to
  10716. // product_category, and the
  10717. // `labels` column refers to product_labels.
  10718. //
  10719. // The `image-id` column is optional but must be unique if provided. If
  10720. // it is
  10721. // empty, the system will automatically assign a unique id to the
  10722. // image.
  10723. //
  10724. // The `product-display-name` column is optional. If it is empty, the
  10725. // system
  10726. // sets the display_name field for the product to a
  10727. // space (" "). You can update the `display_name` later by using the
  10728. // API.
  10729. //
  10730. // If a `Product` with the specified `product-id` already exists, then
  10731. // the
  10732. // system ignores the `product-display-name`, `product-category`, and
  10733. // `labels`
  10734. // columns.
  10735. //
  10736. // The `labels` column (optional) is a line containing a list
  10737. // of
  10738. // comma-separated key-value pairs, in the following format:
  10739. //
  10740. // "key_1=value_1,key_2=value_2,...,key_n=value_n"
  10741. //
  10742. // The `bounding-poly` column (optional) identifies one region
  10743. // of
  10744. // interest from the image in the same manner as `CreateReferenceImage`.
  10745. // If
  10746. // you do not specify the `bounding-poly` column, then the system will
  10747. // try to
  10748. // detect regions of interest automatically.
  10749. //
  10750. // At most one `bounding-poly` column is allowed per line. If the
  10751. // image
  10752. // contains multiple regions of interest, add a line to the CSV file
  10753. // that
  10754. // includes the same product information, and the `bounding-poly` values
  10755. // for
  10756. // each region of interest.
  10757. //
  10758. // The `bounding-poly` column must contain an even number of
  10759. // comma-separated
  10760. // numbers, in the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y".
  10761. // Use
  10762. // non-negative integers for absolute bounding polygons, and float
  10763. // values
  10764. // in [0, 1] for normalized bounding polygons.
  10765. //
  10766. // The system will resize the image if the image resolution is too
  10767. // large to process (larger than 20MP).
  10768. CsvFileUri string `json:"csvFileUri,omitempty"`
  10769. // ForceSendFields is a list of field names (e.g. "CsvFileUri") to
  10770. // unconditionally include in API requests. By default, fields with
  10771. // empty values are omitted from API requests. However, any non-pointer,
  10772. // non-interface field appearing in ForceSendFields will be sent to the
  10773. // server regardless of whether the field is empty or not. This may be
  10774. // used to include empty fields in Patch requests.
  10775. ForceSendFields []string `json:"-"`
  10776. // NullFields is a list of field names (e.g. "CsvFileUri") to include in
  10777. // API requests with the JSON null value. By default, fields with empty
  10778. // values are omitted from API requests. However, any field with an
  10779. // empty value appearing in NullFields will be sent to the server as
  10780. // null. It is an error if a field in this list has a non-empty value.
  10781. // This may be used to include null fields in Patch requests.
  10782. NullFields []string `json:"-"`
  10783. }
  10784. func (s *ImportProductSetsGcsSource) MarshalJSON() ([]byte, error) {
  10785. type NoMethod ImportProductSetsGcsSource
  10786. raw := NoMethod(*s)
  10787. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10788. }
  10789. // ImportProductSetsInputConfig: The input content for the
  10790. // `ImportProductSets` method.
  10791. type ImportProductSetsInputConfig struct {
  10792. // GcsSource: The Google Cloud Storage location for a csv file which
  10793. // preserves a list
  10794. // of ImportProductSetRequests in each line.
  10795. GcsSource *ImportProductSetsGcsSource `json:"gcsSource,omitempty"`
  10796. // ForceSendFields is a list of field names (e.g. "GcsSource") to
  10797. // unconditionally include in API requests. By default, fields with
  10798. // empty values are omitted from API requests. However, any non-pointer,
  10799. // non-interface field appearing in ForceSendFields will be sent to the
  10800. // server regardless of whether the field is empty or not. This may be
  10801. // used to include empty fields in Patch requests.
  10802. ForceSendFields []string `json:"-"`
  10803. // NullFields is a list of field names (e.g. "GcsSource") to include in
  10804. // API requests with the JSON null value. By default, fields with empty
  10805. // values are omitted from API requests. However, any field with an
  10806. // empty value appearing in NullFields will be sent to the server as
  10807. // null. It is an error if a field in this list has a non-empty value.
  10808. // This may be used to include null fields in Patch requests.
  10809. NullFields []string `json:"-"`
  10810. }
  10811. func (s *ImportProductSetsInputConfig) MarshalJSON() ([]byte, error) {
  10812. type NoMethod ImportProductSetsInputConfig
  10813. raw := NoMethod(*s)
  10814. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10815. }
  10816. // ImportProductSetsRequest: Request message for the `ImportProductSets`
  10817. // method.
  10818. type ImportProductSetsRequest struct {
  10819. // InputConfig: The input content for the list of requests.
  10820. InputConfig *ImportProductSetsInputConfig `json:"inputConfig,omitempty"`
  10821. // ForceSendFields is a list of field names (e.g. "InputConfig") to
  10822. // unconditionally include in API requests. By default, fields with
  10823. // empty values are omitted from API requests. However, any non-pointer,
  10824. // non-interface field appearing in ForceSendFields will be sent to the
  10825. // server regardless of whether the field is empty or not. This may be
  10826. // used to include empty fields in Patch requests.
  10827. ForceSendFields []string `json:"-"`
  10828. // NullFields is a list of field names (e.g. "InputConfig") to include
  10829. // in API requests with the JSON null value. By default, fields with
  10830. // empty values are omitted from API requests. However, any field with
  10831. // an empty value appearing in NullFields will be sent to the server as
  10832. // null. It is an error if a field in this list has a non-empty value.
  10833. // This may be used to include null fields in Patch requests.
  10834. NullFields []string `json:"-"`
  10835. }
  10836. func (s *ImportProductSetsRequest) MarshalJSON() ([]byte, error) {
  10837. type NoMethod ImportProductSetsRequest
  10838. raw := NoMethod(*s)
  10839. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10840. }
  10841. // ImportProductSetsResponse: Response message for the
  10842. // `ImportProductSets` method.
  10843. //
  10844. // This message is returned by
  10845. // the
  10846. // google.longrunning.Operations.GetOperation method in the
  10847. // returned
  10848. // google.longrunning.Operation.response field.
  10849. type ImportProductSetsResponse struct {
  10850. // ReferenceImages: The list of reference_images that are imported
  10851. // successfully.
  10852. ReferenceImages []*ReferenceImage `json:"referenceImages,omitempty"`
  10853. // Statuses: The rpc status for each ImportProductSet request, including
  10854. // both successes
  10855. // and errors.
  10856. //
  10857. // The number of statuses here matches the number of lines in the csv
  10858. // file,
  10859. // and statuses[i] stores the success or failure status of processing
  10860. // the i-th
  10861. // line of the csv, starting from line 0.
  10862. Statuses []*Status `json:"statuses,omitempty"`
  10863. // ForceSendFields is a list of field names (e.g. "ReferenceImages") to
  10864. // unconditionally include in API requests. By default, fields with
  10865. // empty values are omitted from API requests. However, any non-pointer,
  10866. // non-interface field appearing in ForceSendFields will be sent to the
  10867. // server regardless of whether the field is empty or not. This may be
  10868. // used to include empty fields in Patch requests.
  10869. ForceSendFields []string `json:"-"`
  10870. // NullFields is a list of field names (e.g. "ReferenceImages") to
  10871. // include in API requests with the JSON null value. By default, fields
  10872. // with empty values are omitted from API requests. However, any field
  10873. // with an empty value appearing in NullFields will be sent to the
  10874. // server as null. It is an error if a field in this list has a
  10875. // non-empty value. This may be used to include null fields in Patch
  10876. // requests.
  10877. NullFields []string `json:"-"`
  10878. }
  10879. func (s *ImportProductSetsResponse) MarshalJSON() ([]byte, error) {
  10880. type NoMethod ImportProductSetsResponse
  10881. raw := NoMethod(*s)
  10882. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10883. }
  10884. // InputConfig: The desired input location and metadata.
  10885. type InputConfig struct {
  10886. // GcsSource: The Google Cloud Storage location to read the input from.
  10887. GcsSource *GcsSource `json:"gcsSource,omitempty"`
  10888. // MimeType: The type of the file. Currently only "application/pdf" and
  10889. // "image/tiff"
  10890. // are supported. Wildcards are not supported.
  10891. MimeType string `json:"mimeType,omitempty"`
  10892. // ForceSendFields is a list of field names (e.g. "GcsSource") to
  10893. // unconditionally include in API requests. By default, fields with
  10894. // empty values are omitted from API requests. However, any non-pointer,
  10895. // non-interface field appearing in ForceSendFields will be sent to the
  10896. // server regardless of whether the field is empty or not. This may be
  10897. // used to include empty fields in Patch requests.
  10898. ForceSendFields []string `json:"-"`
  10899. // NullFields is a list of field names (e.g. "GcsSource") to include in
  10900. // API requests with the JSON null value. By default, fields with empty
  10901. // values are omitted from API requests. However, any field with an
  10902. // empty value appearing in NullFields will be sent to the server as
  10903. // null. It is an error if a field in this list has a non-empty value.
  10904. // This may be used to include null fields in Patch requests.
  10905. NullFields []string `json:"-"`
  10906. }
  10907. func (s *InputConfig) MarshalJSON() ([]byte, error) {
  10908. type NoMethod InputConfig
  10909. raw := NoMethod(*s)
  10910. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10911. }
  10912. // KeyValue: A product label represented as a key-value pair.
  10913. type KeyValue struct {
  10914. // Key: The key of the label attached to the product. Cannot be empty
  10915. // and cannot
  10916. // exceed 128 bytes.
  10917. Key string `json:"key,omitempty"`
  10918. // Value: The value of the label attached to the product. Cannot be
  10919. // empty and
  10920. // cannot exceed 128 bytes.
  10921. Value string `json:"value,omitempty"`
  10922. // ForceSendFields is a list of field names (e.g. "Key") to
  10923. // unconditionally include in API requests. By default, fields with
  10924. // empty values are omitted from API requests. However, any non-pointer,
  10925. // non-interface field appearing in ForceSendFields will be sent to the
  10926. // server regardless of whether the field is empty or not. This may be
  10927. // used to include empty fields in Patch requests.
  10928. ForceSendFields []string `json:"-"`
  10929. // NullFields is a list of field names (e.g. "Key") to include in API
  10930. // requests with the JSON null value. By default, fields with empty
  10931. // values are omitted from API requests. However, any field with an
  10932. // empty value appearing in NullFields will be sent to the server as
  10933. // null. It is an error if a field in this list has a non-empty value.
  10934. // This may be used to include null fields in Patch requests.
  10935. NullFields []string `json:"-"`
  10936. }
  10937. func (s *KeyValue) MarshalJSON() ([]byte, error) {
  10938. type NoMethod KeyValue
  10939. raw := NoMethod(*s)
  10940. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10941. }
  10942. // Landmark: A face-specific landmark (for example, a face feature).
  10943. type Landmark struct {
  10944. // Position: Face landmark position.
  10945. Position *Position `json:"position,omitempty"`
  10946. // Type: Face landmark type.
  10947. //
  10948. // Possible values:
  10949. // "UNKNOWN_LANDMARK" - Unknown face landmark detected. Should not be
  10950. // filled.
  10951. // "LEFT_EYE" - Left eye.
  10952. // "RIGHT_EYE" - Right eye.
  10953. // "LEFT_OF_LEFT_EYEBROW" - Left of left eyebrow.
  10954. // "RIGHT_OF_LEFT_EYEBROW" - Right of left eyebrow.
  10955. // "LEFT_OF_RIGHT_EYEBROW" - Left of right eyebrow.
  10956. // "RIGHT_OF_RIGHT_EYEBROW" - Right of right eyebrow.
  10957. // "MIDPOINT_BETWEEN_EYES" - Midpoint between eyes.
  10958. // "NOSE_TIP" - Nose tip.
  10959. // "UPPER_LIP" - Upper lip.
  10960. // "LOWER_LIP" - Lower lip.
  10961. // "MOUTH_LEFT" - Mouth left.
  10962. // "MOUTH_RIGHT" - Mouth right.
  10963. // "MOUTH_CENTER" - Mouth center.
  10964. // "NOSE_BOTTOM_RIGHT" - Nose, bottom right.
  10965. // "NOSE_BOTTOM_LEFT" - Nose, bottom left.
  10966. // "NOSE_BOTTOM_CENTER" - Nose, bottom center.
  10967. // "LEFT_EYE_TOP_BOUNDARY" - Left eye, top boundary.
  10968. // "LEFT_EYE_RIGHT_CORNER" - Left eye, right corner.
  10969. // "LEFT_EYE_BOTTOM_BOUNDARY" - Left eye, bottom boundary.
  10970. // "LEFT_EYE_LEFT_CORNER" - Left eye, left corner.
  10971. // "RIGHT_EYE_TOP_BOUNDARY" - Right eye, top boundary.
  10972. // "RIGHT_EYE_RIGHT_CORNER" - Right eye, right corner.
  10973. // "RIGHT_EYE_BOTTOM_BOUNDARY" - Right eye, bottom boundary.
  10974. // "RIGHT_EYE_LEFT_CORNER" - Right eye, left corner.
  10975. // "LEFT_EYEBROW_UPPER_MIDPOINT" - Left eyebrow, upper midpoint.
  10976. // "RIGHT_EYEBROW_UPPER_MIDPOINT" - Right eyebrow, upper midpoint.
  10977. // "LEFT_EAR_TRAGION" - Left ear tragion.
  10978. // "RIGHT_EAR_TRAGION" - Right ear tragion.
  10979. // "LEFT_EYE_PUPIL" - Left eye pupil.
  10980. // "RIGHT_EYE_PUPIL" - Right eye pupil.
  10981. // "FOREHEAD_GLABELLA" - Forehead glabella.
  10982. // "CHIN_GNATHION" - Chin gnathion.
  10983. // "CHIN_LEFT_GONION" - Chin left gonion.
  10984. // "CHIN_RIGHT_GONION" - Chin right gonion.
  10985. Type string `json:"type,omitempty"`
  10986. // ForceSendFields is a list of field names (e.g. "Position") to
  10987. // unconditionally include in API requests. By default, fields with
  10988. // empty values are omitted from API requests. However, any non-pointer,
  10989. // non-interface field appearing in ForceSendFields will be sent to the
  10990. // server regardless of whether the field is empty or not. This may be
  10991. // used to include empty fields in Patch requests.
  10992. ForceSendFields []string `json:"-"`
  10993. // NullFields is a list of field names (e.g. "Position") to include in
  10994. // API requests with the JSON null value. By default, fields with empty
  10995. // values are omitted from API requests. However, any field with an
  10996. // empty value appearing in NullFields will be sent to the server as
  10997. // null. It is an error if a field in this list has a non-empty value.
  10998. // This may be used to include null fields in Patch requests.
  10999. NullFields []string `json:"-"`
  11000. }
  11001. func (s *Landmark) MarshalJSON() ([]byte, error) {
  11002. type NoMethod Landmark
  11003. raw := NoMethod(*s)
  11004. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11005. }
  11006. // LatLng: An object representing a latitude/longitude pair. This is
  11007. // expressed as a pair
  11008. // of doubles representing degrees latitude and degrees longitude.
  11009. // Unless
  11010. // specified otherwise, this must conform to the
  11011. // <a
  11012. // href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
  11013. // st
  11014. // andard</a>. Values must be within normalized ranges.
  11015. type LatLng struct {
  11016. // Latitude: The latitude in degrees. It must be in the range [-90.0,
  11017. // +90.0].
  11018. Latitude float64 `json:"latitude,omitempty"`
  11019. // Longitude: The longitude in degrees. It must be in the range [-180.0,
  11020. // +180.0].
  11021. Longitude float64 `json:"longitude,omitempty"`
  11022. // ForceSendFields is a list of field names (e.g. "Latitude") to
  11023. // unconditionally include in API requests. By default, fields with
  11024. // empty values are omitted from API requests. However, any non-pointer,
  11025. // non-interface field appearing in ForceSendFields will be sent to the
  11026. // server regardless of whether the field is empty or not. This may be
  11027. // used to include empty fields in Patch requests.
  11028. ForceSendFields []string `json:"-"`
  11029. // NullFields is a list of field names (e.g. "Latitude") to include in
  11030. // API requests with the JSON null value. By default, fields with empty
  11031. // values are omitted from API requests. However, any field with an
  11032. // empty value appearing in NullFields will be sent to the server as
  11033. // null. It is an error if a field in this list has a non-empty value.
  11034. // This may be used to include null fields in Patch requests.
  11035. NullFields []string `json:"-"`
  11036. }
  11037. func (s *LatLng) MarshalJSON() ([]byte, error) {
  11038. type NoMethod LatLng
  11039. raw := NoMethod(*s)
  11040. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11041. }
  11042. func (s *LatLng) UnmarshalJSON(data []byte) error {
  11043. type NoMethod LatLng
  11044. var s1 struct {
  11045. Latitude gensupport.JSONFloat64 `json:"latitude"`
  11046. Longitude gensupport.JSONFloat64 `json:"longitude"`
  11047. *NoMethod
  11048. }
  11049. s1.NoMethod = (*NoMethod)(s)
  11050. if err := json.Unmarshal(data, &s1); err != nil {
  11051. return err
  11052. }
  11053. s.Latitude = float64(s1.Latitude)
  11054. s.Longitude = float64(s1.Longitude)
  11055. return nil
  11056. }
  11057. // LatLongRect: Rectangle determined by min and max `LatLng` pairs.
  11058. type LatLongRect struct {
  11059. // MaxLatLng: Max lat/long pair.
  11060. MaxLatLng *LatLng `json:"maxLatLng,omitempty"`
  11061. // MinLatLng: Min lat/long pair.
  11062. MinLatLng *LatLng `json:"minLatLng,omitempty"`
  11063. // ForceSendFields is a list of field names (e.g. "MaxLatLng") to
  11064. // unconditionally include in API requests. By default, fields with
  11065. // empty values are omitted from API requests. However, any non-pointer,
  11066. // non-interface field appearing in ForceSendFields will be sent to the
  11067. // server regardless of whether the field is empty or not. This may be
  11068. // used to include empty fields in Patch requests.
  11069. ForceSendFields []string `json:"-"`
  11070. // NullFields is a list of field names (e.g. "MaxLatLng") to include in
  11071. // API requests with the JSON null value. By default, fields with empty
  11072. // values are omitted from API requests. However, any field with an
  11073. // empty value appearing in NullFields will be sent to the server as
  11074. // null. It is an error if a field in this list has a non-empty value.
  11075. // This may be used to include null fields in Patch requests.
  11076. NullFields []string `json:"-"`
  11077. }
  11078. func (s *LatLongRect) MarshalJSON() ([]byte, error) {
  11079. type NoMethod LatLongRect
  11080. raw := NoMethod(*s)
  11081. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11082. }
  11083. // ListOperationsResponse: The response message for
  11084. // Operations.ListOperations.
  11085. type ListOperationsResponse struct {
  11086. // NextPageToken: The standard List next-page token.
  11087. NextPageToken string `json:"nextPageToken,omitempty"`
  11088. // Operations: A list of operations that matches the specified filter in
  11089. // the request.
  11090. Operations []*Operation `json:"operations,omitempty"`
  11091. // ServerResponse contains the HTTP response code and headers from the
  11092. // server.
  11093. googleapi.ServerResponse `json:"-"`
  11094. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  11095. // unconditionally include in API requests. By default, fields with
  11096. // empty values are omitted from API requests. However, any non-pointer,
  11097. // non-interface field appearing in ForceSendFields will be sent to the
  11098. // server regardless of whether the field is empty or not. This may be
  11099. // used to include empty fields in Patch requests.
  11100. ForceSendFields []string `json:"-"`
  11101. // NullFields is a list of field names (e.g. "NextPageToken") to include
  11102. // in API requests with the JSON null value. By default, fields with
  11103. // empty values are omitted from API requests. However, any field with
  11104. // an empty value appearing in NullFields will be sent to the server as
  11105. // null. It is an error if a field in this list has a non-empty value.
  11106. // This may be used to include null fields in Patch requests.
  11107. NullFields []string `json:"-"`
  11108. }
  11109. func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
  11110. type NoMethod ListOperationsResponse
  11111. raw := NoMethod(*s)
  11112. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11113. }
  11114. // ListProductSetsResponse: Response message for the `ListProductSets`
  11115. // method.
  11116. type ListProductSetsResponse struct {
  11117. // NextPageToken: Token to retrieve the next page of results, or empty
  11118. // if there are no more
  11119. // results in the list.
  11120. NextPageToken string `json:"nextPageToken,omitempty"`
  11121. // ProductSets: List of ProductSets.
  11122. ProductSets []*ProductSet `json:"productSets,omitempty"`
  11123. // ServerResponse contains the HTTP response code and headers from the
  11124. // server.
  11125. googleapi.ServerResponse `json:"-"`
  11126. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  11127. // unconditionally include in API requests. By default, fields with
  11128. // empty values are omitted from API requests. However, any non-pointer,
  11129. // non-interface field appearing in ForceSendFields will be sent to the
  11130. // server regardless of whether the field is empty or not. This may be
  11131. // used to include empty fields in Patch requests.
  11132. ForceSendFields []string `json:"-"`
  11133. // NullFields is a list of field names (e.g. "NextPageToken") to include
  11134. // in API requests with the JSON null value. By default, fields with
  11135. // empty values are omitted from API requests. However, any field with
  11136. // an empty value appearing in NullFields will be sent to the server as
  11137. // null. It is an error if a field in this list has a non-empty value.
  11138. // This may be used to include null fields in Patch requests.
  11139. NullFields []string `json:"-"`
  11140. }
  11141. func (s *ListProductSetsResponse) MarshalJSON() ([]byte, error) {
  11142. type NoMethod ListProductSetsResponse
  11143. raw := NoMethod(*s)
  11144. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11145. }
  11146. // ListProductsInProductSetResponse: Response message for the
  11147. // `ListProductsInProductSet` method.
  11148. type ListProductsInProductSetResponse struct {
  11149. // NextPageToken: Token to retrieve the next page of results, or empty
  11150. // if there are no more
  11151. // results in the list.
  11152. NextPageToken string `json:"nextPageToken,omitempty"`
  11153. // Products: The list of Products.
  11154. Products []*Product `json:"products,omitempty"`
  11155. // ServerResponse contains the HTTP response code and headers from the
  11156. // server.
  11157. googleapi.ServerResponse `json:"-"`
  11158. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  11159. // unconditionally include in API requests. By default, fields with
  11160. // empty values are omitted from API requests. However, any non-pointer,
  11161. // non-interface field appearing in ForceSendFields will be sent to the
  11162. // server regardless of whether the field is empty or not. This may be
  11163. // used to include empty fields in Patch requests.
  11164. ForceSendFields []string `json:"-"`
  11165. // NullFields is a list of field names (e.g. "NextPageToken") to include
  11166. // in API requests with the JSON null value. By default, fields with
  11167. // empty values are omitted from API requests. However, any field with
  11168. // an empty value appearing in NullFields will be sent to the server as
  11169. // null. It is an error if a field in this list has a non-empty value.
  11170. // This may be used to include null fields in Patch requests.
  11171. NullFields []string `json:"-"`
  11172. }
  11173. func (s *ListProductsInProductSetResponse) MarshalJSON() ([]byte, error) {
  11174. type NoMethod ListProductsInProductSetResponse
  11175. raw := NoMethod(*s)
  11176. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11177. }
  11178. // ListProductsResponse: Response message for the `ListProducts` method.
  11179. type ListProductsResponse struct {
  11180. // NextPageToken: Token to retrieve the next page of results, or empty
  11181. // if there are no more
  11182. // results in the list.
  11183. NextPageToken string `json:"nextPageToken,omitempty"`
  11184. // Products: List of products.
  11185. Products []*Product `json:"products,omitempty"`
  11186. // ServerResponse contains the HTTP response code and headers from the
  11187. // server.
  11188. googleapi.ServerResponse `json:"-"`
  11189. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  11190. // unconditionally include in API requests. By default, fields with
  11191. // empty values are omitted from API requests. However, any non-pointer,
  11192. // non-interface field appearing in ForceSendFields will be sent to the
  11193. // server regardless of whether the field is empty or not. This may be
  11194. // used to include empty fields in Patch requests.
  11195. ForceSendFields []string `json:"-"`
  11196. // NullFields is a list of field names (e.g. "NextPageToken") to include
  11197. // in API requests with the JSON null value. By default, fields with
  11198. // empty values are omitted from API requests. However, any field with
  11199. // an empty value appearing in NullFields will be sent to the server as
  11200. // null. It is an error if a field in this list has a non-empty value.
  11201. // This may be used to include null fields in Patch requests.
  11202. NullFields []string `json:"-"`
  11203. }
  11204. func (s *ListProductsResponse) MarshalJSON() ([]byte, error) {
  11205. type NoMethod ListProductsResponse
  11206. raw := NoMethod(*s)
  11207. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11208. }
  11209. // ListReferenceImagesResponse: Response message for the
  11210. // `ListReferenceImages` method.
  11211. type ListReferenceImagesResponse struct {
  11212. // NextPageToken: The next_page_token returned from a previous List
  11213. // request, if any.
  11214. NextPageToken string `json:"nextPageToken,omitempty"`
  11215. // PageSize: The maximum number of items to return. Default 10, maximum
  11216. // 100.
  11217. PageSize int64 `json:"pageSize,omitempty"`
  11218. // ReferenceImages: The list of reference images.
  11219. ReferenceImages []*ReferenceImage `json:"referenceImages,omitempty"`
  11220. // ServerResponse contains the HTTP response code and headers from the
  11221. // server.
  11222. googleapi.ServerResponse `json:"-"`
  11223. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  11224. // unconditionally include in API requests. By default, fields with
  11225. // empty values are omitted from API requests. However, any non-pointer,
  11226. // non-interface field appearing in ForceSendFields will be sent to the
  11227. // server regardless of whether the field is empty or not. This may be
  11228. // used to include empty fields in Patch requests.
  11229. ForceSendFields []string `json:"-"`
  11230. // NullFields is a list of field names (e.g. "NextPageToken") to include
  11231. // in API requests with the JSON null value. By default, fields with
  11232. // empty values are omitted from API requests. However, any field with
  11233. // an empty value appearing in NullFields will be sent to the server as
  11234. // null. It is an error if a field in this list has a non-empty value.
  11235. // This may be used to include null fields in Patch requests.
  11236. NullFields []string `json:"-"`
  11237. }
  11238. func (s *ListReferenceImagesResponse) MarshalJSON() ([]byte, error) {
  11239. type NoMethod ListReferenceImagesResponse
  11240. raw := NoMethod(*s)
  11241. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11242. }
  11243. // LocalizedObjectAnnotation: Set of detected objects with bounding
  11244. // boxes.
  11245. type LocalizedObjectAnnotation struct {
  11246. // BoundingPoly: Image region to which this object belongs. This must be
  11247. // populated.
  11248. BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"`
  11249. // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn".
  11250. // For more
  11251. // information,
  11252. // see
  11253. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  11254. LanguageCode string `json:"languageCode,omitempty"`
  11255. // Mid: Object ID that should align with EntityAnnotation mid.
  11256. Mid string `json:"mid,omitempty"`
  11257. // Name: Object name, expressed in its `language_code` language.
  11258. Name string `json:"name,omitempty"`
  11259. // Score: Score of the result. Range [0, 1].
  11260. Score float64 `json:"score,omitempty"`
  11261. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  11262. // unconditionally include in API requests. By default, fields with
  11263. // empty values are omitted from API requests. However, any non-pointer,
  11264. // non-interface field appearing in ForceSendFields will be sent to the
  11265. // server regardless of whether the field is empty or not. This may be
  11266. // used to include empty fields in Patch requests.
  11267. ForceSendFields []string `json:"-"`
  11268. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  11269. // in API requests with the JSON null value. By default, fields with
  11270. // empty values are omitted from API requests. However, any field with
  11271. // an empty value appearing in NullFields will be sent to the server as
  11272. // null. It is an error if a field in this list has a non-empty value.
  11273. // This may be used to include null fields in Patch requests.
  11274. NullFields []string `json:"-"`
  11275. }
  11276. func (s *LocalizedObjectAnnotation) MarshalJSON() ([]byte, error) {
  11277. type NoMethod LocalizedObjectAnnotation
  11278. raw := NoMethod(*s)
  11279. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11280. }
  11281. func (s *LocalizedObjectAnnotation) UnmarshalJSON(data []byte) error {
  11282. type NoMethod LocalizedObjectAnnotation
  11283. var s1 struct {
  11284. Score gensupport.JSONFloat64 `json:"score"`
  11285. *NoMethod
  11286. }
  11287. s1.NoMethod = (*NoMethod)(s)
  11288. if err := json.Unmarshal(data, &s1); err != nil {
  11289. return err
  11290. }
  11291. s.Score = float64(s1.Score)
  11292. return nil
  11293. }
  11294. // LocationInfo: Detected entity location information.
  11295. type LocationInfo struct {
  11296. // LatLng: lat/long location coordinates.
  11297. LatLng *LatLng `json:"latLng,omitempty"`
  11298. // ForceSendFields is a list of field names (e.g. "LatLng") to
  11299. // unconditionally include in API requests. By default, fields with
  11300. // empty values are omitted from API requests. However, any non-pointer,
  11301. // non-interface field appearing in ForceSendFields will be sent to the
  11302. // server regardless of whether the field is empty or not. This may be
  11303. // used to include empty fields in Patch requests.
  11304. ForceSendFields []string `json:"-"`
  11305. // NullFields is a list of field names (e.g. "LatLng") to include in API
  11306. // requests with the JSON null value. By default, fields with empty
  11307. // values are omitted from API requests. However, any field with an
  11308. // empty value appearing in NullFields will be sent to the server as
  11309. // null. It is an error if a field in this list has a non-empty value.
  11310. // This may be used to include null fields in Patch requests.
  11311. NullFields []string `json:"-"`
  11312. }
  11313. func (s *LocationInfo) MarshalJSON() ([]byte, error) {
  11314. type NoMethod LocationInfo
  11315. raw := NoMethod(*s)
  11316. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11317. }
  11318. // NormalizedVertex: A vertex represents a 2D point in the image.
  11319. // NOTE: the normalized vertex coordinates are relative to the original
  11320. // image
  11321. // and range from 0 to 1.
  11322. type NormalizedVertex struct {
  11323. // X: X coordinate.
  11324. X float64 `json:"x,omitempty"`
  11325. // Y: Y coordinate.
  11326. Y float64 `json:"y,omitempty"`
  11327. // ForceSendFields is a list of field names (e.g. "X") to
  11328. // unconditionally include in API requests. By default, fields with
  11329. // empty values are omitted from API requests. However, any non-pointer,
  11330. // non-interface field appearing in ForceSendFields will be sent to the
  11331. // server regardless of whether the field is empty or not. This may be
  11332. // used to include empty fields in Patch requests.
  11333. ForceSendFields []string `json:"-"`
  11334. // NullFields is a list of field names (e.g. "X") to include in API
  11335. // requests with the JSON null value. By default, fields with empty
  11336. // values are omitted from API requests. However, any field with an
  11337. // empty value appearing in NullFields will be sent to the server as
  11338. // null. It is an error if a field in this list has a non-empty value.
  11339. // This may be used to include null fields in Patch requests.
  11340. NullFields []string `json:"-"`
  11341. }
  11342. func (s *NormalizedVertex) MarshalJSON() ([]byte, error) {
  11343. type NoMethod NormalizedVertex
  11344. raw := NoMethod(*s)
  11345. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11346. }
  11347. func (s *NormalizedVertex) UnmarshalJSON(data []byte) error {
  11348. type NoMethod NormalizedVertex
  11349. var s1 struct {
  11350. X gensupport.JSONFloat64 `json:"x"`
  11351. Y gensupport.JSONFloat64 `json:"y"`
  11352. *NoMethod
  11353. }
  11354. s1.NoMethod = (*NoMethod)(s)
  11355. if err := json.Unmarshal(data, &s1); err != nil {
  11356. return err
  11357. }
  11358. s.X = float64(s1.X)
  11359. s.Y = float64(s1.Y)
  11360. return nil
  11361. }
  11362. // Operation: This resource represents a long-running operation that is
  11363. // the result of a
  11364. // network API call.
  11365. type Operation struct {
  11366. // Done: If the value is `false`, it means the operation is still in
  11367. // progress.
  11368. // If `true`, the operation is completed, and either `error` or
  11369. // `response` is
  11370. // available.
  11371. Done bool `json:"done,omitempty"`
  11372. // Error: The error result of the operation in case of failure or
  11373. // cancellation.
  11374. Error *Status `json:"error,omitempty"`
  11375. // Metadata: Service-specific metadata associated with the operation.
  11376. // It typically
  11377. // contains progress information and common metadata such as create
  11378. // time.
  11379. // Some services might not provide such metadata. Any method that
  11380. // returns a
  11381. // long-running operation should document the metadata type, if any.
  11382. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  11383. // Name: The server-assigned name, which is only unique within the same
  11384. // service that
  11385. // originally returns it. If you use the default HTTP mapping,
  11386. // the
  11387. // `name` should have the format of `operations/some/unique/name`.
  11388. Name string `json:"name,omitempty"`
  11389. // Response: The normal response of the operation in case of success.
  11390. // If the original
  11391. // method returns no data on success, such as `Delete`, the response
  11392. // is
  11393. // `google.protobuf.Empty`. If the original method is
  11394. // standard
  11395. // `Get`/`Create`/`Update`, the response should be the resource. For
  11396. // other
  11397. // methods, the response should have the type `XxxResponse`, where
  11398. // `Xxx`
  11399. // is the original method name. For example, if the original method
  11400. // name
  11401. // is `TakeSnapshot()`, the inferred response type
  11402. // is
  11403. // `TakeSnapshotResponse`.
  11404. Response googleapi.RawMessage `json:"response,omitempty"`
  11405. // ServerResponse contains the HTTP response code and headers from the
  11406. // server.
  11407. googleapi.ServerResponse `json:"-"`
  11408. // ForceSendFields is a list of field names (e.g. "Done") to
  11409. // unconditionally include in API requests. By default, fields with
  11410. // empty values are omitted from API requests. However, any non-pointer,
  11411. // non-interface field appearing in ForceSendFields will be sent to the
  11412. // server regardless of whether the field is empty or not. This may be
  11413. // used to include empty fields in Patch requests.
  11414. ForceSendFields []string `json:"-"`
  11415. // NullFields is a list of field names (e.g. "Done") to include in API
  11416. // requests with the JSON null value. By default, fields with empty
  11417. // values are omitted from API requests. However, any field with an
  11418. // empty value appearing in NullFields will be sent to the server as
  11419. // null. It is an error if a field in this list has a non-empty value.
  11420. // This may be used to include null fields in Patch requests.
  11421. NullFields []string `json:"-"`
  11422. }
  11423. func (s *Operation) MarshalJSON() ([]byte, error) {
  11424. type NoMethod Operation
  11425. raw := NoMethod(*s)
  11426. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11427. }
  11428. // OperationMetadata: Contains metadata for the BatchAnnotateImages
  11429. // operation.
  11430. type OperationMetadata struct {
  11431. // CreateTime: The time when the batch request was received.
  11432. CreateTime string `json:"createTime,omitempty"`
  11433. // State: Current state of the batch operation.
  11434. //
  11435. // Possible values:
  11436. // "STATE_UNSPECIFIED" - Invalid.
  11437. // "CREATED" - Request is received.
  11438. // "RUNNING" - Request is actively being processed.
  11439. // "DONE" - The batch processing is done.
  11440. // "CANCELLED" - The batch processing was cancelled.
  11441. State string `json:"state,omitempty"`
  11442. // UpdateTime: The time when the operation result was last updated.
  11443. UpdateTime string `json:"updateTime,omitempty"`
  11444. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  11445. // unconditionally include in API requests. By default, fields with
  11446. // empty values are omitted from API requests. However, any non-pointer,
  11447. // non-interface field appearing in ForceSendFields will be sent to the
  11448. // server regardless of whether the field is empty or not. This may be
  11449. // used to include empty fields in Patch requests.
  11450. ForceSendFields []string `json:"-"`
  11451. // NullFields is a list of field names (e.g. "CreateTime") to include in
  11452. // API requests with the JSON null value. By default, fields with empty
  11453. // values are omitted from API requests. However, any field with an
  11454. // empty value appearing in NullFields will be sent to the server as
  11455. // null. It is an error if a field in this list has a non-empty value.
  11456. // This may be used to include null fields in Patch requests.
  11457. NullFields []string `json:"-"`
  11458. }
  11459. func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
  11460. type NoMethod OperationMetadata
  11461. raw := NoMethod(*s)
  11462. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11463. }
  11464. // OutputConfig: The desired output location and metadata.
  11465. type OutputConfig struct {
  11466. // BatchSize: The max number of response protos to put into each output
  11467. // JSON file on
  11468. // Google Cloud Storage.
  11469. // The valid range is [1, 100]. If not specified, the default value is
  11470. // 20.
  11471. //
  11472. // For example, for one pdf file with 100 pages, 100 response protos
  11473. // will
  11474. // be generated. If `batch_size` = 20, then 5 json files each
  11475. // containing 20 response protos will be written under the
  11476. // prefix
  11477. // `gcs_destination`.`uri`.
  11478. //
  11479. // Currently, batch_size only applies to GcsDestination, with potential
  11480. // future
  11481. // support for other output configurations.
  11482. BatchSize int64 `json:"batchSize,omitempty"`
  11483. // GcsDestination: The Google Cloud Storage location to write the
  11484. // output(s) to.
  11485. GcsDestination *GcsDestination `json:"gcsDestination,omitempty"`
  11486. // ForceSendFields is a list of field names (e.g. "BatchSize") to
  11487. // unconditionally include in API requests. By default, fields with
  11488. // empty values are omitted from API requests. However, any non-pointer,
  11489. // non-interface field appearing in ForceSendFields will be sent to the
  11490. // server regardless of whether the field is empty or not. This may be
  11491. // used to include empty fields in Patch requests.
  11492. ForceSendFields []string `json:"-"`
  11493. // NullFields is a list of field names (e.g. "BatchSize") to include in
  11494. // API requests with the JSON null value. By default, fields with empty
  11495. // values are omitted from API requests. However, any field with an
  11496. // empty value appearing in NullFields will be sent to the server as
  11497. // null. It is an error if a field in this list has a non-empty value.
  11498. // This may be used to include null fields in Patch requests.
  11499. NullFields []string `json:"-"`
  11500. }
  11501. func (s *OutputConfig) MarshalJSON() ([]byte, error) {
  11502. type NoMethod OutputConfig
  11503. raw := NoMethod(*s)
  11504. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11505. }
  11506. // Page: Detected page from OCR.
  11507. type Page struct {
  11508. // Blocks: List of blocks of text, images etc on this page.
  11509. Blocks []*Block `json:"blocks,omitempty"`
  11510. // Confidence: Confidence of the OCR results on the page. Range [0, 1].
  11511. Confidence float64 `json:"confidence,omitempty"`
  11512. // Height: Page height. For PDFs the unit is points. For images
  11513. // (including
  11514. // TIFFs) the unit is pixels.
  11515. Height int64 `json:"height,omitempty"`
  11516. // Property: Additional information detected on the page.
  11517. Property *TextProperty `json:"property,omitempty"`
  11518. // Width: Page width. For PDFs the unit is points. For images
  11519. // (including
  11520. // TIFFs) the unit is pixels.
  11521. Width int64 `json:"width,omitempty"`
  11522. // ForceSendFields is a list of field names (e.g. "Blocks") to
  11523. // unconditionally include in API requests. By default, fields with
  11524. // empty values are omitted from API requests. However, any non-pointer,
  11525. // non-interface field appearing in ForceSendFields will be sent to the
  11526. // server regardless of whether the field is empty or not. This may be
  11527. // used to include empty fields in Patch requests.
  11528. ForceSendFields []string `json:"-"`
  11529. // NullFields is a list of field names (e.g. "Blocks") to include in API
  11530. // requests with the JSON null value. By default, fields with empty
  11531. // values are omitted from API requests. However, any field with an
  11532. // empty value appearing in NullFields will be sent to the server as
  11533. // null. It is an error if a field in this list has a non-empty value.
  11534. // This may be used to include null fields in Patch requests.
  11535. NullFields []string `json:"-"`
  11536. }
  11537. func (s *Page) MarshalJSON() ([]byte, error) {
  11538. type NoMethod Page
  11539. raw := NoMethod(*s)
  11540. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11541. }
  11542. func (s *Page) UnmarshalJSON(data []byte) error {
  11543. type NoMethod Page
  11544. var s1 struct {
  11545. Confidence gensupport.JSONFloat64 `json:"confidence"`
  11546. *NoMethod
  11547. }
  11548. s1.NoMethod = (*NoMethod)(s)
  11549. if err := json.Unmarshal(data, &s1); err != nil {
  11550. return err
  11551. }
  11552. s.Confidence = float64(s1.Confidence)
  11553. return nil
  11554. }
  11555. // Paragraph: Structural unit of text representing a number of words in
  11556. // certain order.
  11557. type Paragraph struct {
  11558. // BoundingBox: The bounding box for the paragraph.
  11559. // The vertices are in the order of top-left, top-right,
  11560. // bottom-right,
  11561. // bottom-left. When a rotation of the bounding box is detected the
  11562. // rotation
  11563. // is represented as around the top-left corner as defined when the text
  11564. // is
  11565. // read in the 'natural' orientation.
  11566. // For example:
  11567. // * when the text is horizontal it might look like:
  11568. // 0----1
  11569. // | |
  11570. // 3----2
  11571. // * when it's rotated 180 degrees around the top-left corner it
  11572. // becomes:
  11573. // 2----3
  11574. // | |
  11575. // 1----0
  11576. // and the vertex order will still be (0, 1, 2, 3).
  11577. BoundingBox *BoundingPoly `json:"boundingBox,omitempty"`
  11578. // Confidence: Confidence of the OCR results for the paragraph. Range
  11579. // [0, 1].
  11580. Confidence float64 `json:"confidence,omitempty"`
  11581. // Property: Additional information detected for the paragraph.
  11582. Property *TextProperty `json:"property,omitempty"`
  11583. // Words: List of words in this paragraph.
  11584. Words []*Word `json:"words,omitempty"`
  11585. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  11586. // unconditionally include in API requests. By default, fields with
  11587. // empty values are omitted from API requests. However, any non-pointer,
  11588. // non-interface field appearing in ForceSendFields will be sent to the
  11589. // server regardless of whether the field is empty or not. This may be
  11590. // used to include empty fields in Patch requests.
  11591. ForceSendFields []string `json:"-"`
  11592. // NullFields is a list of field names (e.g. "BoundingBox") to include
  11593. // in API requests with the JSON null value. By default, fields with
  11594. // empty values are omitted from API requests. However, any field with
  11595. // an empty value appearing in NullFields will be sent to the server as
  11596. // null. It is an error if a field in this list has a non-empty value.
  11597. // This may be used to include null fields in Patch requests.
  11598. NullFields []string `json:"-"`
  11599. }
  11600. func (s *Paragraph) MarshalJSON() ([]byte, error) {
  11601. type NoMethod Paragraph
  11602. raw := NoMethod(*s)
  11603. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11604. }
  11605. func (s *Paragraph) UnmarshalJSON(data []byte) error {
  11606. type NoMethod Paragraph
  11607. var s1 struct {
  11608. Confidence gensupport.JSONFloat64 `json:"confidence"`
  11609. *NoMethod
  11610. }
  11611. s1.NoMethod = (*NoMethod)(s)
  11612. if err := json.Unmarshal(data, &s1); err != nil {
  11613. return err
  11614. }
  11615. s.Confidence = float64(s1.Confidence)
  11616. return nil
  11617. }
  11618. // Position: A 3D position in the image, used primarily for Face
  11619. // detection landmarks.
  11620. // A valid Position must have both x and y coordinates.
  11621. // The position coordinates are in the same scale as the original image.
  11622. type Position struct {
  11623. // X: X coordinate.
  11624. X float64 `json:"x,omitempty"`
  11625. // Y: Y coordinate.
  11626. Y float64 `json:"y,omitempty"`
  11627. // Z: Z coordinate (or depth).
  11628. Z float64 `json:"z,omitempty"`
  11629. // ForceSendFields is a list of field names (e.g. "X") to
  11630. // unconditionally include in API requests. By default, fields with
  11631. // empty values are omitted from API requests. However, any non-pointer,
  11632. // non-interface field appearing in ForceSendFields will be sent to the
  11633. // server regardless of whether the field is empty or not. This may be
  11634. // used to include empty fields in Patch requests.
  11635. ForceSendFields []string `json:"-"`
  11636. // NullFields is a list of field names (e.g. "X") to include in API
  11637. // requests with the JSON null value. By default, fields with empty
  11638. // values are omitted from API requests. However, any field with an
  11639. // empty value appearing in NullFields will be sent to the server as
  11640. // null. It is an error if a field in this list has a non-empty value.
  11641. // This may be used to include null fields in Patch requests.
  11642. NullFields []string `json:"-"`
  11643. }
  11644. func (s *Position) MarshalJSON() ([]byte, error) {
  11645. type NoMethod Position
  11646. raw := NoMethod(*s)
  11647. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11648. }
  11649. func (s *Position) UnmarshalJSON(data []byte) error {
  11650. type NoMethod Position
  11651. var s1 struct {
  11652. X gensupport.JSONFloat64 `json:"x"`
  11653. Y gensupport.JSONFloat64 `json:"y"`
  11654. Z gensupport.JSONFloat64 `json:"z"`
  11655. *NoMethod
  11656. }
  11657. s1.NoMethod = (*NoMethod)(s)
  11658. if err := json.Unmarshal(data, &s1); err != nil {
  11659. return err
  11660. }
  11661. s.X = float64(s1.X)
  11662. s.Y = float64(s1.Y)
  11663. s.Z = float64(s1.Z)
  11664. return nil
  11665. }
  11666. // Product: A Product contains ReferenceImages.
  11667. type Product struct {
  11668. // Description: User-provided metadata to be stored with this product.
  11669. // Must be at most 4096
  11670. // characters long.
  11671. Description string `json:"description,omitempty"`
  11672. // DisplayName: The user-provided name for this Product. Must not be
  11673. // empty. Must be at most
  11674. // 4096 characters long.
  11675. DisplayName string `json:"displayName,omitempty"`
  11676. // Name: The resource name of the product.
  11677. //
  11678. // Format
  11679. // is:
  11680. // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
  11681. //
  11682. // This field is ignored when creating a product.
  11683. Name string `json:"name,omitempty"`
  11684. // ProductCategory: The category for the product identified by the
  11685. // reference image. This should
  11686. // be either "homegoods", "apparel", or "toys".
  11687. //
  11688. // This field is immutable.
  11689. ProductCategory string `json:"productCategory,omitempty"`
  11690. // ProductLabels: Key-value pairs that can be attached to a product. At
  11691. // query time,
  11692. // constraints can be specified based on the product_labels.
  11693. //
  11694. // Note that integer values can be provided as strings, e.g. "1199".
  11695. // Only
  11696. // strings with integer values can match a range-based restriction which
  11697. // is
  11698. // to be supported soon.
  11699. //
  11700. // Multiple values can be assigned to the same key. One product may have
  11701. // up to
  11702. // 100 product_labels.
  11703. ProductLabels []*KeyValue `json:"productLabels,omitempty"`
  11704. // ServerResponse contains the HTTP response code and headers from the
  11705. // server.
  11706. googleapi.ServerResponse `json:"-"`
  11707. // ForceSendFields is a list of field names (e.g. "Description") to
  11708. // unconditionally include in API requests. By default, fields with
  11709. // empty values are omitted from API requests. However, any non-pointer,
  11710. // non-interface field appearing in ForceSendFields will be sent to the
  11711. // server regardless of whether the field is empty or not. This may be
  11712. // used to include empty fields in Patch requests.
  11713. ForceSendFields []string `json:"-"`
  11714. // NullFields is a list of field names (e.g. "Description") to include
  11715. // in API requests with the JSON null value. By default, fields with
  11716. // empty values are omitted from API requests. However, any field with
  11717. // an empty value appearing in NullFields will be sent to the server as
  11718. // null. It is an error if a field in this list has a non-empty value.
  11719. // This may be used to include null fields in Patch requests.
  11720. NullFields []string `json:"-"`
  11721. }
  11722. func (s *Product) MarshalJSON() ([]byte, error) {
  11723. type NoMethod Product
  11724. raw := NoMethod(*s)
  11725. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11726. }
  11727. // ProductSearchParams: Parameters for a product search request.
  11728. type ProductSearchParams struct {
  11729. // BoundingPoly: The bounding polygon around the area of interest in the
  11730. // image.
  11731. // Optional. If it is not specified, system discretion will be applied.
  11732. BoundingPoly *BoundingPoly `json:"boundingPoly,omitempty"`
  11733. // Filter: The filtering expression. This can be used to restrict search
  11734. // results based
  11735. // on Product labels. We currently support an AND of OR of
  11736. // key-value
  11737. // expressions, where each expression within an OR must have the same
  11738. // key.
  11739. //
  11740. // For example, "(color = red OR color = blue) AND brand = Google"
  11741. // is
  11742. // acceptable, but not "(color = red OR brand = Google)" or "color:
  11743. // red".
  11744. Filter string `json:"filter,omitempty"`
  11745. // ProductCategories: The list of product categories to search in.
  11746. // Currently, we only consider
  11747. // the first category, and either "homegoods", "apparel", or "toys"
  11748. // should be
  11749. // specified.
  11750. ProductCategories []string `json:"productCategories,omitempty"`
  11751. // ProductSet: The resource name of a ProductSet to be searched for
  11752. // similar images.
  11753. //
  11754. // Format
  11755. // is:
  11756. // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
  11757. ProductSet string `json:"productSet,omitempty"`
  11758. // ForceSendFields is a list of field names (e.g. "BoundingPoly") to
  11759. // unconditionally include in API requests. By default, fields with
  11760. // empty values are omitted from API requests. However, any non-pointer,
  11761. // non-interface field appearing in ForceSendFields will be sent to the
  11762. // server regardless of whether the field is empty or not. This may be
  11763. // used to include empty fields in Patch requests.
  11764. ForceSendFields []string `json:"-"`
  11765. // NullFields is a list of field names (e.g. "BoundingPoly") to include
  11766. // in API requests with the JSON null value. By default, fields with
  11767. // empty values are omitted from API requests. However, any field with
  11768. // an empty value appearing in NullFields will be sent to the server as
  11769. // null. It is an error if a field in this list has a non-empty value.
  11770. // This may be used to include null fields in Patch requests.
  11771. NullFields []string `json:"-"`
  11772. }
  11773. func (s *ProductSearchParams) MarshalJSON() ([]byte, error) {
  11774. type NoMethod ProductSearchParams
  11775. raw := NoMethod(*s)
  11776. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11777. }
  11778. // ProductSearchResults: Results for a product search request.
  11779. type ProductSearchResults struct {
  11780. // IndexTime: Timestamp of the index which provided these results.
  11781. // Changes made after
  11782. // this time are not reflected in the current results.
  11783. IndexTime string `json:"indexTime,omitempty"`
  11784. // ProductGroupedResults: List of results grouped by products detected
  11785. // in the query image. Each entry
  11786. // corresponds to one bounding polygon in the query image, and contains
  11787. // the
  11788. // matching products specific to that region. There may be duplicate
  11789. // product
  11790. // matches in the union of all the per-product results.
  11791. ProductGroupedResults []*GroupedResult `json:"productGroupedResults,omitempty"`
  11792. // Results: List of results, one for each product match.
  11793. Results []*Result `json:"results,omitempty"`
  11794. // ForceSendFields is a list of field names (e.g. "IndexTime") to
  11795. // unconditionally include in API requests. By default, fields with
  11796. // empty values are omitted from API requests. However, any non-pointer,
  11797. // non-interface field appearing in ForceSendFields will be sent to the
  11798. // server regardless of whether the field is empty or not. This may be
  11799. // used to include empty fields in Patch requests.
  11800. ForceSendFields []string `json:"-"`
  11801. // NullFields is a list of field names (e.g. "IndexTime") to include in
  11802. // API requests with the JSON null value. By default, fields with empty
  11803. // values are omitted from API requests. However, any field with an
  11804. // empty value appearing in NullFields will be sent to the server as
  11805. // null. It is an error if a field in this list has a non-empty value.
  11806. // This may be used to include null fields in Patch requests.
  11807. NullFields []string `json:"-"`
  11808. }
  11809. func (s *ProductSearchResults) MarshalJSON() ([]byte, error) {
  11810. type NoMethod ProductSearchResults
  11811. raw := NoMethod(*s)
  11812. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11813. }
  11814. // ProductSet: A ProductSet contains Products. A ProductSet can contain
  11815. // a maximum of 1
  11816. // million reference images. If the limit is exceeded, periodic indexing
  11817. // will
  11818. // fail.
  11819. type ProductSet struct {
  11820. // DisplayName: The user-provided name for this ProductSet. Must not be
  11821. // empty. Must be at
  11822. // most 4096 characters long.
  11823. DisplayName string `json:"displayName,omitempty"`
  11824. // IndexError: Output only. If there was an error with indexing the
  11825. // product set, the field
  11826. // is populated.
  11827. //
  11828. // This field is ignored when creating a ProductSet.
  11829. IndexError *Status `json:"indexError,omitempty"`
  11830. // IndexTime: Output only. The time at which this ProductSet was last
  11831. // indexed. Query
  11832. // results will reflect all updates before this time. If this ProductSet
  11833. // has
  11834. // never been indexed, this timestamp is the default
  11835. // value
  11836. // "1970-01-01T00:00:00Z".
  11837. //
  11838. // This field is ignored when creating a ProductSet.
  11839. IndexTime string `json:"indexTime,omitempty"`
  11840. // Name: The resource name of the ProductSet.
  11841. //
  11842. // Format
  11843. // is:
  11844. // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
  11845. //
  11846. //
  11847. // This field is ignored when creating a ProductSet.
  11848. Name string `json:"name,omitempty"`
  11849. // ServerResponse contains the HTTP response code and headers from the
  11850. // server.
  11851. googleapi.ServerResponse `json:"-"`
  11852. // ForceSendFields is a list of field names (e.g. "DisplayName") to
  11853. // unconditionally include in API requests. By default, fields with
  11854. // empty values are omitted from API requests. However, any non-pointer,
  11855. // non-interface field appearing in ForceSendFields will be sent to the
  11856. // server regardless of whether the field is empty or not. This may be
  11857. // used to include empty fields in Patch requests.
  11858. ForceSendFields []string `json:"-"`
  11859. // NullFields is a list of field names (e.g. "DisplayName") to include
  11860. // in API requests with the JSON null value. By default, fields with
  11861. // empty values are omitted from API requests. However, any field with
  11862. // an empty value appearing in NullFields will be sent to the server as
  11863. // null. It is an error if a field in this list has a non-empty value.
  11864. // This may be used to include null fields in Patch requests.
  11865. NullFields []string `json:"-"`
  11866. }
  11867. func (s *ProductSet) MarshalJSON() ([]byte, error) {
  11868. type NoMethod ProductSet
  11869. raw := NoMethod(*s)
  11870. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11871. }
  11872. // Property: A `Property` consists of a user-supplied name/value pair.
  11873. type Property struct {
  11874. // Name: Name of the property.
  11875. Name string `json:"name,omitempty"`
  11876. // Uint64Value: Value of numeric properties.
  11877. Uint64Value uint64 `json:"uint64Value,omitempty,string"`
  11878. // Value: Value of the property.
  11879. Value string `json:"value,omitempty"`
  11880. // ForceSendFields is a list of field names (e.g. "Name") to
  11881. // unconditionally include in API requests. By default, fields with
  11882. // empty values are omitted from API requests. However, any non-pointer,
  11883. // non-interface field appearing in ForceSendFields will be sent to the
  11884. // server regardless of whether the field is empty or not. This may be
  11885. // used to include empty fields in Patch requests.
  11886. ForceSendFields []string `json:"-"`
  11887. // NullFields is a list of field names (e.g. "Name") to include in API
  11888. // requests with the JSON null value. By default, fields with empty
  11889. // values are omitted from API requests. However, any field with an
  11890. // empty value appearing in NullFields will be sent to the server as
  11891. // null. It is an error if a field in this list has a non-empty value.
  11892. // This may be used to include null fields in Patch requests.
  11893. NullFields []string `json:"-"`
  11894. }
  11895. func (s *Property) MarshalJSON() ([]byte, error) {
  11896. type NoMethod Property
  11897. raw := NoMethod(*s)
  11898. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11899. }
  11900. // ReferenceImage: A `ReferenceImage` represents a product image and its
  11901. // associated metadata,
  11902. // such as bounding boxes.
  11903. type ReferenceImage struct {
  11904. // BoundingPolys: Bounding polygons around the areas of interest in the
  11905. // reference image.
  11906. // Optional. If this field is empty, the system will try to detect
  11907. // regions of
  11908. // interest. At most 10 bounding polygons will be used.
  11909. //
  11910. // The provided shape is converted into a non-rotated rectangle.
  11911. // Once
  11912. // converted, the small edge of the rectangle must be greater than or
  11913. // equal
  11914. // to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok;
  11915. // 1:5
  11916. // is not).
  11917. BoundingPolys []*BoundingPoly `json:"boundingPolys,omitempty"`
  11918. // Name: The resource name of the reference image.
  11919. //
  11920. // Format
  11921. // is:
  11922. //
  11923. // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referen
  11924. // ceImages/IMAGE_ID`.
  11925. //
  11926. // This field is ignored when creating a reference image.
  11927. Name string `json:"name,omitempty"`
  11928. // Uri: The Google Cloud Storage URI of the reference image.
  11929. //
  11930. // The URI must start with `gs://`.
  11931. //
  11932. // Required.
  11933. Uri string `json:"uri,omitempty"`
  11934. // ServerResponse contains the HTTP response code and headers from the
  11935. // server.
  11936. googleapi.ServerResponse `json:"-"`
  11937. // ForceSendFields is a list of field names (e.g. "BoundingPolys") to
  11938. // unconditionally include in API requests. By default, fields with
  11939. // empty values are omitted from API requests. However, any non-pointer,
  11940. // non-interface field appearing in ForceSendFields will be sent to the
  11941. // server regardless of whether the field is empty or not. This may be
  11942. // used to include empty fields in Patch requests.
  11943. ForceSendFields []string `json:"-"`
  11944. // NullFields is a list of field names (e.g. "BoundingPolys") to include
  11945. // in API requests with the JSON null value. By default, fields with
  11946. // empty values are omitted from API requests. However, any field with
  11947. // an empty value appearing in NullFields will be sent to the server as
  11948. // null. It is an error if a field in this list has a non-empty value.
  11949. // This may be used to include null fields in Patch requests.
  11950. NullFields []string `json:"-"`
  11951. }
  11952. func (s *ReferenceImage) MarshalJSON() ([]byte, error) {
  11953. type NoMethod ReferenceImage
  11954. raw := NoMethod(*s)
  11955. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11956. }
  11957. // RemoveProductFromProductSetRequest: Request message for the
  11958. // `RemoveProductFromProductSet` method.
  11959. type RemoveProductFromProductSetRequest struct {
  11960. // Product: The resource name for the Product to be removed from this
  11961. // ProductSet.
  11962. //
  11963. // Format is:
  11964. // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
  11965. Product string `json:"product,omitempty"`
  11966. // ForceSendFields is a list of field names (e.g. "Product") to
  11967. // unconditionally include in API requests. By default, fields with
  11968. // empty values are omitted from API requests. However, any non-pointer,
  11969. // non-interface field appearing in ForceSendFields will be sent to the
  11970. // server regardless of whether the field is empty or not. This may be
  11971. // used to include empty fields in Patch requests.
  11972. ForceSendFields []string `json:"-"`
  11973. // NullFields is a list of field names (e.g. "Product") to include in
  11974. // API requests with the JSON null value. By default, fields with empty
  11975. // values are omitted from API requests. However, any field with an
  11976. // empty value appearing in NullFields will be sent to the server as
  11977. // null. It is an error if a field in this list has a non-empty value.
  11978. // This may be used to include null fields in Patch requests.
  11979. NullFields []string `json:"-"`
  11980. }
  11981. func (s *RemoveProductFromProductSetRequest) MarshalJSON() ([]byte, error) {
  11982. type NoMethod RemoveProductFromProductSetRequest
  11983. raw := NoMethod(*s)
  11984. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11985. }
  11986. // Result: Information about a product.
  11987. type Result struct {
  11988. // Image: The resource name of the image from the product that is the
  11989. // closest match
  11990. // to the query.
  11991. Image string `json:"image,omitempty"`
  11992. // Product: The Product.
  11993. Product *Product `json:"product,omitempty"`
  11994. // Score: A confidence level on the match, ranging from 0 (no
  11995. // confidence) to
  11996. // 1 (full confidence).
  11997. Score float64 `json:"score,omitempty"`
  11998. // ForceSendFields is a list of field names (e.g. "Image") to
  11999. // unconditionally include in API requests. By default, fields with
  12000. // empty values are omitted from API requests. However, any non-pointer,
  12001. // non-interface field appearing in ForceSendFields will be sent to the
  12002. // server regardless of whether the field is empty or not. This may be
  12003. // used to include empty fields in Patch requests.
  12004. ForceSendFields []string `json:"-"`
  12005. // NullFields is a list of field names (e.g. "Image") to include in API
  12006. // requests with the JSON null value. By default, fields with empty
  12007. // values are omitted from API requests. However, any field with an
  12008. // empty value appearing in NullFields will be sent to the server as
  12009. // null. It is an error if a field in this list has a non-empty value.
  12010. // This may be used to include null fields in Patch requests.
  12011. NullFields []string `json:"-"`
  12012. }
  12013. func (s *Result) MarshalJSON() ([]byte, error) {
  12014. type NoMethod Result
  12015. raw := NoMethod(*s)
  12016. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12017. }
  12018. func (s *Result) UnmarshalJSON(data []byte) error {
  12019. type NoMethod Result
  12020. var s1 struct {
  12021. Score gensupport.JSONFloat64 `json:"score"`
  12022. *NoMethod
  12023. }
  12024. s1.NoMethod = (*NoMethod)(s)
  12025. if err := json.Unmarshal(data, &s1); err != nil {
  12026. return err
  12027. }
  12028. s.Score = float64(s1.Score)
  12029. return nil
  12030. }
  12031. // SafeSearchAnnotation: Set of features pertaining to the image,
  12032. // computed by computer vision
  12033. // methods over safe-search verticals (for example, adult, spoof,
  12034. // medical,
  12035. // violence).
  12036. type SafeSearchAnnotation struct {
  12037. // Adult: Represents the adult content likelihood for the image. Adult
  12038. // content may
  12039. // contain elements such as nudity, pornographic images or cartoons,
  12040. // or
  12041. // sexual activities.
  12042. //
  12043. // Possible values:
  12044. // "UNKNOWN" - Unknown likelihood.
  12045. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  12046. // specified vertical.
  12047. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  12048. // vertical.
  12049. // "POSSIBLE" - It is possible that the image belongs to the specified
  12050. // vertical.
  12051. // "LIKELY" - It is likely that the image belongs to the specified
  12052. // vertical.
  12053. // "VERY_LIKELY" - It is very likely that the image belongs to the
  12054. // specified vertical.
  12055. Adult string `json:"adult,omitempty"`
  12056. // Medical: Likelihood that this is a medical image.
  12057. //
  12058. // Possible values:
  12059. // "UNKNOWN" - Unknown likelihood.
  12060. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  12061. // specified vertical.
  12062. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  12063. // vertical.
  12064. // "POSSIBLE" - It is possible that the image belongs to the specified
  12065. // vertical.
  12066. // "LIKELY" - It is likely that the image belongs to the specified
  12067. // vertical.
  12068. // "VERY_LIKELY" - It is very likely that the image belongs to the
  12069. // specified vertical.
  12070. Medical string `json:"medical,omitempty"`
  12071. // Racy: Likelihood that the request image contains racy content. Racy
  12072. // content may
  12073. // include (but is not limited to) skimpy or sheer clothing,
  12074. // strategically
  12075. // covered nudity, lewd or provocative poses, or close-ups of
  12076. // sensitive
  12077. // body areas.
  12078. //
  12079. // Possible values:
  12080. // "UNKNOWN" - Unknown likelihood.
  12081. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  12082. // specified vertical.
  12083. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  12084. // vertical.
  12085. // "POSSIBLE" - It is possible that the image belongs to the specified
  12086. // vertical.
  12087. // "LIKELY" - It is likely that the image belongs to the specified
  12088. // vertical.
  12089. // "VERY_LIKELY" - It is very likely that the image belongs to the
  12090. // specified vertical.
  12091. Racy string `json:"racy,omitempty"`
  12092. // Spoof: Spoof likelihood. The likelihood that an modification
  12093. // was made to the image's canonical version to make it appear
  12094. // funny or offensive.
  12095. //
  12096. // Possible values:
  12097. // "UNKNOWN" - Unknown likelihood.
  12098. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  12099. // specified vertical.
  12100. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  12101. // vertical.
  12102. // "POSSIBLE" - It is possible that the image belongs to the specified
  12103. // vertical.
  12104. // "LIKELY" - It is likely that the image belongs to the specified
  12105. // vertical.
  12106. // "VERY_LIKELY" - It is very likely that the image belongs to the
  12107. // specified vertical.
  12108. Spoof string `json:"spoof,omitempty"`
  12109. // Violence: Likelihood that this image contains violent content.
  12110. //
  12111. // Possible values:
  12112. // "UNKNOWN" - Unknown likelihood.
  12113. // "VERY_UNLIKELY" - It is very unlikely that the image belongs to the
  12114. // specified vertical.
  12115. // "UNLIKELY" - It is unlikely that the image belongs to the specified
  12116. // vertical.
  12117. // "POSSIBLE" - It is possible that the image belongs to the specified
  12118. // vertical.
  12119. // "LIKELY" - It is likely that the image belongs to the specified
  12120. // vertical.
  12121. // "VERY_LIKELY" - It is very likely that the image belongs to the
  12122. // specified vertical.
  12123. Violence string `json:"violence,omitempty"`
  12124. // ForceSendFields is a list of field names (e.g. "Adult") to
  12125. // unconditionally include in API requests. By default, fields with
  12126. // empty values are omitted from API requests. However, any non-pointer,
  12127. // non-interface field appearing in ForceSendFields will be sent to the
  12128. // server regardless of whether the field is empty or not. This may be
  12129. // used to include empty fields in Patch requests.
  12130. ForceSendFields []string `json:"-"`
  12131. // NullFields is a list of field names (e.g. "Adult") to include in API
  12132. // requests with the JSON null value. By default, fields with empty
  12133. // values are omitted from API requests. However, any field with an
  12134. // empty value appearing in NullFields will be sent to the server as
  12135. // null. It is an error if a field in this list has a non-empty value.
  12136. // This may be used to include null fields in Patch requests.
  12137. NullFields []string `json:"-"`
  12138. }
  12139. func (s *SafeSearchAnnotation) MarshalJSON() ([]byte, error) {
  12140. type NoMethod SafeSearchAnnotation
  12141. raw := NoMethod(*s)
  12142. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12143. }
  12144. // Status: The `Status` type defines a logical error model that is
  12145. // suitable for
  12146. // different programming environments, including REST APIs and RPC APIs.
  12147. // It is
  12148. // used by [gRPC](https://github.com/grpc). The error model is designed
  12149. // to be:
  12150. //
  12151. // - Simple to use and understand for most users
  12152. // - Flexible enough to meet unexpected needs
  12153. //
  12154. // # Overview
  12155. //
  12156. // The `Status` message contains three pieces of data: error code,
  12157. // error
  12158. // message, and error details. The error code should be an enum value
  12159. // of
  12160. // google.rpc.Code, but it may accept additional error codes if needed.
  12161. // The
  12162. // error message should be a developer-facing English message that
  12163. // helps
  12164. // developers *understand* and *resolve* the error. If a localized
  12165. // user-facing
  12166. // error message is needed, put the localized message in the error
  12167. // details or
  12168. // localize it in the client. The optional error details may contain
  12169. // arbitrary
  12170. // information about the error. There is a predefined set of error
  12171. // detail types
  12172. // in the package `google.rpc` that can be used for common error
  12173. // conditions.
  12174. //
  12175. // # Language mapping
  12176. //
  12177. // The `Status` message is the logical representation of the error
  12178. // model, but it
  12179. // is not necessarily the actual wire format. When the `Status` message
  12180. // is
  12181. // exposed in different client libraries and different wire protocols,
  12182. // it can be
  12183. // mapped differently. For example, it will likely be mapped to some
  12184. // exceptions
  12185. // in Java, but more likely mapped to some error codes in C.
  12186. //
  12187. // # Other uses
  12188. //
  12189. // The error model and the `Status` message can be used in a variety
  12190. // of
  12191. // environments, either with or without APIs, to provide a
  12192. // consistent developer experience across different
  12193. // environments.
  12194. //
  12195. // Example uses of this error model include:
  12196. //
  12197. // - Partial errors. If a service needs to return partial errors to the
  12198. // client,
  12199. // it may embed the `Status` in the normal response to indicate the
  12200. // partial
  12201. // errors.
  12202. //
  12203. // - Workflow errors. A typical workflow has multiple steps. Each step
  12204. // may
  12205. // have a `Status` message for error reporting.
  12206. //
  12207. // - Batch operations. If a client uses batch request and batch
  12208. // response, the
  12209. // `Status` message should be used directly inside batch response,
  12210. // one for
  12211. // each error sub-response.
  12212. //
  12213. // - Asynchronous operations. If an API call embeds asynchronous
  12214. // operation
  12215. // results in its response, the status of those operations should
  12216. // be
  12217. // represented directly using the `Status` message.
  12218. //
  12219. // - Logging. If some API errors are stored in logs, the message
  12220. // `Status` could
  12221. // be used directly after any stripping needed for security/privacy
  12222. // reasons.
  12223. type Status struct {
  12224. // Code: The status code, which should be an enum value of
  12225. // google.rpc.Code.
  12226. Code int64 `json:"code,omitempty"`
  12227. // Details: A list of messages that carry the error details. There is a
  12228. // common set of
  12229. // message types for APIs to use.
  12230. Details []googleapi.RawMessage `json:"details,omitempty"`
  12231. // Message: A developer-facing error message, which should be in
  12232. // English. Any
  12233. // user-facing error message should be localized and sent in
  12234. // the
  12235. // google.rpc.Status.details field, or localized by the client.
  12236. Message string `json:"message,omitempty"`
  12237. // ForceSendFields is a list of field names (e.g. "Code") to
  12238. // unconditionally include in API requests. By default, fields with
  12239. // empty values are omitted from API requests. However, any non-pointer,
  12240. // non-interface field appearing in ForceSendFields will be sent to the
  12241. // server regardless of whether the field is empty or not. This may be
  12242. // used to include empty fields in Patch requests.
  12243. ForceSendFields []string `json:"-"`
  12244. // NullFields is a list of field names (e.g. "Code") to include in API
  12245. // requests with the JSON null value. By default, fields with empty
  12246. // values are omitted from API requests. However, any field with an
  12247. // empty value appearing in NullFields will be sent to the server as
  12248. // null. It is an error if a field in this list has a non-empty value.
  12249. // This may be used to include null fields in Patch requests.
  12250. NullFields []string `json:"-"`
  12251. }
  12252. func (s *Status) MarshalJSON() ([]byte, error) {
  12253. type NoMethod Status
  12254. raw := NoMethod(*s)
  12255. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12256. }
  12257. // Symbol: A single symbol representation.
  12258. type Symbol struct {
  12259. // BoundingBox: The bounding box for the symbol.
  12260. // The vertices are in the order of top-left, top-right,
  12261. // bottom-right,
  12262. // bottom-left. When a rotation of the bounding box is detected the
  12263. // rotation
  12264. // is represented as around the top-left corner as defined when the text
  12265. // is
  12266. // read in the 'natural' orientation.
  12267. // For example:
  12268. // * when the text is horizontal it might look like:
  12269. // 0----1
  12270. // | |
  12271. // 3----2
  12272. // * when it's rotated 180 degrees around the top-left corner it
  12273. // becomes:
  12274. // 2----3
  12275. // | |
  12276. // 1----0
  12277. // and the vertice order will still be (0, 1, 2, 3).
  12278. BoundingBox *BoundingPoly `json:"boundingBox,omitempty"`
  12279. // Confidence: Confidence of the OCR results for the symbol. Range [0,
  12280. // 1].
  12281. Confidence float64 `json:"confidence,omitempty"`
  12282. // Property: Additional information detected for the symbol.
  12283. Property *TextProperty `json:"property,omitempty"`
  12284. // Text: The actual UTF-8 representation of the symbol.
  12285. Text string `json:"text,omitempty"`
  12286. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  12287. // unconditionally include in API requests. By default, fields with
  12288. // empty values are omitted from API requests. However, any non-pointer,
  12289. // non-interface field appearing in ForceSendFields will be sent to the
  12290. // server regardless of whether the field is empty or not. This may be
  12291. // used to include empty fields in Patch requests.
  12292. ForceSendFields []string `json:"-"`
  12293. // NullFields is a list of field names (e.g. "BoundingBox") to include
  12294. // in API requests with the JSON null value. By default, fields with
  12295. // empty values are omitted from API requests. However, any field with
  12296. // an empty value appearing in NullFields will be sent to the server as
  12297. // null. It is an error if a field in this list has a non-empty value.
  12298. // This may be used to include null fields in Patch requests.
  12299. NullFields []string `json:"-"`
  12300. }
  12301. func (s *Symbol) MarshalJSON() ([]byte, error) {
  12302. type NoMethod Symbol
  12303. raw := NoMethod(*s)
  12304. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12305. }
  12306. func (s *Symbol) UnmarshalJSON(data []byte) error {
  12307. type NoMethod Symbol
  12308. var s1 struct {
  12309. Confidence gensupport.JSONFloat64 `json:"confidence"`
  12310. *NoMethod
  12311. }
  12312. s1.NoMethod = (*NoMethod)(s)
  12313. if err := json.Unmarshal(data, &s1); err != nil {
  12314. return err
  12315. }
  12316. s.Confidence = float64(s1.Confidence)
  12317. return nil
  12318. }
  12319. // TextAnnotation: TextAnnotation contains a structured representation
  12320. // of OCR extracted text.
  12321. // The hierarchy of an OCR extracted text structure is like this:
  12322. // TextAnnotation -> Page -> Block -> Paragraph -> Word ->
  12323. // Symbol
  12324. // Each structural component, starting from Page, may further have their
  12325. // own
  12326. // properties. Properties describe detected languages, breaks etc..
  12327. // Please refer
  12328. // to the TextAnnotation.TextProperty message definition below for
  12329. // more
  12330. // detail.
  12331. type TextAnnotation struct {
  12332. // Pages: List of pages detected by OCR.
  12333. Pages []*Page `json:"pages,omitempty"`
  12334. // Text: UTF-8 text detected on the pages.
  12335. Text string `json:"text,omitempty"`
  12336. // ForceSendFields is a list of field names (e.g. "Pages") to
  12337. // unconditionally include in API requests. By default, fields with
  12338. // empty values are omitted from API requests. However, any non-pointer,
  12339. // non-interface field appearing in ForceSendFields will be sent to the
  12340. // server regardless of whether the field is empty or not. This may be
  12341. // used to include empty fields in Patch requests.
  12342. ForceSendFields []string `json:"-"`
  12343. // NullFields is a list of field names (e.g. "Pages") to include in API
  12344. // requests with the JSON null value. By default, fields with empty
  12345. // values are omitted from API requests. However, any field with an
  12346. // empty value appearing in NullFields will be sent to the server as
  12347. // null. It is an error if a field in this list has a non-empty value.
  12348. // This may be used to include null fields in Patch requests.
  12349. NullFields []string `json:"-"`
  12350. }
  12351. func (s *TextAnnotation) MarshalJSON() ([]byte, error) {
  12352. type NoMethod TextAnnotation
  12353. raw := NoMethod(*s)
  12354. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12355. }
  12356. // TextProperty: Additional information detected on the structural
  12357. // component.
  12358. type TextProperty struct {
  12359. // DetectedBreak: Detected start or end of a text segment.
  12360. DetectedBreak *DetectedBreak `json:"detectedBreak,omitempty"`
  12361. // DetectedLanguages: A list of detected languages together with
  12362. // confidence.
  12363. DetectedLanguages []*DetectedLanguage `json:"detectedLanguages,omitempty"`
  12364. // ForceSendFields is a list of field names (e.g. "DetectedBreak") to
  12365. // unconditionally include in API requests. By default, fields with
  12366. // empty values are omitted from API requests. However, any non-pointer,
  12367. // non-interface field appearing in ForceSendFields will be sent to the
  12368. // server regardless of whether the field is empty or not. This may be
  12369. // used to include empty fields in Patch requests.
  12370. ForceSendFields []string `json:"-"`
  12371. // NullFields is a list of field names (e.g. "DetectedBreak") to include
  12372. // in API requests with the JSON null value. By default, fields with
  12373. // empty values are omitted from API requests. However, any field with
  12374. // an empty value appearing in NullFields will be sent to the server as
  12375. // null. It is an error if a field in this list has a non-empty value.
  12376. // This may be used to include null fields in Patch requests.
  12377. NullFields []string `json:"-"`
  12378. }
  12379. func (s *TextProperty) MarshalJSON() ([]byte, error) {
  12380. type NoMethod TextProperty
  12381. raw := NoMethod(*s)
  12382. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12383. }
  12384. // Vertex: A vertex represents a 2D point in the image.
  12385. // NOTE: the vertex coordinates are in the same scale as the original
  12386. // image.
  12387. type Vertex struct {
  12388. // X: X coordinate.
  12389. X int64 `json:"x,omitempty"`
  12390. // Y: Y coordinate.
  12391. Y int64 `json:"y,omitempty"`
  12392. // ForceSendFields is a list of field names (e.g. "X") to
  12393. // unconditionally include in API requests. By default, fields with
  12394. // empty values are omitted from API requests. However, any non-pointer,
  12395. // non-interface field appearing in ForceSendFields will be sent to the
  12396. // server regardless of whether the field is empty or not. This may be
  12397. // used to include empty fields in Patch requests.
  12398. ForceSendFields []string `json:"-"`
  12399. // NullFields is a list of field names (e.g. "X") to include in API
  12400. // requests with the JSON null value. By default, fields with empty
  12401. // values are omitted from API requests. However, any field with an
  12402. // empty value appearing in NullFields will be sent to the server as
  12403. // null. It is an error if a field in this list has a non-empty value.
  12404. // This may be used to include null fields in Patch requests.
  12405. NullFields []string `json:"-"`
  12406. }
  12407. func (s *Vertex) MarshalJSON() ([]byte, error) {
  12408. type NoMethod Vertex
  12409. raw := NoMethod(*s)
  12410. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12411. }
  12412. // WebDetection: Relevant information for the image from the Internet.
  12413. type WebDetection struct {
  12414. // BestGuessLabels: The service's best guess as to the topic of the
  12415. // request image.
  12416. // Inferred from similar images on the open web.
  12417. BestGuessLabels []*WebLabel `json:"bestGuessLabels,omitempty"`
  12418. // FullMatchingImages: Fully matching images from the Internet.
  12419. // Can include resized copies of the query image.
  12420. FullMatchingImages []*WebImage `json:"fullMatchingImages,omitempty"`
  12421. // PagesWithMatchingImages: Web pages containing the matching images
  12422. // from the Internet.
  12423. PagesWithMatchingImages []*WebPage `json:"pagesWithMatchingImages,omitempty"`
  12424. // PartialMatchingImages: Partial matching images from the
  12425. // Internet.
  12426. // Those images are similar enough to share some key-point features.
  12427. // For
  12428. // example an original image will likely have partial matching for its
  12429. // crops.
  12430. PartialMatchingImages []*WebImage `json:"partialMatchingImages,omitempty"`
  12431. // VisuallySimilarImages: The visually similar image results.
  12432. VisuallySimilarImages []*WebImage `json:"visuallySimilarImages,omitempty"`
  12433. // WebEntities: Deduced entities from similar images on the Internet.
  12434. WebEntities []*WebEntity `json:"webEntities,omitempty"`
  12435. // ForceSendFields is a list of field names (e.g. "BestGuessLabels") to
  12436. // unconditionally include in API requests. By default, fields with
  12437. // empty values are omitted from API requests. However, any non-pointer,
  12438. // non-interface field appearing in ForceSendFields will be sent to the
  12439. // server regardless of whether the field is empty or not. This may be
  12440. // used to include empty fields in Patch requests.
  12441. ForceSendFields []string `json:"-"`
  12442. // NullFields is a list of field names (e.g. "BestGuessLabels") to
  12443. // include in API requests with the JSON null value. By default, fields
  12444. // with empty values are omitted from API requests. However, any field
  12445. // with an empty value appearing in NullFields will be sent to the
  12446. // server as null. It is an error if a field in this list has a
  12447. // non-empty value. This may be used to include null fields in Patch
  12448. // requests.
  12449. NullFields []string `json:"-"`
  12450. }
  12451. func (s *WebDetection) MarshalJSON() ([]byte, error) {
  12452. type NoMethod WebDetection
  12453. raw := NoMethod(*s)
  12454. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12455. }
  12456. // WebDetectionParams: Parameters for web detection request.
  12457. type WebDetectionParams struct {
  12458. // IncludeGeoResults: Whether to include results derived from the geo
  12459. // information in the image.
  12460. IncludeGeoResults bool `json:"includeGeoResults,omitempty"`
  12461. // ForceSendFields is a list of field names (e.g. "IncludeGeoResults")
  12462. // to unconditionally include in API requests. By default, fields with
  12463. // empty values are omitted from API requests. However, any non-pointer,
  12464. // non-interface field appearing in ForceSendFields will be sent to the
  12465. // server regardless of whether the field is empty or not. This may be
  12466. // used to include empty fields in Patch requests.
  12467. ForceSendFields []string `json:"-"`
  12468. // NullFields is a list of field names (e.g. "IncludeGeoResults") to
  12469. // include in API requests with the JSON null value. By default, fields
  12470. // with empty values are omitted from API requests. However, any field
  12471. // with an empty value appearing in NullFields will be sent to the
  12472. // server as null. It is an error if a field in this list has a
  12473. // non-empty value. This may be used to include null fields in Patch
  12474. // requests.
  12475. NullFields []string `json:"-"`
  12476. }
  12477. func (s *WebDetectionParams) MarshalJSON() ([]byte, error) {
  12478. type NoMethod WebDetectionParams
  12479. raw := NoMethod(*s)
  12480. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12481. }
  12482. // WebEntity: Entity deduced from similar images on the Internet.
  12483. type WebEntity struct {
  12484. // Description: Canonical description of the entity, in English.
  12485. Description string `json:"description,omitempty"`
  12486. // EntityId: Opaque entity ID.
  12487. EntityId string `json:"entityId,omitempty"`
  12488. // Score: Overall relevancy score for the entity.
  12489. // Not normalized and not comparable across different image queries.
  12490. Score float64 `json:"score,omitempty"`
  12491. // ForceSendFields is a list of field names (e.g. "Description") to
  12492. // unconditionally include in API requests. By default, fields with
  12493. // empty values are omitted from API requests. However, any non-pointer,
  12494. // non-interface field appearing in ForceSendFields will be sent to the
  12495. // server regardless of whether the field is empty or not. This may be
  12496. // used to include empty fields in Patch requests.
  12497. ForceSendFields []string `json:"-"`
  12498. // NullFields is a list of field names (e.g. "Description") to include
  12499. // in API requests with the JSON null value. By default, fields with
  12500. // empty values are omitted from API requests. However, any field with
  12501. // an empty value appearing in NullFields will be sent to the server as
  12502. // null. It is an error if a field in this list has a non-empty value.
  12503. // This may be used to include null fields in Patch requests.
  12504. NullFields []string `json:"-"`
  12505. }
  12506. func (s *WebEntity) MarshalJSON() ([]byte, error) {
  12507. type NoMethod WebEntity
  12508. raw := NoMethod(*s)
  12509. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12510. }
  12511. func (s *WebEntity) UnmarshalJSON(data []byte) error {
  12512. type NoMethod WebEntity
  12513. var s1 struct {
  12514. Score gensupport.JSONFloat64 `json:"score"`
  12515. *NoMethod
  12516. }
  12517. s1.NoMethod = (*NoMethod)(s)
  12518. if err := json.Unmarshal(data, &s1); err != nil {
  12519. return err
  12520. }
  12521. s.Score = float64(s1.Score)
  12522. return nil
  12523. }
  12524. // WebImage: Metadata for online images.
  12525. type WebImage struct {
  12526. // Score: (Deprecated) Overall relevancy score for the image.
  12527. Score float64 `json:"score,omitempty"`
  12528. // Url: The result image URL.
  12529. Url string `json:"url,omitempty"`
  12530. // ForceSendFields is a list of field names (e.g. "Score") to
  12531. // unconditionally include in API requests. By default, fields with
  12532. // empty values are omitted from API requests. However, any non-pointer,
  12533. // non-interface field appearing in ForceSendFields will be sent to the
  12534. // server regardless of whether the field is empty or not. This may be
  12535. // used to include empty fields in Patch requests.
  12536. ForceSendFields []string `json:"-"`
  12537. // NullFields is a list of field names (e.g. "Score") to include in API
  12538. // requests with the JSON null value. By default, fields with empty
  12539. // values are omitted from API requests. However, any field with an
  12540. // empty value appearing in NullFields will be sent to the server as
  12541. // null. It is an error if a field in this list has a non-empty value.
  12542. // This may be used to include null fields in Patch requests.
  12543. NullFields []string `json:"-"`
  12544. }
  12545. func (s *WebImage) MarshalJSON() ([]byte, error) {
  12546. type NoMethod WebImage
  12547. raw := NoMethod(*s)
  12548. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12549. }
  12550. func (s *WebImage) UnmarshalJSON(data []byte) error {
  12551. type NoMethod WebImage
  12552. var s1 struct {
  12553. Score gensupport.JSONFloat64 `json:"score"`
  12554. *NoMethod
  12555. }
  12556. s1.NoMethod = (*NoMethod)(s)
  12557. if err := json.Unmarshal(data, &s1); err != nil {
  12558. return err
  12559. }
  12560. s.Score = float64(s1.Score)
  12561. return nil
  12562. }
  12563. // WebLabel: Label to provide extra metadata for the web detection.
  12564. type WebLabel struct {
  12565. // Label: Label for extra metadata.
  12566. Label string `json:"label,omitempty"`
  12567. // LanguageCode: The BCP-47 language code for `label`, such as "en-US"
  12568. // or "sr-Latn".
  12569. // For more information,
  12570. // see
  12571. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  12572. LanguageCode string `json:"languageCode,omitempty"`
  12573. // ForceSendFields is a list of field names (e.g. "Label") to
  12574. // unconditionally include in API requests. By default, fields with
  12575. // empty values are omitted from API requests. However, any non-pointer,
  12576. // non-interface field appearing in ForceSendFields will be sent to the
  12577. // server regardless of whether the field is empty or not. This may be
  12578. // used to include empty fields in Patch requests.
  12579. ForceSendFields []string `json:"-"`
  12580. // NullFields is a list of field names (e.g. "Label") to include in API
  12581. // requests with the JSON null value. By default, fields with empty
  12582. // values are omitted from API requests. However, any field with an
  12583. // empty value appearing in NullFields will be sent to the server as
  12584. // null. It is an error if a field in this list has a non-empty value.
  12585. // This may be used to include null fields in Patch requests.
  12586. NullFields []string `json:"-"`
  12587. }
  12588. func (s *WebLabel) MarshalJSON() ([]byte, error) {
  12589. type NoMethod WebLabel
  12590. raw := NoMethod(*s)
  12591. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12592. }
  12593. // WebPage: Metadata for web pages.
  12594. type WebPage struct {
  12595. // FullMatchingImages: Fully matching images on the page.
  12596. // Can include resized copies of the query image.
  12597. FullMatchingImages []*WebImage `json:"fullMatchingImages,omitempty"`
  12598. // PageTitle: Title for the web page, may contain HTML markups.
  12599. PageTitle string `json:"pageTitle,omitempty"`
  12600. // PartialMatchingImages: Partial matching images on the page.
  12601. // Those images are similar enough to share some key-point features.
  12602. // For
  12603. // example an original image will likely have partial matching for
  12604. // its
  12605. // crops.
  12606. PartialMatchingImages []*WebImage `json:"partialMatchingImages,omitempty"`
  12607. // Score: (Deprecated) Overall relevancy score for the web page.
  12608. Score float64 `json:"score,omitempty"`
  12609. // Url: The result web page URL.
  12610. Url string `json:"url,omitempty"`
  12611. // ForceSendFields is a list of field names (e.g. "FullMatchingImages")
  12612. // to unconditionally include in API requests. By default, fields with
  12613. // empty values are omitted from API requests. However, any non-pointer,
  12614. // non-interface field appearing in ForceSendFields will be sent to the
  12615. // server regardless of whether the field is empty or not. This may be
  12616. // used to include empty fields in Patch requests.
  12617. ForceSendFields []string `json:"-"`
  12618. // NullFields is a list of field names (e.g. "FullMatchingImages") to
  12619. // include in API requests with the JSON null value. By default, fields
  12620. // with empty values are omitted from API requests. However, any field
  12621. // with an empty value appearing in NullFields will be sent to the
  12622. // server as null. It is an error if a field in this list has a
  12623. // non-empty value. This may be used to include null fields in Patch
  12624. // requests.
  12625. NullFields []string `json:"-"`
  12626. }
  12627. func (s *WebPage) MarshalJSON() ([]byte, error) {
  12628. type NoMethod WebPage
  12629. raw := NoMethod(*s)
  12630. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12631. }
  12632. func (s *WebPage) UnmarshalJSON(data []byte) error {
  12633. type NoMethod WebPage
  12634. var s1 struct {
  12635. Score gensupport.JSONFloat64 `json:"score"`
  12636. *NoMethod
  12637. }
  12638. s1.NoMethod = (*NoMethod)(s)
  12639. if err := json.Unmarshal(data, &s1); err != nil {
  12640. return err
  12641. }
  12642. s.Score = float64(s1.Score)
  12643. return nil
  12644. }
  12645. // Word: A word representation.
  12646. type Word struct {
  12647. // BoundingBox: The bounding box for the word.
  12648. // The vertices are in the order of top-left, top-right,
  12649. // bottom-right,
  12650. // bottom-left. When a rotation of the bounding box is detected the
  12651. // rotation
  12652. // is represented as around the top-left corner as defined when the text
  12653. // is
  12654. // read in the 'natural' orientation.
  12655. // For example:
  12656. // * when the text is horizontal it might look like:
  12657. // 0----1
  12658. // | |
  12659. // 3----2
  12660. // * when it's rotated 180 degrees around the top-left corner it
  12661. // becomes:
  12662. // 2----3
  12663. // | |
  12664. // 1----0
  12665. // and the vertex order will still be (0, 1, 2, 3).
  12666. BoundingBox *BoundingPoly `json:"boundingBox,omitempty"`
  12667. // Confidence: Confidence of the OCR results for the word. Range [0, 1].
  12668. Confidence float64 `json:"confidence,omitempty"`
  12669. // Property: Additional information detected for the word.
  12670. Property *TextProperty `json:"property,omitempty"`
  12671. // Symbols: List of symbols in the word.
  12672. // The order of the symbols follows the natural reading order.
  12673. Symbols []*Symbol `json:"symbols,omitempty"`
  12674. // ForceSendFields is a list of field names (e.g. "BoundingBox") to
  12675. // unconditionally include in API requests. By default, fields with
  12676. // empty values are omitted from API requests. However, any non-pointer,
  12677. // non-interface field appearing in ForceSendFields will be sent to the
  12678. // server regardless of whether the field is empty or not. This may be
  12679. // used to include empty fields in Patch requests.
  12680. ForceSendFields []string `json:"-"`
  12681. // NullFields is a list of field names (e.g. "BoundingBox") to include
  12682. // in API requests with the JSON null value. By default, fields with
  12683. // empty values are omitted from API requests. However, any field with
  12684. // an empty value appearing in NullFields will be sent to the server as
  12685. // null. It is an error if a field in this list has a non-empty value.
  12686. // This may be used to include null fields in Patch requests.
  12687. NullFields []string `json:"-"`
  12688. }
  12689. func (s *Word) MarshalJSON() ([]byte, error) {
  12690. type NoMethod Word
  12691. raw := NoMethod(*s)
  12692. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12693. }
  12694. func (s *Word) UnmarshalJSON(data []byte) error {
  12695. type NoMethod Word
  12696. var s1 struct {
  12697. Confidence gensupport.JSONFloat64 `json:"confidence"`
  12698. *NoMethod
  12699. }
  12700. s1.NoMethod = (*NoMethod)(s)
  12701. if err := json.Unmarshal(data, &s1); err != nil {
  12702. return err
  12703. }
  12704. s.Confidence = float64(s1.Confidence)
  12705. return nil
  12706. }
  12707. // method id "vision.files.asyncBatchAnnotate":
  12708. type FilesAsyncBatchAnnotateCall struct {
  12709. s *Service
  12710. asyncbatchannotatefilesrequest *AsyncBatchAnnotateFilesRequest
  12711. urlParams_ gensupport.URLParams
  12712. ctx_ context.Context
  12713. header_ http.Header
  12714. }
  12715. // AsyncBatchAnnotate: Run asynchronous image detection and annotation
  12716. // for a list of generic
  12717. // files, such as PDF files, which may contain multiple pages and
  12718. // multiple
  12719. // images per page. Progress and results can be retrieved through
  12720. // the
  12721. // `google.longrunning.Operations` interface.
  12722. // `Operation.metadata` contains `OperationMetadata`
  12723. // (metadata).
  12724. // `Operation.response` contains `AsyncBatchAnnotateFilesResponse`
  12725. // (results).
  12726. func (r *FilesService) AsyncBatchAnnotate(asyncbatchannotatefilesrequest *AsyncBatchAnnotateFilesRequest) *FilesAsyncBatchAnnotateCall {
  12727. c := &FilesAsyncBatchAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12728. c.asyncbatchannotatefilesrequest = asyncbatchannotatefilesrequest
  12729. return c
  12730. }
  12731. // Fields allows partial responses to be retrieved. See
  12732. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12733. // for more information.
  12734. func (c *FilesAsyncBatchAnnotateCall) Fields(s ...googleapi.Field) *FilesAsyncBatchAnnotateCall {
  12735. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12736. return c
  12737. }
  12738. // Context sets the context to be used in this call's Do method. Any
  12739. // pending HTTP request will be aborted if the provided context is
  12740. // canceled.
  12741. func (c *FilesAsyncBatchAnnotateCall) Context(ctx context.Context) *FilesAsyncBatchAnnotateCall {
  12742. c.ctx_ = ctx
  12743. return c
  12744. }
  12745. // Header returns an http.Header that can be modified by the caller to
  12746. // add HTTP headers to the request.
  12747. func (c *FilesAsyncBatchAnnotateCall) Header() http.Header {
  12748. if c.header_ == nil {
  12749. c.header_ = make(http.Header)
  12750. }
  12751. return c.header_
  12752. }
  12753. func (c *FilesAsyncBatchAnnotateCall) doRequest(alt string) (*http.Response, error) {
  12754. reqHeaders := make(http.Header)
  12755. for k, v := range c.header_ {
  12756. reqHeaders[k] = v
  12757. }
  12758. reqHeaders.Set("User-Agent", c.s.userAgent())
  12759. var body io.Reader = nil
  12760. body, err := googleapi.WithoutDataWrapper.JSONReader(c.asyncbatchannotatefilesrequest)
  12761. if err != nil {
  12762. return nil, err
  12763. }
  12764. reqHeaders.Set("Content-Type", "application/json")
  12765. c.urlParams_.Set("alt", alt)
  12766. c.urlParams_.Set("prettyPrint", "false")
  12767. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/files:asyncBatchAnnotate")
  12768. urls += "?" + c.urlParams_.Encode()
  12769. req, err := http.NewRequest("POST", urls, body)
  12770. if err != nil {
  12771. return nil, err
  12772. }
  12773. req.Header = reqHeaders
  12774. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12775. }
  12776. // Do executes the "vision.files.asyncBatchAnnotate" call.
  12777. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  12778. // status code is an error. Response headers are in either
  12779. // *Operation.ServerResponse.Header or (if a response was returned at
  12780. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12781. // to check whether the returned error was because
  12782. // http.StatusNotModified was returned.
  12783. func (c *FilesAsyncBatchAnnotateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  12784. gensupport.SetOptions(c.urlParams_, opts...)
  12785. res, err := c.doRequest("json")
  12786. if res != nil && res.StatusCode == http.StatusNotModified {
  12787. if res.Body != nil {
  12788. res.Body.Close()
  12789. }
  12790. return nil, &googleapi.Error{
  12791. Code: res.StatusCode,
  12792. Header: res.Header,
  12793. }
  12794. }
  12795. if err != nil {
  12796. return nil, err
  12797. }
  12798. defer googleapi.CloseBody(res)
  12799. if err := googleapi.CheckResponse(res); err != nil {
  12800. return nil, err
  12801. }
  12802. ret := &Operation{
  12803. ServerResponse: googleapi.ServerResponse{
  12804. Header: res.Header,
  12805. HTTPStatusCode: res.StatusCode,
  12806. },
  12807. }
  12808. target := &ret
  12809. if err := gensupport.DecodeResponse(target, res); err != nil {
  12810. return nil, err
  12811. }
  12812. return ret, nil
  12813. // {
  12814. // "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).",
  12815. // "flatPath": "v1/files:asyncBatchAnnotate",
  12816. // "httpMethod": "POST",
  12817. // "id": "vision.files.asyncBatchAnnotate",
  12818. // "parameterOrder": [],
  12819. // "parameters": {},
  12820. // "path": "v1/files:asyncBatchAnnotate",
  12821. // "request": {
  12822. // "$ref": "AsyncBatchAnnotateFilesRequest"
  12823. // },
  12824. // "response": {
  12825. // "$ref": "Operation"
  12826. // },
  12827. // "scopes": [
  12828. // "https://www.googleapis.com/auth/cloud-platform",
  12829. // "https://www.googleapis.com/auth/cloud-vision"
  12830. // ]
  12831. // }
  12832. }
  12833. // method id "vision.images.annotate":
  12834. type ImagesAnnotateCall struct {
  12835. s *Service
  12836. batchannotateimagesrequest *BatchAnnotateImagesRequest
  12837. urlParams_ gensupport.URLParams
  12838. ctx_ context.Context
  12839. header_ http.Header
  12840. }
  12841. // Annotate: Run image detection and annotation for a batch of images.
  12842. func (r *ImagesService) Annotate(batchannotateimagesrequest *BatchAnnotateImagesRequest) *ImagesAnnotateCall {
  12843. c := &ImagesAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12844. c.batchannotateimagesrequest = batchannotateimagesrequest
  12845. return c
  12846. }
  12847. // Fields allows partial responses to be retrieved. See
  12848. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12849. // for more information.
  12850. func (c *ImagesAnnotateCall) Fields(s ...googleapi.Field) *ImagesAnnotateCall {
  12851. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12852. return c
  12853. }
  12854. // Context sets the context to be used in this call's Do method. Any
  12855. // pending HTTP request will be aborted if the provided context is
  12856. // canceled.
  12857. func (c *ImagesAnnotateCall) Context(ctx context.Context) *ImagesAnnotateCall {
  12858. c.ctx_ = ctx
  12859. return c
  12860. }
  12861. // Header returns an http.Header that can be modified by the caller to
  12862. // add HTTP headers to the request.
  12863. func (c *ImagesAnnotateCall) Header() http.Header {
  12864. if c.header_ == nil {
  12865. c.header_ = make(http.Header)
  12866. }
  12867. return c.header_
  12868. }
  12869. func (c *ImagesAnnotateCall) doRequest(alt string) (*http.Response, error) {
  12870. reqHeaders := make(http.Header)
  12871. for k, v := range c.header_ {
  12872. reqHeaders[k] = v
  12873. }
  12874. reqHeaders.Set("User-Agent", c.s.userAgent())
  12875. var body io.Reader = nil
  12876. body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchannotateimagesrequest)
  12877. if err != nil {
  12878. return nil, err
  12879. }
  12880. reqHeaders.Set("Content-Type", "application/json")
  12881. c.urlParams_.Set("alt", alt)
  12882. c.urlParams_.Set("prettyPrint", "false")
  12883. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/images:annotate")
  12884. urls += "?" + c.urlParams_.Encode()
  12885. req, err := http.NewRequest("POST", urls, body)
  12886. if err != nil {
  12887. return nil, err
  12888. }
  12889. req.Header = reqHeaders
  12890. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12891. }
  12892. // Do executes the "vision.images.annotate" call.
  12893. // Exactly one of *BatchAnnotateImagesResponse or error will be non-nil.
  12894. // Any non-2xx status code is an error. Response headers are in either
  12895. // *BatchAnnotateImagesResponse.ServerResponse.Header or (if a response
  12896. // was returned at all) in error.(*googleapi.Error).Header. Use
  12897. // googleapi.IsNotModified to check whether the returned error was
  12898. // because http.StatusNotModified was returned.
  12899. func (c *ImagesAnnotateCall) Do(opts ...googleapi.CallOption) (*BatchAnnotateImagesResponse, error) {
  12900. gensupport.SetOptions(c.urlParams_, opts...)
  12901. res, err := c.doRequest("json")
  12902. if res != nil && res.StatusCode == http.StatusNotModified {
  12903. if res.Body != nil {
  12904. res.Body.Close()
  12905. }
  12906. return nil, &googleapi.Error{
  12907. Code: res.StatusCode,
  12908. Header: res.Header,
  12909. }
  12910. }
  12911. if err != nil {
  12912. return nil, err
  12913. }
  12914. defer googleapi.CloseBody(res)
  12915. if err := googleapi.CheckResponse(res); err != nil {
  12916. return nil, err
  12917. }
  12918. ret := &BatchAnnotateImagesResponse{
  12919. ServerResponse: googleapi.ServerResponse{
  12920. Header: res.Header,
  12921. HTTPStatusCode: res.StatusCode,
  12922. },
  12923. }
  12924. target := &ret
  12925. if err := gensupport.DecodeResponse(target, res); err != nil {
  12926. return nil, err
  12927. }
  12928. return ret, nil
  12929. // {
  12930. // "description": "Run image detection and annotation for a batch of images.",
  12931. // "flatPath": "v1/images:annotate",
  12932. // "httpMethod": "POST",
  12933. // "id": "vision.images.annotate",
  12934. // "parameterOrder": [],
  12935. // "parameters": {},
  12936. // "path": "v1/images:annotate",
  12937. // "request": {
  12938. // "$ref": "BatchAnnotateImagesRequest"
  12939. // },
  12940. // "response": {
  12941. // "$ref": "BatchAnnotateImagesResponse"
  12942. // },
  12943. // "scopes": [
  12944. // "https://www.googleapis.com/auth/cloud-platform",
  12945. // "https://www.googleapis.com/auth/cloud-vision"
  12946. // ]
  12947. // }
  12948. }
  12949. // method id "vision.locations.operations.get":
  12950. type LocationsOperationsGetCall struct {
  12951. s *Service
  12952. name string
  12953. urlParams_ gensupport.URLParams
  12954. ifNoneMatch_ string
  12955. ctx_ context.Context
  12956. header_ http.Header
  12957. }
  12958. // Get: Gets the latest state of a long-running operation. Clients can
  12959. // use this
  12960. // method to poll the operation result at intervals as recommended by
  12961. // the API
  12962. // service.
  12963. func (r *LocationsOperationsService) Get(name string) *LocationsOperationsGetCall {
  12964. c := &LocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12965. c.name = name
  12966. return c
  12967. }
  12968. // Fields allows partial responses to be retrieved. See
  12969. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12970. // for more information.
  12971. func (c *LocationsOperationsGetCall) Fields(s ...googleapi.Field) *LocationsOperationsGetCall {
  12972. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12973. return c
  12974. }
  12975. // IfNoneMatch sets the optional parameter which makes the operation
  12976. // fail if the object's ETag matches the given value. This is useful for
  12977. // getting updates only after the object has changed since the last
  12978. // request. Use googleapi.IsNotModified to check whether the response
  12979. // error from Do is the result of In-None-Match.
  12980. func (c *LocationsOperationsGetCall) IfNoneMatch(entityTag string) *LocationsOperationsGetCall {
  12981. c.ifNoneMatch_ = entityTag
  12982. return c
  12983. }
  12984. // Context sets the context to be used in this call's Do method. Any
  12985. // pending HTTP request will be aborted if the provided context is
  12986. // canceled.
  12987. func (c *LocationsOperationsGetCall) Context(ctx context.Context) *LocationsOperationsGetCall {
  12988. c.ctx_ = ctx
  12989. return c
  12990. }
  12991. // Header returns an http.Header that can be modified by the caller to
  12992. // add HTTP headers to the request.
  12993. func (c *LocationsOperationsGetCall) Header() http.Header {
  12994. if c.header_ == nil {
  12995. c.header_ = make(http.Header)
  12996. }
  12997. return c.header_
  12998. }
  12999. func (c *LocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  13000. reqHeaders := make(http.Header)
  13001. for k, v := range c.header_ {
  13002. reqHeaders[k] = v
  13003. }
  13004. reqHeaders.Set("User-Agent", c.s.userAgent())
  13005. if c.ifNoneMatch_ != "" {
  13006. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13007. }
  13008. var body io.Reader = nil
  13009. c.urlParams_.Set("alt", alt)
  13010. c.urlParams_.Set("prettyPrint", "false")
  13011. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  13012. urls += "?" + c.urlParams_.Encode()
  13013. req, err := http.NewRequest("GET", urls, body)
  13014. if err != nil {
  13015. return nil, err
  13016. }
  13017. req.Header = reqHeaders
  13018. googleapi.Expand(req.URL, map[string]string{
  13019. "name": c.name,
  13020. })
  13021. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13022. }
  13023. // Do executes the "vision.locations.operations.get" call.
  13024. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  13025. // status code is an error. Response headers are in either
  13026. // *Operation.ServerResponse.Header or (if a response was returned at
  13027. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  13028. // to check whether the returned error was because
  13029. // http.StatusNotModified was returned.
  13030. func (c *LocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  13031. gensupport.SetOptions(c.urlParams_, opts...)
  13032. res, err := c.doRequest("json")
  13033. if res != nil && res.StatusCode == http.StatusNotModified {
  13034. if res.Body != nil {
  13035. res.Body.Close()
  13036. }
  13037. return nil, &googleapi.Error{
  13038. Code: res.StatusCode,
  13039. Header: res.Header,
  13040. }
  13041. }
  13042. if err != nil {
  13043. return nil, err
  13044. }
  13045. defer googleapi.CloseBody(res)
  13046. if err := googleapi.CheckResponse(res); err != nil {
  13047. return nil, err
  13048. }
  13049. ret := &Operation{
  13050. ServerResponse: googleapi.ServerResponse{
  13051. Header: res.Header,
  13052. HTTPStatusCode: res.StatusCode,
  13053. },
  13054. }
  13055. target := &ret
  13056. if err := gensupport.DecodeResponse(target, res); err != nil {
  13057. return nil, err
  13058. }
  13059. return ret, nil
  13060. // {
  13061. // "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.",
  13062. // "flatPath": "v1/locations/{locationsId}/operations/{operationsId}",
  13063. // "httpMethod": "GET",
  13064. // "id": "vision.locations.operations.get",
  13065. // "parameterOrder": [
  13066. // "name"
  13067. // ],
  13068. // "parameters": {
  13069. // "name": {
  13070. // "description": "The name of the operation resource.",
  13071. // "location": "path",
  13072. // "pattern": "^locations/[^/]+/operations/[^/]+$",
  13073. // "required": true,
  13074. // "type": "string"
  13075. // }
  13076. // },
  13077. // "path": "v1/{+name}",
  13078. // "response": {
  13079. // "$ref": "Operation"
  13080. // },
  13081. // "scopes": [
  13082. // "https://www.googleapis.com/auth/cloud-platform",
  13083. // "https://www.googleapis.com/auth/cloud-vision"
  13084. // ]
  13085. // }
  13086. }
  13087. // method id "vision.operations.cancel":
  13088. type OperationsCancelCall struct {
  13089. s *Service
  13090. name string
  13091. canceloperationrequest *CancelOperationRequest
  13092. urlParams_ gensupport.URLParams
  13093. ctx_ context.Context
  13094. header_ http.Header
  13095. }
  13096. // Cancel: Starts asynchronous cancellation on a long-running operation.
  13097. // The server
  13098. // makes a best effort to cancel the operation, but success is
  13099. // not
  13100. // guaranteed. If the server doesn't support this method, it
  13101. // returns
  13102. // `google.rpc.Code.UNIMPLEMENTED`. Clients can
  13103. // use
  13104. // Operations.GetOperation or
  13105. // other methods to check whether the cancellation succeeded or whether
  13106. // the
  13107. // operation completed despite cancellation. On successful
  13108. // cancellation,
  13109. // the operation is not deleted; instead, it becomes an operation
  13110. // with
  13111. // an Operation.error value with a google.rpc.Status.code of
  13112. // 1,
  13113. // corresponding to `Code.CANCELLED`.
  13114. func (r *OperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *OperationsCancelCall {
  13115. c := &OperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13116. c.name = name
  13117. c.canceloperationrequest = canceloperationrequest
  13118. return c
  13119. }
  13120. // Fields allows partial responses to be retrieved. See
  13121. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13122. // for more information.
  13123. func (c *OperationsCancelCall) Fields(s ...googleapi.Field) *OperationsCancelCall {
  13124. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13125. return c
  13126. }
  13127. // Context sets the context to be used in this call's Do method. Any
  13128. // pending HTTP request will be aborted if the provided context is
  13129. // canceled.
  13130. func (c *OperationsCancelCall) Context(ctx context.Context) *OperationsCancelCall {
  13131. c.ctx_ = ctx
  13132. return c
  13133. }
  13134. // Header returns an http.Header that can be modified by the caller to
  13135. // add HTTP headers to the request.
  13136. func (c *OperationsCancelCall) Header() http.Header {
  13137. if c.header_ == nil {
  13138. c.header_ = make(http.Header)
  13139. }
  13140. return c.header_
  13141. }
  13142. func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  13143. reqHeaders := make(http.Header)
  13144. for k, v := range c.header_ {
  13145. reqHeaders[k] = v
  13146. }
  13147. reqHeaders.Set("User-Agent", c.s.userAgent())
  13148. var body io.Reader = nil
  13149. body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
  13150. if err != nil {
  13151. return nil, err
  13152. }
  13153. reqHeaders.Set("Content-Type", "application/json")
  13154. c.urlParams_.Set("alt", alt)
  13155. c.urlParams_.Set("prettyPrint", "false")
  13156. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
  13157. urls += "?" + c.urlParams_.Encode()
  13158. req, err := http.NewRequest("POST", urls, body)
  13159. if err != nil {
  13160. return nil, err
  13161. }
  13162. req.Header = reqHeaders
  13163. googleapi.Expand(req.URL, map[string]string{
  13164. "name": c.name,
  13165. })
  13166. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13167. }
  13168. // Do executes the "vision.operations.cancel" call.
  13169. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  13170. // code is an error. Response headers are in either
  13171. // *Empty.ServerResponse.Header or (if a response was returned at all)
  13172. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  13173. // check whether the returned error was because http.StatusNotModified
  13174. // was returned.
  13175. func (c *OperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  13176. gensupport.SetOptions(c.urlParams_, opts...)
  13177. res, err := c.doRequest("json")
  13178. if res != nil && res.StatusCode == http.StatusNotModified {
  13179. if res.Body != nil {
  13180. res.Body.Close()
  13181. }
  13182. return nil, &googleapi.Error{
  13183. Code: res.StatusCode,
  13184. Header: res.Header,
  13185. }
  13186. }
  13187. if err != nil {
  13188. return nil, err
  13189. }
  13190. defer googleapi.CloseBody(res)
  13191. if err := googleapi.CheckResponse(res); err != nil {
  13192. return nil, err
  13193. }
  13194. ret := &Empty{
  13195. ServerResponse: googleapi.ServerResponse{
  13196. Header: res.Header,
  13197. HTTPStatusCode: res.StatusCode,
  13198. },
  13199. }
  13200. target := &ret
  13201. if err := gensupport.DecodeResponse(target, res); err != nil {
  13202. return nil, err
  13203. }
  13204. return ret, nil
  13205. // {
  13206. // "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`.",
  13207. // "flatPath": "v1/operations/{operationsId}:cancel",
  13208. // "httpMethod": "POST",
  13209. // "id": "vision.operations.cancel",
  13210. // "parameterOrder": [
  13211. // "name"
  13212. // ],
  13213. // "parameters": {
  13214. // "name": {
  13215. // "description": "The name of the operation resource to be cancelled.",
  13216. // "location": "path",
  13217. // "pattern": "^operations/.+$",
  13218. // "required": true,
  13219. // "type": "string"
  13220. // }
  13221. // },
  13222. // "path": "v1/{+name}:cancel",
  13223. // "request": {
  13224. // "$ref": "CancelOperationRequest"
  13225. // },
  13226. // "response": {
  13227. // "$ref": "Empty"
  13228. // },
  13229. // "scopes": [
  13230. // "https://www.googleapis.com/auth/cloud-platform",
  13231. // "https://www.googleapis.com/auth/cloud-vision"
  13232. // ]
  13233. // }
  13234. }
  13235. // method id "vision.operations.delete":
  13236. type OperationsDeleteCall struct {
  13237. s *Service
  13238. name string
  13239. urlParams_ gensupport.URLParams
  13240. ctx_ context.Context
  13241. header_ http.Header
  13242. }
  13243. // Delete: Deletes a long-running operation. This method indicates that
  13244. // the client is
  13245. // no longer interested in the operation result. It does not cancel
  13246. // the
  13247. // operation. If the server doesn't support this method, it
  13248. // returns
  13249. // `google.rpc.Code.UNIMPLEMENTED`.
  13250. func (r *OperationsService) Delete(name string) *OperationsDeleteCall {
  13251. c := &OperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13252. c.name = name
  13253. return c
  13254. }
  13255. // Fields allows partial responses to be retrieved. See
  13256. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13257. // for more information.
  13258. func (c *OperationsDeleteCall) Fields(s ...googleapi.Field) *OperationsDeleteCall {
  13259. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13260. return c
  13261. }
  13262. // Context sets the context to be used in this call's Do method. Any
  13263. // pending HTTP request will be aborted if the provided context is
  13264. // canceled.
  13265. func (c *OperationsDeleteCall) Context(ctx context.Context) *OperationsDeleteCall {
  13266. c.ctx_ = ctx
  13267. return c
  13268. }
  13269. // Header returns an http.Header that can be modified by the caller to
  13270. // add HTTP headers to the request.
  13271. func (c *OperationsDeleteCall) Header() http.Header {
  13272. if c.header_ == nil {
  13273. c.header_ = make(http.Header)
  13274. }
  13275. return c.header_
  13276. }
  13277. func (c *OperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  13278. reqHeaders := make(http.Header)
  13279. for k, v := range c.header_ {
  13280. reqHeaders[k] = v
  13281. }
  13282. reqHeaders.Set("User-Agent", c.s.userAgent())
  13283. var body io.Reader = nil
  13284. c.urlParams_.Set("alt", alt)
  13285. c.urlParams_.Set("prettyPrint", "false")
  13286. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  13287. urls += "?" + c.urlParams_.Encode()
  13288. req, err := http.NewRequest("DELETE", urls, body)
  13289. if err != nil {
  13290. return nil, err
  13291. }
  13292. req.Header = reqHeaders
  13293. googleapi.Expand(req.URL, map[string]string{
  13294. "name": c.name,
  13295. })
  13296. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13297. }
  13298. // Do executes the "vision.operations.delete" call.
  13299. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  13300. // code is an error. Response headers are in either
  13301. // *Empty.ServerResponse.Header or (if a response was returned at all)
  13302. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  13303. // check whether the returned error was because http.StatusNotModified
  13304. // was returned.
  13305. func (c *OperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  13306. gensupport.SetOptions(c.urlParams_, opts...)
  13307. res, err := c.doRequest("json")
  13308. if res != nil && res.StatusCode == http.StatusNotModified {
  13309. if res.Body != nil {
  13310. res.Body.Close()
  13311. }
  13312. return nil, &googleapi.Error{
  13313. Code: res.StatusCode,
  13314. Header: res.Header,
  13315. }
  13316. }
  13317. if err != nil {
  13318. return nil, err
  13319. }
  13320. defer googleapi.CloseBody(res)
  13321. if err := googleapi.CheckResponse(res); err != nil {
  13322. return nil, err
  13323. }
  13324. ret := &Empty{
  13325. ServerResponse: googleapi.ServerResponse{
  13326. Header: res.Header,
  13327. HTTPStatusCode: res.StatusCode,
  13328. },
  13329. }
  13330. target := &ret
  13331. if err := gensupport.DecodeResponse(target, res); err != nil {
  13332. return nil, err
  13333. }
  13334. return ret, nil
  13335. // {
  13336. // "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`.",
  13337. // "flatPath": "v1/operations/{operationsId}",
  13338. // "httpMethod": "DELETE",
  13339. // "id": "vision.operations.delete",
  13340. // "parameterOrder": [
  13341. // "name"
  13342. // ],
  13343. // "parameters": {
  13344. // "name": {
  13345. // "description": "The name of the operation resource to be deleted.",
  13346. // "location": "path",
  13347. // "pattern": "^operations/.+$",
  13348. // "required": true,
  13349. // "type": "string"
  13350. // }
  13351. // },
  13352. // "path": "v1/{+name}",
  13353. // "response": {
  13354. // "$ref": "Empty"
  13355. // },
  13356. // "scopes": [
  13357. // "https://www.googleapis.com/auth/cloud-platform",
  13358. // "https://www.googleapis.com/auth/cloud-vision"
  13359. // ]
  13360. // }
  13361. }
  13362. // method id "vision.operations.get":
  13363. type OperationsGetCall struct {
  13364. s *Service
  13365. name string
  13366. urlParams_ gensupport.URLParams
  13367. ifNoneMatch_ string
  13368. ctx_ context.Context
  13369. header_ http.Header
  13370. }
  13371. // Get: Gets the latest state of a long-running operation. Clients can
  13372. // use this
  13373. // method to poll the operation result at intervals as recommended by
  13374. // the API
  13375. // service.
  13376. func (r *OperationsService) Get(name string) *OperationsGetCall {
  13377. c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13378. c.name = name
  13379. return c
  13380. }
  13381. // Fields allows partial responses to be retrieved. See
  13382. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13383. // for more information.
  13384. func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall {
  13385. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13386. return c
  13387. }
  13388. // IfNoneMatch sets the optional parameter which makes the operation
  13389. // fail if the object's ETag matches the given value. This is useful for
  13390. // getting updates only after the object has changed since the last
  13391. // request. Use googleapi.IsNotModified to check whether the response
  13392. // error from Do is the result of In-None-Match.
  13393. func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall {
  13394. c.ifNoneMatch_ = entityTag
  13395. return c
  13396. }
  13397. // Context sets the context to be used in this call's Do method. Any
  13398. // pending HTTP request will be aborted if the provided context is
  13399. // canceled.
  13400. func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall {
  13401. c.ctx_ = ctx
  13402. return c
  13403. }
  13404. // Header returns an http.Header that can be modified by the caller to
  13405. // add HTTP headers to the request.
  13406. func (c *OperationsGetCall) Header() http.Header {
  13407. if c.header_ == nil {
  13408. c.header_ = make(http.Header)
  13409. }
  13410. return c.header_
  13411. }
  13412. func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) {
  13413. reqHeaders := make(http.Header)
  13414. for k, v := range c.header_ {
  13415. reqHeaders[k] = v
  13416. }
  13417. reqHeaders.Set("User-Agent", c.s.userAgent())
  13418. if c.ifNoneMatch_ != "" {
  13419. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13420. }
  13421. var body io.Reader = nil
  13422. c.urlParams_.Set("alt", alt)
  13423. c.urlParams_.Set("prettyPrint", "false")
  13424. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  13425. urls += "?" + c.urlParams_.Encode()
  13426. req, err := http.NewRequest("GET", urls, body)
  13427. if err != nil {
  13428. return nil, err
  13429. }
  13430. req.Header = reqHeaders
  13431. googleapi.Expand(req.URL, map[string]string{
  13432. "name": c.name,
  13433. })
  13434. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13435. }
  13436. // Do executes the "vision.operations.get" call.
  13437. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  13438. // status code is an error. Response headers are in either
  13439. // *Operation.ServerResponse.Header or (if a response was returned at
  13440. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  13441. // to check whether the returned error was because
  13442. // http.StatusNotModified was returned.
  13443. func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  13444. gensupport.SetOptions(c.urlParams_, opts...)
  13445. res, err := c.doRequest("json")
  13446. if res != nil && res.StatusCode == http.StatusNotModified {
  13447. if res.Body != nil {
  13448. res.Body.Close()
  13449. }
  13450. return nil, &googleapi.Error{
  13451. Code: res.StatusCode,
  13452. Header: res.Header,
  13453. }
  13454. }
  13455. if err != nil {
  13456. return nil, err
  13457. }
  13458. defer googleapi.CloseBody(res)
  13459. if err := googleapi.CheckResponse(res); err != nil {
  13460. return nil, err
  13461. }
  13462. ret := &Operation{
  13463. ServerResponse: googleapi.ServerResponse{
  13464. Header: res.Header,
  13465. HTTPStatusCode: res.StatusCode,
  13466. },
  13467. }
  13468. target := &ret
  13469. if err := gensupport.DecodeResponse(target, res); err != nil {
  13470. return nil, err
  13471. }
  13472. return ret, nil
  13473. // {
  13474. // "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.",
  13475. // "flatPath": "v1/operations/{operationsId}",
  13476. // "httpMethod": "GET",
  13477. // "id": "vision.operations.get",
  13478. // "parameterOrder": [
  13479. // "name"
  13480. // ],
  13481. // "parameters": {
  13482. // "name": {
  13483. // "description": "The name of the operation resource.",
  13484. // "location": "path",
  13485. // "pattern": "^operations/[^/]+$",
  13486. // "required": true,
  13487. // "type": "string"
  13488. // }
  13489. // },
  13490. // "path": "v1/{+name}",
  13491. // "response": {
  13492. // "$ref": "Operation"
  13493. // },
  13494. // "scopes": [
  13495. // "https://www.googleapis.com/auth/cloud-platform",
  13496. // "https://www.googleapis.com/auth/cloud-vision"
  13497. // ]
  13498. // }
  13499. }
  13500. // method id "vision.operations.list":
  13501. type OperationsListCall struct {
  13502. s *Service
  13503. name string
  13504. urlParams_ gensupport.URLParams
  13505. ifNoneMatch_ string
  13506. ctx_ context.Context
  13507. header_ http.Header
  13508. }
  13509. // List: Lists operations that match the specified filter in the
  13510. // request. If the
  13511. // server doesn't support this method, it returns
  13512. // `UNIMPLEMENTED`.
  13513. //
  13514. // NOTE: the `name` binding allows API services to override the
  13515. // binding
  13516. // to use different resource name schemes, such as `users/*/operations`.
  13517. // To
  13518. // override the binding, API services can add a binding such
  13519. // as
  13520. // "/v1/{name=users/*}/operations" to their service configuration.
  13521. // For backwards compatibility, the default name includes the
  13522. // operations
  13523. // collection id, however overriding users must ensure the name
  13524. // binding
  13525. // is the parent resource, without the operations collection id.
  13526. func (r *OperationsService) List(name string) *OperationsListCall {
  13527. c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13528. c.name = name
  13529. return c
  13530. }
  13531. // Filter sets the optional parameter "filter": The standard list
  13532. // filter.
  13533. func (c *OperationsListCall) Filter(filter string) *OperationsListCall {
  13534. c.urlParams_.Set("filter", filter)
  13535. return c
  13536. }
  13537. // PageSize sets the optional parameter "pageSize": The standard list
  13538. // page size.
  13539. func (c *OperationsListCall) PageSize(pageSize int64) *OperationsListCall {
  13540. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  13541. return c
  13542. }
  13543. // PageToken sets the optional parameter "pageToken": The standard list
  13544. // page token.
  13545. func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall {
  13546. c.urlParams_.Set("pageToken", pageToken)
  13547. return c
  13548. }
  13549. // Fields allows partial responses to be retrieved. See
  13550. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13551. // for more information.
  13552. func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall {
  13553. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13554. return c
  13555. }
  13556. // IfNoneMatch sets the optional parameter which makes the operation
  13557. // fail if the object's ETag matches the given value. This is useful for
  13558. // getting updates only after the object has changed since the last
  13559. // request. Use googleapi.IsNotModified to check whether the response
  13560. // error from Do is the result of In-None-Match.
  13561. func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall {
  13562. c.ifNoneMatch_ = entityTag
  13563. return c
  13564. }
  13565. // Context sets the context to be used in this call's Do method. Any
  13566. // pending HTTP request will be aborted if the provided context is
  13567. // canceled.
  13568. func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall {
  13569. c.ctx_ = ctx
  13570. return c
  13571. }
  13572. // Header returns an http.Header that can be modified by the caller to
  13573. // add HTTP headers to the request.
  13574. func (c *OperationsListCall) Header() http.Header {
  13575. if c.header_ == nil {
  13576. c.header_ = make(http.Header)
  13577. }
  13578. return c.header_
  13579. }
  13580. func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) {
  13581. reqHeaders := make(http.Header)
  13582. for k, v := range c.header_ {
  13583. reqHeaders[k] = v
  13584. }
  13585. reqHeaders.Set("User-Agent", c.s.userAgent())
  13586. if c.ifNoneMatch_ != "" {
  13587. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13588. }
  13589. var body io.Reader = nil
  13590. c.urlParams_.Set("alt", alt)
  13591. c.urlParams_.Set("prettyPrint", "false")
  13592. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  13593. urls += "?" + c.urlParams_.Encode()
  13594. req, err := http.NewRequest("GET", urls, body)
  13595. if err != nil {
  13596. return nil, err
  13597. }
  13598. req.Header = reqHeaders
  13599. googleapi.Expand(req.URL, map[string]string{
  13600. "name": c.name,
  13601. })
  13602. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13603. }
  13604. // Do executes the "vision.operations.list" call.
  13605. // Exactly one of *ListOperationsResponse or error will be non-nil. Any
  13606. // non-2xx status code is an error. Response headers are in either
  13607. // *ListOperationsResponse.ServerResponse.Header or (if a response was
  13608. // returned at all) in error.(*googleapi.Error).Header. Use
  13609. // googleapi.IsNotModified to check whether the returned error was
  13610. // because http.StatusNotModified was returned.
  13611. func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  13612. gensupport.SetOptions(c.urlParams_, opts...)
  13613. res, err := c.doRequest("json")
  13614. if res != nil && res.StatusCode == http.StatusNotModified {
  13615. if res.Body != nil {
  13616. res.Body.Close()
  13617. }
  13618. return nil, &googleapi.Error{
  13619. Code: res.StatusCode,
  13620. Header: res.Header,
  13621. }
  13622. }
  13623. if err != nil {
  13624. return nil, err
  13625. }
  13626. defer googleapi.CloseBody(res)
  13627. if err := googleapi.CheckResponse(res); err != nil {
  13628. return nil, err
  13629. }
  13630. ret := &ListOperationsResponse{
  13631. ServerResponse: googleapi.ServerResponse{
  13632. Header: res.Header,
  13633. HTTPStatusCode: res.StatusCode,
  13634. },
  13635. }
  13636. target := &ret
  13637. if err := gensupport.DecodeResponse(target, res); err != nil {
  13638. return nil, err
  13639. }
  13640. return ret, nil
  13641. // {
  13642. // "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.",
  13643. // "flatPath": "v1/operations",
  13644. // "httpMethod": "GET",
  13645. // "id": "vision.operations.list",
  13646. // "parameterOrder": [
  13647. // "name"
  13648. // ],
  13649. // "parameters": {
  13650. // "filter": {
  13651. // "description": "The standard list filter.",
  13652. // "location": "query",
  13653. // "type": "string"
  13654. // },
  13655. // "name": {
  13656. // "description": "The name of the operation's parent resource.",
  13657. // "location": "path",
  13658. // "pattern": "^operations$",
  13659. // "required": true,
  13660. // "type": "string"
  13661. // },
  13662. // "pageSize": {
  13663. // "description": "The standard list page size.",
  13664. // "format": "int32",
  13665. // "location": "query",
  13666. // "type": "integer"
  13667. // },
  13668. // "pageToken": {
  13669. // "description": "The standard list page token.",
  13670. // "location": "query",
  13671. // "type": "string"
  13672. // }
  13673. // },
  13674. // "path": "v1/{+name}",
  13675. // "response": {
  13676. // "$ref": "ListOperationsResponse"
  13677. // },
  13678. // "scopes": [
  13679. // "https://www.googleapis.com/auth/cloud-platform",
  13680. // "https://www.googleapis.com/auth/cloud-vision"
  13681. // ]
  13682. // }
  13683. }
  13684. // Pages invokes f for each page of results.
  13685. // A non-nil error returned from f will halt the iteration.
  13686. // The provided context supersedes any context provided to the Context method.
  13687. func (c *OperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
  13688. c.ctx_ = ctx
  13689. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  13690. for {
  13691. x, err := c.Do()
  13692. if err != nil {
  13693. return err
  13694. }
  13695. if err := f(x); err != nil {
  13696. return err
  13697. }
  13698. if x.NextPageToken == "" {
  13699. return nil
  13700. }
  13701. c.PageToken(x.NextPageToken)
  13702. }
  13703. }
  13704. // method id "vision.projects.locations.productSets.addProduct":
  13705. type ProjectsLocationsProductSetsAddProductCall struct {
  13706. s *Service
  13707. name string
  13708. addproducttoproductsetrequest *AddProductToProductSetRequest
  13709. urlParams_ gensupport.URLParams
  13710. ctx_ context.Context
  13711. header_ http.Header
  13712. }
  13713. // AddProduct: Adds a Product to the specified ProductSet. If the
  13714. // Product is already
  13715. // present, no change is made.
  13716. //
  13717. // One Product can be added to at most 100 ProductSets.
  13718. //
  13719. // Possible errors:
  13720. //
  13721. // * Returns NOT_FOUND if the Product or the ProductSet doesn't exist.
  13722. func (r *ProjectsLocationsProductSetsService) AddProduct(name string, addproducttoproductsetrequest *AddProductToProductSetRequest) *ProjectsLocationsProductSetsAddProductCall {
  13723. c := &ProjectsLocationsProductSetsAddProductCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13724. c.name = name
  13725. c.addproducttoproductsetrequest = addproducttoproductsetrequest
  13726. return c
  13727. }
  13728. // Fields allows partial responses to be retrieved. See
  13729. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13730. // for more information.
  13731. func (c *ProjectsLocationsProductSetsAddProductCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductSetsAddProductCall {
  13732. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13733. return c
  13734. }
  13735. // Context sets the context to be used in this call's Do method. Any
  13736. // pending HTTP request will be aborted if the provided context is
  13737. // canceled.
  13738. func (c *ProjectsLocationsProductSetsAddProductCall) Context(ctx context.Context) *ProjectsLocationsProductSetsAddProductCall {
  13739. c.ctx_ = ctx
  13740. return c
  13741. }
  13742. // Header returns an http.Header that can be modified by the caller to
  13743. // add HTTP headers to the request.
  13744. func (c *ProjectsLocationsProductSetsAddProductCall) Header() http.Header {
  13745. if c.header_ == nil {
  13746. c.header_ = make(http.Header)
  13747. }
  13748. return c.header_
  13749. }
  13750. func (c *ProjectsLocationsProductSetsAddProductCall) doRequest(alt string) (*http.Response, error) {
  13751. reqHeaders := make(http.Header)
  13752. for k, v := range c.header_ {
  13753. reqHeaders[k] = v
  13754. }
  13755. reqHeaders.Set("User-Agent", c.s.userAgent())
  13756. var body io.Reader = nil
  13757. body, err := googleapi.WithoutDataWrapper.JSONReader(c.addproducttoproductsetrequest)
  13758. if err != nil {
  13759. return nil, err
  13760. }
  13761. reqHeaders.Set("Content-Type", "application/json")
  13762. c.urlParams_.Set("alt", alt)
  13763. c.urlParams_.Set("prettyPrint", "false")
  13764. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:addProduct")
  13765. urls += "?" + c.urlParams_.Encode()
  13766. req, err := http.NewRequest("POST", urls, body)
  13767. if err != nil {
  13768. return nil, err
  13769. }
  13770. req.Header = reqHeaders
  13771. googleapi.Expand(req.URL, map[string]string{
  13772. "name": c.name,
  13773. })
  13774. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13775. }
  13776. // Do executes the "vision.projects.locations.productSets.addProduct" call.
  13777. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  13778. // code is an error. Response headers are in either
  13779. // *Empty.ServerResponse.Header or (if a response was returned at all)
  13780. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  13781. // check whether the returned error was because http.StatusNotModified
  13782. // was returned.
  13783. func (c *ProjectsLocationsProductSetsAddProductCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  13784. gensupport.SetOptions(c.urlParams_, opts...)
  13785. res, err := c.doRequest("json")
  13786. if res != nil && res.StatusCode == http.StatusNotModified {
  13787. if res.Body != nil {
  13788. res.Body.Close()
  13789. }
  13790. return nil, &googleapi.Error{
  13791. Code: res.StatusCode,
  13792. Header: res.Header,
  13793. }
  13794. }
  13795. if err != nil {
  13796. return nil, err
  13797. }
  13798. defer googleapi.CloseBody(res)
  13799. if err := googleapi.CheckResponse(res); err != nil {
  13800. return nil, err
  13801. }
  13802. ret := &Empty{
  13803. ServerResponse: googleapi.ServerResponse{
  13804. Header: res.Header,
  13805. HTTPStatusCode: res.StatusCode,
  13806. },
  13807. }
  13808. target := &ret
  13809. if err := gensupport.DecodeResponse(target, res); err != nil {
  13810. return nil, err
  13811. }
  13812. return ret, nil
  13813. // {
  13814. // "description": "Adds a Product to the specified ProductSet. If the Product is already\npresent, no change is made.\n\nOne Product can be added to at most 100 ProductSets.\n\nPossible errors:\n\n* Returns NOT_FOUND if the Product or the ProductSet doesn't exist.",
  13815. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/productSets/{productSetsId}:addProduct",
  13816. // "httpMethod": "POST",
  13817. // "id": "vision.projects.locations.productSets.addProduct",
  13818. // "parameterOrder": [
  13819. // "name"
  13820. // ],
  13821. // "parameters": {
  13822. // "name": {
  13823. // "description": "The resource name for the ProductSet to modify.\n\nFormat is:\n`projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`",
  13824. // "location": "path",
  13825. // "pattern": "^projects/[^/]+/locations/[^/]+/productSets/[^/]+$",
  13826. // "required": true,
  13827. // "type": "string"
  13828. // }
  13829. // },
  13830. // "path": "v1/{+name}:addProduct",
  13831. // "request": {
  13832. // "$ref": "AddProductToProductSetRequest"
  13833. // },
  13834. // "response": {
  13835. // "$ref": "Empty"
  13836. // },
  13837. // "scopes": [
  13838. // "https://www.googleapis.com/auth/cloud-platform",
  13839. // "https://www.googleapis.com/auth/cloud-vision"
  13840. // ]
  13841. // }
  13842. }
  13843. // method id "vision.projects.locations.productSets.create":
  13844. type ProjectsLocationsProductSetsCreateCall struct {
  13845. s *Service
  13846. parent string
  13847. productset *ProductSet
  13848. urlParams_ gensupport.URLParams
  13849. ctx_ context.Context
  13850. header_ http.Header
  13851. }
  13852. // Create: Creates and returns a new ProductSet resource.
  13853. //
  13854. // Possible errors:
  13855. //
  13856. // * Returns INVALID_ARGUMENT if display_name is missing, or is longer
  13857. // than
  13858. // 4096 characters.
  13859. func (r *ProjectsLocationsProductSetsService) Create(parent string, productset *ProductSet) *ProjectsLocationsProductSetsCreateCall {
  13860. c := &ProjectsLocationsProductSetsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13861. c.parent = parent
  13862. c.productset = productset
  13863. return c
  13864. }
  13865. // ProductSetId sets the optional parameter "productSetId": A
  13866. // user-supplied resource id for this ProductSet. If set, the server
  13867. // will
  13868. // attempt to use this value as the resource id. If it is already in
  13869. // use, an
  13870. // error is returned with code ALREADY_EXISTS. Must be at most 128
  13871. // characters
  13872. // long. It cannot contain the character `/`.
  13873. func (c *ProjectsLocationsProductSetsCreateCall) ProductSetId(productSetId string) *ProjectsLocationsProductSetsCreateCall {
  13874. c.urlParams_.Set("productSetId", productSetId)
  13875. return c
  13876. }
  13877. // Fields allows partial responses to be retrieved. See
  13878. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13879. // for more information.
  13880. func (c *ProjectsLocationsProductSetsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductSetsCreateCall {
  13881. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13882. return c
  13883. }
  13884. // Context sets the context to be used in this call's Do method. Any
  13885. // pending HTTP request will be aborted if the provided context is
  13886. // canceled.
  13887. func (c *ProjectsLocationsProductSetsCreateCall) Context(ctx context.Context) *ProjectsLocationsProductSetsCreateCall {
  13888. c.ctx_ = ctx
  13889. return c
  13890. }
  13891. // Header returns an http.Header that can be modified by the caller to
  13892. // add HTTP headers to the request.
  13893. func (c *ProjectsLocationsProductSetsCreateCall) Header() http.Header {
  13894. if c.header_ == nil {
  13895. c.header_ = make(http.Header)
  13896. }
  13897. return c.header_
  13898. }
  13899. func (c *ProjectsLocationsProductSetsCreateCall) doRequest(alt string) (*http.Response, error) {
  13900. reqHeaders := make(http.Header)
  13901. for k, v := range c.header_ {
  13902. reqHeaders[k] = v
  13903. }
  13904. reqHeaders.Set("User-Agent", c.s.userAgent())
  13905. var body io.Reader = nil
  13906. body, err := googleapi.WithoutDataWrapper.JSONReader(c.productset)
  13907. if err != nil {
  13908. return nil, err
  13909. }
  13910. reqHeaders.Set("Content-Type", "application/json")
  13911. c.urlParams_.Set("alt", alt)
  13912. c.urlParams_.Set("prettyPrint", "false")
  13913. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/productSets")
  13914. urls += "?" + c.urlParams_.Encode()
  13915. req, err := http.NewRequest("POST", urls, body)
  13916. if err != nil {
  13917. return nil, err
  13918. }
  13919. req.Header = reqHeaders
  13920. googleapi.Expand(req.URL, map[string]string{
  13921. "parent": c.parent,
  13922. })
  13923. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13924. }
  13925. // Do executes the "vision.projects.locations.productSets.create" call.
  13926. // Exactly one of *ProductSet or error will be non-nil. Any non-2xx
  13927. // status code is an error. Response headers are in either
  13928. // *ProductSet.ServerResponse.Header or (if a response was returned at
  13929. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  13930. // to check whether the returned error was because
  13931. // http.StatusNotModified was returned.
  13932. func (c *ProjectsLocationsProductSetsCreateCall) Do(opts ...googleapi.CallOption) (*ProductSet, error) {
  13933. gensupport.SetOptions(c.urlParams_, opts...)
  13934. res, err := c.doRequest("json")
  13935. if res != nil && res.StatusCode == http.StatusNotModified {
  13936. if res.Body != nil {
  13937. res.Body.Close()
  13938. }
  13939. return nil, &googleapi.Error{
  13940. Code: res.StatusCode,
  13941. Header: res.Header,
  13942. }
  13943. }
  13944. if err != nil {
  13945. return nil, err
  13946. }
  13947. defer googleapi.CloseBody(res)
  13948. if err := googleapi.CheckResponse(res); err != nil {
  13949. return nil, err
  13950. }
  13951. ret := &ProductSet{
  13952. ServerResponse: googleapi.ServerResponse{
  13953. Header: res.Header,
  13954. HTTPStatusCode: res.StatusCode,
  13955. },
  13956. }
  13957. target := &ret
  13958. if err := gensupport.DecodeResponse(target, res); err != nil {
  13959. return nil, err
  13960. }
  13961. return ret, nil
  13962. // {
  13963. // "description": "Creates and returns a new ProductSet resource.\n\nPossible errors:\n\n* Returns INVALID_ARGUMENT if display_name is missing, or is longer than\n 4096 characters.",
  13964. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/productSets",
  13965. // "httpMethod": "POST",
  13966. // "id": "vision.projects.locations.productSets.create",
  13967. // "parameterOrder": [
  13968. // "parent"
  13969. // ],
  13970. // "parameters": {
  13971. // "parent": {
  13972. // "description": "The project in which the ProductSet should be created.\n\nFormat is `projects/PROJECT_ID/locations/LOC_ID`.",
  13973. // "location": "path",
  13974. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  13975. // "required": true,
  13976. // "type": "string"
  13977. // },
  13978. // "productSetId": {
  13979. // "description": "A user-supplied resource id for this ProductSet. If set, the server will\nattempt to use this value as the resource id. If it is already in use, an\nerror is returned with code ALREADY_EXISTS. Must be at most 128 characters\nlong. It cannot contain the character `/`.",
  13980. // "location": "query",
  13981. // "type": "string"
  13982. // }
  13983. // },
  13984. // "path": "v1/{+parent}/productSets",
  13985. // "request": {
  13986. // "$ref": "ProductSet"
  13987. // },
  13988. // "response": {
  13989. // "$ref": "ProductSet"
  13990. // },
  13991. // "scopes": [
  13992. // "https://www.googleapis.com/auth/cloud-platform",
  13993. // "https://www.googleapis.com/auth/cloud-vision"
  13994. // ]
  13995. // }
  13996. }
  13997. // method id "vision.projects.locations.productSets.delete":
  13998. type ProjectsLocationsProductSetsDeleteCall struct {
  13999. s *Service
  14000. name string
  14001. urlParams_ gensupport.URLParams
  14002. ctx_ context.Context
  14003. header_ http.Header
  14004. }
  14005. // Delete: Permanently deletes a ProductSet. Products and
  14006. // ReferenceImages in the
  14007. // ProductSet are not deleted.
  14008. //
  14009. // The actual image files are not deleted from Google Cloud
  14010. // Storage.
  14011. //
  14012. // Possible errors:
  14013. //
  14014. // * Returns NOT_FOUND if the ProductSet does not exist.
  14015. func (r *ProjectsLocationsProductSetsService) Delete(name string) *ProjectsLocationsProductSetsDeleteCall {
  14016. c := &ProjectsLocationsProductSetsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14017. c.name = name
  14018. return c
  14019. }
  14020. // Fields allows partial responses to be retrieved. See
  14021. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14022. // for more information.
  14023. func (c *ProjectsLocationsProductSetsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductSetsDeleteCall {
  14024. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14025. return c
  14026. }
  14027. // Context sets the context to be used in this call's Do method. Any
  14028. // pending HTTP request will be aborted if the provided context is
  14029. // canceled.
  14030. func (c *ProjectsLocationsProductSetsDeleteCall) Context(ctx context.Context) *ProjectsLocationsProductSetsDeleteCall {
  14031. c.ctx_ = ctx
  14032. return c
  14033. }
  14034. // Header returns an http.Header that can be modified by the caller to
  14035. // add HTTP headers to the request.
  14036. func (c *ProjectsLocationsProductSetsDeleteCall) Header() http.Header {
  14037. if c.header_ == nil {
  14038. c.header_ = make(http.Header)
  14039. }
  14040. return c.header_
  14041. }
  14042. func (c *ProjectsLocationsProductSetsDeleteCall) doRequest(alt string) (*http.Response, error) {
  14043. reqHeaders := make(http.Header)
  14044. for k, v := range c.header_ {
  14045. reqHeaders[k] = v
  14046. }
  14047. reqHeaders.Set("User-Agent", c.s.userAgent())
  14048. var body io.Reader = nil
  14049. c.urlParams_.Set("alt", alt)
  14050. c.urlParams_.Set("prettyPrint", "false")
  14051. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  14052. urls += "?" + c.urlParams_.Encode()
  14053. req, err := http.NewRequest("DELETE", urls, body)
  14054. if err != nil {
  14055. return nil, err
  14056. }
  14057. req.Header = reqHeaders
  14058. googleapi.Expand(req.URL, map[string]string{
  14059. "name": c.name,
  14060. })
  14061. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14062. }
  14063. // Do executes the "vision.projects.locations.productSets.delete" call.
  14064. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  14065. // code is an error. Response headers are in either
  14066. // *Empty.ServerResponse.Header or (if a response was returned at all)
  14067. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  14068. // check whether the returned error was because http.StatusNotModified
  14069. // was returned.
  14070. func (c *ProjectsLocationsProductSetsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  14071. gensupport.SetOptions(c.urlParams_, opts...)
  14072. res, err := c.doRequest("json")
  14073. if res != nil && res.StatusCode == http.StatusNotModified {
  14074. if res.Body != nil {
  14075. res.Body.Close()
  14076. }
  14077. return nil, &googleapi.Error{
  14078. Code: res.StatusCode,
  14079. Header: res.Header,
  14080. }
  14081. }
  14082. if err != nil {
  14083. return nil, err
  14084. }
  14085. defer googleapi.CloseBody(res)
  14086. if err := googleapi.CheckResponse(res); err != nil {
  14087. return nil, err
  14088. }
  14089. ret := &Empty{
  14090. ServerResponse: googleapi.ServerResponse{
  14091. Header: res.Header,
  14092. HTTPStatusCode: res.StatusCode,
  14093. },
  14094. }
  14095. target := &ret
  14096. if err := gensupport.DecodeResponse(target, res); err != nil {
  14097. return nil, err
  14098. }
  14099. return ret, nil
  14100. // {
  14101. // "description": "Permanently deletes a ProductSet. Products and ReferenceImages in the\nProductSet are not deleted.\n\nThe actual image files are not deleted from Google Cloud Storage.\n\nPossible errors:\n\n* Returns NOT_FOUND if the ProductSet does not exist.",
  14102. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/productSets/{productSetsId}",
  14103. // "httpMethod": "DELETE",
  14104. // "id": "vision.projects.locations.productSets.delete",
  14105. // "parameterOrder": [
  14106. // "name"
  14107. // ],
  14108. // "parameters": {
  14109. // "name": {
  14110. // "description": "Resource name of the ProductSet to delete.\n\nFormat is:\n`projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`",
  14111. // "location": "path",
  14112. // "pattern": "^projects/[^/]+/locations/[^/]+/productSets/[^/]+$",
  14113. // "required": true,
  14114. // "type": "string"
  14115. // }
  14116. // },
  14117. // "path": "v1/{+name}",
  14118. // "response": {
  14119. // "$ref": "Empty"
  14120. // },
  14121. // "scopes": [
  14122. // "https://www.googleapis.com/auth/cloud-platform",
  14123. // "https://www.googleapis.com/auth/cloud-vision"
  14124. // ]
  14125. // }
  14126. }
  14127. // method id "vision.projects.locations.productSets.get":
  14128. type ProjectsLocationsProductSetsGetCall struct {
  14129. s *Service
  14130. name string
  14131. urlParams_ gensupport.URLParams
  14132. ifNoneMatch_ string
  14133. ctx_ context.Context
  14134. header_ http.Header
  14135. }
  14136. // Get: Gets information associated with a ProductSet.
  14137. //
  14138. // Possible errors:
  14139. //
  14140. // * Returns NOT_FOUND if the ProductSet does not exist.
  14141. func (r *ProjectsLocationsProductSetsService) Get(name string) *ProjectsLocationsProductSetsGetCall {
  14142. c := &ProjectsLocationsProductSetsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14143. c.name = name
  14144. return c
  14145. }
  14146. // Fields allows partial responses to be retrieved. See
  14147. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14148. // for more information.
  14149. func (c *ProjectsLocationsProductSetsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductSetsGetCall {
  14150. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14151. return c
  14152. }
  14153. // IfNoneMatch sets the optional parameter which makes the operation
  14154. // fail if the object's ETag matches the given value. This is useful for
  14155. // getting updates only after the object has changed since the last
  14156. // request. Use googleapi.IsNotModified to check whether the response
  14157. // error from Do is the result of In-None-Match.
  14158. func (c *ProjectsLocationsProductSetsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsProductSetsGetCall {
  14159. c.ifNoneMatch_ = entityTag
  14160. return c
  14161. }
  14162. // Context sets the context to be used in this call's Do method. Any
  14163. // pending HTTP request will be aborted if the provided context is
  14164. // canceled.
  14165. func (c *ProjectsLocationsProductSetsGetCall) Context(ctx context.Context) *ProjectsLocationsProductSetsGetCall {
  14166. c.ctx_ = ctx
  14167. return c
  14168. }
  14169. // Header returns an http.Header that can be modified by the caller to
  14170. // add HTTP headers to the request.
  14171. func (c *ProjectsLocationsProductSetsGetCall) Header() http.Header {
  14172. if c.header_ == nil {
  14173. c.header_ = make(http.Header)
  14174. }
  14175. return c.header_
  14176. }
  14177. func (c *ProjectsLocationsProductSetsGetCall) doRequest(alt string) (*http.Response, error) {
  14178. reqHeaders := make(http.Header)
  14179. for k, v := range c.header_ {
  14180. reqHeaders[k] = v
  14181. }
  14182. reqHeaders.Set("User-Agent", c.s.userAgent())
  14183. if c.ifNoneMatch_ != "" {
  14184. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14185. }
  14186. var body io.Reader = nil
  14187. c.urlParams_.Set("alt", alt)
  14188. c.urlParams_.Set("prettyPrint", "false")
  14189. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  14190. urls += "?" + c.urlParams_.Encode()
  14191. req, err := http.NewRequest("GET", urls, body)
  14192. if err != nil {
  14193. return nil, err
  14194. }
  14195. req.Header = reqHeaders
  14196. googleapi.Expand(req.URL, map[string]string{
  14197. "name": c.name,
  14198. })
  14199. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14200. }
  14201. // Do executes the "vision.projects.locations.productSets.get" call.
  14202. // Exactly one of *ProductSet or error will be non-nil. Any non-2xx
  14203. // status code is an error. Response headers are in either
  14204. // *ProductSet.ServerResponse.Header or (if a response was returned at
  14205. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  14206. // to check whether the returned error was because
  14207. // http.StatusNotModified was returned.
  14208. func (c *ProjectsLocationsProductSetsGetCall) Do(opts ...googleapi.CallOption) (*ProductSet, error) {
  14209. gensupport.SetOptions(c.urlParams_, opts...)
  14210. res, err := c.doRequest("json")
  14211. if res != nil && res.StatusCode == http.StatusNotModified {
  14212. if res.Body != nil {
  14213. res.Body.Close()
  14214. }
  14215. return nil, &googleapi.Error{
  14216. Code: res.StatusCode,
  14217. Header: res.Header,
  14218. }
  14219. }
  14220. if err != nil {
  14221. return nil, err
  14222. }
  14223. defer googleapi.CloseBody(res)
  14224. if err := googleapi.CheckResponse(res); err != nil {
  14225. return nil, err
  14226. }
  14227. ret := &ProductSet{
  14228. ServerResponse: googleapi.ServerResponse{
  14229. Header: res.Header,
  14230. HTTPStatusCode: res.StatusCode,
  14231. },
  14232. }
  14233. target := &ret
  14234. if err := gensupport.DecodeResponse(target, res); err != nil {
  14235. return nil, err
  14236. }
  14237. return ret, nil
  14238. // {
  14239. // "description": "Gets information associated with a ProductSet.\n\nPossible errors:\n\n* Returns NOT_FOUND if the ProductSet does not exist.",
  14240. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/productSets/{productSetsId}",
  14241. // "httpMethod": "GET",
  14242. // "id": "vision.projects.locations.productSets.get",
  14243. // "parameterOrder": [
  14244. // "name"
  14245. // ],
  14246. // "parameters": {
  14247. // "name": {
  14248. // "description": "Resource name of the ProductSet to get.\n\nFormat is:\n`projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID`",
  14249. // "location": "path",
  14250. // "pattern": "^projects/[^/]+/locations/[^/]+/productSets/[^/]+$",
  14251. // "required": true,
  14252. // "type": "string"
  14253. // }
  14254. // },
  14255. // "path": "v1/{+name}",
  14256. // "response": {
  14257. // "$ref": "ProductSet"
  14258. // },
  14259. // "scopes": [
  14260. // "https://www.googleapis.com/auth/cloud-platform",
  14261. // "https://www.googleapis.com/auth/cloud-vision"
  14262. // ]
  14263. // }
  14264. }
  14265. // method id "vision.projects.locations.productSets.import":
  14266. type ProjectsLocationsProductSetsImportCall struct {
  14267. s *Service
  14268. parent string
  14269. importproductsetsrequest *ImportProductSetsRequest
  14270. urlParams_ gensupport.URLParams
  14271. ctx_ context.Context
  14272. header_ http.Header
  14273. }
  14274. // Import: Asynchronous API that imports a list of reference images to
  14275. // specified
  14276. // product sets based on a list of image information.
  14277. //
  14278. // The google.longrunning.Operation API can be used to keep track of
  14279. // the
  14280. // progress and results of the request.
  14281. // `Operation.metadata` contains `BatchOperationMetadata`.
  14282. // (progress)
  14283. // `Operation.response` contains `ImportProductSetsResponse`.
  14284. // (results)
  14285. //
  14286. // The input source of this method is a csv file on Google Cloud
  14287. // Storage.
  14288. // For the format of the csv file please
  14289. // see
  14290. // ImportProductSetsGcsSource.csv_file_uri.
  14291. func (r *ProjectsLocationsProductSetsService) Import(parent string, importproductsetsrequest *ImportProductSetsRequest) *ProjectsLocationsProductSetsImportCall {
  14292. c := &ProjectsLocationsProductSetsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14293. c.parent = parent
  14294. c.importproductsetsrequest = importproductsetsrequest
  14295. return c
  14296. }
  14297. // Fields allows partial responses to be retrieved. See
  14298. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14299. // for more information.
  14300. func (c *ProjectsLocationsProductSetsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductSetsImportCall {
  14301. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14302. return c
  14303. }
  14304. // Context sets the context to be used in this call's Do method. Any
  14305. // pending HTTP request will be aborted if the provided context is
  14306. // canceled.
  14307. func (c *ProjectsLocationsProductSetsImportCall) Context(ctx context.Context) *ProjectsLocationsProductSetsImportCall {
  14308. c.ctx_ = ctx
  14309. return c
  14310. }
  14311. // Header returns an http.Header that can be modified by the caller to
  14312. // add HTTP headers to the request.
  14313. func (c *ProjectsLocationsProductSetsImportCall) Header() http.Header {
  14314. if c.header_ == nil {
  14315. c.header_ = make(http.Header)
  14316. }
  14317. return c.header_
  14318. }
  14319. func (c *ProjectsLocationsProductSetsImportCall) doRequest(alt string) (*http.Response, error) {
  14320. reqHeaders := make(http.Header)
  14321. for k, v := range c.header_ {
  14322. reqHeaders[k] = v
  14323. }
  14324. reqHeaders.Set("User-Agent", c.s.userAgent())
  14325. var body io.Reader = nil
  14326. body, err := googleapi.WithoutDataWrapper.JSONReader(c.importproductsetsrequest)
  14327. if err != nil {
  14328. return nil, err
  14329. }
  14330. reqHeaders.Set("Content-Type", "application/json")
  14331. c.urlParams_.Set("alt", alt)
  14332. c.urlParams_.Set("prettyPrint", "false")
  14333. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/productSets:import")
  14334. urls += "?" + c.urlParams_.Encode()
  14335. req, err := http.NewRequest("POST", urls, body)
  14336. if err != nil {
  14337. return nil, err
  14338. }
  14339. req.Header = reqHeaders
  14340. googleapi.Expand(req.URL, map[string]string{
  14341. "parent": c.parent,
  14342. })
  14343. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14344. }
  14345. // Do executes the "vision.projects.locations.productSets.import" call.
  14346. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  14347. // status code is an error. Response headers are in either
  14348. // *Operation.ServerResponse.Header or (if a response was returned at
  14349. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  14350. // to check whether the returned error was because
  14351. // http.StatusNotModified was returned.
  14352. func (c *ProjectsLocationsProductSetsImportCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  14353. gensupport.SetOptions(c.urlParams_, opts...)
  14354. res, err := c.doRequest("json")
  14355. if res != nil && res.StatusCode == http.StatusNotModified {
  14356. if res.Body != nil {
  14357. res.Body.Close()
  14358. }
  14359. return nil, &googleapi.Error{
  14360. Code: res.StatusCode,
  14361. Header: res.Header,
  14362. }
  14363. }
  14364. if err != nil {
  14365. return nil, err
  14366. }
  14367. defer googleapi.CloseBody(res)
  14368. if err := googleapi.CheckResponse(res); err != nil {
  14369. return nil, err
  14370. }
  14371. ret := &Operation{
  14372. ServerResponse: googleapi.ServerResponse{
  14373. Header: res.Header,
  14374. HTTPStatusCode: res.StatusCode,
  14375. },
  14376. }
  14377. target := &ret
  14378. if err := gensupport.DecodeResponse(target, res); err != nil {
  14379. return nil, err
  14380. }
  14381. return ret, nil
  14382. // {
  14383. // "description": "Asynchronous API that imports a list of reference images to specified\nproduct sets based on a list of image information.\n\nThe google.longrunning.Operation API can be used to keep track of the\nprogress and results of the request.\n`Operation.metadata` contains `BatchOperationMetadata`. (progress)\n`Operation.response` contains `ImportProductSetsResponse`. (results)\n\nThe input source of this method is a csv file on Google Cloud Storage.\nFor the format of the csv file please see\nImportProductSetsGcsSource.csv_file_uri.",
  14384. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/productSets:import",
  14385. // "httpMethod": "POST",
  14386. // "id": "vision.projects.locations.productSets.import",
  14387. // "parameterOrder": [
  14388. // "parent"
  14389. // ],
  14390. // "parameters": {
  14391. // "parent": {
  14392. // "description": "The project in which the ProductSets should be imported.\n\nFormat is `projects/PROJECT_ID/locations/LOC_ID`.",
  14393. // "location": "path",
  14394. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  14395. // "required": true,
  14396. // "type": "string"
  14397. // }
  14398. // },
  14399. // "path": "v1/{+parent}/productSets:import",
  14400. // "request": {
  14401. // "$ref": "ImportProductSetsRequest"
  14402. // },
  14403. // "response": {
  14404. // "$ref": "Operation"
  14405. // },
  14406. // "scopes": [
  14407. // "https://www.googleapis.com/auth/cloud-platform",
  14408. // "https://www.googleapis.com/auth/cloud-vision"
  14409. // ]
  14410. // }
  14411. }
  14412. // method id "vision.projects.locations.productSets.list":
  14413. type ProjectsLocationsProductSetsListCall struct {
  14414. s *Service
  14415. parent string
  14416. urlParams_ gensupport.URLParams
  14417. ifNoneMatch_ string
  14418. ctx_ context.Context
  14419. header_ http.Header
  14420. }
  14421. // List: Lists ProductSets in an unspecified order.
  14422. //
  14423. // Possible errors:
  14424. //
  14425. // * Returns INVALID_ARGUMENT if page_size is greater than 100, or less
  14426. // than 1.
  14427. func (r *ProjectsLocationsProductSetsService) List(parent string) *ProjectsLocationsProductSetsListCall {
  14428. c := &ProjectsLocationsProductSetsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14429. c.parent = parent
  14430. return c
  14431. }
  14432. // PageSize sets the optional parameter "pageSize": The maximum number
  14433. // of items to return. Default 10, maximum 100.
  14434. func (c *ProjectsLocationsProductSetsListCall) PageSize(pageSize int64) *ProjectsLocationsProductSetsListCall {
  14435. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  14436. return c
  14437. }
  14438. // PageToken sets the optional parameter "pageToken": The
  14439. // next_page_token returned from a previous List request, if any.
  14440. func (c *ProjectsLocationsProductSetsListCall) PageToken(pageToken string) *ProjectsLocationsProductSetsListCall {
  14441. c.urlParams_.Set("pageToken", pageToken)
  14442. return c
  14443. }
  14444. // Fields allows partial responses to be retrieved. See
  14445. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14446. // for more information.
  14447. func (c *ProjectsLocationsProductSetsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductSetsListCall {
  14448. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14449. return c
  14450. }
  14451. // IfNoneMatch sets the optional parameter which makes the operation
  14452. // fail if the object's ETag matches the given value. This is useful for
  14453. // getting updates only after the object has changed since the last
  14454. // request. Use googleapi.IsNotModified to check whether the response
  14455. // error from Do is the result of In-None-Match.
  14456. func (c *ProjectsLocationsProductSetsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsProductSetsListCall {
  14457. c.ifNoneMatch_ = entityTag
  14458. return c
  14459. }
  14460. // Context sets the context to be used in this call's Do method. Any
  14461. // pending HTTP request will be aborted if the provided context is
  14462. // canceled.
  14463. func (c *ProjectsLocationsProductSetsListCall) Context(ctx context.Context) *ProjectsLocationsProductSetsListCall {
  14464. c.ctx_ = ctx
  14465. return c
  14466. }
  14467. // Header returns an http.Header that can be modified by the caller to
  14468. // add HTTP headers to the request.
  14469. func (c *ProjectsLocationsProductSetsListCall) Header() http.Header {
  14470. if c.header_ == nil {
  14471. c.header_ = make(http.Header)
  14472. }
  14473. return c.header_
  14474. }
  14475. func (c *ProjectsLocationsProductSetsListCall) doRequest(alt string) (*http.Response, error) {
  14476. reqHeaders := make(http.Header)
  14477. for k, v := range c.header_ {
  14478. reqHeaders[k] = v
  14479. }
  14480. reqHeaders.Set("User-Agent", c.s.userAgent())
  14481. if c.ifNoneMatch_ != "" {
  14482. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14483. }
  14484. var body io.Reader = nil
  14485. c.urlParams_.Set("alt", alt)
  14486. c.urlParams_.Set("prettyPrint", "false")
  14487. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/productSets")
  14488. urls += "?" + c.urlParams_.Encode()
  14489. req, err := http.NewRequest("GET", urls, body)
  14490. if err != nil {
  14491. return nil, err
  14492. }
  14493. req.Header = reqHeaders
  14494. googleapi.Expand(req.URL, map[string]string{
  14495. "parent": c.parent,
  14496. })
  14497. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14498. }
  14499. // Do executes the "vision.projects.locations.productSets.list" call.
  14500. // Exactly one of *ListProductSetsResponse or error will be non-nil. Any
  14501. // non-2xx status code is an error. Response headers are in either
  14502. // *ListProductSetsResponse.ServerResponse.Header or (if a response was
  14503. // returned at all) in error.(*googleapi.Error).Header. Use
  14504. // googleapi.IsNotModified to check whether the returned error was
  14505. // because http.StatusNotModified was returned.
  14506. func (c *ProjectsLocationsProductSetsListCall) Do(opts ...googleapi.CallOption) (*ListProductSetsResponse, error) {
  14507. gensupport.SetOptions(c.urlParams_, opts...)
  14508. res, err := c.doRequest("json")
  14509. if res != nil && res.StatusCode == http.StatusNotModified {
  14510. if res.Body != nil {
  14511. res.Body.Close()
  14512. }
  14513. return nil, &googleapi.Error{
  14514. Code: res.StatusCode,
  14515. Header: res.Header,
  14516. }
  14517. }
  14518. if err != nil {
  14519. return nil, err
  14520. }
  14521. defer googleapi.CloseBody(res)
  14522. if err := googleapi.CheckResponse(res); err != nil {
  14523. return nil, err
  14524. }
  14525. ret := &ListProductSetsResponse{
  14526. ServerResponse: googleapi.ServerResponse{
  14527. Header: res.Header,
  14528. HTTPStatusCode: res.StatusCode,
  14529. },
  14530. }
  14531. target := &ret
  14532. if err := gensupport.DecodeResponse(target, res); err != nil {
  14533. return nil, err
  14534. }
  14535. return ret, nil
  14536. // {
  14537. // "description": "Lists ProductSets in an unspecified order.\n\nPossible errors:\n\n* Returns INVALID_ARGUMENT if page_size is greater than 100, or less\n than 1.",
  14538. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/productSets",
  14539. // "httpMethod": "GET",
  14540. // "id": "vision.projects.locations.productSets.list",
  14541. // "parameterOrder": [
  14542. // "parent"
  14543. // ],
  14544. // "parameters": {
  14545. // "pageSize": {
  14546. // "description": "The maximum number of items to return. Default 10, maximum 100.",
  14547. // "format": "int32",
  14548. // "location": "query",
  14549. // "type": "integer"
  14550. // },
  14551. // "pageToken": {
  14552. // "description": "The next_page_token returned from a previous List request, if any.",
  14553. // "location": "query",
  14554. // "type": "string"
  14555. // },
  14556. // "parent": {
  14557. // "description": "The project from which ProductSets should be listed.\n\nFormat is `projects/PROJECT_ID/locations/LOC_ID`.",
  14558. // "location": "path",
  14559. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  14560. // "required": true,
  14561. // "type": "string"
  14562. // }
  14563. // },
  14564. // "path": "v1/{+parent}/productSets",
  14565. // "response": {
  14566. // "$ref": "ListProductSetsResponse"
  14567. // },
  14568. // "scopes": [
  14569. // "https://www.googleapis.com/auth/cloud-platform",
  14570. // "https://www.googleapis.com/auth/cloud-vision"
  14571. // ]
  14572. // }
  14573. }
  14574. // Pages invokes f for each page of results.
  14575. // A non-nil error returned from f will halt the iteration.
  14576. // The provided context supersedes any context provided to the Context method.
  14577. func (c *ProjectsLocationsProductSetsListCall) Pages(ctx context.Context, f func(*ListProductSetsResponse) error) error {
  14578. c.ctx_ = ctx
  14579. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  14580. for {
  14581. x, err := c.Do()
  14582. if err != nil {
  14583. return err
  14584. }
  14585. if err := f(x); err != nil {
  14586. return err
  14587. }
  14588. if x.NextPageToken == "" {
  14589. return nil
  14590. }
  14591. c.PageToken(x.NextPageToken)
  14592. }
  14593. }
  14594. // method id "vision.projects.locations.productSets.patch":
  14595. type ProjectsLocationsProductSetsPatchCall struct {
  14596. s *Service
  14597. name string
  14598. productset *ProductSet
  14599. urlParams_ gensupport.URLParams
  14600. ctx_ context.Context
  14601. header_ http.Header
  14602. }
  14603. // Patch: Makes changes to a ProductSet resource.
  14604. // Only display_name can be updated currently.
  14605. //
  14606. // Possible errors:
  14607. //
  14608. // * Returns NOT_FOUND if the ProductSet does not exist.
  14609. // * Returns INVALID_ARGUMENT if display_name is present in update_mask
  14610. // but
  14611. // missing from the request or longer than 4096 characters.
  14612. func (r *ProjectsLocationsProductSetsService) Patch(name string, productset *ProductSet) *ProjectsLocationsProductSetsPatchCall {
  14613. c := &ProjectsLocationsProductSetsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14614. c.name = name
  14615. c.productset = productset
  14616. return c
  14617. }
  14618. // UpdateMask sets the optional parameter "updateMask": The FieldMask
  14619. // that specifies which fields to
  14620. // update.
  14621. // If update_mask isn't specified, all mutable fields are to be
  14622. // updated.
  14623. // Valid mask path is `display_name`.
  14624. func (c *ProjectsLocationsProductSetsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsProductSetsPatchCall {
  14625. c.urlParams_.Set("updateMask", updateMask)
  14626. return c
  14627. }
  14628. // Fields allows partial responses to be retrieved. See
  14629. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14630. // for more information.
  14631. func (c *ProjectsLocationsProductSetsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductSetsPatchCall {
  14632. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14633. return c
  14634. }
  14635. // Context sets the context to be used in this call's Do method. Any
  14636. // pending HTTP request will be aborted if the provided context is
  14637. // canceled.
  14638. func (c *ProjectsLocationsProductSetsPatchCall) Context(ctx context.Context) *ProjectsLocationsProductSetsPatchCall {
  14639. c.ctx_ = ctx
  14640. return c
  14641. }
  14642. // Header returns an http.Header that can be modified by the caller to
  14643. // add HTTP headers to the request.
  14644. func (c *ProjectsLocationsProductSetsPatchCall) Header() http.Header {
  14645. if c.header_ == nil {
  14646. c.header_ = make(http.Header)
  14647. }
  14648. return c.header_
  14649. }
  14650. func (c *ProjectsLocationsProductSetsPatchCall) doRequest(alt string) (*http.Response, error) {
  14651. reqHeaders := make(http.Header)
  14652. for k, v := range c.header_ {
  14653. reqHeaders[k] = v
  14654. }
  14655. reqHeaders.Set("User-Agent", c.s.userAgent())
  14656. var body io.Reader = nil
  14657. body, err := googleapi.WithoutDataWrapper.JSONReader(c.productset)
  14658. if err != nil {
  14659. return nil, err
  14660. }
  14661. reqHeaders.Set("Content-Type", "application/json")
  14662. c.urlParams_.Set("alt", alt)
  14663. c.urlParams_.Set("prettyPrint", "false")
  14664. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  14665. urls += "?" + c.urlParams_.Encode()
  14666. req, err := http.NewRequest("PATCH", urls, body)
  14667. if err != nil {
  14668. return nil, err
  14669. }
  14670. req.Header = reqHeaders
  14671. googleapi.Expand(req.URL, map[string]string{
  14672. "name": c.name,
  14673. })
  14674. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14675. }
  14676. // Do executes the "vision.projects.locations.productSets.patch" call.
  14677. // Exactly one of *ProductSet or error will be non-nil. Any non-2xx
  14678. // status code is an error. Response headers are in either
  14679. // *ProductSet.ServerResponse.Header or (if a response was returned at
  14680. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  14681. // to check whether the returned error was because
  14682. // http.StatusNotModified was returned.
  14683. func (c *ProjectsLocationsProductSetsPatchCall) Do(opts ...googleapi.CallOption) (*ProductSet, error) {
  14684. gensupport.SetOptions(c.urlParams_, opts...)
  14685. res, err := c.doRequest("json")
  14686. if res != nil && res.StatusCode == http.StatusNotModified {
  14687. if res.Body != nil {
  14688. res.Body.Close()
  14689. }
  14690. return nil, &googleapi.Error{
  14691. Code: res.StatusCode,
  14692. Header: res.Header,
  14693. }
  14694. }
  14695. if err != nil {
  14696. return nil, err
  14697. }
  14698. defer googleapi.CloseBody(res)
  14699. if err := googleapi.CheckResponse(res); err != nil {
  14700. return nil, err
  14701. }
  14702. ret := &ProductSet{
  14703. ServerResponse: googleapi.ServerResponse{
  14704. Header: res.Header,
  14705. HTTPStatusCode: res.StatusCode,
  14706. },
  14707. }
  14708. target := &ret
  14709. if err := gensupport.DecodeResponse(target, res); err != nil {
  14710. return nil, err
  14711. }
  14712. return ret, nil
  14713. // {
  14714. // "description": "Makes changes to a ProductSet resource.\nOnly display_name can be updated currently.\n\nPossible errors:\n\n* Returns NOT_FOUND if the ProductSet does not exist.\n* Returns INVALID_ARGUMENT if display_name is present in update_mask but\n missing from the request or longer than 4096 characters.",
  14715. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/productSets/{productSetsId}",
  14716. // "httpMethod": "PATCH",
  14717. // "id": "vision.projects.locations.productSets.patch",
  14718. // "parameterOrder": [
  14719. // "name"
  14720. // ],
  14721. // "parameters": {
  14722. // "name": {
  14723. // "description": "The resource name of the ProductSet.\n\nFormat is:\n`projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.\n\nThis field is ignored when creating a ProductSet.",
  14724. // "location": "path",
  14725. // "pattern": "^projects/[^/]+/locations/[^/]+/productSets/[^/]+$",
  14726. // "required": true,
  14727. // "type": "string"
  14728. // },
  14729. // "updateMask": {
  14730. // "description": "The FieldMask that specifies which fields to\nupdate.\nIf update_mask isn't specified, all mutable fields are to be updated.\nValid mask path is `display_name`.",
  14731. // "format": "google-fieldmask",
  14732. // "location": "query",
  14733. // "type": "string"
  14734. // }
  14735. // },
  14736. // "path": "v1/{+name}",
  14737. // "request": {
  14738. // "$ref": "ProductSet"
  14739. // },
  14740. // "response": {
  14741. // "$ref": "ProductSet"
  14742. // },
  14743. // "scopes": [
  14744. // "https://www.googleapis.com/auth/cloud-platform",
  14745. // "https://www.googleapis.com/auth/cloud-vision"
  14746. // ]
  14747. // }
  14748. }
  14749. // method id "vision.projects.locations.productSets.removeProduct":
  14750. type ProjectsLocationsProductSetsRemoveProductCall struct {
  14751. s *Service
  14752. name string
  14753. removeproductfromproductsetrequest *RemoveProductFromProductSetRequest
  14754. urlParams_ gensupport.URLParams
  14755. ctx_ context.Context
  14756. header_ http.Header
  14757. }
  14758. // RemoveProduct: Removes a Product from the specified
  14759. // ProductSet.
  14760. //
  14761. // Possible errors:
  14762. //
  14763. // * Returns NOT_FOUND If the Product is not found under the ProductSet.
  14764. func (r *ProjectsLocationsProductSetsService) RemoveProduct(name string, removeproductfromproductsetrequest *RemoveProductFromProductSetRequest) *ProjectsLocationsProductSetsRemoveProductCall {
  14765. c := &ProjectsLocationsProductSetsRemoveProductCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14766. c.name = name
  14767. c.removeproductfromproductsetrequest = removeproductfromproductsetrequest
  14768. return c
  14769. }
  14770. // Fields allows partial responses to be retrieved. See
  14771. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14772. // for more information.
  14773. func (c *ProjectsLocationsProductSetsRemoveProductCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductSetsRemoveProductCall {
  14774. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14775. return c
  14776. }
  14777. // Context sets the context to be used in this call's Do method. Any
  14778. // pending HTTP request will be aborted if the provided context is
  14779. // canceled.
  14780. func (c *ProjectsLocationsProductSetsRemoveProductCall) Context(ctx context.Context) *ProjectsLocationsProductSetsRemoveProductCall {
  14781. c.ctx_ = ctx
  14782. return c
  14783. }
  14784. // Header returns an http.Header that can be modified by the caller to
  14785. // add HTTP headers to the request.
  14786. func (c *ProjectsLocationsProductSetsRemoveProductCall) Header() http.Header {
  14787. if c.header_ == nil {
  14788. c.header_ = make(http.Header)
  14789. }
  14790. return c.header_
  14791. }
  14792. func (c *ProjectsLocationsProductSetsRemoveProductCall) doRequest(alt string) (*http.Response, error) {
  14793. reqHeaders := make(http.Header)
  14794. for k, v := range c.header_ {
  14795. reqHeaders[k] = v
  14796. }
  14797. reqHeaders.Set("User-Agent", c.s.userAgent())
  14798. var body io.Reader = nil
  14799. body, err := googleapi.WithoutDataWrapper.JSONReader(c.removeproductfromproductsetrequest)
  14800. if err != nil {
  14801. return nil, err
  14802. }
  14803. reqHeaders.Set("Content-Type", "application/json")
  14804. c.urlParams_.Set("alt", alt)
  14805. c.urlParams_.Set("prettyPrint", "false")
  14806. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:removeProduct")
  14807. urls += "?" + c.urlParams_.Encode()
  14808. req, err := http.NewRequest("POST", urls, body)
  14809. if err != nil {
  14810. return nil, err
  14811. }
  14812. req.Header = reqHeaders
  14813. googleapi.Expand(req.URL, map[string]string{
  14814. "name": c.name,
  14815. })
  14816. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14817. }
  14818. // Do executes the "vision.projects.locations.productSets.removeProduct" call.
  14819. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  14820. // code is an error. Response headers are in either
  14821. // *Empty.ServerResponse.Header or (if a response was returned at all)
  14822. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  14823. // check whether the returned error was because http.StatusNotModified
  14824. // was returned.
  14825. func (c *ProjectsLocationsProductSetsRemoveProductCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  14826. gensupport.SetOptions(c.urlParams_, opts...)
  14827. res, err := c.doRequest("json")
  14828. if res != nil && res.StatusCode == http.StatusNotModified {
  14829. if res.Body != nil {
  14830. res.Body.Close()
  14831. }
  14832. return nil, &googleapi.Error{
  14833. Code: res.StatusCode,
  14834. Header: res.Header,
  14835. }
  14836. }
  14837. if err != nil {
  14838. return nil, err
  14839. }
  14840. defer googleapi.CloseBody(res)
  14841. if err := googleapi.CheckResponse(res); err != nil {
  14842. return nil, err
  14843. }
  14844. ret := &Empty{
  14845. ServerResponse: googleapi.ServerResponse{
  14846. Header: res.Header,
  14847. HTTPStatusCode: res.StatusCode,
  14848. },
  14849. }
  14850. target := &ret
  14851. if err := gensupport.DecodeResponse(target, res); err != nil {
  14852. return nil, err
  14853. }
  14854. return ret, nil
  14855. // {
  14856. // "description": "Removes a Product from the specified ProductSet.\n\nPossible errors:\n\n* Returns NOT_FOUND If the Product is not found under the ProductSet.",
  14857. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/productSets/{productSetsId}:removeProduct",
  14858. // "httpMethod": "POST",
  14859. // "id": "vision.projects.locations.productSets.removeProduct",
  14860. // "parameterOrder": [
  14861. // "name"
  14862. // ],
  14863. // "parameters": {
  14864. // "name": {
  14865. // "description": "The resource name for the ProductSet to modify.\n\nFormat is:\n`projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`",
  14866. // "location": "path",
  14867. // "pattern": "^projects/[^/]+/locations/[^/]+/productSets/[^/]+$",
  14868. // "required": true,
  14869. // "type": "string"
  14870. // }
  14871. // },
  14872. // "path": "v1/{+name}:removeProduct",
  14873. // "request": {
  14874. // "$ref": "RemoveProductFromProductSetRequest"
  14875. // },
  14876. // "response": {
  14877. // "$ref": "Empty"
  14878. // },
  14879. // "scopes": [
  14880. // "https://www.googleapis.com/auth/cloud-platform",
  14881. // "https://www.googleapis.com/auth/cloud-vision"
  14882. // ]
  14883. // }
  14884. }
  14885. // method id "vision.projects.locations.productSets.products.list":
  14886. type ProjectsLocationsProductSetsProductsListCall struct {
  14887. s *Service
  14888. name string
  14889. urlParams_ gensupport.URLParams
  14890. ifNoneMatch_ string
  14891. ctx_ context.Context
  14892. header_ http.Header
  14893. }
  14894. // List: Lists the Products in a ProductSet, in an unspecified order. If
  14895. // the
  14896. // ProductSet does not exist, the products field of the response will
  14897. // be
  14898. // empty.
  14899. //
  14900. // Possible errors:
  14901. //
  14902. // * Returns INVALID_ARGUMENT if page_size is greater than 100 or less
  14903. // than 1.
  14904. func (r *ProjectsLocationsProductSetsProductsService) List(name string) *ProjectsLocationsProductSetsProductsListCall {
  14905. c := &ProjectsLocationsProductSetsProductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14906. c.name = name
  14907. return c
  14908. }
  14909. // PageSize sets the optional parameter "pageSize": The maximum number
  14910. // of items to return. Default 10, maximum 100.
  14911. func (c *ProjectsLocationsProductSetsProductsListCall) PageSize(pageSize int64) *ProjectsLocationsProductSetsProductsListCall {
  14912. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  14913. return c
  14914. }
  14915. // PageToken sets the optional parameter "pageToken": The
  14916. // next_page_token returned from a previous List request, if any.
  14917. func (c *ProjectsLocationsProductSetsProductsListCall) PageToken(pageToken string) *ProjectsLocationsProductSetsProductsListCall {
  14918. c.urlParams_.Set("pageToken", pageToken)
  14919. return c
  14920. }
  14921. // Fields allows partial responses to be retrieved. See
  14922. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14923. // for more information.
  14924. func (c *ProjectsLocationsProductSetsProductsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductSetsProductsListCall {
  14925. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14926. return c
  14927. }
  14928. // IfNoneMatch sets the optional parameter which makes the operation
  14929. // fail if the object's ETag matches the given value. This is useful for
  14930. // getting updates only after the object has changed since the last
  14931. // request. Use googleapi.IsNotModified to check whether the response
  14932. // error from Do is the result of In-None-Match.
  14933. func (c *ProjectsLocationsProductSetsProductsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsProductSetsProductsListCall {
  14934. c.ifNoneMatch_ = entityTag
  14935. return c
  14936. }
  14937. // Context sets the context to be used in this call's Do method. Any
  14938. // pending HTTP request will be aborted if the provided context is
  14939. // canceled.
  14940. func (c *ProjectsLocationsProductSetsProductsListCall) Context(ctx context.Context) *ProjectsLocationsProductSetsProductsListCall {
  14941. c.ctx_ = ctx
  14942. return c
  14943. }
  14944. // Header returns an http.Header that can be modified by the caller to
  14945. // add HTTP headers to the request.
  14946. func (c *ProjectsLocationsProductSetsProductsListCall) Header() http.Header {
  14947. if c.header_ == nil {
  14948. c.header_ = make(http.Header)
  14949. }
  14950. return c.header_
  14951. }
  14952. func (c *ProjectsLocationsProductSetsProductsListCall) doRequest(alt string) (*http.Response, error) {
  14953. reqHeaders := make(http.Header)
  14954. for k, v := range c.header_ {
  14955. reqHeaders[k] = v
  14956. }
  14957. reqHeaders.Set("User-Agent", c.s.userAgent())
  14958. if c.ifNoneMatch_ != "" {
  14959. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14960. }
  14961. var body io.Reader = nil
  14962. c.urlParams_.Set("alt", alt)
  14963. c.urlParams_.Set("prettyPrint", "false")
  14964. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/products")
  14965. urls += "?" + c.urlParams_.Encode()
  14966. req, err := http.NewRequest("GET", urls, body)
  14967. if err != nil {
  14968. return nil, err
  14969. }
  14970. req.Header = reqHeaders
  14971. googleapi.Expand(req.URL, map[string]string{
  14972. "name": c.name,
  14973. })
  14974. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14975. }
  14976. // Do executes the "vision.projects.locations.productSets.products.list" call.
  14977. // Exactly one of *ListProductsInProductSetResponse or error will be
  14978. // non-nil. Any non-2xx status code is an error. Response headers are in
  14979. // either *ListProductsInProductSetResponse.ServerResponse.Header or (if
  14980. // a response was returned at all) in error.(*googleapi.Error).Header.
  14981. // Use googleapi.IsNotModified to check whether the returned error was
  14982. // because http.StatusNotModified was returned.
  14983. func (c *ProjectsLocationsProductSetsProductsListCall) Do(opts ...googleapi.CallOption) (*ListProductsInProductSetResponse, error) {
  14984. gensupport.SetOptions(c.urlParams_, opts...)
  14985. res, err := c.doRequest("json")
  14986. if res != nil && res.StatusCode == http.StatusNotModified {
  14987. if res.Body != nil {
  14988. res.Body.Close()
  14989. }
  14990. return nil, &googleapi.Error{
  14991. Code: res.StatusCode,
  14992. Header: res.Header,
  14993. }
  14994. }
  14995. if err != nil {
  14996. return nil, err
  14997. }
  14998. defer googleapi.CloseBody(res)
  14999. if err := googleapi.CheckResponse(res); err != nil {
  15000. return nil, err
  15001. }
  15002. ret := &ListProductsInProductSetResponse{
  15003. ServerResponse: googleapi.ServerResponse{
  15004. Header: res.Header,
  15005. HTTPStatusCode: res.StatusCode,
  15006. },
  15007. }
  15008. target := &ret
  15009. if err := gensupport.DecodeResponse(target, res); err != nil {
  15010. return nil, err
  15011. }
  15012. return ret, nil
  15013. // {
  15014. // "description": "Lists the Products in a ProductSet, in an unspecified order. If the\nProductSet does not exist, the products field of the response will be\nempty.\n\nPossible errors:\n\n* Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.",
  15015. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/productSets/{productSetsId}/products",
  15016. // "httpMethod": "GET",
  15017. // "id": "vision.projects.locations.productSets.products.list",
  15018. // "parameterOrder": [
  15019. // "name"
  15020. // ],
  15021. // "parameters": {
  15022. // "name": {
  15023. // "description": "The ProductSet resource for which to retrieve Products.\n\nFormat is:\n`projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`",
  15024. // "location": "path",
  15025. // "pattern": "^projects/[^/]+/locations/[^/]+/productSets/[^/]+$",
  15026. // "required": true,
  15027. // "type": "string"
  15028. // },
  15029. // "pageSize": {
  15030. // "description": "The maximum number of items to return. Default 10, maximum 100.",
  15031. // "format": "int32",
  15032. // "location": "query",
  15033. // "type": "integer"
  15034. // },
  15035. // "pageToken": {
  15036. // "description": "The next_page_token returned from a previous List request, if any.",
  15037. // "location": "query",
  15038. // "type": "string"
  15039. // }
  15040. // },
  15041. // "path": "v1/{+name}/products",
  15042. // "response": {
  15043. // "$ref": "ListProductsInProductSetResponse"
  15044. // },
  15045. // "scopes": [
  15046. // "https://www.googleapis.com/auth/cloud-platform",
  15047. // "https://www.googleapis.com/auth/cloud-vision"
  15048. // ]
  15049. // }
  15050. }
  15051. // Pages invokes f for each page of results.
  15052. // A non-nil error returned from f will halt the iteration.
  15053. // The provided context supersedes any context provided to the Context method.
  15054. func (c *ProjectsLocationsProductSetsProductsListCall) Pages(ctx context.Context, f func(*ListProductsInProductSetResponse) error) error {
  15055. c.ctx_ = ctx
  15056. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  15057. for {
  15058. x, err := c.Do()
  15059. if err != nil {
  15060. return err
  15061. }
  15062. if err := f(x); err != nil {
  15063. return err
  15064. }
  15065. if x.NextPageToken == "" {
  15066. return nil
  15067. }
  15068. c.PageToken(x.NextPageToken)
  15069. }
  15070. }
  15071. // method id "vision.projects.locations.products.create":
  15072. type ProjectsLocationsProductsCreateCall struct {
  15073. s *Service
  15074. parent string
  15075. product *Product
  15076. urlParams_ gensupport.URLParams
  15077. ctx_ context.Context
  15078. header_ http.Header
  15079. }
  15080. // Create: Creates and returns a new product resource.
  15081. //
  15082. // Possible errors:
  15083. //
  15084. // * Returns INVALID_ARGUMENT if display_name is missing or longer than
  15085. // 4096
  15086. // characters.
  15087. // * Returns INVALID_ARGUMENT if description is longer than 4096
  15088. // characters.
  15089. // * Returns INVALID_ARGUMENT if product_category is missing or invalid.
  15090. func (r *ProjectsLocationsProductsService) Create(parent string, product *Product) *ProjectsLocationsProductsCreateCall {
  15091. c := &ProjectsLocationsProductsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15092. c.parent = parent
  15093. c.product = product
  15094. return c
  15095. }
  15096. // ProductId sets the optional parameter "productId": A user-supplied
  15097. // resource id for this Product. If set, the server will
  15098. // attempt to use this value as the resource id. If it is already in
  15099. // use, an
  15100. // error is returned with code ALREADY_EXISTS. Must be at most 128
  15101. // characters
  15102. // long. It cannot contain the character `/`.
  15103. func (c *ProjectsLocationsProductsCreateCall) ProductId(productId string) *ProjectsLocationsProductsCreateCall {
  15104. c.urlParams_.Set("productId", productId)
  15105. return c
  15106. }
  15107. // Fields allows partial responses to be retrieved. See
  15108. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15109. // for more information.
  15110. func (c *ProjectsLocationsProductsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductsCreateCall {
  15111. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15112. return c
  15113. }
  15114. // Context sets the context to be used in this call's Do method. Any
  15115. // pending HTTP request will be aborted if the provided context is
  15116. // canceled.
  15117. func (c *ProjectsLocationsProductsCreateCall) Context(ctx context.Context) *ProjectsLocationsProductsCreateCall {
  15118. c.ctx_ = ctx
  15119. return c
  15120. }
  15121. // Header returns an http.Header that can be modified by the caller to
  15122. // add HTTP headers to the request.
  15123. func (c *ProjectsLocationsProductsCreateCall) Header() http.Header {
  15124. if c.header_ == nil {
  15125. c.header_ = make(http.Header)
  15126. }
  15127. return c.header_
  15128. }
  15129. func (c *ProjectsLocationsProductsCreateCall) doRequest(alt string) (*http.Response, error) {
  15130. reqHeaders := make(http.Header)
  15131. for k, v := range c.header_ {
  15132. reqHeaders[k] = v
  15133. }
  15134. reqHeaders.Set("User-Agent", c.s.userAgent())
  15135. var body io.Reader = nil
  15136. body, err := googleapi.WithoutDataWrapper.JSONReader(c.product)
  15137. if err != nil {
  15138. return nil, err
  15139. }
  15140. reqHeaders.Set("Content-Type", "application/json")
  15141. c.urlParams_.Set("alt", alt)
  15142. c.urlParams_.Set("prettyPrint", "false")
  15143. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/products")
  15144. urls += "?" + c.urlParams_.Encode()
  15145. req, err := http.NewRequest("POST", urls, body)
  15146. if err != nil {
  15147. return nil, err
  15148. }
  15149. req.Header = reqHeaders
  15150. googleapi.Expand(req.URL, map[string]string{
  15151. "parent": c.parent,
  15152. })
  15153. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15154. }
  15155. // Do executes the "vision.projects.locations.products.create" call.
  15156. // Exactly one of *Product or error will be non-nil. Any non-2xx status
  15157. // code is an error. Response headers are in either
  15158. // *Product.ServerResponse.Header or (if a response was returned at all)
  15159. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  15160. // check whether the returned error was because http.StatusNotModified
  15161. // was returned.
  15162. func (c *ProjectsLocationsProductsCreateCall) Do(opts ...googleapi.CallOption) (*Product, error) {
  15163. gensupport.SetOptions(c.urlParams_, opts...)
  15164. res, err := c.doRequest("json")
  15165. if res != nil && res.StatusCode == http.StatusNotModified {
  15166. if res.Body != nil {
  15167. res.Body.Close()
  15168. }
  15169. return nil, &googleapi.Error{
  15170. Code: res.StatusCode,
  15171. Header: res.Header,
  15172. }
  15173. }
  15174. if err != nil {
  15175. return nil, err
  15176. }
  15177. defer googleapi.CloseBody(res)
  15178. if err := googleapi.CheckResponse(res); err != nil {
  15179. return nil, err
  15180. }
  15181. ret := &Product{
  15182. ServerResponse: googleapi.ServerResponse{
  15183. Header: res.Header,
  15184. HTTPStatusCode: res.StatusCode,
  15185. },
  15186. }
  15187. target := &ret
  15188. if err := gensupport.DecodeResponse(target, res); err != nil {
  15189. return nil, err
  15190. }
  15191. return ret, nil
  15192. // {
  15193. // "description": "Creates and returns a new product resource.\n\nPossible errors:\n\n* Returns INVALID_ARGUMENT if display_name is missing or longer than 4096\n characters.\n* Returns INVALID_ARGUMENT if description is longer than 4096 characters.\n* Returns INVALID_ARGUMENT if product_category is missing or invalid.",
  15194. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/products",
  15195. // "httpMethod": "POST",
  15196. // "id": "vision.projects.locations.products.create",
  15197. // "parameterOrder": [
  15198. // "parent"
  15199. // ],
  15200. // "parameters": {
  15201. // "parent": {
  15202. // "description": "The project in which the Product should be created.\n\nFormat is\n`projects/PROJECT_ID/locations/LOC_ID`.",
  15203. // "location": "path",
  15204. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  15205. // "required": true,
  15206. // "type": "string"
  15207. // },
  15208. // "productId": {
  15209. // "description": "A user-supplied resource id for this Product. If set, the server will\nattempt to use this value as the resource id. If it is already in use, an\nerror is returned with code ALREADY_EXISTS. Must be at most 128 characters\nlong. It cannot contain the character `/`.",
  15210. // "location": "query",
  15211. // "type": "string"
  15212. // }
  15213. // },
  15214. // "path": "v1/{+parent}/products",
  15215. // "request": {
  15216. // "$ref": "Product"
  15217. // },
  15218. // "response": {
  15219. // "$ref": "Product"
  15220. // },
  15221. // "scopes": [
  15222. // "https://www.googleapis.com/auth/cloud-platform",
  15223. // "https://www.googleapis.com/auth/cloud-vision"
  15224. // ]
  15225. // }
  15226. }
  15227. // method id "vision.projects.locations.products.delete":
  15228. type ProjectsLocationsProductsDeleteCall struct {
  15229. s *Service
  15230. name string
  15231. urlParams_ gensupport.URLParams
  15232. ctx_ context.Context
  15233. header_ http.Header
  15234. }
  15235. // Delete: Permanently deletes a product and its reference
  15236. // images.
  15237. //
  15238. // Metadata of the product and all its images will be deleted right
  15239. // away, but
  15240. // search queries against ProductSets containing the product may still
  15241. // work
  15242. // until all related caches are refreshed.
  15243. //
  15244. // Possible errors:
  15245. //
  15246. // * Returns NOT_FOUND if the product does not exist.
  15247. func (r *ProjectsLocationsProductsService) Delete(name string) *ProjectsLocationsProductsDeleteCall {
  15248. c := &ProjectsLocationsProductsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15249. c.name = name
  15250. return c
  15251. }
  15252. // Fields allows partial responses to be retrieved. See
  15253. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15254. // for more information.
  15255. func (c *ProjectsLocationsProductsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductsDeleteCall {
  15256. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15257. return c
  15258. }
  15259. // Context sets the context to be used in this call's Do method. Any
  15260. // pending HTTP request will be aborted if the provided context is
  15261. // canceled.
  15262. func (c *ProjectsLocationsProductsDeleteCall) Context(ctx context.Context) *ProjectsLocationsProductsDeleteCall {
  15263. c.ctx_ = ctx
  15264. return c
  15265. }
  15266. // Header returns an http.Header that can be modified by the caller to
  15267. // add HTTP headers to the request.
  15268. func (c *ProjectsLocationsProductsDeleteCall) Header() http.Header {
  15269. if c.header_ == nil {
  15270. c.header_ = make(http.Header)
  15271. }
  15272. return c.header_
  15273. }
  15274. func (c *ProjectsLocationsProductsDeleteCall) doRequest(alt string) (*http.Response, error) {
  15275. reqHeaders := make(http.Header)
  15276. for k, v := range c.header_ {
  15277. reqHeaders[k] = v
  15278. }
  15279. reqHeaders.Set("User-Agent", c.s.userAgent())
  15280. var body io.Reader = nil
  15281. c.urlParams_.Set("alt", alt)
  15282. c.urlParams_.Set("prettyPrint", "false")
  15283. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  15284. urls += "?" + c.urlParams_.Encode()
  15285. req, err := http.NewRequest("DELETE", urls, body)
  15286. if err != nil {
  15287. return nil, err
  15288. }
  15289. req.Header = reqHeaders
  15290. googleapi.Expand(req.URL, map[string]string{
  15291. "name": c.name,
  15292. })
  15293. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15294. }
  15295. // Do executes the "vision.projects.locations.products.delete" call.
  15296. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  15297. // code is an error. Response headers are in either
  15298. // *Empty.ServerResponse.Header or (if a response was returned at all)
  15299. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  15300. // check whether the returned error was because http.StatusNotModified
  15301. // was returned.
  15302. func (c *ProjectsLocationsProductsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  15303. gensupport.SetOptions(c.urlParams_, opts...)
  15304. res, err := c.doRequest("json")
  15305. if res != nil && res.StatusCode == http.StatusNotModified {
  15306. if res.Body != nil {
  15307. res.Body.Close()
  15308. }
  15309. return nil, &googleapi.Error{
  15310. Code: res.StatusCode,
  15311. Header: res.Header,
  15312. }
  15313. }
  15314. if err != nil {
  15315. return nil, err
  15316. }
  15317. defer googleapi.CloseBody(res)
  15318. if err := googleapi.CheckResponse(res); err != nil {
  15319. return nil, err
  15320. }
  15321. ret := &Empty{
  15322. ServerResponse: googleapi.ServerResponse{
  15323. Header: res.Header,
  15324. HTTPStatusCode: res.StatusCode,
  15325. },
  15326. }
  15327. target := &ret
  15328. if err := gensupport.DecodeResponse(target, res); err != nil {
  15329. return nil, err
  15330. }
  15331. return ret, nil
  15332. // {
  15333. // "description": "Permanently deletes a product and its reference images.\n\nMetadata of the product and all its images will be deleted right away, but\nsearch queries against ProductSets containing the product may still work\nuntil all related caches are refreshed.\n\nPossible errors:\n\n* Returns NOT_FOUND if the product does not exist.",
  15334. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/products/{productsId}",
  15335. // "httpMethod": "DELETE",
  15336. // "id": "vision.projects.locations.products.delete",
  15337. // "parameterOrder": [
  15338. // "name"
  15339. // ],
  15340. // "parameters": {
  15341. // "name": {
  15342. // "description": "Resource name of product to delete.\n\nFormat is:\n`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`",
  15343. // "location": "path",
  15344. // "pattern": "^projects/[^/]+/locations/[^/]+/products/[^/]+$",
  15345. // "required": true,
  15346. // "type": "string"
  15347. // }
  15348. // },
  15349. // "path": "v1/{+name}",
  15350. // "response": {
  15351. // "$ref": "Empty"
  15352. // },
  15353. // "scopes": [
  15354. // "https://www.googleapis.com/auth/cloud-platform",
  15355. // "https://www.googleapis.com/auth/cloud-vision"
  15356. // ]
  15357. // }
  15358. }
  15359. // method id "vision.projects.locations.products.get":
  15360. type ProjectsLocationsProductsGetCall struct {
  15361. s *Service
  15362. name string
  15363. urlParams_ gensupport.URLParams
  15364. ifNoneMatch_ string
  15365. ctx_ context.Context
  15366. header_ http.Header
  15367. }
  15368. // Get: Gets information associated with a Product.
  15369. //
  15370. // Possible errors:
  15371. //
  15372. // * Returns NOT_FOUND if the Product does not exist.
  15373. func (r *ProjectsLocationsProductsService) Get(name string) *ProjectsLocationsProductsGetCall {
  15374. c := &ProjectsLocationsProductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15375. c.name = name
  15376. return c
  15377. }
  15378. // Fields allows partial responses to be retrieved. See
  15379. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15380. // for more information.
  15381. func (c *ProjectsLocationsProductsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductsGetCall {
  15382. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15383. return c
  15384. }
  15385. // IfNoneMatch sets the optional parameter which makes the operation
  15386. // fail if the object's ETag matches the given value. This is useful for
  15387. // getting updates only after the object has changed since the last
  15388. // request. Use googleapi.IsNotModified to check whether the response
  15389. // error from Do is the result of In-None-Match.
  15390. func (c *ProjectsLocationsProductsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsProductsGetCall {
  15391. c.ifNoneMatch_ = entityTag
  15392. return c
  15393. }
  15394. // Context sets the context to be used in this call's Do method. Any
  15395. // pending HTTP request will be aborted if the provided context is
  15396. // canceled.
  15397. func (c *ProjectsLocationsProductsGetCall) Context(ctx context.Context) *ProjectsLocationsProductsGetCall {
  15398. c.ctx_ = ctx
  15399. return c
  15400. }
  15401. // Header returns an http.Header that can be modified by the caller to
  15402. // add HTTP headers to the request.
  15403. func (c *ProjectsLocationsProductsGetCall) Header() http.Header {
  15404. if c.header_ == nil {
  15405. c.header_ = make(http.Header)
  15406. }
  15407. return c.header_
  15408. }
  15409. func (c *ProjectsLocationsProductsGetCall) doRequest(alt string) (*http.Response, error) {
  15410. reqHeaders := make(http.Header)
  15411. for k, v := range c.header_ {
  15412. reqHeaders[k] = v
  15413. }
  15414. reqHeaders.Set("User-Agent", c.s.userAgent())
  15415. if c.ifNoneMatch_ != "" {
  15416. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15417. }
  15418. var body io.Reader = nil
  15419. c.urlParams_.Set("alt", alt)
  15420. c.urlParams_.Set("prettyPrint", "false")
  15421. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  15422. urls += "?" + c.urlParams_.Encode()
  15423. req, err := http.NewRequest("GET", urls, body)
  15424. if err != nil {
  15425. return nil, err
  15426. }
  15427. req.Header = reqHeaders
  15428. googleapi.Expand(req.URL, map[string]string{
  15429. "name": c.name,
  15430. })
  15431. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15432. }
  15433. // Do executes the "vision.projects.locations.products.get" call.
  15434. // Exactly one of *Product or error will be non-nil. Any non-2xx status
  15435. // code is an error. Response headers are in either
  15436. // *Product.ServerResponse.Header or (if a response was returned at all)
  15437. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  15438. // check whether the returned error was because http.StatusNotModified
  15439. // was returned.
  15440. func (c *ProjectsLocationsProductsGetCall) Do(opts ...googleapi.CallOption) (*Product, error) {
  15441. gensupport.SetOptions(c.urlParams_, opts...)
  15442. res, err := c.doRequest("json")
  15443. if res != nil && res.StatusCode == http.StatusNotModified {
  15444. if res.Body != nil {
  15445. res.Body.Close()
  15446. }
  15447. return nil, &googleapi.Error{
  15448. Code: res.StatusCode,
  15449. Header: res.Header,
  15450. }
  15451. }
  15452. if err != nil {
  15453. return nil, err
  15454. }
  15455. defer googleapi.CloseBody(res)
  15456. if err := googleapi.CheckResponse(res); err != nil {
  15457. return nil, err
  15458. }
  15459. ret := &Product{
  15460. ServerResponse: googleapi.ServerResponse{
  15461. Header: res.Header,
  15462. HTTPStatusCode: res.StatusCode,
  15463. },
  15464. }
  15465. target := &ret
  15466. if err := gensupport.DecodeResponse(target, res); err != nil {
  15467. return nil, err
  15468. }
  15469. return ret, nil
  15470. // {
  15471. // "description": "Gets information associated with a Product.\n\nPossible errors:\n\n* Returns NOT_FOUND if the Product does not exist.",
  15472. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/products/{productsId}",
  15473. // "httpMethod": "GET",
  15474. // "id": "vision.projects.locations.products.get",
  15475. // "parameterOrder": [
  15476. // "name"
  15477. // ],
  15478. // "parameters": {
  15479. // "name": {
  15480. // "description": "Resource name of the Product to get.\n\nFormat is:\n`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`",
  15481. // "location": "path",
  15482. // "pattern": "^projects/[^/]+/locations/[^/]+/products/[^/]+$",
  15483. // "required": true,
  15484. // "type": "string"
  15485. // }
  15486. // },
  15487. // "path": "v1/{+name}",
  15488. // "response": {
  15489. // "$ref": "Product"
  15490. // },
  15491. // "scopes": [
  15492. // "https://www.googleapis.com/auth/cloud-platform",
  15493. // "https://www.googleapis.com/auth/cloud-vision"
  15494. // ]
  15495. // }
  15496. }
  15497. // method id "vision.projects.locations.products.list":
  15498. type ProjectsLocationsProductsListCall struct {
  15499. s *Service
  15500. parent string
  15501. urlParams_ gensupport.URLParams
  15502. ifNoneMatch_ string
  15503. ctx_ context.Context
  15504. header_ http.Header
  15505. }
  15506. // List: Lists products in an unspecified order.
  15507. //
  15508. // Possible errors:
  15509. //
  15510. // * Returns INVALID_ARGUMENT if page_size is greater than 100 or less
  15511. // than 1.
  15512. func (r *ProjectsLocationsProductsService) List(parent string) *ProjectsLocationsProductsListCall {
  15513. c := &ProjectsLocationsProductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15514. c.parent = parent
  15515. return c
  15516. }
  15517. // PageSize sets the optional parameter "pageSize": The maximum number
  15518. // of items to return. Default 10, maximum 100.
  15519. func (c *ProjectsLocationsProductsListCall) PageSize(pageSize int64) *ProjectsLocationsProductsListCall {
  15520. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  15521. return c
  15522. }
  15523. // PageToken sets the optional parameter "pageToken": The
  15524. // next_page_token returned from a previous List request, if any.
  15525. func (c *ProjectsLocationsProductsListCall) PageToken(pageToken string) *ProjectsLocationsProductsListCall {
  15526. c.urlParams_.Set("pageToken", pageToken)
  15527. return c
  15528. }
  15529. // Fields allows partial responses to be retrieved. See
  15530. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15531. // for more information.
  15532. func (c *ProjectsLocationsProductsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductsListCall {
  15533. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15534. return c
  15535. }
  15536. // IfNoneMatch sets the optional parameter which makes the operation
  15537. // fail if the object's ETag matches the given value. This is useful for
  15538. // getting updates only after the object has changed since the last
  15539. // request. Use googleapi.IsNotModified to check whether the response
  15540. // error from Do is the result of In-None-Match.
  15541. func (c *ProjectsLocationsProductsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsProductsListCall {
  15542. c.ifNoneMatch_ = entityTag
  15543. return c
  15544. }
  15545. // Context sets the context to be used in this call's Do method. Any
  15546. // pending HTTP request will be aborted if the provided context is
  15547. // canceled.
  15548. func (c *ProjectsLocationsProductsListCall) Context(ctx context.Context) *ProjectsLocationsProductsListCall {
  15549. c.ctx_ = ctx
  15550. return c
  15551. }
  15552. // Header returns an http.Header that can be modified by the caller to
  15553. // add HTTP headers to the request.
  15554. func (c *ProjectsLocationsProductsListCall) Header() http.Header {
  15555. if c.header_ == nil {
  15556. c.header_ = make(http.Header)
  15557. }
  15558. return c.header_
  15559. }
  15560. func (c *ProjectsLocationsProductsListCall) doRequest(alt string) (*http.Response, error) {
  15561. reqHeaders := make(http.Header)
  15562. for k, v := range c.header_ {
  15563. reqHeaders[k] = v
  15564. }
  15565. reqHeaders.Set("User-Agent", c.s.userAgent())
  15566. if c.ifNoneMatch_ != "" {
  15567. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15568. }
  15569. var body io.Reader = nil
  15570. c.urlParams_.Set("alt", alt)
  15571. c.urlParams_.Set("prettyPrint", "false")
  15572. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/products")
  15573. urls += "?" + c.urlParams_.Encode()
  15574. req, err := http.NewRequest("GET", urls, body)
  15575. if err != nil {
  15576. return nil, err
  15577. }
  15578. req.Header = reqHeaders
  15579. googleapi.Expand(req.URL, map[string]string{
  15580. "parent": c.parent,
  15581. })
  15582. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15583. }
  15584. // Do executes the "vision.projects.locations.products.list" call.
  15585. // Exactly one of *ListProductsResponse or error will be non-nil. Any
  15586. // non-2xx status code is an error. Response headers are in either
  15587. // *ListProductsResponse.ServerResponse.Header or (if a response was
  15588. // returned at all) in error.(*googleapi.Error).Header. Use
  15589. // googleapi.IsNotModified to check whether the returned error was
  15590. // because http.StatusNotModified was returned.
  15591. func (c *ProjectsLocationsProductsListCall) Do(opts ...googleapi.CallOption) (*ListProductsResponse, error) {
  15592. gensupport.SetOptions(c.urlParams_, opts...)
  15593. res, err := c.doRequest("json")
  15594. if res != nil && res.StatusCode == http.StatusNotModified {
  15595. if res.Body != nil {
  15596. res.Body.Close()
  15597. }
  15598. return nil, &googleapi.Error{
  15599. Code: res.StatusCode,
  15600. Header: res.Header,
  15601. }
  15602. }
  15603. if err != nil {
  15604. return nil, err
  15605. }
  15606. defer googleapi.CloseBody(res)
  15607. if err := googleapi.CheckResponse(res); err != nil {
  15608. return nil, err
  15609. }
  15610. ret := &ListProductsResponse{
  15611. ServerResponse: googleapi.ServerResponse{
  15612. Header: res.Header,
  15613. HTTPStatusCode: res.StatusCode,
  15614. },
  15615. }
  15616. target := &ret
  15617. if err := gensupport.DecodeResponse(target, res); err != nil {
  15618. return nil, err
  15619. }
  15620. return ret, nil
  15621. // {
  15622. // "description": "Lists products in an unspecified order.\n\nPossible errors:\n\n* Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.",
  15623. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/products",
  15624. // "httpMethod": "GET",
  15625. // "id": "vision.projects.locations.products.list",
  15626. // "parameterOrder": [
  15627. // "parent"
  15628. // ],
  15629. // "parameters": {
  15630. // "pageSize": {
  15631. // "description": "The maximum number of items to return. Default 10, maximum 100.",
  15632. // "format": "int32",
  15633. // "location": "query",
  15634. // "type": "integer"
  15635. // },
  15636. // "pageToken": {
  15637. // "description": "The next_page_token returned from a previous List request, if any.",
  15638. // "location": "query",
  15639. // "type": "string"
  15640. // },
  15641. // "parent": {
  15642. // "description": "The project OR ProductSet from which Products should be listed.\n\nFormat:\n`projects/PROJECT_ID/locations/LOC_ID`",
  15643. // "location": "path",
  15644. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  15645. // "required": true,
  15646. // "type": "string"
  15647. // }
  15648. // },
  15649. // "path": "v1/{+parent}/products",
  15650. // "response": {
  15651. // "$ref": "ListProductsResponse"
  15652. // },
  15653. // "scopes": [
  15654. // "https://www.googleapis.com/auth/cloud-platform",
  15655. // "https://www.googleapis.com/auth/cloud-vision"
  15656. // ]
  15657. // }
  15658. }
  15659. // Pages invokes f for each page of results.
  15660. // A non-nil error returned from f will halt the iteration.
  15661. // The provided context supersedes any context provided to the Context method.
  15662. func (c *ProjectsLocationsProductsListCall) Pages(ctx context.Context, f func(*ListProductsResponse) error) error {
  15663. c.ctx_ = ctx
  15664. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  15665. for {
  15666. x, err := c.Do()
  15667. if err != nil {
  15668. return err
  15669. }
  15670. if err := f(x); err != nil {
  15671. return err
  15672. }
  15673. if x.NextPageToken == "" {
  15674. return nil
  15675. }
  15676. c.PageToken(x.NextPageToken)
  15677. }
  15678. }
  15679. // method id "vision.projects.locations.products.patch":
  15680. type ProjectsLocationsProductsPatchCall struct {
  15681. s *Service
  15682. name string
  15683. product *Product
  15684. urlParams_ gensupport.URLParams
  15685. ctx_ context.Context
  15686. header_ http.Header
  15687. }
  15688. // Patch: Makes changes to a Product resource.
  15689. // Only the `display_name`, `description`, and `labels` fields can be
  15690. // updated
  15691. // right now.
  15692. //
  15693. // If labels are updated, the change will not be reflected in queries
  15694. // until
  15695. // the next index time.
  15696. //
  15697. // Possible errors:
  15698. //
  15699. // * Returns NOT_FOUND if the Product does not exist.
  15700. // * Returns INVALID_ARGUMENT if display_name is present in update_mask
  15701. // but is
  15702. // missing from the request or longer than 4096 characters.
  15703. // * Returns INVALID_ARGUMENT if description is present in update_mask
  15704. // but is
  15705. // longer than 4096 characters.
  15706. // * Returns INVALID_ARGUMENT if product_category is present in
  15707. // update_mask.
  15708. func (r *ProjectsLocationsProductsService) Patch(name string, product *Product) *ProjectsLocationsProductsPatchCall {
  15709. c := &ProjectsLocationsProductsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15710. c.name = name
  15711. c.product = product
  15712. return c
  15713. }
  15714. // UpdateMask sets the optional parameter "updateMask": The FieldMask
  15715. // that specifies which fields
  15716. // to update.
  15717. // If update_mask isn't specified, all mutable fields are to be
  15718. // updated.
  15719. // Valid mask paths include `product_labels`, `display_name`,
  15720. // and
  15721. // `description`.
  15722. func (c *ProjectsLocationsProductsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsProductsPatchCall {
  15723. c.urlParams_.Set("updateMask", updateMask)
  15724. return c
  15725. }
  15726. // Fields allows partial responses to be retrieved. See
  15727. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15728. // for more information.
  15729. func (c *ProjectsLocationsProductsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductsPatchCall {
  15730. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15731. return c
  15732. }
  15733. // Context sets the context to be used in this call's Do method. Any
  15734. // pending HTTP request will be aborted if the provided context is
  15735. // canceled.
  15736. func (c *ProjectsLocationsProductsPatchCall) Context(ctx context.Context) *ProjectsLocationsProductsPatchCall {
  15737. c.ctx_ = ctx
  15738. return c
  15739. }
  15740. // Header returns an http.Header that can be modified by the caller to
  15741. // add HTTP headers to the request.
  15742. func (c *ProjectsLocationsProductsPatchCall) Header() http.Header {
  15743. if c.header_ == nil {
  15744. c.header_ = make(http.Header)
  15745. }
  15746. return c.header_
  15747. }
  15748. func (c *ProjectsLocationsProductsPatchCall) doRequest(alt string) (*http.Response, error) {
  15749. reqHeaders := make(http.Header)
  15750. for k, v := range c.header_ {
  15751. reqHeaders[k] = v
  15752. }
  15753. reqHeaders.Set("User-Agent", c.s.userAgent())
  15754. var body io.Reader = nil
  15755. body, err := googleapi.WithoutDataWrapper.JSONReader(c.product)
  15756. if err != nil {
  15757. return nil, err
  15758. }
  15759. reqHeaders.Set("Content-Type", "application/json")
  15760. c.urlParams_.Set("alt", alt)
  15761. c.urlParams_.Set("prettyPrint", "false")
  15762. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  15763. urls += "?" + c.urlParams_.Encode()
  15764. req, err := http.NewRequest("PATCH", urls, body)
  15765. if err != nil {
  15766. return nil, err
  15767. }
  15768. req.Header = reqHeaders
  15769. googleapi.Expand(req.URL, map[string]string{
  15770. "name": c.name,
  15771. })
  15772. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15773. }
  15774. // Do executes the "vision.projects.locations.products.patch" call.
  15775. // Exactly one of *Product or error will be non-nil. Any non-2xx status
  15776. // code is an error. Response headers are in either
  15777. // *Product.ServerResponse.Header or (if a response was returned at all)
  15778. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  15779. // check whether the returned error was because http.StatusNotModified
  15780. // was returned.
  15781. func (c *ProjectsLocationsProductsPatchCall) Do(opts ...googleapi.CallOption) (*Product, error) {
  15782. gensupport.SetOptions(c.urlParams_, opts...)
  15783. res, err := c.doRequest("json")
  15784. if res != nil && res.StatusCode == http.StatusNotModified {
  15785. if res.Body != nil {
  15786. res.Body.Close()
  15787. }
  15788. return nil, &googleapi.Error{
  15789. Code: res.StatusCode,
  15790. Header: res.Header,
  15791. }
  15792. }
  15793. if err != nil {
  15794. return nil, err
  15795. }
  15796. defer googleapi.CloseBody(res)
  15797. if err := googleapi.CheckResponse(res); err != nil {
  15798. return nil, err
  15799. }
  15800. ret := &Product{
  15801. ServerResponse: googleapi.ServerResponse{
  15802. Header: res.Header,
  15803. HTTPStatusCode: res.StatusCode,
  15804. },
  15805. }
  15806. target := &ret
  15807. if err := gensupport.DecodeResponse(target, res); err != nil {
  15808. return nil, err
  15809. }
  15810. return ret, nil
  15811. // {
  15812. // "description": "Makes changes to a Product resource.\nOnly the `display_name`, `description`, and `labels` fields can be updated\nright now.\n\nIf labels are updated, the change will not be reflected in queries until\nthe next index time.\n\nPossible errors:\n\n* Returns NOT_FOUND if the Product does not exist.\n* Returns INVALID_ARGUMENT if display_name is present in update_mask but is\n missing from the request or longer than 4096 characters.\n* Returns INVALID_ARGUMENT if description is present in update_mask but is\n longer than 4096 characters.\n* Returns INVALID_ARGUMENT if product_category is present in update_mask.",
  15813. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/products/{productsId}",
  15814. // "httpMethod": "PATCH",
  15815. // "id": "vision.projects.locations.products.patch",
  15816. // "parameterOrder": [
  15817. // "name"
  15818. // ],
  15819. // "parameters": {
  15820. // "name": {
  15821. // "description": "The resource name of the product.\n\nFormat is:\n`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.\n\nThis field is ignored when creating a product.",
  15822. // "location": "path",
  15823. // "pattern": "^projects/[^/]+/locations/[^/]+/products/[^/]+$",
  15824. // "required": true,
  15825. // "type": "string"
  15826. // },
  15827. // "updateMask": {
  15828. // "description": "The FieldMask that specifies which fields\nto update.\nIf update_mask isn't specified, all mutable fields are to be updated.\nValid mask paths include `product_labels`, `display_name`, and\n`description`.",
  15829. // "format": "google-fieldmask",
  15830. // "location": "query",
  15831. // "type": "string"
  15832. // }
  15833. // },
  15834. // "path": "v1/{+name}",
  15835. // "request": {
  15836. // "$ref": "Product"
  15837. // },
  15838. // "response": {
  15839. // "$ref": "Product"
  15840. // },
  15841. // "scopes": [
  15842. // "https://www.googleapis.com/auth/cloud-platform",
  15843. // "https://www.googleapis.com/auth/cloud-vision"
  15844. // ]
  15845. // }
  15846. }
  15847. // method id "vision.projects.locations.products.referenceImages.create":
  15848. type ProjectsLocationsProductsReferenceImagesCreateCall struct {
  15849. s *Service
  15850. parent string
  15851. referenceimage *ReferenceImage
  15852. urlParams_ gensupport.URLParams
  15853. ctx_ context.Context
  15854. header_ http.Header
  15855. }
  15856. // Create: Creates and returns a new ReferenceImage resource.
  15857. //
  15858. // The `bounding_poly` field is optional. If `bounding_poly` is not
  15859. // specified,
  15860. // the system will try to detect regions of interest in the image that
  15861. // are
  15862. // compatible with the product_category on the parent product. If it
  15863. // is
  15864. // specified, detection is ALWAYS skipped. The system converts polygons
  15865. // into
  15866. // non-rotated rectangles.
  15867. //
  15868. // Note that the pipeline will resize the image if the image resolution
  15869. // is too
  15870. // large to process (above 50MP).
  15871. //
  15872. // Possible errors:
  15873. //
  15874. // * Returns INVALID_ARGUMENT if the image_uri is missing or longer than
  15875. // 4096
  15876. // characters.
  15877. // * Returns INVALID_ARGUMENT if the product does not exist.
  15878. // * Returns INVALID_ARGUMENT if bounding_poly is not provided, and
  15879. // nothing
  15880. // compatible with the parent product's product_category is
  15881. // detected.
  15882. // * Returns INVALID_ARGUMENT if bounding_poly contains more than 10
  15883. // polygons.
  15884. func (r *ProjectsLocationsProductsReferenceImagesService) Create(parent string, referenceimage *ReferenceImage) *ProjectsLocationsProductsReferenceImagesCreateCall {
  15885. c := &ProjectsLocationsProductsReferenceImagesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15886. c.parent = parent
  15887. c.referenceimage = referenceimage
  15888. return c
  15889. }
  15890. // ReferenceImageId sets the optional parameter "referenceImageId": A
  15891. // user-supplied resource id for the ReferenceImage to be added. If
  15892. // set,
  15893. // the server will attempt to use this value as the resource id. If it
  15894. // is
  15895. // already in use, an error is returned with code ALREADY_EXISTS. Must
  15896. // be at
  15897. // most 128 characters long. It cannot contain the character `/`.
  15898. func (c *ProjectsLocationsProductsReferenceImagesCreateCall) ReferenceImageId(referenceImageId string) *ProjectsLocationsProductsReferenceImagesCreateCall {
  15899. c.urlParams_.Set("referenceImageId", referenceImageId)
  15900. return c
  15901. }
  15902. // Fields allows partial responses to be retrieved. See
  15903. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15904. // for more information.
  15905. func (c *ProjectsLocationsProductsReferenceImagesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductsReferenceImagesCreateCall {
  15906. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15907. return c
  15908. }
  15909. // Context sets the context to be used in this call's Do method. Any
  15910. // pending HTTP request will be aborted if the provided context is
  15911. // canceled.
  15912. func (c *ProjectsLocationsProductsReferenceImagesCreateCall) Context(ctx context.Context) *ProjectsLocationsProductsReferenceImagesCreateCall {
  15913. c.ctx_ = ctx
  15914. return c
  15915. }
  15916. // Header returns an http.Header that can be modified by the caller to
  15917. // add HTTP headers to the request.
  15918. func (c *ProjectsLocationsProductsReferenceImagesCreateCall) Header() http.Header {
  15919. if c.header_ == nil {
  15920. c.header_ = make(http.Header)
  15921. }
  15922. return c.header_
  15923. }
  15924. func (c *ProjectsLocationsProductsReferenceImagesCreateCall) doRequest(alt string) (*http.Response, error) {
  15925. reqHeaders := make(http.Header)
  15926. for k, v := range c.header_ {
  15927. reqHeaders[k] = v
  15928. }
  15929. reqHeaders.Set("User-Agent", c.s.userAgent())
  15930. var body io.Reader = nil
  15931. body, err := googleapi.WithoutDataWrapper.JSONReader(c.referenceimage)
  15932. if err != nil {
  15933. return nil, err
  15934. }
  15935. reqHeaders.Set("Content-Type", "application/json")
  15936. c.urlParams_.Set("alt", alt)
  15937. c.urlParams_.Set("prettyPrint", "false")
  15938. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/referenceImages")
  15939. urls += "?" + c.urlParams_.Encode()
  15940. req, err := http.NewRequest("POST", urls, body)
  15941. if err != nil {
  15942. return nil, err
  15943. }
  15944. req.Header = reqHeaders
  15945. googleapi.Expand(req.URL, map[string]string{
  15946. "parent": c.parent,
  15947. })
  15948. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15949. }
  15950. // Do executes the "vision.projects.locations.products.referenceImages.create" call.
  15951. // Exactly one of *ReferenceImage or error will be non-nil. Any non-2xx
  15952. // status code is an error. Response headers are in either
  15953. // *ReferenceImage.ServerResponse.Header or (if a response was returned
  15954. // at all) in error.(*googleapi.Error).Header. Use
  15955. // googleapi.IsNotModified to check whether the returned error was
  15956. // because http.StatusNotModified was returned.
  15957. func (c *ProjectsLocationsProductsReferenceImagesCreateCall) Do(opts ...googleapi.CallOption) (*ReferenceImage, error) {
  15958. gensupport.SetOptions(c.urlParams_, opts...)
  15959. res, err := c.doRequest("json")
  15960. if res != nil && res.StatusCode == http.StatusNotModified {
  15961. if res.Body != nil {
  15962. res.Body.Close()
  15963. }
  15964. return nil, &googleapi.Error{
  15965. Code: res.StatusCode,
  15966. Header: res.Header,
  15967. }
  15968. }
  15969. if err != nil {
  15970. return nil, err
  15971. }
  15972. defer googleapi.CloseBody(res)
  15973. if err := googleapi.CheckResponse(res); err != nil {
  15974. return nil, err
  15975. }
  15976. ret := &ReferenceImage{
  15977. ServerResponse: googleapi.ServerResponse{
  15978. Header: res.Header,
  15979. HTTPStatusCode: res.StatusCode,
  15980. },
  15981. }
  15982. target := &ret
  15983. if err := gensupport.DecodeResponse(target, res); err != nil {
  15984. return nil, err
  15985. }
  15986. return ret, nil
  15987. // {
  15988. // "description": "Creates and returns a new ReferenceImage resource.\n\nThe `bounding_poly` field is optional. If `bounding_poly` is not specified,\nthe system will try to detect regions of interest in the image that are\ncompatible with the product_category on the parent product. If it is\nspecified, detection is ALWAYS skipped. The system converts polygons into\nnon-rotated rectangles.\n\nNote that the pipeline will resize the image if the image resolution is too\nlarge to process (above 50MP).\n\nPossible errors:\n\n* Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096\n characters.\n* Returns INVALID_ARGUMENT if the product does not exist.\n* Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing\n compatible with the parent product's product_category is detected.\n* Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.",
  15989. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/products/{productsId}/referenceImages",
  15990. // "httpMethod": "POST",
  15991. // "id": "vision.projects.locations.products.referenceImages.create",
  15992. // "parameterOrder": [
  15993. // "parent"
  15994. // ],
  15995. // "parameters": {
  15996. // "parent": {
  15997. // "description": "Resource name of the product in which to create the reference image.\n\nFormat is\n`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.",
  15998. // "location": "path",
  15999. // "pattern": "^projects/[^/]+/locations/[^/]+/products/[^/]+$",
  16000. // "required": true,
  16001. // "type": "string"
  16002. // },
  16003. // "referenceImageId": {
  16004. // "description": "A user-supplied resource id for the ReferenceImage to be added. If set,\nthe server will attempt to use this value as the resource id. If it is\nalready in use, an error is returned with code ALREADY_EXISTS. Must be at\nmost 128 characters long. It cannot contain the character `/`.",
  16005. // "location": "query",
  16006. // "type": "string"
  16007. // }
  16008. // },
  16009. // "path": "v1/{+parent}/referenceImages",
  16010. // "request": {
  16011. // "$ref": "ReferenceImage"
  16012. // },
  16013. // "response": {
  16014. // "$ref": "ReferenceImage"
  16015. // },
  16016. // "scopes": [
  16017. // "https://www.googleapis.com/auth/cloud-platform",
  16018. // "https://www.googleapis.com/auth/cloud-vision"
  16019. // ]
  16020. // }
  16021. }
  16022. // method id "vision.projects.locations.products.referenceImages.delete":
  16023. type ProjectsLocationsProductsReferenceImagesDeleteCall struct {
  16024. s *Service
  16025. name string
  16026. urlParams_ gensupport.URLParams
  16027. ctx_ context.Context
  16028. header_ http.Header
  16029. }
  16030. // Delete: Permanently deletes a reference image.
  16031. //
  16032. // The image metadata will be deleted right away, but search
  16033. // queries
  16034. // against ProductSets containing the image may still work until all
  16035. // related
  16036. // caches are refreshed.
  16037. //
  16038. // The actual image files are not deleted from Google Cloud
  16039. // Storage.
  16040. //
  16041. // Possible errors:
  16042. //
  16043. // * Returns NOT_FOUND if the reference image does not exist.
  16044. func (r *ProjectsLocationsProductsReferenceImagesService) Delete(name string) *ProjectsLocationsProductsReferenceImagesDeleteCall {
  16045. c := &ProjectsLocationsProductsReferenceImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16046. c.name = name
  16047. return c
  16048. }
  16049. // Fields allows partial responses to be retrieved. See
  16050. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16051. // for more information.
  16052. func (c *ProjectsLocationsProductsReferenceImagesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductsReferenceImagesDeleteCall {
  16053. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16054. return c
  16055. }
  16056. // Context sets the context to be used in this call's Do method. Any
  16057. // pending HTTP request will be aborted if the provided context is
  16058. // canceled.
  16059. func (c *ProjectsLocationsProductsReferenceImagesDeleteCall) Context(ctx context.Context) *ProjectsLocationsProductsReferenceImagesDeleteCall {
  16060. c.ctx_ = ctx
  16061. return c
  16062. }
  16063. // Header returns an http.Header that can be modified by the caller to
  16064. // add HTTP headers to the request.
  16065. func (c *ProjectsLocationsProductsReferenceImagesDeleteCall) Header() http.Header {
  16066. if c.header_ == nil {
  16067. c.header_ = make(http.Header)
  16068. }
  16069. return c.header_
  16070. }
  16071. func (c *ProjectsLocationsProductsReferenceImagesDeleteCall) doRequest(alt string) (*http.Response, error) {
  16072. reqHeaders := make(http.Header)
  16073. for k, v := range c.header_ {
  16074. reqHeaders[k] = v
  16075. }
  16076. reqHeaders.Set("User-Agent", c.s.userAgent())
  16077. var body io.Reader = nil
  16078. c.urlParams_.Set("alt", alt)
  16079. c.urlParams_.Set("prettyPrint", "false")
  16080. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  16081. urls += "?" + c.urlParams_.Encode()
  16082. req, err := http.NewRequest("DELETE", urls, body)
  16083. if err != nil {
  16084. return nil, err
  16085. }
  16086. req.Header = reqHeaders
  16087. googleapi.Expand(req.URL, map[string]string{
  16088. "name": c.name,
  16089. })
  16090. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16091. }
  16092. // Do executes the "vision.projects.locations.products.referenceImages.delete" call.
  16093. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  16094. // code is an error. Response headers are in either
  16095. // *Empty.ServerResponse.Header or (if a response was returned at all)
  16096. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  16097. // check whether the returned error was because http.StatusNotModified
  16098. // was returned.
  16099. func (c *ProjectsLocationsProductsReferenceImagesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  16100. gensupport.SetOptions(c.urlParams_, opts...)
  16101. res, err := c.doRequest("json")
  16102. if res != nil && res.StatusCode == http.StatusNotModified {
  16103. if res.Body != nil {
  16104. res.Body.Close()
  16105. }
  16106. return nil, &googleapi.Error{
  16107. Code: res.StatusCode,
  16108. Header: res.Header,
  16109. }
  16110. }
  16111. if err != nil {
  16112. return nil, err
  16113. }
  16114. defer googleapi.CloseBody(res)
  16115. if err := googleapi.CheckResponse(res); err != nil {
  16116. return nil, err
  16117. }
  16118. ret := &Empty{
  16119. ServerResponse: googleapi.ServerResponse{
  16120. Header: res.Header,
  16121. HTTPStatusCode: res.StatusCode,
  16122. },
  16123. }
  16124. target := &ret
  16125. if err := gensupport.DecodeResponse(target, res); err != nil {
  16126. return nil, err
  16127. }
  16128. return ret, nil
  16129. // {
  16130. // "description": "Permanently deletes a reference image.\n\nThe image metadata will be deleted right away, but search queries\nagainst ProductSets containing the image may still work until all related\ncaches are refreshed.\n\nThe actual image files are not deleted from Google Cloud Storage.\n\nPossible errors:\n\n* Returns NOT_FOUND if the reference image does not exist.",
  16131. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/products/{productsId}/referenceImages/{referenceImagesId}",
  16132. // "httpMethod": "DELETE",
  16133. // "id": "vision.projects.locations.products.referenceImages.delete",
  16134. // "parameterOrder": [
  16135. // "name"
  16136. // ],
  16137. // "parameters": {
  16138. // "name": {
  16139. // "description": "The resource name of the reference image to delete.\n\nFormat is:\n\n`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`",
  16140. // "location": "path",
  16141. // "pattern": "^projects/[^/]+/locations/[^/]+/products/[^/]+/referenceImages/[^/]+$",
  16142. // "required": true,
  16143. // "type": "string"
  16144. // }
  16145. // },
  16146. // "path": "v1/{+name}",
  16147. // "response": {
  16148. // "$ref": "Empty"
  16149. // },
  16150. // "scopes": [
  16151. // "https://www.googleapis.com/auth/cloud-platform",
  16152. // "https://www.googleapis.com/auth/cloud-vision"
  16153. // ]
  16154. // }
  16155. }
  16156. // method id "vision.projects.locations.products.referenceImages.get":
  16157. type ProjectsLocationsProductsReferenceImagesGetCall struct {
  16158. s *Service
  16159. name string
  16160. urlParams_ gensupport.URLParams
  16161. ifNoneMatch_ string
  16162. ctx_ context.Context
  16163. header_ http.Header
  16164. }
  16165. // Get: Gets information associated with a ReferenceImage.
  16166. //
  16167. // Possible errors:
  16168. //
  16169. // * Returns NOT_FOUND if the specified image does not exist.
  16170. func (r *ProjectsLocationsProductsReferenceImagesService) Get(name string) *ProjectsLocationsProductsReferenceImagesGetCall {
  16171. c := &ProjectsLocationsProductsReferenceImagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16172. c.name = name
  16173. return c
  16174. }
  16175. // Fields allows partial responses to be retrieved. See
  16176. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16177. // for more information.
  16178. func (c *ProjectsLocationsProductsReferenceImagesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductsReferenceImagesGetCall {
  16179. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16180. return c
  16181. }
  16182. // IfNoneMatch sets the optional parameter which makes the operation
  16183. // fail if the object's ETag matches the given value. This is useful for
  16184. // getting updates only after the object has changed since the last
  16185. // request. Use googleapi.IsNotModified to check whether the response
  16186. // error from Do is the result of In-None-Match.
  16187. func (c *ProjectsLocationsProductsReferenceImagesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsProductsReferenceImagesGetCall {
  16188. c.ifNoneMatch_ = entityTag
  16189. return c
  16190. }
  16191. // Context sets the context to be used in this call's Do method. Any
  16192. // pending HTTP request will be aborted if the provided context is
  16193. // canceled.
  16194. func (c *ProjectsLocationsProductsReferenceImagesGetCall) Context(ctx context.Context) *ProjectsLocationsProductsReferenceImagesGetCall {
  16195. c.ctx_ = ctx
  16196. return c
  16197. }
  16198. // Header returns an http.Header that can be modified by the caller to
  16199. // add HTTP headers to the request.
  16200. func (c *ProjectsLocationsProductsReferenceImagesGetCall) Header() http.Header {
  16201. if c.header_ == nil {
  16202. c.header_ = make(http.Header)
  16203. }
  16204. return c.header_
  16205. }
  16206. func (c *ProjectsLocationsProductsReferenceImagesGetCall) doRequest(alt string) (*http.Response, error) {
  16207. reqHeaders := make(http.Header)
  16208. for k, v := range c.header_ {
  16209. reqHeaders[k] = v
  16210. }
  16211. reqHeaders.Set("User-Agent", c.s.userAgent())
  16212. if c.ifNoneMatch_ != "" {
  16213. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16214. }
  16215. var body io.Reader = nil
  16216. c.urlParams_.Set("alt", alt)
  16217. c.urlParams_.Set("prettyPrint", "false")
  16218. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  16219. urls += "?" + c.urlParams_.Encode()
  16220. req, err := http.NewRequest("GET", urls, body)
  16221. if err != nil {
  16222. return nil, err
  16223. }
  16224. req.Header = reqHeaders
  16225. googleapi.Expand(req.URL, map[string]string{
  16226. "name": c.name,
  16227. })
  16228. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16229. }
  16230. // Do executes the "vision.projects.locations.products.referenceImages.get" call.
  16231. // Exactly one of *ReferenceImage or error will be non-nil. Any non-2xx
  16232. // status code is an error. Response headers are in either
  16233. // *ReferenceImage.ServerResponse.Header or (if a response was returned
  16234. // at all) in error.(*googleapi.Error).Header. Use
  16235. // googleapi.IsNotModified to check whether the returned error was
  16236. // because http.StatusNotModified was returned.
  16237. func (c *ProjectsLocationsProductsReferenceImagesGetCall) Do(opts ...googleapi.CallOption) (*ReferenceImage, error) {
  16238. gensupport.SetOptions(c.urlParams_, opts...)
  16239. res, err := c.doRequest("json")
  16240. if res != nil && res.StatusCode == http.StatusNotModified {
  16241. if res.Body != nil {
  16242. res.Body.Close()
  16243. }
  16244. return nil, &googleapi.Error{
  16245. Code: res.StatusCode,
  16246. Header: res.Header,
  16247. }
  16248. }
  16249. if err != nil {
  16250. return nil, err
  16251. }
  16252. defer googleapi.CloseBody(res)
  16253. if err := googleapi.CheckResponse(res); err != nil {
  16254. return nil, err
  16255. }
  16256. ret := &ReferenceImage{
  16257. ServerResponse: googleapi.ServerResponse{
  16258. Header: res.Header,
  16259. HTTPStatusCode: res.StatusCode,
  16260. },
  16261. }
  16262. target := &ret
  16263. if err := gensupport.DecodeResponse(target, res); err != nil {
  16264. return nil, err
  16265. }
  16266. return ret, nil
  16267. // {
  16268. // "description": "Gets information associated with a ReferenceImage.\n\nPossible errors:\n\n* Returns NOT_FOUND if the specified image does not exist.",
  16269. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/products/{productsId}/referenceImages/{referenceImagesId}",
  16270. // "httpMethod": "GET",
  16271. // "id": "vision.projects.locations.products.referenceImages.get",
  16272. // "parameterOrder": [
  16273. // "name"
  16274. // ],
  16275. // "parameters": {
  16276. // "name": {
  16277. // "description": "The resource name of the ReferenceImage to get.\n\nFormat is:\n\n`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.",
  16278. // "location": "path",
  16279. // "pattern": "^projects/[^/]+/locations/[^/]+/products/[^/]+/referenceImages/[^/]+$",
  16280. // "required": true,
  16281. // "type": "string"
  16282. // }
  16283. // },
  16284. // "path": "v1/{+name}",
  16285. // "response": {
  16286. // "$ref": "ReferenceImage"
  16287. // },
  16288. // "scopes": [
  16289. // "https://www.googleapis.com/auth/cloud-platform",
  16290. // "https://www.googleapis.com/auth/cloud-vision"
  16291. // ]
  16292. // }
  16293. }
  16294. // method id "vision.projects.locations.products.referenceImages.list":
  16295. type ProjectsLocationsProductsReferenceImagesListCall struct {
  16296. s *Service
  16297. parent string
  16298. urlParams_ gensupport.URLParams
  16299. ifNoneMatch_ string
  16300. ctx_ context.Context
  16301. header_ http.Header
  16302. }
  16303. // List: Lists reference images.
  16304. //
  16305. // Possible errors:
  16306. //
  16307. // * Returns NOT_FOUND if the parent product does not exist.
  16308. // * Returns INVALID_ARGUMENT if the page_size is greater than 100, or
  16309. // less
  16310. // than 1.
  16311. func (r *ProjectsLocationsProductsReferenceImagesService) List(parent string) *ProjectsLocationsProductsReferenceImagesListCall {
  16312. c := &ProjectsLocationsProductsReferenceImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16313. c.parent = parent
  16314. return c
  16315. }
  16316. // PageSize sets the optional parameter "pageSize": The maximum number
  16317. // of items to return. Default 10, maximum 100.
  16318. func (c *ProjectsLocationsProductsReferenceImagesListCall) PageSize(pageSize int64) *ProjectsLocationsProductsReferenceImagesListCall {
  16319. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  16320. return c
  16321. }
  16322. // PageToken sets the optional parameter "pageToken": A token
  16323. // identifying a page of results to be returned. This is the value
  16324. // of `nextPageToken` returned in a previous reference image list
  16325. // request.
  16326. //
  16327. // Defaults to the first page if not specified.
  16328. func (c *ProjectsLocationsProductsReferenceImagesListCall) PageToken(pageToken string) *ProjectsLocationsProductsReferenceImagesListCall {
  16329. c.urlParams_.Set("pageToken", pageToken)
  16330. return c
  16331. }
  16332. // Fields allows partial responses to be retrieved. See
  16333. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16334. // for more information.
  16335. func (c *ProjectsLocationsProductsReferenceImagesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsProductsReferenceImagesListCall {
  16336. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16337. return c
  16338. }
  16339. // IfNoneMatch sets the optional parameter which makes the operation
  16340. // fail if the object's ETag matches the given value. This is useful for
  16341. // getting updates only after the object has changed since the last
  16342. // request. Use googleapi.IsNotModified to check whether the response
  16343. // error from Do is the result of In-None-Match.
  16344. func (c *ProjectsLocationsProductsReferenceImagesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsProductsReferenceImagesListCall {
  16345. c.ifNoneMatch_ = entityTag
  16346. return c
  16347. }
  16348. // Context sets the context to be used in this call's Do method. Any
  16349. // pending HTTP request will be aborted if the provided context is
  16350. // canceled.
  16351. func (c *ProjectsLocationsProductsReferenceImagesListCall) Context(ctx context.Context) *ProjectsLocationsProductsReferenceImagesListCall {
  16352. c.ctx_ = ctx
  16353. return c
  16354. }
  16355. // Header returns an http.Header that can be modified by the caller to
  16356. // add HTTP headers to the request.
  16357. func (c *ProjectsLocationsProductsReferenceImagesListCall) Header() http.Header {
  16358. if c.header_ == nil {
  16359. c.header_ = make(http.Header)
  16360. }
  16361. return c.header_
  16362. }
  16363. func (c *ProjectsLocationsProductsReferenceImagesListCall) doRequest(alt string) (*http.Response, error) {
  16364. reqHeaders := make(http.Header)
  16365. for k, v := range c.header_ {
  16366. reqHeaders[k] = v
  16367. }
  16368. reqHeaders.Set("User-Agent", c.s.userAgent())
  16369. if c.ifNoneMatch_ != "" {
  16370. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16371. }
  16372. var body io.Reader = nil
  16373. c.urlParams_.Set("alt", alt)
  16374. c.urlParams_.Set("prettyPrint", "false")
  16375. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/referenceImages")
  16376. urls += "?" + c.urlParams_.Encode()
  16377. req, err := http.NewRequest("GET", urls, body)
  16378. if err != nil {
  16379. return nil, err
  16380. }
  16381. req.Header = reqHeaders
  16382. googleapi.Expand(req.URL, map[string]string{
  16383. "parent": c.parent,
  16384. })
  16385. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16386. }
  16387. // Do executes the "vision.projects.locations.products.referenceImages.list" call.
  16388. // Exactly one of *ListReferenceImagesResponse or error will be non-nil.
  16389. // Any non-2xx status code is an error. Response headers are in either
  16390. // *ListReferenceImagesResponse.ServerResponse.Header or (if a response
  16391. // was returned at all) in error.(*googleapi.Error).Header. Use
  16392. // googleapi.IsNotModified to check whether the returned error was
  16393. // because http.StatusNotModified was returned.
  16394. func (c *ProjectsLocationsProductsReferenceImagesListCall) Do(opts ...googleapi.CallOption) (*ListReferenceImagesResponse, error) {
  16395. gensupport.SetOptions(c.urlParams_, opts...)
  16396. res, err := c.doRequest("json")
  16397. if res != nil && res.StatusCode == http.StatusNotModified {
  16398. if res.Body != nil {
  16399. res.Body.Close()
  16400. }
  16401. return nil, &googleapi.Error{
  16402. Code: res.StatusCode,
  16403. Header: res.Header,
  16404. }
  16405. }
  16406. if err != nil {
  16407. return nil, err
  16408. }
  16409. defer googleapi.CloseBody(res)
  16410. if err := googleapi.CheckResponse(res); err != nil {
  16411. return nil, err
  16412. }
  16413. ret := &ListReferenceImagesResponse{
  16414. ServerResponse: googleapi.ServerResponse{
  16415. Header: res.Header,
  16416. HTTPStatusCode: res.StatusCode,
  16417. },
  16418. }
  16419. target := &ret
  16420. if err := gensupport.DecodeResponse(target, res); err != nil {
  16421. return nil, err
  16422. }
  16423. return ret, nil
  16424. // {
  16425. // "description": "Lists reference images.\n\nPossible errors:\n\n* Returns NOT_FOUND if the parent product does not exist.\n* Returns INVALID_ARGUMENT if the page_size is greater than 100, or less\n than 1.",
  16426. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/products/{productsId}/referenceImages",
  16427. // "httpMethod": "GET",
  16428. // "id": "vision.projects.locations.products.referenceImages.list",
  16429. // "parameterOrder": [
  16430. // "parent"
  16431. // ],
  16432. // "parameters": {
  16433. // "pageSize": {
  16434. // "description": "The maximum number of items to return. Default 10, maximum 100.",
  16435. // "format": "int32",
  16436. // "location": "query",
  16437. // "type": "integer"
  16438. // },
  16439. // "pageToken": {
  16440. // "description": "A token identifying a page of results to be returned. This is the value\nof `nextPageToken` returned in a previous reference image list request.\n\nDefaults to the first page if not specified.",
  16441. // "location": "query",
  16442. // "type": "string"
  16443. // },
  16444. // "parent": {
  16445. // "description": "Resource name of the product containing the reference images.\n\nFormat is\n`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.",
  16446. // "location": "path",
  16447. // "pattern": "^projects/[^/]+/locations/[^/]+/products/[^/]+$",
  16448. // "required": true,
  16449. // "type": "string"
  16450. // }
  16451. // },
  16452. // "path": "v1/{+parent}/referenceImages",
  16453. // "response": {
  16454. // "$ref": "ListReferenceImagesResponse"
  16455. // },
  16456. // "scopes": [
  16457. // "https://www.googleapis.com/auth/cloud-platform",
  16458. // "https://www.googleapis.com/auth/cloud-vision"
  16459. // ]
  16460. // }
  16461. }
  16462. // Pages invokes f for each page of results.
  16463. // A non-nil error returned from f will halt the iteration.
  16464. // The provided context supersedes any context provided to the Context method.
  16465. func (c *ProjectsLocationsProductsReferenceImagesListCall) Pages(ctx context.Context, f func(*ListReferenceImagesResponse) error) error {
  16466. c.ctx_ = ctx
  16467. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  16468. for {
  16469. x, err := c.Do()
  16470. if err != nil {
  16471. return err
  16472. }
  16473. if err := f(x); err != nil {
  16474. return err
  16475. }
  16476. if x.NextPageToken == "" {
  16477. return nil
  16478. }
  16479. c.PageToken(x.NextPageToken)
  16480. }
  16481. }