diff --git a/api-list.json b/api-list.json index 06649df7f0f..a433ccd96ad 100644 --- a/api-list.json +++ b/api-list.json @@ -841,6 +841,21 @@ "documentationLink": "https://cloud.google.com/bigquery/", "preferred": true }, + { + "kind": "discovery#directoryItem", + "id": "bigquerydatapolicy:v1", + "name": "bigquerydatapolicy", + "version": "v1", + "title": "BigQuery Data Policy API", + "description": "Allows users to manage BigQuery data policies.", + "discoveryRestUrl": "https://bigquerydatapolicy.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/bigquery/docs/column-data-masking", + "preferred": true + }, { "kind": "discovery#directoryItem", "id": "bigquerydatatransfer:v1", diff --git a/bigquerydatapolicy/v1/bigquerydatapolicy-api.json b/bigquerydatapolicy/v1/bigquerydatapolicy-api.json new file mode 100644 index 00000000000..404f95110e8 --- /dev/null +++ b/bigquerydatapolicy/v1/bigquerydatapolicy-api.json @@ -0,0 +1,705 @@ +{ + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/bigquery": { + "description": "View and manage your data in Google BigQuery and see the email address for your Google Account" + }, + "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://bigquerydatapolicy.googleapis.com/", + "batchPath": "batch", + "canonicalName": "BigQuery DataPolicy Service", + "description": "Allows users to manage BigQuery data policies.", + "discoveryVersion": "v1", + "documentationLink": "https://cloud.google.com/bigquery/docs/column-data-masking", + "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": "bigquerydatapolicy:v1", + "kind": "discovery#restDescription", + "mtlsRootUrl": "https://bigquerydatapolicy.mtls.googleapis.com/", + "name": "bigquerydatapolicy", + "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": { + "projects": { + "resources": { + "locations": { + "resources": { + "dataPolicies": { + "methods": { + "create": { + "description": "Creates a new data policy under a project with the given `dataPolicyId` (used as the display name), policy tag, and data policy type.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/dataPolicies", + "httpMethod": "POST", + "id": "bigquerydatapolicy.projects.locations.dataPolicies.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. Resource name of the project that the data policy will belong to. The format is `projects/{project_number}/locations/{location_id}`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/dataPolicies", + "request": { + "$ref": "DataPolicy" + }, + "response": { + "$ref": "DataPolicy" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Deletes the data policy specified by its resource name.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/dataPolicies/{dataPoliciesId}", + "httpMethod": "DELETE", + "id": "bigquerydatapolicy.projects.locations.dataPolicies.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Resource name of the data policy to delete. Format is `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataPolicies/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets the data policy specified by its resource name.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/dataPolicies/{dataPoliciesId}", + "httpMethod": "GET", + "id": "bigquerydatapolicy.projects.locations.dataPolicies.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Resource name of the requested data policy. Format is `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataPolicies/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "DataPolicy" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "getIamPolicy": { + "description": "Gets the IAM policy for the specified data policy.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/dataPolicies/{dataPoliciesId}:getIamPolicy", + "httpMethod": "POST", + "id": "bigquerydatapolicy.projects.locations.dataPolicies.getIamPolicy", + "parameterOrder": [ + "resource" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataPolicies/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+resource}:getIamPolicy", + "request": { + "$ref": "GetIamPolicyRequest" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "List all of the data policies in the specified parent project.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/dataPolicies", + "httpMethod": "GET", + "id": "bigquerydatapolicy.projects.locations.dataPolicies.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "filter": { + "description": "Filters the data policies by policy tags that they are associated with. Currently filter only supports \"policy_tag\" based filtering and OR based predicates. Sample filter can be \"policy_tag: projects/1/locations/us/taxonomies/2/policyTags/3\". You may also use wildcard such as \"policy_tag: projects/1/locations/us/taxonomies/2*\". Please note that OR predicates cannot be used with wildcard filters.", + "location": "query", + "type": "string" + }, + "pageSize": { + "description": "The maximum number of data policies to return. Must be a value between 1 and 1000. If not set, defaults to 50.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "The `nextPageToken` value returned from a previous list request, if any. If not set, defaults to an empty string.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Resource name of the project for which to list data policies. Format is `projects/{project_number}/locations/{location_id}`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/dataPolicies", + "response": { + "$ref": "ListDataPoliciesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "patch": { + "description": "Updates the metadata for an existing data policy. The target data policy can be specified by the resource name.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/dataPolicies/{dataPoliciesId}", + "httpMethod": "PATCH", + "id": "bigquerydatapolicy.projects.locations.dataPolicies.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Output only. Resource name of this data policy, in the format of `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataPolicies/[^/]+$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "The update mask applies to the resource. For the `FieldMask` definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask If not set, defaults to all of the fields that are allowed to update. Updates to the `name` and `dataPolicyId` fields are not allowed.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "v1/{+name}", + "request": { + "$ref": "DataPolicy" + }, + "response": { + "$ref": "DataPolicy" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "rename": { + "description": "Renames the id (display name) of the specified data policy.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/dataPolicies/{dataPoliciesId}:rename", + "httpMethod": "POST", + "id": "bigquerydatapolicy.projects.locations.dataPolicies.rename", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Resource name of the data policy to rename. The format is `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataPolicies/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}:rename", + "request": { + "$ref": "RenameDataPolicyRequest" + }, + "response": { + "$ref": "DataPolicy" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "setIamPolicy": { + "description": "Sets the IAM policy for the specified data policy.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/dataPolicies/{dataPoliciesId}:setIamPolicy", + "httpMethod": "POST", + "id": "bigquerydatapolicy.projects.locations.dataPolicies.setIamPolicy", + "parameterOrder": [ + "resource" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataPolicies/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+resource}:setIamPolicy", + "request": { + "$ref": "SetIamPolicyRequest" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "testIamPermissions": { + "description": "Returns the caller's permission on the specified data policy resource.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/dataPolicies/{dataPoliciesId}:testIamPermissions", + "httpMethod": "POST", + "id": "bigquerydatapolicy.projects.locations.dataPolicies.testIamPermissions", + "parameterOrder": [ + "resource" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataPolicies/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+resource}:testIamPermissions", + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + } + } + } + }, + "revision": "20231016", + "rootUrl": "https://bigquerydatapolicy.googleapis.com/", + "schemas": { + "AuditConfig": { + "description": "Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs. If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted. Example Policy with multiple AuditConfigs: { \"audit_configs\": [ { \"service\": \"allServices\", \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\", \"exempted_members\": [ \"user:jose@example.com\" ] }, { \"log_type\": \"DATA_WRITE\" }, { \"log_type\": \"ADMIN_READ\" } ] }, { \"service\": \"sampleservice.googleapis.com\", \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\" }, { \"log_type\": \"DATA_WRITE\", \"exempted_members\": [ \"user:aliya@example.com\" ] } ] } ] } For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts `jose@example.com` from DATA_READ logging, and `aliya@example.com` from DATA_WRITE logging.", + "id": "AuditConfig", + "properties": { + "auditLogConfigs": { + "description": "The configuration for logging of each type of permission.", + "items": { + "$ref": "AuditLogConfig" + }, + "type": "array" + }, + "service": { + "description": "Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services.", + "type": "string" + } + }, + "type": "object" + }, + "AuditLogConfig": { + "description": "Provides the configuration for logging a type of permissions. Example: { \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\", \"exempted_members\": [ \"user:jose@example.com\" ] }, { \"log_type\": \"DATA_WRITE\" } ] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ logging.", + "id": "AuditLogConfig", + "properties": { + "exemptedMembers": { + "description": "Specifies the identities that do not cause logging for this type of permission. Follows the same format of Binding.members.", + "items": { + "type": "string" + }, + "type": "array" + }, + "logType": { + "description": "The log type that this config enables.", + "enum": [ + "LOG_TYPE_UNSPECIFIED", + "ADMIN_READ", + "DATA_WRITE", + "DATA_READ" + ], + "enumDescriptions": [ + "Default case. Should never be this.", + "Admin reads. Example: CloudIAM getIamPolicy", + "Data writes. Example: CloudSQL Users create", + "Data reads. Example: CloudSQL Users list" + ], + "type": "string" + } + }, + "type": "object" + }, + "Binding": { + "description": "Associates `members`, or principals, with a `role`.", + "id": "Binding", + "properties": { + "condition": { + "$ref": "Expr", + "description": "The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies)." + }, + "members": { + "description": "Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding.", + "items": { + "type": "string" + }, + "type": "array" + }, + "role": { + "description": "Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.", + "type": "string" + } + }, + "type": "object" + }, + "DataMaskingPolicy": { + "description": "The data masking policy that is used to specify data masking rule.", + "id": "DataMaskingPolicy", + "properties": { + "predefinedExpression": { + "description": "A predefined masking expression.", + "enum": [ + "PREDEFINED_EXPRESSION_UNSPECIFIED", + "SHA256", + "ALWAYS_NULL", + "DEFAULT_MASKING_VALUE", + "LAST_FOUR_CHARACTERS", + "FIRST_FOUR_CHARACTERS", + "EMAIL_MASK", + "DATE_YEAR_MASK" + ], + "enumDescriptions": [ + "Default, unspecified predefined expression. No masking will take place since no expression is specified.", + "Masking expression to replace data with SHA-256 hash.", + "Masking expression to replace data with NULLs.", + "Masking expression to replace data with their default masking values. The default masking values for each type listed as below: * STRING: \"\" * BYTES: b'' * INTEGER: 0 * FLOAT: 0.0 * NUMERIC: 0 * BOOLEAN: FALSE * TIMESTAMP: 1970-01-01 00:00:00 UTC * DATE: 1970-01-01 * TIME: 00:00:00 * DATETIME: 1970-01-01T00:00:00 * GEOGRAPHY: POINT(0 0) * BIGNUMERIC: 0 * ARRAY: [] * STRUCT: NOT_APPLICABLE * JSON: NULL", + "Masking expression shows the last four characters of text. The masking behavior is as follows: * If text length \u003e 4 characters: Replace text with XXXXX, append last four characters of original text. * If text length \u003c= 4 characters: Apply SHA-256 hash.", + "Masking expression shows the first four characters of text. The masking behavior is as follows: * If text length \u003e 4 characters: Replace text with XXXXX, prepend first four characters of original text. * If text length \u003c= 4 characters: Apply SHA-256 hash.", + "Masking expression for email addresses. The masking behavior is as follows: * Syntax-valid email address: Replace username with XXXXX. For example, cloudysanfrancisco@gmail.com becomes XXXXX@gmail.com. * Syntax-invalid email address: Apply SHA-256 hash. For more information, see Email mask.", + "Masking expression to only show the *year* of `Date`, `DateTime` and `TimeStamp`. For example, with the year 2076: * DATE : 2076-01-01 * DATETIME : 2076-01-01T00:00:00 * TIMESTAMP : 2076-01-01 00:00:00 UTC Truncation occurs according to the UTC time zone. To change this, adjust the default time zone using the `time_zone` system variable. For more information, see the System variables reference." + ], + "type": "string" + }, + "routine": { + "description": "The name of the BigQuery routine that contains the custom masking routine, in the format of `projects/{project_number}/datasets/{dataset_id}/routines/{routine_id}`.", + "type": "string" + } + }, + "type": "object" + }, + "DataPolicy": { + "description": "Represents the label-policy binding.", + "id": "DataPolicy", + "properties": { + "dataMaskingPolicy": { + "$ref": "DataMaskingPolicy", + "description": "The data masking policy that specifies the data masking rule to use." + }, + "dataPolicyId": { + "description": "User-assigned (human readable) ID of the data policy that needs to be unique within a project. Used as {data_policy_id} in part of the resource name.", + "type": "string" + }, + "dataPolicyType": { + "description": "Type of data policy.", + "enum": [ + "DATA_POLICY_TYPE_UNSPECIFIED", + "COLUMN_LEVEL_SECURITY_POLICY", + "DATA_MASKING_POLICY" + ], + "enumDescriptions": [ + "Default value for the data policy type. This should not be used.", + "Used to create a data policy for column-level security, without data masking.", + "Used to create a data policy for data masking." + ], + "type": "string" + }, + "name": { + "description": "Output only. Resource name of this data policy, in the format of `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`.", + "readOnly": true, + "type": "string" + }, + "policyTag": { + "description": "Policy tag resource name, in the format of `projects/{project_number}/locations/{location_id}/taxonomies/{taxonomy_id}/policyTags/{policyTag_id}`.", + "type": "string" + } + }, + "type": "object" + }, + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }", + "id": "Empty", + "properties": {}, + "type": "object" + }, + "Expr": { + "description": "Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: \"Summary size limit\" description: \"Determines if a summary is less than 100 chars\" expression: \"document.summary.size() \u003c 100\" Example (Equality): title: \"Requestor is owner\" description: \"Determines if requestor is the document owner\" expression: \"document.owner == request.auth.claims.email\" Example (Logic): title: \"Public documents\" description: \"Determine whether the document should be publicly visible\" expression: \"document.type != 'private' \u0026\u0026 document.type != 'internal'\" Example (Data Manipulation): title: \"Notification string\" description: \"Create a notification string with a timestamp.\" expression: \"'New message received at ' + string(document.create_time)\" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.", + "id": "Expr", + "properties": { + "description": { + "description": "Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.", + "type": "string" + }, + "expression": { + "description": "Textual representation of an expression in Common Expression Language syntax.", + "type": "string" + }, + "location": { + "description": "Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.", + "type": "string" + }, + "title": { + "description": "Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.", + "type": "string" + } + }, + "type": "object" + }, + "GetIamPolicyRequest": { + "description": "Request message for `GetIamPolicy` method.", + "id": "GetIamPolicyRequest", + "properties": { + "options": { + "$ref": "GetPolicyOptions", + "description": "OPTIONAL: A `GetPolicyOptions` object for specifying options to `GetIamPolicy`." + } + }, + "type": "object" + }, + "GetPolicyOptions": { + "description": "Encapsulates settings provided to GetIamPolicy.", + "id": "GetPolicyOptions", + "properties": { + "requestedPolicyVersion": { + "description": "Optional. The maximum policy version that will be used to format the policy. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional role bindings must specify version 3. Policies with no conditional role bindings may specify any valid value or leave the field unset. The policy in the response might use the policy version that you specified, or it might use a lower policy version. For example, if you specify version 3, but the policy has no conditional role bindings, the response uses version 1. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).", + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, + "ListDataPoliciesResponse": { + "description": "Response message for the ListDataPolicies method.", + "id": "ListDataPoliciesResponse", + "properties": { + "dataPolicies": { + "description": "Data policies that belong to the requested project.", + "items": { + "$ref": "DataPolicy" + }, + "type": "array" + }, + "nextPageToken": { + "description": "Token used to retrieve the next page of results, or empty if there are no more results.", + "type": "string" + } + }, + "type": "object" + }, + "Policy": { + "description": "An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. A `Policy` is a collection of `bindings`. A `binding` binds one or more `members`, or principals, to a single `role`. Principals can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role. For some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** ``` { \"bindings\": [ { \"role\": \"roles/resourcemanager.organizationAdmin\", \"members\": [ \"user:mike@example.com\", \"group:admins@example.com\", \"domain:google.com\", \"serviceAccount:my-project-id@appspot.gserviceaccount.com\" ] }, { \"role\": \"roles/resourcemanager.organizationViewer\", \"members\": [ \"user:eve@example.com\" ], \"condition\": { \"title\": \"expirable access\", \"description\": \"Does not grant access after Sep 2020\", \"expression\": \"request.time \u003c timestamp('2020-10-01T00:00:00.000Z')\", } } ], \"etag\": \"BwWWja0YfJA=\", \"version\": 3 } ``` **YAML example:** ``` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time \u003c timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).", + "id": "Policy", + "properties": { + "auditConfigs": { + "description": "Specifies cloud audit logging configuration for this policy.", + "items": { + "$ref": "AuditConfig" + }, + "type": "array" + }, + "bindings": { + "description": "Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`.", + "items": { + "$ref": "Binding" + }, + "type": "array" + }, + "etag": { + "description": "`etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.", + "format": "byte", + "type": "string" + }, + "version": { + "description": "Specifies the format of the policy. Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected. Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations: * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).", + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, + "RenameDataPolicyRequest": { + "description": "Request message for the RenameDataPolicy method.", + "id": "RenameDataPolicyRequest", + "properties": { + "newDataPolicyId": { + "description": "Required. The new data policy id.", + "type": "string" + } + }, + "type": "object" + }, + "SetIamPolicyRequest": { + "description": "Request message for `SetIamPolicy` method.", + "id": "SetIamPolicyRequest", + "properties": { + "policy": { + "$ref": "Policy", + "description": "REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Google Cloud services (such as Projects) might reject them." + }, + "updateMask": { + "description": "OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only the fields in the mask will be modified. If no mask is provided, the following default mask is used: `paths: \"bindings, etag\"`", + "format": "google-fieldmask", + "type": "string" + } + }, + "type": "object" + }, + "TestIamPermissionsRequest": { + "description": "Request message for `TestIamPermissions` method.", + "id": "TestIamPermissionsRequest", + "properties": { + "permissions": { + "description": "The set of permissions to check for the `resource`. Permissions with wildcards (such as `*` or `storage.*`) are not allowed. For more information see [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "TestIamPermissionsResponse": { + "description": "Response message for `TestIamPermissions` method.", + "id": "TestIamPermissionsResponse", + "properties": { + "permissions": { + "description": "A subset of `TestPermissionsRequest.permissions` that the caller is allowed.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "servicePath": "", + "title": "BigQuery Data Policy API", + "version": "v1", + "version_module": true +} \ No newline at end of file diff --git a/bigquerydatapolicy/v1/bigquerydatapolicy-gen.go b/bigquerydatapolicy/v1/bigquerydatapolicy-gen.go new file mode 100644 index 00000000000..b04e6632a67 --- /dev/null +++ b/bigquerydatapolicy/v1/bigquerydatapolicy-gen.go @@ -0,0 +1,2317 @@ +// 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 bigquerydatapolicy provides access to the BigQuery Data Policy API. +// +// For product documentation, see: https://cloud.google.com/bigquery/docs/column-data-masking +// +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// +// # Creating a client +// +// Usage example: +// +// import "google.golang.org/api/bigquerydatapolicy/v1" +// ... +// ctx := context.Background() +// bigquerydatapolicyService, err := bigquerydatapolicy.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 +// +// By default, all available scopes (see "Constants") are used to authenticate. +// To restrict scopes, use [google.golang.org/api/option.WithScopes]: +// +// bigquerydatapolicyService, err := bigquerydatapolicy.NewService(ctx, option.WithScopes(bigquerydatapolicy.CloudPlatformScope)) +// +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: +// +// bigquerydatapolicyService, err := bigquerydatapolicy.NewService(ctx, option.WithAPIKey("AIza...")) +// +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: +// +// config := &oauth2.Config{...} +// // ... +// token, err := config.Exchange(ctx, ...) +// bigquerydatapolicyService, err := bigquerydatapolicy.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) +// +// See [google.golang.org/api/option.ClientOption] for details on options. +package bigquerydatapolicy // import "google.golang.org/api/bigquerydatapolicy/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 +var _ = internal.Version + +const apiId = "bigquerydatapolicy:v1" +const apiName = "bigquerydatapolicy" +const apiVersion = "v1" +const basePath = "https://bigquerydatapolicy.googleapis.com/" +const mtlsBasePath = "https://bigquerydatapolicy.mtls.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your data in Google BigQuery and see the email + // address for your Google Account + BigqueryScope = "https://www.googleapis.com/auth/bigquery" + + // 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/bigquery", + "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.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 + + Projects *ProjectsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewProjectsService(s *Service) *ProjectsService { + rs := &ProjectsService{s: s} + rs.Locations = NewProjectsLocationsService(s) + return rs +} + +type ProjectsService struct { + s *Service + + Locations *ProjectsLocationsService +} + +func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { + rs := &ProjectsLocationsService{s: s} + rs.DataPolicies = NewProjectsLocationsDataPoliciesService(s) + return rs +} + +type ProjectsLocationsService struct { + s *Service + + DataPolicies *ProjectsLocationsDataPoliciesService +} + +func NewProjectsLocationsDataPoliciesService(s *Service) *ProjectsLocationsDataPoliciesService { + rs := &ProjectsLocationsDataPoliciesService{s: s} + return rs +} + +type ProjectsLocationsDataPoliciesService struct { + s *Service +} + +// AuditConfig: Specifies the audit configuration for a service. The +// configuration determines which permission types are logged, and what +// identities, if any, are exempted from logging. An AuditConfig must +// have one or more AuditLogConfigs. If there are AuditConfigs for both +// `allServices` and a specific service, the union of the two +// AuditConfigs is used for that service: the log_types specified in +// each AuditConfig are enabled, and the exempted_members in each +// AuditLogConfig are exempted. Example Policy with multiple +// AuditConfigs: { "audit_configs": [ { "service": "allServices", +// "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": +// [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { +// "log_type": "ADMIN_READ" } ] }, { "service": +// "sampleservice.googleapis.com", "audit_log_configs": [ { "log_type": +// "DATA_READ" }, { "log_type": "DATA_WRITE", "exempted_members": [ +// "user:aliya@example.com" ] } ] } ] } For sampleservice, this policy +// enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts +// `jose@example.com` from DATA_READ logging, and `aliya@example.com` +// from DATA_WRITE logging. +type AuditConfig struct { + // AuditLogConfigs: The configuration for logging of each type of + // permission. + AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"` + + // Service: Specifies a service that will be enabled for audit logging. + // For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + // `allServices` is a special value that covers all services. + Service string `json:"service,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") 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. "AuditLogConfigs") 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 *AuditConfig) MarshalJSON() ([]byte, error) { + type NoMethod AuditConfig + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// AuditLogConfig: Provides the configuration for logging a type of +// permissions. Example: { "audit_log_configs": [ { "log_type": +// "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { +// "log_type": "DATA_WRITE" } ] } This enables 'DATA_READ' and +// 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ +// logging. +type AuditLogConfig struct { + // ExemptedMembers: Specifies the identities that do not cause logging + // for this type of permission. Follows the same format of + // Binding.members. + ExemptedMembers []string `json:"exemptedMembers,omitempty"` + + // LogType: The log type that this config enables. + // + // Possible values: + // "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this. + // "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy + // "DATA_WRITE" - Data writes. Example: CloudSQL Users create + // "DATA_READ" - Data reads. Example: CloudSQL Users list + LogType string `json:"logType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ExemptedMembers") 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. "ExemptedMembers") 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 *AuditLogConfig) MarshalJSON() ([]byte, error) { + type NoMethod AuditLogConfig + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// Binding: Associates `members`, or principals, with a `role`. +type Binding struct { + // Condition: The condition that is associated with this binding. If the + // condition evaluates to `true`, then this binding applies to the + // current request. If the condition evaluates to `false`, then this + // binding does not apply to the current request. However, a different + // role binding might grant the same role to one or more of the + // principals in this binding. To learn which resources support + // conditions in their IAM policies, see the IAM documentation + // (https://cloud.google.com/iam/help/conditions/resource-policies). + Condition *Expr `json:"condition,omitempty"` + + // Members: Specifies the principals requesting access for a Google + // Cloud resource. `members` can have the following values: * + // `allUsers`: A special identifier that represents anyone who is on the + // internet; with or without a Google account. * + // `allAuthenticatedUsers`: A special identifier that represents anyone + // who is authenticated with a Google account or a service account. Does + // not include identities that come from external identity providers + // (IdPs) through identity federation. * `user:{emailid}`: An email + // address that represents a specific Google account. For example, + // `alice@example.com` . * `serviceAccount:{emailid}`: An email address + // that represents a Google service account. For example, + // `my-other-app@appspot.gserviceaccount.com`. * + // `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: + // An identifier for a Kubernetes service account + // (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). + // For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. + // * `group:{emailid}`: An email address that represents a Google group. + // For example, `admins@example.com`. * `domain:{domain}`: The G Suite + // domain (primary) that represents all the users of that domain. For + // example, `google.com` or `example.com`. * + // `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus + // unique identifier) representing a user that has been recently + // deleted. For example, `alice@example.com?uid=123456789012345678901`. + // If the user is recovered, this value reverts to `user:{emailid}` and + // the recovered user retains the role in the binding. * + // `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address + // (plus unique identifier) representing a service account that has been + // recently deleted. For example, + // `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + // If the service account is undeleted, this value reverts to + // `serviceAccount:{emailid}` and the undeleted service account retains + // the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: + // An email address (plus unique identifier) representing a Google group + // that has been recently deleted. For example, + // `admins@example.com?uid=123456789012345678901`. If the group is + // recovered, this value reverts to `group:{emailid}` and the recovered + // group retains the role in the binding. + Members []string `json:"members,omitempty"` + + // Role: Role that is assigned to the list of `members`, or principals. + // For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + Role string `json:"role,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Condition") 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. "Condition") 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 *Binding) MarshalJSON() ([]byte, error) { + type NoMethod Binding + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// DataMaskingPolicy: The data masking policy that is used to specify +// data masking rule. +type DataMaskingPolicy struct { + // PredefinedExpression: A predefined masking expression. + // + // Possible values: + // "PREDEFINED_EXPRESSION_UNSPECIFIED" - Default, unspecified + // predefined expression. No masking will take place since no expression + // is specified. + // "SHA256" - Masking expression to replace data with SHA-256 hash. + // "ALWAYS_NULL" - Masking expression to replace data with NULLs. + // "DEFAULT_MASKING_VALUE" - Masking expression to replace data with + // their default masking values. The default masking values for each + // type listed as below: * STRING: "" * BYTES: b'' * INTEGER: 0 * FLOAT: + // 0.0 * NUMERIC: 0 * BOOLEAN: FALSE * TIMESTAMP: 1970-01-01 00:00:00 + // UTC * DATE: 1970-01-01 * TIME: 00:00:00 * DATETIME: + // 1970-01-01T00:00:00 * GEOGRAPHY: POINT(0 0) * BIGNUMERIC: 0 * ARRAY: + // [] * STRUCT: NOT_APPLICABLE * JSON: NULL + // "LAST_FOUR_CHARACTERS" - Masking expression shows the last four + // characters of text. The masking behavior is as follows: * If text + // length > 4 characters: Replace text with XXXXX, append last four + // characters of original text. * If text length <= 4 characters: Apply + // SHA-256 hash. + // "FIRST_FOUR_CHARACTERS" - Masking expression shows the first four + // characters of text. The masking behavior is as follows: * If text + // length > 4 characters: Replace text with XXXXX, prepend first four + // characters of original text. * If text length <= 4 characters: Apply + // SHA-256 hash. + // "EMAIL_MASK" - Masking expression for email addresses. The masking + // behavior is as follows: * Syntax-valid email address: Replace + // username with XXXXX. For example, cloudysanfrancisco@gmail.com + // becomes XXXXX@gmail.com. * Syntax-invalid email address: Apply + // SHA-256 hash. For more information, see Email mask. + // "DATE_YEAR_MASK" - Masking expression to only show the *year* of + // `Date`, `DateTime` and `TimeStamp`. For example, with the year 2076: + // * DATE : 2076-01-01 * DATETIME : 2076-01-01T00:00:00 * TIMESTAMP : + // 2076-01-01 00:00:00 UTC Truncation occurs according to the UTC time + // zone. To change this, adjust the default time zone using the + // `time_zone` system variable. For more information, see the System + // variables reference. + PredefinedExpression string `json:"predefinedExpression,omitempty"` + + // Routine: The name of the BigQuery routine that contains the custom + // masking routine, in the format of + // `projects/{project_number}/datasets/{dataset_id}/routines/{routine_id} + // `. + Routine string `json:"routine,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "PredefinedExpression") 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. "PredefinedExpression") 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 *DataMaskingPolicy) MarshalJSON() ([]byte, error) { + type NoMethod DataMaskingPolicy + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// DataPolicy: Represents the label-policy binding. +type DataPolicy struct { + // DataMaskingPolicy: The data masking policy that specifies the data + // masking rule to use. + DataMaskingPolicy *DataMaskingPolicy `json:"dataMaskingPolicy,omitempty"` + + // DataPolicyId: User-assigned (human readable) ID of the data policy + // that needs to be unique within a project. Used as {data_policy_id} in + // part of the resource name. + DataPolicyId string `json:"dataPolicyId,omitempty"` + + // DataPolicyType: Type of data policy. + // + // Possible values: + // "DATA_POLICY_TYPE_UNSPECIFIED" - Default value for the data policy + // type. This should not be used. + // "COLUMN_LEVEL_SECURITY_POLICY" - Used to create a data policy for + // column-level security, without data masking. + // "DATA_MASKING_POLICY" - Used to create a data policy for data + // masking. + DataPolicyType string `json:"dataPolicyType,omitempty"` + + // Name: Output only. Resource name of this data policy, in the format + // of + // `projects/{project_number}/locations/{location_id}/dataPolicies/{data_ + // policy_id}`. + Name string `json:"name,omitempty"` + + // PolicyTag: Policy tag resource name, in the format of + // `projects/{project_number}/locations/{location_id}/taxonomies/{taxonom + // y_id}/policyTags/{policyTag_id}`. + PolicyTag string `json:"policyTag,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DataMaskingPolicy") + // 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. "DataMaskingPolicy") 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 *DataPolicy) MarshalJSON() ([]byte, error) { + type NoMethod DataPolicy + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// Empty: A generic empty message that you can re-use to avoid defining +// duplicated empty messages in your APIs. A typical example is to use +// it as the request or the response type of an API method. For +// instance: service Foo { rpc Bar(google.protobuf.Empty) returns +// (google.protobuf.Empty); } +type Empty struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// Expr: Represents a textual expression in the Common Expression +// Language (CEL) syntax. CEL is a C-like expression language. The +// syntax and semantics of CEL are documented at +// https://github.com/google/cel-spec. Example (Comparison): title: +// "Summary size limit" description: "Determines if a summary is less +// than 100 chars" expression: "document.summary.size() < 100" Example +// (Equality): title: "Requestor is owner" description: "Determines if +// requestor is the document owner" expression: "document.owner == +// request.auth.claims.email" Example (Logic): title: "Public documents" +// description: "Determine whether the document should be publicly +// visible" expression: "document.type != 'private' && document.type != +// 'internal'" Example (Data Manipulation): title: "Notification string" +// description: "Create a notification string with a timestamp." +// expression: "'New message received at ' + +// string(document.create_time)" The exact variables and functions that +// may be referenced within an expression are determined by the service +// that evaluates it. See the service documentation for additional +// information. +type Expr struct { + // Description: Optional. Description of the expression. This is a + // longer text which describes the expression, e.g. when hovered over it + // in a UI. + Description string `json:"description,omitempty"` + + // Expression: Textual representation of an expression in Common + // Expression Language syntax. + Expression string `json:"expression,omitempty"` + + // Location: Optional. String indicating the location of the expression + // for error reporting, e.g. a file name and a position in the file. + Location string `json:"location,omitempty"` + + // Title: Optional. Title for the expression, i.e. a short string + // describing its purpose. This can be used e.g. in UIs which allow to + // enter the expression. + Title string `json:"title,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Description") 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. "Description") 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 *Expr) MarshalJSON() ([]byte, error) { + type NoMethod Expr + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GetIamPolicyRequest: Request message for `GetIamPolicy` method. +type GetIamPolicyRequest struct { + // Options: OPTIONAL: A `GetPolicyOptions` object for specifying options + // to `GetIamPolicy`. + Options *GetPolicyOptions `json:"options,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Options") 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. "Options") 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 *GetIamPolicyRequest) MarshalJSON() ([]byte, error) { + type NoMethod GetIamPolicyRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GetPolicyOptions: Encapsulates settings provided to GetIamPolicy. +type GetPolicyOptions struct { + // RequestedPolicyVersion: Optional. The maximum policy version that + // will be used to format the policy. Valid values are 0, 1, and 3. + // Requests specifying an invalid value will be rejected. Requests for + // policies with any conditional role bindings must specify version 3. + // Policies with no conditional role bindings may specify any valid + // value or leave the field unset. The policy in the response might use + // the policy version that you specified, or it might use a lower policy + // version. For example, if you specify version 3, but the policy has no + // conditional role bindings, the response uses version 1. To learn + // which resources support conditions in their IAM policies, see the IAM + // documentation + // (https://cloud.google.com/iam/help/conditions/resource-policies). + RequestedPolicyVersion int64 `json:"requestedPolicyVersion,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "RequestedPolicyVersion") 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. "RequestedPolicyVersion") + // 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 *GetPolicyOptions) MarshalJSON() ([]byte, error) { + type NoMethod GetPolicyOptions + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ListDataPoliciesResponse: Response message for the ListDataPolicies +// method. +type ListDataPoliciesResponse struct { + // DataPolicies: Data policies that belong to the requested project. + DataPolicies []*DataPolicy `json:"dataPolicies,omitempty"` + + // NextPageToken: Token used to retrieve the next page of results, or + // empty if there are no more results. + 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. "DataPolicies") 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. "DataPolicies") 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 *ListDataPoliciesResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListDataPoliciesResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// Policy: An Identity and Access Management (IAM) policy, which +// specifies access controls for Google Cloud resources. A `Policy` is a +// collection of `bindings`. A `binding` binds one or more `members`, or +// principals, to a single `role`. Principals can be user accounts, +// service accounts, Google groups, and domains (such as G Suite). A +// `role` is a named list of permissions; each `role` can be an IAM +// predefined role or a user-created custom role. For some types of +// Google Cloud resources, a `binding` can also specify a `condition`, +// which is a logical expression that allows access to a resource only +// if the expression evaluates to `true`. A condition can add +// constraints based on attributes of the request, the resource, or +// both. To learn which resources support conditions in their IAM +// policies, see the IAM documentation +// (https://cloud.google.com/iam/help/conditions/resource-policies). +// **JSON example:** ``` { "bindings": [ { "role": +// "roles/resourcemanager.organizationAdmin", "members": [ +// "user:mike@example.com", "group:admins@example.com", +// "domain:google.com", +// "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { +// "role": "roles/resourcemanager.organizationViewer", "members": [ +// "user:eve@example.com" ], "condition": { "title": "expirable access", +// "description": "Does not grant access after Sep 2020", "expression": +// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], +// "etag": "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` +// bindings: - members: - user:mike@example.com - +// group:admins@example.com - domain:google.com - +// serviceAccount:my-project-id@appspot.gserviceaccount.com role: +// roles/resourcemanager.organizationAdmin - members: - +// user:eve@example.com role: roles/resourcemanager.organizationViewer +// condition: title: expirable access description: Does not grant access +// after Sep 2020 expression: request.time < +// timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 +// ``` For a description of IAM and its features, see the IAM +// documentation (https://cloud.google.com/iam/docs/). +type Policy struct { + // AuditConfigs: Specifies cloud audit logging configuration for this + // policy. + AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"` + + // Bindings: Associates a list of `members`, or principals, with a + // `role`. Optionally, may specify a `condition` that determines how and + // when the `bindings` are applied. Each of the `bindings` must contain + // at least one principal. The `bindings` in a `Policy` can refer to up + // to 1,500 principals; up to 250 of these principals can be Google + // groups. Each occurrence of a principal counts towards these limits. + // For example, if the `bindings` grant 50 different roles to + // `user:alice@example.com`, and not to any other principal, then you + // can add another 1,450 principals to the `bindings` in the `Policy`. + Bindings []*Binding `json:"bindings,omitempty"` + + // Etag: `etag` is used for optimistic concurrency control as a way to + // help prevent simultaneous updates of a policy from overwriting each + // other. It is strongly suggested that systems make use of the `etag` + // in the read-modify-write cycle to perform policy updates in order to + // avoid race conditions: An `etag` is returned in the response to + // `getIamPolicy`, and systems are expected to put that etag in the + // request to `setIamPolicy` to ensure that their change will be applied + // to the same version of the policy. **Important:** If you use IAM + // Conditions, you must include the `etag` field whenever you call + // `setIamPolicy`. If you omit this field, then IAM allows you to + // overwrite a version `3` policy with a version `1` policy, and all of + // the conditions in the version `3` policy are lost. + Etag string `json:"etag,omitempty"` + + // Version: Specifies the format of the policy. Valid values are `0`, + // `1`, and `3`. Requests that specify an invalid value are rejected. + // Any operation that affects conditional role bindings must specify + // version `3`. This requirement applies to the following operations: * + // Getting a policy that includes a conditional role binding * Adding a + // conditional role binding to a policy * Changing a conditional role + // binding in a policy * Removing any role binding, with or without a + // condition, from a policy that includes conditions **Important:** If + // you use IAM Conditions, you must include the `etag` field whenever + // you call `setIamPolicy`. If you omit this field, then IAM allows you + // to overwrite a version `3` policy with a version `1` policy, and all + // of the conditions in the version `3` policy are lost. If a policy + // does not include any conditions, operations on that policy may + // specify any valid version or leave the field unset. To learn which + // resources support conditions in their IAM policies, see the IAM + // documentation + // (https://cloud.google.com/iam/help/conditions/resource-policies). + Version int64 `json:"version,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AuditConfigs") 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. "AuditConfigs") 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 *Policy) MarshalJSON() ([]byte, error) { + type NoMethod Policy + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// RenameDataPolicyRequest: Request message for the RenameDataPolicy +// method. +type RenameDataPolicyRequest struct { + // NewDataPolicyId: Required. The new data policy id. + NewDataPolicyId string `json:"newDataPolicyId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "NewDataPolicyId") 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. "NewDataPolicyId") 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 *RenameDataPolicyRequest) MarshalJSON() ([]byte, error) { + type NoMethod RenameDataPolicyRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// SetIamPolicyRequest: Request message for `SetIamPolicy` method. +type SetIamPolicyRequest struct { + // Policy: REQUIRED: The complete policy to be applied to the + // `resource`. The size of the policy is limited to a few 10s of KB. An + // empty policy is a valid policy but certain Google Cloud services + // (such as Projects) might reject them. + Policy *Policy `json:"policy,omitempty"` + + // UpdateMask: OPTIONAL: A FieldMask specifying which fields of the + // policy to modify. Only the fields in the mask will be modified. If no + // mask is provided, the following default mask is used: `paths: + // "bindings, etag" + UpdateMask string `json:"updateMask,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Policy") 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. "Policy") 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 *SetIamPolicyRequest) MarshalJSON() ([]byte, error) { + type NoMethod SetIamPolicyRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// TestIamPermissionsRequest: Request message for `TestIamPermissions` +// method. +type TestIamPermissionsRequest struct { + // Permissions: The set of permissions to check for the `resource`. + // Permissions with wildcards (such as `*` or `storage.*`) are not + // allowed. For more information see IAM Overview + // (https://cloud.google.com/iam/docs/overview#permissions). + Permissions []string `json:"permissions,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Permissions") 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. "Permissions") 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 *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) { + type NoMethod TestIamPermissionsRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// TestIamPermissionsResponse: Response message for `TestIamPermissions` +// method. +type TestIamPermissionsResponse struct { + // Permissions: A subset of `TestPermissionsRequest.permissions` that + // the caller is allowed. + Permissions []string `json:"permissions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Permissions") 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. "Permissions") 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 *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { + type NoMethod TestIamPermissionsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// method id "bigquerydatapolicy.projects.locations.dataPolicies.create": + +type ProjectsLocationsDataPoliciesCreateCall struct { + s *Service + parent string + datapolicy *DataPolicy + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a new data policy under a project with the given +// `dataPolicyId` (used as the display name), policy tag, and data +// policy type. +// +// - parent: Resource name of the project that the data policy will +// belong to. The format is +// `projects/{project_number}/locations/{location_id}`. +func (r *ProjectsLocationsDataPoliciesService) Create(parent string, datapolicy *DataPolicy) *ProjectsLocationsDataPoliciesCreateCall { + c := &ProjectsLocationsDataPoliciesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.datapolicy = datapolicy + 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 *ProjectsLocationsDataPoliciesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataPoliciesCreateCall { + 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 *ProjectsLocationsDataPoliciesCreateCall) Context(ctx context.Context) *ProjectsLocationsDataPoliciesCreateCall { + 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 *ProjectsLocationsDataPoliciesCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsDataPoliciesCreateCall) 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.datapolicy) + 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}/dataPolicies") + 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{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "bigquerydatapolicy.projects.locations.dataPolicies.create" call. +// Exactly one of *DataPolicy or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *DataPolicy.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 *ProjectsLocationsDataPoliciesCreateCall) Do(opts ...googleapi.CallOption) (*DataPolicy, 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 := &DataPolicy{ + 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": "Creates a new data policy under a project with the given `dataPolicyId` (used as the display name), policy tag, and data policy type.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/dataPolicies", + // "httpMethod": "POST", + // "id": "bigquerydatapolicy.projects.locations.dataPolicies.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. Resource name of the project that the data policy will belong to. The format is `projects/{project_number}/locations/{location_id}`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+parent}/dataPolicies", + // "request": { + // "$ref": "DataPolicy" + // }, + // "response": { + // "$ref": "DataPolicy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "bigquerydatapolicy.projects.locations.dataPolicies.delete": + +type ProjectsLocationsDataPoliciesDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes the data policy specified by its resource name. +// +// - name: Resource name of the data policy to delete. Format is +// `projects/{project_number}/locations/{location_id}/dataPolicies/{dat +// a_policy_id}`. +func (r *ProjectsLocationsDataPoliciesService) Delete(name string) *ProjectsLocationsDataPoliciesDeleteCall { + c := &ProjectsLocationsDataPoliciesDeleteCall{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 *ProjectsLocationsDataPoliciesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataPoliciesDeleteCall { + 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 *ProjectsLocationsDataPoliciesDeleteCall) Context(ctx context.Context) *ProjectsLocationsDataPoliciesDeleteCall { + 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 *ProjectsLocationsDataPoliciesDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsDataPoliciesDeleteCall) 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 "bigquerydatapolicy.projects.locations.dataPolicies.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.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 *ProjectsLocationsDataPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, 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 := &Empty{ + 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 the data policy specified by its resource name.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/dataPolicies/{dataPoliciesId}", + // "httpMethod": "DELETE", + // "id": "bigquerydatapolicy.projects.locations.dataPolicies.delete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. Resource name of the data policy to delete. Format is `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataPolicies/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "bigquerydatapolicy.projects.locations.dataPolicies.get": + +type ProjectsLocationsDataPoliciesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets the data policy specified by its resource name. +// +// - name: Resource name of the requested data policy. Format is +// `projects/{project_number}/locations/{location_id}/dataPolicies/{dat +// a_policy_id}`. +func (r *ProjectsLocationsDataPoliciesService) Get(name string) *ProjectsLocationsDataPoliciesGetCall { + c := &ProjectsLocationsDataPoliciesGetCall{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 *ProjectsLocationsDataPoliciesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataPoliciesGetCall { + 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 *ProjectsLocationsDataPoliciesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataPoliciesGetCall { + 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 *ProjectsLocationsDataPoliciesGetCall) Context(ctx context.Context) *ProjectsLocationsDataPoliciesGetCall { + 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 *ProjectsLocationsDataPoliciesGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsDataPoliciesGetCall) 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 "bigquerydatapolicy.projects.locations.dataPolicies.get" call. +// Exactly one of *DataPolicy or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *DataPolicy.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 *ProjectsLocationsDataPoliciesGetCall) Do(opts ...googleapi.CallOption) (*DataPolicy, 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 := &DataPolicy{ + 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 the data policy specified by its resource name.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/dataPolicies/{dataPoliciesId}", + // "httpMethod": "GET", + // "id": "bigquerydatapolicy.projects.locations.dataPolicies.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. Resource name of the requested data policy. Format is `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataPolicies/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "response": { + // "$ref": "DataPolicy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "bigquerydatapolicy.projects.locations.dataPolicies.getIamPolicy": + +type ProjectsLocationsDataPoliciesGetIamPolicyCall struct { + s *Service + resource string + getiampolicyrequest *GetIamPolicyRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// GetIamPolicy: Gets the IAM policy for the specified data policy. +// +// - resource: REQUIRED: The resource for which the policy is being +// requested. See Resource names +// (https://cloud.google.com/apis/design/resource_names) for the +// appropriate value for this field. +func (r *ProjectsLocationsDataPoliciesService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsLocationsDataPoliciesGetIamPolicyCall { + c := &ProjectsLocationsDataPoliciesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.resource = resource + c.getiampolicyrequest = getiampolicyrequest + 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 *ProjectsLocationsDataPoliciesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataPoliciesGetIamPolicyCall { + 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 *ProjectsLocationsDataPoliciesGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsDataPoliciesGetIamPolicyCall { + 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 *ProjectsLocationsDataPoliciesGetIamPolicyCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsDataPoliciesGetIamPolicyCall) 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.getiampolicyrequest) + 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/{+resource}:getIamPolicy") + 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{ + "resource": c.resource, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "bigquerydatapolicy.projects.locations.dataPolicies.getIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.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 *ProjectsLocationsDataPoliciesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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 := &Policy{ + 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 the IAM policy for the specified data policy.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/dataPolicies/{dataPoliciesId}:getIamPolicy", + // "httpMethod": "POST", + // "id": "bigquerydatapolicy.projects.locations.dataPolicies.getIamPolicy", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataPolicies/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:getIamPolicy", + // "request": { + // "$ref": "GetIamPolicyRequest" + // }, + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "bigquerydatapolicy.projects.locations.dataPolicies.list": + +type ProjectsLocationsDataPoliciesListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: List all of the data policies in the specified parent project. +// +// - parent: Resource name of the project for which to list data +// policies. Format is +// `projects/{project_number}/locations/{location_id}`. +func (r *ProjectsLocationsDataPoliciesService) List(parent string) *ProjectsLocationsDataPoliciesListCall { + c := &ProjectsLocationsDataPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": Filters the data +// policies by policy tags that they are associated with. Currently +// filter only supports "policy_tag" based filtering and OR based +// predicates. Sample filter can be "policy_tag: +// projects/1/locations/us/taxonomies/2/policyTags/3". You may also use +// wildcard such as "policy_tag: projects/1/locations/us/taxonomies/2*". +// Please note that OR predicates cannot be used with wildcard filters. +func (c *ProjectsLocationsDataPoliciesListCall) Filter(filter string) *ProjectsLocationsDataPoliciesListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of data policies to return. Must be a value between 1 and 1000. If +// not set, defaults to 50. +func (c *ProjectsLocationsDataPoliciesListCall) PageSize(pageSize int64) *ProjectsLocationsDataPoliciesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The +// `nextPageToken` value returned from a previous list request, if any. +// If not set, defaults to an empty string. +func (c *ProjectsLocationsDataPoliciesListCall) PageToken(pageToken string) *ProjectsLocationsDataPoliciesListCall { + 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 *ProjectsLocationsDataPoliciesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataPoliciesListCall { + 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 *ProjectsLocationsDataPoliciesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataPoliciesListCall { + 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 *ProjectsLocationsDataPoliciesListCall) Context(ctx context.Context) *ProjectsLocationsDataPoliciesListCall { + 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 *ProjectsLocationsDataPoliciesListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsDataPoliciesListCall) 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}/dataPolicies") + 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 "bigquerydatapolicy.projects.locations.dataPolicies.list" call. +// Exactly one of *ListDataPoliciesResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ListDataPoliciesResponse.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 *ProjectsLocationsDataPoliciesListCall) Do(opts ...googleapi.CallOption) (*ListDataPoliciesResponse, 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 := &ListDataPoliciesResponse{ + 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": "List all of the data policies in the specified parent project.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/dataPolicies", + // "httpMethod": "GET", + // "id": "bigquerydatapolicy.projects.locations.dataPolicies.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "filter": { + // "description": "Filters the data policies by policy tags that they are associated with. Currently filter only supports \"policy_tag\" based filtering and OR based predicates. Sample filter can be \"policy_tag: projects/1/locations/us/taxonomies/2/policyTags/3\". You may also use wildcard such as \"policy_tag: projects/1/locations/us/taxonomies/2*\". Please note that OR predicates cannot be used with wildcard filters.", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of data policies to return. Must be a value between 1 and 1000. If not set, defaults to 50.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The `nextPageToken` value returned from a previous list request, if any. If not set, defaults to an empty string.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Resource name of the project for which to list data policies. Format is `projects/{project_number}/locations/{location_id}`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+parent}/dataPolicies", + // "response": { + // "$ref": "ListDataPoliciesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "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 *ProjectsLocationsDataPoliciesListCall) Pages(ctx context.Context, f func(*ListDataPoliciesResponse) 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 "bigquerydatapolicy.projects.locations.dataPolicies.patch": + +type ProjectsLocationsDataPoliciesPatchCall struct { + s *Service + name string + datapolicy *DataPolicy + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates the metadata for an existing data policy. The target +// data policy can be specified by the resource name. +// +// - name: Output only. Resource name of this data policy, in the format +// of +// `projects/{project_number}/locations/{location_id}/dataPolicies/{dat +// a_policy_id}`. +func (r *ProjectsLocationsDataPoliciesService) Patch(name string, datapolicy *DataPolicy) *ProjectsLocationsDataPoliciesPatchCall { + c := &ProjectsLocationsDataPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.datapolicy = datapolicy + return c +} + +// UpdateMask sets the optional parameter "updateMask": The update mask +// applies to the resource. For the `FieldMask` definition, see +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask +// If not set, defaults to all of the fields that are allowed to update. +// Updates to the `name` and `dataPolicyId` fields are not allowed. +func (c *ProjectsLocationsDataPoliciesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsDataPoliciesPatchCall { + 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. +func (c *ProjectsLocationsDataPoliciesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataPoliciesPatchCall { + 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 *ProjectsLocationsDataPoliciesPatchCall) Context(ctx context.Context) *ProjectsLocationsDataPoliciesPatchCall { + 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 *ProjectsLocationsDataPoliciesPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsDataPoliciesPatchCall) 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.datapolicy) + 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 += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", 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 "bigquerydatapolicy.projects.locations.dataPolicies.patch" call. +// Exactly one of *DataPolicy or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *DataPolicy.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 *ProjectsLocationsDataPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*DataPolicy, 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 := &DataPolicy{ + 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": "Updates the metadata for an existing data policy. The target data policy can be specified by the resource name.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/dataPolicies/{dataPoliciesId}", + // "httpMethod": "PATCH", + // "id": "bigquerydatapolicy.projects.locations.dataPolicies.patch", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Output only. Resource name of this data policy, in the format of `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataPolicies/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "The update mask applies to the resource. For the `FieldMask` definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask If not set, defaults to all of the fields that are allowed to update. Updates to the `name` and `dataPolicyId` fields are not allowed.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "request": { + // "$ref": "DataPolicy" + // }, + // "response": { + // "$ref": "DataPolicy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "bigquerydatapolicy.projects.locations.dataPolicies.rename": + +type ProjectsLocationsDataPoliciesRenameCall struct { + s *Service + name string + renamedatapolicyrequest *RenameDataPolicyRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Rename: Renames the id (display name) of the specified data policy. +// +// - name: Resource name of the data policy to rename. The format is +// `projects/{project_number}/locations/{location_id}/dataPolicies/{dat +// a_policy_id}`. +func (r *ProjectsLocationsDataPoliciesService) Rename(name string, renamedatapolicyrequest *RenameDataPolicyRequest) *ProjectsLocationsDataPoliciesRenameCall { + c := &ProjectsLocationsDataPoliciesRenameCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.renamedatapolicyrequest = renamedatapolicyrequest + 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 *ProjectsLocationsDataPoliciesRenameCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataPoliciesRenameCall { + 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 *ProjectsLocationsDataPoliciesRenameCall) Context(ctx context.Context) *ProjectsLocationsDataPoliciesRenameCall { + 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 *ProjectsLocationsDataPoliciesRenameCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsDataPoliciesRenameCall) 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.renamedatapolicyrequest) + 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}:rename") + 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 "bigquerydatapolicy.projects.locations.dataPolicies.rename" call. +// Exactly one of *DataPolicy or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *DataPolicy.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 *ProjectsLocationsDataPoliciesRenameCall) Do(opts ...googleapi.CallOption) (*DataPolicy, 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 := &DataPolicy{ + 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": "Renames the id (display name) of the specified data policy.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/dataPolicies/{dataPoliciesId}:rename", + // "httpMethod": "POST", + // "id": "bigquerydatapolicy.projects.locations.dataPolicies.rename", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. Resource name of the data policy to rename. The format is `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataPolicies/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}:rename", + // "request": { + // "$ref": "RenameDataPolicyRequest" + // }, + // "response": { + // "$ref": "DataPolicy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "bigquerydatapolicy.projects.locations.dataPolicies.setIamPolicy": + +type ProjectsLocationsDataPoliciesSetIamPolicyCall struct { + s *Service + resource string + setiampolicyrequest *SetIamPolicyRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// SetIamPolicy: Sets the IAM policy for the specified data policy. +// +// - resource: REQUIRED: The resource for which the policy is being +// specified. See Resource names +// (https://cloud.google.com/apis/design/resource_names) for the +// appropriate value for this field. +func (r *ProjectsLocationsDataPoliciesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsDataPoliciesSetIamPolicyCall { + c := &ProjectsLocationsDataPoliciesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.resource = resource + c.setiampolicyrequest = setiampolicyrequest + 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 *ProjectsLocationsDataPoliciesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataPoliciesSetIamPolicyCall { + 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 *ProjectsLocationsDataPoliciesSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsDataPoliciesSetIamPolicyCall { + 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 *ProjectsLocationsDataPoliciesSetIamPolicyCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsDataPoliciesSetIamPolicyCall) 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.setiampolicyrequest) + 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/{+resource}:setIamPolicy") + 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{ + "resource": c.resource, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "bigquerydatapolicy.projects.locations.dataPolicies.setIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.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 *ProjectsLocationsDataPoliciesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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 := &Policy{ + 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": "Sets the IAM policy for the specified data policy.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/dataPolicies/{dataPoliciesId}:setIamPolicy", + // "httpMethod": "POST", + // "id": "bigquerydatapolicy.projects.locations.dataPolicies.setIamPolicy", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataPolicies/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:setIamPolicy", + // "request": { + // "$ref": "SetIamPolicyRequest" + // }, + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "bigquerydatapolicy.projects.locations.dataPolicies.testIamPermissions": + +type ProjectsLocationsDataPoliciesTestIamPermissionsCall struct { + s *Service + resource string + testiampermissionsrequest *TestIamPermissionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// TestIamPermissions: Returns the caller's permission on the specified +// data policy resource. +// +// - resource: REQUIRED: The resource for which the policy detail is +// being requested. See Resource names +// (https://cloud.google.com/apis/design/resource_names) for the +// appropriate value for this field. +func (r *ProjectsLocationsDataPoliciesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsDataPoliciesTestIamPermissionsCall { + c := &ProjectsLocationsDataPoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.resource = resource + c.testiampermissionsrequest = testiampermissionsrequest + 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 *ProjectsLocationsDataPoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataPoliciesTestIamPermissionsCall { + 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 *ProjectsLocationsDataPoliciesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsDataPoliciesTestIamPermissionsCall { + 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 *ProjectsLocationsDataPoliciesTestIamPermissionsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsDataPoliciesTestIamPermissionsCall) 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.testiampermissionsrequest) + 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/{+resource}:testIamPermissions") + 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{ + "resource": c.resource, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "bigquerydatapolicy.projects.locations.dataPolicies.testIamPermissions" call. +// Exactly one of *TestIamPermissionsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *TestIamPermissionsResponse.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 *ProjectsLocationsDataPoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, 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 := &TestIamPermissionsResponse{ + 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 the caller's permission on the specified data policy resource.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/dataPolicies/{dataPoliciesId}:testIamPermissions", + // "httpMethod": "POST", + // "id": "bigquerydatapolicy.projects.locations.dataPolicies.testIamPermissions", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataPolicies/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:testIamPermissions", + // "request": { + // "$ref": "TestIamPermissionsRequest" + // }, + // "response": { + // "$ref": "TestIamPermissionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} diff --git a/chat/v1/chat-api.json b/chat/v1/chat-api.json index 07eceb694a5..f2770e20219 100644 --- a/chat/v1/chat-api.json +++ b/chat/v1/chat-api.json @@ -281,7 +281,7 @@ ] }, "findDirectMessage": { - "description": "Returns the existing direct message with the specified user. If no direct message space is found, returns a `404 NOT_FOUND` error. For an example, see [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message). With [user authentication](https://developers.google.com/chat/api/guides/auth/users), returns the direct message space between the specified user and the authenticated user. With [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts), returns the direct message space between the specified user and the calling Chat app. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) or [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).", + "description": "Returns the existing direct message with the specified user. If no direct message space is found, returns a `404 NOT_FOUND` error. For an example, see [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message). With [user authentication](https://developers.google.com/chat/api/guides/auth/users), returns the direct message space between the specified user and the authenticated user. With [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts), returns the direct message space between the specified user and the calling Chat app. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) or [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).", "flatPath": "v1/spaces:findDirectMessage", "httpMethod": "GET", "id": "chat.spaces.findDirectMessage", @@ -304,7 +304,7 @@ ] }, "get": { - "description": "Returns details about a space. For an example, see [Get a space](https://developers.google.com/chat/api/guides/v1/spaces/get). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Fully supports [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users).", + "description": "Returns details about a space. For an example, see [Get a space](https://developers.google.com/chat/api/guides/v1/spaces/get). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users).", "flatPath": "v1/spaces/{spacesId}", "httpMethod": "GET", "id": "chat.spaces.get", @@ -331,14 +331,14 @@ ] }, "list": { - "description": "Lists spaces the caller is a member of. Group chats and DMs aren't listed until the first message is sent. For an example, see [List spaces](https://developers.google.com/chat/api/guides/v1/spaces/list). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Fully supports [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). Lists spaces visible to the caller or authenticated user. Group chats and DMs aren't listed until the first message is sent.", + "description": "Lists spaces the caller is a member of. Group chats and DMs aren't listed until the first message is sent. For an example, see [List spaces](https://developers.google.com/chat/api/guides/v1/spaces/list). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). Lists spaces visible to the caller or authenticated user. Group chats and DMs aren't listed until the first message is sent.", "flatPath": "v1/spaces", "httpMethod": "GET", "id": "chat.spaces.list", "parameterOrder": [], "parameters": { "filter": { - "description": "Optional. A query filter. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). You can filter spaces by the space type ([`space_type`](https://developers.google.com/chat/api/reference/rest/v1/spaces#spacetype)). To filter by space type, you must specify valid enum value, such as `SPACE` or `GROUP_CHAT` (the `space_type` can't be `SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR` operator. For example, the following queries are valid: ``` space_type = \"SPACE\" spaceType = \"GROUP_CHAT\" OR spaceType = \"DIRECT_MESSAGE\" ``` Invalid queries are rejected by the server with an `INVALID_ARGUMENT` error. With [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts), this field is ignored and the query always returns all spaces. But the Chat API still validates the query syntax with service accounts, so invalid queries are still rejected.", + "description": "Optional. A query filter. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). You can filter spaces by the space type ([`space_type`](https://developers.google.com/chat/api/reference/rest/v1/spaces#spacetype)). To filter by space type, you must specify valid enum value, such as `SPACE` or `GROUP_CHAT` (the `space_type` can't be `SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR` operator. For example, the following queries are valid: ``` space_type = \"SPACE\" spaceType = \"GROUP_CHAT\" OR spaceType = \"DIRECT_MESSAGE\" ``` Invalid queries are rejected by the server with an `INVALID_ARGUMENT` error. With [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts), this field is ignored and the query always returns all spaces. But the Chat API still validates the query syntax, so invalid queries are still rejected.", "location": "query", "type": "string" }, @@ -480,7 +480,7 @@ ] }, "get": { - "description": "Returns details about a membership. For an example, see [Get a membership](https://developers.google.com/chat/api/guides/v1/members/get). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Fully supports [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users).", + "description": "Returns details about a membership. For an example, see [Get a membership](https://developers.google.com/chat/api/guides/v1/members/get). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users).", "flatPath": "v1/spaces/{spacesId}/members/{membersId}", "httpMethod": "GET", "id": "chat.spaces.members.get", @@ -507,7 +507,7 @@ ] }, "list": { - "description": "Lists memberships in a space. For an example, see [List memberships](https://developers.google.com/chat/api/guides/v1/members/list). Listing memberships with [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) lists memberships in spaces that the Chat app has access to, but excludes Chat app memberships, including its own. Listing memberships with [User authentication](https://developers.google.com/chat/api/guides/auth/users) lists memberships in spaces that the authenticated user has access to. Requires [authentication](https://developers.google.com/chat/api/guides/auth). Fully supports [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users).", + "description": "Lists memberships in a space. For an example, see [List memberships](https://developers.google.com/chat/api/guides/v1/members/list). Listing memberships with [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) lists memberships in spaces that the Chat app has access to, but excludes Chat app memberships, including its own. Listing memberships with [User authentication](https://developers.google.com/chat/api/guides/auth/users) lists memberships in spaces that the authenticated user has access to. Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users).", "flatPath": "v1/spaces/{spacesId}/members", "httpMethod": "GET", "id": "chat.spaces.members.list", @@ -583,7 +583,7 @@ "enumDescriptions": [ "Default. Starts a new thread. Using this option ignores any thread ID or `thread_key` that's included.", "Creates the message as a reply to the thread specified by thread ID or `thread_key`. If it fails, the message starts a new thread instead.", - "Creates the message as a reply to the thread specified by thread ID or `thread_key`. If it fails, a `NOT_FOUND` error is returned instead." + "Creates the message as a reply to the thread specified by thread ID or `thread_key`. If a new `thread_key` is used, a new thread is created. If the message creation fails, a `NOT_FOUND` error is returned instead." ], "location": "query", "type": "string" @@ -622,7 +622,7 @@ ] }, "delete": { - "description": "Deletes a message. For an example, see [Delete a message](https://developers.google.com/chat/api/guides/v1/messages/delete). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Fully supports [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). Requests authenticated with service accounts can only delete messages created by the calling Chat app.", + "description": "Deletes a message. For an example, see [Delete a message](https://developers.google.com/chat/api/guides/v1/messages/delete). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). When using app authentication, requests can only delete messages created by the calling Chat app.", "flatPath": "v1/spaces/{spacesId}/messages/{messagesId}", "httpMethod": "DELETE", "id": "chat.spaces.messages.delete", @@ -631,7 +631,7 @@ ], "parameters": { "force": { - "description": "When `true`, deleting a message also deletes its threaded replies. When `false`, if a message has threaded replies, deletion fails. Only applies when [authenticating as a user](https://developers.google.com/chat/api/guides/auth/users). Has no effect when [authenticating with a service account] (https://developers.google.com/chat/api/guides/auth/service-accounts).", + "description": "When `true`, deleting a message also deletes its threaded replies. When `false`, if a message has threaded replies, deletion fails. Only applies when [authenticating as a user](https://developers.google.com/chat/api/guides/auth/users). Has no effect when [authenticating as a Chat app] (https://developers.google.com/chat/api/guides/auth/service-accounts).", "location": "query", "type": "boolean" }, @@ -654,7 +654,7 @@ ] }, "get": { - "description": "Returns details about a message. For an example, see [Read a message](https://developers.google.com/chat/api/guides/v1/messages/get). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Fully supports [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). Note: Might return a message from a blocked member or space.", + "description": "Returns details about a message. For an example, see [Read a message](https://developers.google.com/chat/api/guides/v1/messages/get). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). Note: Might return a message from a blocked member or space.", "flatPath": "v1/spaces/{spacesId}/messages/{messagesId}", "httpMethod": "GET", "id": "chat.spaces.messages.get", @@ -734,7 +734,7 @@ ] }, "patch": { - "description": "Updates a message. There's a difference between the `patch` and `update` methods. The `patch` method uses a `patch` request while the `update` method uses a `put` request. We recommend using the `patch` method. For an example, see [Update a message](https://developers.google.com/chat/api/guides/v1/messages/update). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Fully supports [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). Requests authenticated with service accounts can only update messages created by the calling Chat app.", + "description": "Updates a message. There's a difference between the `patch` and `update` methods. The `patch` method uses a `patch` request while the `update` method uses a `put` request. We recommend using the `patch` method. For an example, see [Update a message](https://developers.google.com/chat/api/guides/v1/messages/update). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). When using app authentication, requests can only update messages created by the calling Chat app.", "flatPath": "v1/spaces/{spacesId}/messages/{messagesId}", "httpMethod": "PATCH", "id": "chat.spaces.messages.patch", @@ -755,7 +755,7 @@ "type": "string" }, "updateMask": { - "description": "Required. The field paths to update. Separate multiple values with commas. Currently supported field paths: - `text` - `attachment` - `cards` (Requires [service account authentication](/chat/api/guides/auth/service-accounts).) - `cards_v2` (Requires [service account authentication](/chat/api/guides/auth/service-accounts).)", + "description": "Required. The field paths to update. Separate multiple values with commas. Currently supported field paths: - `text` - `attachment` - `cards` (Requires [app authentication](/chat/api/guides/auth/service-accounts).) - `cards_v2` (Requires [app authentication](/chat/api/guides/auth/service-accounts).)", "format": "google-fieldmask", "location": "query", "type": "string" @@ -775,7 +775,7 @@ ] }, "update": { - "description": "Updates a message. There's a difference between the `patch` and `update` methods. The `patch` method uses a `patch` request while the `update` method uses a `put` request. We recommend using the `patch` method. For an example, see [Update a message](https://developers.google.com/chat/api/guides/v1/messages/update). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Fully supports [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). Requests authenticated with service accounts can only update messages created by the calling Chat app.", + "description": "Updates a message. There's a difference between the `patch` and `update` methods. The `patch` method uses a `patch` request while the `update` method uses a `put` request. We recommend using the `patch` method. For an example, see [Update a message](https://developers.google.com/chat/api/guides/v1/messages/update). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). When using app authentication, requests can only update messages created by the calling Chat app.", "flatPath": "v1/spaces/{spacesId}/messages/{messagesId}", "httpMethod": "PUT", "id": "chat.spaces.messages.update", @@ -796,7 +796,7 @@ "type": "string" }, "updateMask": { - "description": "Required. The field paths to update. Separate multiple values with commas. Currently supported field paths: - `text` - `attachment` - `cards` (Requires [service account authentication](/chat/api/guides/auth/service-accounts).) - `cards_v2` (Requires [service account authentication](/chat/api/guides/auth/service-accounts).)", + "description": "Required. The field paths to update. Separate multiple values with commas. Currently supported field paths: - `text` - `attachment` - `cards` (Requires [app authentication](/chat/api/guides/auth/service-accounts).) - `cards_v2` (Requires [app authentication](/chat/api/guides/auth/service-accounts).)", "format": "google-fieldmask", "location": "query", "type": "string" @@ -820,7 +820,7 @@ "attachments": { "methods": { "get": { - "description": "Gets the metadata of a message attachment. The attachment data is fetched using the [media API](https://developers.google.com/chat/api/reference/rest/v1/media/download). For an example, see [Get a message attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/get). Requires [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).", + "description": "Gets the metadata of a message attachment. The attachment data is fetched using the [media API](https://developers.google.com/chat/api/reference/rest/v1/media/download). For an example, see [Get a message attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/get). Requires [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).", "flatPath": "v1/spaces/{spacesId}/messages/{messagesId}/attachments/{attachmentsId}", "httpMethod": "GET", "id": "chat.spaces.messages.attachments.get", diff --git a/chat/v1/chat-gen.go b/chat/v1/chat-gen.go index 9f646f12d61..9a940ace868 100644 --- a/chat/v1/chat-gen.go +++ b/chat/v1/chat-gen.go @@ -5910,12 +5910,12 @@ type SpacesFindDirectMessageCall struct { // authentication // (https://developers.google.com/chat/api/guides/auth/users), returns // the direct message space between the specified user and the -// authenticated user. With service account authentication +// authenticated user. With app authentication // (https://developers.google.com/chat/api/guides/auth/service-accounts), // returns the direct message space between the specified user and the // calling Chat app. Requires user authentication -// (https://developers.google.com/chat/api/guides/auth/users) or service -// account authentication +// (https://developers.google.com/chat/api/guides/auth/users) or app +// authentication // (https://developers.google.com/chat/api/guides/auth/service-accounts). func (r *SpacesService) FindDirectMessage() *SpacesFindDirectMessageCall { c := &SpacesFindDirectMessageCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -6036,7 +6036,7 @@ func (c *SpacesFindDirectMessageCall) Do(opts ...googleapi.CallOption) (*Space, } return ret, nil // { - // "description": "Returns the existing direct message with the specified user. If no direct message space is found, returns a `404 NOT_FOUND` error. For an example, see [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message). With [user authentication](https://developers.google.com/chat/api/guides/auth/users), returns the direct message space between the specified user and the authenticated user. With [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts), returns the direct message space between the specified user and the calling Chat app. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) or [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).", + // "description": "Returns the existing direct message with the specified user. If no direct message space is found, returns a `404 NOT_FOUND` error. For an example, see [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message). With [user authentication](https://developers.google.com/chat/api/guides/auth/users), returns the direct message space between the specified user and the authenticated user. With [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts), returns the direct message space between the specified user and the calling Chat app. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) or [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).", // "flatPath": "v1/spaces:findDirectMessage", // "httpMethod": "GET", // "id": "chat.spaces.findDirectMessage", @@ -6075,8 +6075,8 @@ type SpacesGetCall struct { // Get: Returns details about a space. For an example, see Get a space // (https://developers.google.com/chat/api/guides/v1/spaces/get). // Requires authentication -// (https://developers.google.com/chat/api/guides/auth). Fully supports -// service account authentication +// (https://developers.google.com/chat/api/guides/auth). Supports app +// authentication // (https://developers.google.com/chat/api/guides/auth/service-accounts) // and user authentication // (https://developers.google.com/chat/api/guides/auth/users). @@ -6188,7 +6188,7 @@ func (c *SpacesGetCall) Do(opts ...googleapi.CallOption) (*Space, error) { } return ret, nil // { - // "description": "Returns details about a space. For an example, see [Get a space](https://developers.google.com/chat/api/guides/v1/spaces/get). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Fully supports [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users).", + // "description": "Returns details about a space. For an example, see [Get a space](https://developers.google.com/chat/api/guides/v1/spaces/get). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users).", // "flatPath": "v1/spaces/{spacesId}", // "httpMethod": "GET", // "id": "chat.spaces.get", @@ -6232,8 +6232,8 @@ type SpacesListCall struct { // List spaces // (https://developers.google.com/chat/api/guides/v1/spaces/list). // Requires authentication -// (https://developers.google.com/chat/api/guides/auth). Fully supports -// service account authentication +// (https://developers.google.com/chat/api/guides/auth). Supports app +// authentication // (https://developers.google.com/chat/api/guides/auth/service-accounts) // and user authentication // (https://developers.google.com/chat/api/guides/auth/users). Lists @@ -6255,11 +6255,11 @@ func (r *SpacesService) List() *SpacesListCall { // `OR` operator. For example, the following queries are valid: ``` // space_type = "SPACE" spaceType = "GROUP_CHAT" OR spaceType = // "DIRECT_MESSAGE" ``` Invalid queries are rejected by the server with -// an `INVALID_ARGUMENT` error. With service account authentication +// an `INVALID_ARGUMENT` error. With app authentication // (https://developers.google.com/chat/api/guides/auth/service-accounts), // this field is ignored and the query always returns all spaces. But -// the Chat API still validates the query syntax with service accounts, -// so invalid queries are still rejected. +// the Chat API still validates the query syntax, so invalid queries are +// still rejected. func (c *SpacesListCall) Filter(filter string) *SpacesListCall { c.urlParams_.Set("filter", filter) return c @@ -6381,14 +6381,14 @@ func (c *SpacesListCall) Do(opts ...googleapi.CallOption) (*ListSpacesResponse, } return ret, nil // { - // "description": "Lists spaces the caller is a member of. Group chats and DMs aren't listed until the first message is sent. For an example, see [List spaces](https://developers.google.com/chat/api/guides/v1/spaces/list). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Fully supports [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). Lists spaces visible to the caller or authenticated user. Group chats and DMs aren't listed until the first message is sent.", + // "description": "Lists spaces the caller is a member of. Group chats and DMs aren't listed until the first message is sent. For an example, see [List spaces](https://developers.google.com/chat/api/guides/v1/spaces/list). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). Lists spaces visible to the caller or authenticated user. Group chats and DMs aren't listed until the first message is sent.", // "flatPath": "v1/spaces", // "httpMethod": "GET", // "id": "chat.spaces.list", // "parameterOrder": [], // "parameters": { // "filter": { - // "description": "Optional. A query filter. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). You can filter spaces by the space type ([`space_type`](https://developers.google.com/chat/api/reference/rest/v1/spaces#spacetype)). To filter by space type, you must specify valid enum value, such as `SPACE` or `GROUP_CHAT` (the `space_type` can't be `SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR` operator. For example, the following queries are valid: ``` space_type = \"SPACE\" spaceType = \"GROUP_CHAT\" OR spaceType = \"DIRECT_MESSAGE\" ``` Invalid queries are rejected by the server with an `INVALID_ARGUMENT` error. With [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts), this field is ignored and the query always returns all spaces. But the Chat API still validates the query syntax with service accounts, so invalid queries are still rejected.", + // "description": "Optional. A query filter. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). You can filter spaces by the space type ([`space_type`](https://developers.google.com/chat/api/reference/rest/v1/spaces#spacetype)). To filter by space type, you must specify valid enum value, such as `SPACE` or `GROUP_CHAT` (the `space_type` can't be `SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR` operator. For example, the following queries are valid: ``` space_type = \"SPACE\" spaceType = \"GROUP_CHAT\" OR spaceType = \"DIRECT_MESSAGE\" ``` Invalid queries are rejected by the server with an `INVALID_ARGUMENT` error. With [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts), this field is ignored and the query always returns all spaces. But the Chat API still validates the query syntax, so invalid queries are still rejected.", // "location": "query", // "type": "string" // }, @@ -7105,8 +7105,8 @@ type SpacesMembersGetCall struct { // membership // (https://developers.google.com/chat/api/guides/v1/members/get). // Requires authentication -// (https://developers.google.com/chat/api/guides/auth). Fully supports -// service account authentication +// (https://developers.google.com/chat/api/guides/auth). Supports app +// authentication // (https://developers.google.com/chat/api/guides/auth/service-accounts) // and user authentication // (https://developers.google.com/chat/api/guides/auth/users). @@ -7225,7 +7225,7 @@ func (c *SpacesMembersGetCall) Do(opts ...googleapi.CallOption) (*Membership, er } return ret, nil // { - // "description": "Returns details about a membership. For an example, see [Get a membership](https://developers.google.com/chat/api/guides/v1/members/get). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Fully supports [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users).", + // "description": "Returns details about a membership. For an example, see [Get a membership](https://developers.google.com/chat/api/guides/v1/members/get). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users).", // "flatPath": "v1/spaces/{spacesId}/members/{membersId}", // "httpMethod": "GET", // "id": "chat.spaces.members.get", @@ -7276,8 +7276,8 @@ type SpacesMembersListCall struct { // (https://developers.google.com/chat/api/guides/auth/users) lists // memberships in spaces that the authenticated user has access to. // Requires authentication -// (https://developers.google.com/chat/api/guides/auth). Fully supports -// service account authentication +// (https://developers.google.com/chat/api/guides/auth). Supports app +// authentication // (https://developers.google.com/chat/api/guides/auth/service-accounts) // and user authentication // (https://developers.google.com/chat/api/guides/auth/users). @@ -7441,7 +7441,7 @@ func (c *SpacesMembersListCall) Do(opts ...googleapi.CallOption) (*ListMembershi } return ret, nil // { - // "description": "Lists memberships in a space. For an example, see [List memberships](https://developers.google.com/chat/api/guides/v1/members/list). Listing memberships with [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) lists memberships in spaces that the Chat app has access to, but excludes Chat app memberships, including its own. Listing memberships with [User authentication](https://developers.google.com/chat/api/guides/auth/users) lists memberships in spaces that the authenticated user has access to. Requires [authentication](https://developers.google.com/chat/api/guides/auth). Fully supports [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users).", + // "description": "Lists memberships in a space. For an example, see [List memberships](https://developers.google.com/chat/api/guides/v1/members/list). Listing memberships with [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) lists memberships in spaces that the Chat app has access to, but excludes Chat app memberships, including its own. Listing memberships with [User authentication](https://developers.google.com/chat/api/guides/auth/users) lists memberships in spaces that the authenticated user has access to. Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users).", // "flatPath": "v1/spaces/{spacesId}/members", // "httpMethod": "GET", // "id": "chat.spaces.members.list", @@ -7581,7 +7581,8 @@ func (c *SpacesMessagesCreateCall) MessageId(messageId string) *SpacesMessagesCr // // "REPLY_MESSAGE_OR_FAIL" - Creates the message as a reply to the // -// thread specified by thread ID or `thread_key`. If it fails, a +// thread specified by thread ID or `thread_key`. If a new `thread_key` +// is used, a new thread is created. If the message creation fails, a // `NOT_FOUND` error is returned instead. func (c *SpacesMessagesCreateCall) MessageReplyOption(messageReplyOption string) *SpacesMessagesCreateCall { c.urlParams_.Set("messageReplyOption", messageReplyOption) @@ -7721,7 +7722,7 @@ func (c *SpacesMessagesCreateCall) Do(opts ...googleapi.CallOption) (*Message, e // "enumDescriptions": [ // "Default. Starts a new thread. Using this option ignores any thread ID or `thread_key` that's included.", // "Creates the message as a reply to the thread specified by thread ID or `thread_key`. If it fails, the message starts a new thread instead.", - // "Creates the message as a reply to the thread specified by thread ID or `thread_key`. If it fails, a `NOT_FOUND` error is returned instead." + // "Creates the message as a reply to the thread specified by thread ID or `thread_key`. If a new `thread_key` is used, a new thread is created. If the message creation fails, a `NOT_FOUND` error is returned instead." // ], // "location": "query", // "type": "string" @@ -7775,12 +7776,12 @@ type SpacesMessagesDeleteCall struct { // Delete: Deletes a message. For an example, see Delete a message // (https://developers.google.com/chat/api/guides/v1/messages/delete). // Requires authentication -// (https://developers.google.com/chat/api/guides/auth). Fully supports -// service account authentication +// (https://developers.google.com/chat/api/guides/auth). Supports app +// authentication // (https://developers.google.com/chat/api/guides/auth/service-accounts) // and user authentication -// (https://developers.google.com/chat/api/guides/auth/users). Requests -// authenticated with service accounts can only delete messages created +// (https://developers.google.com/chat/api/guides/auth/users). When +// using app authentication, requests can only delete messages created // by the calling Chat app. // // - name: Resource name of the message that you want to delete, in the @@ -7797,7 +7798,7 @@ func (r *SpacesMessagesService) Delete(name string) *SpacesMessagesDeleteCall { // has threaded replies, deletion fails. Only applies when // authenticating as a user // (https://developers.google.com/chat/api/guides/auth/users). Has no -// effect when [authenticating with a service account] +// effect when [authenticating as a Chat app] // (https://developers.google.com/chat/api/guides/auth/service-accounts). func (c *SpacesMessagesDeleteCall) Force(force bool) *SpacesMessagesDeleteCall { c.urlParams_.Set("force", fmt.Sprint(force)) @@ -7890,7 +7891,7 @@ func (c *SpacesMessagesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, err } return ret, nil // { - // "description": "Deletes a message. For an example, see [Delete a message](https://developers.google.com/chat/api/guides/v1/messages/delete). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Fully supports [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). Requests authenticated with service accounts can only delete messages created by the calling Chat app.", + // "description": "Deletes a message. For an example, see [Delete a message](https://developers.google.com/chat/api/guides/v1/messages/delete). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). When using app authentication, requests can only delete messages created by the calling Chat app.", // "flatPath": "v1/spaces/{spacesId}/messages/{messagesId}", // "httpMethod": "DELETE", // "id": "chat.spaces.messages.delete", @@ -7899,7 +7900,7 @@ func (c *SpacesMessagesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, err // ], // "parameters": { // "force": { - // "description": "When `true`, deleting a message also deletes its threaded replies. When `false`, if a message has threaded replies, deletion fails. Only applies when [authenticating as a user](https://developers.google.com/chat/api/guides/auth/users). Has no effect when [authenticating with a service account] (https://developers.google.com/chat/api/guides/auth/service-accounts).", + // "description": "When `true`, deleting a message also deletes its threaded replies. When `false`, if a message has threaded replies, deletion fails. Only applies when [authenticating as a user](https://developers.google.com/chat/api/guides/auth/users). Has no effect when [authenticating as a Chat app] (https://developers.google.com/chat/api/guides/auth/service-accounts).", // "location": "query", // "type": "boolean" // }, @@ -7939,8 +7940,8 @@ type SpacesMessagesGetCall struct { // message // (https://developers.google.com/chat/api/guides/v1/messages/get). // Requires authentication -// (https://developers.google.com/chat/api/guides/auth). Fully supports -// service account authentication +// (https://developers.google.com/chat/api/guides/auth). Supports app +// authentication // (https://developers.google.com/chat/api/guides/auth/service-accounts) // and user authentication // (https://developers.google.com/chat/api/guides/auth/users). Note: @@ -8058,7 +8059,7 @@ func (c *SpacesMessagesGetCall) Do(opts ...googleapi.CallOption) (*Message, erro } return ret, nil // { - // "description": "Returns details about a message. For an example, see [Read a message](https://developers.google.com/chat/api/guides/v1/messages/get). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Fully supports [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). Note: Might return a message from a blocked member or space.", + // "description": "Returns details about a message. For an example, see [Read a message](https://developers.google.com/chat/api/guides/v1/messages/get). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). Note: Might return a message from a blocked member or space.", // "flatPath": "v1/spaces/{spacesId}/messages/{messagesId}", // "httpMethod": "GET", // "id": "chat.spaces.messages.get", @@ -8371,12 +8372,12 @@ type SpacesMessagesPatchCall struct { // `patch` method. For an example, see Update a message // (https://developers.google.com/chat/api/guides/v1/messages/update). // Requires authentication -// (https://developers.google.com/chat/api/guides/auth). Fully supports -// service account authentication +// (https://developers.google.com/chat/api/guides/auth). Supports app +// authentication // (https://developers.google.com/chat/api/guides/auth/service-accounts) // and user authentication -// (https://developers.google.com/chat/api/guides/auth/users). Requests -// authenticated with service accounts can only update messages created +// (https://developers.google.com/chat/api/guides/auth/users). When +// using app authentication, requests can only update messages created // by the calling Chat app. // // - name: Resource name in the form `spaces/*/messages/*`. Example: @@ -8402,10 +8403,9 @@ func (c *SpacesMessagesPatchCall) AllowMissing(allowMissing bool) *SpacesMessage // UpdateMask sets the optional parameter "updateMask": Required. The // field paths to update. Separate multiple values with commas. // Currently supported field paths: - `text` - `attachment` - `cards` -// (Requires service account authentication -// (/chat/api/guides/auth/service-accounts).) - `cards_v2` (Requires -// service account authentication -// (/chat/api/guides/auth/service-accounts).) +// (Requires app authentication +// (/chat/api/guides/auth/service-accounts).) - `cards_v2` (Requires app +// authentication (/chat/api/guides/auth/service-accounts).) func (c *SpacesMessagesPatchCall) UpdateMask(updateMask string) *SpacesMessagesPatchCall { c.urlParams_.Set("updateMask", updateMask) return c @@ -8502,7 +8502,7 @@ func (c *SpacesMessagesPatchCall) Do(opts ...googleapi.CallOption) (*Message, er } return ret, nil // { - // "description": "Updates a message. There's a difference between the `patch` and `update` methods. The `patch` method uses a `patch` request while the `update` method uses a `put` request. We recommend using the `patch` method. For an example, see [Update a message](https://developers.google.com/chat/api/guides/v1/messages/update). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Fully supports [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). Requests authenticated with service accounts can only update messages created by the calling Chat app.", + // "description": "Updates a message. There's a difference between the `patch` and `update` methods. The `patch` method uses a `patch` request while the `update` method uses a `put` request. We recommend using the `patch` method. For an example, see [Update a message](https://developers.google.com/chat/api/guides/v1/messages/update). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). When using app authentication, requests can only update messages created by the calling Chat app.", // "flatPath": "v1/spaces/{spacesId}/messages/{messagesId}", // "httpMethod": "PATCH", // "id": "chat.spaces.messages.patch", @@ -8523,7 +8523,7 @@ func (c *SpacesMessagesPatchCall) Do(opts ...googleapi.CallOption) (*Message, er // "type": "string" // }, // "updateMask": { - // "description": "Required. The field paths to update. Separate multiple values with commas. Currently supported field paths: - `text` - `attachment` - `cards` (Requires [service account authentication](/chat/api/guides/auth/service-accounts).) - `cards_v2` (Requires [service account authentication](/chat/api/guides/auth/service-accounts).)", + // "description": "Required. The field paths to update. Separate multiple values with commas. Currently supported field paths: - `text` - `attachment` - `cards` (Requires [app authentication](/chat/api/guides/auth/service-accounts).) - `cards_v2` (Requires [app authentication](/chat/api/guides/auth/service-accounts).)", // "format": "google-fieldmask", // "location": "query", // "type": "string" @@ -8562,12 +8562,12 @@ type SpacesMessagesUpdateCall struct { // `patch` method. For an example, see Update a message // (https://developers.google.com/chat/api/guides/v1/messages/update). // Requires authentication -// (https://developers.google.com/chat/api/guides/auth). Fully supports -// service account authentication +// (https://developers.google.com/chat/api/guides/auth). Supports app +// authentication // (https://developers.google.com/chat/api/guides/auth/service-accounts) // and user authentication -// (https://developers.google.com/chat/api/guides/auth/users). Requests -// authenticated with service accounts can only update messages created +// (https://developers.google.com/chat/api/guides/auth/users). When +// using app authentication, requests can only update messages created // by the calling Chat app. // // - name: Resource name in the form `spaces/*/messages/*`. Example: @@ -8593,10 +8593,9 @@ func (c *SpacesMessagesUpdateCall) AllowMissing(allowMissing bool) *SpacesMessag // UpdateMask sets the optional parameter "updateMask": Required. The // field paths to update. Separate multiple values with commas. // Currently supported field paths: - `text` - `attachment` - `cards` -// (Requires service account authentication -// (/chat/api/guides/auth/service-accounts).) - `cards_v2` (Requires -// service account authentication -// (/chat/api/guides/auth/service-accounts).) +// (Requires app authentication +// (/chat/api/guides/auth/service-accounts).) - `cards_v2` (Requires app +// authentication (/chat/api/guides/auth/service-accounts).) func (c *SpacesMessagesUpdateCall) UpdateMask(updateMask string) *SpacesMessagesUpdateCall { c.urlParams_.Set("updateMask", updateMask) return c @@ -8693,7 +8692,7 @@ func (c *SpacesMessagesUpdateCall) Do(opts ...googleapi.CallOption) (*Message, e } return ret, nil // { - // "description": "Updates a message. There's a difference between the `patch` and `update` methods. The `patch` method uses a `patch` request while the `update` method uses a `put` request. We recommend using the `patch` method. For an example, see [Update a message](https://developers.google.com/chat/api/guides/v1/messages/update). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Fully supports [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). Requests authenticated with service accounts can only update messages created by the calling Chat app.", + // "description": "Updates a message. There's a difference between the `patch` and `update` methods. The `patch` method uses a `patch` request while the `update` method uses a `put` request. We recommend using the `patch` method. For an example, see [Update a message](https://developers.google.com/chat/api/guides/v1/messages/update). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). When using app authentication, requests can only update messages created by the calling Chat app.", // "flatPath": "v1/spaces/{spacesId}/messages/{messagesId}", // "httpMethod": "PUT", // "id": "chat.spaces.messages.update", @@ -8714,7 +8713,7 @@ func (c *SpacesMessagesUpdateCall) Do(opts ...googleapi.CallOption) (*Message, e // "type": "string" // }, // "updateMask": { - // "description": "Required. The field paths to update. Separate multiple values with commas. Currently supported field paths: - `text` - `attachment` - `cards` (Requires [service account authentication](/chat/api/guides/auth/service-accounts).) - `cards_v2` (Requires [service account authentication](/chat/api/guides/auth/service-accounts).)", + // "description": "Required. The field paths to update. Separate multiple values with commas. Currently supported field paths: - `text` - `attachment` - `cards` (Requires [app authentication](/chat/api/guides/auth/service-accounts).) - `cards_v2` (Requires [app authentication](/chat/api/guides/auth/service-accounts).)", // "format": "google-fieldmask", // "location": "query", // "type": "string" @@ -8752,7 +8751,7 @@ type SpacesMessagesAttachmentsGetCall struct { // (https://developers.google.com/chat/api/reference/rest/v1/media/download). // For an example, see Get a message attachment // (https://developers.google.com/chat/api/guides/v1/media-and-attachments/get). -// Requires service account authentication +// Requires app authentication // (https://developers.google.com/chat/api/guides/auth/service-accounts). // // - name: Resource name of the attachment, in the form @@ -8862,7 +8861,7 @@ func (c *SpacesMessagesAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*At } return ret, nil // { - // "description": "Gets the metadata of a message attachment. The attachment data is fetched using the [media API](https://developers.google.com/chat/api/reference/rest/v1/media/download). For an example, see [Get a message attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/get). Requires [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).", + // "description": "Gets the metadata of a message attachment. The attachment data is fetched using the [media API](https://developers.google.com/chat/api/reference/rest/v1/media/download). For an example, see [Get a message attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/get). Requires [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).", // "flatPath": "v1/spaces/{spacesId}/messages/{messagesId}/attachments/{attachmentsId}", // "httpMethod": "GET", // "id": "chat.spaces.messages.attachments.get", diff --git a/go.work.sum b/go.work.sum index 6a72a3dab08..137392abb65 100644 --- a/go.work.sum +++ b/go.work.sum @@ -4,6 +4,7 @@ cloud.google.com/go v0.110.4 h1:1JYyxKMN9hd5dR2MYTPWkGUgcoxVVhg0LKNKEo0qvmk= cloud.google.com/go v0.110.6 h1:8uYAkj3YHTP/1iwReuHPxLSbdcyc+dSBbzFMrVwDR6Q= cloud.google.com/go v0.110.7 h1:rJyC7nWRg2jWGZ4wSJ5nY65GTdYJkg0cd/uXb+ACI6o= cloud.google.com/go v0.110.8 h1:tyNdfIxjzaWctIiLYOTalaLKZ17SI44SKFW26QbOhME= +cloud.google.com/go v0.110.9 h1:e7ITSqGFFk4rbz/JFIqZh3G4VEHguhAL4BQcFlWtU68= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= diff --git a/places/v1/places-api.json b/places/v1/places-api.json index 14d2b62f319..633568ac010 100644 --- a/places/v1/places-api.json +++ b/places/v1/places-api.json @@ -248,7 +248,7 @@ } } }, - "revision": "20231112", + "revision": "20231119", "rootUrl": "https://places.googleapis.com/", "schemas": { "GoogleGeoTypeViewport": { @@ -1235,7 +1235,7 @@ "type": "integer" }, "minRating": { - "description": "Filter out results whose average user rating is strictly less than this limit. A valid value must be an float between 0 and 5 (inclusively) at a 0.5 cadence i.e. [0, 0.5, 1.0, ... , 5.0] inclusively. This is to keep parity with LocalRefinement_UserRating. The input rating will round up to the nearest 0.5(ceiling). For instance, a rating of 0.6 will eliminate all results with a less than 1.0 rating.", + "description": "Filter out results whose average user rating is strictly less than this limit. A valid value must be a float between 0 and 5 (inclusively) at a 0.5 cadence i.e. [0, 0.5, 1.0, ... , 5.0] inclusively. The input rating will round up to the nearest 0.5(ceiling). For instance, a rating of 0.6 will eliminate all results with a less than 1.0 rating.", "format": "double", "type": "number" }, @@ -1276,7 +1276,7 @@ "enumDescriptions": [ "RankPreference value not set. Will default to DISTANCE.", "Ranks results by distance.", - "Ranks results by relevance. Sort order determined by normal ranking stack. See SortRefinement::RELEVANCE." + "Ranks results by relevance. Sort order determined by normal ranking stack." ], "type": "string" }, diff --git a/places/v1/places-gen.go b/places/v1/places-gen.go index e6a2683d618..1014fe38466 100644 --- a/places/v1/places-gen.go +++ b/places/v1/places-gen.go @@ -1675,12 +1675,11 @@ type GoogleMapsPlacesV1SearchTextRequest struct { MaxResultCount int64 `json:"maxResultCount,omitempty"` // MinRating: Filter out results whose average user rating is strictly - // less than this limit. A valid value must be an float between 0 and 5 + // less than this limit. A valid value must be a float between 0 and 5 // (inclusively) at a 0.5 cadence i.e. [0, 0.5, 1.0, ... , 5.0] - // inclusively. This is to keep parity with LocalRefinement_UserRating. - // The input rating will round up to the nearest 0.5(ceiling). For - // instance, a rating of 0.6 will eliminate all results with a less than - // 1.0 rating. + // inclusively. The input rating will round up to the nearest + // 0.5(ceiling). For instance, a rating of 0.6 will eliminate all + // results with a less than 1.0 rating. MinRating float64 `json:"minRating,omitempty"` // OpenNow: Used to restrict the search to places that are currently @@ -1709,7 +1708,7 @@ type GoogleMapsPlacesV1SearchTextRequest struct { // default to DISTANCE. // "DISTANCE" - Ranks results by distance. // "RELEVANCE" - Ranks results by relevance. Sort order determined by - // normal ranking stack. See SortRefinement::RELEVANCE. + // normal ranking stack. RankPreference string `json:"rankPreference,omitempty"` // RegionCode: The Unicode country/region code (CLDR) of the location diff --git a/playintegrity/v1/playintegrity-api.json b/playintegrity/v1/playintegrity-api.json index 483daaf6853..a8e93d8b3bd 100644 --- a/playintegrity/v1/playintegrity-api.json +++ b/playintegrity/v1/playintegrity-api.json @@ -138,7 +138,7 @@ } } }, - "revision": "20231109", + "revision": "20231119", "rootUrl": "https://playintegrity.googleapis.com/", "schemas": { "AccountActivity": { @@ -318,13 +318,21 @@ "MEETS_VIRTUAL_INTEGRITY", "MEETS_WEAK_INTEGRITY" ], + "enumDeprecated": [ + false, + false, + false, + false, + false, + true + ], "enumDescriptions": [ "Play does not have sufficient information to evaluate device integrity", "App is running on a device that passes basic system integrity checks, but may not meet Android platform compatibility requirements and may not be approved to run Google Play services.", "App is running on GMS Android device with Google Play services.", "App is running on GMS Android device with Google Play services and has a strong guarantee of system integrity such as a hardware-backed keystore.", "App is running on an Android emulator with Google Play services which meets core Android compatibility requirements.", - "App is running on a device that passes only weak integrity checks (is a physical device)." + "Deprecated: this enum value will be removed. App is running on a device that passes only weak integrity checks (is a physical device)." ], "type": "string" }, diff --git a/playintegrity/v1/playintegrity-gen.go b/playintegrity/v1/playintegrity-gen.go index 943f1c769ab..d6a0b269787 100644 --- a/playintegrity/v1/playintegrity-gen.go +++ b/playintegrity/v1/playintegrity-gen.go @@ -453,8 +453,9 @@ type DeviceIntegrity struct { // "MEETS_VIRTUAL_INTEGRITY" - App is running on an Android emulator // with Google Play services which meets core Android compatibility // requirements. - // "MEETS_WEAK_INTEGRITY" - App is running on a device that passes - // only weak integrity checks (is a physical device). + // "MEETS_WEAK_INTEGRITY" - Deprecated: this enum value will be + // removed. App is running on a device that passes only weak integrity + // checks (is a physical device). DeviceRecognitionVerdict []string `json:"deviceRecognitionVerdict,omitempty"` // ForceSendFields is a list of field names (e.g. diff --git a/servicenetworking/v1/servicenetworking-api.json b/servicenetworking/v1/servicenetworking-api.json index c5ad28c18e5..caa92d57bfc 100644 --- a/servicenetworking/v1/servicenetworking-api.json +++ b/servicenetworking/v1/servicenetworking-api.json @@ -1029,7 +1029,7 @@ } } }, - "revision": "20231029", + "revision": "20231119", "rootUrl": "https://servicenetworking.googleapis.com/", "schemas": { "AddDnsRecordSetMetadata": { @@ -2781,6 +2781,13 @@ "description": "Describes the generator configuration for a method.", "id": "MethodSettings", "properties": { + "autoPopulatedFields": { + "description": "List of top-level fields of the request message, that should be automatically populated by the client libraries based on their (google.api.field_info).format. Currently supported format: UUID4. Example of a YAML configuration: publishing: method_settings: - selector: google.example.v1.ExampleService.CreateExample auto_populated_fields: - request_id", + "items": { + "type": "string" + }, + "type": "array" + }, "longRunning": { "$ref": "LongRunning", "description": "Describes settings to use for long-running operations when generating API methods for RPCs. Complements RPCs that use the annotations in google/longrunning/operations.proto. Example of a YAML configuration:: publishing: method_settings: - selector: google.cloud.speech.v2.Speech.BatchRecognize long_running: initial_poll_delay: seconds: 60 # 1 minute poll_delay_multiplier: 1.5 max_poll_delay: seconds: 360 # 6 minutes total_poll_timeout: seconds: 54000 # 90 minutes" diff --git a/servicenetworking/v1/servicenetworking-gen.go b/servicenetworking/v1/servicenetworking-gen.go index 4e185ddd23f..e99027973f7 100644 --- a/servicenetworking/v1/servicenetworking-gen.go +++ b/servicenetworking/v1/servicenetworking-gen.go @@ -3560,6 +3560,14 @@ func (s *MethodPolicy) MarshalJSON() ([]byte, error) { // MethodSettings: Describes the generator configuration for a method. type MethodSettings struct { + // AutoPopulatedFields: List of top-level fields of the request message, + // that should be automatically populated by the client libraries based + // on their (google.api.field_info).format. Currently supported format: + // UUID4. Example of a YAML configuration: publishing: method_settings: + // - selector: google.example.v1.ExampleService.CreateExample + // auto_populated_fields: - request_id + AutoPopulatedFields []string `json:"autoPopulatedFields,omitempty"` + // LongRunning: Describes settings to use for long-running operations // when generating API methods for RPCs. Complements RPCs that use the // annotations in google/longrunning/operations.proto. Example of a YAML @@ -3575,20 +3583,21 @@ type MethodSettings struct { // options. Selector string `json:"selector,omitempty"` - // ForceSendFields is a list of field names (e.g. "LongRunning") to - // unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "AutoPopulatedFields") + // 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. "LongRunning") 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. "AutoPopulatedFields") 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:"-"` } diff --git a/servicenetworking/v1beta/servicenetworking-api.json b/servicenetworking/v1beta/servicenetworking-api.json index 8f10d66ec7b..ad2a297b81b 100644 --- a/servicenetworking/v1beta/servicenetworking-api.json +++ b/servicenetworking/v1beta/servicenetworking-api.json @@ -307,7 +307,7 @@ } } }, - "revision": "20231015", + "revision": "20231119", "rootUrl": "https://servicenetworking.googleapis.com/", "schemas": { "AddDnsRecordSetMetadata": { @@ -1805,6 +1805,13 @@ "description": "Describes the generator configuration for a method.", "id": "MethodSettings", "properties": { + "autoPopulatedFields": { + "description": "List of top-level fields of the request message, that should be automatically populated by the client libraries based on their (google.api.field_info).format. Currently supported format: UUID4. Example of a YAML configuration: publishing: method_settings: - selector: google.example.v1.ExampleService.CreateExample auto_populated_fields: - request_id", + "items": { + "type": "string" + }, + "type": "array" + }, "longRunning": { "$ref": "LongRunning", "description": "Describes settings to use for long-running operations when generating API methods for RPCs. Complements RPCs that use the annotations in google/longrunning/operations.proto. Example of a YAML configuration:: publishing: method_settings: - selector: google.cloud.speech.v2.Speech.BatchRecognize long_running: initial_poll_delay: seconds: 60 # 1 minute poll_delay_multiplier: 1.5 max_poll_delay: seconds: 360 # 6 minutes total_poll_timeout: seconds: 54000 # 90 minutes" diff --git a/servicenetworking/v1beta/servicenetworking-gen.go b/servicenetworking/v1beta/servicenetworking-gen.go index 02ad807bfd6..45bb6a2914b 100644 --- a/servicenetworking/v1beta/servicenetworking-gen.go +++ b/servicenetworking/v1beta/servicenetworking-gen.go @@ -2894,6 +2894,14 @@ func (s *MethodPolicy) MarshalJSON() ([]byte, error) { // MethodSettings: Describes the generator configuration for a method. type MethodSettings struct { + // AutoPopulatedFields: List of top-level fields of the request message, + // that should be automatically populated by the client libraries based + // on their (google.api.field_info).format. Currently supported format: + // UUID4. Example of a YAML configuration: publishing: method_settings: + // - selector: google.example.v1.ExampleService.CreateExample + // auto_populated_fields: - request_id + AutoPopulatedFields []string `json:"autoPopulatedFields,omitempty"` + // LongRunning: Describes settings to use for long-running operations // when generating API methods for RPCs. Complements RPCs that use the // annotations in google/longrunning/operations.proto. Example of a YAML @@ -2909,20 +2917,21 @@ type MethodSettings struct { // options. Selector string `json:"selector,omitempty"` - // ForceSendFields is a list of field names (e.g. "LongRunning") to - // unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "AutoPopulatedFields") + // 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. "LongRunning") 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. "AutoPopulatedFields") 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:"-"` }