From da48b9ae7467e36f5d664f0afc4b88f1db0f1e57 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 18 Jan 2023 15:18:49 -0800 Subject: [PATCH] feat(all): auto-regenerate discovery clients (#1816) --- androidpublisher/v3/androidpublisher-api.json | 4 +- androidpublisher/v3/androidpublisher-gen.go | 2 +- api-list.json | 26 +- classroom/v1/classroom-api.json | 4 +- classroom/v1/classroom-gen.go | 7 +- cloudasset/v1/cloudasset-api.json | 108 +- cloudasset/v1/cloudasset-gen.go | 418 +- cloudasset/v1beta1/cloudasset-api.json | 28 +- cloudasset/v1beta1/cloudasset-gen.go | 78 +- cloudasset/v1p1beta1/cloudasset-api.json | 32 +- cloudasset/v1p1beta1/cloudasset-gen.go | 98 +- cloudasset/v1p5beta1/cloudasset-api.json | 28 +- cloudasset/v1p5beta1/cloudasset-gen.go | 80 +- cloudasset/v1p7beta1/cloudasset-api.json | 26 +- cloudasset/v1p7beta1/cloudasset-gen.go | 58 +- content/v2.1/content-api.json | 21 +- content/v2.1/content-gen.go | 19 +- dlp/v2/dlp-api.json | 42 +- dlp/v2/dlp-gen.go | 44 +- documentai/v1/documentai-api.json | 451 +- documentai/v1/documentai-gen.go | 10490 +++++++++------- documentai/v1beta2/documentai-api.json | 37 +- documentai/v1beta2/documentai-gen.go | 51 + documentai/v1beta3/documentai-api.json | 64 +- documentai/v1beta3/documentai-gen.go | 97 + integrations/v1alpha/integrations-api.json | 110 +- integrations/v1alpha/integrations-gen.go | 533 + kmsinventory/v1/kmsinventory-api.json | 794 ++ kmsinventory/v1/kmsinventory-gen.go | 1499 +++ .../v1/mybusinessaccountmanagement-api.json | 4 +- .../v1/mybusinessaccountmanagement-gen.go | 2 +- orgpolicy/v2/orgpolicy-api.json | 24 +- orgpolicy/v2/orgpolicy-gen.go | 50 + .../v1alpha1/playdeveloperreporting-api.json | 76 +- .../v1alpha1/playdeveloperreporting-gen.go | 77 +- .../v1beta1/playdeveloperreporting-api.json | 56 +- .../v1beta1/playdeveloperreporting-gen.go | 57 +- securitycenter/v1/securitycenter-api.json | 18 +- securitycenter/v1/securitycenter-gen.go | 55 +- .../v1beta1/securitycenter-api.json | 6 +- securitycenter/v1beta1/securitycenter-gen.go | 13 +- .../v1/servicenetworking-api.json | 6 +- servicenetworking/v1/servicenetworking-gen.go | 7 + .../v1/streetviewpublish-api.json | 33 +- streetviewpublish/v1/streetviewpublish-gen.go | 41 + tpu/v2/tpu-api.json | 6 +- tpu/v2/tpu-gen.go | 4 +- 47 files changed, 10503 insertions(+), 5281 deletions(-) create mode 100644 kmsinventory/v1/kmsinventory-api.json create mode 100644 kmsinventory/v1/kmsinventory-gen.go diff --git a/androidpublisher/v3/androidpublisher-api.json b/androidpublisher/v3/androidpublisher-api.json index 403a7951548..321aacc36fc 100644 --- a/androidpublisher/v3/androidpublisher-api.json +++ b/androidpublisher/v3/androidpublisher-api.json @@ -632,7 +632,7 @@ "accept": [ "application/octet-stream" ], - "maxSize": "629145600", + "maxSize": "838860800", "protocols": { "resumable": { "multipart": true, @@ -3920,7 +3920,7 @@ } } }, - "revision": "20221108", + "revision": "20230117", "rootUrl": "https://androidpublisher.googleapis.com/", "schemas": { "AcquisitionTargetingRule": { diff --git a/androidpublisher/v3/androidpublisher-gen.go b/androidpublisher/v3/androidpublisher-gen.go index c53a5fd134e..de6f2438257 100644 --- a/androidpublisher/v3/androidpublisher-gen.go +++ b/androidpublisher/v3/androidpublisher-gen.go @@ -8508,7 +8508,7 @@ func (c *EditsDeobfuscationfilesUploadCall) Do(opts ...googleapi.CallOption) (*D // "accept": [ // "application/octet-stream" // ], - // "maxSize": "629145600", + // "maxSize": "838860800", // "protocols": { // "resumable": { // "multipart": true, diff --git a/api-list.json b/api-list.json index 93370c2e8a8..45cf9d847b0 100644 --- a/api-list.json +++ b/api-list.json @@ -997,7 +997,7 @@ "name": "cloudasset", "version": "v1p1beta1", "title": "Cloud Asset API", - "description": "The cloud asset API manages the history and inventory of cloud resources.", + "description": "The Cloud Asset API manages the history and inventory of Google Cloud resources.", "discoveryRestUrl": "https://cloudasset.googleapis.com/$discovery/rest?version=v1p1beta1", "icons": { "x16": "https://www.gstatic.com/images/branding/product/1x/googleg_16dp.png", @@ -1012,7 +1012,7 @@ "name": "cloudasset", "version": "v1p5beta1", "title": "Cloud Asset API", - "description": "The cloud asset API manages the history and inventory of cloud resources.", + "description": "The Cloud Asset API manages the history and inventory of Google Cloud resources.", "discoveryRestUrl": "https://cloudasset.googleapis.com/$discovery/rest?version=v1p5beta1", "icons": { "x16": "https://www.gstatic.com/images/branding/product/1x/googleg_16dp.png", @@ -1027,7 +1027,7 @@ "name": "cloudasset", "version": "v1p7beta1", "title": "Cloud Asset API", - "description": "The cloud asset API manages the history and inventory of cloud resources.", + "description": "The Cloud Asset API manages the history and inventory of Google Cloud resources.", "discoveryRestUrl": "https://cloudasset.googleapis.com/$discovery/rest?version=v1p7beta1", "icons": { "x16": "https://www.gstatic.com/images/branding/product/1x/googleg_16dp.png", @@ -1042,7 +1042,7 @@ "name": "cloudasset", "version": "v1beta1", "title": "Cloud Asset API", - "description": "The cloud asset API manages the history and inventory of cloud resources.", + "description": "The Cloud Asset API manages the history and inventory of Google Cloud resources.", "discoveryRestUrl": "https://cloudasset.googleapis.com/$discovery/rest?version=v1beta1", "icons": { "x16": "https://www.gstatic.com/images/branding/product/1x/googleg_16dp.png", @@ -1057,7 +1057,7 @@ "name": "cloudasset", "version": "v1", "title": "Cloud Asset API", - "description": "The cloud asset API manages the history and inventory of cloud resources.", + "description": "The Cloud Asset API manages the history and inventory of Google Cloud resources.", "discoveryRestUrl": "https://cloudasset.googleapis.com/$discovery/rest?version=v1", "icons": { "x16": "https://www.gstatic.com/images/branding/product/1x/googleg_16dp.png", @@ -3548,18 +3548,18 @@ }, { "kind": "discovery#directoryItem", - "id": "language:v1beta1", - "name": "language", - "version": "v1beta1", - "title": "Cloud Natural Language API", - "description": "Provides natural language understanding technologies, such as sentiment analysis, entity recognition, entity sentiment analysis, and other text annotations, to developers.", - "discoveryRestUrl": "https://language.googleapis.com/$discovery/rest?version=v1beta1", + "id": "kmsinventory:v1", + "name": "kmsinventory", + "version": "v1", + "title": "KMS Inventory API", + "description": "", + "discoveryRestUrl": "https://kmsinventory.googleapis.com/$discovery/rest?version=v1", "icons": { "x16": "https://www.gstatic.com/images/branding/product/1x/googleg_16dp.png", "x32": "https://www.gstatic.com/images/branding/product/1x/googleg_32dp.png" }, - "documentationLink": "https://cloud.google.com/natural-language/", - "preferred": false + "documentationLink": "https://cloud.google.com/kms/", + "preferred": true }, { "kind": "discovery#directoryItem", diff --git a/classroom/v1/classroom-api.json b/classroom/v1/classroom-api.json index bb98886f2d2..28b58da9450 100644 --- a/classroom/v1/classroom-api.json +++ b/classroom/v1/classroom-api.json @@ -170,7 +170,7 @@ "courses": { "methods": { "create": { - "description": "Creates a course. The user specified in `ownerId` is the owner of the created course and added as a teacher. A non-admin requesting user can only create a course with themselves as the owner. Domain admins can create courses owned by any user within their domain. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create courses or for access errors. * `NOT_FOUND` if the primary teacher is not a valid user. * `FAILED_PRECONDITION` if the course owner's account is disabled or for the following request errors: * UserGroupsMembershipLimitReached * `ALREADY_EXISTS` if an alias was specified in the `id` and already exists.", + "description": "Creates a course. The user specified in `ownerId` is the owner of the created course and added as a teacher. A non-admin requesting user can only create a course with themselves as the owner. Domain admins can create courses owned by any user within their domain. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create courses or for access errors. * `NOT_FOUND` if the primary teacher is not a valid user. * `FAILED_PRECONDITION` if the course owner's account is disabled or for the following request errors: * UserCannotOwnCourse * UserGroupsMembershipLimitReached * `ALREADY_EXISTS` if an alias was specified in the `id` and already exists.", "flatPath": "v1/courses", "httpMethod": "POST", "id": "classroom.courses.create", @@ -2400,7 +2400,7 @@ } } }, - "revision": "20221220", + "revision": "20230111", "rootUrl": "https://classroom.googleapis.com/", "schemas": { "Announcement": { diff --git a/classroom/v1/classroom-gen.go b/classroom/v1/classroom-gen.go index d2136bedce8..9e03ddde651 100644 --- a/classroom/v1/classroom-gen.go +++ b/classroom/v1/classroom-gen.go @@ -3252,8 +3252,9 @@ type CoursesCreateCall struct { // courses or for access errors. * `NOT_FOUND` if the primary teacher is // not a valid user. * `FAILED_PRECONDITION` if the course owner's // account is disabled or for the following request errors: * -// UserGroupsMembershipLimitReached * `ALREADY_EXISTS` if an alias was -// specified in the `id` and already exists. +// UserCannotOwnCourse * UserGroupsMembershipLimitReached * +// `ALREADY_EXISTS` if an alias was specified in the `id` and already +// exists. func (r *CoursesService) Create(course *Course) *CoursesCreateCall { c := &CoursesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.course = course @@ -3348,7 +3349,7 @@ func (c *CoursesCreateCall) Do(opts ...googleapi.CallOption) (*Course, error) { } return ret, nil // { - // "description": "Creates a course. The user specified in `ownerId` is the owner of the created course and added as a teacher. A non-admin requesting user can only create a course with themselves as the owner. Domain admins can create courses owned by any user within their domain. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create courses or for access errors. * `NOT_FOUND` if the primary teacher is not a valid user. * `FAILED_PRECONDITION` if the course owner's account is disabled or for the following request errors: * UserGroupsMembershipLimitReached * `ALREADY_EXISTS` if an alias was specified in the `id` and already exists.", + // "description": "Creates a course. The user specified in `ownerId` is the owner of the created course and added as a teacher. A non-admin requesting user can only create a course with themselves as the owner. Domain admins can create courses owned by any user within their domain. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create courses or for access errors. * `NOT_FOUND` if the primary teacher is not a valid user. * `FAILED_PRECONDITION` if the course owner's account is disabled or for the following request errors: * UserCannotOwnCourse * UserGroupsMembershipLimitReached * `ALREADY_EXISTS` if an alias was specified in the `id` and already exists.", // "flatPath": "v1/courses", // "httpMethod": "POST", // "id": "classroom.courses.create", diff --git a/cloudasset/v1/cloudasset-api.json b/cloudasset/v1/cloudasset-api.json index 23945237dde..96ed22a491f 100644 --- a/cloudasset/v1/cloudasset-api.json +++ b/cloudasset/v1/cloudasset-api.json @@ -12,7 +12,7 @@ "baseUrl": "https://cloudasset.googleapis.com/", "batchPath": "batch", "canonicalName": "Cloud Asset", - "description": "The cloud asset API manages the history and inventory of cloud resources.", + "description": "The Cloud Asset API manages the history and inventory of Google Cloud resources.", "discoveryVersion": "v1", "documentationLink": "https://cloud.google.com/asset-inventory/docs/quickstart", "fullyEncodeReservedExpansion": true, @@ -137,8 +137,8 @@ "Unspecified content type.", "Resource metadata.", "The actual IAM policy set on a resource.", - "The Cloud Organization Policy set on an asset.", - "The Cloud Access context manager Policy set on an asset.", + "The organization policy set on an asset.", + "The Access Context Manager policy set on an asset.", "The runtime OS Inventory information.", "The related resources." ], @@ -404,7 +404,7 @@ "type": "string" }, "savedQueryId": { - "description": "Required. The ID to use for the saved query, which must be unique in the specified parent. It will become the final component of the saved query's resource name. This value should be 4-63 characters, and valid characters are /a-z-/. Notice that this field is required in the saved query creation, and the `name` field of the `saved_query` will be ignored.", + "description": "Required. The ID to use for the saved query, which must be unique in the specified parent. It will become the final component of the saved query's resource name. This value should be 4-63 characters, and valid characters are `a-z-`. Notice that this field is required in the saved query creation, and the `name` field of the `saved_query` will be ignored.", "location": "query", "type": "string" } @@ -582,7 +582,7 @@ "type": "string" }, "analysisQuery.options.analyzeServiceAccountImpersonation": { - "description": "Optional. If true, the response will include access analysis from identities to resources via service account impersonation. This is a very expensive operation, because many derived queries will be executed. We highly recommend you use AssetService.AnalyzeIamPolicyLongrunning rpc instead. For example, if the request analyzes for which resources user A has permission P, and there's an IAM policy states user A has iam.serviceAccounts.getAccessToken permission to a service account SA, and there's another IAM policy states service account SA has permission P to a GCP folder F, then user A potentially has access to the GCP folder F. And those advanced analysis results will be included in AnalyzeIamPolicyResponse.service_account_impersonation_analysis. Another example, if the request analyzes for who has permission P to a GCP folder F, and there's an IAM policy states user A has iam.serviceAccounts.actAs permission to a service account SA, and there's another IAM policy states service account SA has permission P to the GCP folder F, then user A potentially has access to the GCP folder F. And those advanced analysis results will be included in AnalyzeIamPolicyResponse.service_account_impersonation_analysis. Only the following permissions are considered in this analysis: * `iam.serviceAccounts.actAs` * `iam.serviceAccounts.signBlob` * `iam.serviceAccounts.signJwt` * `iam.serviceAccounts.getAccessToken` * `iam.serviceAccounts.getOpenIdToken` * `iam.serviceAccounts.implicitDelegation` Default is false.", + "description": "Optional. If true, the response will include access analysis from identities to resources via service account impersonation. This is a very expensive operation, because many derived queries will be executed. We highly recommend you use AssetService.AnalyzeIamPolicyLongrunning RPC instead. For example, if the request analyzes for which resources user A has permission P, and there's an IAM policy states user A has iam.serviceAccounts.getAccessToken permission to a service account SA, and there's another IAM policy states service account SA has permission P to a Google Cloud folder F, then user A potentially has access to the Google Cloud folder F. And those advanced analysis results will be included in AnalyzeIamPolicyResponse.service_account_impersonation_analysis. Another example, if the request analyzes for who has permission P to a Google Cloud folder F, and there's an IAM policy states user A has iam.serviceAccounts.actAs permission to a service account SA, and there's another IAM policy states service account SA has permission P to the Google Cloud folder F, then user A potentially has access to the Google Cloud folder F. And those advanced analysis results will be included in AnalyzeIamPolicyResponse.service_account_impersonation_analysis. Only the following permissions are considered in this analysis: * `iam.serviceAccounts.actAs` * `iam.serviceAccounts.signBlob` * `iam.serviceAccounts.signJwt` * `iam.serviceAccounts.getAccessToken` * `iam.serviceAccounts.getOpenIdToken` * `iam.serviceAccounts.implicitDelegation` Default is false.", "location": "query", "type": "boolean" }, @@ -592,7 +592,7 @@ "type": "boolean" }, "analysisQuery.options.expandResources": { - "description": "Optional. If true and IamPolicyAnalysisQuery.resource_selector is not specified, the resource section of the result will expand any resource attached to an IAM policy to include resources lower in the resource hierarchy. For example, if the request analyzes for which resources user A has permission P, and the results include an IAM policy with P on a GCP folder, the results will also include resources in that folder with permission P. If true and IamPolicyAnalysisQuery.resource_selector is specified, the resource section of the result will expand the specified resource to include resources lower in the resource hierarchy. Only project or lower resources are supported. Folder and organization resource cannot be used together with this option. For example, if the request analyzes for which users have permission P on a GCP project with this option enabled, the results will include all users who have permission P on that project or any lower resource. If true, the default max expansion per resource is 1000 for AssetService.AnalyzeIamPolicy][] and 100000 for AssetService.AnalyzeIamPolicyLongrunning][]. Default is false.", + "description": "Optional. If true and IamPolicyAnalysisQuery.resource_selector is not specified, the resource section of the result will expand any resource attached to an IAM policy to include resources lower in the resource hierarchy. For example, if the request analyzes for which resources user A has permission P, and the results include an IAM policy with P on a Google Cloud folder, the results will also include resources in that folder with permission P. If true and IamPolicyAnalysisQuery.resource_selector is specified, the resource section of the result will expand the specified resource to include resources lower in the resource hierarchy. Only project or lower resources are supported. Folder and organization resources cannot be used together with this option. For example, if the request analyzes for which users have permission P on a Google Cloud project with this option enabled, the results will include all users who have permission P on that project or any lower resource. If true, the default max expansion per resource is 1000 for AssetService.AnalyzeIamPolicy][] and 100000 for AssetService.AnalyzeIamPolicyLongrunning][]. Default is false.", "location": "query", "type": "boolean" }, @@ -681,12 +681,12 @@ ], "parameters": { "destinationParent": { - "description": "Required. Name of the GCP Folder or Organization to reparent the target resource. The analysis will be performed against hypothetically moving the resource to this specified desitination parent. This can only be a Folder number (such as \"folders/123\") or an Organization number (such as \"organizations/123\").", + "description": "Required. Name of the Google Cloud folder or organization to reparent the target resource. The analysis will be performed against hypothetically moving the resource to this specified desitination parent. This can only be a folder number (such as \"folders/123\") or an organization number (such as \"organizations/123\").", "location": "query", "type": "string" }, "resource": { - "description": "Required. Name of the resource to perform the analysis against. Only GCP Project are supported as of today. Hence, this can only be Project ID (such as \"projects/my-project-id\") or a Project Number (such as \"projects/12345\").", + "description": "Required. Name of the resource to perform the analysis against. Only Google Cloud projects are supported as of today. Hence, this can only be a project ID (such as \"projects/my-project-id\") or a project number (such as \"projects/12345\").", "location": "path", "pattern": "^[^/]+/[^/]+$", "required": true, @@ -763,7 +763,7 @@ ] }, "analyzeOrgPolicyGovernedAssets": { - "description": "Analyzes organization policies governed assets (GCP resources or policies) under a scope. This RPC supports custom constraints and the following 10 canned constraints: * storage.uniformBucketLevelAccess * iam.disableServiceAccountKeyCreation * iam.allowedPolicyMemberDomains * compute.vmExternalIpAccess * appengine.enforceServiceAccountActAsCheck * gcp.resourceLocations * compute.trustedImageProjects * compute.skipDefaultNetworkCreation * compute.requireOsLogin * compute.disableNestedVirtualization This RPC only returns either resources of types supported by [searchable asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types), or IAM policies.", + "description": "Analyzes organization policies governed assets (Google Cloud resources or policies) under a scope. This RPC supports custom constraints and the following 10 canned constraints: * storage.uniformBucketLevelAccess * iam.disableServiceAccountKeyCreation * iam.allowedPolicyMemberDomains * compute.vmExternalIpAccess * appengine.enforceServiceAccountActAsCheck * gcp.resourceLocations * compute.trustedImageProjects * compute.skipDefaultNetworkCreation * compute.requireOsLogin * compute.disableNestedVirtualization This RPC only returns either resources of types supported by [searchable asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types), or IAM policies.", "flatPath": "v1/{v1Id}/{v1Id1}:analyzeOrgPolicyGovernedAssets", "httpMethod": "GET", "id": "cloudasset.analyzeOrgPolicyGovernedAssets", @@ -884,8 +884,8 @@ "Unspecified content type.", "Resource metadata.", "The actual IAM policy set on a resource.", - "The Cloud Organization Policy set on an asset.", - "The Cloud Access context manager Policy set on an asset.", + "The organization policy set on an asset.", + "The Access Context Manager policy set on an asset.", "The runtime OS Inventory information.", "The related resources." ], @@ -1014,7 +1014,7 @@ "type": "string" }, "query": { - "description": "Optional. The query statement. See [how to construct a query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) for more information. If not specified or empty, it will search all the IAM policies within the specified `scope`. Note that the query string is compared against each Cloud IAM policy binding, including its principals, roles, and Cloud IAM conditions. The returned Cloud IAM policies will only contain the bindings that match your query. To learn more about the IAM policy structure, see the [IAM policy documentation](https://cloud.google.com/iam/help/allow-policies/structure). Examples: * `policy:amy@gmail.com` to find IAM policy bindings that specify user \"amy@gmail.com\". * `policy:roles/compute.admin` to find IAM policy bindings that specify the Compute Admin role. * `policy:comp*` to find IAM policy bindings that contain \"comp\" as a prefix of any word in the binding. * `policy.role.permissions:storage.buckets.update` to find IAM policy bindings that specify a role containing \"storage.buckets.update\" permission. Note that if callers don't have `iam.roles.get` access to a role's included permissions, policy bindings that specify this role will be dropped from the search results. * `policy.role.permissions:upd*` to find IAM policy bindings that specify a role containing \"upd\" as a prefix of any word in the role permission. Note that if callers don't have `iam.roles.get` access to a role's included permissions, policy bindings that specify this role will be dropped from the search results. * `resource:organizations/123456` to find IAM policy bindings that are set on \"organizations/123456\". * `resource=//cloudresourcemanager.googleapis.com/projects/myproject` to find IAM policy bindings that are set on the project named \"myproject\". * `Important` to find IAM policy bindings that contain \"Important\" as a word in any of the searchable fields (except for the included permissions). * `resource:(instance1 OR instance2) policy:amy` to find IAM policy bindings that are set on resources \"instance1\" or \"instance2\" and also specify user \"amy\". * `roles:roles/compute.admin` to find IAM policy bindings that specify the Compute Admin role. * `memberTypes:user` to find IAM policy bindings that contain the principal type \"user\".", + "description": "Optional. The query statement. See [how to construct a query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) for more information. If not specified or empty, it will search all the IAM policies within the specified `scope`. Note that the query string is compared against each IAM policy binding, including its principals, roles, and IAM conditions. The returned IAM policies will only contain the bindings that match your query. To learn more about the IAM policy structure, see the [IAM policy documentation](https://cloud.google.com/iam/help/allow-policies/structure). Examples: * `policy:amy@gmail.com` to find IAM policy bindings that specify user \"amy@gmail.com\". * `policy:roles/compute.admin` to find IAM policy bindings that specify the Compute Admin role. * `policy:comp*` to find IAM policy bindings that contain \"comp\" as a prefix of any word in the binding. * `policy.role.permissions:storage.buckets.update` to find IAM policy bindings that specify a role containing \"storage.buckets.update\" permission. Note that if callers don't have `iam.roles.get` access to a role's included permissions, policy bindings that specify this role will be dropped from the search results. * `policy.role.permissions:upd*` to find IAM policy bindings that specify a role containing \"upd\" as a prefix of any word in the role permission. Note that if callers don't have `iam.roles.get` access to a role's included permissions, policy bindings that specify this role will be dropped from the search results. * `resource:organizations/123456` to find IAM policy bindings that are set on \"organizations/123456\". * `resource=//cloudresourcemanager.googleapis.com/projects/myproject` to find IAM policy bindings that are set on the project named \"myproject\". * `Important` to find IAM policy bindings that contain \"Important\" as a word in any of the searchable fields (except for the included permissions). * `resource:(instance1 OR instance2) policy:amy` to find IAM policy bindings that are set on resources \"instance1\" or \"instance2\" and also specify user \"amy\". * `roles:roles/compute.admin` to find IAM policy bindings that specify the Compute Admin role. * `memberTypes:user` to find IAM policy bindings that contain the principal type \"user\".", "location": "query", "type": "string" }, @@ -1035,7 +1035,7 @@ ] }, "searchAllResources": { - "description": "Searches all Cloud resources within the specified scope, such as a project, folder, or organization. The caller must be granted the `cloudasset.assets.searchAllResources` permission on the desired scope, otherwise the request will be rejected.", + "description": "Searches all Google Cloud resources within the specified scope, such as a project, folder, or organization. The caller must be granted the `cloudasset.assets.searchAllResources` permission on the desired scope, otherwise the request will be rejected.", "flatPath": "v1/{v1Id}/{v1Id1}:searchAllResources", "httpMethod": "GET", "id": "cloudasset.searchAllResources", @@ -1066,12 +1066,12 @@ "type": "string" }, "query": { - "description": "Optional. The query statement. See [how to construct a query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) for more information. If not specified or empty, it will search all the resources within the specified `scope`. Examples: * `name:Important` to find Cloud resources whose name contains \"Important\" as a word. * `name=Important` to find the Cloud resource whose name is exactly \"Important\". * `displayName:Impor*` to find Cloud resources whose display name contains \"Impor\" as a prefix of any word in the field. * `location:us-west*` to find Cloud resources whose location contains both \"us\" and \"west\" as prefixes. * `labels:prod` to find Cloud resources whose labels contain \"prod\" as a key or value. * `labels.env:prod` to find Cloud resources that have a label \"env\" and its value is \"prod\". * `labels.env:*` to find Cloud resources that have a label \"env\". * `kmsKey:key` to find Cloud resources encrypted with a customer-managed encryption key whose name contains \"key\" as a word. This field is deprecated. Please use the `kmsKeys` field to retrieve KMS key information. * `kmsKeys:key` to find Cloud resources encrypted with customer-managed encryption keys whose name contains the word \"key\". * `relationships:instance-group-1` to find Cloud resources that have relationships with \"instance-group-1\" in the related resource name. * `relationships:INSTANCE_TO_INSTANCEGROUP` to find compute instances that have relationships of type \"INSTANCE_TO_INSTANCEGROUP\". * `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find compute instances that have relationships with \"instance-group-1\" in the compute instance group resource name, for relationship type \"INSTANCE_TO_INSTANCEGROUP\". * `state:ACTIVE` to find Cloud resources whose state contains \"ACTIVE\" as a word. * `NOT state:ACTIVE` to find Cloud resources whose state doesn't contain \"ACTIVE\" as a word. * `createTime\u003c1609459200` to find Cloud resources that were created before \"2021-01-01 00:00:00 UTC\". 1609459200 is the epoch timestamp of \"2021-01-01 00:00:00 UTC\" in seconds. * `updateTime\u003e1609459200` to find Cloud resources that were updated after \"2021-01-01 00:00:00 UTC\". 1609459200 is the epoch timestamp of \"2021-01-01 00:00:00 UTC\" in seconds. * `Important` to find Cloud resources that contain \"Important\" as a word in any of the searchable fields. * `Impor*` to find Cloud resources that contain \"Impor\" as a prefix of any word in any of the searchable fields. * `Important location:(us-west1 OR global)` to find Cloud resources that contain \"Important\" as a word in any of the searchable fields and are also located in the \"us-west1\" region or the \"global\" location.", + "description": "Optional. The query statement. See [how to construct a query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) for more information. If not specified or empty, it will search all the resources within the specified `scope`. Examples: * `name:Important` to find Google Cloud resources whose name contains \"Important\" as a word. * `name=Important` to find the Google Cloud resource whose name is exactly \"Important\". * `displayName:Impor*` to find Google Cloud resources whose display name contains \"Impor\" as a prefix of any word in the field. * `location:us-west*` to find Google Cloud resources whose location contains both \"us\" and \"west\" as prefixes. * `labels:prod` to find Google Cloud resources whose labels contain \"prod\" as a key or value. * `labels.env:prod` to find Google Cloud resources that have a label \"env\" and its value is \"prod\". * `labels.env:*` to find Google Cloud resources that have a label \"env\". * `kmsKey:key` to find Google Cloud resources encrypted with a customer-managed encryption key whose name contains \"key\" as a word. This field is deprecated. Please use the `kmsKeys` field to retrieve Cloud KMS key information. * `kmsKeys:key` to find Google Cloud resources encrypted with customer-managed encryption keys whose name contains the word \"key\". * `relationships:instance-group-1` to find Google Cloud resources that have relationships with \"instance-group-1\" in the related resource name. * `relationships:INSTANCE_TO_INSTANCEGROUP` to find Compute Engine instances that have relationships of type \"INSTANCE_TO_INSTANCEGROUP\". * `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find Compute Engine instances that have relationships with \"instance-group-1\" in the Compute Engine instance group resource name, for relationship type \"INSTANCE_TO_INSTANCEGROUP\". * `state:ACTIVE` to find Google Cloud resources whose state contains \"ACTIVE\" as a word. * `NOT state:ACTIVE` to find Google Cloud resources whose state doesn't contain \"ACTIVE\" as a word. * `createTime\u003c1609459200` to find Google Cloud resources that were created before \"2021-01-01 00:00:00 UTC\". 1609459200 is the epoch timestamp of \"2021-01-01 00:00:00 UTC\" in seconds. * `updateTime\u003e1609459200` to find Google Cloud resources that were updated after \"2021-01-01 00:00:00 UTC\". 1609459200 is the epoch timestamp of \"2021-01-01 00:00:00 UTC\" in seconds. * `Important` to find Google Cloud resources that contain \"Important\" as a word in any of the searchable fields. * `Impor*` to find Google Cloud resources that contain \"Impor\" as a prefix of any word in any of the searchable fields. * `Important location:(us-west1 OR global)` to find Google Cloud resources that contain \"Important\" as a word in any of the searchable fields and are also located in the \"us-west1\" region or the \"global\" location.", "location": "query", "type": "string" }, "readMask": { - "description": "Optional. A comma-separated list of fields specifying which fields to be returned in ResourceSearchResult. Only '*' or combination of top level fields can be specified. Field names of both snake_case and camelCase are supported. Examples: `\"*\"`, `\"name,location\"`, `\"name,versionedResources\"`. The read_mask paths must be valid field paths listed but not limited to (both snake_case and camelCase are supported): * name * assetType * project * displayName * description * location * tagKeys * tagValues * tagValueIds * labels * networkTags * kmsKey (This field is deprecated. Please use the `kmsKeys` field to retrieve KMS key information.) * kmsKeys * createTime * updateTime * state * additionalAttributes * versionedResources If read_mask is not specified, all fields except versionedResources will be returned. If only '*' is specified, all fields including versionedResources will be returned. Any invalid field path will trigger INVALID_ARGUMENT error.", + "description": "Optional. A comma-separated list of fields specifying which fields to be returned in ResourceSearchResult. Only '*' or combination of top level fields can be specified. Field names of both snake_case and camelCase are supported. Examples: `\"*\"`, `\"name,location\"`, `\"name,versionedResources\"`. The read_mask paths must be valid field paths listed but not limited to (both snake_case and camelCase are supported): * name * assetType * project * displayName * description * location * tagKeys * tagValues * tagValueIds * labels * networkTags * kmsKey (This field is deprecated. Please use the `kmsKeys` field to retrieve Cloud KMS key information.) * kmsKeys * createTime * updateTime * state * additionalAttributes * versionedResources If read_mask is not specified, all fields except versionedResources will be returned. If only '*' is specified, all fields including versionedResources will be returned. Any invalid field path will trigger INVALID_ARGUMENT error.", "format": "google-fieldmask", "location": "query", "type": "string" @@ -1095,7 +1095,7 @@ } } }, - "revision": "20221201", + "revision": "20230114", "rootUrl": "https://cloudasset.googleapis.com/", "schemas": { "AccessSelector": { @@ -1120,7 +1120,7 @@ "type": "object" }, "AnalyzeIamPolicyLongrunningMetadata": { - "description": "Represents the metadata of the longrunning operation for the AnalyzeIamPolicyLongrunning rpc.", + "description": "Represents the metadata of the longrunning operation for the AnalyzeIamPolicyLongrunning RPC.", "id": "AnalyzeIamPolicyLongrunningMetadata", "properties": { "createTime": { @@ -1184,7 +1184,7 @@ "id": "AnalyzeMoveResponse", "properties": { "moveAnalysis": { - "description": "The list of analyses returned from performing the intended resource move analysis. The analysis is grouped by different Cloud services.", + "description": "The list of analyses returned from performing the intended resource move analysis. The analysis is grouped by different Google Cloud services.", "items": { "$ref": "MoveAnalysis" }, @@ -1260,7 +1260,7 @@ "type": "object" }, "AnalyzerOrgPolicy": { - "description": "This organization policy message is a modified version of the one defined in the OrgPolicy system. This message contains several fields defined in the original organization policy with some new fields for analysis purpose.", + "description": "This organization policy message is a modified version of the one defined in the Organization Policy system. This message contains several fields defined in the original organization policy with some new fields for analysis purpose.", "id": "AnalyzerOrgPolicy", "properties": { "appliedResource": { @@ -1305,7 +1305,7 @@ "type": "object" }, "Asset": { - "description": "An asset in Google Cloud. An asset can be any resource in the Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy), or a relationship (e.g. an INSTANCE_TO_INSTANCEGROUP relationship). See [Supported asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information.", + "description": "An asset in Google Cloud. An asset can be any resource in the Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. IAM policy), or a relationship (e.g. an INSTANCE_TO_INSTANCEGROUP relationship). See [Supported asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information.", "id": "Asset", "properties": { "accessLevel": { @@ -1329,7 +1329,7 @@ }, "iamPolicy": { "$ref": "Policy", - "description": "A representation of the Cloud IAM policy set on a Google Cloud resource. There can be a maximum of one Cloud IAM policy set on any given resource. In addition, Cloud IAM policies inherit their granted access scope from any policies set on parent resources in the resource hierarchy. Therefore, the effectively policy is the union of both the policy set on this resource and each policy set on all of the resource's ancestry resource levels in the hierarchy. See [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance) for more information." + "description": "A representation of the IAM policy set on a Google Cloud resource. There can be a maximum of one IAM policy set on any given resource. In addition, IAM policies inherit their granted access scope from any policies set on parent resources in the resource hierarchy. Therefore, the effectively policy is the union of both the policy set on this resource and each policy set on all of the resource's ancestry resource levels in the hierarchy. See [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance) for more information." }, "name": { "description": "The full name of the asset. Example: `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` See [Resource names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information.", @@ -1649,8 +1649,8 @@ "Unspecified content type.", "Resource metadata.", "The actual IAM policy set on a resource.", - "The Cloud Organization Policy set on an asset.", - "The Cloud Access context manager Policy set on an asset.", + "The organization policy set on an asset.", + "The Access Context Manager policy set on an asset.", "The runtime OS Inventory information.", "The related resources." ], @@ -1735,8 +1735,8 @@ "Unspecified content type.", "Resource metadata.", "The actual IAM policy set on a resource.", - "The Cloud Organization Policy set on an asset.", - "The Cloud Access context manager Policy set on an asset.", + "The organization policy set on an asset.", + "The Access Context Manager policy set on an asset.", "The runtime OS Inventory information.", "The related resources." ], @@ -1776,11 +1776,11 @@ "id": "GcsDestination", "properties": { "uri": { - "description": "The uri of the Cloud Storage object. It's the same uri that is used by gsutil. Example: \"gs://bucket_name/object_name\". See [Viewing and Editing Object Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) for more information. If the specified Cloud Storage object already exists and there is no [hold](https://cloud.google.com/storage/docs/object-holds), it will be overwritten with the exported result.", + "description": "The URI of the Cloud Storage object. It's the same URI that is used by gsutil. Example: \"gs://bucket_name/object_name\". See [Viewing and Editing Object Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) for more information. If the specified Cloud Storage object already exists and there is no [hold](https://cloud.google.com/storage/docs/object-holds), it will be overwritten with the exported result.", "type": "string" }, "uriPrefix": { - "description": "The uri prefix of all generated Cloud Storage objects. Example: \"gs://bucket_name/object_name_prefix\". Each object uri is in format: \"gs://bucket_name/object_name_prefix// and only contains assets for that type. starts from 0. Example: \"gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0\" is the first shard of output objects containing all compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be returned if file with the same name \"gs://bucket_name/object_name_prefix\" already exists.", + "description": "The URI prefix of all generated Cloud Storage objects. Example: \"gs://bucket_name/object_name_prefix\". Each object URI is in format: \"gs://bucket_name/object_name_prefix// and only contains assets for that type. starts from 0. Example: \"gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0\" is the first shard of output objects containing all compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be returned if file with the same name \"gs://bucket_name/object_name_prefix\" already exists.", "type": "string" } }, @@ -1838,7 +1838,7 @@ "type": "object" }, "GoogleCloudAssetV1AnalyzeOrgPolicyGovernedAssetsResponseGovernedAsset": { - "description": "Represents a GCP asset(resource or IAM policy) governed by the organization policies of the AnalyzeOrgPolicyGovernedAssetsRequest.constraint.", + "description": "Represents a Google Cloud asset(resource or IAM policy) governed by the organization policies of the AnalyzeOrgPolicyGovernedAssetsRequest.constraint.", "id": "GoogleCloudAssetV1AnalyzeOrgPolicyGovernedAssetsResponseGovernedAsset", "properties": { "consolidatedPolicy": { @@ -1851,7 +1851,7 @@ }, "governedResource": { "$ref": "GoogleCloudAssetV1AnalyzeOrgPolicyGovernedAssetsResponseGovernedResource", - "description": "A GCP resource governed by the organization policies of the AnalyzeOrgPolicyGovernedAssetsRequest.constraint." + "description": "A Google Cloud resource governed by the organization policies of the AnalyzeOrgPolicyGovernedAssetsRequest.constraint." }, "policyBundle": { "description": "The ordered list of all organization policies from the AnalyzeOrgPoliciesResponse.OrgPolicyResult.consolidated_policy.attached_resource to the scope specified in the request. If the constraint is defined with default policy, it will also appear in the list.", @@ -1894,7 +1894,7 @@ "type": "object" }, "GoogleCloudAssetV1AnalyzeOrgPolicyGovernedAssetsResponseGovernedResource": { - "description": "The GCP resources governed by the organization policies of the AnalyzeOrgPolicyGovernedAssetsRequest.constraint.", + "description": "The Google Cloud resources governed by the organization policies of the AnalyzeOrgPolicyGovernedAssetsRequest.constraint.", "id": "GoogleCloudAssetV1AnalyzeOrgPolicyGovernedAssetsResponseGovernedResource", "properties": { "folders": { @@ -1905,7 +1905,7 @@ "type": "array" }, "fullResourceName": { - "description": "The [full resource name] (https://cloud.google.com/asset-inventory/docs/resource-name-format) of the GCP resource.", + "description": "The [full resource name] (https://cloud.google.com/asset-inventory/docs/resource-name-format) of the Google Cloud resource.", "type": "string" }, "organization": { @@ -2020,7 +2020,7 @@ "type": "string" }, "condition": { - "description": "Organization policy condition/expression. For example: `resource.instanceName.matches(\"[production|test]_.*_(\\d)+\")'` or, `resource.management.auto_upgrade == true`", + "description": "Organization Policy condition/expression. For example: `resource.instanceName.matches(\"[production|test]_.*_(\\d)+\")'` or, `resource.management.auto_upgrade == true`", "type": "string" }, "description": { @@ -2084,7 +2084,7 @@ "id": "GoogleCloudAssetV1GcsDestination", "properties": { "uri": { - "description": "Required. The uri of the Cloud Storage object. It's the same uri that is used by gsutil. Example: \"gs://bucket_name/object_name\". See [Viewing and Editing Object Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) for more information. If the specified Cloud Storage object already exists and there is no [hold](https://cloud.google.com/storage/docs/object-holds), it will be overwritten with the analysis result.", + "description": "Required. The URI of the Cloud Storage object. It's the same URI that is used by gsutil. Example: \"gs://bucket_name/object_name\". See [Viewing and Editing Object Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) for more information. If the specified Cloud Storage object already exists and there is no [hold](https://cloud.google.com/storage/docs/object-holds), it will be overwritten with the analysis result.", "type": "string" } }, @@ -2153,7 +2153,7 @@ "type": "object" }, "GoogleCloudAssetV1ListConstraint": { - "description": "A `Constraint` that allows or disallows a list of string values, which are configured by an Organization's policy administrator with a `Policy`.", + "description": "A `Constraint` that allows or disallows a list of string values, which are configured by an organization's policy administrator with a `Policy`.", "id": "GoogleCloudAssetV1ListConstraint", "properties": { "supportsIn": { @@ -2250,7 +2250,7 @@ "type": "object" }, "GoogleCloudAssetV1p7beta1Asset": { - "description": "An asset in Google Cloud. An asset can be any resource in the Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy). See [Supported asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information.", + "description": "An asset in Google Cloud. An asset can be any resource in the Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. IAM policy). See [Supported asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information.", "id": "GoogleCloudAssetV1p7beta1Asset", "properties": { "accessLevel": { @@ -2274,7 +2274,7 @@ }, "iamPolicy": { "$ref": "Policy", - "description": "A representation of the Cloud IAM policy set on a Google Cloud resource. There can be a maximum of one Cloud IAM policy set on any given resource. In addition, Cloud IAM policies inherit their granted access scope from any policies set on parent resources in the resource hierarchy. Therefore, the effectively policy is the union of both the policy set on this resource and each policy set on all of the resource's ancestry resource levels in the hierarchy. See [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance) for more information." + "description": "A representation of the IAM policy set on a Google Cloud resource. There can be a maximum of one IAM policy set on any given resource. In addition, IAM policies inherit their granted access scope from any policies set on parent resources in the resource hierarchy. Therefore, the effectively policy is the union of both the policy set on this resource and each policy set on all of the resource's ancestry resource levels in the hierarchy. See [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance) for more information." }, "name": { "description": "The full name of the asset. Example: `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` See [Resource names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information.", @@ -2308,7 +2308,7 @@ "type": "object" }, "GoogleCloudAssetV1p7beta1RelatedAsset": { - "description": "An asset identify in Google Cloud which contains its name, type and ancestors. An asset can be any resource in the Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy). See [Supported asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information.", + "description": "An asset identify in Google Cloud which contains its name, type and ancestors. An asset can be any resource in the Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. IAM policy). See [Supported asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information.", "id": "GoogleCloudAssetV1p7beta1RelatedAsset", "properties": { "ancestors": { @@ -2395,7 +2395,7 @@ "type": "string" }, "parent": { - "description": "The full name of the immediate parent of this resource. See [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information. For Google Cloud assets, this value is the parent resource defined in the [Cloud IAM policy hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). Example: `//cloudresourcemanager.googleapis.com/projects/my_project_123` For third-party assets, this field may be set differently.", + "description": "The full name of the immediate parent of this resource. See [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information. For Google Cloud assets, this value is the parent resource defined in the [IAM policy hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). Example: `//cloudresourcemanager.googleapis.com/projects/my_project_123` For third-party assets, this field may be set differently.", "type": "string" }, "resourceUrl": { @@ -2860,7 +2860,7 @@ "type": "string" }, "resource": { - "description": "A Google Cloud resource that is allowed to ingress the perimeter. Requests from these resources will be allowed to access perimeter data. Currently only projects are allowed. Format: `projects/{project_number}` The project may be in any Google Cloud organization, not just the organization that the perimeter is defined in. `*` is not allowed, the case of allowing all Google Cloud resources only is not supported.", + "description": "A Google Cloud resource that is allowed to ingress the perimeter. Requests from these resources will be allowed to access perimeter data. Currently only projects and VPCs are allowed. Project format: `projects/{project_number}` VPC format: `//compute.googleapis.com/projects/{PROJECT_ID}/global/networks/{NAME}`. The project may be in any Google Cloud organization, not just the organization that the perimeter is defined in. `*` is not allowed, the case of allowing all Google Cloud resources only is not supported.", "type": "string" } }, @@ -3008,7 +3008,7 @@ "type": "array" }, "resources": { - "description": "A list of Google Cloud resources that are inside of the service perimeter. Currently only projects are allowed. Format: `projects/{project_number}`", + "description": "A list of Google Cloud resources that are inside of the service perimeter. Currently only projects and VPCs are allowed. Project format: `projects/{project_number}` VPC format: `//compute.googleapis.com/projects/{PROJECT_ID}/global/networks/{NAME}`.", "items": { "type": "string" }, @@ -3142,7 +3142,7 @@ }, "iamBinding": { "$ref": "Binding", - "description": "The Cloud IAM policy binding under analysis." + "description": "The IAM policy binding under analysis." }, "identityList": { "$ref": "GoogleCloudAssetV1IdentityList", @@ -3232,7 +3232,7 @@ "description": "The IAM policy directly set on the given resource. Note that the original IAM policy can contain multiple bindings. This only contains the bindings that match the given query. For queries that don't contain a constrain on policies (e.g., an empty query), this contains all the bindings. To search against the `policy` bindings: * use a field query: - query by the policy contained members. Example: `policy:amy@gmail.com` - query by the policy contained roles. Example: `policy:roles/compute.admin` - query by the policy contained roles' included permissions. Example: `policy.role.permissions:compute.instances.create`" }, "project": { - "description": "The project that the associated GCP resource belongs to, in the form of projects/{PROJECT_NUMBER}. If an IAM policy is set on a resource (like VM instance, Cloud Storage bucket), the project field will indicate the project that contains the resource. If an IAM policy is set on a folder or orgnization, this field will be empty. To search against the `project`: * specify the `scope` field as this project in your search request.", + "description": "The project that the associated Google Cloud resource belongs to, in the form of projects/{PROJECT_NUMBER}. If an IAM policy is set on a resource (like VM instance, Cloud Storage bucket), the project field will indicate the project that contains the resource. If an IAM policy is set on a folder or orgnization, this field will be empty. To search against the `project`: * specify the `scope` field as this project in your search request.", "type": "string" }, "resource": { @@ -3400,7 +3400,7 @@ "description": "Analysis result of moving the target resource." }, "displayName": { - "description": "The user friendly display name of the analysis. E.g. IAM, Organization Policy etc.", + "description": "The user friendly display name of the analysis. E.g. IAM, organization policy etc.", "type": "string" }, "error": { @@ -3482,7 +3482,7 @@ "id": "Options", "properties": { "analyzeServiceAccountImpersonation": { - "description": "Optional. If true, the response will include access analysis from identities to resources via service account impersonation. This is a very expensive operation, because many derived queries will be executed. We highly recommend you use AssetService.AnalyzeIamPolicyLongrunning rpc instead. For example, if the request analyzes for which resources user A has permission P, and there's an IAM policy states user A has iam.serviceAccounts.getAccessToken permission to a service account SA, and there's another IAM policy states service account SA has permission P to a GCP folder F, then user A potentially has access to the GCP folder F. And those advanced analysis results will be included in AnalyzeIamPolicyResponse.service_account_impersonation_analysis. Another example, if the request analyzes for who has permission P to a GCP folder F, and there's an IAM policy states user A has iam.serviceAccounts.actAs permission to a service account SA, and there's another IAM policy states service account SA has permission P to the GCP folder F, then user A potentially has access to the GCP folder F. And those advanced analysis results will be included in AnalyzeIamPolicyResponse.service_account_impersonation_analysis. Only the following permissions are considered in this analysis: * `iam.serviceAccounts.actAs` * `iam.serviceAccounts.signBlob` * `iam.serviceAccounts.signJwt` * `iam.serviceAccounts.getAccessToken` * `iam.serviceAccounts.getOpenIdToken` * `iam.serviceAccounts.implicitDelegation` Default is false.", + "description": "Optional. If true, the response will include access analysis from identities to resources via service account impersonation. This is a very expensive operation, because many derived queries will be executed. We highly recommend you use AssetService.AnalyzeIamPolicyLongrunning RPC instead. For example, if the request analyzes for which resources user A has permission P, and there's an IAM policy states user A has iam.serviceAccounts.getAccessToken permission to a service account SA, and there's another IAM policy states service account SA has permission P to a Google Cloud folder F, then user A potentially has access to the Google Cloud folder F. And those advanced analysis results will be included in AnalyzeIamPolicyResponse.service_account_impersonation_analysis. Another example, if the request analyzes for who has permission P to a Google Cloud folder F, and there's an IAM policy states user A has iam.serviceAccounts.actAs permission to a service account SA, and there's another IAM policy states service account SA has permission P to the Google Cloud folder F, then user A potentially has access to the Google Cloud folder F. And those advanced analysis results will be included in AnalyzeIamPolicyResponse.service_account_impersonation_analysis. Only the following permissions are considered in this analysis: * `iam.serviceAccounts.actAs` * `iam.serviceAccounts.signBlob` * `iam.serviceAccounts.signJwt` * `iam.serviceAccounts.getAccessToken` * `iam.serviceAccounts.getOpenIdToken` * `iam.serviceAccounts.implicitDelegation` Default is false.", "type": "boolean" }, "expandGroups": { @@ -3490,7 +3490,7 @@ "type": "boolean" }, "expandResources": { - "description": "Optional. If true and IamPolicyAnalysisQuery.resource_selector is not specified, the resource section of the result will expand any resource attached to an IAM policy to include resources lower in the resource hierarchy. For example, if the request analyzes for which resources user A has permission P, and the results include an IAM policy with P on a GCP folder, the results will also include resources in that folder with permission P. If true and IamPolicyAnalysisQuery.resource_selector is specified, the resource section of the result will expand the specified resource to include resources lower in the resource hierarchy. Only project or lower resources are supported. Folder and organization resource cannot be used together with this option. For example, if the request analyzes for which users have permission P on a GCP project with this option enabled, the results will include all users who have permission P on that project or any lower resource. If true, the default max expansion per resource is 1000 for AssetService.AnalyzeIamPolicy][] and 100000 for AssetService.AnalyzeIamPolicyLongrunning][]. Default is false.", + "description": "Optional. If true and IamPolicyAnalysisQuery.resource_selector is not specified, the resource section of the result will expand any resource attached to an IAM policy to include resources lower in the resource hierarchy. For example, if the request analyzes for which resources user A has permission P, and the results include an IAM policy with P on a Google Cloud folder, the results will also include resources in that folder with permission P. If true and IamPolicyAnalysisQuery.resource_selector is specified, the resource section of the result will expand the specified resource to include resources lower in the resource hierarchy. Only project or lower resources are supported. Folder and organization resources cannot be used together with this option. For example, if the request analyzes for which users have permission P on a Google Cloud project with this option enabled, the results will include all users who have permission P on that project or any lower resource. If true, the default max expansion per resource is 1000 for AssetService.AnalyzeIamPolicy][] and 100000 for AssetService.AnalyzeIamPolicyLongrunning][]. Default is false.", "type": "boolean" }, "expandRoles": { @@ -3758,7 +3758,7 @@ "properties": { "iamPolicyAnalysisQuery": { "$ref": "IamPolicyAnalysisQuery", - "description": "An IAM Policy Analysis query, which could be used in the AssetService.AnalyzeIamPolicy rpc or the AssetService.AnalyzeIamPolicyLongrunning rpc." + "description": "An IAM Policy Analysis query, which could be used in the AssetService.AnalyzeIamPolicy RPC or the AssetService.AnalyzeIamPolicyLongrunning RPC." } }, "type": "object" @@ -3795,7 +3795,7 @@ "type": "object" }, "RelatedAsset": { - "description": "An asset identifier in Google Cloud which contains its name, type and ancestors. An asset can be any resource in the Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy). See [Supported asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information.", + "description": "An asset identifier in Google Cloud which contains its name, type and ancestors. An asset can be any resource in the Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. IAM policy). See [Supported asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information.", "id": "RelatedAsset", "properties": { "ancestors": { @@ -3915,7 +3915,7 @@ "type": "string" }, "parent": { - "description": "The full name of the immediate parent of this resource. See [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information. For Google Cloud assets, this value is the parent resource defined in the [Cloud IAM policy hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). Example: `//cloudresourcemanager.googleapis.com/projects/my_project_123` For third-party assets, this field may be set differently.", + "description": "The full name of the immediate parent of this resource. See [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information. For Google Cloud assets, this value is the parent resource defined in the [IAM policy hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). Example: `//cloudresourcemanager.googleapis.com/projects/my_project_123` For third-party assets, this field may be set differently.", "type": "string" }, "resourceUrl": { @@ -3938,7 +3938,7 @@ "description": "Properties of the object.", "type": "any" }, - "description": "The additional searchable attributes of this resource. The attributes may vary from one resource type to another. Examples: `projectId` for Project, `dnsName` for DNS ManagedZone. This field contains a subset of the resource metadata fields that are returned by the List or Get APIs provided by the corresponding GCP service (e.g., Compute Engine). see [API references and supported searchable attributes](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types) to see which fields are included. You can search values of these fields through free text search. However, you should not consume the field programically as the field names and values may change as the GCP service updates to a new incompatible API version. To search against the `additional_attributes`: * Use a free text query to match the attributes values. Example: to search `additional_attributes = { dnsName: \"foobar\" }`, you can issue a query `foobar`.", + "description": "The additional searchable attributes of this resource. The attributes may vary from one resource type to another. Examples: `projectId` for Project, `dnsName` for DNS ManagedZone. This field contains a subset of the resource metadata fields that are returned by the List or Get APIs provided by the corresponding Google Cloud service (e.g., Compute Engine). see [API references and supported searchable attributes](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types) to see which fields are included. You can search values of these fields through free text search. However, you should not consume the field programically as the field names and values may change as the Google Cloud service updates to a new incompatible API version. To search against the `additional_attributes`: * Use a free text query to match the attributes values. Example: to search `additional_attributes = { dnsName: \"foobar\" }`, you can issue a query `foobar`.", "type": "object" }, "assetType": { @@ -3973,7 +3973,7 @@ "type": "array" }, "kmsKey": { - "description": "The Cloud KMS [CryptoKey](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys) name or [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions) name. This field only presents for the purpose of backward compatibility. Please use the `kms_keys` field to retrieve KMS key information. This field is available only when the resource's Protobuf contains it and will only be populated for [these resource types](https://cloud.google.com/asset-inventory/docs/legacy-field-names#resource_types_with_the_to_be_deprecated_kmskey_field) for backward compatible purposes. To search against the `kms_key`: * Use a field query. Example: `kmsKey:key` * Use a free text query. Example: `key`", + "description": "The Cloud KMS [CryptoKey](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys) name or [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions) name. This field only presents for the purpose of backward compatibility. Please use the `kms_keys` field to retrieve Cloud KMS key information. This field is available only when the resource's Protobuf contains it and will only be populated for [these resource types](https://cloud.google.com/asset-inventory/docs/legacy-field-names#resource_types_with_the_to_be_deprecated_kmskey_field) for backward compatible purposes. To search against the `kms_key`: * Use a field query. Example: `kmsKey:key` * Use a free text query. Example: `key`", "type": "string" }, "kmsKeys": { @@ -3987,7 +3987,7 @@ "additionalProperties": { "type": "string" }, - "description": "Labels associated with this resource. See [Labelling and grouping GCP resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) for more information. This field is available only when the resource's Protobuf contains it. To search against the `labels`: * Use a field query: - query on any label's key or value. Example: `labels:prod` - query by a given label. Example: `labels.env:prod` - query by a given label's existence. Example: `labels.env:*` * Use a free text query. Example: `prod`", + "description": "Labels associated with this resource. See [Labelling and grouping Google Cloud resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) for more information. This field is available only when the resource's Protobuf contains it. To search against the `labels`: * Use a field query: - query on any label's key or value. Example: `labels:prod` - query by a given label. Example: `labels.env:prod` - query by a given label's existence. Example: `labels.env:*` * Use a free text query. Example: `prod`", "type": "object" }, "location": { @@ -3999,7 +3999,7 @@ "type": "string" }, "networkTags": { - "description": "Network tags associated with this resource. Like labels, network tags are a type of annotations used to group GCP resources. See [Labelling GCP resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) for more information. This field is available only when the resource's Protobuf contains it. To search against the `network_tags`: * Use a field query. Example: `networkTags:internal` * Use a free text query. Example: `internal`", + "description": "Network tags associated with this resource. Like labels, network tags are a type of annotations used to group Google Cloud resources. See [Labelling Google Cloud resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) for more information. This field is available only when the resource's Protobuf contains it. To search against the `network_tags`: * Use a field query. Example: `networkTags:internal` * Use a free text query. Example: `internal`", "items": { "type": "string" }, @@ -4029,7 +4029,7 @@ "type": "object" }, "state": { - "description": "The state of this resource. Different resources types have different state definitions that are mapped from various fields of different resource types. This field is available only when the resource's Protobuf contains it. Example: If the resource is an instance provided by Compute Engine, its state will include PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, REPAIRING, and TERMINATED. See `status` definition in [API Reference](https://cloud.google.com/compute/docs/reference/rest/v1/instances). If the resource is a project provided by Cloud Resource Manager, its state will include LIFECYCLE_STATE_UNSPECIFIED, ACTIVE, DELETE_REQUESTED and DELETE_IN_PROGRESS. See `lifecycleState` definition in [API Reference](https://cloud.google.com/resource-manager/reference/rest/v1/projects). To search against the `state`: * Use a field query. Example: `state:RUNNING` * Use a free text query. Example: `RUNNING`", + "description": "The state of this resource. Different resources types have different state definitions that are mapped from various fields of different resource types. This field is available only when the resource's Protobuf contains it. Example: If the resource is an instance provided by Compute Engine, its state will include PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, REPAIRING, and TERMINATED. See `status` definition in [API Reference](https://cloud.google.com/compute/docs/reference/rest/v1/instances). If the resource is a project provided by Resource Manager, its state will include LIFECYCLE_STATE_UNSPECIFIED, ACTIVE, DELETE_REQUESTED and DELETE_IN_PROGRESS. See `lifecycleState` definition in [API Reference](https://cloud.google.com/resource-manager/reference/rest/v1/projects). To search against the `state`: * Use a field query. Example: `state:RUNNING` * Use a free text query. Example: `RUNNING`", "type": "string" }, "tagKeys": { @@ -4136,7 +4136,7 @@ "type": "string" }, "results": { - "description": "A list of IamPolicy that match the search query. Related information such as the associated resource is returned along with the policy.", + "description": "A list of IAM policies that match the search query. Related information such as the associated resource is returned along with the policy.", "items": { "$ref": "IamPolicySearchResult" }, diff --git a/cloudasset/v1/cloudasset-gen.go b/cloudasset/v1/cloudasset-gen.go index e08d1185792..983b968e1a3 100644 --- a/cloudasset/v1/cloudasset-gen.go +++ b/cloudasset/v1/cloudasset-gen.go @@ -242,7 +242,7 @@ func (s *AccessSelector) MarshalJSON() ([]byte, error) { } // AnalyzeIamPolicyLongrunningMetadata: Represents the metadata of the -// longrunning operation for the AnalyzeIamPolicyLongrunning rpc. +// longrunning operation for the AnalyzeIamPolicyLongrunning RPC. type AnalyzeIamPolicyLongrunningMetadata struct { // CreateTime: Output only. The time the operation was created. CreateTime string `json:"createTime,omitempty"` @@ -371,7 +371,7 @@ func (s *AnalyzeIamPolicyResponse) MarshalJSON() ([]byte, error) { type AnalyzeMoveResponse struct { // MoveAnalysis: The list of analyses returned from performing the // intended resource move analysis. The analysis is grouped by different - // Cloud services. + // Google Cloud services. MoveAnalysis []*MoveAnalysis `json:"moveAnalysis,omitempty"` // ServerResponse contains the HTTP response code and headers from the @@ -524,9 +524,9 @@ func (s *AnalyzeOrgPolicyGovernedContainersResponse) MarshalJSON() ([]byte, erro } // AnalyzerOrgPolicy: This organization policy message is a modified -// version of the one defined in the OrgPolicy system. This message -// contains several fields defined in the original organization policy -// with some new fields for analysis purpose. +// version of the one defined in the Organization Policy system. This +// message contains several fields defined in the original organization +// policy with some new fields for analysis purpose. type AnalyzerOrgPolicy struct { // AppliedResource: The [full resource name] // (https://cloud.google.com/asset-inventory/docs/resource-name-format) @@ -620,9 +620,9 @@ func (s *AnalyzerOrgPolicyConstraint) MarshalJSON() ([]byte, error) { // Google Cloud resource hierarchy // (https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), // a resource outside the Google Cloud resource hierarchy (such as -// Google Kubernetes Engine clusters and objects), or a policy (e.g. -// Cloud IAM policy), or a relationship (e.g. an -// INSTANCE_TO_INSTANCEGROUP relationship). See Supported asset types +// Google Kubernetes Engine clusters and objects), or a policy (e.g. IAM +// policy), or a relationship (e.g. an INSTANCE_TO_INSTANCEGROUP +// relationship). See Supported asset types // (https://cloud.google.com/asset-inventory/docs/supported-asset-types) // for more information. type Asset struct { @@ -650,15 +650,15 @@ type Asset struct { // for more information. AssetType string `json:"assetType,omitempty"` - // IamPolicy: A representation of the Cloud IAM policy set on a Google - // Cloud resource. There can be a maximum of one Cloud IAM policy set on - // any given resource. In addition, Cloud IAM policies inherit their - // granted access scope from any policies set on parent resources in the - // resource hierarchy. Therefore, the effectively policy is the union of - // both the policy set on this resource and each policy set on all of - // the resource's ancestry resource levels in the hierarchy. See this - // topic (https://cloud.google.com/iam/help/allow-policies/inheritance) - // for more information. + // IamPolicy: A representation of the IAM policy set on a Google Cloud + // resource. There can be a maximum of one IAM policy set on any given + // resource. In addition, IAM policies inherit their granted access + // scope from any policies set on parent resources in the resource + // hierarchy. Therefore, the effectively policy is the union of both the + // policy set on this resource and each policy set on all of the + // resource's ancestry resource levels in the hierarchy. See this topic + // (https://cloud.google.com/iam/help/allow-policies/inheritance) for + // more information. IamPolicy *Policy `json:"iamPolicy,omitempty"` // Name: The full name of the asset. Example: @@ -1365,8 +1365,8 @@ type ExportAssetsRequest struct { // "CONTENT_TYPE_UNSPECIFIED" - Unspecified content type. // "RESOURCE" - Resource metadata. // "IAM_POLICY" - The actual IAM policy set on a resource. - // "ORG_POLICY" - The Cloud Organization Policy set on an asset. - // "ACCESS_POLICY" - The Cloud Access context manager Policy set on an + // "ORG_POLICY" - The organization policy set on an asset. + // "ACCESS_POLICY" - The Access Context Manager policy set on an // asset. // "OS_INVENTORY" - The runtime OS Inventory information. // "RELATIONSHIP" - The related resources. @@ -1524,8 +1524,8 @@ type Feed struct { // "CONTENT_TYPE_UNSPECIFIED" - Unspecified content type. // "RESOURCE" - Resource metadata. // "IAM_POLICY" - The actual IAM policy set on a resource. - // "ORG_POLICY" - The Cloud Organization Policy set on an asset. - // "ACCESS_POLICY" - The Cloud Access context manager Policy set on an + // "ORG_POLICY" - The organization policy set on an asset. + // "ACCESS_POLICY" - The Access Context Manager policy set on an // asset. // "OS_INVENTORY" - The runtime OS Inventory information. // "RELATIONSHIP" - The related resources. @@ -1617,7 +1617,7 @@ func (s *FeedOutputConfig) MarshalJSON() ([]byte, error) { // GcsDestination: A Cloud Storage location. type GcsDestination struct { - // Uri: The uri of the Cloud Storage object. It's the same uri that is + // Uri: The URI of the Cloud Storage object. It's the same URI that is // used by gsutil. Example: "gs://bucket_name/object_name". See Viewing // and Editing Object Metadata // (https://cloud.google.com/storage/docs/viewing-editing-metadata) for @@ -1627,8 +1627,8 @@ type GcsDestination struct { // overwritten with the exported result. Uri string `json:"uri,omitempty"` - // UriPrefix: The uri prefix of all generated Cloud Storage objects. - // Example: "gs://bucket_name/object_name_prefix". Each object uri is in + // UriPrefix: The URI prefix of all generated Cloud Storage objects. + // Example: "gs://bucket_name/object_name_prefix". Each object URI is in // format: "gs://bucket_name/object_name_prefix// and only contains // assets for that type. starts from 0. Example: // "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" @@ -1754,9 +1754,9 @@ func (s *GoogleCloudAssetV1AccessControlList) MarshalJSON() ([]byte, error) { // GoogleCloudAssetV1AnalyzeOrgPolicyGovernedAssetsResponseGovernedAsset: // -// Represents a GCP asset(resource or IAM policy) governed by the +// Represents a Google Cloud asset(resource or IAM policy) governed by // -// organization policies of the +// the organization policies of the // AnalyzeOrgPolicyGovernedAssetsRequest.constraint. type GoogleCloudAssetV1AnalyzeOrgPolicyGovernedAssetsResponseGovernedAsset struct { // ConsolidatedPolicy: The consolidated policy for the analyzed asset. @@ -1770,8 +1770,9 @@ type GoogleCloudAssetV1AnalyzeOrgPolicyGovernedAssetsResponseGovernedAsset struc // policies of the AnalyzeOrgPolicyGovernedAssetsRequest.constraint. GovernedIamPolicy *GoogleCloudAssetV1AnalyzeOrgPolicyGovernedAssetsResponseGovernedIamPolicy `json:"governedIamPolicy,omitempty"` - // GovernedResource: A GCP resource governed by the organization - // policies of the AnalyzeOrgPolicyGovernedAssetsRequest.constraint. + // GovernedResource: A Google Cloud resource governed by the + // organization policies of the + // AnalyzeOrgPolicyGovernedAssetsRequest.constraint. GovernedResource *GoogleCloudAssetV1AnalyzeOrgPolicyGovernedAssetsResponseGovernedResource `json:"governedResource,omitempty"` // PolicyBundle: The ordered list of all organization policies from the @@ -1860,8 +1861,8 @@ func (s *GoogleCloudAssetV1AnalyzeOrgPolicyGovernedAssetsResponseGovernedIamPoli } // GoogleCloudAssetV1AnalyzeOrgPolicyGovernedAssetsResponseGovernedResour -// ce: The GCP resources governed by the organization policies of the -// AnalyzeOrgPolicyGovernedAssetsRequest.constraint. +// ce: The Google Cloud resources governed by the organization policies +// of the AnalyzeOrgPolicyGovernedAssetsRequest.constraint. type GoogleCloudAssetV1AnalyzeOrgPolicyGovernedAssetsResponseGovernedResource struct { // Folders: The folder(s) that this resource belongs to, in the form of // folders/{FOLDER_NUMBER}. This field is available when the resource @@ -1870,7 +1871,7 @@ type GoogleCloudAssetV1AnalyzeOrgPolicyGovernedAssetsResponseGovernedResource st // FullResourceName: The [full resource name] // (https://cloud.google.com/asset-inventory/docs/resource-name-format) - // of the GCP resource. + // of the Google Cloud resource. FullResourceName string `json:"fullResourceName,omitempty"` // Organization: The organization that this resource belongs to, in the @@ -2055,7 +2056,7 @@ type GoogleCloudAssetV1CustomConstraint struct { // "DENY" - Deny action type. ActionType string `json:"actionType,omitempty"` - // Condition: Organization policy condition/expression. For example: + // Condition: Organization Policy condition/expression. For example: // `resource.instanceName.matches("[production|test]_.*_(\d)+")'` or, // `resource.management.auto_upgrade == true` Condition string `json:"condition,omitempty"` @@ -2147,7 +2148,7 @@ func (s *GoogleCloudAssetV1Edge) MarshalJSON() ([]byte, error) { // GoogleCloudAssetV1GcsDestination: A Cloud Storage location. type GoogleCloudAssetV1GcsDestination struct { - // Uri: Required. The uri of the Cloud Storage object. It's the same uri + // Uri: Required. The URI of the Cloud Storage object. It's the same URI // that is used by gsutil. Example: "gs://bucket_name/object_name". See // Viewing and Editing Object Metadata // (https://cloud.google.com/storage/docs/viewing-editing-metadata) for @@ -2311,7 +2312,7 @@ func (s *GoogleCloudAssetV1IdentityList) MarshalJSON() ([]byte, error) { // GoogleCloudAssetV1ListConstraint: A `Constraint` that allows or // disallows a list of string values, which are configured by an -// Organization's policy administrator with a `Policy`. +// organization's policy administrator with a `Policy`. type GoogleCloudAssetV1ListConstraint struct { // SupportsIn: Indicates whether values grouped into categories can be // used in `Policy.allowed_values` and `Policy.denied_values`. For @@ -2508,8 +2509,8 @@ func (s *GoogleCloudAssetV1StringValues) MarshalJSON() ([]byte, error) { // can be any resource in the Google Cloud resource hierarchy // (https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), // a resource outside the Google Cloud resource hierarchy (such as -// Google Kubernetes Engine clusters and objects), or a policy (e.g. -// Cloud IAM policy). See Supported asset types +// Google Kubernetes Engine clusters and objects), or a policy (e.g. IAM +// policy). See Supported asset types // (https://cloud.google.com/asset-inventory/docs/supported-asset-types) // for more information. type GoogleCloudAssetV1p7beta1Asset struct { @@ -2537,15 +2538,15 @@ type GoogleCloudAssetV1p7beta1Asset struct { // for more information. AssetType string `json:"assetType,omitempty"` - // IamPolicy: A representation of the Cloud IAM policy set on a Google - // Cloud resource. There can be a maximum of one Cloud IAM policy set on - // any given resource. In addition, Cloud IAM policies inherit their - // granted access scope from any policies set on parent resources in the - // resource hierarchy. Therefore, the effectively policy is the union of - // both the policy set on this resource and each policy set on all of - // the resource's ancestry resource levels in the hierarchy. See this - // topic (https://cloud.google.com/iam/help/allow-policies/inheritance) - // for more information. + // IamPolicy: A representation of the IAM policy set on a Google Cloud + // resource. There can be a maximum of one IAM policy set on any given + // resource. In addition, IAM policies inherit their granted access + // scope from any policies set on parent resources in the resource + // hierarchy. Therefore, the effectively policy is the union of both the + // policy set on this resource and each policy set on all of the + // resource's ancestry resource levels in the hierarchy. See this topic + // (https://cloud.google.com/iam/help/allow-policies/inheritance) for + // more information. IamPolicy *Policy `json:"iamPolicy,omitempty"` // Name: The full name of the asset. Example: @@ -2604,8 +2605,8 @@ func (s *GoogleCloudAssetV1p7beta1Asset) MarshalJSON() ([]byte, error) { // any resource in the Google Cloud resource hierarchy // (https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), // a resource outside the Google Cloud resource hierarchy (such as -// Google Kubernetes Engine clusters and objects), or a policy (e.g. -// Cloud IAM policy). See Supported asset types +// Google Kubernetes Engine clusters and objects), or a policy (e.g. IAM +// policy). See Supported asset types // (https://cloud.google.com/asset-inventory/docs/supported-asset-types) // for more information. type GoogleCloudAssetV1p7beta1RelatedAsset struct { @@ -2757,7 +2758,7 @@ type GoogleCloudAssetV1p7beta1Resource struct { // Resource Names // (https://cloud.google.com/apis/design/resource_names#full_resource_name) // for more information. For Google Cloud assets, this value is the - // parent resource defined in the Cloud IAM policy hierarchy + // parent resource defined in the IAM policy hierarchy // (https://cloud.google.com/iam/docs/overview#policy_hierarchy). // Example: // `//cloudresourcemanager.googleapis.com/projects/my_project_123` For @@ -3705,11 +3706,13 @@ type GoogleIdentityAccesscontextmanagerV1IngressSource struct { // Resource: A Google Cloud resource that is allowed to ingress the // perimeter. Requests from these resources will be allowed to access - // perimeter data. Currently only projects are allowed. Format: - // `projects/{project_number}` The project may be in any Google Cloud - // organization, not just the organization that the perimeter is defined - // in. `*` is not allowed, the case of allowing all Google Cloud - // resources only is not supported. + // perimeter data. Currently only projects and VPCs are allowed. Project + // format: `projects/{project_number}` VPC format: + // `//compute.googleapis.com/projects/{PROJECT_ID}/global/networks/{NAME} + // `. The project may be in any Google Cloud organization, not just the + // organization that the perimeter is defined in. `*` is not allowed, + // the case of allowing all Google Cloud resources only is not + // supported. Resource string `json:"resource,omitempty"` // ForceSendFields is a list of field names (e.g. "AccessLevel") to @@ -3977,8 +3980,10 @@ type GoogleIdentityAccesscontextmanagerV1ServicePerimeterConfig struct { IngressPolicies []*GoogleIdentityAccesscontextmanagerV1IngressPolicy `json:"ingressPolicies,omitempty"` // Resources: A list of Google Cloud resources that are inside of the - // service perimeter. Currently only projects are allowed. Format: - // `projects/{project_number}` + // service perimeter. Currently only projects and VPCs are allowed. + // Project format: `projects/{project_number}` VPC format: + // `//compute.googleapis.com/projects/{PROJECT_ID}/global/networks/{NAME} + // `. Resources []string `json:"resources,omitempty"` // RestrictedServices: Google Cloud services that are subject to the @@ -4197,7 +4202,7 @@ type IamPolicyAnalysisResult struct { // have successfully finished. FullyExplored bool `json:"fullyExplored,omitempty"` - // IamBinding: The Cloud IAM policy binding under analysis. + // IamBinding: The IAM policy binding under analysis. IamBinding *Binding `json:"iamBinding,omitempty"` // IdentityList: The identity list derived from members of the @@ -4396,13 +4401,13 @@ type IamPolicySearchResult struct { // `policy.role.permissions:compute.instances.create` Policy *Policy `json:"policy,omitempty"` - // Project: The project that the associated GCP resource belongs to, in - // the form of projects/{PROJECT_NUMBER}. If an IAM policy is set on a - // resource (like VM instance, Cloud Storage bucket), the project field - // will indicate the project that contains the resource. If an IAM - // policy is set on a folder or orgnization, this field will be empty. - // To search against the `project`: * specify the `scope` field as this - // project in your search request. + // Project: The project that the associated Google Cloud resource + // belongs to, in the form of projects/{PROJECT_NUMBER}. If an IAM + // policy is set on a resource (like VM instance, Cloud Storage bucket), + // the project field will indicate the project that contains the + // resource. If an IAM policy is set on a folder or orgnization, this + // field will be empty. To search against the `project`: * specify the + // `scope` field as this project in your search request. Project string `json:"project,omitempty"` // Resource: The full resource name of the resource associated with this @@ -4698,7 +4703,7 @@ type MoveAnalysis struct { Analysis *MoveAnalysisResult `json:"analysis,omitempty"` // DisplayName: The user friendly display name of the analysis. E.g. - // IAM, Organization Policy etc. + // IAM, organization policy etc. DisplayName string `json:"displayName,omitempty"` // Error: Description of error encountered when performing the analysis. @@ -4859,21 +4864,22 @@ type Options struct { // will include access analysis from identities to resources via service // account impersonation. This is a very expensive operation, because // many derived queries will be executed. We highly recommend you use - // AssetService.AnalyzeIamPolicyLongrunning rpc instead. For example, if + // AssetService.AnalyzeIamPolicyLongrunning RPC instead. For example, if // the request analyzes for which resources user A has permission P, and // there's an IAM policy states user A has // iam.serviceAccounts.getAccessToken permission to a service account // SA, and there's another IAM policy states service account SA has - // permission P to a GCP folder F, then user A potentially has access to - // the GCP folder F. And those advanced analysis results will be - // included in + // permission P to a Google Cloud folder F, then user A potentially has + // access to the Google Cloud folder F. And those advanced analysis + // results will be included in // AnalyzeIamPolicyResponse.service_account_impersonation_analysis. // Another example, if the request analyzes for who has permission P to - // a GCP folder F, and there's an IAM policy states user A has + // a Google Cloud folder F, and there's an IAM policy states user A has // iam.serviceAccounts.actAs permission to a service account SA, and // there's another IAM policy states service account SA has permission P - // to the GCP folder F, then user A potentially has access to the GCP - // folder F. And those advanced analysis results will be included in + // to the Google Cloud folder F, then user A potentially has access to + // the Google Cloud folder F. And those advanced analysis results will + // be included in // AnalyzeIamPolicyResponse.service_account_impersonation_analysis. Only // the following permissions are considered in this analysis: * // `iam.serviceAccounts.actAs` * `iam.serviceAccounts.signBlob` * @@ -4895,17 +4901,18 @@ type Options struct { // resource section of the result will expand any resource attached to // an IAM policy to include resources lower in the resource hierarchy. // For example, if the request analyzes for which resources user A has - // permission P, and the results include an IAM policy with P on a GCP - // folder, the results will also include resources in that folder with - // permission P. If true and IamPolicyAnalysisQuery.resource_selector is - // specified, the resource section of the result will expand the - // specified resource to include resources lower in the resource - // hierarchy. Only project or lower resources are supported. Folder and - // organization resource cannot be used together with this option. For - // example, if the request analyzes for which users have permission P on - // a GCP project with this option enabled, the results will include all - // users who have permission P on that project or any lower resource. If - // true, the default max expansion per resource is 1000 for + // permission P, and the results include an IAM policy with P on a + // Google Cloud folder, the results will also include resources in that + // folder with permission P. If true and + // IamPolicyAnalysisQuery.resource_selector is specified, the resource + // section of the result will expand the specified resource to include + // resources lower in the resource hierarchy. Only project or lower + // resources are supported. Folder and organization resources cannot be + // used together with this option. For example, if the request analyzes + // for which users have permission P on a Google Cloud project with this + // option enabled, the results will include all users who have + // permission P on that project or any lower resource. If true, the + // default max expansion per resource is 1000 for // AssetService.AnalyzeIamPolicy][] and 100000 for // AssetService.AnalyzeIamPolicyLongrunning][]. Default is false. ExpandResources bool `json:"expandResources,omitempty"` @@ -5477,8 +5484,8 @@ func (s *QueryAssetsResponse) MarshalJSON() ([]byte, error) { // QueryContent: The query content. type QueryContent struct { // IamPolicyAnalysisQuery: An IAM Policy Analysis query, which could be - // used in the AssetService.AnalyzeIamPolicy rpc or the - // AssetService.AnalyzeIamPolicyLongrunning rpc. + // used in the AssetService.AnalyzeIamPolicy RPC or the + // AssetService.AnalyzeIamPolicyLongrunning RPC. IamPolicyAnalysisQuery *IamPolicyAnalysisQuery `json:"iamPolicyAnalysisQuery,omitempty"` // ForceSendFields is a list of field names (e.g. @@ -5551,8 +5558,8 @@ func (s *QueryResult) MarshalJSON() ([]byte, error) { // Cloud resource hierarchy // (https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), // a resource outside the Google Cloud resource hierarchy (such as -// Google Kubernetes Engine clusters and objects), or a policy (e.g. -// Cloud IAM policy). See Supported asset types +// Google Kubernetes Engine clusters and objects), or a policy (e.g. IAM +// policy). See Supported asset types // (https://cloud.google.com/asset-inventory/docs/supported-asset-types) // for more information. type RelatedAsset struct { @@ -5775,7 +5782,7 @@ type Resource struct { // Resource Names // (https://cloud.google.com/apis/design/resource_names#full_resource_name) // for more information. For Google Cloud assets, this value is the - // parent resource defined in the Cloud IAM policy hierarchy + // parent resource defined in the IAM policy hierarchy // (https://cloud.google.com/iam/docs/overview#policy_hierarchy). // Example: // `//cloudresourcemanager.googleapis.com/projects/my_project_123` For @@ -5821,17 +5828,18 @@ type ResourceSearchResult struct { // resource. The attributes may vary from one resource type to another. // Examples: `projectId` for Project, `dnsName` for DNS ManagedZone. // This field contains a subset of the resource metadata fields that are - // returned by the List or Get APIs provided by the corresponding GCP - // service (e.g., Compute Engine). see API references and supported - // searchable attributes + // returned by the List or Get APIs provided by the corresponding Google + // Cloud service (e.g., Compute Engine). see API references and + // supported searchable attributes // (https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types) // to see which fields are included. You can search values of these // fields through free text search. However, you should not consume the // field programically as the field names and values may change as the - // GCP service updates to a new incompatible API version. To search - // against the `additional_attributes`: * Use a free text query to match - // the attributes values. Example: to search `additional_attributes = { - // dnsName: "foobar" }`, you can issue a query `foobar`. + // Google Cloud service updates to a new incompatible API version. To + // search against the `additional_attributes`: * Use a free text query + // to match the attributes values. Example: to search + // `additional_attributes = { dnsName: "foobar" }`, you can issue a + // query `foobar`. AdditionalAttributes googleapi.RawMessage `json:"additionalAttributes,omitempty"` // AssetType: The type of this resource. Example: @@ -5886,8 +5894,8 @@ type ResourceSearchResult struct { // name or CryptoKeyVersion // (https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions) // name. This field only presents for the purpose of backward - // compatibility. Please use the `kms_keys` field to retrieve KMS key - // information. This field is available only when the resource's + // compatibility. Please use the `kms_keys` field to retrieve Cloud KMS + // key information. This field is available only when the resource's // Protobuf contains it and will only be populated for these resource // types // (https://cloud.google.com/asset-inventory/docs/legacy-field-names#resource_types_with_the_to_be_deprecated_kmskey_field) @@ -5906,7 +5914,7 @@ type ResourceSearchResult struct { KmsKeys []string `json:"kmsKeys,omitempty"` // Labels: Labels associated with this resource. See Labelling and - // grouping GCP resources + // grouping Google Cloud resources // (https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) // for more information. This field is available only when the // resource's Protobuf contains it. To search against the `labels`: * @@ -5933,8 +5941,8 @@ type ResourceSearchResult struct { Name string `json:"name,omitempty"` // NetworkTags: Network tags associated with this resource. Like labels, - // network tags are a type of annotations used to group GCP resources. - // See Labelling GCP resources + // network tags are a type of annotations used to group Google Cloud + // resources. See Labelling Google Cloud resources // (https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) // for more information. This field is available only when the // resource's Protobuf contains it. To search against the @@ -5989,10 +5997,10 @@ type ResourceSearchResult struct { // PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, // REPAIRING, and TERMINATED. See `status` definition in API Reference // (https://cloud.google.com/compute/docs/reference/rest/v1/instances). - // If the resource is a project provided by Cloud Resource Manager, its - // state will include LIFECYCLE_STATE_UNSPECIFIED, ACTIVE, - // DELETE_REQUESTED and DELETE_IN_PROGRESS. See `lifecycleState` - // definition in API Reference + // If the resource is a project provided by Resource Manager, its state + // will include LIFECYCLE_STATE_UNSPECIFIED, ACTIVE, DELETE_REQUESTED + // and DELETE_IN_PROGRESS. See `lifecycleState` definition in API + // Reference // (https://cloud.google.com/resource-manager/reference/rest/v1/projects). // To search against the `state`: * Use a field query. Example: // `state:RUNNING` * Use a free text query. Example: `RUNNING` @@ -6166,7 +6174,7 @@ type SearchAllIamPoliciesResponse struct { // again, using this value as the `page_token`. NextPageToken string `json:"nextPageToken,omitempty"` - // Results: A list of IamPolicy that match the search query. Related + // Results: A list of IAM policies that match the search query. Related // information such as the associated resource is returned along with // the policy. Results []*IamPolicySearchResult `json:"results,omitempty"` @@ -6893,8 +6901,8 @@ func (c *AssetsListCall) AssetTypes(assetTypes ...string) *AssetsListCall { // "CONTENT_TYPE_UNSPECIFIED" - Unspecified content type. // "RESOURCE" - Resource metadata. // "IAM_POLICY" - The actual IAM policy set on a resource. -// "ORG_POLICY" - The Cloud Organization Policy set on an asset. -// "ACCESS_POLICY" - The Cloud Access context manager Policy set on an +// "ORG_POLICY" - The organization policy set on an asset. +// "ACCESS_POLICY" - The Access Context Manager policy set on an // // asset. // @@ -7081,8 +7089,8 @@ func (c *AssetsListCall) Do(opts ...googleapi.CallOption) (*ListAssetsResponse, // "Unspecified content type.", // "Resource metadata.", // "The actual IAM policy set on a resource.", - // "The Cloud Organization Policy set on an asset.", - // "The Cloud Access context manager Policy set on an asset.", + // "The organization policy set on an asset.", + // "The Access Context Manager policy set on an asset.", // "The runtime OS Inventory information.", // "The related resources." // ], @@ -8231,7 +8239,7 @@ func (r *SavedQueriesService) Create(parent string, savedquery *SavedQuery) *Sav // The ID to use for the saved query, which must be unique in the // specified parent. It will become the final component of the saved // query's resource name. This value should be 4-63 characters, and -// valid characters are /a-z-/. Notice that this field is required in +// valid characters are `a-z-`. Notice that this field is required in // the saved query creation, and the `name` field of the `saved_query` // will be ignored. func (c *SavedQueriesCreateCall) SavedQueryId(savedQueryId string) *SavedQueriesCreateCall { @@ -8346,7 +8354,7 @@ func (c *SavedQueriesCreateCall) Do(opts ...googleapi.CallOption) (*SavedQuery, // "type": "string" // }, // "savedQueryId": { - // "description": "Required. The ID to use for the saved query, which must be unique in the specified parent. It will become the final component of the saved query's resource name. This value should be 4-63 characters, and valid characters are /a-z-/. Notice that this field is required in the saved query creation, and the `name` field of the `saved_query` will be ignored.", + // "description": "Required. The ID to use for the saved query, which must be unique in the specified parent. It will become the final component of the saved query's resource name. This value should be 4-63 characters, and valid characters are `a-z-`. Notice that this field is required in the saved query creation, and the `name` field of the `saved_query` will be ignored.", // "location": "query", // "type": "string" // } @@ -9099,21 +9107,22 @@ func (c *V1AnalyzeIamPolicyCall) AnalysisQueryIdentitySelectorIdentity(analysisQ // the response will include access analysis from identities to // resources via service account impersonation. This is a very expensive // operation, because many derived queries will be executed. We highly -// recommend you use AssetService.AnalyzeIamPolicyLongrunning rpc +// recommend you use AssetService.AnalyzeIamPolicyLongrunning RPC // instead. For example, if the request analyzes for which resources // user A has permission P, and there's an IAM policy states user A has // iam.serviceAccounts.getAccessToken permission to a service account // SA, and there's another IAM policy states service account SA has -// permission P to a GCP folder F, then user A potentially has access to -// the GCP folder F. And those advanced analysis results will be -// included in +// permission P to a Google Cloud folder F, then user A potentially has +// access to the Google Cloud folder F. And those advanced analysis +// results will be included in // AnalyzeIamPolicyResponse.service_account_impersonation_analysis. // Another example, if the request analyzes for who has permission P to -// a GCP folder F, and there's an IAM policy states user A has +// a Google Cloud folder F, and there's an IAM policy states user A has // iam.serviceAccounts.actAs permission to a service account SA, and // there's another IAM policy states service account SA has permission P -// to the GCP folder F, then user A potentially has access to the GCP -// folder F. And those advanced analysis results will be included in +// to the Google Cloud folder F, then user A potentially has access to +// the Google Cloud folder F. And those advanced analysis results will +// be included in // AnalyzeIamPolicyResponse.service_account_impersonation_analysis. Only // the following permissions are considered in this analysis: * // `iam.serviceAccounts.actAs` * `iam.serviceAccounts.signBlob` * @@ -9144,17 +9153,18 @@ func (c *V1AnalyzeIamPolicyCall) AnalysisQueryOptionsExpandGroups(analysisQueryO // resource section of the result will expand any resource attached to // an IAM policy to include resources lower in the resource hierarchy. // For example, if the request analyzes for which resources user A has -// permission P, and the results include an IAM policy with P on a GCP -// folder, the results will also include resources in that folder with -// permission P. If true and IamPolicyAnalysisQuery.resource_selector is -// specified, the resource section of the result will expand the -// specified resource to include resources lower in the resource -// hierarchy. Only project or lower resources are supported. Folder and -// organization resource cannot be used together with this option. For -// example, if the request analyzes for which users have permission P on -// a GCP project with this option enabled, the results will include all -// users who have permission P on that project or any lower resource. If -// true, the default max expansion per resource is 1000 for +// permission P, and the results include an IAM policy with P on a +// Google Cloud folder, the results will also include resources in that +// folder with permission P. If true and +// IamPolicyAnalysisQuery.resource_selector is specified, the resource +// section of the result will expand the specified resource to include +// resources lower in the resource hierarchy. Only project or lower +// resources are supported. Folder and organization resources cannot be +// used together with this option. For example, if the request analyzes +// for which users have permission P on a Google Cloud project with this +// option enabled, the results will include all users who have +// permission P on that project or any lower resource. If true, the +// default max expansion per resource is 1000 for // AssetService.AnalyzeIamPolicy][] and 100000 for // AssetService.AnalyzeIamPolicyLongrunning][]. Default is false. func (c *V1AnalyzeIamPolicyCall) AnalysisQueryOptionsExpandResources(analysisQueryOptionsExpandResources bool) *V1AnalyzeIamPolicyCall { @@ -9366,7 +9376,7 @@ func (c *V1AnalyzeIamPolicyCall) Do(opts ...googleapi.CallOption) (*AnalyzeIamPo // "type": "string" // }, // "analysisQuery.options.analyzeServiceAccountImpersonation": { - // "description": "Optional. If true, the response will include access analysis from identities to resources via service account impersonation. This is a very expensive operation, because many derived queries will be executed. We highly recommend you use AssetService.AnalyzeIamPolicyLongrunning rpc instead. For example, if the request analyzes for which resources user A has permission P, and there's an IAM policy states user A has iam.serviceAccounts.getAccessToken permission to a service account SA, and there's another IAM policy states service account SA has permission P to a GCP folder F, then user A potentially has access to the GCP folder F. And those advanced analysis results will be included in AnalyzeIamPolicyResponse.service_account_impersonation_analysis. Another example, if the request analyzes for who has permission P to a GCP folder F, and there's an IAM policy states user A has iam.serviceAccounts.actAs permission to a service account SA, and there's another IAM policy states service account SA has permission P to the GCP folder F, then user A potentially has access to the GCP folder F. And those advanced analysis results will be included in AnalyzeIamPolicyResponse.service_account_impersonation_analysis. Only the following permissions are considered in this analysis: * `iam.serviceAccounts.actAs` * `iam.serviceAccounts.signBlob` * `iam.serviceAccounts.signJwt` * `iam.serviceAccounts.getAccessToken` * `iam.serviceAccounts.getOpenIdToken` * `iam.serviceAccounts.implicitDelegation` Default is false.", + // "description": "Optional. If true, the response will include access analysis from identities to resources via service account impersonation. This is a very expensive operation, because many derived queries will be executed. We highly recommend you use AssetService.AnalyzeIamPolicyLongrunning RPC instead. For example, if the request analyzes for which resources user A has permission P, and there's an IAM policy states user A has iam.serviceAccounts.getAccessToken permission to a service account SA, and there's another IAM policy states service account SA has permission P to a Google Cloud folder F, then user A potentially has access to the Google Cloud folder F. And those advanced analysis results will be included in AnalyzeIamPolicyResponse.service_account_impersonation_analysis. Another example, if the request analyzes for who has permission P to a Google Cloud folder F, and there's an IAM policy states user A has iam.serviceAccounts.actAs permission to a service account SA, and there's another IAM policy states service account SA has permission P to the Google Cloud folder F, then user A potentially has access to the Google Cloud folder F. And those advanced analysis results will be included in AnalyzeIamPolicyResponse.service_account_impersonation_analysis. Only the following permissions are considered in this analysis: * `iam.serviceAccounts.actAs` * `iam.serviceAccounts.signBlob` * `iam.serviceAccounts.signJwt` * `iam.serviceAccounts.getAccessToken` * `iam.serviceAccounts.getOpenIdToken` * `iam.serviceAccounts.implicitDelegation` Default is false.", // "location": "query", // "type": "boolean" // }, @@ -9376,7 +9386,7 @@ func (c *V1AnalyzeIamPolicyCall) Do(opts ...googleapi.CallOption) (*AnalyzeIamPo // "type": "boolean" // }, // "analysisQuery.options.expandResources": { - // "description": "Optional. If true and IamPolicyAnalysisQuery.resource_selector is not specified, the resource section of the result will expand any resource attached to an IAM policy to include resources lower in the resource hierarchy. For example, if the request analyzes for which resources user A has permission P, and the results include an IAM policy with P on a GCP folder, the results will also include resources in that folder with permission P. If true and IamPolicyAnalysisQuery.resource_selector is specified, the resource section of the result will expand the specified resource to include resources lower in the resource hierarchy. Only project or lower resources are supported. Folder and organization resource cannot be used together with this option. For example, if the request analyzes for which users have permission P on a GCP project with this option enabled, the results will include all users who have permission P on that project or any lower resource. If true, the default max expansion per resource is 1000 for AssetService.AnalyzeIamPolicy][] and 100000 for AssetService.AnalyzeIamPolicyLongrunning][]. Default is false.", + // "description": "Optional. If true and IamPolicyAnalysisQuery.resource_selector is not specified, the resource section of the result will expand any resource attached to an IAM policy to include resources lower in the resource hierarchy. For example, if the request analyzes for which resources user A has permission P, and the results include an IAM policy with P on a Google Cloud folder, the results will also include resources in that folder with permission P. If true and IamPolicyAnalysisQuery.resource_selector is specified, the resource section of the result will expand the specified resource to include resources lower in the resource hierarchy. Only project or lower resources are supported. Folder and organization resources cannot be used together with this option. For example, if the request analyzes for which users have permission P on a Google Cloud project with this option enabled, the results will include all users who have permission P on that project or any lower resource. If true, the default max expansion per resource is 1000 for AssetService.AnalyzeIamPolicy][] and 100000 for AssetService.AnalyzeIamPolicyLongrunning][]. Default is false.", // "location": "query", // "type": "boolean" // }, @@ -9606,9 +9616,9 @@ type V1AnalyzeMoveCall struct { // subject to change before the actual resource migration takes place. // // - resource: Name of the resource to perform the analysis against. -// Only GCP Project are supported as of today. Hence, this can only be -// Project ID (such as "projects/my-project-id") or a Project Number -// (such as "projects/12345"). +// Only Google Cloud projects are supported as of today. Hence, this +// can only be a project ID (such as "projects/my-project-id") or a +// project number (such as "projects/12345"). func (r *V1Service) AnalyzeMove(resource string) *V1AnalyzeMoveCall { c := &V1AnalyzeMoveCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.resource = resource @@ -9616,11 +9626,11 @@ func (r *V1Service) AnalyzeMove(resource string) *V1AnalyzeMoveCall { } // DestinationParent sets the optional parameter "destinationParent": -// Required. Name of the GCP Folder or Organization to reparent the -// target resource. The analysis will be performed against +// Required. Name of the Google Cloud folder or organization to reparent +// the target resource. The analysis will be performed against // hypothetically moving the resource to this specified desitination -// parent. This can only be a Folder number (such as "folders/123") or -// an Organization number (such as "organizations/123"). +// parent. This can only be a folder number (such as "folders/123") or +// an organization number (such as "organizations/123"). func (c *V1AnalyzeMoveCall) DestinationParent(destinationParent string) *V1AnalyzeMoveCall { c.urlParams_.Set("destinationParent", destinationParent) return c @@ -9756,12 +9766,12 @@ func (c *V1AnalyzeMoveCall) Do(opts ...googleapi.CallOption) (*AnalyzeMoveRespon // ], // "parameters": { // "destinationParent": { - // "description": "Required. Name of the GCP Folder or Organization to reparent the target resource. The analysis will be performed against hypothetically moving the resource to this specified desitination parent. This can only be a Folder number (such as \"folders/123\") or an Organization number (such as \"organizations/123\").", + // "description": "Required. Name of the Google Cloud folder or organization to reparent the target resource. The analysis will be performed against hypothetically moving the resource to this specified desitination parent. This can only be a folder number (such as \"folders/123\") or an organization number (such as \"organizations/123\").", // "location": "query", // "type": "string" // }, // "resource": { - // "description": "Required. Name of the resource to perform the analysis against. Only GCP Project are supported as of today. Hence, this can only be Project ID (such as \"projects/my-project-id\") or a Project Number (such as \"projects/12345\").", + // "description": "Required. Name of the resource to perform the analysis against. Only Google Cloud projects are supported as of today. Hence, this can only be a project ID (such as \"projects/my-project-id\") or a project number (such as \"projects/12345\").", // "location": "path", // "pattern": "^[^/]+/[^/]+$", // "required": true, @@ -10033,9 +10043,9 @@ type V1AnalyzeOrgPolicyGovernedAssetsCall struct { } // AnalyzeOrgPolicyGovernedAssets: Analyzes organization policies -// governed assets (GCP resources or policies) under a scope. This RPC -// supports custom constraints and the following 10 canned constraints: -// * storage.uniformBucketLevelAccess * +// governed assets (Google Cloud resources or policies) under a scope. +// This RPC supports custom constraints and the following 10 canned +// constraints: * storage.uniformBucketLevelAccess * // iam.disableServiceAccountKeyCreation * iam.allowedPolicyMemberDomains // * compute.vmExternalIpAccess * // appengine.enforceServiceAccountActAsCheck * gcp.resourceLocations * @@ -10198,7 +10208,7 @@ func (c *V1AnalyzeOrgPolicyGovernedAssetsCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Analyzes organization policies governed assets (GCP resources or policies) under a scope. This RPC supports custom constraints and the following 10 canned constraints: * storage.uniformBucketLevelAccess * iam.disableServiceAccountKeyCreation * iam.allowedPolicyMemberDomains * compute.vmExternalIpAccess * appengine.enforceServiceAccountActAsCheck * gcp.resourceLocations * compute.trustedImageProjects * compute.skipDefaultNetworkCreation * compute.requireOsLogin * compute.disableNestedVirtualization This RPC only returns either resources of types supported by [searchable asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types), or IAM policies.", + // "description": "Analyzes organization policies governed assets (Google Cloud resources or policies) under a scope. This RPC supports custom constraints and the following 10 canned constraints: * storage.uniformBucketLevelAccess * iam.disableServiceAccountKeyCreation * iam.allowedPolicyMemberDomains * compute.vmExternalIpAccess * appengine.enforceServiceAccountActAsCheck * gcp.resourceLocations * compute.trustedImageProjects * compute.skipDefaultNetworkCreation * compute.requireOsLogin * compute.disableNestedVirtualization This RPC only returns either resources of types supported by [searchable asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types), or IAM policies.", // "flatPath": "v1/{v1Id}/{v1Id1}:analyzeOrgPolicyGovernedAssets", // "httpMethod": "GET", // "id": "cloudasset.analyzeOrgPolicyGovernedAssets", @@ -10547,8 +10557,8 @@ func (c *V1BatchGetAssetsHistoryCall) AssetNames(assetNames ...string) *V1BatchG // "CONTENT_TYPE_UNSPECIFIED" - Unspecified content type. // "RESOURCE" - Resource metadata. // "IAM_POLICY" - The actual IAM policy set on a resource. -// "ORG_POLICY" - The Cloud Organization Policy set on an asset. -// "ACCESS_POLICY" - The Cloud Access context manager Policy set on an +// "ORG_POLICY" - The organization policy set on an asset. +// "ACCESS_POLICY" - The Access Context Manager policy set on an // // asset. // @@ -10722,8 +10732,8 @@ func (c *V1BatchGetAssetsHistoryCall) Do(opts ...googleapi.CallOption) (*BatchGe // "Unspecified content type.", // "Resource metadata.", // "The actual IAM policy set on a resource.", - // "The Cloud Organization Policy set on an asset.", - // "The Cloud Access context manager Policy set on an asset.", + // "The organization policy set on an asset.", + // "The Access Context Manager policy set on an asset.", // "The runtime OS Inventory information.", // "The related resources." // ], @@ -11166,11 +11176,10 @@ func (c *V1SearchAllIamPoliciesCall) PageToken(pageToken string) *V1SearchAllIam // (https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) // for more information. If not specified or empty, it will search all // the IAM policies within the specified `scope`. Note that the query -// string is compared against each Cloud IAM policy binding, including -// its principals, roles, and Cloud IAM conditions. The returned Cloud -// IAM policies will only contain the bindings that match your query. To -// learn more about the IAM policy structure, see the IAM policy -// documentation +// string is compared against each IAM policy binding, including its +// principals, roles, and IAM conditions. The returned IAM policies will +// only contain the bindings that match your query. To learn more about +// the IAM policy structure, see the IAM policy documentation // (https://cloud.google.com/iam/help/allow-policies/structure). // Examples: * `policy:amy@gmail.com` to find IAM policy bindings that // specify user "amy@gmail.com". * `policy:roles/compute.admin` to find @@ -11334,7 +11343,7 @@ func (c *V1SearchAllIamPoliciesCall) Do(opts ...googleapi.CallOption) (*SearchAl // "type": "string" // }, // "query": { - // "description": "Optional. The query statement. See [how to construct a query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) for more information. If not specified or empty, it will search all the IAM policies within the specified `scope`. Note that the query string is compared against each Cloud IAM policy binding, including its principals, roles, and Cloud IAM conditions. The returned Cloud IAM policies will only contain the bindings that match your query. To learn more about the IAM policy structure, see the [IAM policy documentation](https://cloud.google.com/iam/help/allow-policies/structure). Examples: * `policy:amy@gmail.com` to find IAM policy bindings that specify user \"amy@gmail.com\". * `policy:roles/compute.admin` to find IAM policy bindings that specify the Compute Admin role. * `policy:comp*` to find IAM policy bindings that contain \"comp\" as a prefix of any word in the binding. * `policy.role.permissions:storage.buckets.update` to find IAM policy bindings that specify a role containing \"storage.buckets.update\" permission. Note that if callers don't have `iam.roles.get` access to a role's included permissions, policy bindings that specify this role will be dropped from the search results. * `policy.role.permissions:upd*` to find IAM policy bindings that specify a role containing \"upd\" as a prefix of any word in the role permission. Note that if callers don't have `iam.roles.get` access to a role's included permissions, policy bindings that specify this role will be dropped from the search results. * `resource:organizations/123456` to find IAM policy bindings that are set on \"organizations/123456\". * `resource=//cloudresourcemanager.googleapis.com/projects/myproject` to find IAM policy bindings that are set on the project named \"myproject\". * `Important` to find IAM policy bindings that contain \"Important\" as a word in any of the searchable fields (except for the included permissions). * `resource:(instance1 OR instance2) policy:amy` to find IAM policy bindings that are set on resources \"instance1\" or \"instance2\" and also specify user \"amy\". * `roles:roles/compute.admin` to find IAM policy bindings that specify the Compute Admin role. * `memberTypes:user` to find IAM policy bindings that contain the principal type \"user\".", + // "description": "Optional. The query statement. See [how to construct a query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) for more information. If not specified or empty, it will search all the IAM policies within the specified `scope`. Note that the query string is compared against each IAM policy binding, including its principals, roles, and IAM conditions. The returned IAM policies will only contain the bindings that match your query. To learn more about the IAM policy structure, see the [IAM policy documentation](https://cloud.google.com/iam/help/allow-policies/structure). Examples: * `policy:amy@gmail.com` to find IAM policy bindings that specify user \"amy@gmail.com\". * `policy:roles/compute.admin` to find IAM policy bindings that specify the Compute Admin role. * `policy:comp*` to find IAM policy bindings that contain \"comp\" as a prefix of any word in the binding. * `policy.role.permissions:storage.buckets.update` to find IAM policy bindings that specify a role containing \"storage.buckets.update\" permission. Note that if callers don't have `iam.roles.get` access to a role's included permissions, policy bindings that specify this role will be dropped from the search results. * `policy.role.permissions:upd*` to find IAM policy bindings that specify a role containing \"upd\" as a prefix of any word in the role permission. Note that if callers don't have `iam.roles.get` access to a role's included permissions, policy bindings that specify this role will be dropped from the search results. * `resource:organizations/123456` to find IAM policy bindings that are set on \"organizations/123456\". * `resource=//cloudresourcemanager.googleapis.com/projects/myproject` to find IAM policy bindings that are set on the project named \"myproject\". * `Important` to find IAM policy bindings that contain \"Important\" as a word in any of the searchable fields (except for the included permissions). * `resource:(instance1 OR instance2) policy:amy` to find IAM policy bindings that are set on resources \"instance1\" or \"instance2\" and also specify user \"amy\". * `roles:roles/compute.admin` to find IAM policy bindings that specify the Compute Admin role. * `memberTypes:user` to find IAM policy bindings that contain the principal type \"user\".", // "location": "query", // "type": "string" // }, @@ -11389,10 +11398,11 @@ type V1SearchAllResourcesCall struct { header_ http.Header } -// SearchAllResources: Searches all Cloud resources within the specified -// scope, such as a project, folder, or organization. The caller must be -// granted the `cloudasset.assets.searchAllResources` permission on the -// desired scope, otherwise the request will be rejected. +// SearchAllResources: Searches all Google Cloud resources within the +// specified scope, such as a project, folder, or organization. The +// caller must be granted the `cloudasset.assets.searchAllResources` +// permission on the desired scope, otherwise the request will be +// rejected. // // - scope: A scope can be a project, a folder, or an organization. The // search is limited to the resources within the `scope`. The caller @@ -11468,43 +11478,47 @@ func (c *V1SearchAllResourcesCall) PageToken(pageToken string) *V1SearchAllResou // (https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) // for more information. If not specified or empty, it will search all // the resources within the specified `scope`. Examples: * -// `name:Important` to find Cloud resources whose name contains -// "Important" as a word. * `name=Important` to find the Cloud resource -// whose name is exactly "Important". * `displayName:Impor*` to find -// Cloud resources whose display name contains "Impor" as a prefix of -// any word in the field. * `location:us-west*` to find Cloud resources -// whose location contains both "us" and "west" as prefixes. * -// `labels:prod` to find Cloud resources whose labels contain "prod" as -// a key or value. * `labels.env:prod` to find Cloud resources that have -// a label "env" and its value is "prod". * `labels.env:*` to find Cloud -// resources that have a label "env". * `kmsKey:key` to find Cloud -// resources encrypted with a customer-managed encryption key whose name -// contains "key" as a word. This field is deprecated. Please use the -// `kmsKeys` field to retrieve KMS key information. * `kmsKeys:key` to -// find Cloud resources encrypted with customer-managed encryption keys -// whose name contains the word "key". * -// `relationships:instance-group-1` to find Cloud resources that have -// relationships with "instance-group-1" in the related resource name. * -// `relationships:INSTANCE_TO_INSTANCEGROUP` to find compute instances -// that have relationships of type "INSTANCE_TO_INSTANCEGROUP". * +// `name:Important` to find Google Cloud resources whose name contains +// "Important" as a word. * `name=Important` to find the Google Cloud +// resource whose name is exactly "Important". * `displayName:Impor*` to +// find Google Cloud resources whose display name contains "Impor" as a +// prefix of any word in the field. * `location:us-west*` to find Google +// Cloud resources whose location contains both "us" and "west" as +// prefixes. * `labels:prod` to find Google Cloud resources whose labels +// contain "prod" as a key or value. * `labels.env:prod` to find Google +// Cloud resources that have a label "env" and its value is "prod". * +// `labels.env:*` to find Google Cloud resources that have a label +// "env". * `kmsKey:key` to find Google Cloud resources encrypted with a +// customer-managed encryption key whose name contains "key" as a word. +// This field is deprecated. Please use the `kmsKeys` field to retrieve +// Cloud KMS key information. * `kmsKeys:key` to find Google Cloud +// resources encrypted with customer-managed encryption keys whose name +// contains the word "key". * `relationships:instance-group-1` to find +// Google Cloud resources that have relationships with +// "instance-group-1" in the related resource name. * +// `relationships:INSTANCE_TO_INSTANCEGROUP` to find Compute Engine +// instances that have relationships of type +// "INSTANCE_TO_INSTANCEGROUP". * // `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find -// compute instances that have relationships with "instance-group-1" in -// the compute instance group resource name, for relationship type -// "INSTANCE_TO_INSTANCEGROUP". * `state:ACTIVE` to find Cloud resources -// whose state contains "ACTIVE" as a word. * `NOT state:ACTIVE` to find -// Cloud resources whose state doesn't contain "ACTIVE" as a word. * -// `createTime<1609459200` to find Cloud resources that were created -// before "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp -// of "2021-01-01 00:00:00 UTC" in seconds. * `updateTime>1609459200` to -// find Cloud resources that were updated after "2021-01-01 00:00:00 -// UTC". 1609459200 is the epoch timestamp of "2021-01-01 00:00:00 UTC" -// in seconds. * `Important` to find Cloud resources that contain -// "Important" as a word in any of the searchable fields. * `Impor*` to -// find Cloud resources that contain "Impor" as a prefix of any word in -// any of the searchable fields. * `Important location:(us-west1 OR -// global)` to find Cloud resources that contain "Important" as a word -// in any of the searchable fields and are also located in the -// "us-west1" region or the "global" location. +// Compute Engine instances that have relationships with +// "instance-group-1" in the Compute Engine instance group resource +// name, for relationship type "INSTANCE_TO_INSTANCEGROUP". * +// `state:ACTIVE` to find Google Cloud resources whose state contains +// "ACTIVE" as a word. * `NOT state:ACTIVE` to find Google Cloud +// resources whose state doesn't contain "ACTIVE" as a word. * +// `createTime<1609459200` to find Google Cloud resources that were +// created before "2021-01-01 00:00:00 UTC". 1609459200 is the epoch +// timestamp of "2021-01-01 00:00:00 UTC" in seconds. * +// `updateTime>1609459200` to find Google Cloud resources that were +// updated after "2021-01-01 00:00:00 UTC". 1609459200 is the epoch +// timestamp of "2021-01-01 00:00:00 UTC" in seconds. * `Important` to +// find Google Cloud resources that contain "Important" as a word in any +// of the searchable fields. * `Impor*` to find Google Cloud resources +// that contain "Impor" as a prefix of any word in any of the searchable +// fields. * `Important location:(us-west1 OR global)` to find Google +// Cloud resources that contain "Important" as a word in any of the +// searchable fields and are also located in the "us-west1" region or +// the "global" location. func (c *V1SearchAllResourcesCall) Query(query string) *V1SearchAllResourcesCall { c.urlParams_.Set("query", query) return c @@ -11520,12 +11534,12 @@ func (c *V1SearchAllResourcesCall) Query(query string) *V1SearchAllResourcesCall // supported): * name * assetType * project * displayName * description // * location * tagKeys * tagValues * tagValueIds * labels * networkTags // * kmsKey (This field is deprecated. Please use the `kmsKeys` field to -// retrieve KMS key information.) * kmsKeys * createTime * updateTime * -// state * additionalAttributes * versionedResources If read_mask is not -// specified, all fields except versionedResources will be returned. If -// only '*' is specified, all fields including versionedResources will -// be returned. Any invalid field path will trigger INVALID_ARGUMENT -// error. +// retrieve Cloud KMS key information.) * kmsKeys * createTime * +// updateTime * state * additionalAttributes * versionedResources If +// read_mask is not specified, all fields except versionedResources will +// be returned. If only '*' is specified, all fields including +// versionedResources will be returned. Any invalid field path will +// trigger INVALID_ARGUMENT error. func (c *V1SearchAllResourcesCall) ReadMask(readMask string) *V1SearchAllResourcesCall { c.urlParams_.Set("readMask", readMask) return c @@ -11630,7 +11644,7 @@ func (c *V1SearchAllResourcesCall) Do(opts ...googleapi.CallOption) (*SearchAllR } return ret, nil // { - // "description": "Searches all Cloud resources within the specified scope, such as a project, folder, or organization. The caller must be granted the `cloudasset.assets.searchAllResources` permission on the desired scope, otherwise the request will be rejected.", + // "description": "Searches all Google Cloud resources within the specified scope, such as a project, folder, or organization. The caller must be granted the `cloudasset.assets.searchAllResources` permission on the desired scope, otherwise the request will be rejected.", // "flatPath": "v1/{v1Id}/{v1Id1}:searchAllResources", // "httpMethod": "GET", // "id": "cloudasset.searchAllResources", @@ -11661,12 +11675,12 @@ func (c *V1SearchAllResourcesCall) Do(opts ...googleapi.CallOption) (*SearchAllR // "type": "string" // }, // "query": { - // "description": "Optional. The query statement. See [how to construct a query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) for more information. If not specified or empty, it will search all the resources within the specified `scope`. Examples: * `name:Important` to find Cloud resources whose name contains \"Important\" as a word. * `name=Important` to find the Cloud resource whose name is exactly \"Important\". * `displayName:Impor*` to find Cloud resources whose display name contains \"Impor\" as a prefix of any word in the field. * `location:us-west*` to find Cloud resources whose location contains both \"us\" and \"west\" as prefixes. * `labels:prod` to find Cloud resources whose labels contain \"prod\" as a key or value. * `labels.env:prod` to find Cloud resources that have a label \"env\" and its value is \"prod\". * `labels.env:*` to find Cloud resources that have a label \"env\". * `kmsKey:key` to find Cloud resources encrypted with a customer-managed encryption key whose name contains \"key\" as a word. This field is deprecated. Please use the `kmsKeys` field to retrieve KMS key information. * `kmsKeys:key` to find Cloud resources encrypted with customer-managed encryption keys whose name contains the word \"key\". * `relationships:instance-group-1` to find Cloud resources that have relationships with \"instance-group-1\" in the related resource name. * `relationships:INSTANCE_TO_INSTANCEGROUP` to find compute instances that have relationships of type \"INSTANCE_TO_INSTANCEGROUP\". * `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find compute instances that have relationships with \"instance-group-1\" in the compute instance group resource name, for relationship type \"INSTANCE_TO_INSTANCEGROUP\". * `state:ACTIVE` to find Cloud resources whose state contains \"ACTIVE\" as a word. * `NOT state:ACTIVE` to find Cloud resources whose state doesn't contain \"ACTIVE\" as a word. * `createTime\u003c1609459200` to find Cloud resources that were created before \"2021-01-01 00:00:00 UTC\". 1609459200 is the epoch timestamp of \"2021-01-01 00:00:00 UTC\" in seconds. * `updateTime\u003e1609459200` to find Cloud resources that were updated after \"2021-01-01 00:00:00 UTC\". 1609459200 is the epoch timestamp of \"2021-01-01 00:00:00 UTC\" in seconds. * `Important` to find Cloud resources that contain \"Important\" as a word in any of the searchable fields. * `Impor*` to find Cloud resources that contain \"Impor\" as a prefix of any word in any of the searchable fields. * `Important location:(us-west1 OR global)` to find Cloud resources that contain \"Important\" as a word in any of the searchable fields and are also located in the \"us-west1\" region or the \"global\" location.", + // "description": "Optional. The query statement. See [how to construct a query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) for more information. If not specified or empty, it will search all the resources within the specified `scope`. Examples: * `name:Important` to find Google Cloud resources whose name contains \"Important\" as a word. * `name=Important` to find the Google Cloud resource whose name is exactly \"Important\". * `displayName:Impor*` to find Google Cloud resources whose display name contains \"Impor\" as a prefix of any word in the field. * `location:us-west*` to find Google Cloud resources whose location contains both \"us\" and \"west\" as prefixes. * `labels:prod` to find Google Cloud resources whose labels contain \"prod\" as a key or value. * `labels.env:prod` to find Google Cloud resources that have a label \"env\" and its value is \"prod\". * `labels.env:*` to find Google Cloud resources that have a label \"env\". * `kmsKey:key` to find Google Cloud resources encrypted with a customer-managed encryption key whose name contains \"key\" as a word. This field is deprecated. Please use the `kmsKeys` field to retrieve Cloud KMS key information. * `kmsKeys:key` to find Google Cloud resources encrypted with customer-managed encryption keys whose name contains the word \"key\". * `relationships:instance-group-1` to find Google Cloud resources that have relationships with \"instance-group-1\" in the related resource name. * `relationships:INSTANCE_TO_INSTANCEGROUP` to find Compute Engine instances that have relationships of type \"INSTANCE_TO_INSTANCEGROUP\". * `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find Compute Engine instances that have relationships with \"instance-group-1\" in the Compute Engine instance group resource name, for relationship type \"INSTANCE_TO_INSTANCEGROUP\". * `state:ACTIVE` to find Google Cloud resources whose state contains \"ACTIVE\" as a word. * `NOT state:ACTIVE` to find Google Cloud resources whose state doesn't contain \"ACTIVE\" as a word. * `createTime\u003c1609459200` to find Google Cloud resources that were created before \"2021-01-01 00:00:00 UTC\". 1609459200 is the epoch timestamp of \"2021-01-01 00:00:00 UTC\" in seconds. * `updateTime\u003e1609459200` to find Google Cloud resources that were updated after \"2021-01-01 00:00:00 UTC\". 1609459200 is the epoch timestamp of \"2021-01-01 00:00:00 UTC\" in seconds. * `Important` to find Google Cloud resources that contain \"Important\" as a word in any of the searchable fields. * `Impor*` to find Google Cloud resources that contain \"Impor\" as a prefix of any word in any of the searchable fields. * `Important location:(us-west1 OR global)` to find Google Cloud resources that contain \"Important\" as a word in any of the searchable fields and are also located in the \"us-west1\" region or the \"global\" location.", // "location": "query", // "type": "string" // }, // "readMask": { - // "description": "Optional. A comma-separated list of fields specifying which fields to be returned in ResourceSearchResult. Only '*' or combination of top level fields can be specified. Field names of both snake_case and camelCase are supported. Examples: `\"*\"`, `\"name,location\"`, `\"name,versionedResources\"`. The read_mask paths must be valid field paths listed but not limited to (both snake_case and camelCase are supported): * name * assetType * project * displayName * description * location * tagKeys * tagValues * tagValueIds * labels * networkTags * kmsKey (This field is deprecated. Please use the `kmsKeys` field to retrieve KMS key information.) * kmsKeys * createTime * updateTime * state * additionalAttributes * versionedResources If read_mask is not specified, all fields except versionedResources will be returned. If only '*' is specified, all fields including versionedResources will be returned. Any invalid field path will trigger INVALID_ARGUMENT error.", + // "description": "Optional. A comma-separated list of fields specifying which fields to be returned in ResourceSearchResult. Only '*' or combination of top level fields can be specified. Field names of both snake_case and camelCase are supported. Examples: `\"*\"`, `\"name,location\"`, `\"name,versionedResources\"`. The read_mask paths must be valid field paths listed but not limited to (both snake_case and camelCase are supported): * name * assetType * project * displayName * description * location * tagKeys * tagValues * tagValueIds * labels * networkTags * kmsKey (This field is deprecated. Please use the `kmsKeys` field to retrieve Cloud KMS key information.) * kmsKeys * createTime * updateTime * state * additionalAttributes * versionedResources If read_mask is not specified, all fields except versionedResources will be returned. If only '*' is specified, all fields including versionedResources will be returned. Any invalid field path will trigger INVALID_ARGUMENT error.", // "format": "google-fieldmask", // "location": "query", // "type": "string" diff --git a/cloudasset/v1beta1/cloudasset-api.json b/cloudasset/v1beta1/cloudasset-api.json index 956c8f485bb..7ad9abe9b70 100644 --- a/cloudasset/v1beta1/cloudasset-api.json +++ b/cloudasset/v1beta1/cloudasset-api.json @@ -12,7 +12,7 @@ "baseUrl": "https://cloudasset.googleapis.com/", "batchPath": "batch", "canonicalName": "Cloud Asset", - "description": "The cloud asset API manages the history and inventory of cloud resources.", + "description": "The Cloud Asset API manages the history and inventory of Google Cloud resources.", "discoveryVersion": "v1", "documentationLink": "https://cloud.google.com/asset-inventory/docs/quickstart", "fullyEncodeReservedExpansion": true, @@ -411,11 +411,11 @@ } } }, - "revision": "20221114", + "revision": "20230114", "rootUrl": "https://cloudasset.googleapis.com/", "schemas": { "AnalyzeIamPolicyLongrunningMetadata": { - "description": "Represents the metadata of the longrunning operation for the AnalyzeIamPolicyLongrunning rpc.", + "description": "Represents the metadata of the longrunning operation for the AnalyzeIamPolicyLongrunning RPC.", "id": "AnalyzeIamPolicyLongrunningMetadata", "properties": { "createTime": { @@ -434,7 +434,7 @@ "type": "object" }, "Asset": { - "description": "An asset in Google Cloud. An asset can be any resource in the Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy). See [Supported asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information.", + "description": "An asset in Google Cloud. An asset can be any resource in the Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. IAM policy). See [Supported asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information.", "id": "Asset", "properties": { "accessLevel": { @@ -451,7 +451,7 @@ }, "iamPolicy": { "$ref": "Policy", - "description": "A representation of the Cloud IAM policy set on a Google Cloud resource. There can be a maximum of one Cloud IAM policy set on any given resource. In addition, Cloud IAM policies inherit their granted access scope from any policies set on parent resources in the resource hierarchy. Therefore, the effectively policy is the union of both the policy set on this resource and each policy set on all of the resource's ancestry resource levels in the hierarchy. See [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance) for more information." + "description": "A representation of the IAM policy set on a Google Cloud resource. There can be a maximum of one IAM policy set on any given resource. In addition, IAM policies inherit their granted access scope from any policies set on parent resources in the resource hierarchy. Therefore, the effectively policy is the union of both the policy set on this resource and each policy set on all of the resource's ancestry resource levels in the hierarchy. See [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance) for more information." }, "name": { "description": "The full name of the asset. Example: `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` See [Resource names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information.", @@ -624,18 +624,18 @@ "id": "GcsDestination", "properties": { "uri": { - "description": "The uri of the Cloud Storage object. It's the same uri that is used by gsutil. For example: \"gs://bucket_name/object_name\". See [Viewing and Editing Object Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) for more information.", + "description": "The URI of the Cloud Storage object. It's the same URI that is used by gsutil. For example: \"gs://bucket_name/object_name\". See [Viewing and Editing Object Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) for more information.", "type": "string" }, "uriPrefix": { - "description": "The uri prefix of all generated Cloud Storage objects. For example: \"gs://bucket_name/object_name_prefix\". Each object uri is in format: \"gs://bucket_name/object_name_prefix// and only contains assets for that type. starts from 0. For example: \"gs://bucket_name/object_name_prefix/google.compute.disk/0\" is the first shard of output objects containing all google.compute.disk assets. An INVALID_ARGUMENT error will be returned if file with the same name \"gs://bucket_name/object_name_prefix\" already exists.", + "description": "The URI prefix of all generated Cloud Storage objects. For example: \"gs://bucket_name/object_name_prefix\". Each object URI is in format: \"gs://bucket_name/object_name_prefix// and only contains assets for that type. starts from 0. For example: \"gs://bucket_name/object_name_prefix/google.compute.disk/0\" is the first shard of output objects containing all google.compute.disk assets. An INVALID_ARGUMENT error will be returned if file with the same name \"gs://bucket_name/object_name_prefix\" already exists.", "type": "string" } }, "type": "object" }, "GoogleCloudAssetV1p7beta1Asset": { - "description": "An asset in Google Cloud. An asset can be any resource in the Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy). See [Supported asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information.", + "description": "An asset in Google Cloud. An asset can be any resource in the Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. IAM policy). See [Supported asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information.", "id": "GoogleCloudAssetV1p7beta1Asset", "properties": { "accessLevel": { @@ -659,7 +659,7 @@ }, "iamPolicy": { "$ref": "Policy", - "description": "A representation of the Cloud IAM policy set on a Google Cloud resource. There can be a maximum of one Cloud IAM policy set on any given resource. In addition, Cloud IAM policies inherit their granted access scope from any policies set on parent resources in the resource hierarchy. Therefore, the effectively policy is the union of both the policy set on this resource and each policy set on all of the resource's ancestry resource levels in the hierarchy. See [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance) for more information." + "description": "A representation of the IAM policy set on a Google Cloud resource. There can be a maximum of one IAM policy set on any given resource. In addition, IAM policies inherit their granted access scope from any policies set on parent resources in the resource hierarchy. Therefore, the effectively policy is the union of both the policy set on this resource and each policy set on all of the resource's ancestry resource levels in the hierarchy. See [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance) for more information." }, "name": { "description": "The full name of the asset. Example: `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` See [Resource names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information.", @@ -693,7 +693,7 @@ "type": "object" }, "GoogleCloudAssetV1p7beta1RelatedAsset": { - "description": "An asset identify in Google Cloud which contains its name, type and ancestors. An asset can be any resource in the Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy). See [Supported asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information.", + "description": "An asset identify in Google Cloud which contains its name, type and ancestors. An asset can be any resource in the Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. IAM policy). See [Supported asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information.", "id": "GoogleCloudAssetV1p7beta1RelatedAsset", "properties": { "ancestors": { @@ -780,7 +780,7 @@ "type": "string" }, "parent": { - "description": "The full name of the immediate parent of this resource. See [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information. For Google Cloud assets, this value is the parent resource defined in the [Cloud IAM policy hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). Example: `//cloudresourcemanager.googleapis.com/projects/my_project_123` For third-party assets, this field may be set differently.", + "description": "The full name of the immediate parent of this resource. See [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information. For Google Cloud assets, this value is the parent resource defined in the [IAM policy hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). Example: `//cloudresourcemanager.googleapis.com/projects/my_project_123` For third-party assets, this field may be set differently.", "type": "string" }, "resourceUrl": { @@ -1245,7 +1245,7 @@ "type": "string" }, "resource": { - "description": "A Google Cloud resource that is allowed to ingress the perimeter. Requests from these resources will be allowed to access perimeter data. Currently only projects are allowed. Format: `projects/{project_number}` The project may be in any Google Cloud organization, not just the organization that the perimeter is defined in. `*` is not allowed, the case of allowing all Google Cloud resources only is not supported.", + "description": "A Google Cloud resource that is allowed to ingress the perimeter. Requests from these resources will be allowed to access perimeter data. Currently only projects and VPCs are allowed. Project format: `projects/{project_number}` VPC format: `//compute.googleapis.com/projects/{PROJECT_ID}/global/networks/{NAME}`. The project may be in any Google Cloud organization, not just the organization that the perimeter is defined in. `*` is not allowed, the case of allowing all Google Cloud resources only is not supported.", "type": "string" } }, @@ -1393,7 +1393,7 @@ "type": "array" }, "resources": { - "description": "A list of Google Cloud resources that are inside of the service perimeter. Currently only projects are allowed. Format: `projects/{project_number}`", + "description": "A list of Google Cloud resources that are inside of the service perimeter. Currently only projects and VPCs are allowed. Project format: `projects/{project_number}` VPC format: `//compute.googleapis.com/projects/{PROJECT_ID}/global/networks/{NAME}`.", "items": { "type": "string" }, @@ -1529,7 +1529,7 @@ "type": "string" }, "parent": { - "description": "The full name of the immediate parent of this resource. See [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information. For Google Cloud assets, this value is the parent resource defined in the [Cloud IAM policy hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). Example: `//cloudresourcemanager.googleapis.com/projects/my_project_123` For third-party assets, this field may be set differently.", + "description": "The full name of the immediate parent of this resource. See [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information. For Google Cloud assets, this value is the parent resource defined in the [IAM policy hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). Example: `//cloudresourcemanager.googleapis.com/projects/my_project_123` For third-party assets, this field may be set differently.", "type": "string" }, "resourceUrl": { diff --git a/cloudasset/v1beta1/cloudasset-gen.go b/cloudasset/v1beta1/cloudasset-gen.go index 2e0edf7052f..4eebcf120d5 100644 --- a/cloudasset/v1beta1/cloudasset-gen.go +++ b/cloudasset/v1beta1/cloudasset-gen.go @@ -207,7 +207,7 @@ type ProjectsOperationsService struct { } // AnalyzeIamPolicyLongrunningMetadata: Represents the metadata of the -// longrunning operation for the AnalyzeIamPolicyLongrunning rpc. +// longrunning operation for the AnalyzeIamPolicyLongrunning RPC. type AnalyzeIamPolicyLongrunningMetadata struct { // CreateTime: Output only. The time the operation was created. CreateTime string `json:"createTime,omitempty"` @@ -244,8 +244,8 @@ type AnalyzeIamPolicyLongrunningResponse struct { // Google Cloud resource hierarchy // (https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), // a resource outside the Google Cloud resource hierarchy (such as -// Google Kubernetes Engine clusters and objects), or a policy (e.g. -// Cloud IAM policy). See Supported asset types +// Google Kubernetes Engine clusters and objects), or a policy (e.g. IAM +// policy). See Supported asset types // (https://cloud.google.com/asset-inventory/docs/supported-asset-types) // for more information. type Asset struct { @@ -263,15 +263,15 @@ type Asset struct { // for more information. AssetType string `json:"assetType,omitempty"` - // IamPolicy: A representation of the Cloud IAM policy set on a Google - // Cloud resource. There can be a maximum of one Cloud IAM policy set on - // any given resource. In addition, Cloud IAM policies inherit their - // granted access scope from any policies set on parent resources in the - // resource hierarchy. Therefore, the effectively policy is the union of - // both the policy set on this resource and each policy set on all of - // the resource's ancestry resource levels in the hierarchy. See this - // topic (https://cloud.google.com/iam/help/allow-policies/inheritance) - // for more information. + // IamPolicy: A representation of the IAM policy set on a Google Cloud + // resource. There can be a maximum of one IAM policy set on any given + // resource. In addition, IAM policies inherit their granted access + // scope from any policies set on parent resources in the resource + // hierarchy. Therefore, the effectively policy is the union of both the + // policy set on this resource and each policy set on all of the + // resource's ancestry resource levels in the hierarchy. See this topic + // (https://cloud.google.com/iam/help/allow-policies/inheritance) for + // more information. IamPolicy *Policy `json:"iamPolicy,omitempty"` // Name: The full name of the asset. Example: @@ -639,15 +639,15 @@ func (s *Expr) MarshalJSON() ([]byte, error) { // GcsDestination: A Cloud Storage location. type GcsDestination struct { - // Uri: The uri of the Cloud Storage object. It's the same uri that is + // Uri: The URI of the Cloud Storage object. It's the same URI that is // used by gsutil. For example: "gs://bucket_name/object_name". See // Viewing and Editing Object Metadata // (https://cloud.google.com/storage/docs/viewing-editing-metadata) for // more information. Uri string `json:"uri,omitempty"` - // UriPrefix: The uri prefix of all generated Cloud Storage objects. For - // example: "gs://bucket_name/object_name_prefix". Each object uri is in + // UriPrefix: The URI prefix of all generated Cloud Storage objects. For + // example: "gs://bucket_name/object_name_prefix". Each object URI is in // format: "gs://bucket_name/object_name_prefix// and only contains // assets for that type. starts from 0. For example: // "gs://bucket_name/object_name_prefix/google.compute.disk/0" is the @@ -683,8 +683,8 @@ func (s *GcsDestination) MarshalJSON() ([]byte, error) { // can be any resource in the Google Cloud resource hierarchy // (https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), // a resource outside the Google Cloud resource hierarchy (such as -// Google Kubernetes Engine clusters and objects), or a policy (e.g. -// Cloud IAM policy). See Supported asset types +// Google Kubernetes Engine clusters and objects), or a policy (e.g. IAM +// policy). See Supported asset types // (https://cloud.google.com/asset-inventory/docs/supported-asset-types) // for more information. type GoogleCloudAssetV1p7beta1Asset struct { @@ -712,15 +712,15 @@ type GoogleCloudAssetV1p7beta1Asset struct { // for more information. AssetType string `json:"assetType,omitempty"` - // IamPolicy: A representation of the Cloud IAM policy set on a Google - // Cloud resource. There can be a maximum of one Cloud IAM policy set on - // any given resource. In addition, Cloud IAM policies inherit their - // granted access scope from any policies set on parent resources in the - // resource hierarchy. Therefore, the effectively policy is the union of - // both the policy set on this resource and each policy set on all of - // the resource's ancestry resource levels in the hierarchy. See this - // topic (https://cloud.google.com/iam/help/allow-policies/inheritance) - // for more information. + // IamPolicy: A representation of the IAM policy set on a Google Cloud + // resource. There can be a maximum of one IAM policy set on any given + // resource. In addition, IAM policies inherit their granted access + // scope from any policies set on parent resources in the resource + // hierarchy. Therefore, the effectively policy is the union of both the + // policy set on this resource and each policy set on all of the + // resource's ancestry resource levels in the hierarchy. See this topic + // (https://cloud.google.com/iam/help/allow-policies/inheritance) for + // more information. IamPolicy *Policy `json:"iamPolicy,omitempty"` // Name: The full name of the asset. Example: @@ -779,8 +779,8 @@ func (s *GoogleCloudAssetV1p7beta1Asset) MarshalJSON() ([]byte, error) { // any resource in the Google Cloud resource hierarchy // (https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), // a resource outside the Google Cloud resource hierarchy (such as -// Google Kubernetes Engine clusters and objects), or a policy (e.g. -// Cloud IAM policy). See Supported asset types +// Google Kubernetes Engine clusters and objects), or a policy (e.g. IAM +// policy). See Supported asset types // (https://cloud.google.com/asset-inventory/docs/supported-asset-types) // for more information. type GoogleCloudAssetV1p7beta1RelatedAsset struct { @@ -932,7 +932,7 @@ type GoogleCloudAssetV1p7beta1Resource struct { // Resource Names // (https://cloud.google.com/apis/design/resource_names#full_resource_name) // for more information. For Google Cloud assets, this value is the - // parent resource defined in the Cloud IAM policy hierarchy + // parent resource defined in the IAM policy hierarchy // (https://cloud.google.com/iam/docs/overview#policy_hierarchy). // Example: // `//cloudresourcemanager.googleapis.com/projects/my_project_123` For @@ -1880,11 +1880,13 @@ type GoogleIdentityAccesscontextmanagerV1IngressSource struct { // Resource: A Google Cloud resource that is allowed to ingress the // perimeter. Requests from these resources will be allowed to access - // perimeter data. Currently only projects are allowed. Format: - // `projects/{project_number}` The project may be in any Google Cloud - // organization, not just the organization that the perimeter is defined - // in. `*` is not allowed, the case of allowing all Google Cloud - // resources only is not supported. + // perimeter data. Currently only projects and VPCs are allowed. Project + // format: `projects/{project_number}` VPC format: + // `//compute.googleapis.com/projects/{PROJECT_ID}/global/networks/{NAME} + // `. The project may be in any Google Cloud organization, not just the + // organization that the perimeter is defined in. `*` is not allowed, + // the case of allowing all Google Cloud resources only is not + // supported. Resource string `json:"resource,omitempty"` // ForceSendFields is a list of field names (e.g. "AccessLevel") to @@ -2152,8 +2154,10 @@ type GoogleIdentityAccesscontextmanagerV1ServicePerimeterConfig struct { IngressPolicies []*GoogleIdentityAccesscontextmanagerV1IngressPolicy `json:"ingressPolicies,omitempty"` // Resources: A list of Google Cloud resources that are inside of the - // service perimeter. Currently only projects are allowed. Format: - // `projects/{project_number}` + // service perimeter. Currently only projects and VPCs are allowed. + // Project format: `projects/{project_number}` VPC format: + // `//compute.googleapis.com/projects/{PROJECT_ID}/global/networks/{NAME} + // `. Resources []string `json:"resources,omitempty"` // RestrictedServices: Google Cloud services that are subject to the @@ -2447,7 +2451,7 @@ type Resource struct { // Resource Names // (https://cloud.google.com/apis/design/resource_names#full_resource_name) // for more information. For Google Cloud assets, this value is the - // parent resource defined in the Cloud IAM policy hierarchy + // parent resource defined in the IAM policy hierarchy // (https://cloud.google.com/iam/docs/overview#policy_hierarchy). // Example: // `//cloudresourcemanager.googleapis.com/projects/my_project_123` For diff --git a/cloudasset/v1p1beta1/cloudasset-api.json b/cloudasset/v1p1beta1/cloudasset-api.json index 0844329ba14..ab78dd6c3df 100644 --- a/cloudasset/v1p1beta1/cloudasset-api.json +++ b/cloudasset/v1p1beta1/cloudasset-api.json @@ -12,7 +12,7 @@ "baseUrl": "https://cloudasset.googleapis.com/", "batchPath": "batch", "canonicalName": "Cloud Asset", - "description": "The cloud asset API manages the history and inventory of cloud resources.", + "description": "The Cloud Asset API manages the history and inventory of Google Cloud resources.", "discoveryVersion": "v1", "documentationLink": "https://cloud.google.com/asset-inventory/docs/quickstart", "fullyEncodeReservedExpansion": true, @@ -108,7 +108,7 @@ "iamPolicies": { "methods": { "searchAll": { - "description": "Searches all the IAM policies within a given accessible CRM scope (project/folder/organization). This RPC gives callers especially administrators the ability to search all the IAM policies within a scope, even if they don't have `.getIamPolicy` permission of all the IAM policies. Callers should have `cloud.assets.SearchAllIamPolicies` permission on the requested scope, otherwise the request will be rejected.", + "description": "Searches all the IAM policies within a given accessible Resource Manager scope (project/folder/organization). This RPC gives callers especially administrators the ability to search all the IAM policies within a scope, even if they don't have `.getIamPolicy` permission of all the IAM policies. Callers should have `cloud.assets.SearchAllIamPolicies` permission on the requested scope, otherwise the request will be rejected.", "flatPath": "v1p1beta1/{v1p1beta1Id}/{v1p1beta1Id1}/iamPolicies:searchAll", "httpMethod": "GET", "id": "cloudasset.iamPolicies.searchAll", @@ -133,7 +133,7 @@ "type": "string" }, "scope": { - "description": "Required. The relative name of an asset. The search is limited to the resources within the `scope`. The allowed value must be: * Organization number (such as \"organizations/123\") * Folder number(such as \"folders/1234\") * Project number (such as \"projects/12345\") * Project id (such as \"projects/abc\")", + "description": "Required. The relative name of an asset. The search is limited to the resources within the `scope`. The allowed value must be: * Organization number (such as \"organizations/123\") * Folder number (such as \"folders/1234\") * Project number (such as \"projects/12345\") * Project ID (such as \"projects/abc\")", "location": "path", "pattern": "^[^/]+/[^/]+$", "required": true, @@ -153,7 +153,7 @@ "resources": { "methods": { "searchAll": { - "description": "Searches all the resources within a given accessible CRM scope (project/folder/organization). This RPC gives callers especially administrators the ability to search all the resources within a scope, even if they don't have `.get` permission of all the resources. Callers should have `cloud.assets.SearchAllResources` permission on the requested scope, otherwise the request will be rejected.", + "description": "Searches all the resources within a given accessible Resource Manager scope (project/folder/organization). This RPC gives callers especially administrators the ability to search all the resources within a scope, even if they don't have `.get` permission of all the resources. Callers should have `cloud.assets.SearchAllResources` permission on the requested scope, otherwise the request will be rejected.", "flatPath": "v1p1beta1/{v1p1beta1Id}/{v1p1beta1Id1}/resources:searchAll", "httpMethod": "GET", "id": "cloudasset.resources.searchAll", @@ -189,7 +189,7 @@ "type": "string" }, "scope": { - "description": "Required. The relative name of an asset. The search is limited to the resources within the `scope`. The allowed value must be: * Organization number (such as \"organizations/123\") * Folder number(such as \"folders/1234\") * Project number (such as \"projects/12345\") * Project id (such as \"projects/abc\")", + "description": "Required. The relative name of an asset. The search is limited to the resources within the `scope`. The allowed value must be: * Organization number (such as \"organizations/123\") * Folder number (such as \"folders/1234\") * Project number (such as \"projects/12345\") * Project ID (such as \"projects/abc\")", "location": "path", "pattern": "^[^/]+/[^/]+$", "required": true, @@ -207,11 +207,11 @@ } } }, - "revision": "20221114", + "revision": "20230114", "rootUrl": "https://cloudasset.googleapis.com/", "schemas": { "AnalyzeIamPolicyLongrunningMetadata": { - "description": "Represents the metadata of the longrunning operation for the AnalyzeIamPolicyLongrunning rpc.", + "description": "Represents the metadata of the longrunning operation for the AnalyzeIamPolicyLongrunning RPC.", "id": "AnalyzeIamPolicyLongrunningMetadata", "properties": { "createTime": { @@ -337,7 +337,7 @@ "type": "object" }, "GoogleCloudAssetV1p7beta1Asset": { - "description": "An asset in Google Cloud. An asset can be any resource in the Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy). See [Supported asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information.", + "description": "An asset in Google Cloud. An asset can be any resource in the Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. IAM policy). See [Supported asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information.", "id": "GoogleCloudAssetV1p7beta1Asset", "properties": { "accessLevel": { @@ -361,7 +361,7 @@ }, "iamPolicy": { "$ref": "Policy", - "description": "A representation of the Cloud IAM policy set on a Google Cloud resource. There can be a maximum of one Cloud IAM policy set on any given resource. In addition, Cloud IAM policies inherit their granted access scope from any policies set on parent resources in the resource hierarchy. Therefore, the effectively policy is the union of both the policy set on this resource and each policy set on all of the resource's ancestry resource levels in the hierarchy. See [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance) for more information." + "description": "A representation of the IAM policy set on a Google Cloud resource. There can be a maximum of one IAM policy set on any given resource. In addition, IAM policies inherit their granted access scope from any policies set on parent resources in the resource hierarchy. Therefore, the effectively policy is the union of both the policy set on this resource and each policy set on all of the resource's ancestry resource levels in the hierarchy. See [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance) for more information." }, "name": { "description": "The full name of the asset. Example: `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` See [Resource names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information.", @@ -395,7 +395,7 @@ "type": "object" }, "GoogleCloudAssetV1p7beta1RelatedAsset": { - "description": "An asset identify in Google Cloud which contains its name, type and ancestors. An asset can be any resource in the Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy). See [Supported asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information.", + "description": "An asset identify in Google Cloud which contains its name, type and ancestors. An asset can be any resource in the Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. IAM policy). See [Supported asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information.", "id": "GoogleCloudAssetV1p7beta1RelatedAsset", "properties": { "ancestors": { @@ -482,7 +482,7 @@ "type": "string" }, "parent": { - "description": "The full name of the immediate parent of this resource. See [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information. For Google Cloud assets, this value is the parent resource defined in the [Cloud IAM policy hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). Example: `//cloudresourcemanager.googleapis.com/projects/my_project_123` For third-party assets, this field may be set differently.", + "description": "The full name of the immediate parent of this resource. See [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information. For Google Cloud assets, this value is the parent resource defined in the [IAM policy hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). Example: `//cloudresourcemanager.googleapis.com/projects/my_project_123` For third-party assets, this field may be set differently.", "type": "string" }, "resourceUrl": { @@ -947,7 +947,7 @@ "type": "string" }, "resource": { - "description": "A Google Cloud resource that is allowed to ingress the perimeter. Requests from these resources will be allowed to access perimeter data. Currently only projects are allowed. Format: `projects/{project_number}` The project may be in any Google Cloud organization, not just the organization that the perimeter is defined in. `*` is not allowed, the case of allowing all Google Cloud resources only is not supported.", + "description": "A Google Cloud resource that is allowed to ingress the perimeter. Requests from these resources will be allowed to access perimeter data. Currently only projects and VPCs are allowed. Project format: `projects/{project_number}` VPC format: `//compute.googleapis.com/projects/{PROJECT_ID}/global/networks/{NAME}`. The project may be in any Google Cloud organization, not just the organization that the perimeter is defined in. `*` is not allowed, the case of allowing all Google Cloud resources only is not supported.", "type": "string" } }, @@ -1095,7 +1095,7 @@ "type": "array" }, "resources": { - "description": "A list of Google Cloud resources that are inside of the service perimeter. Currently only projects are allowed. Format: `projects/{project_number}`", + "description": "A list of Google Cloud resources that are inside of the service perimeter. Currently only projects and VPCs are allowed. Project format: `projects/{project_number}` VPC format: `//compute.googleapis.com/projects/{PROJECT_ID}/global/networks/{NAME}`.", "items": { "type": "string" }, @@ -1210,7 +1210,7 @@ "type": "string" }, "results": { - "description": "A list of IamPolicy that match the search query. Related information such as the associated resource is returned along with the policy.", + "description": "A list of IAM policies that match the search query. Related information such as the associated resource is returned along with the policy.", "items": { "$ref": "IamPolicySearchResult" }, @@ -1264,7 +1264,7 @@ "additionalProperties": { "type": "string" }, - "description": "Labels associated with this resource. See [Labelling and grouping GCP resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) for more information.", + "description": "Labels associated with this resource. See [Labelling and grouping Google Cloud resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) for more information.", "type": "object" }, "location": { @@ -1276,7 +1276,7 @@ "type": "string" }, "networkTags": { - "description": "Network tags associated with this resource. Like labels, network tags are a type of annotations used to group GCP resources. See [Labelling GCP resources](lhttps://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) for more information.", + "description": "Network tags associated with this resource. Like labels, network tags are a type of annotations used to group Google Cloud resources. See [Labelling Google Cloud resources](lhttps://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) for more information.", "items": { "type": "string" }, diff --git a/cloudasset/v1p1beta1/cloudasset-gen.go b/cloudasset/v1p1beta1/cloudasset-gen.go index e7f51fe28c9..e2b9a093c75 100644 --- a/cloudasset/v1p1beta1/cloudasset-gen.go +++ b/cloudasset/v1p1beta1/cloudasset-gen.go @@ -159,7 +159,7 @@ type ResourcesService struct { } // AnalyzeIamPolicyLongrunningMetadata: Represents the metadata of the -// longrunning operation for the AnalyzeIamPolicyLongrunning rpc. +// longrunning operation for the AnalyzeIamPolicyLongrunning RPC. type AnalyzeIamPolicyLongrunningMetadata struct { // CreateTime: Output only. The time the operation was created. CreateTime string `json:"createTime,omitempty"` @@ -465,8 +465,8 @@ func (s *Expr) MarshalJSON() ([]byte, error) { // can be any resource in the Google Cloud resource hierarchy // (https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), // a resource outside the Google Cloud resource hierarchy (such as -// Google Kubernetes Engine clusters and objects), or a policy (e.g. -// Cloud IAM policy). See Supported asset types +// Google Kubernetes Engine clusters and objects), or a policy (e.g. IAM +// policy). See Supported asset types // (https://cloud.google.com/asset-inventory/docs/supported-asset-types) // for more information. type GoogleCloudAssetV1p7beta1Asset struct { @@ -494,15 +494,15 @@ type GoogleCloudAssetV1p7beta1Asset struct { // for more information. AssetType string `json:"assetType,omitempty"` - // IamPolicy: A representation of the Cloud IAM policy set on a Google - // Cloud resource. There can be a maximum of one Cloud IAM policy set on - // any given resource. In addition, Cloud IAM policies inherit their - // granted access scope from any policies set on parent resources in the - // resource hierarchy. Therefore, the effectively policy is the union of - // both the policy set on this resource and each policy set on all of - // the resource's ancestry resource levels in the hierarchy. See this - // topic (https://cloud.google.com/iam/help/allow-policies/inheritance) - // for more information. + // IamPolicy: A representation of the IAM policy set on a Google Cloud + // resource. There can be a maximum of one IAM policy set on any given + // resource. In addition, IAM policies inherit their granted access + // scope from any policies set on parent resources in the resource + // hierarchy. Therefore, the effectively policy is the union of both the + // policy set on this resource and each policy set on all of the + // resource's ancestry resource levels in the hierarchy. See this topic + // (https://cloud.google.com/iam/help/allow-policies/inheritance) for + // more information. IamPolicy *Policy `json:"iamPolicy,omitempty"` // Name: The full name of the asset. Example: @@ -561,8 +561,8 @@ func (s *GoogleCloudAssetV1p7beta1Asset) MarshalJSON() ([]byte, error) { // any resource in the Google Cloud resource hierarchy // (https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), // a resource outside the Google Cloud resource hierarchy (such as -// Google Kubernetes Engine clusters and objects), or a policy (e.g. -// Cloud IAM policy). See Supported asset types +// Google Kubernetes Engine clusters and objects), or a policy (e.g. IAM +// policy). See Supported asset types // (https://cloud.google.com/asset-inventory/docs/supported-asset-types) // for more information. type GoogleCloudAssetV1p7beta1RelatedAsset struct { @@ -714,7 +714,7 @@ type GoogleCloudAssetV1p7beta1Resource struct { // Resource Names // (https://cloud.google.com/apis/design/resource_names#full_resource_name) // for more information. For Google Cloud assets, this value is the - // parent resource defined in the Cloud IAM policy hierarchy + // parent resource defined in the IAM policy hierarchy // (https://cloud.google.com/iam/docs/overview#policy_hierarchy). // Example: // `//cloudresourcemanager.googleapis.com/projects/my_project_123` For @@ -1662,11 +1662,13 @@ type GoogleIdentityAccesscontextmanagerV1IngressSource struct { // Resource: A Google Cloud resource that is allowed to ingress the // perimeter. Requests from these resources will be allowed to access - // perimeter data. Currently only projects are allowed. Format: - // `projects/{project_number}` The project may be in any Google Cloud - // organization, not just the organization that the perimeter is defined - // in. `*` is not allowed, the case of allowing all Google Cloud - // resources only is not supported. + // perimeter data. Currently only projects and VPCs are allowed. Project + // format: `projects/{project_number}` VPC format: + // `//compute.googleapis.com/projects/{PROJECT_ID}/global/networks/{NAME} + // `. The project may be in any Google Cloud organization, not just the + // organization that the perimeter is defined in. `*` is not allowed, + // the case of allowing all Google Cloud resources only is not + // supported. Resource string `json:"resource,omitempty"` // ForceSendFields is a list of field names (e.g. "AccessLevel") to @@ -1934,8 +1936,10 @@ type GoogleIdentityAccesscontextmanagerV1ServicePerimeterConfig struct { IngressPolicies []*GoogleIdentityAccesscontextmanagerV1IngressPolicy `json:"ingressPolicies,omitempty"` // Resources: A list of Google Cloud resources that are inside of the - // service perimeter. Currently only projects are allowed. Format: - // `projects/{project_number}` + // service perimeter. Currently only projects and VPCs are allowed. + // Project format: `projects/{project_number}` VPC format: + // `//compute.googleapis.com/projects/{PROJECT_ID}/global/networks/{NAME} + // `. Resources []string `json:"resources,omitempty"` // RestrictedServices: Google Cloud services that are subject to the @@ -2201,7 +2205,7 @@ type SearchAllIamPoliciesResponse struct { // again, using this value as the `page_token`. NextPageToken string `json:"nextPageToken,omitempty"` - // Results: A list of IamPolicy that match the search query. Related + // Results: A list of IAM policies that match the search query. Related // information such as the associated resource is returned along with // the policy. Results []*IamPolicySearchResult `json:"results,omitempty"` @@ -2290,7 +2294,7 @@ type StandardResourceMetadata struct { DisplayName string `json:"displayName,omitempty"` // Labels: Labels associated with this resource. See Labelling and - // grouping GCP resources + // grouping Google Cloud resources // (https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) // for more information. Labels map[string]string `json:"labels,omitempty"` @@ -2307,8 +2311,8 @@ type StandardResourceMetadata struct { Name string `json:"name,omitempty"` // NetworkTags: Network tags associated with this resource. Like labels, - // network tags are a type of annotations used to group GCP resources. - // See Labelling GCP resources + // network tags are a type of annotations used to group Google Cloud + // resources. See Labelling Google Cloud resources // (lhttps://cloud.google.com/blog/products/gcp/labelling-and-grouping-yo // ur-google-cloud-platform-resources) for more information. NetworkTags []string `json:"networkTags,omitempty"` @@ -2354,18 +2358,18 @@ type IamPoliciesSearchAllCall struct { } // SearchAll: Searches all the IAM policies within a given accessible -// CRM scope (project/folder/organization). This RPC gives callers -// especially administrators the ability to search all the IAM policies -// within a scope, even if they don't have `.getIamPolicy` permission of -// all the IAM policies. Callers should have +// Resource Manager scope (project/folder/organization). This RPC gives +// callers especially administrators the ability to search all the IAM +// policies within a scope, even if they don't have `.getIamPolicy` +// permission of all the IAM policies. Callers should have // `cloud.assets.SearchAllIamPolicies` permission on the requested // scope, otherwise the request will be rejected. // // - scope: The relative name of an asset. The search is limited to the // resources within the `scope`. The allowed value must be: * -// Organization number (such as "organizations/123") * Folder -// number(such as "folders/1234") * Project number (such as -// "projects/12345") * Project id (such as "projects/abc"). +// Organization number (such as "organizations/123") * Folder number +// (such as "folders/1234") * Project number (such as +// "projects/12345") * Project ID (such as "projects/abc"). func (r *IamPoliciesService) SearchAll(scope string) *IamPoliciesSearchAllCall { c := &IamPoliciesSearchAllCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.scope = scope @@ -2500,7 +2504,7 @@ func (c *IamPoliciesSearchAllCall) Do(opts ...googleapi.CallOption) (*SearchAllI } return ret, nil // { - // "description": "Searches all the IAM policies within a given accessible CRM scope (project/folder/organization). This RPC gives callers especially administrators the ability to search all the IAM policies within a scope, even if they don't have `.getIamPolicy` permission of all the IAM policies. Callers should have `cloud.assets.SearchAllIamPolicies` permission on the requested scope, otherwise the request will be rejected.", + // "description": "Searches all the IAM policies within a given accessible Resource Manager scope (project/folder/organization). This RPC gives callers especially administrators the ability to search all the IAM policies within a scope, even if they don't have `.getIamPolicy` permission of all the IAM policies. Callers should have `cloud.assets.SearchAllIamPolicies` permission on the requested scope, otherwise the request will be rejected.", // "flatPath": "v1p1beta1/{v1p1beta1Id}/{v1p1beta1Id1}/iamPolicies:searchAll", // "httpMethod": "GET", // "id": "cloudasset.iamPolicies.searchAll", @@ -2525,7 +2529,7 @@ func (c *IamPoliciesSearchAllCall) Do(opts ...googleapi.CallOption) (*SearchAllI // "type": "string" // }, // "scope": { - // "description": "Required. The relative name of an asset. The search is limited to the resources within the `scope`. The allowed value must be: * Organization number (such as \"organizations/123\") * Folder number(such as \"folders/1234\") * Project number (such as \"projects/12345\") * Project id (such as \"projects/abc\")", + // "description": "Required. The relative name of an asset. The search is limited to the resources within the `scope`. The allowed value must be: * Organization number (such as \"organizations/123\") * Folder number (such as \"folders/1234\") * Project number (such as \"projects/12345\") * Project ID (such as \"projects/abc\")", // "location": "path", // "pattern": "^[^/]+/[^/]+$", // "required": true, @@ -2575,19 +2579,19 @@ type ResourcesSearchAllCall struct { header_ http.Header } -// SearchAll: Searches all the resources within a given accessible CRM -// scope (project/folder/organization). This RPC gives callers -// especially administrators the ability to search all the resources -// within a scope, even if they don't have `.get` permission of all the -// resources. Callers should have `cloud.assets.SearchAllResources` -// permission on the requested scope, otherwise the request will be -// rejected. +// SearchAll: Searches all the resources within a given accessible +// Resource Manager scope (project/folder/organization). This RPC gives +// callers especially administrators the ability to search all the +// resources within a scope, even if they don't have `.get` permission +// of all the resources. Callers should have +// `cloud.assets.SearchAllResources` permission on the requested scope, +// otherwise the request will be rejected. // // - scope: The relative name of an asset. The search is limited to the // resources within the `scope`. The allowed value must be: * -// Organization number (such as "organizations/123") * Folder -// number(such as "folders/1234") * Project number (such as -// "projects/12345") * Project id (such as "projects/abc"). +// Organization number (such as "organizations/123") * Folder number +// (such as "folders/1234") * Project number (such as +// "projects/12345") * Project ID (such as "projects/abc"). func (r *ResourcesService) SearchAll(scope string) *ResourcesSearchAllCall { c := &ResourcesSearchAllCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.scope = scope @@ -2738,7 +2742,7 @@ func (c *ResourcesSearchAllCall) Do(opts ...googleapi.CallOption) (*SearchAllRes } return ret, nil // { - // "description": "Searches all the resources within a given accessible CRM scope (project/folder/organization). This RPC gives callers especially administrators the ability to search all the resources within a scope, even if they don't have `.get` permission of all the resources. Callers should have `cloud.assets.SearchAllResources` permission on the requested scope, otherwise the request will be rejected.", + // "description": "Searches all the resources within a given accessible Resource Manager scope (project/folder/organization). This RPC gives callers especially administrators the ability to search all the resources within a scope, even if they don't have `.get` permission of all the resources. Callers should have `cloud.assets.SearchAllResources` permission on the requested scope, otherwise the request will be rejected.", // "flatPath": "v1p1beta1/{v1p1beta1Id}/{v1p1beta1Id1}/resources:searchAll", // "httpMethod": "GET", // "id": "cloudasset.resources.searchAll", @@ -2774,7 +2778,7 @@ func (c *ResourcesSearchAllCall) Do(opts ...googleapi.CallOption) (*SearchAllRes // "type": "string" // }, // "scope": { - // "description": "Required. The relative name of an asset. The search is limited to the resources within the `scope`. The allowed value must be: * Organization number (such as \"organizations/123\") * Folder number(such as \"folders/1234\") * Project number (such as \"projects/12345\") * Project id (such as \"projects/abc\")", + // "description": "Required. The relative name of an asset. The search is limited to the resources within the `scope`. The allowed value must be: * Organization number (such as \"organizations/123\") * Folder number (such as \"folders/1234\") * Project number (such as \"projects/12345\") * Project ID (such as \"projects/abc\")", // "location": "path", // "pattern": "^[^/]+/[^/]+$", // "required": true, diff --git a/cloudasset/v1p5beta1/cloudasset-api.json b/cloudasset/v1p5beta1/cloudasset-api.json index 8a8b6866f9c..e8c84170513 100644 --- a/cloudasset/v1p5beta1/cloudasset-api.json +++ b/cloudasset/v1p5beta1/cloudasset-api.json @@ -12,7 +12,7 @@ "baseUrl": "https://cloudasset.googleapis.com/", "batchPath": "batch", "canonicalName": "Cloud Asset", - "description": "The cloud asset API manages the history and inventory of cloud resources.", + "description": "The Cloud Asset API manages the history and inventory of Google Cloud resources.", "discoveryVersion": "v1", "documentationLink": "https://cloud.google.com/asset-inventory/docs/quickstart", "fullyEncodeReservedExpansion": true, @@ -135,8 +135,8 @@ "Unspecified content type.", "Resource metadata.", "The actual IAM policy set on a resource.", - "The Cloud Organization Policy set on an asset.", - "The Cloud Access context manager Policy set on an asset." + "The organization policy set on an asset.", + "The Access Context Manager policy set on an asset." ], "location": "query", "type": "string" @@ -177,11 +177,11 @@ } } }, - "revision": "20221114", + "revision": "20230114", "rootUrl": "https://cloudasset.googleapis.com/", "schemas": { "AnalyzeIamPolicyLongrunningMetadata": { - "description": "Represents the metadata of the longrunning operation for the AnalyzeIamPolicyLongrunning rpc.", + "description": "Represents the metadata of the longrunning operation for the AnalyzeIamPolicyLongrunning RPC.", "id": "AnalyzeIamPolicyLongrunningMetadata", "properties": { "createTime": { @@ -200,7 +200,7 @@ "type": "object" }, "Asset": { - "description": "An asset in Google Cloud. An asset can be any resource in the Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy). See [Supported asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information.", + "description": "An asset in Google Cloud. An asset can be any resource in the Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. IAM policy). See [Supported asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information.", "id": "Asset", "properties": { "accessLevel": { @@ -224,7 +224,7 @@ }, "iamPolicy": { "$ref": "Policy", - "description": "A representation of the Cloud IAM policy set on a Google Cloud resource. There can be a maximum of one Cloud IAM policy set on any given resource. In addition, Cloud IAM policies inherit their granted access scope from any policies set on parent resources in the resource hierarchy. Therefore, the effectively policy is the union of both the policy set on this resource and each policy set on all of the resource's ancestry resource levels in the hierarchy. See [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance) for more information." + "description": "A representation of the IAM policy set on a Google Cloud resource. There can be a maximum of one IAM policy set on any given resource. In addition, IAM policies inherit their granted access scope from any policies set on parent resources in the resource hierarchy. Therefore, the effectively policy is the union of both the policy set on this resource and each policy set on all of the resource's ancestry resource levels in the hierarchy. See [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance) for more information." }, "name": { "description": "The full name of the asset. Example: `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` See [Resource names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information.", @@ -342,7 +342,7 @@ "type": "object" }, "GoogleCloudAssetV1p7beta1Asset": { - "description": "An asset in Google Cloud. An asset can be any resource in the Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy). See [Supported asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information.", + "description": "An asset in Google Cloud. An asset can be any resource in the Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. IAM policy). See [Supported asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information.", "id": "GoogleCloudAssetV1p7beta1Asset", "properties": { "accessLevel": { @@ -366,7 +366,7 @@ }, "iamPolicy": { "$ref": "Policy", - "description": "A representation of the Cloud IAM policy set on a Google Cloud resource. There can be a maximum of one Cloud IAM policy set on any given resource. In addition, Cloud IAM policies inherit their granted access scope from any policies set on parent resources in the resource hierarchy. Therefore, the effectively policy is the union of both the policy set on this resource and each policy set on all of the resource's ancestry resource levels in the hierarchy. See [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance) for more information." + "description": "A representation of the IAM policy set on a Google Cloud resource. There can be a maximum of one IAM policy set on any given resource. In addition, IAM policies inherit their granted access scope from any policies set on parent resources in the resource hierarchy. Therefore, the effectively policy is the union of both the policy set on this resource and each policy set on all of the resource's ancestry resource levels in the hierarchy. See [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance) for more information." }, "name": { "description": "The full name of the asset. Example: `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` See [Resource names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information.", @@ -400,7 +400,7 @@ "type": "object" }, "GoogleCloudAssetV1p7beta1RelatedAsset": { - "description": "An asset identify in Google Cloud which contains its name, type and ancestors. An asset can be any resource in the Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy). See [Supported asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information.", + "description": "An asset identify in Google Cloud which contains its name, type and ancestors. An asset can be any resource in the Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. IAM policy). See [Supported asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information.", "id": "GoogleCloudAssetV1p7beta1RelatedAsset", "properties": { "ancestors": { @@ -487,7 +487,7 @@ "type": "string" }, "parent": { - "description": "The full name of the immediate parent of this resource. See [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information. For Google Cloud assets, this value is the parent resource defined in the [Cloud IAM policy hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). Example: `//cloudresourcemanager.googleapis.com/projects/my_project_123` For third-party assets, this field may be set differently.", + "description": "The full name of the immediate parent of this resource. See [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information. For Google Cloud assets, this value is the parent resource defined in the [IAM policy hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). Example: `//cloudresourcemanager.googleapis.com/projects/my_project_123` For third-party assets, this field may be set differently.", "type": "string" }, "resourceUrl": { @@ -952,7 +952,7 @@ "type": "string" }, "resource": { - "description": "A Google Cloud resource that is allowed to ingress the perimeter. Requests from these resources will be allowed to access perimeter data. Currently only projects are allowed. Format: `projects/{project_number}` The project may be in any Google Cloud organization, not just the organization that the perimeter is defined in. `*` is not allowed, the case of allowing all Google Cloud resources only is not supported.", + "description": "A Google Cloud resource that is allowed to ingress the perimeter. Requests from these resources will be allowed to access perimeter data. Currently only projects and VPCs are allowed. Project format: `projects/{project_number}` VPC format: `//compute.googleapis.com/projects/{PROJECT_ID}/global/networks/{NAME}`. The project may be in any Google Cloud organization, not just the organization that the perimeter is defined in. `*` is not allowed, the case of allowing all Google Cloud resources only is not supported.", "type": "string" } }, @@ -1100,7 +1100,7 @@ "type": "array" }, "resources": { - "description": "A list of Google Cloud resources that are inside of the service perimeter. Currently only projects are allowed. Format: `projects/{project_number}`", + "description": "A list of Google Cloud resources that are inside of the service perimeter. Currently only projects and VPCs are allowed. Project format: `projects/{project_number}` VPC format: `//compute.googleapis.com/projects/{PROJECT_ID}/global/networks/{NAME}`.", "items": { "type": "string" }, @@ -1213,7 +1213,7 @@ "type": "string" }, "parent": { - "description": "The full name of the immediate parent of this resource. See [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information. For Google Cloud assets, this value is the parent resource defined in the [Cloud IAM policy hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). Example: `//cloudresourcemanager.googleapis.com/projects/my_project_123` For third-party assets, this field may be set differently.", + "description": "The full name of the immediate parent of this resource. See [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information. For Google Cloud assets, this value is the parent resource defined in the [IAM policy hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). Example: `//cloudresourcemanager.googleapis.com/projects/my_project_123` For third-party assets, this field may be set differently.", "type": "string" }, "resourceUrl": { diff --git a/cloudasset/v1p5beta1/cloudasset-gen.go b/cloudasset/v1p5beta1/cloudasset-gen.go index d0d1c1bacc5..dd9c1bf09e0 100644 --- a/cloudasset/v1p5beta1/cloudasset-gen.go +++ b/cloudasset/v1p5beta1/cloudasset-gen.go @@ -147,7 +147,7 @@ type AssetsService struct { } // AnalyzeIamPolicyLongrunningMetadata: Represents the metadata of the -// longrunning operation for the AnalyzeIamPolicyLongrunning rpc. +// longrunning operation for the AnalyzeIamPolicyLongrunning RPC. type AnalyzeIamPolicyLongrunningMetadata struct { // CreateTime: Output only. The time the operation was created. CreateTime string `json:"createTime,omitempty"` @@ -184,8 +184,8 @@ type AnalyzeIamPolicyLongrunningResponse struct { // Google Cloud resource hierarchy // (https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), // a resource outside the Google Cloud resource hierarchy (such as -// Google Kubernetes Engine clusters and objects), or a policy (e.g. -// Cloud IAM policy). See Supported asset types +// Google Kubernetes Engine clusters and objects), or a policy (e.g. IAM +// policy). See Supported asset types // (https://cloud.google.com/asset-inventory/docs/supported-asset-types) // for more information. type Asset struct { @@ -213,15 +213,15 @@ type Asset struct { // for more information. AssetType string `json:"assetType,omitempty"` - // IamPolicy: A representation of the Cloud IAM policy set on a Google - // Cloud resource. There can be a maximum of one Cloud IAM policy set on - // any given resource. In addition, Cloud IAM policies inherit their - // granted access scope from any policies set on parent resources in the - // resource hierarchy. Therefore, the effectively policy is the union of - // both the policy set on this resource and each policy set on all of - // the resource's ancestry resource levels in the hierarchy. See this - // topic (https://cloud.google.com/iam/help/allow-policies/inheritance) - // for more information. + // IamPolicy: A representation of the IAM policy set on a Google Cloud + // resource. There can be a maximum of one IAM policy set on any given + // resource. In addition, IAM policies inherit their granted access + // scope from any policies set on parent resources in the resource + // hierarchy. Therefore, the effectively policy is the union of both the + // policy set on this resource and each policy set on all of the + // resource's ancestry resource levels in the hierarchy. See this topic + // (https://cloud.google.com/iam/help/allow-policies/inheritance) for + // more information. IamPolicy *Policy `json:"iamPolicy,omitempty"` // Name: The full name of the asset. Example: @@ -506,8 +506,8 @@ func (s *Expr) MarshalJSON() ([]byte, error) { // can be any resource in the Google Cloud resource hierarchy // (https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), // a resource outside the Google Cloud resource hierarchy (such as -// Google Kubernetes Engine clusters and objects), or a policy (e.g. -// Cloud IAM policy). See Supported asset types +// Google Kubernetes Engine clusters and objects), or a policy (e.g. IAM +// policy). See Supported asset types // (https://cloud.google.com/asset-inventory/docs/supported-asset-types) // for more information. type GoogleCloudAssetV1p7beta1Asset struct { @@ -535,15 +535,15 @@ type GoogleCloudAssetV1p7beta1Asset struct { // for more information. AssetType string `json:"assetType,omitempty"` - // IamPolicy: A representation of the Cloud IAM policy set on a Google - // Cloud resource. There can be a maximum of one Cloud IAM policy set on - // any given resource. In addition, Cloud IAM policies inherit their - // granted access scope from any policies set on parent resources in the - // resource hierarchy. Therefore, the effectively policy is the union of - // both the policy set on this resource and each policy set on all of - // the resource's ancestry resource levels in the hierarchy. See this - // topic (https://cloud.google.com/iam/help/allow-policies/inheritance) - // for more information. + // IamPolicy: A representation of the IAM policy set on a Google Cloud + // resource. There can be a maximum of one IAM policy set on any given + // resource. In addition, IAM policies inherit their granted access + // scope from any policies set on parent resources in the resource + // hierarchy. Therefore, the effectively policy is the union of both the + // policy set on this resource and each policy set on all of the + // resource's ancestry resource levels in the hierarchy. See this topic + // (https://cloud.google.com/iam/help/allow-policies/inheritance) for + // more information. IamPolicy *Policy `json:"iamPolicy,omitempty"` // Name: The full name of the asset. Example: @@ -602,8 +602,8 @@ func (s *GoogleCloudAssetV1p7beta1Asset) MarshalJSON() ([]byte, error) { // any resource in the Google Cloud resource hierarchy // (https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), // a resource outside the Google Cloud resource hierarchy (such as -// Google Kubernetes Engine clusters and objects), or a policy (e.g. -// Cloud IAM policy). See Supported asset types +// Google Kubernetes Engine clusters and objects), or a policy (e.g. IAM +// policy). See Supported asset types // (https://cloud.google.com/asset-inventory/docs/supported-asset-types) // for more information. type GoogleCloudAssetV1p7beta1RelatedAsset struct { @@ -755,7 +755,7 @@ type GoogleCloudAssetV1p7beta1Resource struct { // Resource Names // (https://cloud.google.com/apis/design/resource_names#full_resource_name) // for more information. For Google Cloud assets, this value is the - // parent resource defined in the Cloud IAM policy hierarchy + // parent resource defined in the IAM policy hierarchy // (https://cloud.google.com/iam/docs/overview#policy_hierarchy). // Example: // `//cloudresourcemanager.googleapis.com/projects/my_project_123` For @@ -1703,11 +1703,13 @@ type GoogleIdentityAccesscontextmanagerV1IngressSource struct { // Resource: A Google Cloud resource that is allowed to ingress the // perimeter. Requests from these resources will be allowed to access - // perimeter data. Currently only projects are allowed. Format: - // `projects/{project_number}` The project may be in any Google Cloud - // organization, not just the organization that the perimeter is defined - // in. `*` is not allowed, the case of allowing all Google Cloud - // resources only is not supported. + // perimeter data. Currently only projects and VPCs are allowed. Project + // format: `projects/{project_number}` VPC format: + // `//compute.googleapis.com/projects/{PROJECT_ID}/global/networks/{NAME} + // `. The project may be in any Google Cloud organization, not just the + // organization that the perimeter is defined in. `*` is not allowed, + // the case of allowing all Google Cloud resources only is not + // supported. Resource string `json:"resource,omitempty"` // ForceSendFields is a list of field names (e.g. "AccessLevel") to @@ -1975,8 +1977,10 @@ type GoogleIdentityAccesscontextmanagerV1ServicePerimeterConfig struct { IngressPolicies []*GoogleIdentityAccesscontextmanagerV1IngressPolicy `json:"ingressPolicies,omitempty"` // Resources: A list of Google Cloud resources that are inside of the - // service perimeter. Currently only projects are allowed. Format: - // `projects/{project_number}` + // service perimeter. Currently only projects and VPCs are allowed. + // Project format: `projects/{project_number}` VPC format: + // `//compute.googleapis.com/projects/{PROJECT_ID}/global/networks/{NAME} + // `. Resources []string `json:"resources,omitempty"` // RestrictedServices: Google Cloud services that are subject to the @@ -2219,7 +2223,7 @@ type Resource struct { // Resource Names // (https://cloud.google.com/apis/design/resource_names#full_resource_name) // for more information. For Google Cloud assets, this value is the - // parent resource defined in the Cloud IAM policy hierarchy + // parent resource defined in the IAM policy hierarchy // (https://cloud.google.com/iam/docs/overview#policy_hierarchy). // Example: // `//cloudresourcemanager.googleapis.com/projects/my_project_123` For @@ -2312,8 +2316,8 @@ func (c *AssetsListCall) AssetTypes(assetTypes ...string) *AssetsListCall { // "CONTENT_TYPE_UNSPECIFIED" - Unspecified content type. // "RESOURCE" - Resource metadata. // "IAM_POLICY" - The actual IAM policy set on a resource. -// "ORG_POLICY" - The Cloud Organization Policy set on an asset. -// "ACCESS_POLICY" - The Cloud Access context manager Policy set on an +// "ORG_POLICY" - The organization policy set on an asset. +// "ACCESS_POLICY" - The Access Context Manager policy set on an // // asset. func (c *AssetsListCall) ContentType(contentType string) *AssetsListCall { @@ -2476,8 +2480,8 @@ func (c *AssetsListCall) Do(opts ...googleapi.CallOption) (*ListAssetsResponse, // "Unspecified content type.", // "Resource metadata.", // "The actual IAM policy set on a resource.", - // "The Cloud Organization Policy set on an asset.", - // "The Cloud Access context manager Policy set on an asset." + // "The organization policy set on an asset.", + // "The Access Context Manager policy set on an asset." // ], // "location": "query", // "type": "string" diff --git a/cloudasset/v1p7beta1/cloudasset-api.json b/cloudasset/v1p7beta1/cloudasset-api.json index a8edd7bb50f..57508c203e4 100644 --- a/cloudasset/v1p7beta1/cloudasset-api.json +++ b/cloudasset/v1p7beta1/cloudasset-api.json @@ -12,7 +12,7 @@ "baseUrl": "https://cloudasset.googleapis.com/", "batchPath": "batch", "canonicalName": "Cloud Asset", - "description": "The cloud asset API manages the history and inventory of cloud resources.", + "description": "The Cloud Asset API manages the history and inventory of Google Cloud resources.", "discoveryVersion": "v1", "documentationLink": "https://cloud.google.com/asset-inventory/docs/quickstart", "fullyEncodeReservedExpansion": true, @@ -167,11 +167,11 @@ } } }, - "revision": "20221114", + "revision": "20230114", "rootUrl": "https://cloudasset.googleapis.com/", "schemas": { "AnalyzeIamPolicyLongrunningMetadata": { - "description": "Represents the metadata of the longrunning operation for the AnalyzeIamPolicyLongrunning rpc.", + "description": "Represents the metadata of the longrunning operation for the AnalyzeIamPolicyLongrunning RPC.", "id": "AnalyzeIamPolicyLongrunningMetadata", "properties": { "createTime": { @@ -283,7 +283,7 @@ "type": "object" }, "GoogleCloudAssetV1p7beta1Asset": { - "description": "An asset in Google Cloud. An asset can be any resource in the Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy). See [Supported asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information.", + "description": "An asset in Google Cloud. An asset can be any resource in the Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. IAM policy). See [Supported asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information.", "id": "GoogleCloudAssetV1p7beta1Asset", "properties": { "accessLevel": { @@ -307,7 +307,7 @@ }, "iamPolicy": { "$ref": "Policy", - "description": "A representation of the Cloud IAM policy set on a Google Cloud resource. There can be a maximum of one Cloud IAM policy set on any given resource. In addition, Cloud IAM policies inherit their granted access scope from any policies set on parent resources in the resource hierarchy. Therefore, the effectively policy is the union of both the policy set on this resource and each policy set on all of the resource's ancestry resource levels in the hierarchy. See [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance) for more information." + "description": "A representation of the IAM policy set on a Google Cloud resource. There can be a maximum of one IAM policy set on any given resource. In addition, IAM policies inherit their granted access scope from any policies set on parent resources in the resource hierarchy. Therefore, the effectively policy is the union of both the policy set on this resource and each policy set on all of the resource's ancestry resource levels in the hierarchy. See [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance) for more information." }, "name": { "description": "The full name of the asset. Example: `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` See [Resource names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information.", @@ -392,8 +392,8 @@ "Unspecified content type.", "Resource metadata.", "The actual IAM policy set on a resource.", - "The Cloud Organization Policy set on an asset.", - "The Cloud Access context manager Policy set on an asset.", + "The organization policy set on an asset.", + "The Access Context Manager policy set on an asset.", "The related resources." ], "type": "string" @@ -422,11 +422,11 @@ "id": "GoogleCloudAssetV1p7beta1GcsDestination", "properties": { "uri": { - "description": "The uri of the Cloud Storage object. It's the same uri that is used by gsutil. Example: \"gs://bucket_name/object_name\". See [Viewing and Editing Object Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) for more information.", + "description": "The URI of the Cloud Storage object. It's the same URI that is used by gsutil. Example: \"gs://bucket_name/object_name\". See [Viewing and Editing Object Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) for more information.", "type": "string" }, "uriPrefix": { - "description": "The uri prefix of all generated Cloud Storage objects. Example: \"gs://bucket_name/object_name_prefix\". Each object uri is in format: \"gs://bucket_name/object_name_prefix/{ASSET_TYPE}/{SHARD_NUMBER} and only contains assets for that type. starts from 0. Example: \"gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0\" is the first shard of output objects containing all compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be returned if file with the same name \"gs://bucket_name/object_name_prefix\" already exists.", + "description": "The URI prefix of all generated Cloud Storage objects. Example: \"gs://bucket_name/object_name_prefix\". Each object URI is in format: \"gs://bucket_name/object_name_prefix/{ASSET_TYPE}/{SHARD_NUMBER} and only contains assets for that type. starts from 0. Example: \"gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0\" is the first shard of output objects containing all compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be returned if file with the same name \"gs://bucket_name/object_name_prefix\" already exists.", "type": "string" } }, @@ -469,7 +469,7 @@ "type": "object" }, "GoogleCloudAssetV1p7beta1RelatedAsset": { - "description": "An asset identify in Google Cloud which contains its name, type and ancestors. An asset can be any resource in the Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy). See [Supported asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information.", + "description": "An asset identify in Google Cloud which contains its name, type and ancestors. An asset can be any resource in the Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. IAM policy). See [Supported asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information.", "id": "GoogleCloudAssetV1p7beta1RelatedAsset", "properties": { "ancestors": { @@ -556,7 +556,7 @@ "type": "string" }, "parent": { - "description": "The full name of the immediate parent of this resource. See [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information. For Google Cloud assets, this value is the parent resource defined in the [Cloud IAM policy hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). Example: `//cloudresourcemanager.googleapis.com/projects/my_project_123` For third-party assets, this field may be set differently.", + "description": "The full name of the immediate parent of this resource. See [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information. For Google Cloud assets, this value is the parent resource defined in the [IAM policy hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). Example: `//cloudresourcemanager.googleapis.com/projects/my_project_123` For third-party assets, this field may be set differently.", "type": "string" }, "resourceUrl": { @@ -1021,7 +1021,7 @@ "type": "string" }, "resource": { - "description": "A Google Cloud resource that is allowed to ingress the perimeter. Requests from these resources will be allowed to access perimeter data. Currently only projects are allowed. Format: `projects/{project_number}` The project may be in any Google Cloud organization, not just the organization that the perimeter is defined in. `*` is not allowed, the case of allowing all Google Cloud resources only is not supported.", + "description": "A Google Cloud resource that is allowed to ingress the perimeter. Requests from these resources will be allowed to access perimeter data. Currently only projects and VPCs are allowed. Project format: `projects/{project_number}` VPC format: `//compute.googleapis.com/projects/{PROJECT_ID}/global/networks/{NAME}`. The project may be in any Google Cloud organization, not just the organization that the perimeter is defined in. `*` is not allowed, the case of allowing all Google Cloud resources only is not supported.", "type": "string" } }, @@ -1169,7 +1169,7 @@ "type": "array" }, "resources": { - "description": "A list of Google Cloud resources that are inside of the service perimeter. Currently only projects are allowed. Format: `projects/{project_number}`", + "description": "A list of Google Cloud resources that are inside of the service perimeter. Currently only projects and VPCs are allowed. Project format: `projects/{project_number}` VPC format: `//compute.googleapis.com/projects/{PROJECT_ID}/global/networks/{NAME}`.", "items": { "type": "string" }, diff --git a/cloudasset/v1p7beta1/cloudasset-gen.go b/cloudasset/v1p7beta1/cloudasset-gen.go index bb02889be62..59696469393 100644 --- a/cloudasset/v1p7beta1/cloudasset-gen.go +++ b/cloudasset/v1p7beta1/cloudasset-gen.go @@ -159,7 +159,7 @@ type V1p7beta1Service struct { } // AnalyzeIamPolicyLongrunningMetadata: Represents the metadata of the -// longrunning operation for the AnalyzeIamPolicyLongrunning rpc. +// longrunning operation for the AnalyzeIamPolicyLongrunning RPC. type AnalyzeIamPolicyLongrunningMetadata struct { // CreateTime: Output only. The time the operation was created. CreateTime string `json:"createTime,omitempty"` @@ -431,8 +431,8 @@ func (s *Expr) MarshalJSON() ([]byte, error) { // can be any resource in the Google Cloud resource hierarchy // (https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), // a resource outside the Google Cloud resource hierarchy (such as -// Google Kubernetes Engine clusters and objects), or a policy (e.g. -// Cloud IAM policy). See Supported asset types +// Google Kubernetes Engine clusters and objects), or a policy (e.g. IAM +// policy). See Supported asset types // (https://cloud.google.com/asset-inventory/docs/supported-asset-types) // for more information. type GoogleCloudAssetV1p7beta1Asset struct { @@ -460,15 +460,15 @@ type GoogleCloudAssetV1p7beta1Asset struct { // for more information. AssetType string `json:"assetType,omitempty"` - // IamPolicy: A representation of the Cloud IAM policy set on a Google - // Cloud resource. There can be a maximum of one Cloud IAM policy set on - // any given resource. In addition, Cloud IAM policies inherit their - // granted access scope from any policies set on parent resources in the - // resource hierarchy. Therefore, the effectively policy is the union of - // both the policy set on this resource and each policy set on all of - // the resource's ancestry resource levels in the hierarchy. See this - // topic (https://cloud.google.com/iam/help/allow-policies/inheritance) - // for more information. + // IamPolicy: A representation of the IAM policy set on a Google Cloud + // resource. There can be a maximum of one IAM policy set on any given + // resource. In addition, IAM policies inherit their granted access + // scope from any policies set on parent resources in the resource + // hierarchy. Therefore, the effectively policy is the union of both the + // policy set on this resource and each policy set on all of the + // resource's ancestry resource levels in the hierarchy. See this topic + // (https://cloud.google.com/iam/help/allow-policies/inheritance) for + // more information. IamPolicy *Policy `json:"iamPolicy,omitempty"` // Name: The full name of the asset. Example: @@ -634,8 +634,8 @@ type GoogleCloudAssetV1p7beta1ExportAssetsRequest struct { // "CONTENT_TYPE_UNSPECIFIED" - Unspecified content type. // "RESOURCE" - Resource metadata. // "IAM_POLICY" - The actual IAM policy set on a resource. - // "ORG_POLICY" - The Cloud Organization Policy set on an asset. - // "ACCESS_POLICY" - The Cloud Access context manager Policy set on an + // "ORG_POLICY" - The organization policy set on an asset. + // "ACCESS_POLICY" - The Access Context Manager policy set on an // asset. // "RELATIONSHIP" - The related resources. ContentType string `json:"contentType,omitempty"` @@ -689,15 +689,15 @@ func (s *GoogleCloudAssetV1p7beta1ExportAssetsRequest) MarshalJSON() ([]byte, er // GoogleCloudAssetV1p7beta1GcsDestination: A Cloud Storage location. type GoogleCloudAssetV1p7beta1GcsDestination struct { - // Uri: The uri of the Cloud Storage object. It's the same uri that is + // Uri: The URI of the Cloud Storage object. It's the same URI that is // used by gsutil. Example: "gs://bucket_name/object_name". See Viewing // and Editing Object Metadata // (https://cloud.google.com/storage/docs/viewing-editing-metadata) for // more information. Uri string `json:"uri,omitempty"` - // UriPrefix: The uri prefix of all generated Cloud Storage objects. - // Example: "gs://bucket_name/object_name_prefix". Each object uri is in + // UriPrefix: The URI prefix of all generated Cloud Storage objects. + // Example: "gs://bucket_name/object_name_prefix". Each object URI is in // format: // "gs://bucket_name/object_name_prefix/{ASSET_TYPE}/{SHARD_NUMBER} and // only contains assets for that type. starts from 0. Example: @@ -813,8 +813,8 @@ func (s *GoogleCloudAssetV1p7beta1PartitionSpec) MarshalJSON() ([]byte, error) { // any resource in the Google Cloud resource hierarchy // (https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), // a resource outside the Google Cloud resource hierarchy (such as -// Google Kubernetes Engine clusters and objects), or a policy (e.g. -// Cloud IAM policy). See Supported asset types +// Google Kubernetes Engine clusters and objects), or a policy (e.g. IAM +// policy). See Supported asset types // (https://cloud.google.com/asset-inventory/docs/supported-asset-types) // for more information. type GoogleCloudAssetV1p7beta1RelatedAsset struct { @@ -966,7 +966,7 @@ type GoogleCloudAssetV1p7beta1Resource struct { // Resource Names // (https://cloud.google.com/apis/design/resource_names#full_resource_name) // for more information. For Google Cloud assets, this value is the - // parent resource defined in the Cloud IAM policy hierarchy + // parent resource defined in the IAM policy hierarchy // (https://cloud.google.com/iam/docs/overview#policy_hierarchy). // Example: // `//cloudresourcemanager.googleapis.com/projects/my_project_123` For @@ -1914,11 +1914,13 @@ type GoogleIdentityAccesscontextmanagerV1IngressSource struct { // Resource: A Google Cloud resource that is allowed to ingress the // perimeter. Requests from these resources will be allowed to access - // perimeter data. Currently only projects are allowed. Format: - // `projects/{project_number}` The project may be in any Google Cloud - // organization, not just the organization that the perimeter is defined - // in. `*` is not allowed, the case of allowing all Google Cloud - // resources only is not supported. + // perimeter data. Currently only projects and VPCs are allowed. Project + // format: `projects/{project_number}` VPC format: + // `//compute.googleapis.com/projects/{PROJECT_ID}/global/networks/{NAME} + // `. The project may be in any Google Cloud organization, not just the + // organization that the perimeter is defined in. `*` is not allowed, + // the case of allowing all Google Cloud resources only is not + // supported. Resource string `json:"resource,omitempty"` // ForceSendFields is a list of field names (e.g. "AccessLevel") to @@ -2186,8 +2188,10 @@ type GoogleIdentityAccesscontextmanagerV1ServicePerimeterConfig struct { IngressPolicies []*GoogleIdentityAccesscontextmanagerV1IngressPolicy `json:"ingressPolicies,omitempty"` // Resources: A list of Google Cloud resources that are inside of the - // service perimeter. Currently only projects are allowed. Format: - // `projects/{project_number}` + // service perimeter. Currently only projects and VPCs are allowed. + // Project format: `projects/{project_number}` VPC format: + // `//compute.googleapis.com/projects/{PROJECT_ID}/global/networks/{NAME} + // `. Resources []string `json:"resources,omitempty"` // RestrictedServices: Google Cloud services that are subject to the diff --git a/content/v2.1/content-api.json b/content/v2.1/content-api.json index a7057049fdc..9a40cca6330 100644 --- a/content/v2.1/content-api.json +++ b/content/v2.1/content-api.json @@ -5953,7 +5953,7 @@ } } }, - "revision": "20230104", + "revision": "20230112", "rootUrl": "https://shoppingcontent.googleapis.com/", "schemas": { "Account": { @@ -5966,7 +5966,7 @@ "type": "string" }, "adsLinks": { - "description": "Linked Ads accounts that are active or pending approval. To create a new link request, add a new link with status `active` to the list. It will remain in a `pending` state until approved or rejected either in the Ads interface or through the AdWords API. To delete an active link, or to cancel a link request, remove it from the list.", + "description": "Linked Ads accounts that are active or pending approval. To create a new link request, add a new link with status `active` to the list. It will remain in a `pending` state until approved or rejected either in the Ads interface or through the Google Ads API. To delete an active link, or to cancel a link request, remove it from the list.", "items": { "$ref": "AccountAdsLink" }, @@ -12738,7 +12738,7 @@ "type": "object" }, "Product": { - "description": " Required product attributes are primarily defined by the products data specification. See the Products Data Specification Help Center article for information. Product data. After inserting, updating, or deleting a product, it may take several minutes before changes take effect.", + "description": " Required product attributes are primarily defined by the product data specification. See the Product Data Specification Help Center article for information. Product data. After inserting, updating, or deleting a product, it may take several minutes before changes take effect.", "id": "Product", "properties": { "additionalImageLinks": { @@ -12936,6 +12936,13 @@ "description": "Identifies what kind of resource this is. Value: the fixed string \"`content#product`\"", "type": "string" }, + "lifestyleImageLinks": { + "description": "Additional URLs of lifestyle images of the item, used to explicitly identify images that showcase your item in a real-world context. See the Help Center article for more information.", + "items": { + "type": "string" + }, + "type": "array" + }, "link": { "description": "URL directly linking to your item's page on your website.", "type": "string" @@ -13034,7 +13041,7 @@ "description": "The length of the product in the units provided. The value must be between 0 (exclusive) and 3000 (inclusive)." }, "productTypes": { - "description": "Categories of the item (formatted as in products data specification).", + "description": "Categories of the item (formatted as in product data specification).", "items": { "type": "string" }, @@ -13060,7 +13067,7 @@ "description": "Advertised sale price of the item." }, "salePriceEffectiveDate": { - "description": "Date range during which the item is on sale (see products data specification ).", + "description": "Date range during which the item is on sale (see product data specification ).", "type": "string" }, "sellOnGoogleQuantity": { @@ -13367,7 +13374,7 @@ "type": "string" }, "locationId": { - "description": "The numeric ID of a location that the shipping rate applies to as defined in the AdWords API.", + "description": "The numeric ID of a location that the shipping rate applies to as defined in the Google Ads API.", "format": "int64", "type": "string" }, @@ -13596,7 +13603,7 @@ "type": "string" }, "locationId": { - "description": "The numeric ID of a location that the tax rate applies to as defined in the AdWords API.", + "description": "The numeric ID of a location that the tax rate applies to as defined in the Google Ads API.", "format": "int64", "type": "string" }, diff --git a/content/v2.1/content-gen.go b/content/v2.1/content-gen.go index b8d45ac72e1..5db1b0cbd3d 100644 --- a/content/v2.1/content-gen.go +++ b/content/v2.1/content-gen.go @@ -636,8 +636,8 @@ type Account struct { // AdsLinks: Linked Ads accounts that are active or pending approval. To // create a new link request, add a new link with status `active` to the // list. It will remain in a `pending` state until approved or rejected - // either in the Ads interface or through the AdWords API. To delete an - // active link, or to cancel a link request, remove it from the list. + // either in the Ads interface or through the Google Ads API. To delete + // an active link, or to cancel a link request, remove it from the list. AdsLinks []*AccountAdsLink `json:"adsLinks,omitempty"` // AdultContent: Indicates whether the merchant sells adult content. @@ -12352,7 +12352,7 @@ func (s *PriceInsights) UnmarshalJSON(data []byte) error { } // Product: Required product attributes are primarily defined by the -// products data specification. See the Products Data Specification Help +// product data specification. See the Product Data Specification Help // Center article for information. Product data. After inserting, // updating, or deleting a product, it may take several minutes before // changes take effect. @@ -12537,6 +12537,11 @@ type Product struct { // string "content#product" Kind string `json:"kind,omitempty"` + // LifestyleImageLinks: Additional URLs of lifestyle images of the item, + // used to explicitly identify images that showcase your item in a + // real-world context. See the Help Center article for more information. + LifestyleImageLinks []string `json:"lifestyleImageLinks,omitempty"` + // Link: URL directly linking to your item's page on your website. Link string `json:"link,omitempty"` @@ -12622,7 +12627,7 @@ type Product struct { // value must be between 0 (exclusive) and 3000 (inclusive). ProductLength *ProductDimension `json:"productLength,omitempty"` - // ProductTypes: Categories of the item (formatted as in products data + // ProductTypes: Categories of the item (formatted as in product data // specification). ProductTypes []string `json:"productTypes,omitempty"` @@ -12641,7 +12646,7 @@ type Product struct { SalePrice *Price `json:"salePrice,omitempty"` // SalePriceEffectiveDate: Date range during which the item is on sale - // (see products data specification ). + // (see product data specification ). SalePriceEffectiveDate string `json:"salePriceEffectiveDate,omitempty"` // SellOnGoogleQuantity: The quantity of the product that is available @@ -13127,7 +13132,7 @@ type ProductShipping struct { LocationGroupName string `json:"locationGroupName,omitempty"` // LocationId: The numeric ID of a location that the shipping rate - // applies to as defined in the AdWords API. + // applies to as defined in the Google Ads API. LocationId int64 `json:"locationId,omitempty,string"` // MaxHandlingTime: Maximum handling time (inclusive) between when the @@ -13487,7 +13492,7 @@ type ProductTax struct { Country string `json:"country,omitempty"` // LocationId: The numeric ID of a location that the tax rate applies to - // as defined in the AdWords API. + // as defined in the Google Ads API. LocationId int64 `json:"locationId,omitempty,string"` // PostalCode: The postal code range that the tax rate applies to, diff --git a/dlp/v2/dlp-api.json b/dlp/v2/dlp-api.json index 1fcad43a84a..7cb61ed3f71 100644 --- a/dlp/v2/dlp-api.json +++ b/dlp/v2/dlp-api.json @@ -3412,7 +3412,7 @@ } } }, - "revision": "20221210", + "revision": "20230115", "rootUrl": "https://dlp.googleapis.com/", "schemas": { "GooglePrivacyDlpV2Action": { @@ -4390,11 +4390,11 @@ ], "enumDescriptions": [ "Default value; same as POSSIBLE.", - "Few matching elements.", - "", - "Some matching elements.", - "", - "Many matching elements." + "Highest chance of a false positive.", + "High chance of a false positive.", + "Some matching signals. The default value.", + "Low chance of a false positive.", + "Confidence level is high. Lowest chance of a false positive." ], "type": "string" }, @@ -5243,11 +5243,11 @@ ], "enumDescriptions": [ "Default value; same as POSSIBLE.", - "Few matching elements.", - "", - "Some matching elements.", - "", - "Many matching elements." + "Highest chance of a false positive.", + "High chance of a false positive.", + "Some matching signals. The default value.", + "Low chance of a false positive.", + "Confidence level is high. Lowest chance of a false positive." ], "type": "string" }, @@ -5889,11 +5889,11 @@ ], "enumDescriptions": [ "Default value; same as POSSIBLE.", - "Few matching elements.", - "", - "Some matching elements.", - "", - "Many matching elements." + "Highest chance of a false positive.", + "High chance of a false positive.", + "Some matching signals. The default value.", + "Low chance of a false positive.", + "Confidence level is high. Lowest chance of a false positive." ], "type": "string" }, @@ -6522,11 +6522,11 @@ ], "enumDescriptions": [ "Default value; same as POSSIBLE.", - "Few matching elements.", - "", - "Some matching elements.", - "", - "Many matching elements." + "Highest chance of a false positive.", + "High chance of a false positive.", + "Some matching signals. The default value.", + "Low chance of a false positive.", + "Confidence level is high. Lowest chance of a false positive." ], "type": "string" }, diff --git a/dlp/v2/dlp-gen.go b/dlp/v2/dlp-gen.go index 5e389bf209c..15ee110795f 100644 --- a/dlp/v2/dlp-gen.go +++ b/dlp/v2/dlp-gen.go @@ -2217,11 +2217,12 @@ type GooglePrivacyDlpV2CustomInfoType struct { // // Possible values: // "LIKELIHOOD_UNSPECIFIED" - Default value; same as POSSIBLE. - // "VERY_UNLIKELY" - Few matching elements. - // "UNLIKELY" - // "POSSIBLE" - Some matching elements. - // "LIKELY" - // "VERY_LIKELY" - Many matching elements. + // "VERY_UNLIKELY" - Highest chance of a false positive. + // "UNLIKELY" - High chance of a false positive. + // "POSSIBLE" - Some matching signals. The default value. + // "LIKELY" - Low chance of a false positive. + // "VERY_LIKELY" - Confidence level is high. Lowest chance of a false + // positive. Likelihood string `json:"likelihood,omitempty"` // Regex: Regular expression based CustomInfoType. @@ -3801,11 +3802,12 @@ type GooglePrivacyDlpV2Finding struct { // // Possible values: // "LIKELIHOOD_UNSPECIFIED" - Default value; same as POSSIBLE. - // "VERY_UNLIKELY" - Few matching elements. - // "UNLIKELY" - // "POSSIBLE" - Some matching elements. - // "LIKELY" - // "VERY_LIKELY" - Many matching elements. + // "VERY_UNLIKELY" - Highest chance of a false positive. + // "UNLIKELY" - High chance of a false positive. + // "POSSIBLE" - Some matching signals. The default value. + // "LIKELY" - Low chance of a false positive. + // "VERY_LIKELY" - Confidence level is high. Lowest chance of a false + // positive. Likelihood string `json:"likelihood,omitempty"` // Location: Where the content was found. @@ -4845,11 +4847,12 @@ type GooglePrivacyDlpV2InspectConfig struct { // // Possible values: // "LIKELIHOOD_UNSPECIFIED" - Default value; same as POSSIBLE. - // "VERY_UNLIKELY" - Few matching elements. - // "UNLIKELY" - // "POSSIBLE" - Some matching elements. - // "LIKELY" - // "VERY_LIKELY" - Many matching elements. + // "VERY_UNLIKELY" - Highest chance of a false positive. + // "UNLIKELY" - High chance of a false positive. + // "POSSIBLE" - Some matching signals. The default value. + // "LIKELY" - Low chance of a false positive. + // "VERY_LIKELY" - Confidence level is high. Lowest chance of a false + // positive. MinLikelihood string `json:"minLikelihood,omitempty"` // RuleSet: Set of rules to apply to the findings for this @@ -5958,11 +5961,12 @@ type GooglePrivacyDlpV2LikelihoodAdjustment struct { // // Possible values: // "LIKELIHOOD_UNSPECIFIED" - Default value; same as POSSIBLE. - // "VERY_UNLIKELY" - Few matching elements. - // "UNLIKELY" - // "POSSIBLE" - Some matching elements. - // "LIKELY" - // "VERY_LIKELY" - Many matching elements. + // "VERY_UNLIKELY" - Highest chance of a false positive. + // "UNLIKELY" - High chance of a false positive. + // "POSSIBLE" - Some matching signals. The default value. + // "LIKELY" - Low chance of a false positive. + // "VERY_LIKELY" - Confidence level is high. Lowest chance of a false + // positive. FixedLikelihood string `json:"fixedLikelihood,omitempty"` // RelativeLikelihood: Increase or decrease the likelihood by the diff --git a/documentai/v1/documentai-api.json b/documentai/v1/documentai-api.json index d5564abb5a1..8bafc3bdb19 100644 --- a/documentai/v1/documentai-api.json +++ b/documentai/v1/documentai-api.json @@ -764,6 +764,34 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "evaluateProcessorVersion": { + "description": "Evaluates a ProcessorVersion against annotated documents, producing an Evaluation.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}/processorVersions/{processorVersionsId}:evaluateProcessorVersion", + "httpMethod": "POST", + "id": "documentai.projects.locations.processors.processorVersions.evaluateProcessorVersion", + "parameterOrder": [ + "processorVersion" + ], + "parameters": { + "processorVersion": { + "description": "Required. The resource name of the ProcessorVersion to evaluate. `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+processorVersion}:evaluateProcessorVersion", + "request": { + "$ref": "GoogleCloudDocumentaiV1EvaluateProcessorVersionRequest" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "get": { "description": "Gets a processor version detail.", "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}/processorVersions/{processorVersionsId}", @@ -853,6 +881,34 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "train": { + "description": "Trains a new processor version. Operation metadata is returned as cloud_documentai_core.TrainProcessorVersionMetadata.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}/processorVersions:train", + "httpMethod": "POST", + "id": "documentai.projects.locations.processors.processorVersions.train", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The parent (project, location and processor) to create the new version for. Format: `projects/{project}/locations/{location}/processors/{processor}`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/processorVersions:train", + "request": { + "$ref": "GoogleCloudDocumentaiV1TrainProcessorVersionRequest" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "undeploy": { "description": "Undeploys the processor version.", "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}/processorVersions/{processorVersionsId}:undeploy", @@ -881,6 +937,73 @@ "https://www.googleapis.com/auth/cloud-platform" ] } + }, + "resources": { + "evaluations": { + "methods": { + "get": { + "description": "Retrieves a specific evaluation.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}/processorVersions/{processorVersionsId}/evaluations/{evaluationsId}", + "httpMethod": "GET", + "id": "documentai.projects.locations.processors.processorVersions.evaluations.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the Evaluation to get. `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+/evaluations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "GoogleCloudDocumentaiV1Evaluation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Retrieves a set of evaluations for a given processor version.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}/processorVersions/{processorVersionsId}/evaluations", + "httpMethod": "GET", + "id": "documentai.projects.locations.processors.processorVersions.evaluations.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "The standard list page size. If unspecified, at most 5 evaluations will be returned. The maximum value is 100; values above 100 will be coerced to 100.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token, received from a previous `ListEvaluations` call. Provide this to retrieve the subsequent page.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The resource name of the ProcessorVersion to list evaluations for. `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/evaluations", + "response": { + "$ref": "GoogleCloudDocumentaiV1ListEvaluationsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } } } } @@ -919,7 +1042,7 @@ } } }, - "revision": "20230106", + "revision": "20230117", "rootUrl": "https://documentai.googleapis.com/", "schemas": { "GoogleCloudDocumentaiUiv1beta3BatchDeleteDocumentsMetadata": { @@ -1181,6 +1304,10 @@ "gcsManagedDocId": { "$ref": "GoogleCloudDocumentaiUiv1beta3DocumentIdGCSManagedDocumentId" }, + "revisionRef": { + "$ref": "GoogleCloudDocumentaiUiv1beta3RevisionRef", + "description": "Points to a specific revision of the document if set." + }, "revisionReference": { "$ref": "GoogleCloudDocumentaiUiv1beta3RevisionReference", "description": "Points to a specific revision of the document if set." @@ -1497,6 +1624,37 @@ "properties": {}, "type": "object" }, + "GoogleCloudDocumentaiUiv1beta3RevisionRef": { + "description": "The revision reference specifies which revision on the document to read.", + "id": "GoogleCloudDocumentaiUiv1beta3RevisionRef", + "properties": { + "latestProcessorVersion": { + "description": "Reads the revision generated by the processor version. The format takes the full resource name of processor version. `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`", + "type": "string" + }, + "revisionCase": { + "description": "Reads the revision by the predefined case.", + "enum": [ + "REVISION_CASE_UNSPECIFIED", + "LATEST_HUMAN_REVIEW", + "LATEST_TIMESTAMP", + "BASE_OCR_REVISION" + ], + "enumDescriptions": [ + "Unspecified case, fallback to read the first (OCR) revision.", + "The latest revision made by a human.", + "The latest revision based on timestamp.", + "The first (OCR) revision." + ], + "type": "string" + }, + "revisionId": { + "description": "Reads the revision given by the id.", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDocumentaiUiv1beta3RevisionReference": { "description": "The revision reference specifies which revision on the document to read.", "id": "GoogleCloudDocumentaiUiv1beta3RevisionReference", @@ -3196,6 +3354,237 @@ "properties": {}, "type": "object" }, + "GoogleCloudDocumentaiV1EvaluateProcessorVersionRequest": { + "description": "Evaluates the given ProcessorVersion against the supplied documents.", + "id": "GoogleCloudDocumentaiV1EvaluateProcessorVersionRequest", + "properties": { + "evaluationDocuments": { + "$ref": "GoogleCloudDocumentaiV1BatchDocumentsInputConfig", + "description": "Optional. The documents used in the evaluation. If unspecified, use the processor's dataset as evaluation input." + } + }, + "type": "object" + }, + "GoogleCloudDocumentaiV1Evaluation": { + "description": "An evaluation of a ProcessorVersion's performance.", + "id": "GoogleCloudDocumentaiV1Evaluation", + "properties": { + "allEntitiesMetrics": { + "$ref": "GoogleCloudDocumentaiV1EvaluationMultiConfidenceMetrics", + "description": "Metrics for all the entities in aggregate." + }, + "createTime": { + "description": "The time that the evaluation was created.", + "format": "google-datetime", + "type": "string" + }, + "documentCounters": { + "$ref": "GoogleCloudDocumentaiV1EvaluationCounters", + "description": "Counters for the documents used in the evaluation." + }, + "entityMetrics": { + "additionalProperties": { + "$ref": "GoogleCloudDocumentaiV1EvaluationMultiConfidenceMetrics" + }, + "description": "Metrics across confidence levels, for different entities.", + "type": "object" + }, + "kmsKeyName": { + "description": "The KMS key name used for encryption.", + "type": "string" + }, + "kmsKeyVersionName": { + "description": "The KMS key version with which data is encrypted.", + "type": "string" + }, + "name": { + "description": "The resource name of the evaluation. Format: `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}`", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDocumentaiV1EvaluationConfidenceLevelMetrics": { + "description": "Evaluations metrics, at a specific confidence level.", + "id": "GoogleCloudDocumentaiV1EvaluationConfidenceLevelMetrics", + "properties": { + "confidenceLevel": { + "description": "The confidence level.", + "format": "float", + "type": "number" + }, + "metrics": { + "$ref": "GoogleCloudDocumentaiV1EvaluationMetrics", + "description": "The metrics at the specific confidence level." + } + }, + "type": "object" + }, + "GoogleCloudDocumentaiV1EvaluationCounters": { + "description": "Evaluation counters for the documents that were used.", + "id": "GoogleCloudDocumentaiV1EvaluationCounters", + "properties": { + "evaluatedDocumentsCount": { + "description": "How many documents were used in the evaluation.", + "format": "int32", + "type": "integer" + }, + "failedDocumentsCount": { + "description": "How many documents were not included in the evaluation as Document AI failed to process them.", + "format": "int32", + "type": "integer" + }, + "inputDocumentsCount": { + "description": "How many documents were sent for evaluation.", + "format": "int32", + "type": "integer" + }, + "invalidDocumentsCount": { + "description": "How many documents were not included in the evaluation as they didn't pass validation.", + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, + "GoogleCloudDocumentaiV1EvaluationMetrics": { + "description": "Evaluation metrics, either in aggregate or about a specific entity.", + "id": "GoogleCloudDocumentaiV1EvaluationMetrics", + "properties": { + "f1Score": { + "description": "The calculated f1 score.", + "format": "float", + "type": "number" + }, + "falseNegativesCount": { + "description": "The amount of false negatives.", + "format": "int32", + "type": "integer" + }, + "falsePositivesCount": { + "description": "The amount of false positives.", + "format": "int32", + "type": "integer" + }, + "groundTruthDocumentCount": { + "description": "The amount of documents with a ground truth occurrence.", + "format": "int32", + "type": "integer" + }, + "groundTruthOccurrencesCount": { + "description": "The amount of occurrences in ground truth documents.", + "format": "int32", + "type": "integer" + }, + "precision": { + "description": "The calculated precision.", + "format": "float", + "type": "number" + }, + "predictedDocumentCount": { + "description": "The amount of documents with a predicted occurrence.", + "format": "int32", + "type": "integer" + }, + "predictedOccurrencesCount": { + "description": "The amount of occurrences in predicted documents.", + "format": "int32", + "type": "integer" + }, + "recall": { + "description": "The calculated recall.", + "format": "float", + "type": "number" + }, + "totalDocumentsCount": { + "description": "The amount of documents that had an occurrence of this label.", + "format": "int32", + "type": "integer" + }, + "truePositivesCount": { + "description": "The amount of true positives.", + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, + "GoogleCloudDocumentaiV1EvaluationMultiConfidenceMetrics": { + "description": "Metrics across multiple confidence levels.", + "id": "GoogleCloudDocumentaiV1EvaluationMultiConfidenceMetrics", + "properties": { + "auprc": { + "description": "The calculated area under the precision recall curve (AUPRC), computed by integrating over all confidence thresholds.", + "format": "float", + "type": "number" + }, + "auprcExact": { + "description": "The AUPRC for metrics with fuzzy matching disabled, i.e., exact matching only.", + "format": "float", + "type": "number" + }, + "confidenceLevelMetrics": { + "description": "Metrics across confidence levels with fuzzy matching enabled.", + "items": { + "$ref": "GoogleCloudDocumentaiV1EvaluationConfidenceLevelMetrics" + }, + "type": "array" + }, + "confidenceLevelMetricsExact": { + "description": "Metrics across confidence levels with only exact matching.", + "items": { + "$ref": "GoogleCloudDocumentaiV1EvaluationConfidenceLevelMetrics" + }, + "type": "array" + }, + "estimatedCalibrationError": { + "description": "The Estimated Calibration Error (ECE) of the confidence of the predicted entities.", + "format": "float", + "type": "number" + }, + "estimatedCalibrationErrorExact": { + "description": "The ECE for the predicted entities with fuzzy matching disabled, i.e., exact matching only.", + "format": "float", + "type": "number" + }, + "metricsType": { + "description": "The metrics type for the label.", + "enum": [ + "METRICS_TYPE_UNSPECIFIED", + "AGGREGATE" + ], + "enumDescriptions": [ + "The metrics type is unspecified. By default, metrics without a particular specification are for leaf entity types (i.e., top-level entity types without child types, or child types which are not parent types themselves).", + "Indicates whether metrics for this particular label type represent an aggregate of metrics for other types instead of being based on actual TP/FP/FN values for the label type. Metrics for parent (i.e., non-leaf) entity types are an aggregate of metrics for their children." + ], + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDocumentaiV1EvaluationReference": { + "description": "Gives a short summary of an evaluation, and links to the evaluation itself.", + "id": "GoogleCloudDocumentaiV1EvaluationReference", + "properties": { + "aggregateMetrics": { + "$ref": "GoogleCloudDocumentaiV1EvaluationMetrics", + "description": "An aggregate of the statistics for the evaluation with fuzzy matching on." + }, + "aggregateMetricsExact": { + "$ref": "GoogleCloudDocumentaiV1EvaluationMetrics", + "description": "An aggregate of the statistics for the evaluation with fuzzy matching off." + }, + "evaluation": { + "description": "The resource name of the evaluation.", + "type": "string" + }, + "operation": { + "description": "The resource name of the Long Running Operation for the evaluation.", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDocumentaiV1FetchProcessorTypesResponse": { "description": "Response message for fetch processor types.", "id": "GoogleCloudDocumentaiV1FetchProcessorTypesResponse", @@ -3283,6 +3672,24 @@ }, "type": "object" }, + "GoogleCloudDocumentaiV1ListEvaluationsResponse": { + "description": "The response from ListEvaluations.", + "id": "GoogleCloudDocumentaiV1ListEvaluationsResponse", + "properties": { + "evaluations": { + "description": "The evaluations requested.", + "items": { + "$ref": "GoogleCloudDocumentaiV1Evaluation" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDocumentaiV1ListProcessorTypesResponse": { "description": "Response message for list processor types.", "id": "GoogleCloudDocumentaiV1ListProcessorTypesResponse", @@ -3561,6 +3968,10 @@ "description": "The KMS key version with which data is encrypted.", "type": "string" }, + "latestEvaluation": { + "$ref": "GoogleCloudDocumentaiV1EvaluationReference", + "description": "The most recently invoked evaluation for the processor version." + }, "name": { "description": "The resource name of the processor version. Format: `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}`", "type": "string" @@ -3727,6 +4138,44 @@ "properties": {}, "type": "object" }, + "GoogleCloudDocumentaiV1TrainProcessorVersionRequest": { + "description": "Request message for the create processor version method.", + "id": "GoogleCloudDocumentaiV1TrainProcessorVersionRequest", + "properties": { + "baseProcessorVersion": { + "description": "Optional. The processor version to use as a base for training. This processor version must be a child of `parent`. Format: `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`.", + "type": "string" + }, + "documentSchema": { + "$ref": "GoogleCloudDocumentaiV1DocumentSchema", + "description": "Optional. The schema the processor version will be trained with." + }, + "inputData": { + "$ref": "GoogleCloudDocumentaiV1TrainProcessorVersionRequestInputData", + "description": "Optional. The input data used to train the `ProcessorVersion`." + }, + "processorVersion": { + "$ref": "GoogleCloudDocumentaiV1ProcessorVersion", + "description": "Required. The processor version to be created." + } + }, + "type": "object" + }, + "GoogleCloudDocumentaiV1TrainProcessorVersionRequestInputData": { + "description": "The input data used to train a new `ProcessorVersion`.", + "id": "GoogleCloudDocumentaiV1TrainProcessorVersionRequestInputData", + "properties": { + "testDocuments": { + "$ref": "GoogleCloudDocumentaiV1BatchDocumentsInputConfig", + "description": "The documents used for testing the trained version." + }, + "trainingDocuments": { + "$ref": "GoogleCloudDocumentaiV1BatchDocumentsInputConfig", + "description": "The documents used for training the new version." + } + }, + "type": "object" + }, "GoogleCloudDocumentaiV1UndeployProcessorVersionMetadata": { "description": "The long running operation metadata for the undeploy processor version method.", "id": "GoogleCloudDocumentaiV1UndeployProcessorVersionMetadata", diff --git a/documentai/v1/documentai-gen.go b/documentai/v1/documentai-gen.go index 08427a51ef3..3c8063699bb 100644 --- a/documentai/v1/documentai-gen.go +++ b/documentai/v1/documentai-gen.go @@ -226,11 +226,23 @@ type ProjectsLocationsProcessorsHumanReviewConfigService struct { func NewProjectsLocationsProcessorsProcessorVersionsService(s *Service) *ProjectsLocationsProcessorsProcessorVersionsService { rs := &ProjectsLocationsProcessorsProcessorVersionsService{s: s} + rs.Evaluations = NewProjectsLocationsProcessorsProcessorVersionsEvaluationsService(s) return rs } type ProjectsLocationsProcessorsProcessorVersionsService struct { s *Service + + Evaluations *ProjectsLocationsProcessorsProcessorVersionsEvaluationsService +} + +func NewProjectsLocationsProcessorsProcessorVersionsEvaluationsService(s *Service) *ProjectsLocationsProcessorsProcessorVersionsEvaluationsService { + rs := &ProjectsLocationsProcessorsProcessorVersionsEvaluationsService{s: s} + return rs +} + +type ProjectsLocationsProcessorsProcessorVersionsEvaluationsService struct { + s *Service } func NewProjectsOperationsService(s *Service) *ProjectsOperationsService { @@ -684,6 +696,9 @@ type GoogleCloudDocumentaiUiv1beta3DisableProcessorResponse struct { type GoogleCloudDocumentaiUiv1beta3DocumentId struct { GcsManagedDocId *GoogleCloudDocumentaiUiv1beta3DocumentIdGCSManagedDocumentId `json:"gcsManagedDocId,omitempty"` + // RevisionRef: Points to a specific revision of the document if set. + RevisionRef *GoogleCloudDocumentaiUiv1beta3RevisionRef `json:"revisionRef,omitempty"` + // RevisionReference: Points to a specific revision of the document if // set. RevisionReference *GoogleCloudDocumentaiUiv1beta3RevisionReference `json:"revisionReference,omitempty"` @@ -1274,6 +1289,54 @@ func (s *GoogleCloudDocumentaiUiv1beta3ResyncDatasetMetadataIndividualDocumentRe type GoogleCloudDocumentaiUiv1beta3ResyncDatasetResponse struct { } +// GoogleCloudDocumentaiUiv1beta3RevisionRef: The revision reference +// specifies which revision on the document to read. +type GoogleCloudDocumentaiUiv1beta3RevisionRef struct { + // LatestProcessorVersion: Reads the revision generated by the processor + // version. The format takes the full resource name of processor + // version. + // `projects/{project}/locations/{location}/processors/{processor}/proces + // sorVersions/{processorVersion}` + LatestProcessorVersion string `json:"latestProcessorVersion,omitempty"` + + // RevisionCase: Reads the revision by the predefined case. + // + // Possible values: + // "REVISION_CASE_UNSPECIFIED" - Unspecified case, fallback to read + // the first (OCR) revision. + // "LATEST_HUMAN_REVIEW" - The latest revision made by a human. + // "LATEST_TIMESTAMP" - The latest revision based on timestamp. + // "BASE_OCR_REVISION" - The first (OCR) revision. + RevisionCase string `json:"revisionCase,omitempty"` + + // RevisionId: Reads the revision given by the id. + RevisionId string `json:"revisionId,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "LatestProcessorVersion") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "LatestProcessorVersion") + // to include in API requests with the JSON null value. By default, + // fields with empty values are omitted from API requests. However, any + // field with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDocumentaiUiv1beta3RevisionRef) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiUiv1beta3RevisionRef + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudDocumentaiUiv1beta3RevisionReference: The revision // reference specifies which revision on the document to read. type GoogleCloudDocumentaiUiv1beta3RevisionReference struct { @@ -4091,25 +4154,22 @@ type GoogleCloudDocumentaiV1EnableProcessorRequest struct { type GoogleCloudDocumentaiV1EnableProcessorResponse struct { } -// GoogleCloudDocumentaiV1FetchProcessorTypesResponse: Response message -// for fetch processor types. -type GoogleCloudDocumentaiV1FetchProcessorTypesResponse struct { - // ProcessorTypes: The list of processor types. - ProcessorTypes []*GoogleCloudDocumentaiV1ProcessorType `json:"processorTypes,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` +// GoogleCloudDocumentaiV1EvaluateProcessorVersionRequest: Evaluates the +// given ProcessorVersion against the supplied documents. +type GoogleCloudDocumentaiV1EvaluateProcessorVersionRequest struct { + // EvaluationDocuments: Optional. The documents used in the evaluation. + // If unspecified, use the processor's dataset as evaluation input. + EvaluationDocuments *GoogleCloudDocumentaiV1BatchDocumentsInputConfig `json:"evaluationDocuments,omitempty"` - // ForceSendFields is a list of field names (e.g. "ProcessorTypes") to - // unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "EvaluationDocuments") + // to unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ProcessorTypes") to + // NullFields is a list of field names (e.g. "EvaluationDocuments") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the @@ -4119,80 +4179,77 @@ type GoogleCloudDocumentaiV1FetchProcessorTypesResponse struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1FetchProcessorTypesResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1FetchProcessorTypesResponse +func (s *GoogleCloudDocumentaiV1EvaluateProcessorVersionRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1EvaluateProcessorVersionRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1GcsDocument: Specifies a document stored on -// Cloud Storage. -type GoogleCloudDocumentaiV1GcsDocument struct { - // GcsUri: The Cloud Storage object uri. - GcsUri string `json:"gcsUri,omitempty"` +// GoogleCloudDocumentaiV1Evaluation: An evaluation of a +// ProcessorVersion's performance. +type GoogleCloudDocumentaiV1Evaluation struct { + // AllEntitiesMetrics: Metrics for all the entities in aggregate. + AllEntitiesMetrics *GoogleCloudDocumentaiV1EvaluationMultiConfidenceMetrics `json:"allEntitiesMetrics,omitempty"` - // MimeType: An IANA MIME type (RFC6838) of the content. - MimeType string `json:"mimeType,omitempty"` + // CreateTime: The time that the evaluation was created. + CreateTime string `json:"createTime,omitempty"` - // ForceSendFields is a list of field names (e.g. "GcsUri") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` + // DocumentCounters: Counters for the documents used in the evaluation. + DocumentCounters *GoogleCloudDocumentaiV1EvaluationCounters `json:"documentCounters,omitempty"` - // NullFields is a list of field names (e.g. "GcsUri") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} + // EntityMetrics: Metrics across confidence levels, for different + // entities. + EntityMetrics map[string]GoogleCloudDocumentaiV1EvaluationMultiConfidenceMetrics `json:"entityMetrics,omitempty"` -func (s *GoogleCloudDocumentaiV1GcsDocument) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1GcsDocument - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} + // KmsKeyName: The KMS key name used for encryption. + KmsKeyName string `json:"kmsKeyName,omitempty"` -// GoogleCloudDocumentaiV1GcsDocuments: Specifies a set of documents on -// Cloud Storage. -type GoogleCloudDocumentaiV1GcsDocuments struct { - // Documents: The list of documents. - Documents []*GoogleCloudDocumentaiV1GcsDocument `json:"documents,omitempty"` + // KmsKeyVersionName: The KMS key version with which data is encrypted. + KmsKeyVersionName string `json:"kmsKeyVersionName,omitempty"` - // ForceSendFields is a list of field names (e.g. "Documents") to - // unconditionally include in API requests. By default, fields with + // Name: The resource name of the evaluation. Format: + // `projects/{project}/locations/{location}/processors/{processor}/proces + // sorVersions/{processor_version}/evaluations/{evaluation}` + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AllEntitiesMetrics") + // to unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Documents") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "AllEntitiesMetrics") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1GcsDocuments) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1GcsDocuments +func (s *GoogleCloudDocumentaiV1Evaluation) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1Evaluation raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1GcsPrefix: Specifies all documents on Cloud -// Storage with a common prefix. -type GoogleCloudDocumentaiV1GcsPrefix struct { - // GcsUriPrefix: The URI prefix. - GcsUriPrefix string `json:"gcsUriPrefix,omitempty"` +// GoogleCloudDocumentaiV1EvaluationConfidenceLevelMetrics: Evaluations +// metrics, at a specific confidence level. +type GoogleCloudDocumentaiV1EvaluationConfidenceLevelMetrics struct { + // ConfidenceLevel: The confidence level. + ConfidenceLevel float64 `json:"confidenceLevel,omitempty"` - // ForceSendFields is a list of field names (e.g. "GcsUriPrefix") to + // Metrics: The metrics at the specific confidence level. + Metrics *GoogleCloudDocumentaiV1EvaluationMetrics `json:"metrics,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ConfidenceLevel") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -4200,126 +4257,121 @@ type GoogleCloudDocumentaiV1GcsPrefix struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "GcsUriPrefix") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "ConfidenceLevel") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1GcsPrefix) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1GcsPrefix +func (s *GoogleCloudDocumentaiV1EvaluationConfidenceLevelMetrics) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1EvaluationConfidenceLevelMetrics raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1HumanReviewStatus: The status of human review -// on a processed document. -type GoogleCloudDocumentaiV1HumanReviewStatus struct { - // HumanReviewOperation: The name of the operation triggered by the - // processed document. This field is populated only when the [state] is - // [HUMAN_REVIEW_IN_PROGRESS]. It has the same response type and - // metadata as the long running operation returned by [ReviewDocument] - // method. - HumanReviewOperation string `json:"humanReviewOperation,omitempty"` +func (s *GoogleCloudDocumentaiV1EvaluationConfidenceLevelMetrics) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDocumentaiV1EvaluationConfidenceLevelMetrics + var s1 struct { + ConfidenceLevel gensupport.JSONFloat64 `json:"confidenceLevel"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.ConfidenceLevel = float64(s1.ConfidenceLevel) + return nil +} - // State: The state of human review on the processing request. - // - // Possible values: - // "STATE_UNSPECIFIED" - Human review state is unspecified. Most - // likely due to an internal error. - // "SKIPPED" - Human review is skipped for the document. This can - // happen because human review is not enabled on the processor or the - // processing request has been set to skip this document. - // "VALIDATION_PASSED" - Human review validation is triggered and - // passed, so no review is needed. - // "IN_PROGRESS" - Human review validation is triggered and the - // document is under review. - // "ERROR" - Some error happened during triggering human review, see - // the [state_message] for details. - State string `json:"state,omitempty"` +// GoogleCloudDocumentaiV1EvaluationCounters: Evaluation counters for +// the documents that were used. +type GoogleCloudDocumentaiV1EvaluationCounters struct { + // EvaluatedDocumentsCount: How many documents were used in the + // evaluation. + EvaluatedDocumentsCount int64 `json:"evaluatedDocumentsCount,omitempty"` - // StateMessage: A message providing more details about the human review - // state. - StateMessage string `json:"stateMessage,omitempty"` + // FailedDocumentsCount: How many documents were not included in the + // evaluation as Document AI failed to process them. + FailedDocumentsCount int64 `json:"failedDocumentsCount,omitempty"` + + // InputDocumentsCount: How many documents were sent for evaluation. + InputDocumentsCount int64 `json:"inputDocumentsCount,omitempty"` + + // InvalidDocumentsCount: How many documents were not included in the + // evaluation as they didn't pass validation. + InvalidDocumentsCount int64 `json:"invalidDocumentsCount,omitempty"` // ForceSendFields is a list of field names (e.g. - // "HumanReviewOperation") to unconditionally include in API requests. - // By default, fields with empty or default values are omitted from API - // requests. However, any non-pointer, non-interface field appearing in - // ForceSendFields will be sent to the server regardless of whether the - // field is empty or not. This may be used to include empty fields in - // Patch requests. + // "EvaluatedDocumentsCount") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted + // from API requests. However, any non-pointer, non-interface field + // appearing in ForceSendFields will be sent to the server regardless of + // whether the field is empty or not. This may be used to include empty + // fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "HumanReviewOperation") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the + // NullFields is a list of field names (e.g. "EvaluatedDocumentsCount") + // to include in API requests with the JSON null value. By default, + // fields with empty values are omitted from API requests. However, any + // field with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1HumanReviewStatus) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1HumanReviewStatus +func (s *GoogleCloudDocumentaiV1EvaluationCounters) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1EvaluationCounters raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1ListProcessorTypesResponse: Response message -// for list processor types. -type GoogleCloudDocumentaiV1ListProcessorTypesResponse struct { - // NextPageToken: Points to the next page, otherwise empty. - NextPageToken string `json:"nextPageToken,omitempty"` +// GoogleCloudDocumentaiV1EvaluationMetrics: Evaluation metrics, either +// in aggregate or about a specific entity. +type GoogleCloudDocumentaiV1EvaluationMetrics struct { + // F1Score: The calculated f1 score. + F1Score float64 `json:"f1Score,omitempty"` - // ProcessorTypes: The processor types. - ProcessorTypes []*GoogleCloudDocumentaiV1ProcessorType `json:"processorTypes,omitempty"` + // FalseNegativesCount: The amount of false negatives. + FalseNegativesCount int64 `json:"falseNegativesCount,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // FalsePositivesCount: The amount of false positives. + FalsePositivesCount int64 `json:"falsePositivesCount,omitempty"` - // ForceSendFields is a list of field names (e.g. "NextPageToken") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` + // GroundTruthDocumentCount: The amount of documents with a ground truth + // occurrence. + GroundTruthDocumentCount int64 `json:"groundTruthDocumentCount,omitempty"` - // NullFields is a list of field names (e.g. "NextPageToken") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} + // GroundTruthOccurrencesCount: The amount of occurrences in ground + // truth documents. + GroundTruthOccurrencesCount int64 `json:"groundTruthOccurrencesCount,omitempty"` -func (s *GoogleCloudDocumentaiV1ListProcessorTypesResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1ListProcessorTypesResponse - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} + // Precision: The calculated precision. + Precision float64 `json:"precision,omitempty"` -// GoogleCloudDocumentaiV1ListProcessorVersionsResponse: Response -// message for list processors. -type GoogleCloudDocumentaiV1ListProcessorVersionsResponse struct { - // NextPageToken: Points to the next processor, otherwise empty. - NextPageToken string `json:"nextPageToken,omitempty"` + // PredictedDocumentCount: The amount of documents with a predicted + // occurrence. + PredictedDocumentCount int64 `json:"predictedDocumentCount,omitempty"` - // ProcessorVersions: The list of processors. - ProcessorVersions []*GoogleCloudDocumentaiV1ProcessorVersion `json:"processorVersions,omitempty"` + // PredictedOccurrencesCount: The amount of occurrences in predicted + // documents. + PredictedOccurrencesCount int64 `json:"predictedOccurrencesCount,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // Recall: The calculated recall. + Recall float64 `json:"recall,omitempty"` - // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // TotalDocumentsCount: The amount of documents that had an occurrence + // of this label. + TotalDocumentsCount int64 `json:"totalDocumentsCount,omitempty"` + + // TruePositivesCount: The amount of true positives. + TruePositivesCount int64 `json:"truePositivesCount,omitempty"` + + // ForceSendFields is a list of field names (e.g. "F1Score") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -4327,68 +4379,81 @@ type GoogleCloudDocumentaiV1ListProcessorVersionsResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "NextPageToken") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "F1Score") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1ListProcessorVersionsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1ListProcessorVersionsResponse +func (s *GoogleCloudDocumentaiV1EvaluationMetrics) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1EvaluationMetrics raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1ListProcessorsResponse: Response message for -// list processors. -type GoogleCloudDocumentaiV1ListProcessorsResponse struct { - // NextPageToken: Points to the next processor, otherwise empty. - NextPageToken string `json:"nextPageToken,omitempty"` +func (s *GoogleCloudDocumentaiV1EvaluationMetrics) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDocumentaiV1EvaluationMetrics + var s1 struct { + F1Score gensupport.JSONFloat64 `json:"f1Score"` + Precision gensupport.JSONFloat64 `json:"precision"` + Recall gensupport.JSONFloat64 `json:"recall"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.F1Score = float64(s1.F1Score) + s.Precision = float64(s1.Precision) + s.Recall = float64(s1.Recall) + return nil +} - // Processors: The list of processors. - Processors []*GoogleCloudDocumentaiV1Processor `json:"processors,omitempty"` +// GoogleCloudDocumentaiV1EvaluationMultiConfidenceMetrics: Metrics +// across multiple confidence levels. +type GoogleCloudDocumentaiV1EvaluationMultiConfidenceMetrics struct { + // Auprc: The calculated area under the precision recall curve (AUPRC), + // computed by integrating over all confidence thresholds. + Auprc float64 `json:"auprc,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // AuprcExact: The AUPRC for metrics with fuzzy matching disabled, i.e., + // exact matching only. + AuprcExact float64 `json:"auprcExact,omitempty"` - // ForceSendFields is a list of field names (e.g. "NextPageToken") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` + // ConfidenceLevelMetrics: Metrics across confidence levels with fuzzy + // matching enabled. + ConfidenceLevelMetrics []*GoogleCloudDocumentaiV1EvaluationConfidenceLevelMetrics `json:"confidenceLevelMetrics,omitempty"` - // NullFields is a list of field names (e.g. "NextPageToken") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} + // ConfidenceLevelMetricsExact: Metrics across confidence levels with + // only exact matching. + ConfidenceLevelMetricsExact []*GoogleCloudDocumentaiV1EvaluationConfidenceLevelMetrics `json:"confidenceLevelMetricsExact,omitempty"` -func (s *GoogleCloudDocumentaiV1ListProcessorsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1ListProcessorsResponse - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} + // EstimatedCalibrationError: The Estimated Calibration Error (ECE) of + // the confidence of the predicted entities. + EstimatedCalibrationError float64 `json:"estimatedCalibrationError,omitempty"` -// GoogleCloudDocumentaiV1NormalizedVertex: A vertex represents a 2D -// point in the image. NOTE: the normalized vertex coordinates are -// relative to the original image and range from 0 to 1. -type GoogleCloudDocumentaiV1NormalizedVertex struct { - // X: X coordinate. - X float64 `json:"x,omitempty"` + // EstimatedCalibrationErrorExact: The ECE for the predicted entities + // with fuzzy matching disabled, i.e., exact matching only. + EstimatedCalibrationErrorExact float64 `json:"estimatedCalibrationErrorExact,omitempty"` - // Y: Y coordinate (starts from the top of the image). - Y float64 `json:"y,omitempty"` + // MetricsType: The metrics type for the label. + // + // Possible values: + // "METRICS_TYPE_UNSPECIFIED" - The metrics type is unspecified. By + // default, metrics without a particular specification are for leaf + // entity types (i.e., top-level entity types without child types, or + // child types which are not parent types themselves). + // "AGGREGATE" - Indicates whether metrics for this particular label + // type represent an aggregate of metrics for other types instead of + // being based on actual TP/FP/FN values for the label type. Metrics for + // parent (i.e., non-leaf) entity types are an aggregate of metrics for + // their children. + MetricsType string `json:"metricsType,omitempty"` - // ForceSendFields is a list of field names (e.g. "X") to + // ForceSendFields is a list of field names (e.g. "Auprc") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -4396,7 +4461,7 @@ type GoogleCloudDocumentaiV1NormalizedVertex struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "X") to include in API + // NullFields is a list of field names (e.g. "Auprc") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -4405,48 +4470,51 @@ type GoogleCloudDocumentaiV1NormalizedVertex struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1NormalizedVertex) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1NormalizedVertex +func (s *GoogleCloudDocumentaiV1EvaluationMultiConfidenceMetrics) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1EvaluationMultiConfidenceMetrics raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *GoogleCloudDocumentaiV1NormalizedVertex) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudDocumentaiV1NormalizedVertex +func (s *GoogleCloudDocumentaiV1EvaluationMultiConfidenceMetrics) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDocumentaiV1EvaluationMultiConfidenceMetrics var s1 struct { - X gensupport.JSONFloat64 `json:"x"` - Y gensupport.JSONFloat64 `json:"y"` + Auprc gensupport.JSONFloat64 `json:"auprc"` + AuprcExact gensupport.JSONFloat64 `json:"auprcExact"` + EstimatedCalibrationError gensupport.JSONFloat64 `json:"estimatedCalibrationError"` + EstimatedCalibrationErrorExact gensupport.JSONFloat64 `json:"estimatedCalibrationErrorExact"` *NoMethod } s1.NoMethod = (*NoMethod)(s) if err := json.Unmarshal(data, &s1); err != nil { return err } - s.X = float64(s1.X) - s.Y = float64(s1.Y) + s.Auprc = float64(s1.Auprc) + s.AuprcExact = float64(s1.AuprcExact) + s.EstimatedCalibrationError = float64(s1.EstimatedCalibrationError) + s.EstimatedCalibrationErrorExact = float64(s1.EstimatedCalibrationErrorExact) return nil } -// GoogleCloudDocumentaiV1ProcessRequest: Request message for the -// process document method. -type GoogleCloudDocumentaiV1ProcessRequest struct { - // FieldMask: Specifies which fields to include in ProcessResponse's - // document. Only supports top level document and pages field so it must - // be in the form of `{document_field_name}` or - // `pages.{page_field_name}`. - FieldMask string `json:"fieldMask,omitempty"` +// GoogleCloudDocumentaiV1EvaluationReference: Gives a short summary of +// an evaluation, and links to the evaluation itself. +type GoogleCloudDocumentaiV1EvaluationReference struct { + // AggregateMetrics: An aggregate of the statistics for the evaluation + // with fuzzy matching on. + AggregateMetrics *GoogleCloudDocumentaiV1EvaluationMetrics `json:"aggregateMetrics,omitempty"` - // InlineDocument: An inline document proto. - InlineDocument *GoogleCloudDocumentaiV1Document `json:"inlineDocument,omitempty"` + // AggregateMetricsExact: An aggregate of the statistics for the + // evaluation with fuzzy matching off. + AggregateMetricsExact *GoogleCloudDocumentaiV1EvaluationMetrics `json:"aggregateMetricsExact,omitempty"` - // RawDocument: A raw document content (bytes). - RawDocument *GoogleCloudDocumentaiV1RawDocument `json:"rawDocument,omitempty"` + // Evaluation: The resource name of the evaluation. + Evaluation string `json:"evaluation,omitempty"` - // SkipHumanReview: Whether Human Review feature should be skipped for - // this request. Default to false. - SkipHumanReview bool `json:"skipHumanReview,omitempty"` + // Operation: The resource name of the Long Running Operation for the + // evaluation. + Operation string `json:"operation,omitempty"` - // ForceSendFields is a list of field names (e.g. "FieldMask") to + // ForceSendFields is a list of field names (e.g. "AggregateMetrics") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -4454,37 +4522,33 @@ type GoogleCloudDocumentaiV1ProcessRequest struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "FieldMask") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "AggregateMetrics") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1ProcessRequest) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1ProcessRequest +func (s *GoogleCloudDocumentaiV1EvaluationReference) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1EvaluationReference raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1ProcessResponse: Response message for the -// process document method. -type GoogleCloudDocumentaiV1ProcessResponse struct { - // Document: The document payload, will populate fields based on the - // processor's behavior. - Document *GoogleCloudDocumentaiV1Document `json:"document,omitempty"` - - // HumanReviewStatus: The status of human review on the processed - // document. - HumanReviewStatus *GoogleCloudDocumentaiV1HumanReviewStatus `json:"humanReviewStatus,omitempty"` +// GoogleCloudDocumentaiV1FetchProcessorTypesResponse: Response message +// for fetch processor types. +type GoogleCloudDocumentaiV1FetchProcessorTypesResponse struct { + // ProcessorTypes: The list of processor types. + ProcessorTypes []*GoogleCloudDocumentaiV1ProcessorType `json:"processorTypes,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "Document") to + // ForceSendFields is a list of field names (e.g. "ProcessorTypes") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -4492,81 +4556,61 @@ type GoogleCloudDocumentaiV1ProcessResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Document") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "ProcessorTypes") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1ProcessResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1ProcessResponse +func (s *GoogleCloudDocumentaiV1FetchProcessorTypesResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1FetchProcessorTypesResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1Processor: The first-class citizen for -// Document AI. Each processor defines how to extract structural -// information from a document. -type GoogleCloudDocumentaiV1Processor struct { - // CreateTime: The time the processor was created. - CreateTime string `json:"createTime,omitempty"` - - // DefaultProcessorVersion: The default processor version. - DefaultProcessorVersion string `json:"defaultProcessorVersion,omitempty"` - - // DisplayName: The display name of the processor. - DisplayName string `json:"displayName,omitempty"` - - // KmsKeyName: The KMS key used for encryption/decryption in CMEK - // scenarios. See https://cloud.google.com/security-key-management. - KmsKeyName string `json:"kmsKeyName,omitempty"` +// GoogleCloudDocumentaiV1GcsDocument: Specifies a document stored on +// Cloud Storage. +type GoogleCloudDocumentaiV1GcsDocument struct { + // GcsUri: The Cloud Storage object uri. + GcsUri string `json:"gcsUri,omitempty"` - // Name: Output only. Immutable. The resource name of the processor. - // Format: - // `projects/{project}/locations/{location}/processors/{processor}` - Name string `json:"name,omitempty"` + // MimeType: An IANA MIME type (RFC6838) of the content. + MimeType string `json:"mimeType,omitempty"` - // ProcessEndpoint: Output only. Immutable. The http endpoint that can - // be called to invoke processing. - ProcessEndpoint string `json:"processEndpoint,omitempty"` + // ForceSendFields is a list of field names (e.g. "GcsUri") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` - // State: Output only. The state of the processor. - // - // Possible values: - // "STATE_UNSPECIFIED" - The processor is in an unspecified state. - // "ENABLED" - The processor is enabled, i.e., has an enabled version - // which can currently serve processing requests and all the feature - // dependencies have been successfully initialized. - // "DISABLED" - The processor is disabled. - // "ENABLING" - The processor is being enabled, will become `ENABLED` - // if successful. - // "DISABLING" - The processor is being disabled, will become - // `DISABLED` if successful. - // "CREATING" - The processor is being created, will become either - // `ENABLED` (for successful creation) or `FAILED` (for failed ones). - // Once a processor is in this state, it can then be used for document - // processing, but the feature dependencies of the processor might not - // be fully created yet. - // "FAILED" - The processor failed during creation or initialization - // of feature dependencies. The user should delete the processor and - // recreate one as all the functionalities of the processor are - // disabled. - // "DELETING" - The processor is being deleted, will be removed if - // successful. - State string `json:"state,omitempty"` + // NullFields is a list of field names (e.g. "GcsUri") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} - // Type: The processor type, e.g., `OCR_PROCESSOR`, `INVOICE_PROCESSOR`, - // etc. To get a list of processors types, see FetchProcessorTypes. - Type string `json:"type,omitempty"` +func (s *GoogleCloudDocumentaiV1GcsDocument) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1GcsDocument + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` +// GoogleCloudDocumentaiV1GcsDocuments: Specifies a set of documents on +// Cloud Storage. +type GoogleCloudDocumentaiV1GcsDocuments struct { + // Documents: The list of documents. + Documents []*GoogleCloudDocumentaiV1GcsDocument `json:"documents,omitempty"` - // ForceSendFields is a list of field names (e.g. "CreateTime") to + // ForceSendFields is a list of field names (e.g. "Documents") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -4574,7 +4618,7 @@ type GoogleCloudDocumentaiV1Processor struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CreateTime") to include in + // NullFields is a list of field names (e.g. "Documents") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -4583,83 +4627,112 @@ type GoogleCloudDocumentaiV1Processor struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1Processor) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1Processor +func (s *GoogleCloudDocumentaiV1GcsDocuments) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1GcsDocuments raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1ProcessorType: A processor type is responsible -// for performing a certain document understanding task on a certain -// type of document. -type GoogleCloudDocumentaiV1ProcessorType struct { - // AllowCreation: Whether the processor type allows creation. If true, - // users can create a processor of this processor type. Otherwise, users - // need to request access. - AllowCreation bool `json:"allowCreation,omitempty"` +// GoogleCloudDocumentaiV1GcsPrefix: Specifies all documents on Cloud +// Storage with a common prefix. +type GoogleCloudDocumentaiV1GcsPrefix struct { + // GcsUriPrefix: The URI prefix. + GcsUriPrefix string `json:"gcsUriPrefix,omitempty"` - // AvailableLocations: The locations in which this processor is - // available. - AvailableLocations []*GoogleCloudDocumentaiV1ProcessorTypeLocationInfo `json:"availableLocations,omitempty"` + // ForceSendFields is a list of field names (e.g. "GcsUriPrefix") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` - // Category: The processor category, used by UI to group processor - // types. - Category string `json:"category,omitempty"` + // NullFields is a list of field names (e.g. "GcsUriPrefix") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} - // LaunchStage: Launch stage of the processor type - // - // Possible values: - // "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value. - // "UNIMPLEMENTED" - The feature is not yet implemented. Users can not - // use it. - // "PRELAUNCH" - Prelaunch features are hidden from users and are only - // visible internally. - // "EARLY_ACCESS" - Early Access features are limited to a closed - // group of testers. To use these features, you must sign up in advance - // and sign a Trusted Tester agreement (which includes confidentiality - // provisions). These features may be unstable, changed in - // backward-incompatible ways, and are not guaranteed to be released. - // "ALPHA" - Alpha is a limited availability test for releases before - // they are cleared for widespread use. By Alpha, all significant design - // issues are resolved and we are in the process of verifying - // functionality. Alpha customers need to apply for access, agree to - // applicable terms, and have their projects allowlisted. Alpha releases - // don't have to be feature complete, no SLAs are provided, and there - // are no technical support obligations, but they will be far enough - // along that customers can actually use them in test environments or - // for limited-use tests -- just like they would in normal production - // cases. - // "BETA" - Beta is the point at which we are ready to open a release - // for any customer to use. There are no SLA or technical support - // obligations in a Beta release. Products will be complete from a - // feature perspective, but may have some open outstanding issues. Beta - // releases are suitable for limited production use cases. - // "GA" - GA features are open to all developers and are considered - // stable and fully qualified for production use. - // "DEPRECATED" - Deprecated features are scheduled to be shut down - // and removed. For more information, see the "Deprecation Policy" - // section of our [Terms of Service](https://cloud.google.com/terms/) - // and the [Google Cloud Platform Subject to the Deprecation - // Policy](https://cloud.google.com/terms/deprecation) documentation. - LaunchStage string `json:"launchStage,omitempty"` +func (s *GoogleCloudDocumentaiV1GcsPrefix) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1GcsPrefix + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // Name: The resource name of the processor type. Format: - // `projects/{project}/processorTypes/{processor_type}` - Name string `json:"name,omitempty"` +// GoogleCloudDocumentaiV1HumanReviewStatus: The status of human review +// on a processed document. +type GoogleCloudDocumentaiV1HumanReviewStatus struct { + // HumanReviewOperation: The name of the operation triggered by the + // processed document. This field is populated only when the [state] is + // [HUMAN_REVIEW_IN_PROGRESS]. It has the same response type and + // metadata as the long running operation returned by [ReviewDocument] + // method. + HumanReviewOperation string `json:"humanReviewOperation,omitempty"` - // SampleDocumentUris: A set of Cloud Storage URIs of sample documents - // for this processor. - SampleDocumentUris []string `json:"sampleDocumentUris,omitempty"` + // State: The state of human review on the processing request. + // + // Possible values: + // "STATE_UNSPECIFIED" - Human review state is unspecified. Most + // likely due to an internal error. + // "SKIPPED" - Human review is skipped for the document. This can + // happen because human review is not enabled on the processor or the + // processing request has been set to skip this document. + // "VALIDATION_PASSED" - Human review validation is triggered and + // passed, so no review is needed. + // "IN_PROGRESS" - Human review validation is triggered and the + // document is under review. + // "ERROR" - Some error happened during triggering human review, see + // the [state_message] for details. + State string `json:"state,omitempty"` - // Type: The processor type, e.g., `OCR_PROCESSOR`, `INVOICE_PROCESSOR`, - // etc. - Type string `json:"type,omitempty"` + // StateMessage: A message providing more details about the human review + // state. + StateMessage string `json:"stateMessage,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "HumanReviewOperation") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "HumanReviewOperation") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDocumentaiV1HumanReviewStatus) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1HumanReviewStatus + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDocumentaiV1ListEvaluationsResponse: The response from +// ListEvaluations. +type GoogleCloudDocumentaiV1ListEvaluationsResponse struct { + // Evaluations: The evaluations requested. + Evaluations []*GoogleCloudDocumentaiV1Evaluation `json:"evaluations,omitempty"` + + // NextPageToken: A token, which can be sent as `page_token` to retrieve + // the next page. If this field is omitted, there are no subsequent + // pages. + NextPageToken string `json:"nextPageToken,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "AllowCreation") to + // ForceSendFields is a list of field names (e.g. "Evaluations") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -4667,7 +4740,7 @@ type GoogleCloudDocumentaiV1ProcessorType struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AllowCreation") to include + // NullFields is a list of field names (e.g. "Evaluations") to include // in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. However, any field with // an empty value appearing in NullFields will be sent to the server as @@ -4676,19 +4749,26 @@ type GoogleCloudDocumentaiV1ProcessorType struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1ProcessorType) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1ProcessorType +func (s *GoogleCloudDocumentaiV1ListEvaluationsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1ListEvaluationsResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1ProcessorTypeLocationInfo: The location -// information about where the processor is available. -type GoogleCloudDocumentaiV1ProcessorTypeLocationInfo struct { - // LocationId: The location id, currently must be one of [us, eu]. - LocationId string `json:"locationId,omitempty"` +// GoogleCloudDocumentaiV1ListProcessorTypesResponse: Response message +// for list processor types. +type GoogleCloudDocumentaiV1ListProcessorTypesResponse struct { + // NextPageToken: Points to the next page, otherwise empty. + NextPageToken string `json:"nextPageToken,omitempty"` - // ForceSendFields is a list of field names (e.g. "LocationId") to + // ProcessorTypes: The processor types. + ProcessorTypes []*GoogleCloudDocumentaiV1ProcessorType `json:"processorTypes,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -4696,79 +4776,35 @@ type GoogleCloudDocumentaiV1ProcessorTypeLocationInfo struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "LocationId") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "NextPageToken") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1ProcessorTypeLocationInfo) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1ProcessorTypeLocationInfo +func (s *GoogleCloudDocumentaiV1ListProcessorTypesResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1ListProcessorTypesResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1ProcessorVersion: A processor version is an -// implementation of a processor. Each processor can have multiple -// versions, pre-trained by Google internally or up-trained by the -// customer. At a time, a processor can only have one default version -// version. So the processor's behavior (when processing documents) is -// defined by a default version -type GoogleCloudDocumentaiV1ProcessorVersion struct { - // CreateTime: The time the processor version was created. - CreateTime string `json:"createTime,omitempty"` - - // DeprecationInfo: If set, information about the eventual deprecation - // of this version. - DeprecationInfo *GoogleCloudDocumentaiV1ProcessorVersionDeprecationInfo `json:"deprecationInfo,omitempty"` - - // DisplayName: The display name of the processor version. - DisplayName string `json:"displayName,omitempty"` - - // DocumentSchema: The schema of the processor version. Describes the - // output. - DocumentSchema *GoogleCloudDocumentaiV1DocumentSchema `json:"documentSchema,omitempty"` - - // GoogleManaged: Denotes that this ProcessorVersion is managed by - // google. - GoogleManaged bool `json:"googleManaged,omitempty"` - - // KmsKeyName: The KMS key name used for encryption. - KmsKeyName string `json:"kmsKeyName,omitempty"` - - // KmsKeyVersionName: The KMS key version with which data is encrypted. - KmsKeyVersionName string `json:"kmsKeyVersionName,omitempty"` - - // Name: The resource name of the processor version. Format: - // `projects/{project}/locations/{location}/processors/{processor}/proces - // sorVersions/{processor_version}` - Name string `json:"name,omitempty"` +// GoogleCloudDocumentaiV1ListProcessorVersionsResponse: Response +// message for list processors. +type GoogleCloudDocumentaiV1ListProcessorVersionsResponse struct { + // NextPageToken: Points to the next processor, otherwise empty. + NextPageToken string `json:"nextPageToken,omitempty"` - // State: The state of the processor version. - // - // Possible values: - // "STATE_UNSPECIFIED" - The processor version is in an unspecified - // state. - // "DEPLOYED" - The processor version is deployed and can be used for - // processing. - // "DEPLOYING" - The processor version is being deployed. - // "UNDEPLOYED" - The processor version is not deployed and cannot be - // used for processing. - // "UNDEPLOYING" - The processor version is being undeployed. - // "CREATING" - The processor version is being created. - // "DELETING" - The processor version is being deleted. - // "FAILED" - The processor version failed and is in an indeterminate - // state. - State string `json:"state,omitempty"` + // ProcessorVersions: The list of processors. + ProcessorVersions []*GoogleCloudDocumentaiV1ProcessorVersion `json:"processorVersions,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "CreateTime") to + // ForceSendFields is a list of field names (e.g. "NextPageToken") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -4776,33 +4812,35 @@ type GoogleCloudDocumentaiV1ProcessorVersion struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CreateTime") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "NextPageToken") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1ProcessorVersion) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1ProcessorVersion +func (s *GoogleCloudDocumentaiV1ListProcessorVersionsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1ListProcessorVersionsResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1ProcessorVersionDeprecationInfo: Information -// about the upcoming deprecation of this processor version. -type GoogleCloudDocumentaiV1ProcessorVersionDeprecationInfo struct { - // DeprecationTime: The time at which this processor version will be - // deprecated. - DeprecationTime string `json:"deprecationTime,omitempty"` +// GoogleCloudDocumentaiV1ListProcessorsResponse: Response message for +// list processors. +type GoogleCloudDocumentaiV1ListProcessorsResponse struct { + // NextPageToken: Points to the next processor, otherwise empty. + NextPageToken string `json:"nextPageToken,omitempty"` - // ReplacementProcessorVersion: If set, the processor version that will - // be used as a replacement. - ReplacementProcessorVersion string `json:"replacementProcessorVersion,omitempty"` + // Processors: The list of processors. + Processors []*GoogleCloudDocumentaiV1Processor `json:"processors,omitempty"` - // ForceSendFields is a list of field names (e.g. "DeprecationTime") to + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -4810,33 +4848,32 @@ type GoogleCloudDocumentaiV1ProcessorVersionDeprecationInfo struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DeprecationTime") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "NextPageToken") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1ProcessorVersionDeprecationInfo) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1ProcessorVersionDeprecationInfo +func (s *GoogleCloudDocumentaiV1ListProcessorsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1ListProcessorsResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1RawDocument: Payload message of raw document -// content (bytes). -type GoogleCloudDocumentaiV1RawDocument struct { - // Content: Inline document content. - Content string `json:"content,omitempty"` +// GoogleCloudDocumentaiV1NormalizedVertex: A vertex represents a 2D +// point in the image. NOTE: the normalized vertex coordinates are +// relative to the original image and range from 0 to 1. +type GoogleCloudDocumentaiV1NormalizedVertex struct { + // X: X coordinate. + X float64 `json:"x,omitempty"` - // MimeType: An IANA MIME type (RFC6838) indicating the nature and - // format of the content. - MimeType string `json:"mimeType,omitempty"` + // Y: Y coordinate (starts from the top of the image). + Y float64 `json:"y,omitempty"` - // ForceSendFields is a list of field names (e.g. "Content") to + // ForceSendFields is a list of field names (e.g. "X") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -4844,8 +4881,8 @@ type GoogleCloudDocumentaiV1RawDocument struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Content") to include in - // API requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "X") to include in API + // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -4853,22 +4890,48 @@ type GoogleCloudDocumentaiV1RawDocument struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1RawDocument) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1RawDocument +func (s *GoogleCloudDocumentaiV1NormalizedVertex) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1NormalizedVertex raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1ReviewDocumentOperationMetadata: The long -// running operation metadata for review document method. -type GoogleCloudDocumentaiV1ReviewDocumentOperationMetadata struct { - // CommonMetadata: The basic metadata of the long running operation. - CommonMetadata *GoogleCloudDocumentaiV1CommonOperationMetadata `json:"commonMetadata,omitempty"` +func (s *GoogleCloudDocumentaiV1NormalizedVertex) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDocumentaiV1NormalizedVertex + var s1 struct { + X gensupport.JSONFloat64 `json:"x"` + Y gensupport.JSONFloat64 `json:"y"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.X = float64(s1.X) + s.Y = float64(s1.Y) + return nil +} - // QuestionId: The Crowd Compute question ID. - QuestionId string `json:"questionId,omitempty"` +// GoogleCloudDocumentaiV1ProcessRequest: Request message for the +// process document method. +type GoogleCloudDocumentaiV1ProcessRequest struct { + // FieldMask: Specifies which fields to include in ProcessResponse's + // document. Only supports top level document and pages field so it must + // be in the form of `{document_field_name}` or + // `pages.{page_field_name}`. + FieldMask string `json:"fieldMask,omitempty"` - // ForceSendFields is a list of field names (e.g. "CommonMetadata") to + // InlineDocument: An inline document proto. + InlineDocument *GoogleCloudDocumentaiV1Document `json:"inlineDocument,omitempty"` + + // RawDocument: A raw document content (bytes). + RawDocument *GoogleCloudDocumentaiV1RawDocument `json:"rawDocument,omitempty"` + + // SkipHumanReview: Whether Human Review feature should be skipped for + // this request. Default to false. + SkipHumanReview bool `json:"skipHumanReview,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FieldMask") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -4876,45 +4939,37 @@ type GoogleCloudDocumentaiV1ReviewDocumentOperationMetadata struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CommonMetadata") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "FieldMask") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1ReviewDocumentOperationMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1ReviewDocumentOperationMetadata +func (s *GoogleCloudDocumentaiV1ProcessRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1ProcessRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1ReviewDocumentRequest: Request message for -// review document method. -type GoogleCloudDocumentaiV1ReviewDocumentRequest struct { - // DocumentSchema: The document schema of the human review task. - DocumentSchema *GoogleCloudDocumentaiV1DocumentSchema `json:"documentSchema,omitempty"` - - // EnableSchemaValidation: Whether the validation should be performed on - // the ad-hoc review request. - EnableSchemaValidation bool `json:"enableSchemaValidation,omitempty"` +// GoogleCloudDocumentaiV1ProcessResponse: Response message for the +// process document method. +type GoogleCloudDocumentaiV1ProcessResponse struct { + // Document: The document payload, will populate fields based on the + // processor's behavior. + Document *GoogleCloudDocumentaiV1Document `json:"document,omitempty"` - // InlineDocument: An inline document proto. - InlineDocument *GoogleCloudDocumentaiV1Document `json:"inlineDocument,omitempty"` + // HumanReviewStatus: The status of human review on the processed + // document. + HumanReviewStatus *GoogleCloudDocumentaiV1HumanReviewStatus `json:"humanReviewStatus,omitempty"` - // Priority: The priority of the human review task. - // - // Possible values: - // "DEFAULT" - The default priority level. - // "URGENT" - The urgent priority level. The labeling manager should - // allocate labeler resource to the urgent task queue to respect this - // priority level. - Priority string `json:"priority,omitempty"` + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "DocumentSchema") to + // ForceSendFields is a list of field names (e.g. "Document") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -4922,72 +4977,81 @@ type GoogleCloudDocumentaiV1ReviewDocumentRequest struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DocumentSchema") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "Document") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1ReviewDocumentRequest) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1ReviewDocumentRequest +func (s *GoogleCloudDocumentaiV1ProcessResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1ProcessResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1ReviewDocumentResponse: Response message for -// review document method. -type GoogleCloudDocumentaiV1ReviewDocumentResponse struct { - // GcsDestination: The Cloud Storage uri for the human reviewed document - // if the review is succeeded. - GcsDestination string `json:"gcsDestination,omitempty"` +// GoogleCloudDocumentaiV1Processor: The first-class citizen for +// Document AI. Each processor defines how to extract structural +// information from a document. +type GoogleCloudDocumentaiV1Processor struct { + // CreateTime: The time the processor was created. + CreateTime string `json:"createTime,omitempty"` - // RejectionReason: The reason why the review is rejected by reviewer. - RejectionReason string `json:"rejectionReason,omitempty"` + // DefaultProcessorVersion: The default processor version. + DefaultProcessorVersion string `json:"defaultProcessorVersion,omitempty"` - // State: The state of the review operation. + // DisplayName: The display name of the processor. + DisplayName string `json:"displayName,omitempty"` + + // KmsKeyName: The KMS key used for encryption/decryption in CMEK + // scenarios. See https://cloud.google.com/security-key-management. + KmsKeyName string `json:"kmsKeyName,omitempty"` + + // Name: Output only. Immutable. The resource name of the processor. + // Format: + // `projects/{project}/locations/{location}/processors/{processor}` + Name string `json:"name,omitempty"` + + // ProcessEndpoint: Output only. Immutable. The http endpoint that can + // be called to invoke processing. + ProcessEndpoint string `json:"processEndpoint,omitempty"` + + // State: Output only. The state of the processor. // // Possible values: - // "STATE_UNSPECIFIED" - The default value. This value is used if the - // state is omitted. - // "REJECTED" - The review operation is rejected by the reviewer. - // "SUCCEEDED" - The review operation is succeeded. + // "STATE_UNSPECIFIED" - The processor is in an unspecified state. + // "ENABLED" - The processor is enabled, i.e., has an enabled version + // which can currently serve processing requests and all the feature + // dependencies have been successfully initialized. + // "DISABLED" - The processor is disabled. + // "ENABLING" - The processor is being enabled, will become `ENABLED` + // if successful. + // "DISABLING" - The processor is being disabled, will become + // `DISABLED` if successful. + // "CREATING" - The processor is being created, will become either + // `ENABLED` (for successful creation) or `FAILED` (for failed ones). + // Once a processor is in this state, it can then be used for document + // processing, but the feature dependencies of the processor might not + // be fully created yet. + // "FAILED" - The processor failed during creation or initialization + // of feature dependencies. The user should delete the processor and + // recreate one as all the functionalities of the processor are + // disabled. + // "DELETING" - The processor is being deleted, will be removed if + // successful. State string `json:"state,omitempty"` - // ForceSendFields is a list of field names (e.g. "GcsDestination") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "GcsDestination") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudDocumentaiV1ReviewDocumentResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1ReviewDocumentResponse - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} + // Type: The processor type, e.g., `OCR_PROCESSOR`, `INVOICE_PROCESSOR`, + // etc. To get a list of processors types, see FetchProcessorTypes. + Type string `json:"type,omitempty"` -// GoogleCloudDocumentaiV1SetDefaultProcessorVersionMetadata: The long -// running operation metadata for set default processor version method. -type GoogleCloudDocumentaiV1SetDefaultProcessorVersionMetadata struct { - // CommonMetadata: The basic metadata of the long running operation. - CommonMetadata *GoogleCloudDocumentaiV1CommonOperationMetadata `json:"commonMetadata,omitempty"` + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "CommonMetadata") to + // ForceSendFields is a list of field names (e.g. "CreateTime") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -4995,68 +5059,92 @@ type GoogleCloudDocumentaiV1SetDefaultProcessorVersionMetadata struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CommonMetadata") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1SetDefaultProcessorVersionMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1SetDefaultProcessorVersionMetadata +func (s *GoogleCloudDocumentaiV1Processor) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1Processor raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1SetDefaultProcessorVersionRequest: Request -// message for the set default processor version method. -type GoogleCloudDocumentaiV1SetDefaultProcessorVersionRequest struct { - // DefaultProcessorVersion: Required. The resource name of child - // ProcessorVersion to use as default. Format: - // `projects/{project}/locations/{location}/processors/{processor}/proces - // sorVersions/{version}` - DefaultProcessorVersion string `json:"defaultProcessorVersion,omitempty"` +// GoogleCloudDocumentaiV1ProcessorType: A processor type is responsible +// for performing a certain document understanding task on a certain +// type of document. +type GoogleCloudDocumentaiV1ProcessorType struct { + // AllowCreation: Whether the processor type allows creation. If true, + // users can create a processor of this processor type. Otherwise, users + // need to request access. + AllowCreation bool `json:"allowCreation,omitempty"` - // ForceSendFields is a list of field names (e.g. - // "DefaultProcessorVersion") to unconditionally include in API - // requests. By default, fields with empty or default values are omitted - // from API requests. However, any non-pointer, non-interface field - // appearing in ForceSendFields will be sent to the server regardless of - // whether the field is empty or not. This may be used to include empty - // fields in Patch requests. - ForceSendFields []string `json:"-"` + // AvailableLocations: The locations in which this processor is + // available. + AvailableLocations []*GoogleCloudDocumentaiV1ProcessorTypeLocationInfo `json:"availableLocations,omitempty"` - // NullFields is a list of field names (e.g. "DefaultProcessorVersion") - // to include in API requests with the JSON null value. By default, - // fields with empty values are omitted from API requests. However, any - // field with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. - NullFields []string `json:"-"` -} + // Category: The processor category, used by UI to group processor + // types. + Category string `json:"category,omitempty"` -func (s *GoogleCloudDocumentaiV1SetDefaultProcessorVersionRequest) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1SetDefaultProcessorVersionRequest - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} + // LaunchStage: Launch stage of the processor type + // + // Possible values: + // "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value. + // "UNIMPLEMENTED" - The feature is not yet implemented. Users can not + // use it. + // "PRELAUNCH" - Prelaunch features are hidden from users and are only + // visible internally. + // "EARLY_ACCESS" - Early Access features are limited to a closed + // group of testers. To use these features, you must sign up in advance + // and sign a Trusted Tester agreement (which includes confidentiality + // provisions). These features may be unstable, changed in + // backward-incompatible ways, and are not guaranteed to be released. + // "ALPHA" - Alpha is a limited availability test for releases before + // they are cleared for widespread use. By Alpha, all significant design + // issues are resolved and we are in the process of verifying + // functionality. Alpha customers need to apply for access, agree to + // applicable terms, and have their projects allowlisted. Alpha releases + // don't have to be feature complete, no SLAs are provided, and there + // are no technical support obligations, but they will be far enough + // along that customers can actually use them in test environments or + // for limited-use tests -- just like they would in normal production + // cases. + // "BETA" - Beta is the point at which we are ready to open a release + // for any customer to use. There are no SLA or technical support + // obligations in a Beta release. Products will be complete from a + // feature perspective, but may have some open outstanding issues. Beta + // releases are suitable for limited production use cases. + // "GA" - GA features are open to all developers and are considered + // stable and fully qualified for production use. + // "DEPRECATED" - Deprecated features are scheduled to be shut down + // and removed. For more information, see the "Deprecation Policy" + // section of our [Terms of Service](https://cloud.google.com/terms/) + // and the [Google Cloud Platform Subject to the Deprecation + // Policy](https://cloud.google.com/terms/deprecation) documentation. + LaunchStage string `json:"launchStage,omitempty"` -// GoogleCloudDocumentaiV1SetDefaultProcessorVersionResponse: Response -// message for set default processor version method. -type GoogleCloudDocumentaiV1SetDefaultProcessorVersionResponse struct { -} + // Name: The resource name of the processor type. Format: + // `projects/{project}/processorTypes/{processor_type}` + Name string `json:"name,omitempty"` -// GoogleCloudDocumentaiV1UndeployProcessorVersionMetadata: The long -// running operation metadata for the undeploy processor version method. -type GoogleCloudDocumentaiV1UndeployProcessorVersionMetadata struct { - // CommonMetadata: The basic metadata of the long running operation. - CommonMetadata *GoogleCloudDocumentaiV1CommonOperationMetadata `json:"commonMetadata,omitempty"` + // SampleDocumentUris: A set of Cloud Storage URIs of sample documents + // for this processor. + SampleDocumentUris []string `json:"sampleDocumentUris,omitempty"` - // ForceSendFields is a list of field names (e.g. "CommonMetadata") to + // Type: The processor type, e.g., `OCR_PROCESSOR`, `INVOICE_PROCESSOR`, + // etc. + Type string `json:"type,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AllowCreation") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -5064,43 +5152,28 @@ type GoogleCloudDocumentaiV1UndeployProcessorVersionMetadata struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CommonMetadata") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "AllowCreation") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1UndeployProcessorVersionMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1UndeployProcessorVersionMetadata +func (s *GoogleCloudDocumentaiV1ProcessorType) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1ProcessorType raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1UndeployProcessorVersionRequest: Request -// message for the undeploy processor version method. -type GoogleCloudDocumentaiV1UndeployProcessorVersionRequest struct { -} - -// GoogleCloudDocumentaiV1UndeployProcessorVersionResponse: Response -// message for the undeploy processor version method. -type GoogleCloudDocumentaiV1UndeployProcessorVersionResponse struct { -} - -// GoogleCloudDocumentaiV1Vertex: A vertex represents a 2D point in the -// image. NOTE: the vertex coordinates are in the same scale as the -// original image. -type GoogleCloudDocumentaiV1Vertex struct { - // X: X coordinate. - X int64 `json:"x,omitempty"` - - // Y: Y coordinate (starts from the top of the image). - Y int64 `json:"y,omitempty"` +// GoogleCloudDocumentaiV1ProcessorTypeLocationInfo: The location +// information about where the processor is available. +type GoogleCloudDocumentaiV1ProcessorTypeLocationInfo struct { + // LocationId: The location id, currently must be one of [us, eu]. + LocationId string `json:"locationId,omitempty"` - // ForceSendFields is a list of field names (e.g. "X") to + // ForceSendFields is a list of field names (e.g. "LocationId") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -5108,8 +5181,8 @@ type GoogleCloudDocumentaiV1Vertex struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "X") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "LocationId") to include in + // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -5117,38 +5190,74 @@ type GoogleCloudDocumentaiV1Vertex struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1Vertex) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1Vertex +func (s *GoogleCloudDocumentaiV1ProcessorTypeLocationInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1ProcessorTypeLocationInfo raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1Barcode: Encodes the detailed information -// of a barcode. -type GoogleCloudDocumentaiV1beta1Barcode struct { - // Format: Format of a barcode. The supported formats are: - `CODE_128`: - // Code 128 type. - `CODE_39`: Code 39 type. - `CODE_93`: Code 93 type. - // - `CODABAR`: Codabar type. - `DATA_MATRIX`: 2D Data Matrix type. - - // `ITF`: ITF type. - `EAN_13`: EAN-13 type. - `EAN_8`: EAN-8 type. - - // `QR_CODE`: 2D QR code type. - `UPC_A`: UPC-A type. - `UPC_E`: UPC-E - // type. - `PDF417`: PDF417 type. - `AZTEC`: 2D Aztec code type. - - // `DATABAR`: GS1 DataBar code type. - Format string `json:"format,omitempty"` +// GoogleCloudDocumentaiV1ProcessorVersion: A processor version is an +// implementation of a processor. Each processor can have multiple +// versions, pre-trained by Google internally or up-trained by the +// customer. At a time, a processor can only have one default version +// version. So the processor's behavior (when processing documents) is +// defined by a default version +type GoogleCloudDocumentaiV1ProcessorVersion struct { + // CreateTime: The time the processor version was created. + CreateTime string `json:"createTime,omitempty"` - // RawValue: Raw value encoded in the barcode. For example: - // `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`. - RawValue string `json:"rawValue,omitempty"` + // DeprecationInfo: If set, information about the eventual deprecation + // of this version. + DeprecationInfo *GoogleCloudDocumentaiV1ProcessorVersionDeprecationInfo `json:"deprecationInfo,omitempty"` - // ValueFormat: Value format describes the format of the value that a - // barcode encodes. The supported formats are: - `CONTACT_INFO`: Contact - // information. - `EMAIL`: Email address. - `ISBN`: ISBN identifier. - - // `PHONE`: Phone number. - `PRODUCT`: Product. - `SMS`: SMS message. - - // `TEXT`: Text string. - `URL`: URL address. - `WIFI`: Wifi - // information. - `GEO`: Geo-localization. - `CALENDAR_EVENT`: Calendar - // event. - `DRIVER_LICENSE`: Driver's license. - ValueFormat string `json:"valueFormat,omitempty"` + // DisplayName: The display name of the processor version. + DisplayName string `json:"displayName,omitempty"` - // ForceSendFields is a list of field names (e.g. "Format") to + // DocumentSchema: The schema of the processor version. Describes the + // output. + DocumentSchema *GoogleCloudDocumentaiV1DocumentSchema `json:"documentSchema,omitempty"` + + // GoogleManaged: Denotes that this ProcessorVersion is managed by + // google. + GoogleManaged bool `json:"googleManaged,omitempty"` + + // KmsKeyName: The KMS key name used for encryption. + KmsKeyName string `json:"kmsKeyName,omitempty"` + + // KmsKeyVersionName: The KMS key version with which data is encrypted. + KmsKeyVersionName string `json:"kmsKeyVersionName,omitempty"` + + // LatestEvaluation: The most recently invoked evaluation for the + // processor version. + LatestEvaluation *GoogleCloudDocumentaiV1EvaluationReference `json:"latestEvaluation,omitempty"` + + // Name: The resource name of the processor version. Format: + // `projects/{project}/locations/{location}/processors/{processor}/proces + // sorVersions/{processor_version}` + Name string `json:"name,omitempty"` + + // State: The state of the processor version. + // + // Possible values: + // "STATE_UNSPECIFIED" - The processor version is in an unspecified + // state. + // "DEPLOYED" - The processor version is deployed and can be used for + // processing. + // "DEPLOYING" - The processor version is being deployed. + // "UNDEPLOYED" - The processor version is not deployed and cannot be + // used for processing. + // "UNDEPLOYING" - The processor version is being undeployed. + // "CREATING" - The processor version is being created. + // "DELETING" - The processor version is being deleted. + // "FAILED" - The processor version failed and is in an indeterminate + // state. + State string `json:"state,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -5156,8 +5265,8 @@ type GoogleCloudDocumentaiV1beta1Barcode struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Format") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -5165,20 +5274,24 @@ type GoogleCloudDocumentaiV1beta1Barcode struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1Barcode) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1Barcode +func (s *GoogleCloudDocumentaiV1ProcessorVersion) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1ProcessorVersion raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1BatchProcessDocumentsResponse: Response -// to an batch document processing request. This is returned in the LRO -// Operation after the operation is complete. -type GoogleCloudDocumentaiV1beta1BatchProcessDocumentsResponse struct { - // Responses: Responses for each individual document. - Responses []*GoogleCloudDocumentaiV1beta1ProcessDocumentResponse `json:"responses,omitempty"` +// GoogleCloudDocumentaiV1ProcessorVersionDeprecationInfo: Information +// about the upcoming deprecation of this processor version. +type GoogleCloudDocumentaiV1ProcessorVersionDeprecationInfo struct { + // DeprecationTime: The time at which this processor version will be + // deprecated. + DeprecationTime string `json:"deprecationTime,omitempty"` - // ForceSendFields is a list of field names (e.g. "Responses") to + // ReplacementProcessorVersion: If set, the processor version that will + // be used as a replacement. + ReplacementProcessorVersion string `json:"replacementProcessorVersion,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DeprecationTime") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -5186,110 +5299,32 @@ type GoogleCloudDocumentaiV1beta1BatchProcessDocumentsResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Responses") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "DeprecationTime") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1BatchProcessDocumentsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1BatchProcessDocumentsResponse - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// GoogleCloudDocumentaiV1beta1BoundingPoly: A bounding polygon for the -// detected image annotation. -type GoogleCloudDocumentaiV1beta1BoundingPoly struct { - // NormalizedVertices: The bounding polygon normalized vertices. - NormalizedVertices []*GoogleCloudDocumentaiV1beta1NormalizedVertex `json:"normalizedVertices,omitempty"` - - // Vertices: The bounding polygon vertices. - Vertices []*GoogleCloudDocumentaiV1beta1Vertex `json:"vertices,omitempty"` - - // ForceSendFields is a list of field names (e.g. "NormalizedVertices") - // to unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "NormalizedVertices") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudDocumentaiV1beta1BoundingPoly) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1BoundingPoly +func (s *GoogleCloudDocumentaiV1ProcessorVersionDeprecationInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1ProcessorVersionDeprecationInfo raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1Document: Document represents the -// canonical document resource in Document AI. It is an interchange -// format that provides insights into documents and allows for -// collaboration between users and Document AI to iterate and optimize -// for quality. -type GoogleCloudDocumentaiV1beta1Document struct { - // Content: Optional. Inline document content, represented as a stream - // of bytes. Note: As with all `bytes` fields, protobuffers use a pure - // binary representation, whereas JSON representations use base64. +// GoogleCloudDocumentaiV1RawDocument: Payload message of raw document +// content (bytes). +type GoogleCloudDocumentaiV1RawDocument struct { + // Content: Inline document content. Content string `json:"content,omitempty"` - // Entities: A list of entities detected on Document.text. For document - // shards, entities in this list may cross shard boundaries. - Entities []*GoogleCloudDocumentaiV1beta1DocumentEntity `json:"entities,omitempty"` - - // EntityRelations: Placeholder. Relationship among Document.entities. - EntityRelations []*GoogleCloudDocumentaiV1beta1DocumentEntityRelation `json:"entityRelations,omitempty"` - - // Error: Any error that occurred while processing this document. - Error *GoogleRpcStatus `json:"error,omitempty"` - - // MimeType: An IANA published MIME type (also referred to as media - // type). For more information, see - // https://www.iana.org/assignments/media-types/media-types.xhtml. + // MimeType: An IANA MIME type (RFC6838) indicating the nature and + // format of the content. MimeType string `json:"mimeType,omitempty"` - // Pages: Visual page layout for the Document. - Pages []*GoogleCloudDocumentaiV1beta1DocumentPage `json:"pages,omitempty"` - - // Revisions: Placeholder. Revision history of this document. - Revisions []*GoogleCloudDocumentaiV1beta1DocumentRevision `json:"revisions,omitempty"` - - // ShardInfo: Information about the sharding if this document is sharded - // part of a larger document. If the document is not sharded, this - // message is not specified. - ShardInfo *GoogleCloudDocumentaiV1beta1DocumentShardInfo `json:"shardInfo,omitempty"` - - // Text: Optional. UTF-8 encoded text in reading order from the - // document. - Text string `json:"text,omitempty"` - - // TextChanges: Placeholder. A list of text corrections made to - // Document.text. This is usually used for annotating corrections to OCR - // mistakes. Text changes for a given revision may not overlap with each - // other. - TextChanges []*GoogleCloudDocumentaiV1beta1DocumentTextChange `json:"textChanges,omitempty"` - - // TextStyles: Styles for the Document.text. - TextStyles []*GoogleCloudDocumentaiV1beta1DocumentStyle `json:"textStyles,omitempty"` - - // Uri: Optional. Currently supports Google Cloud Storage URI of the - // form `gs://bucket_name/object_name`. Object versioning is not - // supported. See Google Cloud Storage Request URIs - // (https://cloud.google.com/storage/docs/reference-uris) for more info. - Uri string `json:"uri,omitempty"` - // ForceSendFields is a list of field names (e.g. "Content") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any @@ -5307,60 +5342,22 @@ type GoogleCloudDocumentaiV1beta1Document struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1Document) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1Document +func (s *GoogleCloudDocumentaiV1RawDocument) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1RawDocument raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1DocumentEntity: An entity that could be a -// phrase in the text or a property that belongs to the document. It is -// a known entity type, such as a person, an organization, or location. -type GoogleCloudDocumentaiV1beta1DocumentEntity struct { - // Confidence: Optional. Confidence of detected Schema entity. Range - // `[0, 1]`. - Confidence float64 `json:"confidence,omitempty"` - - // Id: Optional. Canonical id. This will be a unique value in the entity - // list for this document. - Id string `json:"id,omitempty"` - - // MentionId: Optional. Deprecated. Use `id` field instead. - MentionId string `json:"mentionId,omitempty"` - - // MentionText: Optional. Text value of the entity e.g. `1600 - // Amphitheatre Pkwy`. - MentionText string `json:"mentionText,omitempty"` - - // NormalizedValue: Optional. Normalized entity value. Absent if the - // extracted value could not be converted or the type (e.g. address) is - // not supported for certain parsers. This field is also only populated - // for certain supported document types. - NormalizedValue *GoogleCloudDocumentaiV1beta1DocumentEntityNormalizedValue `json:"normalizedValue,omitempty"` - - // PageAnchor: Optional. Represents the provenance of this entity wrt. - // the location on the page where it was found. - PageAnchor *GoogleCloudDocumentaiV1beta1DocumentPageAnchor `json:"pageAnchor,omitempty"` - - // Properties: Optional. Entities can be nested to form a hierarchical - // data structure representing the content in the document. - Properties []*GoogleCloudDocumentaiV1beta1DocumentEntity `json:"properties,omitempty"` - - // Provenance: Optional. The history of this annotation. - Provenance *GoogleCloudDocumentaiV1beta1DocumentProvenance `json:"provenance,omitempty"` - - // Redacted: Optional. Whether the entity will be redacted for - // de-identification purposes. - Redacted bool `json:"redacted,omitempty"` - - // TextAnchor: Optional. Provenance of the entity. Text anchor indexing - // into the Document.text. - TextAnchor *GoogleCloudDocumentaiV1beta1DocumentTextAnchor `json:"textAnchor,omitempty"` +// GoogleCloudDocumentaiV1ReviewDocumentOperationMetadata: The long +// running operation metadata for review document method. +type GoogleCloudDocumentaiV1ReviewDocumentOperationMetadata struct { + // CommonMetadata: The basic metadata of the long running operation. + CommonMetadata *GoogleCloudDocumentaiV1CommonOperationMetadata `json:"commonMetadata,omitempty"` - // Type: Required. Entity type from a schema e.g. `Address`. - Type string `json:"type,omitempty"` + // QuestionId: The Crowd Compute question ID. + QuestionId string `json:"questionId,omitempty"` - // ForceSendFields is a list of field names (e.g. "Confidence") to + // ForceSendFields is a list of field names (e.g. "CommonMetadata") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -5368,77 +5365,45 @@ type GoogleCloudDocumentaiV1beta1DocumentEntity struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Confidence") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "CommonMetadata") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentEntity) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentEntity +func (s *GoogleCloudDocumentaiV1ReviewDocumentOperationMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1ReviewDocumentOperationMetadata raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *GoogleCloudDocumentaiV1beta1DocumentEntity) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentEntity - var s1 struct { - Confidence gensupport.JSONFloat64 `json:"confidence"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.Confidence = float64(s1.Confidence) - return nil -} - -// GoogleCloudDocumentaiV1beta1DocumentEntityNormalizedValue: Parsed and -// normalized entity value. -type GoogleCloudDocumentaiV1beta1DocumentEntityNormalizedValue struct { - // AddressValue: Postal address. See also: - // https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto - AddressValue *GoogleTypePostalAddress `json:"addressValue,omitempty"` - - // BooleanValue: Boolean value. Can be used for entities with binary - // values, or for checkboxes. - BooleanValue bool `json:"booleanValue,omitempty"` - - // DateValue: Date value. Includes year, month, day. See also: - // https://github.com/googleapis/googleapis/blob/master/google/type/date.proto - DateValue *GoogleTypeDate `json:"dateValue,omitempty"` - - // DatetimeValue: DateTime value. Includes date, time, and timezone. See - // also: - // https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto - DatetimeValue *GoogleTypeDateTime `json:"datetimeValue,omitempty"` - - // FloatValue: Float value. - FloatValue float64 `json:"floatValue,omitempty"` +// GoogleCloudDocumentaiV1ReviewDocumentRequest: Request message for +// review document method. +type GoogleCloudDocumentaiV1ReviewDocumentRequest struct { + // DocumentSchema: The document schema of the human review task. + DocumentSchema *GoogleCloudDocumentaiV1DocumentSchema `json:"documentSchema,omitempty"` - // IntegerValue: Integer value. - IntegerValue int64 `json:"integerValue,omitempty"` + // EnableSchemaValidation: Whether the validation should be performed on + // the ad-hoc review request. + EnableSchemaValidation bool `json:"enableSchemaValidation,omitempty"` - // MoneyValue: Money value. See also: - // https://github.com/googleapis/googleapis/blob/master/google/type/money.proto - MoneyValue *GoogleTypeMoney `json:"moneyValue,omitempty"` + // InlineDocument: An inline document proto. + InlineDocument *GoogleCloudDocumentaiV1Document `json:"inlineDocument,omitempty"` - // Text: Optional. An optional field to store a normalized string. For - // some entity types, one of respective `structured_value` fields may - // also be populated. Also not all the types of `structured_value` will - // be normalized. For example, some processors may not generate `float` - // or `integer` normalized text by default. Below are sample formats - // mapped to structured values. - Money/Currency type (`money_value`) is - // in the ISO 4217 text format. - Date type (`date_value`) is in the ISO - // 8601 text format. - Datetime type (`datetime_value`) is in the ISO - // 8601 text format. - Text string `json:"text,omitempty"` + // Priority: The priority of the human review task. + // + // Possible values: + // "DEFAULT" - The default priority level. + // "URGENT" - The urgent priority level. The labeling manager should + // allocate labeler resource to the urgent task queue to respect this + // priority level. + Priority string `json:"priority,omitempty"` - // ForceSendFields is a list of field names (e.g. "AddressValue") to + // ForceSendFields is a list of field names (e.g. "DocumentSchema") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -5446,48 +5411,42 @@ type GoogleCloudDocumentaiV1beta1DocumentEntityNormalizedValue struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AddressValue") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "DocumentSchema") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentEntityNormalizedValue) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentEntityNormalizedValue +func (s *GoogleCloudDocumentaiV1ReviewDocumentRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1ReviewDocumentRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *GoogleCloudDocumentaiV1beta1DocumentEntityNormalizedValue) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentEntityNormalizedValue - var s1 struct { - FloatValue gensupport.JSONFloat64 `json:"floatValue"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.FloatValue = float64(s1.FloatValue) - return nil -} - -// GoogleCloudDocumentaiV1beta1DocumentEntityRelation: Relationship -// between Entities. -type GoogleCloudDocumentaiV1beta1DocumentEntityRelation struct { - // ObjectId: Object entity id. - ObjectId string `json:"objectId,omitempty"` +// GoogleCloudDocumentaiV1ReviewDocumentResponse: Response message for +// review document method. +type GoogleCloudDocumentaiV1ReviewDocumentResponse struct { + // GcsDestination: The Cloud Storage uri for the human reviewed document + // if the review is succeeded. + GcsDestination string `json:"gcsDestination,omitempty"` - // Relation: Relationship description. - Relation string `json:"relation,omitempty"` + // RejectionReason: The reason why the review is rejected by reviewer. + RejectionReason string `json:"rejectionReason,omitempty"` - // SubjectId: Subject entity id. - SubjectId string `json:"subjectId,omitempty"` + // State: The state of the review operation. + // + // Possible values: + // "STATE_UNSPECIFIED" - The default value. This value is used if the + // state is omitted. + // "REJECTED" - The review operation is rejected by the reviewer. + // "SUCCEEDED" - The review operation is succeeded. + State string `json:"state,omitempty"` - // ForceSendFields is a list of field names (e.g. "ObjectId") to + // ForceSendFields is a list of field names (e.g. "GcsDestination") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -5495,86 +5454,147 @@ type GoogleCloudDocumentaiV1beta1DocumentEntityRelation struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ObjectId") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "GcsDestination") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentEntityRelation) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentEntityRelation +func (s *GoogleCloudDocumentaiV1ReviewDocumentResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1ReviewDocumentResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1DocumentPage: A page in a Document. -type GoogleCloudDocumentaiV1beta1DocumentPage struct { - // Blocks: A list of visually detected text blocks on the page. A block - // has a set of lines (collected into paragraphs) that have a common - // line-spacing and orientation. - Blocks []*GoogleCloudDocumentaiV1beta1DocumentPageBlock `json:"blocks,omitempty"` +// GoogleCloudDocumentaiV1SetDefaultProcessorVersionMetadata: The long +// running operation metadata for set default processor version method. +type GoogleCloudDocumentaiV1SetDefaultProcessorVersionMetadata struct { + // CommonMetadata: The basic metadata of the long running operation. + CommonMetadata *GoogleCloudDocumentaiV1CommonOperationMetadata `json:"commonMetadata,omitempty"` - // DetectedBarcodes: A list of detected barcodes. - DetectedBarcodes []*GoogleCloudDocumentaiV1beta1DocumentPageDetectedBarcode `json:"detectedBarcodes,omitempty"` + // ForceSendFields is a list of field names (e.g. "CommonMetadata") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` - // DetectedLanguages: A list of detected languages together with - // confidence. - DetectedLanguages []*GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` + // NullFields is a list of field names (e.g. "CommonMetadata") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} - // Dimension: Physical dimension of the page. - Dimension *GoogleCloudDocumentaiV1beta1DocumentPageDimension `json:"dimension,omitempty"` +func (s *GoogleCloudDocumentaiV1SetDefaultProcessorVersionMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1SetDefaultProcessorVersionMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // FormFields: A list of visually detected form fields on the page. - FormFields []*GoogleCloudDocumentaiV1beta1DocumentPageFormField `json:"formFields,omitempty"` +// GoogleCloudDocumentaiV1SetDefaultProcessorVersionRequest: Request +// message for the set default processor version method. +type GoogleCloudDocumentaiV1SetDefaultProcessorVersionRequest struct { + // DefaultProcessorVersion: Required. The resource name of child + // ProcessorVersion to use as default. Format: + // `projects/{project}/locations/{location}/processors/{processor}/proces + // sorVersions/{version}` + DefaultProcessorVersion string `json:"defaultProcessorVersion,omitempty"` - // Image: Rendered image for this page. This image is preprocessed to - // remove any skew, rotation, and distortions such that the annotation - // bounding boxes can be upright and axis-aligned. - Image *GoogleCloudDocumentaiV1beta1DocumentPageImage `json:"image,omitempty"` + // ForceSendFields is a list of field names (e.g. + // "DefaultProcessorVersion") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted + // from API requests. However, any non-pointer, non-interface field + // appearing in ForceSendFields will be sent to the server regardless of + // whether the field is empty or not. This may be used to include empty + // fields in Patch requests. + ForceSendFields []string `json:"-"` - // ImageQualityScores: Image Quality Scores. - ImageQualityScores *GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScores `json:"imageQualityScores,omitempty"` + // NullFields is a list of field names (e.g. "DefaultProcessorVersion") + // to include in API requests with the JSON null value. By default, + // fields with empty values are omitted from API requests. However, any + // field with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} - // Layout: Layout for the page. - Layout *GoogleCloudDocumentaiV1beta1DocumentPageLayout `json:"layout,omitempty"` +func (s *GoogleCloudDocumentaiV1SetDefaultProcessorVersionRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1SetDefaultProcessorVersionRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // Lines: A list of visually detected text lines on the page. A - // collection of tokens that a human would perceive as a line. - Lines []*GoogleCloudDocumentaiV1beta1DocumentPageLine `json:"lines,omitempty"` +// GoogleCloudDocumentaiV1SetDefaultProcessorVersionResponse: Response +// message for set default processor version method. +type GoogleCloudDocumentaiV1SetDefaultProcessorVersionResponse struct { +} - // PageNumber: 1-based index for current Page in a parent Document. - // Useful when a page is taken out of a Document for individual - // processing. - PageNumber int64 `json:"pageNumber,omitempty"` +// GoogleCloudDocumentaiV1TrainProcessorVersionRequest: Request message +// for the create processor version method. +type GoogleCloudDocumentaiV1TrainProcessorVersionRequest struct { + // BaseProcessorVersion: Optional. The processor version to use as a + // base for training. This processor version must be a child of + // `parent`. Format: + // `projects/{project}/locations/{location}/processors/{processor}/proces + // sorVersions/{processorVersion}`. + BaseProcessorVersion string `json:"baseProcessorVersion,omitempty"` - // Paragraphs: A list of visually detected text paragraphs on the page. - // A collection of lines that a human would perceive as a paragraph. - Paragraphs []*GoogleCloudDocumentaiV1beta1DocumentPageParagraph `json:"paragraphs,omitempty"` + // DocumentSchema: Optional. The schema the processor version will be + // trained with. + DocumentSchema *GoogleCloudDocumentaiV1DocumentSchema `json:"documentSchema,omitempty"` - // Provenance: The history of this page. - Provenance *GoogleCloudDocumentaiV1beta1DocumentProvenance `json:"provenance,omitempty"` + // InputData: Optional. The input data used to train the + // `ProcessorVersion`. + InputData *GoogleCloudDocumentaiV1TrainProcessorVersionRequestInputData `json:"inputData,omitempty"` - // Symbols: A list of visually detected symbols on the page. - Symbols []*GoogleCloudDocumentaiV1beta1DocumentPageSymbol `json:"symbols,omitempty"` + // ProcessorVersion: Required. The processor version to be created. + ProcessorVersion *GoogleCloudDocumentaiV1ProcessorVersion `json:"processorVersion,omitempty"` - // Tables: A list of visually detected tables on the page. - Tables []*GoogleCloudDocumentaiV1beta1DocumentPageTable `json:"tables,omitempty"` + // ForceSendFields is a list of field names (e.g. + // "BaseProcessorVersion") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` - // Tokens: A list of visually detected tokens on the page. - Tokens []*GoogleCloudDocumentaiV1beta1DocumentPageToken `json:"tokens,omitempty"` + // NullFields is a list of field names (e.g. "BaseProcessorVersion") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} - // Transforms: Transformation matrices that were applied to the original - // document image to produce Page.image. - Transforms []*GoogleCloudDocumentaiV1beta1DocumentPageMatrix `json:"transforms,omitempty"` +func (s *GoogleCloudDocumentaiV1TrainProcessorVersionRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1TrainProcessorVersionRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // VisualElements: A list of detected non-text visual elements e.g. - // checkbox, signature etc. on the page. - VisualElements []*GoogleCloudDocumentaiV1beta1DocumentPageVisualElement `json:"visualElements,omitempty"` +// GoogleCloudDocumentaiV1TrainProcessorVersionRequestInputData: The +// input data used to train a new `ProcessorVersion`. +type GoogleCloudDocumentaiV1TrainProcessorVersionRequestInputData struct { + // TestDocuments: The documents used for testing the trained version. + TestDocuments *GoogleCloudDocumentaiV1BatchDocumentsInputConfig `json:"testDocuments,omitempty"` - // ForceSendFields is a list of field names (e.g. "Blocks") to + // TrainingDocuments: The documents used for training the new version. + TrainingDocuments *GoogleCloudDocumentaiV1BatchDocumentsInputConfig `json:"trainingDocuments,omitempty"` + + // ForceSendFields is a list of field names (e.g. "TestDocuments") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -5582,30 +5602,28 @@ type GoogleCloudDocumentaiV1beta1DocumentPage struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Blocks") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "TestDocuments") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentPage) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentPage +func (s *GoogleCloudDocumentaiV1TrainProcessorVersionRequestInputData) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1TrainProcessorVersionRequestInputData raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1DocumentPageAnchor: Referencing the -// visual context of the entity in the Document.pages. Page anchors can -// be cross-page, consist of multiple bounding polygons and optionally -// reference specific layout element types. -type GoogleCloudDocumentaiV1beta1DocumentPageAnchor struct { - // PageRefs: One or more references to visual page elements - PageRefs []*GoogleCloudDocumentaiV1beta1DocumentPageAnchorPageRef `json:"pageRefs,omitempty"` +// GoogleCloudDocumentaiV1UndeployProcessorVersionMetadata: The long +// running operation metadata for the undeploy processor version method. +type GoogleCloudDocumentaiV1UndeployProcessorVersionMetadata struct { + // CommonMetadata: The basic metadata of the long running operation. + CommonMetadata *GoogleCloudDocumentaiV1CommonOperationMetadata `json:"commonMetadata,omitempty"` - // ForceSendFields is a list of field names (e.g. "PageRefs") to + // ForceSendFields is a list of field names (e.g. "CommonMetadata") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -5613,56 +5631,43 @@ type GoogleCloudDocumentaiV1beta1DocumentPageAnchor struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "PageRefs") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "CommonMetadata") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentPageAnchor) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageAnchor +func (s *GoogleCloudDocumentaiV1UndeployProcessorVersionMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1UndeployProcessorVersionMetadata raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1DocumentPageAnchorPageRef: Represents a -// weak reference to a page element within a document. -type GoogleCloudDocumentaiV1beta1DocumentPageAnchorPageRef struct { - // BoundingPoly: Optional. Identifies the bounding polygon of a layout - // element on the page. - BoundingPoly *GoogleCloudDocumentaiV1beta1BoundingPoly `json:"boundingPoly,omitempty"` +// GoogleCloudDocumentaiV1UndeployProcessorVersionRequest: Request +// message for the undeploy processor version method. +type GoogleCloudDocumentaiV1UndeployProcessorVersionRequest struct { +} - // Confidence: Optional. Confidence of detected page element, if - // applicable. Range `[0, 1]`. - Confidence float64 `json:"confidence,omitempty"` +// GoogleCloudDocumentaiV1UndeployProcessorVersionResponse: Response +// message for the undeploy processor version method. +type GoogleCloudDocumentaiV1UndeployProcessorVersionResponse struct { +} - // LayoutId: Optional. Deprecated. Use PageRef.bounding_poly instead. - LayoutId string `json:"layoutId,omitempty"` +// GoogleCloudDocumentaiV1Vertex: A vertex represents a 2D point in the +// image. NOTE: the vertex coordinates are in the same scale as the +// original image. +type GoogleCloudDocumentaiV1Vertex struct { + // X: X coordinate. + X int64 `json:"x,omitempty"` - // LayoutType: Optional. The type of the layout element that is being - // referenced if any. - // - // Possible values: - // "LAYOUT_TYPE_UNSPECIFIED" - Layout Unspecified. - // "BLOCK" - References a Page.blocks element. - // "PARAGRAPH" - References a Page.paragraphs element. - // "LINE" - References a Page.lines element. - // "TOKEN" - References a Page.tokens element. - // "VISUAL_ELEMENT" - References a Page.visual_elements element. - // "TABLE" - Refrrences a Page.tables element. - // "FORM_FIELD" - References a Page.form_fields element. - LayoutType string `json:"layoutType,omitempty"` - - // Page: Required. Index into the Document.pages element, for example - // using `Document.pages` to locate the related page element. This field - // is skipped when its value is the default `0`. See - // https://developers.google.com/protocol-buffers/docs/proto3#json. - Page int64 `json:"page,omitempty,string"` + // Y: Y coordinate (starts from the top of the image). + Y int64 `json:"y,omitempty"` - // ForceSendFields is a list of field names (e.g. "BoundingPoly") to + // ForceSendFields is a list of field names (e.g. "X") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -5670,83 +5675,77 @@ type GoogleCloudDocumentaiV1beta1DocumentPageAnchorPageRef struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "BoundingPoly") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "X") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentPageAnchorPageRef) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageAnchorPageRef +func (s *GoogleCloudDocumentaiV1Vertex) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1Vertex raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *GoogleCloudDocumentaiV1beta1DocumentPageAnchorPageRef) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageAnchorPageRef - var s1 struct { - Confidence gensupport.JSONFloat64 `json:"confidence"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.Confidence = float64(s1.Confidence) - return nil -} - -// GoogleCloudDocumentaiV1beta1DocumentPageBlock: A block has a set of -// lines (collected into paragraphs) that have a common line-spacing and -// orientation. -type GoogleCloudDocumentaiV1beta1DocumentPageBlock struct { - // DetectedLanguages: A list of detected languages together with - // confidence. - DetectedLanguages []*GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` +// GoogleCloudDocumentaiV1beta1Barcode: Encodes the detailed information +// of a barcode. +type GoogleCloudDocumentaiV1beta1Barcode struct { + // Format: Format of a barcode. The supported formats are: - `CODE_128`: + // Code 128 type. - `CODE_39`: Code 39 type. - `CODE_93`: Code 93 type. + // - `CODABAR`: Codabar type. - `DATA_MATRIX`: 2D Data Matrix type. - + // `ITF`: ITF type. - `EAN_13`: EAN-13 type. - `EAN_8`: EAN-8 type. - + // `QR_CODE`: 2D QR code type. - `UPC_A`: UPC-A type. - `UPC_E`: UPC-E + // type. - `PDF417`: PDF417 type. - `AZTEC`: 2D Aztec code type. - + // `DATABAR`: GS1 DataBar code type. + Format string `json:"format,omitempty"` - // Layout: Layout for Block. - Layout *GoogleCloudDocumentaiV1beta1DocumentPageLayout `json:"layout,omitempty"` + // RawValue: Raw value encoded in the barcode. For example: + // `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`. + RawValue string `json:"rawValue,omitempty"` - // Provenance: The history of this annotation. - Provenance *GoogleCloudDocumentaiV1beta1DocumentProvenance `json:"provenance,omitempty"` + // ValueFormat: Value format describes the format of the value that a + // barcode encodes. The supported formats are: - `CONTACT_INFO`: Contact + // information. - `EMAIL`: Email address. - `ISBN`: ISBN identifier. - + // `PHONE`: Phone number. - `PRODUCT`: Product. - `SMS`: SMS message. - + // `TEXT`: Text string. - `URL`: URL address. - `WIFI`: Wifi + // information. - `GEO`: Geo-localization. - `CALENDAR_EVENT`: Calendar + // event. - `DRIVER_LICENSE`: Driver's license. + ValueFormat string `json:"valueFormat,omitempty"` - // ForceSendFields is a list of field names (e.g. "DetectedLanguages") - // to unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "Format") to + // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DetectedLanguages") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "Format") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentPageBlock) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageBlock +func (s *GoogleCloudDocumentaiV1beta1Barcode) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1Barcode raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1DocumentPageDetectedBarcode: A detected -// barcode. -type GoogleCloudDocumentaiV1beta1DocumentPageDetectedBarcode struct { - // Barcode: Detailed barcode information of the DetectedBarcode. - Barcode *GoogleCloudDocumentaiV1beta1Barcode `json:"barcode,omitempty"` - - // Layout: Layout for DetectedBarcode. - Layout *GoogleCloudDocumentaiV1beta1DocumentPageLayout `json:"layout,omitempty"` +// GoogleCloudDocumentaiV1beta1BatchProcessDocumentsResponse: Response +// to an batch document processing request. This is returned in the LRO +// Operation after the operation is complete. +type GoogleCloudDocumentaiV1beta1BatchProcessDocumentsResponse struct { + // Responses: Responses for each individual document. + Responses []*GoogleCloudDocumentaiV1beta1ProcessDocumentResponse `json:"responses,omitempty"` - // ForceSendFields is a list of field names (e.g. "Barcode") to + // ForceSendFields is a list of field names (e.g. "Responses") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -5754,7 +5753,7 @@ type GoogleCloudDocumentaiV1beta1DocumentPageDetectedBarcode struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Barcode") to include in + // NullFields is a list of field names (e.g. "Responses") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -5763,73 +5762,102 @@ type GoogleCloudDocumentaiV1beta1DocumentPageDetectedBarcode struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentPageDetectedBarcode) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageDetectedBarcode +func (s *GoogleCloudDocumentaiV1beta1BatchProcessDocumentsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1BatchProcessDocumentsResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage: Detected -// language for a structural component. -type GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage struct { - // Confidence: Confidence of detected language. Range `[0, 1]`. - Confidence float64 `json:"confidence,omitempty"` +// GoogleCloudDocumentaiV1beta1BoundingPoly: A bounding polygon for the +// detected image annotation. +type GoogleCloudDocumentaiV1beta1BoundingPoly struct { + // NormalizedVertices: The bounding polygon normalized vertices. + NormalizedVertices []*GoogleCloudDocumentaiV1beta1NormalizedVertex `json:"normalizedVertices,omitempty"` - // LanguageCode: The BCP-47 language code, such as `en-US` or `sr-Latn`. - // For more information, see - // https://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - LanguageCode string `json:"languageCode,omitempty"` + // Vertices: The bounding polygon vertices. + Vertices []*GoogleCloudDocumentaiV1beta1Vertex `json:"vertices,omitempty"` - // ForceSendFields is a list of field names (e.g. "Confidence") to - // unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "NormalizedVertices") + // to unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Confidence") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "NormalizedVertices") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage +func (s *GoogleCloudDocumentaiV1beta1BoundingPoly) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1BoundingPoly raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage - var s1 struct { - Confidence gensupport.JSONFloat64 `json:"confidence"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.Confidence = float64(s1.Confidence) - return nil -} +// GoogleCloudDocumentaiV1beta1Document: Document represents the +// canonical document resource in Document AI. It is an interchange +// format that provides insights into documents and allows for +// collaboration between users and Document AI to iterate and optimize +// for quality. +type GoogleCloudDocumentaiV1beta1Document struct { + // Content: Optional. Inline document content, represented as a stream + // of bytes. Note: As with all `bytes` fields, protobuffers use a pure + // binary representation, whereas JSON representations use base64. + Content string `json:"content,omitempty"` -// GoogleCloudDocumentaiV1beta1DocumentPageDimension: Dimension for the -// page. -type GoogleCloudDocumentaiV1beta1DocumentPageDimension struct { - // Height: Page height. - Height float64 `json:"height,omitempty"` + // Entities: A list of entities detected on Document.text. For document + // shards, entities in this list may cross shard boundaries. + Entities []*GoogleCloudDocumentaiV1beta1DocumentEntity `json:"entities,omitempty"` - // Unit: Dimension unit. - Unit string `json:"unit,omitempty"` + // EntityRelations: Placeholder. Relationship among Document.entities. + EntityRelations []*GoogleCloudDocumentaiV1beta1DocumentEntityRelation `json:"entityRelations,omitempty"` - // Width: Page width. - Width float64 `json:"width,omitempty"` + // Error: Any error that occurred while processing this document. + Error *GoogleRpcStatus `json:"error,omitempty"` - // ForceSendFields is a list of field names (e.g. "Height") to + // MimeType: An IANA published MIME type (also referred to as media + // type). For more information, see + // https://www.iana.org/assignments/media-types/media-types.xhtml. + MimeType string `json:"mimeType,omitempty"` + + // Pages: Visual page layout for the Document. + Pages []*GoogleCloudDocumentaiV1beta1DocumentPage `json:"pages,omitempty"` + + // Revisions: Placeholder. Revision history of this document. + Revisions []*GoogleCloudDocumentaiV1beta1DocumentRevision `json:"revisions,omitempty"` + + // ShardInfo: Information about the sharding if this document is sharded + // part of a larger document. If the document is not sharded, this + // message is not specified. + ShardInfo *GoogleCloudDocumentaiV1beta1DocumentShardInfo `json:"shardInfo,omitempty"` + + // Text: Optional. UTF-8 encoded text in reading order from the + // document. + Text string `json:"text,omitempty"` + + // TextChanges: Placeholder. A list of text corrections made to + // Document.text. This is usually used for annotating corrections to OCR + // mistakes. Text changes for a given revision may not overlap with each + // other. + TextChanges []*GoogleCloudDocumentaiV1beta1DocumentTextChange `json:"textChanges,omitempty"` + + // TextStyles: Styles for the Document.text. + TextStyles []*GoogleCloudDocumentaiV1beta1DocumentStyle `json:"textStyles,omitempty"` + + // Uri: Optional. Currently supports Google Cloud Storage URI of the + // form `gs://bucket_name/object_name`. Object versioning is not + // supported. See Google Cloud Storage Request URIs + // (https://cloud.google.com/storage/docs/reference-uris) for more info. + Uri string `json:"uri,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Content") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -5837,8 +5865,8 @@ type GoogleCloudDocumentaiV1beta1DocumentPageDimension struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Height") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "Content") to include in + // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -5846,66 +5874,60 @@ type GoogleCloudDocumentaiV1beta1DocumentPageDimension struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentPageDimension) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageDimension +func (s *GoogleCloudDocumentaiV1beta1Document) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1Document raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *GoogleCloudDocumentaiV1beta1DocumentPageDimension) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageDimension - var s1 struct { - Height gensupport.JSONFloat64 `json:"height"` - Width gensupport.JSONFloat64 `json:"width"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.Height = float64(s1.Height) - s.Width = float64(s1.Width) - return nil -} +// GoogleCloudDocumentaiV1beta1DocumentEntity: An entity that could be a +// phrase in the text or a property that belongs to the document. It is +// a known entity type, such as a person, an organization, or location. +type GoogleCloudDocumentaiV1beta1DocumentEntity struct { + // Confidence: Optional. Confidence of detected Schema entity. Range + // `[0, 1]`. + Confidence float64 `json:"confidence,omitempty"` -// GoogleCloudDocumentaiV1beta1DocumentPageFormField: A form field -// detected on the page. -type GoogleCloudDocumentaiV1beta1DocumentPageFormField struct { - // CorrectedKeyText: Created for Labeling UI to export key text. If - // corrections were made to the text identified by the - // `field_name.text_anchor`, this field will contain the correction. - CorrectedKeyText string `json:"correctedKeyText,omitempty"` + // Id: Optional. Canonical id. This will be a unique value in the entity + // list for this document. + Id string `json:"id,omitempty"` - // CorrectedValueText: Created for Labeling UI to export value text. If - // corrections were made to the text identified by the - // `field_value.text_anchor`, this field will contain the correction. - CorrectedValueText string `json:"correctedValueText,omitempty"` + // MentionId: Optional. Deprecated. Use `id` field instead. + MentionId string `json:"mentionId,omitempty"` - // FieldName: Layout for the FormField name. e.g. `Address`, `Email`, - // `Grand total`, `Phone number`, etc. - FieldName *GoogleCloudDocumentaiV1beta1DocumentPageLayout `json:"fieldName,omitempty"` + // MentionText: Optional. Text value of the entity e.g. `1600 + // Amphitheatre Pkwy`. + MentionText string `json:"mentionText,omitempty"` - // FieldValue: Layout for the FormField value. - FieldValue *GoogleCloudDocumentaiV1beta1DocumentPageLayout `json:"fieldValue,omitempty"` + // NormalizedValue: Optional. Normalized entity value. Absent if the + // extracted value could not be converted or the type (e.g. address) is + // not supported for certain parsers. This field is also only populated + // for certain supported document types. + NormalizedValue *GoogleCloudDocumentaiV1beta1DocumentEntityNormalizedValue `json:"normalizedValue,omitempty"` - // NameDetectedLanguages: A list of detected languages for name together - // with confidence. - NameDetectedLanguages []*GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage `json:"nameDetectedLanguages,omitempty"` + // PageAnchor: Optional. Represents the provenance of this entity wrt. + // the location on the page where it was found. + PageAnchor *GoogleCloudDocumentaiV1beta1DocumentPageAnchor `json:"pageAnchor,omitempty"` - // Provenance: The history of this annotation. + // Properties: Optional. Entities can be nested to form a hierarchical + // data structure representing the content in the document. + Properties []*GoogleCloudDocumentaiV1beta1DocumentEntity `json:"properties,omitempty"` + + // Provenance: Optional. The history of this annotation. Provenance *GoogleCloudDocumentaiV1beta1DocumentProvenance `json:"provenance,omitempty"` - // ValueDetectedLanguages: A list of detected languages for value - // together with confidence. - ValueDetectedLanguages []*GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage `json:"valueDetectedLanguages,omitempty"` + // Redacted: Optional. Whether the entity will be redacted for + // de-identification purposes. + Redacted bool `json:"redacted,omitempty"` - // ValueType: If the value is non-textual, this field represents the - // type. Current valid values are: - blank (this indicates the - // `field_value` is normal text) - `unfilled_checkbox` - - // `filled_checkbox` - ValueType string `json:"valueType,omitempty"` + // TextAnchor: Optional. Provenance of the entity. Text anchor indexing + // into the Document.text. + TextAnchor *GoogleCloudDocumentaiV1beta1DocumentTextAnchor `json:"textAnchor,omitempty"` - // ForceSendFields is a list of field names (e.g. "CorrectedKeyText") to + // Type: Required. Entity type from a schema e.g. `Address`. + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Confidence") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -5913,71 +5935,77 @@ type GoogleCloudDocumentaiV1beta1DocumentPageFormField struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CorrectedKeyText") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "Confidence") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentPageFormField) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageFormField +func (s *GoogleCloudDocumentaiV1beta1DocumentEntity) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentEntity raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1DocumentPageImage: Rendered image -// contents for this page. -type GoogleCloudDocumentaiV1beta1DocumentPageImage struct { - // Content: Raw byte content of the image. - Content string `json:"content,omitempty"` +func (s *GoogleCloudDocumentaiV1beta1DocumentEntity) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentEntity + var s1 struct { + Confidence gensupport.JSONFloat64 `json:"confidence"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Confidence = float64(s1.Confidence) + return nil +} - // Height: Height of the image in pixels. - Height int64 `json:"height,omitempty"` +// GoogleCloudDocumentaiV1beta1DocumentEntityNormalizedValue: Parsed and +// normalized entity value. +type GoogleCloudDocumentaiV1beta1DocumentEntityNormalizedValue struct { + // AddressValue: Postal address. See also: + // https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto + AddressValue *GoogleTypePostalAddress `json:"addressValue,omitempty"` - // MimeType: Encoding mime type for the image. - MimeType string `json:"mimeType,omitempty"` + // BooleanValue: Boolean value. Can be used for entities with binary + // values, or for checkboxes. + BooleanValue bool `json:"booleanValue,omitempty"` - // Width: Width of the image in pixels. - Width int64 `json:"width,omitempty"` + // DateValue: Date value. Includes year, month, day. See also: + // https://github.com/googleapis/googleapis/blob/master/google/type/date.proto + DateValue *GoogleTypeDate `json:"dateValue,omitempty"` - // ForceSendFields is a list of field names (e.g. "Content") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` + // DatetimeValue: DateTime value. Includes date, time, and timezone. See + // also: + // https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto + DatetimeValue *GoogleTypeDateTime `json:"datetimeValue,omitempty"` - // NullFields is a list of field names (e.g. "Content") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} + // FloatValue: Float value. + FloatValue float64 `json:"floatValue,omitempty"` -func (s *GoogleCloudDocumentaiV1beta1DocumentPageImage) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageImage - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} + // IntegerValue: Integer value. + IntegerValue int64 `json:"integerValue,omitempty"` -// GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScores: Image -// Quality Scores for the page image -type GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScores struct { - // DetectedDefects: A list of detected defects. - DetectedDefects []*GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScoresDetectedDefect `json:"detectedDefects,omitempty"` + // MoneyValue: Money value. See also: + // https://github.com/googleapis/googleapis/blob/master/google/type/money.proto + MoneyValue *GoogleTypeMoney `json:"moneyValue,omitempty"` - // QualityScore: The overall quality score. Range `[0, 1]` where 1 is - // perfect quality. - QualityScore float64 `json:"qualityScore,omitempty"` + // Text: Optional. An optional field to store a normalized string. For + // some entity types, one of respective `structured_value` fields may + // also be populated. Also not all the types of `structured_value` will + // be normalized. For example, some processors may not generate `float` + // or `integer` normalized text by default. Below are sample formats + // mapped to structured values. - Money/Currency type (`money_value`) is + // in the ISO 4217 text format. - Date type (`date_value`) is in the ISO + // 8601 text format. - Datetime type (`datetime_value`) is in the ISO + // 8601 text format. + Text string `json:"text,omitempty"` - // ForceSendFields is a list of field names (e.g. "DetectedDefects") to + // ForceSendFields is a list of field names (e.g. "AddressValue") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -5985,51 +6013,48 @@ type GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScores struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DetectedDefects") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "AddressValue") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScores) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScores +func (s *GoogleCloudDocumentaiV1beta1DocumentEntityNormalizedValue) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentEntityNormalizedValue raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScores) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScores +func (s *GoogleCloudDocumentaiV1beta1DocumentEntityNormalizedValue) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentEntityNormalizedValue var s1 struct { - QualityScore gensupport.JSONFloat64 `json:"qualityScore"` + FloatValue gensupport.JSONFloat64 `json:"floatValue"` *NoMethod } s1.NoMethod = (*NoMethod)(s) if err := json.Unmarshal(data, &s1); err != nil { return err } - s.QualityScore = float64(s1.QualityScore) + s.FloatValue = float64(s1.FloatValue) return nil } -// GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScoresDetectedDefe -// ct: Image Quality Defects -type GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScoresDetectedDefect struct { - // Confidence: Confidence of detected defect. Range `[0, 1]` where 1 - // indicates strong confidence of that the defect exists. - Confidence float64 `json:"confidence,omitempty"` +// GoogleCloudDocumentaiV1beta1DocumentEntityRelation: Relationship +// between Entities. +type GoogleCloudDocumentaiV1beta1DocumentEntityRelation struct { + // ObjectId: Object entity id. + ObjectId string `json:"objectId,omitempty"` - // Type: Name of the defect type. Supported values are: - - // `quality/defect_blurry` - `quality/defect_noisy` - - // `quality/defect_dark` - `quality/defect_faint` - - // `quality/defect_text_too_small` - `quality/defect_document_cutoff` - - // `quality/defect_text_cutoff` - `quality/defect_glare` - Type string `json:"type,omitempty"` + // Relation: Relationship description. + Relation string `json:"relation,omitempty"` - // ForceSendFields is a list of field names (e.g. "Confidence") to + // SubjectId: Subject entity id. + SubjectId string `json:"subjectId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ObjectId") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -6037,7 +6062,7 @@ type GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScoresDetectedDefect st // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Confidence") to include in + // NullFields is a list of field names (e.g. "ObjectId") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -6046,52 +6071,163 @@ type GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScoresDetectedDefect st NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScoresDetectedDefect) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScoresDetectedDefect +func (s *GoogleCloudDocumentaiV1beta1DocumentEntityRelation) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentEntityRelation raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScoresDetectedDefect) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScoresDetectedDefect - var s1 struct { - Confidence gensupport.JSONFloat64 `json:"confidence"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.Confidence = float64(s1.Confidence) - return nil -} +// GoogleCloudDocumentaiV1beta1DocumentPage: A page in a Document. +type GoogleCloudDocumentaiV1beta1DocumentPage struct { + // Blocks: A list of visually detected text blocks on the page. A block + // has a set of lines (collected into paragraphs) that have a common + // line-spacing and orientation. + Blocks []*GoogleCloudDocumentaiV1beta1DocumentPageBlock `json:"blocks,omitempty"` -// GoogleCloudDocumentaiV1beta1DocumentPageLayout: Visual element -// describing a layout unit on a page. -type GoogleCloudDocumentaiV1beta1DocumentPageLayout struct { - // BoundingPoly: The bounding polygon for the Layout. - BoundingPoly *GoogleCloudDocumentaiV1beta1BoundingPoly `json:"boundingPoly,omitempty"` + // DetectedBarcodes: A list of detected barcodes. + DetectedBarcodes []*GoogleCloudDocumentaiV1beta1DocumentPageDetectedBarcode `json:"detectedBarcodes,omitempty"` - // Confidence: Confidence of the current Layout within context of the - // object this layout is for. e.g. confidence can be for a single token, - // a table, a visual element, etc. depending on context. Range `[0, 1]`. - Confidence float64 `json:"confidence,omitempty"` + // DetectedLanguages: A list of detected languages together with + // confidence. + DetectedLanguages []*GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` - // Orientation: Detected orientation for the Layout. + // Dimension: Physical dimension of the page. + Dimension *GoogleCloudDocumentaiV1beta1DocumentPageDimension `json:"dimension,omitempty"` + + // FormFields: A list of visually detected form fields on the page. + FormFields []*GoogleCloudDocumentaiV1beta1DocumentPageFormField `json:"formFields,omitempty"` + + // Image: Rendered image for this page. This image is preprocessed to + // remove any skew, rotation, and distortions such that the annotation + // bounding boxes can be upright and axis-aligned. + Image *GoogleCloudDocumentaiV1beta1DocumentPageImage `json:"image,omitempty"` + + // ImageQualityScores: Image Quality Scores. + ImageQualityScores *GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScores `json:"imageQualityScores,omitempty"` + + // Layout: Layout for the page. + Layout *GoogleCloudDocumentaiV1beta1DocumentPageLayout `json:"layout,omitempty"` + + // Lines: A list of visually detected text lines on the page. A + // collection of tokens that a human would perceive as a line. + Lines []*GoogleCloudDocumentaiV1beta1DocumentPageLine `json:"lines,omitempty"` + + // PageNumber: 1-based index for current Page in a parent Document. + // Useful when a page is taken out of a Document for individual + // processing. + PageNumber int64 `json:"pageNumber,omitempty"` + + // Paragraphs: A list of visually detected text paragraphs on the page. + // A collection of lines that a human would perceive as a paragraph. + Paragraphs []*GoogleCloudDocumentaiV1beta1DocumentPageParagraph `json:"paragraphs,omitempty"` + + // Provenance: The history of this page. + Provenance *GoogleCloudDocumentaiV1beta1DocumentProvenance `json:"provenance,omitempty"` + + // Symbols: A list of visually detected symbols on the page. + Symbols []*GoogleCloudDocumentaiV1beta1DocumentPageSymbol `json:"symbols,omitempty"` + + // Tables: A list of visually detected tables on the page. + Tables []*GoogleCloudDocumentaiV1beta1DocumentPageTable `json:"tables,omitempty"` + + // Tokens: A list of visually detected tokens on the page. + Tokens []*GoogleCloudDocumentaiV1beta1DocumentPageToken `json:"tokens,omitempty"` + + // Transforms: Transformation matrices that were applied to the original + // document image to produce Page.image. + Transforms []*GoogleCloudDocumentaiV1beta1DocumentPageMatrix `json:"transforms,omitempty"` + + // VisualElements: A list of detected non-text visual elements e.g. + // checkbox, signature etc. on the page. + VisualElements []*GoogleCloudDocumentaiV1beta1DocumentPageVisualElement `json:"visualElements,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Blocks") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Blocks") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDocumentaiV1beta1DocumentPage) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentPage + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDocumentaiV1beta1DocumentPageAnchor: Referencing the +// visual context of the entity in the Document.pages. Page anchors can +// be cross-page, consist of multiple bounding polygons and optionally +// reference specific layout element types. +type GoogleCloudDocumentaiV1beta1DocumentPageAnchor struct { + // PageRefs: One or more references to visual page elements + PageRefs []*GoogleCloudDocumentaiV1beta1DocumentPageAnchorPageRef `json:"pageRefs,omitempty"` + + // ForceSendFields is a list of field names (e.g. "PageRefs") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "PageRefs") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDocumentaiV1beta1DocumentPageAnchor) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageAnchor + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDocumentaiV1beta1DocumentPageAnchorPageRef: Represents a +// weak reference to a page element within a document. +type GoogleCloudDocumentaiV1beta1DocumentPageAnchorPageRef struct { + // BoundingPoly: Optional. Identifies the bounding polygon of a layout + // element on the page. + BoundingPoly *GoogleCloudDocumentaiV1beta1BoundingPoly `json:"boundingPoly,omitempty"` + + // Confidence: Optional. Confidence of detected page element, if + // applicable. Range `[0, 1]`. + Confidence float64 `json:"confidence,omitempty"` + + // LayoutId: Optional. Deprecated. Use PageRef.bounding_poly instead. + LayoutId string `json:"layoutId,omitempty"` + + // LayoutType: Optional. The type of the layout element that is being + // referenced if any. // // Possible values: - // "ORIENTATION_UNSPECIFIED" - Unspecified orientation. - // "PAGE_UP" - Orientation is aligned with page up. - // "PAGE_RIGHT" - Orientation is aligned with page right. Turn the - // head 90 degrees clockwise from upright to read. - // "PAGE_DOWN" - Orientation is aligned with page down. Turn the head - // 180 degrees from upright to read. - // "PAGE_LEFT" - Orientation is aligned with page left. Turn the head - // 90 degrees counterclockwise from upright to read. - Orientation string `json:"orientation,omitempty"` + // "LAYOUT_TYPE_UNSPECIFIED" - Layout Unspecified. + // "BLOCK" - References a Page.blocks element. + // "PARAGRAPH" - References a Page.paragraphs element. + // "LINE" - References a Page.lines element. + // "TOKEN" - References a Page.tokens element. + // "VISUAL_ELEMENT" - References a Page.visual_elements element. + // "TABLE" - Refrrences a Page.tables element. + // "FORM_FIELD" - References a Page.form_fields element. + LayoutType string `json:"layoutType,omitempty"` - // TextAnchor: Text anchor indexing into the Document.text. - TextAnchor *GoogleCloudDocumentaiV1beta1DocumentTextAnchor `json:"textAnchor,omitempty"` + // Page: Required. Index into the Document.pages element, for example + // using `Document.pages` to locate the related page element. This field + // is skipped when its value is the default `0`. See + // https://developers.google.com/protocol-buffers/docs/proto3#json. + Page int64 `json:"page,omitempty,string"` // ForceSendFields is a list of field names (e.g. "BoundingPoly") to // unconditionally include in API requests. By default, fields with @@ -6110,14 +6246,14 @@ type GoogleCloudDocumentaiV1beta1DocumentPageLayout struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentPageLayout) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageLayout +func (s *GoogleCloudDocumentaiV1beta1DocumentPageAnchorPageRef) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageAnchorPageRef raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *GoogleCloudDocumentaiV1beta1DocumentPageLayout) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageLayout +func (s *GoogleCloudDocumentaiV1beta1DocumentPageAnchorPageRef) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageAnchorPageRef var s1 struct { Confidence gensupport.JSONFloat64 `json:"confidence"` *NoMethod @@ -6130,15 +6266,15 @@ func (s *GoogleCloudDocumentaiV1beta1DocumentPageLayout) UnmarshalJSON(data []by return nil } -// GoogleCloudDocumentaiV1beta1DocumentPageLine: A collection of tokens -// that a human would perceive as a line. Does not cross column -// boundaries, can be horizontal, vertical, etc. -type GoogleCloudDocumentaiV1beta1DocumentPageLine struct { +// GoogleCloudDocumentaiV1beta1DocumentPageBlock: A block has a set of +// lines (collected into paragraphs) that have a common line-spacing and +// orientation. +type GoogleCloudDocumentaiV1beta1DocumentPageBlock struct { // DetectedLanguages: A list of detected languages together with // confidence. DetectedLanguages []*GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` - // Layout: Layout for Line. + // Layout: Layout for Block. Layout *GoogleCloudDocumentaiV1beta1DocumentPageLayout `json:"layout,omitempty"` // Provenance: The history of this annotation. @@ -6162,32 +6298,22 @@ type GoogleCloudDocumentaiV1beta1DocumentPageLine struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentPageLine) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageLine +func (s *GoogleCloudDocumentaiV1beta1DocumentPageBlock) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageBlock raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1DocumentPageMatrix: Representation for -// transformation matrix, intended to be compatible and used with OpenCV -// format for image manipulation. -type GoogleCloudDocumentaiV1beta1DocumentPageMatrix struct { - // Cols: Number of columns in the matrix. - Cols int64 `json:"cols,omitempty"` - - // Data: The matrix data. - Data string `json:"data,omitempty"` - - // Rows: Number of rows in the matrix. - Rows int64 `json:"rows,omitempty"` +// GoogleCloudDocumentaiV1beta1DocumentPageDetectedBarcode: A detected +// barcode. +type GoogleCloudDocumentaiV1beta1DocumentPageDetectedBarcode struct { + // Barcode: Detailed barcode information of the DetectedBarcode. + Barcode *GoogleCloudDocumentaiV1beta1Barcode `json:"barcode,omitempty"` - // Type: This encodes information about what data type the matrix uses. - // For example, 0 (CV_8U) is an unsigned 8-bit image. For the full list - // of OpenCV primitive data types, please refer to - // https://docs.opencv.org/4.3.0/d1/d1b/group__core__hal__interface.html - Type int64 `json:"type,omitempty"` + // Layout: Layout for DetectedBarcode. + Layout *GoogleCloudDocumentaiV1beta1DocumentPageLayout `json:"layout,omitempty"` - // ForceSendFields is a list of field names (e.g. "Cols") to + // ForceSendFields is a list of field names (e.g. "Barcode") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -6195,8 +6321,8 @@ type GoogleCloudDocumentaiV1beta1DocumentPageMatrix struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Cols") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "Barcode") to include in + // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -6204,102 +6330,149 @@ type GoogleCloudDocumentaiV1beta1DocumentPageMatrix struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentPageMatrix) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageMatrix +func (s *GoogleCloudDocumentaiV1beta1DocumentPageDetectedBarcode) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageDetectedBarcode raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1DocumentPageParagraph: A collection of -// lines that a human would perceive as a paragraph. -type GoogleCloudDocumentaiV1beta1DocumentPageParagraph struct { - // DetectedLanguages: A list of detected languages together with - // confidence. - DetectedLanguages []*GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` - - // Layout: Layout for Paragraph. - Layout *GoogleCloudDocumentaiV1beta1DocumentPageLayout `json:"layout,omitempty"` +// GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage: Detected +// language for a structural component. +type GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage struct { + // Confidence: Confidence of detected language. Range `[0, 1]`. + Confidence float64 `json:"confidence,omitempty"` - // Provenance: The history of this annotation. - Provenance *GoogleCloudDocumentaiV1beta1DocumentProvenance `json:"provenance,omitempty"` + // LanguageCode: The BCP-47 language code, such as `en-US` or `sr-Latn`. + // For more information, see + // https://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + LanguageCode string `json:"languageCode,omitempty"` - // ForceSendFields is a list of field names (e.g. "DetectedLanguages") - // to unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "Confidence") to + // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DetectedLanguages") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "Confidence") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentPageParagraph) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageParagraph +func (s *GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1DocumentPageSymbol: A detected symbol. -type GoogleCloudDocumentaiV1beta1DocumentPageSymbol struct { - // DetectedLanguages: A list of detected languages together with - // confidence. - DetectedLanguages []*GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` - - // Layout: Layout for Symbol. - Layout *GoogleCloudDocumentaiV1beta1DocumentPageLayout `json:"layout,omitempty"` - - // ForceSendFields is a list of field names (e.g. "DetectedLanguages") - // to unconditionally include in API requests. By default, fields with +func (s *GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage + var s1 struct { + Confidence gensupport.JSONFloat64 `json:"confidence"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Confidence = float64(s1.Confidence) + return nil +} + +// GoogleCloudDocumentaiV1beta1DocumentPageDimension: Dimension for the +// page. +type GoogleCloudDocumentaiV1beta1DocumentPageDimension struct { + // Height: Page height. + Height float64 `json:"height,omitempty"` + + // Unit: Dimension unit. + Unit string `json:"unit,omitempty"` + + // Width: Page width. + Width float64 `json:"width,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DetectedLanguages") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "Height") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentPageSymbol) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageSymbol +func (s *GoogleCloudDocumentaiV1beta1DocumentPageDimension) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageDimension raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1DocumentPageTable: A table representation -// similar to HTML table structure. -type GoogleCloudDocumentaiV1beta1DocumentPageTable struct { - // BodyRows: Body rows of the table. - BodyRows []*GoogleCloudDocumentaiV1beta1DocumentPageTableTableRow `json:"bodyRows,omitempty"` +func (s *GoogleCloudDocumentaiV1beta1DocumentPageDimension) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageDimension + var s1 struct { + Height gensupport.JSONFloat64 `json:"height"` + Width gensupport.JSONFloat64 `json:"width"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Height = float64(s1.Height) + s.Width = float64(s1.Width) + return nil +} - // DetectedLanguages: A list of detected languages together with - // confidence. - DetectedLanguages []*GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` +// GoogleCloudDocumentaiV1beta1DocumentPageFormField: A form field +// detected on the page. +type GoogleCloudDocumentaiV1beta1DocumentPageFormField struct { + // CorrectedKeyText: Created for Labeling UI to export key text. If + // corrections were made to the text identified by the + // `field_name.text_anchor`, this field will contain the correction. + CorrectedKeyText string `json:"correctedKeyText,omitempty"` - // HeaderRows: Header rows of the table. - HeaderRows []*GoogleCloudDocumentaiV1beta1DocumentPageTableTableRow `json:"headerRows,omitempty"` + // CorrectedValueText: Created for Labeling UI to export value text. If + // corrections were made to the text identified by the + // `field_value.text_anchor`, this field will contain the correction. + CorrectedValueText string `json:"correctedValueText,omitempty"` - // Layout: Layout for Table. - Layout *GoogleCloudDocumentaiV1beta1DocumentPageLayout `json:"layout,omitempty"` + // FieldName: Layout for the FormField name. e.g. `Address`, `Email`, + // `Grand total`, `Phone number`, etc. + FieldName *GoogleCloudDocumentaiV1beta1DocumentPageLayout `json:"fieldName,omitempty"` - // Provenance: The history of this table. + // FieldValue: Layout for the FormField value. + FieldValue *GoogleCloudDocumentaiV1beta1DocumentPageLayout `json:"fieldValue,omitempty"` + + // NameDetectedLanguages: A list of detected languages for name together + // with confidence. + NameDetectedLanguages []*GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage `json:"nameDetectedLanguages,omitempty"` + + // Provenance: The history of this annotation. Provenance *GoogleCloudDocumentaiV1beta1DocumentProvenance `json:"provenance,omitempty"` - // ForceSendFields is a list of field names (e.g. "BodyRows") to + // ValueDetectedLanguages: A list of detected languages for value + // together with confidence. + ValueDetectedLanguages []*GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage `json:"valueDetectedLanguages,omitempty"` + + // ValueType: If the value is non-textual, this field represents the + // type. Current valid values are: - blank (this indicates the + // `field_value` is normal text) - `unfilled_checkbox` - + // `filled_checkbox` + ValueType string `json:"valueType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CorrectedKeyText") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -6307,38 +6480,38 @@ type GoogleCloudDocumentaiV1beta1DocumentPageTable struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "BodyRows") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "CorrectedKeyText") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentPageTable) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageTable +func (s *GoogleCloudDocumentaiV1beta1DocumentPageFormField) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageFormField raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1DocumentPageTableTableCell: A cell -// representation inside the table. -type GoogleCloudDocumentaiV1beta1DocumentPageTableTableCell struct { - // ColSpan: How many columns this cell spans. - ColSpan int64 `json:"colSpan,omitempty"` +// GoogleCloudDocumentaiV1beta1DocumentPageImage: Rendered image +// contents for this page. +type GoogleCloudDocumentaiV1beta1DocumentPageImage struct { + // Content: Raw byte content of the image. + Content string `json:"content,omitempty"` - // DetectedLanguages: A list of detected languages together with - // confidence. - DetectedLanguages []*GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` + // Height: Height of the image in pixels. + Height int64 `json:"height,omitempty"` - // Layout: Layout for TableCell. - Layout *GoogleCloudDocumentaiV1beta1DocumentPageLayout `json:"layout,omitempty"` + // MimeType: Encoding mime type for the image. + MimeType string `json:"mimeType,omitempty"` - // RowSpan: How many rows this cell spans. - RowSpan int64 `json:"rowSpan,omitempty"` + // Width: Width of the image in pixels. + Width int64 `json:"width,omitempty"` - // ForceSendFields is a list of field names (e.g. "ColSpan") to + // ForceSendFields is a list of field names (e.g. "Content") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -6346,7 +6519,7 @@ type GoogleCloudDocumentaiV1beta1DocumentPageTableTableCell struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ColSpan") to include in + // NullFields is a list of field names (e.g. "Content") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -6355,19 +6528,23 @@ type GoogleCloudDocumentaiV1beta1DocumentPageTableTableCell struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentPageTableTableCell) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageTableTableCell +func (s *GoogleCloudDocumentaiV1beta1DocumentPageImage) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageImage raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1DocumentPageTableTableRow: A row of table -// cells. -type GoogleCloudDocumentaiV1beta1DocumentPageTableTableRow struct { - // Cells: Cells that make up this row. - Cells []*GoogleCloudDocumentaiV1beta1DocumentPageTableTableCell `json:"cells,omitempty"` +// GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScores: Image +// Quality Scores for the page image +type GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScores struct { + // DetectedDefects: A list of detected defects. + DetectedDefects []*GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScoresDetectedDefect `json:"detectedDefects,omitempty"` - // ForceSendFields is a list of field names (e.g. "Cells") to + // QualityScore: The overall quality score. Range `[0, 1]` where 1 is + // perfect quality. + QualityScore float64 `json:"qualityScore,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DetectedDefects") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -6375,37 +6552,51 @@ type GoogleCloudDocumentaiV1beta1DocumentPageTableTableRow struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Cells") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "DetectedDefects") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentPageTableTableRow) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageTableTableRow +func (s *GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScores) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScores raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1DocumentPageToken: A detected token. -type GoogleCloudDocumentaiV1beta1DocumentPageToken struct { - // DetectedBreak: Detected break at the end of a Token. - DetectedBreak *GoogleCloudDocumentaiV1beta1DocumentPageTokenDetectedBreak `json:"detectedBreak,omitempty"` - - // DetectedLanguages: A list of detected languages together with - // confidence. - DetectedLanguages []*GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` +func (s *GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScores) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScores + var s1 struct { + QualityScore gensupport.JSONFloat64 `json:"qualityScore"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.QualityScore = float64(s1.QualityScore) + return nil +} - // Layout: Layout for Token. - Layout *GoogleCloudDocumentaiV1beta1DocumentPageLayout `json:"layout,omitempty"` +// GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScoresDetectedDefe +// ct: Image Quality Defects +type GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScoresDetectedDefect struct { + // Confidence: Confidence of detected defect. Range `[0, 1]` where 1 + // indicates strong confidence of that the defect exists. + Confidence float64 `json:"confidence,omitempty"` - // Provenance: The history of this annotation. - Provenance *GoogleCloudDocumentaiV1beta1DocumentProvenance `json:"provenance,omitempty"` + // Type: Name of the defect type. Supported values are: - + // `quality/defect_blurry` - `quality/defect_noisy` - + // `quality/defect_dark` - `quality/defect_faint` - + // `quality/defect_text_too_small` - `quality/defect_document_cutoff` - + // `quality/defect_text_cutoff` - `quality/defect_glare` + Type string `json:"type,omitempty"` - // ForceSendFields is a list of field names (e.g. "DetectedBreak") to + // ForceSendFields is a list of field names (e.g. "Confidence") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -6413,69 +6604,112 @@ type GoogleCloudDocumentaiV1beta1DocumentPageToken struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DetectedBreak") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "Confidence") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentPageToken) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageToken +func (s *GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScoresDetectedDefect) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScoresDetectedDefect raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1DocumentPageTokenDetectedBreak: Detected -// break at the end of a Token. -type GoogleCloudDocumentaiV1beta1DocumentPageTokenDetectedBreak struct { - // Type: Detected break type. - // - // Possible values: - // "TYPE_UNSPECIFIED" - Unspecified break type. - // "SPACE" - A single whitespace. - // "WIDE_SPACE" - A wider whitespace. - // "HYPHEN" - A hyphen that indicates that a token has been split - // across lines. - Type string `json:"type,omitempty"` - - // ForceSendFields is a list of field names (e.g. "Type") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any +func (s *GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScoresDetectedDefect) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageImageQualityScoresDetectedDefect + var s1 struct { + Confidence gensupport.JSONFloat64 `json:"confidence"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Confidence = float64(s1.Confidence) + return nil +} + +// GoogleCloudDocumentaiV1beta1DocumentPageLayout: Visual element +// describing a layout unit on a page. +type GoogleCloudDocumentaiV1beta1DocumentPageLayout struct { + // BoundingPoly: The bounding polygon for the Layout. + BoundingPoly *GoogleCloudDocumentaiV1beta1BoundingPoly `json:"boundingPoly,omitempty"` + + // Confidence: Confidence of the current Layout within context of the + // object this layout is for. e.g. confidence can be for a single token, + // a table, a visual element, etc. depending on context. Range `[0, 1]`. + Confidence float64 `json:"confidence,omitempty"` + + // Orientation: Detected orientation for the Layout. + // + // Possible values: + // "ORIENTATION_UNSPECIFIED" - Unspecified orientation. + // "PAGE_UP" - Orientation is aligned with page up. + // "PAGE_RIGHT" - Orientation is aligned with page right. Turn the + // head 90 degrees clockwise from upright to read. + // "PAGE_DOWN" - Orientation is aligned with page down. Turn the head + // 180 degrees from upright to read. + // "PAGE_LEFT" - Orientation is aligned with page left. Turn the head + // 90 degrees counterclockwise from upright to read. + Orientation string `json:"orientation,omitempty"` + + // TextAnchor: Text anchor indexing into the Document.text. + TextAnchor *GoogleCloudDocumentaiV1beta1DocumentTextAnchor `json:"textAnchor,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BoundingPoly") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Type") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "BoundingPoly") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentPageTokenDetectedBreak) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageTokenDetectedBreak +func (s *GoogleCloudDocumentaiV1beta1DocumentPageLayout) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageLayout raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1DocumentPageVisualElement: Detected -// non-text visual elements e.g. checkbox, signature etc. on the page. -type GoogleCloudDocumentaiV1beta1DocumentPageVisualElement struct { +func (s *GoogleCloudDocumentaiV1beta1DocumentPageLayout) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageLayout + var s1 struct { + Confidence gensupport.JSONFloat64 `json:"confidence"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Confidence = float64(s1.Confidence) + return nil +} + +// GoogleCloudDocumentaiV1beta1DocumentPageLine: A collection of tokens +// that a human would perceive as a line. Does not cross column +// boundaries, can be horizontal, vertical, etc. +type GoogleCloudDocumentaiV1beta1DocumentPageLine struct { // DetectedLanguages: A list of detected languages together with // confidence. DetectedLanguages []*GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` - // Layout: Layout for VisualElement. + // Layout: Layout for Line. Layout *GoogleCloudDocumentaiV1beta1DocumentPageLayout `json:"layout,omitempty"` - // Type: Type of the VisualElement. - Type string `json:"type,omitempty"` + // Provenance: The history of this annotation. + Provenance *GoogleCloudDocumentaiV1beta1DocumentProvenance `json:"provenance,omitempty"` // ForceSendFields is a list of field names (e.g. "DetectedLanguages") // to unconditionally include in API requests. By default, fields with @@ -6495,42 +6729,32 @@ type GoogleCloudDocumentaiV1beta1DocumentPageVisualElement struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentPageVisualElement) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageVisualElement +func (s *GoogleCloudDocumentaiV1beta1DocumentPageLine) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageLine raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1DocumentProvenance: Structure to identify -// provenance relationships between annotations in different revisions. -type GoogleCloudDocumentaiV1beta1DocumentProvenance struct { - // Id: The Id of this operation. Needs to be unique within the scope of - // the revision. - Id int64 `json:"id,omitempty"` +// GoogleCloudDocumentaiV1beta1DocumentPageMatrix: Representation for +// transformation matrix, intended to be compatible and used with OpenCV +// format for image manipulation. +type GoogleCloudDocumentaiV1beta1DocumentPageMatrix struct { + // Cols: Number of columns in the matrix. + Cols int64 `json:"cols,omitempty"` - // Parents: References to the original elements that are replaced. - Parents []*GoogleCloudDocumentaiV1beta1DocumentProvenanceParent `json:"parents,omitempty"` + // Data: The matrix data. + Data string `json:"data,omitempty"` - // Revision: The index of the revision that produced this element. - Revision int64 `json:"revision,omitempty"` + // Rows: Number of rows in the matrix. + Rows int64 `json:"rows,omitempty"` - // Type: The type of provenance operation. - // - // Possible values: - // "OPERATION_TYPE_UNSPECIFIED" - Operation type unspecified. If no - // operation is specified a provenance entry is simply used to match - // against a `parent`. - // "ADD" - Add an element. - // "REMOVE" - Remove an element identified by `parent`. - // "REPLACE" - Replace an element identified by `parent`. - // "EVAL_REQUESTED" - Request human review for the element identified - // by `parent`. - // "EVAL_APPROVED" - Element is reviewed and approved at human review, - // confidence will be set to 1.0. - // "EVAL_SKIPPED" - Element is skipped in the validation process. - Type string `json:"type,omitempty"` + // Type: This encodes information about what data type the matrix uses. + // For example, 0 (CV_8U) is an unsigned 8-bit image. For the full list + // of OpenCV primitive data types, please refer to + // https://docs.opencv.org/4.3.0/d1/d1b/group__core__hal__interface.html + Type int64 `json:"type,omitempty"` - // ForceSendFields is a list of field names (e.g. "Id") to + // ForceSendFields is a list of field names (e.g. "Cols") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -6538,7 +6762,7 @@ type GoogleCloudDocumentaiV1beta1DocumentProvenance struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Id") to include in API + // NullFields is a list of field names (e.g. "Cols") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -6547,82 +6771,102 @@ type GoogleCloudDocumentaiV1beta1DocumentProvenance struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentProvenance) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentProvenance +func (s *GoogleCloudDocumentaiV1beta1DocumentPageMatrix) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageMatrix raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1DocumentProvenanceParent: The parent -// element the current element is based on. Used for -// referencing/aligning, removal and replacement operations. -type GoogleCloudDocumentaiV1beta1DocumentProvenanceParent struct { - // Id: The id of the parent provenance. - Id int64 `json:"id,omitempty"` +// GoogleCloudDocumentaiV1beta1DocumentPageParagraph: A collection of +// lines that a human would perceive as a paragraph. +type GoogleCloudDocumentaiV1beta1DocumentPageParagraph struct { + // DetectedLanguages: A list of detected languages together with + // confidence. + DetectedLanguages []*GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` - // Index: The index of the parent item in the corresponding item list - // (eg. list of entities, properties within entities, etc.) in the - // parent revision. - Index int64 `json:"index,omitempty"` + // Layout: Layout for Paragraph. + Layout *GoogleCloudDocumentaiV1beta1DocumentPageLayout `json:"layout,omitempty"` - // Revision: The index of the index into current revision's parent_ids - // list. - Revision int64 `json:"revision,omitempty"` + // Provenance: The history of this annotation. + Provenance *GoogleCloudDocumentaiV1beta1DocumentProvenance `json:"provenance,omitempty"` - // ForceSendFields is a list of field names (e.g. "Id") to - // unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "DetectedLanguages") + // to unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Id") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "DetectedLanguages") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentProvenanceParent) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentProvenanceParent +func (s *GoogleCloudDocumentaiV1beta1DocumentPageParagraph) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageParagraph raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1DocumentRevision: Contains past or -// forward revisions of this document. -type GoogleCloudDocumentaiV1beta1DocumentRevision struct { - // Agent: If the change was made by a person specify the name or id of - // that person. - Agent string `json:"agent,omitempty"` +// GoogleCloudDocumentaiV1beta1DocumentPageSymbol: A detected symbol. +type GoogleCloudDocumentaiV1beta1DocumentPageSymbol struct { + // DetectedLanguages: A list of detected languages together with + // confidence. + DetectedLanguages []*GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` - // CreateTime: The time that the revision was created. - CreateTime string `json:"createTime,omitempty"` + // Layout: Layout for Symbol. + Layout *GoogleCloudDocumentaiV1beta1DocumentPageLayout `json:"layout,omitempty"` - // HumanReview: Human Review information of this revision. - HumanReview *GoogleCloudDocumentaiV1beta1DocumentRevisionHumanReview `json:"humanReview,omitempty"` + // ForceSendFields is a list of field names (e.g. "DetectedLanguages") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` - // Id: Id of the revision. Unique within the context of the document. - Id string `json:"id,omitempty"` + // NullFields is a list of field names (e.g. "DetectedLanguages") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} - // Parent: The revisions that this revision is based on. This can - // include one or more parent (when documents are merged.) This field - // represents the index into the `revisions` field. - Parent []int64 `json:"parent,omitempty"` +func (s *GoogleCloudDocumentaiV1beta1DocumentPageSymbol) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageSymbol + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // ParentIds: The revisions that this revision is based on. Must include - // all the ids that have anything to do with this revision - eg. there - // are `provenance.parent.revision` fields that index into this field. - ParentIds []string `json:"parentIds,omitempty"` +// GoogleCloudDocumentaiV1beta1DocumentPageTable: A table representation +// similar to HTML table structure. +type GoogleCloudDocumentaiV1beta1DocumentPageTable struct { + // BodyRows: Body rows of the table. + BodyRows []*GoogleCloudDocumentaiV1beta1DocumentPageTableTableRow `json:"bodyRows,omitempty"` - // Processor: If the annotation was made by processor identify the - // processor by its resource name. - Processor string `json:"processor,omitempty"` + // DetectedLanguages: A list of detected languages together with + // confidence. + DetectedLanguages []*GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` - // ForceSendFields is a list of field names (e.g. "Agent") to + // HeaderRows: Header rows of the table. + HeaderRows []*GoogleCloudDocumentaiV1beta1DocumentPageTableTableRow `json:"headerRows,omitempty"` + + // Layout: Layout for Table. + Layout *GoogleCloudDocumentaiV1beta1DocumentPageLayout `json:"layout,omitempty"` + + // Provenance: The history of this table. + Provenance *GoogleCloudDocumentaiV1beta1DocumentProvenance `json:"provenance,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BodyRows") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -6630,8 +6874,8 @@ type GoogleCloudDocumentaiV1beta1DocumentRevision struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Agent") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "BodyRows") to include in + // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -6639,24 +6883,29 @@ type GoogleCloudDocumentaiV1beta1DocumentRevision struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentRevision) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentRevision - raw := NoMethod(*s) +func (s *GoogleCloudDocumentaiV1beta1DocumentPageTable) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageTable + raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1DocumentRevisionHumanReview: Human Review -// information of the document. -type GoogleCloudDocumentaiV1beta1DocumentRevisionHumanReview struct { - // State: Human review state. e.g. `requested`, `succeeded`, `rejected`. - State string `json:"state,omitempty"` +// GoogleCloudDocumentaiV1beta1DocumentPageTableTableCell: A cell +// representation inside the table. +type GoogleCloudDocumentaiV1beta1DocumentPageTableTableCell struct { + // ColSpan: How many columns this cell spans. + ColSpan int64 `json:"colSpan,omitempty"` - // StateMessage: A message providing more details about the current - // state of processing. For example, the rejection reason when the state - // is `rejected`. - StateMessage string `json:"stateMessage,omitempty"` + // DetectedLanguages: A list of detected languages together with + // confidence. + DetectedLanguages []*GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` - // ForceSendFields is a list of field names (e.g. "State") to + // Layout: Layout for TableCell. + Layout *GoogleCloudDocumentaiV1beta1DocumentPageLayout `json:"layout,omitempty"` + + // RowSpan: How many rows this cell spans. + RowSpan int64 `json:"rowSpan,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ColSpan") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -6664,8 +6913,8 @@ type GoogleCloudDocumentaiV1beta1DocumentRevisionHumanReview struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "State") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "ColSpan") to include in + // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -6673,27 +6922,19 @@ type GoogleCloudDocumentaiV1beta1DocumentRevisionHumanReview struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentRevisionHumanReview) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentRevisionHumanReview +func (s *GoogleCloudDocumentaiV1beta1DocumentPageTableTableCell) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageTableTableCell raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1DocumentShardInfo: For a large document, -// sharding may be performed to produce several document shards. Each -// document shard contains this field to detail which shard it is. -type GoogleCloudDocumentaiV1beta1DocumentShardInfo struct { - // ShardCount: Total number of shards. - ShardCount int64 `json:"shardCount,omitempty,string"` - - // ShardIndex: The 0-based index of this shard. - ShardIndex int64 `json:"shardIndex,omitempty,string"` - - // TextOffset: The index of the first character in Document.text in the - // overall document global text. - TextOffset int64 `json:"textOffset,omitempty,string"` +// GoogleCloudDocumentaiV1beta1DocumentPageTableTableRow: A row of table +// cells. +type GoogleCloudDocumentaiV1beta1DocumentPageTableTableRow struct { + // Cells: Cells that make up this row. + Cells []*GoogleCloudDocumentaiV1beta1DocumentPageTableTableCell `json:"cells,omitempty"` - // ForceSendFields is a list of field names (e.g. "ShardCount") to + // ForceSendFields is a list of field names (e.g. "Cells") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -6701,8 +6942,8 @@ type GoogleCloudDocumentaiV1beta1DocumentShardInfo struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ShardCount") to include in - // API requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "Cells") to include in API + // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -6710,45 +6951,28 @@ type GoogleCloudDocumentaiV1beta1DocumentShardInfo struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentShardInfo) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentShardInfo +func (s *GoogleCloudDocumentaiV1beta1DocumentPageTableTableRow) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageTableTableRow raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1DocumentStyle: Annotation for common text -// style attributes. This adheres to CSS conventions as much as -// possible. -type GoogleCloudDocumentaiV1beta1DocumentStyle struct { - // BackgroundColor: Text background color. - BackgroundColor *GoogleTypeColor `json:"backgroundColor,omitempty"` - - // Color: Text color. - Color *GoogleTypeColor `json:"color,omitempty"` - - // FontFamily: Font family such as `Arial`, `Times New Roman`. - // https://www.w3schools.com/cssref/pr_font_font-family.asp - FontFamily string `json:"fontFamily,omitempty"` - - // FontSize: Font size. - FontSize *GoogleCloudDocumentaiV1beta1DocumentStyleFontSize `json:"fontSize,omitempty"` - - // FontWeight: Font weight. Possible values are normal, bold, bolder, - // and lighter. https://www.w3schools.com/cssref/pr_font_weight.asp - FontWeight string `json:"fontWeight,omitempty"` +// GoogleCloudDocumentaiV1beta1DocumentPageToken: A detected token. +type GoogleCloudDocumentaiV1beta1DocumentPageToken struct { + // DetectedBreak: Detected break at the end of a Token. + DetectedBreak *GoogleCloudDocumentaiV1beta1DocumentPageTokenDetectedBreak `json:"detectedBreak,omitempty"` - // TextAnchor: Text anchor indexing into the Document.text. - TextAnchor *GoogleCloudDocumentaiV1beta1DocumentTextAnchor `json:"textAnchor,omitempty"` + // DetectedLanguages: A list of detected languages together with + // confidence. + DetectedLanguages []*GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` - // TextDecoration: Text decoration. Follows CSS standard. - // https://www.w3schools.com/cssref/pr_text_text-decoration.asp - TextDecoration string `json:"textDecoration,omitempty"` + // Layout: Layout for Token. + Layout *GoogleCloudDocumentaiV1beta1DocumentPageLayout `json:"layout,omitempty"` - // TextStyle: Text style. Possible values are normal, italic, and - // oblique. https://www.w3schools.com/cssref/pr_font_font-style.asp - TextStyle string `json:"textStyle,omitempty"` + // Provenance: The history of this annotation. + Provenance *GoogleCloudDocumentaiV1beta1DocumentProvenance `json:"provenance,omitempty"` - // ForceSendFields is a list of field names (e.g. "BackgroundColor") to + // ForceSendFields is a list of field names (e.g. "DetectedBreak") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -6756,32 +6980,35 @@ type GoogleCloudDocumentaiV1beta1DocumentStyle struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "BackgroundColor") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "DetectedBreak") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentStyle) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentStyle +func (s *GoogleCloudDocumentaiV1beta1DocumentPageToken) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageToken raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1DocumentStyleFontSize: Font size with -// unit. -type GoogleCloudDocumentaiV1beta1DocumentStyleFontSize struct { - // Size: Font size for the text. - Size float64 `json:"size,omitempty"` - - // Unit: Unit for the font size. Follows CSS naming (in, px, pt, etc.). - Unit string `json:"unit,omitempty"` +// GoogleCloudDocumentaiV1beta1DocumentPageTokenDetectedBreak: Detected +// break at the end of a Token. +type GoogleCloudDocumentaiV1beta1DocumentPageTokenDetectedBreak struct { + // Type: Detected break type. + // + // Possible values: + // "TYPE_UNSPECIFIED" - Unspecified break type. + // "SPACE" - A single whitespace. + // "WIDE_SPACE" - A wider whitespace. + // "HYPHEN" - A hyphen that indicates that a token has been split + // across lines. + Type string `json:"type,omitempty"` - // ForceSendFields is a list of field names (e.g. "Size") to + // ForceSendFields is a list of field names (e.g. "Type") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -6789,7 +7016,7 @@ type GoogleCloudDocumentaiV1beta1DocumentStyleFontSize struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Size") to include in API + // NullFields is a list of field names (e.g. "Type") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -6798,73 +7025,79 @@ type GoogleCloudDocumentaiV1beta1DocumentStyleFontSize struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentStyleFontSize) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentStyleFontSize +func (s *GoogleCloudDocumentaiV1beta1DocumentPageTokenDetectedBreak) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageTokenDetectedBreak raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *GoogleCloudDocumentaiV1beta1DocumentStyleFontSize) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentStyleFontSize - var s1 struct { - Size gensupport.JSONFloat64 `json:"size"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.Size = float64(s1.Size) - return nil -} +// GoogleCloudDocumentaiV1beta1DocumentPageVisualElement: Detected +// non-text visual elements e.g. checkbox, signature etc. on the page. +type GoogleCloudDocumentaiV1beta1DocumentPageVisualElement struct { + // DetectedLanguages: A list of detected languages together with + // confidence. + DetectedLanguages []*GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` -// GoogleCloudDocumentaiV1beta1DocumentTextAnchor: Text reference -// indexing into the Document.text. -type GoogleCloudDocumentaiV1beta1DocumentTextAnchor struct { - // Content: Contains the content of the text span so that users do not - // have to look it up in the text_segments. It is always populated for - // formFields. - Content string `json:"content,omitempty"` + // Layout: Layout for VisualElement. + Layout *GoogleCloudDocumentaiV1beta1DocumentPageLayout `json:"layout,omitempty"` - // TextSegments: The text segments from the Document.text. - TextSegments []*GoogleCloudDocumentaiV1beta1DocumentTextAnchorTextSegment `json:"textSegments,omitempty"` + // Type: Type of the VisualElement. + Type string `json:"type,omitempty"` - // ForceSendFields is a list of field names (e.g. "Content") to - // unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "DetectedLanguages") + // to unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Content") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "DetectedLanguages") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentTextAnchor) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentTextAnchor +func (s *GoogleCloudDocumentaiV1beta1DocumentPageVisualElement) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentPageVisualElement raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1DocumentTextAnchorTextSegment: A text -// segment in the Document.text. The indices may be out of bounds which -// indicate that the text extends into another document shard for large -// sharded documents. See ShardInfo.text_offset -type GoogleCloudDocumentaiV1beta1DocumentTextAnchorTextSegment struct { - // EndIndex: TextSegment half open end UTF-8 char index in the - // Document.text. - EndIndex int64 `json:"endIndex,omitempty,string"` +// GoogleCloudDocumentaiV1beta1DocumentProvenance: Structure to identify +// provenance relationships between annotations in different revisions. +type GoogleCloudDocumentaiV1beta1DocumentProvenance struct { + // Id: The Id of this operation. Needs to be unique within the scope of + // the revision. + Id int64 `json:"id,omitempty"` - // StartIndex: TextSegment start UTF-8 char index in the Document.text. - StartIndex int64 `json:"startIndex,omitempty,string"` + // Parents: References to the original elements that are replaced. + Parents []*GoogleCloudDocumentaiV1beta1DocumentProvenanceParent `json:"parents,omitempty"` - // ForceSendFields is a list of field names (e.g. "EndIndex") to + // Revision: The index of the revision that produced this element. + Revision int64 `json:"revision,omitempty"` + + // Type: The type of provenance operation. + // + // Possible values: + // "OPERATION_TYPE_UNSPECIFIED" - Operation type unspecified. If no + // operation is specified a provenance entry is simply used to match + // against a `parent`. + // "ADD" - Add an element. + // "REMOVE" - Remove an element identified by `parent`. + // "REPLACE" - Replace an element identified by `parent`. + // "EVAL_REQUESTED" - Request human review for the element identified + // by `parent`. + // "EVAL_APPROVED" - Element is reviewed and approved at human review, + // confidence will be set to 1.0. + // "EVAL_SKIPPED" - Element is skipped in the validation process. + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -6872,8 +7105,8 @@ type GoogleCloudDocumentaiV1beta1DocumentTextAnchorTextSegment struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "EndIndex") to include in - // API requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "Id") to include in API + // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -6881,30 +7114,29 @@ type GoogleCloudDocumentaiV1beta1DocumentTextAnchorTextSegment struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentTextAnchorTextSegment) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentTextAnchorTextSegment +func (s *GoogleCloudDocumentaiV1beta1DocumentProvenance) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentProvenance raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1DocumentTextChange: This message is used -// for text changes aka. OCR corrections. -type GoogleCloudDocumentaiV1beta1DocumentTextChange struct { - // ChangedText: The text that replaces the text identified in the - // `text_anchor`. - ChangedText string `json:"changedText,omitempty"` +// GoogleCloudDocumentaiV1beta1DocumentProvenanceParent: The parent +// element the current element is based on. Used for +// referencing/aligning, removal and replacement operations. +type GoogleCloudDocumentaiV1beta1DocumentProvenanceParent struct { + // Id: The id of the parent provenance. + Id int64 `json:"id,omitempty"` - // Provenance: The history of this annotation. - Provenance []*GoogleCloudDocumentaiV1beta1DocumentProvenance `json:"provenance,omitempty"` + // Index: The index of the parent item in the corresponding item list + // (eg. list of entities, properties within entities, etc.) in the + // parent revision. + Index int64 `json:"index,omitempty"` - // TextAnchor: Provenance of the correction. Text anchor indexing into - // the Document.text. There can only be a single - // `TextAnchor.text_segments` element. If the start and end index of the - // text segment are the same, the text change is inserted before that - // index. - TextAnchor *GoogleCloudDocumentaiV1beta1DocumentTextAnchor `json:"textAnchor,omitempty"` + // Revision: The index of the index into current revision's parent_ids + // list. + Revision int64 `json:"revision,omitempty"` - // ForceSendFields is a list of field names (e.g. "ChangedText") to + // ForceSendFields is a list of field names (e.g. "Id") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -6912,27 +7144,52 @@ type GoogleCloudDocumentaiV1beta1DocumentTextChange struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ChangedText") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "Id") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1DocumentTextChange) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1DocumentTextChange +func (s *GoogleCloudDocumentaiV1beta1DocumentProvenanceParent) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentProvenanceParent raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1GcsDestination: The Google Cloud Storage -// location where the output file will be written to. -type GoogleCloudDocumentaiV1beta1GcsDestination struct { - Uri string `json:"uri,omitempty"` +// GoogleCloudDocumentaiV1beta1DocumentRevision: Contains past or +// forward revisions of this document. +type GoogleCloudDocumentaiV1beta1DocumentRevision struct { + // Agent: If the change was made by a person specify the name or id of + // that person. + Agent string `json:"agent,omitempty"` - // ForceSendFields is a list of field names (e.g. "Uri") to + // CreateTime: The time that the revision was created. + CreateTime string `json:"createTime,omitempty"` + + // HumanReview: Human Review information of this revision. + HumanReview *GoogleCloudDocumentaiV1beta1DocumentRevisionHumanReview `json:"humanReview,omitempty"` + + // Id: Id of the revision. Unique within the context of the document. + Id string `json:"id,omitempty"` + + // Parent: The revisions that this revision is based on. This can + // include one or more parent (when documents are merged.) This field + // represents the index into the `revisions` field. + Parent []int64 `json:"parent,omitempty"` + + // ParentIds: The revisions that this revision is based on. Must include + // all the ids that have anything to do with this revision - eg. there + // are `provenance.parent.revision` fields that index into this field. + ParentIds []string `json:"parentIds,omitempty"` + + // Processor: If the annotation was made by processor identify the + // processor by its resource name. + Processor string `json:"processor,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Agent") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -6940,7 +7197,7 @@ type GoogleCloudDocumentaiV1beta1GcsDestination struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Uri") to include in API + // NullFields is a list of field names (e.g. "Agent") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -6949,18 +7206,24 @@ type GoogleCloudDocumentaiV1beta1GcsDestination struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1GcsDestination) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1GcsDestination +func (s *GoogleCloudDocumentaiV1beta1DocumentRevision) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentRevision raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1GcsSource: The Google Cloud Storage -// location where the input file will be read from. -type GoogleCloudDocumentaiV1beta1GcsSource struct { - Uri string `json:"uri,omitempty"` +// GoogleCloudDocumentaiV1beta1DocumentRevisionHumanReview: Human Review +// information of the document. +type GoogleCloudDocumentaiV1beta1DocumentRevisionHumanReview struct { + // State: Human review state. e.g. `requested`, `succeeded`, `rejected`. + State string `json:"state,omitempty"` - // ForceSendFields is a list of field names (e.g. "Uri") to + // StateMessage: A message providing more details about the current + // state of processing. For example, the rejection reason when the state + // is `rejected`. + StateMessage string `json:"stateMessage,omitempty"` + + // ForceSendFields is a list of field names (e.g. "State") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -6968,7 +7231,7 @@ type GoogleCloudDocumentaiV1beta1GcsSource struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Uri") to include in API + // NullFields is a list of field names (e.g. "State") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -6977,27 +7240,27 @@ type GoogleCloudDocumentaiV1beta1GcsSource struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1GcsSource) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1GcsSource +func (s *GoogleCloudDocumentaiV1beta1DocumentRevisionHumanReview) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentRevisionHumanReview raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1InputConfig: The desired input location -// and metadata. -type GoogleCloudDocumentaiV1beta1InputConfig struct { - // GcsSource: The Google Cloud Storage location to read the input from. - // This must be a single file. - GcsSource *GoogleCloudDocumentaiV1beta1GcsSource `json:"gcsSource,omitempty"` +// GoogleCloudDocumentaiV1beta1DocumentShardInfo: For a large document, +// sharding may be performed to produce several document shards. Each +// document shard contains this field to detail which shard it is. +type GoogleCloudDocumentaiV1beta1DocumentShardInfo struct { + // ShardCount: Total number of shards. + ShardCount int64 `json:"shardCount,omitempty,string"` - // MimeType: Required. Mimetype of the input. Current supported - // mimetypes are application/pdf, image/tiff, and image/gif. In - // addition, application/json type is supported for requests with - // ProcessDocumentRequest.automl_params field set. The JSON file needs - // to be in Document format. - MimeType string `json:"mimeType,omitempty"` + // ShardIndex: The 0-based index of this shard. + ShardIndex int64 `json:"shardIndex,omitempty,string"` - // ForceSendFields is a list of field names (e.g. "GcsSource") to + // TextOffset: The index of the first character in Document.text in the + // overall document global text. + TextOffset int64 `json:"textOffset,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "ShardCount") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -7005,7 +7268,7 @@ type GoogleCloudDocumentaiV1beta1InputConfig struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "GcsSource") to include in + // NullFields is a list of field names (e.g. "ShardCount") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -7014,23 +7277,45 @@ type GoogleCloudDocumentaiV1beta1InputConfig struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1InputConfig) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1InputConfig +func (s *GoogleCloudDocumentaiV1beta1DocumentShardInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentShardInfo raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1NormalizedVertex: A vertex represents a -// 2D point in the image. NOTE: the normalized vertex coordinates are -// relative to the original image and range from 0 to 1. -type GoogleCloudDocumentaiV1beta1NormalizedVertex struct { - // X: X coordinate. - X float64 `json:"x,omitempty"` +// GoogleCloudDocumentaiV1beta1DocumentStyle: Annotation for common text +// style attributes. This adheres to CSS conventions as much as +// possible. +type GoogleCloudDocumentaiV1beta1DocumentStyle struct { + // BackgroundColor: Text background color. + BackgroundColor *GoogleTypeColor `json:"backgroundColor,omitempty"` - // Y: Y coordinate (starts from the top of the image). - Y float64 `json:"y,omitempty"` + // Color: Text color. + Color *GoogleTypeColor `json:"color,omitempty"` - // ForceSendFields is a list of field names (e.g. "X") to + // FontFamily: Font family such as `Arial`, `Times New Roman`. + // https://www.w3schools.com/cssref/pr_font_font-family.asp + FontFamily string `json:"fontFamily,omitempty"` + + // FontSize: Font size. + FontSize *GoogleCloudDocumentaiV1beta1DocumentStyleFontSize `json:"fontSize,omitempty"` + + // FontWeight: Font weight. Possible values are normal, bold, bolder, + // and lighter. https://www.w3schools.com/cssref/pr_font_weight.asp + FontWeight string `json:"fontWeight,omitempty"` + + // TextAnchor: Text anchor indexing into the Document.text. + TextAnchor *GoogleCloudDocumentaiV1beta1DocumentTextAnchor `json:"textAnchor,omitempty"` + + // TextDecoration: Text decoration. Follows CSS standard. + // https://www.w3schools.com/cssref/pr_text_text-decoration.asp + TextDecoration string `json:"textDecoration,omitempty"` + + // TextStyle: Text style. Possible values are normal, italic, and + // oblique. https://www.w3schools.com/cssref/pr_font_font-style.asp + TextStyle string `json:"textStyle,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BackgroundColor") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -7038,7 +7323,40 @@ type GoogleCloudDocumentaiV1beta1NormalizedVertex struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "X") to include in API + // NullFields is a list of field names (e.g. "BackgroundColor") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDocumentaiV1beta1DocumentStyle) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentStyle + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDocumentaiV1beta1DocumentStyleFontSize: Font size with +// unit. +type GoogleCloudDocumentaiV1beta1DocumentStyleFontSize struct { + // Size: Font size for the text. + Size float64 `json:"size,omitempty"` + + // Unit: Unit for the font size. Follows CSS naming (in, px, pt, etc.). + Unit string `json:"unit,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Size") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Size") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -7047,55 +7365,38 @@ type GoogleCloudDocumentaiV1beta1NormalizedVertex struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1NormalizedVertex) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1NormalizedVertex +func (s *GoogleCloudDocumentaiV1beta1DocumentStyleFontSize) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentStyleFontSize raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *GoogleCloudDocumentaiV1beta1NormalizedVertex) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudDocumentaiV1beta1NormalizedVertex +func (s *GoogleCloudDocumentaiV1beta1DocumentStyleFontSize) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentStyleFontSize var s1 struct { - X gensupport.JSONFloat64 `json:"x"` - Y gensupport.JSONFloat64 `json:"y"` + Size gensupport.JSONFloat64 `json:"size"` *NoMethod } s1.NoMethod = (*NoMethod)(s) if err := json.Unmarshal(data, &s1); err != nil { return err } - s.X = float64(s1.X) - s.Y = float64(s1.Y) + s.Size = float64(s1.Size) return nil } -// GoogleCloudDocumentaiV1beta1OperationMetadata: Contains metadata for -// the BatchProcessDocuments operation. -type GoogleCloudDocumentaiV1beta1OperationMetadata struct { - // CreateTime: The creation time of the operation. - CreateTime string `json:"createTime,omitempty"` - - // State: The state of the current batch processing. - // - // Possible values: - // "STATE_UNSPECIFIED" - The default value. This value is used if the - // state is omitted. - // "ACCEPTED" - Request is received. - // "WAITING" - Request operation is waiting for scheduling. - // "RUNNING" - Request is being processed. - // "SUCCEEDED" - The batch processing completed successfully. - // "CANCELLED" - The batch processing was cancelled. - // "FAILED" - The batch processing has failed. - State string `json:"state,omitempty"` - - // StateMessage: A message providing more details about the current - // state of processing. - StateMessage string `json:"stateMessage,omitempty"` +// GoogleCloudDocumentaiV1beta1DocumentTextAnchor: Text reference +// indexing into the Document.text. +type GoogleCloudDocumentaiV1beta1DocumentTextAnchor struct { + // Content: Contains the content of the text span so that users do not + // have to look it up in the text_segments. It is always populated for + // formFields. + Content string `json:"content,omitempty"` - // UpdateTime: The last update time of the operation. - UpdateTime string `json:"updateTime,omitempty"` + // TextSegments: The text segments from the Document.text. + TextSegments []*GoogleCloudDocumentaiV1beta1DocumentTextAnchorTextSegment `json:"textSegments,omitempty"` - // ForceSendFields is a list of field names (e.g. "CreateTime") to + // ForceSendFields is a list of field names (e.g. "Content") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -7103,7 +7404,7 @@ type GoogleCloudDocumentaiV1beta1OperationMetadata struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CreateTime") to include in + // NullFields is a list of field names (e.g. "Content") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -7112,32 +7413,25 @@ type GoogleCloudDocumentaiV1beta1OperationMetadata struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1OperationMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1OperationMetadata +func (s *GoogleCloudDocumentaiV1beta1DocumentTextAnchor) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentTextAnchor raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1OutputConfig: The desired output location -// and metadata. -type GoogleCloudDocumentaiV1beta1OutputConfig struct { - // GcsDestination: The Google Cloud Storage location to write the output - // to. - GcsDestination *GoogleCloudDocumentaiV1beta1GcsDestination `json:"gcsDestination,omitempty"` +// GoogleCloudDocumentaiV1beta1DocumentTextAnchorTextSegment: A text +// segment in the Document.text. The indices may be out of bounds which +// indicate that the text extends into another document shard for large +// sharded documents. See ShardInfo.text_offset +type GoogleCloudDocumentaiV1beta1DocumentTextAnchorTextSegment struct { + // EndIndex: TextSegment half open end UTF-8 char index in the + // Document.text. + EndIndex int64 `json:"endIndex,omitempty,string"` - // PagesPerShard: The max number of pages to include into each output - // Document shard JSON on Google Cloud Storage. The valid range is [1, - // 100]. If not specified, the default value is 20. For example, for one - // pdf file with 100 pages, 100 parsed pages will be produced. If - // `pages_per_shard` = 20, then 5 Document shard JSON files each - // containing 20 parsed pages will be written under the prefix - // OutputConfig.gcs_destination.uri and suffix pages-x-to-y.json where x - // and y are 1-indexed page numbers. Example GCS outputs with 157 pages - // and pages_per_shard = 50: pages-001-to-050.json pages-051-to-100.json - // pages-101-to-150.json pages-151-to-157.json - PagesPerShard int64 `json:"pagesPerShard,omitempty"` + // StartIndex: TextSegment start UTF-8 char index in the Document.text. + StartIndex int64 `json:"startIndex,omitempty,string"` - // ForceSendFields is a list of field names (e.g. "GcsDestination") to + // ForceSendFields is a list of field names (e.g. "EndIndex") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -7145,35 +7439,39 @@ type GoogleCloudDocumentaiV1beta1OutputConfig struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "GcsDestination") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "EndIndex") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1OutputConfig) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1OutputConfig +func (s *GoogleCloudDocumentaiV1beta1DocumentTextAnchorTextSegment) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentTextAnchorTextSegment raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1ProcessDocumentResponse: Response to a -// single document processing request. -type GoogleCloudDocumentaiV1beta1ProcessDocumentResponse struct { - // InputConfig: Information about the input file. This is the same as - // the corresponding input config in the request. - InputConfig *GoogleCloudDocumentaiV1beta1InputConfig `json:"inputConfig,omitempty"` +// GoogleCloudDocumentaiV1beta1DocumentTextChange: This message is used +// for text changes aka. OCR corrections. +type GoogleCloudDocumentaiV1beta1DocumentTextChange struct { + // ChangedText: The text that replaces the text identified in the + // `text_anchor`. + ChangedText string `json:"changedText,omitempty"` - // OutputConfig: The output location of the parsed responses. The - // responses are written to this location as JSON-serialized `Document` - // objects. - OutputConfig *GoogleCloudDocumentaiV1beta1OutputConfig `json:"outputConfig,omitempty"` + // Provenance: The history of this annotation. + Provenance []*GoogleCloudDocumentaiV1beta1DocumentProvenance `json:"provenance,omitempty"` - // ForceSendFields is a list of field names (e.g. "InputConfig") to + // TextAnchor: Provenance of the correction. Text anchor indexing into + // the Document.text. There can only be a single + // `TextAnchor.text_segments` element. If the start and end index of the + // text segment are the same, the text change is inserted before that + // index. + TextAnchor *GoogleCloudDocumentaiV1beta1DocumentTextAnchor `json:"textAnchor,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ChangedText") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -7181,7 +7479,7 @@ type GoogleCloudDocumentaiV1beta1ProcessDocumentResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "InputConfig") to include + // NullFields is a list of field names (e.g. "ChangedText") to include // in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. However, any field with // an empty value appearing in NullFields will be sent to the server as @@ -7190,23 +7488,18 @@ type GoogleCloudDocumentaiV1beta1ProcessDocumentResponse struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1ProcessDocumentResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1ProcessDocumentResponse +func (s *GoogleCloudDocumentaiV1beta1DocumentTextChange) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1DocumentTextChange raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta1Vertex: A vertex represents a 2D point in -// the image. NOTE: the vertex coordinates are in the same scale as the -// original image. -type GoogleCloudDocumentaiV1beta1Vertex struct { - // X: X coordinate. - X int64 `json:"x,omitempty"` - - // Y: Y coordinate (starts from the top of the image). - Y int64 `json:"y,omitempty"` +// GoogleCloudDocumentaiV1beta1GcsDestination: The Google Cloud Storage +// location where the output file will be written to. +type GoogleCloudDocumentaiV1beta1GcsDestination struct { + Uri string `json:"uri,omitempty"` - // ForceSendFields is a list of field names (e.g. "X") to + // ForceSendFields is a list of field names (e.g. "Uri") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -7214,7 +7507,7 @@ type GoogleCloudDocumentaiV1beta1Vertex struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "X") to include in API + // NullFields is a list of field names (e.g. "Uri") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -7223,38 +7516,18 @@ type GoogleCloudDocumentaiV1beta1Vertex struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta1Vertex) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta1Vertex +func (s *GoogleCloudDocumentaiV1beta1GcsDestination) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1GcsDestination raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2Barcode: Encodes the detailed information -// of a barcode. -type GoogleCloudDocumentaiV1beta2Barcode struct { - // Format: Format of a barcode. The supported formats are: - `CODE_128`: - // Code 128 type. - `CODE_39`: Code 39 type. - `CODE_93`: Code 93 type. - // - `CODABAR`: Codabar type. - `DATA_MATRIX`: 2D Data Matrix type. - - // `ITF`: ITF type. - `EAN_13`: EAN-13 type. - `EAN_8`: EAN-8 type. - - // `QR_CODE`: 2D QR code type. - `UPC_A`: UPC-A type. - `UPC_E`: UPC-E - // type. - `PDF417`: PDF417 type. - `AZTEC`: 2D Aztec code type. - - // `DATABAR`: GS1 DataBar code type. - Format string `json:"format,omitempty"` - - // RawValue: Raw value encoded in the barcode. For example: - // `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`. - RawValue string `json:"rawValue,omitempty"` - - // ValueFormat: Value format describes the format of the value that a - // barcode encodes. The supported formats are: - `CONTACT_INFO`: Contact - // information. - `EMAIL`: Email address. - `ISBN`: ISBN identifier. - - // `PHONE`: Phone number. - `PRODUCT`: Product. - `SMS`: SMS message. - - // `TEXT`: Text string. - `URL`: URL address. - `WIFI`: Wifi - // information. - `GEO`: Geo-localization. - `CALENDAR_EVENT`: Calendar - // event. - `DRIVER_LICENSE`: Driver's license. - ValueFormat string `json:"valueFormat,omitempty"` +// GoogleCloudDocumentaiV1beta1GcsSource: The Google Cloud Storage +// location where the input file will be read from. +type GoogleCloudDocumentaiV1beta1GcsSource struct { + Uri string `json:"uri,omitempty"` - // ForceSendFields is a list of field names (e.g. "Format") to + // ForceSendFields is a list of field names (e.g. "Uri") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -7262,7 +7535,7 @@ type GoogleCloudDocumentaiV1beta2Barcode struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Format") to include in API + // NullFields is a list of field names (e.g. "Uri") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -7271,20 +7544,27 @@ type GoogleCloudDocumentaiV1beta2Barcode struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2Barcode) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2Barcode +func (s *GoogleCloudDocumentaiV1beta1GcsSource) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1GcsSource raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2BatchProcessDocumentsResponse: Response -// to an batch document processing request. This is returned in the LRO -// Operation after the operation is complete. -type GoogleCloudDocumentaiV1beta2BatchProcessDocumentsResponse struct { - // Responses: Responses for each individual document. - Responses []*GoogleCloudDocumentaiV1beta2ProcessDocumentResponse `json:"responses,omitempty"` +// GoogleCloudDocumentaiV1beta1InputConfig: The desired input location +// and metadata. +type GoogleCloudDocumentaiV1beta1InputConfig struct { + // GcsSource: The Google Cloud Storage location to read the input from. + // This must be a single file. + GcsSource *GoogleCloudDocumentaiV1beta1GcsSource `json:"gcsSource,omitempty"` - // ForceSendFields is a list of field names (e.g. "Responses") to + // MimeType: Required. Mimetype of the input. Current supported + // mimetypes are application/pdf, image/tiff, and image/gif. In + // addition, application/json type is supported for requests with + // ProcessDocumentRequest.automl_params field set. The JSON file needs + // to be in Document format. + MimeType string `json:"mimeType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "GcsSource") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -7292,7 +7572,7 @@ type GoogleCloudDocumentaiV1beta2BatchProcessDocumentsResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Responses") to include in + // NullFields is a list of field names (e.g. "GcsSource") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -7301,105 +7581,88 @@ type GoogleCloudDocumentaiV1beta2BatchProcessDocumentsResponse struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2BatchProcessDocumentsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2BatchProcessDocumentsResponse +func (s *GoogleCloudDocumentaiV1beta1InputConfig) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1InputConfig raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2BoundingPoly: A bounding polygon for the -// detected image annotation. -type GoogleCloudDocumentaiV1beta2BoundingPoly struct { - // NormalizedVertices: The bounding polygon normalized vertices. - NormalizedVertices []*GoogleCloudDocumentaiV1beta2NormalizedVertex `json:"normalizedVertices,omitempty"` +// GoogleCloudDocumentaiV1beta1NormalizedVertex: A vertex represents a +// 2D point in the image. NOTE: the normalized vertex coordinates are +// relative to the original image and range from 0 to 1. +type GoogleCloudDocumentaiV1beta1NormalizedVertex struct { + // X: X coordinate. + X float64 `json:"x,omitempty"` - // Vertices: The bounding polygon vertices. - Vertices []*GoogleCloudDocumentaiV1beta2Vertex `json:"vertices,omitempty"` + // Y: Y coordinate (starts from the top of the image). + Y float64 `json:"y,omitempty"` - // ForceSendFields is a list of field names (e.g. "NormalizedVertices") - // to unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "X") to + // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "NormalizedVertices") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "X") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2BoundingPoly) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2BoundingPoly +func (s *GoogleCloudDocumentaiV1beta1NormalizedVertex) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1NormalizedVertex raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2Document: Document represents the -// canonical document resource in Document AI. It is an interchange -// format that provides insights into documents and allows for -// collaboration between users and Document AI to iterate and optimize -// for quality. -type GoogleCloudDocumentaiV1beta2Document struct { - // Content: Optional. Inline document content, represented as a stream - // of bytes. Note: As with all `bytes` fields, protobuffers use a pure - // binary representation, whereas JSON representations use base64. - Content string `json:"content,omitempty"` +func (s *GoogleCloudDocumentaiV1beta1NormalizedVertex) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDocumentaiV1beta1NormalizedVertex + var s1 struct { + X gensupport.JSONFloat64 `json:"x"` + Y gensupport.JSONFloat64 `json:"y"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.X = float64(s1.X) + s.Y = float64(s1.Y) + return nil +} - // Entities: A list of entities detected on Document.text. For document - // shards, entities in this list may cross shard boundaries. - Entities []*GoogleCloudDocumentaiV1beta2DocumentEntity `json:"entities,omitempty"` +// GoogleCloudDocumentaiV1beta1OperationMetadata: Contains metadata for +// the BatchProcessDocuments operation. +type GoogleCloudDocumentaiV1beta1OperationMetadata struct { + // CreateTime: The creation time of the operation. + CreateTime string `json:"createTime,omitempty"` - // EntityRelations: Placeholder. Relationship among Document.entities. - EntityRelations []*GoogleCloudDocumentaiV1beta2DocumentEntityRelation `json:"entityRelations,omitempty"` + // State: The state of the current batch processing. + // + // Possible values: + // "STATE_UNSPECIFIED" - The default value. This value is used if the + // state is omitted. + // "ACCEPTED" - Request is received. + // "WAITING" - Request operation is waiting for scheduling. + // "RUNNING" - Request is being processed. + // "SUCCEEDED" - The batch processing completed successfully. + // "CANCELLED" - The batch processing was cancelled. + // "FAILED" - The batch processing has failed. + State string `json:"state,omitempty"` - // Error: Any error that occurred while processing this document. - Error *GoogleRpcStatus `json:"error,omitempty"` + // StateMessage: A message providing more details about the current + // state of processing. + StateMessage string `json:"stateMessage,omitempty"` - // Labels: Labels for this document. - Labels []*GoogleCloudDocumentaiV1beta2DocumentLabel `json:"labels,omitempty"` - - // MimeType: An IANA published MIME type (also referred to as media - // type). For more information, see - // https://www.iana.org/assignments/media-types/media-types.xhtml. - MimeType string `json:"mimeType,omitempty"` - - // Pages: Visual page layout for the Document. - Pages []*GoogleCloudDocumentaiV1beta2DocumentPage `json:"pages,omitempty"` - - // Revisions: Placeholder. Revision history of this document. - Revisions []*GoogleCloudDocumentaiV1beta2DocumentRevision `json:"revisions,omitempty"` - - // ShardInfo: Information about the sharding if this document is sharded - // part of a larger document. If the document is not sharded, this - // message is not specified. - ShardInfo *GoogleCloudDocumentaiV1beta2DocumentShardInfo `json:"shardInfo,omitempty"` - - // Text: Optional. UTF-8 encoded text in reading order from the - // document. - Text string `json:"text,omitempty"` - - // TextChanges: Placeholder. A list of text corrections made to - // Document.text. This is usually used for annotating corrections to OCR - // mistakes. Text changes for a given revision may not overlap with each - // other. - TextChanges []*GoogleCloudDocumentaiV1beta2DocumentTextChange `json:"textChanges,omitempty"` - - // TextStyles: Styles for the Document.text. - TextStyles []*GoogleCloudDocumentaiV1beta2DocumentStyle `json:"textStyles,omitempty"` - - // Uri: Optional. Currently supports Google Cloud Storage URI of the - // form `gs://bucket_name/object_name`. Object versioning is not - // supported. See Google Cloud Storage Request URIs - // (https://cloud.google.com/storage/docs/reference-uris) for more info. - Uri string `json:"uri,omitempty"` + // UpdateTime: The last update time of the operation. + UpdateTime string `json:"updateTime,omitempty"` - // ForceSendFields is a list of field names (e.g. "Content") to + // ForceSendFields is a list of field names (e.g. "CreateTime") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -7407,7 +7670,7 @@ type GoogleCloudDocumentaiV1beta2Document struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Content") to include in + // NullFields is a list of field names (e.g. "CreateTime") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -7416,60 +7679,32 @@ type GoogleCloudDocumentaiV1beta2Document struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2Document) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2Document +func (s *GoogleCloudDocumentaiV1beta1OperationMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1OperationMetadata raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2DocumentEntity: An entity that could be a -// phrase in the text or a property that belongs to the document. It is -// a known entity type, such as a person, an organization, or location. -type GoogleCloudDocumentaiV1beta2DocumentEntity struct { - // Confidence: Optional. Confidence of detected Schema entity. Range - // `[0, 1]`. - Confidence float64 `json:"confidence,omitempty"` - - // Id: Optional. Canonical id. This will be a unique value in the entity - // list for this document. - Id string `json:"id,omitempty"` - - // MentionId: Optional. Deprecated. Use `id` field instead. - MentionId string `json:"mentionId,omitempty"` - - // MentionText: Optional. Text value of the entity e.g. `1600 - // Amphitheatre Pkwy`. - MentionText string `json:"mentionText,omitempty"` - - // NormalizedValue: Optional. Normalized entity value. Absent if the - // extracted value could not be converted or the type (e.g. address) is - // not supported for certain parsers. This field is also only populated - // for certain supported document types. - NormalizedValue *GoogleCloudDocumentaiV1beta2DocumentEntityNormalizedValue `json:"normalizedValue,omitempty"` - - // PageAnchor: Optional. Represents the provenance of this entity wrt. - // the location on the page where it was found. - PageAnchor *GoogleCloudDocumentaiV1beta2DocumentPageAnchor `json:"pageAnchor,omitempty"` - - // Properties: Optional. Entities can be nested to form a hierarchical - // data structure representing the content in the document. - Properties []*GoogleCloudDocumentaiV1beta2DocumentEntity `json:"properties,omitempty"` - - // Provenance: Optional. The history of this annotation. - Provenance *GoogleCloudDocumentaiV1beta2DocumentProvenance `json:"provenance,omitempty"` - - // Redacted: Optional. Whether the entity will be redacted for - // de-identification purposes. - Redacted bool `json:"redacted,omitempty"` - - // TextAnchor: Optional. Provenance of the entity. Text anchor indexing - // into the Document.text. - TextAnchor *GoogleCloudDocumentaiV1beta2DocumentTextAnchor `json:"textAnchor,omitempty"` +// GoogleCloudDocumentaiV1beta1OutputConfig: The desired output location +// and metadata. +type GoogleCloudDocumentaiV1beta1OutputConfig struct { + // GcsDestination: The Google Cloud Storage location to write the output + // to. + GcsDestination *GoogleCloudDocumentaiV1beta1GcsDestination `json:"gcsDestination,omitempty"` - // Type: Required. Entity type from a schema e.g. `Address`. - Type string `json:"type,omitempty"` + // PagesPerShard: The max number of pages to include into each output + // Document shard JSON on Google Cloud Storage. The valid range is [1, + // 100]. If not specified, the default value is 20. For example, for one + // pdf file with 100 pages, 100 parsed pages will be produced. If + // `pages_per_shard` = 20, then 5 Document shard JSON files each + // containing 20 parsed pages will be written under the prefix + // OutputConfig.gcs_destination.uri and suffix pages-x-to-y.json where x + // and y are 1-indexed page numbers. Example GCS outputs with 157 pages + // and pages_per_shard = 50: pages-001-to-050.json pages-051-to-100.json + // pages-101-to-150.json pages-151-to-157.json + PagesPerShard int64 `json:"pagesPerShard,omitempty"` - // ForceSendFields is a list of field names (e.g. "Confidence") to + // ForceSendFields is a list of field names (e.g. "GcsDestination") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -7477,77 +7712,35 @@ type GoogleCloudDocumentaiV1beta2DocumentEntity struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Confidence") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "GcsDestination") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentEntity) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentEntity +func (s *GoogleCloudDocumentaiV1beta1OutputConfig) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1OutputConfig raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *GoogleCloudDocumentaiV1beta2DocumentEntity) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentEntity - var s1 struct { - Confidence gensupport.JSONFloat64 `json:"confidence"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.Confidence = float64(s1.Confidence) - return nil -} - -// GoogleCloudDocumentaiV1beta2DocumentEntityNormalizedValue: Parsed and -// normalized entity value. -type GoogleCloudDocumentaiV1beta2DocumentEntityNormalizedValue struct { - // AddressValue: Postal address. See also: - // https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto - AddressValue *GoogleTypePostalAddress `json:"addressValue,omitempty"` - - // BooleanValue: Boolean value. Can be used for entities with binary - // values, or for checkboxes. - BooleanValue bool `json:"booleanValue,omitempty"` - - // DateValue: Date value. Includes year, month, day. See also: - // https://github.com/googleapis/googleapis/blob/master/google/type/date.proto - DateValue *GoogleTypeDate `json:"dateValue,omitempty"` - - // DatetimeValue: DateTime value. Includes date, time, and timezone. See - // also: - // https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto - DatetimeValue *GoogleTypeDateTime `json:"datetimeValue,omitempty"` - - // FloatValue: Float value. - FloatValue float64 `json:"floatValue,omitempty"` - - // IntegerValue: Integer value. - IntegerValue int64 `json:"integerValue,omitempty"` - - // MoneyValue: Money value. See also: - // https://github.com/googleapis/googleapis/blob/master/google/type/money.proto - MoneyValue *GoogleTypeMoney `json:"moneyValue,omitempty"` +// GoogleCloudDocumentaiV1beta1ProcessDocumentResponse: Response to a +// single document processing request. +type GoogleCloudDocumentaiV1beta1ProcessDocumentResponse struct { + // InputConfig: Information about the input file. This is the same as + // the corresponding input config in the request. + InputConfig *GoogleCloudDocumentaiV1beta1InputConfig `json:"inputConfig,omitempty"` - // Text: Optional. An optional field to store a normalized string. For - // some entity types, one of respective `structured_value` fields may - // also be populated. Also not all the types of `structured_value` will - // be normalized. For example, some processors may not generate `float` - // or `integer` normalized text by default. Below are sample formats - // mapped to structured values. - Money/Currency type (`money_value`) is - // in the ISO 4217 text format. - Date type (`date_value`) is in the ISO - // 8601 text format. - Datetime type (`datetime_value`) is in the ISO - // 8601 text format. - Text string `json:"text,omitempty"` + // OutputConfig: The output location of the parsed responses. The + // responses are written to this location as JSON-serialized `Document` + // objects. + OutputConfig *GoogleCloudDocumentaiV1beta1OutputConfig `json:"outputConfig,omitempty"` - // ForceSendFields is a list of field names (e.g. "AddressValue") to + // ForceSendFields is a list of field names (e.g. "InputConfig") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -7555,7 +7748,7 @@ type GoogleCloudDocumentaiV1beta2DocumentEntityNormalizedValue struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AddressValue") to include + // NullFields is a list of field names (e.g. "InputConfig") to include // in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. However, any field with // an empty value appearing in NullFields will be sent to the server as @@ -7564,39 +7757,23 @@ type GoogleCloudDocumentaiV1beta2DocumentEntityNormalizedValue struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentEntityNormalizedValue) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentEntityNormalizedValue +func (s *GoogleCloudDocumentaiV1beta1ProcessDocumentResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1ProcessDocumentResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *GoogleCloudDocumentaiV1beta2DocumentEntityNormalizedValue) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentEntityNormalizedValue - var s1 struct { - FloatValue gensupport.JSONFloat64 `json:"floatValue"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.FloatValue = float64(s1.FloatValue) - return nil -} - -// GoogleCloudDocumentaiV1beta2DocumentEntityRelation: Relationship -// between Entities. -type GoogleCloudDocumentaiV1beta2DocumentEntityRelation struct { - // ObjectId: Object entity id. - ObjectId string `json:"objectId,omitempty"` - - // Relation: Relationship description. - Relation string `json:"relation,omitempty"` +// GoogleCloudDocumentaiV1beta1Vertex: A vertex represents a 2D point in +// the image. NOTE: the vertex coordinates are in the same scale as the +// original image. +type GoogleCloudDocumentaiV1beta1Vertex struct { + // X: X coordinate. + X int64 `json:"x,omitempty"` - // SubjectId: Subject entity id. - SubjectId string `json:"subjectId,omitempty"` + // Y: Y coordinate (starts from the top of the image). + Y int64 `json:"y,omitempty"` - // ForceSendFields is a list of field names (e.g. "ObjectId") to + // ForceSendFields is a list of field names (e.g. "X") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -7604,8 +7781,8 @@ type GoogleCloudDocumentaiV1beta2DocumentEntityRelation struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ObjectId") to include in - // API requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "X") to include in API + // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -7613,132 +7790,38 @@ type GoogleCloudDocumentaiV1beta2DocumentEntityRelation struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentEntityRelation) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentEntityRelation +func (s *GoogleCloudDocumentaiV1beta1Vertex) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta1Vertex raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2DocumentLabel: Label attaches schema -// information and/or other metadata to segments within a Document. -// Multiple Labels on a single field can denote either different labels, -// different instances of the same label created at different times, or -// some combination of both. -type GoogleCloudDocumentaiV1beta2DocumentLabel struct { - // AutomlModel: Label is generated AutoML model. This field stores the - // full resource name of the AutoML model. Format: - // `projects/{project-id}/locations/{location-id}/models/{model-id}` - AutomlModel string `json:"automlModel,omitempty"` - - // Confidence: Confidence score between 0 and 1 for label assignment. - Confidence float64 `json:"confidence,omitempty"` - - // Name: Name of the label. When the label is generated from AutoML Text - // Classification model, this field represents the name of the category. - Name string `json:"name,omitempty"` - - // ForceSendFields is a list of field names (e.g. "AutomlModel") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "AutomlModel") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudDocumentaiV1beta2DocumentLabel) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentLabel - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -func (s *GoogleCloudDocumentaiV1beta2DocumentLabel) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentLabel - var s1 struct { - Confidence gensupport.JSONFloat64 `json:"confidence"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.Confidence = float64(s1.Confidence) - return nil -} - -// GoogleCloudDocumentaiV1beta2DocumentPage: A page in a Document. -type GoogleCloudDocumentaiV1beta2DocumentPage struct { - // Blocks: A list of visually detected text blocks on the page. A block - // has a set of lines (collected into paragraphs) that have a common - // line-spacing and orientation. - Blocks []*GoogleCloudDocumentaiV1beta2DocumentPageBlock `json:"blocks,omitempty"` - - // DetectedBarcodes: A list of detected barcodes. - DetectedBarcodes []*GoogleCloudDocumentaiV1beta2DocumentPageDetectedBarcode `json:"detectedBarcodes,omitempty"` - - // DetectedLanguages: A list of detected languages together with - // confidence. - DetectedLanguages []*GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` - - // Dimension: Physical dimension of the page. - Dimension *GoogleCloudDocumentaiV1beta2DocumentPageDimension `json:"dimension,omitempty"` - - // FormFields: A list of visually detected form fields on the page. - FormFields []*GoogleCloudDocumentaiV1beta2DocumentPageFormField `json:"formFields,omitempty"` - - // Image: Rendered image for this page. This image is preprocessed to - // remove any skew, rotation, and distortions such that the annotation - // bounding boxes can be upright and axis-aligned. - Image *GoogleCloudDocumentaiV1beta2DocumentPageImage `json:"image,omitempty"` - - // ImageQualityScores: Image Quality Scores. - ImageQualityScores *GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScores `json:"imageQualityScores,omitempty"` - - // Layout: Layout for the page. - Layout *GoogleCloudDocumentaiV1beta2DocumentPageLayout `json:"layout,omitempty"` - - // Lines: A list of visually detected text lines on the page. A - // collection of tokens that a human would perceive as a line. - Lines []*GoogleCloudDocumentaiV1beta2DocumentPageLine `json:"lines,omitempty"` - - // PageNumber: 1-based index for current Page in a parent Document. - // Useful when a page is taken out of a Document for individual - // processing. - PageNumber int64 `json:"pageNumber,omitempty"` - - // Paragraphs: A list of visually detected text paragraphs on the page. - // A collection of lines that a human would perceive as a paragraph. - Paragraphs []*GoogleCloudDocumentaiV1beta2DocumentPageParagraph `json:"paragraphs,omitempty"` - - // Provenance: The history of this page. - Provenance *GoogleCloudDocumentaiV1beta2DocumentProvenance `json:"provenance,omitempty"` - - // Symbols: A list of visually detected symbols on the page. - Symbols []*GoogleCloudDocumentaiV1beta2DocumentPageSymbol `json:"symbols,omitempty"` - - // Tables: A list of visually detected tables on the page. - Tables []*GoogleCloudDocumentaiV1beta2DocumentPageTable `json:"tables,omitempty"` - - // Tokens: A list of visually detected tokens on the page. - Tokens []*GoogleCloudDocumentaiV1beta2DocumentPageToken `json:"tokens,omitempty"` +// GoogleCloudDocumentaiV1beta2Barcode: Encodes the detailed information +// of a barcode. +type GoogleCloudDocumentaiV1beta2Barcode struct { + // Format: Format of a barcode. The supported formats are: - `CODE_128`: + // Code 128 type. - `CODE_39`: Code 39 type. - `CODE_93`: Code 93 type. + // - `CODABAR`: Codabar type. - `DATA_MATRIX`: 2D Data Matrix type. - + // `ITF`: ITF type. - `EAN_13`: EAN-13 type. - `EAN_8`: EAN-8 type. - + // `QR_CODE`: 2D QR code type. - `UPC_A`: UPC-A type. - `UPC_E`: UPC-E + // type. - `PDF417`: PDF417 type. - `AZTEC`: 2D Aztec code type. - + // `DATABAR`: GS1 DataBar code type. + Format string `json:"format,omitempty"` - // Transforms: Transformation matrices that were applied to the original - // document image to produce Page.image. - Transforms []*GoogleCloudDocumentaiV1beta2DocumentPageMatrix `json:"transforms,omitempty"` + // RawValue: Raw value encoded in the barcode. For example: + // `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`. + RawValue string `json:"rawValue,omitempty"` - // VisualElements: A list of detected non-text visual elements e.g. - // checkbox, signature etc. on the page. - VisualElements []*GoogleCloudDocumentaiV1beta2DocumentPageVisualElement `json:"visualElements,omitempty"` + // ValueFormat: Value format describes the format of the value that a + // barcode encodes. The supported formats are: - `CONTACT_INFO`: Contact + // information. - `EMAIL`: Email address. - `ISBN`: ISBN identifier. - + // `PHONE`: Phone number. - `PRODUCT`: Product. - `SMS`: SMS message. - + // `TEXT`: Text string. - `URL`: URL address. - `WIFI`: Wifi + // information. - `GEO`: Geo-localization. - `CALENDAR_EVENT`: Calendar + // event. - `DRIVER_LICENSE`: Driver's license. + ValueFormat string `json:"valueFormat,omitempty"` - // ForceSendFields is a list of field names (e.g. "Blocks") to + // ForceSendFields is a list of field names (e.g. "Format") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -7746,7 +7829,7 @@ type GoogleCloudDocumentaiV1beta2DocumentPage struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Blocks") to include in API + // NullFields is a list of field names (e.g. "Format") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -7755,21 +7838,20 @@ type GoogleCloudDocumentaiV1beta2DocumentPage struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentPage) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentPage +func (s *GoogleCloudDocumentaiV1beta2Barcode) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2Barcode raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2DocumentPageAnchor: Referencing the -// visual context of the entity in the Document.pages. Page anchors can -// be cross-page, consist of multiple bounding polygons and optionally -// reference specific layout element types. -type GoogleCloudDocumentaiV1beta2DocumentPageAnchor struct { - // PageRefs: One or more references to visual page elements - PageRefs []*GoogleCloudDocumentaiV1beta2DocumentPageAnchorPageRef `json:"pageRefs,omitempty"` +// GoogleCloudDocumentaiV1beta2BatchProcessDocumentsResponse: Response +// to an batch document processing request. This is returned in the LRO +// Operation after the operation is complete. +type GoogleCloudDocumentaiV1beta2BatchProcessDocumentsResponse struct { + // Responses: Responses for each individual document. + Responses []*GoogleCloudDocumentaiV1beta2ProcessDocumentResponse `json:"responses,omitempty"` - // ForceSendFields is a list of field names (e.g. "PageRefs") to + // ForceSendFields is a list of field names (e.g. "Responses") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -7777,7 +7859,7 @@ type GoogleCloudDocumentaiV1beta2DocumentPageAnchor struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "PageRefs") to include in + // NullFields is a list of field names (e.g. "Responses") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -7786,98 +7868,22 @@ type GoogleCloudDocumentaiV1beta2DocumentPageAnchor struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentPageAnchor) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageAnchor - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// GoogleCloudDocumentaiV1beta2DocumentPageAnchorPageRef: Represents a -// weak reference to a page element within a document. -type GoogleCloudDocumentaiV1beta2DocumentPageAnchorPageRef struct { - // BoundingPoly: Optional. Identifies the bounding polygon of a layout - // element on the page. - BoundingPoly *GoogleCloudDocumentaiV1beta2BoundingPoly `json:"boundingPoly,omitempty"` - - // Confidence: Optional. Confidence of detected page element, if - // applicable. Range `[0, 1]`. - Confidence float64 `json:"confidence,omitempty"` - - // LayoutId: Optional. Deprecated. Use PageRef.bounding_poly instead. - LayoutId string `json:"layoutId,omitempty"` - - // LayoutType: Optional. The type of the layout element that is being - // referenced if any. - // - // Possible values: - // "LAYOUT_TYPE_UNSPECIFIED" - Layout Unspecified. - // "BLOCK" - References a Page.blocks element. - // "PARAGRAPH" - References a Page.paragraphs element. - // "LINE" - References a Page.lines element. - // "TOKEN" - References a Page.tokens element. - // "VISUAL_ELEMENT" - References a Page.visual_elements element. - // "TABLE" - Refrrences a Page.tables element. - // "FORM_FIELD" - References a Page.form_fields element. - LayoutType string `json:"layoutType,omitempty"` - - // Page: Required. Index into the Document.pages element, for example - // using `Document.pages` to locate the related page element. This field - // is skipped when its value is the default `0`. See - // https://developers.google.com/protocol-buffers/docs/proto3#json. - Page int64 `json:"page,omitempty,string"` - - // ForceSendFields is a list of field names (e.g. "BoundingPoly") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "BoundingPoly") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudDocumentaiV1beta2DocumentPageAnchorPageRef) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageAnchorPageRef +func (s *GoogleCloudDocumentaiV1beta2BatchProcessDocumentsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2BatchProcessDocumentsResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *GoogleCloudDocumentaiV1beta2DocumentPageAnchorPageRef) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageAnchorPageRef - var s1 struct { - Confidence gensupport.JSONFloat64 `json:"confidence"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.Confidence = float64(s1.Confidence) - return nil -} - -// GoogleCloudDocumentaiV1beta2DocumentPageBlock: A block has a set of -// lines (collected into paragraphs) that have a common line-spacing and -// orientation. -type GoogleCloudDocumentaiV1beta2DocumentPageBlock struct { - // DetectedLanguages: A list of detected languages together with - // confidence. - DetectedLanguages []*GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` - - // Layout: Layout for Block. - Layout *GoogleCloudDocumentaiV1beta2DocumentPageLayout `json:"layout,omitempty"` +// GoogleCloudDocumentaiV1beta2BoundingPoly: A bounding polygon for the +// detected image annotation. +type GoogleCloudDocumentaiV1beta2BoundingPoly struct { + // NormalizedVertices: The bounding polygon normalized vertices. + NormalizedVertices []*GoogleCloudDocumentaiV1beta2NormalizedVertex `json:"normalizedVertices,omitempty"` - // Provenance: The history of this annotation. - Provenance *GoogleCloudDocumentaiV1beta2DocumentProvenance `json:"provenance,omitempty"` + // Vertices: The bounding polygon vertices. + Vertices []*GoogleCloudDocumentaiV1beta2Vertex `json:"vertices,omitempty"` - // ForceSendFields is a list of field names (e.g. "DetectedLanguages") + // ForceSendFields is a list of field names (e.g. "NormalizedVertices") // to unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -7885,7 +7891,7 @@ type GoogleCloudDocumentaiV1beta2DocumentPageBlock struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DetectedLanguages") to + // NullFields is a list of field names (e.g. "NormalizedVertices") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the @@ -7895,22 +7901,72 @@ type GoogleCloudDocumentaiV1beta2DocumentPageBlock struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentPageBlock) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageBlock +func (s *GoogleCloudDocumentaiV1beta2BoundingPoly) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2BoundingPoly raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2DocumentPageDetectedBarcode: A detected -// barcode. -type GoogleCloudDocumentaiV1beta2DocumentPageDetectedBarcode struct { - // Barcode: Detailed barcode information of the DetectedBarcode. - Barcode *GoogleCloudDocumentaiV1beta2Barcode `json:"barcode,omitempty"` - - // Layout: Layout for DetectedBarcode. - Layout *GoogleCloudDocumentaiV1beta2DocumentPageLayout `json:"layout,omitempty"` +// GoogleCloudDocumentaiV1beta2Document: Document represents the +// canonical document resource in Document AI. It is an interchange +// format that provides insights into documents and allows for +// collaboration between users and Document AI to iterate and optimize +// for quality. +type GoogleCloudDocumentaiV1beta2Document struct { + // Content: Optional. Inline document content, represented as a stream + // of bytes. Note: As with all `bytes` fields, protobuffers use a pure + // binary representation, whereas JSON representations use base64. + Content string `json:"content,omitempty"` - // ForceSendFields is a list of field names (e.g. "Barcode") to + // Entities: A list of entities detected on Document.text. For document + // shards, entities in this list may cross shard boundaries. + Entities []*GoogleCloudDocumentaiV1beta2DocumentEntity `json:"entities,omitempty"` + + // EntityRelations: Placeholder. Relationship among Document.entities. + EntityRelations []*GoogleCloudDocumentaiV1beta2DocumentEntityRelation `json:"entityRelations,omitempty"` + + // Error: Any error that occurred while processing this document. + Error *GoogleRpcStatus `json:"error,omitempty"` + + // Labels: Labels for this document. + Labels []*GoogleCloudDocumentaiV1beta2DocumentLabel `json:"labels,omitempty"` + + // MimeType: An IANA published MIME type (also referred to as media + // type). For more information, see + // https://www.iana.org/assignments/media-types/media-types.xhtml. + MimeType string `json:"mimeType,omitempty"` + + // Pages: Visual page layout for the Document. + Pages []*GoogleCloudDocumentaiV1beta2DocumentPage `json:"pages,omitempty"` + + // Revisions: Placeholder. Revision history of this document. + Revisions []*GoogleCloudDocumentaiV1beta2DocumentRevision `json:"revisions,omitempty"` + + // ShardInfo: Information about the sharding if this document is sharded + // part of a larger document. If the document is not sharded, this + // message is not specified. + ShardInfo *GoogleCloudDocumentaiV1beta2DocumentShardInfo `json:"shardInfo,omitempty"` + + // Text: Optional. UTF-8 encoded text in reading order from the + // document. + Text string `json:"text,omitempty"` + + // TextChanges: Placeholder. A list of text corrections made to + // Document.text. This is usually used for annotating corrections to OCR + // mistakes. Text changes for a given revision may not overlap with each + // other. + TextChanges []*GoogleCloudDocumentaiV1beta2DocumentTextChange `json:"textChanges,omitempty"` + + // TextStyles: Styles for the Document.text. + TextStyles []*GoogleCloudDocumentaiV1beta2DocumentStyle `json:"textStyles,omitempty"` + + // Uri: Optional. Currently supports Google Cloud Storage URI of the + // form `gs://bucket_name/object_name`. Object versioning is not + // supported. See Google Cloud Storage Request URIs + // (https://cloud.google.com/storage/docs/reference-uris) for more info. + Uri string `json:"uri,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Content") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -7918,7 +7974,7 @@ type GoogleCloudDocumentaiV1beta2DocumentPageDetectedBarcode struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Barcode") to include in + // NullFields is a list of field names (e.g. "Content") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -7927,22 +7983,58 @@ type GoogleCloudDocumentaiV1beta2DocumentPageDetectedBarcode struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentPageDetectedBarcode) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageDetectedBarcode +func (s *GoogleCloudDocumentaiV1beta2Document) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2Document raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage: Detected -// language for a structural component. -type GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage struct { - // Confidence: Confidence of detected language. Range `[0, 1]`. +// GoogleCloudDocumentaiV1beta2DocumentEntity: An entity that could be a +// phrase in the text or a property that belongs to the document. It is +// a known entity type, such as a person, an organization, or location. +type GoogleCloudDocumentaiV1beta2DocumentEntity struct { + // Confidence: Optional. Confidence of detected Schema entity. Range + // `[0, 1]`. Confidence float64 `json:"confidence,omitempty"` - // LanguageCode: The BCP-47 language code, such as `en-US` or `sr-Latn`. - // For more information, see - // https://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - LanguageCode string `json:"languageCode,omitempty"` + // Id: Optional. Canonical id. This will be a unique value in the entity + // list for this document. + Id string `json:"id,omitempty"` + + // MentionId: Optional. Deprecated. Use `id` field instead. + MentionId string `json:"mentionId,omitempty"` + + // MentionText: Optional. Text value of the entity e.g. `1600 + // Amphitheatre Pkwy`. + MentionText string `json:"mentionText,omitempty"` + + // NormalizedValue: Optional. Normalized entity value. Absent if the + // extracted value could not be converted or the type (e.g. address) is + // not supported for certain parsers. This field is also only populated + // for certain supported document types. + NormalizedValue *GoogleCloudDocumentaiV1beta2DocumentEntityNormalizedValue `json:"normalizedValue,omitempty"` + + // PageAnchor: Optional. Represents the provenance of this entity wrt. + // the location on the page where it was found. + PageAnchor *GoogleCloudDocumentaiV1beta2DocumentPageAnchor `json:"pageAnchor,omitempty"` + + // Properties: Optional. Entities can be nested to form a hierarchical + // data structure representing the content in the document. + Properties []*GoogleCloudDocumentaiV1beta2DocumentEntity `json:"properties,omitempty"` + + // Provenance: Optional. The history of this annotation. + Provenance *GoogleCloudDocumentaiV1beta2DocumentProvenance `json:"provenance,omitempty"` + + // Redacted: Optional. Whether the entity will be redacted for + // de-identification purposes. + Redacted bool `json:"redacted,omitempty"` + + // TextAnchor: Optional. Provenance of the entity. Text anchor indexing + // into the Document.text. + TextAnchor *GoogleCloudDocumentaiV1beta2DocumentTextAnchor `json:"textAnchor,omitempty"` + + // Type: Required. Entity type from a schema e.g. `Address`. + Type string `json:"type,omitempty"` // ForceSendFields is a list of field names (e.g. "Confidence") to // unconditionally include in API requests. By default, fields with @@ -7961,14 +8053,14 @@ type GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage +func (s *GoogleCloudDocumentaiV1beta2DocumentEntity) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentEntity raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage +func (s *GoogleCloudDocumentaiV1beta2DocumentEntity) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentEntity var s1 struct { Confidence gensupport.JSONFloat64 `json:"confidence"` *NoMethod @@ -7981,19 +8073,48 @@ func (s *GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage) UnmarshalJSON return nil } -// GoogleCloudDocumentaiV1beta2DocumentPageDimension: Dimension for the -// page. -type GoogleCloudDocumentaiV1beta2DocumentPageDimension struct { - // Height: Page height. - Height float64 `json:"height,omitempty"` +// GoogleCloudDocumentaiV1beta2DocumentEntityNormalizedValue: Parsed and +// normalized entity value. +type GoogleCloudDocumentaiV1beta2DocumentEntityNormalizedValue struct { + // AddressValue: Postal address. See also: + // https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto + AddressValue *GoogleTypePostalAddress `json:"addressValue,omitempty"` - // Unit: Dimension unit. - Unit string `json:"unit,omitempty"` + // BooleanValue: Boolean value. Can be used for entities with binary + // values, or for checkboxes. + BooleanValue bool `json:"booleanValue,omitempty"` - // Width: Page width. - Width float64 `json:"width,omitempty"` + // DateValue: Date value. Includes year, month, day. See also: + // https://github.com/googleapis/googleapis/blob/master/google/type/date.proto + DateValue *GoogleTypeDate `json:"dateValue,omitempty"` - // ForceSendFields is a list of field names (e.g. "Height") to + // DatetimeValue: DateTime value. Includes date, time, and timezone. See + // also: + // https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto + DatetimeValue *GoogleTypeDateTime `json:"datetimeValue,omitempty"` + + // FloatValue: Float value. + FloatValue float64 `json:"floatValue,omitempty"` + + // IntegerValue: Integer value. + IntegerValue int64 `json:"integerValue,omitempty"` + + // MoneyValue: Money value. See also: + // https://github.com/googleapis/googleapis/blob/master/google/type/money.proto + MoneyValue *GoogleTypeMoney `json:"moneyValue,omitempty"` + + // Text: Optional. An optional field to store a normalized string. For + // some entity types, one of respective `structured_value` fields may + // also be populated. Also not all the types of `structured_value` will + // be normalized. For example, some processors may not generate `float` + // or `integer` normalized text by default. Below are sample formats + // mapped to structured values. - Money/Currency type (`money_value`) is + // in the ISO 4217 text format. - Date type (`date_value`) is in the ISO + // 8601 text format. - Datetime type (`datetime_value`) is in the ISO + // 8601 text format. + Text string `json:"text,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AddressValue") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -8001,75 +8122,48 @@ type GoogleCloudDocumentaiV1beta2DocumentPageDimension struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Height") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "AddressValue") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentPageDimension) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageDimension +func (s *GoogleCloudDocumentaiV1beta2DocumentEntityNormalizedValue) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentEntityNormalizedValue raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *GoogleCloudDocumentaiV1beta2DocumentPageDimension) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageDimension +func (s *GoogleCloudDocumentaiV1beta2DocumentEntityNormalizedValue) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentEntityNormalizedValue var s1 struct { - Height gensupport.JSONFloat64 `json:"height"` - Width gensupport.JSONFloat64 `json:"width"` + FloatValue gensupport.JSONFloat64 `json:"floatValue"` *NoMethod } s1.NoMethod = (*NoMethod)(s) if err := json.Unmarshal(data, &s1); err != nil { return err } - s.Height = float64(s1.Height) - s.Width = float64(s1.Width) + s.FloatValue = float64(s1.FloatValue) return nil } -// GoogleCloudDocumentaiV1beta2DocumentPageFormField: A form field -// detected on the page. -type GoogleCloudDocumentaiV1beta2DocumentPageFormField struct { - // CorrectedKeyText: Created for Labeling UI to export key text. If - // corrections were made to the text identified by the - // `field_name.text_anchor`, this field will contain the correction. - CorrectedKeyText string `json:"correctedKeyText,omitempty"` - - // CorrectedValueText: Created for Labeling UI to export value text. If - // corrections were made to the text identified by the - // `field_value.text_anchor`, this field will contain the correction. - CorrectedValueText string `json:"correctedValueText,omitempty"` - - // FieldName: Layout for the FormField name. e.g. `Address`, `Email`, - // `Grand total`, `Phone number`, etc. - FieldName *GoogleCloudDocumentaiV1beta2DocumentPageLayout `json:"fieldName,omitempty"` - - // FieldValue: Layout for the FormField value. - FieldValue *GoogleCloudDocumentaiV1beta2DocumentPageLayout `json:"fieldValue,omitempty"` - - // NameDetectedLanguages: A list of detected languages for name together - // with confidence. - NameDetectedLanguages []*GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage `json:"nameDetectedLanguages,omitempty"` - - // Provenance: The history of this annotation. - Provenance *GoogleCloudDocumentaiV1beta2DocumentProvenance `json:"provenance,omitempty"` +// GoogleCloudDocumentaiV1beta2DocumentEntityRelation: Relationship +// between Entities. +type GoogleCloudDocumentaiV1beta2DocumentEntityRelation struct { + // ObjectId: Object entity id. + ObjectId string `json:"objectId,omitempty"` - // ValueDetectedLanguages: A list of detected languages for value - // together with confidence. - ValueDetectedLanguages []*GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage `json:"valueDetectedLanguages,omitempty"` + // Relation: Relationship description. + Relation string `json:"relation,omitempty"` - // ValueType: If the value is non-textual, this field represents the - // type. Current valid values are: - blank (this indicates the - // `field_value` is normal text) - `unfilled_checkbox` - - // `filled_checkbox` - ValueType string `json:"valueType,omitempty"` + // SubjectId: Subject entity id. + SubjectId string `json:"subjectId,omitempty"` - // ForceSendFields is a list of field names (e.g. "CorrectedKeyText") to + // ForceSendFields is a list of field names (e.g. "ObjectId") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -8077,38 +8171,40 @@ type GoogleCloudDocumentaiV1beta2DocumentPageFormField struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CorrectedKeyText") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "ObjectId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentPageFormField) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageFormField +func (s *GoogleCloudDocumentaiV1beta2DocumentEntityRelation) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentEntityRelation raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2DocumentPageImage: Rendered image -// contents for this page. -type GoogleCloudDocumentaiV1beta2DocumentPageImage struct { - // Content: Raw byte content of the image. - Content string `json:"content,omitempty"` - - // Height: Height of the image in pixels. - Height int64 `json:"height,omitempty"` +// GoogleCloudDocumentaiV1beta2DocumentLabel: Label attaches schema +// information and/or other metadata to segments within a Document. +// Multiple Labels on a single field can denote either different labels, +// different instances of the same label created at different times, or +// some combination of both. +type GoogleCloudDocumentaiV1beta2DocumentLabel struct { + // AutomlModel: Label is generated AutoML model. This field stores the + // full resource name of the AutoML model. Format: + // `projects/{project-id}/locations/{location-id}/models/{model-id}` + AutomlModel string `json:"automlModel,omitempty"` - // MimeType: Encoding mime type for the image. - MimeType string `json:"mimeType,omitempty"` + // Confidence: Confidence score between 0 and 1 for label assignment. + Confidence float64 `json:"confidence,omitempty"` - // Width: Width of the image in pixels. - Width int64 `json:"width,omitempty"` + // Name: Name of the label. When the label is generated from AutoML Text + // Classification model, this field represents the name of the category. + Name string `json:"name,omitempty"` - // ForceSendFields is a list of field names (e.g. "Content") to + // ForceSendFields is a list of field names (e.g. "AutomlModel") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -8116,32 +8212,100 @@ type GoogleCloudDocumentaiV1beta2DocumentPageImage struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Content") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "AutomlModel") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentPageImage) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageImage +func (s *GoogleCloudDocumentaiV1beta2DocumentLabel) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentLabel raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScores: Image -// Quality Scores for the page image -type GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScores struct { - // DetectedDefects: A list of detected defects. - DetectedDefects []*GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScoresDetectedDefect `json:"detectedDefects,omitempty"` +func (s *GoogleCloudDocumentaiV1beta2DocumentLabel) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentLabel + var s1 struct { + Confidence gensupport.JSONFloat64 `json:"confidence"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Confidence = float64(s1.Confidence) + return nil +} - // QualityScore: The overall quality score. Range `[0, 1]` where 1 is - // perfect quality. - QualityScore float64 `json:"qualityScore,omitempty"` +// GoogleCloudDocumentaiV1beta2DocumentPage: A page in a Document. +type GoogleCloudDocumentaiV1beta2DocumentPage struct { + // Blocks: A list of visually detected text blocks on the page. A block + // has a set of lines (collected into paragraphs) that have a common + // line-spacing and orientation. + Blocks []*GoogleCloudDocumentaiV1beta2DocumentPageBlock `json:"blocks,omitempty"` - // ForceSendFields is a list of field names (e.g. "DetectedDefects") to + // DetectedBarcodes: A list of detected barcodes. + DetectedBarcodes []*GoogleCloudDocumentaiV1beta2DocumentPageDetectedBarcode `json:"detectedBarcodes,omitempty"` + + // DetectedLanguages: A list of detected languages together with + // confidence. + DetectedLanguages []*GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` + + // Dimension: Physical dimension of the page. + Dimension *GoogleCloudDocumentaiV1beta2DocumentPageDimension `json:"dimension,omitempty"` + + // FormFields: A list of visually detected form fields on the page. + FormFields []*GoogleCloudDocumentaiV1beta2DocumentPageFormField `json:"formFields,omitempty"` + + // Image: Rendered image for this page. This image is preprocessed to + // remove any skew, rotation, and distortions such that the annotation + // bounding boxes can be upright and axis-aligned. + Image *GoogleCloudDocumentaiV1beta2DocumentPageImage `json:"image,omitempty"` + + // ImageQualityScores: Image Quality Scores. + ImageQualityScores *GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScores `json:"imageQualityScores,omitempty"` + + // Layout: Layout for the page. + Layout *GoogleCloudDocumentaiV1beta2DocumentPageLayout `json:"layout,omitempty"` + + // Lines: A list of visually detected text lines on the page. A + // collection of tokens that a human would perceive as a line. + Lines []*GoogleCloudDocumentaiV1beta2DocumentPageLine `json:"lines,omitempty"` + + // PageNumber: 1-based index for current Page in a parent Document. + // Useful when a page is taken out of a Document for individual + // processing. + PageNumber int64 `json:"pageNumber,omitempty"` + + // Paragraphs: A list of visually detected text paragraphs on the page. + // A collection of lines that a human would perceive as a paragraph. + Paragraphs []*GoogleCloudDocumentaiV1beta2DocumentPageParagraph `json:"paragraphs,omitempty"` + + // Provenance: The history of this page. + Provenance *GoogleCloudDocumentaiV1beta2DocumentProvenance `json:"provenance,omitempty"` + + // Symbols: A list of visually detected symbols on the page. + Symbols []*GoogleCloudDocumentaiV1beta2DocumentPageSymbol `json:"symbols,omitempty"` + + // Tables: A list of visually detected tables on the page. + Tables []*GoogleCloudDocumentaiV1beta2DocumentPageTable `json:"tables,omitempty"` + + // Tokens: A list of visually detected tokens on the page. + Tokens []*GoogleCloudDocumentaiV1beta2DocumentPageToken `json:"tokens,omitempty"` + + // Transforms: Transformation matrices that were applied to the original + // document image to produce Page.image. + Transforms []*GoogleCloudDocumentaiV1beta2DocumentPageMatrix `json:"transforms,omitempty"` + + // VisualElements: A list of detected non-text visual elements e.g. + // checkbox, signature etc. on the page. + VisualElements []*GoogleCloudDocumentaiV1beta2DocumentPageVisualElement `json:"visualElements,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Blocks") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -8149,51 +8313,30 @@ type GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScores struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DetectedDefects") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "Blocks") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScores) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScores +func (s *GoogleCloudDocumentaiV1beta2DocumentPage) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentPage raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScores) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScores - var s1 struct { - QualityScore gensupport.JSONFloat64 `json:"qualityScore"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.QualityScore = float64(s1.QualityScore) - return nil -} - -// GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScoresDetectedDefe -// ct: Image Quality Defects -type GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScoresDetectedDefect struct { - // Confidence: Confidence of detected defect. Range `[0, 1]` where 1 - // indicates strong confidence of that the defect exists. - Confidence float64 `json:"confidence,omitempty"` - - // Type: Name of the defect type. Supported values are: - - // `quality/defect_blurry` - `quality/defect_noisy` - - // `quality/defect_dark` - `quality/defect_faint` - - // `quality/defect_text_too_small` - `quality/defect_document_cutoff` - - // `quality/defect_text_cutoff` - `quality/defect_glare` - Type string `json:"type,omitempty"` +// GoogleCloudDocumentaiV1beta2DocumentPageAnchor: Referencing the +// visual context of the entity in the Document.pages. Page anchors can +// be cross-page, consist of multiple bounding polygons and optionally +// reference specific layout element types. +type GoogleCloudDocumentaiV1beta2DocumentPageAnchor struct { + // PageRefs: One or more references to visual page elements + PageRefs []*GoogleCloudDocumentaiV1beta2DocumentPageAnchorPageRef `json:"pageRefs,omitempty"` - // ForceSendFields is a list of field names (e.g. "Confidence") to + // ForceSendFields is a list of field names (e.g. "PageRefs") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -8201,7 +8344,7 @@ type GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScoresDetectedDefect st // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Confidence") to include in + // NullFields is a list of field names (e.g. "PageRefs") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -8210,52 +8353,45 @@ type GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScoresDetectedDefect st NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScoresDetectedDefect) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScoresDetectedDefect +func (s *GoogleCloudDocumentaiV1beta2DocumentPageAnchor) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageAnchor raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScoresDetectedDefect) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScoresDetectedDefect - var s1 struct { - Confidence gensupport.JSONFloat64 `json:"confidence"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.Confidence = float64(s1.Confidence) - return nil -} - -// GoogleCloudDocumentaiV1beta2DocumentPageLayout: Visual element -// describing a layout unit on a page. -type GoogleCloudDocumentaiV1beta2DocumentPageLayout struct { - // BoundingPoly: The bounding polygon for the Layout. +// GoogleCloudDocumentaiV1beta2DocumentPageAnchorPageRef: Represents a +// weak reference to a page element within a document. +type GoogleCloudDocumentaiV1beta2DocumentPageAnchorPageRef struct { + // BoundingPoly: Optional. Identifies the bounding polygon of a layout + // element on the page. BoundingPoly *GoogleCloudDocumentaiV1beta2BoundingPoly `json:"boundingPoly,omitempty"` - // Confidence: Confidence of the current Layout within context of the - // object this layout is for. e.g. confidence can be for a single token, - // a table, a visual element, etc. depending on context. Range `[0, 1]`. + // Confidence: Optional. Confidence of detected page element, if + // applicable. Range `[0, 1]`. Confidence float64 `json:"confidence,omitempty"` - // Orientation: Detected orientation for the Layout. + // LayoutId: Optional. Deprecated. Use PageRef.bounding_poly instead. + LayoutId string `json:"layoutId,omitempty"` + + // LayoutType: Optional. The type of the layout element that is being + // referenced if any. // // Possible values: - // "ORIENTATION_UNSPECIFIED" - Unspecified orientation. - // "PAGE_UP" - Orientation is aligned with page up. - // "PAGE_RIGHT" - Orientation is aligned with page right. Turn the - // head 90 degrees clockwise from upright to read. - // "PAGE_DOWN" - Orientation is aligned with page down. Turn the head - // 180 degrees from upright to read. - // "PAGE_LEFT" - Orientation is aligned with page left. Turn the head - // 90 degrees counterclockwise from upright to read. - Orientation string `json:"orientation,omitempty"` + // "LAYOUT_TYPE_UNSPECIFIED" - Layout Unspecified. + // "BLOCK" - References a Page.blocks element. + // "PARAGRAPH" - References a Page.paragraphs element. + // "LINE" - References a Page.lines element. + // "TOKEN" - References a Page.tokens element. + // "VISUAL_ELEMENT" - References a Page.visual_elements element. + // "TABLE" - Refrrences a Page.tables element. + // "FORM_FIELD" - References a Page.form_fields element. + LayoutType string `json:"layoutType,omitempty"` - // TextAnchor: Text anchor indexing into the Document.text. - TextAnchor *GoogleCloudDocumentaiV1beta2DocumentTextAnchor `json:"textAnchor,omitempty"` + // Page: Required. Index into the Document.pages element, for example + // using `Document.pages` to locate the related page element. This field + // is skipped when its value is the default `0`. See + // https://developers.google.com/protocol-buffers/docs/proto3#json. + Page int64 `json:"page,omitempty,string"` // ForceSendFields is a list of field names (e.g. "BoundingPoly") to // unconditionally include in API requests. By default, fields with @@ -8274,15 +8410,15 @@ type GoogleCloudDocumentaiV1beta2DocumentPageLayout struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentPageLayout) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageLayout +func (s *GoogleCloudDocumentaiV1beta2DocumentPageAnchorPageRef) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageAnchorPageRef raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *GoogleCloudDocumentaiV1beta2DocumentPageLayout) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageLayout - var s1 struct { +func (s *GoogleCloudDocumentaiV1beta2DocumentPageAnchorPageRef) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageAnchorPageRef + var s1 struct { Confidence gensupport.JSONFloat64 `json:"confidence"` *NoMethod } @@ -8294,15 +8430,15 @@ func (s *GoogleCloudDocumentaiV1beta2DocumentPageLayout) UnmarshalJSON(data []by return nil } -// GoogleCloudDocumentaiV1beta2DocumentPageLine: A collection of tokens -// that a human would perceive as a line. Does not cross column -// boundaries, can be horizontal, vertical, etc. -type GoogleCloudDocumentaiV1beta2DocumentPageLine struct { +// GoogleCloudDocumentaiV1beta2DocumentPageBlock: A block has a set of +// lines (collected into paragraphs) that have a common line-spacing and +// orientation. +type GoogleCloudDocumentaiV1beta2DocumentPageBlock struct { // DetectedLanguages: A list of detected languages together with // confidence. DetectedLanguages []*GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` - // Layout: Layout for Line. + // Layout: Layout for Block. Layout *GoogleCloudDocumentaiV1beta2DocumentPageLayout `json:"layout,omitempty"` // Provenance: The history of this annotation. @@ -8326,32 +8462,22 @@ type GoogleCloudDocumentaiV1beta2DocumentPageLine struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentPageLine) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageLine +func (s *GoogleCloudDocumentaiV1beta2DocumentPageBlock) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageBlock raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2DocumentPageMatrix: Representation for -// transformation matrix, intended to be compatible and used with OpenCV -// format for image manipulation. -type GoogleCloudDocumentaiV1beta2DocumentPageMatrix struct { - // Cols: Number of columns in the matrix. - Cols int64 `json:"cols,omitempty"` - - // Data: The matrix data. - Data string `json:"data,omitempty"` - - // Rows: Number of rows in the matrix. - Rows int64 `json:"rows,omitempty"` +// GoogleCloudDocumentaiV1beta2DocumentPageDetectedBarcode: A detected +// barcode. +type GoogleCloudDocumentaiV1beta2DocumentPageDetectedBarcode struct { + // Barcode: Detailed barcode information of the DetectedBarcode. + Barcode *GoogleCloudDocumentaiV1beta2Barcode `json:"barcode,omitempty"` - // Type: This encodes information about what data type the matrix uses. - // For example, 0 (CV_8U) is an unsigned 8-bit image. For the full list - // of OpenCV primitive data types, please refer to - // https://docs.opencv.org/4.3.0/d1/d1b/group__core__hal__interface.html - Type int64 `json:"type,omitempty"` + // Layout: Layout for DetectedBarcode. + Layout *GoogleCloudDocumentaiV1beta2DocumentPageLayout `json:"layout,omitempty"` - // ForceSendFields is a list of field names (e.g. "Cols") to + // ForceSendFields is a list of field names (e.g. "Barcode") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -8359,8 +8485,8 @@ type GoogleCloudDocumentaiV1beta2DocumentPageMatrix struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Cols") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "Barcode") to include in + // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -8368,102 +8494,149 @@ type GoogleCloudDocumentaiV1beta2DocumentPageMatrix struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentPageMatrix) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageMatrix +func (s *GoogleCloudDocumentaiV1beta2DocumentPageDetectedBarcode) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageDetectedBarcode raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2DocumentPageParagraph: A collection of -// lines that a human would perceive as a paragraph. -type GoogleCloudDocumentaiV1beta2DocumentPageParagraph struct { - // DetectedLanguages: A list of detected languages together with - // confidence. - DetectedLanguages []*GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` - - // Layout: Layout for Paragraph. - Layout *GoogleCloudDocumentaiV1beta2DocumentPageLayout `json:"layout,omitempty"` +// GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage: Detected +// language for a structural component. +type GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage struct { + // Confidence: Confidence of detected language. Range `[0, 1]`. + Confidence float64 `json:"confidence,omitempty"` - // Provenance: The history of this annotation. - Provenance *GoogleCloudDocumentaiV1beta2DocumentProvenance `json:"provenance,omitempty"` + // LanguageCode: The BCP-47 language code, such as `en-US` or `sr-Latn`. + // For more information, see + // https://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + LanguageCode string `json:"languageCode,omitempty"` - // ForceSendFields is a list of field names (e.g. "DetectedLanguages") - // to unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "Confidence") to + // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DetectedLanguages") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "Confidence") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentPageParagraph) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageParagraph +func (s *GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2DocumentPageSymbol: A detected symbol. -type GoogleCloudDocumentaiV1beta2DocumentPageSymbol struct { - // DetectedLanguages: A list of detected languages together with - // confidence. - DetectedLanguages []*GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` +func (s *GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage + var s1 struct { + Confidence gensupport.JSONFloat64 `json:"confidence"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Confidence = float64(s1.Confidence) + return nil +} - // Layout: Layout for Symbol. - Layout *GoogleCloudDocumentaiV1beta2DocumentPageLayout `json:"layout,omitempty"` +// GoogleCloudDocumentaiV1beta2DocumentPageDimension: Dimension for the +// page. +type GoogleCloudDocumentaiV1beta2DocumentPageDimension struct { + // Height: Page height. + Height float64 `json:"height,omitempty"` - // ForceSendFields is a list of field names (e.g. "DetectedLanguages") - // to unconditionally include in API requests. By default, fields with + // Unit: Dimension unit. + Unit string `json:"unit,omitempty"` + + // Width: Page width. + Width float64 `json:"width,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DetectedLanguages") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "Height") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentPageSymbol) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageSymbol +func (s *GoogleCloudDocumentaiV1beta2DocumentPageDimension) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageDimension raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2DocumentPageTable: A table representation -// similar to HTML table structure. -type GoogleCloudDocumentaiV1beta2DocumentPageTable struct { - // BodyRows: Body rows of the table. - BodyRows []*GoogleCloudDocumentaiV1beta2DocumentPageTableTableRow `json:"bodyRows,omitempty"` +func (s *GoogleCloudDocumentaiV1beta2DocumentPageDimension) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageDimension + var s1 struct { + Height gensupport.JSONFloat64 `json:"height"` + Width gensupport.JSONFloat64 `json:"width"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Height = float64(s1.Height) + s.Width = float64(s1.Width) + return nil +} - // DetectedLanguages: A list of detected languages together with - // confidence. - DetectedLanguages []*GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` +// GoogleCloudDocumentaiV1beta2DocumentPageFormField: A form field +// detected on the page. +type GoogleCloudDocumentaiV1beta2DocumentPageFormField struct { + // CorrectedKeyText: Created for Labeling UI to export key text. If + // corrections were made to the text identified by the + // `field_name.text_anchor`, this field will contain the correction. + CorrectedKeyText string `json:"correctedKeyText,omitempty"` - // HeaderRows: Header rows of the table. - HeaderRows []*GoogleCloudDocumentaiV1beta2DocumentPageTableTableRow `json:"headerRows,omitempty"` + // CorrectedValueText: Created for Labeling UI to export value text. If + // corrections were made to the text identified by the + // `field_value.text_anchor`, this field will contain the correction. + CorrectedValueText string `json:"correctedValueText,omitempty"` - // Layout: Layout for Table. - Layout *GoogleCloudDocumentaiV1beta2DocumentPageLayout `json:"layout,omitempty"` + // FieldName: Layout for the FormField name. e.g. `Address`, `Email`, + // `Grand total`, `Phone number`, etc. + FieldName *GoogleCloudDocumentaiV1beta2DocumentPageLayout `json:"fieldName,omitempty"` - // Provenance: The history of this table. + // FieldValue: Layout for the FormField value. + FieldValue *GoogleCloudDocumentaiV1beta2DocumentPageLayout `json:"fieldValue,omitempty"` + + // NameDetectedLanguages: A list of detected languages for name together + // with confidence. + NameDetectedLanguages []*GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage `json:"nameDetectedLanguages,omitempty"` + + // Provenance: The history of this annotation. Provenance *GoogleCloudDocumentaiV1beta2DocumentProvenance `json:"provenance,omitempty"` - // ForceSendFields is a list of field names (e.g. "BodyRows") to + // ValueDetectedLanguages: A list of detected languages for value + // together with confidence. + ValueDetectedLanguages []*GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage `json:"valueDetectedLanguages,omitempty"` + + // ValueType: If the value is non-textual, this field represents the + // type. Current valid values are: - blank (this indicates the + // `field_value` is normal text) - `unfilled_checkbox` - + // `filled_checkbox` + ValueType string `json:"valueType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CorrectedKeyText") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -8471,38 +8644,38 @@ type GoogleCloudDocumentaiV1beta2DocumentPageTable struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "BodyRows") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "CorrectedKeyText") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentPageTable) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageTable +func (s *GoogleCloudDocumentaiV1beta2DocumentPageFormField) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageFormField raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2DocumentPageTableTableCell: A cell -// representation inside the table. -type GoogleCloudDocumentaiV1beta2DocumentPageTableTableCell struct { - // ColSpan: How many columns this cell spans. - ColSpan int64 `json:"colSpan,omitempty"` +// GoogleCloudDocumentaiV1beta2DocumentPageImage: Rendered image +// contents for this page. +type GoogleCloudDocumentaiV1beta2DocumentPageImage struct { + // Content: Raw byte content of the image. + Content string `json:"content,omitempty"` - // DetectedLanguages: A list of detected languages together with - // confidence. - DetectedLanguages []*GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` + // Height: Height of the image in pixels. + Height int64 `json:"height,omitempty"` - // Layout: Layout for TableCell. - Layout *GoogleCloudDocumentaiV1beta2DocumentPageLayout `json:"layout,omitempty"` + // MimeType: Encoding mime type for the image. + MimeType string `json:"mimeType,omitempty"` - // RowSpan: How many rows this cell spans. - RowSpan int64 `json:"rowSpan,omitempty"` + // Width: Width of the image in pixels. + Width int64 `json:"width,omitempty"` - // ForceSendFields is a list of field names (e.g. "ColSpan") to + // ForceSendFields is a list of field names (e.g. "Content") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -8510,7 +8683,7 @@ type GoogleCloudDocumentaiV1beta2DocumentPageTableTableCell struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ColSpan") to include in + // NullFields is a list of field names (e.g. "Content") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -8519,19 +8692,23 @@ type GoogleCloudDocumentaiV1beta2DocumentPageTableTableCell struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentPageTableTableCell) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageTableTableCell +func (s *GoogleCloudDocumentaiV1beta2DocumentPageImage) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageImage raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2DocumentPageTableTableRow: A row of table -// cells. -type GoogleCloudDocumentaiV1beta2DocumentPageTableTableRow struct { - // Cells: Cells that make up this row. - Cells []*GoogleCloudDocumentaiV1beta2DocumentPageTableTableCell `json:"cells,omitempty"` +// GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScores: Image +// Quality Scores for the page image +type GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScores struct { + // DetectedDefects: A list of detected defects. + DetectedDefects []*GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScoresDetectedDefect `json:"detectedDefects,omitempty"` - // ForceSendFields is a list of field names (e.g. "Cells") to + // QualityScore: The overall quality score. Range `[0, 1]` where 1 is + // perfect quality. + QualityScore float64 `json:"qualityScore,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DetectedDefects") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -8539,37 +8716,51 @@ type GoogleCloudDocumentaiV1beta2DocumentPageTableTableRow struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Cells") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "DetectedDefects") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentPageTableTableRow) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageTableTableRow +func (s *GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScores) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScores raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2DocumentPageToken: A detected token. -type GoogleCloudDocumentaiV1beta2DocumentPageToken struct { - // DetectedBreak: Detected break at the end of a Token. - DetectedBreak *GoogleCloudDocumentaiV1beta2DocumentPageTokenDetectedBreak `json:"detectedBreak,omitempty"` - - // DetectedLanguages: A list of detected languages together with - // confidence. - DetectedLanguages []*GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` +func (s *GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScores) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScores + var s1 struct { + QualityScore gensupport.JSONFloat64 `json:"qualityScore"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.QualityScore = float64(s1.QualityScore) + return nil +} - // Layout: Layout for Token. - Layout *GoogleCloudDocumentaiV1beta2DocumentPageLayout `json:"layout,omitempty"` +// GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScoresDetectedDefe +// ct: Image Quality Defects +type GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScoresDetectedDefect struct { + // Confidence: Confidence of detected defect. Range `[0, 1]` where 1 + // indicates strong confidence of that the defect exists. + Confidence float64 `json:"confidence,omitempty"` - // Provenance: The history of this annotation. - Provenance *GoogleCloudDocumentaiV1beta2DocumentProvenance `json:"provenance,omitempty"` + // Type: Name of the defect type. Supported values are: - + // `quality/defect_blurry` - `quality/defect_noisy` - + // `quality/defect_dark` - `quality/defect_faint` - + // `quality/defect_text_too_small` - `quality/defect_document_cutoff` - + // `quality/defect_text_cutoff` - `quality/defect_glare` + Type string `json:"type,omitempty"` - // ForceSendFields is a list of field names (e.g. "DetectedBreak") to + // ForceSendFields is a list of field names (e.g. "Confidence") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -8577,35 +8768,63 @@ type GoogleCloudDocumentaiV1beta2DocumentPageToken struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DetectedBreak") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "Confidence") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentPageToken) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageToken +func (s *GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScoresDetectedDefect) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScoresDetectedDefect raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2DocumentPageTokenDetectedBreak: Detected -// break at the end of a Token. -type GoogleCloudDocumentaiV1beta2DocumentPageTokenDetectedBreak struct { - // Type: Detected break type. +func (s *GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScoresDetectedDefect) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageImageQualityScoresDetectedDefect + var s1 struct { + Confidence gensupport.JSONFloat64 `json:"confidence"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Confidence = float64(s1.Confidence) + return nil +} + +// GoogleCloudDocumentaiV1beta2DocumentPageLayout: Visual element +// describing a layout unit on a page. +type GoogleCloudDocumentaiV1beta2DocumentPageLayout struct { + // BoundingPoly: The bounding polygon for the Layout. + BoundingPoly *GoogleCloudDocumentaiV1beta2BoundingPoly `json:"boundingPoly,omitempty"` + + // Confidence: Confidence of the current Layout within context of the + // object this layout is for. e.g. confidence can be for a single token, + // a table, a visual element, etc. depending on context. Range `[0, 1]`. + Confidence float64 `json:"confidence,omitempty"` + + // Orientation: Detected orientation for the Layout. // // Possible values: - // "TYPE_UNSPECIFIED" - Unspecified break type. - // "SPACE" - A single whitespace. - // "WIDE_SPACE" - A wider whitespace. - // "HYPHEN" - A hyphen that indicates that a token has been split - // across lines. - Type string `json:"type,omitempty"` + // "ORIENTATION_UNSPECIFIED" - Unspecified orientation. + // "PAGE_UP" - Orientation is aligned with page up. + // "PAGE_RIGHT" - Orientation is aligned with page right. Turn the + // head 90 degrees clockwise from upright to read. + // "PAGE_DOWN" - Orientation is aligned with page down. Turn the head + // 180 degrees from upright to read. + // "PAGE_LEFT" - Orientation is aligned with page left. Turn the head + // 90 degrees counterclockwise from upright to read. + Orientation string `json:"orientation,omitempty"` - // ForceSendFields is a list of field names (e.g. "Type") to + // TextAnchor: Text anchor indexing into the Document.text. + TextAnchor *GoogleCloudDocumentaiV1beta2DocumentTextAnchor `json:"textAnchor,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BoundingPoly") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -8613,33 +8832,48 @@ type GoogleCloudDocumentaiV1beta2DocumentPageTokenDetectedBreak struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Type") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "BoundingPoly") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentPageTokenDetectedBreak) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageTokenDetectedBreak +func (s *GoogleCloudDocumentaiV1beta2DocumentPageLayout) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageLayout raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2DocumentPageVisualElement: Detected -// non-text visual elements e.g. checkbox, signature etc. on the page. -type GoogleCloudDocumentaiV1beta2DocumentPageVisualElement struct { +func (s *GoogleCloudDocumentaiV1beta2DocumentPageLayout) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageLayout + var s1 struct { + Confidence gensupport.JSONFloat64 `json:"confidence"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Confidence = float64(s1.Confidence) + return nil +} + +// GoogleCloudDocumentaiV1beta2DocumentPageLine: A collection of tokens +// that a human would perceive as a line. Does not cross column +// boundaries, can be horizontal, vertical, etc. +type GoogleCloudDocumentaiV1beta2DocumentPageLine struct { // DetectedLanguages: A list of detected languages together with // confidence. DetectedLanguages []*GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` - // Layout: Layout for VisualElement. + // Layout: Layout for Line. Layout *GoogleCloudDocumentaiV1beta2DocumentPageLayout `json:"layout,omitempty"` - // Type: Type of the VisualElement. - Type string `json:"type,omitempty"` + // Provenance: The history of this annotation. + Provenance *GoogleCloudDocumentaiV1beta2DocumentProvenance `json:"provenance,omitempty"` // ForceSendFields is a list of field names (e.g. "DetectedLanguages") // to unconditionally include in API requests. By default, fields with @@ -8659,42 +8893,32 @@ type GoogleCloudDocumentaiV1beta2DocumentPageVisualElement struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentPageVisualElement) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageVisualElement +func (s *GoogleCloudDocumentaiV1beta2DocumentPageLine) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageLine raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2DocumentProvenance: Structure to identify -// provenance relationships between annotations in different revisions. -type GoogleCloudDocumentaiV1beta2DocumentProvenance struct { - // Id: The Id of this operation. Needs to be unique within the scope of - // the revision. - Id int64 `json:"id,omitempty"` +// GoogleCloudDocumentaiV1beta2DocumentPageMatrix: Representation for +// transformation matrix, intended to be compatible and used with OpenCV +// format for image manipulation. +type GoogleCloudDocumentaiV1beta2DocumentPageMatrix struct { + // Cols: Number of columns in the matrix. + Cols int64 `json:"cols,omitempty"` - // Parents: References to the original elements that are replaced. - Parents []*GoogleCloudDocumentaiV1beta2DocumentProvenanceParent `json:"parents,omitempty"` + // Data: The matrix data. + Data string `json:"data,omitempty"` - // Revision: The index of the revision that produced this element. - Revision int64 `json:"revision,omitempty"` + // Rows: Number of rows in the matrix. + Rows int64 `json:"rows,omitempty"` - // Type: The type of provenance operation. - // - // Possible values: - // "OPERATION_TYPE_UNSPECIFIED" - Operation type unspecified. If no - // operation is specified a provenance entry is simply used to match - // against a `parent`. - // "ADD" - Add an element. - // "REMOVE" - Remove an element identified by `parent`. - // "REPLACE" - Replace an element identified by `parent`. - // "EVAL_REQUESTED" - Request human review for the element identified - // by `parent`. - // "EVAL_APPROVED" - Element is reviewed and approved at human review, - // confidence will be set to 1.0. - // "EVAL_SKIPPED" - Element is skipped in the validation process. - Type string `json:"type,omitempty"` + // Type: This encodes information about what data type the matrix uses. + // For example, 0 (CV_8U) is an unsigned 8-bit image. For the full list + // of OpenCV primitive data types, please refer to + // https://docs.opencv.org/4.3.0/d1/d1b/group__core__hal__interface.html + Type int64 `json:"type,omitempty"` - // ForceSendFields is a list of field names (e.g. "Id") to + // ForceSendFields is a list of field names (e.g. "Cols") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -8702,7 +8926,7 @@ type GoogleCloudDocumentaiV1beta2DocumentProvenance struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Id") to include in API + // NullFields is a list of field names (e.g. "Cols") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -8711,82 +8935,102 @@ type GoogleCloudDocumentaiV1beta2DocumentProvenance struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentProvenance) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentProvenance +func (s *GoogleCloudDocumentaiV1beta2DocumentPageMatrix) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageMatrix raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2DocumentProvenanceParent: The parent -// element the current element is based on. Used for -// referencing/aligning, removal and replacement operations. -type GoogleCloudDocumentaiV1beta2DocumentProvenanceParent struct { - // Id: The id of the parent provenance. - Id int64 `json:"id,omitempty"` +// GoogleCloudDocumentaiV1beta2DocumentPageParagraph: A collection of +// lines that a human would perceive as a paragraph. +type GoogleCloudDocumentaiV1beta2DocumentPageParagraph struct { + // DetectedLanguages: A list of detected languages together with + // confidence. + DetectedLanguages []*GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` - // Index: The index of the parent item in the corresponding item list - // (eg. list of entities, properties within entities, etc.) in the - // parent revision. - Index int64 `json:"index,omitempty"` + // Layout: Layout for Paragraph. + Layout *GoogleCloudDocumentaiV1beta2DocumentPageLayout `json:"layout,omitempty"` - // Revision: The index of the index into current revision's parent_ids - // list. - Revision int64 `json:"revision,omitempty"` + // Provenance: The history of this annotation. + Provenance *GoogleCloudDocumentaiV1beta2DocumentProvenance `json:"provenance,omitempty"` - // ForceSendFields is a list of field names (e.g. "Id") to - // unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "DetectedLanguages") + // to unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Id") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "DetectedLanguages") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentProvenanceParent) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentProvenanceParent +func (s *GoogleCloudDocumentaiV1beta2DocumentPageParagraph) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageParagraph raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2DocumentRevision: Contains past or -// forward revisions of this document. -type GoogleCloudDocumentaiV1beta2DocumentRevision struct { - // Agent: If the change was made by a person specify the name or id of - // that person. - Agent string `json:"agent,omitempty"` +// GoogleCloudDocumentaiV1beta2DocumentPageSymbol: A detected symbol. +type GoogleCloudDocumentaiV1beta2DocumentPageSymbol struct { + // DetectedLanguages: A list of detected languages together with + // confidence. + DetectedLanguages []*GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` - // CreateTime: The time that the revision was created. - CreateTime string `json:"createTime,omitempty"` + // Layout: Layout for Symbol. + Layout *GoogleCloudDocumentaiV1beta2DocumentPageLayout `json:"layout,omitempty"` - // HumanReview: Human Review information of this revision. - HumanReview *GoogleCloudDocumentaiV1beta2DocumentRevisionHumanReview `json:"humanReview,omitempty"` + // ForceSendFields is a list of field names (e.g. "DetectedLanguages") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` - // Id: Id of the revision. Unique within the context of the document. - Id string `json:"id,omitempty"` + // NullFields is a list of field names (e.g. "DetectedLanguages") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} - // Parent: The revisions that this revision is based on. This can - // include one or more parent (when documents are merged.) This field - // represents the index into the `revisions` field. - Parent []int64 `json:"parent,omitempty"` +func (s *GoogleCloudDocumentaiV1beta2DocumentPageSymbol) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageSymbol + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // ParentIds: The revisions that this revision is based on. Must include - // all the ids that have anything to do with this revision - eg. there - // are `provenance.parent.revision` fields that index into this field. - ParentIds []string `json:"parentIds,omitempty"` +// GoogleCloudDocumentaiV1beta2DocumentPageTable: A table representation +// similar to HTML table structure. +type GoogleCloudDocumentaiV1beta2DocumentPageTable struct { + // BodyRows: Body rows of the table. + BodyRows []*GoogleCloudDocumentaiV1beta2DocumentPageTableTableRow `json:"bodyRows,omitempty"` - // Processor: If the annotation was made by processor identify the - // processor by its resource name. - Processor string `json:"processor,omitempty"` + // DetectedLanguages: A list of detected languages together with + // confidence. + DetectedLanguages []*GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` - // ForceSendFields is a list of field names (e.g. "Agent") to + // HeaderRows: Header rows of the table. + HeaderRows []*GoogleCloudDocumentaiV1beta2DocumentPageTableTableRow `json:"headerRows,omitempty"` + + // Layout: Layout for Table. + Layout *GoogleCloudDocumentaiV1beta2DocumentPageLayout `json:"layout,omitempty"` + + // Provenance: The history of this table. + Provenance *GoogleCloudDocumentaiV1beta2DocumentProvenance `json:"provenance,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BodyRows") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -8794,8 +9038,8 @@ type GoogleCloudDocumentaiV1beta2DocumentRevision struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Agent") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "BodyRows") to include in + // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -8803,24 +9047,29 @@ type GoogleCloudDocumentaiV1beta2DocumentRevision struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentRevision) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentRevision +func (s *GoogleCloudDocumentaiV1beta2DocumentPageTable) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageTable raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2DocumentRevisionHumanReview: Human Review -// information of the document. -type GoogleCloudDocumentaiV1beta2DocumentRevisionHumanReview struct { - // State: Human review state. e.g. `requested`, `succeeded`, `rejected`. - State string `json:"state,omitempty"` +// GoogleCloudDocumentaiV1beta2DocumentPageTableTableCell: A cell +// representation inside the table. +type GoogleCloudDocumentaiV1beta2DocumentPageTableTableCell struct { + // ColSpan: How many columns this cell spans. + ColSpan int64 `json:"colSpan,omitempty"` - // StateMessage: A message providing more details about the current - // state of processing. For example, the rejection reason when the state - // is `rejected`. - StateMessage string `json:"stateMessage,omitempty"` + // DetectedLanguages: A list of detected languages together with + // confidence. + DetectedLanguages []*GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` - // ForceSendFields is a list of field names (e.g. "State") to + // Layout: Layout for TableCell. + Layout *GoogleCloudDocumentaiV1beta2DocumentPageLayout `json:"layout,omitempty"` + + // RowSpan: How many rows this cell spans. + RowSpan int64 `json:"rowSpan,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ColSpan") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -8828,8 +9077,8 @@ type GoogleCloudDocumentaiV1beta2DocumentRevisionHumanReview struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "State") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "ColSpan") to include in + // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -8837,27 +9086,19 @@ type GoogleCloudDocumentaiV1beta2DocumentRevisionHumanReview struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentRevisionHumanReview) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentRevisionHumanReview +func (s *GoogleCloudDocumentaiV1beta2DocumentPageTableTableCell) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageTableTableCell raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2DocumentShardInfo: For a large document, -// sharding may be performed to produce several document shards. Each -// document shard contains this field to detail which shard it is. -type GoogleCloudDocumentaiV1beta2DocumentShardInfo struct { - // ShardCount: Total number of shards. - ShardCount int64 `json:"shardCount,omitempty,string"` - - // ShardIndex: The 0-based index of this shard. - ShardIndex int64 `json:"shardIndex,omitempty,string"` - - // TextOffset: The index of the first character in Document.text in the - // overall document global text. - TextOffset int64 `json:"textOffset,omitempty,string"` +// GoogleCloudDocumentaiV1beta2DocumentPageTableTableRow: A row of table +// cells. +type GoogleCloudDocumentaiV1beta2DocumentPageTableTableRow struct { + // Cells: Cells that make up this row. + Cells []*GoogleCloudDocumentaiV1beta2DocumentPageTableTableCell `json:"cells,omitempty"` - // ForceSendFields is a list of field names (e.g. "ShardCount") to + // ForceSendFields is a list of field names (e.g. "Cells") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -8865,8 +9106,8 @@ type GoogleCloudDocumentaiV1beta2DocumentShardInfo struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ShardCount") to include in - // API requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "Cells") to include in API + // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -8874,45 +9115,28 @@ type GoogleCloudDocumentaiV1beta2DocumentShardInfo struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentShardInfo) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentShardInfo +func (s *GoogleCloudDocumentaiV1beta2DocumentPageTableTableRow) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageTableTableRow raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2DocumentStyle: Annotation for common text -// style attributes. This adheres to CSS conventions as much as -// possible. -type GoogleCloudDocumentaiV1beta2DocumentStyle struct { - // BackgroundColor: Text background color. - BackgroundColor *GoogleTypeColor `json:"backgroundColor,omitempty"` - - // Color: Text color. - Color *GoogleTypeColor `json:"color,omitempty"` - - // FontFamily: Font family such as `Arial`, `Times New Roman`. - // https://www.w3schools.com/cssref/pr_font_font-family.asp - FontFamily string `json:"fontFamily,omitempty"` - - // FontSize: Font size. - FontSize *GoogleCloudDocumentaiV1beta2DocumentStyleFontSize `json:"fontSize,omitempty"` - - // FontWeight: Font weight. Possible values are normal, bold, bolder, - // and lighter. https://www.w3schools.com/cssref/pr_font_weight.asp - FontWeight string `json:"fontWeight,omitempty"` +// GoogleCloudDocumentaiV1beta2DocumentPageToken: A detected token. +type GoogleCloudDocumentaiV1beta2DocumentPageToken struct { + // DetectedBreak: Detected break at the end of a Token. + DetectedBreak *GoogleCloudDocumentaiV1beta2DocumentPageTokenDetectedBreak `json:"detectedBreak,omitempty"` - // TextAnchor: Text anchor indexing into the Document.text. - TextAnchor *GoogleCloudDocumentaiV1beta2DocumentTextAnchor `json:"textAnchor,omitempty"` + // DetectedLanguages: A list of detected languages together with + // confidence. + DetectedLanguages []*GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` - // TextDecoration: Text decoration. Follows CSS standard. - // https://www.w3schools.com/cssref/pr_text_text-decoration.asp - TextDecoration string `json:"textDecoration,omitempty"` + // Layout: Layout for Token. + Layout *GoogleCloudDocumentaiV1beta2DocumentPageLayout `json:"layout,omitempty"` - // TextStyle: Text style. Possible values are normal, italic, and - // oblique. https://www.w3schools.com/cssref/pr_font_font-style.asp - TextStyle string `json:"textStyle,omitempty"` + // Provenance: The history of this annotation. + Provenance *GoogleCloudDocumentaiV1beta2DocumentProvenance `json:"provenance,omitempty"` - // ForceSendFields is a list of field names (e.g. "BackgroundColor") to + // ForceSendFields is a list of field names (e.g. "DetectedBreak") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -8920,32 +9144,35 @@ type GoogleCloudDocumentaiV1beta2DocumentStyle struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "BackgroundColor") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "DetectedBreak") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentStyle) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentStyle +func (s *GoogleCloudDocumentaiV1beta2DocumentPageToken) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageToken raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2DocumentStyleFontSize: Font size with -// unit. -type GoogleCloudDocumentaiV1beta2DocumentStyleFontSize struct { - // Size: Font size for the text. - Size float64 `json:"size,omitempty"` - - // Unit: Unit for the font size. Follows CSS naming (in, px, pt, etc.). - Unit string `json:"unit,omitempty"` +// GoogleCloudDocumentaiV1beta2DocumentPageTokenDetectedBreak: Detected +// break at the end of a Token. +type GoogleCloudDocumentaiV1beta2DocumentPageTokenDetectedBreak struct { + // Type: Detected break type. + // + // Possible values: + // "TYPE_UNSPECIFIED" - Unspecified break type. + // "SPACE" - A single whitespace. + // "WIDE_SPACE" - A wider whitespace. + // "HYPHEN" - A hyphen that indicates that a token has been split + // across lines. + Type string `json:"type,omitempty"` - // ForceSendFields is a list of field names (e.g. "Size") to + // ForceSendFields is a list of field names (e.g. "Type") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -8953,7 +9180,7 @@ type GoogleCloudDocumentaiV1beta2DocumentStyleFontSize struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Size") to include in API + // NullFields is a list of field names (e.g. "Type") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -8962,73 +9189,79 @@ type GoogleCloudDocumentaiV1beta2DocumentStyleFontSize struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentStyleFontSize) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentStyleFontSize +func (s *GoogleCloudDocumentaiV1beta2DocumentPageTokenDetectedBreak) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageTokenDetectedBreak raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *GoogleCloudDocumentaiV1beta2DocumentStyleFontSize) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentStyleFontSize - var s1 struct { - Size gensupport.JSONFloat64 `json:"size"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.Size = float64(s1.Size) - return nil -} +// GoogleCloudDocumentaiV1beta2DocumentPageVisualElement: Detected +// non-text visual elements e.g. checkbox, signature etc. on the page. +type GoogleCloudDocumentaiV1beta2DocumentPageVisualElement struct { + // DetectedLanguages: A list of detected languages together with + // confidence. + DetectedLanguages []*GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage `json:"detectedLanguages,omitempty"` -// GoogleCloudDocumentaiV1beta2DocumentTextAnchor: Text reference -// indexing into the Document.text. -type GoogleCloudDocumentaiV1beta2DocumentTextAnchor struct { - // Content: Contains the content of the text span so that users do not - // have to look it up in the text_segments. It is always populated for - // formFields. - Content string `json:"content,omitempty"` + // Layout: Layout for VisualElement. + Layout *GoogleCloudDocumentaiV1beta2DocumentPageLayout `json:"layout,omitempty"` - // TextSegments: The text segments from the Document.text. - TextSegments []*GoogleCloudDocumentaiV1beta2DocumentTextAnchorTextSegment `json:"textSegments,omitempty"` + // Type: Type of the VisualElement. + Type string `json:"type,omitempty"` - // ForceSendFields is a list of field names (e.g. "Content") to - // unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "DetectedLanguages") + // to unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Content") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "DetectedLanguages") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentTextAnchor) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentTextAnchor +func (s *GoogleCloudDocumentaiV1beta2DocumentPageVisualElement) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentPageVisualElement raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2DocumentTextAnchorTextSegment: A text -// segment in the Document.text. The indices may be out of bounds which -// indicate that the text extends into another document shard for large -// sharded documents. See ShardInfo.text_offset -type GoogleCloudDocumentaiV1beta2DocumentTextAnchorTextSegment struct { - // EndIndex: TextSegment half open end UTF-8 char index in the - // Document.text. - EndIndex int64 `json:"endIndex,omitempty,string"` +// GoogleCloudDocumentaiV1beta2DocumentProvenance: Structure to identify +// provenance relationships between annotations in different revisions. +type GoogleCloudDocumentaiV1beta2DocumentProvenance struct { + // Id: The Id of this operation. Needs to be unique within the scope of + // the revision. + Id int64 `json:"id,omitempty"` - // StartIndex: TextSegment start UTF-8 char index in the Document.text. - StartIndex int64 `json:"startIndex,omitempty,string"` + // Parents: References to the original elements that are replaced. + Parents []*GoogleCloudDocumentaiV1beta2DocumentProvenanceParent `json:"parents,omitempty"` - // ForceSendFields is a list of field names (e.g. "EndIndex") to + // Revision: The index of the revision that produced this element. + Revision int64 `json:"revision,omitempty"` + + // Type: The type of provenance operation. + // + // Possible values: + // "OPERATION_TYPE_UNSPECIFIED" - Operation type unspecified. If no + // operation is specified a provenance entry is simply used to match + // against a `parent`. + // "ADD" - Add an element. + // "REMOVE" - Remove an element identified by `parent`. + // "REPLACE" - Replace an element identified by `parent`. + // "EVAL_REQUESTED" - Request human review for the element identified + // by `parent`. + // "EVAL_APPROVED" - Element is reviewed and approved at human review, + // confidence will be set to 1.0. + // "EVAL_SKIPPED" - Element is skipped in the validation process. + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -9036,8 +9269,8 @@ type GoogleCloudDocumentaiV1beta2DocumentTextAnchorTextSegment struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "EndIndex") to include in - // API requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "Id") to include in API + // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -9045,30 +9278,29 @@ type GoogleCloudDocumentaiV1beta2DocumentTextAnchorTextSegment struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentTextAnchorTextSegment) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentTextAnchorTextSegment +func (s *GoogleCloudDocumentaiV1beta2DocumentProvenance) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentProvenance raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2DocumentTextChange: This message is used -// for text changes aka. OCR corrections. -type GoogleCloudDocumentaiV1beta2DocumentTextChange struct { - // ChangedText: The text that replaces the text identified in the - // `text_anchor`. - ChangedText string `json:"changedText,omitempty"` +// GoogleCloudDocumentaiV1beta2DocumentProvenanceParent: The parent +// element the current element is based on. Used for +// referencing/aligning, removal and replacement operations. +type GoogleCloudDocumentaiV1beta2DocumentProvenanceParent struct { + // Id: The id of the parent provenance. + Id int64 `json:"id,omitempty"` - // Provenance: The history of this annotation. - Provenance []*GoogleCloudDocumentaiV1beta2DocumentProvenance `json:"provenance,omitempty"` + // Index: The index of the parent item in the corresponding item list + // (eg. list of entities, properties within entities, etc.) in the + // parent revision. + Index int64 `json:"index,omitempty"` - // TextAnchor: Provenance of the correction. Text anchor indexing into - // the Document.text. There can only be a single - // `TextAnchor.text_segments` element. If the start and end index of the - // text segment are the same, the text change is inserted before that - // index. - TextAnchor *GoogleCloudDocumentaiV1beta2DocumentTextAnchor `json:"textAnchor,omitempty"` + // Revision: The index of the index into current revision's parent_ids + // list. + Revision int64 `json:"revision,omitempty"` - // ForceSendFields is a list of field names (e.g. "ChangedText") to + // ForceSendFields is a list of field names (e.g. "Id") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -9076,27 +9308,52 @@ type GoogleCloudDocumentaiV1beta2DocumentTextChange struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ChangedText") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "Id") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2DocumentTextChange) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2DocumentTextChange +func (s *GoogleCloudDocumentaiV1beta2DocumentProvenanceParent) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentProvenanceParent raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2GcsDestination: The Google Cloud Storage -// location where the output file will be written to. -type GoogleCloudDocumentaiV1beta2GcsDestination struct { - Uri string `json:"uri,omitempty"` +// GoogleCloudDocumentaiV1beta2DocumentRevision: Contains past or +// forward revisions of this document. +type GoogleCloudDocumentaiV1beta2DocumentRevision struct { + // Agent: If the change was made by a person specify the name or id of + // that person. + Agent string `json:"agent,omitempty"` - // ForceSendFields is a list of field names (e.g. "Uri") to + // CreateTime: The time that the revision was created. + CreateTime string `json:"createTime,omitempty"` + + // HumanReview: Human Review information of this revision. + HumanReview *GoogleCloudDocumentaiV1beta2DocumentRevisionHumanReview `json:"humanReview,omitempty"` + + // Id: Id of the revision. Unique within the context of the document. + Id string `json:"id,omitempty"` + + // Parent: The revisions that this revision is based on. This can + // include one or more parent (when documents are merged.) This field + // represents the index into the `revisions` field. + Parent []int64 `json:"parent,omitempty"` + + // ParentIds: The revisions that this revision is based on. Must include + // all the ids that have anything to do with this revision - eg. there + // are `provenance.parent.revision` fields that index into this field. + ParentIds []string `json:"parentIds,omitempty"` + + // Processor: If the annotation was made by processor identify the + // processor by its resource name. + Processor string `json:"processor,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Agent") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -9104,7 +9361,7 @@ type GoogleCloudDocumentaiV1beta2GcsDestination struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Uri") to include in API + // NullFields is a list of field names (e.g. "Agent") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -9113,18 +9370,24 @@ type GoogleCloudDocumentaiV1beta2GcsDestination struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2GcsDestination) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2GcsDestination +func (s *GoogleCloudDocumentaiV1beta2DocumentRevision) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentRevision raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2GcsSource: The Google Cloud Storage -// location where the input file will be read from. -type GoogleCloudDocumentaiV1beta2GcsSource struct { - Uri string `json:"uri,omitempty"` +// GoogleCloudDocumentaiV1beta2DocumentRevisionHumanReview: Human Review +// information of the document. +type GoogleCloudDocumentaiV1beta2DocumentRevisionHumanReview struct { + // State: Human review state. e.g. `requested`, `succeeded`, `rejected`. + State string `json:"state,omitempty"` - // ForceSendFields is a list of field names (e.g. "Uri") to + // StateMessage: A message providing more details about the current + // state of processing. For example, the rejection reason when the state + // is `rejected`. + StateMessage string `json:"stateMessage,omitempty"` + + // ForceSendFields is a list of field names (e.g. "State") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -9132,7 +9395,7 @@ type GoogleCloudDocumentaiV1beta2GcsSource struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Uri") to include in API + // NullFields is a list of field names (e.g. "State") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -9141,33 +9404,27 @@ type GoogleCloudDocumentaiV1beta2GcsSource struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2GcsSource) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2GcsSource +func (s *GoogleCloudDocumentaiV1beta2DocumentRevisionHumanReview) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentRevisionHumanReview raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2InputConfig: The desired input location -// and metadata. -type GoogleCloudDocumentaiV1beta2InputConfig struct { - // Contents: Content in bytes, represented as a stream of bytes. Note: - // As with all `bytes` fields, proto buffer messages use a pure binary - // representation, whereas JSON representations use base64. This field - // only works for synchronous ProcessDocument method. - Contents string `json:"contents,omitempty"` +// GoogleCloudDocumentaiV1beta2DocumentShardInfo: For a large document, +// sharding may be performed to produce several document shards. Each +// document shard contains this field to detail which shard it is. +type GoogleCloudDocumentaiV1beta2DocumentShardInfo struct { + // ShardCount: Total number of shards. + ShardCount int64 `json:"shardCount,omitempty,string"` - // GcsSource: The Google Cloud Storage location to read the input from. - // This must be a single file. - GcsSource *GoogleCloudDocumentaiV1beta2GcsSource `json:"gcsSource,omitempty"` + // ShardIndex: The 0-based index of this shard. + ShardIndex int64 `json:"shardIndex,omitempty,string"` - // MimeType: Required. Mimetype of the input. Current supported - // mimetypes are application/pdf, image/tiff, and image/gif. In - // addition, application/json type is supported for requests with - // ProcessDocumentRequest.automl_params field set. The JSON file needs - // to be in Document format. - MimeType string `json:"mimeType,omitempty"` + // TextOffset: The index of the first character in Document.text in the + // overall document global text. + TextOffset int64 `json:"textOffset,omitempty,string"` - // ForceSendFields is a list of field names (e.g. "Contents") to + // ForceSendFields is a list of field names (e.g. "ShardCount") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -9175,7 +9432,7 @@ type GoogleCloudDocumentaiV1beta2InputConfig struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Contents") to include in + // NullFields is a list of field names (e.g. "ShardCount") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -9184,88 +9441,126 @@ type GoogleCloudDocumentaiV1beta2InputConfig struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2InputConfig) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2InputConfig +func (s *GoogleCloudDocumentaiV1beta2DocumentShardInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentShardInfo raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2NormalizedVertex: A vertex represents a -// 2D point in the image. NOTE: the normalized vertex coordinates are -// relative to the original image and range from 0 to 1. -type GoogleCloudDocumentaiV1beta2NormalizedVertex struct { - // X: X coordinate. - X float64 `json:"x,omitempty"` +// GoogleCloudDocumentaiV1beta2DocumentStyle: Annotation for common text +// style attributes. This adheres to CSS conventions as much as +// possible. +type GoogleCloudDocumentaiV1beta2DocumentStyle struct { + // BackgroundColor: Text background color. + BackgroundColor *GoogleTypeColor `json:"backgroundColor,omitempty"` - // Y: Y coordinate (starts from the top of the image). - Y float64 `json:"y,omitempty"` + // Color: Text color. + Color *GoogleTypeColor `json:"color,omitempty"` - // ForceSendFields is a list of field names (e.g. "X") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` + // FontFamily: Font family such as `Arial`, `Times New Roman`. + // https://www.w3schools.com/cssref/pr_font_font-family.asp + FontFamily string `json:"fontFamily,omitempty"` - // NullFields is a list of field names (e.g. "X") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} + // FontSize: Font size. + FontSize *GoogleCloudDocumentaiV1beta2DocumentStyleFontSize `json:"fontSize,omitempty"` -func (s *GoogleCloudDocumentaiV1beta2NormalizedVertex) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2NormalizedVertex + // FontWeight: Font weight. Possible values are normal, bold, bolder, + // and lighter. https://www.w3schools.com/cssref/pr_font_weight.asp + FontWeight string `json:"fontWeight,omitempty"` + + // TextAnchor: Text anchor indexing into the Document.text. + TextAnchor *GoogleCloudDocumentaiV1beta2DocumentTextAnchor `json:"textAnchor,omitempty"` + + // TextDecoration: Text decoration. Follows CSS standard. + // https://www.w3schools.com/cssref/pr_text_text-decoration.asp + TextDecoration string `json:"textDecoration,omitempty"` + + // TextStyle: Text style. Possible values are normal, italic, and + // oblique. https://www.w3schools.com/cssref/pr_font_font-style.asp + TextStyle string `json:"textStyle,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BackgroundColor") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "BackgroundColor") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDocumentaiV1beta2DocumentStyle) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentStyle raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *GoogleCloudDocumentaiV1beta2NormalizedVertex) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudDocumentaiV1beta2NormalizedVertex +// GoogleCloudDocumentaiV1beta2DocumentStyleFontSize: Font size with +// unit. +type GoogleCloudDocumentaiV1beta2DocumentStyleFontSize struct { + // Size: Font size for the text. + Size float64 `json:"size,omitempty"` + + // Unit: Unit for the font size. Follows CSS naming (in, px, pt, etc.). + Unit string `json:"unit,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Size") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Size") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDocumentaiV1beta2DocumentStyleFontSize) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentStyleFontSize + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *GoogleCloudDocumentaiV1beta2DocumentStyleFontSize) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentStyleFontSize var s1 struct { - X gensupport.JSONFloat64 `json:"x"` - Y gensupport.JSONFloat64 `json:"y"` + Size gensupport.JSONFloat64 `json:"size"` *NoMethod } s1.NoMethod = (*NoMethod)(s) if err := json.Unmarshal(data, &s1); err != nil { return err } - s.X = float64(s1.X) - s.Y = float64(s1.Y) + s.Size = float64(s1.Size) return nil } -// GoogleCloudDocumentaiV1beta2OperationMetadata: Contains metadata for -// the BatchProcessDocuments operation. -type GoogleCloudDocumentaiV1beta2OperationMetadata struct { - // CreateTime: The creation time of the operation. - CreateTime string `json:"createTime,omitempty"` - - // State: The state of the current batch processing. - // - // Possible values: - // "STATE_UNSPECIFIED" - The default value. This value is used if the - // state is omitted. - // "ACCEPTED" - Request is received. - // "WAITING" - Request operation is waiting for scheduling. - // "RUNNING" - Request is being processed. - // "SUCCEEDED" - The batch processing completed successfully. - // "CANCELLED" - The batch processing was cancelled. - // "FAILED" - The batch processing has failed. - State string `json:"state,omitempty"` - - // StateMessage: A message providing more details about the current - // state of processing. - StateMessage string `json:"stateMessage,omitempty"` +// GoogleCloudDocumentaiV1beta2DocumentTextAnchor: Text reference +// indexing into the Document.text. +type GoogleCloudDocumentaiV1beta2DocumentTextAnchor struct { + // Content: Contains the content of the text span so that users do not + // have to look it up in the text_segments. It is always populated for + // formFields. + Content string `json:"content,omitempty"` - // UpdateTime: The last update time of the operation. - UpdateTime string `json:"updateTime,omitempty"` + // TextSegments: The text segments from the Document.text. + TextSegments []*GoogleCloudDocumentaiV1beta2DocumentTextAnchorTextSegment `json:"textSegments,omitempty"` - // ForceSendFields is a list of field names (e.g. "CreateTime") to + // ForceSendFields is a list of field names (e.g. "Content") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -9273,7 +9568,7 @@ type GoogleCloudDocumentaiV1beta2OperationMetadata struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CreateTime") to include in + // NullFields is a list of field names (e.g. "Content") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -9282,32 +9577,25 @@ type GoogleCloudDocumentaiV1beta2OperationMetadata struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2OperationMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2OperationMetadata +func (s *GoogleCloudDocumentaiV1beta2DocumentTextAnchor) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentTextAnchor raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2OutputConfig: The desired output location -// and metadata. -type GoogleCloudDocumentaiV1beta2OutputConfig struct { - // GcsDestination: The Google Cloud Storage location to write the output - // to. - GcsDestination *GoogleCloudDocumentaiV1beta2GcsDestination `json:"gcsDestination,omitempty"` +// GoogleCloudDocumentaiV1beta2DocumentTextAnchorTextSegment: A text +// segment in the Document.text. The indices may be out of bounds which +// indicate that the text extends into another document shard for large +// sharded documents. See ShardInfo.text_offset +type GoogleCloudDocumentaiV1beta2DocumentTextAnchorTextSegment struct { + // EndIndex: TextSegment half open end UTF-8 char index in the + // Document.text. + EndIndex int64 `json:"endIndex,omitempty,string"` - // PagesPerShard: The max number of pages to include into each output - // Document shard JSON on Google Cloud Storage. The valid range is [1, - // 100]. If not specified, the default value is 20. For example, for one - // pdf file with 100 pages, 100 parsed pages will be produced. If - // `pages_per_shard` = 20, then 5 Document shard JSON files each - // containing 20 parsed pages will be written under the prefix - // OutputConfig.gcs_destination.uri and suffix pages-x-to-y.json where x - // and y are 1-indexed page numbers. Example GCS outputs with 157 pages - // and pages_per_shard = 50: pages-001-to-050.json pages-051-to-100.json - // pages-101-to-150.json pages-151-to-157.json - PagesPerShard int64 `json:"pagesPerShard,omitempty"` + // StartIndex: TextSegment start UTF-8 char index in the Document.text. + StartIndex int64 `json:"startIndex,omitempty,string"` - // ForceSendFields is a list of field names (e.g. "GcsDestination") to + // ForceSendFields is a list of field names (e.g. "EndIndex") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -9315,35 +9603,39 @@ type GoogleCloudDocumentaiV1beta2OutputConfig struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "GcsDestination") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "EndIndex") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2OutputConfig) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2OutputConfig +func (s *GoogleCloudDocumentaiV1beta2DocumentTextAnchorTextSegment) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentTextAnchorTextSegment raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2ProcessDocumentResponse: Response to a -// single document processing request. -type GoogleCloudDocumentaiV1beta2ProcessDocumentResponse struct { - // InputConfig: Information about the input file. This is the same as - // the corresponding input config in the request. - InputConfig *GoogleCloudDocumentaiV1beta2InputConfig `json:"inputConfig,omitempty"` +// GoogleCloudDocumentaiV1beta2DocumentTextChange: This message is used +// for text changes aka. OCR corrections. +type GoogleCloudDocumentaiV1beta2DocumentTextChange struct { + // ChangedText: The text that replaces the text identified in the + // `text_anchor`. + ChangedText string `json:"changedText,omitempty"` - // OutputConfig: The output location of the parsed responses. The - // responses are written to this location as JSON-serialized `Document` - // objects. - OutputConfig *GoogleCloudDocumentaiV1beta2OutputConfig `json:"outputConfig,omitempty"` + // Provenance: The history of this annotation. + Provenance []*GoogleCloudDocumentaiV1beta2DocumentProvenance `json:"provenance,omitempty"` - // ForceSendFields is a list of field names (e.g. "InputConfig") to + // TextAnchor: Provenance of the correction. Text anchor indexing into + // the Document.text. There can only be a single + // `TextAnchor.text_segments` element. If the start and end index of the + // text segment are the same, the text change is inserted before that + // index. + TextAnchor *GoogleCloudDocumentaiV1beta2DocumentTextAnchor `json:"textAnchor,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ChangedText") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -9351,7 +9643,7 @@ type GoogleCloudDocumentaiV1beta2ProcessDocumentResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "InputConfig") to include + // NullFields is a list of field names (e.g. "ChangedText") to include // in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. However, any field with // an empty value appearing in NullFields will be sent to the server as @@ -9360,23 +9652,18 @@ type GoogleCloudDocumentaiV1beta2ProcessDocumentResponse struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2ProcessDocumentResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2ProcessDocumentResponse +func (s *GoogleCloudDocumentaiV1beta2DocumentTextChange) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2DocumentTextChange raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta2Vertex: A vertex represents a 2D point in -// the image. NOTE: the vertex coordinates are in the same scale as the -// original image. -type GoogleCloudDocumentaiV1beta2Vertex struct { - // X: X coordinate. - X int64 `json:"x,omitempty"` - - // Y: Y coordinate (starts from the top of the image). - Y int64 `json:"y,omitempty"` +// GoogleCloudDocumentaiV1beta2GcsDestination: The Google Cloud Storage +// location where the output file will be written to. +type GoogleCloudDocumentaiV1beta2GcsDestination struct { + Uri string `json:"uri,omitempty"` - // ForceSendFields is a list of field names (e.g. "X") to + // ForceSendFields is a list of field names (e.g. "Uri") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -9384,7 +9671,7 @@ type GoogleCloudDocumentaiV1beta2Vertex struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "X") to include in API + // NullFields is a list of field names (e.g. "Uri") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -9393,44 +9680,18 @@ type GoogleCloudDocumentaiV1beta2Vertex struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta2Vertex) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta2Vertex +func (s *GoogleCloudDocumentaiV1beta2GcsDestination) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2GcsDestination raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta3BatchProcessMetadata: The long running -// operation metadata for batch process method. -type GoogleCloudDocumentaiV1beta3BatchProcessMetadata struct { - // CreateTime: The creation time of the operation. - CreateTime string `json:"createTime,omitempty"` - - // IndividualProcessStatuses: The list of response details of each - // document. - IndividualProcessStatuses []*GoogleCloudDocumentaiV1beta3BatchProcessMetadataIndividualProcessStatus `json:"individualProcessStatuses,omitempty"` - - // State: The state of the current batch processing. - // - // Possible values: - // "STATE_UNSPECIFIED" - The default value. This value is used if the - // state is omitted. - // "WAITING" - Request operation is waiting for scheduling. - // "RUNNING" - Request is being processed. - // "SUCCEEDED" - The batch processing completed successfully. - // "CANCELLING" - The batch processing was being cancelled. - // "CANCELLED" - The batch processing was cancelled. - // "FAILED" - The batch processing has failed. - State string `json:"state,omitempty"` - - // StateMessage: A message providing more details about the current - // state of processing. For example, the error message if the operation - // is failed. - StateMessage string `json:"stateMessage,omitempty"` - - // UpdateTime: The last update time of the operation. - UpdateTime string `json:"updateTime,omitempty"` +// GoogleCloudDocumentaiV1beta2GcsSource: The Google Cloud Storage +// location where the input file will be read from. +type GoogleCloudDocumentaiV1beta2GcsSource struct { + Uri string `json:"uri,omitempty"` - // ForceSendFields is a list of field names (e.g. "CreateTime") to + // ForceSendFields is a list of field names (e.g. "Uri") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -9438,8 +9699,8 @@ type GoogleCloudDocumentaiV1beta3BatchProcessMetadata struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CreateTime") to include in - // API requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "Uri") to include in API + // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -9447,88 +9708,121 @@ type GoogleCloudDocumentaiV1beta3BatchProcessMetadata struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta3BatchProcessMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta3BatchProcessMetadata +func (s *GoogleCloudDocumentaiV1beta2GcsSource) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2GcsSource raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta3BatchProcessMetadataIndividualProcessStatu -// s: The status of a each individual document in the batch process. -type GoogleCloudDocumentaiV1beta3BatchProcessMetadataIndividualProcessStatus struct { - // HumanReviewOperation: The name of the operation triggered by the - // processed document. If the human review process is not triggered, - // this field will be empty. It has the same response type and metadata - // as the long running operation returned by ReviewDocument method. - HumanReviewOperation string `json:"humanReviewOperation,omitempty"` +// GoogleCloudDocumentaiV1beta2InputConfig: The desired input location +// and metadata. +type GoogleCloudDocumentaiV1beta2InputConfig struct { + // Contents: Content in bytes, represented as a stream of bytes. Note: + // As with all `bytes` fields, proto buffer messages use a pure binary + // representation, whereas JSON representations use base64. This field + // only works for synchronous ProcessDocument method. + Contents string `json:"contents,omitempty"` - // HumanReviewStatus: The status of human review on the processed - // document. - HumanReviewStatus *GoogleCloudDocumentaiV1beta3HumanReviewStatus `json:"humanReviewStatus,omitempty"` + // GcsSource: The Google Cloud Storage location to read the input from. + // This must be a single file. + GcsSource *GoogleCloudDocumentaiV1beta2GcsSource `json:"gcsSource,omitempty"` - // InputGcsSource: The source of the document, same as the - // [input_gcs_source] field in the request when the batch process - // started. The batch process is started by take snapshot of that - // document, since a user can move or change that document during the - // process. - InputGcsSource string `json:"inputGcsSource,omitempty"` + // MimeType: Required. Mimetype of the input. Current supported + // mimetypes are application/pdf, image/tiff, and image/gif. In + // addition, application/json type is supported for requests with + // ProcessDocumentRequest.automl_params field set. The JSON file needs + // to be in Document format. + MimeType string `json:"mimeType,omitempty"` - // OutputGcsDestination: The output_gcs_destination (in the request as - // `output_gcs_destination`) of the processed document if it was - // successful, otherwise empty. - OutputGcsDestination string `json:"outputGcsDestination,omitempty"` + // ForceSendFields is a list of field names (e.g. "Contents") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` - // Status: The status processing the document. - Status *GoogleRpcStatus `json:"status,omitempty"` + // NullFields is a list of field names (e.g. "Contents") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} - // ForceSendFields is a list of field names (e.g. - // "HumanReviewOperation") to unconditionally include in API requests. - // By default, fields with empty or default values are omitted from API - // requests. However, any non-pointer, non-interface field appearing in - // ForceSendFields will be sent to the server regardless of whether the - // field is empty or not. This may be used to include empty fields in - // Patch requests. +func (s *GoogleCloudDocumentaiV1beta2InputConfig) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2InputConfig + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDocumentaiV1beta2NormalizedVertex: A vertex represents a +// 2D point in the image. NOTE: the normalized vertex coordinates are +// relative to the original image and range from 0 to 1. +type GoogleCloudDocumentaiV1beta2NormalizedVertex struct { + // X: X coordinate. + X float64 `json:"x,omitempty"` + + // Y: Y coordinate (starts from the top of the image). + Y float64 `json:"y,omitempty"` + + // ForceSendFields is a list of field names (e.g. "X") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "HumanReviewOperation") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "X") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta3BatchProcessMetadataIndividualProcessStatus) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta3BatchProcessMetadataIndividualProcessStatus +func (s *GoogleCloudDocumentaiV1beta2NormalizedVertex) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2NormalizedVertex raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta3BatchProcessResponse: Response message -// for batch process document method. -type GoogleCloudDocumentaiV1beta3BatchProcessResponse struct { +func (s *GoogleCloudDocumentaiV1beta2NormalizedVertex) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDocumentaiV1beta2NormalizedVertex + var s1 struct { + X gensupport.JSONFloat64 `json:"x"` + Y gensupport.JSONFloat64 `json:"y"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.X = float64(s1.X) + s.Y = float64(s1.Y) + return nil } -// GoogleCloudDocumentaiV1beta3CommonOperationMetadata: The common -// metadata for long running operations. -type GoogleCloudDocumentaiV1beta3CommonOperationMetadata struct { +// GoogleCloudDocumentaiV1beta2OperationMetadata: Contains metadata for +// the BatchProcessDocuments operation. +type GoogleCloudDocumentaiV1beta2OperationMetadata struct { // CreateTime: The creation time of the operation. CreateTime string `json:"createTime,omitempty"` - // Resource: A related resource to this operation. - Resource string `json:"resource,omitempty"` - - // State: The state of the operation. + // State: The state of the current batch processing. // // Possible values: - // "STATE_UNSPECIFIED" - Unspecified state. - // "RUNNING" - Operation is still running. - // "CANCELLING" - Operation is being cancelled. - // "SUCCEEDED" - Operation succeeded. - // "FAILED" - Operation failed. - // "CANCELLED" - Operation is cancelled. + // "STATE_UNSPECIFIED" - The default value. This value is used if the + // state is omitted. + // "ACCEPTED" - Request is received. + // "WAITING" - Request operation is waiting for scheduling. + // "RUNNING" - Request is being processed. + // "SUCCEEDED" - The batch processing completed successfully. + // "CANCELLED" - The batch processing was cancelled. + // "FAILED" - The batch processing has failed. State string `json:"state,omitempty"` // StateMessage: A message providing more details about the current @@ -9555,19 +9849,32 @@ type GoogleCloudDocumentaiV1beta3CommonOperationMetadata struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta3CommonOperationMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta3CommonOperationMetadata +func (s *GoogleCloudDocumentaiV1beta2OperationMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2OperationMetadata raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta3DeleteProcessorMetadata: The long running -// operation metadata for delete processor method. -type GoogleCloudDocumentaiV1beta3DeleteProcessorMetadata struct { - // CommonMetadata: The basic metadata of the long running operation. - CommonMetadata *GoogleCloudDocumentaiV1beta3CommonOperationMetadata `json:"commonMetadata,omitempty"` +// GoogleCloudDocumentaiV1beta2OutputConfig: The desired output location +// and metadata. +type GoogleCloudDocumentaiV1beta2OutputConfig struct { + // GcsDestination: The Google Cloud Storage location to write the output + // to. + GcsDestination *GoogleCloudDocumentaiV1beta2GcsDestination `json:"gcsDestination,omitempty"` - // ForceSendFields is a list of field names (e.g. "CommonMetadata") to + // PagesPerShard: The max number of pages to include into each output + // Document shard JSON on Google Cloud Storage. The valid range is [1, + // 100]. If not specified, the default value is 20. For example, for one + // pdf file with 100 pages, 100 parsed pages will be produced. If + // `pages_per_shard` = 20, then 5 Document shard JSON files each + // containing 20 parsed pages will be written under the prefix + // OutputConfig.gcs_destination.uri and suffix pages-x-to-y.json where x + // and y are 1-indexed page numbers. Example GCS outputs with 157 pages + // and pages_per_shard = 50: pages-001-to-050.json pages-051-to-100.json + // pages-101-to-150.json pages-151-to-157.json + PagesPerShard int64 `json:"pagesPerShard,omitempty"` + + // ForceSendFields is a list of field names (e.g. "GcsDestination") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -9575,7 +9882,7 @@ type GoogleCloudDocumentaiV1beta3DeleteProcessorMetadata struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CommonMetadata") to + // NullFields is a list of field names (e.g. "GcsDestination") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the @@ -9585,19 +9892,25 @@ type GoogleCloudDocumentaiV1beta3DeleteProcessorMetadata struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta3DeleteProcessorMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta3DeleteProcessorMetadata +func (s *GoogleCloudDocumentaiV1beta2OutputConfig) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2OutputConfig raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta3DeleteProcessorVersionMetadata: The long -// running operation metadata for delete processor version method. -type GoogleCloudDocumentaiV1beta3DeleteProcessorVersionMetadata struct { - // CommonMetadata: The basic metadata of the long running operation. - CommonMetadata *GoogleCloudDocumentaiV1beta3CommonOperationMetadata `json:"commonMetadata,omitempty"` +// GoogleCloudDocumentaiV1beta2ProcessDocumentResponse: Response to a +// single document processing request. +type GoogleCloudDocumentaiV1beta2ProcessDocumentResponse struct { + // InputConfig: Information about the input file. This is the same as + // the corresponding input config in the request. + InputConfig *GoogleCloudDocumentaiV1beta2InputConfig `json:"inputConfig,omitempty"` - // ForceSendFields is a list of field names (e.g. "CommonMetadata") to + // OutputConfig: The output location of the parsed responses. The + // responses are written to this location as JSON-serialized `Document` + // objects. + OutputConfig *GoogleCloudDocumentaiV1beta2OutputConfig `json:"outputConfig,omitempty"` + + // ForceSendFields is a list of field names (e.g. "InputConfig") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -9605,29 +9918,32 @@ type GoogleCloudDocumentaiV1beta3DeleteProcessorVersionMetadata struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CommonMetadata") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "InputConfig") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta3DeleteProcessorVersionMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta3DeleteProcessorVersionMetadata +func (s *GoogleCloudDocumentaiV1beta2ProcessDocumentResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2ProcessDocumentResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta3DeployProcessorVersionMetadata: The long -// running operation metadata for deploy processor version method. -type GoogleCloudDocumentaiV1beta3DeployProcessorVersionMetadata struct { - // CommonMetadata: The basic metadata of the long running operation. - CommonMetadata *GoogleCloudDocumentaiV1beta3CommonOperationMetadata `json:"commonMetadata,omitempty"` +// GoogleCloudDocumentaiV1beta2Vertex: A vertex represents a 2D point in +// the image. NOTE: the vertex coordinates are in the same scale as the +// original image. +type GoogleCloudDocumentaiV1beta2Vertex struct { + // X: X coordinate. + X int64 `json:"x,omitempty"` - // ForceSendFields is a list of field names (e.g. "CommonMetadata") to + // Y: Y coordinate (starts from the top of the image). + Y int64 `json:"y,omitempty"` + + // ForceSendFields is a list of field names (e.g. "X") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -9635,24 +9951,275 @@ type GoogleCloudDocumentaiV1beta3DeployProcessorVersionMetadata struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CommonMetadata") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "X") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDocumentaiV1beta3DeployProcessorVersionMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1beta3DeployProcessorVersionMetadata +func (s *GoogleCloudDocumentaiV1beta2Vertex) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta2Vertex raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1beta3DeployProcessorVersionResponse: Response -// message for the deploy processor version method. +// GoogleCloudDocumentaiV1beta3BatchProcessMetadata: The long running +// operation metadata for batch process method. +type GoogleCloudDocumentaiV1beta3BatchProcessMetadata struct { + // CreateTime: The creation time of the operation. + CreateTime string `json:"createTime,omitempty"` + + // IndividualProcessStatuses: The list of response details of each + // document. + IndividualProcessStatuses []*GoogleCloudDocumentaiV1beta3BatchProcessMetadataIndividualProcessStatus `json:"individualProcessStatuses,omitempty"` + + // State: The state of the current batch processing. + // + // Possible values: + // "STATE_UNSPECIFIED" - The default value. This value is used if the + // state is omitted. + // "WAITING" - Request operation is waiting for scheduling. + // "RUNNING" - Request is being processed. + // "SUCCEEDED" - The batch processing completed successfully. + // "CANCELLING" - The batch processing was being cancelled. + // "CANCELLED" - The batch processing was cancelled. + // "FAILED" - The batch processing has failed. + State string `json:"state,omitempty"` + + // StateMessage: A message providing more details about the current + // state of processing. For example, the error message if the operation + // is failed. + StateMessage string `json:"stateMessage,omitempty"` + + // UpdateTime: The last update time of the operation. + UpdateTime string `json:"updateTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDocumentaiV1beta3BatchProcessMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta3BatchProcessMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDocumentaiV1beta3BatchProcessMetadataIndividualProcessStatu +// s: The status of a each individual document in the batch process. +type GoogleCloudDocumentaiV1beta3BatchProcessMetadataIndividualProcessStatus struct { + // HumanReviewOperation: The name of the operation triggered by the + // processed document. If the human review process is not triggered, + // this field will be empty. It has the same response type and metadata + // as the long running operation returned by ReviewDocument method. + HumanReviewOperation string `json:"humanReviewOperation,omitempty"` + + // HumanReviewStatus: The status of human review on the processed + // document. + HumanReviewStatus *GoogleCloudDocumentaiV1beta3HumanReviewStatus `json:"humanReviewStatus,omitempty"` + + // InputGcsSource: The source of the document, same as the + // [input_gcs_source] field in the request when the batch process + // started. The batch process is started by take snapshot of that + // document, since a user can move or change that document during the + // process. + InputGcsSource string `json:"inputGcsSource,omitempty"` + + // OutputGcsDestination: The output_gcs_destination (in the request as + // `output_gcs_destination`) of the processed document if it was + // successful, otherwise empty. + OutputGcsDestination string `json:"outputGcsDestination,omitempty"` + + // Status: The status processing the document. + Status *GoogleRpcStatus `json:"status,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "HumanReviewOperation") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "HumanReviewOperation") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDocumentaiV1beta3BatchProcessMetadataIndividualProcessStatus) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta3BatchProcessMetadataIndividualProcessStatus + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDocumentaiV1beta3BatchProcessResponse: Response message +// for batch process document method. +type GoogleCloudDocumentaiV1beta3BatchProcessResponse struct { +} + +// GoogleCloudDocumentaiV1beta3CommonOperationMetadata: The common +// metadata for long running operations. +type GoogleCloudDocumentaiV1beta3CommonOperationMetadata struct { + // CreateTime: The creation time of the operation. + CreateTime string `json:"createTime,omitempty"` + + // Resource: A related resource to this operation. + Resource string `json:"resource,omitempty"` + + // State: The state of the operation. + // + // Possible values: + // "STATE_UNSPECIFIED" - Unspecified state. + // "RUNNING" - Operation is still running. + // "CANCELLING" - Operation is being cancelled. + // "SUCCEEDED" - Operation succeeded. + // "FAILED" - Operation failed. + // "CANCELLED" - Operation is cancelled. + State string `json:"state,omitempty"` + + // StateMessage: A message providing more details about the current + // state of processing. + StateMessage string `json:"stateMessage,omitempty"` + + // UpdateTime: The last update time of the operation. + UpdateTime string `json:"updateTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDocumentaiV1beta3CommonOperationMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta3CommonOperationMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDocumentaiV1beta3DeleteProcessorMetadata: The long running +// operation metadata for delete processor method. +type GoogleCloudDocumentaiV1beta3DeleteProcessorMetadata struct { + // CommonMetadata: The basic metadata of the long running operation. + CommonMetadata *GoogleCloudDocumentaiV1beta3CommonOperationMetadata `json:"commonMetadata,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CommonMetadata") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CommonMetadata") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDocumentaiV1beta3DeleteProcessorMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta3DeleteProcessorMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDocumentaiV1beta3DeleteProcessorVersionMetadata: The long +// running operation metadata for delete processor version method. +type GoogleCloudDocumentaiV1beta3DeleteProcessorVersionMetadata struct { + // CommonMetadata: The basic metadata of the long running operation. + CommonMetadata *GoogleCloudDocumentaiV1beta3CommonOperationMetadata `json:"commonMetadata,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CommonMetadata") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CommonMetadata") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDocumentaiV1beta3DeleteProcessorVersionMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta3DeleteProcessorVersionMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDocumentaiV1beta3DeployProcessorVersionMetadata: The long +// running operation metadata for deploy processor version method. +type GoogleCloudDocumentaiV1beta3DeployProcessorVersionMetadata struct { + // CommonMetadata: The basic metadata of the long running operation. + CommonMetadata *GoogleCloudDocumentaiV1beta3CommonOperationMetadata `json:"commonMetadata,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CommonMetadata") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CommonMetadata") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDocumentaiV1beta3DeployProcessorVersionMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta3DeployProcessorVersionMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDocumentaiV1beta3DeployProcessorVersionResponse: Response +// message for the deploy processor version method. type GoogleCloudDocumentaiV1beta3DeployProcessorVersionResponse struct { } @@ -10748,84 +11315,868 @@ type GoogleTypePostalAddress struct { // indicator" (e.g. Côte d'Ivoire). SortingCode string `json:"sortingCode,omitempty"` - // Sublocality: Optional. Sublocality of the address. For example, this - // can be neighborhoods, boroughs, districts. - Sublocality string `json:"sublocality,omitempty"` + // Sublocality: Optional. Sublocality of the address. For example, this + // can be neighborhoods, boroughs, districts. + Sublocality string `json:"sublocality,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AddressLines") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AddressLines") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleTypePostalAddress) MarshalJSON() ([]byte, error) { + type NoMethod GoogleTypePostalAddress + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleTypeTimeZone: Represents a time zone from the IANA Time Zone +// Database (https://www.iana.org/time-zones). +type GoogleTypeTimeZone struct { + // Id: IANA Time Zone Database time zone, e.g. "America/New_York". + Id string `json:"id,omitempty"` + + // Version: Optional. IANA Time Zone Database version number, e.g. + // "2019a". + Version string `json:"version,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Id") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleTypeTimeZone) MarshalJSON() ([]byte, error) { + type NoMethod GoogleTypeTimeZone + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// method id "documentai.operations.delete": + +type OperationsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a long-running operation. This method indicates that +// the client is no longer interested in the operation result. It does +// not cancel the operation. If the server doesn't support this method, +// it returns `google.rpc.Code.UNIMPLEMENTED`. +// +// - name: The name of the operation resource to be deleted. +func (r *OperationsService) Delete(name string) *OperationsDeleteCall { + c := &OperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OperationsDeleteCall) Fields(s ...googleapi.Field) *OperationsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OperationsDeleteCall) Context(ctx context.Context) *OperationsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OperationsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OperationsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "documentai.operations.delete" call. +// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OperationsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleProtobufEmpty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.", + // "flatPath": "v1/operations/{operationsId}", + // "httpMethod": "DELETE", + // "id": "documentai.operations.delete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The name of the operation resource to be deleted.", + // "location": "path", + // "pattern": "^operations/.*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "response": { + // "$ref": "GoogleProtobufEmpty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "documentai.projects.locations.fetchProcessorTypes": + +type ProjectsLocationsFetchProcessorTypesCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// FetchProcessorTypes: Fetches processor types. Note that we do not use +// ListProcessorTypes here because it is not paginated. +// +// - parent: The project of processor type to list. The available +// processor types may depend on the allow-listing on projects. +// Format: `projects/{project}/locations/{location}`. +func (r *ProjectsLocationsService) FetchProcessorTypes(parent string) *ProjectsLocationsFetchProcessorTypesCall { + c := &ProjectsLocationsFetchProcessorTypesCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsFetchProcessorTypesCall) Fields(s ...googleapi.Field) *ProjectsLocationsFetchProcessorTypesCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsFetchProcessorTypesCall) IfNoneMatch(entityTag string) *ProjectsLocationsFetchProcessorTypesCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsFetchProcessorTypesCall) Context(ctx context.Context) *ProjectsLocationsFetchProcessorTypesCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsFetchProcessorTypesCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsFetchProcessorTypesCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:fetchProcessorTypes") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "documentai.projects.locations.fetchProcessorTypes" call. +// Exactly one of *GoogleCloudDocumentaiV1FetchProcessorTypesResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDocumentaiV1FetchProcessorTypesResponse.ServerResponse.Hea +// der or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsFetchProcessorTypesCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDocumentaiV1FetchProcessorTypesResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudDocumentaiV1FetchProcessorTypesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Fetches processor types. Note that we do not use ListProcessorTypes here because it is not paginated.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}:fetchProcessorTypes", + // "httpMethod": "GET", + // "id": "documentai.projects.locations.fetchProcessorTypes", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. The project of processor type to list. The available processor types may depend on the allow-listing on projects. Format: `projects/{project}/locations/{location}`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+parent}:fetchProcessorTypes", + // "response": { + // "$ref": "GoogleCloudDocumentaiV1FetchProcessorTypesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "documentai.projects.locations.get": + +type ProjectsLocationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets information about a location. +// +// - name: Resource name for the location. +func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall { + c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "documentai.projects.locations.get" call. +// Exactly one of *GoogleCloudLocationLocation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleCloudLocationLocation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudLocationLocation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudLocationLocation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets information about a location.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}", + // "httpMethod": "GET", + // "id": "documentai.projects.locations.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Resource name for the location.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "response": { + // "$ref": "GoogleCloudLocationLocation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "documentai.projects.locations.list": + +type ProjectsLocationsListCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists information about the supported locations for this +// service. +// +// - name: The resource that owns the locations collection, if +// applicable. +func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall { + c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Filter sets the optional parameter "filter": A filter to narrow down +// results to a preferred subset. The filtering language accepts strings +// like "displayName=tokyo", and is documented in more detail in +// AIP-160 (https://google.aip.dev/160). +func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return. If not set, the service selects a default. +func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token +// received from the `next_page_token` field in the response. Send that +// page token to receive the subsequent page. +func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "documentai.projects.locations.list" call. +// Exactly one of *GoogleCloudLocationListLocationsResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudLocationListLocationsResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudLocationListLocationsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudLocationListLocationsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists information about the supported locations for this service.", + // "flatPath": "v1/projects/{projectsId}/locations", + // "httpMethod": "GET", + // "id": "documentai.projects.locations.list", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "filter": { + // "description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like `\"displayName=tokyo\"`, and is documented in more detail in [AIP-160](https://google.aip.dev/160).", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "The resource that owns the locations collection, if applicable.", + // "location": "path", + // "pattern": "^projects/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of results to return. If not set, the service selects a default.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/{+name}/locations", + // "response": { + // "$ref": "GoogleCloudLocationListLocationsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} - // ForceSendFields is a list of field names (e.g. "AddressLines") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*GoogleCloudLocationListLocationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} - // NullFields is a list of field names (e.g. "AddressLines") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` +// method id "documentai.projects.locations.operations.cancel": + +type ProjectsLocationsOperationsCancelCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -func (s *GoogleTypePostalAddress) MarshalJSON() ([]byte, error) { - type NoMethod GoogleTypePostalAddress - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +// Cancel: Starts asynchronous cancellation on a long-running operation. +// The server makes a best effort to cancel the operation, but success +// is not guaranteed. If the server doesn't support this method, it +// returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use +// Operations.GetOperation or other methods to check whether the +// cancellation succeeded or whether the operation completed despite +// cancellation. On successful cancellation, the operation is not +// deleted; instead, it becomes an operation with an Operation.error +// value with a google.rpc.Status.code of 1, corresponding to +// `Code.CANCELLED`. +// +// - name: The name of the operation resource to be cancelled. +func (r *ProjectsLocationsOperationsService) Cancel(name string) *ProjectsLocationsOperationsCancelCall { + c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c } -// GoogleTypeTimeZone: Represents a time zone from the IANA Time Zone -// Database (https://www.iana.org/time-zones). -type GoogleTypeTimeZone struct { - // Id: IANA Time Zone Database time zone, e.g. "America/New_York". - Id string `json:"id,omitempty"` +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} - // Version: Optional. IANA Time Zone Database version number, e.g. - // "2019a". - Version string `json:"version,omitempty"` +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall { + c.ctx_ = ctx + return c +} - // ForceSendFields is a list of field names (e.g. "Id") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} - // NullFields is a list of field names (e.g. "Id") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` +func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } -func (s *GoogleTypeTimeZone) MarshalJSON() ([]byte, error) { - type NoMethod GoogleTypeTimeZone - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +// Do executes the "documentai.projects.locations.operations.cancel" call. +// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleProtobufEmpty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}:cancel", + // "httpMethod": "POST", + // "id": "documentai.projects.locations.operations.cancel", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The name of the operation resource to be cancelled.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}:cancel", + // "response": { + // "$ref": "GoogleProtobufEmpty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + } -// method id "documentai.operations.delete": +// method id "documentai.projects.locations.operations.get": -type OperationsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsOperationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a long-running operation. This method indicates that -// the client is no longer interested in the operation result. It does -// not cancel the operation. If the server doesn't support this method, -// it returns `google.rpc.Code.UNIMPLEMENTED`. +// Get: Gets the latest state of a long-running operation. Clients can +// use this method to poll the operation result at intervals as +// recommended by the API service. // -// - name: The name of the operation resource to be deleted. -func (r *OperationsService) Delete(name string) *OperationsDeleteCall { - c := &OperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the operation resource. +func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall { + c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -10833,41 +12184,54 @@ func (r *OperationsService) Delete(name string) *OperationsDeleteCall { // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OperationsDeleteCall) Fields(s ...googleapi.Field) *OperationsDeleteCall { +func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OperationsDeleteCall) Context(ctx context.Context) *OperationsDeleteCall { +func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OperationsDeleteCall) Header() http.Header { +func (c *ProjectsLocationsOperationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OperationsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -10878,14 +12242,14 @@ func (c *OperationsDeleteCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "documentai.operations.delete" call. -// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "documentai.projects.locations.operations.get" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *OperationsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { +func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10904,7 +12268,7 @@ func (c *OperationsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobuf if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleProtobufEmpty{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10916,25 +12280,25 @@ func (c *OperationsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobuf } return ret, nil // { - // "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.", - // "flatPath": "v1/operations/{operationsId}", - // "httpMethod": "DELETE", - // "id": "documentai.operations.delete", + // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}", + // "httpMethod": "GET", + // "id": "documentai.projects.locations.operations.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The name of the operation resource to be deleted.", + // "description": "The name of the operation resource.", // "location": "path", - // "pattern": "^operations/.*$", + // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1/{+name}", // "response": { - // "$ref": "GoogleProtobufEmpty" + // "$ref": "GoogleLongrunningOperation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -10943,33 +12307,60 @@ func (c *OperationsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobuf } -// method id "documentai.projects.locations.fetchProcessorTypes": +// method id "documentai.projects.locations.operations.list": -type ProjectsLocationsFetchProcessorTypesCall struct { +type ProjectsLocationsOperationsListCall struct { s *Service - parent string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// FetchProcessorTypes: Fetches processor types. Note that we do not use -// ListProcessorTypes here because it is not paginated. +// List: Lists operations that match the specified filter in the +// request. If the server doesn't support this method, it returns +// `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to +// override the binding to use different resource name schemes, such as +// `users/*/operations`. To override the binding, API services can add a +// binding such as "/v1/{name=users/*}/operations" to their service +// configuration. For backwards compatibility, the default name includes +// the operations collection id, however overriding users must ensure +// the name binding is the parent resource, without the operations +// collection id. // -// - parent: The project of processor type to list. The available -// processor types may depend on the allow-listing on projects. -// Format: `projects/{project}/locations/{location}`. -func (r *ProjectsLocationsService) FetchProcessorTypes(parent string) *ProjectsLocationsFetchProcessorTypesCall { - c := &ProjectsLocationsFetchProcessorTypesCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent +// - name: The name of the operation's parent resource. +func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall { + c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Filter sets the optional parameter "filter": The standard list +// filter. +func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list +// page size. +func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The standard list +// page token. +func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsFetchProcessorTypesCall) Fields(s ...googleapi.Field) *ProjectsLocationsFetchProcessorTypesCall { +func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10979,7 +12370,7 @@ func (c *ProjectsLocationsFetchProcessorTypesCall) Fields(s ...googleapi.Field) // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsFetchProcessorTypesCall) IfNoneMatch(entityTag string) *ProjectsLocationsFetchProcessorTypesCall { +func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall { c.ifNoneMatch_ = entityTag return c } @@ -10987,21 +12378,21 @@ func (c *ProjectsLocationsFetchProcessorTypesCall) IfNoneMatch(entityTag string) // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsFetchProcessorTypesCall) Context(ctx context.Context) *ProjectsLocationsFetchProcessorTypesCall { +func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsFetchProcessorTypesCall) Header() http.Header { +func (c *ProjectsLocationsOperationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsFetchProcessorTypesCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -11014,7 +12405,7 @@ func (c *ProjectsLocationsFetchProcessorTypesCall) doRequest(alt string) (*http. var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:fetchProcessorTypes") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -11022,21 +12413,20 @@ func (c *ProjectsLocationsFetchProcessorTypesCall) doRequest(alt string) (*http. } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "documentai.projects.locations.fetchProcessorTypes" call. -// Exactly one of *GoogleCloudDocumentaiV1FetchProcessorTypesResponse or -// error will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudDocumentaiV1FetchProcessorTypesResponse.ServerResponse.Hea -// der or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsLocationsFetchProcessorTypesCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDocumentaiV1FetchProcessorTypesResponse, error) { +// Do executes the "documentai.projects.locations.operations.list" call. +// Exactly one of *GoogleLongrunningListOperationsResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11055,7 +12445,7 @@ func (c *ProjectsLocationsFetchProcessorTypesCall) Do(opts ...googleapi.CallOpti if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudDocumentaiV1FetchProcessorTypesResponse{ + ret := &GoogleLongrunningListOperationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11067,25 +12457,41 @@ func (c *ProjectsLocationsFetchProcessorTypesCall) Do(opts ...googleapi.CallOpti } return ret, nil // { - // "description": "Fetches processor types. Note that we do not use ListProcessorTypes here because it is not paginated.", - // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}:fetchProcessorTypes", + // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `\"/v1/{name=users/*}/operations\"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/operations", // "httpMethod": "GET", - // "id": "documentai.projects.locations.fetchProcessorTypes", + // "id": "documentai.projects.locations.operations.list", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. The project of processor type to list. The available processor types may depend on the allow-listing on projects. Format: `projects/{project}/locations/{location}`", + // "filter": { + // "description": "The standard list filter.", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "The name of the operation's parent resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/operations$", // "required": true, // "type": "string" + // }, + // "pageSize": { + // "description": "The standard list page size.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The standard list page token.", + // "location": "query", + // "type": "string" // } // }, - // "path": "v1/{+parent}:fetchProcessorTypes", + // "path": "v1/{+name}", // "response": { - // "$ref": "GoogleCloudDocumentaiV1FetchProcessorTypesResponse" + // "$ref": "GoogleLongrunningListOperationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -11094,9 +12500,30 @@ func (c *ProjectsLocationsFetchProcessorTypesCall) Do(opts ...googleapi.CallOpti } -// method id "documentai.projects.locations.get": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type ProjectsLocationsGetCall struct { +// method id "documentai.projects.locations.processorTypes.get": + +type ProjectsLocationsProcessorTypesGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -11105,11 +12532,11 @@ type ProjectsLocationsGetCall struct { header_ http.Header } -// Get: Gets information about a location. +// Get: Gets a processor type detail. // -// - name: Resource name for the location. -func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall { - c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The processor type resource name. +func (r *ProjectsLocationsProcessorTypesService) Get(name string) *ProjectsLocationsProcessorTypesGetCall { + c := &ProjectsLocationsProcessorTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -11117,7 +12544,7 @@ func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall { // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall { +func (c *ProjectsLocationsProcessorTypesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorTypesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11127,7 +12554,7 @@ func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocatio // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall { +func (c *ProjectsLocationsProcessorTypesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsProcessorTypesGetCall { c.ifNoneMatch_ = entityTag return c } @@ -11135,21 +12562,21 @@ func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocati // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall { +func (c *ProjectsLocationsProcessorTypesGetCall) Context(ctx context.Context) *ProjectsLocationsProcessorTypesGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsGetCall) Header() http.Header { +func (c *ProjectsLocationsProcessorTypesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsProcessorTypesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -11175,14 +12602,15 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "documentai.projects.locations.get" call. -// Exactly one of *GoogleCloudLocationLocation or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleCloudLocationLocation.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudLocationLocation, error) { +// Do executes the "documentai.projects.locations.processorTypes.get" call. +// Exactly one of *GoogleCloudDocumentaiV1ProcessorType or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *GoogleCloudDocumentaiV1ProcessorType.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsProcessorTypesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDocumentaiV1ProcessorType, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11201,7 +12629,7 @@ func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleClou if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudLocationLocation{ + ret := &GoogleCloudDocumentaiV1ProcessorType{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11213,25 +12641,25 @@ func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleClou } return ret, nil // { - // "description": "Gets information about a location.", - // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}", + // "description": "Gets a processor type detail.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processorTypes/{processorTypesId}", // "httpMethod": "GET", - // "id": "documentai.projects.locations.get", + // "id": "documentai.projects.locations.processorTypes.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Resource name for the location.", + // "description": "Required. The processor type resource name.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/processorTypes/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1/{+name}", // "response": { - // "$ref": "GoogleCloudLocationLocation" + // "$ref": "GoogleCloudDocumentaiV1ProcessorType" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -11240,48 +12668,40 @@ func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleClou } -// method id "documentai.projects.locations.list": +// method id "documentai.projects.locations.processorTypes.list": -type ProjectsLocationsListCall struct { +type ProjectsLocationsProcessorTypesListCall struct { s *Service - name string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists information about the supported locations for this -// service. +// List: Lists the processor types that exist. // -// - name: The resource that owns the locations collection, if -// applicable. -func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall { - c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} - -// Filter sets the optional parameter "filter": A filter to narrow down -// results to a preferred subset. The filtering language accepts strings -// like "displayName=tokyo", and is documented in more detail in -// AIP-160 (https://google.aip.dev/160). -func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall { - c.urlParams_.Set("filter", filter) +// - parent: The location of processor type to list. The available +// processor types may depend on the allow-listing on projects. +// Format: `projects/{project}/locations/{location}`. +func (r *ProjectsLocationsProcessorTypesService) List(parent string) *ProjectsLocationsProcessorTypesListCall { + c := &ProjectsLocationsProcessorTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } // PageSize sets the optional parameter "pageSize": The maximum number -// of results to return. If not set, the service selects a default. -func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall { +// of processor types to return. If unspecified, at most 100 processor +// types will be returned. The maximum value is 500; values above 500 +// will be coerced to 500. +func (c *ProjectsLocationsProcessorTypesListCall) PageSize(pageSize int64) *ProjectsLocationsProcessorTypesListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// PageToken sets the optional parameter "pageToken": A page token -// received from the `next_page_token` field in the response. Send that -// page token to receive the subsequent page. -func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall { +// PageToken sets the optional parameter "pageToken": Used to retrieve +// the next page of results, empty if at the end of the list. +func (c *ProjectsLocationsProcessorTypesListCall) PageToken(pageToken string) *ProjectsLocationsProcessorTypesListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -11289,7 +12709,7 @@ func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocatio // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall { +func (c *ProjectsLocationsProcessorTypesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorTypesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11299,7 +12719,7 @@ func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocati // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall { +func (c *ProjectsLocationsProcessorTypesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsProcessorTypesListCall { c.ifNoneMatch_ = entityTag return c } @@ -11307,21 +12727,21 @@ func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocat // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall { +func (c *ProjectsLocationsProcessorTypesListCall) Context(ctx context.Context) *ProjectsLocationsProcessorTypesListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsListCall) Header() http.Header { +func (c *ProjectsLocationsProcessorTypesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsProcessorTypesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -11334,7 +12754,7 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/processorTypes") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -11342,21 +12762,21 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "documentai.projects.locations.list" call. -// Exactly one of *GoogleCloudLocationListLocationsResponse or error -// will be non-nil. Any non-2xx status code is an error. Response +// Do executes the "documentai.projects.locations.processorTypes.list" call. +// Exactly one of *GoogleCloudDocumentaiV1ListProcessorTypesResponse or +// error will be non-nil. Any non-2xx status code is an error. Response // headers are in either -// *GoogleCloudLocationListLocationsResponse.ServerResponse.Header or -// (if a response was returned at all) in +// *GoogleCloudDocumentaiV1ListProcessorTypesResponse.ServerResponse.Head +// er or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was // returned. -func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudLocationListLocationsResponse, error) { +func (c *ProjectsLocationsProcessorTypesListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDocumentaiV1ListProcessorTypesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11375,7 +12795,7 @@ func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*GoogleClo if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudLocationListLocationsResponse{ + ret := &GoogleCloudDocumentaiV1ListProcessorTypesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11387,41 +12807,36 @@ func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*GoogleClo } return ret, nil // { - // "description": "Lists information about the supported locations for this service.", - // "flatPath": "v1/projects/{projectsId}/locations", + // "description": "Lists the processor types that exist.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processorTypes", // "httpMethod": "GET", - // "id": "documentai.projects.locations.list", + // "id": "documentai.projects.locations.processorTypes.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "filter": { - // "description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like `\"displayName=tokyo\"`, and is documented in more detail in [AIP-160](https://google.aip.dev/160).", - // "location": "query", - // "type": "string" - // }, - // "name": { - // "description": "The resource that owns the locations collection, if applicable.", - // "location": "path", - // "pattern": "^projects/[^/]+$", - // "required": true, - // "type": "string" - // }, // "pageSize": { - // "description": "The maximum number of results to return. If not set, the service selects a default.", + // "description": "The maximum number of processor types to return. If unspecified, at most 100 processor types will be returned. The maximum value is 500; values above 500 will be coerced to 500.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page.", + // "description": "Used to retrieve the next page of results, empty if at the end of the list.", // "location": "query", // "type": "string" + // }, + // "parent": { + // "description": "Required. The location of processor type to list. The available processor types may depend on the allow-listing on projects. Format: `projects/{project}/locations/{location}`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "required": true, + // "type": "string" // } // }, - // "path": "v1/{+name}/locations", + // "path": "v1/{+parent}/processorTypes", // "response": { - // "$ref": "GoogleCloudLocationListLocationsResponse" + // "$ref": "GoogleCloudDocumentaiV1ListProcessorTypesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -11433,7 +12848,7 @@ func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*GoogleClo // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*GoogleCloudLocationListLocationsResponse) error) error { +func (c *ProjectsLocationsProcessorTypesListCall) Pages(ctx context.Context, f func(*GoogleCloudDocumentaiV1ListProcessorTypesResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -11451,38 +12866,36 @@ func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*GoogleClo } } -// method id "documentai.projects.locations.operations.cancel": +// method id "documentai.projects.locations.processors.batchProcess": -type ProjectsLocationsOperationsCancelCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsProcessorsBatchProcessCall struct { + s *Service + name string + googleclouddocumentaiv1batchprocessrequest *GoogleCloudDocumentaiV1BatchProcessRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Cancel: Starts asynchronous cancellation on a long-running operation. -// The server makes a best effort to cancel the operation, but success -// is not guaranteed. If the server doesn't support this method, it -// returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use -// Operations.GetOperation or other methods to check whether the -// cancellation succeeded or whether the operation completed despite -// cancellation. On successful cancellation, the operation is not -// deleted; instead, it becomes an operation with an Operation.error -// value with a google.rpc.Status.code of 1, corresponding to -// `Code.CANCELLED`. +// BatchProcess: LRO endpoint to batch process many documents. The +// output is written to Cloud Storage as JSON in the [Document] format. // -// - name: The name of the operation resource to be cancelled. -func (r *ProjectsLocationsOperationsService) Cancel(name string) *ProjectsLocationsOperationsCancelCall { - c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of Processor or ProcessorVersion. Format: +// `projects/{project}/locations/{location}/processors/{processor}`, +// or +// `projects/{project}/locations/{location}/processors/{processor}/proc +// essorVersions/{processorVersion}`. +func (r *ProjectsLocationsProcessorsService) BatchProcess(name string, googleclouddocumentaiv1batchprocessrequest *GoogleCloudDocumentaiV1BatchProcessRequest) *ProjectsLocationsProcessorsBatchProcessCall { + c := &ProjectsLocationsProcessorsBatchProcessCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.googleclouddocumentaiv1batchprocessrequest = googleclouddocumentaiv1batchprocessrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall { +func (c *ProjectsLocationsProcessorsBatchProcessCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsBatchProcessCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11490,21 +12903,21 @@ func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *Pr // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall { +func (c *ProjectsLocationsProcessorsBatchProcessCall) Context(ctx context.Context) *ProjectsLocationsProcessorsBatchProcessCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { +func (c *ProjectsLocationsProcessorsBatchProcessCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsProcessorsBatchProcessCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -11512,159 +12925,16 @@ func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Res } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "name": c.name, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "documentai.projects.locations.operations.cancel" call. -// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1batchprocessrequest) if err != nil { return nil, err } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &GoogleProtobufEmpty{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.", - // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}:cancel", - // "httpMethod": "POST", - // "id": "documentai.projects.locations.operations.cancel", - // "parameterOrder": [ - // "name" - // ], - // "parameters": { - // "name": { - // "description": "The name of the operation resource to be cancelled.", - // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1/{+name}:cancel", - // "response": { - // "$ref": "GoogleProtobufEmpty" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform" - // ] - // } - -} - -// method id "documentai.projects.locations.operations.get": - -type ProjectsLocationsOperationsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// Get: Gets the latest state of a long-running operation. Clients can -// use this method to poll the operation result at intervals as -// recommended by the API service. -// -// - name: The name of the operation resource. -func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall { - c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ProjectsLocationsOperationsGetCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:batchProcess") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -11675,14 +12945,14 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "documentai.projects.locations.operations.get" call. +// Do executes the "documentai.projects.locations.processors.batchProcess" call. // Exactly one of *GoogleLongrunningOperation or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either // *GoogleLongrunningOperation.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsProcessorsBatchProcessCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11713,23 +12983,26 @@ func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (* } return ret, nil // { - // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", - // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}", - // "httpMethod": "GET", - // "id": "documentai.projects.locations.operations.get", + // "description": "LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the [Document] format.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}:batchProcess", + // "httpMethod": "POST", + // "id": "documentai.projects.locations.processors.batchProcess", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The name of the operation resource.", + // "description": "Required. The resource name of Processor or ProcessorVersion. Format: `projects/{project}/locations/{location}/processors/{processor}`, or `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+name}:batchProcess", + // "request": { + // "$ref": "GoogleCloudDocumentaiV1BatchProcessRequest" + // }, // "response": { // "$ref": "GoogleLongrunningOperation" // }, @@ -11740,126 +13013,91 @@ func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (* } -// method id "documentai.projects.locations.operations.list": +// method id "documentai.projects.locations.processors.create": -type ProjectsLocationsOperationsListCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsProcessorsCreateCall struct { + s *Service + parent string + googleclouddocumentaiv1processor *GoogleCloudDocumentaiV1Processor + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists operations that match the specified filter in the -// request. If the server doesn't support this method, it returns -// `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to -// override the binding to use different resource name schemes, such as -// `users/*/operations`. To override the binding, API services can add a -// binding such as "/v1/{name=users/*}/operations" to their service -// configuration. For backwards compatibility, the default name includes -// the operations collection id, however overriding users must ensure -// the name binding is the parent resource, without the operations -// collection id. +// Create: Creates a processor from the type processor that the user +// chose. The processor will be at "ENABLED" state by default after its +// creation. // -// - name: The name of the operation's parent resource. -func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall { - c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} - -// Filter sets the optional parameter "filter": The standard list -// filter. -func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// PageSize sets the optional parameter "pageSize": The standard list -// page size. -func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The standard list -// page token. -func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall { - c.urlParams_.Set("pageToken", pageToken) +// - parent: The parent (project and location) under which to create the +// processor. Format: `projects/{project}/locations/{location}`. +func (r *ProjectsLocationsProcessorsService) Create(parent string, googleclouddocumentaiv1processor *GoogleCloudDocumentaiV1Processor) *ProjectsLocationsProcessorsCreateCall { + c := &ProjectsLocationsProcessorsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddocumentaiv1processor = googleclouddocumentaiv1processor return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall { +func (c *ProjectsLocationsProcessorsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall { +func (c *ProjectsLocationsProcessorsCreateCall) Context(ctx context.Context) *ProjectsLocationsProcessorsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsOperationsListCall) Header() http.Header { +func (c *ProjectsLocationsProcessorsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsProcessorsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1processor) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/processors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "documentai.projects.locations.operations.list" call. -// Exactly one of *GoogleLongrunningListOperationsResponse or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if +// Do executes the "documentai.projects.locations.processors.create" call. +// Exactly one of *GoogleCloudDocumentaiV1Processor or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *GoogleCloudDocumentaiV1Processor.ServerResponse.Header or (if // a response was returned at all) in error.(*googleapi.Error).Header. // Use googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { +func (c *ProjectsLocationsProcessorsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDocumentaiV1Processor, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11878,7 +13116,7 @@ func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningListOperationsResponse{ + ret := &GoogleCloudDocumentaiV1Processor{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11890,41 +13128,28 @@ func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) ( } return ret, nil // { - // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `\"/v1/{name=users/*}/operations\"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.", - // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/operations", - // "httpMethod": "GET", - // "id": "documentai.projects.locations.operations.list", + // "description": "Creates a processor from the type processor that the user chose. The processor will be at \"ENABLED\" state by default after its creation.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors", + // "httpMethod": "POST", + // "id": "documentai.projects.locations.processors.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "filter": { - // "description": "The standard list filter.", - // "location": "query", - // "type": "string" - // }, - // "name": { - // "description": "The name of the operation's parent resource.", + // "parent": { + // "description": "Required. The parent (project and location) under which to create the processor. Format: `projects/{project}/locations/{location}`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/operations$", + // "pattern": "^projects/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" - // }, - // "pageSize": { - // "description": "The standard list page size.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The standard list page token.", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/processors", + // "request": { + // "$ref": "GoogleCloudDocumentaiV1Processor" + // }, // "response": { - // "$ref": "GoogleLongrunningListOperationsResponse" + // "$ref": "GoogleCloudDocumentaiV1Processor" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -11933,43 +13158,23 @@ func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) ( } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "documentai.projects.locations.processorTypes.get": +// method id "documentai.projects.locations.processors.delete": -type ProjectsLocationsProcessorTypesGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsProcessorsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a processor type detail. +// Delete: Deletes the processor, unloads all deployed model artifacts +// if it was enabled and then deletes all artifacts associated with this +// processor. // -// - name: The processor type resource name. -func (r *ProjectsLocationsProcessorTypesService) Get(name string) *ProjectsLocationsProcessorTypesGetCall { - c := &ProjectsLocationsProcessorTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The processor resource name to be deleted. +func (r *ProjectsLocationsProcessorsService) Delete(name string) *ProjectsLocationsProcessorsDeleteCall { + c := &ProjectsLocationsProcessorsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -11977,54 +13182,41 @@ func (r *ProjectsLocationsProcessorTypesService) Get(name string) *ProjectsLocat // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsProcessorTypesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorTypesGetCall { +func (c *ProjectsLocationsProcessorsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsProcessorTypesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsProcessorTypesGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsProcessorTypesGetCall) Context(ctx context.Context) *ProjectsLocationsProcessorTypesGetCall { +func (c *ProjectsLocationsProcessorsDeleteCall) Context(ctx context.Context) *ProjectsLocationsProcessorsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsProcessorTypesGetCall) Header() http.Header { +func (c *ProjectsLocationsProcessorsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsProcessorTypesGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsProcessorsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -12035,15 +13227,14 @@ func (c *ProjectsLocationsProcessorTypesGetCall) doRequest(alt string) (*http.Re return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "documentai.projects.locations.processorTypes.get" call. -// Exactly one of *GoogleCloudDocumentaiV1ProcessorType or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *GoogleCloudDocumentaiV1ProcessorType.ServerResponse.Header or -// (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsLocationsProcessorTypesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDocumentaiV1ProcessorType, error) { +// Do executes the "documentai.projects.locations.processors.delete" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsProcessorsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12062,7 +13253,7 @@ func (c *ProjectsLocationsProcessorTypesGetCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudDocumentaiV1ProcessorType{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12074,25 +13265,25 @@ func (c *ProjectsLocationsProcessorTypesGetCall) Do(opts ...googleapi.CallOption } return ret, nil // { - // "description": "Gets a processor type detail.", - // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processorTypes/{processorTypesId}", - // "httpMethod": "GET", - // "id": "documentai.projects.locations.processorTypes.get", + // "description": "Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes all artifacts associated with this processor.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}", + // "httpMethod": "DELETE", + // "id": "documentai.projects.locations.processors.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The processor type resource name.", + // "description": "Required. The processor resource name to be deleted.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/processorTypes/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1/{+name}", // "response": { - // "$ref": "GoogleCloudDocumentaiV1ProcessorType" + // "$ref": "GoogleLongrunningOperation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -12101,115 +13292,88 @@ func (c *ProjectsLocationsProcessorTypesGetCall) Do(opts ...googleapi.CallOption } -// method id "documentai.projects.locations.processorTypes.list": +// method id "documentai.projects.locations.processors.disable": -type ProjectsLocationsProcessorTypesListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsProcessorsDisableCall struct { + s *Service + name string + googleclouddocumentaiv1disableprocessorrequest *GoogleCloudDocumentaiV1DisableProcessorRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists the processor types that exist. +// Disable: Disables a processor // -// - parent: The location of processor type to list. The available -// processor types may depend on the allow-listing on projects. -// Format: `projects/{project}/locations/{location}`. -func (r *ProjectsLocationsProcessorTypesService) List(parent string) *ProjectsLocationsProcessorTypesListCall { - c := &ProjectsLocationsProcessorTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of processor types to return. If unspecified, at most 100 processor -// types will be returned. The maximum value is 500; values above 500 -// will be coerced to 500. -func (c *ProjectsLocationsProcessorTypesListCall) PageSize(pageSize int64) *ProjectsLocationsProcessorTypesListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": Used to retrieve -// the next page of results, empty if at the end of the list. -func (c *ProjectsLocationsProcessorTypesListCall) PageToken(pageToken string) *ProjectsLocationsProcessorTypesListCall { - c.urlParams_.Set("pageToken", pageToken) +// - name: The processor resource name to be disabled. +func (r *ProjectsLocationsProcessorsService) Disable(name string, googleclouddocumentaiv1disableprocessorrequest *GoogleCloudDocumentaiV1DisableProcessorRequest) *ProjectsLocationsProcessorsDisableCall { + c := &ProjectsLocationsProcessorsDisableCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googleclouddocumentaiv1disableprocessorrequest = googleclouddocumentaiv1disableprocessorrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsProcessorTypesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorTypesListCall { +func (c *ProjectsLocationsProcessorsDisableCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsDisableCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsProcessorTypesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsProcessorTypesListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsProcessorTypesListCall) Context(ctx context.Context) *ProjectsLocationsProcessorTypesListCall { +func (c *ProjectsLocationsProcessorsDisableCall) Context(ctx context.Context) *ProjectsLocationsProcessorsDisableCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsProcessorTypesListCall) Header() http.Header { +func (c *ProjectsLocationsProcessorsDisableCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsProcessorTypesListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsProcessorsDisableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1disableprocessorrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/processorTypes") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:disable") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "documentai.projects.locations.processorTypes.list" call. -// Exactly one of *GoogleCloudDocumentaiV1ListProcessorTypesResponse or -// error will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudDocumentaiV1ListProcessorTypesResponse.ServerResponse.Head -// er or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsLocationsProcessorTypesListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDocumentaiV1ListProcessorTypesResponse, error) { +// Do executes the "documentai.projects.locations.processors.disable" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsProcessorsDisableCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12228,7 +13392,7 @@ func (c *ProjectsLocationsProcessorTypesListCall) Do(opts ...googleapi.CallOptio if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudDocumentaiV1ListProcessorTypesResponse{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12240,36 +13404,28 @@ func (c *ProjectsLocationsProcessorTypesListCall) Do(opts ...googleapi.CallOptio } return ret, nil // { - // "description": "Lists the processor types that exist.", - // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processorTypes", - // "httpMethod": "GET", - // "id": "documentai.projects.locations.processorTypes.list", + // "description": "Disables a processor", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}:disable", + // "httpMethod": "POST", + // "id": "documentai.projects.locations.processors.disable", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "pageSize": { - // "description": "The maximum number of processor types to return. If unspecified, at most 100 processor types will be returned. The maximum value is 500; values above 500 will be coerced to 500.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "Used to retrieve the next page of results, empty if at the end of the list.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The location of processor type to list. The available processor types may depend on the allow-listing on projects. Format: `projects/{project}/locations/{location}`", + // "name": { + // "description": "Required. The processor resource name to be disabled.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/processorTypes", + // "path": "v1/{+name}:disable", + // "request": { + // "$ref": "GoogleCloudDocumentaiV1DisableProcessorRequest" + // }, // "response": { - // "$ref": "GoogleCloudDocumentaiV1ListProcessorTypesResponse" + // "$ref": "GoogleLongrunningOperation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -12278,57 +13434,31 @@ func (c *ProjectsLocationsProcessorTypesListCall) Do(opts ...googleapi.CallOptio } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsProcessorTypesListCall) Pages(ctx context.Context, f func(*GoogleCloudDocumentaiV1ListProcessorTypesResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "documentai.projects.locations.processors.batchProcess": +// method id "documentai.projects.locations.processors.enable": -type ProjectsLocationsProcessorsBatchProcessCall struct { - s *Service - name string - googleclouddocumentaiv1batchprocessrequest *GoogleCloudDocumentaiV1BatchProcessRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsProcessorsEnableCall struct { + s *Service + name string + googleclouddocumentaiv1enableprocessorrequest *GoogleCloudDocumentaiV1EnableProcessorRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// BatchProcess: LRO endpoint to batch process many documents. The -// output is written to Cloud Storage as JSON in the [Document] format. +// Enable: Enables a processor // -// - name: The resource name of Processor or ProcessorVersion. Format: -// `projects/{project}/locations/{location}/processors/{processor}`, -// or -// `projects/{project}/locations/{location}/processors/{processor}/proc -// essorVersions/{processorVersion}`. -func (r *ProjectsLocationsProcessorsService) BatchProcess(name string, googleclouddocumentaiv1batchprocessrequest *GoogleCloudDocumentaiV1BatchProcessRequest) *ProjectsLocationsProcessorsBatchProcessCall { - c := &ProjectsLocationsProcessorsBatchProcessCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The processor resource name to be enabled. +func (r *ProjectsLocationsProcessorsService) Enable(name string, googleclouddocumentaiv1enableprocessorrequest *GoogleCloudDocumentaiV1EnableProcessorRequest) *ProjectsLocationsProcessorsEnableCall { + c := &ProjectsLocationsProcessorsEnableCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googleclouddocumentaiv1batchprocessrequest = googleclouddocumentaiv1batchprocessrequest + c.googleclouddocumentaiv1enableprocessorrequest = googleclouddocumentaiv1enableprocessorrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsProcessorsBatchProcessCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsBatchProcessCall { +func (c *ProjectsLocationsProcessorsEnableCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsEnableCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -12336,21 +13466,21 @@ func (c *ProjectsLocationsProcessorsBatchProcessCall) Fields(s ...googleapi.Fiel // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsProcessorsBatchProcessCall) Context(ctx context.Context) *ProjectsLocationsProcessorsBatchProcessCall { +func (c *ProjectsLocationsProcessorsEnableCall) Context(ctx context.Context) *ProjectsLocationsProcessorsEnableCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsProcessorsBatchProcessCall) Header() http.Header { +func (c *ProjectsLocationsProcessorsEnableCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsProcessorsBatchProcessCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsProcessorsEnableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -12358,14 +13488,14 @@ func (c *ProjectsLocationsProcessorsBatchProcessCall) doRequest(alt string) (*ht } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1batchprocessrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1enableprocessorrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:batchProcess") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:enable") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -12378,14 +13508,14 @@ func (c *ProjectsLocationsProcessorsBatchProcessCall) doRequest(alt string) (*ht return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "documentai.projects.locations.processors.batchProcess" call. +// Do executes the "documentai.projects.locations.processors.enable" call. // Exactly one of *GoogleLongrunningOperation or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either // *GoogleLongrunningOperation.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsProcessorsBatchProcessCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsProcessorsEnableCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12416,25 +13546,25 @@ func (c *ProjectsLocationsProcessorsBatchProcessCall) Do(opts ...googleapi.CallO } return ret, nil // { - // "description": "LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the [Document] format.", - // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}:batchProcess", + // "description": "Enables a processor", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}:enable", // "httpMethod": "POST", - // "id": "documentai.projects.locations.processors.batchProcess", + // "id": "documentai.projects.locations.processors.enable", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of Processor or ProcessorVersion. Format: `projects/{project}/locations/{location}/processors/{processor}`, or `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`", + // "description": "Required. The processor resource name to be enabled.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}:batchProcess", + // "path": "v1/{+name}:enable", // "request": { - // "$ref": "GoogleCloudDocumentaiV1BatchProcessRequest" + // "$ref": "GoogleCloudDocumentaiV1EnableProcessorRequest" // }, // "response": { // "$ref": "GoogleLongrunningOperation" @@ -12446,91 +13576,95 @@ func (c *ProjectsLocationsProcessorsBatchProcessCall) Do(opts ...googleapi.CallO } -// method id "documentai.projects.locations.processors.create": +// method id "documentai.projects.locations.processors.get": -type ProjectsLocationsProcessorsCreateCall struct { - s *Service - parent string - googleclouddocumentaiv1processor *GoogleCloudDocumentaiV1Processor - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsProcessorsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Create: Creates a processor from the type processor that the user -// chose. The processor will be at "ENABLED" state by default after its -// creation. +// Get: Gets a processor detail. // -// - parent: The parent (project and location) under which to create the -// processor. Format: `projects/{project}/locations/{location}`. -func (r *ProjectsLocationsProcessorsService) Create(parent string, googleclouddocumentaiv1processor *GoogleCloudDocumentaiV1Processor) *ProjectsLocationsProcessorsCreateCall { - c := &ProjectsLocationsProcessorsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.googleclouddocumentaiv1processor = googleclouddocumentaiv1processor +// - name: The processor resource name. +func (r *ProjectsLocationsProcessorsService) Get(name string) *ProjectsLocationsProcessorsGetCall { + c := &ProjectsLocationsProcessorsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsProcessorsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsCreateCall { +func (c *ProjectsLocationsProcessorsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsProcessorsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsProcessorsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsProcessorsCreateCall) Context(ctx context.Context) *ProjectsLocationsProcessorsCreateCall { +func (c *ProjectsLocationsProcessorsGetCall) Context(ctx context.Context) *ProjectsLocationsProcessorsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsProcessorsCreateCall) Header() http.Header { +func (c *ProjectsLocationsProcessorsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsProcessorsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsProcessorsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1processor) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/processors") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "documentai.projects.locations.processors.create" call. +// Do executes the "documentai.projects.locations.processors.get" call. // Exactly one of *GoogleCloudDocumentaiV1Processor or error will be // non-nil. Any non-2xx status code is an error. Response headers are in // either *GoogleCloudDocumentaiV1Processor.ServerResponse.Header or (if // a response was returned at all) in error.(*googleapi.Error).Header. // Use googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsProcessorsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDocumentaiV1Processor, error) { +func (c *ProjectsLocationsProcessorsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDocumentaiV1Processor, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12561,26 +13695,23 @@ func (c *ProjectsLocationsProcessorsCreateCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Creates a processor from the type processor that the user chose. The processor will be at \"ENABLED\" state by default after its creation.", - // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors", - // "httpMethod": "POST", - // "id": "documentai.projects.locations.processors.create", + // "description": "Gets a processor detail.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}", + // "httpMethod": "GET", + // "id": "documentai.projects.locations.processors.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. The parent (project and location) under which to create the processor. Format: `projects/{project}/locations/{location}`", + // "name": { + // "description": "Required. The processor resource name.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/processors", - // "request": { - // "$ref": "GoogleCloudDocumentaiV1Processor" - // }, + // "path": "v1/{+name}", // "response": { // "$ref": "GoogleCloudDocumentaiV1Processor" // }, @@ -12591,83 +13722,116 @@ func (c *ProjectsLocationsProcessorsCreateCall) Do(opts ...googleapi.CallOption) } -// method id "documentai.projects.locations.processors.delete": +// method id "documentai.projects.locations.processors.list": -type ProjectsLocationsProcessorsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsProcessorsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes the processor, unloads all deployed model artifacts -// if it was enabled and then deletes all artifacts associated with this -// processor. +// List: Lists all processors which belong to this project. // -// - name: The processor resource name to be deleted. -func (r *ProjectsLocationsProcessorsService) Delete(name string) *ProjectsLocationsProcessorsDeleteCall { - c := &ProjectsLocationsProcessorsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The parent (project and location) which owns this +// collection of Processors. Format: +// `projects/{project}/locations/{location}`. +func (r *ProjectsLocationsProcessorsService) List(parent string) *ProjectsLocationsProcessorsListCall { + c := &ProjectsLocationsProcessorsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of processors to return. If unspecified, at most 50 processors will +// be returned. The maximum value is 100; values above 100 will be +// coerced to 100. +func (c *ProjectsLocationsProcessorsListCall) PageSize(pageSize int64) *ProjectsLocationsProcessorsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": We will return the +// processors sorted by creation time. The page token will point to the +// next processor. +func (c *ProjectsLocationsProcessorsListCall) PageToken(pageToken string) *ProjectsLocationsProcessorsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsProcessorsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsDeleteCall { +func (c *ProjectsLocationsProcessorsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsProcessorsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsProcessorsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsProcessorsDeleteCall) Context(ctx context.Context) *ProjectsLocationsProcessorsDeleteCall { +func (c *ProjectsLocationsProcessorsListCall) Context(ctx context.Context) *ProjectsLocationsProcessorsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsProcessorsDeleteCall) Header() http.Header { +func (c *ProjectsLocationsProcessorsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsProcessorsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsProcessorsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/processors") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "documentai.projects.locations.processors.delete" call. -// Exactly one of *GoogleLongrunningOperation or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsProcessorsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +// Do executes the "documentai.projects.locations.processors.list" call. +// Exactly one of *GoogleCloudDocumentaiV1ListProcessorsResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDocumentaiV1ListProcessorsResponse.ServerResponse.Header +// or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsProcessorsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDocumentaiV1ListProcessorsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12686,7 +13850,7 @@ func (c *ProjectsLocationsProcessorsDeleteCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningOperation{ + ret := &GoogleCloudDocumentaiV1ListProcessorsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12698,25 +13862,36 @@ func (c *ProjectsLocationsProcessorsDeleteCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes all artifacts associated with this processor.", - // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}", - // "httpMethod": "DELETE", - // "id": "documentai.projects.locations.processors.delete", + // "description": "Lists all processors which belong to this project.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors", + // "httpMethod": "GET", + // "id": "documentai.projects.locations.processors.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The processor resource name to be deleted.", + // "pageSize": { + // "description": "The maximum number of processors to return. If unspecified, at most 50 processors will be returned. The maximum value is 100; values above 100 will be coerced to 100.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "We will return the processors sorted by creation time. The page token will point to the next processor.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent (project and location) which owns this collection of Processors. Format: `projects/{project}/locations/{location}`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/processors", // "response": { - // "$ref": "GoogleLongrunningOperation" + // "$ref": "GoogleCloudDocumentaiV1ListProcessorsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -12725,31 +13900,58 @@ func (c *ProjectsLocationsProcessorsDeleteCall) Do(opts ...googleapi.CallOption) } -// method id "documentai.projects.locations.processors.disable": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsProcessorsListCall) Pages(ctx context.Context, f func(*GoogleCloudDocumentaiV1ListProcessorsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type ProjectsLocationsProcessorsDisableCall struct { - s *Service - name string - googleclouddocumentaiv1disableprocessorrequest *GoogleCloudDocumentaiV1DisableProcessorRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "documentai.projects.locations.processors.process": + +type ProjectsLocationsProcessorsProcessCall struct { + s *Service + name string + googleclouddocumentaiv1processrequest *GoogleCloudDocumentaiV1ProcessRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Disable: Disables a processor +// Process: Processes a single document. // -// - name: The processor resource name to be disabled. -func (r *ProjectsLocationsProcessorsService) Disable(name string, googleclouddocumentaiv1disableprocessorrequest *GoogleCloudDocumentaiV1DisableProcessorRequest) *ProjectsLocationsProcessorsDisableCall { - c := &ProjectsLocationsProcessorsDisableCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of the Processor or ProcessorVersion to use +// for processing. If a Processor is specified, the server will use +// its default version. Format: +// `projects/{project}/locations/{location}/processors/{processor}`, +// or +// `projects/{project}/locations/{location}/processors/{processor}/proc +// essorVersions/{processorVersion}`. +func (r *ProjectsLocationsProcessorsService) Process(name string, googleclouddocumentaiv1processrequest *GoogleCloudDocumentaiV1ProcessRequest) *ProjectsLocationsProcessorsProcessCall { + c := &ProjectsLocationsProcessorsProcessCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googleclouddocumentaiv1disableprocessorrequest = googleclouddocumentaiv1disableprocessorrequest + c.googleclouddocumentaiv1processrequest = googleclouddocumentaiv1processrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsProcessorsDisableCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsDisableCall { +func (c *ProjectsLocationsProcessorsProcessCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsProcessCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -12757,21 +13959,21 @@ func (c *ProjectsLocationsProcessorsDisableCall) Fields(s ...googleapi.Field) *P // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsProcessorsDisableCall) Context(ctx context.Context) *ProjectsLocationsProcessorsDisableCall { +func (c *ProjectsLocationsProcessorsProcessCall) Context(ctx context.Context) *ProjectsLocationsProcessorsProcessCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsProcessorsDisableCall) Header() http.Header { +func (c *ProjectsLocationsProcessorsProcessCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsProcessorsDisableCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsProcessorsProcessCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -12779,14 +13981,14 @@ func (c *ProjectsLocationsProcessorsDisableCall) doRequest(alt string) (*http.Re } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1disableprocessorrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1processrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:disable") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:process") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -12796,17 +13998,18 @@ func (c *ProjectsLocationsProcessorsDisableCall) doRequest(alt string) (*http.Re googleapi.Expand(req.URL, map[string]string{ "name": c.name, }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "documentai.projects.locations.processors.disable" call. -// Exactly one of *GoogleLongrunningOperation or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "documentai.projects.locations.processors.process" call. +// Exactly one of *GoogleCloudDocumentaiV1ProcessResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudDocumentaiV1ProcessResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsProcessorsDisableCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsProcessorsProcessCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDocumentaiV1ProcessResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12825,7 +14028,7 @@ func (c *ProjectsLocationsProcessorsDisableCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningOperation{ + ret := &GoogleCloudDocumentaiV1ProcessResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12837,28 +14040,28 @@ func (c *ProjectsLocationsProcessorsDisableCall) Do(opts ...googleapi.CallOption } return ret, nil // { - // "description": "Disables a processor", - // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}:disable", + // "description": "Processes a single document.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}:process", // "httpMethod": "POST", - // "id": "documentai.projects.locations.processors.disable", + // "id": "documentai.projects.locations.processors.process", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The processor resource name to be disabled.", + // "description": "Required. The resource name of the Processor or ProcessorVersion to use for processing. If a Processor is specified, the server will use its default version. Format: `projects/{project}/locations/{location}/processors/{processor}`, or `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}:disable", + // "path": "v1/{+name}:process", // "request": { - // "$ref": "GoogleCloudDocumentaiV1DisableProcessorRequest" + // "$ref": "GoogleCloudDocumentaiV1ProcessRequest" // }, // "response": { - // "$ref": "GoogleLongrunningOperation" + // "$ref": "GoogleCloudDocumentaiV1ProcessResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -12867,31 +14070,34 @@ func (c *ProjectsLocationsProcessorsDisableCall) Do(opts ...googleapi.CallOption } -// method id "documentai.projects.locations.processors.enable": +// method id "documentai.projects.locations.processors.setDefaultProcessorVersion": -type ProjectsLocationsProcessorsEnableCall struct { - s *Service - name string - googleclouddocumentaiv1enableprocessorrequest *GoogleCloudDocumentaiV1EnableProcessorRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsProcessorsSetDefaultProcessorVersionCall struct { + s *Service + processor string + googleclouddocumentaiv1setdefaultprocessorversionrequest *GoogleCloudDocumentaiV1SetDefaultProcessorVersionRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Enable: Enables a processor +// SetDefaultProcessorVersion: Set the default (active) version of a +// Processor that will be used in ProcessDocument and +// BatchProcessDocuments. // -// - name: The processor resource name to be enabled. -func (r *ProjectsLocationsProcessorsService) Enable(name string, googleclouddocumentaiv1enableprocessorrequest *GoogleCloudDocumentaiV1EnableProcessorRequest) *ProjectsLocationsProcessorsEnableCall { - c := &ProjectsLocationsProcessorsEnableCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.googleclouddocumentaiv1enableprocessorrequest = googleclouddocumentaiv1enableprocessorrequest +// - processor: The resource name of the Processor to change default +// version. +func (r *ProjectsLocationsProcessorsService) SetDefaultProcessorVersion(processor string, googleclouddocumentaiv1setdefaultprocessorversionrequest *GoogleCloudDocumentaiV1SetDefaultProcessorVersionRequest) *ProjectsLocationsProcessorsSetDefaultProcessorVersionCall { + c := &ProjectsLocationsProcessorsSetDefaultProcessorVersionCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.processor = processor + c.googleclouddocumentaiv1setdefaultprocessorversionrequest = googleclouddocumentaiv1setdefaultprocessorversionrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsProcessorsEnableCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsEnableCall { +func (c *ProjectsLocationsProcessorsSetDefaultProcessorVersionCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsSetDefaultProcessorVersionCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -12899,21 +14105,21 @@ func (c *ProjectsLocationsProcessorsEnableCall) Fields(s ...googleapi.Field) *Pr // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsProcessorsEnableCall) Context(ctx context.Context) *ProjectsLocationsProcessorsEnableCall { +func (c *ProjectsLocationsProcessorsSetDefaultProcessorVersionCall) Context(ctx context.Context) *ProjectsLocationsProcessorsSetDefaultProcessorVersionCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsProcessorsEnableCall) Header() http.Header { +func (c *ProjectsLocationsProcessorsSetDefaultProcessorVersionCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsProcessorsEnableCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsProcessorsSetDefaultProcessorVersionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -12921,14 +14127,14 @@ func (c *ProjectsLocationsProcessorsEnableCall) doRequest(alt string) (*http.Res } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1enableprocessorrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1setdefaultprocessorversionrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:enable") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+processor}:setDefaultProcessorVersion") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -12936,19 +14142,19 @@ func (c *ProjectsLocationsProcessorsEnableCall) doRequest(alt string) (*http.Res } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "processor": c.processor, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "documentai.projects.locations.processors.enable" call. +// Do executes the "documentai.projects.locations.processors.setDefaultProcessorVersion" call. // Exactly one of *GoogleLongrunningOperation or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either // *GoogleLongrunningOperation.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsProcessorsEnableCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsProcessorsSetDefaultProcessorVersionCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12979,25 +14185,25 @@ func (c *ProjectsLocationsProcessorsEnableCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Enables a processor", - // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}:enable", + // "description": "Set the default (active) version of a Processor that will be used in ProcessDocument and BatchProcessDocuments.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}:setDefaultProcessorVersion", // "httpMethod": "POST", - // "id": "documentai.projects.locations.processors.enable", + // "id": "documentai.projects.locations.processors.setDefaultProcessorVersion", // "parameterOrder": [ - // "name" + // "processor" // ], // "parameters": { - // "name": { - // "description": "Required. The processor resource name to be enabled.", + // "processor": { + // "description": "Required. The resource name of the Processor to change default version.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}:enable", + // "path": "v1/{+processor}:setDefaultProcessorVersion", // "request": { - // "$ref": "GoogleCloudDocumentaiV1EnableProcessorRequest" + // "$ref": "GoogleCloudDocumentaiV1SetDefaultProcessorVersionRequest" // }, // "response": { // "$ref": "GoogleLongrunningOperation" @@ -13009,95 +14215,90 @@ func (c *ProjectsLocationsProcessorsEnableCall) Do(opts ...googleapi.CallOption) } -// method id "documentai.projects.locations.processors.get": +// method id "documentai.projects.locations.processors.humanReviewConfig.reviewDocument": -type ProjectsLocationsProcessorsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsProcessorsHumanReviewConfigReviewDocumentCall struct { + s *Service + humanReviewConfig string + googleclouddocumentaiv1reviewdocumentrequest *GoogleCloudDocumentaiV1ReviewDocumentRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a processor detail. +// ReviewDocument: Send a document for Human Review. The input document +// should be processed by the specified processor. // -// - name: The processor resource name. -func (r *ProjectsLocationsProcessorsService) Get(name string) *ProjectsLocationsProcessorsGetCall { - c := &ProjectsLocationsProcessorsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - humanReviewConfig: The resource name of the HumanReviewConfig that +// the document will be reviewed with. +func (r *ProjectsLocationsProcessorsHumanReviewConfigService) ReviewDocument(humanReviewConfig string, googleclouddocumentaiv1reviewdocumentrequest *GoogleCloudDocumentaiV1ReviewDocumentRequest) *ProjectsLocationsProcessorsHumanReviewConfigReviewDocumentCall { + c := &ProjectsLocationsProcessorsHumanReviewConfigReviewDocumentCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.humanReviewConfig = humanReviewConfig + c.googleclouddocumentaiv1reviewdocumentrequest = googleclouddocumentaiv1reviewdocumentrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsProcessorsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsGetCall { +func (c *ProjectsLocationsProcessorsHumanReviewConfigReviewDocumentCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsHumanReviewConfigReviewDocumentCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsProcessorsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsProcessorsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsProcessorsGetCall) Context(ctx context.Context) *ProjectsLocationsProcessorsGetCall { +func (c *ProjectsLocationsProcessorsHumanReviewConfigReviewDocumentCall) Context(ctx context.Context) *ProjectsLocationsProcessorsHumanReviewConfigReviewDocumentCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsProcessorsGetCall) Header() http.Header { +func (c *ProjectsLocationsProcessorsHumanReviewConfigReviewDocumentCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsProcessorsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsProcessorsHumanReviewConfigReviewDocumentCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1reviewdocumentrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+humanReviewConfig}:reviewDocument") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "humanReviewConfig": c.humanReviewConfig, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "documentai.projects.locations.processors.get" call. -// Exactly one of *GoogleCloudDocumentaiV1Processor or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *GoogleCloudDocumentaiV1Processor.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was +// Do executes the "documentai.projects.locations.processors.humanReviewConfig.reviewDocument" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsProcessorsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDocumentaiV1Processor, error) { +func (c *ProjectsLocationsProcessorsHumanReviewConfigReviewDocumentCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13116,7 +14317,7 @@ func (c *ProjectsLocationsProcessorsGetCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudDocumentaiV1Processor{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13128,25 +14329,28 @@ func (c *ProjectsLocationsProcessorsGetCall) Do(opts ...googleapi.CallOption) (* } return ret, nil // { - // "description": "Gets a processor detail.", - // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}", - // "httpMethod": "GET", - // "id": "documentai.projects.locations.processors.get", + // "description": "Send a document for Human Review. The input document should be processed by the specified processor.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}/humanReviewConfig:reviewDocument", + // "httpMethod": "POST", + // "id": "documentai.projects.locations.processors.humanReviewConfig.reviewDocument", // "parameterOrder": [ - // "name" + // "humanReviewConfig" // ], // "parameters": { - // "name": { - // "description": "Required. The processor resource name.", + // "humanReviewConfig": { + // "description": "Required. The resource name of the HumanReviewConfig that the document will be reviewed with.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+/humanReviewConfig$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+humanReviewConfig}:reviewDocument", + // "request": { + // "$ref": "GoogleCloudDocumentaiV1ReviewDocumentRequest" + // }, // "response": { - // "$ref": "GoogleCloudDocumentaiV1Processor" + // "$ref": "GoogleLongrunningOperation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -13155,116 +14359,93 @@ func (c *ProjectsLocationsProcessorsGetCall) Do(opts ...googleapi.CallOption) (* } -// method id "documentai.projects.locations.processors.list": +// method id "documentai.projects.locations.processors.processorVersions.batchProcess": -type ProjectsLocationsProcessorsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsProcessorsProcessorVersionsBatchProcessCall struct { + s *Service + name string + googleclouddocumentaiv1batchprocessrequest *GoogleCloudDocumentaiV1BatchProcessRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists all processors which belong to this project. +// BatchProcess: LRO endpoint to batch process many documents. The +// output is written to Cloud Storage as JSON in the [Document] format. // -// - parent: The parent (project and location) which owns this -// collection of Processors. Format: -// `projects/{project}/locations/{location}`. -func (r *ProjectsLocationsProcessorsService) List(parent string) *ProjectsLocationsProcessorsListCall { - c := &ProjectsLocationsProcessorsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of processors to return. If unspecified, at most 50 processors will -// be returned. The maximum value is 100; values above 100 will be -// coerced to 100. -func (c *ProjectsLocationsProcessorsListCall) PageSize(pageSize int64) *ProjectsLocationsProcessorsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": We will return the -// processors sorted by creation time. The page token will point to the -// next processor. -func (c *ProjectsLocationsProcessorsListCall) PageToken(pageToken string) *ProjectsLocationsProcessorsListCall { - c.urlParams_.Set("pageToken", pageToken) +// - name: The resource name of Processor or ProcessorVersion. Format: +// `projects/{project}/locations/{location}/processors/{processor}`, +// or +// `projects/{project}/locations/{location}/processors/{processor}/proc +// essorVersions/{processorVersion}`. +func (r *ProjectsLocationsProcessorsProcessorVersionsService) BatchProcess(name string, googleclouddocumentaiv1batchprocessrequest *GoogleCloudDocumentaiV1BatchProcessRequest) *ProjectsLocationsProcessorsProcessorVersionsBatchProcessCall { + c := &ProjectsLocationsProcessorsProcessorVersionsBatchProcessCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googleclouddocumentaiv1batchprocessrequest = googleclouddocumentaiv1batchprocessrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsProcessorsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsListCall { +func (c *ProjectsLocationsProcessorsProcessorVersionsBatchProcessCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsProcessorVersionsBatchProcessCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsProcessorsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsProcessorsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsProcessorsListCall) Context(ctx context.Context) *ProjectsLocationsProcessorsListCall { +func (c *ProjectsLocationsProcessorsProcessorVersionsBatchProcessCall) Context(ctx context.Context) *ProjectsLocationsProcessorsProcessorVersionsBatchProcessCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsProcessorsListCall) Header() http.Header { +func (c *ProjectsLocationsProcessorsProcessorVersionsBatchProcessCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsProcessorsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsProcessorsProcessorVersionsBatchProcessCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1batchprocessrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/processors") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:batchProcess") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "documentai.projects.locations.processors.list" call. -// Exactly one of *GoogleCloudDocumentaiV1ListProcessorsResponse or -// error will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudDocumentaiV1ListProcessorsResponse.ServerResponse.Header -// or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsLocationsProcessorsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDocumentaiV1ListProcessorsResponse, error) { +// Do executes the "documentai.projects.locations.processors.processorVersions.batchProcess" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsProcessorsProcessorVersionsBatchProcessCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13283,7 +14464,7 @@ func (c *ProjectsLocationsProcessorsListCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudDocumentaiV1ListProcessorsResponse{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13295,36 +14476,28 @@ func (c *ProjectsLocationsProcessorsListCall) Do(opts ...googleapi.CallOption) ( } return ret, nil // { - // "description": "Lists all processors which belong to this project.", - // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors", - // "httpMethod": "GET", - // "id": "documentai.projects.locations.processors.list", + // "description": "LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the [Document] format.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}/processorVersions/{processorVersionsId}:batchProcess", + // "httpMethod": "POST", + // "id": "documentai.projects.locations.processors.processorVersions.batchProcess", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "pageSize": { - // "description": "The maximum number of processors to return. If unspecified, at most 50 processors will be returned. The maximum value is 100; values above 100 will be coerced to 100.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "We will return the processors sorted by creation time. The page token will point to the next processor.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The parent (project and location) which owns this collection of Processors. Format: `projects/{project}/locations/{location}`", + // "name": { + // "description": "Required. The resource name of Processor or ProcessorVersion. Format: `projects/{project}/locations/{location}/processors/{processor}`, or `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/processors", + // "path": "v1/{+name}:batchProcess", + // "request": { + // "$ref": "GoogleCloudDocumentaiV1BatchProcessRequest" + // }, // "response": { - // "$ref": "GoogleCloudDocumentaiV1ListProcessorsResponse" + // "$ref": "GoogleLongrunningOperation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -13333,58 +14506,30 @@ func (c *ProjectsLocationsProcessorsListCall) Do(opts ...googleapi.CallOption) ( } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsProcessorsListCall) Pages(ctx context.Context, f func(*GoogleCloudDocumentaiV1ListProcessorsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "documentai.projects.locations.processors.process": +// method id "documentai.projects.locations.processors.processorVersions.delete": -type ProjectsLocationsProcessorsProcessCall struct { - s *Service - name string - googleclouddocumentaiv1processrequest *GoogleCloudDocumentaiV1ProcessRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsProcessorsProcessorVersionsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Process: Processes a single document. +// Delete: Deletes the processor version, all artifacts under the +// processor version will be deleted. // -// - name: The resource name of the Processor or ProcessorVersion to use -// for processing. If a Processor is specified, the server will use -// its default version. Format: -// `projects/{project}/locations/{location}/processors/{processor}`, -// or -// `projects/{project}/locations/{location}/processors/{processor}/proc -// essorVersions/{processorVersion}`. -func (r *ProjectsLocationsProcessorsService) Process(name string, googleclouddocumentaiv1processrequest *GoogleCloudDocumentaiV1ProcessRequest) *ProjectsLocationsProcessorsProcessCall { - c := &ProjectsLocationsProcessorsProcessCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The processor version resource name to be deleted. +func (r *ProjectsLocationsProcessorsProcessorVersionsService) Delete(name string) *ProjectsLocationsProcessorsProcessorVersionsDeleteCall { + c := &ProjectsLocationsProcessorsProcessorVersionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googleclouddocumentaiv1processrequest = googleclouddocumentaiv1processrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsProcessorsProcessCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsProcessCall { +func (c *ProjectsLocationsProcessorsProcessorVersionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsProcessorVersionsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -13392,21 +14537,21 @@ func (c *ProjectsLocationsProcessorsProcessCall) Fields(s ...googleapi.Field) *P // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsProcessorsProcessCall) Context(ctx context.Context) *ProjectsLocationsProcessorsProcessCall { +func (c *ProjectsLocationsProcessorsProcessorVersionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsProcessorsProcessorVersionsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsProcessorsProcessCall) Header() http.Header { +func (c *ProjectsLocationsProcessorsProcessorVersionsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsProcessorsProcessCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsProcessorsProcessorVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -13414,16 +14559,11 @@ func (c *ProjectsLocationsProcessorsProcessCall) doRequest(alt string) (*http.Re } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1processrequest) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:process") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -13434,15 +14574,14 @@ func (c *ProjectsLocationsProcessorsProcessCall) doRequest(alt string) (*http.Re return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "documentai.projects.locations.processors.process" call. -// Exactly one of *GoogleCloudDocumentaiV1ProcessResponse or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleCloudDocumentaiV1ProcessResponse.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was +// Do executes the "documentai.projects.locations.processors.processorVersions.delete" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsProcessorsProcessCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDocumentaiV1ProcessResponse, error) { +func (c *ProjectsLocationsProcessorsProcessorVersionsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13461,7 +14600,7 @@ func (c *ProjectsLocationsProcessorsProcessCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudDocumentaiV1ProcessResponse{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13473,28 +14612,25 @@ func (c *ProjectsLocationsProcessorsProcessCall) Do(opts ...googleapi.CallOption } return ret, nil // { - // "description": "Processes a single document.", - // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}:process", - // "httpMethod": "POST", - // "id": "documentai.projects.locations.processors.process", + // "description": "Deletes the processor version, all artifacts under the processor version will be deleted.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}/processorVersions/{processorVersionsId}", + // "httpMethod": "DELETE", + // "id": "documentai.projects.locations.processors.processorVersions.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of the Processor or ProcessorVersion to use for processing. If a Processor is specified, the server will use its default version. Format: `projects/{project}/locations/{location}/processors/{processor}`, or `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`", + // "description": "Required. The processor version resource name to be deleted.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}:process", - // "request": { - // "$ref": "GoogleCloudDocumentaiV1ProcessRequest" - // }, + // "path": "v1/{+name}", // "response": { - // "$ref": "GoogleCloudDocumentaiV1ProcessResponse" + // "$ref": "GoogleLongrunningOperation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -13503,34 +14639,31 @@ func (c *ProjectsLocationsProcessorsProcessCall) Do(opts ...googleapi.CallOption } -// method id "documentai.projects.locations.processors.setDefaultProcessorVersion": +// method id "documentai.projects.locations.processors.processorVersions.deploy": -type ProjectsLocationsProcessorsSetDefaultProcessorVersionCall struct { - s *Service - processor string - googleclouddocumentaiv1setdefaultprocessorversionrequest *GoogleCloudDocumentaiV1SetDefaultProcessorVersionRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsProcessorsProcessorVersionsDeployCall struct { + s *Service + name string + googleclouddocumentaiv1deployprocessorversionrequest *GoogleCloudDocumentaiV1DeployProcessorVersionRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// SetDefaultProcessorVersion: Set the default (active) version of a -// Processor that will be used in ProcessDocument and -// BatchProcessDocuments. +// Deploy: Deploys the processor version. // -// - processor: The resource name of the Processor to change default -// version. -func (r *ProjectsLocationsProcessorsService) SetDefaultProcessorVersion(processor string, googleclouddocumentaiv1setdefaultprocessorversionrequest *GoogleCloudDocumentaiV1SetDefaultProcessorVersionRequest) *ProjectsLocationsProcessorsSetDefaultProcessorVersionCall { - c := &ProjectsLocationsProcessorsSetDefaultProcessorVersionCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.processor = processor - c.googleclouddocumentaiv1setdefaultprocessorversionrequest = googleclouddocumentaiv1setdefaultprocessorversionrequest +// - name: The processor version resource name to be deployed. +func (r *ProjectsLocationsProcessorsProcessorVersionsService) Deploy(name string, googleclouddocumentaiv1deployprocessorversionrequest *GoogleCloudDocumentaiV1DeployProcessorVersionRequest) *ProjectsLocationsProcessorsProcessorVersionsDeployCall { + c := &ProjectsLocationsProcessorsProcessorVersionsDeployCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googleclouddocumentaiv1deployprocessorversionrequest = googleclouddocumentaiv1deployprocessorversionrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsProcessorsSetDefaultProcessorVersionCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsSetDefaultProcessorVersionCall { +func (c *ProjectsLocationsProcessorsProcessorVersionsDeployCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsProcessorVersionsDeployCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -13538,21 +14671,21 @@ func (c *ProjectsLocationsProcessorsSetDefaultProcessorVersionCall) Fields(s ... // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsProcessorsSetDefaultProcessorVersionCall) Context(ctx context.Context) *ProjectsLocationsProcessorsSetDefaultProcessorVersionCall { +func (c *ProjectsLocationsProcessorsProcessorVersionsDeployCall) Context(ctx context.Context) *ProjectsLocationsProcessorsProcessorVersionsDeployCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsProcessorsSetDefaultProcessorVersionCall) Header() http.Header { +func (c *ProjectsLocationsProcessorsProcessorVersionsDeployCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsProcessorsSetDefaultProcessorVersionCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsProcessorsProcessorVersionsDeployCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -13560,14 +14693,14 @@ func (c *ProjectsLocationsProcessorsSetDefaultProcessorVersionCall) doRequest(al } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1setdefaultprocessorversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1deployprocessorversionrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+processor}:setDefaultProcessorVersion") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:deploy") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -13575,19 +14708,19 @@ func (c *ProjectsLocationsProcessorsSetDefaultProcessorVersionCall) doRequest(al } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "processor": c.processor, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "documentai.projects.locations.processors.setDefaultProcessorVersion" call. +// Do executes the "documentai.projects.locations.processors.processorVersions.deploy" call. // Exactly one of *GoogleLongrunningOperation or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either // *GoogleLongrunningOperation.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsProcessorsSetDefaultProcessorVersionCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsProcessorsProcessorVersionsDeployCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13618,25 +14751,25 @@ func (c *ProjectsLocationsProcessorsSetDefaultProcessorVersionCall) Do(opts ...g } return ret, nil // { - // "description": "Set the default (active) version of a Processor that will be used in ProcessDocument and BatchProcessDocuments.", - // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}:setDefaultProcessorVersion", + // "description": "Deploys the processor version.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}/processorVersions/{processorVersionsId}:deploy", // "httpMethod": "POST", - // "id": "documentai.projects.locations.processors.setDefaultProcessorVersion", + // "id": "documentai.projects.locations.processors.processorVersions.deploy", // "parameterOrder": [ - // "processor" + // "name" // ], // "parameters": { - // "processor": { - // "description": "Required. The resource name of the Processor to change default version.", + // "name": { + // "description": "Required. The processor version resource name to be deployed.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+processor}:setDefaultProcessorVersion", + // "path": "v1/{+name}:deploy", // "request": { - // "$ref": "GoogleCloudDocumentaiV1SetDefaultProcessorVersionRequest" + // "$ref": "GoogleCloudDocumentaiV1DeployProcessorVersionRequest" // }, // "response": { // "$ref": "GoogleLongrunningOperation" @@ -13647,34 +14780,36 @@ func (c *ProjectsLocationsProcessorsSetDefaultProcessorVersionCall) Do(opts ...g // } } - -// method id "documentai.projects.locations.processors.humanReviewConfig.reviewDocument": - -type ProjectsLocationsProcessorsHumanReviewConfigReviewDocumentCall struct { - s *Service - humanReviewConfig string - googleclouddocumentaiv1reviewdocumentrequest *GoogleCloudDocumentaiV1ReviewDocumentRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header + +// method id "documentai.projects.locations.processors.processorVersions.evaluateProcessorVersion": + +type ProjectsLocationsProcessorsProcessorVersionsEvaluateProcessorVersionCall struct { + s *Service + processorVersion string + googleclouddocumentaiv1evaluateprocessorversionrequest *GoogleCloudDocumentaiV1EvaluateProcessorVersionRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// ReviewDocument: Send a document for Human Review. The input document -// should be processed by the specified processor. +// EvaluateProcessorVersion: Evaluates a ProcessorVersion against +// annotated documents, producing an Evaluation. // -// - humanReviewConfig: The resource name of the HumanReviewConfig that -// the document will be reviewed with. -func (r *ProjectsLocationsProcessorsHumanReviewConfigService) ReviewDocument(humanReviewConfig string, googleclouddocumentaiv1reviewdocumentrequest *GoogleCloudDocumentaiV1ReviewDocumentRequest) *ProjectsLocationsProcessorsHumanReviewConfigReviewDocumentCall { - c := &ProjectsLocationsProcessorsHumanReviewConfigReviewDocumentCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.humanReviewConfig = humanReviewConfig - c.googleclouddocumentaiv1reviewdocumentrequest = googleclouddocumentaiv1reviewdocumentrequest +// - processorVersion: The resource name of the ProcessorVersion to +// evaluate. +// `projects/{project}/locations/{location}/processors/{processor}/proc +// essorVersions/{processorVersion}`. +func (r *ProjectsLocationsProcessorsProcessorVersionsService) EvaluateProcessorVersion(processorVersion string, googleclouddocumentaiv1evaluateprocessorversionrequest *GoogleCloudDocumentaiV1EvaluateProcessorVersionRequest) *ProjectsLocationsProcessorsProcessorVersionsEvaluateProcessorVersionCall { + c := &ProjectsLocationsProcessorsProcessorVersionsEvaluateProcessorVersionCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.processorVersion = processorVersion + c.googleclouddocumentaiv1evaluateprocessorversionrequest = googleclouddocumentaiv1evaluateprocessorversionrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsProcessorsHumanReviewConfigReviewDocumentCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsHumanReviewConfigReviewDocumentCall { +func (c *ProjectsLocationsProcessorsProcessorVersionsEvaluateProcessorVersionCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsProcessorVersionsEvaluateProcessorVersionCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -13682,21 +14817,21 @@ func (c *ProjectsLocationsProcessorsHumanReviewConfigReviewDocumentCall) Fields( // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsProcessorsHumanReviewConfigReviewDocumentCall) Context(ctx context.Context) *ProjectsLocationsProcessorsHumanReviewConfigReviewDocumentCall { +func (c *ProjectsLocationsProcessorsProcessorVersionsEvaluateProcessorVersionCall) Context(ctx context.Context) *ProjectsLocationsProcessorsProcessorVersionsEvaluateProcessorVersionCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsProcessorsHumanReviewConfigReviewDocumentCall) Header() http.Header { +func (c *ProjectsLocationsProcessorsProcessorVersionsEvaluateProcessorVersionCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsProcessorsHumanReviewConfigReviewDocumentCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsProcessorsProcessorVersionsEvaluateProcessorVersionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -13704,14 +14839,14 @@ func (c *ProjectsLocationsProcessorsHumanReviewConfigReviewDocumentCall) doReque } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1reviewdocumentrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1evaluateprocessorversionrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+humanReviewConfig}:reviewDocument") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+processorVersion}:evaluateProcessorVersion") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -13719,19 +14854,19 @@ func (c *ProjectsLocationsProcessorsHumanReviewConfigReviewDocumentCall) doReque } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "humanReviewConfig": c.humanReviewConfig, + "processorVersion": c.processorVersion, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "documentai.projects.locations.processors.humanReviewConfig.reviewDocument" call. +// Do executes the "documentai.projects.locations.processors.processorVersions.evaluateProcessorVersion" call. // Exactly one of *GoogleLongrunningOperation or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either // *GoogleLongrunningOperation.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsProcessorsHumanReviewConfigReviewDocumentCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsProcessorsProcessorVersionsEvaluateProcessorVersionCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13762,25 +14897,25 @@ func (c *ProjectsLocationsProcessorsHumanReviewConfigReviewDocumentCall) Do(opts } return ret, nil // { - // "description": "Send a document for Human Review. The input document should be processed by the specified processor.", - // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}/humanReviewConfig:reviewDocument", + // "description": "Evaluates a ProcessorVersion against annotated documents, producing an Evaluation.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}/processorVersions/{processorVersionsId}:evaluateProcessorVersion", // "httpMethod": "POST", - // "id": "documentai.projects.locations.processors.humanReviewConfig.reviewDocument", + // "id": "documentai.projects.locations.processors.processorVersions.evaluateProcessorVersion", // "parameterOrder": [ - // "humanReviewConfig" + // "processorVersion" // ], // "parameters": { - // "humanReviewConfig": { - // "description": "Required. The resource name of the HumanReviewConfig that the document will be reviewed with.", + // "processorVersion": { + // "description": "Required. The resource name of the ProcessorVersion to evaluate. `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+/humanReviewConfig$", + // "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+humanReviewConfig}:reviewDocument", + // "path": "v1/{+processorVersion}:evaluateProcessorVersion", // "request": { - // "$ref": "GoogleCloudDocumentaiV1ReviewDocumentRequest" + // "$ref": "GoogleCloudDocumentaiV1EvaluateProcessorVersionRequest" // }, // "response": { // "$ref": "GoogleLongrunningOperation" @@ -13792,75 +14927,77 @@ func (c *ProjectsLocationsProcessorsHumanReviewConfigReviewDocumentCall) Do(opts } -// method id "documentai.projects.locations.processors.processorVersions.batchProcess": +// method id "documentai.projects.locations.processors.processorVersions.get": -type ProjectsLocationsProcessorsProcessorVersionsBatchProcessCall struct { - s *Service - name string - googleclouddocumentaiv1batchprocessrequest *GoogleCloudDocumentaiV1BatchProcessRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsProcessorsProcessorVersionsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// BatchProcess: LRO endpoint to batch process many documents. The -// output is written to Cloud Storage as JSON in the [Document] format. +// Get: Gets a processor version detail. // -// - name: The resource name of Processor or ProcessorVersion. Format: -// `projects/{project}/locations/{location}/processors/{processor}`, -// or -// `projects/{project}/locations/{location}/processors/{processor}/proc -// essorVersions/{processorVersion}`. -func (r *ProjectsLocationsProcessorsProcessorVersionsService) BatchProcess(name string, googleclouddocumentaiv1batchprocessrequest *GoogleCloudDocumentaiV1BatchProcessRequest) *ProjectsLocationsProcessorsProcessorVersionsBatchProcessCall { - c := &ProjectsLocationsProcessorsProcessorVersionsBatchProcessCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The processor resource name. +func (r *ProjectsLocationsProcessorsProcessorVersionsService) Get(name string) *ProjectsLocationsProcessorsProcessorVersionsGetCall { + c := &ProjectsLocationsProcessorsProcessorVersionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googleclouddocumentaiv1batchprocessrequest = googleclouddocumentaiv1batchprocessrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsProcessorsProcessorVersionsBatchProcessCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsProcessorVersionsBatchProcessCall { +func (c *ProjectsLocationsProcessorsProcessorVersionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsProcessorVersionsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsProcessorsProcessorVersionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsProcessorsProcessorVersionsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsProcessorsProcessorVersionsBatchProcessCall) Context(ctx context.Context) *ProjectsLocationsProcessorsProcessorVersionsBatchProcessCall { +func (c *ProjectsLocationsProcessorsProcessorVersionsGetCall) Context(ctx context.Context) *ProjectsLocationsProcessorsProcessorVersionsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsProcessorsProcessorVersionsBatchProcessCall) Header() http.Header { +func (c *ProjectsLocationsProcessorsProcessorVersionsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsProcessorsProcessorVersionsBatchProcessCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsProcessorsProcessorVersionsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1batchprocessrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:batchProcess") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -13871,14 +15008,15 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsBatchProcessCall) doRequest return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "documentai.projects.locations.processors.processorVersions.batchProcess" call. -// Exactly one of *GoogleLongrunningOperation or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was +// Do executes the "documentai.projects.locations.processors.processorVersions.get" call. +// Exactly one of *GoogleCloudDocumentaiV1ProcessorVersion or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudDocumentaiV1ProcessorVersion.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsProcessorsProcessorVersionsBatchProcessCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsProcessorsProcessorVersionsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDocumentaiV1ProcessorVersion, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13897,7 +15035,7 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsBatchProcessCall) Do(opts . if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningOperation{ + ret := &GoogleCloudDocumentaiV1ProcessorVersion{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13909,28 +15047,25 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsBatchProcessCall) Do(opts . } return ret, nil // { - // "description": "LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the [Document] format.", - // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}/processorVersions/{processorVersionsId}:batchProcess", - // "httpMethod": "POST", - // "id": "documentai.projects.locations.processors.processorVersions.batchProcess", + // "description": "Gets a processor version detail.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}/processorVersions/{processorVersionsId}", + // "httpMethod": "GET", + // "id": "documentai.projects.locations.processors.processorVersions.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of Processor or ProcessorVersion. Format: `projects/{project}/locations/{location}/processors/{processor}`, or `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`", + // "description": "Required. The processor resource name.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}:batchProcess", - // "request": { - // "$ref": "GoogleCloudDocumentaiV1BatchProcessRequest" - // }, + // "path": "v1/{+name}", // "response": { - // "$ref": "GoogleLongrunningOperation" + // "$ref": "GoogleCloudDocumentaiV1ProcessorVersion" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -13939,82 +15074,116 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsBatchProcessCall) Do(opts . } -// method id "documentai.projects.locations.processors.processorVersions.delete": +// method id "documentai.projects.locations.processors.processorVersions.list": -type ProjectsLocationsProcessorsProcessorVersionsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsProcessorsProcessorVersionsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes the processor version, all artifacts under the -// processor version will be deleted. +// List: Lists all versions of a processor. // -// - name: The processor version resource name to be deleted. -func (r *ProjectsLocationsProcessorsProcessorVersionsService) Delete(name string) *ProjectsLocationsProcessorsProcessorVersionsDeleteCall { - c := &ProjectsLocationsProcessorsProcessorVersionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The parent (project, location and processor) to list all +// versions. Format: +// `projects/{project}/locations/{location}/processors/{processor}`. +func (r *ProjectsLocationsProcessorsProcessorVersionsService) List(parent string) *ProjectsLocationsProcessorsProcessorVersionsListCall { + c := &ProjectsLocationsProcessorsProcessorVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of processor versions to return. If unspecified, at most 10 processor +// versions will be returned. The maximum value is 20; values above 20 +// will be coerced to 20. +func (c *ProjectsLocationsProcessorsProcessorVersionsListCall) PageSize(pageSize int64) *ProjectsLocationsProcessorsProcessorVersionsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": We will return the +// processor versions sorted by creation time. The page token will point +// to the next processor version. +func (c *ProjectsLocationsProcessorsProcessorVersionsListCall) PageToken(pageToken string) *ProjectsLocationsProcessorsProcessorVersionsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsProcessorsProcessorVersionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsProcessorVersionsDeleteCall { +func (c *ProjectsLocationsProcessorsProcessorVersionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsProcessorVersionsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsProcessorsProcessorVersionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsProcessorsProcessorVersionsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsProcessorsProcessorVersionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsProcessorsProcessorVersionsDeleteCall { +func (c *ProjectsLocationsProcessorsProcessorVersionsListCall) Context(ctx context.Context) *ProjectsLocationsProcessorsProcessorVersionsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsProcessorsProcessorVersionsDeleteCall) Header() http.Header { +func (c *ProjectsLocationsProcessorsProcessorVersionsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsProcessorsProcessorVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsProcessorsProcessorVersionsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/processorVersions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "documentai.projects.locations.processors.processorVersions.delete" call. -// Exactly one of *GoogleLongrunningOperation or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsProcessorsProcessorVersionsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +// Do executes the "documentai.projects.locations.processors.processorVersions.list" call. +// Exactly one of *GoogleCloudDocumentaiV1ListProcessorVersionsResponse +// or error will be non-nil. Any non-2xx status code is an error. +// Response headers are in either +// *GoogleCloudDocumentaiV1ListProcessorVersionsResponse.ServerResponse.H +// eader or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsProcessorsProcessorVersionsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDocumentaiV1ListProcessorVersionsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14033,7 +15202,7 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsDeleteCall) Do(opts ...goog if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningOperation{ + ret := &GoogleCloudDocumentaiV1ListProcessorVersionsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14045,25 +15214,36 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsDeleteCall) Do(opts ...goog } return ret, nil // { - // "description": "Deletes the processor version, all artifacts under the processor version will be deleted.", - // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}/processorVersions/{processorVersionsId}", - // "httpMethod": "DELETE", - // "id": "documentai.projects.locations.processors.processorVersions.delete", + // "description": "Lists all versions of a processor.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}/processorVersions", + // "httpMethod": "GET", + // "id": "documentai.projects.locations.processors.processorVersions.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The processor version resource name to be deleted.", + // "pageSize": { + // "description": "The maximum number of processor versions to return. If unspecified, at most 10 processor versions will be returned. The maximum value is 20; values above 20 will be coerced to 20.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "We will return the processor versions sorted by creation time. The page token will point to the next processor version.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent (project, location and processor) to list all versions. Format: `projects/{project}/locations/{location}/processors/{processor}`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/processorVersions", // "response": { - // "$ref": "GoogleLongrunningOperation" + // "$ref": "GoogleCloudDocumentaiV1ListProcessorVersionsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -14072,31 +15252,58 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsDeleteCall) Do(opts ...goog } -// method id "documentai.projects.locations.processors.processorVersions.deploy": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsProcessorsProcessorVersionsListCall) Pages(ctx context.Context, f func(*GoogleCloudDocumentaiV1ListProcessorVersionsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "documentai.projects.locations.processors.processorVersions.process": -type ProjectsLocationsProcessorsProcessorVersionsDeployCall struct { - s *Service - name string - googleclouddocumentaiv1deployprocessorversionrequest *GoogleCloudDocumentaiV1DeployProcessorVersionRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsProcessorsProcessorVersionsProcessCall struct { + s *Service + name string + googleclouddocumentaiv1processrequest *GoogleCloudDocumentaiV1ProcessRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Deploy: Deploys the processor version. +// Process: Processes a single document. // -// - name: The processor version resource name to be deployed. -func (r *ProjectsLocationsProcessorsProcessorVersionsService) Deploy(name string, googleclouddocumentaiv1deployprocessorversionrequest *GoogleCloudDocumentaiV1DeployProcessorVersionRequest) *ProjectsLocationsProcessorsProcessorVersionsDeployCall { - c := &ProjectsLocationsProcessorsProcessorVersionsDeployCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of the Processor or ProcessorVersion to use +// for processing. If a Processor is specified, the server will use +// its default version. Format: +// `projects/{project}/locations/{location}/processors/{processor}`, +// or +// `projects/{project}/locations/{location}/processors/{processor}/proc +// essorVersions/{processorVersion}`. +func (r *ProjectsLocationsProcessorsProcessorVersionsService) Process(name string, googleclouddocumentaiv1processrequest *GoogleCloudDocumentaiV1ProcessRequest) *ProjectsLocationsProcessorsProcessorVersionsProcessCall { + c := &ProjectsLocationsProcessorsProcessorVersionsProcessCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googleclouddocumentaiv1deployprocessorversionrequest = googleclouddocumentaiv1deployprocessorversionrequest + c.googleclouddocumentaiv1processrequest = googleclouddocumentaiv1processrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsProcessorsProcessorVersionsDeployCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsProcessorVersionsDeployCall { +func (c *ProjectsLocationsProcessorsProcessorVersionsProcessCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsProcessorVersionsProcessCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -14104,21 +15311,21 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsDeployCall) Fields(s ...goo // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsProcessorsProcessorVersionsDeployCall) Context(ctx context.Context) *ProjectsLocationsProcessorsProcessorVersionsDeployCall { +func (c *ProjectsLocationsProcessorsProcessorVersionsProcessCall) Context(ctx context.Context) *ProjectsLocationsProcessorsProcessorVersionsProcessCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsProcessorsProcessorVersionsDeployCall) Header() http.Header { +func (c *ProjectsLocationsProcessorsProcessorVersionsProcessCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsProcessorsProcessorVersionsDeployCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsProcessorsProcessorVersionsProcessCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -14126,14 +15333,14 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsDeployCall) doRequest(alt s } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1deployprocessorversionrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1processrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:deploy") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:process") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -14146,14 +15353,15 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsDeployCall) doRequest(alt s return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "documentai.projects.locations.processors.processorVersions.deploy" call. -// Exactly one of *GoogleLongrunningOperation or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was +// Do executes the "documentai.projects.locations.processors.processorVersions.process" call. +// Exactly one of *GoogleCloudDocumentaiV1ProcessResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudDocumentaiV1ProcessResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsProcessorsProcessorVersionsDeployCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsProcessorsProcessorVersionsProcessCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDocumentaiV1ProcessResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14172,7 +15380,7 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsDeployCall) Do(opts ...goog if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningOperation{ + ret := &GoogleCloudDocumentaiV1ProcessResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14184,28 +15392,28 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsDeployCall) Do(opts ...goog } return ret, nil // { - // "description": "Deploys the processor version.", - // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}/processorVersions/{processorVersionsId}:deploy", + // "description": "Processes a single document.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}/processorVersions/{processorVersionsId}:process", // "httpMethod": "POST", - // "id": "documentai.projects.locations.processors.processorVersions.deploy", + // "id": "documentai.projects.locations.processors.processorVersions.process", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The processor version resource name to be deployed.", + // "description": "Required. The resource name of the Processor or ProcessorVersion to use for processing. If a Processor is specified, the server will use its default version. Format: `projects/{project}/locations/{location}/processors/{processor}`, or `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}:deploy", + // "path": "v1/{+name}:process", // "request": { - // "$ref": "GoogleCloudDocumentaiV1DeployProcessorVersionRequest" + // "$ref": "GoogleCloudDocumentaiV1ProcessRequest" // }, // "response": { - // "$ref": "GoogleLongrunningOperation" + // "$ref": "GoogleCloudDocumentaiV1ProcessResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -14214,96 +15422,91 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsDeployCall) Do(opts ...goog } -// method id "documentai.projects.locations.processors.processorVersions.get": +// method id "documentai.projects.locations.processors.processorVersions.train": -type ProjectsLocationsProcessorsProcessorVersionsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsProcessorsProcessorVersionsTrainCall struct { + s *Service + parent string + googleclouddocumentaiv1trainprocessorversionrequest *GoogleCloudDocumentaiV1TrainProcessorVersionRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a processor version detail. +// Train: Trains a new processor version. Operation metadata is returned +// as cloud_documentai_core.TrainProcessorVersionMetadata. // -// - name: The processor resource name. -func (r *ProjectsLocationsProcessorsProcessorVersionsService) Get(name string) *ProjectsLocationsProcessorsProcessorVersionsGetCall { - c := &ProjectsLocationsProcessorsProcessorVersionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The parent (project, location and processor) to create the +// new version for. Format: +// `projects/{project}/locations/{location}/processors/{processor}`. +func (r *ProjectsLocationsProcessorsProcessorVersionsService) Train(parent string, googleclouddocumentaiv1trainprocessorversionrequest *GoogleCloudDocumentaiV1TrainProcessorVersionRequest) *ProjectsLocationsProcessorsProcessorVersionsTrainCall { + c := &ProjectsLocationsProcessorsProcessorVersionsTrainCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddocumentaiv1trainprocessorversionrequest = googleclouddocumentaiv1trainprocessorversionrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsProcessorsProcessorVersionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsProcessorVersionsGetCall { +func (c *ProjectsLocationsProcessorsProcessorVersionsTrainCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsProcessorVersionsTrainCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsProcessorsProcessorVersionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsProcessorsProcessorVersionsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsProcessorsProcessorVersionsGetCall) Context(ctx context.Context) *ProjectsLocationsProcessorsProcessorVersionsGetCall { +func (c *ProjectsLocationsProcessorsProcessorVersionsTrainCall) Context(ctx context.Context) *ProjectsLocationsProcessorsProcessorVersionsTrainCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsProcessorsProcessorVersionsGetCall) Header() http.Header { +func (c *ProjectsLocationsProcessorsProcessorVersionsTrainCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsProcessorsProcessorVersionsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsProcessorsProcessorVersionsTrainCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1trainprocessorversionrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/processorVersions:train") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "documentai.projects.locations.processors.processorVersions.get" call. -// Exactly one of *GoogleCloudDocumentaiV1ProcessorVersion or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleCloudDocumentaiV1ProcessorVersion.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was +// Do executes the "documentai.projects.locations.processors.processorVersions.train" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsProcessorsProcessorVersionsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDocumentaiV1ProcessorVersion, error) { +func (c *ProjectsLocationsProcessorsProcessorVersionsTrainCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14322,7 +15525,7 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsGetCall) Do(opts ...googlea if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudDocumentaiV1ProcessorVersion{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14334,25 +15537,28 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsGetCall) Do(opts ...googlea } return ret, nil // { - // "description": "Gets a processor version detail.", - // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}/processorVersions/{processorVersionsId}", - // "httpMethod": "GET", - // "id": "documentai.projects.locations.processors.processorVersions.get", + // "description": "Trains a new processor version. Operation metadata is returned as cloud_documentai_core.TrainProcessorVersionMetadata.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}/processorVersions:train", + // "httpMethod": "POST", + // "id": "documentai.projects.locations.processors.processorVersions.train", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The processor resource name.", + // "parent": { + // "description": "Required. The parent (project, location and processor) to create the new version for. Format: `projects/{project}/locations/{location}/processors/{processor}`.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/processorVersions:train", + // "request": { + // "$ref": "GoogleCloudDocumentaiV1TrainProcessorVersionRequest" + // }, // "response": { - // "$ref": "GoogleCloudDocumentaiV1ProcessorVersion" + // "$ref": "GoogleLongrunningOperation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -14361,116 +15567,88 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsGetCall) Do(opts ...googlea } -// method id "documentai.projects.locations.processors.processorVersions.list": +// method id "documentai.projects.locations.processors.processorVersions.undeploy": -type ProjectsLocationsProcessorsProcessorVersionsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsProcessorsProcessorVersionsUndeployCall struct { + s *Service + name string + googleclouddocumentaiv1undeployprocessorversionrequest *GoogleCloudDocumentaiV1UndeployProcessorVersionRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists all versions of a processor. +// Undeploy: Undeploys the processor version. // -// - parent: The parent (project, location and processor) to list all -// versions. Format: -// `projects/{project}/locations/{location}/processors/{processor}`. -func (r *ProjectsLocationsProcessorsProcessorVersionsService) List(parent string) *ProjectsLocationsProcessorsProcessorVersionsListCall { - c := &ProjectsLocationsProcessorsProcessorVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of processor versions to return. If unspecified, at most 10 processor -// versions will be returned. The maximum value is 20; values above 20 -// will be coerced to 20. -func (c *ProjectsLocationsProcessorsProcessorVersionsListCall) PageSize(pageSize int64) *ProjectsLocationsProcessorsProcessorVersionsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": We will return the -// processor versions sorted by creation time. The page token will point -// to the next processor version. -func (c *ProjectsLocationsProcessorsProcessorVersionsListCall) PageToken(pageToken string) *ProjectsLocationsProcessorsProcessorVersionsListCall { - c.urlParams_.Set("pageToken", pageToken) +// - name: The processor version resource name to be undeployed. +func (r *ProjectsLocationsProcessorsProcessorVersionsService) Undeploy(name string, googleclouddocumentaiv1undeployprocessorversionrequest *GoogleCloudDocumentaiV1UndeployProcessorVersionRequest) *ProjectsLocationsProcessorsProcessorVersionsUndeployCall { + c := &ProjectsLocationsProcessorsProcessorVersionsUndeployCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googleclouddocumentaiv1undeployprocessorversionrequest = googleclouddocumentaiv1undeployprocessorversionrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsProcessorsProcessorVersionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsProcessorVersionsListCall { +func (c *ProjectsLocationsProcessorsProcessorVersionsUndeployCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsProcessorVersionsUndeployCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsProcessorsProcessorVersionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsProcessorsProcessorVersionsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsProcessorsProcessorVersionsListCall) Context(ctx context.Context) *ProjectsLocationsProcessorsProcessorVersionsListCall { +func (c *ProjectsLocationsProcessorsProcessorVersionsUndeployCall) Context(ctx context.Context) *ProjectsLocationsProcessorsProcessorVersionsUndeployCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsProcessorsProcessorVersionsListCall) Header() http.Header { +func (c *ProjectsLocationsProcessorsProcessorVersionsUndeployCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsProcessorsProcessorVersionsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsProcessorsProcessorVersionsUndeployCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1undeployprocessorversionrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/processorVersions") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:undeploy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "documentai.projects.locations.processors.processorVersions.list" call. -// Exactly one of *GoogleCloudDocumentaiV1ListProcessorVersionsResponse -// or error will be non-nil. Any non-2xx status code is an error. -// Response headers are in either -// *GoogleCloudDocumentaiV1ListProcessorVersionsResponse.ServerResponse.H -// eader or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsLocationsProcessorsProcessorVersionsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDocumentaiV1ListProcessorVersionsResponse, error) { +// Do executes the "documentai.projects.locations.processors.processorVersions.undeploy" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsProcessorsProcessorVersionsUndeployCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14489,7 +15667,7 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsListCall) Do(opts ...google if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudDocumentaiV1ListProcessorVersionsResponse{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14501,36 +15679,28 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsListCall) Do(opts ...google } return ret, nil // { - // "description": "Lists all versions of a processor.", - // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}/processorVersions", - // "httpMethod": "GET", - // "id": "documentai.projects.locations.processors.processorVersions.list", + // "description": "Undeploys the processor version.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}/processorVersions/{processorVersionsId}:undeploy", + // "httpMethod": "POST", + // "id": "documentai.projects.locations.processors.processorVersions.undeploy", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "pageSize": { - // "description": "The maximum number of processor versions to return. If unspecified, at most 10 processor versions will be returned. The maximum value is 20; values above 20 will be coerced to 20.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "We will return the processor versions sorted by creation time. The page token will point to the next processor version.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The parent (project, location and processor) to list all versions. Format: `projects/{project}/locations/{location}/processors/{processor}`", + // "name": { + // "description": "Required. The processor version resource name to be undeployed.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/processorVersions", + // "path": "v1/{+name}:undeploy", + // "request": { + // "$ref": "GoogleCloudDocumentaiV1UndeployProcessorVersionRequest" + // }, // "response": { - // "$ref": "GoogleCloudDocumentaiV1ListProcessorVersionsResponse" + // "$ref": "GoogleLongrunningOperation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -14539,97 +15709,79 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsListCall) Do(opts ...google } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsProcessorsProcessorVersionsListCall) Pages(ctx context.Context, f func(*GoogleCloudDocumentaiV1ListProcessorVersionsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "documentai.projects.locations.processors.processorVersions.process": +// method id "documentai.projects.locations.processors.processorVersions.evaluations.get": -type ProjectsLocationsProcessorsProcessorVersionsProcessCall struct { - s *Service - name string - googleclouddocumentaiv1processrequest *GoogleCloudDocumentaiV1ProcessRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsProcessorsProcessorVersionsEvaluationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Process: Processes a single document. +// Get: Retrieves a specific evaluation. // -// - name: The resource name of the Processor or ProcessorVersion to use -// for processing. If a Processor is specified, the server will use -// its default version. Format: -// `projects/{project}/locations/{location}/processors/{processor}`, -// or +// - name: The resource name of the Evaluation to get. // `projects/{project}/locations/{location}/processors/{processor}/proc -// essorVersions/{processorVersion}`. -func (r *ProjectsLocationsProcessorsProcessorVersionsService) Process(name string, googleclouddocumentaiv1processrequest *GoogleCloudDocumentaiV1ProcessRequest) *ProjectsLocationsProcessorsProcessorVersionsProcessCall { - c := &ProjectsLocationsProcessorsProcessorVersionsProcessCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// essorVersions/{processorVersion}/evaluations/{evaluation}`. +func (r *ProjectsLocationsProcessorsProcessorVersionsEvaluationsService) Get(name string) *ProjectsLocationsProcessorsProcessorVersionsEvaluationsGetCall { + c := &ProjectsLocationsProcessorsProcessorVersionsEvaluationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googleclouddocumentaiv1processrequest = googleclouddocumentaiv1processrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsProcessorsProcessorVersionsProcessCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsProcessorVersionsProcessCall { +func (c *ProjectsLocationsProcessorsProcessorVersionsEvaluationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsProcessorVersionsEvaluationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsProcessorsProcessorVersionsEvaluationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsProcessorsProcessorVersionsEvaluationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsProcessorsProcessorVersionsProcessCall) Context(ctx context.Context) *ProjectsLocationsProcessorsProcessorVersionsProcessCall { +func (c *ProjectsLocationsProcessorsProcessorVersionsEvaluationsGetCall) Context(ctx context.Context) *ProjectsLocationsProcessorsProcessorVersionsEvaluationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsProcessorsProcessorVersionsProcessCall) Header() http.Header { +func (c *ProjectsLocationsProcessorsProcessorVersionsEvaluationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsProcessorsProcessorVersionsProcessCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsProcessorsProcessorVersionsEvaluationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1processrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:process") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -14640,15 +15792,15 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsProcessCall) doRequest(alt return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "documentai.projects.locations.processors.processorVersions.process" call. -// Exactly one of *GoogleCloudDocumentaiV1ProcessResponse or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleCloudDocumentaiV1ProcessResponse.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsProcessorsProcessorVersionsProcessCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDocumentaiV1ProcessResponse, error) { +// Do executes the "documentai.projects.locations.processors.processorVersions.evaluations.get" call. +// Exactly one of *GoogleCloudDocumentaiV1Evaluation or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *GoogleCloudDocumentaiV1Evaluation.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsProcessorsProcessorVersionsEvaluationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDocumentaiV1Evaluation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14667,7 +15819,7 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsProcessCall) Do(opts ...goo if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudDocumentaiV1ProcessResponse{ + ret := &GoogleCloudDocumentaiV1Evaluation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14679,28 +15831,25 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsProcessCall) Do(opts ...goo } return ret, nil // { - // "description": "Processes a single document.", - // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}/processorVersions/{processorVersionsId}:process", - // "httpMethod": "POST", - // "id": "documentai.projects.locations.processors.processorVersions.process", + // "description": "Retrieves a specific evaluation.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}/processorVersions/{processorVersionsId}/evaluations/{evaluationsId}", + // "httpMethod": "GET", + // "id": "documentai.projects.locations.processors.processorVersions.evaluations.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of the Processor or ProcessorVersion to use for processing. If a Processor is specified, the server will use its default version. Format: `projects/{project}/locations/{location}/processors/{processor}`, or `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`", + // "description": "Required. The resource name of the Evaluation to get. `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+/evaluations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}:process", - // "request": { - // "$ref": "GoogleCloudDocumentaiV1ProcessRequest" - // }, + // "path": "v1/{+name}", // "response": { - // "$ref": "GoogleCloudDocumentaiV1ProcessResponse" + // "$ref": "GoogleCloudDocumentaiV1Evaluation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -14709,88 +15858,116 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsProcessCall) Do(opts ...goo } -// method id "documentai.projects.locations.processors.processorVersions.undeploy": +// method id "documentai.projects.locations.processors.processorVersions.evaluations.list": -type ProjectsLocationsProcessorsProcessorVersionsUndeployCall struct { - s *Service - name string - googleclouddocumentaiv1undeployprocessorversionrequest *GoogleCloudDocumentaiV1UndeployProcessorVersionRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsProcessorsProcessorVersionsEvaluationsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Undeploy: Undeploys the processor version. +// List: Retrieves a set of evaluations for a given processor version. // -// - name: The processor version resource name to be undeployed. -func (r *ProjectsLocationsProcessorsProcessorVersionsService) Undeploy(name string, googleclouddocumentaiv1undeployprocessorversionrequest *GoogleCloudDocumentaiV1UndeployProcessorVersionRequest) *ProjectsLocationsProcessorsProcessorVersionsUndeployCall { - c := &ProjectsLocationsProcessorsProcessorVersionsUndeployCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.googleclouddocumentaiv1undeployprocessorversionrequest = googleclouddocumentaiv1undeployprocessorversionrequest +// - parent: The resource name of the ProcessorVersion to list +// evaluations for. +// `projects/{project}/locations/{location}/processors/{processor}/proc +// essorVersions/{processorVersion}`. +func (r *ProjectsLocationsProcessorsProcessorVersionsEvaluationsService) List(parent string) *ProjectsLocationsProcessorsProcessorVersionsEvaluationsListCall { + c := &ProjectsLocationsProcessorsProcessorVersionsEvaluationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list +// page size. If unspecified, at most 5 evaluations will be returned. +// The maximum value is 100; values above 100 will be coerced to 100. +func (c *ProjectsLocationsProcessorsProcessorVersionsEvaluationsListCall) PageSize(pageSize int64) *ProjectsLocationsProcessorsProcessorVersionsEvaluationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous `ListEvaluations` call. Provide this to +// retrieve the subsequent page. +func (c *ProjectsLocationsProcessorsProcessorVersionsEvaluationsListCall) PageToken(pageToken string) *ProjectsLocationsProcessorsProcessorVersionsEvaluationsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsProcessorsProcessorVersionsUndeployCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsProcessorVersionsUndeployCall { +func (c *ProjectsLocationsProcessorsProcessorVersionsEvaluationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorsProcessorVersionsEvaluationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsProcessorsProcessorVersionsEvaluationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsProcessorsProcessorVersionsEvaluationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsProcessorsProcessorVersionsUndeployCall) Context(ctx context.Context) *ProjectsLocationsProcessorsProcessorVersionsUndeployCall { +func (c *ProjectsLocationsProcessorsProcessorVersionsEvaluationsListCall) Context(ctx context.Context) *ProjectsLocationsProcessorsProcessorVersionsEvaluationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsProcessorsProcessorVersionsUndeployCall) Header() http.Header { +func (c *ProjectsLocationsProcessorsProcessorVersionsEvaluationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsProcessorsProcessorVersionsUndeployCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsProcessorsProcessorVersionsEvaluationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddocumentaiv1undeployprocessorversionrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:undeploy") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/evaluations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "documentai.projects.locations.processors.processorVersions.undeploy" call. -// Exactly one of *GoogleLongrunningOperation or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsProcessorsProcessorVersionsUndeployCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +// Do executes the "documentai.projects.locations.processors.processorVersions.evaluations.list" call. +// Exactly one of *GoogleCloudDocumentaiV1ListEvaluationsResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDocumentaiV1ListEvaluationsResponse.ServerResponse.Header +// or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsProcessorsProcessorVersionsEvaluationsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDocumentaiV1ListEvaluationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14809,7 +15986,7 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsUndeployCall) Do(opts ...go if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningOperation{ + ret := &GoogleCloudDocumentaiV1ListEvaluationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14821,28 +15998,36 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsUndeployCall) Do(opts ...go } return ret, nil // { - // "description": "Undeploys the processor version.", - // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}/processorVersions/{processorVersionsId}:undeploy", - // "httpMethod": "POST", - // "id": "documentai.projects.locations.processors.processorVersions.undeploy", + // "description": "Retrieves a set of evaluations for a given processor version.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}/processorVersions/{processorVersionsId}/evaluations", + // "httpMethod": "GET", + // "id": "documentai.projects.locations.processors.processorVersions.evaluations.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The processor version resource name to be undeployed.", + // "pageSize": { + // "description": "The standard list page size. If unspecified, at most 5 evaluations will be returned. The maximum value is 100; values above 100 will be coerced to 100.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token, received from a previous `ListEvaluations` call. Provide this to retrieve the subsequent page.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The resource name of the ProcessorVersion to list evaluations for. `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}:undeploy", - // "request": { - // "$ref": "GoogleCloudDocumentaiV1UndeployProcessorVersionRequest" - // }, + // "path": "v1/{+parent}/evaluations", // "response": { - // "$ref": "GoogleLongrunningOperation" + // "$ref": "GoogleCloudDocumentaiV1ListEvaluationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -14851,6 +16036,27 @@ func (c *ProjectsLocationsProcessorsProcessorVersionsUndeployCall) Do(opts ...go } +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsProcessorsProcessorVersionsEvaluationsListCall) Pages(ctx context.Context, f func(*GoogleCloudDocumentaiV1ListEvaluationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + // method id "documentai.projects.operations.get": type ProjectsOperationsGetCall struct { diff --git a/documentai/v1beta2/documentai-api.json b/documentai/v1beta2/documentai-api.json index 2d431e5250d..c716f9b4802 100644 --- a/documentai/v1beta2/documentai-api.json +++ b/documentai/v1beta2/documentai-api.json @@ -292,7 +292,7 @@ } } }, - "revision": "20230106", + "revision": "20230117", "rootUrl": "https://documentai.googleapis.com/", "schemas": { "GoogleCloudDocumentaiUiv1beta3BatchDeleteDocumentsMetadata": { @@ -554,6 +554,10 @@ "gcsManagedDocId": { "$ref": "GoogleCloudDocumentaiUiv1beta3DocumentIdGCSManagedDocumentId" }, + "revisionRef": { + "$ref": "GoogleCloudDocumentaiUiv1beta3RevisionRef", + "description": "Points to a specific revision of the document if set." + }, "revisionReference": { "$ref": "GoogleCloudDocumentaiUiv1beta3RevisionReference", "description": "Points to a specific revision of the document if set." @@ -870,6 +874,37 @@ "properties": {}, "type": "object" }, + "GoogleCloudDocumentaiUiv1beta3RevisionRef": { + "description": "The revision reference specifies which revision on the document to read.", + "id": "GoogleCloudDocumentaiUiv1beta3RevisionRef", + "properties": { + "latestProcessorVersion": { + "description": "Reads the revision generated by the processor version. The format takes the full resource name of processor version. `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`", + "type": "string" + }, + "revisionCase": { + "description": "Reads the revision by the predefined case.", + "enum": [ + "REVISION_CASE_UNSPECIFIED", + "LATEST_HUMAN_REVIEW", + "LATEST_TIMESTAMP", + "BASE_OCR_REVISION" + ], + "enumDescriptions": [ + "Unspecified case, fallback to read the first (OCR) revision.", + "The latest revision made by a human.", + "The latest revision based on timestamp.", + "The first (OCR) revision." + ], + "type": "string" + }, + "revisionId": { + "description": "Reads the revision given by the id.", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDocumentaiUiv1beta3RevisionReference": { "description": "The revision reference specifies which revision on the document to read.", "id": "GoogleCloudDocumentaiUiv1beta3RevisionReference", diff --git a/documentai/v1beta2/documentai-gen.go b/documentai/v1beta2/documentai-gen.go index b2ca3267656..a369b98a066 100644 --- a/documentai/v1beta2/documentai-gen.go +++ b/documentai/v1beta2/documentai-gen.go @@ -648,6 +648,9 @@ type GoogleCloudDocumentaiUiv1beta3DisableProcessorResponse struct { type GoogleCloudDocumentaiUiv1beta3DocumentId struct { GcsManagedDocId *GoogleCloudDocumentaiUiv1beta3DocumentIdGCSManagedDocumentId `json:"gcsManagedDocId,omitempty"` + // RevisionRef: Points to a specific revision of the document if set. + RevisionRef *GoogleCloudDocumentaiUiv1beta3RevisionRef `json:"revisionRef,omitempty"` + // RevisionReference: Points to a specific revision of the document if // set. RevisionReference *GoogleCloudDocumentaiUiv1beta3RevisionReference `json:"revisionReference,omitempty"` @@ -1238,6 +1241,54 @@ func (s *GoogleCloudDocumentaiUiv1beta3ResyncDatasetMetadataIndividualDocumentRe type GoogleCloudDocumentaiUiv1beta3ResyncDatasetResponse struct { } +// GoogleCloudDocumentaiUiv1beta3RevisionRef: The revision reference +// specifies which revision on the document to read. +type GoogleCloudDocumentaiUiv1beta3RevisionRef struct { + // LatestProcessorVersion: Reads the revision generated by the processor + // version. The format takes the full resource name of processor + // version. + // `projects/{project}/locations/{location}/processors/{processor}/proces + // sorVersions/{processorVersion}` + LatestProcessorVersion string `json:"latestProcessorVersion,omitempty"` + + // RevisionCase: Reads the revision by the predefined case. + // + // Possible values: + // "REVISION_CASE_UNSPECIFIED" - Unspecified case, fallback to read + // the first (OCR) revision. + // "LATEST_HUMAN_REVIEW" - The latest revision made by a human. + // "LATEST_TIMESTAMP" - The latest revision based on timestamp. + // "BASE_OCR_REVISION" - The first (OCR) revision. + RevisionCase string `json:"revisionCase,omitempty"` + + // RevisionId: Reads the revision given by the id. + RevisionId string `json:"revisionId,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "LatestProcessorVersion") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "LatestProcessorVersion") + // to include in API requests with the JSON null value. By default, + // fields with empty values are omitted from API requests. However, any + // field with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDocumentaiUiv1beta3RevisionRef) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiUiv1beta3RevisionRef + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudDocumentaiUiv1beta3RevisionReference: The revision // reference specifies which revision on the document to read. type GoogleCloudDocumentaiUiv1beta3RevisionReference struct { diff --git a/documentai/v1beta3/documentai-api.json b/documentai/v1beta3/documentai-api.json index f36250fa732..dd15f4d301a 100644 --- a/documentai/v1beta3/documentai-api.json +++ b/documentai/v1beta3/documentai-api.json @@ -984,7 +984,7 @@ } } }, - "revision": "20230106", + "revision": "20230117", "rootUrl": "https://documentai.googleapis.com/", "schemas": { "GoogleCloudDocumentaiUiv1beta3BatchDeleteDocumentsMetadata": { @@ -1246,6 +1246,10 @@ "gcsManagedDocId": { "$ref": "GoogleCloudDocumentaiUiv1beta3DocumentIdGCSManagedDocumentId" }, + "revisionRef": { + "$ref": "GoogleCloudDocumentaiUiv1beta3RevisionRef", + "description": "Points to a specific revision of the document if set." + }, "revisionReference": { "$ref": "GoogleCloudDocumentaiUiv1beta3RevisionReference", "description": "Points to a specific revision of the document if set." @@ -1562,6 +1566,37 @@ "properties": {}, "type": "object" }, + "GoogleCloudDocumentaiUiv1beta3RevisionRef": { + "description": "The revision reference specifies which revision on the document to read.", + "id": "GoogleCloudDocumentaiUiv1beta3RevisionRef", + "properties": { + "latestProcessorVersion": { + "description": "Reads the revision generated by the processor version. The format takes the full resource name of processor version. `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`", + "type": "string" + }, + "revisionCase": { + "description": "Reads the revision by the predefined case.", + "enum": [ + "REVISION_CASE_UNSPECIFIED", + "LATEST_HUMAN_REVIEW", + "LATEST_TIMESTAMP", + "BASE_OCR_REVISION" + ], + "enumDescriptions": [ + "Unspecified case, fallback to read the first (OCR) revision.", + "The latest revision made by a human.", + "The latest revision based on timestamp.", + "The first (OCR) revision." + ], + "type": "string" + }, + "revisionId": { + "description": "Reads the revision given by the id.", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDocumentaiUiv1beta3RevisionReference": { "description": "The revision reference specifies which revision on the document to read.", "id": "GoogleCloudDocumentaiUiv1beta3RevisionReference", @@ -6424,6 +6459,29 @@ }, "type": "object" }, + "GoogleCloudDocumentaiV1beta3EvaluationReference": { + "description": "Gives a short summary of an evaluation, and links to the evaluation itself.", + "id": "GoogleCloudDocumentaiV1beta3EvaluationReference", + "properties": { + "aggregateMetrics": { + "$ref": "GoogleCloudDocumentaiV1beta3EvaluationMetrics", + "description": "An aggregate of the statistics for the evaluation with fuzzy matching on." + }, + "aggregateMetricsExact": { + "$ref": "GoogleCloudDocumentaiV1beta3EvaluationMetrics", + "description": "An aggregate of the statistics for the evaluation with fuzzy matching off." + }, + "evaluation": { + "description": "The resource name of the evaluation.", + "type": "string" + }, + "operation": { + "description": "The resource name of the Long Running Operation for the evaluation.", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDocumentaiV1beta3FetchProcessorTypesResponse": { "description": "Response message for fetch processor types.", "id": "GoogleCloudDocumentaiV1beta3FetchProcessorTypesResponse", @@ -6841,6 +6899,10 @@ "description": "The KMS key version with which data is encrypted.", "type": "string" }, + "latestEvaluation": { + "$ref": "GoogleCloudDocumentaiV1beta3EvaluationReference", + "description": "The most recently invoked evaluation for the processor version." + }, "name": { "description": "The resource name of the processor version. Format: `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}`", "type": "string" diff --git a/documentai/v1beta3/documentai-gen.go b/documentai/v1beta3/documentai-gen.go index 23baa80f2a2..ebe0b8a1e12 100644 --- a/documentai/v1beta3/documentai-gen.go +++ b/documentai/v1beta3/documentai-gen.go @@ -672,6 +672,9 @@ type GoogleCloudDocumentaiUiv1beta3DisableProcessorResponse struct { type GoogleCloudDocumentaiUiv1beta3DocumentId struct { GcsManagedDocId *GoogleCloudDocumentaiUiv1beta3DocumentIdGCSManagedDocumentId `json:"gcsManagedDocId,omitempty"` + // RevisionRef: Points to a specific revision of the document if set. + RevisionRef *GoogleCloudDocumentaiUiv1beta3RevisionRef `json:"revisionRef,omitempty"` + // RevisionReference: Points to a specific revision of the document if // set. RevisionReference *GoogleCloudDocumentaiUiv1beta3RevisionReference `json:"revisionReference,omitempty"` @@ -1262,6 +1265,54 @@ func (s *GoogleCloudDocumentaiUiv1beta3ResyncDatasetMetadataIndividualDocumentRe type GoogleCloudDocumentaiUiv1beta3ResyncDatasetResponse struct { } +// GoogleCloudDocumentaiUiv1beta3RevisionRef: The revision reference +// specifies which revision on the document to read. +type GoogleCloudDocumentaiUiv1beta3RevisionRef struct { + // LatestProcessorVersion: Reads the revision generated by the processor + // version. The format takes the full resource name of processor + // version. + // `projects/{project}/locations/{location}/processors/{processor}/proces + // sorVersions/{processorVersion}` + LatestProcessorVersion string `json:"latestProcessorVersion,omitempty"` + + // RevisionCase: Reads the revision by the predefined case. + // + // Possible values: + // "REVISION_CASE_UNSPECIFIED" - Unspecified case, fallback to read + // the first (OCR) revision. + // "LATEST_HUMAN_REVIEW" - The latest revision made by a human. + // "LATEST_TIMESTAMP" - The latest revision based on timestamp. + // "BASE_OCR_REVISION" - The first (OCR) revision. + RevisionCase string `json:"revisionCase,omitempty"` + + // RevisionId: Reads the revision given by the id. + RevisionId string `json:"revisionId,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "LatestProcessorVersion") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "LatestProcessorVersion") + // to include in API requests with the JSON null value. By default, + // fields with empty values are omitted from API requests. However, any + // field with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDocumentaiUiv1beta3RevisionRef) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiUiv1beta3RevisionRef + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudDocumentaiUiv1beta3RevisionReference: The revision // reference specifies which revision on the document to read. type GoogleCloudDocumentaiUiv1beta3RevisionReference struct { @@ -9366,6 +9417,48 @@ func (s *GoogleCloudDocumentaiV1beta3EvaluationMultiConfidenceMetrics) Unmarshal return nil } +// GoogleCloudDocumentaiV1beta3EvaluationReference: Gives a short +// summary of an evaluation, and links to the evaluation itself. +type GoogleCloudDocumentaiV1beta3EvaluationReference struct { + // AggregateMetrics: An aggregate of the statistics for the evaluation + // with fuzzy matching on. + AggregateMetrics *GoogleCloudDocumentaiV1beta3EvaluationMetrics `json:"aggregateMetrics,omitempty"` + + // AggregateMetricsExact: An aggregate of the statistics for the + // evaluation with fuzzy matching off. + AggregateMetricsExact *GoogleCloudDocumentaiV1beta3EvaluationMetrics `json:"aggregateMetricsExact,omitempty"` + + // Evaluation: The resource name of the evaluation. + Evaluation string `json:"evaluation,omitempty"` + + // Operation: The resource name of the Long Running Operation for the + // evaluation. + Operation string `json:"operation,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AggregateMetrics") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AggregateMetrics") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDocumentaiV1beta3EvaluationReference) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiV1beta3EvaluationReference + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudDocumentaiV1beta3FetchProcessorTypesResponse: Response // message for fetch processor types. type GoogleCloudDocumentaiV1beta3FetchProcessorTypesResponse struct { @@ -10129,6 +10222,10 @@ type GoogleCloudDocumentaiV1beta3ProcessorVersion struct { // KmsKeyVersionName: The KMS key version with which data is encrypted. KmsKeyVersionName string `json:"kmsKeyVersionName,omitempty"` + // LatestEvaluation: The most recently invoked evaluation for the + // processor version. + LatestEvaluation *GoogleCloudDocumentaiV1beta3EvaluationReference `json:"latestEvaluation,omitempty"` + // Name: The resource name of the processor version. Format: // `projects/{project}/locations/{location}/processors/{processor}/proces // sorVersions/{processor_version}` diff --git a/integrations/v1alpha/integrations-api.json b/integrations/v1alpha/integrations-api.json index 7106b8aa745..357bab7e258 100644 --- a/integrations/v1alpha/integrations-api.json +++ b/integrations/v1alpha/integrations-api.json @@ -895,6 +895,114 @@ "https://www.googleapis.com/auth/cloud-platform" ] } + }, + "resources": { + "suspensions": { + "methods": { + "lift": { + "description": "* Lifts suspension for advanced suspension task. Fetch corresponding suspension with provided suspension Id, resolve suspension, and set up suspension result for the Suspension Task.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/integrations/{integrationsId}/executions/{executionsId}/suspensions/{suspensionsId}:lift", + "httpMethod": "POST", + "id": "integrations.projects.locations.integrations.executions.suspensions.lift", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource that the suspension belongs to. \"projects/{project}/locations/{location}/products/{product}/integrations/{integration}/executions/{execution}/suspensions/{suspenion}\" format.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/integrations/[^/]+/executions/[^/]+/suspensions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+name}:lift", + "request": { + "$ref": "GoogleCloudIntegrationsV1alphaLiftSuspensionRequest" + }, + "response": { + "$ref": "GoogleCloudIntegrationsV1alphaLiftSuspensionResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "* Lists suspensions associated with a specific execution. Only those with permissions to resolve the relevant suspensions will be able to view them.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/integrations/{integrationsId}/executions/{executionsId}/suspensions", + "httpMethod": "GET", + "id": "integrations.projects.locations.integrations.executions.suspensions.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "filter": { + "description": "Standard filter field.", + "location": "query", + "type": "string" + }, + "orderBy": { + "description": "Field name to order by.", + "location": "query", + "type": "string" + }, + "pageSize": { + "description": "Maximum number of entries in the response.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Token to retrieve a specific page.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. projects/{gcp_project_id}/locations/{location}/products/{product}/integrations/{integration_name}/executions/{execution_name}", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/integrations/[^/]+/executions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+parent}/suspensions", + "response": { + "$ref": "GoogleCloudIntegrationsV1alphaListSuspensionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "resolve": { + "description": "* Resolves (lifts/rejects) any number of suspensions. If the integration is already running, only the status of the suspension is updated. Otherwise, the suspended integration will begin execution again.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/integrations/{integrationsId}/executions/{executionsId}/suspensions/{suspensionsId}:resolve", + "httpMethod": "POST", + "id": "integrations.projects.locations.integrations.executions.suspensions.resolve", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. projects/{gcp_project_id}/locations/{location}/products/{product}/integrations/{integration_name}/executions/{execution_name}/suspensions/{suspension_id}", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/integrations/[^/]+/executions/[^/]+/suspensions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+name}:resolve", + "request": { + "$ref": "GoogleCloudIntegrationsV1alphaResolveSuspensionRequest" + }, + "response": { + "$ref": "GoogleCloudIntegrationsV1alphaResolveSuspensionResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } } }, "versions": { @@ -3252,7 +3360,7 @@ } } }, - "revision": "20230103", + "revision": "20230110", "rootUrl": "https://integrations.googleapis.com/", "schemas": { "CrmlogErrorCode": { diff --git a/integrations/v1alpha/integrations-gen.go b/integrations/v1alpha/integrations-gen.go index 5e754fe70e7..d432da0b315 100644 --- a/integrations/v1alpha/integrations-gen.go +++ b/integrations/v1alpha/integrations-gen.go @@ -280,11 +280,23 @@ type ProjectsLocationsIntegrationsService struct { func NewProjectsLocationsIntegrationsExecutionsService(s *Service) *ProjectsLocationsIntegrationsExecutionsService { rs := &ProjectsLocationsIntegrationsExecutionsService{s: s} + rs.Suspensions = NewProjectsLocationsIntegrationsExecutionsSuspensionsService(s) return rs } type ProjectsLocationsIntegrationsExecutionsService struct { s *Service + + Suspensions *ProjectsLocationsIntegrationsExecutionsSuspensionsService +} + +func NewProjectsLocationsIntegrationsExecutionsSuspensionsService(s *Service) *ProjectsLocationsIntegrationsExecutionsSuspensionsService { + rs := &ProjectsLocationsIntegrationsExecutionsSuspensionsService{s: s} + return rs +} + +type ProjectsLocationsIntegrationsExecutionsSuspensionsService struct { + s *Service } func NewProjectsLocationsIntegrationsVersionsService(s *Service) *ProjectsLocationsIntegrationsVersionsService { @@ -14738,6 +14750,527 @@ func (c *ProjectsLocationsIntegrationsExecutionsListCall) Pages(ctx context.Cont } } +// method id "integrations.projects.locations.integrations.executions.suspensions.lift": + +type ProjectsLocationsIntegrationsExecutionsSuspensionsLiftCall struct { + s *Service + name string + googlecloudintegrationsv1alphaliftsuspensionrequest *GoogleCloudIntegrationsV1alphaLiftSuspensionRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Lift: * Lifts suspension for advanced suspension task. Fetch +// corresponding suspension with provided suspension Id, resolve +// suspension, and set up suspension result for the Suspension Task. +// +// - name: The resource that the suspension belongs to. +// "projects/{project}/locations/{location}/products/{product}/integrat +// ions/{integration}/executions/{execution}/suspensions/{suspenion}" +// format. +func (r *ProjectsLocationsIntegrationsExecutionsSuspensionsService) Lift(name string, googlecloudintegrationsv1alphaliftsuspensionrequest *GoogleCloudIntegrationsV1alphaLiftSuspensionRequest) *ProjectsLocationsIntegrationsExecutionsSuspensionsLiftCall { + c := &ProjectsLocationsIntegrationsExecutionsSuspensionsLiftCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudintegrationsv1alphaliftsuspensionrequest = googlecloudintegrationsv1alphaliftsuspensionrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsIntegrationsExecutionsSuspensionsLiftCall) Fields(s ...googleapi.Field) *ProjectsLocationsIntegrationsExecutionsSuspensionsLiftCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsIntegrationsExecutionsSuspensionsLiftCall) Context(ctx context.Context) *ProjectsLocationsIntegrationsExecutionsSuspensionsLiftCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsIntegrationsExecutionsSuspensionsLiftCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsIntegrationsExecutionsSuspensionsLiftCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudintegrationsv1alphaliftsuspensionrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:lift") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "integrations.projects.locations.integrations.executions.suspensions.lift" call. +// Exactly one of *GoogleCloudIntegrationsV1alphaLiftSuspensionResponse +// or error will be non-nil. Any non-2xx status code is an error. +// Response headers are in either +// *GoogleCloudIntegrationsV1alphaLiftSuspensionResponse.ServerResponse.H +// eader or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsIntegrationsExecutionsSuspensionsLiftCall) Do(opts ...googleapi.CallOption) (*GoogleCloudIntegrationsV1alphaLiftSuspensionResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudIntegrationsV1alphaLiftSuspensionResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "* Lifts suspension for advanced suspension task. Fetch corresponding suspension with provided suspension Id, resolve suspension, and set up suspension result for the Suspension Task.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/integrations/{integrationsId}/executions/{executionsId}/suspensions/{suspensionsId}:lift", + // "httpMethod": "POST", + // "id": "integrations.projects.locations.integrations.executions.suspensions.lift", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource that the suspension belongs to. \"projects/{project}/locations/{location}/products/{product}/integrations/{integration}/executions/{execution}/suspensions/{suspenion}\" format.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/integrations/[^/]+/executions/[^/]+/suspensions/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+name}:lift", + // "request": { + // "$ref": "GoogleCloudIntegrationsV1alphaLiftSuspensionRequest" + // }, + // "response": { + // "$ref": "GoogleCloudIntegrationsV1alphaLiftSuspensionResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "integrations.projects.locations.integrations.executions.suspensions.list": + +type ProjectsLocationsIntegrationsExecutionsSuspensionsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: * Lists suspensions associated with a specific execution. Only +// those with permissions to resolve the relevant suspensions will be +// able to view them. +// +// - parent: +// projects/{gcp_project_id}/locations/{location}/products/{product}/in +// tegrations/{integration_name}/executions/{execution_name}. +func (r *ProjectsLocationsIntegrationsExecutionsSuspensionsService) List(parent string) *ProjectsLocationsIntegrationsExecutionsSuspensionsListCall { + c := &ProjectsLocationsIntegrationsExecutionsSuspensionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": Standard filter field. +func (c *ProjectsLocationsIntegrationsExecutionsSuspensionsListCall) Filter(filter string) *ProjectsLocationsIntegrationsExecutionsSuspensionsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// OrderBy sets the optional parameter "orderBy": Field name to order +// by. +func (c *ProjectsLocationsIntegrationsExecutionsSuspensionsListCall) OrderBy(orderBy string) *ProjectsLocationsIntegrationsExecutionsSuspensionsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// entries in the response. +func (c *ProjectsLocationsIntegrationsExecutionsSuspensionsListCall) PageSize(pageSize int64) *ProjectsLocationsIntegrationsExecutionsSuspensionsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": Token to retrieve +// a specific page. +func (c *ProjectsLocationsIntegrationsExecutionsSuspensionsListCall) PageToken(pageToken string) *ProjectsLocationsIntegrationsExecutionsSuspensionsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsIntegrationsExecutionsSuspensionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsIntegrationsExecutionsSuspensionsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsIntegrationsExecutionsSuspensionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsIntegrationsExecutionsSuspensionsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsIntegrationsExecutionsSuspensionsListCall) Context(ctx context.Context) *ProjectsLocationsIntegrationsExecutionsSuspensionsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsIntegrationsExecutionsSuspensionsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsIntegrationsExecutionsSuspensionsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/suspensions") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "integrations.projects.locations.integrations.executions.suspensions.list" call. +// Exactly one of *GoogleCloudIntegrationsV1alphaListSuspensionsResponse +// or error will be non-nil. Any non-2xx status code is an error. +// Response headers are in either +// *GoogleCloudIntegrationsV1alphaListSuspensionsResponse.ServerResponse. +// Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsIntegrationsExecutionsSuspensionsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudIntegrationsV1alphaListSuspensionsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudIntegrationsV1alphaListSuspensionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "* Lists suspensions associated with a specific execution. Only those with permissions to resolve the relevant suspensions will be able to view them.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/integrations/{integrationsId}/executions/{executionsId}/suspensions", + // "httpMethod": "GET", + // "id": "integrations.projects.locations.integrations.executions.suspensions.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "filter": { + // "description": "Standard filter field.", + // "location": "query", + // "type": "string" + // }, + // "orderBy": { + // "description": "Field name to order by.", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "Maximum number of entries in the response.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Token to retrieve a specific page.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. projects/{gcp_project_id}/locations/{location}/products/{product}/integrations/{integration_name}/executions/{execution_name}", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/integrations/[^/]+/executions/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+parent}/suspensions", + // "response": { + // "$ref": "GoogleCloudIntegrationsV1alphaListSuspensionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsIntegrationsExecutionsSuspensionsListCall) Pages(ctx context.Context, f func(*GoogleCloudIntegrationsV1alphaListSuspensionsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "integrations.projects.locations.integrations.executions.suspensions.resolve": + +type ProjectsLocationsIntegrationsExecutionsSuspensionsResolveCall struct { + s *Service + name string + googlecloudintegrationsv1alpharesolvesuspensionrequest *GoogleCloudIntegrationsV1alphaResolveSuspensionRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Resolve: * Resolves (lifts/rejects) any number of suspensions. If the +// integration is already running, only the status of the suspension is +// updated. Otherwise, the suspended integration will begin execution +// again. +// +// - name: +// projects/{gcp_project_id}/locations/{location}/products/{product}/in +// tegrations/{integration_name}/executions/{execution_name}/suspension +// s/{suspension_id}. +func (r *ProjectsLocationsIntegrationsExecutionsSuspensionsService) Resolve(name string, googlecloudintegrationsv1alpharesolvesuspensionrequest *GoogleCloudIntegrationsV1alphaResolveSuspensionRequest) *ProjectsLocationsIntegrationsExecutionsSuspensionsResolveCall { + c := &ProjectsLocationsIntegrationsExecutionsSuspensionsResolveCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudintegrationsv1alpharesolvesuspensionrequest = googlecloudintegrationsv1alpharesolvesuspensionrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsIntegrationsExecutionsSuspensionsResolveCall) Fields(s ...googleapi.Field) *ProjectsLocationsIntegrationsExecutionsSuspensionsResolveCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsIntegrationsExecutionsSuspensionsResolveCall) Context(ctx context.Context) *ProjectsLocationsIntegrationsExecutionsSuspensionsResolveCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsIntegrationsExecutionsSuspensionsResolveCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsIntegrationsExecutionsSuspensionsResolveCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudintegrationsv1alpharesolvesuspensionrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:resolve") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "integrations.projects.locations.integrations.executions.suspensions.resolve" call. +// Exactly one of +// *GoogleCloudIntegrationsV1alphaResolveSuspensionResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudIntegrationsV1alphaResolveSuspensionResponse.ServerRespons +// e.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsIntegrationsExecutionsSuspensionsResolveCall) Do(opts ...googleapi.CallOption) (*GoogleCloudIntegrationsV1alphaResolveSuspensionResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudIntegrationsV1alphaResolveSuspensionResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "* Resolves (lifts/rejects) any number of suspensions. If the integration is already running, only the status of the suspension is updated. Otherwise, the suspended integration will begin execution again.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/integrations/{integrationsId}/executions/{executionsId}/suspensions/{suspensionsId}:resolve", + // "httpMethod": "POST", + // "id": "integrations.projects.locations.integrations.executions.suspensions.resolve", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. projects/{gcp_project_id}/locations/{location}/products/{product}/integrations/{integration_name}/executions/{execution_name}/suspensions/{suspension_id}", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/integrations/[^/]+/executions/[^/]+/suspensions/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+name}:resolve", + // "request": { + // "$ref": "GoogleCloudIntegrationsV1alphaResolveSuspensionRequest" + // }, + // "response": { + // "$ref": "GoogleCloudIntegrationsV1alphaResolveSuspensionResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + // method id "integrations.projects.locations.integrations.versions.archive": type ProjectsLocationsIntegrationsVersionsArchiveCall struct { diff --git a/kmsinventory/v1/kmsinventory-api.json b/kmsinventory/v1/kmsinventory-api.json new file mode 100644 index 00000000000..313c8737e89 --- /dev/null +++ b/kmsinventory/v1/kmsinventory-api.json @@ -0,0 +1,794 @@ +{ + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account." + } + } + } + }, + "basePath": "", + "baseUrl": "https://kmsinventory.googleapis.com/", + "batchPath": "batch", + "canonicalName": "Kmsinventory", + "description": "", + "discoveryVersion": "v1", + "documentationLink": "https://cloud.google.com/kms/", + "fullyEncodeReservedExpansion": true, + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "id": "kmsinventory:v1", + "kind": "discovery#restDescription", + "mtlsRootUrl": "https://kmsinventory.mtls.googleapis.com/", + "name": "kmsinventory", + "ownerDomain": "google.com", + "ownerName": "Google", + "parameters": { + "$.xgafv": { + "description": "V1 error format.", + "enum": [ + "1", + "2" + ], + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "type": "string" + }, + "access_token": { + "description": "OAuth access token.", + "location": "query", + "type": "string" + }, + "alt": { + "default": "json", + "description": "Data format for response.", + "enum": [ + "json", + "media", + "proto" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query", + "type": "string" + }, + "callback": { + "description": "JSONP", + "location": "query", + "type": "string" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "location": "query", + "type": "string" + }, + "key": { + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query", + "type": "string" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "location": "query", + "type": "string" + }, + "prettyPrint": { + "default": "true", + "description": "Returns response with indentations and line breaks.", + "location": "query", + "type": "boolean" + }, + "quotaUser": { + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query", + "type": "string" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query", + "type": "string" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query", + "type": "string" + } + }, + "protocol": "rest", + "resources": { + "organizations": { + "resources": { + "protectedResources": { + "methods": { + "search": { + "description": "Returns metadata about the resources protected by the given Cloud KMS CryptoKey in the given Cloud organization.", + "flatPath": "v1/organizations/{organizationsId}/protectedResources:search", + "httpMethod": "GET", + "id": "kmsinventory.organizations.protectedResources.search", + "parameterOrder": [ + "scope" + ], + "parameters": { + "cryptoKey": { + "description": "Required. The resource name of the CryptoKey.", + "location": "query", + "type": "string" + }, + "pageSize": { + "description": "The maximum number of resources to return. The service may return fewer than this value. If unspecified, at most 500 resources will be returned. The maximum value is 500; values above 500 will be coerced to 500.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token, received from a previous KeyTrackingService.SearchProtectedResources call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to KeyTrackingService.SearchProtectedResources must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "scope": { + "description": "Required. Resource name of the organization. Example: organizations/123", + "location": "path", + "pattern": "^organizations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+scope}/protectedResources:search", + "response": { + "$ref": "GoogleCloudKmsInventoryV1SearchProtectedResourcesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + }, + "projects": { + "resources": { + "cryptoKeys": { + "methods": { + "list": { + "description": "Returns cryptographic keys managed by Cloud KMS in a given Cloud project. Note that this data is sourced from snapshots, meaning it may not completely reflect the actual state of key metadata at call time.", + "flatPath": "v1/projects/{projectsId}/cryptoKeys", + "httpMethod": "GET", + "id": "kmsinventory.projects.cryptoKeys.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of keys to return. The service may return fewer than this value. If unspecified, at most 1000 keys will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. Pass this into a subsequent request in order to receive the next page of results.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The Google Cloud project for which to retrieve key metadata, in the format `projects/*`", + "location": "path", + "pattern": "^projects/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/cryptoKeys", + "response": { + "$ref": "GoogleCloudKmsInventoryV1ListCryptoKeysResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "locations": { + "resources": { + "keyRings": { + "resources": { + "cryptoKeys": { + "methods": { + "getProtectedResourcesSummary": { + "description": "Returns aggregate information about the resources protected by the given Cloud KMS CryptoKey. Only resources within the same Cloud organization as the key will be returned. The project that holds the key must be part of an organization in order for this call to succeed.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}/protectedResourcesSummary", + "httpMethod": "GET", + "id": "kmsinventory.projects.locations.keyRings.cryptoKeys.getProtectedResourcesSummary", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the CryptoKey.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/.*$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}/protectedResourcesSummary", + "response": { + "$ref": "GoogleCloudKmsInventoryV1ProtectedResourcesSummary" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + } + } + } + } + } + }, + "revision": "20230115", + "rootUrl": "https://kmsinventory.googleapis.com/", + "schemas": { + "GoogleCloudKmsInventoryV1ListCryptoKeysResponse": { + "description": "Response message for KeyDashboardService.ListCryptoKeys.", + "id": "GoogleCloudKmsInventoryV1ListCryptoKeysResponse", + "properties": { + "cryptoKeys": { + "description": "The list of CryptoKeys.", + "items": { + "$ref": "GoogleCloudKmsV1CryptoKey" + }, + "type": "array" + }, + "nextPageToken": { + "description": "The page token returned from the previous response if the next page is desired.", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudKmsInventoryV1ProtectedResource": { + "description": "Metadata about a resource protected by a Cloud KMS key.", + "id": "GoogleCloudKmsInventoryV1ProtectedResource", + "properties": { + "cloudProduct": { + "description": "The Cloud product that owns the resource. Example: `compute`", + "type": "string" + }, + "createTime": { + "description": "Output only. The time at which this resource was created. The granularity is in seconds. Timestamp.nanos will always be 0.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "cryptoKeyVersion": { + "description": "The name of the Cloud KMS [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions?hl=en) used to protect this resource via CMEK. This field may be empty if the Cloud product owning the resource does not provide key version data to Asset Inventory.", + "type": "string" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "A key-value pair of the resource's labels (v1) to their values.", + "type": "object" + }, + "location": { + "description": "Location can be `global`, regional like `us-east1`, or zonal like `us-west1-b`.", + "type": "string" + }, + "name": { + "description": "The full resource name of the resource. Example: `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.", + "type": "string" + }, + "project": { + "description": "Format: `projects/{PROJECT_NUMBER}`.", + "type": "string" + }, + "projectId": { + "description": "The ID of the project that owns the resource.", + "type": "string" + }, + "resourceType": { + "description": "Example: `compute.googleapis.com/Disk`", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudKmsInventoryV1ProtectedResourcesSummary": { + "description": "Aggregate information about the resources protected by a Cloud KMS key in the same Cloud organization as the key.", + "id": "GoogleCloudKmsInventoryV1ProtectedResourcesSummary", + "properties": { + "cloudProducts": { + "additionalProperties": { + "format": "int64", + "type": "string" + }, + "description": "The number of resources protected by the key grouped by Cloud product.", + "type": "object" + }, + "locations": { + "additionalProperties": { + "format": "int64", + "type": "string" + }, + "description": "The number of resources protected by the key grouped by region.", + "type": "object" + }, + "name": { + "description": "The full name of the ProtectedResourcesSummary resource. Example: projects/test-project/locations/us/keyRings/test-keyring/cryptoKeys/test-key/protectedResourcesSummary", + "type": "string" + }, + "projectCount": { + "description": "The number of distinct Cloud projects in the same Cloud organization as the key that have resources protected by the key.", + "format": "int32", + "type": "integer" + }, + "resourceCount": { + "description": "The total number of protected resources in the same Cloud organization as the key.", + "format": "int64", + "type": "string" + }, + "resourceTypes": { + "additionalProperties": { + "format": "int64", + "type": "string" + }, + "description": "The number of resources protected by the key grouped by resource type.", + "type": "object" + } + }, + "type": "object" + }, + "GoogleCloudKmsInventoryV1SearchProtectedResourcesResponse": { + "description": "Response message for KeyTrackingService.SearchProtectedResources.", + "id": "GoogleCloudKmsInventoryV1SearchProtectedResourcesResponse", + "properties": { + "nextPageToken": { + "description": "A token that can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + }, + "protectedResources": { + "description": "Protected resources for this page.", + "items": { + "$ref": "GoogleCloudKmsInventoryV1ProtectedResource" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudKmsV1CryptoKey": { + "description": "A CryptoKey represents a logical key that can be used for cryptographic operations. A CryptoKey is made up of zero or more versions, which represent the actual key material used in cryptographic operations.", + "id": "GoogleCloudKmsV1CryptoKey", + "properties": { + "createTime": { + "description": "Output only. The time at which this CryptoKey was created.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "cryptoKeyBackend": { + "description": "Immutable. The resource name of the backend environment where the key material for all CryptoKeyVersions associated with this CryptoKey reside and where all related cryptographic operations are performed. Only applicable if CryptoKeyVersions have a ProtectionLevel of EXTERNAL_VPC, with the resource name in the format `projects/*/locations/*/ekmConnections/*`. Note, this list is non-exhaustive and may apply to additional ProtectionLevels in the future.", + "type": "string" + }, + "destroyScheduledDuration": { + "description": "Immutable. The period of time that versions of this key spend in the DESTROY_SCHEDULED state before transitioning to DESTROYED. If not specified at creation time, the default duration is 24 hours.", + "format": "google-duration", + "type": "string" + }, + "importOnly": { + "description": "Immutable. Whether this key may contain imported versions only.", + "type": "boolean" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "Labels with user-defined metadata. For more information, see [Labeling Keys](https://cloud.google.com/kms/docs/labeling-keys).", + "type": "object" + }, + "name": { + "description": "Output only. The resource name for this CryptoKey in the format `projects/*/locations/*/keyRings/*/cryptoKeys/*`.", + "readOnly": true, + "type": "string" + }, + "nextRotationTime": { + "description": "At next_rotation_time, the Key Management Service will automatically: 1. Create a new version of this CryptoKey. 2. Mark the new version as primary. Key rotations performed manually via CreateCryptoKeyVersion and UpdateCryptoKeyPrimaryVersion do not affect next_rotation_time. Keys with purpose ENCRYPT_DECRYPT support automatic rotation. For other keys, this field must be omitted.", + "format": "google-datetime", + "type": "string" + }, + "primary": { + "$ref": "GoogleCloudKmsV1CryptoKeyVersion", + "description": "Output only. A copy of the \"primary\" CryptoKeyVersion that will be used by Encrypt when this CryptoKey is given in EncryptRequest.name. The CryptoKey's primary version can be updated via UpdateCryptoKeyPrimaryVersion. Keys with purpose ENCRYPT_DECRYPT may have a primary. For other keys, this field will be omitted.", + "readOnly": true + }, + "purpose": { + "description": "Immutable. The immutable purpose of this CryptoKey.", + "enum": [ + "CRYPTO_KEY_PURPOSE_UNSPECIFIED", + "ENCRYPT_DECRYPT", + "ASYMMETRIC_SIGN", + "ASYMMETRIC_DECRYPT", + "MAC" + ], + "enumDescriptions": [ + "Not specified.", + "CryptoKeys with this purpose may be used with Encrypt and Decrypt.", + "CryptoKeys with this purpose may be used with AsymmetricSign and GetPublicKey.", + "CryptoKeys with this purpose may be used with AsymmetricDecrypt and GetPublicKey.", + "CryptoKeys with this purpose may be used with MacSign." + ], + "type": "string" + }, + "rotationPeriod": { + "description": "next_rotation_time will be advanced by this period when the service automatically rotates a key. Must be at least 24 hours and at most 876,000 hours. If rotation_period is set, next_rotation_time must also be set. Keys with purpose ENCRYPT_DECRYPT support automatic rotation. For other keys, this field must be omitted.", + "format": "google-duration", + "type": "string" + }, + "versionTemplate": { + "$ref": "GoogleCloudKmsV1CryptoKeyVersionTemplate", + "description": "A template describing settings for new CryptoKeyVersion instances. The properties of new CryptoKeyVersion instances created by either CreateCryptoKeyVersion or auto-rotation are controlled by this template." + } + }, + "type": "object" + }, + "GoogleCloudKmsV1CryptoKeyVersion": { + "description": "A CryptoKeyVersion represents an individual cryptographic key, and the associated key material. An ENABLED version can be used for cryptographic operations. For security reasons, the raw cryptographic key material represented by a CryptoKeyVersion can never be viewed or exported. It can only be used to encrypt, decrypt, or sign data when an authorized user or application invokes Cloud KMS.", + "id": "GoogleCloudKmsV1CryptoKeyVersion", + "properties": { + "algorithm": { + "description": "Output only. The CryptoKeyVersionAlgorithm that this CryptoKeyVersion supports.", + "enum": [ + "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED", + "GOOGLE_SYMMETRIC_ENCRYPTION", + "RSA_SIGN_PSS_2048_SHA256", + "RSA_SIGN_PSS_3072_SHA256", + "RSA_SIGN_PSS_4096_SHA256", + "RSA_SIGN_PSS_4096_SHA512", + "RSA_SIGN_PKCS1_2048_SHA256", + "RSA_SIGN_PKCS1_3072_SHA256", + "RSA_SIGN_PKCS1_4096_SHA256", + "RSA_SIGN_PKCS1_4096_SHA512", + "RSA_SIGN_RAW_PKCS1_2048", + "RSA_SIGN_RAW_PKCS1_3072", + "RSA_SIGN_RAW_PKCS1_4096", + "RSA_DECRYPT_OAEP_2048_SHA256", + "RSA_DECRYPT_OAEP_3072_SHA256", + "RSA_DECRYPT_OAEP_4096_SHA256", + "RSA_DECRYPT_OAEP_4096_SHA512", + "RSA_DECRYPT_OAEP_2048_SHA1", + "RSA_DECRYPT_OAEP_3072_SHA1", + "RSA_DECRYPT_OAEP_4096_SHA1", + "EC_SIGN_P256_SHA256", + "EC_SIGN_P384_SHA384", + "EC_SIGN_SECP256K1_SHA256", + "HMAC_SHA256", + "HMAC_SHA1", + "HMAC_SHA384", + "HMAC_SHA512", + "HMAC_SHA224", + "EXTERNAL_SYMMETRIC_ENCRYPTION" + ], + "enumDescriptions": [ + "Not specified.", + "Creates symmetric encryption keys.", + "RSASSA-PSS 2048 bit key with a SHA256 digest.", + "RSASSA-PSS 3072 bit key with a SHA256 digest.", + "RSASSA-PSS 4096 bit key with a SHA256 digest.", + "RSASSA-PSS 4096 bit key with a SHA512 digest.", + "RSASSA-PKCS1-v1_5 with a 2048 bit key and a SHA256 digest.", + "RSASSA-PKCS1-v1_5 with a 3072 bit key and a SHA256 digest.", + "RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA256 digest.", + "RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA512 digest.", + "RSASSA-PKCS1-v1_5 signing without encoding, with a 2048 bit key.", + "RSASSA-PKCS1-v1_5 signing without encoding, with a 3072 bit key.", + "RSASSA-PKCS1-v1_5 signing without encoding, with a 4096 bit key.", + "RSAES-OAEP 2048 bit key with a SHA256 digest.", + "RSAES-OAEP 3072 bit key with a SHA256 digest.", + "RSAES-OAEP 4096 bit key with a SHA256 digest.", + "RSAES-OAEP 4096 bit key with a SHA512 digest.", + "RSAES-OAEP 2048 bit key with a SHA1 digest.", + "RSAES-OAEP 3072 bit key with a SHA1 digest.", + "RSAES-OAEP 4096 bit key with a SHA1 digest.", + "ECDSA on the NIST P-256 curve with a SHA256 digest.", + "ECDSA on the NIST P-384 curve with a SHA384 digest.", + "ECDSA on the non-NIST secp256k1 curve. This curve is only supported for HSM protection level.", + "HMAC-SHA256 signing with a 256 bit key.", + "HMAC-SHA1 signing with a 160 bit key.", + "HMAC-SHA384 signing with a 384 bit key.", + "HMAC-SHA512 signing with a 512 bit key.", + "HMAC-SHA224 signing with a 224 bit key.", + "Algorithm representing symmetric encryption by an external key manager." + ], + "readOnly": true, + "type": "string" + }, + "attestation": { + "$ref": "GoogleCloudKmsV1KeyOperationAttestation", + "description": "Output only. Statement that was generated and signed by the HSM at key creation time. Use this statement to verify attributes of the key as stored on the HSM, independently of Google. Only provided for key versions with protection_level HSM.", + "readOnly": true + }, + "createTime": { + "description": "Output only. The time at which this CryptoKeyVersion was created.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "destroyEventTime": { + "description": "Output only. The time this CryptoKeyVersion's key material was destroyed. Only present if state is DESTROYED.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "destroyTime": { + "description": "Output only. The time this CryptoKeyVersion's key material is scheduled for destruction. Only present if state is DESTROY_SCHEDULED.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "externalProtectionLevelOptions": { + "$ref": "GoogleCloudKmsV1ExternalProtectionLevelOptions", + "description": "ExternalProtectionLevelOptions stores a group of additional fields for configuring a CryptoKeyVersion that are specific to the EXTERNAL protection level and EXTERNAL_VPC protection levels." + }, + "generateTime": { + "description": "Output only. The time this CryptoKeyVersion's key material was generated.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "importFailureReason": { + "description": "Output only. The root cause of the most recent import failure. Only present if state is IMPORT_FAILED.", + "readOnly": true, + "type": "string" + }, + "importJob": { + "description": "Output only. The name of the ImportJob used in the most recent import of this CryptoKeyVersion. Only present if the underlying key material was imported.", + "readOnly": true, + "type": "string" + }, + "importTime": { + "description": "Output only. The time at which this CryptoKeyVersion's key material was most recently imported.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "name": { + "description": "Output only. The resource name for this CryptoKeyVersion in the format `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.", + "readOnly": true, + "type": "string" + }, + "protectionLevel": { + "description": "Output only. The ProtectionLevel describing how crypto operations are performed with this CryptoKeyVersion.", + "enum": [ + "PROTECTION_LEVEL_UNSPECIFIED", + "SOFTWARE", + "HSM", + "EXTERNAL", + "EXTERNAL_VPC" + ], + "enumDescriptions": [ + "Not specified.", + "Crypto operations are performed in software.", + "Crypto operations are performed in a Hardware Security Module.", + "Crypto operations are performed by an external key manager.", + "Crypto operations are performed in an EKM-over-VPC backend." + ], + "readOnly": true, + "type": "string" + }, + "reimportEligible": { + "description": "Output only. Whether or not this key version is eligible for reimport, by being specified as a target in ImportCryptoKeyVersionRequest.crypto_key_version.", + "readOnly": true, + "type": "boolean" + }, + "state": { + "description": "The current state of the CryptoKeyVersion.", + "enum": [ + "CRYPTO_KEY_VERSION_STATE_UNSPECIFIED", + "PENDING_GENERATION", + "ENABLED", + "DISABLED", + "DESTROYED", + "DESTROY_SCHEDULED", + "PENDING_IMPORT", + "IMPORT_FAILED" + ], + "enumDescriptions": [ + "Not specified.", + "This version is still being generated. It may not be used, enabled, disabled, or destroyed yet. Cloud KMS will automatically mark this version ENABLED as soon as the version is ready.", + "This version may be used for cryptographic operations.", + "This version may not be used, but the key material is still available, and the version can be placed back into the ENABLED state.", + "This version is destroyed, and the key material is no longer stored. This version may only become ENABLED again if this version is reimport_eligible and the original key material is reimported with a call to KeyManagementService.ImportCryptoKeyVersion.", + "This version is scheduled for destruction, and will be destroyed soon. Call RestoreCryptoKeyVersion to put it back into the DISABLED state.", + "This version is still being imported. It may not be used, enabled, disabled, or destroyed yet. Cloud KMS will automatically mark this version ENABLED as soon as the version is ready.", + "This version was not imported successfully. It may not be used, enabled, disabled, or destroyed. The submitted key material has been discarded. Additional details can be found in CryptoKeyVersion.import_failure_reason." + ], + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudKmsV1CryptoKeyVersionTemplate": { + "description": "A CryptoKeyVersionTemplate specifies the properties to use when creating a new CryptoKeyVersion, either manually with CreateCryptoKeyVersion or automatically as a result of auto-rotation.", + "id": "GoogleCloudKmsV1CryptoKeyVersionTemplate", + "properties": { + "algorithm": { + "description": "Required. Algorithm to use when creating a CryptoKeyVersion based on this template. For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied if both this field is omitted and CryptoKey.purpose is ENCRYPT_DECRYPT.", + "enum": [ + "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED", + "GOOGLE_SYMMETRIC_ENCRYPTION", + "RSA_SIGN_PSS_2048_SHA256", + "RSA_SIGN_PSS_3072_SHA256", + "RSA_SIGN_PSS_4096_SHA256", + "RSA_SIGN_PSS_4096_SHA512", + "RSA_SIGN_PKCS1_2048_SHA256", + "RSA_SIGN_PKCS1_3072_SHA256", + "RSA_SIGN_PKCS1_4096_SHA256", + "RSA_SIGN_PKCS1_4096_SHA512", + "RSA_SIGN_RAW_PKCS1_2048", + "RSA_SIGN_RAW_PKCS1_3072", + "RSA_SIGN_RAW_PKCS1_4096", + "RSA_DECRYPT_OAEP_2048_SHA256", + "RSA_DECRYPT_OAEP_3072_SHA256", + "RSA_DECRYPT_OAEP_4096_SHA256", + "RSA_DECRYPT_OAEP_4096_SHA512", + "RSA_DECRYPT_OAEP_2048_SHA1", + "RSA_DECRYPT_OAEP_3072_SHA1", + "RSA_DECRYPT_OAEP_4096_SHA1", + "EC_SIGN_P256_SHA256", + "EC_SIGN_P384_SHA384", + "EC_SIGN_SECP256K1_SHA256", + "HMAC_SHA256", + "HMAC_SHA1", + "HMAC_SHA384", + "HMAC_SHA512", + "HMAC_SHA224", + "EXTERNAL_SYMMETRIC_ENCRYPTION" + ], + "enumDescriptions": [ + "Not specified.", + "Creates symmetric encryption keys.", + "RSASSA-PSS 2048 bit key with a SHA256 digest.", + "RSASSA-PSS 3072 bit key with a SHA256 digest.", + "RSASSA-PSS 4096 bit key with a SHA256 digest.", + "RSASSA-PSS 4096 bit key with a SHA512 digest.", + "RSASSA-PKCS1-v1_5 with a 2048 bit key and a SHA256 digest.", + "RSASSA-PKCS1-v1_5 with a 3072 bit key and a SHA256 digest.", + "RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA256 digest.", + "RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA512 digest.", + "RSASSA-PKCS1-v1_5 signing without encoding, with a 2048 bit key.", + "RSASSA-PKCS1-v1_5 signing without encoding, with a 3072 bit key.", + "RSASSA-PKCS1-v1_5 signing without encoding, with a 4096 bit key.", + "RSAES-OAEP 2048 bit key with a SHA256 digest.", + "RSAES-OAEP 3072 bit key with a SHA256 digest.", + "RSAES-OAEP 4096 bit key with a SHA256 digest.", + "RSAES-OAEP 4096 bit key with a SHA512 digest.", + "RSAES-OAEP 2048 bit key with a SHA1 digest.", + "RSAES-OAEP 3072 bit key with a SHA1 digest.", + "RSAES-OAEP 4096 bit key with a SHA1 digest.", + "ECDSA on the NIST P-256 curve with a SHA256 digest.", + "ECDSA on the NIST P-384 curve with a SHA384 digest.", + "ECDSA on the non-NIST secp256k1 curve. This curve is only supported for HSM protection level.", + "HMAC-SHA256 signing with a 256 bit key.", + "HMAC-SHA1 signing with a 160 bit key.", + "HMAC-SHA384 signing with a 384 bit key.", + "HMAC-SHA512 signing with a 512 bit key.", + "HMAC-SHA224 signing with a 224 bit key.", + "Algorithm representing symmetric encryption by an external key manager." + ], + "type": "string" + }, + "protectionLevel": { + "description": "ProtectionLevel to use when creating a CryptoKeyVersion based on this template. Immutable. Defaults to SOFTWARE.", + "enum": [ + "PROTECTION_LEVEL_UNSPECIFIED", + "SOFTWARE", + "HSM", + "EXTERNAL", + "EXTERNAL_VPC" + ], + "enumDescriptions": [ + "Not specified.", + "Crypto operations are performed in software.", + "Crypto operations are performed in a Hardware Security Module.", + "Crypto operations are performed by an external key manager.", + "Crypto operations are performed in an EKM-over-VPC backend." + ], + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudKmsV1ExternalProtectionLevelOptions": { + "description": "ExternalProtectionLevelOptions stores a group of additional fields for configuring a CryptoKeyVersion that are specific to the EXTERNAL protection level and EXTERNAL_VPC protection levels.", + "id": "GoogleCloudKmsV1ExternalProtectionLevelOptions", + "properties": { + "ekmConnectionKeyPath": { + "description": "The path to the external key material on the EKM when using EkmConnection e.g., \"v0/my/key\". Set this field instead of external_key_uri when using an EkmConnection.", + "type": "string" + }, + "externalKeyUri": { + "description": "The URI for an external resource that this CryptoKeyVersion represents.", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudKmsV1KeyOperationAttestation": { + "description": "Contains an HSM-generated attestation about a key operation. For more information, see [Verifying attestations] (https://cloud.google.com/kms/docs/attest-key).", + "id": "GoogleCloudKmsV1KeyOperationAttestation", + "properties": { + "certChains": { + "$ref": "GoogleCloudKmsV1KeyOperationAttestationCertificateChains", + "description": "Output only. The certificate chains needed to validate the attestation", + "readOnly": true + }, + "content": { + "description": "Output only. The attestation data provided by the HSM when the key operation was performed.", + "format": "byte", + "readOnly": true, + "type": "string" + }, + "format": { + "description": "Output only. The format of the attestation data.", + "enum": [ + "ATTESTATION_FORMAT_UNSPECIFIED", + "CAVIUM_V1_COMPRESSED", + "CAVIUM_V2_COMPRESSED" + ], + "enumDescriptions": [ + "Not specified.", + "Cavium HSM attestation compressed with gzip. Note that this format is defined by Cavium and subject to change at any time. See https://www.marvell.com/products/security-solutions/nitrox-hs-adapters/software-key-attestation.html.", + "Cavium HSM attestation V2 compressed with gzip. This is a new format introduced in Cavium's version 3.2-08." + ], + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudKmsV1KeyOperationAttestationCertificateChains": { + "description": "Certificate chains needed to verify the attestation. Certificates in chains are PEM-encoded and are ordered based on https://tools.ietf.org/html/rfc5246#section-7.4.2.", + "id": "GoogleCloudKmsV1KeyOperationAttestationCertificateChains", + "properties": { + "caviumCerts": { + "description": "Cavium certificate chain corresponding to the attestation.", + "items": { + "type": "string" + }, + "type": "array" + }, + "googleCardCerts": { + "description": "Google card certificate chain corresponding to the attestation.", + "items": { + "type": "string" + }, + "type": "array" + }, + "googlePartitionCerts": { + "description": "Google partition certificate chain corresponding to the attestation.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "servicePath": "", + "title": "KMS Inventory API", + "version": "v1", + "version_module": true +} \ No newline at end of file diff --git a/kmsinventory/v1/kmsinventory-gen.go b/kmsinventory/v1/kmsinventory-gen.go new file mode 100644 index 00000000000..30f078868c8 --- /dev/null +++ b/kmsinventory/v1/kmsinventory-gen.go @@ -0,0 +1,1499 @@ +// Copyright 2023 Google LLC. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Code generated file. DO NOT EDIT. + +// Package kmsinventory provides access to the KMS Inventory API. +// +// For product documentation, see: https://cloud.google.com/kms/ +// +// # Creating a client +// +// Usage example: +// +// import "google.golang.org/api/kmsinventory/v1" +// ... +// ctx := context.Background() +// kmsinventoryService, err := kmsinventory.NewService(ctx) +// +// In this example, Google Application Default Credentials are used for authentication. +// +// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// +// # Other authentication options +// +// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// +// kmsinventoryService, err := kmsinventory.NewService(ctx, option.WithAPIKey("AIza...")) +// +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// +// config := &oauth2.Config{...} +// // ... +// token, err := config.Exchange(ctx, ...) +// kmsinventoryService, err := kmsinventory.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) +// +// See https://godoc.org/google.golang.org/api/option/ for details on options. +package kmsinventory // import "google.golang.org/api/kmsinventory/v1" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strconv" + "strings" + + googleapi "google.golang.org/api/googleapi" + internal "google.golang.org/api/internal" + gensupport "google.golang.org/api/internal/gensupport" + option "google.golang.org/api/option" + internaloption "google.golang.org/api/option/internaloption" + htransport "google.golang.org/api/transport/http" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = gensupport.MarshalJSON +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = context.Canceled +var _ = internaloption.WithDefaultEndpoint + +const apiId = "kmsinventory:v1" +const apiName = "kmsinventory" +const apiVersion = "v1" +const basePath = "https://kmsinventory.googleapis.com/" +const mtlsBasePath = "https://kmsinventory.mtls.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // See, edit, configure, and delete your Google Cloud data and see the + // email address for your Google Account. + CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" +) + +// NewService creates a new Service. +func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { + scopesOption := internaloption.WithDefaultScopes( + "https://www.googleapis.com/auth/cloud-platform", + ) + // NOTE: prepend, so we don't override user-specified scopes. + opts = append([]option.ClientOption{scopesOption}, opts...) + opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) + opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) + client, endpoint, err := htransport.NewClient(ctx, opts...) + if err != nil { + return nil, err + } + s, err := New(client) + if err != nil { + return nil, err + } + if endpoint != "" { + s.BasePath = endpoint + } + return s, nil +} + +// New creates a new Service. It uses the provided http.Client for requests. +// +// Deprecated: please use NewService instead. +// To provide a custom HTTP client, use option.WithHTTPClient. +// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Organizations *OrganizationsService + + Projects *ProjectsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewOrganizationsService(s *Service) *OrganizationsService { + rs := &OrganizationsService{s: s} + rs.ProtectedResources = NewOrganizationsProtectedResourcesService(s) + return rs +} + +type OrganizationsService struct { + s *Service + + ProtectedResources *OrganizationsProtectedResourcesService +} + +func NewOrganizationsProtectedResourcesService(s *Service) *OrganizationsProtectedResourcesService { + rs := &OrganizationsProtectedResourcesService{s: s} + return rs +} + +type OrganizationsProtectedResourcesService struct { + s *Service +} + +func NewProjectsService(s *Service) *ProjectsService { + rs := &ProjectsService{s: s} + rs.CryptoKeys = NewProjectsCryptoKeysService(s) + rs.Locations = NewProjectsLocationsService(s) + return rs +} + +type ProjectsService struct { + s *Service + + CryptoKeys *ProjectsCryptoKeysService + + Locations *ProjectsLocationsService +} + +func NewProjectsCryptoKeysService(s *Service) *ProjectsCryptoKeysService { + rs := &ProjectsCryptoKeysService{s: s} + return rs +} + +type ProjectsCryptoKeysService struct { + s *Service +} + +func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { + rs := &ProjectsLocationsService{s: s} + rs.KeyRings = NewProjectsLocationsKeyRingsService(s) + return rs +} + +type ProjectsLocationsService struct { + s *Service + + KeyRings *ProjectsLocationsKeyRingsService +} + +func NewProjectsLocationsKeyRingsService(s *Service) *ProjectsLocationsKeyRingsService { + rs := &ProjectsLocationsKeyRingsService{s: s} + rs.CryptoKeys = NewProjectsLocationsKeyRingsCryptoKeysService(s) + return rs +} + +type ProjectsLocationsKeyRingsService struct { + s *Service + + CryptoKeys *ProjectsLocationsKeyRingsCryptoKeysService +} + +func NewProjectsLocationsKeyRingsCryptoKeysService(s *Service) *ProjectsLocationsKeyRingsCryptoKeysService { + rs := &ProjectsLocationsKeyRingsCryptoKeysService{s: s} + return rs +} + +type ProjectsLocationsKeyRingsCryptoKeysService struct { + s *Service +} + +// GoogleCloudKmsInventoryV1ListCryptoKeysResponse: Response message for +// KeyDashboardService.ListCryptoKeys. +type GoogleCloudKmsInventoryV1ListCryptoKeysResponse struct { + // CryptoKeys: The list of CryptoKeys. + CryptoKeys []*GoogleCloudKmsV1CryptoKey `json:"cryptoKeys,omitempty"` + + // NextPageToken: The page token returned from the previous response if + // the next page is desired. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CryptoKeys") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CryptoKeys") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudKmsInventoryV1ListCryptoKeysResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudKmsInventoryV1ListCryptoKeysResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudKmsInventoryV1ProtectedResource: Metadata about a resource +// protected by a Cloud KMS key. +type GoogleCloudKmsInventoryV1ProtectedResource struct { + // CloudProduct: The Cloud product that owns the resource. Example: + // `compute` + CloudProduct string `json:"cloudProduct,omitempty"` + + // CreateTime: Output only. The time at which this resource was created. + // The granularity is in seconds. Timestamp.nanos will always be 0. + CreateTime string `json:"createTime,omitempty"` + + // CryptoKeyVersion: The name of the Cloud KMS CryptoKeyVersion + // (https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions?hl=en) + // used to protect this resource via CMEK. This field may be empty if + // the Cloud product owning the resource does not provide key version + // data to Asset Inventory. + CryptoKeyVersion string `json:"cryptoKeyVersion,omitempty"` + + // Labels: A key-value pair of the resource's labels (v1) to their + // values. + Labels map[string]string `json:"labels,omitempty"` + + // Location: Location can be `global`, regional like `us-east1`, or + // zonal like `us-west1-b`. + Location string `json:"location,omitempty"` + + // Name: The full resource name of the resource. Example: + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instance + // s/instance1`. + Name string `json:"name,omitempty"` + + // Project: Format: `projects/{PROJECT_NUMBER}`. + Project string `json:"project,omitempty"` + + // ProjectId: The ID of the project that owns the resource. + ProjectId string `json:"projectId,omitempty"` + + // ResourceType: Example: `compute.googleapis.com/Disk` + ResourceType string `json:"resourceType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CloudProduct") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CloudProduct") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudKmsInventoryV1ProtectedResource) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudKmsInventoryV1ProtectedResource + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudKmsInventoryV1ProtectedResourcesSummary: Aggregate +// information about the resources protected by a Cloud KMS key in the +// same Cloud organization as the key. +type GoogleCloudKmsInventoryV1ProtectedResourcesSummary struct { + // CloudProducts: The number of resources protected by the key grouped + // by Cloud product. + CloudProducts map[string]string `json:"cloudProducts,omitempty"` + + // Locations: The number of resources protected by the key grouped by + // region. + Locations map[string]string `json:"locations,omitempty"` + + // Name: The full name of the ProtectedResourcesSummary resource. + // Example: + // projects/test-project/locations/us/keyRings/test-keyring/cryptoKeys/te + // st-key/protectedResourcesSummary + Name string `json:"name,omitempty"` + + // ProjectCount: The number of distinct Cloud projects in the same Cloud + // organization as the key that have resources protected by the key. + ProjectCount int64 `json:"projectCount,omitempty"` + + // ResourceCount: The total number of protected resources in the same + // Cloud organization as the key. + ResourceCount int64 `json:"resourceCount,omitempty,string"` + + // ResourceTypes: The number of resources protected by the key grouped + // by resource type. + ResourceTypes map[string]string `json:"resourceTypes,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CloudProducts") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CloudProducts") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudKmsInventoryV1ProtectedResourcesSummary) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudKmsInventoryV1ProtectedResourcesSummary + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudKmsInventoryV1SearchProtectedResourcesResponse: Response +// message for KeyTrackingService.SearchProtectedResources. +type GoogleCloudKmsInventoryV1SearchProtectedResourcesResponse struct { + // NextPageToken: A token that can be sent as `page_token` to retrieve + // the next page. If this field is omitted, there are no subsequent + // pages. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ProtectedResources: Protected resources for this page. + ProtectedResources []*GoogleCloudKmsInventoryV1ProtectedResource `json:"protectedResources,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "NextPageToken") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudKmsInventoryV1SearchProtectedResourcesResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudKmsInventoryV1SearchProtectedResourcesResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudKmsV1CryptoKey: A CryptoKey represents a logical key that +// can be used for cryptographic operations. A CryptoKey is made up of +// zero or more versions, which represent the actual key material used +// in cryptographic operations. +type GoogleCloudKmsV1CryptoKey struct { + // CreateTime: Output only. The time at which this CryptoKey was + // created. + CreateTime string `json:"createTime,omitempty"` + + // CryptoKeyBackend: Immutable. The resource name of the backend + // environment where the key material for all CryptoKeyVersions + // associated with this CryptoKey reside and where all related + // cryptographic operations are performed. Only applicable if + // CryptoKeyVersions have a ProtectionLevel of EXTERNAL_VPC, with the + // resource name in the format + // `projects/*/locations/*/ekmConnections/*`. Note, this list is + // non-exhaustive and may apply to additional ProtectionLevels in the + // future. + CryptoKeyBackend string `json:"cryptoKeyBackend,omitempty"` + + // DestroyScheduledDuration: Immutable. The period of time that versions + // of this key spend in the DESTROY_SCHEDULED state before transitioning + // to DESTROYED. If not specified at creation time, the default duration + // is 24 hours. + DestroyScheduledDuration string `json:"destroyScheduledDuration,omitempty"` + + // ImportOnly: Immutable. Whether this key may contain imported versions + // only. + ImportOnly bool `json:"importOnly,omitempty"` + + // Labels: Labels with user-defined metadata. For more information, see + // Labeling Keys (https://cloud.google.com/kms/docs/labeling-keys). + Labels map[string]string `json:"labels,omitempty"` + + // Name: Output only. The resource name for this CryptoKey in the format + // `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + Name string `json:"name,omitempty"` + + // NextRotationTime: At next_rotation_time, the Key Management Service + // will automatically: 1. Create a new version of this CryptoKey. 2. + // Mark the new version as primary. Key rotations performed manually via + // CreateCryptoKeyVersion and UpdateCryptoKeyPrimaryVersion do not + // affect next_rotation_time. Keys with purpose ENCRYPT_DECRYPT support + // automatic rotation. For other keys, this field must be omitted. + NextRotationTime string `json:"nextRotationTime,omitempty"` + + // Primary: Output only. A copy of the "primary" CryptoKeyVersion that + // will be used by Encrypt when this CryptoKey is given in + // EncryptRequest.name. The CryptoKey's primary version can be updated + // via UpdateCryptoKeyPrimaryVersion. Keys with purpose ENCRYPT_DECRYPT + // may have a primary. For other keys, this field will be omitted. + Primary *GoogleCloudKmsV1CryptoKeyVersion `json:"primary,omitempty"` + + // Purpose: Immutable. The immutable purpose of this CryptoKey. + // + // Possible values: + // "CRYPTO_KEY_PURPOSE_UNSPECIFIED" - Not specified. + // "ENCRYPT_DECRYPT" - CryptoKeys with this purpose may be used with + // Encrypt and Decrypt. + // "ASYMMETRIC_SIGN" - CryptoKeys with this purpose may be used with + // AsymmetricSign and GetPublicKey. + // "ASYMMETRIC_DECRYPT" - CryptoKeys with this purpose may be used + // with AsymmetricDecrypt and GetPublicKey. + // "MAC" - CryptoKeys with this purpose may be used with MacSign. + Purpose string `json:"purpose,omitempty"` + + // RotationPeriod: next_rotation_time will be advanced by this period + // when the service automatically rotates a key. Must be at least 24 + // hours and at most 876,000 hours. If rotation_period is set, + // next_rotation_time must also be set. Keys with purpose + // ENCRYPT_DECRYPT support automatic rotation. For other keys, this + // field must be omitted. + RotationPeriod string `json:"rotationPeriod,omitempty"` + + // VersionTemplate: A template describing settings for new + // CryptoKeyVersion instances. The properties of new CryptoKeyVersion + // instances created by either CreateCryptoKeyVersion or auto-rotation + // are controlled by this template. + VersionTemplate *GoogleCloudKmsV1CryptoKeyVersionTemplate `json:"versionTemplate,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudKmsV1CryptoKey) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudKmsV1CryptoKey + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudKmsV1CryptoKeyVersion: A CryptoKeyVersion represents an +// individual cryptographic key, and the associated key material. An +// ENABLED version can be used for cryptographic operations. For +// security reasons, the raw cryptographic key material represented by a +// CryptoKeyVersion can never be viewed or exported. It can only be used +// to encrypt, decrypt, or sign data when an authorized user or +// application invokes Cloud KMS. +type GoogleCloudKmsV1CryptoKeyVersion struct { + // Algorithm: Output only. The CryptoKeyVersionAlgorithm that this + // CryptoKeyVersion supports. + // + // Possible values: + // "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED" - Not specified. + // "GOOGLE_SYMMETRIC_ENCRYPTION" - Creates symmetric encryption keys. + // "RSA_SIGN_PSS_2048_SHA256" - RSASSA-PSS 2048 bit key with a SHA256 + // digest. + // "RSA_SIGN_PSS_3072_SHA256" - RSASSA-PSS 3072 bit key with a SHA256 + // digest. + // "RSA_SIGN_PSS_4096_SHA256" - RSASSA-PSS 4096 bit key with a SHA256 + // digest. + // "RSA_SIGN_PSS_4096_SHA512" - RSASSA-PSS 4096 bit key with a SHA512 + // digest. + // "RSA_SIGN_PKCS1_2048_SHA256" - RSASSA-PKCS1-v1_5 with a 2048 bit + // key and a SHA256 digest. + // "RSA_SIGN_PKCS1_3072_SHA256" - RSASSA-PKCS1-v1_5 with a 3072 bit + // key and a SHA256 digest. + // "RSA_SIGN_PKCS1_4096_SHA256" - RSASSA-PKCS1-v1_5 with a 4096 bit + // key and a SHA256 digest. + // "RSA_SIGN_PKCS1_4096_SHA512" - RSASSA-PKCS1-v1_5 with a 4096 bit + // key and a SHA512 digest. + // "RSA_SIGN_RAW_PKCS1_2048" - RSASSA-PKCS1-v1_5 signing without + // encoding, with a 2048 bit key. + // "RSA_SIGN_RAW_PKCS1_3072" - RSASSA-PKCS1-v1_5 signing without + // encoding, with a 3072 bit key. + // "RSA_SIGN_RAW_PKCS1_4096" - RSASSA-PKCS1-v1_5 signing without + // encoding, with a 4096 bit key. + // "RSA_DECRYPT_OAEP_2048_SHA256" - RSAES-OAEP 2048 bit key with a + // SHA256 digest. + // "RSA_DECRYPT_OAEP_3072_SHA256" - RSAES-OAEP 3072 bit key with a + // SHA256 digest. + // "RSA_DECRYPT_OAEP_4096_SHA256" - RSAES-OAEP 4096 bit key with a + // SHA256 digest. + // "RSA_DECRYPT_OAEP_4096_SHA512" - RSAES-OAEP 4096 bit key with a + // SHA512 digest. + // "RSA_DECRYPT_OAEP_2048_SHA1" - RSAES-OAEP 2048 bit key with a SHA1 + // digest. + // "RSA_DECRYPT_OAEP_3072_SHA1" - RSAES-OAEP 3072 bit key with a SHA1 + // digest. + // "RSA_DECRYPT_OAEP_4096_SHA1" - RSAES-OAEP 4096 bit key with a SHA1 + // digest. + // "EC_SIGN_P256_SHA256" - ECDSA on the NIST P-256 curve with a SHA256 + // digest. + // "EC_SIGN_P384_SHA384" - ECDSA on the NIST P-384 curve with a SHA384 + // digest. + // "EC_SIGN_SECP256K1_SHA256" - ECDSA on the non-NIST secp256k1 curve. + // This curve is only supported for HSM protection level. + // "HMAC_SHA256" - HMAC-SHA256 signing with a 256 bit key. + // "HMAC_SHA1" - HMAC-SHA1 signing with a 160 bit key. + // "HMAC_SHA384" - HMAC-SHA384 signing with a 384 bit key. + // "HMAC_SHA512" - HMAC-SHA512 signing with a 512 bit key. + // "HMAC_SHA224" - HMAC-SHA224 signing with a 224 bit key. + // "EXTERNAL_SYMMETRIC_ENCRYPTION" - Algorithm representing symmetric + // encryption by an external key manager. + Algorithm string `json:"algorithm,omitempty"` + + // Attestation: Output only. Statement that was generated and signed by + // the HSM at key creation time. Use this statement to verify attributes + // of the key as stored on the HSM, independently of Google. Only + // provided for key versions with protection_level HSM. + Attestation *GoogleCloudKmsV1KeyOperationAttestation `json:"attestation,omitempty"` + + // CreateTime: Output only. The time at which this CryptoKeyVersion was + // created. + CreateTime string `json:"createTime,omitempty"` + + // DestroyEventTime: Output only. The time this CryptoKeyVersion's key + // material was destroyed. Only present if state is DESTROYED. + DestroyEventTime string `json:"destroyEventTime,omitempty"` + + // DestroyTime: Output only. The time this CryptoKeyVersion's key + // material is scheduled for destruction. Only present if state is + // DESTROY_SCHEDULED. + DestroyTime string `json:"destroyTime,omitempty"` + + // ExternalProtectionLevelOptions: ExternalProtectionLevelOptions stores + // a group of additional fields for configuring a CryptoKeyVersion that + // are specific to the EXTERNAL protection level and EXTERNAL_VPC + // protection levels. + ExternalProtectionLevelOptions *GoogleCloudKmsV1ExternalProtectionLevelOptions `json:"externalProtectionLevelOptions,omitempty"` + + // GenerateTime: Output only. The time this CryptoKeyVersion's key + // material was generated. + GenerateTime string `json:"generateTime,omitempty"` + + // ImportFailureReason: Output only. The root cause of the most recent + // import failure. Only present if state is IMPORT_FAILED. + ImportFailureReason string `json:"importFailureReason,omitempty"` + + // ImportJob: Output only. The name of the ImportJob used in the most + // recent import of this CryptoKeyVersion. Only present if the + // underlying key material was imported. + ImportJob string `json:"importJob,omitempty"` + + // ImportTime: Output only. The time at which this CryptoKeyVersion's + // key material was most recently imported. + ImportTime string `json:"importTime,omitempty"` + + // Name: Output only. The resource name for this CryptoKeyVersion in the + // format + // `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. + Name string `json:"name,omitempty"` + + // ProtectionLevel: Output only. The ProtectionLevel describing how + // crypto operations are performed with this CryptoKeyVersion. + // + // Possible values: + // "PROTECTION_LEVEL_UNSPECIFIED" - Not specified. + // "SOFTWARE" - Crypto operations are performed in software. + // "HSM" - Crypto operations are performed in a Hardware Security + // Module. + // "EXTERNAL" - Crypto operations are performed by an external key + // manager. + // "EXTERNAL_VPC" - Crypto operations are performed in an EKM-over-VPC + // backend. + ProtectionLevel string `json:"protectionLevel,omitempty"` + + // ReimportEligible: Output only. Whether or not this key version is + // eligible for reimport, by being specified as a target in + // ImportCryptoKeyVersionRequest.crypto_key_version. + ReimportEligible bool `json:"reimportEligible,omitempty"` + + // State: The current state of the CryptoKeyVersion. + // + // Possible values: + // "CRYPTO_KEY_VERSION_STATE_UNSPECIFIED" - Not specified. + // "PENDING_GENERATION" - This version is still being generated. It + // may not be used, enabled, disabled, or destroyed yet. Cloud KMS will + // automatically mark this version ENABLED as soon as the version is + // ready. + // "ENABLED" - This version may be used for cryptographic operations. + // "DISABLED" - This version may not be used, but the key material is + // still available, and the version can be placed back into the ENABLED + // state. + // "DESTROYED" - This version is destroyed, and the key material is no + // longer stored. This version may only become ENABLED again if this + // version is reimport_eligible and the original key material is + // reimported with a call to + // KeyManagementService.ImportCryptoKeyVersion. + // "DESTROY_SCHEDULED" - This version is scheduled for destruction, + // and will be destroyed soon. Call RestoreCryptoKeyVersion to put it + // back into the DISABLED state. + // "PENDING_IMPORT" - This version is still being imported. It may not + // be used, enabled, disabled, or destroyed yet. Cloud KMS will + // automatically mark this version ENABLED as soon as the version is + // ready. + // "IMPORT_FAILED" - This version was not imported successfully. It + // may not be used, enabled, disabled, or destroyed. The submitted key + // material has been discarded. Additional details can be found in + // CryptoKeyVersion.import_failure_reason. + State string `json:"state,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Algorithm") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Algorithm") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudKmsV1CryptoKeyVersion) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudKmsV1CryptoKeyVersion + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudKmsV1CryptoKeyVersionTemplate: A CryptoKeyVersionTemplate +// specifies the properties to use when creating a new CryptoKeyVersion, +// either manually with CreateCryptoKeyVersion or automatically as a +// result of auto-rotation. +type GoogleCloudKmsV1CryptoKeyVersionTemplate struct { + // Algorithm: Required. Algorithm to use when creating a + // CryptoKeyVersion based on this template. For backwards compatibility, + // GOOGLE_SYMMETRIC_ENCRYPTION is implied if both this field is omitted + // and CryptoKey.purpose is ENCRYPT_DECRYPT. + // + // Possible values: + // "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED" - Not specified. + // "GOOGLE_SYMMETRIC_ENCRYPTION" - Creates symmetric encryption keys. + // "RSA_SIGN_PSS_2048_SHA256" - RSASSA-PSS 2048 bit key with a SHA256 + // digest. + // "RSA_SIGN_PSS_3072_SHA256" - RSASSA-PSS 3072 bit key with a SHA256 + // digest. + // "RSA_SIGN_PSS_4096_SHA256" - RSASSA-PSS 4096 bit key with a SHA256 + // digest. + // "RSA_SIGN_PSS_4096_SHA512" - RSASSA-PSS 4096 bit key with a SHA512 + // digest. + // "RSA_SIGN_PKCS1_2048_SHA256" - RSASSA-PKCS1-v1_5 with a 2048 bit + // key and a SHA256 digest. + // "RSA_SIGN_PKCS1_3072_SHA256" - RSASSA-PKCS1-v1_5 with a 3072 bit + // key and a SHA256 digest. + // "RSA_SIGN_PKCS1_4096_SHA256" - RSASSA-PKCS1-v1_5 with a 4096 bit + // key and a SHA256 digest. + // "RSA_SIGN_PKCS1_4096_SHA512" - RSASSA-PKCS1-v1_5 with a 4096 bit + // key and a SHA512 digest. + // "RSA_SIGN_RAW_PKCS1_2048" - RSASSA-PKCS1-v1_5 signing without + // encoding, with a 2048 bit key. + // "RSA_SIGN_RAW_PKCS1_3072" - RSASSA-PKCS1-v1_5 signing without + // encoding, with a 3072 bit key. + // "RSA_SIGN_RAW_PKCS1_4096" - RSASSA-PKCS1-v1_5 signing without + // encoding, with a 4096 bit key. + // "RSA_DECRYPT_OAEP_2048_SHA256" - RSAES-OAEP 2048 bit key with a + // SHA256 digest. + // "RSA_DECRYPT_OAEP_3072_SHA256" - RSAES-OAEP 3072 bit key with a + // SHA256 digest. + // "RSA_DECRYPT_OAEP_4096_SHA256" - RSAES-OAEP 4096 bit key with a + // SHA256 digest. + // "RSA_DECRYPT_OAEP_4096_SHA512" - RSAES-OAEP 4096 bit key with a + // SHA512 digest. + // "RSA_DECRYPT_OAEP_2048_SHA1" - RSAES-OAEP 2048 bit key with a SHA1 + // digest. + // "RSA_DECRYPT_OAEP_3072_SHA1" - RSAES-OAEP 3072 bit key with a SHA1 + // digest. + // "RSA_DECRYPT_OAEP_4096_SHA1" - RSAES-OAEP 4096 bit key with a SHA1 + // digest. + // "EC_SIGN_P256_SHA256" - ECDSA on the NIST P-256 curve with a SHA256 + // digest. + // "EC_SIGN_P384_SHA384" - ECDSA on the NIST P-384 curve with a SHA384 + // digest. + // "EC_SIGN_SECP256K1_SHA256" - ECDSA on the non-NIST secp256k1 curve. + // This curve is only supported for HSM protection level. + // "HMAC_SHA256" - HMAC-SHA256 signing with a 256 bit key. + // "HMAC_SHA1" - HMAC-SHA1 signing with a 160 bit key. + // "HMAC_SHA384" - HMAC-SHA384 signing with a 384 bit key. + // "HMAC_SHA512" - HMAC-SHA512 signing with a 512 bit key. + // "HMAC_SHA224" - HMAC-SHA224 signing with a 224 bit key. + // "EXTERNAL_SYMMETRIC_ENCRYPTION" - Algorithm representing symmetric + // encryption by an external key manager. + Algorithm string `json:"algorithm,omitempty"` + + // ProtectionLevel: ProtectionLevel to use when creating a + // CryptoKeyVersion based on this template. Immutable. Defaults to + // SOFTWARE. + // + // Possible values: + // "PROTECTION_LEVEL_UNSPECIFIED" - Not specified. + // "SOFTWARE" - Crypto operations are performed in software. + // "HSM" - Crypto operations are performed in a Hardware Security + // Module. + // "EXTERNAL" - Crypto operations are performed by an external key + // manager. + // "EXTERNAL_VPC" - Crypto operations are performed in an EKM-over-VPC + // backend. + ProtectionLevel string `json:"protectionLevel,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Algorithm") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Algorithm") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudKmsV1CryptoKeyVersionTemplate) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudKmsV1CryptoKeyVersionTemplate + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudKmsV1ExternalProtectionLevelOptions: +// ExternalProtectionLevelOptions stores a group of additional fields +// for configuring a CryptoKeyVersion that are specific to the EXTERNAL +// protection level and EXTERNAL_VPC protection levels. +type GoogleCloudKmsV1ExternalProtectionLevelOptions struct { + // EkmConnectionKeyPath: The path to the external key material on the + // EKM when using EkmConnection e.g., "v0/my/key". Set this field + // instead of external_key_uri when using an EkmConnection. + EkmConnectionKeyPath string `json:"ekmConnectionKeyPath,omitempty"` + + // ExternalKeyUri: The URI for an external resource that this + // CryptoKeyVersion represents. + ExternalKeyUri string `json:"externalKeyUri,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "EkmConnectionKeyPath") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "EkmConnectionKeyPath") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudKmsV1ExternalProtectionLevelOptions) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudKmsV1ExternalProtectionLevelOptions + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudKmsV1KeyOperationAttestation: Contains an HSM-generated +// attestation about a key operation. For more information, see +// [Verifying attestations] +// (https://cloud.google.com/kms/docs/attest-key). +type GoogleCloudKmsV1KeyOperationAttestation struct { + // CertChains: Output only. The certificate chains needed to validate + // the attestation + CertChains *GoogleCloudKmsV1KeyOperationAttestationCertificateChains `json:"certChains,omitempty"` + + // Content: Output only. The attestation data provided by the HSM when + // the key operation was performed. + Content string `json:"content,omitempty"` + + // Format: Output only. The format of the attestation data. + // + // Possible values: + // "ATTESTATION_FORMAT_UNSPECIFIED" - Not specified. + // "CAVIUM_V1_COMPRESSED" - Cavium HSM attestation compressed with + // gzip. Note that this format is defined by Cavium and subject to + // change at any time. See + // https://www.marvell.com/products/security-solutions/nitrox-hs-adapters/software-key-attestation.html. + // "CAVIUM_V2_COMPRESSED" - Cavium HSM attestation V2 compressed with + // gzip. This is a new format introduced in Cavium's version 3.2-08. + Format string `json:"format,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CertChains") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CertChains") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudKmsV1KeyOperationAttestation) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudKmsV1KeyOperationAttestation + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudKmsV1KeyOperationAttestationCertificateChains: Certificate +// chains needed to verify the attestation. Certificates in chains are +// PEM-encoded and are ordered based on +// https://tools.ietf.org/html/rfc5246#section-7.4.2. +type GoogleCloudKmsV1KeyOperationAttestationCertificateChains struct { + // CaviumCerts: Cavium certificate chain corresponding to the + // attestation. + CaviumCerts []string `json:"caviumCerts,omitempty"` + + // GoogleCardCerts: Google card certificate chain corresponding to the + // attestation. + GoogleCardCerts []string `json:"googleCardCerts,omitempty"` + + // GooglePartitionCerts: Google partition certificate chain + // corresponding to the attestation. + GooglePartitionCerts []string `json:"googlePartitionCerts,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CaviumCerts") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CaviumCerts") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudKmsV1KeyOperationAttestationCertificateChains) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudKmsV1KeyOperationAttestationCertificateChains + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// method id "kmsinventory.organizations.protectedResources.search": + +type OrganizationsProtectedResourcesSearchCall struct { + s *Service + scope string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Search: Returns metadata about the resources protected by the given +// Cloud KMS CryptoKey in the given Cloud organization. +// +// - scope: Resource name of the organization. Example: +// organizations/123. +func (r *OrganizationsProtectedResourcesService) Search(scope string) *OrganizationsProtectedResourcesSearchCall { + c := &OrganizationsProtectedResourcesSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.scope = scope + return c +} + +// CryptoKey sets the optional parameter "cryptoKey": Required. The +// resource name of the CryptoKey. +func (c *OrganizationsProtectedResourcesSearchCall) CryptoKey(cryptoKey string) *OrganizationsProtectedResourcesSearchCall { + c.urlParams_.Set("cryptoKey", cryptoKey) + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of resources to return. The service may return fewer than this value. +// If unspecified, at most 500 resources will be returned. The maximum +// value is 500; values above 500 will be coerced to 500. +func (c *OrganizationsProtectedResourcesSearchCall) PageSize(pageSize int64) *OrganizationsProtectedResourcesSearchCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous KeyTrackingService.SearchProtectedResources +// call. Provide this to retrieve the subsequent page. When paginating, +// all other parameters provided to +// KeyTrackingService.SearchProtectedResources must match the call that +// provided the page token. +func (c *OrganizationsProtectedResourcesSearchCall) PageToken(pageToken string) *OrganizationsProtectedResourcesSearchCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsProtectedResourcesSearchCall) Fields(s ...googleapi.Field) *OrganizationsProtectedResourcesSearchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsProtectedResourcesSearchCall) IfNoneMatch(entityTag string) *OrganizationsProtectedResourcesSearchCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OrganizationsProtectedResourcesSearchCall) Context(ctx context.Context) *OrganizationsProtectedResourcesSearchCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsProtectedResourcesSearchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsProtectedResourcesSearchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+scope}/protectedResources:search") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "scope": c.scope, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "kmsinventory.organizations.protectedResources.search" call. +// Exactly one of +// *GoogleCloudKmsInventoryV1SearchProtectedResourcesResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudKmsInventoryV1SearchProtectedResourcesResponse.ServerRespo +// nse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsProtectedResourcesSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudKmsInventoryV1SearchProtectedResourcesResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudKmsInventoryV1SearchProtectedResourcesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns metadata about the resources protected by the given Cloud KMS CryptoKey in the given Cloud organization.", + // "flatPath": "v1/organizations/{organizationsId}/protectedResources:search", + // "httpMethod": "GET", + // "id": "kmsinventory.organizations.protectedResources.search", + // "parameterOrder": [ + // "scope" + // ], + // "parameters": { + // "cryptoKey": { + // "description": "Required. The resource name of the CryptoKey.", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of resources to return. The service may return fewer than this value. If unspecified, at most 500 resources will be returned. The maximum value is 500; values above 500 will be coerced to 500.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token, received from a previous KeyTrackingService.SearchProtectedResources call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to KeyTrackingService.SearchProtectedResources must match the call that provided the page token.", + // "location": "query", + // "type": "string" + // }, + // "scope": { + // "description": "Required. Resource name of the organization. Example: organizations/123", + // "location": "path", + // "pattern": "^organizations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+scope}/protectedResources:search", + // "response": { + // "$ref": "GoogleCloudKmsInventoryV1SearchProtectedResourcesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *OrganizationsProtectedResourcesSearchCall) Pages(ctx context.Context, f func(*GoogleCloudKmsInventoryV1SearchProtectedResourcesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "kmsinventory.projects.cryptoKeys.list": + +type ProjectsCryptoKeysListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Returns cryptographic keys managed by Cloud KMS in a given +// Cloud project. Note that this data is sourced from snapshots, meaning +// it may not completely reflect the actual state of key metadata at +// call time. +// +// - parent: The Google Cloud project for which to retrieve key +// metadata, in the format `projects/*`. +func (r *ProjectsCryptoKeysService) List(parent string) *ProjectsCryptoKeysListCall { + c := &ProjectsCryptoKeysListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of keys to return. The service may return fewer than this value. If +// unspecified, at most 1000 keys will be returned. The maximum value is +// 1000; values above 1000 will be coerced to 1000. +func (c *ProjectsCryptoKeysListCall) PageSize(pageSize int64) *ProjectsCryptoKeysListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": Pass this into a +// subsequent request in order to receive the next page of results. +func (c *ProjectsCryptoKeysListCall) PageToken(pageToken string) *ProjectsCryptoKeysListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsCryptoKeysListCall) Fields(s ...googleapi.Field) *ProjectsCryptoKeysListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsCryptoKeysListCall) IfNoneMatch(entityTag string) *ProjectsCryptoKeysListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsCryptoKeysListCall) Context(ctx context.Context) *ProjectsCryptoKeysListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsCryptoKeysListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsCryptoKeysListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/cryptoKeys") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "kmsinventory.projects.cryptoKeys.list" call. +// Exactly one of *GoogleCloudKmsInventoryV1ListCryptoKeysResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudKmsInventoryV1ListCryptoKeysResponse.ServerResponse.Header +// +// or (if a response was returned at all) in +// +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsCryptoKeysListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudKmsInventoryV1ListCryptoKeysResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudKmsInventoryV1ListCryptoKeysResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns cryptographic keys managed by Cloud KMS in a given Cloud project. Note that this data is sourced from snapshots, meaning it may not completely reflect the actual state of key metadata at call time.", + // "flatPath": "v1/projects/{projectsId}/cryptoKeys", + // "httpMethod": "GET", + // "id": "kmsinventory.projects.cryptoKeys.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "pageSize": { + // "description": "Optional. The maximum number of keys to return. The service may return fewer than this value. If unspecified, at most 1000 keys will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Pass this into a subsequent request in order to receive the next page of results.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The Google Cloud project for which to retrieve key metadata, in the format `projects/*`", + // "location": "path", + // "pattern": "^projects/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+parent}/cryptoKeys", + // "response": { + // "$ref": "GoogleCloudKmsInventoryV1ListCryptoKeysResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsCryptoKeysListCall) Pages(ctx context.Context, f func(*GoogleCloudKmsInventoryV1ListCryptoKeysResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "kmsinventory.projects.locations.keyRings.cryptoKeys.getProtectedResourcesSummary": + +type ProjectsLocationsKeyRingsCryptoKeysGetProtectedResourcesSummaryCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// GetProtectedResourcesSummary: Returns aggregate information about the +// resources protected by the given Cloud KMS CryptoKey. Only resources +// within the same Cloud organization as the key will be returned. The +// project that holds the key must be part of an organization in order +// for this call to succeed. +// +// - name: The resource name of the CryptoKey. +func (r *ProjectsLocationsKeyRingsCryptoKeysService) GetProtectedResourcesSummary(name string) *ProjectsLocationsKeyRingsCryptoKeysGetProtectedResourcesSummaryCall { + c := &ProjectsLocationsKeyRingsCryptoKeysGetProtectedResourcesSummaryCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsKeyRingsCryptoKeysGetProtectedResourcesSummaryCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsCryptoKeysGetProtectedResourcesSummaryCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsKeyRingsCryptoKeysGetProtectedResourcesSummaryCall) IfNoneMatch(entityTag string) *ProjectsLocationsKeyRingsCryptoKeysGetProtectedResourcesSummaryCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsKeyRingsCryptoKeysGetProtectedResourcesSummaryCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsCryptoKeysGetProtectedResourcesSummaryCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsKeyRingsCryptoKeysGetProtectedResourcesSummaryCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsKeyRingsCryptoKeysGetProtectedResourcesSummaryCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/protectedResourcesSummary") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "kmsinventory.projects.locations.keyRings.cryptoKeys.getProtectedResourcesSummary" call. +// Exactly one of *GoogleCloudKmsInventoryV1ProtectedResourcesSummary or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudKmsInventoryV1ProtectedResourcesSummary.ServerResponse.Hea +// der or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsKeyRingsCryptoKeysGetProtectedResourcesSummaryCall) Do(opts ...googleapi.CallOption) (*GoogleCloudKmsInventoryV1ProtectedResourcesSummary, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudKmsInventoryV1ProtectedResourcesSummary{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns aggregate information about the resources protected by the given Cloud KMS CryptoKey. Only resources within the same Cloud organization as the key will be returned. The project that holds the key must be part of an organization in order for this call to succeed.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}/protectedResourcesSummary", + // "httpMethod": "GET", + // "id": "kmsinventory.projects.locations.keyRings.cryptoKeys.getProtectedResourcesSummary", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource name of the CryptoKey.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/.*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}/protectedResourcesSummary", + // "response": { + // "$ref": "GoogleCloudKmsInventoryV1ProtectedResourcesSummary" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} diff --git a/mybusinessaccountmanagement/v1/mybusinessaccountmanagement-api.json b/mybusinessaccountmanagement/v1/mybusinessaccountmanagement-api.json index 5c4a343834b..e6a83102560 100644 --- a/mybusinessaccountmanagement/v1/mybusinessaccountmanagement-api.json +++ b/mybusinessaccountmanagement/v1/mybusinessaccountmanagement-api.json @@ -530,7 +530,7 @@ } } }, - "revision": "20221201", + "revision": "20230117", "rootUrl": "https://mybusinessaccountmanagement.googleapis.com/", "schemas": { "AcceptInvitationRequest": { @@ -577,7 +577,7 @@ "type": "string" }, "primaryOwner": { - "description": "Required. Input only. The resource name of the account which will be the primary owner of the account being created. It should be of the form `accounts/{account_id}/`.", + "description": "Required. Input only. The resource name of the account which will be the primary owner of the account being created. It should be of the form `accounts/{account_id}`.", "type": "string" }, "role": { diff --git a/mybusinessaccountmanagement/v1/mybusinessaccountmanagement-gen.go b/mybusinessaccountmanagement/v1/mybusinessaccountmanagement-gen.go index d17e8acd600..eb1d2bc9a15 100644 --- a/mybusinessaccountmanagement/v1/mybusinessaccountmanagement-gen.go +++ b/mybusinessaccountmanagement/v1/mybusinessaccountmanagement-gen.go @@ -219,7 +219,7 @@ type Account struct { // PrimaryOwner: Required. Input only. The resource name of the account // which will be the primary owner of the account being created. It - // should be of the form `accounts/{account_id}/`. + // should be of the form `accounts/{account_id}`. PrimaryOwner string `json:"primaryOwner,omitempty"` // Role: Output only. Specifies the AccountRole of this account. diff --git a/orgpolicy/v2/orgpolicy-api.json b/orgpolicy/v2/orgpolicy-api.json index 8cfc8e19c41..8537cdb2786 100644 --- a/orgpolicy/v2/orgpolicy-api.json +++ b/orgpolicy/v2/orgpolicy-api.json @@ -303,6 +303,12 @@ "pattern": "^folders/[^/]+/policies/[^/]+$", "required": true, "type": "string" + }, + "updateMask": { + "description": "Field mask used to specify the fields to be overwritten in the policy by the set. The fields specified in the update_mask are relative to the policy, not the full request.", + "format": "google-fieldmask", + "location": "query", + "type": "string" } }, "path": "v2/{+name}", @@ -664,6 +670,12 @@ "pattern": "^organizations/[^/]+/policies/[^/]+$", "required": true, "type": "string" + }, + "updateMask": { + "description": "Field mask used to specify the fields to be overwritten in the policy by the set. The fields specified in the update_mask are relative to the policy, not the full request.", + "format": "google-fieldmask", + "location": "query", + "type": "string" } }, "path": "v2/{+name}", @@ -879,6 +891,12 @@ "pattern": "^projects/[^/]+/policies/[^/]+$", "required": true, "type": "string" + }, + "updateMask": { + "description": "Field mask used to specify the fields to be overwritten in the policy by the set. The fields specified in the update_mask are relative to the policy, not the full request.", + "format": "google-fieldmask", + "location": "query", + "type": "string" } }, "path": "v2/{+name}", @@ -897,7 +915,7 @@ } } }, - "revision": "20221024", + "revision": "20230116", "rootUrl": "https://orgpolicy.googleapis.com/", "schemas": { "GoogleCloudOrgpolicyV2AlternatePolicySpec": { @@ -1108,6 +1126,10 @@ "$ref": "GoogleCloudOrgpolicyV2AlternatePolicySpec", "description": "Deprecated." }, + "dryRunSpec": { + "$ref": "GoogleCloudOrgpolicyV2PolicySpec", + "description": "dry-run policy. Audit-only policy, can be used to monitor how the policy would have impacted the existing and future resources if it's enforced." + }, "name": { "description": "Immutable. The resource name of the Policy. Must be one of the following forms, where constraint_name is the name of the constraint which this Policy configures: * `projects/{project_number}/policies/{constraint_name}` * `folders/{folder_id}/policies/{constraint_name}` * `organizations/{organization_id}/policies/{constraint_name}` For example, \"projects/123/policies/compute.disableSerialPortAccess\". Note: `projects/{project_id}/policies/{constraint_name}` is also an acceptable name for API requests, but responses will return the name using the equivalent project number.", "type": "string" diff --git a/orgpolicy/v2/orgpolicy-gen.go b/orgpolicy/v2/orgpolicy-gen.go index bf9ac131484..72778699368 100644 --- a/orgpolicy/v2/orgpolicy-gen.go +++ b/orgpolicy/v2/orgpolicy-gen.go @@ -624,6 +624,11 @@ type GoogleCloudOrgpolicyV2Policy struct { // Alternate: Deprecated. Alternate *GoogleCloudOrgpolicyV2AlternatePolicySpec `json:"alternate,omitempty"` + // DryRunSpec: dry-run policy. Audit-only policy, can be used to monitor + // how the policy would have impacted the existing and future resources + // if it's enforced. + DryRunSpec *GoogleCloudOrgpolicyV2PolicySpec `json:"dryRunSpec,omitempty"` + // Name: Immutable. The resource name of the Policy. Must be one of the // following forms, where constraint_name is the name of the constraint // which this Policy configures: * @@ -1920,6 +1925,15 @@ func (r *FoldersPoliciesService) Patch(name string, googlecloudorgpolicyv2policy return c } +// UpdateMask sets the optional parameter "updateMask": Field mask used +// to specify the fields to be overwritten in the policy by the set. The +// fields specified in the update_mask are relative to the policy, not +// the full request. +func (c *FoldersPoliciesPatchCall) UpdateMask(updateMask string) *FoldersPoliciesPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. @@ -2025,6 +2039,12 @@ func (c *FoldersPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleClou // "pattern": "^folders/[^/]+/policies/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Field mask used to specify the fields to be overwritten in the policy by the set. The fields specified in the update_mask are relative to the policy, not the full request.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, // "path": "v2/{+name}", @@ -3842,6 +3862,15 @@ func (r *OrganizationsPoliciesService) Patch(name string, googlecloudorgpolicyv2 return c } +// UpdateMask sets the optional parameter "updateMask": Field mask used +// to specify the fields to be overwritten in the policy by the set. The +// fields specified in the update_mask are relative to the policy, not +// the full request. +func (c *OrganizationsPoliciesPatchCall) UpdateMask(updateMask string) *OrganizationsPoliciesPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. @@ -3947,6 +3976,12 @@ func (c *OrganizationsPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Goog // "pattern": "^organizations/[^/]+/policies/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Field mask used to specify the fields to be overwritten in the policy by the set. The fields specified in the update_mask are relative to the policy, not the full request.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, // "path": "v2/{+name}", @@ -4982,6 +5017,15 @@ func (r *ProjectsPoliciesService) Patch(name string, googlecloudorgpolicyv2polic return c } +// UpdateMask sets the optional parameter "updateMask": Field mask used +// to specify the fields to be overwritten in the policy by the set. The +// fields specified in the update_mask are relative to the policy, not +// the full request. +func (c *ProjectsPoliciesPatchCall) UpdateMask(updateMask string) *ProjectsPoliciesPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. @@ -5087,6 +5131,12 @@ func (c *ProjectsPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleClo // "pattern": "^projects/[^/]+/policies/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Field mask used to specify the fields to be overwritten in the policy by the set. The fields specified in the update_mask are relative to the policy, not the full request.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, // "path": "v2/{+name}", diff --git a/playdeveloperreporting/v1alpha1/playdeveloperreporting-api.json b/playdeveloperreporting/v1alpha1/playdeveloperreporting-api.json index b5979c1cc56..b1d68bc4eba 100644 --- a/playdeveloperreporting/v1alpha1/playdeveloperreporting-api.json +++ b/playdeveloperreporting/v1alpha1/playdeveloperreporting-api.json @@ -1,4 +1,13 @@ { + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/playdeveloperreporting": { + "description": "See metrics and data about the apps in your Google Play Developer account" + } + } + } + }, "basePath": "", "baseUrl": "https://playdeveloperreporting.googleapis.com/", "batchPath": "batch", @@ -134,7 +143,10 @@ "path": "v1alpha1/{+parent}/anomalies", "response": { "$ref": "GooglePlayDeveloperReportingV1alpha1ListAnomaliesResponse" - } + }, + "scopes": [ + "https://www.googleapis.com/auth/playdeveloperreporting" + ] } } }, @@ -162,7 +174,10 @@ "path": "v1alpha1/{+name}", "response": { "$ref": "GooglePlayDeveloperReportingV1alpha1AnrRateMetricSet" - } + }, + "scopes": [ + "https://www.googleapis.com/auth/playdeveloperreporting" + ] }, "query": { "description": "Queries the metrics in the metric set.", @@ -187,7 +202,10 @@ }, "response": { "$ref": "GooglePlayDeveloperReportingV1alpha1QueryAnrRateMetricSetResponse" - } + }, + "scopes": [ + "https://www.googleapis.com/auth/playdeveloperreporting" + ] } } }, @@ -213,7 +231,10 @@ "path": "v1alpha1/{+name}", "response": { "$ref": "GooglePlayDeveloperReportingV1alpha1CrashRateMetricSet" - } + }, + "scopes": [ + "https://www.googleapis.com/auth/playdeveloperreporting" + ] }, "query": { "description": "Queries the metrics in the metric set.", @@ -238,7 +259,10 @@ }, "response": { "$ref": "GooglePlayDeveloperReportingV1alpha1QueryCrashRateMetricSetResponse" - } + }, + "scopes": [ + "https://www.googleapis.com/auth/playdeveloperreporting" + ] } } }, @@ -266,7 +290,10 @@ "path": "v1alpha1/{+name}", "response": { "$ref": "GooglePlayDeveloperReportingV1alpha1ErrorCountMetricSet" - } + }, + "scopes": [ + "https://www.googleapis.com/auth/playdeveloperreporting" + ] }, "query": { "description": "Queries the metrics in the metrics set.", @@ -291,7 +318,10 @@ }, "response": { "$ref": "GooglePlayDeveloperReportingV1alpha1QueryErrorCountMetricSetResponse" - } + }, + "scopes": [ + "https://www.googleapis.com/auth/playdeveloperreporting" + ] } } }, @@ -449,7 +479,10 @@ "path": "v1alpha1/{+parent}/errorIssues:search", "response": { "$ref": "GooglePlayDeveloperReportingV1alpha1SearchErrorIssuesResponse" - } + }, + "scopes": [ + "https://www.googleapis.com/auth/playdeveloperreporting" + ] } } }, @@ -607,7 +640,10 @@ "path": "v1alpha1/{+parent}/errorReports:search", "response": { "$ref": "GooglePlayDeveloperReportingV1alpha1SearchErrorReportsResponse" - } + }, + "scopes": [ + "https://www.googleapis.com/auth/playdeveloperreporting" + ] } } } @@ -635,7 +671,10 @@ "path": "v1alpha1/{+name}", "response": { "$ref": "GooglePlayDeveloperReportingV1alpha1ExcessiveWakeupRateMetricSet" - } + }, + "scopes": [ + "https://www.googleapis.com/auth/playdeveloperreporting" + ] }, "query": { "description": "Queries the metrics in the metric set.", @@ -660,7 +699,10 @@ }, "response": { "$ref": "GooglePlayDeveloperReportingV1alpha1QueryExcessiveWakeupRateMetricSetResponse" - } + }, + "scopes": [ + "https://www.googleapis.com/auth/playdeveloperreporting" + ] } } }, @@ -686,7 +728,10 @@ "path": "v1alpha1/{+name}", "response": { "$ref": "GooglePlayDeveloperReportingV1alpha1StuckBackgroundWakelockRateMetricSet" - } + }, + "scopes": [ + "https://www.googleapis.com/auth/playdeveloperreporting" + ] }, "query": { "description": "Queries the metrics in the metric set.", @@ -711,14 +756,17 @@ }, "response": { "$ref": "GooglePlayDeveloperReportingV1alpha1QueryStuckBackgroundWakelockRateMetricSetResponse" - } + }, + "scopes": [ + "https://www.googleapis.com/auth/playdeveloperreporting" + ] } } } } } }, - "revision": "20221106", + "revision": "20230116", "rootUrl": "https://playdeveloperreporting.googleapis.com/", "schemas": { "GooglePlayDeveloperReportingV1alpha1Anomaly": { diff --git a/playdeveloperreporting/v1alpha1/playdeveloperreporting-gen.go b/playdeveloperreporting/v1alpha1/playdeveloperreporting-gen.go index c16d59e6a03..fdc6cfe6f79 100644 --- a/playdeveloperreporting/v1alpha1/playdeveloperreporting-gen.go +++ b/playdeveloperreporting/v1alpha1/playdeveloperreporting-gen.go @@ -78,8 +78,20 @@ const apiVersion = "v1alpha1" const basePath = "https://playdeveloperreporting.googleapis.com/" const mtlsBasePath = "https://playdeveloperreporting.mtls.googleapis.com/" +// OAuth2 scopes used by this API. +const ( + // See metrics and data about the apps in your Google Play Developer + // account + PlaydeveloperreportingScope = "https://www.googleapis.com/auth/playdeveloperreporting" +) + // NewService creates a new Service. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { + scopesOption := internaloption.WithDefaultScopes( + "https://www.googleapis.com/auth/playdeveloperreporting", + ) + // NOTE: prepend, so we don't override user-specified scopes. + opts = append([]option.ClientOption{scopesOption}, opts...) opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) client, endpoint, err := htransport.NewClient(ctx, opts...) @@ -2281,7 +2293,10 @@ func (c *AnomaliesListCall) Do(opts ...googleapi.CallOption) (*GooglePlayDevelop // "path": "v1alpha1/{+parent}/anomalies", // "response": { // "$ref": "GooglePlayDeveloperReportingV1alpha1ListAnomaliesResponse" - // } + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/playdeveloperreporting" + // ] // } } @@ -2447,7 +2462,10 @@ func (c *VitalsAnrrateGetCall) Do(opts ...googleapi.CallOption) (*GooglePlayDeve // "path": "v1alpha1/{+name}", // "response": { // "$ref": "GooglePlayDeveloperReportingV1alpha1AnrRateMetricSet" - // } + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/playdeveloperreporting" + // ] // } } @@ -2589,7 +2607,10 @@ func (c *VitalsAnrrateQueryCall) Do(opts ...googleapi.CallOption) (*GooglePlayDe // }, // "response": { // "$ref": "GooglePlayDeveloperReportingV1alpha1QueryAnrRateMetricSetResponse" - // } + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/playdeveloperreporting" + // ] // } } @@ -2756,7 +2777,10 @@ func (c *VitalsCrashrateGetCall) Do(opts ...googleapi.CallOption) (*GooglePlayDe // "path": "v1alpha1/{+name}", // "response": { // "$ref": "GooglePlayDeveloperReportingV1alpha1CrashRateMetricSet" - // } + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/playdeveloperreporting" + // ] // } } @@ -2898,7 +2922,10 @@ func (c *VitalsCrashrateQueryCall) Do(opts ...googleapi.CallOption) (*GooglePlay // }, // "response": { // "$ref": "GooglePlayDeveloperReportingV1alpha1QueryCrashRateMetricSetResponse" - // } + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/playdeveloperreporting" + // ] // } } @@ -3066,7 +3093,10 @@ func (c *VitalsErrorsCountsGetCall) Do(opts ...googleapi.CallOption) (*GooglePla // "path": "v1alpha1/{+name}", // "response": { // "$ref": "GooglePlayDeveloperReportingV1alpha1ErrorCountMetricSet" - // } + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/playdeveloperreporting" + // ] // } } @@ -3208,7 +3238,10 @@ func (c *VitalsErrorsCountsQueryCall) Do(opts ...googleapi.CallOption) (*GoogleP // }, // "response": { // "$ref": "GooglePlayDeveloperReportingV1alpha1QueryErrorCountMetricSetResponse" - // } + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/playdeveloperreporting" + // ] // } } @@ -3727,7 +3760,10 @@ func (c *VitalsErrorsIssuesSearchCall) Do(opts ...googleapi.CallOption) (*Google // "path": "v1alpha1/{+parent}/errorIssues:search", // "response": { // "$ref": "GooglePlayDeveloperReportingV1alpha1SearchErrorIssuesResponse" - // } + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/playdeveloperreporting" + // ] // } } @@ -4249,7 +4285,10 @@ func (c *VitalsErrorsReportsSearchCall) Do(opts ...googleapi.CallOption) (*Googl // "path": "v1alpha1/{+parent}/errorReports:search", // "response": { // "$ref": "GooglePlayDeveloperReportingV1alpha1SearchErrorReportsResponse" - // } + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/playdeveloperreporting" + // ] // } } @@ -4417,7 +4456,10 @@ func (c *VitalsExcessivewakeuprateGetCall) Do(opts ...googleapi.CallOption) (*Go // "path": "v1alpha1/{+name}", // "response": { // "$ref": "GooglePlayDeveloperReportingV1alpha1ExcessiveWakeupRateMetricSet" - // } + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/playdeveloperreporting" + // ] // } } @@ -4560,7 +4602,10 @@ func (c *VitalsExcessivewakeuprateQueryCall) Do(opts ...googleapi.CallOption) (* // }, // "response": { // "$ref": "GooglePlayDeveloperReportingV1alpha1QueryExcessiveWakeupRateMetricSetResponse" - // } + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/playdeveloperreporting" + // ] // } } @@ -4730,7 +4775,10 @@ func (c *VitalsStuckbackgroundwakelockrateGetCall) Do(opts ...googleapi.CallOpti // "path": "v1alpha1/{+name}", // "response": { // "$ref": "GooglePlayDeveloperReportingV1alpha1StuckBackgroundWakelockRateMetricSet" - // } + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/playdeveloperreporting" + // ] // } } @@ -4873,7 +4921,10 @@ func (c *VitalsStuckbackgroundwakelockrateQueryCall) Do(opts ...googleapi.CallOp // }, // "response": { // "$ref": "GooglePlayDeveloperReportingV1alpha1QueryStuckBackgroundWakelockRateMetricSetResponse" - // } + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/playdeveloperreporting" + // ] // } } diff --git a/playdeveloperreporting/v1beta1/playdeveloperreporting-api.json b/playdeveloperreporting/v1beta1/playdeveloperreporting-api.json index 315ed35b301..2a9c1a14f10 100644 --- a/playdeveloperreporting/v1beta1/playdeveloperreporting-api.json +++ b/playdeveloperreporting/v1beta1/playdeveloperreporting-api.json @@ -1,4 +1,13 @@ { + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/playdeveloperreporting": { + "description": "See metrics and data about the apps in your Google Play Developer account" + } + } + } + }, "basePath": "", "baseUrl": "https://playdeveloperreporting.googleapis.com/", "batchPath": "batch", @@ -134,7 +143,10 @@ "path": "v1beta1/{+parent}/anomalies", "response": { "$ref": "GooglePlayDeveloperReportingV1beta1ListAnomaliesResponse" - } + }, + "scopes": [ + "https://www.googleapis.com/auth/playdeveloperreporting" + ] } } }, @@ -162,7 +174,10 @@ "path": "v1beta1/{+name}", "response": { "$ref": "GooglePlayDeveloperReportingV1beta1AnrRateMetricSet" - } + }, + "scopes": [ + "https://www.googleapis.com/auth/playdeveloperreporting" + ] }, "query": { "description": "Queries the metrics in the metric set.", @@ -187,7 +202,10 @@ }, "response": { "$ref": "GooglePlayDeveloperReportingV1beta1QueryAnrRateMetricSetResponse" - } + }, + "scopes": [ + "https://www.googleapis.com/auth/playdeveloperreporting" + ] } } }, @@ -213,7 +231,10 @@ "path": "v1beta1/{+name}", "response": { "$ref": "GooglePlayDeveloperReportingV1beta1CrashRateMetricSet" - } + }, + "scopes": [ + "https://www.googleapis.com/auth/playdeveloperreporting" + ] }, "query": { "description": "Queries the metrics in the metric set.", @@ -238,7 +259,10 @@ }, "response": { "$ref": "GooglePlayDeveloperReportingV1beta1QueryCrashRateMetricSetResponse" - } + }, + "scopes": [ + "https://www.googleapis.com/auth/playdeveloperreporting" + ] } } }, @@ -264,7 +288,10 @@ "path": "v1beta1/{+name}", "response": { "$ref": "GooglePlayDeveloperReportingV1beta1ExcessiveWakeupRateMetricSet" - } + }, + "scopes": [ + "https://www.googleapis.com/auth/playdeveloperreporting" + ] }, "query": { "description": "Queries the metrics in the metric set.", @@ -289,7 +316,10 @@ }, "response": { "$ref": "GooglePlayDeveloperReportingV1beta1QueryExcessiveWakeupRateMetricSetResponse" - } + }, + "scopes": [ + "https://www.googleapis.com/auth/playdeveloperreporting" + ] } } }, @@ -315,7 +345,10 @@ "path": "v1beta1/{+name}", "response": { "$ref": "GooglePlayDeveloperReportingV1beta1StuckBackgroundWakelockRateMetricSet" - } + }, + "scopes": [ + "https://www.googleapis.com/auth/playdeveloperreporting" + ] }, "query": { "description": "Queries the metrics in the metric set.", @@ -340,14 +373,17 @@ }, "response": { "$ref": "GooglePlayDeveloperReportingV1beta1QueryStuckBackgroundWakelockRateMetricSetResponse" - } + }, + "scopes": [ + "https://www.googleapis.com/auth/playdeveloperreporting" + ] } } } } } }, - "revision": "20221106", + "revision": "20230116", "rootUrl": "https://playdeveloperreporting.googleapis.com/", "schemas": { "GooglePlayDeveloperReportingV1beta1Anomaly": { diff --git a/playdeveloperreporting/v1beta1/playdeveloperreporting-gen.go b/playdeveloperreporting/v1beta1/playdeveloperreporting-gen.go index 18f1eb0eb4a..cc374a5c5d5 100644 --- a/playdeveloperreporting/v1beta1/playdeveloperreporting-gen.go +++ b/playdeveloperreporting/v1beta1/playdeveloperreporting-gen.go @@ -78,8 +78,20 @@ const apiVersion = "v1beta1" const basePath = "https://playdeveloperreporting.googleapis.com/" const mtlsBasePath = "https://playdeveloperreporting.mtls.googleapis.com/" +// OAuth2 scopes used by this API. +const ( + // See metrics and data about the apps in your Google Play Developer + // account + PlaydeveloperreportingScope = "https://www.googleapis.com/auth/playdeveloperreporting" +) + // NewService creates a new Service. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { + scopesOption := internaloption.WithDefaultScopes( + "https://www.googleapis.com/auth/playdeveloperreporting", + ) + // NOTE: prepend, so we don't override user-specified scopes. + opts = append([]option.ClientOption{scopesOption}, opts...) opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) client, endpoint, err := htransport.NewClient(ctx, opts...) @@ -1834,7 +1846,10 @@ func (c *AnomaliesListCall) Do(opts ...googleapi.CallOption) (*GooglePlayDevelop // "path": "v1beta1/{+parent}/anomalies", // "response": { // "$ref": "GooglePlayDeveloperReportingV1beta1ListAnomaliesResponse" - // } + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/playdeveloperreporting" + // ] // } } @@ -2000,7 +2015,10 @@ func (c *VitalsAnrrateGetCall) Do(opts ...googleapi.CallOption) (*GooglePlayDeve // "path": "v1beta1/{+name}", // "response": { // "$ref": "GooglePlayDeveloperReportingV1beta1AnrRateMetricSet" - // } + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/playdeveloperreporting" + // ] // } } @@ -2142,7 +2160,10 @@ func (c *VitalsAnrrateQueryCall) Do(opts ...googleapi.CallOption) (*GooglePlayDe // }, // "response": { // "$ref": "GooglePlayDeveloperReportingV1beta1QueryAnrRateMetricSetResponse" - // } + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/playdeveloperreporting" + // ] // } } @@ -2308,7 +2329,10 @@ func (c *VitalsCrashrateGetCall) Do(opts ...googleapi.CallOption) (*GooglePlayDe // "path": "v1beta1/{+name}", // "response": { // "$ref": "GooglePlayDeveloperReportingV1beta1CrashRateMetricSet" - // } + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/playdeveloperreporting" + // ] // } } @@ -2450,7 +2474,10 @@ func (c *VitalsCrashrateQueryCall) Do(opts ...googleapi.CallOption) (*GooglePlay // }, // "response": { // "$ref": "GooglePlayDeveloperReportingV1beta1QueryCrashRateMetricSetResponse" - // } + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/playdeveloperreporting" + // ] // } } @@ -2618,7 +2645,10 @@ func (c *VitalsExcessivewakeuprateGetCall) Do(opts ...googleapi.CallOption) (*Go // "path": "v1beta1/{+name}", // "response": { // "$ref": "GooglePlayDeveloperReportingV1beta1ExcessiveWakeupRateMetricSet" - // } + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/playdeveloperreporting" + // ] // } } @@ -2761,7 +2791,10 @@ func (c *VitalsExcessivewakeuprateQueryCall) Do(opts ...googleapi.CallOption) (* // }, // "response": { // "$ref": "GooglePlayDeveloperReportingV1beta1QueryExcessiveWakeupRateMetricSetResponse" - // } + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/playdeveloperreporting" + // ] // } } @@ -2931,7 +2964,10 @@ func (c *VitalsStuckbackgroundwakelockrateGetCall) Do(opts ...googleapi.CallOpti // "path": "v1beta1/{+name}", // "response": { // "$ref": "GooglePlayDeveloperReportingV1beta1StuckBackgroundWakelockRateMetricSet" - // } + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/playdeveloperreporting" + // ] // } } @@ -3074,7 +3110,10 @@ func (c *VitalsStuckbackgroundwakelockrateQueryCall) Do(opts ...googleapi.CallOp // }, // "response": { // "$ref": "GooglePlayDeveloperReportingV1beta1QueryStuckBackgroundWakelockRateMetricSetResponse" - // } + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/playdeveloperreporting" + // ] // } } diff --git a/securitycenter/v1/securitycenter-api.json b/securitycenter/v1/securitycenter-api.json index 0e189f7cc47..34f6ebccd40 100644 --- a/securitycenter/v1/securitycenter-api.json +++ b/securitycenter/v1/securitycenter-api.json @@ -180,7 +180,7 @@ "type": "string" }, "parent": { - "description": "Required. The name of the parent that the listed assets belong to. Its format is \"organizations/[organization_id], \"folders/[folder_id]\", or \"projects/[project_id]\".", + "description": "Required. The name of the parent resource that contains the assets. The value that you can specify on parent depends on the method in which you specify parent. You can specify one of the following values: \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", "location": "path", "pattern": "^folders/[^/]+$", "required": true, @@ -769,7 +769,7 @@ "type": "string" }, "parent": { - "description": "Required. Resource name of the parent of sources to list. Its format should be \"organizations/[organization_id], \"folders/[folder_id]\", or \"projects/[project_id]\".", + "description": "Required. Resource name of the parent of sources to list. Its format should be \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", "location": "path", "pattern": "^folders/[^/]+$", "required": true, @@ -1192,7 +1192,7 @@ "type": "string" }, "parent": { - "description": "Required. The name of the parent that the listed assets belong to. Its format is \"organizations/[organization_id], \"folders/[folder_id]\", or \"projects/[project_id]\".", + "description": "Required. The name of the parent resource that contains the assets. The value that you can specify on parent depends on the method in which you specify parent. You can specify one of the following values: \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", "location": "path", "pattern": "^organizations/[^/]+$", "required": true, @@ -2010,7 +2010,7 @@ "type": "string" }, "parent": { - "description": "Required. Resource name of the parent of sources to list. Its format should be \"organizations/[organization_id], \"folders/[folder_id]\", or \"projects/[project_id]\".", + "description": "Required. Resource name of the parent of sources to list. Its format should be \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", "location": "path", "pattern": "^organizations/[^/]+$", "required": true, @@ -2495,7 +2495,7 @@ "type": "string" }, "parent": { - "description": "Required. The name of the parent that the listed assets belong to. Its format is \"organizations/[organization_id], \"folders/[folder_id]\", or \"projects/[project_id]\".", + "description": "Required. The name of the parent resource that contains the assets. The value that you can specify on parent depends on the method in which you specify parent. You can specify one of the following values: \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", "location": "path", "pattern": "^projects/[^/]+$", "required": true, @@ -3084,7 +3084,7 @@ "type": "string" }, "parent": { - "description": "Required. Resource name of the parent of sources to list. Its format should be \"organizations/[organization_id], \"folders/[folder_id]\", or \"projects/[project_id]\".", + "description": "Required. Resource name of the parent of sources to list. Its format should be \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", "location": "path", "pattern": "^projects/[^/]+$", "required": true, @@ -3372,7 +3372,7 @@ } } }, - "revision": "20221220", + "revision": "20230112", "rootUrl": "https://securitycenter.googleapis.com/", "schemas": { "Access": { @@ -3415,11 +3415,11 @@ "type": "string" }, "userAgentFamily": { - "description": "What kind of user agent is associated, e.g. operating system shells, embedded or stand-alone applications, etc.", + "description": "What kind of user agent is associated, for example operating system shells, embedded or stand-alone applications, etc.", "type": "string" }, "userName": { - "description": "A string representing a username. This is likely not an IAM principal. For instance, this may be the system user name if the finding is VM-related, or this may be some type of application login user name, depending on the type of finding.", + "description": "A string that represents the username of a user, user account, or other entity involved in the access event. What the entity is and what its role in the access event is depends on the finding that this field appears in. The entity is likely not an IAM principal, but could be a user that is logged into an operating system, if the finding is VM-related, or a user that is logged into some type of application that is involved in the access event.", "type": "string" } }, diff --git a/securitycenter/v1/securitycenter-gen.go b/securitycenter/v1/securitycenter-gen.go index b0554c5e488..48767de8e71 100644 --- a/securitycenter/v1/securitycenter-gen.go +++ b/securitycenter/v1/securitycenter-gen.go @@ -522,14 +522,17 @@ type Access struct { // call to, e.g. "iam.googleapis.com" ServiceName string `json:"serviceName,omitempty"` - // UserAgentFamily: What kind of user agent is associated, e.g. + // UserAgentFamily: What kind of user agent is associated, for example // operating system shells, embedded or stand-alone applications, etc. UserAgentFamily string `json:"userAgentFamily,omitempty"` - // UserName: A string representing a username. This is likely not an IAM - // principal. For instance, this may be the system user name if the - // finding is VM-related, or this may be some type of application login - // user name, depending on the type of finding. + // UserName: A string that represents the username of a user, user + // account, or other entity involved in the access event. What the + // entity is and what its role in the access event is depends on the + // finding that this field appears in. The entity is likely not an IAM + // principal, but could be a user that is logged into an operating + // system, if the finding is VM-related, or a user that is logged into + // some type of application that is involved in the access event. UserName string `json:"userName,omitempty"` // ForceSendFields is a list of field names (e.g. "CallerIp") to @@ -5592,9 +5595,11 @@ type FoldersAssetsListCall struct { // List: Lists an organization's assets. // -// - parent: The name of the parent that the listed assets belong to. -// Its format is "organizations/[organization_id], -// "folders/[folder_id]", or "projects/[project_id]". +// - parent: The name of the parent resource that contains the assets. +// The value that you can specify on parent depends on the method in +// which you specify parent. You can specify one of the following +// values: "organizations/[organization_id]", "folders/[folder_id]", +// or "projects/[project_id]". func (r *FoldersAssetsService) List(parent string) *FoldersAssetsListCall { c := &FoldersAssetsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent @@ -5865,7 +5870,7 @@ func (c *FoldersAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAssetsRes // "type": "string" // }, // "parent": { - // "description": "Required. The name of the parent that the listed assets belong to. Its format is \"organizations/[organization_id], \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "description": "Required. The name of the parent resource that contains the assets. The value that you can specify on parent depends on the method in which you specify parent. You can specify one of the following values: \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", // "pattern": "^folders/[^/]+$", // "required": true, @@ -8668,7 +8673,7 @@ type FoldersSourcesListCall struct { // List: Lists all sources belonging to an organization. // // - parent: Resource name of the parent of sources to list. Its format -// should be "organizations/[organization_id], "folders/[folder_id]", +// should be "organizations/[organization_id]", "folders/[folder_id]", // or "projects/[project_id]". func (r *FoldersSourcesService) List(parent string) *FoldersSourcesListCall { c := &FoldersSourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -8812,7 +8817,7 @@ func (c *FoldersSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSourcesR // "type": "string" // }, // "parent": { - // "description": "Required. Resource name of the parent of sources to list. Its format should be \"organizations/[organization_id], \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "description": "Required. Resource name of the parent of sources to list. Its format should be \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", // "pattern": "^folders/[^/]+$", // "required": true, @@ -10638,9 +10643,11 @@ type OrganizationsAssetsListCall struct { // List: Lists an organization's assets. // -// - parent: The name of the parent that the listed assets belong to. -// Its format is "organizations/[organization_id], -// "folders/[folder_id]", or "projects/[project_id]". +// - parent: The name of the parent resource that contains the assets. +// The value that you can specify on parent depends on the method in +// which you specify parent. You can specify one of the following +// values: "organizations/[organization_id]", "folders/[folder_id]", +// or "projects/[project_id]". func (r *OrganizationsAssetsService) List(parent string) *OrganizationsAssetsListCall { c := &OrganizationsAssetsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent @@ -10911,7 +10918,7 @@ func (c *OrganizationsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAss // "type": "string" // }, // "parent": { - // "description": "Required. The name of the parent that the listed assets belong to. Its format is \"organizations/[organization_id], \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "description": "Required. The name of the parent resource that contains the assets. The value that you can specify on parent depends on the method in which you specify parent. You can specify one of the following values: \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", // "pattern": "^organizations/[^/]+$", // "required": true, @@ -14932,7 +14939,7 @@ type OrganizationsSourcesListCall struct { // List: Lists all sources belonging to an organization. // // - parent: Resource name of the parent of sources to list. Its format -// should be "organizations/[organization_id], "folders/[folder_id]", +// should be "organizations/[organization_id]", "folders/[folder_id]", // or "projects/[project_id]". func (r *OrganizationsSourcesService) List(parent string) *OrganizationsSourcesListCall { c := &OrganizationsSourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -15076,7 +15083,7 @@ func (c *OrganizationsSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSo // "type": "string" // }, // "parent": { - // "description": "Required. Resource name of the parent of sources to list. Its format should be \"organizations/[organization_id], \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "description": "Required. Resource name of the parent of sources to list. Its format should be \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", // "pattern": "^organizations/[^/]+$", // "required": true, @@ -17203,9 +17210,11 @@ type ProjectsAssetsListCall struct { // List: Lists an organization's assets. // -// - parent: The name of the parent that the listed assets belong to. -// Its format is "organizations/[organization_id], -// "folders/[folder_id]", or "projects/[project_id]". +// - parent: The name of the parent resource that contains the assets. +// The value that you can specify on parent depends on the method in +// which you specify parent. You can specify one of the following +// values: "organizations/[organization_id]", "folders/[folder_id]", +// or "projects/[project_id]". func (r *ProjectsAssetsService) List(parent string) *ProjectsAssetsListCall { c := &ProjectsAssetsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent @@ -17476,7 +17485,7 @@ func (c *ProjectsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAssetsRe // "type": "string" // }, // "parent": { - // "description": "Required. The name of the parent that the listed assets belong to. Its format is \"organizations/[organization_id], \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "description": "Required. The name of the parent resource that contains the assets. The value that you can specify on parent depends on the method in which you specify parent. You can specify one of the following values: \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", // "pattern": "^projects/[^/]+$", // "required": true, @@ -20279,7 +20288,7 @@ type ProjectsSourcesListCall struct { // List: Lists all sources belonging to an organization. // // - parent: Resource name of the parent of sources to list. Its format -// should be "organizations/[organization_id], "folders/[folder_id]", +// should be "organizations/[organization_id]", "folders/[folder_id]", // or "projects/[project_id]". func (r *ProjectsSourcesService) List(parent string) *ProjectsSourcesListCall { c := &ProjectsSourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -20423,7 +20432,7 @@ func (c *ProjectsSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSources // "type": "string" // }, // "parent": { - // "description": "Required. Resource name of the parent of sources to list. Its format should be \"organizations/[organization_id], \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "description": "Required. Resource name of the parent of sources to list. Its format should be \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", // "pattern": "^projects/[^/]+$", // "required": true, diff --git a/securitycenter/v1beta1/securitycenter-api.json b/securitycenter/v1beta1/securitycenter-api.json index a52a262a7de..f983049389e 100644 --- a/securitycenter/v1beta1/securitycenter-api.json +++ b/securitycenter/v1beta1/securitycenter-api.json @@ -896,7 +896,7 @@ } } }, - "revision": "20221220", + "revision": "20230112", "rootUrl": "https://securitycenter.googleapis.com/", "schemas": { "Access": { @@ -939,11 +939,11 @@ "type": "string" }, "userAgentFamily": { - "description": "What kind of user agent is associated, e.g. operating system shells, embedded or stand-alone applications, etc.", + "description": "What kind of user agent is associated, for example operating system shells, embedded or stand-alone applications, etc.", "type": "string" }, "userName": { - "description": "A string representing a username. This is likely not an IAM principal. For instance, this may be the system user name if the finding is VM-related, or this may be some type of application login user name, depending on the type of finding.", + "description": "A string that represents the username of a user, user account, or other entity involved in the access event. What the entity is and what its role in the access event is depends on the finding that this field appears in. The entity is likely not an IAM principal, but could be a user that is logged into an operating system, if the finding is VM-related, or a user that is logged into some type of application that is involved in the access event.", "type": "string" } }, diff --git a/securitycenter/v1beta1/securitycenter-gen.go b/securitycenter/v1beta1/securitycenter-gen.go index 1d57a16f1c7..56532420af1 100644 --- a/securitycenter/v1beta1/securitycenter-gen.go +++ b/securitycenter/v1beta1/securitycenter-gen.go @@ -246,14 +246,17 @@ type Access struct { // call to, e.g. "iam.googleapis.com" ServiceName string `json:"serviceName,omitempty"` - // UserAgentFamily: What kind of user agent is associated, e.g. + // UserAgentFamily: What kind of user agent is associated, for example // operating system shells, embedded or stand-alone applications, etc. UserAgentFamily string `json:"userAgentFamily,omitempty"` - // UserName: A string representing a username. This is likely not an IAM - // principal. For instance, this may be the system user name if the - // finding is VM-related, or this may be some type of application login - // user name, depending on the type of finding. + // UserName: A string that represents the username of a user, user + // account, or other entity involved in the access event. What the + // entity is and what its role in the access event is depends on the + // finding that this field appears in. The entity is likely not an IAM + // principal, but could be a user that is logged into an operating + // system, if the finding is VM-related, or a user that is logged into + // some type of application that is involved in the access event. UserName string `json:"userName,omitempty"` // ForceSendFields is a list of field names (e.g. "CallerIp") to diff --git a/servicenetworking/v1/servicenetworking-api.json b/servicenetworking/v1/servicenetworking-api.json index 3d688fd055a..99a9089df10 100644 --- a/servicenetworking/v1/servicenetworking-api.json +++ b/servicenetworking/v1/servicenetworking-api.json @@ -865,7 +865,7 @@ } } }, - "revision": "20221218", + "revision": "20230116", "rootUrl": "https://servicenetworking.googleapis.com/", "schemas": { "AddDnsRecordSetMetadata": { @@ -1032,6 +1032,10 @@ }, "type": "array" }, + "role": { + "description": "Optional. Defines the role field of the subnet, e.g. 'ACTIVE'. For information about the roles that can be set using this field, see [subnetwork](https://cloud.google.com/compute/docs/reference/rest/v1/subnetworks) in the Compute API documentation.", + "type": "string" + }, "secondaryIpRangeSpecs": { "description": "Optional. A list of secondary IP ranges to be created within the new subnetwork.", "items": { diff --git a/servicenetworking/v1/servicenetworking-gen.go b/servicenetworking/v1/servicenetworking-gen.go index 3e03fbee34f..1a17cf2fe65 100644 --- a/servicenetworking/v1/servicenetworking-gen.go +++ b/servicenetworking/v1/servicenetworking-gen.go @@ -557,6 +557,13 @@ type AddSubnetworkRequest struct { // call fails. RequestedRanges []string `json:"requestedRanges,omitempty"` + // Role: Optional. Defines the role field of the subnet, e.g. 'ACTIVE'. + // For information about the roles that can be set using this field, see + // subnetwork + // (https://cloud.google.com/compute/docs/reference/rest/v1/subnetworks) + // in the Compute API documentation. + Role string `json:"role,omitempty"` + // SecondaryIpRangeSpecs: Optional. A list of secondary IP ranges to be // created within the new subnetwork. SecondaryIpRangeSpecs []*SecondaryIpRangeSpec `json:"secondaryIpRangeSpecs,omitempty"` diff --git a/streetviewpublish/v1/streetviewpublish-api.json b/streetviewpublish/v1/streetviewpublish-api.json index 40977f68796..73c81131ace 100644 --- a/streetviewpublish/v1/streetviewpublish-api.json +++ b/streetviewpublish/v1/streetviewpublish-api.json @@ -533,7 +533,7 @@ } } }, - "revision": "20220926", + "revision": "20230116", "rootUrl": "https://streetviewpublish.googleapis.com/", "schemas": { "BatchDeletePhotosRequest": { @@ -808,6 +808,33 @@ }, "type": "object" }, + "NoOverlapGpsFailureDetails": { + "description": "Details related to PhotoSequenceProcessingFailureReason#NO_OVERLAP_GPS.", + "id": "NoOverlapGpsFailureDetails", + "properties": { + "gpsEndTime": { + "description": "Time of last recorded GPS point.", + "format": "google-datetime", + "type": "string" + }, + "gpsStartTime": { + "description": "Time of first recorded GPS point.", + "format": "google-datetime", + "type": "string" + }, + "videoEndTime": { + "description": "End time of video.", + "format": "google-datetime", + "type": "string" + }, + "videoStartTime": { + "description": "Start time of video.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, "NotOutdoorsFailureDetails": { "description": "Details related to ProcessingFailureReason#NOT_OUTDOORS. If there are multiple indoor frames found, the first frame is recorded here.", "id": "NotOutdoorsFailureDetails", @@ -1228,6 +1255,10 @@ "$ref": "InsufficientGpsFailureDetails", "description": "See InsufficientGpsFailureDetails." }, + "noOverlapGpsDetails": { + "$ref": "NoOverlapGpsFailureDetails", + "description": "See NoOverlapGpsFailureDetails." + }, "notOutdoorsDetails": { "$ref": "NotOutdoorsFailureDetails", "description": "See NotOutdoorsFailureDetails." diff --git a/streetviewpublish/v1/streetviewpublish-gen.go b/streetviewpublish/v1/streetviewpublish-gen.go index 05f3c06b07d..29f372c697f 100644 --- a/streetviewpublish/v1/streetviewpublish-gen.go +++ b/streetviewpublish/v1/streetviewpublish-gen.go @@ -791,6 +791,44 @@ func (s *Measurement3d) UnmarshalJSON(data []byte) error { return nil } +// NoOverlapGpsFailureDetails: Details related to +// PhotoSequenceProcessingFailureReason#NO_OVERLAP_GPS. +type NoOverlapGpsFailureDetails struct { + // GpsEndTime: Time of last recorded GPS point. + GpsEndTime string `json:"gpsEndTime,omitempty"` + + // GpsStartTime: Time of first recorded GPS point. + GpsStartTime string `json:"gpsStartTime,omitempty"` + + // VideoEndTime: End time of video. + VideoEndTime string `json:"videoEndTime,omitempty"` + + // VideoStartTime: Start time of video. + VideoStartTime string `json:"videoStartTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "GpsEndTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "GpsEndTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *NoOverlapGpsFailureDetails) MarshalJSON() ([]byte, error) { + type NoMethod NoOverlapGpsFailureDetails + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // NotOutdoorsFailureDetails: Details related to // ProcessingFailureReason#NOT_OUTDOORS. If there are multiple indoor // frames found, the first frame is recorded here. @@ -1359,6 +1397,9 @@ type ProcessingFailureDetails struct { // InsufficientGpsDetails: See InsufficientGpsFailureDetails. InsufficientGpsDetails *InsufficientGpsFailureDetails `json:"insufficientGpsDetails,omitempty"` + // NoOverlapGpsDetails: See NoOverlapGpsFailureDetails. + NoOverlapGpsDetails *NoOverlapGpsFailureDetails `json:"noOverlapGpsDetails,omitempty"` + // NotOutdoorsDetails: See NotOutdoorsFailureDetails. NotOutdoorsDetails *NotOutdoorsFailureDetails `json:"notOutdoorsDetails,omitempty"` diff --git a/tpu/v2/tpu-api.json b/tpu/v2/tpu-api.json index 83becb9520a..e3b2c55b38d 100644 --- a/tpu/v2/tpu-api.json +++ b/tpu/v2/tpu-api.json @@ -473,7 +473,7 @@ ], "parameters": { "name": { - "description": "The resource name.", + "description": "Required. The resource name.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/nodes/[^/]+$", "required": true, @@ -501,7 +501,7 @@ ], "parameters": { "name": { - "description": "The resource name.", + "description": "Required. The resource name.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/nodes/[^/]+$", "required": true, @@ -721,7 +721,7 @@ } } }, - "revision": "20221004", + "revision": "20230105", "rootUrl": "https://tpu.googleapis.com/", "schemas": { "AcceleratorType": { diff --git a/tpu/v2/tpu-gen.go b/tpu/v2/tpu-gen.go index ce63b5b6f86..5a0bf98abc9 100644 --- a/tpu/v2/tpu-gen.go +++ b/tpu/v2/tpu-gen.go @@ -3254,7 +3254,7 @@ func (c *ProjectsLocationsNodesStartCall) Do(opts ...googleapi.CallOption) (*Ope // ], // "parameters": { // "name": { - // "description": "The resource name.", + // "description": "Required. The resource name.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/nodes/[^/]+$", // "required": true, @@ -3397,7 +3397,7 @@ func (c *ProjectsLocationsNodesStopCall) Do(opts ...googleapi.CallOption) (*Oper // ], // "parameters": { // "name": { - // "description": "The resource name.", + // "description": "Required. The resource name.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/nodes/[^/]+$", // "required": true,