From 7cd88dabf7a36af1b9586f242e565e93b882f6de Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 28 Jun 2024 00:18:23 -0700 Subject: [PATCH] feat(all): auto-regenerate discovery clients (#2659) --- checks/v1alpha/checks-api.json | 8 +- checks/v1alpha/checks-gen.go | 2 + chromemanagement/v1/chromemanagement-api.json | 8 +- chromemanagement/v1/chromemanagement-gen.go | 2 + compute/v0.alpha/compute-api.json | 526 +- compute/v0.alpha/compute-gen.go | 410 +- compute/v0.alpha/compute2-gen.go | 933 ++ compute/v0.alpha/compute3-gen.go | 1779 ++-- displayvideo/v3/displayvideo-api.json | 26 +- displayvideo/v3/displayvideo-gen.go | 10 + dlp/v2/dlp-api.json | 521 +- dlp/v2/dlp-gen.go | 8399 ++++++++++------- .../v1alpha/firebaseappdistribution-api.json | 43 +- .../v1alpha/firebaseappdistribution-gen.go | 67 +- meet/v2/meet-api.json | 4 +- meet/v2/meet-gen.go | 6 +- migrationcenter/v1/migrationcenter-api.json | 4 +- migrationcenter/v1/migrationcenter-gen.go | 2 +- .../v1alpha1/migrationcenter-api.json | 40 +- .../v1alpha1/migrationcenter-gen.go | 34 +- .../v1/servicenetworking-api.json | 4 +- servicenetworking/v1/servicenetworking-gen.go | 25 +- .../v1beta/servicenetworking-api.json | 4 +- .../v1beta/servicenetworking-gen.go | 25 +- walletobjects/v1/walletobjects-api.json | 4 +- walletobjects/v1/walletobjects-gen.go | 5 +- 26 files changed, 8060 insertions(+), 4831 deletions(-) diff --git a/checks/v1alpha/checks-api.json b/checks/v1alpha/checks-api.json index 0888037b574..4ee5233da8a 100644 --- a/checks/v1alpha/checks-api.json +++ b/checks/v1alpha/checks-api.json @@ -414,7 +414,7 @@ } } }, - "revision": "20240424", + "revision": "20240626", "rootUrl": "https://checks.googleapis.com/", "schemas": { "CancelOperationRequest": { @@ -674,7 +674,8 @@ "DATA_MONITORING_ENDPOINTS_DENYLIST_VIOLATION", "DATA_MONITORING_OUTDATED_SDK_VERSION", "DATA_MONITORING_CRITICAL_SDK_ISSUE", - "PRIVACY_POLICY_DATA_TYPE_SENSITIVE_INFO" + "PRIVACY_POLICY_DATA_TYPE_SENSITIVE_INFO", + "DATA_MONITORING_PII_LOGCAT_LEAK" ], "enumDescriptions": [ "Not specified.", @@ -764,7 +765,8 @@ "Checks if any endpoints were detected that are specified in the denylist.", "Checks if there are any outdated SDKs.", "Checks if there are any SDKs with critical issues.", - "Checks if the Sensitive Information data type declaration matches usage." + "Checks if the Sensitive Information data type declaration matches usage.", + "Checks if there were any PII leaked to device logs." ], "type": "string" } diff --git a/checks/v1alpha/checks-gen.go b/checks/v1alpha/checks-gen.go index 04ccd091d7f..245b15ba0a4 100644 --- a/checks/v1alpha/checks-gen.go +++ b/checks/v1alpha/checks-gen.go @@ -597,6 +597,8 @@ type GoogleChecksReportV1alphaCheck struct { // critical issues. // "PRIVACY_POLICY_DATA_TYPE_SENSITIVE_INFO" - Checks if the Sensitive // Information data type declaration matches usage. + // "DATA_MONITORING_PII_LOGCAT_LEAK" - Checks if there were any PII leaked to + // device logs. Type string `json:"type,omitempty"` // ForceSendFields is a list of field names (e.g. "Citations") to // unconditionally include in API requests. By default, fields with empty or diff --git a/chromemanagement/v1/chromemanagement-api.json b/chromemanagement/v1/chromemanagement-api.json index 6856b6cd2b6..0e91e5592af 100644 --- a/chromemanagement/v1/chromemanagement-api.json +++ b/chromemanagement/v1/chromemanagement-api.json @@ -1172,7 +1172,7 @@ } } }, - "revision": "20240602", + "revision": "20240626", "rootUrl": "https://chromemanagement.googleapis.com/", "schemas": { "GoogleChromeManagementV1AndroidAppInfo": { @@ -3681,7 +3681,8 @@ "APPLICATION_LAUNCH_SOURCE_INSTALLER", "APPLICATION_LAUNCH_SOURCE_FIRST_RUN", "APPLICATION_LAUNCH_SOURCE_WELCOME_TOUR", - "APPLICATION_LAUNCH_SOURCE_FOCUS_MODE" + "APPLICATION_LAUNCH_SOURCE_FOCUS_MODE", + "APPLICATION_LAUNCH_SOURCE_SPARKY" ], "enumDescriptions": [ "Application launch source unknown.", @@ -3724,7 +3725,8 @@ "Application launched from source installer.", "Count first-run Help app launches separately so that we can understand the number of user-triggered launches.", "Application launched from welcome tour.", - "Applicationed launched from focus panel." + "Applicationed launched from focus panel.", + "Application launched from experimental feature Sparky." ], "type": "string" }, diff --git a/chromemanagement/v1/chromemanagement-gen.go b/chromemanagement/v1/chromemanagement-gen.go index 73e7017e107..23517e87328 100644 --- a/chromemanagement/v1/chromemanagement-gen.go +++ b/chromemanagement/v1/chromemanagement-gen.go @@ -2982,6 +2982,8 @@ type GoogleChromeManagementV1TelemetryAppLaunchEvent struct { // welcome tour. // "APPLICATION_LAUNCH_SOURCE_FOCUS_MODE" - Applicationed launched from focus // panel. + // "APPLICATION_LAUNCH_SOURCE_SPARKY" - Application launched from + // experimental feature Sparky. AppLaunchSource string `json:"appLaunchSource,omitempty"` // AppType: Type of app. // diff --git a/compute/v0.alpha/compute-api.json b/compute/v0.alpha/compute-api.json index e617ad15787..3539c18f142 100644 --- a/compute/v0.alpha/compute-api.json +++ b/compute/v0.alpha/compute-api.json @@ -28596,6 +28596,204 @@ } } }, + "regionMultiMigs": { + "methods": { + "delete": { + "description": "Deletes a regional multiMIG in the specified project.", + "flatPath": "projects/{project}/regions/{region}/multiMigs/{multiMig}", + "httpMethod": "DELETE", + "id": "compute.regionMultiMigs.delete", + "parameterOrder": [ + "project", + "region", + "multiMig" + ], + "parameters": { + "multiMig": { + "description": "Name of the multiMIG to delete.", + "location": "path", + "required": true, + "type": "string" + }, + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "region": { + "description": "Name of the region for this request.", + "location": "path", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "required": true, + "type": "string" + }, + "requestId": { + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + "location": "query", + "type": "string" + } + }, + "path": "projects/{project}/regions/{region}/multiMigs/{multiMig}", + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "description": "Returns the specified MultiMIG resource.", + "flatPath": "projects/{project}/regions/{region}/multiMigs/{multiMig}", + "httpMethod": "GET", + "id": "compute.regionMultiMigs.get", + "parameterOrder": [ + "project", + "region", + "multiMig" + ], + "parameters": { + "multiMig": { + "description": "Name of the MultiMig resource to return.", + "location": "path", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}", + "required": true, + "type": "string" + }, + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "region": { + "description": "Name of the region for this request.", + "location": "path", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "required": true, + "type": "string" + } + }, + "path": "projects/{project}/regions/{region}/multiMigs/{multiMig}", + "response": { + "$ref": "MultiMig" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "description": "Creates a regional multiMIG in the specified project.", + "flatPath": "projects/{project}/regions/{region}/multiMigs", + "httpMethod": "POST", + "id": "compute.regionMultiMigs.insert", + "parameterOrder": [ + "project", + "region" + ], + "parameters": { + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "region": { + "description": "Name of the region for this request.", + "location": "path", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "required": true, + "type": "string" + }, + "requestId": { + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + "location": "query", + "type": "string" + } + }, + "path": "projects/{project}/regions/{region}/multiMigs", + "request": { + "$ref": "MultiMig" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "description": "Retrieves a list of MultiMIGs in a project and region.", + "flatPath": "projects/{project}/regions/{region}/multiMigs", + "httpMethod": "GET", + "id": "compute.regionMultiMigs.list", + "parameterOrder": [ + "project", + "region" + ], + "parameters": { + "filter": { + "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.", + "location": "query", + "type": "string" + }, + "maxResults": { + "default": "500", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)", + "format": "uint32", + "location": "query", + "minimum": "0", + "type": "integer" + }, + "orderBy": { + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.", + "location": "query", + "type": "string" + }, + "pageToken": { + "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.", + "location": "query", + "type": "string" + }, + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "region": { + "description": "Name of the region for this request.", + "location": "path", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "required": true, + "type": "string" + }, + "returnPartialSuccess": { + "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.", + "location": "query", + "type": "boolean" + } + }, + "path": "projects/{project}/regions/{region}/multiMigs", + "response": { + "$ref": "MultiMigsList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, "regionNetworkEndpointGroups": { "methods": { "attachNetworkEndpoints": { @@ -38770,7 +38968,7 @@ ] }, "update": { - "description": "Updates the specified storagePool with the data included in the request. The update is performed only on selected fields included as part of update-mask. Only the following fields can be modified: size_tb and provisioned_iops.", + "description": "Updates the specified storagePool with the data included in the request. The update is performed only on selected fields included as part of update-mask. Only the following fields can be modified: pool_provisioned_capacity_gb, pool_provisioned_iops and pool_provisioned_throughput.", "flatPath": "projects/{project}/zones/{zone}/storagePools/{storagePool}", "httpMethod": "PATCH", "id": "compute.storagePools.update", @@ -44517,7 +44715,7 @@ } } }, - "revision": "20240604", + "revision": "20240618", "rootUrl": "https://compute.googleapis.com/", "schemas": { "AWSV4Signature": { @@ -45903,6 +46101,26 @@ }, "type": "object" }, + "AllocationReservationSharingPolicy": { + "id": "AllocationReservationSharingPolicy", + "properties": { + "serviceShareType": { + "description": "Sharing config for all Google Cloud services.", + "enum": [ + "ALLOW_ALL", + "DISALLOW_ALL", + "SERVICE_SHARE_TYPE_UNSPECIFIED" + ], + "enumDescriptions": [ + "Allow all Google Cloud managed services to share reservations.", + "[Default] Disallow sharing with all Google Cloud services.", + "" + ], + "type": "string" + } + }, + "type": "object" + }, "AllocationResourceStatus": { "description": "[Output Only] Contains output only fields.", "id": "AllocationResourceStatus", @@ -59961,6 +60179,20 @@ "$ref": "InstanceGroupManagerInstanceLifecyclePolicyMetadataBasedReadinessSignal", "deprecated": true, "description": "The configuration for metadata based readiness signal sent by the instance during initialization when stopping / suspending an instance. The Instance Group Manager will wait for a signal that indicates successful initialization before stopping / suspending an instance. If a successful readiness signal is not sent before timeout, the corresponding instance will not be stopped / suspended. Instead, an error will be visible in the lastAttempt.errors field of the managed instance in the listmanagedinstances method. If metadataBasedReadinessSignal.timeoutSec is unset, the Instance Group Manager will directly proceed to suspend / stop instances, skipping initialization on them." + }, + "onFailedHealthCheck": { + "description": "The action that a MIG performs on an unhealthy VM. A VM is marked as unhealthy when the application running on that VM fails a health check. Valid values are: - DEFAULT_ACTION (default): The MIG performs the same action as specified in the instanceLifecyclePolicy.defaultActionOnFailure field. If the defaultActionOnFailure field is set to REPAIR, then the MIG repairs unhealthy VMs. If the defaultActionOnFailure field is set to DO_NOTHING, then the MIG doesn't repair unhealthy VMs. - REPAIR: The MIG repairs unhealthy VMs by recreating it. - DO_NOTHING: The MIG doesn't repair unhealthy VMs. For more information, see About repairing VMs in a MIG. ", + "enum": [ + "DEFAULT_ACTION", + "DO_NOTHING", + "REPAIR" + ], + "enumDescriptions": [ + "(Default) The MIG performs the same action as specified in the instanceLifecyclePolicy.defaultActionOnFailure field. If the defaultActionOnFailure field is set to REPAIR, then the MIG repairs unhealthy VMs. If the defaultActionOnFailure field is set to DO_NOTHING, then the MIG doesn't repair unhealthy VMs.", + "The MIG doesn't repair unhealthy VMs.", + "The MIG repairs unhealthy VMs by recreating it." + ], + "type": "string" } }, "type": "object" @@ -62148,7 +62380,7 @@ "compute.instanceTemplates.insert" ] }, - "description": "The machine type to use for instances that are created from these properties. This field only accept machine types name. e.g. n2-standard-4 and does not accept machine type full or partial url. e.g. projects/my-l7ilb-project/zones/us-central1-a/machineTypes/n2-standard-4 will throw INTERNAL_ERROR.", + "description": "The machine type to use for instances that are created from these properties. This field only accepts a machine type name, for example `n2-standard-4`. If you use the machine type full or partial URL, for example `projects/my-l7ilb-project/zones/us-central1-a/machineTypes/n2-standard-4`, the request will result in an `INTERNAL_ERROR`.", "type": "string" }, "metadata": { @@ -64111,7 +64343,7 @@ "type": "object" }, "InterconnectApplicationAwareInterconnectBandwidthPercentage": { - "description": "Specify bandwidth percentages (0-100) for various traffic classes in BandwidthPercentagePolicy. The sum of all percentages must equal 100. It is valid to specify percentages for some classes and not for others. The others will be implicitly marked as 0.", + "description": "Specify bandwidth percentages [1-100] for various traffic classes in BandwidthPercentagePolicy. The sum of all percentages must equal 100. All traffic classes must have a percentage value specified.", "id": "InterconnectApplicationAwareInterconnectBandwidthPercentage", "properties": { "percentage": { @@ -68360,6 +68592,271 @@ }, "type": "object" }, + "MultiMig": { + "description": "MultiMIG represents a group of Managed Instance Groups.", + "id": "MultiMig", + "properties": { + "creationTimestamp": { + "description": "[Output Only] Creation timestamp in RFC3339 text format.", + "type": "string" + }, + "description": { + "description": "An optional description of this resource. Provide this property when you create the resource.", + "type": "string" + }, + "id": { + "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.", + "format": "uint64", + "type": "string" + }, + "kind": { + "default": "compute#multiMig", + "description": "[Output Only] Type of the resource. Always compute#multiMig for MultiMIGs.", + "type": "string" + }, + "locationPolicy": { + "$ref": "MultiMigLocationPolicy" + }, + "name": { + "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "type": "string" + }, + "parts": { + "additionalProperties": { + "$ref": "MultiMigPart" + }, + "description": "User-provided names for Parts of MultiMIG and the Parts themselves.", + "type": "object" + }, + "region": { + "description": "[Output Only] URL of the region where the resource resides. Only applicable for regional resources. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.", + "type": "string" + }, + "schedulingPolicy": { + "$ref": "MultiMigSchedulingPolicy", + "description": "Policy for handling provisioning and other scheduling-related events." + }, + "selfLink": { + "description": "[Output only] Server-defined URL for the resource.", + "type": "string" + }, + "selfLinkWithId": { + "description": "[Output Only] Server-defined URL for this resource with the resource id.", + "type": "string" + } + }, + "type": "object" + }, + "MultiMigLocationPolicy": { + "description": "Policy regarding where to create MIGs Initially only zonal MIGs in the same zone are supported.", + "id": "MultiMigLocationPolicy", + "properties": { + "provisioningZones": { + "description": "List of zones where MIGs will be provisioned. Should be valid RFC1035 name", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "MultiMigPart": { + "description": "Config for an MMIG part.", + "id": "MultiMigPart", + "properties": { + "instanceGroupManager": { + "description": "Link to an existing InstanceGroupManager that will be adopted by a MultiMIG.", + "type": "string" + }, + "instanceGroupManagerProperties": { + "$ref": "InstanceGroupManager", + "description": "InstanceGroupManager to be created by the multiMig" + } + }, + "type": "object" + }, + "MultiMigSchedulingPolicy": { + "description": "Policy for handling provisioning and other scheduling-related events.", + "id": "MultiMigSchedulingPolicy", + "properties": { + "provisioning": { + "description": "How provisioning of MIGs should be scheduled (coordinated or not)", + "enum": [ + "ANY", + "COOORDINATED" + ], + "enumDescriptions": [ + "Allows idependent lifecycles of parts.", + "Requires all parts at the same time." + ], + "type": "string" + } + }, + "type": "object" + }, + "MultiMigsList": { + "id": "MultiMigsList", + "properties": { + "etag": { + "type": "string" + }, + "id": { + "description": "Unique identifier for the resource; defined by the server.", + "type": "string" + }, + "items": { + "description": "A list of MultiMig resources.", + "items": { + "$ref": "MultiMig" + }, + "type": "array" + }, + "kind": { + "default": "compute#multiMigList", + "description": "Type of resource.", + "type": "string" + }, + "nextPageToken": { + "description": "This token allows you to get the next page of results for maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.", + "type": "string" + }, + "selfLink": { + "description": "[Output only] Server-defined URL for this resource.", + "type": "string" + }, + "unreachables": { + "description": "[Output only] Unreachable resources.", + "items": { + "type": "string" + }, + "type": "array" + }, + "warning": { + "description": "Informational warning message.", + "properties": { + "code": { + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB", + "LARGE_DEPLOYMENT_WARNING", + "LIST_OVERHEAD_QUOTA_EXCEED", + "MISSING_TYPE_DEPENDENCY", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "PARTIAL_SUCCESS", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "UNREACHABLE" + ], + "enumDeprecated": [ + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "enumDescriptions": [ + "Warning about failed cleanup of transient changes made by a failed operation.", + "A link to a deprecated resource was created.", + "When deploying and at least one of the resources has a type marked as deprecated", + "The user created a boot disk that is larger than image size.", + "When deploying and at least one of the resources has a type marked as experimental", + "Warning that is present in an external api call", + "Warning that value of a field has been overridden. Deprecated unused field.", + "The operation involved use of an injected kernel, which is deprecated.", + "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.", + "When deploying a deployment with a exceedingly large number of resources", + "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.", + "A resource depends on a missing type", + "The route's nextHopIp address is not assigned to an instance on the network.", + "The route's next hop instance cannot ip forward.", + "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.", + "The route's nextHopInstance URL refers to an instance that does not exist.", + "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.", + "The route's next hop instance does not have a status of RUNNING.", + "Error which is not critical. We decided to continue the process despite the mentioned error.", + "No results are present on a particular list page.", + "Success is reported, but some results may be missing due to errors", + "The user attempted to use a resource that requires a TOS they have not accepted.", + "Warning that a resource is in use.", + "One or more of the resources set to auto-delete could not be deleted because they were in use.", + "When a resource schema validation is ignored.", + "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.", + "When undeclared properties in the schema are present", + "A given scope cannot be reached." + ], + "type": "string" + }, + "data": { + "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ", + "items": { + "properties": { + "key": { + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).", + "type": "string" + }, + "value": { + "description": "[Output Only] A warning data value corresponding to the key.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "message": { + "description": "[Output Only] A human-readable description of the warning code.", + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, "MutualTls": { "description": "[Deprecated] Configuration for the mutual Tls mode for peer authentication. Configuration for the mutual Tls mode for peer authentication.", "id": "MutualTls", @@ -80801,6 +81298,10 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "type": "string" }, + "reservationSharingPolicy": { + "$ref": "AllocationReservationSharingPolicy", + "description": "Specify the reservation sharing policy. If unspecified, the reservation will not be shared with Google Cloud managed services." + }, "resourcePolicies": { "additionalProperties": { "type": "string" @@ -82564,7 +83065,7 @@ "type": "string" }, "nextHopIlb": { - "description": "The URL to a forwarding rule of type loadBalancingScheme=INTERNAL that should handle matching packets or the IP address of the forwarding Rule. For example, the following are all valid URLs: - 10.128.0.56 - https://www.googleapis.com/compute/v1/projects/project/regions/region /forwardingRules/forwardingRule - regions/region/forwardingRules/forwardingRule ", + "description": "The URL to a forwarding rule of type loadBalancingScheme=INTERNAL that should handle matching packets or the IP address of the forwarding Rule. For example, the following are all valid URLs: - https://www.googleapis.com/compute/v1/projects/project/regions/region /forwardingRules/forwardingRule - regions/region/forwardingRules/forwardingRule If an IP address is provided, must specify an IPv4 address in dot-decimal notation or an IPv6 address in RFC 4291 format. For example, the following are all valid IP addresses: - 10.128.0.56 - 2001:db8::2d9:51:0:0 - 2001:db8:0:0:2d9:51:0:0 IPv6 addresses will be displayed using RFC 5952 compressed format (e.g. 2001:db8::2d9:51:0:0). Should never be an IPv4-mapped IPv6 address.", "type": "string" }, "nextHopInstance": { @@ -84044,7 +84545,7 @@ "type": "string" }, "match": { - "description": "CEL expression that specifies the match condition that egress traffic from a VM is evaluated against. If it evaluates to true, the corresponding `action` is enforced. The following examples are valid match expressions for public NAT: \"inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')\" \"destination.ip == '1.1.0.1' || destination.ip == '8.8.8.8'\" The following example is a valid match expression for private NAT: \"nexthop.hub == '//networkconnectivity.googleapis.com/projects/my-project/locations/global/hubs/hub-1'\"", + "description": "CEL expression that specifies the match condition that egress traffic from a VM is evaluated against. If it evaluates to true, the corresponding `action` is enforced. The following examples are valid match expressions for public NAT: `inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')` `destination.ip == '1.1.0.1' || destination.ip == '8.8.8.8'` The following example is a valid match expression for private NAT: `nexthop.hub == '//networkconnectivity.googleapis.com/projects/my-project/locations/global/hubs/hub-1'`", "type": "string" }, "ruleNumber": { @@ -84128,14 +84629,14 @@ "id": "RouterStatus", "properties": { "bestRoutes": { - "description": "Best routes for this router's network.", + "description": "A list of the best dynamic routes for this Cloud Router's Virtual Private Cloud (VPC) network in the same region as this Cloud Router. Lists all of the best routes per prefix that are programmed into this region's VPC data plane. When global dynamic routing mode is turned on in the VPC network, this list can include cross-region dynamic routes from Cloud Routers in other regions.", "items": { "$ref": "Route" }, "type": "array" }, "bestRoutesForRouter": { - "description": "Best routes learned by this router.", + "description": "A list of the best BGP routes learned by this Cloud Router. It is possible that routes listed might not be programmed into the data plane, if the Google Cloud control plane finds a more optimal route for a prefix than a route learned by this Cloud Router.", "items": { "$ref": "Route" }, @@ -90615,7 +91116,12 @@ "type": "string" }, "poolProvisionedCapacityGb": { - "description": "Size, in GiB, of the storage pool.", + "annotations": { + "required": [ + "compute.storagePools.insert" + ] + }, + "description": "Size, in GiB, of the storage pool. For more information about the size limits, see https://cloud.google.com/compute/docs/disks/storage-pools.", "format": "int64", "type": "string" }, @@ -91292,7 +91798,7 @@ "type": "string" }, "poolUsedIops": { - "description": "Sum of all the disks' provisioned IOPS, minus some amount that is allowed per disk that is not counted towards pool's IOPS capacity.", + "description": "[Output Only] Sum of all the disks' provisioned IOPS, minus some amount that is allowed per disk that is not counted towards pool's IOPS capacity. For more information, see https://cloud.google.com/compute/docs/disks/storage-pools.", "format": "int64", "type": "string" }, diff --git a/compute/v0.alpha/compute-gen.go b/compute/v0.alpha/compute-gen.go index 01a4f11f998..9e305832a60 100644 --- a/compute/v0.alpha/compute-gen.go +++ b/compute/v0.alpha/compute-gen.go @@ -228,6 +228,7 @@ func New(client *http.Client) (*Service, error) { s.RegionInstanceTemplates = NewRegionInstanceTemplatesService(s) s.RegionInstances = NewRegionInstancesService(s) s.RegionInstantSnapshots = NewRegionInstantSnapshotsService(s) + s.RegionMultiMigs = NewRegionMultiMigsService(s) s.RegionNetworkEndpointGroups = NewRegionNetworkEndpointGroupsService(s) s.RegionNetworkFirewallPolicies = NewRegionNetworkFirewallPoliciesService(s) s.RegionNotificationEndpoints = NewRegionNotificationEndpointsService(s) @@ -412,6 +413,8 @@ type Service struct { RegionInstantSnapshots *RegionInstantSnapshotsService + RegionMultiMigs *RegionMultiMigsService + RegionNetworkEndpointGroups *RegionNetworkEndpointGroupsService RegionNetworkFirewallPolicies *RegionNetworkFirewallPoliciesService @@ -1107,6 +1110,15 @@ type RegionInstantSnapshotsService struct { s *Service } +func NewRegionMultiMigsService(s *Service) *RegionMultiMigsService { + rs := &RegionMultiMigsService{s: s} + return rs +} + +type RegionMultiMigsService struct { + s *Service +} + func NewRegionNetworkEndpointGroupsService(s *Service) *RegionNetworkEndpointGroupsService { rs := &RegionNetworkEndpointGroupsService{s: s} return rs @@ -2946,6 +2958,34 @@ func (s *AllocationAggregateReservationReservedResourceInfoAccelerator) MarshalJ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +type AllocationReservationSharingPolicy struct { + // ServiceShareType: Sharing config for all Google Cloud services. + // + // Possible values: + // "ALLOW_ALL" - Allow all Google Cloud managed services to share + // reservations. + // "DISALLOW_ALL" - [Default] Disallow sharing with all Google Cloud + // services. + // "SERVICE_SHARE_TYPE_UNSPECIFIED" + ServiceShareType string `json:"serviceShareType,omitempty"` + // ForceSendFields is a list of field names (e.g. "ServiceShareType") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ServiceShareType") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *AllocationReservationSharingPolicy) MarshalJSON() ([]byte, error) { + type NoMethod AllocationReservationSharingPolicy + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // AllocationResourceStatus: [Output Only] Contains output only fields. type AllocationResourceStatus struct { // SpecificSkuAllocation: Allocation Properties of this reservation. @@ -19389,6 +19429,26 @@ type InstanceGroupManagerInstanceLifecyclePolicy struct { // is unset, the Instance Group Manager will directly proceed to suspend / stop // instances, skipping initialization on them. MetadataBasedReadinessSignal *InstanceGroupManagerInstanceLifecyclePolicyMetadataBasedReadinessSignal `json:"metadataBasedReadinessSignal,omitempty"` + // OnFailedHealthCheck: The action that a MIG performs on an unhealthy VM. A VM + // is marked as unhealthy when the application running on that VM fails a + // health check. Valid values are: - DEFAULT_ACTION (default): The MIG performs + // the same action as specified in the + // instanceLifecyclePolicy.defaultActionOnFailure field. If the + // defaultActionOnFailure field is set to REPAIR, then the MIG repairs + // unhealthy VMs. If the defaultActionOnFailure field is set to DO_NOTHING, + // then the MIG doesn't repair unhealthy VMs. - REPAIR: The MIG repairs + // unhealthy VMs by recreating it. - DO_NOTHING: The MIG doesn't repair + // unhealthy VMs. For more information, see About repairing VMs in a MIG. + // + // Possible values: + // "DEFAULT_ACTION" - (Default) The MIG performs the same action as specified + // in the instanceLifecyclePolicy.defaultActionOnFailure field. If the + // defaultActionOnFailure field is set to REPAIR, then the MIG repairs + // unhealthy VMs. If the defaultActionOnFailure field is set to DO_NOTHING, + // then the MIG doesn't repair unhealthy VMs. + // "DO_NOTHING" - The MIG doesn't repair unhealthy VMs. + // "REPAIR" - The MIG repairs unhealthy VMs by recreating it. + OnFailedHealthCheck string `json:"onFailedHealthCheck,omitempty"` // ForceSendFields is a list of field names (e.g. "DefaultActionOnFailure") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See @@ -22117,10 +22177,11 @@ type InstanceProperties struct { // Labels: Labels to apply to instances that are created from these properties. Labels map[string]string `json:"labels,omitempty"` // MachineType: The machine type to use for instances that are created from - // these properties. This field only accept machine types name. e.g. - // n2-standard-4 and does not accept machine type full or partial url. e.g. - // projects/my-l7ilb-project/zones/us-central1-a/machineTypes/n2-standard-4 - // will throw INTERNAL_ERROR. + // these properties. This field only accepts a machine type name, for example + // `n2-standard-4`. If you use the machine type full or partial URL, for + // example + // `projects/my-l7ilb-project/zones/us-central1-a/machineTypes/n2-standard-4`, + // the request will result in an `INTERNAL_ERROR`. MachineType string `json:"machineType,omitempty"` // Metadata: The metadata key/value pairs to assign to instances that are // created from these properties. These pairs can consist of custom metadata or @@ -24268,10 +24329,9 @@ func (s *InterconnectApplicationAwareInterconnect) MarshalJSON() ([]byte, error) } // InterconnectApplicationAwareInterconnectBandwidthPercentage: Specify -// bandwidth percentages (0-100) for various traffic classes in -// BandwidthPercentagePolicy. The sum of all percentages must equal 100. It is -// valid to specify percentages for some classes and not for others. The others -// will be implicitly marked as 0. +// bandwidth percentages [1-100] for various traffic classes in +// BandwidthPercentagePolicy. The sum of all percentages must equal 100. All +// traffic classes must have a percentage value specified. type InterconnectApplicationAwareInterconnectBandwidthPercentage struct { // Percentage: Bandwidth percentage for a specific traffic class. Percentage int64 `json:"percentage,omitempty"` @@ -29057,6 +29117,295 @@ func (s *Money) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// MultiMig: MultiMIG represents a group of Managed Instance Groups. +type MultiMig struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + // Description: An optional description of this resource. Provide this property + // when you create the resource. + Description string `json:"description,omitempty"` + // Id: [Output Only] The unique identifier for the resource. This identifier is + // defined by the server. + Id uint64 `json:"id,omitempty,string"` + // Kind: [Output Only] Type of the resource. Always compute#multiMig for + // MultiMIGs. + Kind string `json:"kind,omitempty"` + LocationPolicy *MultiMigLocationPolicy `json:"locationPolicy,omitempty"` + // Name: Name of the resource. Provided by the client when the resource is + // created. The name must be 1-63 characters long, and comply with RFC1035. + // Specifically, the name must be 1-63 characters long and match the regular + // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must + // be a lowercase letter, and all following characters must be a dash, + // lowercase letter, or digit, except the last character, which cannot be a + // dash. + Name string `json:"name,omitempty"` + // Parts: User-provided names for Parts of MultiMIG and the Parts themselves. + Parts map[string]MultiMigPart `json:"parts,omitempty"` + // Region: [Output Only] URL of the region where the resource resides. Only + // applicable for regional resources. You must specify this field as part of + // the HTTP request URL. It is not settable as a field in the request body. + Region string `json:"region,omitempty"` + // SchedulingPolicy: Policy for handling provisioning and other + // scheduling-related events. + SchedulingPolicy *MultiMigSchedulingPolicy `json:"schedulingPolicy,omitempty"` + // SelfLink: [Output only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + // SelfLinkWithId: [Output Only] Server-defined URL for this resource with the + // resource id. + SelfLinkWithId string `json:"selfLinkWithId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "CreationTimestamp") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *MultiMig) MarshalJSON() ([]byte, error) { + type NoMethod MultiMig + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// MultiMigLocationPolicy: Policy regarding where to create MIGs Initially only +// zonal MIGs in the same zone are supported. +type MultiMigLocationPolicy struct { + // ProvisioningZones: List of zones where MIGs will be provisioned. Should be + // valid RFC1035 name + ProvisioningZones []string `json:"provisioningZones,omitempty"` + // ForceSendFields is a list of field names (e.g. "ProvisioningZones") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ProvisioningZones") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *MultiMigLocationPolicy) MarshalJSON() ([]byte, error) { + type NoMethod MultiMigLocationPolicy + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// MultiMigPart: Config for an MMIG part. +type MultiMigPart struct { + // InstanceGroupManager: Link to an existing InstanceGroupManager that will be + // adopted by a MultiMIG. + InstanceGroupManager string `json:"instanceGroupManager,omitempty"` + // InstanceGroupManagerProperties: InstanceGroupManager to be created by the + // multiMig + InstanceGroupManagerProperties *InstanceGroupManager `json:"instanceGroupManagerProperties,omitempty"` + // ForceSendFields is a list of field names (e.g. "InstanceGroupManager") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "InstanceGroupManager") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *MultiMigPart) MarshalJSON() ([]byte, error) { + type NoMethod MultiMigPart + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// MultiMigSchedulingPolicy: Policy for handling provisioning and other +// scheduling-related events. +type MultiMigSchedulingPolicy struct { + // Provisioning: How provisioning of MIGs should be scheduled (coordinated or + // not) + // + // Possible values: + // "ANY" - Allows idependent lifecycles of parts. + // "COOORDINATED" - Requires all parts at the same time. + Provisioning string `json:"provisioning,omitempty"` + // ForceSendFields is a list of field names (e.g. "Provisioning") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Provisioning") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *MultiMigSchedulingPolicy) MarshalJSON() ([]byte, error) { + type NoMethod MultiMigSchedulingPolicy + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +type MultiMigsList struct { + Etag string `json:"etag,omitempty"` + // Id: Unique identifier for the resource; defined by the server. + Id string `json:"id,omitempty"` + // Items: A list of MultiMig resources. + Items []*MultiMig `json:"items,omitempty"` + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + // NextPageToken: This token allows you to get the next page of results for + // maxResults, use the nextPageToken as a value for the query parameter + // pageToken in the next list request. Subsequent list requests will have their + // own nextPageToken to continue paging through the results. + NextPageToken string `json:"nextPageToken,omitempty"` + // SelfLink: [Output only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + // Unreachables: [Output only] Unreachable resources. + Unreachables []string `json:"unreachables,omitempty"` + // Warning: Informational warning message. + Warning *MultiMigsListWarning `json:"warning,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Etag") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *MultiMigsList) MarshalJSON() ([]byte, error) { + type NoMethod MultiMigsList + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// MultiMigsListWarning: Informational warning message. +type MultiMigsListWarning struct { + // Code: [Output Only] A warning code, if applicable. For example, Compute + // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + // + // Possible values: + // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made + // by a failed operation. + // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created. + // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources + // has a type marked as deprecated + // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is + // larger than image size. + // "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the + // resources has a type marked as experimental + // "EXTERNAL_API_WARNING" - Warning that is present in an external api call + // "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been + // overridden. Deprecated unused field. + // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected + // kernel, which is deprecated. + // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend + // service is associated with a health check that is not of type + // HTTP/HTTPS/HTTP2. + // "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a + // exceedingly large number of resources + // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list + // overhead quota exceed which captures the amount of resources filtered out by + // user-defined list filter. + // "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type + // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not + // assigned to an instance on the network. + // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip + // forward. + // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance + // URL refers to an instance that does not have an ipv6 interface on the same + // network as the route. + // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to + // an instance that does not exist. + // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL + // refers to an instance that is not on the same network as the route. + // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a + // status of RUNNING. + // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue + // the process despite the mentioned error. + // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. + // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing + // due to errors + // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that + // requires a TOS they have not accepted. + // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is + // in use. + // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete + // could not be deleted because they were in use. + // "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is + // ignored. + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance + // group manager is valid as such, but its application does not make a lot of + // sense, because it allows only single instance in instance group. + // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are + // present + // "UNREACHABLE" - A given scope cannot be reached. + Code string `json:"code,omitempty"` + // Data: [Output Only] Metadata about this warning in key: value format. For + // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" } + Data []*MultiMigsListWarningData `json:"data,omitempty"` + // Message: [Output Only] A human-readable description of the warning code. + Message string `json:"message,omitempty"` + // ForceSendFields is a list of field names (e.g. "Code") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Code") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *MultiMigsListWarning) MarshalJSON() ([]byte, error) { + type NoMethod MultiMigsListWarning + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +type MultiMigsListWarningData struct { + // Key: [Output Only] A key that provides more detail on the warning being + // returned. For example, for warnings where there are no results in a list + // request for a particular zone, this key might be scope and the key value + // might be the zone name. Other examples might be a key indicating a + // deprecated resource and a suggested replacement, or a warning about invalid + // network settings (for example, if an instance attempts to perform IP + // forwarding but is not enabled for IP forwarding). + Key string `json:"key,omitempty"` + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + // ForceSendFields is a list of field names (e.g. "Key") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Key") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *MultiMigsListWarningData) MarshalJSON() ([]byte, error) { + type NoMethod MultiMigsListWarningData + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // MutualTls: [Deprecated] Configuration for the mutual Tls mode for peer // authentication. Configuration for the mutual Tls mode for peer // authentication. @@ -42169,6 +42518,10 @@ type Reservation struct { // must be a dash, lowercase letter, or digit, except the last character, which // cannot be a dash. Name string `json:"name,omitempty"` + // ReservationSharingPolicy: Specify the reservation sharing policy. If + // unspecified, the reservation will not be shared with Google Cloud managed + // services. + ReservationSharingPolicy *AllocationReservationSharingPolicy `json:"reservationSharingPolicy,omitempty"` // ResourcePolicies: Resource policies to be added to this reservation. The key // is defined by user, and the value is resource policy url. This is to define // placement policy with reservation. @@ -44120,10 +44473,15 @@ type Route struct { // NextHopIlb: The URL to a forwarding rule of type // loadBalancingScheme=INTERNAL that should handle matching packets or the IP // address of the forwarding Rule. For example, the following are all valid - // URLs: - 10.128.0.56 - + // URLs: - // https://www.googleapis.com/compute/v1/projects/project/regions/region // /forwardingRules/forwardingRule - - // regions/region/forwardingRules/forwardingRule + // regions/region/forwardingRules/forwardingRule If an IP address is provided, + // must specify an IPv4 address in dot-decimal notation or an IPv6 address in + // RFC 4291 format. For example, the following are all valid IP addresses: - + // 10.128.0.56 - 2001:db8::2d9:51:0:0 - 2001:db8:0:0:2d9:51:0:0 IPv6 addresses + // will be displayed using RFC 5952 compressed format (e.g. + // 2001:db8::2d9:51:0:0). Should never be an IPv4-mapped IPv6 address. NextHopIlb string `json:"nextHopIlb,omitempty"` // NextHopInstance: The URL to an instance that should handle matching packets. // You can specify this as a full or partial URL. For example: @@ -45610,12 +45968,12 @@ type RouterNatRule struct { // Match: CEL expression that specifies the match condition that egress traffic // from a VM is evaluated against. If it evaluates to true, the corresponding // `action` is enforced. The following examples are valid match expressions for - // public NAT: "inIpRange(destination.ip, '1.1.0.0/16') || - // inIpRange(destination.ip, '2.2.0.0/16')" "destination.ip == '1.1.0.1' || - // destination.ip == '8.8.8.8'" The following example is a valid match - // expression for private NAT: "nexthop.hub == + // public NAT: `inIpRange(destination.ip, '1.1.0.0/16') || + // inIpRange(destination.ip, '2.2.0.0/16')` `destination.ip == '1.1.0.1' || + // destination.ip == '8.8.8.8'` The following example is a valid match + // expression for private NAT: `nexthop.hub == // '//networkconnectivity.googleapis.com/projects/my-project/locations/global/hu - // bs/hub-1'" + // bs/hub-1'` Match string `json:"match,omitempty"` // RuleNumber: An integer uniquely identifying a rule in the list. The rule // number must be a positive value between 0 and 65000, and must be unique @@ -45718,9 +46076,17 @@ func (s *RouterNatSubnetworkToNat) MarshalJSON() ([]byte, error) { } type RouterStatus struct { - // BestRoutes: Best routes for this router's network. + // BestRoutes: A list of the best dynamic routes for this Cloud Router's + // Virtual Private Cloud (VPC) network in the same region as this Cloud Router. + // Lists all of the best routes per prefix that are programmed into this + // region's VPC data plane. When global dynamic routing mode is turned on in + // the VPC network, this list can include cross-region dynamic routes from + // Cloud Routers in other regions. BestRoutes []*Route `json:"bestRoutes,omitempty"` - // BestRoutesForRouter: Best routes learned by this router. + // BestRoutesForRouter: A list of the best BGP routes learned by this Cloud + // Router. It is possible that routes listed might not be programmed into the + // data plane, if the Google Cloud control plane finds a more optimal route for + // a prefix than a route learned by this Cloud Router. BestRoutesForRouter []*Route `json:"bestRoutesForRouter,omitempty"` BgpPeerStatus []*RouterStatusBgpPeerStatus `json:"bgpPeerStatus,omitempty"` NatStatus []*RouterStatusNatStatus `json:"natStatus,omitempty"` @@ -52819,7 +53185,9 @@ type StoragePool struct { // pool disks' exclusive use. // "UNSPECIFIED" PerformanceProvisioningType string `json:"performanceProvisioningType,omitempty"` - // PoolProvisionedCapacityGb: Size, in GiB, of the storage pool. + // PoolProvisionedCapacityGb: Size, in GiB, of the storage pool. For more + // information about the size limits, see + // https://cloud.google.com/compute/docs/disks/storage-pools. PoolProvisionedCapacityGb int64 `json:"poolProvisionedCapacityGb,omitempty,string"` // PoolProvisionedIops: Provisioned IOPS of the storage pool. Only relevant if // the storage pool type is hyperdisk-balanced. @@ -53431,8 +53799,10 @@ type StoragePoolResourceStatus struct { // bytes written to the disks in the pool, in contrast to the capacity of those // disks. PoolUsedCapacityBytes int64 `json:"poolUsedCapacityBytes,omitempty,string"` - // PoolUsedIops: Sum of all the disks' provisioned IOPS, minus some amount that - // is allowed per disk that is not counted towards pool's IOPS capacity. + // PoolUsedIops: [Output Only] Sum of all the disks' provisioned IOPS, minus + // some amount that is allowed per disk that is not counted towards pool's IOPS + // capacity. For more information, see + // https://cloud.google.com/compute/docs/disks/storage-pools. PoolUsedIops int64 `json:"poolUsedIops,omitempty,string"` // PoolUsedThroughput: [Output Only] Sum of all the disks' provisioned // throughput in MB/s. diff --git a/compute/v0.alpha/compute2-gen.go b/compute/v0.alpha/compute2-gen.go index 6e707e65173..0a25fd0fc5b 100644 --- a/compute/v0.alpha/compute2-gen.go +++ b/compute/v0.alpha/compute2-gen.go @@ -67588,3 +67588,936 @@ func (c *PublicDelegatedPrefixesWithdrawCall) Do(opts ...googleapi.CallOption) ( } return ret, nil } + +type RegionAutoscalersDeleteCall struct { + s *Service + project string + region string + autoscaler string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes the specified autoscaler. +// +// - autoscaler: Name of the autoscaler to delete. +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionAutoscalersService) Delete(project string, region string, autoscaler string) *RegionAutoscalersDeleteCall { + c := &RegionAutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.autoscaler = autoscaler + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *RegionAutoscalersDeleteCall) RequestId(requestId string) *RegionAutoscalersDeleteCall { + c.urlParams_.Set("requestId", requestId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *RegionAutoscalersDeleteCall) Fields(s ...googleapi.Field) *RegionAutoscalersDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *RegionAutoscalersDeleteCall) Context(ctx context.Context) *RegionAutoscalersDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *RegionAutoscalersDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionAutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers/{autoscaler}") + 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{ + "project": c.project, + "region": c.region, + "autoscaler": c.autoscaler, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionAutoscalers.delete" call. +// Any non-2xx status code is an error. Response headers are in either +// *Operation.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 *RegionAutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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 := &Operation{ + 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 +} + +type RegionAutoscalersGetCall struct { + s *Service + project string + region string + autoscaler string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Returns the specified autoscaler. +// +// - autoscaler: Name of the autoscaler to return. +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionAutoscalersService) Get(project string, region string, autoscaler string) *RegionAutoscalersGetCall { + c := &RegionAutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.autoscaler = autoscaler + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *RegionAutoscalersGetCall) Fields(s ...googleapi.Field) *RegionAutoscalersGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *RegionAutoscalersGetCall) IfNoneMatch(entityTag string) *RegionAutoscalersGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *RegionAutoscalersGetCall) Context(ctx context.Context) *RegionAutoscalersGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *RegionAutoscalersGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionAutoscalersGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "projects/{project}/regions/{region}/autoscalers/{autoscaler}") + 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{ + "project": c.project, + "region": c.region, + "autoscaler": c.autoscaler, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionAutoscalers.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *Autoscaler.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 *RegionAutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, 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 := &Autoscaler{ + 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 +} + +type RegionAutoscalersInsertCall struct { + s *Service + project string + region string + autoscaler *Autoscaler + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Insert: Creates an autoscaler in the specified project using the data +// included in the request. +// +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionAutoscalersService) Insert(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersInsertCall { + c := &RegionAutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.autoscaler = autoscaler + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *RegionAutoscalersInsertCall) RequestId(requestId string) *RegionAutoscalersInsertCall { + c.urlParams_.Set("requestId", requestId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *RegionAutoscalersInsertCall) Fields(s ...googleapi.Field) *RegionAutoscalersInsertCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *RegionAutoscalersInsertCall) Context(ctx context.Context) *RegionAutoscalersInsertCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *RegionAutoscalersInsertCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionAutoscalersInsertCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers") + 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{ + "project": c.project, + "region": c.region, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionAutoscalers.insert" call. +// Any non-2xx status code is an error. Response headers are in either +// *Operation.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 *RegionAutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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 := &Operation{ + 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 +} + +type RegionAutoscalersListCall struct { + s *Service + project string + region string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Retrieves a list of autoscalers contained within the specified region. +// +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionAutoscalersService) List(project string, region string) *RegionAutoscalersListCall { + c := &RegionAutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + return c +} + +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *RegionAutoscalersListCall) Filter(filter string) *RegionAutoscalersListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *RegionAutoscalersListCall) MaxResults(maxResults int64) *RegionAutoscalersListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *RegionAutoscalersListCall) OrderBy(orderBy string) *RegionAutoscalersListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *RegionAutoscalersListCall) PageToken(pageToken string) *RegionAutoscalersListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *RegionAutoscalersListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionAutoscalersListCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *RegionAutoscalersListCall) Fields(s ...googleapi.Field) *RegionAutoscalersListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *RegionAutoscalersListCall) IfNoneMatch(entityTag string) *RegionAutoscalersListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *RegionAutoscalersListCall) Context(ctx context.Context) *RegionAutoscalersListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *RegionAutoscalersListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionAutoscalersListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "projects/{project}/regions/{region}/autoscalers") + 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{ + "project": c.project, + "region": c.region, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionAutoscalers.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *RegionAutoscalerList.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 *RegionAutoscalersListCall) Do(opts ...googleapi.CallOption) (*RegionAutoscalerList, 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 := &RegionAutoscalerList{ + 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 +} + +// 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 *RegionAutoscalersListCall) Pages(ctx context.Context, f func(*RegionAutoscalerList) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type RegionAutoscalersPatchCall struct { + s *Service + project string + region string + autoscaler *Autoscaler + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates an autoscaler in the specified project using the data +// included in the request. This method supports PATCH semantics and uses the +// JSON merge patch format and processing rules. +// +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionAutoscalersService) Patch(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersPatchCall { + c := &RegionAutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.autoscaler = autoscaler + return c +} + +// Autoscaler sets the optional parameter "autoscaler": Name of the autoscaler +// to patch. +func (c *RegionAutoscalersPatchCall) Autoscaler(autoscaler string) *RegionAutoscalersPatchCall { + c.urlParams_.Set("autoscaler", autoscaler) + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *RegionAutoscalersPatchCall) RequestId(requestId string) *RegionAutoscalersPatchCall { + c.urlParams_.Set("requestId", requestId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *RegionAutoscalersPatchCall) Fields(s ...googleapi.Field) *RegionAutoscalersPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *RegionAutoscalersPatchCall) Context(ctx context.Context) *RegionAutoscalersPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *RegionAutoscalersPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionAutoscalersPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers") + 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{ + "project": c.project, + "region": c.region, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionAutoscalers.patch" call. +// Any non-2xx status code is an error. Response headers are in either +// *Operation.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 *RegionAutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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 := &Operation{ + 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 +} + +type RegionAutoscalersTestIamPermissionsCall struct { + s *Service + project string + region string + resource string + testpermissionsrequest *TestPermissionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// TestIamPermissions: Returns permissions that a caller has on the specified +// resource. +// +// - project: Project ID for this request. +// - region: The name of the region for this request. +// - resource: Name or id of the resource for this request. +func (r *RegionAutoscalersService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionAutoscalersTestIamPermissionsCall { + c := &RegionAutoscalersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.resource = resource + c.testpermissionsrequest = testpermissionsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *RegionAutoscalersTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionAutoscalersTestIamPermissionsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *RegionAutoscalersTestIamPermissionsCall) Context(ctx context.Context) *RegionAutoscalersTestIamPermissionsCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *RegionAutoscalersTestIamPermissionsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionAutoscalersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers/{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{ + "project": c.project, + "region": c.region, + "resource": c.resource, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionAutoscalers.testIamPermissions" call. +// Any non-2xx status code is an error. Response headers are in either +// *TestPermissionsResponse.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 *RegionAutoscalersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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 := &TestPermissionsResponse{ + 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 +} + +type RegionAutoscalersUpdateCall struct { + s *Service + project string + region string + autoscaler *Autoscaler + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Update: Updates an autoscaler in the specified project using the data +// included in the request. +// +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionAutoscalersService) Update(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersUpdateCall { + c := &RegionAutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.autoscaler = autoscaler + return c +} + +// Autoscaler sets the optional parameter "autoscaler": Name of the autoscaler +// to update. +func (c *RegionAutoscalersUpdateCall) Autoscaler(autoscaler string) *RegionAutoscalersUpdateCall { + c.urlParams_.Set("autoscaler", autoscaler) + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *RegionAutoscalersUpdateCall) RequestId(requestId string) *RegionAutoscalersUpdateCall { + c.urlParams_.Set("requestId", requestId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *RegionAutoscalersUpdateCall) Fields(s ...googleapi.Field) *RegionAutoscalersUpdateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *RegionAutoscalersUpdateCall) Context(ctx context.Context) *RegionAutoscalersUpdateCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *RegionAutoscalersUpdateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionAutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PUT", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionAutoscalers.update" call. +// Any non-2xx status code is an error. Response headers are in either +// *Operation.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 *RegionAutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, 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 := &Operation{ + 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 +} diff --git a/compute/v0.alpha/compute3-gen.go b/compute/v0.alpha/compute3-gen.go index e16b2fe10ba..9dc7a254be0 100644 --- a/compute/v0.alpha/compute3-gen.go +++ b/compute/v0.alpha/compute3-gen.go @@ -16,26 +16,26 @@ import ( gensupport "google.golang.org/api/internal/gensupport" ) -type RegionAutoscalersDeleteCall struct { - s *Service - project string - region string - autoscaler string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionBackendServicesDeleteCall struct { + s *Service + project string + region string + backendService string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes the specified autoscaler. +// Delete: Deletes the specified regional BackendService resource. // -// - autoscaler: Name of the autoscaler to delete. +// - backendService: Name of the BackendService resource to delete. // - project: Project ID for this request. // - region: Name of the region scoping this request. -func (r *RegionAutoscalersService) Delete(project string, region string, autoscaler string) *RegionAutoscalersDeleteCall { - c := &RegionAutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *RegionBackendServicesService) Delete(project string, region string, backendService string) *RegionBackendServicesDeleteCall { + c := &RegionBackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.autoscaler = autoscaler + c.backendService = backendService return c } @@ -49,7 +49,7 @@ func (r *RegionAutoscalersService) Delete(project string, region string, autosca // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionAutoscalersDeleteCall) RequestId(requestId string) *RegionAutoscalersDeleteCall { +func (c *RegionBackendServicesDeleteCall) RequestId(requestId string) *RegionBackendServicesDeleteCall { c.urlParams_.Set("requestId", requestId) return c } @@ -57,32 +57,32 @@ func (c *RegionAutoscalersDeleteCall) RequestId(requestId string) *RegionAutosca // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionAutoscalersDeleteCall) Fields(s ...googleapi.Field) *RegionAutoscalersDeleteCall { +func (c *RegionBackendServicesDeleteCall) Fields(s ...googleapi.Field) *RegionBackendServicesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionAutoscalersDeleteCall) Context(ctx context.Context) *RegionAutoscalersDeleteCall { +func (c *RegionBackendServicesDeleteCall) Context(ctx context.Context) *RegionBackendServicesDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionAutoscalersDeleteCall) Header() http.Header { +func (c *RegionBackendServicesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionAutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionBackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers/{autoscaler}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{backendService}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("DELETE", urls, body) if err != nil { @@ -90,19 +90,19 @@ func (c *RegionAutoscalersDeleteCall) doRequest(alt string) (*http.Response, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "autoscaler": c.autoscaler, + "project": c.project, + "region": c.region, + "backendService": c.backendService, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionAutoscalers.delete" call. +// Do executes the "compute.regionBackendServices.delete" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.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 *RegionAutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionBackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -134,34 +134,34 @@ func (c *RegionAutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operati return ret, nil } -type RegionAutoscalersGetCall struct { - s *Service - project string - region string - autoscaler string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type RegionBackendServicesGetCall struct { + s *Service + project string + region string + backendService string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Get: Returns the specified autoscaler. +// Get: Returns the specified regional BackendService resource. // -// - autoscaler: Name of the autoscaler to return. +// - backendService: Name of the BackendService resource to return. // - project: Project ID for this request. // - region: Name of the region scoping this request. -func (r *RegionAutoscalersService) Get(project string, region string, autoscaler string) *RegionAutoscalersGetCall { - c := &RegionAutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *RegionBackendServicesService) Get(project string, region string, backendService string) *RegionBackendServicesGetCall { + c := &RegionBackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.autoscaler = autoscaler + c.backendService = backendService return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionAutoscalersGetCall) Fields(s ...googleapi.Field) *RegionAutoscalersGetCall { +func (c *RegionBackendServicesGetCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -169,27 +169,27 @@ func (c *RegionAutoscalersGetCall) Fields(s ...googleapi.Field) *RegionAutoscale // IfNoneMatch sets an 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. -func (c *RegionAutoscalersGetCall) IfNoneMatch(entityTag string) *RegionAutoscalersGetCall { +func (c *RegionBackendServicesGetCall) IfNoneMatch(entityTag string) *RegionBackendServicesGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *RegionAutoscalersGetCall) Context(ctx context.Context) *RegionAutoscalersGetCall { +func (c *RegionBackendServicesGetCall) Context(ctx context.Context) *RegionBackendServicesGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionAutoscalersGetCall) Header() http.Header { +func (c *RegionBackendServicesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionAutoscalersGetCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionBackendServicesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -197,7 +197,7 @@ func (c *RegionAutoscalersGetCall) doRequest(alt string) (*http.Response, error) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers/{autoscaler}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{backendService}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -205,19 +205,19 @@ func (c *RegionAutoscalersGetCall) doRequest(alt string) (*http.Response, error) } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "autoscaler": c.autoscaler, + "project": c.project, + "region": c.region, + "backendService": c.backendService, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionAutoscalers.get" call. +// Do executes the "compute.regionBackendServices.get" call. // Any non-2xx status code is an error. Response headers are in either -// *Autoscaler.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// *BackendService.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 *RegionAutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, error) { +func (c *RegionBackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -236,7 +236,7 @@ func (c *RegionAutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Autoscaler{ + ret := &BackendService{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -249,77 +249,66 @@ func (c *RegionAutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler return ret, nil } -type RegionAutoscalersInsertCall struct { - s *Service - project string - region string - autoscaler *Autoscaler - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionBackendServicesGetHealthCall struct { + s *Service + project string + region string + backendService string + resourcegroupreference *ResourceGroupReference + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Insert: Creates an autoscaler in the specified project using the data -// included in the request. +// GetHealth: Gets the most recent health check results for this regional +// BackendService. // -// - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *RegionAutoscalersService) Insert(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersInsertCall { - c := &RegionAutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - backendService: Name of the BackendService resource for which to get +// health. +// - project: . +// - region: Name of the region scoping this request. +func (r *RegionBackendServicesService) GetHealth(project string, region string, backendService string, resourcegroupreference *ResourceGroupReference) *RegionBackendServicesGetHealthCall { + c := &RegionBackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.autoscaler = autoscaler - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionAutoscalersInsertCall) RequestId(requestId string) *RegionAutoscalersInsertCall { - c.urlParams_.Set("requestId", requestId) + c.backendService = backendService + c.resourcegroupreference = resourcegroupreference return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionAutoscalersInsertCall) Fields(s ...googleapi.Field) *RegionAutoscalersInsertCall { +func (c *RegionBackendServicesGetHealthCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetHealthCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionAutoscalersInsertCall) Context(ctx context.Context) *RegionAutoscalersInsertCall { +func (c *RegionBackendServicesGetHealthCall) Context(ctx context.Context) *RegionBackendServicesGetHealthCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionAutoscalersInsertCall) Header() http.Header { +func (c *RegionBackendServicesGetHealthCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionAutoscalersInsertCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionBackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{backendService}/getHealth") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -327,18 +316,20 @@ func (c *RegionAutoscalersInsertCall) doRequest(alt string) (*http.Response, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, + "project": c.project, + "region": c.region, + "backendService": c.backendService, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionAutoscalers.insert" call. +// Do executes the "compute.regionBackendServices.getHealth" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.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 *RegionAutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// *BackendServiceGroupHealth.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 *RegionBackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -357,7 +348,7 @@ func (c *RegionAutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operati if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &BackendServiceGroupHealth{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -370,109 +361,42 @@ func (c *RegionAutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operati return ret, nil } -type RegionAutoscalersListCall struct { +type RegionBackendServicesGetIamPolicyCall struct { s *Service project string region string + resource string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Retrieves a list of autoscalers contained within the specified region. +// GetIamPolicy: Gets the access control policy for a resource. May be empty if +// no such policy or resource exists. // // - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *RegionAutoscalersService) List(project string, region string) *RegionAutoscalersListCall { - c := &RegionAutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: The name of the region for this request. +// - resource: Name or id of the resource for this request. +func (r *RegionBackendServicesService) GetIamPolicy(project string, region string, resource string) *RegionBackendServicesGetIamPolicyCall { + c := &RegionBackendServicesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region + c.resource = resource return c } -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *RegionAutoscalersListCall) Filter(filter string) *RegionAutoscalersListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *RegionAutoscalersListCall) MaxResults(maxResults int64) *RegionAutoscalersListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *RegionAutoscalersListCall) OrderBy(orderBy string) *RegionAutoscalersListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *RegionAutoscalersListCall) PageToken(pageToken string) *RegionAutoscalersListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *RegionAutoscalersListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionAutoscalersListCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) +// OptionsRequestedPolicyVersion sets the optional parameter +// "optionsRequestedPolicyVersion": Requested IAM Policy version. +func (c *RegionBackendServicesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *RegionBackendServicesGetIamPolicyCall { + c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionAutoscalersListCall) Fields(s ...googleapi.Field) *RegionAutoscalersListCall { +func (c *RegionBackendServicesGetIamPolicyCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetIamPolicyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -480,27 +404,27 @@ func (c *RegionAutoscalersListCall) Fields(s ...googleapi.Field) *RegionAutoscal // IfNoneMatch sets an 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. -func (c *RegionAutoscalersListCall) IfNoneMatch(entityTag string) *RegionAutoscalersListCall { +func (c *RegionBackendServicesGetIamPolicyCall) IfNoneMatch(entityTag string) *RegionBackendServicesGetIamPolicyCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *RegionAutoscalersListCall) Context(ctx context.Context) *RegionAutoscalersListCall { +func (c *RegionBackendServicesGetIamPolicyCall) Context(ctx context.Context) *RegionBackendServicesGetIamPolicyCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionAutoscalersListCall) Header() http.Header { +func (c *RegionBackendServicesGetIamPolicyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionAutoscalersListCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionBackendServicesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -508,7 +432,7 @@ func (c *RegionAutoscalersListCall) doRequest(alt string) (*http.Response, error var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -516,19 +440,19 @@ func (c *RegionAutoscalersListCall) doRequest(alt string) (*http.Response, error } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, + "project": c.project, + "region": c.region, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionAutoscalers.list" call. +// Do executes the "compute.regionBackendServices.getIamPolicy" call. // Any non-2xx status code is an error. Response headers are in either -// *RegionAutoscalerList.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 *RegionAutoscalersListCall) Do(opts ...googleapi.CallOption) (*RegionAutoscalerList, error) { +// *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 *RegionBackendServicesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -547,7 +471,7 @@ func (c *RegionAutoscalersListCall) Do(opts ...googleapi.CallOption) (*RegionAut if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &RegionAutoscalerList{ + ret := &Policy{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -560,55 +484,27 @@ func (c *RegionAutoscalersListCall) Do(opts ...googleapi.CallOption) (*RegionAut return ret, nil } -// 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 *RegionAutoscalersListCall) Pages(ctx context.Context, f func(*RegionAutoscalerList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type RegionAutoscalersPatchCall struct { - s *Service - project string - region string - autoscaler *Autoscaler - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionBackendServicesInsertCall struct { + s *Service + project string + region string + backendservice *BackendService + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates an autoscaler in the specified project using the data -// included in the request. This method supports PATCH semantics and uses the -// JSON merge patch format and processing rules. +// Insert: Creates a regional BackendService resource in the specified project +// using the data included in the request. For more information, see Backend +// services overview. // // - project: Project ID for this request. // - region: Name of the region scoping this request. -func (r *RegionAutoscalersService) Patch(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersPatchCall { - c := &RegionAutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *RegionBackendServicesService) Insert(project string, region string, backendservice *BackendService) *RegionBackendServicesInsertCall { + c := &RegionBackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.autoscaler = autoscaler - return c -} - -// Autoscaler sets the optional parameter "autoscaler": Name of the autoscaler -// to patch. -func (c *RegionAutoscalersPatchCall) Autoscaler(autoscaler string) *RegionAutoscalersPatchCall { - c.urlParams_.Set("autoscaler", autoscaler) + c.backendservice = backendservice return c } @@ -622,7 +518,7 @@ func (c *RegionAutoscalersPatchCall) Autoscaler(autoscaler string) *RegionAutosc // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionAutoscalersPatchCall) RequestId(requestId string) *RegionAutoscalersPatchCall { +func (c *RegionBackendServicesInsertCall) RequestId(requestId string) *RegionBackendServicesInsertCall { c.urlParams_.Set("requestId", requestId) return c } @@ -630,38 +526,38 @@ func (c *RegionAutoscalersPatchCall) RequestId(requestId string) *RegionAutoscal // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionAutoscalersPatchCall) Fields(s ...googleapi.Field) *RegionAutoscalersPatchCall { +func (c *RegionBackendServicesInsertCall) Fields(s ...googleapi.Field) *RegionBackendServicesInsertCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionAutoscalersPatchCall) Context(ctx context.Context) *RegionAutoscalersPatchCall { +func (c *RegionBackendServicesInsertCall) Context(ctx context.Context) *RegionBackendServicesInsertCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionAutoscalersPatchCall) Header() http.Header { +func (c *RegionBackendServicesInsertCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionAutoscalersPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionBackendServicesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -673,841 +569,12 @@ func (c *RegionAutoscalersPatchCall) doRequest(alt string) (*http.Response, erro return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionAutoscalers.patch" call. +// Do executes the "compute.regionBackendServices.insert" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.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 *RegionAutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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 := &Operation{ - 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 -} - -type RegionAutoscalersTestIamPermissionsCall struct { - s *Service - project string - region string - resource string - testpermissionsrequest *TestPermissionsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// TestIamPermissions: Returns permissions that a caller has on the specified -// resource. -// -// - project: Project ID for this request. -// - region: The name of the region for this request. -// - resource: Name or id of the resource for this request. -func (r *RegionAutoscalersService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionAutoscalersTestIamPermissionsCall { - c := &RegionAutoscalersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - c.region = region - c.resource = resource - c.testpermissionsrequest = testpermissionsrequest - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *RegionAutoscalersTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionAutoscalersTestIamPermissionsCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *RegionAutoscalersTestIamPermissionsCall) Context(ctx context.Context) *RegionAutoscalersTestIamPermissionsCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *RegionAutoscalersTestIamPermissionsCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *RegionAutoscalersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) - if err != nil { - return nil, err - } - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers/{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{ - "project": c.project, - "region": c.region, - "resource": c.resource, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "compute.regionAutoscalers.testIamPermissions" call. -// Any non-2xx status code is an error. Response headers are in either -// *TestPermissionsResponse.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 *RegionAutoscalersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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 := &TestPermissionsResponse{ - 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 -} - -type RegionAutoscalersUpdateCall struct { - s *Service - project string - region string - autoscaler *Autoscaler - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Update: Updates an autoscaler in the specified project using the data -// included in the request. -// -// - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *RegionAutoscalersService) Update(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersUpdateCall { - c := &RegionAutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - c.region = region - c.autoscaler = autoscaler - return c -} - -// Autoscaler sets the optional parameter "autoscaler": Name of the autoscaler -// to update. -func (c *RegionAutoscalersUpdateCall) Autoscaler(autoscaler string) *RegionAutoscalersUpdateCall { - c.urlParams_.Set("autoscaler", autoscaler) - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionAutoscalersUpdateCall) RequestId(requestId string) *RegionAutoscalersUpdateCall { - c.urlParams_.Set("requestId", requestId) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *RegionAutoscalersUpdateCall) Fields(s ...googleapi.Field) *RegionAutoscalersUpdateCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *RegionAutoscalersUpdateCall) Context(ctx context.Context) *RegionAutoscalersUpdateCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *RegionAutoscalersUpdateCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *RegionAutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) - if err != nil { - return nil, err - } - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "compute.regionAutoscalers.update" call. -// Any non-2xx status code is an error. Response headers are in either -// *Operation.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 *RegionAutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, 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 := &Operation{ - 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 -} - -type RegionBackendServicesDeleteCall struct { - s *Service - project string - region string - backendService string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Delete: Deletes the specified regional BackendService resource. -// -// - backendService: Name of the BackendService resource to delete. -// - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *RegionBackendServicesService) Delete(project string, region string, backendService string) *RegionBackendServicesDeleteCall { - c := &RegionBackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - c.region = region - c.backendService = backendService - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionBackendServicesDeleteCall) RequestId(requestId string) *RegionBackendServicesDeleteCall { - c.urlParams_.Set("requestId", requestId) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *RegionBackendServicesDeleteCall) Fields(s ...googleapi.Field) *RegionBackendServicesDeleteCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *RegionBackendServicesDeleteCall) Context(ctx context.Context) *RegionBackendServicesDeleteCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *RegionBackendServicesDeleteCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *RegionBackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{backendService}") - 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{ - "project": c.project, - "region": c.region, - "backendService": c.backendService, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "compute.regionBackendServices.delete" call. -// Any non-2xx status code is an error. Response headers are in either -// *Operation.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 *RegionBackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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 := &Operation{ - 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 -} - -type RegionBackendServicesGetCall struct { - s *Service - project string - region string - backendService string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// Get: Returns the specified regional BackendService resource. -// -// - backendService: Name of the BackendService resource to return. -// - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *RegionBackendServicesService) Get(project string, region string, backendService string) *RegionBackendServicesGetCall { - c := &RegionBackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - c.region = region - c.backendService = backendService - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *RegionBackendServicesGetCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets an 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. -func (c *RegionBackendServicesGetCall) IfNoneMatch(entityTag string) *RegionBackendServicesGetCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *RegionBackendServicesGetCall) Context(ctx context.Context) *RegionBackendServicesGetCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *RegionBackendServicesGetCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *RegionBackendServicesGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - 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, "projects/{project}/regions/{region}/backendServices/{backendService}") - 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{ - "project": c.project, - "region": c.region, - "backendService": c.backendService, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "compute.regionBackendServices.get" call. -// Any non-2xx status code is an error. Response headers are in either -// *BackendService.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 *RegionBackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, 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 := &BackendService{ - 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 -} - -type RegionBackendServicesGetHealthCall struct { - s *Service - project string - region string - backendService string - resourcegroupreference *ResourceGroupReference - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// GetHealth: Gets the most recent health check results for this regional -// BackendService. -// -// - backendService: Name of the BackendService resource for which to get -// health. -// - project: . -// - region: Name of the region scoping this request. -func (r *RegionBackendServicesService) GetHealth(project string, region string, backendService string, resourcegroupreference *ResourceGroupReference) *RegionBackendServicesGetHealthCall { - c := &RegionBackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - c.region = region - c.backendService = backendService - c.resourcegroupreference = resourcegroupreference - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *RegionBackendServicesGetHealthCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetHealthCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *RegionBackendServicesGetHealthCall) Context(ctx context.Context) *RegionBackendServicesGetHealthCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *RegionBackendServicesGetHealthCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *RegionBackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference) - if err != nil { - return nil, err - } - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{backendService}/getHealth") - 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{ - "project": c.project, - "region": c.region, - "backendService": c.backendService, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "compute.regionBackendServices.getHealth" call. -// Any non-2xx status code is an error. Response headers are in either -// *BackendServiceGroupHealth.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 *RegionBackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, 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 := &BackendServiceGroupHealth{ - 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 -} - -type RegionBackendServicesGetIamPolicyCall struct { - s *Service - project string - region string - resource string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// GetIamPolicy: Gets the access control policy for a resource. May be empty if -// no such policy or resource exists. -// -// - project: Project ID for this request. -// - region: The name of the region for this request. -// - resource: Name or id of the resource for this request. -func (r *RegionBackendServicesService) GetIamPolicy(project string, region string, resource string) *RegionBackendServicesGetIamPolicyCall { - c := &RegionBackendServicesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - c.region = region - c.resource = resource - return c -} - -// OptionsRequestedPolicyVersion sets the optional parameter -// "optionsRequestedPolicyVersion": Requested IAM Policy version. -func (c *RegionBackendServicesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *RegionBackendServicesGetIamPolicyCall { - c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *RegionBackendServicesGetIamPolicyCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetIamPolicyCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets an 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. -func (c *RegionBackendServicesGetIamPolicyCall) IfNoneMatch(entityTag string) *RegionBackendServicesGetIamPolicyCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *RegionBackendServicesGetIamPolicyCall) Context(ctx context.Context) *RegionBackendServicesGetIamPolicyCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *RegionBackendServicesGetIamPolicyCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *RegionBackendServicesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - 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, "projects/{project}/regions/{region}/backendServices/{resource}/getIamPolicy") - 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{ - "project": c.project, - "region": c.region, - "resource": c.resource, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "compute.regionBackendServices.getIamPolicy" call. -// 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 *RegionBackendServicesGetIamPolicyCall) 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 -} - -type RegionBackendServicesInsertCall struct { - s *Service - project string - region string - backendservice *BackendService - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Insert: Creates a regional BackendService resource in the specified project -// using the data included in the request. For more information, see Backend -// services overview. -// -// - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *RegionBackendServicesService) Insert(project string, region string, backendservice *BackendService) *RegionBackendServicesInsertCall { - c := &RegionBackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - c.region = region - c.backendservice = backendservice - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionBackendServicesInsertCall) RequestId(requestId string) *RegionBackendServicesInsertCall { - c.urlParams_.Set("requestId", requestId) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *RegionBackendServicesInsertCall) Fields(s ...googleapi.Field) *RegionBackendServicesInsertCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *RegionBackendServicesInsertCall) Context(ctx context.Context) *RegionBackendServicesInsertCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *RegionBackendServicesInsertCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *RegionBackendServicesInsertCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) - if err != nil { - return nil, err - } - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices") - 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{ - "project": c.project, - "region": c.region, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "compute.regionBackendServices.insert" call. -// Any non-2xx status code is an error. Response headers are in either -// *Operation.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 *RegionBackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionBackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14890,6 +13957,569 @@ func (c *RegionInstantSnapshotsTestIamPermissionsCall) Do(opts ...googleapi.Call return ret, nil } +type RegionMultiMigsDeleteCall struct { + s *Service + project string + region string + multiMig string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a regional multiMIG in the specified project. +// +// - multiMig: Name of the multiMIG to delete. +// - project: Project ID for this request. +// - region: Name of the region for this request. +func (r *RegionMultiMigsService) Delete(project string, region string, multiMig string) *RegionMultiMigsDeleteCall { + c := &RegionMultiMigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.multiMig = multiMig + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *RegionMultiMigsDeleteCall) RequestId(requestId string) *RegionMultiMigsDeleteCall { + c.urlParams_.Set("requestId", requestId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *RegionMultiMigsDeleteCall) Fields(s ...googleapi.Field) *RegionMultiMigsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *RegionMultiMigsDeleteCall) Context(ctx context.Context) *RegionMultiMigsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *RegionMultiMigsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionMultiMigsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/multiMigs/{multiMig}") + 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{ + "project": c.project, + "region": c.region, + "multiMig": c.multiMig, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionMultiMigs.delete" call. +// Any non-2xx status code is an error. Response headers are in either +// *Operation.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 *RegionMultiMigsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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 := &Operation{ + 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 +} + +type RegionMultiMigsGetCall struct { + s *Service + project string + region string + multiMig string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Returns the specified MultiMIG resource. +// +// - multiMig: Name of the MultiMig resource to return. +// - project: Project ID for this request. +// - region: Name of the region for this request. +func (r *RegionMultiMigsService) Get(project string, region string, multiMig string) *RegionMultiMigsGetCall { + c := &RegionMultiMigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.multiMig = multiMig + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *RegionMultiMigsGetCall) Fields(s ...googleapi.Field) *RegionMultiMigsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *RegionMultiMigsGetCall) IfNoneMatch(entityTag string) *RegionMultiMigsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *RegionMultiMigsGetCall) Context(ctx context.Context) *RegionMultiMigsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *RegionMultiMigsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionMultiMigsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "projects/{project}/regions/{region}/multiMigs/{multiMig}") + 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{ + "project": c.project, + "region": c.region, + "multiMig": c.multiMig, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionMultiMigs.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *MultiMig.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 *RegionMultiMigsGetCall) Do(opts ...googleapi.CallOption) (*MultiMig, 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 := &MultiMig{ + 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 +} + +type RegionMultiMigsInsertCall struct { + s *Service + project string + region string + multimig *MultiMig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Insert: Creates a regional multiMIG in the specified project. +// +// - project: Project ID for this request. +// - region: Name of the region for this request. +func (r *RegionMultiMigsService) Insert(project string, region string, multimig *MultiMig) *RegionMultiMigsInsertCall { + c := &RegionMultiMigsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.multimig = multimig + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *RegionMultiMigsInsertCall) RequestId(requestId string) *RegionMultiMigsInsertCall { + c.urlParams_.Set("requestId", requestId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *RegionMultiMigsInsertCall) Fields(s ...googleapi.Field) *RegionMultiMigsInsertCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *RegionMultiMigsInsertCall) Context(ctx context.Context) *RegionMultiMigsInsertCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *RegionMultiMigsInsertCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionMultiMigsInsertCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.multimig) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/multiMigs") + 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{ + "project": c.project, + "region": c.region, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionMultiMigs.insert" call. +// Any non-2xx status code is an error. Response headers are in either +// *Operation.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 *RegionMultiMigsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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 := &Operation{ + 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 +} + +type RegionMultiMigsListCall struct { + s *Service + project string + region string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Retrieves a list of MultiMIGs in a project and region. +// +// - project: Project ID for this request. +// - region: Name of the region for this request. +func (r *RegionMultiMigsService) List(project string, region string) *RegionMultiMigsListCall { + c := &RegionMultiMigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + return c +} + +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *RegionMultiMigsListCall) Filter(filter string) *RegionMultiMigsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *RegionMultiMigsListCall) MaxResults(maxResults int64) *RegionMultiMigsListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *RegionMultiMigsListCall) OrderBy(orderBy string) *RegionMultiMigsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *RegionMultiMigsListCall) PageToken(pageToken string) *RegionMultiMigsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *RegionMultiMigsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionMultiMigsListCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *RegionMultiMigsListCall) Fields(s ...googleapi.Field) *RegionMultiMigsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *RegionMultiMigsListCall) IfNoneMatch(entityTag string) *RegionMultiMigsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *RegionMultiMigsListCall) Context(ctx context.Context) *RegionMultiMigsListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *RegionMultiMigsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionMultiMigsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "projects/{project}/regions/{region}/multiMigs") + 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{ + "project": c.project, + "region": c.region, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionMultiMigs.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *MultiMigsList.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 *RegionMultiMigsListCall) Do(opts ...googleapi.CallOption) (*MultiMigsList, 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 := &MultiMigsList{ + 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 +} + +// 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 *RegionMultiMigsListCall) Pages(ctx context.Context, f func(*MultiMigsList) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + type RegionNetworkEndpointGroupsAttachNetworkEndpointsCall struct { s *Service project string @@ -43430,8 +43060,9 @@ type StoragePoolsUpdateCall struct { // Update: Updates the specified storagePool with the data included in the // request. The update is performed only on selected fields included as part of -// update-mask. Only the following fields can be modified: size_tb and -// provisioned_iops. +// update-mask. Only the following fields can be modified: +// pool_provisioned_capacity_gb, pool_provisioned_iops and +// pool_provisioned_throughput. // // - project: Project ID for this request. // - storagePool: The storagePool name for this request. diff --git a/displayvideo/v3/displayvideo-api.json b/displayvideo/v3/displayvideo-api.json index f320f0a9856..340126b84e8 100644 --- a/displayvideo/v3/displayvideo-api.json +++ b/displayvideo/v3/displayvideo-api.json @@ -9222,7 +9222,7 @@ } } }, - "revision": "20240618", + "revision": "20240627", "rootUrl": "https://displayvideo.googleapis.com/", "schemas": { "ActiveViewVideoViewabilityMetricConfig": { @@ -16718,6 +16718,14 @@ }, "type": "array" }, + "adGroupQaIds": { + "description": "Optional. YouTube Ad Groups QA to download by ID. All IDs must belong to the same Advertiser or Partner specified in CreateSdfDownloadTaskRequest.", + "items": { + "format": "int64", + "type": "string" + }, + "type": "array" + }, "campaignIds": { "description": "Campaigns to download by ID. All IDs must belong to the same Advertiser or Partner specified in CreateSdfDownloadTaskRequest.", "items": { @@ -16742,6 +16750,14 @@ }, "type": "array" }, + "lineItemQaIds": { + "description": "Optional. Line Items QA to download by ID. All IDs must belong to the same Advertiser or Partner specified in CreateSdfDownloadTaskRequest.", + "items": { + "format": "int64", + "type": "string" + }, + "type": "array" + }, "mediaProductIds": { "description": "Media Products to download by ID. All IDs must belong to the same Advertiser or Partner specified in CreateSdfDownloadTaskRequest.", "items": { @@ -19596,7 +19612,9 @@ "FILE_TYPE_INSERTION_ORDER", "FILE_TYPE_LINE_ITEM", "FILE_TYPE_AD_GROUP", - "FILE_TYPE_AD" + "FILE_TYPE_AD", + "FILE_TYPE_LINE_ITEM_QA", + "FILE_TYPE_AD_GROUP_QA" ], "enumDescriptions": [ "Default value when type is unspecified or is unknown in this version.", @@ -19605,7 +19623,9 @@ "Insertion Order.", "Line Item.", "YouTube Ad Group.", - "YouTube Ad." + "YouTube Ad.", + "Line Item QA.", + "YouTube Ad Group QA." ], "type": "string" }, diff --git a/displayvideo/v3/displayvideo-gen.go b/displayvideo/v3/displayvideo-gen.go index 0f26b9939ee..5a84cf840e6 100644 --- a/displayvideo/v3/displayvideo-gen.go +++ b/displayvideo/v3/displayvideo-gen.go @@ -9211,6 +9211,10 @@ type IdFilter struct { // AdGroupIds: YouTube Ad Groups to download by ID. All IDs must belong to the // same Advertiser or Partner specified in CreateSdfDownloadTaskRequest. AdGroupIds googleapi.Int64s `json:"adGroupIds,omitempty"` + // AdGroupQaIds: Optional. YouTube Ad Groups QA to download by ID. All IDs must + // belong to the same Advertiser or Partner specified in + // CreateSdfDownloadTaskRequest. + AdGroupQaIds googleapi.Int64s `json:"adGroupQaIds,omitempty"` // CampaignIds: Campaigns to download by ID. All IDs must belong to the same // Advertiser or Partner specified in CreateSdfDownloadTaskRequest. CampaignIds googleapi.Int64s `json:"campaignIds,omitempty"` @@ -9220,6 +9224,10 @@ type IdFilter struct { // LineItemIds: Line Items to download by ID. All IDs must belong to the same // Advertiser or Partner specified in CreateSdfDownloadTaskRequest. LineItemIds googleapi.Int64s `json:"lineItemIds,omitempty"` + // LineItemQaIds: Optional. Line Items QA to download by ID. All IDs must + // belong to the same Advertiser or Partner specified in + // CreateSdfDownloadTaskRequest. + LineItemQaIds googleapi.Int64s `json:"lineItemQaIds,omitempty"` // MediaProductIds: Media Products to download by ID. All IDs must belong to // the same Advertiser or Partner specified in CreateSdfDownloadTaskRequest. MediaProductIds googleapi.Int64s `json:"mediaProductIds,omitempty"` @@ -12743,6 +12751,8 @@ type ParentEntityFilter struct { // "FILE_TYPE_LINE_ITEM" - Line Item. // "FILE_TYPE_AD_GROUP" - YouTube Ad Group. // "FILE_TYPE_AD" - YouTube Ad. + // "FILE_TYPE_LINE_ITEM_QA" - Line Item QA. + // "FILE_TYPE_AD_GROUP_QA" - YouTube Ad Group QA. FileType []string `json:"fileType,omitempty"` // FilterIds: The IDs of the specified filter type. This is used to filter // entities to fetch. If filter type is not `FILTER_TYPE_NONE`, at least one ID diff --git a/dlp/v2/dlp-api.json b/dlp/v2/dlp-api.json index 3cd226e8dd8..179529f7e0a 100644 --- a/dlp/v2/dlp-api.json +++ b/dlp/v2/dlp-api.json @@ -1129,6 +1129,106 @@ } } }, + "fileStoreDataProfiles": { + "methods": { + "delete": { + "description": "Delete a FileStoreDataProfile. Will not prevent the profile from being regenerated if the resource is still included in a discovery configuration.", + "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/fileStoreDataProfiles/{fileStoreDataProfilesId}", + "httpMethod": "DELETE", + "id": "dlp.organizations.locations.fileStoreDataProfiles.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Resource name of the file store data profile.", + "location": "path", + "pattern": "^organizations/[^/]+/locations/[^/]+/fileStoreDataProfiles/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets a file store data profile.", + "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/fileStoreDataProfiles/{fileStoreDataProfilesId}", + "httpMethod": "GET", + "id": "dlp.organizations.locations.fileStoreDataProfiles.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Resource name, for example `organizations/12345/locations/us/fileStoreDataProfiles/53234423`.", + "location": "path", + "pattern": "^organizations/[^/]+/locations/[^/]+/fileStoreDataProfiles/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "GooglePrivacyDlpV2FileStoreDataProfile" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists file store data profiles for an organization.", + "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/fileStoreDataProfiles", + "httpMethod": "GET", + "id": "dlp.organizations.locations.fileStoreDataProfiles.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "filter": { + "description": "Optional. Allows filtering. Supported syntax: * Filter expressions are made up of one or more restrictions. * Restrictions can be combined by `AND` or `OR` logical operators. A sequence of restrictions implicitly uses `AND`. * A restriction has the form of `{field} {operator} {value}`. * Supported fields/values: - `project_id` - The Google Cloud project ID. - `file_store_path` - The path like \"gs://bucket\". - `sensitivity_level` - HIGH|MODERATE|LOW - `data_risk_level` - HIGH|MODERATE|LOW - `resource_visibility`: PUBLIC|RESTRICTED - `status_code` - an RPC status code as defined in https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto * The operator must be `=` or `!=`. Examples: * `project_id = 12345 AND status_code = 1` * `project_id = 12345 AND sensitivity_level = HIGH` * `project_id = 12345 AND resource_visibility = PUBLIC` . * 'file_store_path = \"gs://mybucket\"` The length of this field should be no more than 500 characters.", + "location": "query", + "type": "string" + }, + "orderBy": { + "description": "Optional. Comma separated list of fields to order by, followed by `asc` or `desc` postfix. This list is case insensitive. The default sorting order is ascending. Redundant space characters are insignificant. Only one order field at a time is allowed. Examples: * `project_id asc` * `name` * `sensitivity_level desc` Supported fields are: - `project_id`: The Google Cloud project ID. - `sensitivity_level`: How sensitive the data in a table is, at most. - `data_risk_level`: How much risk is associated with this data. - `profile_last_generated`: When the profile was last updated in epoch seconds. - `last_modified`: The last time the resource was modified. - `resource_visibility`: Visibility restriction for this resource. - `name`: The name of the profile. - `create_time`: The time the file store was first created.", + "location": "query", + "type": "string" + }, + "pageSize": { + "description": "Optional. Size of the page. This value can be limited by the server. If zero, server returns a page of max size 100.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. Page token to continue retrieval.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Resource name of the organization or project, for example `organizations/433245324/locations/europe` or `projects/project-id/locations/asia`.", + "location": "path", + "pattern": "^organizations/[^/]+/locations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/fileStoreDataProfiles", + "response": { + "$ref": "GooglePrivacyDlpV2ListFileStoreDataProfilesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, "inspectTemplates": { "methods": { "create": { @@ -3662,6 +3762,106 @@ } } }, + "fileStoreDataProfiles": { + "methods": { + "delete": { + "description": "Delete a FileStoreDataProfile. Will not prevent the profile from being regenerated if the resource is still included in a discovery configuration.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/fileStoreDataProfiles/{fileStoreDataProfilesId}", + "httpMethod": "DELETE", + "id": "dlp.projects.locations.fileStoreDataProfiles.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Resource name of the file store data profile.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/fileStoreDataProfiles/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets a file store data profile.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/fileStoreDataProfiles/{fileStoreDataProfilesId}", + "httpMethod": "GET", + "id": "dlp.projects.locations.fileStoreDataProfiles.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Resource name, for example `organizations/12345/locations/us/fileStoreDataProfiles/53234423`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/fileStoreDataProfiles/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "GooglePrivacyDlpV2FileStoreDataProfile" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists file store data profiles for an organization.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/fileStoreDataProfiles", + "httpMethod": "GET", + "id": "dlp.projects.locations.fileStoreDataProfiles.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "filter": { + "description": "Optional. Allows filtering. Supported syntax: * Filter expressions are made up of one or more restrictions. * Restrictions can be combined by `AND` or `OR` logical operators. A sequence of restrictions implicitly uses `AND`. * A restriction has the form of `{field} {operator} {value}`. * Supported fields/values: - `project_id` - The Google Cloud project ID. - `file_store_path` - The path like \"gs://bucket\". - `sensitivity_level` - HIGH|MODERATE|LOW - `data_risk_level` - HIGH|MODERATE|LOW - `resource_visibility`: PUBLIC|RESTRICTED - `status_code` - an RPC status code as defined in https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto * The operator must be `=` or `!=`. Examples: * `project_id = 12345 AND status_code = 1` * `project_id = 12345 AND sensitivity_level = HIGH` * `project_id = 12345 AND resource_visibility = PUBLIC` . * 'file_store_path = \"gs://mybucket\"` The length of this field should be no more than 500 characters.", + "location": "query", + "type": "string" + }, + "orderBy": { + "description": "Optional. Comma separated list of fields to order by, followed by `asc` or `desc` postfix. This list is case insensitive. The default sorting order is ascending. Redundant space characters are insignificant. Only one order field at a time is allowed. Examples: * `project_id asc` * `name` * `sensitivity_level desc` Supported fields are: - `project_id`: The Google Cloud project ID. - `sensitivity_level`: How sensitive the data in a table is, at most. - `data_risk_level`: How much risk is associated with this data. - `profile_last_generated`: When the profile was last updated in epoch seconds. - `last_modified`: The last time the resource was modified. - `resource_visibility`: Visibility restriction for this resource. - `name`: The name of the profile. - `create_time`: The time the file store was first created.", + "location": "query", + "type": "string" + }, + "pageSize": { + "description": "Optional. Size of the page. This value can be limited by the server. If zero, server returns a page of max size 100.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. Page token to continue retrieval.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Resource name of the organization or project, for example `organizations/433245324/locations/europe` or `projects/project-id/locations/asia`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/fileStoreDataProfiles", + "response": { + "$ref": "GooglePrivacyDlpV2ListFileStoreDataProfilesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, "image": { "methods": { "redact": { @@ -4574,7 +4774,7 @@ } } }, - "revision": "20240616", + "revision": "20240624", "rootUrl": "https://dlp.googleapis.com/", "schemas": { "GooglePrivacyDlpV2Action": { @@ -5000,7 +5200,10 @@ "EXCEL_DOCUMENT", "AVRO", "CSV", - "TSV" + "TSV", + "AUDIO", + "VIDEO", + "EXECUTABLE" ], "enumDescriptions": [ "Unused", @@ -5016,7 +5219,10 @@ "xlsx, xlsm, xltx, xltm", "avro", "csv", - "tsv" + "tsv", + "Audio file types. Only used for profiling.", + "Video file types. Only used for profiling.", + "Executable file types. Only used for profiling." ], "type": "string" } @@ -6030,6 +6236,10 @@ "$ref": "GooglePrivacyDlpV2ColumnDataProfile", "description": "Column data profile column" }, + "fileStoreProfile": { + "$ref": "GooglePrivacyDlpV2FileStoreDataProfile", + "description": "File store data profile column." + }, "tableProfile": { "$ref": "GooglePrivacyDlpV2TableDataProfile", "description": "Table data profile column" @@ -6145,6 +6355,10 @@ ], "type": "string" }, + "fileStoreProfile": { + "$ref": "GooglePrivacyDlpV2FileStoreDataProfile", + "description": "If `DetailLevel` is `FILE_STORE_PROFILE` this will be fully populated. Otherwise, if `DetailLevel` is `RESOURCE_NAME`, then only `name` and `file_store_path` will be populated." + }, "profile": { "$ref": "GooglePrivacyDlpV2TableDataProfile", "description": "If `DetailLevel` is `TABLE_PROFILE` this will be fully populated. Otherwise, if `DetailLevel` is `RESOURCE_NAME`, then only `name` and `full_resource` will be populated." @@ -6161,12 +6375,14 @@ "enum": [ "RISK_SCORE_UNSPECIFIED", "RISK_LOW", + "RISK_UNKNOWN", "RISK_MODERATE", "RISK_HIGH" ], "enumDescriptions": [ "Unused.", "Low risk - Lower indication of sensitive data that appears to have additional access restrictions in place or no indication of sensitive data found.", + "Unable to determine risk.", "Medium risk - Sensitive data may be present but additional access or fine grain access restrictions appear to be present. Consider limiting access even further or transform data to mask.", "High risk – SPII may be present. Access controls may include public ACLs. Exfiltration of data may lead to user data loss. Re-identification of users may be possible. Consider limiting usage and or removing SPII." ], @@ -7145,6 +7361,20 @@ "$ref": "GoogleRpcStatus", "description": "Detailed error codes and messages." }, + "extraInfo": { + "description": "Additional information about the error.", + "enum": [ + "ERROR_INFO_UNSPECIFIED", + "IMAGE_SCAN_UNAVAILABLE_IN_REGION", + "FILE_STORE_CLUSTER_UNSUPPORTED" + ], + "enumDescriptions": [ + "Unused.", + "Image scan is not available in the region.", + "File store cluster is not supported for profile generation." + ], + "type": "string" + }, "timestamps": { "description": "The times the error occurred. List includes the oldest timestamp and the last 9 timestamps.", "items": { @@ -7295,6 +7525,103 @@ }, "type": "object" }, + "GooglePrivacyDlpV2FileClusterSummary": { + "description": "The file cluster summary.", + "id": "GooglePrivacyDlpV2FileClusterSummary", + "properties": { + "dataRiskLevel": { + "$ref": "GooglePrivacyDlpV2DataRiskLevel", + "description": "The data risk level of this cluster. RISK_LOW if nothing has been scanned." + }, + "errors": { + "description": "A list of Errors detected while scanning this cluster. The list is truncated to 10 per cluster.", + "items": { + "$ref": "GooglePrivacyDlpV2Error" + }, + "type": "array" + }, + "fileClusterType": { + "$ref": "GooglePrivacyDlpV2FileClusterType", + "description": "The file cluster type." + }, + "fileExtensionsScanned": { + "description": "A sample of file types scanned in this cluster. Empty if no files were scanned.", + "items": { + "$ref": "GooglePrivacyDlpV2FileExtensionInfo" + }, + "type": "array" + }, + "fileExtensionsSeen": { + "description": "A sample of file types seen in this cluster. Empty if no files were seen.", + "items": { + "$ref": "GooglePrivacyDlpV2FileExtensionInfo" + }, + "type": "array" + }, + "fileStoreInfoTypeSummaries": { + "description": "InfoTypes detected in this cluster.", + "items": { + "$ref": "GooglePrivacyDlpV2FileStoreInfoTypeSummary" + }, + "type": "array" + }, + "noFilesExist": { + "description": "True if no files exist in this cluster. If the bucket had more files than could be listed, this will be false even if no files for this cluster were seen and file_extensions_seen is empty.", + "type": "boolean" + }, + "sensitivityScore": { + "$ref": "GooglePrivacyDlpV2SensitivityScore", + "description": "The sensitivity score of this cluster. The score will be SENSITIVITY_LOW if nothing has been scanned." + } + }, + "type": "object" + }, + "GooglePrivacyDlpV2FileClusterType": { + "description": "Message used to identify file cluster type being profiled.", + "id": "GooglePrivacyDlpV2FileClusterType", + "properties": { + "cluster": { + "description": "Cluster type.", + "enum": [ + "CLUSTER_UNSPECIFIED", + "CLUSTER_UNKNOWN", + "CLUSTER_TEXT", + "CLUSTER_STRUCTURED_DATA", + "CLUSTER_SOURCE_CODE", + "CLUSTER_RICH_DOCUMENT", + "CLUSTER_IMAGE", + "CLUSTER_ARCHIVE", + "CLUSTER_MULTIMEDIA", + "CLUSTER_EXECUTABLE" + ], + "enumDescriptions": [ + "Unused.", + "Unsupported files.", + "Plain text.", + "Structured data like CSV, TSV etc.", + "Source code.", + "Rich document like docx, xlsx etc.", + "Images like jpeg, bmp.", + "Archives and containers like .zip, .tar etc.", + "Multimedia like .mp4, .avi etc.", + "Executable files like .exe, .class, .apk etc." + ], + "type": "string" + } + }, + "type": "object" + }, + "GooglePrivacyDlpV2FileExtensionInfo": { + "description": "Information regarding the discovered file extension.", + "id": "GooglePrivacyDlpV2FileExtensionInfo", + "properties": { + "fileExtension": { + "description": "The file extension if set. (aka .pdf, .jpg, .txt)", + "type": "string" + } + }, + "type": "object" + }, "GooglePrivacyDlpV2FileSet": { "description": "Set of files to scan.", "id": "GooglePrivacyDlpV2FileSet", @@ -7310,6 +7637,156 @@ }, "type": "object" }, + "GooglePrivacyDlpV2FileStoreDataProfile": { + "description": "The profile for a file store. * Google Cloud Storage: maps 1:1 with a bucket.", + "id": "GooglePrivacyDlpV2FileStoreDataProfile", + "properties": { + "configSnapshot": { + "$ref": "GooglePrivacyDlpV2DataProfileConfigSnapshot", + "description": "The snapshot of the configurations used to generate the profile." + }, + "createTime": { + "description": "The time the file store was first created.", + "format": "google-datetime", + "type": "string" + }, + "dataRiskLevel": { + "$ref": "GooglePrivacyDlpV2DataRiskLevel", + "description": "The data risk level of this resource." + }, + "dataSourceType": { + "$ref": "GooglePrivacyDlpV2DataSourceType", + "description": "The resource type that was profiled." + }, + "dataStorageLocations": { + "description": "For resources that have multiple storage locations, these are those regions. For Google Cloud Storage this is the list of regions chosen for dual-region storage. `file_store_location` will normally be the corresponding multi-region for the list of individual locations. The first region is always picked as the processing and storage location for the data profile.", + "items": { + "type": "string" + }, + "type": "array" + }, + "fileClusterSummaries": { + "description": "FileClusterSummary per each cluster.", + "items": { + "$ref": "GooglePrivacyDlpV2FileClusterSummary" + }, + "type": "array" + }, + "fileStoreInfoTypeSummaries": { + "description": "InfoTypes detected in this file store.", + "items": { + "$ref": "GooglePrivacyDlpV2FileStoreInfoTypeSummary" + }, + "type": "array" + }, + "fileStoreIsEmpty": { + "description": "The file store does not have any files.", + "type": "boolean" + }, + "fileStoreLocation": { + "description": "The location of the file store. * Google Cloud Storage: https://cloud.google.com/storage/docs/locations#available-locations", + "type": "string" + }, + "fileStorePath": { + "description": "The file store path. * Google Cloud Storage: `gs://{bucket}`", + "type": "string" + }, + "fullResource": { + "description": "The resource name of the resource profiled. https://cloud.google.com/apis/design/resource_names#full_resource_name", + "type": "string" + }, + "lastModifiedTime": { + "description": "The time the file store was last modified.", + "format": "google-datetime", + "type": "string" + }, + "locationType": { + "description": "The location type of the bucket (region, dual-region, multi-region, etc). If dual-region, expect data_storage_locations to be populated.", + "type": "string" + }, + "name": { + "description": "The name of the profile.", + "type": "string" + }, + "profileLastGenerated": { + "description": "The last time the profile was generated.", + "format": "google-datetime", + "type": "string" + }, + "profileStatus": { + "$ref": "GooglePrivacyDlpV2ProfileStatus", + "description": "Success or error status from the most recent profile generation attempt. May be empty if the profile is still being generated." + }, + "projectDataProfile": { + "description": "The resource name to the project data profile for this file store.", + "type": "string" + }, + "projectId": { + "description": "The Google Cloud project ID that owns the resource.", + "type": "string" + }, + "resourceAttributes": { + "additionalProperties": { + "$ref": "GooglePrivacyDlpV2Value" + }, + "description": "Attributes of the resource being profiled. Currently used attributes: - customer_managed_encryption: boolean true: the resource is encrypted with a customer-managed key. false: the resource is encrypted with a provider-managed key.", + "type": "object" + }, + "resourceLabels": { + "additionalProperties": { + "type": "string" + }, + "description": "The labels applied to the resource at the time the profile was generated.", + "type": "object" + }, + "resourceVisibility": { + "description": "How broadly a resource has been shared.", + "enum": [ + "RESOURCE_VISIBILITY_UNSPECIFIED", + "RESOURCE_VISIBILITY_PUBLIC", + "RESOURCE_VISIBILITY_INCONCLUSIVE", + "RESOURCE_VISIBILITY_RESTRICTED" + ], + "enumDescriptions": [ + "Unused.", + "Visible to any user.", + "May contain public items. For example, if a Cloud Storage bucket has uniform bucket level access disabled, some objects inside it may be public, but none are known yet.", + "Visible only to specific users." + ], + "type": "string" + }, + "sensitivityScore": { + "$ref": "GooglePrivacyDlpV2SensitivityScore", + "description": "The sensitivity score of this resource." + }, + "state": { + "description": "State of a profile.", + "enum": [ + "STATE_UNSPECIFIED", + "RUNNING", + "DONE" + ], + "enumDescriptions": [ + "Unused.", + "The profile is currently running. Once a profile has finished it will transition to DONE.", + "The profile is no longer generating. If profile_status.status.code is 0, the profile succeeded, otherwise, it failed." + ], + "type": "string" + } + }, + "type": "object" + }, + "GooglePrivacyDlpV2FileStoreInfoTypeSummary": { + "description": "Information regarding the discovered InfoType.", + "id": "GooglePrivacyDlpV2FileStoreInfoTypeSummary", + "properties": { + "infoType": { + "$ref": "GooglePrivacyDlpV2InfoType", + "description": "The InfoType seen." + } + }, + "type": "object" + }, "GooglePrivacyDlpV2Finding": { "description": "Represents a piece of potentially sensitive content.", "id": "GooglePrivacyDlpV2Finding", @@ -8802,6 +9279,24 @@ }, "type": "object" }, + "GooglePrivacyDlpV2ListFileStoreDataProfilesResponse": { + "description": "List of file store data profiles generated for a given organization or project.", + "id": "GooglePrivacyDlpV2ListFileStoreDataProfilesResponse", + "properties": { + "fileStoreDataProfiles": { + "description": "List of data profiles.", + "items": { + "$ref": "GooglePrivacyDlpV2FileStoreDataProfile" + }, + "type": "array" + }, + "nextPageToken": { + "description": "The next page token.", + "type": "string" + } + }, + "type": "object" + }, "GooglePrivacyDlpV2ListInfoTypesResponse": { "description": "Response to the ListInfoTypes request.", "id": "GooglePrivacyDlpV2ListInfoTypesResponse", @@ -9222,6 +9717,11 @@ "$ref": "GooglePrivacyDlpV2DataRiskLevel", "description": "The data risk level of this project." }, + "fileStoreDataProfileCount": { + "description": "The number of file store data profiles generated for this project.", + "format": "int64", + "type": "string" + }, "name": { "description": "The resource name of the profile.", "type": "string" @@ -9242,6 +9742,11 @@ "sensitivityScore": { "$ref": "GooglePrivacyDlpV2SensitivityScore", "description": "The sensitivity score of this project." + }, + "tableDataProfileCount": { + "description": "The number of table data profiles generated for this project.", + "format": "int64", + "type": "string" } }, "type": "object" @@ -9335,12 +9840,14 @@ "enum": [ "DETAIL_LEVEL_UNSPECIFIED", "TABLE_PROFILE", - "RESOURCE_NAME" + "RESOURCE_NAME", + "FILE_STORE_PROFILE" ], "enumDescriptions": [ "Unused.", "The full table data profile.", - "The name of the profiled resource." + "The name of the profiled resource.", + "The full file store data profile." ], "type": "string" }, @@ -9975,12 +10482,14 @@ "enum": [ "SENSITIVITY_SCORE_UNSPECIFIED", "SENSITIVITY_LOW", + "SENSITIVITY_UNKNOWN", "SENSITIVITY_MODERATE", "SENSITIVITY_HIGH" ], "enumDescriptions": [ "Unused.", "No sensitive information detected. The resource isn't publicly accessible.", + "Unable to determine sensitivity.", "Medium risk. Contains personally identifiable information (PII), potentially sensitive data, or fields with free-text data that are at a higher risk of having intermittent sensitive data. Consider limiting access.", "High risk. Sensitive personally identifiable information (SPII) can be present. Exfiltration of data can lead to user data loss. Re-identification of users might be possible. Consider limiting usage and or removing SPII." ], @@ -10342,7 +10851,7 @@ "enumDescriptions": [ "Unused.", "Visible to any user.", - "May contain public items. For example, if a Cloud Storage bucket has uniform bucket level access disabled, some objects inside it may be public.", + "May contain public items. For example, if a Cloud Storage bucket has uniform bucket level access disabled, some objects inside it may be public, but none are known yet.", "Visible only to specific users." ], "type": "string" diff --git a/dlp/v2/dlp-gen.go b/dlp/v2/dlp-gen.go index 875b1993019..3aa0745a4c1 100644 --- a/dlp/v2/dlp-gen.go +++ b/dlp/v2/dlp-gen.go @@ -241,6 +241,7 @@ func NewOrganizationsLocationsService(s *Service) *OrganizationsLocationsService rs.DeidentifyTemplates = NewOrganizationsLocationsDeidentifyTemplatesService(s) rs.DiscoveryConfigs = NewOrganizationsLocationsDiscoveryConfigsService(s) rs.DlpJobs = NewOrganizationsLocationsDlpJobsService(s) + rs.FileStoreDataProfiles = NewOrganizationsLocationsFileStoreDataProfilesService(s) rs.InspectTemplates = NewOrganizationsLocationsInspectTemplatesService(s) rs.JobTriggers = NewOrganizationsLocationsJobTriggersService(s) rs.ProjectDataProfiles = NewOrganizationsLocationsProjectDataProfilesService(s) @@ -262,6 +263,8 @@ type OrganizationsLocationsService struct { DlpJobs *OrganizationsLocationsDlpJobsService + FileStoreDataProfiles *OrganizationsLocationsFileStoreDataProfilesService + InspectTemplates *OrganizationsLocationsInspectTemplatesService JobTriggers *OrganizationsLocationsJobTriggersService @@ -318,6 +321,15 @@ type OrganizationsLocationsDlpJobsService struct { s *Service } +func NewOrganizationsLocationsFileStoreDataProfilesService(s *Service) *OrganizationsLocationsFileStoreDataProfilesService { + rs := &OrganizationsLocationsFileStoreDataProfilesService{s: s} + return rs +} + +type OrganizationsLocationsFileStoreDataProfilesService struct { + s *Service +} + func NewOrganizationsLocationsInspectTemplatesService(s *Service) *OrganizationsLocationsInspectTemplatesService { rs := &OrganizationsLocationsInspectTemplatesService{s: s} return rs @@ -467,6 +479,7 @@ func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { rs.DeidentifyTemplates = NewProjectsLocationsDeidentifyTemplatesService(s) rs.DiscoveryConfigs = NewProjectsLocationsDiscoveryConfigsService(s) rs.DlpJobs = NewProjectsLocationsDlpJobsService(s) + rs.FileStoreDataProfiles = NewProjectsLocationsFileStoreDataProfilesService(s) rs.Image = NewProjectsLocationsImageService(s) rs.InspectTemplates = NewProjectsLocationsInspectTemplatesService(s) rs.JobTriggers = NewProjectsLocationsJobTriggersService(s) @@ -491,6 +504,8 @@ type ProjectsLocationsService struct { DlpJobs *ProjectsLocationsDlpJobsService + FileStoreDataProfiles *ProjectsLocationsFileStoreDataProfilesService + Image *ProjectsLocationsImageService InspectTemplates *ProjectsLocationsInspectTemplatesService @@ -558,6 +573,15 @@ type ProjectsLocationsDlpJobsService struct { s *Service } +func NewProjectsLocationsFileStoreDataProfilesService(s *Service) *ProjectsLocationsFileStoreDataProfilesService { + rs := &ProjectsLocationsFileStoreDataProfilesService{s: s} + return rs +} + +type ProjectsLocationsFileStoreDataProfilesService struct { + s *Service +} + func NewProjectsLocationsImageService(s *Service) *ProjectsLocationsImageService { rs := &ProjectsLocationsImageService{s: s} return rs @@ -1176,6 +1200,9 @@ type GooglePrivacyDlpV2ByteContentItem struct { // "AVRO" - avro // "CSV" - csv // "TSV" - tsv + // "AUDIO" - Audio file types. Only used for profiling. + // "VIDEO" - Video file types. Only used for profiling. + // "EXECUTABLE" - Executable file types. Only used for profiling. Type string `json:"type,omitempty"` // ForceSendFields is a list of field names (e.g. "Data") to unconditionally // include in API requests. By default, fields with empty or default values are @@ -2592,6 +2619,8 @@ func (s *GooglePrivacyDlpV2DataProfileAction) MarshalJSON() ([]byte, error) { type GooglePrivacyDlpV2DataProfileBigQueryRowSchema struct { // ColumnProfile: Column data profile column ColumnProfile *GooglePrivacyDlpV2ColumnDataProfile `json:"columnProfile,omitempty"` + // FileStoreProfile: File store data profile column. + FileStoreProfile *GooglePrivacyDlpV2FileStoreDataProfile `json:"fileStoreProfile,omitempty"` // TableProfile: Table data profile column TableProfile *GooglePrivacyDlpV2TableDataProfile `json:"tableProfile,omitempty"` // ForceSendFields is a list of field names (e.g. "ColumnProfile") to @@ -2756,6 +2785,10 @@ type GooglePrivacyDlpV2DataProfilePubSubMessage struct { // "SCORE_INCREASED" - Table data risk score or sensitivity score increased. // "ERROR_CHANGED" - A user (non-internal) error occurred. Event string `json:"event,omitempty"` + // FileStoreProfile: If `DetailLevel` is `FILE_STORE_PROFILE` this will be + // fully populated. Otherwise, if `DetailLevel` is `RESOURCE_NAME`, then only + // `name` and `file_store_path` will be populated. + FileStoreProfile *GooglePrivacyDlpV2FileStoreDataProfile `json:"fileStoreProfile,omitempty"` // Profile: If `DetailLevel` is `TABLE_PROFILE` this will be fully populated. // Otherwise, if `DetailLevel` is `RESOURCE_NAME`, then only `name` and // `full_resource` will be populated. @@ -2788,6 +2821,7 @@ type GooglePrivacyDlpV2DataRiskLevel struct { // "RISK_LOW" - Low risk - Lower indication of sensitive data that appears to // have additional access restrictions in place or no indication of sensitive // data found. + // "RISK_UNKNOWN" - Unable to determine risk. // "RISK_MODERATE" - Medium risk - Sensitive data may be present but // additional access or fine grain access restrictions appear to be present. // Consider limiting access even further or transform data to mask. @@ -4172,6 +4206,15 @@ func (s *GooglePrivacyDlpV2EntityId) MarshalJSON() ([]byte, error) { type GooglePrivacyDlpV2Error struct { // Details: Detailed error codes and messages. Details *GoogleRpcStatus `json:"details,omitempty"` + // ExtraInfo: Additional information about the error. + // + // Possible values: + // "ERROR_INFO_UNSPECIFIED" - Unused. + // "IMAGE_SCAN_UNAVAILABLE_IN_REGION" - Image scan is not available in the + // region. + // "FILE_STORE_CLUSTER_UNSUPPORTED" - File store cluster is not supported for + // profile generation. + ExtraInfo string `json:"extraInfo,omitempty"` // Timestamps: The times the error occurred. List includes the oldest timestamp // and the last 9 timestamps. Timestamps []string `json:"timestamps,omitempty"` @@ -4421,6 +4464,107 @@ func (s *GooglePrivacyDlpV2FieldTransformation) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// GooglePrivacyDlpV2FileClusterSummary: The file cluster summary. +type GooglePrivacyDlpV2FileClusterSummary struct { + // DataRiskLevel: The data risk level of this cluster. RISK_LOW if nothing has + // been scanned. + DataRiskLevel *GooglePrivacyDlpV2DataRiskLevel `json:"dataRiskLevel,omitempty"` + // Errors: A list of Errors detected while scanning this cluster. The list is + // truncated to 10 per cluster. + Errors []*GooglePrivacyDlpV2Error `json:"errors,omitempty"` + // FileClusterType: The file cluster type. + FileClusterType *GooglePrivacyDlpV2FileClusterType `json:"fileClusterType,omitempty"` + // FileExtensionsScanned: A sample of file types scanned in this cluster. Empty + // if no files were scanned. + FileExtensionsScanned []*GooglePrivacyDlpV2FileExtensionInfo `json:"fileExtensionsScanned,omitempty"` + // FileExtensionsSeen: A sample of file types seen in this cluster. Empty if no + // files were seen. + FileExtensionsSeen []*GooglePrivacyDlpV2FileExtensionInfo `json:"fileExtensionsSeen,omitempty"` + // FileStoreInfoTypeSummaries: InfoTypes detected in this cluster. + FileStoreInfoTypeSummaries []*GooglePrivacyDlpV2FileStoreInfoTypeSummary `json:"fileStoreInfoTypeSummaries,omitempty"` + // NoFilesExist: True if no files exist in this cluster. If the bucket had more + // files than could be listed, this will be false even if no files for this + // cluster were seen and file_extensions_seen is empty. + NoFilesExist bool `json:"noFilesExist,omitempty"` + // SensitivityScore: The sensitivity score of this cluster. The score will be + // SENSITIVITY_LOW if nothing has been scanned. + SensitivityScore *GooglePrivacyDlpV2SensitivityScore `json:"sensitivityScore,omitempty"` + // ForceSendFields is a list of field names (e.g. "DataRiskLevel") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "DataRiskLevel") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GooglePrivacyDlpV2FileClusterSummary) MarshalJSON() ([]byte, error) { + type NoMethod GooglePrivacyDlpV2FileClusterSummary + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GooglePrivacyDlpV2FileClusterType: Message used to identify file cluster +// type being profiled. +type GooglePrivacyDlpV2FileClusterType struct { + // Cluster: Cluster type. + // + // Possible values: + // "CLUSTER_UNSPECIFIED" - Unused. + // "CLUSTER_UNKNOWN" - Unsupported files. + // "CLUSTER_TEXT" - Plain text. + // "CLUSTER_STRUCTURED_DATA" - Structured data like CSV, TSV etc. + // "CLUSTER_SOURCE_CODE" - Source code. + // "CLUSTER_RICH_DOCUMENT" - Rich document like docx, xlsx etc. + // "CLUSTER_IMAGE" - Images like jpeg, bmp. + // "CLUSTER_ARCHIVE" - Archives and containers like .zip, .tar etc. + // "CLUSTER_MULTIMEDIA" - Multimedia like .mp4, .avi etc. + // "CLUSTER_EXECUTABLE" - Executable files like .exe, .class, .apk etc. + Cluster string `json:"cluster,omitempty"` + // ForceSendFields is a list of field names (e.g. "Cluster") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Cluster") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GooglePrivacyDlpV2FileClusterType) MarshalJSON() ([]byte, error) { + type NoMethod GooglePrivacyDlpV2FileClusterType + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GooglePrivacyDlpV2FileExtensionInfo: Information regarding the discovered +// file extension. +type GooglePrivacyDlpV2FileExtensionInfo struct { + // FileExtension: The file extension if set. (aka .pdf, .jpg, .txt) + FileExtension string `json:"fileExtension,omitempty"` + // ForceSendFields is a list of field names (e.g. "FileExtension") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "FileExtension") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GooglePrivacyDlpV2FileExtensionInfo) MarshalJSON() ([]byte, error) { + type NoMethod GooglePrivacyDlpV2FileExtensionInfo + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // GooglePrivacyDlpV2FileSet: Set of files to scan. type GooglePrivacyDlpV2FileSet struct { // RegexFileSet: The regex-filtered set of files to scan. Exactly one of `url` @@ -4452,6 +4596,131 @@ func (s *GooglePrivacyDlpV2FileSet) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// GooglePrivacyDlpV2FileStoreDataProfile: The profile for a file store. * +// Google Cloud Storage: maps 1:1 with a bucket. +type GooglePrivacyDlpV2FileStoreDataProfile struct { + // ConfigSnapshot: The snapshot of the configurations used to generate the + // profile. + ConfigSnapshot *GooglePrivacyDlpV2DataProfileConfigSnapshot `json:"configSnapshot,omitempty"` + // CreateTime: The time the file store was first created. + CreateTime string `json:"createTime,omitempty"` + // DataRiskLevel: The data risk level of this resource. + DataRiskLevel *GooglePrivacyDlpV2DataRiskLevel `json:"dataRiskLevel,omitempty"` + // DataSourceType: The resource type that was profiled. + DataSourceType *GooglePrivacyDlpV2DataSourceType `json:"dataSourceType,omitempty"` + // DataStorageLocations: For resources that have multiple storage locations, + // these are those regions. For Google Cloud Storage this is the list of + // regions chosen for dual-region storage. `file_store_location` will normally + // be the corresponding multi-region for the list of individual locations. The + // first region is always picked as the processing and storage location for the + // data profile. + DataStorageLocations []string `json:"dataStorageLocations,omitempty"` + // FileClusterSummaries: FileClusterSummary per each cluster. + FileClusterSummaries []*GooglePrivacyDlpV2FileClusterSummary `json:"fileClusterSummaries,omitempty"` + // FileStoreInfoTypeSummaries: InfoTypes detected in this file store. + FileStoreInfoTypeSummaries []*GooglePrivacyDlpV2FileStoreInfoTypeSummary `json:"fileStoreInfoTypeSummaries,omitempty"` + // FileStoreIsEmpty: The file store does not have any files. + FileStoreIsEmpty bool `json:"fileStoreIsEmpty,omitempty"` + // FileStoreLocation: The location of the file store. * Google Cloud Storage: + // https://cloud.google.com/storage/docs/locations#available-locations + FileStoreLocation string `json:"fileStoreLocation,omitempty"` + // FileStorePath: The file store path. * Google Cloud Storage: `gs://{bucket}` + FileStorePath string `json:"fileStorePath,omitempty"` + // FullResource: The resource name of the resource profiled. + // https://cloud.google.com/apis/design/resource_names#full_resource_name + FullResource string `json:"fullResource,omitempty"` + // LastModifiedTime: The time the file store was last modified. + LastModifiedTime string `json:"lastModifiedTime,omitempty"` + // LocationType: The location type of the bucket (region, dual-region, + // multi-region, etc). If dual-region, expect data_storage_locations to be + // populated. + LocationType string `json:"locationType,omitempty"` + // Name: The name of the profile. + Name string `json:"name,omitempty"` + // ProfileLastGenerated: The last time the profile was generated. + ProfileLastGenerated string `json:"profileLastGenerated,omitempty"` + // ProfileStatus: Success or error status from the most recent profile + // generation attempt. May be empty if the profile is still being generated. + ProfileStatus *GooglePrivacyDlpV2ProfileStatus `json:"profileStatus,omitempty"` + // ProjectDataProfile: The resource name to the project data profile for this + // file store. + ProjectDataProfile string `json:"projectDataProfile,omitempty"` + // ProjectId: The Google Cloud project ID that owns the resource. + ProjectId string `json:"projectId,omitempty"` + // ResourceAttributes: Attributes of the resource being profiled. Currently + // used attributes: - customer_managed_encryption: boolean true: the resource + // is encrypted with a customer-managed key. false: the resource is encrypted + // with a provider-managed key. + ResourceAttributes map[string]GooglePrivacyDlpV2Value `json:"resourceAttributes,omitempty"` + // ResourceLabels: The labels applied to the resource at the time the profile + // was generated. + ResourceLabels map[string]string `json:"resourceLabels,omitempty"` + // ResourceVisibility: How broadly a resource has been shared. + // + // Possible values: + // "RESOURCE_VISIBILITY_UNSPECIFIED" - Unused. + // "RESOURCE_VISIBILITY_PUBLIC" - Visible to any user. + // "RESOURCE_VISIBILITY_INCONCLUSIVE" - May contain public items. For + // example, if a Cloud Storage bucket has uniform bucket level access disabled, + // some objects inside it may be public, but none are known yet. + // "RESOURCE_VISIBILITY_RESTRICTED" - Visible only to specific users. + ResourceVisibility string `json:"resourceVisibility,omitempty"` + // SensitivityScore: The sensitivity score of this resource. + SensitivityScore *GooglePrivacyDlpV2SensitivityScore `json:"sensitivityScore,omitempty"` + // State: State of a profile. + // + // Possible values: + // "STATE_UNSPECIFIED" - Unused. + // "RUNNING" - The profile is currently running. Once a profile has finished + // it will transition to DONE. + // "DONE" - The profile is no longer generating. If + // profile_status.status.code is 0, the profile succeeded, otherwise, it + // failed. + State string `json:"state,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "ConfigSnapshot") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ConfigSnapshot") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GooglePrivacyDlpV2FileStoreDataProfile) MarshalJSON() ([]byte, error) { + type NoMethod GooglePrivacyDlpV2FileStoreDataProfile + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GooglePrivacyDlpV2FileStoreInfoTypeSummary: Information regarding the +// discovered InfoType. +type GooglePrivacyDlpV2FileStoreInfoTypeSummary struct { + // InfoType: The InfoType seen. + InfoType *GooglePrivacyDlpV2InfoType `json:"infoType,omitempty"` + // ForceSendFields is a list of field names (e.g. "InfoType") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "InfoType") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GooglePrivacyDlpV2FileStoreInfoTypeSummary) MarshalJSON() ([]byte, error) { + type NoMethod GooglePrivacyDlpV2FileStoreInfoTypeSummary + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // GooglePrivacyDlpV2Finding: Represents a piece of potentially sensitive // content. type GooglePrivacyDlpV2Finding struct { @@ -6431,6 +6700,34 @@ func (s *GooglePrivacyDlpV2ListDlpJobsResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// GooglePrivacyDlpV2ListFileStoreDataProfilesResponse: List of file store data +// profiles generated for a given organization or project. +type GooglePrivacyDlpV2ListFileStoreDataProfilesResponse struct { + // FileStoreDataProfiles: List of data profiles. + FileStoreDataProfiles []*GooglePrivacyDlpV2FileStoreDataProfile `json:"fileStoreDataProfiles,omitempty"` + // NextPageToken: The next page token. + 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. "FileStoreDataProfiles") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "FileStoreDataProfiles") to + // include in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GooglePrivacyDlpV2ListFileStoreDataProfilesResponse) MarshalJSON() ([]byte, error) { + type NoMethod GooglePrivacyDlpV2ListFileStoreDataProfilesResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // GooglePrivacyDlpV2ListInfoTypesResponse: Response to the ListInfoTypes // request. type GooglePrivacyDlpV2ListInfoTypesResponse struct { @@ -7028,6 +7325,9 @@ func (s *GooglePrivacyDlpV2ProfileStatus) MarshalJSON() ([]byte, error) { type GooglePrivacyDlpV2ProjectDataProfile struct { // DataRiskLevel: The data risk level of this project. DataRiskLevel *GooglePrivacyDlpV2DataRiskLevel `json:"dataRiskLevel,omitempty"` + // FileStoreDataProfileCount: The number of file store data profiles generated + // for this project. + FileStoreDataProfileCount int64 `json:"fileStoreDataProfileCount,omitempty,string"` // Name: The resource name of the profile. Name string `json:"name,omitempty"` // ProfileLastGenerated: The last time the profile was generated. @@ -7039,6 +7339,9 @@ type GooglePrivacyDlpV2ProjectDataProfile struct { ProjectId string `json:"projectId,omitempty"` // SensitivityScore: The sensitivity score of this project. SensitivityScore *GooglePrivacyDlpV2SensitivityScore `json:"sensitivityScore,omitempty"` + // TableDataProfileCount: The number of table data profiles generated for this + // project. + TableDataProfileCount int64 `json:"tableDataProfileCount,omitempty,string"` // ServerResponse contains the HTTP response code and headers from the server. googleapi.ServerResponse `json:"-"` @@ -7167,6 +7470,7 @@ type GooglePrivacyDlpV2PubSubNotification struct { // "DETAIL_LEVEL_UNSPECIFIED" - Unused. // "TABLE_PROFILE" - The full table data profile. // "RESOURCE_NAME" - The name of the profiled resource. + // "FILE_STORE_PROFILE" - The full file store data profile. DetailOfMessage string `json:"detailOfMessage,omitempty"` // Event: The type of event that triggers a Pub/Sub. At most one // `PubSubNotification` per EventType is permitted. @@ -8155,6 +8459,7 @@ type GooglePrivacyDlpV2SensitivityScore struct { // "SENSITIVITY_SCORE_UNSPECIFIED" - Unused. // "SENSITIVITY_LOW" - No sensitive information detected. The resource isn't // publicly accessible. + // "SENSITIVITY_UNKNOWN" - Unable to determine sensitivity. // "SENSITIVITY_MODERATE" - Medium risk. Contains personally identifiable // information (PII), potentially sensitive data, or fields with free-text data // that are at a higher risk of having intermittent sensitive data. Consider @@ -8572,7 +8877,7 @@ type GooglePrivacyDlpV2TableDataProfile struct { // "RESOURCE_VISIBILITY_PUBLIC" - Visible to any user. // "RESOURCE_VISIBILITY_INCONCLUSIVE" - May contain public items. For // example, if a Cloud Storage bucket has uniform bucket level access disabled, - // some objects inside it may be public. + // some objects inside it may be public, but none are known yet. // "RESOURCE_VISIBILITY_RESTRICTED" - Visible only to specific users. ResourceVisibility string `json:"resourceVisibility,omitempty"` // RowCount: Number of rows in the table when the profile was generated. This @@ -13436,92 +13741,73 @@ func (c *OrganizationsLocationsDlpJobsListCall) Pages(ctx context.Context, f fun } } -type OrganizationsLocationsInspectTemplatesCreateCall struct { - s *Service - parentid string - googleprivacydlpv2createinspecttemplaterequest *GooglePrivacyDlpV2CreateInspectTemplateRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsLocationsFileStoreDataProfilesDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates an InspectTemplate for reusing frequently used configuration -// for inspecting content, images, and storage. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-templates -// to learn more. +// Delete: Delete a FileStoreDataProfile. Will not prevent the profile from +// being regenerated if the resource is still included in a discovery +// configuration. // -// - parent: Parent resource name. The format of this value varies depending on -// the scope of the request (project or organization) and whether you have -// specified a processing location -// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` -// LOCATION_ID + Projects scope, no location specified (defaults to global): -// `projects/`PROJECT_ID + Organizations scope, location specified: -// `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no -// location specified (defaults to global): `organizations/`ORG_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: -// parent=projects/example-project/locations/europe-west3. -func (r *OrganizationsLocationsInspectTemplatesService) Create(parentid string, googleprivacydlpv2createinspecttemplaterequest *GooglePrivacyDlpV2CreateInspectTemplateRequest) *OrganizationsLocationsInspectTemplatesCreateCall { - c := &OrganizationsLocationsInspectTemplatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parentid = parentid - c.googleprivacydlpv2createinspecttemplaterequest = googleprivacydlpv2createinspecttemplaterequest +// - name: Resource name of the file store data profile. +func (r *OrganizationsLocationsFileStoreDataProfilesService) Delete(name string) *OrganizationsLocationsFileStoreDataProfilesDeleteCall { + c := &OrganizationsLocationsFileStoreDataProfilesDeleteCall{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 // details. -func (c *OrganizationsLocationsInspectTemplatesCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsInspectTemplatesCreateCall { +func (c *OrganizationsLocationsFileStoreDataProfilesDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsFileStoreDataProfilesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *OrganizationsLocationsInspectTemplatesCreateCall) Context(ctx context.Context) *OrganizationsLocationsInspectTemplatesCreateCall { +func (c *OrganizationsLocationsFileStoreDataProfilesDeleteCall) Context(ctx context.Context) *OrganizationsLocationsFileStoreDataProfilesDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *OrganizationsLocationsInspectTemplatesCreateCall) Header() http.Header { +func (c *OrganizationsLocationsFileStoreDataProfilesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsInspectTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *OrganizationsLocationsFileStoreDataProfilesDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createinspecttemplaterequest) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/inspectTemplates") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parentid, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.organizations.locations.inspectTemplates.create" call. +// Do executes the "dlp.organizations.locations.fileStoreDataProfiles.delete" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2InspectTemplate.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 *OrganizationsLocationsInspectTemplatesCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2InspectTemplate, error) { +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsLocationsFileStoreDataProfilesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13540,7 +13826,7 @@ func (c *OrganizationsLocationsInspectTemplatesCreateCall) Do(opts ...googleapi. if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2InspectTemplate{ + ret := &GoogleProtobufEmpty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13553,23 +13839,21 @@ func (c *OrganizationsLocationsInspectTemplatesCreateCall) Do(opts ...googleapi. return ret, nil } -type OrganizationsLocationsInspectTemplatesDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsLocationsFileStoreDataProfilesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes an InspectTemplate. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-templates -// to learn more. +// Get: Gets a file store data profile. // -// - name: Resource name of the organization and inspectTemplate to be deleted, -// for example `organizations/433245324/inspectTemplates/432452342` or -// projects/project-id/inspectTemplates/432452342. -func (r *OrganizationsLocationsInspectTemplatesService) Delete(name string) *OrganizationsLocationsInspectTemplatesDeleteCall { - c := &OrganizationsLocationsInspectTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Resource name, for example +// `organizations/12345/locations/us/fileStoreDataProfiles/53234423`. +func (r *OrganizationsLocationsFileStoreDataProfilesService) Get(name string) *OrganizationsLocationsFileStoreDataProfilesGetCall { + c := &OrganizationsLocationsFileStoreDataProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -13577,108 +13861,7 @@ func (r *OrganizationsLocationsInspectTemplatesService) Delete(name string) *Org // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *OrganizationsLocationsInspectTemplatesDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsInspectTemplatesDeleteCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *OrganizationsLocationsInspectTemplatesDeleteCall) Context(ctx context.Context) *OrganizationsLocationsInspectTemplatesDeleteCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *OrganizationsLocationsInspectTemplatesDeleteCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *OrganizationsLocationsInspectTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+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 "dlp.organizations.locations.inspectTemplates.delete" call. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *OrganizationsLocationsInspectTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &GoogleProtobufEmpty{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil -} - -type OrganizationsLocationsInspectTemplatesGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// Get: Gets an InspectTemplate. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-templates -// to learn more. -// -// - name: Resource name of the organization and inspectTemplate to be read, -// for example `organizations/433245324/inspectTemplates/432452342` or -// projects/project-id/inspectTemplates/432452342. -func (r *OrganizationsLocationsInspectTemplatesService) Get(name string) *OrganizationsLocationsInspectTemplatesGetCall { - c := &OrganizationsLocationsInspectTemplatesGetCall{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 -// details. -func (c *OrganizationsLocationsInspectTemplatesGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsInspectTemplatesGetCall { +func (c *OrganizationsLocationsFileStoreDataProfilesGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsFileStoreDataProfilesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -13686,27 +13869,27 @@ func (c *OrganizationsLocationsInspectTemplatesGetCall) Fields(s ...googleapi.Fi // IfNoneMatch sets an 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. -func (c *OrganizationsLocationsInspectTemplatesGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsInspectTemplatesGetCall { +func (c *OrganizationsLocationsFileStoreDataProfilesGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsFileStoreDataProfilesGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *OrganizationsLocationsInspectTemplatesGetCall) Context(ctx context.Context) *OrganizationsLocationsInspectTemplatesGetCall { +func (c *OrganizationsLocationsFileStoreDataProfilesGetCall) Context(ctx context.Context) *OrganizationsLocationsFileStoreDataProfilesGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *OrganizationsLocationsInspectTemplatesGetCall) Header() http.Header { +func (c *OrganizationsLocationsFileStoreDataProfilesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsInspectTemplatesGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsFileStoreDataProfilesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -13727,13 +13910,13 @@ func (c *OrganizationsLocationsInspectTemplatesGetCall) doRequest(alt string) (* return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.organizations.locations.inspectTemplates.get" call. +// Do executes the "dlp.organizations.locations.fileStoreDataProfiles.get" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2InspectTemplate.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use +// *GooglePrivacyDlpV2FileStoreDataProfile.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 *OrganizationsLocationsInspectTemplatesGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2InspectTemplate, error) { +func (c *OrganizationsLocationsFileStoreDataProfilesGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2FileStoreDataProfile, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13752,7 +13935,7 @@ func (c *OrganizationsLocationsInspectTemplatesGetCall) Do(opts ...googleapi.Cal if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2InspectTemplate{ + ret := &GooglePrivacyDlpV2FileStoreDataProfile{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13765,69 +13948,75 @@ func (c *OrganizationsLocationsInspectTemplatesGetCall) Do(opts ...googleapi.Cal return ret, nil } -type OrganizationsLocationsInspectTemplatesListCall struct { +type OrganizationsLocationsFileStoreDataProfilesListCall struct { s *Service - parentid string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists InspectTemplates. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-templates -// to learn more. +// List: Lists file store data profiles for an organization. // -// - parent: Parent resource name. The format of this value varies depending on -// the scope of the request (project or organization) and whether you have -// specified a processing location -// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` -// LOCATION_ID + Projects scope, no location specified (defaults to global): -// `projects/`PROJECT_ID + Organizations scope, location specified: -// `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no -// location specified (defaults to global): `organizations/`ORG_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: -// parent=projects/example-project/locations/europe-west3. -func (r *OrganizationsLocationsInspectTemplatesService) List(parentid string) *OrganizationsLocationsInspectTemplatesListCall { - c := &OrganizationsLocationsInspectTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parentid = parentid +// - parent: Resource name of the organization or project, for example +// `organizations/433245324/locations/europe` or +// `projects/project-id/locations/asia`. +func (r *OrganizationsLocationsFileStoreDataProfilesService) List(parent string) *OrganizationsLocationsFileStoreDataProfilesListCall { + c := &OrganizationsLocationsFileStoreDataProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } -// LocationId sets the optional parameter "locationId": Deprecated. This field -// has no effect. -func (c *OrganizationsLocationsInspectTemplatesListCall) LocationId(locationId string) *OrganizationsLocationsInspectTemplatesListCall { - c.urlParams_.Set("locationId", locationId) +// Filter sets the optional parameter "filter": Allows filtering. Supported +// syntax: * Filter expressions are made up of one or more restrictions. * +// Restrictions can be combined by `AND` or `OR` logical operators. A sequence +// of restrictions implicitly uses `AND`. * A restriction has the form of +// `{field} {operator} {value}`. * Supported fields/values: - `project_id` - +// The Google Cloud project ID. - `file_store_path` - The path like +// "gs://bucket". - `sensitivity_level` - HIGH|MODERATE|LOW - `data_risk_level` +// - HIGH|MODERATE|LOW - `resource_visibility`: PUBLIC|RESTRICTED - +// `status_code` - an RPC status code as defined in +// https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto * +// The operator must be `=` or `!=`. Examples: * `project_id = 12345 AND +// status_code = 1` * `project_id = 12345 AND sensitivity_level = HIGH` * +// `project_id = 12345 AND resource_visibility = PUBLIC` . * 'file_store_path = +// "gs://mybucket" The length of this field should be no more than 500 +// characters. +func (c *OrganizationsLocationsFileStoreDataProfilesListCall) Filter(filter string) *OrganizationsLocationsFileStoreDataProfilesListCall { + c.urlParams_.Set("filter", filter) return c } // OrderBy sets the optional parameter "orderBy": Comma separated list of // fields to order by, followed by `asc` or `desc` postfix. This list is case // insensitive. The default sorting order is ascending. Redundant space -// characters are insignificant. Example: `name asc,update_time, create_time -// desc` Supported fields are: - `create_time`: corresponds to the time the -// template was created. - `update_time`: corresponds to the time the template -// was last updated. - `name`: corresponds to the template's name. - -// `display_name`: corresponds to the template's display name. -func (c *OrganizationsLocationsInspectTemplatesListCall) OrderBy(orderBy string) *OrganizationsLocationsInspectTemplatesListCall { +// characters are insignificant. Only one order field at a time is allowed. +// Examples: * `project_id asc` * `name` * `sensitivity_level desc` Supported +// fields are: - `project_id`: The Google Cloud project ID. - +// `sensitivity_level`: How sensitive the data in a table is, at most. - +// `data_risk_level`: How much risk is associated with this data. - +// `profile_last_generated`: When the profile was last updated in epoch +// seconds. - `last_modified`: The last time the resource was modified. - +// `resource_visibility`: Visibility restriction for this resource. - `name`: +// The name of the profile. - `create_time`: The time the file store was first +// created. +func (c *OrganizationsLocationsFileStoreDataProfilesListCall) OrderBy(orderBy string) *OrganizationsLocationsFileStoreDataProfilesListCall { c.urlParams_.Set("orderBy", orderBy) return c } // PageSize sets the optional parameter "pageSize": Size of the page. This -// value can be limited by the server. If zero server returns a page of max +// value can be limited by the server. If zero, server returns a page of max // size 100. -func (c *OrganizationsLocationsInspectTemplatesListCall) PageSize(pageSize int64) *OrganizationsLocationsInspectTemplatesListCall { +func (c *OrganizationsLocationsFileStoreDataProfilesListCall) PageSize(pageSize int64) *OrganizationsLocationsFileStoreDataProfilesListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } // PageToken sets the optional parameter "pageToken": Page token to continue -// retrieval. Comes from the previous call to `ListInspectTemplates`. -func (c *OrganizationsLocationsInspectTemplatesListCall) PageToken(pageToken string) *OrganizationsLocationsInspectTemplatesListCall { +// retrieval. +func (c *OrganizationsLocationsFileStoreDataProfilesListCall) PageToken(pageToken string) *OrganizationsLocationsFileStoreDataProfilesListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -13835,7 +14024,7 @@ func (c *OrganizationsLocationsInspectTemplatesListCall) PageToken(pageToken str // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *OrganizationsLocationsInspectTemplatesListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsInspectTemplatesListCall { +func (c *OrganizationsLocationsFileStoreDataProfilesListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsFileStoreDataProfilesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -13843,27 +14032,27 @@ func (c *OrganizationsLocationsInspectTemplatesListCall) Fields(s ...googleapi.F // IfNoneMatch sets an 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. -func (c *OrganizationsLocationsInspectTemplatesListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsInspectTemplatesListCall { +func (c *OrganizationsLocationsFileStoreDataProfilesListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsFileStoreDataProfilesListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *OrganizationsLocationsInspectTemplatesListCall) Context(ctx context.Context) *OrganizationsLocationsInspectTemplatesListCall { +func (c *OrganizationsLocationsFileStoreDataProfilesListCall) Context(ctx context.Context) *OrganizationsLocationsFileStoreDataProfilesListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *OrganizationsLocationsInspectTemplatesListCall) Header() http.Header { +func (c *OrganizationsLocationsFileStoreDataProfilesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsInspectTemplatesListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsFileStoreDataProfilesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -13871,7 +14060,7 @@ func (c *OrganizationsLocationsInspectTemplatesListCall) doRequest(alt string) ( var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/inspectTemplates") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/fileStoreDataProfiles") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -13879,18 +14068,18 @@ func (c *OrganizationsLocationsInspectTemplatesListCall) doRequest(alt string) ( } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parentid, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.organizations.locations.inspectTemplates.list" call. +// Do executes the "dlp.organizations.locations.fileStoreDataProfiles.list" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2ListInspectTemplatesResponse.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 +// *GooglePrivacyDlpV2ListFileStoreDataProfilesResponse.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 *OrganizationsLocationsInspectTemplatesListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListInspectTemplatesResponse, error) { +func (c *OrganizationsLocationsFileStoreDataProfilesListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListFileStoreDataProfilesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13909,7 +14098,7 @@ func (c *OrganizationsLocationsInspectTemplatesListCall) Do(opts ...googleapi.Ca if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2ListInspectTemplatesResponse{ + ret := &GooglePrivacyDlpV2ListFileStoreDataProfilesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13925,7 +14114,7 @@ func (c *OrganizationsLocationsInspectTemplatesListCall) Do(opts ...googleapi.Ca // 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 *OrganizationsLocationsInspectTemplatesListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListInspectTemplatesResponse) error) error { +func (c *OrganizationsLocationsFileStoreDataProfilesListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListFileStoreDataProfilesResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { @@ -13943,81 +14132,92 @@ func (c *OrganizationsLocationsInspectTemplatesListCall) Pages(ctx context.Conte } } -type OrganizationsLocationsInspectTemplatesPatchCall struct { +type OrganizationsLocationsInspectTemplatesCreateCall struct { s *Service - name string - googleprivacydlpv2updateinspecttemplaterequest *GooglePrivacyDlpV2UpdateInspectTemplateRequest + parentid string + googleprivacydlpv2createinspecttemplaterequest *GooglePrivacyDlpV2CreateInspectTemplateRequest urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Patch: Updates the InspectTemplate. See +// Create: Creates an InspectTemplate for reusing frequently used configuration +// for inspecting content, images, and storage. See // https://cloud.google.com/sensitive-data-protection/docs/creating-templates // to learn more. // -// - name: Resource name of organization and inspectTemplate to be updated, for -// example `organizations/433245324/inspectTemplates/432452342` or -// projects/project-id/inspectTemplates/432452342. -func (r *OrganizationsLocationsInspectTemplatesService) Patch(name string, googleprivacydlpv2updateinspecttemplaterequest *GooglePrivacyDlpV2UpdateInspectTemplateRequest) *OrganizationsLocationsInspectTemplatesPatchCall { - c := &OrganizationsLocationsInspectTemplatesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.googleprivacydlpv2updateinspecttemplaterequest = googleprivacydlpv2updateinspecttemplaterequest +// - parent: Parent resource name. The format of this value varies depending on +// the scope of the request (project or organization) and whether you have +// specified a processing location +// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID + Organizations scope, location specified: +// `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no +// location specified (defaults to global): `organizations/`ORG_ID The +// following example `parent` string specifies a parent project with the +// identifier `example-project`, and specifies the `europe-west3` location +// for processing data: +// parent=projects/example-project/locations/europe-west3. +func (r *OrganizationsLocationsInspectTemplatesService) Create(parentid string, googleprivacydlpv2createinspecttemplaterequest *GooglePrivacyDlpV2CreateInspectTemplateRequest) *OrganizationsLocationsInspectTemplatesCreateCall { + c := &OrganizationsLocationsInspectTemplatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parentid = parentid + c.googleprivacydlpv2createinspecttemplaterequest = googleprivacydlpv2createinspecttemplaterequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *OrganizationsLocationsInspectTemplatesPatchCall) Fields(s ...googleapi.Field) *OrganizationsLocationsInspectTemplatesPatchCall { +func (c *OrganizationsLocationsInspectTemplatesCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsInspectTemplatesCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *OrganizationsLocationsInspectTemplatesPatchCall) Context(ctx context.Context) *OrganizationsLocationsInspectTemplatesPatchCall { +func (c *OrganizationsLocationsInspectTemplatesCreateCall) Context(ctx context.Context) *OrganizationsLocationsInspectTemplatesCreateCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *OrganizationsLocationsInspectTemplatesPatchCall) Header() http.Header { +func (c *OrganizationsLocationsInspectTemplatesCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsInspectTemplatesPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsInspectTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updateinspecttemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createinspecttemplaterequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/inspectTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parentid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.organizations.locations.inspectTemplates.patch" call. +// Do executes the "dlp.organizations.locations.inspectTemplates.create" call. // Any non-2xx status code is an error. Response headers are in either // *GooglePrivacyDlpV2InspectTemplate.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 *OrganizationsLocationsInspectTemplatesPatchCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2InspectTemplate, error) { +func (c *OrganizationsLocationsInspectTemplatesCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2InspectTemplate, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14049,135 +14249,23 @@ func (c *OrganizationsLocationsInspectTemplatesPatchCall) Do(opts ...googleapi.C return ret, nil } -type OrganizationsLocationsJobTriggersCreateCall struct { - s *Service - parentid string - googleprivacydlpv2createjobtriggerrequest *GooglePrivacyDlpV2CreateJobTriggerRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsLocationsInspectTemplatesDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a job trigger to run DLP actions such as scanning storage -// for sensitive information on a set schedule. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-job-triggers +// Delete: Deletes an InspectTemplate. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-templates // to learn more. // -// - parent: Parent resource name. The format of this value varies depending on -// whether you have specified a processing location -// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` -// LOCATION_ID + Projects scope, no location specified (defaults to global): -// `projects/`PROJECT_ID The following example `parent` string specifies a -// parent project with the identifier `example-project`, and specifies the -// `europe-west3` location for processing data: -// parent=projects/example-project/locations/europe-west3. -func (r *OrganizationsLocationsJobTriggersService) Create(parentid string, googleprivacydlpv2createjobtriggerrequest *GooglePrivacyDlpV2CreateJobTriggerRequest) *OrganizationsLocationsJobTriggersCreateCall { - c := &OrganizationsLocationsJobTriggersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parentid = parentid - c.googleprivacydlpv2createjobtriggerrequest = googleprivacydlpv2createjobtriggerrequest - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *OrganizationsLocationsJobTriggersCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsJobTriggersCreateCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *OrganizationsLocationsJobTriggersCreateCall) Context(ctx context.Context) *OrganizationsLocationsJobTriggersCreateCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *OrganizationsLocationsJobTriggersCreateCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *OrganizationsLocationsJobTriggersCreateCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createjobtriggerrequest) - if err != nil { - return nil, err - } - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/jobTriggers") - 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.parentid, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "dlp.organizations.locations.jobTriggers.create" call. -// Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2JobTrigger.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 *OrganizationsLocationsJobTriggersCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2JobTrigger, 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 := &GooglePrivacyDlpV2JobTrigger{ - 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 -} - -type OrganizationsLocationsJobTriggersDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Delete: Deletes a job trigger. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-job-triggers -// to learn more. -// -// - name: Resource name of the project and the triggeredJob, for example -// `projects/dlp-test-project/jobTriggers/53234423`. -func (r *OrganizationsLocationsJobTriggersService) Delete(name string) *OrganizationsLocationsJobTriggersDeleteCall { - c := &OrganizationsLocationsJobTriggersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Resource name of the organization and inspectTemplate to be deleted, +// for example `organizations/433245324/inspectTemplates/432452342` or +// projects/project-id/inspectTemplates/432452342. +func (r *OrganizationsLocationsInspectTemplatesService) Delete(name string) *OrganizationsLocationsInspectTemplatesDeleteCall { + c := &OrganizationsLocationsInspectTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -14185,27 +14273,27 @@ func (r *OrganizationsLocationsJobTriggersService) Delete(name string) *Organiza // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *OrganizationsLocationsJobTriggersDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsJobTriggersDeleteCall { +func (c *OrganizationsLocationsInspectTemplatesDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsInspectTemplatesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *OrganizationsLocationsJobTriggersDeleteCall) Context(ctx context.Context) *OrganizationsLocationsJobTriggersDeleteCall { +func (c *OrganizationsLocationsInspectTemplatesDeleteCall) Context(ctx context.Context) *OrganizationsLocationsInspectTemplatesDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *OrganizationsLocationsJobTriggersDeleteCall) Header() http.Header { +func (c *OrganizationsLocationsInspectTemplatesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsJobTriggersDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsInspectTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil c.urlParams_.Set("alt", alt) @@ -14223,13 +14311,13 @@ func (c *OrganizationsLocationsJobTriggersDeleteCall) doRequest(alt string) (*ht return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.organizations.locations.jobTriggers.delete" call. +// Do executes the "dlp.organizations.locations.inspectTemplates.delete" call. // Any non-2xx status code is an error. Response headers are in either // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified was // returned. -func (c *OrganizationsLocationsJobTriggersDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { +func (c *OrganizationsLocationsInspectTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14261,7 +14349,7 @@ func (c *OrganizationsLocationsJobTriggersDeleteCall) Do(opts ...googleapi.CallO return ret, nil } -type OrganizationsLocationsJobTriggersGetCall struct { +type OrganizationsLocationsInspectTemplatesGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -14270,14 +14358,15 @@ type OrganizationsLocationsJobTriggersGetCall struct { header_ http.Header } -// Get: Gets a job trigger. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-job-triggers +// Get: Gets an InspectTemplate. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-templates // to learn more. // -// - name: Resource name of the project and the triggeredJob, for example -// `projects/dlp-test-project/jobTriggers/53234423`. -func (r *OrganizationsLocationsJobTriggersService) Get(name string) *OrganizationsLocationsJobTriggersGetCall { - c := &OrganizationsLocationsJobTriggersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Resource name of the organization and inspectTemplate to be read, +// for example `organizations/433245324/inspectTemplates/432452342` or +// projects/project-id/inspectTemplates/432452342. +func (r *OrganizationsLocationsInspectTemplatesService) Get(name string) *OrganizationsLocationsInspectTemplatesGetCall { + c := &OrganizationsLocationsInspectTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -14285,7 +14374,7 @@ func (r *OrganizationsLocationsJobTriggersService) Get(name string) *Organizatio // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *OrganizationsLocationsJobTriggersGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsJobTriggersGetCall { +func (c *OrganizationsLocationsInspectTemplatesGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsInspectTemplatesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -14293,27 +14382,27 @@ func (c *OrganizationsLocationsJobTriggersGetCall) Fields(s ...googleapi.Field) // IfNoneMatch sets an 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. -func (c *OrganizationsLocationsJobTriggersGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsJobTriggersGetCall { +func (c *OrganizationsLocationsInspectTemplatesGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsInspectTemplatesGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *OrganizationsLocationsJobTriggersGetCall) Context(ctx context.Context) *OrganizationsLocationsJobTriggersGetCall { +func (c *OrganizationsLocationsInspectTemplatesGetCall) Context(ctx context.Context) *OrganizationsLocationsInspectTemplatesGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *OrganizationsLocationsJobTriggersGetCall) Header() http.Header { +func (c *OrganizationsLocationsInspectTemplatesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsJobTriggersGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsInspectTemplatesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -14334,13 +14423,13 @@ func (c *OrganizationsLocationsJobTriggersGetCall) doRequest(alt string) (*http. return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.organizations.locations.jobTriggers.get" call. +// Do executes the "dlp.organizations.locations.inspectTemplates.get" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2JobTrigger.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// *GooglePrivacyDlpV2InspectTemplate.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 *OrganizationsLocationsJobTriggersGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2JobTrigger, error) { +func (c *OrganizationsLocationsInspectTemplatesGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2InspectTemplate, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14359,7 +14448,7 @@ func (c *OrganizationsLocationsJobTriggersGetCall) Do(opts ...googleapi.CallOpti if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2JobTrigger{ + ret := &GooglePrivacyDlpV2InspectTemplate{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14372,7 +14461,7 @@ func (c *OrganizationsLocationsJobTriggersGetCall) Do(opts ...googleapi.CallOpti return ret, nil } -type OrganizationsLocationsJobTriggersListCall struct { +type OrganizationsLocationsInspectTemplatesListCall struct { s *Service parentid string urlParams_ gensupport.URLParams @@ -14381,99 +14470,68 @@ type OrganizationsLocationsJobTriggersListCall struct { header_ http.Header } -// List: Lists job triggers. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-job-triggers +// List: Lists InspectTemplates. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-templates // to learn more. // // - parent: Parent resource name. The format of this value varies depending on -// whether you have specified a processing location +// the scope of the request (project or organization) and whether you have +// specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): // - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` // LOCATION_ID + Projects scope, no location specified (defaults to global): -// `projects/`PROJECT_ID The following example `parent` string specifies a -// parent project with the identifier `example-project`, and specifies the -// `europe-west3` location for processing data: +// `projects/`PROJECT_ID + Organizations scope, location specified: +// `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no +// location specified (defaults to global): `organizations/`ORG_ID The +// following example `parent` string specifies a parent project with the +// identifier `example-project`, and specifies the `europe-west3` location +// for processing data: // parent=projects/example-project/locations/europe-west3. -func (r *OrganizationsLocationsJobTriggersService) List(parentid string) *OrganizationsLocationsJobTriggersListCall { - c := &OrganizationsLocationsJobTriggersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *OrganizationsLocationsInspectTemplatesService) List(parentid string) *OrganizationsLocationsInspectTemplatesListCall { + c := &OrganizationsLocationsInspectTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parentid = parentid return c } -// Filter sets the optional parameter "filter": Allows filtering. Supported -// syntax: * Filter expressions are made up of one or more restrictions. * -// Restrictions can be combined by `AND` or `OR` logical operators. A sequence -// of restrictions implicitly uses `AND`. * A restriction has the form of -// `{field} {operator} {value}`. * Supported fields/values for inspect -// triggers: - `status` - HEALTHY|PAUSED|CANCELLED - `inspected_storage` - -// DATASTORE|CLOUD_STORAGE|BIGQUERY - 'last_run_time` - RFC 3339 formatted -// timestamp, surrounded by quotation marks. Nanoseconds are ignored. - -// 'error_count' - Number of errors that have occurred while running. * The -// operator must be `=` or `!=` for status and inspected_storage. Examples: * -// inspected_storage = cloud_storage AND status = HEALTHY * inspected_storage = -// cloud_storage OR inspected_storage = bigquery * inspected_storage = -// cloud_storage AND (state = PAUSED OR state = HEALTHY) * last_run_time > -// \"2017-12-12T00:00:00+00:00\" The length of this field should be no more -// than 500 characters. -func (c *OrganizationsLocationsJobTriggersListCall) Filter(filter string) *OrganizationsLocationsJobTriggersListCall { - c.urlParams_.Set("filter", filter) - return c -} - // LocationId sets the optional parameter "locationId": Deprecated. This field // has no effect. -func (c *OrganizationsLocationsJobTriggersListCall) LocationId(locationId string) *OrganizationsLocationsJobTriggersListCall { +func (c *OrganizationsLocationsInspectTemplatesListCall) LocationId(locationId string) *OrganizationsLocationsInspectTemplatesListCall { c.urlParams_.Set("locationId", locationId) return c } // OrderBy sets the optional parameter "orderBy": Comma separated list of -// triggeredJob fields to order by, followed by `asc` or `desc` postfix. This -// list is case insensitive. The default sorting order is ascending. Redundant -// space characters are insignificant. Example: `name asc,update_time, -// create_time desc` Supported fields are: - `create_time`: corresponds to the -// time the JobTrigger was created. - `update_time`: corresponds to the time -// the JobTrigger was last updated. - `last_run_time`: corresponds to the last -// time the JobTrigger ran. - `name`: corresponds to the JobTrigger's name. - -// `display_name`: corresponds to the JobTrigger's display name. - `status`: -// corresponds to JobTrigger's status. -func (c *OrganizationsLocationsJobTriggersListCall) OrderBy(orderBy string) *OrganizationsLocationsJobTriggersListCall { +// fields to order by, followed by `asc` or `desc` postfix. This list is case +// insensitive. The default sorting order is ascending. Redundant space +// characters are insignificant. Example: `name asc,update_time, create_time +// desc` Supported fields are: - `create_time`: corresponds to the time the +// template was created. - `update_time`: corresponds to the time the template +// was last updated. - `name`: corresponds to the template's name. - +// `display_name`: corresponds to the template's display name. +func (c *OrganizationsLocationsInspectTemplatesListCall) OrderBy(orderBy string) *OrganizationsLocationsInspectTemplatesListCall { c.urlParams_.Set("orderBy", orderBy) return c } // PageSize sets the optional parameter "pageSize": Size of the page. This -// value can be limited by a server. -func (c *OrganizationsLocationsJobTriggersListCall) PageSize(pageSize int64) *OrganizationsLocationsJobTriggersListCall { +// value can be limited by the server. If zero server returns a page of max +// size 100. +func (c *OrganizationsLocationsInspectTemplatesListCall) PageSize(pageSize int64) *OrganizationsLocationsInspectTemplatesListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } // PageToken sets the optional parameter "pageToken": Page token to continue -// retrieval. Comes from the previous call to ListJobTriggers. `order_by` field -// must not change for subsequent calls. -func (c *OrganizationsLocationsJobTriggersListCall) PageToken(pageToken string) *OrganizationsLocationsJobTriggersListCall { +// retrieval. Comes from the previous call to `ListInspectTemplates`. +func (c *OrganizationsLocationsInspectTemplatesListCall) PageToken(pageToken string) *OrganizationsLocationsInspectTemplatesListCall { c.urlParams_.Set("pageToken", pageToken) return c } -// Type sets the optional parameter "type": The type of jobs. Will use -// `DlpJobType.INSPECT` if not set. -// -// Possible values: -// -// "DLP_JOB_TYPE_UNSPECIFIED" - Defaults to INSPECT_JOB. -// "INSPECT_JOB" - The job inspected Google Cloud for sensitive data. -// "RISK_ANALYSIS_JOB" - The job executed a Risk Analysis computation. -func (c *OrganizationsLocationsJobTriggersListCall) Type(type_ string) *OrganizationsLocationsJobTriggersListCall { - c.urlParams_.Set("type", type_) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *OrganizationsLocationsJobTriggersListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsJobTriggersListCall { +func (c *OrganizationsLocationsInspectTemplatesListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsInspectTemplatesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -14481,27 +14539,27 @@ func (c *OrganizationsLocationsJobTriggersListCall) Fields(s ...googleapi.Field) // IfNoneMatch sets an 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. -func (c *OrganizationsLocationsJobTriggersListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsJobTriggersListCall { +func (c *OrganizationsLocationsInspectTemplatesListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsInspectTemplatesListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *OrganizationsLocationsJobTriggersListCall) Context(ctx context.Context) *OrganizationsLocationsJobTriggersListCall { +func (c *OrganizationsLocationsInspectTemplatesListCall) Context(ctx context.Context) *OrganizationsLocationsInspectTemplatesListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *OrganizationsLocationsJobTriggersListCall) Header() http.Header { +func (c *OrganizationsLocationsInspectTemplatesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsJobTriggersListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsInspectTemplatesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -14509,7 +14567,7 @@ func (c *OrganizationsLocationsJobTriggersListCall) doRequest(alt string) (*http var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/jobTriggers") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/inspectTemplates") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -14522,13 +14580,13 @@ func (c *OrganizationsLocationsJobTriggersListCall) doRequest(alt string) (*http return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.organizations.locations.jobTriggers.list" call. +// Do executes the "dlp.organizations.locations.inspectTemplates.list" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2ListJobTriggersResponse.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use +// *GooglePrivacyDlpV2ListInspectTemplatesResponse.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 *OrganizationsLocationsJobTriggersListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListJobTriggersResponse, error) { +func (c *OrganizationsLocationsInspectTemplatesListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListInspectTemplatesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14547,7 +14605,7 @@ func (c *OrganizationsLocationsJobTriggersListCall) Do(opts ...googleapi.CallOpt if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2ListJobTriggersResponse{ + ret := &GooglePrivacyDlpV2ListInspectTemplatesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14563,7 +14621,7 @@ func (c *OrganizationsLocationsJobTriggersListCall) Do(opts ...googleapi.CallOpt // 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 *OrganizationsLocationsJobTriggersListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListJobTriggersResponse) error) error { +func (c *OrganizationsLocationsInspectTemplatesListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListInspectTemplatesResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { @@ -14581,55 +14639,56 @@ func (c *OrganizationsLocationsJobTriggersListCall) Pages(ctx context.Context, f } } -type OrganizationsLocationsJobTriggersPatchCall struct { - s *Service - name string - googleprivacydlpv2updatejobtriggerrequest *GooglePrivacyDlpV2UpdateJobTriggerRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsLocationsInspectTemplatesPatchCall struct { + s *Service + name string + googleprivacydlpv2updateinspecttemplaterequest *GooglePrivacyDlpV2UpdateInspectTemplateRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates a job trigger. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-job-triggers +// Patch: Updates the InspectTemplate. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-templates // to learn more. // -// - name: Resource name of the project and the triggeredJob, for example -// `projects/dlp-test-project/jobTriggers/53234423`. -func (r *OrganizationsLocationsJobTriggersService) Patch(name string, googleprivacydlpv2updatejobtriggerrequest *GooglePrivacyDlpV2UpdateJobTriggerRequest) *OrganizationsLocationsJobTriggersPatchCall { - c := &OrganizationsLocationsJobTriggersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Resource name of organization and inspectTemplate to be updated, for +// example `organizations/433245324/inspectTemplates/432452342` or +// projects/project-id/inspectTemplates/432452342. +func (r *OrganizationsLocationsInspectTemplatesService) Patch(name string, googleprivacydlpv2updateinspecttemplaterequest *GooglePrivacyDlpV2UpdateInspectTemplateRequest) *OrganizationsLocationsInspectTemplatesPatchCall { + c := &OrganizationsLocationsInspectTemplatesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googleprivacydlpv2updatejobtriggerrequest = googleprivacydlpv2updatejobtriggerrequest + c.googleprivacydlpv2updateinspecttemplaterequest = googleprivacydlpv2updateinspecttemplaterequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *OrganizationsLocationsJobTriggersPatchCall) Fields(s ...googleapi.Field) *OrganizationsLocationsJobTriggersPatchCall { +func (c *OrganizationsLocationsInspectTemplatesPatchCall) Fields(s ...googleapi.Field) *OrganizationsLocationsInspectTemplatesPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *OrganizationsLocationsJobTriggersPatchCall) Context(ctx context.Context) *OrganizationsLocationsJobTriggersPatchCall { +func (c *OrganizationsLocationsInspectTemplatesPatchCall) Context(ctx context.Context) *OrganizationsLocationsInspectTemplatesPatchCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *OrganizationsLocationsJobTriggersPatchCall) Header() http.Header { +func (c *OrganizationsLocationsInspectTemplatesPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsJobTriggersPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsInspectTemplatesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatejobtriggerrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updateinspecttemplaterequest) if err != nil { return nil, err } @@ -14648,13 +14707,13 @@ func (c *OrganizationsLocationsJobTriggersPatchCall) doRequest(alt string) (*htt return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.organizations.locations.jobTriggers.patch" call. +// Do executes the "dlp.organizations.locations.inspectTemplates.patch" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2JobTrigger.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// *GooglePrivacyDlpV2InspectTemplate.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 *OrganizationsLocationsJobTriggersPatchCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2JobTrigger, error) { +func (c *OrganizationsLocationsInspectTemplatesPatchCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2InspectTemplate, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14673,7 +14732,7 @@ func (c *OrganizationsLocationsJobTriggersPatchCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2JobTrigger{ + ret := &GooglePrivacyDlpV2InspectTemplate{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14686,84 +14745,88 @@ func (c *OrganizationsLocationsJobTriggersPatchCall) Do(opts ...googleapi.CallOp return ret, nil } -type OrganizationsLocationsProjectDataProfilesGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsLocationsJobTriggersCreateCall struct { + s *Service + parentid string + googleprivacydlpv2createjobtriggerrequest *GooglePrivacyDlpV2CreateJobTriggerRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a project data profile. +// Create: Creates a job trigger to run DLP actions such as scanning storage +// for sensitive information on a set schedule. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-job-triggers +// to learn more. // -// - name: Resource name, for example -// `organizations/12345/locations/us/projectDataProfiles/53234423`. -func (r *OrganizationsLocationsProjectDataProfilesService) Get(name string) *OrganizationsLocationsProjectDataProfilesGetCall { - c := &OrganizationsLocationsProjectDataProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: Parent resource name. The format of this value varies depending on +// whether you have specified a processing location +// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: +// parent=projects/example-project/locations/europe-west3. +func (r *OrganizationsLocationsJobTriggersService) Create(parentid string, googleprivacydlpv2createjobtriggerrequest *GooglePrivacyDlpV2CreateJobTriggerRequest) *OrganizationsLocationsJobTriggersCreateCall { + c := &OrganizationsLocationsJobTriggersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parentid = parentid + c.googleprivacydlpv2createjobtriggerrequest = googleprivacydlpv2createjobtriggerrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *OrganizationsLocationsProjectDataProfilesGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsProjectDataProfilesGetCall { +func (c *OrganizationsLocationsJobTriggersCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsJobTriggersCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an 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. -func (c *OrganizationsLocationsProjectDataProfilesGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsProjectDataProfilesGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *OrganizationsLocationsProjectDataProfilesGetCall) Context(ctx context.Context) *OrganizationsLocationsProjectDataProfilesGetCall { +func (c *OrganizationsLocationsJobTriggersCreateCall) Context(ctx context.Context) *OrganizationsLocationsJobTriggersCreateCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *OrganizationsLocationsProjectDataProfilesGetCall) Header() http.Header { +func (c *OrganizationsLocationsJobTriggersCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsProjectDataProfilesGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *OrganizationsLocationsJobTriggersCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createjobtriggerrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/jobTriggers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parentid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.organizations.locations.projectDataProfiles.get" call. +// Do executes the "dlp.organizations.locations.jobTriggers.create" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2ProjectDataProfile.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use +// *GooglePrivacyDlpV2JobTrigger.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 *OrganizationsLocationsProjectDataProfilesGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ProjectDataProfile, error) { +func (c *OrganizationsLocationsJobTriggersCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2JobTrigger, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14782,7 +14845,7 @@ func (c *OrganizationsLocationsProjectDataProfilesGetCall) Do(opts ...googleapi. if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2ProjectDataProfile{ + ret := &GooglePrivacyDlpV2JobTrigger{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14795,128 +14858,74 @@ func (c *OrganizationsLocationsProjectDataProfilesGetCall) Do(opts ...googleapi. return ret, nil } -type OrganizationsLocationsProjectDataProfilesListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsLocationsJobTriggersDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists project data profiles for an organization. +// Delete: Deletes a job trigger. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-job-triggers +// to learn more. // -// - parent: organizations/{org_id}/locations/{loc_id}. -func (r *OrganizationsLocationsProjectDataProfilesService) List(parent string) *OrganizationsLocationsProjectDataProfilesListCall { - c := &OrganizationsLocationsProjectDataProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// Filter sets the optional parameter "filter": Allows filtering. Supported -// syntax: * Filter expressions are made up of one or more restrictions. * -// Restrictions can be combined by `AND` or `OR` logical operators. A sequence -// of restrictions implicitly uses `AND`. * A restriction has the form of -// `{field} {operator} {value}`. * Supported fields/values: - -// `sensitivity_level` - HIGH|MODERATE|LOW - `data_risk_level` - -// HIGH|MODERATE|LOW - `status_code` - an RPC status code as defined in -// https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto * -// The operator must be `=` or `!=`. Examples: * `project_id = 12345 AND -// status_code = 1` * `project_id = 12345 AND sensitivity_level = HIGH` The -// length of this field should be no more than 500 characters. -func (c *OrganizationsLocationsProjectDataProfilesListCall) Filter(filter string) *OrganizationsLocationsProjectDataProfilesListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// OrderBy sets the optional parameter "orderBy": Comma separated list of -// fields to order by, followed by `asc` or `desc` postfix. This list is case -// insensitive. The default sorting order is ascending. Redundant space -// characters are insignificant. Only one order field at a time is allowed. -// Examples: * `project_id` * `sensitivity_level desc` Supported fields are: - -// `project_id`: Google Cloud project ID - `sensitivity_level`: How sensitive -// the data in a project is, at most. - `data_risk_level`: How much risk is -// associated with this data. - `profile_last_generated`: When the profile was -// last updated in epoch seconds. -func (c *OrganizationsLocationsProjectDataProfilesListCall) OrderBy(orderBy string) *OrganizationsLocationsProjectDataProfilesListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageSize sets the optional parameter "pageSize": Size of the page. This -// value can be limited by the server. If zero, server returns a page of max -// size 100. -func (c *OrganizationsLocationsProjectDataProfilesListCall) PageSize(pageSize int64) *OrganizationsLocationsProjectDataProfilesListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": Page token to continue -// retrieval. -func (c *OrganizationsLocationsProjectDataProfilesListCall) PageToken(pageToken string) *OrganizationsLocationsProjectDataProfilesListCall { - c.urlParams_.Set("pageToken", pageToken) +// - name: Resource name of the project and the triggeredJob, for example +// `projects/dlp-test-project/jobTriggers/53234423`. +func (r *OrganizationsLocationsJobTriggersService) Delete(name string) *OrganizationsLocationsJobTriggersDeleteCall { + c := &OrganizationsLocationsJobTriggersDeleteCall{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 // details. -func (c *OrganizationsLocationsProjectDataProfilesListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsProjectDataProfilesListCall { +func (c *OrganizationsLocationsJobTriggersDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsJobTriggersDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an 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. -func (c *OrganizationsLocationsProjectDataProfilesListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsProjectDataProfilesListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *OrganizationsLocationsProjectDataProfilesListCall) Context(ctx context.Context) *OrganizationsLocationsProjectDataProfilesListCall { +func (c *OrganizationsLocationsJobTriggersDeleteCall) Context(ctx context.Context) *OrganizationsLocationsJobTriggersDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *OrganizationsLocationsProjectDataProfilesListCall) Header() http.Header { +func (c *OrganizationsLocationsJobTriggersDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsProjectDataProfilesListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsJobTriggersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - 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, "v2/{+parent}/projectDataProfiles") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.organizations.locations.projectDataProfiles.list" call. +// Do executes the "dlp.organizations.locations.jobTriggers.delete" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2ListProjectDataProfilesResponse.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 *OrganizationsLocationsProjectDataProfilesListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListProjectDataProfilesResponse, error) { +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsLocationsJobTriggersDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14935,7 +14944,7 @@ func (c *OrganizationsLocationsProjectDataProfilesListCall) Do(opts ...googleapi if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2ListProjectDataProfilesResponse{ + ret := &GoogleProtobufEmpty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14948,14 +14957,1701 @@ func (c *OrganizationsLocationsProjectDataProfilesListCall) Do(opts ...googleapi return ret, nil } -// 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 *OrganizationsLocationsProjectDataProfilesListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListProjectDataProfilesResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() +type OrganizationsLocationsJobTriggersGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a job trigger. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-job-triggers +// to learn more. +// +// - name: Resource name of the project and the triggeredJob, for example +// `projects/dlp-test-project/jobTriggers/53234423`. +func (r *OrganizationsLocationsJobTriggersService) Get(name string) *OrganizationsLocationsJobTriggersGetCall { + c := &OrganizationsLocationsJobTriggersGetCall{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 +// details. +func (c *OrganizationsLocationsJobTriggersGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsJobTriggersGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *OrganizationsLocationsJobTriggersGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsJobTriggersGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *OrganizationsLocationsJobTriggersGetCall) Context(ctx context.Context) *OrganizationsLocationsJobTriggersGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *OrganizationsLocationsJobTriggersGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsJobTriggersGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "v2/{+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 "dlp.organizations.locations.jobTriggers.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *GooglePrivacyDlpV2JobTrigger.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 *OrganizationsLocationsJobTriggersGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2JobTrigger, 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 := &GooglePrivacyDlpV2JobTrigger{ + 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 +} + +type OrganizationsLocationsJobTriggersListCall struct { + s *Service + parentid string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists job triggers. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-job-triggers +// to learn more. +// +// - parent: Parent resource name. The format of this value varies depending on +// whether you have specified a processing location +// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: +// parent=projects/example-project/locations/europe-west3. +func (r *OrganizationsLocationsJobTriggersService) List(parentid string) *OrganizationsLocationsJobTriggersListCall { + c := &OrganizationsLocationsJobTriggersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parentid = parentid + return c +} + +// Filter sets the optional parameter "filter": Allows filtering. Supported +// syntax: * Filter expressions are made up of one or more restrictions. * +// Restrictions can be combined by `AND` or `OR` logical operators. A sequence +// of restrictions implicitly uses `AND`. * A restriction has the form of +// `{field} {operator} {value}`. * Supported fields/values for inspect +// triggers: - `status` - HEALTHY|PAUSED|CANCELLED - `inspected_storage` - +// DATASTORE|CLOUD_STORAGE|BIGQUERY - 'last_run_time` - RFC 3339 formatted +// timestamp, surrounded by quotation marks. Nanoseconds are ignored. - +// 'error_count' - Number of errors that have occurred while running. * The +// operator must be `=` or `!=` for status and inspected_storage. Examples: * +// inspected_storage = cloud_storage AND status = HEALTHY * inspected_storage = +// cloud_storage OR inspected_storage = bigquery * inspected_storage = +// cloud_storage AND (state = PAUSED OR state = HEALTHY) * last_run_time > +// \"2017-12-12T00:00:00+00:00\" The length of this field should be no more +// than 500 characters. +func (c *OrganizationsLocationsJobTriggersListCall) Filter(filter string) *OrganizationsLocationsJobTriggersListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// LocationId sets the optional parameter "locationId": Deprecated. This field +// has no effect. +func (c *OrganizationsLocationsJobTriggersListCall) LocationId(locationId string) *OrganizationsLocationsJobTriggersListCall { + c.urlParams_.Set("locationId", locationId) + return c +} + +// OrderBy sets the optional parameter "orderBy": Comma separated list of +// triggeredJob fields to order by, followed by `asc` or `desc` postfix. This +// list is case insensitive. The default sorting order is ascending. Redundant +// space characters are insignificant. Example: `name asc,update_time, +// create_time desc` Supported fields are: - `create_time`: corresponds to the +// time the JobTrigger was created. - `update_time`: corresponds to the time +// the JobTrigger was last updated. - `last_run_time`: corresponds to the last +// time the JobTrigger ran. - `name`: corresponds to the JobTrigger's name. - +// `display_name`: corresponds to the JobTrigger's display name. - `status`: +// corresponds to JobTrigger's status. +func (c *OrganizationsLocationsJobTriggersListCall) OrderBy(orderBy string) *OrganizationsLocationsJobTriggersListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageSize sets the optional parameter "pageSize": Size of the page. This +// value can be limited by a server. +func (c *OrganizationsLocationsJobTriggersListCall) PageSize(pageSize int64) *OrganizationsLocationsJobTriggersListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": Page token to continue +// retrieval. Comes from the previous call to ListJobTriggers. `order_by` field +// must not change for subsequent calls. +func (c *OrganizationsLocationsJobTriggersListCall) PageToken(pageToken string) *OrganizationsLocationsJobTriggersListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Type sets the optional parameter "type": The type of jobs. Will use +// `DlpJobType.INSPECT` if not set. +// +// Possible values: +// +// "DLP_JOB_TYPE_UNSPECIFIED" - Defaults to INSPECT_JOB. +// "INSPECT_JOB" - The job inspected Google Cloud for sensitive data. +// "RISK_ANALYSIS_JOB" - The job executed a Risk Analysis computation. +func (c *OrganizationsLocationsJobTriggersListCall) Type(type_ string) *OrganizationsLocationsJobTriggersListCall { + c.urlParams_.Set("type", type_) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *OrganizationsLocationsJobTriggersListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsJobTriggersListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *OrganizationsLocationsJobTriggersListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsJobTriggersListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *OrganizationsLocationsJobTriggersListCall) Context(ctx context.Context) *OrganizationsLocationsJobTriggersListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *OrganizationsLocationsJobTriggersListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsJobTriggersListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "v2/{+parent}/jobTriggers") + 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.parentid, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "dlp.organizations.locations.jobTriggers.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *GooglePrivacyDlpV2ListJobTriggersResponse.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 *OrganizationsLocationsJobTriggersListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListJobTriggersResponse, 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 := &GooglePrivacyDlpV2ListJobTriggersResponse{ + 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 +} + +// 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 *OrganizationsLocationsJobTriggersListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListJobTriggersResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type OrganizationsLocationsJobTriggersPatchCall struct { + s *Service + name string + googleprivacydlpv2updatejobtriggerrequest *GooglePrivacyDlpV2UpdateJobTriggerRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates a job trigger. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-job-triggers +// to learn more. +// +// - name: Resource name of the project and the triggeredJob, for example +// `projects/dlp-test-project/jobTriggers/53234423`. +func (r *OrganizationsLocationsJobTriggersService) Patch(name string, googleprivacydlpv2updatejobtriggerrequest *GooglePrivacyDlpV2UpdateJobTriggerRequest) *OrganizationsLocationsJobTriggersPatchCall { + c := &OrganizationsLocationsJobTriggersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googleprivacydlpv2updatejobtriggerrequest = googleprivacydlpv2updatejobtriggerrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *OrganizationsLocationsJobTriggersPatchCall) Fields(s ...googleapi.Field) *OrganizationsLocationsJobTriggersPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *OrganizationsLocationsJobTriggersPatchCall) Context(ctx context.Context) *OrganizationsLocationsJobTriggersPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *OrganizationsLocationsJobTriggersPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsJobTriggersPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatejobtriggerrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+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 "dlp.organizations.locations.jobTriggers.patch" call. +// Any non-2xx status code is an error. Response headers are in either +// *GooglePrivacyDlpV2JobTrigger.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 *OrganizationsLocationsJobTriggersPatchCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2JobTrigger, 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 := &GooglePrivacyDlpV2JobTrigger{ + 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 +} + +type OrganizationsLocationsProjectDataProfilesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a project data profile. +// +// - name: Resource name, for example +// `organizations/12345/locations/us/projectDataProfiles/53234423`. +func (r *OrganizationsLocationsProjectDataProfilesService) Get(name string) *OrganizationsLocationsProjectDataProfilesGetCall { + c := &OrganizationsLocationsProjectDataProfilesGetCall{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 +// details. +func (c *OrganizationsLocationsProjectDataProfilesGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsProjectDataProfilesGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *OrganizationsLocationsProjectDataProfilesGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsProjectDataProfilesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *OrganizationsLocationsProjectDataProfilesGetCall) Context(ctx context.Context) *OrganizationsLocationsProjectDataProfilesGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *OrganizationsLocationsProjectDataProfilesGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsProjectDataProfilesGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "v2/{+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 "dlp.organizations.locations.projectDataProfiles.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *GooglePrivacyDlpV2ProjectDataProfile.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 *OrganizationsLocationsProjectDataProfilesGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ProjectDataProfile, 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 := &GooglePrivacyDlpV2ProjectDataProfile{ + 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 +} + +type OrganizationsLocationsProjectDataProfilesListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists project data profiles for an organization. +// +// - parent: organizations/{org_id}/locations/{loc_id}. +func (r *OrganizationsLocationsProjectDataProfilesService) List(parent string) *OrganizationsLocationsProjectDataProfilesListCall { + c := &OrganizationsLocationsProjectDataProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": Allows filtering. Supported +// syntax: * Filter expressions are made up of one or more restrictions. * +// Restrictions can be combined by `AND` or `OR` logical operators. A sequence +// of restrictions implicitly uses `AND`. * A restriction has the form of +// `{field} {operator} {value}`. * Supported fields/values: - +// `sensitivity_level` - HIGH|MODERATE|LOW - `data_risk_level` - +// HIGH|MODERATE|LOW - `status_code` - an RPC status code as defined in +// https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto * +// The operator must be `=` or `!=`. Examples: * `project_id = 12345 AND +// status_code = 1` * `project_id = 12345 AND sensitivity_level = HIGH` The +// length of this field should be no more than 500 characters. +func (c *OrganizationsLocationsProjectDataProfilesListCall) Filter(filter string) *OrganizationsLocationsProjectDataProfilesListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// OrderBy sets the optional parameter "orderBy": Comma separated list of +// fields to order by, followed by `asc` or `desc` postfix. This list is case +// insensitive. The default sorting order is ascending. Redundant space +// characters are insignificant. Only one order field at a time is allowed. +// Examples: * `project_id` * `sensitivity_level desc` Supported fields are: - +// `project_id`: Google Cloud project ID - `sensitivity_level`: How sensitive +// the data in a project is, at most. - `data_risk_level`: How much risk is +// associated with this data. - `profile_last_generated`: When the profile was +// last updated in epoch seconds. +func (c *OrganizationsLocationsProjectDataProfilesListCall) OrderBy(orderBy string) *OrganizationsLocationsProjectDataProfilesListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageSize sets the optional parameter "pageSize": Size of the page. This +// value can be limited by the server. If zero, server returns a page of max +// size 100. +func (c *OrganizationsLocationsProjectDataProfilesListCall) PageSize(pageSize int64) *OrganizationsLocationsProjectDataProfilesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": Page token to continue +// retrieval. +func (c *OrganizationsLocationsProjectDataProfilesListCall) PageToken(pageToken string) *OrganizationsLocationsProjectDataProfilesListCall { + 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 +// details. +func (c *OrganizationsLocationsProjectDataProfilesListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsProjectDataProfilesListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *OrganizationsLocationsProjectDataProfilesListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsProjectDataProfilesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *OrganizationsLocationsProjectDataProfilesListCall) Context(ctx context.Context) *OrganizationsLocationsProjectDataProfilesListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *OrganizationsLocationsProjectDataProfilesListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsProjectDataProfilesListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "v2/{+parent}/projectDataProfiles") + 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 "dlp.organizations.locations.projectDataProfiles.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *GooglePrivacyDlpV2ListProjectDataProfilesResponse.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 *OrganizationsLocationsProjectDataProfilesListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListProjectDataProfilesResponse, 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 := &GooglePrivacyDlpV2ListProjectDataProfilesResponse{ + 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 +} + +// 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 *OrganizationsLocationsProjectDataProfilesListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListProjectDataProfilesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type OrganizationsLocationsStoredInfoTypesCreateCall struct { + s *Service + parentid string + googleprivacydlpv2createstoredinfotyperequest *GooglePrivacyDlpV2CreateStoredInfoTypeRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a pre-built stored infoType to be used for inspection. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-stored-infotypes +// to learn more. +// +// - parent: Parent resource name. The format of this value varies depending on +// the scope of the request (project or organization) and whether you have +// specified a processing location +// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID + Organizations scope, location specified: +// `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no +// location specified (defaults to global): `organizations/`ORG_ID The +// following example `parent` string specifies a parent project with the +// identifier `example-project`, and specifies the `europe-west3` location +// for processing data: +// parent=projects/example-project/locations/europe-west3. +func (r *OrganizationsLocationsStoredInfoTypesService) Create(parentid string, googleprivacydlpv2createstoredinfotyperequest *GooglePrivacyDlpV2CreateStoredInfoTypeRequest) *OrganizationsLocationsStoredInfoTypesCreateCall { + c := &OrganizationsLocationsStoredInfoTypesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parentid = parentid + c.googleprivacydlpv2createstoredinfotyperequest = googleprivacydlpv2createstoredinfotyperequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *OrganizationsLocationsStoredInfoTypesCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsStoredInfoTypesCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *OrganizationsLocationsStoredInfoTypesCreateCall) Context(ctx context.Context) *OrganizationsLocationsStoredInfoTypesCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *OrganizationsLocationsStoredInfoTypesCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsStoredInfoTypesCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createstoredinfotyperequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/storedInfoTypes") + 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.parentid, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "dlp.organizations.locations.storedInfoTypes.create" call. +// Any non-2xx status code is an error. Response headers are in either +// *GooglePrivacyDlpV2StoredInfoType.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 *OrganizationsLocationsStoredInfoTypesCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2StoredInfoType, 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 := &GooglePrivacyDlpV2StoredInfoType{ + 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 +} + +type OrganizationsLocationsStoredInfoTypesDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a stored infoType. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-stored-infotypes +// to learn more. +// +// - name: Resource name of the organization and storedInfoType to be deleted, +// for example `organizations/433245324/storedInfoTypes/432452342` or +// projects/project-id/storedInfoTypes/432452342. +func (r *OrganizationsLocationsStoredInfoTypesService) Delete(name string) *OrganizationsLocationsStoredInfoTypesDeleteCall { + c := &OrganizationsLocationsStoredInfoTypesDeleteCall{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 +// details. +func (c *OrganizationsLocationsStoredInfoTypesDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsStoredInfoTypesDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *OrganizationsLocationsStoredInfoTypesDeleteCall) Context(ctx context.Context) *OrganizationsLocationsStoredInfoTypesDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *OrganizationsLocationsStoredInfoTypesDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsStoredInfoTypesDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+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 "dlp.organizations.locations.storedInfoTypes.delete" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsLocationsStoredInfoTypesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleProtobufEmpty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type OrganizationsLocationsStoredInfoTypesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a stored infoType. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-stored-infotypes +// to learn more. +// +// - name: Resource name of the organization and storedInfoType to be read, for +// example `organizations/433245324/storedInfoTypes/432452342` or +// projects/project-id/storedInfoTypes/432452342. +func (r *OrganizationsLocationsStoredInfoTypesService) Get(name string) *OrganizationsLocationsStoredInfoTypesGetCall { + c := &OrganizationsLocationsStoredInfoTypesGetCall{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 +// details. +func (c *OrganizationsLocationsStoredInfoTypesGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsStoredInfoTypesGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *OrganizationsLocationsStoredInfoTypesGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsStoredInfoTypesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *OrganizationsLocationsStoredInfoTypesGetCall) Context(ctx context.Context) *OrganizationsLocationsStoredInfoTypesGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *OrganizationsLocationsStoredInfoTypesGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsStoredInfoTypesGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "v2/{+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 "dlp.organizations.locations.storedInfoTypes.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *GooglePrivacyDlpV2StoredInfoType.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 *OrganizationsLocationsStoredInfoTypesGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2StoredInfoType, 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 := &GooglePrivacyDlpV2StoredInfoType{ + 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 +} + +type OrganizationsLocationsStoredInfoTypesListCall struct { + s *Service + parentid string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists stored infoTypes. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-stored-infotypes +// to learn more. +// +// - parent: Parent resource name. The format of this value varies depending on +// the scope of the request (project or organization) and whether you have +// specified a processing location +// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: +// parent=projects/example-project/locations/europe-west3. +func (r *OrganizationsLocationsStoredInfoTypesService) List(parentid string) *OrganizationsLocationsStoredInfoTypesListCall { + c := &OrganizationsLocationsStoredInfoTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parentid = parentid + return c +} + +// LocationId sets the optional parameter "locationId": Deprecated. This field +// has no effect. +func (c *OrganizationsLocationsStoredInfoTypesListCall) LocationId(locationId string) *OrganizationsLocationsStoredInfoTypesListCall { + c.urlParams_.Set("locationId", locationId) + return c +} + +// OrderBy sets the optional parameter "orderBy": Comma separated list of +// fields to order by, followed by `asc` or `desc` postfix. This list is case +// insensitive. The default sorting order is ascending. Redundant space +// characters are insignificant. Example: `name asc, display_name, create_time +// desc` Supported fields are: - `create_time`: corresponds to the time the +// most recent version of the resource was created. - `state`: corresponds to +// the state of the resource. - `name`: corresponds to resource name. - +// `display_name`: corresponds to info type's display name. +func (c *OrganizationsLocationsStoredInfoTypesListCall) OrderBy(orderBy string) *OrganizationsLocationsStoredInfoTypesListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageSize sets the optional parameter "pageSize": Size of the page. This +// value can be limited by the server. If zero server returns a page of max +// size 100. +func (c *OrganizationsLocationsStoredInfoTypesListCall) PageSize(pageSize int64) *OrganizationsLocationsStoredInfoTypesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": Page token to continue +// retrieval. Comes from the previous call to `ListStoredInfoTypes`. +func (c *OrganizationsLocationsStoredInfoTypesListCall) PageToken(pageToken string) *OrganizationsLocationsStoredInfoTypesListCall { + 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 +// details. +func (c *OrganizationsLocationsStoredInfoTypesListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsStoredInfoTypesListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *OrganizationsLocationsStoredInfoTypesListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsStoredInfoTypesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *OrganizationsLocationsStoredInfoTypesListCall) Context(ctx context.Context) *OrganizationsLocationsStoredInfoTypesListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *OrganizationsLocationsStoredInfoTypesListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsStoredInfoTypesListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "v2/{+parent}/storedInfoTypes") + 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.parentid, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "dlp.organizations.locations.storedInfoTypes.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *GooglePrivacyDlpV2ListStoredInfoTypesResponse.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 *OrganizationsLocationsStoredInfoTypesListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListStoredInfoTypesResponse, 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 := &GooglePrivacyDlpV2ListStoredInfoTypesResponse{ + 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 +} + +// 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 *OrganizationsLocationsStoredInfoTypesListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListStoredInfoTypesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type OrganizationsLocationsStoredInfoTypesPatchCall struct { + s *Service + name string + googleprivacydlpv2updatestoredinfotyperequest *GooglePrivacyDlpV2UpdateStoredInfoTypeRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates the stored infoType by creating a new version. The existing +// version will continue to be used until the new version is ready. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-stored-infotypes +// to learn more. +// +// - name: Resource name of organization and storedInfoType to be updated, for +// example `organizations/433245324/storedInfoTypes/432452342` or +// projects/project-id/storedInfoTypes/432452342. +func (r *OrganizationsLocationsStoredInfoTypesService) Patch(name string, googleprivacydlpv2updatestoredinfotyperequest *GooglePrivacyDlpV2UpdateStoredInfoTypeRequest) *OrganizationsLocationsStoredInfoTypesPatchCall { + c := &OrganizationsLocationsStoredInfoTypesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googleprivacydlpv2updatestoredinfotyperequest = googleprivacydlpv2updatestoredinfotyperequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *OrganizationsLocationsStoredInfoTypesPatchCall) Fields(s ...googleapi.Field) *OrganizationsLocationsStoredInfoTypesPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *OrganizationsLocationsStoredInfoTypesPatchCall) Context(ctx context.Context) *OrganizationsLocationsStoredInfoTypesPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *OrganizationsLocationsStoredInfoTypesPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsStoredInfoTypesPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatestoredinfotyperequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+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 "dlp.organizations.locations.storedInfoTypes.patch" call. +// Any non-2xx status code is an error. Response headers are in either +// *GooglePrivacyDlpV2StoredInfoType.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 *OrganizationsLocationsStoredInfoTypesPatchCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2StoredInfoType, 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 := &GooglePrivacyDlpV2StoredInfoType{ + 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 +} + +type OrganizationsLocationsTableDataProfilesDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Delete a TableDataProfile. Will not prevent the profile from being +// regenerated if the table is still included in a discovery configuration. +// +// - name: Resource name of the table data profile. +func (r *OrganizationsLocationsTableDataProfilesService) Delete(name string) *OrganizationsLocationsTableDataProfilesDeleteCall { + c := &OrganizationsLocationsTableDataProfilesDeleteCall{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 +// details. +func (c *OrganizationsLocationsTableDataProfilesDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsTableDataProfilesDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *OrganizationsLocationsTableDataProfilesDeleteCall) Context(ctx context.Context) *OrganizationsLocationsTableDataProfilesDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *OrganizationsLocationsTableDataProfilesDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsTableDataProfilesDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+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 "dlp.organizations.locations.tableDataProfiles.delete" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsLocationsTableDataProfilesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleProtobufEmpty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type OrganizationsLocationsTableDataProfilesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a table data profile. +// +// - name: Resource name, for example +// `organizations/12345/locations/us/tableDataProfiles/53234423`. +func (r *OrganizationsLocationsTableDataProfilesService) Get(name string) *OrganizationsLocationsTableDataProfilesGetCall { + c := &OrganizationsLocationsTableDataProfilesGetCall{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 +// details. +func (c *OrganizationsLocationsTableDataProfilesGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsTableDataProfilesGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *OrganizationsLocationsTableDataProfilesGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsTableDataProfilesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *OrganizationsLocationsTableDataProfilesGetCall) Context(ctx context.Context) *OrganizationsLocationsTableDataProfilesGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *OrganizationsLocationsTableDataProfilesGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsTableDataProfilesGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "v2/{+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 "dlp.organizations.locations.tableDataProfiles.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *GooglePrivacyDlpV2TableDataProfile.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 *OrganizationsLocationsTableDataProfilesGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2TableDataProfile, 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 := &GooglePrivacyDlpV2TableDataProfile{ + 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 +} + +type OrganizationsLocationsTableDataProfilesListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists table data profiles for an organization. +// +// - parent: Resource name of the organization or project, for example +// `organizations/433245324/locations/europe` or +// `projects/project-id/locations/asia`. +func (r *OrganizationsLocationsTableDataProfilesService) List(parent string) *OrganizationsLocationsTableDataProfilesListCall { + c := &OrganizationsLocationsTableDataProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": Allows filtering. Supported +// syntax: * Filter expressions are made up of one or more restrictions. * +// Restrictions can be combined by `AND` or `OR` logical operators. A sequence +// of restrictions implicitly uses `AND`. * A restriction has the form of +// `{field} {operator} {value}`. * Supported fields/values: - `project_id` - +// The Google Cloud project ID. - `dataset_id` - The BigQuery dataset ID. - +// `table_id` - The ID of the BigQuery table. - `sensitivity_level` - +// HIGH|MODERATE|LOW - `data_risk_level` - HIGH|MODERATE|LOW - +// `resource_visibility`: PUBLIC|RESTRICTED - `status_code` - an RPC status +// code as defined in +// https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto * +// The operator must be `=` or `!=`. Examples: * `project_id = 12345 AND +// status_code = 1` * `project_id = 12345 AND sensitivity_level = HIGH` * +// `project_id = 12345 AND resource_visibility = PUBLIC` The length of this +// field should be no more than 500 characters. +func (c *OrganizationsLocationsTableDataProfilesListCall) Filter(filter string) *OrganizationsLocationsTableDataProfilesListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// OrderBy sets the optional parameter "orderBy": Comma separated list of +// fields to order by, followed by `asc` or `desc` postfix. This list is case +// insensitive. The default sorting order is ascending. Redundant space +// characters are insignificant. Only one order field at a time is allowed. +// Examples: * `project_id asc` * `table_id` * `sensitivity_level desc` +// Supported fields are: - `project_id`: The Google Cloud project ID. - +// `dataset_id`: The ID of a BigQuery dataset. - `table_id`: The ID of a +// BigQuery table. - `sensitivity_level`: How sensitive the data in a table is, +// at most. - `data_risk_level`: How much risk is associated with this data. - +// `profile_last_generated`: When the profile was last updated in epoch +// seconds. - `last_modified`: The last time the resource was modified. - +// `resource_visibility`: Visibility restriction for this resource. - +// `row_count`: Number of rows in this resource. +func (c *OrganizationsLocationsTableDataProfilesListCall) OrderBy(orderBy string) *OrganizationsLocationsTableDataProfilesListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageSize sets the optional parameter "pageSize": Size of the page. This +// value can be limited by the server. If zero, server returns a page of max +// size 100. +func (c *OrganizationsLocationsTableDataProfilesListCall) PageSize(pageSize int64) *OrganizationsLocationsTableDataProfilesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": Page token to continue +// retrieval. +func (c *OrganizationsLocationsTableDataProfilesListCall) PageToken(pageToken string) *OrganizationsLocationsTableDataProfilesListCall { + 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 +// details. +func (c *OrganizationsLocationsTableDataProfilesListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsTableDataProfilesListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *OrganizationsLocationsTableDataProfilesListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsTableDataProfilesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *OrganizationsLocationsTableDataProfilesListCall) Context(ctx context.Context) *OrganizationsLocationsTableDataProfilesListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *OrganizationsLocationsTableDataProfilesListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsTableDataProfilesListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "v2/{+parent}/tableDataProfiles") + 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 "dlp.organizations.locations.tableDataProfiles.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *GooglePrivacyDlpV2ListTableDataProfilesResponse.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 *OrganizationsLocationsTableDataProfilesListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListTableDataProfilesResponse, 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 := &GooglePrivacyDlpV2ListTableDataProfilesResponse{ + 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 +} + +// 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 *OrganizationsLocationsTableDataProfilesListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListTableDataProfilesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() if err != nil { return err } @@ -14969,7 +16665,7 @@ func (c *OrganizationsLocationsProjectDataProfilesListCall) Pages(ctx context.Co } } -type OrganizationsLocationsStoredInfoTypesCreateCall struct { +type OrganizationsStoredInfoTypesCreateCall struct { s *Service parentid string googleprivacydlpv2createstoredinfotyperequest *GooglePrivacyDlpV2CreateStoredInfoTypeRequest @@ -14995,8 +16691,8 @@ type OrganizationsLocationsStoredInfoTypesCreateCall struct { // identifier `example-project`, and specifies the `europe-west3` location // for processing data: // parent=projects/example-project/locations/europe-west3. -func (r *OrganizationsLocationsStoredInfoTypesService) Create(parentid string, googleprivacydlpv2createstoredinfotyperequest *GooglePrivacyDlpV2CreateStoredInfoTypeRequest) *OrganizationsLocationsStoredInfoTypesCreateCall { - c := &OrganizationsLocationsStoredInfoTypesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *OrganizationsStoredInfoTypesService) Create(parentid string, googleprivacydlpv2createstoredinfotyperequest *GooglePrivacyDlpV2CreateStoredInfoTypeRequest) *OrganizationsStoredInfoTypesCreateCall { + c := &OrganizationsStoredInfoTypesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parentid = parentid c.googleprivacydlpv2createstoredinfotyperequest = googleprivacydlpv2createstoredinfotyperequest return c @@ -15005,27 +16701,27 @@ func (r *OrganizationsLocationsStoredInfoTypesService) Create(parentid string, g // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *OrganizationsLocationsStoredInfoTypesCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsStoredInfoTypesCreateCall { +func (c *OrganizationsStoredInfoTypesCreateCall) Fields(s ...googleapi.Field) *OrganizationsStoredInfoTypesCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *OrganizationsLocationsStoredInfoTypesCreateCall) Context(ctx context.Context) *OrganizationsLocationsStoredInfoTypesCreateCall { +func (c *OrganizationsStoredInfoTypesCreateCall) Context(ctx context.Context) *OrganizationsStoredInfoTypesCreateCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *OrganizationsLocationsStoredInfoTypesCreateCall) Header() http.Header { +func (c *OrganizationsStoredInfoTypesCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsStoredInfoTypesCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsStoredInfoTypesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createstoredinfotyperequest) @@ -15047,13 +16743,13 @@ func (c *OrganizationsLocationsStoredInfoTypesCreateCall) doRequest(alt string) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.organizations.locations.storedInfoTypes.create" call. +// Do executes the "dlp.organizations.storedInfoTypes.create" call. // Any non-2xx status code is an error. Response headers are in either // *GooglePrivacyDlpV2StoredInfoType.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 *OrganizationsLocationsStoredInfoTypesCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2StoredInfoType, error) { +func (c *OrganizationsStoredInfoTypesCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2StoredInfoType, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15085,7 +16781,7 @@ func (c *OrganizationsLocationsStoredInfoTypesCreateCall) Do(opts ...googleapi.C return ret, nil } -type OrganizationsLocationsStoredInfoTypesDeleteCall struct { +type OrganizationsStoredInfoTypesDeleteCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -15100,8 +16796,8 @@ type OrganizationsLocationsStoredInfoTypesDeleteCall struct { // - name: Resource name of the organization and storedInfoType to be deleted, // for example `organizations/433245324/storedInfoTypes/432452342` or // projects/project-id/storedInfoTypes/432452342. -func (r *OrganizationsLocationsStoredInfoTypesService) Delete(name string) *OrganizationsLocationsStoredInfoTypesDeleteCall { - c := &OrganizationsLocationsStoredInfoTypesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *OrganizationsStoredInfoTypesService) Delete(name string) *OrganizationsStoredInfoTypesDeleteCall { + c := &OrganizationsStoredInfoTypesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -15109,27 +16805,27 @@ func (r *OrganizationsLocationsStoredInfoTypesService) Delete(name string) *Orga // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *OrganizationsLocationsStoredInfoTypesDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsStoredInfoTypesDeleteCall { +func (c *OrganizationsStoredInfoTypesDeleteCall) Fields(s ...googleapi.Field) *OrganizationsStoredInfoTypesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *OrganizationsLocationsStoredInfoTypesDeleteCall) Context(ctx context.Context) *OrganizationsLocationsStoredInfoTypesDeleteCall { +func (c *OrganizationsStoredInfoTypesDeleteCall) Context(ctx context.Context) *OrganizationsStoredInfoTypesDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *OrganizationsLocationsStoredInfoTypesDeleteCall) Header() http.Header { +func (c *OrganizationsStoredInfoTypesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsStoredInfoTypesDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsStoredInfoTypesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil c.urlParams_.Set("alt", alt) @@ -15147,13 +16843,13 @@ func (c *OrganizationsLocationsStoredInfoTypesDeleteCall) doRequest(alt string) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.organizations.locations.storedInfoTypes.delete" call. +// Do executes the "dlp.organizations.storedInfoTypes.delete" call. // Any non-2xx status code is an error. Response headers are in either // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified was // returned. -func (c *OrganizationsLocationsStoredInfoTypesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { +func (c *OrganizationsStoredInfoTypesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15185,7 +16881,7 @@ func (c *OrganizationsLocationsStoredInfoTypesDeleteCall) Do(opts ...googleapi.C return ret, nil } -type OrganizationsLocationsStoredInfoTypesGetCall struct { +type OrganizationsStoredInfoTypesGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -15201,8 +16897,8 @@ type OrganizationsLocationsStoredInfoTypesGetCall struct { // - name: Resource name of the organization and storedInfoType to be read, for // example `organizations/433245324/storedInfoTypes/432452342` or // projects/project-id/storedInfoTypes/432452342. -func (r *OrganizationsLocationsStoredInfoTypesService) Get(name string) *OrganizationsLocationsStoredInfoTypesGetCall { - c := &OrganizationsLocationsStoredInfoTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *OrganizationsStoredInfoTypesService) Get(name string) *OrganizationsStoredInfoTypesGetCall { + c := &OrganizationsStoredInfoTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -15210,7 +16906,7 @@ func (r *OrganizationsLocationsStoredInfoTypesService) Get(name string) *Organiz // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *OrganizationsLocationsStoredInfoTypesGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsStoredInfoTypesGetCall { +func (c *OrganizationsStoredInfoTypesGetCall) Fields(s ...googleapi.Field) *OrganizationsStoredInfoTypesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -15218,27 +16914,27 @@ func (c *OrganizationsLocationsStoredInfoTypesGetCall) Fields(s ...googleapi.Fie // IfNoneMatch sets an 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. -func (c *OrganizationsLocationsStoredInfoTypesGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsStoredInfoTypesGetCall { +func (c *OrganizationsStoredInfoTypesGetCall) IfNoneMatch(entityTag string) *OrganizationsStoredInfoTypesGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *OrganizationsLocationsStoredInfoTypesGetCall) Context(ctx context.Context) *OrganizationsLocationsStoredInfoTypesGetCall { +func (c *OrganizationsStoredInfoTypesGetCall) Context(ctx context.Context) *OrganizationsStoredInfoTypesGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *OrganizationsLocationsStoredInfoTypesGetCall) Header() http.Header { +func (c *OrganizationsStoredInfoTypesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsStoredInfoTypesGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsStoredInfoTypesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -15259,13 +16955,13 @@ func (c *OrganizationsLocationsStoredInfoTypesGetCall) doRequest(alt string) (*h return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.organizations.locations.storedInfoTypes.get" call. +// Do executes the "dlp.organizations.storedInfoTypes.get" call. // Any non-2xx status code is an error. Response headers are in either // *GooglePrivacyDlpV2StoredInfoType.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 *OrganizationsLocationsStoredInfoTypesGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2StoredInfoType, error) { +func (c *OrganizationsStoredInfoTypesGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2StoredInfoType, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15297,7 +16993,7 @@ func (c *OrganizationsLocationsStoredInfoTypesGetCall) Do(opts ...googleapi.Call return ret, nil } -type OrganizationsLocationsStoredInfoTypesListCall struct { +type OrganizationsStoredInfoTypesListCall struct { s *Service parentid string urlParams_ gensupport.URLParams @@ -15320,15 +17016,15 @@ type OrganizationsLocationsStoredInfoTypesListCall struct { // parent project with the identifier `example-project`, and specifies the // `europe-west3` location for processing data: // parent=projects/example-project/locations/europe-west3. -func (r *OrganizationsLocationsStoredInfoTypesService) List(parentid string) *OrganizationsLocationsStoredInfoTypesListCall { - c := &OrganizationsLocationsStoredInfoTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *OrganizationsStoredInfoTypesService) List(parentid string) *OrganizationsStoredInfoTypesListCall { + c := &OrganizationsStoredInfoTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parentid = parentid return c } // LocationId sets the optional parameter "locationId": Deprecated. This field // has no effect. -func (c *OrganizationsLocationsStoredInfoTypesListCall) LocationId(locationId string) *OrganizationsLocationsStoredInfoTypesListCall { +func (c *OrganizationsStoredInfoTypesListCall) LocationId(locationId string) *OrganizationsStoredInfoTypesListCall { c.urlParams_.Set("locationId", locationId) return c } @@ -15341,7 +17037,7 @@ func (c *OrganizationsLocationsStoredInfoTypesListCall) LocationId(locationId st // most recent version of the resource was created. - `state`: corresponds to // the state of the resource. - `name`: corresponds to resource name. - // `display_name`: corresponds to info type's display name. -func (c *OrganizationsLocationsStoredInfoTypesListCall) OrderBy(orderBy string) *OrganizationsLocationsStoredInfoTypesListCall { +func (c *OrganizationsStoredInfoTypesListCall) OrderBy(orderBy string) *OrganizationsStoredInfoTypesListCall { c.urlParams_.Set("orderBy", orderBy) return c } @@ -15349,14 +17045,14 @@ func (c *OrganizationsLocationsStoredInfoTypesListCall) OrderBy(orderBy string) // PageSize sets the optional parameter "pageSize": Size of the page. This // value can be limited by the server. If zero server returns a page of max // size 100. -func (c *OrganizationsLocationsStoredInfoTypesListCall) PageSize(pageSize int64) *OrganizationsLocationsStoredInfoTypesListCall { +func (c *OrganizationsStoredInfoTypesListCall) PageSize(pageSize int64) *OrganizationsStoredInfoTypesListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } // PageToken sets the optional parameter "pageToken": Page token to continue // retrieval. Comes from the previous call to `ListStoredInfoTypes`. -func (c *OrganizationsLocationsStoredInfoTypesListCall) PageToken(pageToken string) *OrganizationsLocationsStoredInfoTypesListCall { +func (c *OrganizationsStoredInfoTypesListCall) PageToken(pageToken string) *OrganizationsStoredInfoTypesListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -15364,7 +17060,7 @@ func (c *OrganizationsLocationsStoredInfoTypesListCall) PageToken(pageToken stri // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *OrganizationsLocationsStoredInfoTypesListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsStoredInfoTypesListCall { +func (c *OrganizationsStoredInfoTypesListCall) Fields(s ...googleapi.Field) *OrganizationsStoredInfoTypesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -15372,27 +17068,27 @@ func (c *OrganizationsLocationsStoredInfoTypesListCall) Fields(s ...googleapi.Fi // IfNoneMatch sets an 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. -func (c *OrganizationsLocationsStoredInfoTypesListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsStoredInfoTypesListCall { +func (c *OrganizationsStoredInfoTypesListCall) IfNoneMatch(entityTag string) *OrganizationsStoredInfoTypesListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *OrganizationsLocationsStoredInfoTypesListCall) Context(ctx context.Context) *OrganizationsLocationsStoredInfoTypesListCall { +func (c *OrganizationsStoredInfoTypesListCall) Context(ctx context.Context) *OrganizationsStoredInfoTypesListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *OrganizationsLocationsStoredInfoTypesListCall) Header() http.Header { +func (c *OrganizationsStoredInfoTypesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsStoredInfoTypesListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsStoredInfoTypesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -15413,13 +17109,13 @@ func (c *OrganizationsLocationsStoredInfoTypesListCall) doRequest(alt string) (* return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.organizations.locations.storedInfoTypes.list" call. +// Do executes the "dlp.organizations.storedInfoTypes.list" call. // Any non-2xx status code is an error. Response headers are in either // *GooglePrivacyDlpV2ListStoredInfoTypesResponse.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 *OrganizationsLocationsStoredInfoTypesListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListStoredInfoTypesResponse, error) { +func (c *OrganizationsStoredInfoTypesListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListStoredInfoTypesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15454,289 +17150,83 @@ func (c *OrganizationsLocationsStoredInfoTypesListCall) Do(opts ...googleapi.Cal // 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 *OrganizationsLocationsStoredInfoTypesListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListStoredInfoTypesResponse) error) error { +func (c *OrganizationsStoredInfoTypesListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListStoredInfoTypesResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type OrganizationsLocationsStoredInfoTypesPatchCall struct { - s *Service - name string - googleprivacydlpv2updatestoredinfotyperequest *GooglePrivacyDlpV2UpdateStoredInfoTypeRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Patch: Updates the stored infoType by creating a new version. The existing -// version will continue to be used until the new version is ready. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-stored-infotypes -// to learn more. -// -// - name: Resource name of organization and storedInfoType to be updated, for -// example `organizations/433245324/storedInfoTypes/432452342` or -// projects/project-id/storedInfoTypes/432452342. -func (r *OrganizationsLocationsStoredInfoTypesService) Patch(name string, googleprivacydlpv2updatestoredinfotyperequest *GooglePrivacyDlpV2UpdateStoredInfoTypeRequest) *OrganizationsLocationsStoredInfoTypesPatchCall { - c := &OrganizationsLocationsStoredInfoTypesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.googleprivacydlpv2updatestoredinfotyperequest = googleprivacydlpv2updatestoredinfotyperequest - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *OrganizationsLocationsStoredInfoTypesPatchCall) Fields(s ...googleapi.Field) *OrganizationsLocationsStoredInfoTypesPatchCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *OrganizationsLocationsStoredInfoTypesPatchCall) Context(ctx context.Context) *OrganizationsLocationsStoredInfoTypesPatchCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *OrganizationsLocationsStoredInfoTypesPatchCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *OrganizationsLocationsStoredInfoTypesPatchCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatestoredinfotyperequest) - if err != nil { - return nil, err - } - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+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 "dlp.organizations.locations.storedInfoTypes.patch" call. -// Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2StoredInfoType.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 *OrganizationsLocationsStoredInfoTypesPatchCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2StoredInfoType, 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 := &GooglePrivacyDlpV2StoredInfoType{ - 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 -} - -type OrganizationsLocationsTableDataProfilesDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Delete: Delete a TableDataProfile. Will not prevent the profile from being -// regenerated if the table is still included in a discovery configuration. -// -// - name: Resource name of the table data profile. -func (r *OrganizationsLocationsTableDataProfilesService) Delete(name string) *OrganizationsLocationsTableDataProfilesDeleteCall { - c := &OrganizationsLocationsTableDataProfilesDeleteCall{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 -// details. -func (c *OrganizationsLocationsTableDataProfilesDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsTableDataProfilesDeleteCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *OrganizationsLocationsTableDataProfilesDeleteCall) Context(ctx context.Context) *OrganizationsLocationsTableDataProfilesDeleteCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *OrganizationsLocationsTableDataProfilesDeleteCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *OrganizationsLocationsTableDataProfilesDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+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 "dlp.organizations.locations.tableDataProfiles.delete" call. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *OrganizationsLocationsTableDataProfilesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &GoogleProtobufEmpty{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err + 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) } - return ret, nil } -type OrganizationsLocationsTableDataProfilesGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsStoredInfoTypesPatchCall struct { + s *Service + name string + googleprivacydlpv2updatestoredinfotyperequest *GooglePrivacyDlpV2UpdateStoredInfoTypeRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a table data profile. +// Patch: Updates the stored infoType by creating a new version. The existing +// version will continue to be used until the new version is ready. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-stored-infotypes +// to learn more. // -// - name: Resource name, for example -// `organizations/12345/locations/us/tableDataProfiles/53234423`. -func (r *OrganizationsLocationsTableDataProfilesService) Get(name string) *OrganizationsLocationsTableDataProfilesGetCall { - c := &OrganizationsLocationsTableDataProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Resource name of organization and storedInfoType to be updated, for +// example `organizations/433245324/storedInfoTypes/432452342` or +// projects/project-id/storedInfoTypes/432452342. +func (r *OrganizationsStoredInfoTypesService) Patch(name string, googleprivacydlpv2updatestoredinfotyperequest *GooglePrivacyDlpV2UpdateStoredInfoTypeRequest) *OrganizationsStoredInfoTypesPatchCall { + c := &OrganizationsStoredInfoTypesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.googleprivacydlpv2updatestoredinfotyperequest = googleprivacydlpv2updatestoredinfotyperequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *OrganizationsLocationsTableDataProfilesGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsTableDataProfilesGetCall { +func (c *OrganizationsStoredInfoTypesPatchCall) Fields(s ...googleapi.Field) *OrganizationsStoredInfoTypesPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an 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. -func (c *OrganizationsLocationsTableDataProfilesGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsTableDataProfilesGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *OrganizationsLocationsTableDataProfilesGetCall) Context(ctx context.Context) *OrganizationsLocationsTableDataProfilesGetCall { +func (c *OrganizationsStoredInfoTypesPatchCall) Context(ctx context.Context) *OrganizationsStoredInfoTypesPatchCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *OrganizationsLocationsTableDataProfilesGetCall) Header() http.Header { +func (c *OrganizationsStoredInfoTypesPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsTableDataProfilesGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *OrganizationsStoredInfoTypesPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatestoredinfotyperequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -15747,13 +17237,13 @@ func (c *OrganizationsLocationsTableDataProfilesGetCall) doRequest(alt string) ( return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.organizations.locations.tableDataProfiles.get" call. +// Do executes the "dlp.organizations.storedInfoTypes.patch" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2TableDataProfile.ServerResponse.Header or (if a response +// *GooglePrivacyDlpV2StoredInfoType.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 *OrganizationsLocationsTableDataProfilesGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2TableDataProfile, error) { +func (c *OrganizationsStoredInfoTypesPatchCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2StoredInfoType, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15772,7 +17262,7 @@ func (c *OrganizationsLocationsTableDataProfilesGetCall) Do(opts ...googleapi.Ca if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2TableDataProfile{ + ret := &GooglePrivacyDlpV2StoredInfoType{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15785,138 +17275,91 @@ func (c *OrganizationsLocationsTableDataProfilesGetCall) Do(opts ...googleapi.Ca return ret, nil } -type OrganizationsLocationsTableDataProfilesListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsContentDeidentifyCall struct { + s *Service + parentid string + googleprivacydlpv2deidentifycontentrequest *GooglePrivacyDlpV2DeidentifyContentRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists table data profiles for an organization. +// Deidentify: De-identifies potentially sensitive info from a ContentItem. +// This method has limits on input size and output size. See +// https://cloud.google.com/sensitive-data-protection/docs/deidentify-sensitive-data +// to learn more. When no InfoTypes or CustomInfoTypes are specified in this +// request, the system will automatically choose what detectors to run. By +// default this may be all types, but may change over time as detectors are +// updated. // -// - parent: Resource name of the organization or project, for example -// `organizations/433245324/locations/europe` or -// `projects/project-id/locations/asia`. -func (r *OrganizationsLocationsTableDataProfilesService) List(parent string) *OrganizationsLocationsTableDataProfilesListCall { - c := &OrganizationsLocationsTableDataProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// Filter sets the optional parameter "filter": Allows filtering. Supported -// syntax: * Filter expressions are made up of one or more restrictions. * -// Restrictions can be combined by `AND` or `OR` logical operators. A sequence -// of restrictions implicitly uses `AND`. * A restriction has the form of -// `{field} {operator} {value}`. * Supported fields/values: - `project_id` - -// The Google Cloud project ID. - `dataset_id` - The BigQuery dataset ID. - -// `table_id` - The ID of the BigQuery table. - `sensitivity_level` - -// HIGH|MODERATE|LOW - `data_risk_level` - HIGH|MODERATE|LOW - -// `resource_visibility`: PUBLIC|RESTRICTED - `status_code` - an RPC status -// code as defined in -// https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto * -// The operator must be `=` or `!=`. Examples: * `project_id = 12345 AND -// status_code = 1` * `project_id = 12345 AND sensitivity_level = HIGH` * -// `project_id = 12345 AND resource_visibility = PUBLIC` The length of this -// field should be no more than 500 characters. -func (c *OrganizationsLocationsTableDataProfilesListCall) Filter(filter string) *OrganizationsLocationsTableDataProfilesListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// OrderBy sets the optional parameter "orderBy": Comma separated list of -// fields to order by, followed by `asc` or `desc` postfix. This list is case -// insensitive. The default sorting order is ascending. Redundant space -// characters are insignificant. Only one order field at a time is allowed. -// Examples: * `project_id asc` * `table_id` * `sensitivity_level desc` -// Supported fields are: - `project_id`: The Google Cloud project ID. - -// `dataset_id`: The ID of a BigQuery dataset. - `table_id`: The ID of a -// BigQuery table. - `sensitivity_level`: How sensitive the data in a table is, -// at most. - `data_risk_level`: How much risk is associated with this data. - -// `profile_last_generated`: When the profile was last updated in epoch -// seconds. - `last_modified`: The last time the resource was modified. - -// `resource_visibility`: Visibility restriction for this resource. - -// `row_count`: Number of rows in this resource. -func (c *OrganizationsLocationsTableDataProfilesListCall) OrderBy(orderBy string) *OrganizationsLocationsTableDataProfilesListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageSize sets the optional parameter "pageSize": Size of the page. This -// value can be limited by the server. If zero, server returns a page of max -// size 100. -func (c *OrganizationsLocationsTableDataProfilesListCall) PageSize(pageSize int64) *OrganizationsLocationsTableDataProfilesListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": Page token to continue -// retrieval. -func (c *OrganizationsLocationsTableDataProfilesListCall) PageToken(pageToken string) *OrganizationsLocationsTableDataProfilesListCall { - c.urlParams_.Set("pageToken", pageToken) +// - parent: Parent resource name. The format of this value varies depending on +// whether you have specified a processing location +// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: +// parent=projects/example-project/locations/europe-west3. +func (r *ProjectsContentService) Deidentify(parentid string, googleprivacydlpv2deidentifycontentrequest *GooglePrivacyDlpV2DeidentifyContentRequest) *ProjectsContentDeidentifyCall { + c := &ProjectsContentDeidentifyCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parentid = parentid + c.googleprivacydlpv2deidentifycontentrequest = googleprivacydlpv2deidentifycontentrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *OrganizationsLocationsTableDataProfilesListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsTableDataProfilesListCall { +func (c *ProjectsContentDeidentifyCall) Fields(s ...googleapi.Field) *ProjectsContentDeidentifyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an 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. -func (c *OrganizationsLocationsTableDataProfilesListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsTableDataProfilesListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *OrganizationsLocationsTableDataProfilesListCall) Context(ctx context.Context) *OrganizationsLocationsTableDataProfilesListCall { +func (c *ProjectsContentDeidentifyCall) Context(ctx context.Context) *ProjectsContentDeidentifyCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *OrganizationsLocationsTableDataProfilesListCall) Header() http.Header { +func (c *ProjectsContentDeidentifyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsTableDataProfilesListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *ProjectsContentDeidentifyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2deidentifycontentrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/tableDataProfiles") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/content:deidentify") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "parent": c.parentid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.organizations.locations.tableDataProfiles.list" call. +// Do executes the "dlp.projects.content.deidentify" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2ListTableDataProfilesResponse.ServerResponse.Header or -// (if a response was returned at all) in error.(*googleapi.Error).Header. Use +// *GooglePrivacyDlpV2DeidentifyContentResponse.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 *OrganizationsLocationsTableDataProfilesListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListTableDataProfilesResponse, error) { +func (c *ProjectsContentDeidentifyCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DeidentifyContentResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15935,7 +17378,7 @@ func (c *OrganizationsLocationsTableDataProfilesListCall) Do(opts ...googleapi.C if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2ListTableDataProfilesResponse{ + ret := &GooglePrivacyDlpV2DeidentifyContentResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15948,93 +17391,72 @@ func (c *OrganizationsLocationsTableDataProfilesListCall) Do(opts ...googleapi.C return ret, nil } -// 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 *OrganizationsLocationsTableDataProfilesListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListTableDataProfilesResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type OrganizationsStoredInfoTypesCreateCall struct { - s *Service - parentid string - googleprivacydlpv2createstoredinfotyperequest *GooglePrivacyDlpV2CreateStoredInfoTypeRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsContentInspectCall struct { + s *Service + parentid string + googleprivacydlpv2inspectcontentrequest *GooglePrivacyDlpV2InspectContentRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a pre-built stored infoType to be used for inspection. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-stored-infotypes -// to learn more. +// Inspect: Finds potentially sensitive info in content. This method has limits +// on input size, processing time, and output size. When no InfoTypes or +// CustomInfoTypes are specified in this request, the system will automatically +// choose what detectors to run. By default this may be all types, but may +// change over time as detectors are updated. For how to guides, see +// https://cloud.google.com/sensitive-data-protection/docs/inspecting-images +// and https://cloud.google.com/sensitive-data-protection/docs/inspecting-text, // // - parent: Parent resource name. The format of this value varies depending on -// the scope of the request (project or organization) and whether you have -// specified a processing location +// whether you have specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): // - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` // LOCATION_ID + Projects scope, no location specified (defaults to global): -// `projects/`PROJECT_ID + Organizations scope, location specified: -// `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no -// location specified (defaults to global): `organizations/`ORG_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: // parent=projects/example-project/locations/europe-west3. -func (r *OrganizationsStoredInfoTypesService) Create(parentid string, googleprivacydlpv2createstoredinfotyperequest *GooglePrivacyDlpV2CreateStoredInfoTypeRequest) *OrganizationsStoredInfoTypesCreateCall { - c := &OrganizationsStoredInfoTypesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsContentService) Inspect(parentid string, googleprivacydlpv2inspectcontentrequest *GooglePrivacyDlpV2InspectContentRequest) *ProjectsContentInspectCall { + c := &ProjectsContentInspectCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parentid = parentid - c.googleprivacydlpv2createstoredinfotyperequest = googleprivacydlpv2createstoredinfotyperequest + c.googleprivacydlpv2inspectcontentrequest = googleprivacydlpv2inspectcontentrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *OrganizationsStoredInfoTypesCreateCall) Fields(s ...googleapi.Field) *OrganizationsStoredInfoTypesCreateCall { +func (c *ProjectsContentInspectCall) Fields(s ...googleapi.Field) *ProjectsContentInspectCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *OrganizationsStoredInfoTypesCreateCall) Context(ctx context.Context) *OrganizationsStoredInfoTypesCreateCall { +func (c *ProjectsContentInspectCall) Context(ctx context.Context) *ProjectsContentInspectCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *OrganizationsStoredInfoTypesCreateCall) Header() http.Header { +func (c *ProjectsContentInspectCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsStoredInfoTypesCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsContentInspectCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createstoredinfotyperequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2inspectcontentrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/storedInfoTypes") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/content:inspect") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -16047,13 +17469,13 @@ func (c *OrganizationsStoredInfoTypesCreateCall) doRequest(alt string) (*http.Re return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.organizations.storedInfoTypes.create" call. +// Do executes the "dlp.projects.content.inspect" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2StoredInfoType.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use +// *GooglePrivacyDlpV2InspectContentResponse.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 *OrganizationsStoredInfoTypesCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2StoredInfoType, error) { +func (c *ProjectsContentInspectCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2InspectContentResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16072,7 +17494,7 @@ func (c *OrganizationsStoredInfoTypesCreateCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2StoredInfoType{ + ret := &GooglePrivacyDlpV2InspectContentResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16085,75 +17507,87 @@ func (c *OrganizationsStoredInfoTypesCreateCall) Do(opts ...googleapi.CallOption return ret, nil } -type OrganizationsStoredInfoTypesDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsContentReidentifyCall struct { + s *Service + parentid string + googleprivacydlpv2reidentifycontentrequest *GooglePrivacyDlpV2ReidentifyContentRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a stored infoType. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-stored-infotypes +// Reidentify: Re-identifies content that has been de-identified. See +// https://cloud.google.com/sensitive-data-protection/docs/pseudonymization#re-identification_in_free_text_code_example // to learn more. // -// - name: Resource name of the organization and storedInfoType to be deleted, -// for example `organizations/433245324/storedInfoTypes/432452342` or -// projects/project-id/storedInfoTypes/432452342. -func (r *OrganizationsStoredInfoTypesService) Delete(name string) *OrganizationsStoredInfoTypesDeleteCall { - c := &OrganizationsStoredInfoTypesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: Parent resource name. The format of this value varies depending on +// whether you have specified a processing location +// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: +// parent=projects/example-project/locations/europe-west3. +func (r *ProjectsContentService) Reidentify(parentid string, googleprivacydlpv2reidentifycontentrequest *GooglePrivacyDlpV2ReidentifyContentRequest) *ProjectsContentReidentifyCall { + c := &ProjectsContentReidentifyCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parentid = parentid + c.googleprivacydlpv2reidentifycontentrequest = googleprivacydlpv2reidentifycontentrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *OrganizationsStoredInfoTypesDeleteCall) Fields(s ...googleapi.Field) *OrganizationsStoredInfoTypesDeleteCall { +func (c *ProjectsContentReidentifyCall) Fields(s ...googleapi.Field) *ProjectsContentReidentifyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *OrganizationsStoredInfoTypesDeleteCall) Context(ctx context.Context) *OrganizationsStoredInfoTypesDeleteCall { +func (c *ProjectsContentReidentifyCall) Context(ctx context.Context) *ProjectsContentReidentifyCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *OrganizationsStoredInfoTypesDeleteCall) Header() http.Header { +func (c *ProjectsContentReidentifyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsStoredInfoTypesDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *ProjectsContentReidentifyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2reidentifycontentrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/content:reidentify") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parentid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.organizations.storedInfoTypes.delete" call. +// Do executes the "dlp.projects.content.reidentify" call. // Any non-2xx status code is an error. Response headers are in either -// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *OrganizationsStoredInfoTypesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { +// *GooglePrivacyDlpV2ReidentifyContentResponse.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 *ProjectsContentReidentifyCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ReidentifyContentResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16172,7 +17606,7 @@ func (c *OrganizationsStoredInfoTypesDeleteCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleProtobufEmpty{ + ret := &GooglePrivacyDlpV2ReidentifyContentResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16185,87 +17619,92 @@ func (c *OrganizationsStoredInfoTypesDeleteCall) Do(opts ...googleapi.CallOption return ret, nil } -type OrganizationsStoredInfoTypesGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsDeidentifyTemplatesCreateCall struct { + s *Service + parentid string + googleprivacydlpv2createdeidentifytemplaterequest *GooglePrivacyDlpV2CreateDeidentifyTemplateRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a stored infoType. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-stored-infotypes +// Create: Creates a DeidentifyTemplate for reusing frequently used +// configuration for de-identifying content, images, and storage. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-templates-deid // to learn more. // -// - name: Resource name of the organization and storedInfoType to be read, for -// example `organizations/433245324/storedInfoTypes/432452342` or -// projects/project-id/storedInfoTypes/432452342. -func (r *OrganizationsStoredInfoTypesService) Get(name string) *OrganizationsStoredInfoTypesGetCall { - c := &OrganizationsStoredInfoTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: Parent resource name. The format of this value varies depending on +// the scope of the request (project or organization) and whether you have +// specified a processing location +// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID + Organizations scope, location specified: +// `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no +// location specified (defaults to global): `organizations/`ORG_ID The +// following example `parent` string specifies a parent project with the +// identifier `example-project`, and specifies the `europe-west3` location +// for processing data: +// parent=projects/example-project/locations/europe-west3. +func (r *ProjectsDeidentifyTemplatesService) Create(parentid string, googleprivacydlpv2createdeidentifytemplaterequest *GooglePrivacyDlpV2CreateDeidentifyTemplateRequest) *ProjectsDeidentifyTemplatesCreateCall { + c := &ProjectsDeidentifyTemplatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parentid = parentid + c.googleprivacydlpv2createdeidentifytemplaterequest = googleprivacydlpv2createdeidentifytemplaterequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *OrganizationsStoredInfoTypesGetCall) Fields(s ...googleapi.Field) *OrganizationsStoredInfoTypesGetCall { +func (c *ProjectsDeidentifyTemplatesCreateCall) Fields(s ...googleapi.Field) *ProjectsDeidentifyTemplatesCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an 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. -func (c *OrganizationsStoredInfoTypesGetCall) IfNoneMatch(entityTag string) *OrganizationsStoredInfoTypesGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *OrganizationsStoredInfoTypesGetCall) Context(ctx context.Context) *OrganizationsStoredInfoTypesGetCall { +func (c *ProjectsDeidentifyTemplatesCreateCall) Context(ctx context.Context) *ProjectsDeidentifyTemplatesCreateCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *OrganizationsStoredInfoTypesGetCall) Header() http.Header { +func (c *ProjectsDeidentifyTemplatesCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsStoredInfoTypesGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *ProjectsDeidentifyTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createdeidentifytemplaterequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/deidentifyTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parentid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.organizations.storedInfoTypes.get" call. +// Do executes the "dlp.projects.deidentifyTemplates.create" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2StoredInfoType.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use +// *GooglePrivacyDlpV2DeidentifyTemplate.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 *OrganizationsStoredInfoTypesGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2StoredInfoType, error) { +func (c *ProjectsDeidentifyTemplatesCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DeidentifyTemplate, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16279,147 +17718,94 @@ func (c *OrganizationsStoredInfoTypesGetCall) Do(opts ...googleapi.CallOption) ( } if err != nil { return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &GooglePrivacyDlpV2StoredInfoType{ - 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 -} - -type OrganizationsStoredInfoTypesListCall struct { - s *Service - parentid string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// List: Lists stored infoTypes. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-stored-infotypes -// to learn more. -// -// - parent: Parent resource name. The format of this value varies depending on -// the scope of the request (project or organization) and whether you have -// specified a processing location -// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` -// LOCATION_ID + Projects scope, no location specified (defaults to global): -// `projects/`PROJECT_ID The following example `parent` string specifies a -// parent project with the identifier `example-project`, and specifies the -// `europe-west3` location for processing data: -// parent=projects/example-project/locations/europe-west3. -func (r *OrganizationsStoredInfoTypesService) List(parentid string) *OrganizationsStoredInfoTypesListCall { - c := &OrganizationsStoredInfoTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parentid = parentid - return c -} - -// LocationId sets the optional parameter "locationId": Deprecated. This field -// has no effect. -func (c *OrganizationsStoredInfoTypesListCall) LocationId(locationId string) *OrganizationsStoredInfoTypesListCall { - c.urlParams_.Set("locationId", locationId) - return c -} - -// OrderBy sets the optional parameter "orderBy": Comma separated list of -// fields to order by, followed by `asc` or `desc` postfix. This list is case -// insensitive. The default sorting order is ascending. Redundant space -// characters are insignificant. Example: `name asc, display_name, create_time -// desc` Supported fields are: - `create_time`: corresponds to the time the -// most recent version of the resource was created. - `state`: corresponds to -// the state of the resource. - `name`: corresponds to resource name. - -// `display_name`: corresponds to info type's display name. -func (c *OrganizationsStoredInfoTypesListCall) OrderBy(orderBy string) *OrganizationsStoredInfoTypesListCall { - c.urlParams_.Set("orderBy", orderBy) - return c + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GooglePrivacyDlpV2DeidentifyTemplate{ + 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 } -// PageSize sets the optional parameter "pageSize": Size of the page. This -// value can be limited by the server. If zero server returns a page of max -// size 100. -func (c *OrganizationsStoredInfoTypesListCall) PageSize(pageSize int64) *OrganizationsStoredInfoTypesListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c +type ProjectsDeidentifyTemplatesDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// PageToken sets the optional parameter "pageToken": Page token to continue -// retrieval. Comes from the previous call to `ListStoredInfoTypes`. -func (c *OrganizationsStoredInfoTypesListCall) PageToken(pageToken string) *OrganizationsStoredInfoTypesListCall { - c.urlParams_.Set("pageToken", pageToken) +// Delete: Deletes a DeidentifyTemplate. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-templates-deid +// to learn more. +// +// - name: Resource name of the organization and deidentify template to be +// deleted, for example +// `organizations/433245324/deidentifyTemplates/432452342` or +// projects/project-id/deidentifyTemplates/432452342. +func (r *ProjectsDeidentifyTemplatesService) Delete(name string) *ProjectsDeidentifyTemplatesDeleteCall { + c := &ProjectsDeidentifyTemplatesDeleteCall{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 // details. -func (c *OrganizationsStoredInfoTypesListCall) Fields(s ...googleapi.Field) *OrganizationsStoredInfoTypesListCall { +func (c *ProjectsDeidentifyTemplatesDeleteCall) Fields(s ...googleapi.Field) *ProjectsDeidentifyTemplatesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an 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. -func (c *OrganizationsStoredInfoTypesListCall) IfNoneMatch(entityTag string) *OrganizationsStoredInfoTypesListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *OrganizationsStoredInfoTypesListCall) Context(ctx context.Context) *OrganizationsStoredInfoTypesListCall { +func (c *ProjectsDeidentifyTemplatesDeleteCall) Context(ctx context.Context) *ProjectsDeidentifyTemplatesDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *OrganizationsStoredInfoTypesListCall) Header() http.Header { +func (c *ProjectsDeidentifyTemplatesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsStoredInfoTypesListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsDeidentifyTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - 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, "v2/{+parent}/storedInfoTypes") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parentid, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.organizations.storedInfoTypes.list" call. +// Do executes the "dlp.projects.deidentifyTemplates.delete" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2ListStoredInfoTypesResponse.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 *OrganizationsStoredInfoTypesListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListStoredInfoTypesResponse, error) { +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsDeidentifyTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16438,7 +17824,7 @@ func (c *OrganizationsStoredInfoTypesListCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2ListStoredInfoTypesResponse{ + ret := &GoogleProtobufEmpty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16451,86 +17837,70 @@ func (c *OrganizationsStoredInfoTypesListCall) Do(opts ...googleapi.CallOption) return ret, nil } -// 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 *OrganizationsStoredInfoTypesListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListStoredInfoTypesResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type OrganizationsStoredInfoTypesPatchCall struct { - s *Service - name string - googleprivacydlpv2updatestoredinfotyperequest *GooglePrivacyDlpV2UpdateStoredInfoTypeRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsDeidentifyTemplatesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Updates the stored infoType by creating a new version. The existing -// version will continue to be used until the new version is ready. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-stored-infotypes +// Get: Gets a DeidentifyTemplate. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-templates-deid // to learn more. // -// - name: Resource name of organization and storedInfoType to be updated, for -// example `organizations/433245324/storedInfoTypes/432452342` or -// projects/project-id/storedInfoTypes/432452342. -func (r *OrganizationsStoredInfoTypesService) Patch(name string, googleprivacydlpv2updatestoredinfotyperequest *GooglePrivacyDlpV2UpdateStoredInfoTypeRequest) *OrganizationsStoredInfoTypesPatchCall { - c := &OrganizationsStoredInfoTypesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Resource name of the organization and deidentify template to be +// read, for example `organizations/433245324/deidentifyTemplates/432452342` +// or projects/project-id/deidentifyTemplates/432452342. +func (r *ProjectsDeidentifyTemplatesService) Get(name string) *ProjectsDeidentifyTemplatesGetCall { + c := &ProjectsDeidentifyTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googleprivacydlpv2updatestoredinfotyperequest = googleprivacydlpv2updatestoredinfotyperequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *OrganizationsStoredInfoTypesPatchCall) Fields(s ...googleapi.Field) *OrganizationsStoredInfoTypesPatchCall { +func (c *ProjectsDeidentifyTemplatesGetCall) Fields(s ...googleapi.Field) *ProjectsDeidentifyTemplatesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an 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. +func (c *ProjectsDeidentifyTemplatesGetCall) IfNoneMatch(entityTag string) *ProjectsDeidentifyTemplatesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *OrganizationsStoredInfoTypesPatchCall) Context(ctx context.Context) *OrganizationsStoredInfoTypesPatchCall { +func (c *ProjectsDeidentifyTemplatesGetCall) Context(ctx context.Context) *ProjectsDeidentifyTemplatesGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *OrganizationsStoredInfoTypesPatchCall) Header() http.Header { +func (c *ProjectsDeidentifyTemplatesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsStoredInfoTypesPatchCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatestoredinfotyperequest) - if err != nil { - return nil, err +func (c *ProjectsDeidentifyTemplatesGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -16541,13 +17911,13 @@ func (c *OrganizationsStoredInfoTypesPatchCall) doRequest(alt string) (*http.Res return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.organizations.storedInfoTypes.patch" call. +// Do executes the "dlp.projects.deidentifyTemplates.get" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2StoredInfoType.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use +// *GooglePrivacyDlpV2DeidentifyTemplate.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 *OrganizationsStoredInfoTypesPatchCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2StoredInfoType, error) { +func (c *ProjectsDeidentifyTemplatesGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DeidentifyTemplate, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16566,7 +17936,7 @@ func (c *OrganizationsStoredInfoTypesPatchCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2StoredInfoType{ + ret := &GooglePrivacyDlpV2DeidentifyTemplate{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16579,74 +17949,115 @@ func (c *OrganizationsStoredInfoTypesPatchCall) Do(opts ...googleapi.CallOption) return ret, nil } -type ProjectsContentDeidentifyCall struct { - s *Service - parentid string - googleprivacydlpv2deidentifycontentrequest *GooglePrivacyDlpV2DeidentifyContentRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsDeidentifyTemplatesListCall struct { + s *Service + parentid string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Deidentify: De-identifies potentially sensitive info from a ContentItem. -// This method has limits on input size and output size. See -// https://cloud.google.com/sensitive-data-protection/docs/deidentify-sensitive-data -// to learn more. When no InfoTypes or CustomInfoTypes are specified in this -// request, the system will automatically choose what detectors to run. By -// default this may be all types, but may change over time as detectors are -// updated. +// List: Lists DeidentifyTemplates. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-templates-deid +// to learn more. // // - parent: Parent resource name. The format of this value varies depending on -// whether you have specified a processing location +// the scope of the request (project or organization) and whether you have +// specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): // - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` // LOCATION_ID + Projects scope, no location specified (defaults to global): -// `projects/`PROJECT_ID The following example `parent` string specifies a -// parent project with the identifier `example-project`, and specifies the -// `europe-west3` location for processing data: +// `projects/`PROJECT_ID + Organizations scope, location specified: +// `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no +// location specified (defaults to global): `organizations/`ORG_ID The +// following example `parent` string specifies a parent project with the +// identifier `example-project`, and specifies the `europe-west3` location +// for processing data: // parent=projects/example-project/locations/europe-west3. -func (r *ProjectsContentService) Deidentify(parentid string, googleprivacydlpv2deidentifycontentrequest *GooglePrivacyDlpV2DeidentifyContentRequest) *ProjectsContentDeidentifyCall { - c := &ProjectsContentDeidentifyCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsDeidentifyTemplatesService) List(parentid string) *ProjectsDeidentifyTemplatesListCall { + c := &ProjectsDeidentifyTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parentid = parentid - c.googleprivacydlpv2deidentifycontentrequest = googleprivacydlpv2deidentifycontentrequest + return c +} + +// LocationId sets the optional parameter "locationId": Deprecated. This field +// has no effect. +func (c *ProjectsDeidentifyTemplatesListCall) LocationId(locationId string) *ProjectsDeidentifyTemplatesListCall { + c.urlParams_.Set("locationId", locationId) + return c +} + +// OrderBy sets the optional parameter "orderBy": Comma separated list of +// fields to order by, followed by `asc` or `desc` postfix. This list is case +// insensitive. The default sorting order is ascending. Redundant space +// characters are insignificant. Example: `name asc,update_time, create_time +// desc` Supported fields are: - `create_time`: corresponds to the time the +// template was created. - `update_time`: corresponds to the time the template +// was last updated. - `name`: corresponds to the template's name. - +// `display_name`: corresponds to the template's display name. +func (c *ProjectsDeidentifyTemplatesListCall) OrderBy(orderBy string) *ProjectsDeidentifyTemplatesListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageSize sets the optional parameter "pageSize": Size of the page. This +// value can be limited by the server. If zero server returns a page of max +// size 100. +func (c *ProjectsDeidentifyTemplatesListCall) PageSize(pageSize int64) *ProjectsDeidentifyTemplatesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": Page token to continue +// retrieval. Comes from the previous call to `ListDeidentifyTemplates`. +func (c *ProjectsDeidentifyTemplatesListCall) PageToken(pageToken string) *ProjectsDeidentifyTemplatesListCall { + 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 // details. -func (c *ProjectsContentDeidentifyCall) Fields(s ...googleapi.Field) *ProjectsContentDeidentifyCall { +func (c *ProjectsDeidentifyTemplatesListCall) Fields(s ...googleapi.Field) *ProjectsDeidentifyTemplatesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an 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. +func (c *ProjectsDeidentifyTemplatesListCall) IfNoneMatch(entityTag string) *ProjectsDeidentifyTemplatesListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *ProjectsContentDeidentifyCall) Context(ctx context.Context) *ProjectsContentDeidentifyCall { +func (c *ProjectsDeidentifyTemplatesListCall) Context(ctx context.Context) *ProjectsDeidentifyTemplatesListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsContentDeidentifyCall) Header() http.Header { +func (c *ProjectsDeidentifyTemplatesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsContentDeidentifyCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2deidentifycontentrequest) - if err != nil { - return nil, err +func (c *ProjectsDeidentifyTemplatesListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "v2/{+parent}/content:deidentify") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/deidentifyTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -16657,13 +18068,13 @@ func (c *ProjectsContentDeidentifyCall) doRequest(alt string) (*http.Response, e return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.content.deidentify" call. +// Do executes the "dlp.projects.deidentifyTemplates.list" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2DeidentifyContentResponse.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use +// *GooglePrivacyDlpV2ListDeidentifyTemplatesResponse.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 *ProjectsContentDeidentifyCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DeidentifyContentResponse, error) { +func (c *ProjectsDeidentifyTemplatesListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListDeidentifyTemplatesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16682,7 +18093,7 @@ func (c *ProjectsContentDeidentifyCall) Do(opts ...googleapi.CallOption) (*Googl if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2DeidentifyContentResponse{ + ret := &GooglePrivacyDlpV2ListDeidentifyTemplatesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16695,91 +18106,102 @@ func (c *ProjectsContentDeidentifyCall) Do(opts ...googleapi.CallOption) (*Googl return ret, nil } -type ProjectsContentInspectCall struct { - s *Service - parentid string - googleprivacydlpv2inspectcontentrequest *GooglePrivacyDlpV2InspectContentRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// 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 *ProjectsDeidentifyTemplatesListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListDeidentifyTemplatesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + 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) + } } -// Inspect: Finds potentially sensitive info in content. This method has limits -// on input size, processing time, and output size. When no InfoTypes or -// CustomInfoTypes are specified in this request, the system will automatically -// choose what detectors to run. By default this may be all types, but may -// change over time as detectors are updated. For how to guides, see -// https://cloud.google.com/sensitive-data-protection/docs/inspecting-images -// and https://cloud.google.com/sensitive-data-protection/docs/inspecting-text, +type ProjectsDeidentifyTemplatesPatchCall struct { + s *Service + name string + googleprivacydlpv2updatedeidentifytemplaterequest *GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates the DeidentifyTemplate. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-templates-deid +// to learn more. // -// - parent: Parent resource name. The format of this value varies depending on -// whether you have specified a processing location -// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` -// LOCATION_ID + Projects scope, no location specified (defaults to global): -// `projects/`PROJECT_ID The following example `parent` string specifies a -// parent project with the identifier `example-project`, and specifies the -// `europe-west3` location for processing data: -// parent=projects/example-project/locations/europe-west3. -func (r *ProjectsContentService) Inspect(parentid string, googleprivacydlpv2inspectcontentrequest *GooglePrivacyDlpV2InspectContentRequest) *ProjectsContentInspectCall { - c := &ProjectsContentInspectCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parentid = parentid - c.googleprivacydlpv2inspectcontentrequest = googleprivacydlpv2inspectcontentrequest +// - name: Resource name of organization and deidentify template to be updated, +// for example `organizations/433245324/deidentifyTemplates/432452342` or +// projects/project-id/deidentifyTemplates/432452342. +func (r *ProjectsDeidentifyTemplatesService) Patch(name string, googleprivacydlpv2updatedeidentifytemplaterequest *GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest) *ProjectsDeidentifyTemplatesPatchCall { + c := &ProjectsDeidentifyTemplatesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googleprivacydlpv2updatedeidentifytemplaterequest = googleprivacydlpv2updatedeidentifytemplaterequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsContentInspectCall) Fields(s ...googleapi.Field) *ProjectsContentInspectCall { +func (c *ProjectsDeidentifyTemplatesPatchCall) Fields(s ...googleapi.Field) *ProjectsDeidentifyTemplatesPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsContentInspectCall) Context(ctx context.Context) *ProjectsContentInspectCall { +func (c *ProjectsDeidentifyTemplatesPatchCall) Context(ctx context.Context) *ProjectsDeidentifyTemplatesPatchCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsContentInspectCall) Header() http.Header { +func (c *ProjectsDeidentifyTemplatesPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsContentInspectCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsDeidentifyTemplatesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2inspectcontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatedeidentifytemplaterequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/content:inspect") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parentid, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.content.inspect" call. +// Do executes the "dlp.projects.deidentifyTemplates.patch" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2InspectContentResponse.ServerResponse.Header or (if a +// *GooglePrivacyDlpV2DeidentifyTemplate.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 *ProjectsContentInspectCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2InspectContentResponse, error) { +func (c *ProjectsDeidentifyTemplatesPatchCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DeidentifyTemplate, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16798,7 +18220,7 @@ func (c *ProjectsContentInspectCall) Do(opts ...googleapi.CallOption) (*GooglePr if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2InspectContentResponse{ + ret := &GooglePrivacyDlpV2DeidentifyTemplate{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16811,68 +18233,64 @@ func (c *ProjectsContentInspectCall) Do(opts ...googleapi.CallOption) (*GooglePr return ret, nil } -type ProjectsContentReidentifyCall struct { - s *Service - parentid string - googleprivacydlpv2reidentifycontentrequest *GooglePrivacyDlpV2ReidentifyContentRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsDlpJobsCancelCall struct { + s *Service + name string + googleprivacydlpv2canceldlpjobrequest *GooglePrivacyDlpV2CancelDlpJobRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Reidentify: Re-identifies content that has been de-identified. See -// https://cloud.google.com/sensitive-data-protection/docs/pseudonymization#re-identification_in_free_text_code_example +// Cancel: Starts asynchronous cancellation on a long-running DlpJob. The +// server makes a best effort to cancel the DlpJob, but success is not +// guaranteed. See +// https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage +// and +// https://cloud.google.com/sensitive-data-protection/docs/compute-risk-analysis // to learn more. // -// - parent: Parent resource name. The format of this value varies depending on -// whether you have specified a processing location -// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` -// LOCATION_ID + Projects scope, no location specified (defaults to global): -// `projects/`PROJECT_ID The following example `parent` string specifies a -// parent project with the identifier `example-project`, and specifies the -// `europe-west3` location for processing data: -// parent=projects/example-project/locations/europe-west3. -func (r *ProjectsContentService) Reidentify(parentid string, googleprivacydlpv2reidentifycontentrequest *GooglePrivacyDlpV2ReidentifyContentRequest) *ProjectsContentReidentifyCall { - c := &ProjectsContentReidentifyCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parentid = parentid - c.googleprivacydlpv2reidentifycontentrequest = googleprivacydlpv2reidentifycontentrequest +// - name: The name of the DlpJob resource to be cancelled. +func (r *ProjectsDlpJobsService) Cancel(name string, googleprivacydlpv2canceldlpjobrequest *GooglePrivacyDlpV2CancelDlpJobRequest) *ProjectsDlpJobsCancelCall { + c := &ProjectsDlpJobsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googleprivacydlpv2canceldlpjobrequest = googleprivacydlpv2canceldlpjobrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsContentReidentifyCall) Fields(s ...googleapi.Field) *ProjectsContentReidentifyCall { +func (c *ProjectsDlpJobsCancelCall) Fields(s ...googleapi.Field) *ProjectsDlpJobsCancelCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsContentReidentifyCall) Context(ctx context.Context) *ProjectsContentReidentifyCall { +func (c *ProjectsDlpJobsCancelCall) Context(ctx context.Context) *ProjectsDlpJobsCancelCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsContentReidentifyCall) Header() http.Header { +func (c *ProjectsDlpJobsCancelCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsContentReidentifyCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsDlpJobsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2reidentifycontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2canceldlpjobrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/content:reidentify") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:cancel") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -16880,18 +18298,18 @@ func (c *ProjectsContentReidentifyCall) doRequest(alt string) (*http.Response, e } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parentid, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.content.reidentify" call. +// Do executes the "dlp.projects.dlpJobs.cancel" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2ReidentifyContentResponse.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 *ProjectsContentReidentifyCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ReidentifyContentResponse, error) { +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsDlpJobsCancelCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16910,7 +18328,7 @@ func (c *ProjectsContentReidentifyCall) Do(opts ...googleapi.CallOption) (*Googl if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2ReidentifyContentResponse{ + ret := &GoogleProtobufEmpty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16923,73 +18341,72 @@ func (c *ProjectsContentReidentifyCall) Do(opts ...googleapi.CallOption) (*Googl return ret, nil } -type ProjectsDeidentifyTemplatesCreateCall struct { - s *Service - parentid string - googleprivacydlpv2createdeidentifytemplaterequest *GooglePrivacyDlpV2CreateDeidentifyTemplateRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsDlpJobsCreateCall struct { + s *Service + parentid string + googleprivacydlpv2createdlpjobrequest *GooglePrivacyDlpV2CreateDlpJobRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a DeidentifyTemplate for reusing frequently used -// configuration for de-identifying content, images, and storage. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-templates-deid -// to learn more. +// Create: Creates a new job to inspect storage or calculate risk metrics. See +// https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage +// and +// https://cloud.google.com/sensitive-data-protection/docs/compute-risk-analysis +// to learn more. When no InfoTypes or CustomInfoTypes are specified in inspect +// jobs, the system will automatically choose what detectors to run. By default +// this may be all types, but may change over time as detectors are updated. // // - parent: Parent resource name. The format of this value varies depending on -// the scope of the request (project or organization) and whether you have -// specified a processing location +// whether you have specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): // - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` // LOCATION_ID + Projects scope, no location specified (defaults to global): -// `projects/`PROJECT_ID + Organizations scope, location specified: -// `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no -// location specified (defaults to global): `organizations/`ORG_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: // parent=projects/example-project/locations/europe-west3. -func (r *ProjectsDeidentifyTemplatesService) Create(parentid string, googleprivacydlpv2createdeidentifytemplaterequest *GooglePrivacyDlpV2CreateDeidentifyTemplateRequest) *ProjectsDeidentifyTemplatesCreateCall { - c := &ProjectsDeidentifyTemplatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsDlpJobsService) Create(parentid string, googleprivacydlpv2createdlpjobrequest *GooglePrivacyDlpV2CreateDlpJobRequest) *ProjectsDlpJobsCreateCall { + c := &ProjectsDlpJobsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parentid = parentid - c.googleprivacydlpv2createdeidentifytemplaterequest = googleprivacydlpv2createdeidentifytemplaterequest + c.googleprivacydlpv2createdlpjobrequest = googleprivacydlpv2createdlpjobrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsDeidentifyTemplatesCreateCall) Fields(s ...googleapi.Field) *ProjectsDeidentifyTemplatesCreateCall { +func (c *ProjectsDlpJobsCreateCall) Fields(s ...googleapi.Field) *ProjectsDlpJobsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsDeidentifyTemplatesCreateCall) Context(ctx context.Context) *ProjectsDeidentifyTemplatesCreateCall { +func (c *ProjectsDlpJobsCreateCall) Context(ctx context.Context) *ProjectsDlpJobsCreateCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsDeidentifyTemplatesCreateCall) Header() http.Header { +func (c *ProjectsDlpJobsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsDeidentifyTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsDlpJobsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createdeidentifytemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createdlpjobrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/deidentifyTemplates") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/dlpJobs") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -17002,13 +18419,13 @@ func (c *ProjectsDeidentifyTemplatesCreateCall) doRequest(alt string) (*http.Res return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.deidentifyTemplates.create" call. +// Do executes the "dlp.projects.dlpJobs.create" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2DeidentifyTemplate.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use +// *GooglePrivacyDlpV2DlpJob.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 *ProjectsDeidentifyTemplatesCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DeidentifyTemplate, error) { +func (c *ProjectsDlpJobsCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DlpJob, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17027,7 +18444,7 @@ func (c *ProjectsDeidentifyTemplatesCreateCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2DeidentifyTemplate{ + ret := &GooglePrivacyDlpV2DlpJob{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17040,24 +18457,25 @@ func (c *ProjectsDeidentifyTemplatesCreateCall) Do(opts ...googleapi.CallOption) return ret, nil } -type ProjectsDeidentifyTemplatesDeleteCall struct { +type ProjectsDlpJobsDeleteCall struct { s *Service name string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } - -// Delete: Deletes a DeidentifyTemplate. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-templates-deid + +// Delete: Deletes a long-running DlpJob. This method indicates that the client +// is no longer interested in the DlpJob result. The job will be canceled if +// possible. See +// https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage +// and +// https://cloud.google.com/sensitive-data-protection/docs/compute-risk-analysis // to learn more. // -// - name: Resource name of the organization and deidentify template to be -// deleted, for example -// `organizations/433245324/deidentifyTemplates/432452342` or -// projects/project-id/deidentifyTemplates/432452342. -func (r *ProjectsDeidentifyTemplatesService) Delete(name string) *ProjectsDeidentifyTemplatesDeleteCall { - c := &ProjectsDeidentifyTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the DlpJob resource to be deleted. +func (r *ProjectsDlpJobsService) Delete(name string) *ProjectsDlpJobsDeleteCall { + c := &ProjectsDlpJobsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -17065,27 +18483,27 @@ func (r *ProjectsDeidentifyTemplatesService) Delete(name string) *ProjectsDeiden // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsDeidentifyTemplatesDeleteCall) Fields(s ...googleapi.Field) *ProjectsDeidentifyTemplatesDeleteCall { +func (c *ProjectsDlpJobsDeleteCall) Fields(s ...googleapi.Field) *ProjectsDlpJobsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsDeidentifyTemplatesDeleteCall) Context(ctx context.Context) *ProjectsDeidentifyTemplatesDeleteCall { +func (c *ProjectsDlpJobsDeleteCall) Context(ctx context.Context) *ProjectsDlpJobsDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsDeidentifyTemplatesDeleteCall) Header() http.Header { +func (c *ProjectsDlpJobsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsDeidentifyTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsDlpJobsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil c.urlParams_.Set("alt", alt) @@ -17103,13 +18521,13 @@ func (c *ProjectsDeidentifyTemplatesDeleteCall) doRequest(alt string) (*http.Res return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.deidentifyTemplates.delete" call. +// Do executes the "dlp.projects.dlpJobs.delete" call. // Any non-2xx status code is an error. Response headers are in either // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified was // returned. -func (c *ProjectsDeidentifyTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { +func (c *ProjectsDlpJobsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17141,7 +18559,7 @@ func (c *ProjectsDeidentifyTemplatesDeleteCall) Do(opts ...googleapi.CallOption) return ret, nil } -type ProjectsDeidentifyTemplatesGetCall struct { +type ProjectsDlpJobsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -17150,15 +18568,15 @@ type ProjectsDeidentifyTemplatesGetCall struct { header_ http.Header } -// Get: Gets a DeidentifyTemplate. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-templates-deid +// Get: Gets the latest state of a long-running DlpJob. See +// https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage +// and +// https://cloud.google.com/sensitive-data-protection/docs/compute-risk-analysis // to learn more. // -// - name: Resource name of the organization and deidentify template to be -// read, for example `organizations/433245324/deidentifyTemplates/432452342` -// or projects/project-id/deidentifyTemplates/432452342. -func (r *ProjectsDeidentifyTemplatesService) Get(name string) *ProjectsDeidentifyTemplatesGetCall { - c := &ProjectsDeidentifyTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the DlpJob resource. +func (r *ProjectsDlpJobsService) Get(name string) *ProjectsDlpJobsGetCall { + c := &ProjectsDlpJobsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -17166,7 +18584,7 @@ func (r *ProjectsDeidentifyTemplatesService) Get(name string) *ProjectsDeidentif // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsDeidentifyTemplatesGetCall) Fields(s ...googleapi.Field) *ProjectsDeidentifyTemplatesGetCall { +func (c *ProjectsDlpJobsGetCall) Fields(s ...googleapi.Field) *ProjectsDlpJobsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -17174,27 +18592,27 @@ func (c *ProjectsDeidentifyTemplatesGetCall) Fields(s ...googleapi.Field) *Proje // IfNoneMatch sets an 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. -func (c *ProjectsDeidentifyTemplatesGetCall) IfNoneMatch(entityTag string) *ProjectsDeidentifyTemplatesGetCall { +func (c *ProjectsDlpJobsGetCall) IfNoneMatch(entityTag string) *ProjectsDlpJobsGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsDeidentifyTemplatesGetCall) Context(ctx context.Context) *ProjectsDeidentifyTemplatesGetCall { +func (c *ProjectsDlpJobsGetCall) Context(ctx context.Context) *ProjectsDlpJobsGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsDeidentifyTemplatesGetCall) Header() http.Header { +func (c *ProjectsDlpJobsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsDeidentifyTemplatesGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsDlpJobsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -17215,13 +18633,13 @@ func (c *ProjectsDeidentifyTemplatesGetCall) doRequest(alt string) (*http.Respon return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.deidentifyTemplates.get" call. +// Do executes the "dlp.projects.dlpJobs.get" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2DeidentifyTemplate.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use +// *GooglePrivacyDlpV2DlpJob.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 *ProjectsDeidentifyTemplatesGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DeidentifyTemplate, error) { +func (c *ProjectsDlpJobsGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DlpJob, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17240,7 +18658,7 @@ func (c *ProjectsDeidentifyTemplatesGetCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2DeidentifyTemplate{ + ret := &GooglePrivacyDlpV2DlpJob{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17253,7 +18671,7 @@ func (c *ProjectsDeidentifyTemplatesGetCall) Do(opts ...googleapi.CallOption) (* return ret, nil } -type ProjectsDeidentifyTemplatesListCall struct { +type ProjectsDlpJobsListCall struct { s *Service parentid string urlParams_ gensupport.URLParams @@ -17262,32 +18680,52 @@ type ProjectsDeidentifyTemplatesListCall struct { header_ http.Header } -// List: Lists DeidentifyTemplates. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-templates-deid +// List: Lists DlpJobs that match the specified filter in the request. See +// https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage +// and +// https://cloud.google.com/sensitive-data-protection/docs/compute-risk-analysis // to learn more. // // - parent: Parent resource name. The format of this value varies depending on -// the scope of the request (project or organization) and whether you have -// specified a processing location +// whether you have specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): // - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` // LOCATION_ID + Projects scope, no location specified (defaults to global): -// `projects/`PROJECT_ID + Organizations scope, location specified: -// `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no -// location specified (defaults to global): `organizations/`ORG_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: // parent=projects/example-project/locations/europe-west3. -func (r *ProjectsDeidentifyTemplatesService) List(parentid string) *ProjectsDeidentifyTemplatesListCall { - c := &ProjectsDeidentifyTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsDlpJobsService) List(parentid string) *ProjectsDlpJobsListCall { + c := &ProjectsDlpJobsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parentid = parentid return c } +// Filter sets the optional parameter "filter": Allows filtering. Supported +// syntax: * Filter expressions are made up of one or more restrictions. * +// Restrictions can be combined by `AND` or `OR` logical operators. A sequence +// of restrictions implicitly uses `AND`. * A restriction has the form of +// `{field} {operator} {value}`. * Supported fields/values for inspect jobs: - +// `state` - PENDING|RUNNING|CANCELED|FINISHED|FAILED - `inspected_storage` - +// DATASTORE|CLOUD_STORAGE|BIGQUERY - `trigger_name` - The name of the trigger +// that created the job. - 'end_time` - Corresponds to the time the job +// finished. - 'start_time` - Corresponds to the time the job finished. * +// Supported fields for risk analysis jobs: - `state` - +// RUNNING|CANCELED|FINISHED|FAILED - 'end_time` - Corresponds to the time the +// job finished. - 'start_time` - Corresponds to the time the job finished. * +// The operator must be `=` or `!=`. Examples: * inspected_storage = +// cloud_storage AND state = done * inspected_storage = cloud_storage OR +// inspected_storage = bigquery * inspected_storage = cloud_storage AND (state +// = done OR state = canceled) * end_time > \"2017-12-12T00:00:00+00:00\" The +// length of this field should be no more than 500 characters. +func (c *ProjectsDlpJobsListCall) Filter(filter string) *ProjectsDlpJobsListCall { + c.urlParams_.Set("filter", filter) + return c +} + // LocationId sets the optional parameter "locationId": Deprecated. This field // has no effect. -func (c *ProjectsDeidentifyTemplatesListCall) LocationId(locationId string) *ProjectsDeidentifyTemplatesListCall { +func (c *ProjectsDlpJobsListCall) LocationId(locationId string) *ProjectsDlpJobsListCall { c.urlParams_.Set("locationId", locationId) return c } @@ -17295,217 +18733,101 @@ func (c *ProjectsDeidentifyTemplatesListCall) LocationId(locationId string) *Pro // OrderBy sets the optional parameter "orderBy": Comma separated list of // fields to order by, followed by `asc` or `desc` postfix. This list is case // insensitive. The default sorting order is ascending. Redundant space -// characters are insignificant. Example: `name asc,update_time, create_time -// desc` Supported fields are: - `create_time`: corresponds to the time the -// template was created. - `update_time`: corresponds to the time the template -// was last updated. - `name`: corresponds to the template's name. - -// `display_name`: corresponds to the template's display name. -func (c *ProjectsDeidentifyTemplatesListCall) OrderBy(orderBy string) *ProjectsDeidentifyTemplatesListCall { +// characters are insignificant. Example: `name asc, end_time asc, create_time +// desc` Supported fields are: - `create_time`: corresponds to the time the job +// was created. - `end_time`: corresponds to the time the job ended. - `name`: +// corresponds to the job's name. - `state`: corresponds to `state` +func (c *ProjectsDlpJobsListCall) OrderBy(orderBy string) *ProjectsDlpJobsListCall { c.urlParams_.Set("orderBy", orderBy) return c } -// PageSize sets the optional parameter "pageSize": Size of the page. This -// value can be limited by the server. If zero server returns a page of max -// size 100. -func (c *ProjectsDeidentifyTemplatesListCall) PageSize(pageSize int64) *ProjectsDeidentifyTemplatesListCall { +// PageSize sets the optional parameter "pageSize": The standard list page +// size. +func (c *ProjectsDlpJobsListCall) PageSize(pageSize int64) *ProjectsDlpJobsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// PageToken sets the optional parameter "pageToken": Page token to continue -// retrieval. Comes from the previous call to `ListDeidentifyTemplates`. -func (c *ProjectsDeidentifyTemplatesListCall) PageToken(pageToken string) *ProjectsDeidentifyTemplatesListCall { +// PageToken sets the optional parameter "pageToken": The standard list page +// token. +func (c *ProjectsDlpJobsListCall) PageToken(pageToken string) *ProjectsDlpJobsListCall { 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 -// details. -func (c *ProjectsDeidentifyTemplatesListCall) Fields(s ...googleapi.Field) *ProjectsDeidentifyTemplatesListCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets an 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. -func (c *ProjectsDeidentifyTemplatesListCall) IfNoneMatch(entityTag string) *ProjectsDeidentifyTemplatesListCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *ProjectsDeidentifyTemplatesListCall) Context(ctx context.Context) *ProjectsDeidentifyTemplatesListCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *ProjectsDeidentifyTemplatesListCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ProjectsDeidentifyTemplatesListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - 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, "v2/{+parent}/deidentifyTemplates") - 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.parentid, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "dlp.projects.deidentifyTemplates.list" call. -// Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2ListDeidentifyTemplatesResponse.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 *ProjectsDeidentifyTemplatesListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListDeidentifyTemplatesResponse, 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 := &GooglePrivacyDlpV2ListDeidentifyTemplatesResponse{ - 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 -} - -// 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 *ProjectsDeidentifyTemplatesListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListDeidentifyTemplatesResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type ProjectsDeidentifyTemplatesPatchCall struct { - s *Service - name string - googleprivacydlpv2updatedeidentifytemplaterequest *GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Patch: Updates the DeidentifyTemplate. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-templates-deid -// to learn more. +// Type sets the optional parameter "type": The type of job. Defaults to +// `DlpJobType.INSPECT` // -// - name: Resource name of organization and deidentify template to be updated, -// for example `organizations/433245324/deidentifyTemplates/432452342` or -// projects/project-id/deidentifyTemplates/432452342. -func (r *ProjectsDeidentifyTemplatesService) Patch(name string, googleprivacydlpv2updatedeidentifytemplaterequest *GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest) *ProjectsDeidentifyTemplatesPatchCall { - c := &ProjectsDeidentifyTemplatesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.googleprivacydlpv2updatedeidentifytemplaterequest = googleprivacydlpv2updatedeidentifytemplaterequest +// Possible values: +// +// "DLP_JOB_TYPE_UNSPECIFIED" - Defaults to INSPECT_JOB. +// "INSPECT_JOB" - The job inspected Google Cloud for sensitive data. +// "RISK_ANALYSIS_JOB" - The job executed a Risk Analysis computation. +func (c *ProjectsDlpJobsListCall) Type(type_ string) *ProjectsDlpJobsListCall { + c.urlParams_.Set("type", type_) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsDeidentifyTemplatesPatchCall) Fields(s ...googleapi.Field) *ProjectsDeidentifyTemplatesPatchCall { +func (c *ProjectsDlpJobsListCall) Fields(s ...googleapi.Field) *ProjectsDlpJobsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an 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. +func (c *ProjectsDlpJobsListCall) IfNoneMatch(entityTag string) *ProjectsDlpJobsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *ProjectsDeidentifyTemplatesPatchCall) Context(ctx context.Context) *ProjectsDeidentifyTemplatesPatchCall { +func (c *ProjectsDlpJobsListCall) Context(ctx context.Context) *ProjectsDlpJobsListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsDeidentifyTemplatesPatchCall) Header() http.Header { +func (c *ProjectsDlpJobsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsDeidentifyTemplatesPatchCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatedeidentifytemplaterequest) - if err != nil { - return nil, err +func (c *ProjectsDlpJobsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/dlpJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parentid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.deidentifyTemplates.patch" call. +// Do executes the "dlp.projects.dlpJobs.list" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2DeidentifyTemplate.ServerResponse.Header or (if a +// *GooglePrivacyDlpV2ListDlpJobsResponse.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 *ProjectsDeidentifyTemplatesPatchCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DeidentifyTemplate, error) { +func (c *ProjectsDlpJobsListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListDlpJobsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17524,7 +18846,7 @@ func (c *ProjectsDeidentifyTemplatesPatchCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2DeidentifyTemplate{ + ret := &GooglePrivacyDlpV2ListDlpJobsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17537,64 +18859,93 @@ func (c *ProjectsDeidentifyTemplatesPatchCall) Do(opts ...googleapi.CallOption) return ret, nil } -type ProjectsDlpJobsCancelCall struct { - s *Service - name string - googleprivacydlpv2canceldlpjobrequest *GooglePrivacyDlpV2CancelDlpJobRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// 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 *ProjectsDlpJobsListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListDlpJobsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + 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) + } } -// Cancel: Starts asynchronous cancellation on a long-running DlpJob. The -// server makes a best effort to cancel the DlpJob, but success is not -// guaranteed. See -// https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage -// and -// https://cloud.google.com/sensitive-data-protection/docs/compute-risk-analysis -// to learn more. +type ProjectsImageRedactCall struct { + s *Service + parentid string + googleprivacydlpv2redactimagerequest *GooglePrivacyDlpV2RedactImageRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Redact: Redacts potentially sensitive info from an image. This method has +// limits on input size, processing time, and output size. See +// https://cloud.google.com/sensitive-data-protection/docs/redacting-sensitive-data-images +// to learn more. When no InfoTypes or CustomInfoTypes are specified in this +// request, the system will automatically choose what detectors to run. By +// default this may be all types, but may change over time as detectors are +// updated. // -// - name: The name of the DlpJob resource to be cancelled. -func (r *ProjectsDlpJobsService) Cancel(name string, googleprivacydlpv2canceldlpjobrequest *GooglePrivacyDlpV2CancelDlpJobRequest) *ProjectsDlpJobsCancelCall { - c := &ProjectsDlpJobsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.googleprivacydlpv2canceldlpjobrequest = googleprivacydlpv2canceldlpjobrequest +// - parent: Parent resource name. The format of this value varies depending on +// whether you have specified a processing location +// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: +// parent=projects/example-project/locations/europe-west3. +func (r *ProjectsImageService) Redact(parentid string, googleprivacydlpv2redactimagerequest *GooglePrivacyDlpV2RedactImageRequest) *ProjectsImageRedactCall { + c := &ProjectsImageRedactCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parentid = parentid + c.googleprivacydlpv2redactimagerequest = googleprivacydlpv2redactimagerequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsDlpJobsCancelCall) Fields(s ...googleapi.Field) *ProjectsDlpJobsCancelCall { +func (c *ProjectsImageRedactCall) Fields(s ...googleapi.Field) *ProjectsImageRedactCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsDlpJobsCancelCall) Context(ctx context.Context) *ProjectsDlpJobsCancelCall { +func (c *ProjectsImageRedactCall) Context(ctx context.Context) *ProjectsImageRedactCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsDlpJobsCancelCall) Header() http.Header { +func (c *ProjectsImageRedactCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsDlpJobsCancelCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsImageRedactCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2canceldlpjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2redactimagerequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:cancel") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/image:redact") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -17602,18 +18953,18 @@ func (c *ProjectsDlpJobsCancelCall) doRequest(alt string) (*http.Response, error } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parentid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.dlpJobs.cancel" call. +// Do executes the "dlp.projects.image.redact" call. // Any non-2xx status code is an error. Response headers are in either -// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsDlpJobsCancelCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { +// *GooglePrivacyDlpV2RedactImageResponse.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 *ProjectsImageRedactCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2RedactImageResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17632,7 +18983,7 @@ func (c *ProjectsDlpJobsCancelCall) Do(opts ...googleapi.CallOption) (*GooglePro if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleProtobufEmpty{ + ret := &GooglePrivacyDlpV2RedactImageResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17645,72 +18996,73 @@ func (c *ProjectsDlpJobsCancelCall) Do(opts ...googleapi.CallOption) (*GooglePro return ret, nil } -type ProjectsDlpJobsCreateCall struct { - s *Service - parentid string - googleprivacydlpv2createdlpjobrequest *GooglePrivacyDlpV2CreateDlpJobRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsInspectTemplatesCreateCall struct { + s *Service + parentid string + googleprivacydlpv2createinspecttemplaterequest *GooglePrivacyDlpV2CreateInspectTemplateRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a new job to inspect storage or calculate risk metrics. See -// https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage -// and -// https://cloud.google.com/sensitive-data-protection/docs/compute-risk-analysis -// to learn more. When no InfoTypes or CustomInfoTypes are specified in inspect -// jobs, the system will automatically choose what detectors to run. By default -// this may be all types, but may change over time as detectors are updated. +// Create: Creates an InspectTemplate for reusing frequently used configuration +// for inspecting content, images, and storage. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-templates +// to learn more. // // - parent: Parent resource name. The format of this value varies depending on -// whether you have specified a processing location +// the scope of the request (project or organization) and whether you have +// specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): // - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` // LOCATION_ID + Projects scope, no location specified (defaults to global): -// `projects/`PROJECT_ID The following example `parent` string specifies a -// parent project with the identifier `example-project`, and specifies the -// `europe-west3` location for processing data: +// `projects/`PROJECT_ID + Organizations scope, location specified: +// `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no +// location specified (defaults to global): `organizations/`ORG_ID The +// following example `parent` string specifies a parent project with the +// identifier `example-project`, and specifies the `europe-west3` location +// for processing data: // parent=projects/example-project/locations/europe-west3. -func (r *ProjectsDlpJobsService) Create(parentid string, googleprivacydlpv2createdlpjobrequest *GooglePrivacyDlpV2CreateDlpJobRequest) *ProjectsDlpJobsCreateCall { - c := &ProjectsDlpJobsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsInspectTemplatesService) Create(parentid string, googleprivacydlpv2createinspecttemplaterequest *GooglePrivacyDlpV2CreateInspectTemplateRequest) *ProjectsInspectTemplatesCreateCall { + c := &ProjectsInspectTemplatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parentid = parentid - c.googleprivacydlpv2createdlpjobrequest = googleprivacydlpv2createdlpjobrequest + c.googleprivacydlpv2createinspecttemplaterequest = googleprivacydlpv2createinspecttemplaterequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsDlpJobsCreateCall) Fields(s ...googleapi.Field) *ProjectsDlpJobsCreateCall { +func (c *ProjectsInspectTemplatesCreateCall) Fields(s ...googleapi.Field) *ProjectsInspectTemplatesCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsDlpJobsCreateCall) Context(ctx context.Context) *ProjectsDlpJobsCreateCall { +func (c *ProjectsInspectTemplatesCreateCall) Context(ctx context.Context) *ProjectsInspectTemplatesCreateCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsDlpJobsCreateCall) Header() http.Header { +func (c *ProjectsInspectTemplatesCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsDlpJobsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsInspectTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createdlpjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createinspecttemplaterequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/dlpJobs") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/inspectTemplates") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -17723,13 +19075,13 @@ func (c *ProjectsDlpJobsCreateCall) doRequest(alt string) (*http.Response, error return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.dlpJobs.create" call. +// Do executes the "dlp.projects.inspectTemplates.create" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2DlpJob.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// *GooglePrivacyDlpV2InspectTemplate.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 *ProjectsDlpJobsCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DlpJob, error) { +func (c *ProjectsInspectTemplatesCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2InspectTemplate, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17748,7 +19100,7 @@ func (c *ProjectsDlpJobsCreateCall) Do(opts ...googleapi.CallOption) (*GooglePri if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2DlpJob{ + ret := &GooglePrivacyDlpV2InspectTemplate{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17761,7 +19113,7 @@ func (c *ProjectsDlpJobsCreateCall) Do(opts ...googleapi.CallOption) (*GooglePri return ret, nil } -type ProjectsDlpJobsDeleteCall struct { +type ProjectsInspectTemplatesDeleteCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -17769,17 +19121,15 @@ type ProjectsDlpJobsDeleteCall struct { header_ http.Header } -// Delete: Deletes a long-running DlpJob. This method indicates that the client -// is no longer interested in the DlpJob result. The job will be canceled if -// possible. See -// https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage -// and -// https://cloud.google.com/sensitive-data-protection/docs/compute-risk-analysis +// Delete: Deletes an InspectTemplate. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-templates // to learn more. // -// - name: The name of the DlpJob resource to be deleted. -func (r *ProjectsDlpJobsService) Delete(name string) *ProjectsDlpJobsDeleteCall { - c := &ProjectsDlpJobsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Resource name of the organization and inspectTemplate to be deleted, +// for example `organizations/433245324/inspectTemplates/432452342` or +// projects/project-id/inspectTemplates/432452342. +func (r *ProjectsInspectTemplatesService) Delete(name string) *ProjectsInspectTemplatesDeleteCall { + c := &ProjectsInspectTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -17787,27 +19137,27 @@ func (r *ProjectsDlpJobsService) Delete(name string) *ProjectsDlpJobsDeleteCall // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsDlpJobsDeleteCall) Fields(s ...googleapi.Field) *ProjectsDlpJobsDeleteCall { +func (c *ProjectsInspectTemplatesDeleteCall) Fields(s ...googleapi.Field) *ProjectsInspectTemplatesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsDlpJobsDeleteCall) Context(ctx context.Context) *ProjectsDlpJobsDeleteCall { +func (c *ProjectsInspectTemplatesDeleteCall) Context(ctx context.Context) *ProjectsInspectTemplatesDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsDlpJobsDeleteCall) Header() http.Header { +func (c *ProjectsInspectTemplatesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsDlpJobsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsInspectTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil c.urlParams_.Set("alt", alt) @@ -17825,13 +19175,13 @@ func (c *ProjectsDlpJobsDeleteCall) doRequest(alt string) (*http.Response, error return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.dlpJobs.delete" call. +// Do executes the "dlp.projects.inspectTemplates.delete" call. // Any non-2xx status code is an error. Response headers are in either // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified was // returned. -func (c *ProjectsDlpJobsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { +func (c *ProjectsInspectTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17863,24 +19213,24 @@ func (c *ProjectsDlpJobsDeleteCall) Do(opts ...googleapi.CallOption) (*GooglePro return ret, nil } -type ProjectsDlpJobsGetCall struct { +type ProjectsInspectTemplatesGetCall struct { s *Service name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header -} - -// Get: Gets the latest state of a long-running DlpJob. See -// https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage -// and -// https://cloud.google.com/sensitive-data-protection/docs/compute-risk-analysis +} + +// Get: Gets an InspectTemplate. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-templates // to learn more. // -// - name: The name of the DlpJob resource. -func (r *ProjectsDlpJobsService) Get(name string) *ProjectsDlpJobsGetCall { - c := &ProjectsDlpJobsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Resource name of the organization and inspectTemplate to be read, +// for example `organizations/433245324/inspectTemplates/432452342` or +// projects/project-id/inspectTemplates/432452342. +func (r *ProjectsInspectTemplatesService) Get(name string) *ProjectsInspectTemplatesGetCall { + c := &ProjectsInspectTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -17888,7 +19238,7 @@ func (r *ProjectsDlpJobsService) Get(name string) *ProjectsDlpJobsGetCall { // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsDlpJobsGetCall) Fields(s ...googleapi.Field) *ProjectsDlpJobsGetCall { +func (c *ProjectsInspectTemplatesGetCall) Fields(s ...googleapi.Field) *ProjectsInspectTemplatesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -17896,27 +19246,27 @@ func (c *ProjectsDlpJobsGetCall) Fields(s ...googleapi.Field) *ProjectsDlpJobsGe // IfNoneMatch sets an 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. -func (c *ProjectsDlpJobsGetCall) IfNoneMatch(entityTag string) *ProjectsDlpJobsGetCall { +func (c *ProjectsInspectTemplatesGetCall) IfNoneMatch(entityTag string) *ProjectsInspectTemplatesGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsDlpJobsGetCall) Context(ctx context.Context) *ProjectsDlpJobsGetCall { +func (c *ProjectsInspectTemplatesGetCall) Context(ctx context.Context) *ProjectsInspectTemplatesGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsDlpJobsGetCall) Header() http.Header { +func (c *ProjectsInspectTemplatesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsDlpJobsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsInspectTemplatesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -17937,13 +19287,13 @@ func (c *ProjectsDlpJobsGetCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.dlpJobs.get" call. +// Do executes the "dlp.projects.inspectTemplates.get" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2DlpJob.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// *GooglePrivacyDlpV2InspectTemplate.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 *ProjectsDlpJobsGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DlpJob, error) { +func (c *ProjectsInspectTemplatesGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2InspectTemplate, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17962,7 +19312,7 @@ func (c *ProjectsDlpJobsGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivac if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2DlpJob{ + ret := &GooglePrivacyDlpV2InspectTemplate{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17975,7 +19325,7 @@ func (c *ProjectsDlpJobsGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivac return ret, nil } -type ProjectsDlpJobsListCall struct { +type ProjectsInspectTemplatesListCall struct { s *Service parentid string urlParams_ gensupport.URLParams @@ -17984,52 +19334,32 @@ type ProjectsDlpJobsListCall struct { header_ http.Header } -// List: Lists DlpJobs that match the specified filter in the request. See -// https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage -// and -// https://cloud.google.com/sensitive-data-protection/docs/compute-risk-analysis +// List: Lists InspectTemplates. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-templates // to learn more. // // - parent: Parent resource name. The format of this value varies depending on -// whether you have specified a processing location +// the scope of the request (project or organization) and whether you have +// specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): // - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` // LOCATION_ID + Projects scope, no location specified (defaults to global): -// `projects/`PROJECT_ID The following example `parent` string specifies a -// parent project with the identifier `example-project`, and specifies the -// `europe-west3` location for processing data: +// `projects/`PROJECT_ID + Organizations scope, location specified: +// `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no +// location specified (defaults to global): `organizations/`ORG_ID The +// following example `parent` string specifies a parent project with the +// identifier `example-project`, and specifies the `europe-west3` location +// for processing data: // parent=projects/example-project/locations/europe-west3. -func (r *ProjectsDlpJobsService) List(parentid string) *ProjectsDlpJobsListCall { - c := &ProjectsDlpJobsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsInspectTemplatesService) List(parentid string) *ProjectsInspectTemplatesListCall { + c := &ProjectsInspectTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parentid = parentid return c } -// Filter sets the optional parameter "filter": Allows filtering. Supported -// syntax: * Filter expressions are made up of one or more restrictions. * -// Restrictions can be combined by `AND` or `OR` logical operators. A sequence -// of restrictions implicitly uses `AND`. * A restriction has the form of -// `{field} {operator} {value}`. * Supported fields/values for inspect jobs: - -// `state` - PENDING|RUNNING|CANCELED|FINISHED|FAILED - `inspected_storage` - -// DATASTORE|CLOUD_STORAGE|BIGQUERY - `trigger_name` - The name of the trigger -// that created the job. - 'end_time` - Corresponds to the time the job -// finished. - 'start_time` - Corresponds to the time the job finished. * -// Supported fields for risk analysis jobs: - `state` - -// RUNNING|CANCELED|FINISHED|FAILED - 'end_time` - Corresponds to the time the -// job finished. - 'start_time` - Corresponds to the time the job finished. * -// The operator must be `=` or `!=`. Examples: * inspected_storage = -// cloud_storage AND state = done * inspected_storage = cloud_storage OR -// inspected_storage = bigquery * inspected_storage = cloud_storage AND (state -// = done OR state = canceled) * end_time > \"2017-12-12T00:00:00+00:00\" The -// length of this field should be no more than 500 characters. -func (c *ProjectsDlpJobsListCall) Filter(filter string) *ProjectsDlpJobsListCall { - c.urlParams_.Set("filter", filter) - return c -} - // LocationId sets the optional parameter "locationId": Deprecated. This field // has no effect. -func (c *ProjectsDlpJobsListCall) LocationId(locationId string) *ProjectsDlpJobsListCall { +func (c *ProjectsInspectTemplatesListCall) LocationId(locationId string) *ProjectsInspectTemplatesListCall { c.urlParams_.Set("locationId", locationId) return c } @@ -18037,46 +19367,35 @@ func (c *ProjectsDlpJobsListCall) LocationId(locationId string) *ProjectsDlpJobs // OrderBy sets the optional parameter "orderBy": Comma separated list of // fields to order by, followed by `asc` or `desc` postfix. This list is case // insensitive. The default sorting order is ascending. Redundant space -// characters are insignificant. Example: `name asc, end_time asc, create_time -// desc` Supported fields are: - `create_time`: corresponds to the time the job -// was created. - `end_time`: corresponds to the time the job ended. - `name`: -// corresponds to the job's name. - `state`: corresponds to `state` -func (c *ProjectsDlpJobsListCall) OrderBy(orderBy string) *ProjectsDlpJobsListCall { +// characters are insignificant. Example: `name asc,update_time, create_time +// desc` Supported fields are: - `create_time`: corresponds to the time the +// template was created. - `update_time`: corresponds to the time the template +// was last updated. - `name`: corresponds to the template's name. - +// `display_name`: corresponds to the template's display name. +func (c *ProjectsInspectTemplatesListCall) OrderBy(orderBy string) *ProjectsInspectTemplatesListCall { c.urlParams_.Set("orderBy", orderBy) return c } -// PageSize sets the optional parameter "pageSize": The standard list page -// size. -func (c *ProjectsDlpJobsListCall) PageSize(pageSize int64) *ProjectsDlpJobsListCall { +// PageSize sets the optional parameter "pageSize": Size of the page. This +// value can be limited by the server. If zero server returns a page of max +// size 100. +func (c *ProjectsInspectTemplatesListCall) PageSize(pageSize int64) *ProjectsInspectTemplatesListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// PageToken sets the optional parameter "pageToken": The standard list page -// token. -func (c *ProjectsDlpJobsListCall) PageToken(pageToken string) *ProjectsDlpJobsListCall { +// PageToken sets the optional parameter "pageToken": Page token to continue +// retrieval. Comes from the previous call to `ListInspectTemplates`. +func (c *ProjectsInspectTemplatesListCall) PageToken(pageToken string) *ProjectsInspectTemplatesListCall { c.urlParams_.Set("pageToken", pageToken) return c } -// Type sets the optional parameter "type": The type of job. Defaults to -// `DlpJobType.INSPECT` -// -// Possible values: -// -// "DLP_JOB_TYPE_UNSPECIFIED" - Defaults to INSPECT_JOB. -// "INSPECT_JOB" - The job inspected Google Cloud for sensitive data. -// "RISK_ANALYSIS_JOB" - The job executed a Risk Analysis computation. -func (c *ProjectsDlpJobsListCall) Type(type_ string) *ProjectsDlpJobsListCall { - c.urlParams_.Set("type", type_) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsDlpJobsListCall) Fields(s ...googleapi.Field) *ProjectsDlpJobsListCall { +func (c *ProjectsInspectTemplatesListCall) Fields(s ...googleapi.Field) *ProjectsInspectTemplatesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -18084,27 +19403,27 @@ func (c *ProjectsDlpJobsListCall) Fields(s ...googleapi.Field) *ProjectsDlpJobsL // IfNoneMatch sets an 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. -func (c *ProjectsDlpJobsListCall) IfNoneMatch(entityTag string) *ProjectsDlpJobsListCall { +func (c *ProjectsInspectTemplatesListCall) IfNoneMatch(entityTag string) *ProjectsInspectTemplatesListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsDlpJobsListCall) Context(ctx context.Context) *ProjectsDlpJobsListCall { +func (c *ProjectsInspectTemplatesListCall) Context(ctx context.Context) *ProjectsInspectTemplatesListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsDlpJobsListCall) Header() http.Header { +func (c *ProjectsInspectTemplatesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsDlpJobsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsInspectTemplatesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -18112,7 +19431,7 @@ func (c *ProjectsDlpJobsListCall) doRequest(alt string) (*http.Response, error) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/dlpJobs") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/inspectTemplates") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -18125,13 +19444,13 @@ func (c *ProjectsDlpJobsListCall) doRequest(alt string) (*http.Response, error) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.dlpJobs.list" call. +// Do executes the "dlp.projects.inspectTemplates.list" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2ListDlpJobsResponse.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use +// *GooglePrivacyDlpV2ListInspectTemplatesResponse.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 *ProjectsDlpJobsListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListDlpJobsResponse, error) { +func (c *ProjectsInspectTemplatesListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListInspectTemplatesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18150,7 +19469,7 @@ func (c *ProjectsDlpJobsListCall) Do(opts ...googleapi.CallOption) (*GooglePriva if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2ListDlpJobsResponse{ + ret := &GooglePrivacyDlpV2ListInspectTemplatesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18166,7 +19485,7 @@ func (c *ProjectsDlpJobsListCall) Do(opts ...googleapi.CallOption) (*GooglePriva // 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 *ProjectsDlpJobsListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListDlpJobsResponse) error) error { +func (c *ProjectsInspectTemplatesListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListInspectTemplatesResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { @@ -18184,208 +19503,81 @@ func (c *ProjectsDlpJobsListCall) Pages(ctx context.Context, f func(*GooglePriva } } -type ProjectsImageRedactCall struct { - s *Service - parentid string - googleprivacydlpv2redactimagerequest *GooglePrivacyDlpV2RedactImageRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Redact: Redacts potentially sensitive info from an image. This method has -// limits on input size, processing time, and output size. See -// https://cloud.google.com/sensitive-data-protection/docs/redacting-sensitive-data-images -// to learn more. When no InfoTypes or CustomInfoTypes are specified in this -// request, the system will automatically choose what detectors to run. By -// default this may be all types, but may change over time as detectors are -// updated. -// -// - parent: Parent resource name. The format of this value varies depending on -// whether you have specified a processing location -// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` -// LOCATION_ID + Projects scope, no location specified (defaults to global): -// `projects/`PROJECT_ID The following example `parent` string specifies a -// parent project with the identifier `example-project`, and specifies the -// `europe-west3` location for processing data: -// parent=projects/example-project/locations/europe-west3. -func (r *ProjectsImageService) Redact(parentid string, googleprivacydlpv2redactimagerequest *GooglePrivacyDlpV2RedactImageRequest) *ProjectsImageRedactCall { - c := &ProjectsImageRedactCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parentid = parentid - c.googleprivacydlpv2redactimagerequest = googleprivacydlpv2redactimagerequest - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *ProjectsImageRedactCall) Fields(s ...googleapi.Field) *ProjectsImageRedactCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *ProjectsImageRedactCall) Context(ctx context.Context) *ProjectsImageRedactCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *ProjectsImageRedactCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ProjectsImageRedactCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2redactimagerequest) - if err != nil { - return nil, err - } - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/image:redact") - 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.parentid, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "dlp.projects.image.redact" call. -// Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2RedactImageResponse.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 *ProjectsImageRedactCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2RedactImageResponse, 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 := &GooglePrivacyDlpV2RedactImageResponse{ - 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 -} - -type ProjectsInspectTemplatesCreateCall struct { +type ProjectsInspectTemplatesPatchCall struct { s *Service - parentid string - googleprivacydlpv2createinspecttemplaterequest *GooglePrivacyDlpV2CreateInspectTemplateRequest + name string + googleprivacydlpv2updateinspecttemplaterequest *GooglePrivacyDlpV2UpdateInspectTemplateRequest urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Create: Creates an InspectTemplate for reusing frequently used configuration -// for inspecting content, images, and storage. See +// Patch: Updates the InspectTemplate. See // https://cloud.google.com/sensitive-data-protection/docs/creating-templates // to learn more. // -// - parent: Parent resource name. The format of this value varies depending on -// the scope of the request (project or organization) and whether you have -// specified a processing location -// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` -// LOCATION_ID + Projects scope, no location specified (defaults to global): -// `projects/`PROJECT_ID + Organizations scope, location specified: -// `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no -// location specified (defaults to global): `organizations/`ORG_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: -// parent=projects/example-project/locations/europe-west3. -func (r *ProjectsInspectTemplatesService) Create(parentid string, googleprivacydlpv2createinspecttemplaterequest *GooglePrivacyDlpV2CreateInspectTemplateRequest) *ProjectsInspectTemplatesCreateCall { - c := &ProjectsInspectTemplatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parentid = parentid - c.googleprivacydlpv2createinspecttemplaterequest = googleprivacydlpv2createinspecttemplaterequest +// - name: Resource name of organization and inspectTemplate to be updated, for +// example `organizations/433245324/inspectTemplates/432452342` or +// projects/project-id/inspectTemplates/432452342. +func (r *ProjectsInspectTemplatesService) Patch(name string, googleprivacydlpv2updateinspecttemplaterequest *GooglePrivacyDlpV2UpdateInspectTemplateRequest) *ProjectsInspectTemplatesPatchCall { + c := &ProjectsInspectTemplatesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googleprivacydlpv2updateinspecttemplaterequest = googleprivacydlpv2updateinspecttemplaterequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsInspectTemplatesCreateCall) Fields(s ...googleapi.Field) *ProjectsInspectTemplatesCreateCall { +func (c *ProjectsInspectTemplatesPatchCall) Fields(s ...googleapi.Field) *ProjectsInspectTemplatesPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsInspectTemplatesCreateCall) Context(ctx context.Context) *ProjectsInspectTemplatesCreateCall { +func (c *ProjectsInspectTemplatesPatchCall) Context(ctx context.Context) *ProjectsInspectTemplatesPatchCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsInspectTemplatesCreateCall) Header() http.Header { +func (c *ProjectsInspectTemplatesPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsInspectTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsInspectTemplatesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createinspecttemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updateinspecttemplaterequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/inspectTemplates") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parentid, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.inspectTemplates.create" call. +// Do executes the "dlp.projects.inspectTemplates.patch" call. // Any non-2xx status code is an error. Response headers are in either // *GooglePrivacyDlpV2InspectTemplate.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 *ProjectsInspectTemplatesCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2InspectTemplate, error) { +func (c *ProjectsInspectTemplatesPatchCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2InspectTemplate, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18417,58 +19609,62 @@ func (c *ProjectsInspectTemplatesCreateCall) Do(opts ...googleapi.CallOption) (* return ret, nil } -type ProjectsInspectTemplatesDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsJobTriggersActivateCall struct { + s *Service + name string + googleprivacydlpv2activatejobtriggerrequest *GooglePrivacyDlpV2ActivateJobTriggerRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes an InspectTemplate. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-templates -// to learn more. +// Activate: Activate a job trigger. Causes the immediate execute of a trigger +// instead of waiting on the trigger event to occur. // -// - name: Resource name of the organization and inspectTemplate to be deleted, -// for example `organizations/433245324/inspectTemplates/432452342` or -// projects/project-id/inspectTemplates/432452342. -func (r *ProjectsInspectTemplatesService) Delete(name string) *ProjectsInspectTemplatesDeleteCall { - c := &ProjectsInspectTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Resource name of the trigger to activate, for example +// `projects/dlp-test-project/jobTriggers/53234423`. +func (r *ProjectsJobTriggersService) Activate(name string, googleprivacydlpv2activatejobtriggerrequest *GooglePrivacyDlpV2ActivateJobTriggerRequest) *ProjectsJobTriggersActivateCall { + c := &ProjectsJobTriggersActivateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.googleprivacydlpv2activatejobtriggerrequest = googleprivacydlpv2activatejobtriggerrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsInspectTemplatesDeleteCall) Fields(s ...googleapi.Field) *ProjectsInspectTemplatesDeleteCall { +func (c *ProjectsJobTriggersActivateCall) Fields(s ...googleapi.Field) *ProjectsJobTriggersActivateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsInspectTemplatesDeleteCall) Context(ctx context.Context) *ProjectsInspectTemplatesDeleteCall { +func (c *ProjectsJobTriggersActivateCall) Context(ctx context.Context) *ProjectsJobTriggersActivateCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsInspectTemplatesDeleteCall) Header() http.Header { +func (c *ProjectsJobTriggersActivateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsInspectTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *ProjectsJobTriggersActivateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2activatejobtriggerrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:activate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -18479,13 +19675,13 @@ func (c *ProjectsInspectTemplatesDeleteCall) doRequest(alt string) (*http.Respon return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.inspectTemplates.delete" call. +// Do executes the "dlp.projects.jobTriggers.activate" call. // Any non-2xx status code is an error. Response headers are in either -// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsInspectTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { +// *GooglePrivacyDlpV2DlpJob.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 *ProjectsJobTriggersActivateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DlpJob, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18504,7 +19700,7 @@ func (c *ProjectsInspectTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleProtobufEmpty{ + ret := &GooglePrivacyDlpV2DlpJob{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18517,87 +19713,88 @@ func (c *ProjectsInspectTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (* return ret, nil } -type ProjectsInspectTemplatesGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsJobTriggersCreateCall struct { + s *Service + parentid string + googleprivacydlpv2createjobtriggerrequest *GooglePrivacyDlpV2CreateJobTriggerRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets an InspectTemplate. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-templates +// Create: Creates a job trigger to run DLP actions such as scanning storage +// for sensitive information on a set schedule. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-job-triggers // to learn more. // -// - name: Resource name of the organization and inspectTemplate to be read, -// for example `organizations/433245324/inspectTemplates/432452342` or -// projects/project-id/inspectTemplates/432452342. -func (r *ProjectsInspectTemplatesService) Get(name string) *ProjectsInspectTemplatesGetCall { - c := &ProjectsInspectTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: Parent resource name. The format of this value varies depending on +// whether you have specified a processing location +// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: +// parent=projects/example-project/locations/europe-west3. +func (r *ProjectsJobTriggersService) Create(parentid string, googleprivacydlpv2createjobtriggerrequest *GooglePrivacyDlpV2CreateJobTriggerRequest) *ProjectsJobTriggersCreateCall { + c := &ProjectsJobTriggersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parentid = parentid + c.googleprivacydlpv2createjobtriggerrequest = googleprivacydlpv2createjobtriggerrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsInspectTemplatesGetCall) Fields(s ...googleapi.Field) *ProjectsInspectTemplatesGetCall { +func (c *ProjectsJobTriggersCreateCall) Fields(s ...googleapi.Field) *ProjectsJobTriggersCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an 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. -func (c *ProjectsInspectTemplatesGetCall) IfNoneMatch(entityTag string) *ProjectsInspectTemplatesGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *ProjectsInspectTemplatesGetCall) Context(ctx context.Context) *ProjectsInspectTemplatesGetCall { +func (c *ProjectsJobTriggersCreateCall) Context(ctx context.Context) *ProjectsJobTriggersCreateCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsInspectTemplatesGetCall) Header() http.Header { +func (c *ProjectsJobTriggersCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsInspectTemplatesGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *ProjectsJobTriggersCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createjobtriggerrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/jobTriggers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parentid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.inspectTemplates.get" call. +// Do executes the "dlp.projects.jobTriggers.create" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2InspectTemplate.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use +// *GooglePrivacyDlpV2JobTrigger.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 *ProjectsInspectTemplatesGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2InspectTemplate, error) { +func (c *ProjectsJobTriggersCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2JobTrigger, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18614,147 +19811,89 @@ func (c *ProjectsInspectTemplatesGetCall) Do(opts ...googleapi.CallOption) (*Goo } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &GooglePrivacyDlpV2InspectTemplate{ - 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 -} - -type ProjectsInspectTemplatesListCall struct { - s *Service - parentid string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// List: Lists InspectTemplates. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-templates -// to learn more. -// -// - parent: Parent resource name. The format of this value varies depending on -// the scope of the request (project or organization) and whether you have -// specified a processing location -// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` -// LOCATION_ID + Projects scope, no location specified (defaults to global): -// `projects/`PROJECT_ID + Organizations scope, location specified: -// `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no -// location specified (defaults to global): `organizations/`ORG_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: -// parent=projects/example-project/locations/europe-west3. -func (r *ProjectsInspectTemplatesService) List(parentid string) *ProjectsInspectTemplatesListCall { - c := &ProjectsInspectTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parentid = parentid - return c -} - -// LocationId sets the optional parameter "locationId": Deprecated. This field -// has no effect. -func (c *ProjectsInspectTemplatesListCall) LocationId(locationId string) *ProjectsInspectTemplatesListCall { - c.urlParams_.Set("locationId", locationId) - return c -} - -// OrderBy sets the optional parameter "orderBy": Comma separated list of -// fields to order by, followed by `asc` or `desc` postfix. This list is case -// insensitive. The default sorting order is ascending. Redundant space -// characters are insignificant. Example: `name asc,update_time, create_time -// desc` Supported fields are: - `create_time`: corresponds to the time the -// template was created. - `update_time`: corresponds to the time the template -// was last updated. - `name`: corresponds to the template's name. - -// `display_name`: corresponds to the template's display name. -func (c *ProjectsInspectTemplatesListCall) OrderBy(orderBy string) *ProjectsInspectTemplatesListCall { - c.urlParams_.Set("orderBy", orderBy) - return c + return nil, gensupport.WrapError(err) + } + ret := &GooglePrivacyDlpV2JobTrigger{ + 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 } -// PageSize sets the optional parameter "pageSize": Size of the page. This -// value can be limited by the server. If zero server returns a page of max -// size 100. -func (c *ProjectsInspectTemplatesListCall) PageSize(pageSize int64) *ProjectsInspectTemplatesListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c +type ProjectsJobTriggersDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// PageToken sets the optional parameter "pageToken": Page token to continue -// retrieval. Comes from the previous call to `ListInspectTemplates`. -func (c *ProjectsInspectTemplatesListCall) PageToken(pageToken string) *ProjectsInspectTemplatesListCall { - c.urlParams_.Set("pageToken", pageToken) +// Delete: Deletes a job trigger. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-job-triggers +// to learn more. +// +// - name: Resource name of the project and the triggeredJob, for example +// `projects/dlp-test-project/jobTriggers/53234423`. +func (r *ProjectsJobTriggersService) Delete(name string) *ProjectsJobTriggersDeleteCall { + c := &ProjectsJobTriggersDeleteCall{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 // details. -func (c *ProjectsInspectTemplatesListCall) Fields(s ...googleapi.Field) *ProjectsInspectTemplatesListCall { +func (c *ProjectsJobTriggersDeleteCall) Fields(s ...googleapi.Field) *ProjectsJobTriggersDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an 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. -func (c *ProjectsInspectTemplatesListCall) IfNoneMatch(entityTag string) *ProjectsInspectTemplatesListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *ProjectsInspectTemplatesListCall) Context(ctx context.Context) *ProjectsInspectTemplatesListCall { +func (c *ProjectsJobTriggersDeleteCall) Context(ctx context.Context) *ProjectsJobTriggersDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsInspectTemplatesListCall) Header() http.Header { +func (c *ProjectsJobTriggersDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsInspectTemplatesListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsJobTriggersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - 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, "v2/{+parent}/inspectTemplates") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parentid, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.inspectTemplates.list" call. +// Do executes the "dlp.projects.jobTriggers.delete" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2ListInspectTemplatesResponse.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 *ProjectsInspectTemplatesListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListInspectTemplatesResponse, error) { +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsJobTriggersDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18773,7 +19912,7 @@ func (c *ProjectsInspectTemplatesListCall) Do(opts ...googleapi.CallOption) (*Go if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2ListInspectTemplatesResponse{ + ret := &GoogleProtobufEmpty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18786,85 +19925,69 @@ func (c *ProjectsInspectTemplatesListCall) Do(opts ...googleapi.CallOption) (*Go return ret, nil } -// 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 *ProjectsInspectTemplatesListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListInspectTemplatesResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type ProjectsInspectTemplatesPatchCall struct { - s *Service - name string - googleprivacydlpv2updateinspecttemplaterequest *GooglePrivacyDlpV2UpdateInspectTemplateRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsJobTriggersGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Updates the InspectTemplate. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-templates +// Get: Gets a job trigger. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-job-triggers // to learn more. // -// - name: Resource name of organization and inspectTemplate to be updated, for -// example `organizations/433245324/inspectTemplates/432452342` or -// projects/project-id/inspectTemplates/432452342. -func (r *ProjectsInspectTemplatesService) Patch(name string, googleprivacydlpv2updateinspecttemplaterequest *GooglePrivacyDlpV2UpdateInspectTemplateRequest) *ProjectsInspectTemplatesPatchCall { - c := &ProjectsInspectTemplatesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Resource name of the project and the triggeredJob, for example +// `projects/dlp-test-project/jobTriggers/53234423`. +func (r *ProjectsJobTriggersService) Get(name string) *ProjectsJobTriggersGetCall { + c := &ProjectsJobTriggersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googleprivacydlpv2updateinspecttemplaterequest = googleprivacydlpv2updateinspecttemplaterequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsInspectTemplatesPatchCall) Fields(s ...googleapi.Field) *ProjectsInspectTemplatesPatchCall { +func (c *ProjectsJobTriggersGetCall) Fields(s ...googleapi.Field) *ProjectsJobTriggersGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an 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. +func (c *ProjectsJobTriggersGetCall) IfNoneMatch(entityTag string) *ProjectsJobTriggersGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *ProjectsInspectTemplatesPatchCall) Context(ctx context.Context) *ProjectsInspectTemplatesPatchCall { +func (c *ProjectsJobTriggersGetCall) Context(ctx context.Context) *ProjectsJobTriggersGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsInspectTemplatesPatchCall) Header() http.Header { +func (c *ProjectsJobTriggersGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsInspectTemplatesPatchCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updateinspecttemplaterequest) - if err != nil { - return nil, err +func (c *ProjectsJobTriggersGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -18875,13 +19998,13 @@ func (c *ProjectsInspectTemplatesPatchCall) doRequest(alt string) (*http.Respons return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.inspectTemplates.patch" call. +// Do executes the "dlp.projects.jobTriggers.get" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2InspectTemplate.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use +// *GooglePrivacyDlpV2JobTrigger.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 *ProjectsInspectTemplatesPatchCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2InspectTemplate, error) { +func (c *ProjectsJobTriggersGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2JobTrigger, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18900,7 +20023,7 @@ func (c *ProjectsInspectTemplatesPatchCall) Do(opts ...googleapi.CallOption) (*G if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2InspectTemplate{ + ret := &GooglePrivacyDlpV2JobTrigger{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18913,79 +20036,163 @@ func (c *ProjectsInspectTemplatesPatchCall) Do(opts ...googleapi.CallOption) (*G return ret, nil } -type ProjectsJobTriggersActivateCall struct { - s *Service - name string - googleprivacydlpv2activatejobtriggerrequest *GooglePrivacyDlpV2ActivateJobTriggerRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsJobTriggersListCall struct { + s *Service + parentid string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Activate: Activate a job trigger. Causes the immediate execute of a trigger -// instead of waiting on the trigger event to occur. +// List: Lists job triggers. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-job-triggers +// to learn more. +// +// - parent: Parent resource name. The format of this value varies depending on +// whether you have specified a processing location +// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: +// parent=projects/example-project/locations/europe-west3. +func (r *ProjectsJobTriggersService) List(parentid string) *ProjectsJobTriggersListCall { + c := &ProjectsJobTriggersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parentid = parentid + return c +} + +// Filter sets the optional parameter "filter": Allows filtering. Supported +// syntax: * Filter expressions are made up of one or more restrictions. * +// Restrictions can be combined by `AND` or `OR` logical operators. A sequence +// of restrictions implicitly uses `AND`. * A restriction has the form of +// `{field} {operator} {value}`. * Supported fields/values for inspect +// triggers: - `status` - HEALTHY|PAUSED|CANCELLED - `inspected_storage` - +// DATASTORE|CLOUD_STORAGE|BIGQUERY - 'last_run_time` - RFC 3339 formatted +// timestamp, surrounded by quotation marks. Nanoseconds are ignored. - +// 'error_count' - Number of errors that have occurred while running. * The +// operator must be `=` or `!=` for status and inspected_storage. Examples: * +// inspected_storage = cloud_storage AND status = HEALTHY * inspected_storage = +// cloud_storage OR inspected_storage = bigquery * inspected_storage = +// cloud_storage AND (state = PAUSED OR state = HEALTHY) * last_run_time > +// \"2017-12-12T00:00:00+00:00\" The length of this field should be no more +// than 500 characters. +func (c *ProjectsJobTriggersListCall) Filter(filter string) *ProjectsJobTriggersListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// LocationId sets the optional parameter "locationId": Deprecated. This field +// has no effect. +func (c *ProjectsJobTriggersListCall) LocationId(locationId string) *ProjectsJobTriggersListCall { + c.urlParams_.Set("locationId", locationId) + return c +} + +// OrderBy sets the optional parameter "orderBy": Comma separated list of +// triggeredJob fields to order by, followed by `asc` or `desc` postfix. This +// list is case insensitive. The default sorting order is ascending. Redundant +// space characters are insignificant. Example: `name asc,update_time, +// create_time desc` Supported fields are: - `create_time`: corresponds to the +// time the JobTrigger was created. - `update_time`: corresponds to the time +// the JobTrigger was last updated. - `last_run_time`: corresponds to the last +// time the JobTrigger ran. - `name`: corresponds to the JobTrigger's name. - +// `display_name`: corresponds to the JobTrigger's display name. - `status`: +// corresponds to JobTrigger's status. +func (c *ProjectsJobTriggersListCall) OrderBy(orderBy string) *ProjectsJobTriggersListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageSize sets the optional parameter "pageSize": Size of the page. This +// value can be limited by a server. +func (c *ProjectsJobTriggersListCall) PageSize(pageSize int64) *ProjectsJobTriggersListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": Page token to continue +// retrieval. Comes from the previous call to ListJobTriggers. `order_by` field +// must not change for subsequent calls. +func (c *ProjectsJobTriggersListCall) PageToken(pageToken string) *ProjectsJobTriggersListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Type sets the optional parameter "type": The type of jobs. Will use +// `DlpJobType.INSPECT` if not set. // -// - name: Resource name of the trigger to activate, for example -// `projects/dlp-test-project/jobTriggers/53234423`. -func (r *ProjectsJobTriggersService) Activate(name string, googleprivacydlpv2activatejobtriggerrequest *GooglePrivacyDlpV2ActivateJobTriggerRequest) *ProjectsJobTriggersActivateCall { - c := &ProjectsJobTriggersActivateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.googleprivacydlpv2activatejobtriggerrequest = googleprivacydlpv2activatejobtriggerrequest +// Possible values: +// +// "DLP_JOB_TYPE_UNSPECIFIED" - Defaults to INSPECT_JOB. +// "INSPECT_JOB" - The job inspected Google Cloud for sensitive data. +// "RISK_ANALYSIS_JOB" - The job executed a Risk Analysis computation. +func (c *ProjectsJobTriggersListCall) Type(type_ string) *ProjectsJobTriggersListCall { + c.urlParams_.Set("type", type_) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsJobTriggersActivateCall) Fields(s ...googleapi.Field) *ProjectsJobTriggersActivateCall { +func (c *ProjectsJobTriggersListCall) Fields(s ...googleapi.Field) *ProjectsJobTriggersListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an 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. +func (c *ProjectsJobTriggersListCall) IfNoneMatch(entityTag string) *ProjectsJobTriggersListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *ProjectsJobTriggersActivateCall) Context(ctx context.Context) *ProjectsJobTriggersActivateCall { +func (c *ProjectsJobTriggersListCall) Context(ctx context.Context) *ProjectsJobTriggersListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsJobTriggersActivateCall) Header() http.Header { +func (c *ProjectsJobTriggersListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsJobTriggersActivateCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2activatejobtriggerrequest) - if err != nil { - return nil, err +func (c *ProjectsJobTriggersListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "v2/{+name}:activate") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/jobTriggers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parentid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.jobTriggers.activate" call. +// Do executes the "dlp.projects.jobTriggers.list" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2DlpJob.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// *GooglePrivacyDlpV2ListJobTriggersResponse.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 *ProjectsJobTriggersActivateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DlpJob, error) { +func (c *ProjectsJobTriggersListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListJobTriggersResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19004,7 +20211,7 @@ func (c *ProjectsJobTriggersActivateCall) Do(opts ...googleapi.CallOption) (*Goo if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2DlpJob{ + ret := &GooglePrivacyDlpV2ListJobTriggersResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19017,88 +20224,101 @@ func (c *ProjectsJobTriggersActivateCall) Do(opts ...googleapi.CallOption) (*Goo return ret, nil } -type ProjectsJobTriggersCreateCall struct { +// 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 *ProjectsJobTriggersListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListJobTriggersResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type ProjectsJobTriggersPatchCall struct { s *Service - parentid string - googleprivacydlpv2createjobtriggerrequest *GooglePrivacyDlpV2CreateJobTriggerRequest + name string + googleprivacydlpv2updatejobtriggerrequest *GooglePrivacyDlpV2UpdateJobTriggerRequest urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Create: Creates a job trigger to run DLP actions such as scanning storage -// for sensitive information on a set schedule. See +// Patch: Updates a job trigger. See // https://cloud.google.com/sensitive-data-protection/docs/creating-job-triggers // to learn more. // -// - parent: Parent resource name. The format of this value varies depending on -// whether you have specified a processing location -// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` -// LOCATION_ID + Projects scope, no location specified (defaults to global): -// `projects/`PROJECT_ID The following example `parent` string specifies a -// parent project with the identifier `example-project`, and specifies the -// `europe-west3` location for processing data: -// parent=projects/example-project/locations/europe-west3. -func (r *ProjectsJobTriggersService) Create(parentid string, googleprivacydlpv2createjobtriggerrequest *GooglePrivacyDlpV2CreateJobTriggerRequest) *ProjectsJobTriggersCreateCall { - c := &ProjectsJobTriggersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parentid = parentid - c.googleprivacydlpv2createjobtriggerrequest = googleprivacydlpv2createjobtriggerrequest +// - name: Resource name of the project and the triggeredJob, for example +// `projects/dlp-test-project/jobTriggers/53234423`. +func (r *ProjectsJobTriggersService) Patch(name string, googleprivacydlpv2updatejobtriggerrequest *GooglePrivacyDlpV2UpdateJobTriggerRequest) *ProjectsJobTriggersPatchCall { + c := &ProjectsJobTriggersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googleprivacydlpv2updatejobtriggerrequest = googleprivacydlpv2updatejobtriggerrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsJobTriggersCreateCall) Fields(s ...googleapi.Field) *ProjectsJobTriggersCreateCall { +func (c *ProjectsJobTriggersPatchCall) Fields(s ...googleapi.Field) *ProjectsJobTriggersPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsJobTriggersCreateCall) Context(ctx context.Context) *ProjectsJobTriggersCreateCall { +func (c *ProjectsJobTriggersPatchCall) Context(ctx context.Context) *ProjectsJobTriggersPatchCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsJobTriggersCreateCall) Header() http.Header { +func (c *ProjectsJobTriggersPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsJobTriggersCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsJobTriggersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createjobtriggerrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatejobtriggerrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/jobTriggers") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parentid, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.jobTriggers.create" call. +// Do executes the "dlp.projects.jobTriggers.patch" call. // Any non-2xx status code is an error. Response headers are in either // *GooglePrivacyDlpV2JobTrigger.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 *ProjectsJobTriggersCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2JobTrigger, error) { +func (c *ProjectsJobTriggersPatchCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2JobTrigger, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19130,22 +20350,21 @@ func (c *ProjectsJobTriggersCreateCall) Do(opts ...googleapi.CallOption) (*Googl return ret, nil } -type ProjectsJobTriggersDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsColumnDataProfilesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a job trigger. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-job-triggers -// to learn more. +// Get: Gets a column data profile. // -// - name: Resource name of the project and the triggeredJob, for example -// `projects/dlp-test-project/jobTriggers/53234423`. -func (r *ProjectsJobTriggersService) Delete(name string) *ProjectsJobTriggersDeleteCall { - c := &ProjectsJobTriggersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Resource name, for example +// `organizations/12345/locations/us/columnDataProfiles/53234423`. +func (r *ProjectsLocationsColumnDataProfilesService) Get(name string) *ProjectsLocationsColumnDataProfilesGetCall { + c := &ProjectsLocationsColumnDataProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -19153,34 +20372,45 @@ func (r *ProjectsJobTriggersService) Delete(name string) *ProjectsJobTriggersDel // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsJobTriggersDeleteCall) Fields(s ...googleapi.Field) *ProjectsJobTriggersDeleteCall { +func (c *ProjectsLocationsColumnDataProfilesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsColumnDataProfilesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an 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. +func (c *ProjectsLocationsColumnDataProfilesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsColumnDataProfilesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *ProjectsJobTriggersDeleteCall) Context(ctx context.Context) *ProjectsJobTriggersDeleteCall { +func (c *ProjectsLocationsColumnDataProfilesGetCall) Context(ctx context.Context) *ProjectsLocationsColumnDataProfilesGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsJobTriggersDeleteCall) Header() http.Header { +func (c *ProjectsLocationsColumnDataProfilesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsJobTriggersDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsColumnDataProfilesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -19191,13 +20421,13 @@ func (c *ProjectsJobTriggersDeleteCall) doRequest(alt string) (*http.Response, e return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.jobTriggers.delete" call. +// Do executes the "dlp.projects.locations.columnDataProfiles.get" call. // Any non-2xx status code is an error. Response headers are in either -// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsJobTriggersDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { +// *GooglePrivacyDlpV2ColumnDataProfile.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 *ProjectsLocationsColumnDataProfilesGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ColumnDataProfile, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19216,7 +20446,7 @@ func (c *ProjectsJobTriggersDeleteCall) Do(opts ...googleapi.CallOption) (*Googl if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleProtobufEmpty{ + ret := &GooglePrivacyDlpV2ColumnDataProfile{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19229,31 +20459,84 @@ func (c *ProjectsJobTriggersDeleteCall) Do(opts ...googleapi.CallOption) (*Googl return ret, nil } -type ProjectsJobTriggersGetCall struct { +type ProjectsLocationsColumnDataProfilesListCall struct { s *Service - name string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Gets a job trigger. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-job-triggers -// to learn more. +// List: Lists column data profiles for an organization. // -// - name: Resource name of the project and the triggeredJob, for example -// `projects/dlp-test-project/jobTriggers/53234423`. -func (r *ProjectsJobTriggersService) Get(name string) *ProjectsJobTriggersGetCall { - c := &ProjectsJobTriggersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: Resource name of the organization or project, for example +// `organizations/433245324/locations/europe` or +// `projects/project-id/locations/asia`. +func (r *ProjectsLocationsColumnDataProfilesService) List(parent string) *ProjectsLocationsColumnDataProfilesListCall { + c := &ProjectsLocationsColumnDataProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": Allows filtering. Supported +// syntax: * Filter expressions are made up of one or more restrictions. * +// Restrictions can be combined by `AND` or `OR` logical operators. A sequence +// of restrictions implicitly uses `AND`. * A restriction has the form of +// `{field} {operator} {value}`. * Supported fields/values: - +// `table_data_profile_name` - The name of the related table data profile. - +// `project_id` - The Google Cloud project ID. (REQUIRED) - `dataset_id` - The +// BigQuery dataset ID. (REQUIRED) - `table_id` - The BigQuery table ID. +// (REQUIRED) - `field_id` - The ID of the BigQuery field. - `info_type` - The +// infotype detected in the resource. - `sensitivity_level` - HIGH|MEDIUM|LOW - +// `data_risk_level`: How much risk is associated with this data. - +// `status_code` - an RPC status code as defined in +// https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto * +// The operator must be `=` for project_id, dataset_id, and table_id. Other +// filters also support `!=`. Examples: * project_id = 12345 AND status_code = +// 1 * project_id = 12345 AND sensitivity_level = HIGH * project_id = 12345 AND +// info_type = STREET_ADDRESS The length of this field should be no more than +// 500 characters. +func (c *ProjectsLocationsColumnDataProfilesListCall) Filter(filter string) *ProjectsLocationsColumnDataProfilesListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// OrderBy sets the optional parameter "orderBy": Comma separated list of +// fields to order by, followed by `asc` or `desc` postfix. This list is case +// insensitive. The default sorting order is ascending. Redundant space +// characters are insignificant. Only one order field at a time is allowed. +// Examples: * `project_id asc` * `table_id` * `sensitivity_level desc` +// Supported fields are: - `project_id`: The Google Cloud project ID. - +// `dataset_id`: The ID of a BigQuery dataset. - `table_id`: The ID of a +// BigQuery table. - `sensitivity_level`: How sensitive the data in a column +// is, at most. - `data_risk_level`: How much risk is associated with this +// data. - `profile_last_generated`: When the profile was last updated in epoch +// seconds. +func (c *ProjectsLocationsColumnDataProfilesListCall) OrderBy(orderBy string) *ProjectsLocationsColumnDataProfilesListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageSize sets the optional parameter "pageSize": Size of the page. This +// value can be limited by the server. If zero, server returns a page of max +// size 100. +func (c *ProjectsLocationsColumnDataProfilesListCall) PageSize(pageSize int64) *ProjectsLocationsColumnDataProfilesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": Page token to continue +// retrieval. +func (c *ProjectsLocationsColumnDataProfilesListCall) PageToken(pageToken string) *ProjectsLocationsColumnDataProfilesListCall { + 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 // details. -func (c *ProjectsJobTriggersGetCall) Fields(s ...googleapi.Field) *ProjectsJobTriggersGetCall { +func (c *ProjectsLocationsColumnDataProfilesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsColumnDataProfilesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -19261,27 +20544,27 @@ func (c *ProjectsJobTriggersGetCall) Fields(s ...googleapi.Field) *ProjectsJobTr // IfNoneMatch sets an 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. -func (c *ProjectsJobTriggersGetCall) IfNoneMatch(entityTag string) *ProjectsJobTriggersGetCall { +func (c *ProjectsLocationsColumnDataProfilesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsColumnDataProfilesListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsJobTriggersGetCall) Context(ctx context.Context) *ProjectsJobTriggersGetCall { +func (c *ProjectsLocationsColumnDataProfilesListCall) Context(ctx context.Context) *ProjectsLocationsColumnDataProfilesListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsJobTriggersGetCall) Header() http.Header { +func (c *ProjectsLocationsColumnDataProfilesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsJobTriggersGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsColumnDataProfilesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -19289,7 +20572,7 @@ func (c *ProjectsJobTriggersGetCall) doRequest(alt string) (*http.Response, erro var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/columnDataProfiles") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -19297,18 +20580,18 @@ func (c *ProjectsJobTriggersGetCall) doRequest(alt string) (*http.Response, erro } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.jobTriggers.get" call. +// Do executes the "dlp.projects.locations.columnDataProfiles.list" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2JobTrigger.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// *GooglePrivacyDlpV2ListColumnDataProfilesResponse.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 *ProjectsJobTriggersGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2JobTrigger, error) { +func (c *ProjectsLocationsColumnDataProfilesListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListColumnDataProfilesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19327,7 +20610,7 @@ func (c *ProjectsJobTriggersGetCall) Do(opts ...googleapi.CallOption) (*GooglePr if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2JobTrigger{ + ret := &GooglePrivacyDlpV2ListColumnDataProfilesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19340,163 +20623,101 @@ func (c *ProjectsJobTriggersGetCall) Do(opts ...googleapi.CallOption) (*GooglePr return ret, nil } -type ProjectsJobTriggersListCall struct { - s *Service - parentid string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// List: Lists job triggers. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-job-triggers -// to learn more. -// -// - parent: Parent resource name. The format of this value varies depending on -// whether you have specified a processing location -// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` -// LOCATION_ID + Projects scope, no location specified (defaults to global): -// `projects/`PROJECT_ID The following example `parent` string specifies a -// parent project with the identifier `example-project`, and specifies the -// `europe-west3` location for processing data: -// parent=projects/example-project/locations/europe-west3. -func (r *ProjectsJobTriggersService) List(parentid string) *ProjectsJobTriggersListCall { - c := &ProjectsJobTriggersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parentid = parentid - return c -} - -// Filter sets the optional parameter "filter": Allows filtering. Supported -// syntax: * Filter expressions are made up of one or more restrictions. * -// Restrictions can be combined by `AND` or `OR` logical operators. A sequence -// of restrictions implicitly uses `AND`. * A restriction has the form of -// `{field} {operator} {value}`. * Supported fields/values for inspect -// triggers: - `status` - HEALTHY|PAUSED|CANCELLED - `inspected_storage` - -// DATASTORE|CLOUD_STORAGE|BIGQUERY - 'last_run_time` - RFC 3339 formatted -// timestamp, surrounded by quotation marks. Nanoseconds are ignored. - -// 'error_count' - Number of errors that have occurred while running. * The -// operator must be `=` or `!=` for status and inspected_storage. Examples: * -// inspected_storage = cloud_storage AND status = HEALTHY * inspected_storage = -// cloud_storage OR inspected_storage = bigquery * inspected_storage = -// cloud_storage AND (state = PAUSED OR state = HEALTHY) * last_run_time > -// \"2017-12-12T00:00:00+00:00\" The length of this field should be no more -// than 500 characters. -func (c *ProjectsJobTriggersListCall) Filter(filter string) *ProjectsJobTriggersListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// LocationId sets the optional parameter "locationId": Deprecated. This field -// has no effect. -func (c *ProjectsJobTriggersListCall) LocationId(locationId string) *ProjectsJobTriggersListCall { - c.urlParams_.Set("locationId", locationId) - return c -} - -// OrderBy sets the optional parameter "orderBy": Comma separated list of -// triggeredJob fields to order by, followed by `asc` or `desc` postfix. This -// list is case insensitive. The default sorting order is ascending. Redundant -// space characters are insignificant. Example: `name asc,update_time, -// create_time desc` Supported fields are: - `create_time`: corresponds to the -// time the JobTrigger was created. - `update_time`: corresponds to the time -// the JobTrigger was last updated. - `last_run_time`: corresponds to the last -// time the JobTrigger ran. - `name`: corresponds to the JobTrigger's name. - -// `display_name`: corresponds to the JobTrigger's display name. - `status`: -// corresponds to JobTrigger's status. -func (c *ProjectsJobTriggersListCall) OrderBy(orderBy string) *ProjectsJobTriggersListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageSize sets the optional parameter "pageSize": Size of the page. This -// value can be limited by a server. -func (c *ProjectsJobTriggersListCall) PageSize(pageSize int64) *ProjectsJobTriggersListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c +// 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 *ProjectsLocationsColumnDataProfilesListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListColumnDataProfilesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + 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) + } } -// PageToken sets the optional parameter "pageToken": Page token to continue -// retrieval. Comes from the previous call to ListJobTriggers. `order_by` field -// must not change for subsequent calls. -func (c *ProjectsJobTriggersListCall) PageToken(pageToken string) *ProjectsJobTriggersListCall { - c.urlParams_.Set("pageToken", pageToken) - return c +type ProjectsLocationsConnectionsCreateCall struct { + s *Service + parent string + googleprivacydlpv2createconnectionrequest *GooglePrivacyDlpV2CreateConnectionRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Type sets the optional parameter "type": The type of jobs. Will use -// `DlpJobType.INSPECT` if not set. -// -// Possible values: +// Create: Create a Connection to an external data source. // -// "DLP_JOB_TYPE_UNSPECIFIED" - Defaults to INSPECT_JOB. -// "INSPECT_JOB" - The job inspected Google Cloud for sensitive data. -// "RISK_ANALYSIS_JOB" - The job executed a Risk Analysis computation. -func (c *ProjectsJobTriggersListCall) Type(type_ string) *ProjectsJobTriggersListCall { - c.urlParams_.Set("type", type_) +// - parent: Parent resource name. The format of this value varies depending on +// the scope of the request (project or organization): + Projects scope: +// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Organizations scope: +// `organizations/`ORG_ID`/locations/`LOCATION_ID. +func (r *ProjectsLocationsConnectionsService) Create(parent string, googleprivacydlpv2createconnectionrequest *GooglePrivacyDlpV2CreateConnectionRequest) *ProjectsLocationsConnectionsCreateCall { + c := &ProjectsLocationsConnectionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleprivacydlpv2createconnectionrequest = googleprivacydlpv2createconnectionrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsJobTriggersListCall) Fields(s ...googleapi.Field) *ProjectsJobTriggersListCall { +func (c *ProjectsLocationsConnectionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an 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. -func (c *ProjectsJobTriggersListCall) IfNoneMatch(entityTag string) *ProjectsJobTriggersListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *ProjectsJobTriggersListCall) Context(ctx context.Context) *ProjectsJobTriggersListCall { +func (c *ProjectsLocationsConnectionsCreateCall) Context(ctx context.Context) *ProjectsLocationsConnectionsCreateCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsJobTriggersListCall) Header() http.Header { +func (c *ProjectsLocationsConnectionsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsJobTriggersListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *ProjectsLocationsConnectionsCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createconnectionrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/jobTriggers") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/connections") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parentid, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.jobTriggers.list" call. +// Do executes the "dlp.projects.locations.connections.create" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2ListJobTriggersResponse.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use +// *GooglePrivacyDlpV2Connection.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 *ProjectsJobTriggersListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListJobTriggersResponse, error) { +func (c *ProjectsLocationsConnectionsCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2Connection, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19515,7 +20736,7 @@ func (c *ProjectsJobTriggersListCall) Do(opts ...googleapi.CallOption) (*GoogleP if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2ListJobTriggersResponse{ + ret := &GooglePrivacyDlpV2Connection{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19528,84 +20749,55 @@ func (c *ProjectsJobTriggersListCall) Do(opts ...googleapi.CallOption) (*GoogleP return ret, nil } -// 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 *ProjectsJobTriggersListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListJobTriggersResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type ProjectsJobTriggersPatchCall struct { - s *Service - name string - googleprivacydlpv2updatejobtriggerrequest *GooglePrivacyDlpV2UpdateJobTriggerRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsConnectionsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates a job trigger. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-job-triggers -// to learn more. +// Delete: Delete a Connection. // -// - name: Resource name of the project and the triggeredJob, for example -// `projects/dlp-test-project/jobTriggers/53234423`. -func (r *ProjectsJobTriggersService) Patch(name string, googleprivacydlpv2updatejobtriggerrequest *GooglePrivacyDlpV2UpdateJobTriggerRequest) *ProjectsJobTriggersPatchCall { - c := &ProjectsJobTriggersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Resource name of the Connection to be deleted, in the format: +// `projects/{project}/locations/{location}/connections/{connection}`. +func (r *ProjectsLocationsConnectionsService) Delete(name string) *ProjectsLocationsConnectionsDeleteCall { + c := &ProjectsLocationsConnectionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googleprivacydlpv2updatejobtriggerrequest = googleprivacydlpv2updatejobtriggerrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsJobTriggersPatchCall) Fields(s ...googleapi.Field) *ProjectsJobTriggersPatchCall { +func (c *ProjectsLocationsConnectionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsJobTriggersPatchCall) Context(ctx context.Context) *ProjectsJobTriggersPatchCall { +func (c *ProjectsLocationsConnectionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsConnectionsDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsJobTriggersPatchCall) Header() http.Header { +func (c *ProjectsLocationsConnectionsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsJobTriggersPatchCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *ProjectsLocationsConnectionsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatejobtriggerrequest) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -19616,13 +20808,13 @@ func (c *ProjectsJobTriggersPatchCall) doRequest(alt string) (*http.Response, er return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.jobTriggers.patch" call. +// Do executes the "dlp.projects.locations.connections.delete" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2JobTrigger.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 *ProjectsJobTriggersPatchCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2JobTrigger, error) { +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsConnectionsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19641,7 +20833,7 @@ func (c *ProjectsJobTriggersPatchCall) Do(opts ...googleapi.CallOption) (*Google if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2JobTrigger{ + ret := &GoogleProtobufEmpty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19654,7 +20846,7 @@ func (c *ProjectsJobTriggersPatchCall) Do(opts ...googleapi.CallOption) (*Google return ret, nil } -type ProjectsLocationsColumnDataProfilesGetCall struct { +type ProjectsLocationsConnectionsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -19663,12 +20855,12 @@ type ProjectsLocationsColumnDataProfilesGetCall struct { header_ http.Header } -// Get: Gets a column data profile. +// Get: Get a Connection by name. // -// - name: Resource name, for example -// `organizations/12345/locations/us/columnDataProfiles/53234423`. -func (r *ProjectsLocationsColumnDataProfilesService) Get(name string) *ProjectsLocationsColumnDataProfilesGetCall { - c := &ProjectsLocationsColumnDataProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Resource name in the format: +// `projects/{project}/locations/{location}/connections/{connection}`. +func (r *ProjectsLocationsConnectionsService) Get(name string) *ProjectsLocationsConnectionsGetCall { + c := &ProjectsLocationsConnectionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -19676,7 +20868,7 @@ func (r *ProjectsLocationsColumnDataProfilesService) Get(name string) *ProjectsL // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsColumnDataProfilesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsColumnDataProfilesGetCall { +func (c *ProjectsLocationsConnectionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -19684,27 +20876,27 @@ func (c *ProjectsLocationsColumnDataProfilesGetCall) Fields(s ...googleapi.Field // IfNoneMatch sets an 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. -func (c *ProjectsLocationsColumnDataProfilesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsColumnDataProfilesGetCall { +func (c *ProjectsLocationsConnectionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsConnectionsGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsColumnDataProfilesGetCall) Context(ctx context.Context) *ProjectsLocationsColumnDataProfilesGetCall { +func (c *ProjectsLocationsConnectionsGetCall) Context(ctx context.Context) *ProjectsLocationsConnectionsGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsColumnDataProfilesGetCall) Header() http.Header { +func (c *ProjectsLocationsConnectionsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsColumnDataProfilesGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsConnectionsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -19725,13 +20917,13 @@ func (c *ProjectsLocationsColumnDataProfilesGetCall) doRequest(alt string) (*htt return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.locations.columnDataProfiles.get" call. +// Do executes the "dlp.projects.locations.connections.get" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2ColumnDataProfile.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use +// *GooglePrivacyDlpV2Connection.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 *ProjectsLocationsColumnDataProfilesGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ColumnDataProfile, error) { +func (c *ProjectsLocationsConnectionsGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2Connection, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19750,7 +20942,7 @@ func (c *ProjectsLocationsColumnDataProfilesGetCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2ColumnDataProfile{ + ret := &GooglePrivacyDlpV2Connection{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19763,7 +20955,7 @@ func (c *ProjectsLocationsColumnDataProfilesGetCall) Do(opts ...googleapi.CallOp return ret, nil } -type ProjectsLocationsColumnDataProfilesListCall struct { +type ProjectsLocationsConnectionsListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -19772,67 +20964,33 @@ type ProjectsLocationsColumnDataProfilesListCall struct { header_ http.Header } -// List: Lists column data profiles for an organization. +// List: Lists Connections in a parent. // -// - parent: Resource name of the organization or project, for example -// `organizations/433245324/locations/europe` or -// `projects/project-id/locations/asia`. -func (r *ProjectsLocationsColumnDataProfilesService) List(parent string) *ProjectsLocationsColumnDataProfilesListCall { - c := &ProjectsLocationsColumnDataProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: Parent name, for example: `projects/project-id/locations/global`. +func (r *ProjectsLocationsConnectionsService) List(parent string) *ProjectsLocationsConnectionsListCall { + c := &ProjectsLocationsConnectionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } -// Filter sets the optional parameter "filter": Allows filtering. Supported -// syntax: * Filter expressions are made up of one or more restrictions. * -// Restrictions can be combined by `AND` or `OR` logical operators. A sequence -// of restrictions implicitly uses `AND`. * A restriction has the form of -// `{field} {operator} {value}`. * Supported fields/values: - -// `table_data_profile_name` - The name of the related table data profile. - -// `project_id` - The Google Cloud project ID. (REQUIRED) - `dataset_id` - The -// BigQuery dataset ID. (REQUIRED) - `table_id` - The BigQuery table ID. -// (REQUIRED) - `field_id` - The ID of the BigQuery field. - `info_type` - The -// infotype detected in the resource. - `sensitivity_level` - HIGH|MEDIUM|LOW - -// `data_risk_level`: How much risk is associated with this data. - -// `status_code` - an RPC status code as defined in -// https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto * -// The operator must be `=` for project_id, dataset_id, and table_id. Other -// filters also support `!=`. Examples: * project_id = 12345 AND status_code = -// 1 * project_id = 12345 AND sensitivity_level = HIGH * project_id = 12345 AND -// info_type = STREET_ADDRESS The length of this field should be no more than -// 500 characters. -func (c *ProjectsLocationsColumnDataProfilesListCall) Filter(filter string) *ProjectsLocationsColumnDataProfilesListCall { +// Filter sets the optional parameter "filter": Supported field/value: `state` +// - MISSING|AVAILABLE|ERROR +func (c *ProjectsLocationsConnectionsListCall) Filter(filter string) *ProjectsLocationsConnectionsListCall { c.urlParams_.Set("filter", filter) return c } -// OrderBy sets the optional parameter "orderBy": Comma separated list of -// fields to order by, followed by `asc` or `desc` postfix. This list is case -// insensitive. The default sorting order is ascending. Redundant space -// characters are insignificant. Only one order field at a time is allowed. -// Examples: * `project_id asc` * `table_id` * `sensitivity_level desc` -// Supported fields are: - `project_id`: The Google Cloud project ID. - -// `dataset_id`: The ID of a BigQuery dataset. - `table_id`: The ID of a -// BigQuery table. - `sensitivity_level`: How sensitive the data in a column -// is, at most. - `data_risk_level`: How much risk is associated with this -// data. - `profile_last_generated`: When the profile was last updated in epoch -// seconds. -func (c *ProjectsLocationsColumnDataProfilesListCall) OrderBy(orderBy string) *ProjectsLocationsColumnDataProfilesListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageSize sets the optional parameter "pageSize": Size of the page. This -// value can be limited by the server. If zero, server returns a page of max -// size 100. -func (c *ProjectsLocationsColumnDataProfilesListCall) PageSize(pageSize int64) *ProjectsLocationsColumnDataProfilesListCall { +// PageSize sets the optional parameter "pageSize": Number of results per page, +// max 1000. +func (c *ProjectsLocationsConnectionsListCall) PageSize(pageSize int64) *ProjectsLocationsConnectionsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// PageToken sets the optional parameter "pageToken": Page token to continue -// retrieval. -func (c *ProjectsLocationsColumnDataProfilesListCall) PageToken(pageToken string) *ProjectsLocationsColumnDataProfilesListCall { +// PageToken sets the optional parameter "pageToken": Page token from a +// previous page to return the next set of results. If set, all other request +// fields must match the original request. +func (c *ProjectsLocationsConnectionsListCall) PageToken(pageToken string) *ProjectsLocationsConnectionsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -19840,7 +20998,7 @@ func (c *ProjectsLocationsColumnDataProfilesListCall) PageToken(pageToken string // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsColumnDataProfilesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsColumnDataProfilesListCall { +func (c *ProjectsLocationsConnectionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -19848,27 +21006,27 @@ func (c *ProjectsLocationsColumnDataProfilesListCall) Fields(s ...googleapi.Fiel // IfNoneMatch sets an 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. -func (c *ProjectsLocationsColumnDataProfilesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsColumnDataProfilesListCall { +func (c *ProjectsLocationsConnectionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsConnectionsListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsColumnDataProfilesListCall) Context(ctx context.Context) *ProjectsLocationsColumnDataProfilesListCall { +func (c *ProjectsLocationsConnectionsListCall) Context(ctx context.Context) *ProjectsLocationsConnectionsListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsColumnDataProfilesListCall) Header() http.Header { +func (c *ProjectsLocationsConnectionsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsColumnDataProfilesListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsConnectionsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -19876,7 +21034,7 @@ func (c *ProjectsLocationsColumnDataProfilesListCall) doRequest(alt string) (*ht var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/columnDataProfiles") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/connections") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -19889,13 +21047,13 @@ func (c *ProjectsLocationsColumnDataProfilesListCall) doRequest(alt string) (*ht return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.locations.columnDataProfiles.list" call. +// Do executes the "dlp.projects.locations.connections.list" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2ListColumnDataProfilesResponse.ServerResponse.Header or -// (if a response was returned at all) in error.(*googleapi.Error).Header. Use +// *GooglePrivacyDlpV2ListConnectionsResponse.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 *ProjectsLocationsColumnDataProfilesListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListColumnDataProfilesResponse, error) { +func (c *ProjectsLocationsConnectionsListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListConnectionsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19914,7 +21072,7 @@ func (c *ProjectsLocationsColumnDataProfilesListCall) Do(opts ...googleapi.CallO if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2ListColumnDataProfilesResponse{ + ret := &GooglePrivacyDlpV2ListConnectionsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19930,7 +21088,7 @@ func (c *ProjectsLocationsColumnDataProfilesListCall) Do(opts ...googleapi.CallO // 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 *ProjectsLocationsColumnDataProfilesListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListColumnDataProfilesResponse) error) error { +func (c *ProjectsLocationsConnectionsListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListConnectionsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { @@ -19948,160 +21106,61 @@ func (c *ProjectsLocationsColumnDataProfilesListCall) Pages(ctx context.Context, } } -type ProjectsLocationsConnectionsCreateCall struct { +type ProjectsLocationsConnectionsPatchCall struct { s *Service - parent string - googleprivacydlpv2createconnectionrequest *GooglePrivacyDlpV2CreateConnectionRequest + name string + googleprivacydlpv2updateconnectionrequest *GooglePrivacyDlpV2UpdateConnectionRequest urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Create: Create a Connection to an external data source. -// -// - parent: Parent resource name. The format of this value varies depending on -// the scope of the request (project or organization): + Projects scope: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Organizations scope: -// `organizations/`ORG_ID`/locations/`LOCATION_ID. -func (r *ProjectsLocationsConnectionsService) Create(parent string, googleprivacydlpv2createconnectionrequest *GooglePrivacyDlpV2CreateConnectionRequest) *ProjectsLocationsConnectionsCreateCall { - c := &ProjectsLocationsConnectionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.googleprivacydlpv2createconnectionrequest = googleprivacydlpv2createconnectionrequest - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *ProjectsLocationsConnectionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsCreateCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsConnectionsCreateCall) Context(ctx context.Context) *ProjectsLocationsConnectionsCreateCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *ProjectsLocationsConnectionsCreateCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ProjectsLocationsConnectionsCreateCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createconnectionrequest) - if err != nil { - return nil, err - } - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/connections") - 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 "dlp.projects.locations.connections.create" call. -// Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2Connection.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 *ProjectsLocationsConnectionsCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2Connection, 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 := &GooglePrivacyDlpV2Connection{ - 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 -} - -type ProjectsLocationsConnectionsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Delete: Delete a Connection. +// Patch: Update a Connection. // -// - name: Resource name of the Connection to be deleted, in the format: +// - name: Resource name in the format: // `projects/{project}/locations/{location}/connections/{connection}`. -func (r *ProjectsLocationsConnectionsService) Delete(name string) *ProjectsLocationsConnectionsDeleteCall { - c := &ProjectsLocationsConnectionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsLocationsConnectionsService) Patch(name string, googleprivacydlpv2updateconnectionrequest *GooglePrivacyDlpV2UpdateConnectionRequest) *ProjectsLocationsConnectionsPatchCall { + c := &ProjectsLocationsConnectionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.googleprivacydlpv2updateconnectionrequest = googleprivacydlpv2updateconnectionrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsConnectionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsDeleteCall { +func (c *ProjectsLocationsConnectionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsConnectionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsConnectionsDeleteCall { +func (c *ProjectsLocationsConnectionsPatchCall) Context(ctx context.Context) *ProjectsLocationsConnectionsPatchCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsConnectionsDeleteCall) Header() http.Header { +func (c *ProjectsLocationsConnectionsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsConnectionsDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *ProjectsLocationsConnectionsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updateconnectionrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -20112,13 +21171,13 @@ func (c *ProjectsLocationsConnectionsDeleteCall) doRequest(alt string) (*http.Re return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.locations.connections.delete" call. +// Do executes the "dlp.projects.locations.connections.patch" call. // Any non-2xx status code is an error. Response headers are in either -// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsLocationsConnectionsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { +// *GooglePrivacyDlpV2Connection.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 *ProjectsLocationsConnectionsPatchCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2Connection, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20137,7 +21196,7 @@ func (c *ProjectsLocationsConnectionsDeleteCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleProtobufEmpty{ + ret := &GooglePrivacyDlpV2Connection{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20150,29 +21209,51 @@ func (c *ProjectsLocationsConnectionsDeleteCall) Do(opts ...googleapi.CallOption return ret, nil } -type ProjectsLocationsConnectionsGetCall struct { +type ProjectsLocationsConnectionsSearchCall struct { s *Service - name string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Get a Connection by name. +// Search: Searches for Connections in a parent. // -// - name: Resource name in the format: -// `projects/{project}/locations/{location}/connections/{connection}`. -func (r *ProjectsLocationsConnectionsService) Get(name string) *ProjectsLocationsConnectionsGetCall { - c := &ProjectsLocationsConnectionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: Parent name, typically an organization, without location. For +// example: `organizations/12345678`. +func (r *ProjectsLocationsConnectionsService) Search(parent string) *ProjectsLocationsConnectionsSearchCall { + c := &ProjectsLocationsConnectionsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": Supported field/value: - +// `state` - MISSING|AVAILABLE|ERROR +func (c *ProjectsLocationsConnectionsSearchCall) Filter(filter string) *ProjectsLocationsConnectionsSearchCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": Number of results per page, +// max 1000. +func (c *ProjectsLocationsConnectionsSearchCall) PageSize(pageSize int64) *ProjectsLocationsConnectionsSearchCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": Page token from a +// previous page to return the next set of results. If set, all other request +// fields must match the original request. +func (c *ProjectsLocationsConnectionsSearchCall) PageToken(pageToken string) *ProjectsLocationsConnectionsSearchCall { + 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 // details. -func (c *ProjectsLocationsConnectionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsGetCall { +func (c *ProjectsLocationsConnectionsSearchCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsSearchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -20180,27 +21261,27 @@ func (c *ProjectsLocationsConnectionsGetCall) Fields(s ...googleapi.Field) *Proj // IfNoneMatch sets an 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. -func (c *ProjectsLocationsConnectionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsConnectionsGetCall { +func (c *ProjectsLocationsConnectionsSearchCall) IfNoneMatch(entityTag string) *ProjectsLocationsConnectionsSearchCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsConnectionsGetCall) Context(ctx context.Context) *ProjectsLocationsConnectionsGetCall { +func (c *ProjectsLocationsConnectionsSearchCall) Context(ctx context.Context) *ProjectsLocationsConnectionsSearchCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsConnectionsGetCall) Header() http.Header { +func (c *ProjectsLocationsConnectionsSearchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsConnectionsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsConnectionsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -20208,7 +21289,7 @@ func (c *ProjectsLocationsConnectionsGetCall) doRequest(alt string) (*http.Respo var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/connections:search") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -20216,18 +21297,18 @@ func (c *ProjectsLocationsConnectionsGetCall) doRequest(alt string) (*http.Respo } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.locations.connections.get" call. +// Do executes the "dlp.projects.locations.connections.search" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2Connection.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// *GooglePrivacyDlpV2SearchConnectionsResponse.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 *ProjectsLocationsConnectionsGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2Connection, error) { +func (c *ProjectsLocationsConnectionsSearchCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2SearchConnectionsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20246,7 +21327,7 @@ func (c *ProjectsLocationsConnectionsGetCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2Connection{ + ret := &GooglePrivacyDlpV2SearchConnectionsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20259,105 +21340,112 @@ func (c *ProjectsLocationsConnectionsGetCall) Do(opts ...googleapi.CallOption) ( return ret, nil } -type ProjectsLocationsConnectionsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// List: Lists Connections in a parent. -// -// - parent: Parent name, for example: `projects/project-id/locations/global`. -func (r *ProjectsLocationsConnectionsService) List(parent string) *ProjectsLocationsConnectionsListCall { - c := &ProjectsLocationsConnectionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// Filter sets the optional parameter "filter": Supported field/value: `state` -// - MISSING|AVAILABLE|ERROR -func (c *ProjectsLocationsConnectionsListCall) Filter(filter string) *ProjectsLocationsConnectionsListCall { - c.urlParams_.Set("filter", filter) - return c +// 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 *ProjectsLocationsConnectionsSearchCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2SearchConnectionsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + 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) + } } -// PageSize sets the optional parameter "pageSize": Number of results per page, -// max 1000. -func (c *ProjectsLocationsConnectionsListCall) PageSize(pageSize int64) *ProjectsLocationsConnectionsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c +type ProjectsLocationsContentDeidentifyCall struct { + s *Service + parentid string + googleprivacydlpv2deidentifycontentrequest *GooglePrivacyDlpV2DeidentifyContentRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// PageToken sets the optional parameter "pageToken": Page token from a -// previous page to return the next set of results. If set, all other request -// fields must match the original request. -func (c *ProjectsLocationsConnectionsListCall) PageToken(pageToken string) *ProjectsLocationsConnectionsListCall { - c.urlParams_.Set("pageToken", pageToken) +// Deidentify: De-identifies potentially sensitive info from a ContentItem. +// This method has limits on input size and output size. See +// https://cloud.google.com/sensitive-data-protection/docs/deidentify-sensitive-data +// to learn more. When no InfoTypes or CustomInfoTypes are specified in this +// request, the system will automatically choose what detectors to run. By +// default this may be all types, but may change over time as detectors are +// updated. +// +// - parent: Parent resource name. The format of this value varies depending on +// whether you have specified a processing location +// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: +// parent=projects/example-project/locations/europe-west3. +func (r *ProjectsLocationsContentService) Deidentify(parentid string, googleprivacydlpv2deidentifycontentrequest *GooglePrivacyDlpV2DeidentifyContentRequest) *ProjectsLocationsContentDeidentifyCall { + c := &ProjectsLocationsContentDeidentifyCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parentid = parentid + c.googleprivacydlpv2deidentifycontentrequest = googleprivacydlpv2deidentifycontentrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsConnectionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsListCall { +func (c *ProjectsLocationsContentDeidentifyCall) Fields(s ...googleapi.Field) *ProjectsLocationsContentDeidentifyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an 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. -func (c *ProjectsLocationsConnectionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsConnectionsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsConnectionsListCall) Context(ctx context.Context) *ProjectsLocationsConnectionsListCall { +func (c *ProjectsLocationsContentDeidentifyCall) Context(ctx context.Context) *ProjectsLocationsContentDeidentifyCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsConnectionsListCall) Header() http.Header { +func (c *ProjectsLocationsContentDeidentifyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsConnectionsListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *ProjectsLocationsContentDeidentifyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2deidentifycontentrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/connections") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/content:deidentify") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "parent": c.parentid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.locations.connections.list" call. +// Do executes the "dlp.projects.locations.content.deidentify" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2ListConnectionsResponse.ServerResponse.Header or (if a +// *GooglePrivacyDlpV2DeidentifyContentResponse.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 *ProjectsLocationsConnectionsListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListConnectionsResponse, error) { +func (c *ProjectsLocationsContentDeidentifyCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DeidentifyContentResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20376,7 +21464,7 @@ func (c *ProjectsLocationsConnectionsListCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2ListConnectionsResponse{ + ret := &GooglePrivacyDlpV2DeidentifyContentResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20389,99 +21477,91 @@ func (c *ProjectsLocationsConnectionsListCall) Do(opts ...googleapi.CallOption) return ret, nil } -// 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 *ProjectsLocationsConnectionsListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListConnectionsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type ProjectsLocationsConnectionsPatchCall struct { - s *Service - name string - googleprivacydlpv2updateconnectionrequest *GooglePrivacyDlpV2UpdateConnectionRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsContentInspectCall struct { + s *Service + parentid string + googleprivacydlpv2inspectcontentrequest *GooglePrivacyDlpV2InspectContentRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Update a Connection. -// -// - name: Resource name in the format: -// `projects/{project}/locations/{location}/connections/{connection}`. -func (r *ProjectsLocationsConnectionsService) Patch(name string, googleprivacydlpv2updateconnectionrequest *GooglePrivacyDlpV2UpdateConnectionRequest) *ProjectsLocationsConnectionsPatchCall { - c := &ProjectsLocationsConnectionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.googleprivacydlpv2updateconnectionrequest = googleprivacydlpv2updateconnectionrequest +// Inspect: Finds potentially sensitive info in content. This method has limits +// on input size, processing time, and output size. When no InfoTypes or +// CustomInfoTypes are specified in this request, the system will automatically +// choose what detectors to run. By default this may be all types, but may +// change over time as detectors are updated. For how to guides, see +// https://cloud.google.com/sensitive-data-protection/docs/inspecting-images +// and https://cloud.google.com/sensitive-data-protection/docs/inspecting-text, +// +// - parent: Parent resource name. The format of this value varies depending on +// whether you have specified a processing location +// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: +// parent=projects/example-project/locations/europe-west3. +func (r *ProjectsLocationsContentService) Inspect(parentid string, googleprivacydlpv2inspectcontentrequest *GooglePrivacyDlpV2InspectContentRequest) *ProjectsLocationsContentInspectCall { + c := &ProjectsLocationsContentInspectCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parentid = parentid + c.googleprivacydlpv2inspectcontentrequest = googleprivacydlpv2inspectcontentrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsConnectionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsPatchCall { +func (c *ProjectsLocationsContentInspectCall) Fields(s ...googleapi.Field) *ProjectsLocationsContentInspectCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsConnectionsPatchCall) Context(ctx context.Context) *ProjectsLocationsConnectionsPatchCall { +func (c *ProjectsLocationsContentInspectCall) Context(ctx context.Context) *ProjectsLocationsContentInspectCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsConnectionsPatchCall) Header() http.Header { +func (c *ProjectsLocationsContentInspectCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsConnectionsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsContentInspectCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updateconnectionrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2inspectcontentrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/content:inspect") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parentid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.locations.connections.patch" call. +// Do executes the "dlp.projects.locations.content.inspect" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2Connection.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// *GooglePrivacyDlpV2InspectContentResponse.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 *ProjectsLocationsConnectionsPatchCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2Connection, error) { +func (c *ProjectsLocationsContentInspectCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2InspectContentResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20500,7 +21580,7 @@ func (c *ProjectsLocationsConnectionsPatchCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2Connection{ + ret := &GooglePrivacyDlpV2InspectContentResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20513,106 +21593,87 @@ func (c *ProjectsLocationsConnectionsPatchCall) Do(opts ...googleapi.CallOption) return ret, nil } -type ProjectsLocationsConnectionsSearchCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsContentReidentifyCall struct { + s *Service + parentid string + googleprivacydlpv2reidentifycontentrequest *GooglePrivacyDlpV2ReidentifyContentRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Search: Searches for Connections in a parent. +// Reidentify: Re-identifies content that has been de-identified. See +// https://cloud.google.com/sensitive-data-protection/docs/pseudonymization#re-identification_in_free_text_code_example +// to learn more. // -// - parent: Parent name, typically an organization, without location. For -// example: `organizations/12345678`. -func (r *ProjectsLocationsConnectionsService) Search(parent string) *ProjectsLocationsConnectionsSearchCall { - c := &ProjectsLocationsConnectionsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// Filter sets the optional parameter "filter": Supported field/value: - -// `state` - MISSING|AVAILABLE|ERROR -func (c *ProjectsLocationsConnectionsSearchCall) Filter(filter string) *ProjectsLocationsConnectionsSearchCall { - c.urlParams_.Set("filter", filter) - return c -} - -// PageSize sets the optional parameter "pageSize": Number of results per page, -// max 1000. -func (c *ProjectsLocationsConnectionsSearchCall) PageSize(pageSize int64) *ProjectsLocationsConnectionsSearchCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": Page token from a -// previous page to return the next set of results. If set, all other request -// fields must match the original request. -func (c *ProjectsLocationsConnectionsSearchCall) PageToken(pageToken string) *ProjectsLocationsConnectionsSearchCall { - c.urlParams_.Set("pageToken", pageToken) +// - parent: Parent resource name. The format of this value varies depending on +// whether you have specified a processing location +// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: +// parent=projects/example-project/locations/europe-west3. +func (r *ProjectsLocationsContentService) Reidentify(parentid string, googleprivacydlpv2reidentifycontentrequest *GooglePrivacyDlpV2ReidentifyContentRequest) *ProjectsLocationsContentReidentifyCall { + c := &ProjectsLocationsContentReidentifyCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parentid = parentid + c.googleprivacydlpv2reidentifycontentrequest = googleprivacydlpv2reidentifycontentrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsConnectionsSearchCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsSearchCall { +func (c *ProjectsLocationsContentReidentifyCall) Fields(s ...googleapi.Field) *ProjectsLocationsContentReidentifyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an 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. -func (c *ProjectsLocationsConnectionsSearchCall) IfNoneMatch(entityTag string) *ProjectsLocationsConnectionsSearchCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsConnectionsSearchCall) Context(ctx context.Context) *ProjectsLocationsConnectionsSearchCall { +func (c *ProjectsLocationsContentReidentifyCall) Context(ctx context.Context) *ProjectsLocationsContentReidentifyCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsConnectionsSearchCall) Header() http.Header { +func (c *ProjectsLocationsContentReidentifyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsConnectionsSearchCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *ProjectsLocationsContentReidentifyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2reidentifycontentrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/connections:search") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/content:reidentify") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "parent": c.parentid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.locations.connections.search" call. +// Do executes the "dlp.projects.locations.content.reidentify" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2SearchConnectionsResponse.ServerResponse.Header or (if a +// *GooglePrivacyDlpV2ReidentifyContentResponse.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 *ProjectsLocationsConnectionsSearchCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2SearchConnectionsResponse, error) { +func (c *ProjectsLocationsContentReidentifyCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ReidentifyContentResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20631,7 +21692,7 @@ func (c *ProjectsLocationsConnectionsSearchCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2SearchConnectionsResponse{ + ret := &GooglePrivacyDlpV2ReidentifyContentResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20644,93 +21705,73 @@ func (c *ProjectsLocationsConnectionsSearchCall) Do(opts ...googleapi.CallOption return ret, nil } -// 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 *ProjectsLocationsConnectionsSearchCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2SearchConnectionsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type ProjectsLocationsContentDeidentifyCall struct { - s *Service - parentid string - googleprivacydlpv2deidentifycontentrequest *GooglePrivacyDlpV2DeidentifyContentRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDeidentifyTemplatesCreateCall struct { + s *Service + parentid string + googleprivacydlpv2createdeidentifytemplaterequest *GooglePrivacyDlpV2CreateDeidentifyTemplateRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Deidentify: De-identifies potentially sensitive info from a ContentItem. -// This method has limits on input size and output size. See -// https://cloud.google.com/sensitive-data-protection/docs/deidentify-sensitive-data -// to learn more. When no InfoTypes or CustomInfoTypes are specified in this -// request, the system will automatically choose what detectors to run. By -// default this may be all types, but may change over time as detectors are -// updated. +// Create: Creates a DeidentifyTemplate for reusing frequently used +// configuration for de-identifying content, images, and storage. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-templates-deid +// to learn more. // // - parent: Parent resource name. The format of this value varies depending on -// whether you have specified a processing location +// the scope of the request (project or organization) and whether you have +// specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): // - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` // LOCATION_ID + Projects scope, no location specified (defaults to global): -// `projects/`PROJECT_ID The following example `parent` string specifies a -// parent project with the identifier `example-project`, and specifies the -// `europe-west3` location for processing data: +// `projects/`PROJECT_ID + Organizations scope, location specified: +// `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no +// location specified (defaults to global): `organizations/`ORG_ID The +// following example `parent` string specifies a parent project with the +// identifier `example-project`, and specifies the `europe-west3` location +// for processing data: // parent=projects/example-project/locations/europe-west3. -func (r *ProjectsLocationsContentService) Deidentify(parentid string, googleprivacydlpv2deidentifycontentrequest *GooglePrivacyDlpV2DeidentifyContentRequest) *ProjectsLocationsContentDeidentifyCall { - c := &ProjectsLocationsContentDeidentifyCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsLocationsDeidentifyTemplatesService) Create(parentid string, googleprivacydlpv2createdeidentifytemplaterequest *GooglePrivacyDlpV2CreateDeidentifyTemplateRequest) *ProjectsLocationsDeidentifyTemplatesCreateCall { + c := &ProjectsLocationsDeidentifyTemplatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parentid = parentid - c.googleprivacydlpv2deidentifycontentrequest = googleprivacydlpv2deidentifycontentrequest + c.googleprivacydlpv2createdeidentifytemplaterequest = googleprivacydlpv2createdeidentifytemplaterequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsContentDeidentifyCall) Fields(s ...googleapi.Field) *ProjectsLocationsContentDeidentifyCall { +func (c *ProjectsLocationsDeidentifyTemplatesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsDeidentifyTemplatesCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsContentDeidentifyCall) Context(ctx context.Context) *ProjectsLocationsContentDeidentifyCall { +func (c *ProjectsLocationsDeidentifyTemplatesCreateCall) Context(ctx context.Context) *ProjectsLocationsDeidentifyTemplatesCreateCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsContentDeidentifyCall) Header() http.Header { +func (c *ProjectsLocationsDeidentifyTemplatesCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsContentDeidentifyCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDeidentifyTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2deidentifycontentrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createdeidentifytemplaterequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/content:deidentify") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/deidentifyTemplates") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -20743,13 +21784,13 @@ func (c *ProjectsLocationsContentDeidentifyCall) doRequest(alt string) (*http.Re return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.locations.content.deidentify" call. +// Do executes the "dlp.projects.locations.deidentifyTemplates.create" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2DeidentifyContentResponse.ServerResponse.Header or (if a +// *GooglePrivacyDlpV2DeidentifyTemplate.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 *ProjectsLocationsContentDeidentifyCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DeidentifyContentResponse, error) { +func (c *ProjectsLocationsDeidentifyTemplatesCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DeidentifyTemplate, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20768,7 +21809,7 @@ func (c *ProjectsLocationsContentDeidentifyCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2DeidentifyContentResponse{ + ret := &GooglePrivacyDlpV2DeidentifyTemplate{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20781,91 +21822,76 @@ func (c *ProjectsLocationsContentDeidentifyCall) Do(opts ...googleapi.CallOption return ret, nil } -type ProjectsLocationsContentInspectCall struct { - s *Service - parentid string - googleprivacydlpv2inspectcontentrequest *GooglePrivacyDlpV2InspectContentRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDeidentifyTemplatesDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } - -// Inspect: Finds potentially sensitive info in content. This method has limits -// on input size, processing time, and output size. When no InfoTypes or -// CustomInfoTypes are specified in this request, the system will automatically -// choose what detectors to run. By default this may be all types, but may -// change over time as detectors are updated. For how to guides, see -// https://cloud.google.com/sensitive-data-protection/docs/inspecting-images -// and https://cloud.google.com/sensitive-data-protection/docs/inspecting-text, -// -// - parent: Parent resource name. The format of this value varies depending on -// whether you have specified a processing location -// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` -// LOCATION_ID + Projects scope, no location specified (defaults to global): -// `projects/`PROJECT_ID The following example `parent` string specifies a -// parent project with the identifier `example-project`, and specifies the -// `europe-west3` location for processing data: -// parent=projects/example-project/locations/europe-west3. -func (r *ProjectsLocationsContentService) Inspect(parentid string, googleprivacydlpv2inspectcontentrequest *GooglePrivacyDlpV2InspectContentRequest) *ProjectsLocationsContentInspectCall { - c := &ProjectsLocationsContentInspectCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parentid = parentid - c.googleprivacydlpv2inspectcontentrequest = googleprivacydlpv2inspectcontentrequest + +// Delete: Deletes a DeidentifyTemplate. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-templates-deid +// to learn more. +// +// - name: Resource name of the organization and deidentify template to be +// deleted, for example +// `organizations/433245324/deidentifyTemplates/432452342` or +// projects/project-id/deidentifyTemplates/432452342. +func (r *ProjectsLocationsDeidentifyTemplatesService) Delete(name string) *ProjectsLocationsDeidentifyTemplatesDeleteCall { + c := &ProjectsLocationsDeidentifyTemplatesDeleteCall{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 // details. -func (c *ProjectsLocationsContentInspectCall) Fields(s ...googleapi.Field) *ProjectsLocationsContentInspectCall { +func (c *ProjectsLocationsDeidentifyTemplatesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsDeidentifyTemplatesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsContentInspectCall) Context(ctx context.Context) *ProjectsLocationsContentInspectCall { +func (c *ProjectsLocationsDeidentifyTemplatesDeleteCall) Context(ctx context.Context) *ProjectsLocationsDeidentifyTemplatesDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsContentInspectCall) Header() http.Header { +func (c *ProjectsLocationsDeidentifyTemplatesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsContentInspectCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *ProjectsLocationsDeidentifyTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2inspectcontentrequest) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/content:inspect") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parentid, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.locations.content.inspect" call. +// Do executes the "dlp.projects.locations.deidentifyTemplates.delete" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2InspectContentResponse.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 *ProjectsLocationsContentInspectCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2InspectContentResponse, error) { +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsDeidentifyTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20884,7 +21910,7 @@ func (c *ProjectsLocationsContentInspectCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2InspectContentResponse{ + ret := &GoogleProtobufEmpty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20897,87 +21923,87 @@ func (c *ProjectsLocationsContentInspectCall) Do(opts ...googleapi.CallOption) ( return ret, nil } -type ProjectsLocationsContentReidentifyCall struct { - s *Service - parentid string - googleprivacydlpv2reidentifycontentrequest *GooglePrivacyDlpV2ReidentifyContentRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDeidentifyTemplatesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Reidentify: Re-identifies content that has been de-identified. See -// https://cloud.google.com/sensitive-data-protection/docs/pseudonymization#re-identification_in_free_text_code_example +// Get: Gets a DeidentifyTemplate. See +// https://cloud.google.com/sensitive-data-protection/docs/creating-templates-deid // to learn more. // -// - parent: Parent resource name. The format of this value varies depending on -// whether you have specified a processing location -// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` -// LOCATION_ID + Projects scope, no location specified (defaults to global): -// `projects/`PROJECT_ID The following example `parent` string specifies a -// parent project with the identifier `example-project`, and specifies the -// `europe-west3` location for processing data: -// parent=projects/example-project/locations/europe-west3. -func (r *ProjectsLocationsContentService) Reidentify(parentid string, googleprivacydlpv2reidentifycontentrequest *GooglePrivacyDlpV2ReidentifyContentRequest) *ProjectsLocationsContentReidentifyCall { - c := &ProjectsLocationsContentReidentifyCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parentid = parentid - c.googleprivacydlpv2reidentifycontentrequest = googleprivacydlpv2reidentifycontentrequest +// - name: Resource name of the organization and deidentify template to be +// read, for example `organizations/433245324/deidentifyTemplates/432452342` +// or projects/project-id/deidentifyTemplates/432452342. +func (r *ProjectsLocationsDeidentifyTemplatesService) Get(name string) *ProjectsLocationsDeidentifyTemplatesGetCall { + c := &ProjectsLocationsDeidentifyTemplatesGetCall{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 // details. -func (c *ProjectsLocationsContentReidentifyCall) Fields(s ...googleapi.Field) *ProjectsLocationsContentReidentifyCall { +func (c *ProjectsLocationsDeidentifyTemplatesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDeidentifyTemplatesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an 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. +func (c *ProjectsLocationsDeidentifyTemplatesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDeidentifyTemplatesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsContentReidentifyCall) Context(ctx context.Context) *ProjectsLocationsContentReidentifyCall { +func (c *ProjectsLocationsDeidentifyTemplatesGetCall) Context(ctx context.Context) *ProjectsLocationsDeidentifyTemplatesGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsContentReidentifyCall) Header() http.Header { +func (c *ProjectsLocationsDeidentifyTemplatesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsContentReidentifyCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2reidentifycontentrequest) - if err != nil { - return nil, err +func (c *ProjectsLocationsDeidentifyTemplatesGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "v2/{+parent}/content:reidentify") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parentid, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.locations.content.reidentify" call. +// Do executes the "dlp.projects.locations.deidentifyTemplates.get" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2ReidentifyContentResponse.ServerResponse.Header or (if a +// *GooglePrivacyDlpV2DeidentifyTemplate.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 *ProjectsLocationsContentReidentifyCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ReidentifyContentResponse, error) { +func (c *ProjectsLocationsDeidentifyTemplatesGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DeidentifyTemplate, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20996,7 +22022,7 @@ func (c *ProjectsLocationsContentReidentifyCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2ReidentifyContentResponse{ + ret := &GooglePrivacyDlpV2DeidentifyTemplate{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21009,17 +22035,16 @@ func (c *ProjectsLocationsContentReidentifyCall) Do(opts ...googleapi.CallOption return ret, nil } -type ProjectsLocationsDeidentifyTemplatesCreateCall struct { - s *Service - parentid string - googleprivacydlpv2createdeidentifytemplaterequest *GooglePrivacyDlpV2CreateDeidentifyTemplateRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDeidentifyTemplatesListCall struct { + s *Service + parentid string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Create: Creates a DeidentifyTemplate for reusing frequently used -// configuration for de-identifying content, images, and storage. See +// List: Lists DeidentifyTemplates. See // https://cloud.google.com/sensitive-data-protection/docs/creating-templates-deid // to learn more. // @@ -21036,48 +22061,89 @@ type ProjectsLocationsDeidentifyTemplatesCreateCall struct { // identifier `example-project`, and specifies the `europe-west3` location // for processing data: // parent=projects/example-project/locations/europe-west3. -func (r *ProjectsLocationsDeidentifyTemplatesService) Create(parentid string, googleprivacydlpv2createdeidentifytemplaterequest *GooglePrivacyDlpV2CreateDeidentifyTemplateRequest) *ProjectsLocationsDeidentifyTemplatesCreateCall { - c := &ProjectsLocationsDeidentifyTemplatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsLocationsDeidentifyTemplatesService) List(parentid string) *ProjectsLocationsDeidentifyTemplatesListCall { + c := &ProjectsLocationsDeidentifyTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parentid = parentid - c.googleprivacydlpv2createdeidentifytemplaterequest = googleprivacydlpv2createdeidentifytemplaterequest + return c +} + +// LocationId sets the optional parameter "locationId": Deprecated. This field +// has no effect. +func (c *ProjectsLocationsDeidentifyTemplatesListCall) LocationId(locationId string) *ProjectsLocationsDeidentifyTemplatesListCall { + c.urlParams_.Set("locationId", locationId) + return c +} + +// OrderBy sets the optional parameter "orderBy": Comma separated list of +// fields to order by, followed by `asc` or `desc` postfix. This list is case +// insensitive. The default sorting order is ascending. Redundant space +// characters are insignificant. Example: `name asc,update_time, create_time +// desc` Supported fields are: - `create_time`: corresponds to the time the +// template was created. - `update_time`: corresponds to the time the template +// was last updated. - `name`: corresponds to the template's name. - +// `display_name`: corresponds to the template's display name. +func (c *ProjectsLocationsDeidentifyTemplatesListCall) OrderBy(orderBy string) *ProjectsLocationsDeidentifyTemplatesListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageSize sets the optional parameter "pageSize": Size of the page. This +// value can be limited by the server. If zero server returns a page of max +// size 100. +func (c *ProjectsLocationsDeidentifyTemplatesListCall) PageSize(pageSize int64) *ProjectsLocationsDeidentifyTemplatesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": Page token to continue +// retrieval. Comes from the previous call to `ListDeidentifyTemplates`. +func (c *ProjectsLocationsDeidentifyTemplatesListCall) PageToken(pageToken string) *ProjectsLocationsDeidentifyTemplatesListCall { + 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 // details. -func (c *ProjectsLocationsDeidentifyTemplatesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsDeidentifyTemplatesCreateCall { +func (c *ProjectsLocationsDeidentifyTemplatesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDeidentifyTemplatesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an 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. +func (c *ProjectsLocationsDeidentifyTemplatesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDeidentifyTemplatesListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsDeidentifyTemplatesCreateCall) Context(ctx context.Context) *ProjectsLocationsDeidentifyTemplatesCreateCall { +func (c *ProjectsLocationsDeidentifyTemplatesListCall) Context(ctx context.Context) *ProjectsLocationsDeidentifyTemplatesListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsDeidentifyTemplatesCreateCall) Header() http.Header { +func (c *ProjectsLocationsDeidentifyTemplatesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDeidentifyTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createdeidentifytemplaterequest) - if err != nil { - return nil, err +func (c *ProjectsLocationsDeidentifyTemplatesListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "v2/{+parent}/deidentifyTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -21088,13 +22154,13 @@ func (c *ProjectsLocationsDeidentifyTemplatesCreateCall) doRequest(alt string) ( return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.locations.deidentifyTemplates.create" call. +// Do executes the "dlp.projects.locations.deidentifyTemplates.list" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2DeidentifyTemplate.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use +// *GooglePrivacyDlpV2ListDeidentifyTemplatesResponse.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 *ProjectsLocationsDeidentifyTemplatesCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DeidentifyTemplate, error) { +func (c *ProjectsLocationsDeidentifyTemplatesListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListDeidentifyTemplatesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -21113,7 +22179,7 @@ func (c *ProjectsLocationsDeidentifyTemplatesCreateCall) Do(opts ...googleapi.Ca if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2DeidentifyTemplate{ + ret := &GooglePrivacyDlpV2ListDeidentifyTemplatesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21126,59 +22192,85 @@ func (c *ProjectsLocationsDeidentifyTemplatesCreateCall) Do(opts ...googleapi.Ca return ret, nil } -type ProjectsLocationsDeidentifyTemplatesDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// 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 *ProjectsLocationsDeidentifyTemplatesListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListDeidentifyTemplatesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + 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) + } } -// Delete: Deletes a DeidentifyTemplate. See +type ProjectsLocationsDeidentifyTemplatesPatchCall struct { + s *Service + name string + googleprivacydlpv2updatedeidentifytemplaterequest *GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates the DeidentifyTemplate. See // https://cloud.google.com/sensitive-data-protection/docs/creating-templates-deid // to learn more. -// -// - name: Resource name of the organization and deidentify template to be -// deleted, for example -// `organizations/433245324/deidentifyTemplates/432452342` or +// +// - name: Resource name of organization and deidentify template to be updated, +// for example `organizations/433245324/deidentifyTemplates/432452342` or // projects/project-id/deidentifyTemplates/432452342. -func (r *ProjectsLocationsDeidentifyTemplatesService) Delete(name string) *ProjectsLocationsDeidentifyTemplatesDeleteCall { - c := &ProjectsLocationsDeidentifyTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsLocationsDeidentifyTemplatesService) Patch(name string, googleprivacydlpv2updatedeidentifytemplaterequest *GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest) *ProjectsLocationsDeidentifyTemplatesPatchCall { + c := &ProjectsLocationsDeidentifyTemplatesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.googleprivacydlpv2updatedeidentifytemplaterequest = googleprivacydlpv2updatedeidentifytemplaterequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsDeidentifyTemplatesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsDeidentifyTemplatesDeleteCall { +func (c *ProjectsLocationsDeidentifyTemplatesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsDeidentifyTemplatesPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsDeidentifyTemplatesDeleteCall) Context(ctx context.Context) *ProjectsLocationsDeidentifyTemplatesDeleteCall { +func (c *ProjectsLocationsDeidentifyTemplatesPatchCall) Context(ctx context.Context) *ProjectsLocationsDeidentifyTemplatesPatchCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsDeidentifyTemplatesDeleteCall) Header() http.Header { +func (c *ProjectsLocationsDeidentifyTemplatesPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDeidentifyTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *ProjectsLocationsDeidentifyTemplatesPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatedeidentifytemplaterequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -21189,13 +22281,13 @@ func (c *ProjectsLocationsDeidentifyTemplatesDeleteCall) doRequest(alt string) ( return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.locations.deidentifyTemplates.delete" call. +// Do executes the "dlp.projects.locations.deidentifyTemplates.patch" call. // Any non-2xx status code is an error. Response headers are in either -// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsLocationsDeidentifyTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { +// *GooglePrivacyDlpV2DeidentifyTemplate.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 *ProjectsLocationsDeidentifyTemplatesPatchCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DeidentifyTemplate, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -21214,7 +22306,7 @@ func (c *ProjectsLocationsDeidentifyTemplatesDeleteCall) Do(opts ...googleapi.Ca if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleProtobufEmpty{ + ret := &GooglePrivacyDlpV2DeidentifyTemplate{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21227,87 +22319,83 @@ func (c *ProjectsLocationsDeidentifyTemplatesDeleteCall) Do(opts ...googleapi.Ca return ret, nil } -type ProjectsLocationsDeidentifyTemplatesGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDiscoveryConfigsCreateCall struct { + s *Service + parentid string + googleprivacydlpv2creatediscoveryconfigrequest *GooglePrivacyDlpV2CreateDiscoveryConfigRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a DeidentifyTemplate. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-templates-deid -// to learn more. +// Create: Creates a config for discovery to scan and profile storage. // -// - name: Resource name of the organization and deidentify template to be -// read, for example `organizations/433245324/deidentifyTemplates/432452342` -// or projects/project-id/deidentifyTemplates/432452342. -func (r *ProjectsLocationsDeidentifyTemplatesService) Get(name string) *ProjectsLocationsDeidentifyTemplatesGetCall { - c := &ProjectsLocationsDeidentifyTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: Parent resource name. The format of this value varies depending on +// the scope of the request (project or organization): + Projects scope: +// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Organizations scope: +// `organizations/`ORG_ID`/locations/`LOCATION_ID The following example +// `parent` string specifies a parent project with the identifier +// `example-project`, and specifies the `europe-west3` location for +// processing data: parent=projects/example-project/locations/europe-west3. +func (r *ProjectsLocationsDiscoveryConfigsService) Create(parentid string, googleprivacydlpv2creatediscoveryconfigrequest *GooglePrivacyDlpV2CreateDiscoveryConfigRequest) *ProjectsLocationsDiscoveryConfigsCreateCall { + c := &ProjectsLocationsDiscoveryConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parentid = parentid + c.googleprivacydlpv2creatediscoveryconfigrequest = googleprivacydlpv2creatediscoveryconfigrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsDeidentifyTemplatesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDeidentifyTemplatesGetCall { +func (c *ProjectsLocationsDiscoveryConfigsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsDiscoveryConfigsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an 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. -func (c *ProjectsLocationsDeidentifyTemplatesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDeidentifyTemplatesGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsDeidentifyTemplatesGetCall) Context(ctx context.Context) *ProjectsLocationsDeidentifyTemplatesGetCall { +func (c *ProjectsLocationsDiscoveryConfigsCreateCall) Context(ctx context.Context) *ProjectsLocationsDiscoveryConfigsCreateCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsDeidentifyTemplatesGetCall) Header() http.Header { +func (c *ProjectsLocationsDiscoveryConfigsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDeidentifyTemplatesGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *ProjectsLocationsDiscoveryConfigsCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2creatediscoveryconfigrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/discoveryConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parentid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.locations.deidentifyTemplates.get" call. +// Do executes the "dlp.projects.locations.discoveryConfigs.create" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2DeidentifyTemplate.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use +// *GooglePrivacyDlpV2DiscoveryConfig.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 *ProjectsLocationsDeidentifyTemplatesGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DeidentifyTemplate, error) { +func (c *ProjectsLocationsDiscoveryConfigsCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DiscoveryConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -21326,7 +22414,7 @@ func (c *ProjectsLocationsDeidentifyTemplatesGetCall) Do(opts ...googleapi.CallO if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2DeidentifyTemplate{ + ret := &GooglePrivacyDlpV2DiscoveryConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21339,132 +22427,72 @@ func (c *ProjectsLocationsDeidentifyTemplatesGetCall) Do(opts ...googleapi.CallO return ret, nil } -type ProjectsLocationsDeidentifyTemplatesListCall struct { - s *Service - parentid string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDiscoveryConfigsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists DeidentifyTemplates. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-templates-deid -// to learn more. +// Delete: Deletes a discovery configuration. // -// - parent: Parent resource name. The format of this value varies depending on -// the scope of the request (project or organization) and whether you have -// specified a processing location -// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` -// LOCATION_ID + Projects scope, no location specified (defaults to global): -// `projects/`PROJECT_ID + Organizations scope, location specified: -// `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no -// location specified (defaults to global): `organizations/`ORG_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: -// parent=projects/example-project/locations/europe-west3. -func (r *ProjectsLocationsDeidentifyTemplatesService) List(parentid string) *ProjectsLocationsDeidentifyTemplatesListCall { - c := &ProjectsLocationsDeidentifyTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parentid = parentid - return c -} - -// LocationId sets the optional parameter "locationId": Deprecated. This field -// has no effect. -func (c *ProjectsLocationsDeidentifyTemplatesListCall) LocationId(locationId string) *ProjectsLocationsDeidentifyTemplatesListCall { - c.urlParams_.Set("locationId", locationId) - return c -} - -// OrderBy sets the optional parameter "orderBy": Comma separated list of -// fields to order by, followed by `asc` or `desc` postfix. This list is case -// insensitive. The default sorting order is ascending. Redundant space -// characters are insignificant. Example: `name asc,update_time, create_time -// desc` Supported fields are: - `create_time`: corresponds to the time the -// template was created. - `update_time`: corresponds to the time the template -// was last updated. - `name`: corresponds to the template's name. - -// `display_name`: corresponds to the template's display name. -func (c *ProjectsLocationsDeidentifyTemplatesListCall) OrderBy(orderBy string) *ProjectsLocationsDeidentifyTemplatesListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageSize sets the optional parameter "pageSize": Size of the page. This -// value can be limited by the server. If zero server returns a page of max -// size 100. -func (c *ProjectsLocationsDeidentifyTemplatesListCall) PageSize(pageSize int64) *ProjectsLocationsDeidentifyTemplatesListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": Page token to continue -// retrieval. Comes from the previous call to `ListDeidentifyTemplates`. -func (c *ProjectsLocationsDeidentifyTemplatesListCall) PageToken(pageToken string) *ProjectsLocationsDeidentifyTemplatesListCall { - c.urlParams_.Set("pageToken", pageToken) +// - name: Resource name of the project and the config, for example +// `projects/dlp-test-project/discoveryConfigs/53234423`. +func (r *ProjectsLocationsDiscoveryConfigsService) Delete(name string) *ProjectsLocationsDiscoveryConfigsDeleteCall { + c := &ProjectsLocationsDiscoveryConfigsDeleteCall{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 // details. -func (c *ProjectsLocationsDeidentifyTemplatesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDeidentifyTemplatesListCall { +func (c *ProjectsLocationsDiscoveryConfigsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsDiscoveryConfigsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an 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. -func (c *ProjectsLocationsDeidentifyTemplatesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDeidentifyTemplatesListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsDeidentifyTemplatesListCall) Context(ctx context.Context) *ProjectsLocationsDeidentifyTemplatesListCall { +func (c *ProjectsLocationsDiscoveryConfigsDeleteCall) Context(ctx context.Context) *ProjectsLocationsDiscoveryConfigsDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsDeidentifyTemplatesListCall) Header() http.Header { +func (c *ProjectsLocationsDiscoveryConfigsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDeidentifyTemplatesListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDiscoveryConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - 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, "v2/{+parent}/deidentifyTemplates") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parentid, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.locations.deidentifyTemplates.list" call. +// Do executes the "dlp.projects.locations.discoveryConfigs.delete" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2ListDeidentifyTemplatesResponse.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 *ProjectsLocationsDeidentifyTemplatesListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListDeidentifyTemplatesResponse, error) { +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsDiscoveryConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -21483,7 +22511,7 @@ func (c *ProjectsLocationsDeidentifyTemplatesListCall) Do(opts ...googleapi.Call if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2ListDeidentifyTemplatesResponse{ + ret := &GoogleProtobufEmpty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21496,85 +22524,67 @@ func (c *ProjectsLocationsDeidentifyTemplatesListCall) Do(opts ...googleapi.Call return ret, nil } -// 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 *ProjectsLocationsDeidentifyTemplatesListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListDeidentifyTemplatesResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type ProjectsLocationsDeidentifyTemplatesPatchCall struct { - s *Service - name string - googleprivacydlpv2updatedeidentifytemplaterequest *GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Patch: Updates the DeidentifyTemplate. See -// https://cloud.google.com/sensitive-data-protection/docs/creating-templates-deid -// to learn more. +type ProjectsLocationsDiscoveryConfigsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a discovery configuration. // -// - name: Resource name of organization and deidentify template to be updated, -// for example `organizations/433245324/deidentifyTemplates/432452342` or -// projects/project-id/deidentifyTemplates/432452342. -func (r *ProjectsLocationsDeidentifyTemplatesService) Patch(name string, googleprivacydlpv2updatedeidentifytemplaterequest *GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest) *ProjectsLocationsDeidentifyTemplatesPatchCall { - c := &ProjectsLocationsDeidentifyTemplatesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Resource name of the project and the configuration, for example +// `projects/dlp-test-project/discoveryConfigs/53234423`. +func (r *ProjectsLocationsDiscoveryConfigsService) Get(name string) *ProjectsLocationsDiscoveryConfigsGetCall { + c := &ProjectsLocationsDiscoveryConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googleprivacydlpv2updatedeidentifytemplaterequest = googleprivacydlpv2updatedeidentifytemplaterequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsDeidentifyTemplatesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsDeidentifyTemplatesPatchCall { +func (c *ProjectsLocationsDiscoveryConfigsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDiscoveryConfigsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an 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. +func (c *ProjectsLocationsDiscoveryConfigsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDiscoveryConfigsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsDeidentifyTemplatesPatchCall) Context(ctx context.Context) *ProjectsLocationsDeidentifyTemplatesPatchCall { +func (c *ProjectsLocationsDiscoveryConfigsGetCall) Context(ctx context.Context) *ProjectsLocationsDiscoveryConfigsGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsDeidentifyTemplatesPatchCall) Header() http.Header { +func (c *ProjectsLocationsDiscoveryConfigsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDeidentifyTemplatesPatchCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatedeidentifytemplaterequest) - if err != nil { - return nil, err +func (c *ProjectsLocationsDiscoveryConfigsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -21585,13 +22595,13 @@ func (c *ProjectsLocationsDeidentifyTemplatesPatchCall) doRequest(alt string) (* return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.locations.deidentifyTemplates.patch" call. +// Do executes the "dlp.projects.locations.discoveryConfigs.get" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2DeidentifyTemplate.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use +// *GooglePrivacyDlpV2DiscoveryConfig.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 *ProjectsLocationsDeidentifyTemplatesPatchCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DeidentifyTemplate, error) { +func (c *ProjectsLocationsDiscoveryConfigsGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DiscoveryConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -21610,7 +22620,7 @@ func (c *ProjectsLocationsDeidentifyTemplatesPatchCall) Do(opts ...googleapi.Cal if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2DeidentifyTemplate{ + ret := &GooglePrivacyDlpV2DiscoveryConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21623,66 +22633,97 @@ func (c *ProjectsLocationsDeidentifyTemplatesPatchCall) Do(opts ...googleapi.Cal return ret, nil } -type ProjectsLocationsDiscoveryConfigsCreateCall struct { - s *Service - parentid string - googleprivacydlpv2creatediscoveryconfigrequest *GooglePrivacyDlpV2CreateDiscoveryConfigRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDiscoveryConfigsListCall struct { + s *Service + parentid string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Create: Creates a config for discovery to scan and profile storage. +// List: Lists discovery configurations. // -// - parent: Parent resource name. The format of this value varies depending on -// the scope of the request (project or organization): + Projects scope: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Organizations scope: -// `organizations/`ORG_ID`/locations/`LOCATION_ID The following example +// - parent: Parent resource name. The format of this value is as follows: +// `projects/`PROJECT_ID`/locations/`LOCATION_ID The following example // `parent` string specifies a parent project with the identifier // `example-project`, and specifies the `europe-west3` location for // processing data: parent=projects/example-project/locations/europe-west3. -func (r *ProjectsLocationsDiscoveryConfigsService) Create(parentid string, googleprivacydlpv2creatediscoveryconfigrequest *GooglePrivacyDlpV2CreateDiscoveryConfigRequest) *ProjectsLocationsDiscoveryConfigsCreateCall { - c := &ProjectsLocationsDiscoveryConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsLocationsDiscoveryConfigsService) List(parentid string) *ProjectsLocationsDiscoveryConfigsListCall { + c := &ProjectsLocationsDiscoveryConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parentid = parentid - c.googleprivacydlpv2creatediscoveryconfigrequest = googleprivacydlpv2creatediscoveryconfigrequest + return c +} + +// OrderBy sets the optional parameter "orderBy": Comma separated list of +// config fields to order by, followed by `asc` or `desc` postfix. This list is +// case insensitive. The default sorting order is ascending. Redundant space +// characters are insignificant. Example: `name asc,update_time, create_time +// desc` Supported fields are: - `last_run_time`: corresponds to the last time +// the DiscoveryConfig ran. - `name`: corresponds to the DiscoveryConfig's +// name. - `status`: corresponds to DiscoveryConfig's status. +func (c *ProjectsLocationsDiscoveryConfigsListCall) OrderBy(orderBy string) *ProjectsLocationsDiscoveryConfigsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageSize sets the optional parameter "pageSize": Size of the page. This +// value can be limited by a server. +func (c *ProjectsLocationsDiscoveryConfigsListCall) PageSize(pageSize int64) *ProjectsLocationsDiscoveryConfigsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": Page token to continue +// retrieval. Comes from the previous call to ListDiscoveryConfigs. `order_by` +// field must not change for subsequent calls. +func (c *ProjectsLocationsDiscoveryConfigsListCall) PageToken(pageToken string) *ProjectsLocationsDiscoveryConfigsListCall { + 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 // details. -func (c *ProjectsLocationsDiscoveryConfigsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsDiscoveryConfigsCreateCall { +func (c *ProjectsLocationsDiscoveryConfigsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDiscoveryConfigsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an 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. +func (c *ProjectsLocationsDiscoveryConfigsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDiscoveryConfigsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsDiscoveryConfigsCreateCall) Context(ctx context.Context) *ProjectsLocationsDiscoveryConfigsCreateCall { +func (c *ProjectsLocationsDiscoveryConfigsListCall) Context(ctx context.Context) *ProjectsLocationsDiscoveryConfigsListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsDiscoveryConfigsCreateCall) Header() http.Header { +func (c *ProjectsLocationsDiscoveryConfigsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDiscoveryConfigsCreateCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2creatediscoveryconfigrequest) - if err != nil { - return nil, err +func (c *ProjectsLocationsDiscoveryConfigsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "v2/{+parent}/discoveryConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -21693,13 +22734,13 @@ func (c *ProjectsLocationsDiscoveryConfigsCreateCall) doRequest(alt string) (*ht return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.locations.discoveryConfigs.create" call. +// Do executes the "dlp.projects.locations.discoveryConfigs.list" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2DiscoveryConfig.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use +// *GooglePrivacyDlpV2ListDiscoveryConfigsResponse.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 *ProjectsLocationsDiscoveryConfigsCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DiscoveryConfig, error) { +func (c *ProjectsLocationsDiscoveryConfigsListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListDiscoveryConfigsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -21718,7 +22759,7 @@ func (c *ProjectsLocationsDiscoveryConfigsCreateCall) Do(opts ...googleapi.CallO if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2DiscoveryConfig{ + ret := &GooglePrivacyDlpV2ListDiscoveryConfigsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21731,55 +22772,82 @@ func (c *ProjectsLocationsDiscoveryConfigsCreateCall) Do(opts ...googleapi.CallO return ret, nil } -type ProjectsLocationsDiscoveryConfigsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// 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 *ProjectsLocationsDiscoveryConfigsListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListDiscoveryConfigsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + 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) + } } -// Delete: Deletes a discovery configuration. +type ProjectsLocationsDiscoveryConfigsPatchCall struct { + s *Service + name string + googleprivacydlpv2updatediscoveryconfigrequest *GooglePrivacyDlpV2UpdateDiscoveryConfigRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates a discovery configuration. // -// - name: Resource name of the project and the config, for example +// - name: Resource name of the project and the configuration, for example // `projects/dlp-test-project/discoveryConfigs/53234423`. -func (r *ProjectsLocationsDiscoveryConfigsService) Delete(name string) *ProjectsLocationsDiscoveryConfigsDeleteCall { - c := &ProjectsLocationsDiscoveryConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsLocationsDiscoveryConfigsService) Patch(name string, googleprivacydlpv2updatediscoveryconfigrequest *GooglePrivacyDlpV2UpdateDiscoveryConfigRequest) *ProjectsLocationsDiscoveryConfigsPatchCall { + c := &ProjectsLocationsDiscoveryConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.googleprivacydlpv2updatediscoveryconfigrequest = googleprivacydlpv2updatediscoveryconfigrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsDiscoveryConfigsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsDiscoveryConfigsDeleteCall { +func (c *ProjectsLocationsDiscoveryConfigsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsDiscoveryConfigsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsDiscoveryConfigsDeleteCall) Context(ctx context.Context) *ProjectsLocationsDiscoveryConfigsDeleteCall { +func (c *ProjectsLocationsDiscoveryConfigsPatchCall) Context(ctx context.Context) *ProjectsLocationsDiscoveryConfigsPatchCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsDiscoveryConfigsDeleteCall) Header() http.Header { +func (c *ProjectsLocationsDiscoveryConfigsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDiscoveryConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *ProjectsLocationsDiscoveryConfigsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatediscoveryconfigrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -21790,13 +22858,13 @@ func (c *ProjectsLocationsDiscoveryConfigsDeleteCall) doRequest(alt string) (*ht return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.locations.discoveryConfigs.delete" call. +// Do executes the "dlp.projects.locations.discoveryConfigs.patch" call. // Any non-2xx status code is an error. Response headers are in either -// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsLocationsDiscoveryConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { +// *GooglePrivacyDlpV2DiscoveryConfig.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 *ProjectsLocationsDiscoveryConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DiscoveryConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -21815,7 +22883,7 @@ func (c *ProjectsLocationsDiscoveryConfigsDeleteCall) Do(opts ...googleapi.CallO if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleProtobufEmpty{ + ret := &GooglePrivacyDlpV2DiscoveryConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21828,67 +22896,66 @@ func (c *ProjectsLocationsDiscoveryConfigsDeleteCall) Do(opts ...googleapi.CallO return ret, nil } -type ProjectsLocationsDiscoveryConfigsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDlpJobsCancelCall struct { + s *Service + name string + googleprivacydlpv2canceldlpjobrequest *GooglePrivacyDlpV2CancelDlpJobRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a discovery configuration. +// Cancel: Starts asynchronous cancellation on a long-running DlpJob. The +// server makes a best effort to cancel the DlpJob, but success is not +// guaranteed. See +// https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage +// and +// https://cloud.google.com/sensitive-data-protection/docs/compute-risk-analysis +// to learn more. // -// - name: Resource name of the project and the configuration, for example -// `projects/dlp-test-project/discoveryConfigs/53234423`. -func (r *ProjectsLocationsDiscoveryConfigsService) Get(name string) *ProjectsLocationsDiscoveryConfigsGetCall { - c := &ProjectsLocationsDiscoveryConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the DlpJob resource to be cancelled. +func (r *ProjectsLocationsDlpJobsService) Cancel(name string, googleprivacydlpv2canceldlpjobrequest *GooglePrivacyDlpV2CancelDlpJobRequest) *ProjectsLocationsDlpJobsCancelCall { + c := &ProjectsLocationsDlpJobsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.googleprivacydlpv2canceldlpjobrequest = googleprivacydlpv2canceldlpjobrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsDiscoveryConfigsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDiscoveryConfigsGetCall { +func (c *ProjectsLocationsDlpJobsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsDlpJobsCancelCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an 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. -func (c *ProjectsLocationsDiscoveryConfigsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDiscoveryConfigsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsDiscoveryConfigsGetCall) Context(ctx context.Context) *ProjectsLocationsDiscoveryConfigsGetCall { +func (c *ProjectsLocationsDlpJobsCancelCall) Context(ctx context.Context) *ProjectsLocationsDlpJobsCancelCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsDiscoveryConfigsGetCall) Header() http.Header { +func (c *ProjectsLocationsDlpJobsCancelCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDiscoveryConfigsGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *ProjectsLocationsDlpJobsCancelCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2canceldlpjobrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -21899,13 +22966,13 @@ func (c *ProjectsLocationsDiscoveryConfigsGetCall) doRequest(alt string) (*http. return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.locations.discoveryConfigs.get" call. +// Do executes the "dlp.projects.locations.dlpJobs.cancel" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2DiscoveryConfig.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 *ProjectsLocationsDiscoveryConfigsGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DiscoveryConfig, error) { +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsDlpJobsCancelCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -21924,7 +22991,7 @@ func (c *ProjectsLocationsDiscoveryConfigsGetCall) Do(opts ...googleapi.CallOpti if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2DiscoveryConfig{ + ret := &GoogleProtobufEmpty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21937,97 +23004,74 @@ func (c *ProjectsLocationsDiscoveryConfigsGetCall) Do(opts ...googleapi.CallOpti return ret, nil } -type ProjectsLocationsDiscoveryConfigsListCall struct { - s *Service - parentid string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDlpJobsCreateCall struct { + s *Service + parentid string + googleprivacydlpv2createdlpjobrequest *GooglePrivacyDlpV2CreateDlpJobRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists discovery configurations. +// Create: Creates a new job to inspect storage or calculate risk metrics. See +// https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage +// and +// https://cloud.google.com/sensitive-data-protection/docs/compute-risk-analysis +// to learn more. When no InfoTypes or CustomInfoTypes are specified in inspect +// jobs, the system will automatically choose what detectors to run. By default +// this may be all types, but may change over time as detectors are updated. // -// - parent: Parent resource name. The format of this value is as follows: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID The following example -// `parent` string specifies a parent project with the identifier -// `example-project`, and specifies the `europe-west3` location for -// processing data: parent=projects/example-project/locations/europe-west3. -func (r *ProjectsLocationsDiscoveryConfigsService) List(parentid string) *ProjectsLocationsDiscoveryConfigsListCall { - c := &ProjectsLocationsDiscoveryConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: Parent resource name. The format of this value varies depending on +// whether you have specified a processing location +// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: +// parent=projects/example-project/locations/europe-west3. +func (r *ProjectsLocationsDlpJobsService) Create(parentid string, googleprivacydlpv2createdlpjobrequest *GooglePrivacyDlpV2CreateDlpJobRequest) *ProjectsLocationsDlpJobsCreateCall { + c := &ProjectsLocationsDlpJobsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parentid = parentid - return c -} - -// OrderBy sets the optional parameter "orderBy": Comma separated list of -// config fields to order by, followed by `asc` or `desc` postfix. This list is -// case insensitive. The default sorting order is ascending. Redundant space -// characters are insignificant. Example: `name asc,update_time, create_time -// desc` Supported fields are: - `last_run_time`: corresponds to the last time -// the DiscoveryConfig ran. - `name`: corresponds to the DiscoveryConfig's -// name. - `status`: corresponds to DiscoveryConfig's status. -func (c *ProjectsLocationsDiscoveryConfigsListCall) OrderBy(orderBy string) *ProjectsLocationsDiscoveryConfigsListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageSize sets the optional parameter "pageSize": Size of the page. This -// value can be limited by a server. -func (c *ProjectsLocationsDiscoveryConfigsListCall) PageSize(pageSize int64) *ProjectsLocationsDiscoveryConfigsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": Page token to continue -// retrieval. Comes from the previous call to ListDiscoveryConfigs. `order_by` -// field must not change for subsequent calls. -func (c *ProjectsLocationsDiscoveryConfigsListCall) PageToken(pageToken string) *ProjectsLocationsDiscoveryConfigsListCall { - c.urlParams_.Set("pageToken", pageToken) + c.googleprivacydlpv2createdlpjobrequest = googleprivacydlpv2createdlpjobrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsDiscoveryConfigsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDiscoveryConfigsListCall { +func (c *ProjectsLocationsDlpJobsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsDlpJobsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an 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. -func (c *ProjectsLocationsDiscoveryConfigsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDiscoveryConfigsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsDiscoveryConfigsListCall) Context(ctx context.Context) *ProjectsLocationsDiscoveryConfigsListCall { +func (c *ProjectsLocationsDlpJobsCreateCall) Context(ctx context.Context) *ProjectsLocationsDlpJobsCreateCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsDiscoveryConfigsListCall) Header() http.Header { +func (c *ProjectsLocationsDlpJobsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDiscoveryConfigsListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *ProjectsLocationsDlpJobsCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createdlpjobrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/discoveryConfigs") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/dlpJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -22038,13 +23082,13 @@ func (c *ProjectsLocationsDiscoveryConfigsListCall) doRequest(alt string) (*http return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.locations.discoveryConfigs.list" call. +// Do executes the "dlp.projects.locations.dlpJobs.create" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2ListDiscoveryConfigsResponse.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. Use +// *GooglePrivacyDlpV2DlpJob.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 *ProjectsLocationsDiscoveryConfigsListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListDiscoveryConfigsResponse, error) { +func (c *ProjectsLocationsDlpJobsCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DlpJob, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -22063,7 +23107,7 @@ func (c *ProjectsLocationsDiscoveryConfigsListCall) Do(opts ...googleapi.CallOpt if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2ListDiscoveryConfigsResponse{ + ret := &GooglePrivacyDlpV2DlpJob{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -22076,82 +23120,60 @@ func (c *ProjectsLocationsDiscoveryConfigsListCall) Do(opts ...googleapi.CallOpt return ret, nil } -// 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 *ProjectsLocationsDiscoveryConfigsListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListDiscoveryConfigsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type ProjectsLocationsDiscoveryConfigsPatchCall struct { - s *Service - name string - googleprivacydlpv2updatediscoveryconfigrequest *GooglePrivacyDlpV2UpdateDiscoveryConfigRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDlpJobsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates a discovery configuration. +// Delete: Deletes a long-running DlpJob. This method indicates that the client +// is no longer interested in the DlpJob result. The job will be canceled if +// possible. See +// https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage +// and +// https://cloud.google.com/sensitive-data-protection/docs/compute-risk-analysis +// to learn more. // -// - name: Resource name of the project and the configuration, for example -// `projects/dlp-test-project/discoveryConfigs/53234423`. -func (r *ProjectsLocationsDiscoveryConfigsService) Patch(name string, googleprivacydlpv2updatediscoveryconfigrequest *GooglePrivacyDlpV2UpdateDiscoveryConfigRequest) *ProjectsLocationsDiscoveryConfigsPatchCall { - c := &ProjectsLocationsDiscoveryConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the DlpJob resource to be deleted. +func (r *ProjectsLocationsDlpJobsService) Delete(name string) *ProjectsLocationsDlpJobsDeleteCall { + c := &ProjectsLocationsDlpJobsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googleprivacydlpv2updatediscoveryconfigrequest = googleprivacydlpv2updatediscoveryconfigrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsDiscoveryConfigsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsDiscoveryConfigsPatchCall { +func (c *ProjectsLocationsDlpJobsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsDlpJobsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsDiscoveryConfigsPatchCall) Context(ctx context.Context) *ProjectsLocationsDiscoveryConfigsPatchCall { +func (c *ProjectsLocationsDlpJobsDeleteCall) Context(ctx context.Context) *ProjectsLocationsDlpJobsDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsDiscoveryConfigsPatchCall) Header() http.Header { +func (c *ProjectsLocationsDlpJobsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDiscoveryConfigsPatchCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *ProjectsLocationsDlpJobsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatediscoveryconfigrequest) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -22162,13 +23184,13 @@ func (c *ProjectsLocationsDiscoveryConfigsPatchCall) doRequest(alt string) (*htt return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.locations.discoveryConfigs.patch" call. +// Do executes the "dlp.projects.locations.dlpJobs.delete" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2DiscoveryConfig.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 *ProjectsLocationsDiscoveryConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DiscoveryConfig, error) { +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsDlpJobsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -22187,7 +23209,7 @@ func (c *ProjectsLocationsDiscoveryConfigsPatchCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2DiscoveryConfig{ + ret := &GoogleProtobufEmpty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -22200,64 +23222,59 @@ func (c *ProjectsLocationsDiscoveryConfigsPatchCall) Do(opts ...googleapi.CallOp return ret, nil } -type ProjectsLocationsDlpJobsCancelCall struct { +type ProjectsLocationsDlpJobsFinishCall struct { s *Service name string - googleprivacydlpv2canceldlpjobrequest *GooglePrivacyDlpV2CancelDlpJobRequest + googleprivacydlpv2finishdlpjobrequest *GooglePrivacyDlpV2FinishDlpJobRequest urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Cancel: Starts asynchronous cancellation on a long-running DlpJob. The -// server makes a best effort to cancel the DlpJob, but success is not -// guaranteed. See -// https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage -// and -// https://cloud.google.com/sensitive-data-protection/docs/compute-risk-analysis -// to learn more. +// Finish: Finish a running hybrid DlpJob. Triggers the finalization steps and +// running of any enabled actions that have not yet run. // -// - name: The name of the DlpJob resource to be cancelled. -func (r *ProjectsLocationsDlpJobsService) Cancel(name string, googleprivacydlpv2canceldlpjobrequest *GooglePrivacyDlpV2CancelDlpJobRequest) *ProjectsLocationsDlpJobsCancelCall { - c := &ProjectsLocationsDlpJobsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the DlpJob resource to be finished. +func (r *ProjectsLocationsDlpJobsService) Finish(name string, googleprivacydlpv2finishdlpjobrequest *GooglePrivacyDlpV2FinishDlpJobRequest) *ProjectsLocationsDlpJobsFinishCall { + c := &ProjectsLocationsDlpJobsFinishCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googleprivacydlpv2canceldlpjobrequest = googleprivacydlpv2canceldlpjobrequest + c.googleprivacydlpv2finishdlpjobrequest = googleprivacydlpv2finishdlpjobrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsDlpJobsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsDlpJobsCancelCall { +func (c *ProjectsLocationsDlpJobsFinishCall) Fields(s ...googleapi.Field) *ProjectsLocationsDlpJobsFinishCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsDlpJobsCancelCall) Context(ctx context.Context) *ProjectsLocationsDlpJobsCancelCall { +func (c *ProjectsLocationsDlpJobsFinishCall) Context(ctx context.Context) *ProjectsLocationsDlpJobsFinishCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsDlpJobsCancelCall) Header() http.Header { +func (c *ProjectsLocationsDlpJobsFinishCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDlpJobsCancelCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDlpJobsFinishCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2canceldlpjobrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2finishdlpjobrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:cancel") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:finish") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -22270,13 +23287,13 @@ func (c *ProjectsLocationsDlpJobsCancelCall) doRequest(alt string) (*http.Respon return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.locations.dlpJobs.cancel" call. +// Do executes the "dlp.projects.locations.dlpJobs.finish" call. // Any non-2xx status code is an error. Response headers are in either // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified was // returned. -func (c *ProjectsLocationsDlpJobsCancelCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { +func (c *ProjectsLocationsDlpJobsFinishCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -22308,91 +23325,87 @@ func (c *ProjectsLocationsDlpJobsCancelCall) Do(opts ...googleapi.CallOption) (* return ret, nil } -type ProjectsLocationsDlpJobsCreateCall struct { - s *Service - parentid string - googleprivacydlpv2createdlpjobrequest *GooglePrivacyDlpV2CreateDlpJobRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDlpJobsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Create: Creates a new job to inspect storage or calculate risk metrics. See +// Get: Gets the latest state of a long-running DlpJob. See // https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage // and // https://cloud.google.com/sensitive-data-protection/docs/compute-risk-analysis -// to learn more. When no InfoTypes or CustomInfoTypes are specified in inspect -// jobs, the system will automatically choose what detectors to run. By default -// this may be all types, but may change over time as detectors are updated. +// to learn more. // -// - parent: Parent resource name. The format of this value varies depending on -// whether you have specified a processing location -// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` -// LOCATION_ID + Projects scope, no location specified (defaults to global): -// `projects/`PROJECT_ID The following example `parent` string specifies a -// parent project with the identifier `example-project`, and specifies the -// `europe-west3` location for processing data: -// parent=projects/example-project/locations/europe-west3. -func (r *ProjectsLocationsDlpJobsService) Create(parentid string, googleprivacydlpv2createdlpjobrequest *GooglePrivacyDlpV2CreateDlpJobRequest) *ProjectsLocationsDlpJobsCreateCall { - c := &ProjectsLocationsDlpJobsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parentid = parentid - c.googleprivacydlpv2createdlpjobrequest = googleprivacydlpv2createdlpjobrequest +// - name: The name of the DlpJob resource. +func (r *ProjectsLocationsDlpJobsService) Get(name string) *ProjectsLocationsDlpJobsGetCall { + c := &ProjectsLocationsDlpJobsGetCall{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 // details. -func (c *ProjectsLocationsDlpJobsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsDlpJobsCreateCall { +func (c *ProjectsLocationsDlpJobsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDlpJobsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an 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. +func (c *ProjectsLocationsDlpJobsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDlpJobsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsDlpJobsCreateCall) Context(ctx context.Context) *ProjectsLocationsDlpJobsCreateCall { +func (c *ProjectsLocationsDlpJobsGetCall) Context(ctx context.Context) *ProjectsLocationsDlpJobsGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsDlpJobsCreateCall) Header() http.Header { +func (c *ProjectsLocationsDlpJobsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDlpJobsCreateCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createdlpjobrequest) - if err != nil { - return nil, err +func (c *ProjectsLocationsDlpJobsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "v2/{+parent}/dlpJobs") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parentid, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.locations.dlpJobs.create" call. +// Do executes the "dlp.projects.locations.dlpJobs.get" call. // Any non-2xx status code is an error. Response headers are in either // *GooglePrivacyDlpV2DlpJob.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 *ProjectsLocationsDlpJobsCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DlpJob, error) { +func (c *ProjectsLocationsDlpJobsGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DlpJob, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -22424,60 +23437,62 @@ func (c *ProjectsLocationsDlpJobsCreateCall) Do(opts ...googleapi.CallOption) (* return ret, nil } -type ProjectsLocationsDlpJobsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDlpJobsHybridInspectCall struct { + s *Service + name string + googleprivacydlpv2hybridinspectdlpjobrequest *GooglePrivacyDlpV2HybridInspectDlpJobRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a long-running DlpJob. This method indicates that the client -// is no longer interested in the DlpJob result. The job will be canceled if -// possible. See -// https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage -// and -// https://cloud.google.com/sensitive-data-protection/docs/compute-risk-analysis -// to learn more. +// HybridInspect: Inspect hybrid content and store findings to a job. To review +// the findings, inspect the job. Inspection will occur asynchronously. // -// - name: The name of the DlpJob resource to be deleted. -func (r *ProjectsLocationsDlpJobsService) Delete(name string) *ProjectsLocationsDlpJobsDeleteCall { - c := &ProjectsLocationsDlpJobsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Resource name of the job to execute a hybrid inspect on, for example +// `projects/dlp-test-project/dlpJob/53234423`. +func (r *ProjectsLocationsDlpJobsService) HybridInspect(name string, googleprivacydlpv2hybridinspectdlpjobrequest *GooglePrivacyDlpV2HybridInspectDlpJobRequest) *ProjectsLocationsDlpJobsHybridInspectCall { + c := &ProjectsLocationsDlpJobsHybridInspectCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.googleprivacydlpv2hybridinspectdlpjobrequest = googleprivacydlpv2hybridinspectdlpjobrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsDlpJobsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsDlpJobsDeleteCall { +func (c *ProjectsLocationsDlpJobsHybridInspectCall) Fields(s ...googleapi.Field) *ProjectsLocationsDlpJobsHybridInspectCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsDlpJobsDeleteCall) Context(ctx context.Context) *ProjectsLocationsDlpJobsDeleteCall { +func (c *ProjectsLocationsDlpJobsHybridInspectCall) Context(ctx context.Context) *ProjectsLocationsDlpJobsHybridInspectCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsDlpJobsDeleteCall) Header() http.Header { +func (c *ProjectsLocationsDlpJobsHybridInspectCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDlpJobsDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *ProjectsLocationsDlpJobsHybridInspectCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2hybridinspectdlpjobrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:hybridInspect") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -22488,13 +23503,13 @@ func (c *ProjectsLocationsDlpJobsDeleteCall) doRequest(alt string) (*http.Respon return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.locations.dlpJobs.delete" call. +// Do executes the "dlp.projects.locations.dlpJobs.hybridInspect" call. // Any non-2xx status code is an error. Response headers are in either -// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsLocationsDlpJobsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { +// *GooglePrivacyDlpV2HybridInspectResponse.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 *ProjectsLocationsDlpJobsHybridInspectCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2HybridInspectResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -22513,7 +23528,7 @@ func (c *ProjectsLocationsDlpJobsDeleteCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleProtobufEmpty{ + ret := &GooglePrivacyDlpV2HybridInspectResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -22526,78 +23541,163 @@ func (c *ProjectsLocationsDlpJobsDeleteCall) Do(opts ...googleapi.CallOption) (* return ret, nil } -type ProjectsLocationsDlpJobsFinishCall struct { - s *Service - name string - googleprivacydlpv2finishdlpjobrequest *GooglePrivacyDlpV2FinishDlpJobRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDlpJobsListCall struct { + s *Service + parentid string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Finish: Finish a running hybrid DlpJob. Triggers the finalization steps and -// running of any enabled actions that have not yet run. +// List: Lists DlpJobs that match the specified filter in the request. See +// https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage +// and +// https://cloud.google.com/sensitive-data-protection/docs/compute-risk-analysis +// to learn more. // -// - name: The name of the DlpJob resource to be finished. -func (r *ProjectsLocationsDlpJobsService) Finish(name string, googleprivacydlpv2finishdlpjobrequest *GooglePrivacyDlpV2FinishDlpJobRequest) *ProjectsLocationsDlpJobsFinishCall { - c := &ProjectsLocationsDlpJobsFinishCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.googleprivacydlpv2finishdlpjobrequest = googleprivacydlpv2finishdlpjobrequest +// - parent: Parent resource name. The format of this value varies depending on +// whether you have specified a processing location +// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: +// parent=projects/example-project/locations/europe-west3. +func (r *ProjectsLocationsDlpJobsService) List(parentid string) *ProjectsLocationsDlpJobsListCall { + c := &ProjectsLocationsDlpJobsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parentid = parentid + return c +} + +// Filter sets the optional parameter "filter": Allows filtering. Supported +// syntax: * Filter expressions are made up of one or more restrictions. * +// Restrictions can be combined by `AND` or `OR` logical operators. A sequence +// of restrictions implicitly uses `AND`. * A restriction has the form of +// `{field} {operator} {value}`. * Supported fields/values for inspect jobs: - +// `state` - PENDING|RUNNING|CANCELED|FINISHED|FAILED - `inspected_storage` - +// DATASTORE|CLOUD_STORAGE|BIGQUERY - `trigger_name` - The name of the trigger +// that created the job. - 'end_time` - Corresponds to the time the job +// finished. - 'start_time` - Corresponds to the time the job finished. * +// Supported fields for risk analysis jobs: - `state` - +// RUNNING|CANCELED|FINISHED|FAILED - 'end_time` - Corresponds to the time the +// job finished. - 'start_time` - Corresponds to the time the job finished. * +// The operator must be `=` or `!=`. Examples: * inspected_storage = +// cloud_storage AND state = done * inspected_storage = cloud_storage OR +// inspected_storage = bigquery * inspected_storage = cloud_storage AND (state +// = done OR state = canceled) * end_time > \"2017-12-12T00:00:00+00:00\" The +// length of this field should be no more than 500 characters. +func (c *ProjectsLocationsDlpJobsListCall) Filter(filter string) *ProjectsLocationsDlpJobsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// LocationId sets the optional parameter "locationId": Deprecated. This field +// has no effect. +func (c *ProjectsLocationsDlpJobsListCall) LocationId(locationId string) *ProjectsLocationsDlpJobsListCall { + c.urlParams_.Set("locationId", locationId) + return c +} + +// OrderBy sets the optional parameter "orderBy": Comma separated list of +// fields to order by, followed by `asc` or `desc` postfix. This list is case +// insensitive. The default sorting order is ascending. Redundant space +// characters are insignificant. Example: `name asc, end_time asc, create_time +// desc` Supported fields are: - `create_time`: corresponds to the time the job +// was created. - `end_time`: corresponds to the time the job ended. - `name`: +// corresponds to the job's name. - `state`: corresponds to `state` +func (c *ProjectsLocationsDlpJobsListCall) OrderBy(orderBy string) *ProjectsLocationsDlpJobsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list page +// size. +func (c *ProjectsLocationsDlpJobsListCall) PageSize(pageSize int64) *ProjectsLocationsDlpJobsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The standard list page +// token. +func (c *ProjectsLocationsDlpJobsListCall) PageToken(pageToken string) *ProjectsLocationsDlpJobsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Type sets the optional parameter "type": The type of job. Defaults to +// `DlpJobType.INSPECT` +// +// Possible values: +// +// "DLP_JOB_TYPE_UNSPECIFIED" - Defaults to INSPECT_JOB. +// "INSPECT_JOB" - The job inspected Google Cloud for sensitive data. +// "RISK_ANALYSIS_JOB" - The job executed a Risk Analysis computation. +func (c *ProjectsLocationsDlpJobsListCall) Type(type_ string) *ProjectsLocationsDlpJobsListCall { + c.urlParams_.Set("type", type_) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsDlpJobsFinishCall) Fields(s ...googleapi.Field) *ProjectsLocationsDlpJobsFinishCall { +func (c *ProjectsLocationsDlpJobsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDlpJobsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an 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. +func (c *ProjectsLocationsDlpJobsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDlpJobsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsDlpJobsFinishCall) Context(ctx context.Context) *ProjectsLocationsDlpJobsFinishCall { +func (c *ProjectsLocationsDlpJobsListCall) Context(ctx context.Context) *ProjectsLocationsDlpJobsListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsDlpJobsFinishCall) Header() http.Header { +func (c *ProjectsLocationsDlpJobsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDlpJobsFinishCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2finishdlpjobrequest) - if err != nil { - return nil, err +func (c *ProjectsLocationsDlpJobsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "v2/{+name}:finish") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/dlpJobs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parentid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.locations.dlpJobs.finish" call. +// Do executes the "dlp.projects.locations.dlpJobs.list" call. // Any non-2xx status code is an error. Response headers are in either -// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsLocationsDlpJobsFinishCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { +// *GooglePrivacyDlpV2ListDlpJobsResponse.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 *ProjectsLocationsDlpJobsListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListDlpJobsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -22616,7 +23716,7 @@ func (c *ProjectsLocationsDlpJobsFinishCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleProtobufEmpty{ + ret := &GooglePrivacyDlpV2ListDlpJobsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -22629,24 +23729,42 @@ func (c *ProjectsLocationsDlpJobsFinishCall) Do(opts ...googleapi.CallOption) (* return ret, nil } -type ProjectsLocationsDlpJobsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// 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 *ProjectsLocationsDlpJobsListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListDlpJobsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + 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) + } } -// Get: Gets the latest state of a long-running DlpJob. See -// https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage -// and -// https://cloud.google.com/sensitive-data-protection/docs/compute-risk-analysis -// to learn more. +type ProjectsLocationsFileStoreDataProfilesDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Delete a FileStoreDataProfile. Will not prevent the profile from +// being regenerated if the resource is still included in a discovery +// configuration. // -// - name: The name of the DlpJob resource. -func (r *ProjectsLocationsDlpJobsService) Get(name string) *ProjectsLocationsDlpJobsGetCall { - c := &ProjectsLocationsDlpJobsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Resource name of the file store data profile. +func (r *ProjectsLocationsFileStoreDataProfilesService) Delete(name string) *ProjectsLocationsFileStoreDataProfilesDeleteCall { + c := &ProjectsLocationsFileStoreDataProfilesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -22654,45 +23772,34 @@ func (r *ProjectsLocationsDlpJobsService) Get(name string) *ProjectsLocationsDlp // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsDlpJobsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDlpJobsGetCall { +func (c *ProjectsLocationsFileStoreDataProfilesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsFileStoreDataProfilesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an 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. -func (c *ProjectsLocationsDlpJobsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDlpJobsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsDlpJobsGetCall) Context(ctx context.Context) *ProjectsLocationsDlpJobsGetCall { +func (c *ProjectsLocationsFileStoreDataProfilesDeleteCall) Context(ctx context.Context) *ProjectsLocationsFileStoreDataProfilesDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsDlpJobsGetCall) Header() http.Header { +func (c *ProjectsLocationsFileStoreDataProfilesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDlpJobsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsFileStoreDataProfilesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - 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, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -22703,13 +23810,13 @@ func (c *ProjectsLocationsDlpJobsGetCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.locations.dlpJobs.get" call. +// Do executes the "dlp.projects.locations.fileStoreDataProfiles.delete" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2DlpJob.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 *ProjectsLocationsDlpJobsGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DlpJob, error) { +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsFileStoreDataProfilesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -22728,7 +23835,7 @@ func (c *ProjectsLocationsDlpJobsGetCall) Do(opts ...googleapi.CallOption) (*Goo if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2DlpJob{ + ret := &GoogleProtobufEmpty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -22741,62 +23848,67 @@ func (c *ProjectsLocationsDlpJobsGetCall) Do(opts ...googleapi.CallOption) (*Goo return ret, nil } -type ProjectsLocationsDlpJobsHybridInspectCall struct { - s *Service - name string - googleprivacydlpv2hybridinspectdlpjobrequest *GooglePrivacyDlpV2HybridInspectDlpJobRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsFileStoreDataProfilesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// HybridInspect: Inspect hybrid content and store findings to a job. To review -// the findings, inspect the job. Inspection will occur asynchronously. +// Get: Gets a file store data profile. // -// - name: Resource name of the job to execute a hybrid inspect on, for example -// `projects/dlp-test-project/dlpJob/53234423`. -func (r *ProjectsLocationsDlpJobsService) HybridInspect(name string, googleprivacydlpv2hybridinspectdlpjobrequest *GooglePrivacyDlpV2HybridInspectDlpJobRequest) *ProjectsLocationsDlpJobsHybridInspectCall { - c := &ProjectsLocationsDlpJobsHybridInspectCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Resource name, for example +// `organizations/12345/locations/us/fileStoreDataProfiles/53234423`. +func (r *ProjectsLocationsFileStoreDataProfilesService) Get(name string) *ProjectsLocationsFileStoreDataProfilesGetCall { + c := &ProjectsLocationsFileStoreDataProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googleprivacydlpv2hybridinspectdlpjobrequest = googleprivacydlpv2hybridinspectdlpjobrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsDlpJobsHybridInspectCall) Fields(s ...googleapi.Field) *ProjectsLocationsDlpJobsHybridInspectCall { +func (c *ProjectsLocationsFileStoreDataProfilesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsFileStoreDataProfilesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an 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. +func (c *ProjectsLocationsFileStoreDataProfilesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsFileStoreDataProfilesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsDlpJobsHybridInspectCall) Context(ctx context.Context) *ProjectsLocationsDlpJobsHybridInspectCall { +func (c *ProjectsLocationsFileStoreDataProfilesGetCall) Context(ctx context.Context) *ProjectsLocationsFileStoreDataProfilesGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsDlpJobsHybridInspectCall) Header() http.Header { +func (c *ProjectsLocationsFileStoreDataProfilesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDlpJobsHybridInspectCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2hybridinspectdlpjobrequest) - if err != nil { - return nil, err +func (c *ProjectsLocationsFileStoreDataProfilesGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "v2/{+name}:hybridInspect") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -22807,13 +23919,13 @@ func (c *ProjectsLocationsDlpJobsHybridInspectCall) doRequest(alt string) (*http return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.locations.dlpJobs.hybridInspect" call. +// Do executes the "dlp.projects.locations.fileStoreDataProfiles.get" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2HybridInspectResponse.ServerResponse.Header or (if a +// *GooglePrivacyDlpV2FileStoreDataProfile.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 *ProjectsLocationsDlpJobsHybridInspectCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2HybridInspectResponse, error) { +func (c *ProjectsLocationsFileStoreDataProfilesGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2FileStoreDataProfile, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -22832,7 +23944,7 @@ func (c *ProjectsLocationsDlpJobsHybridInspectCall) Do(opts ...googleapi.CallOpt if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2HybridInspectResponse{ + ret := &GooglePrivacyDlpV2FileStoreDataProfile{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -22845,33 +23957,23 @@ func (c *ProjectsLocationsDlpJobsHybridInspectCall) Do(opts ...googleapi.CallOpt return ret, nil } -type ProjectsLocationsDlpJobsListCall struct { +type ProjectsLocationsFileStoreDataProfilesListCall struct { s *Service - parentid string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists DlpJobs that match the specified filter in the request. See -// https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage -// and -// https://cloud.google.com/sensitive-data-protection/docs/compute-risk-analysis -// to learn more. +// List: Lists file store data profiles for an organization. // -// - parent: Parent resource name. The format of this value varies depending on -// whether you have specified a processing location -// (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` -// LOCATION_ID + Projects scope, no location specified (defaults to global): -// `projects/`PROJECT_ID The following example `parent` string specifies a -// parent project with the identifier `example-project`, and specifies the -// `europe-west3` location for processing data: -// parent=projects/example-project/locations/europe-west3. -func (r *ProjectsLocationsDlpJobsService) List(parentid string) *ProjectsLocationsDlpJobsListCall { - c := &ProjectsLocationsDlpJobsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parentid = parentid +// - parent: Resource name of the organization or project, for example +// `organizations/433245324/locations/europe` or +// `projects/project-id/locations/asia`. +func (r *ProjectsLocationsFileStoreDataProfilesService) List(parent string) *ProjectsLocationsFileStoreDataProfilesListCall { + c := &ProjectsLocationsFileStoreDataProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } @@ -22879,74 +23981,59 @@ func (r *ProjectsLocationsDlpJobsService) List(parentid string) *ProjectsLocatio // syntax: * Filter expressions are made up of one or more restrictions. * // Restrictions can be combined by `AND` or `OR` logical operators. A sequence // of restrictions implicitly uses `AND`. * A restriction has the form of -// `{field} {operator} {value}`. * Supported fields/values for inspect jobs: - -// `state` - PENDING|RUNNING|CANCELED|FINISHED|FAILED - `inspected_storage` - -// DATASTORE|CLOUD_STORAGE|BIGQUERY - `trigger_name` - The name of the trigger -// that created the job. - 'end_time` - Corresponds to the time the job -// finished. - 'start_time` - Corresponds to the time the job finished. * -// Supported fields for risk analysis jobs: - `state` - -// RUNNING|CANCELED|FINISHED|FAILED - 'end_time` - Corresponds to the time the -// job finished. - 'start_time` - Corresponds to the time the job finished. * -// The operator must be `=` or `!=`. Examples: * inspected_storage = -// cloud_storage AND state = done * inspected_storage = cloud_storage OR -// inspected_storage = bigquery * inspected_storage = cloud_storage AND (state -// = done OR state = canceled) * end_time > \"2017-12-12T00:00:00+00:00\" The -// length of this field should be no more than 500 characters. -func (c *ProjectsLocationsDlpJobsListCall) Filter(filter string) *ProjectsLocationsDlpJobsListCall { +// `{field} {operator} {value}`. * Supported fields/values: - `project_id` - +// The Google Cloud project ID. - `file_store_path` - The path like +// "gs://bucket". - `sensitivity_level` - HIGH|MODERATE|LOW - `data_risk_level` +// - HIGH|MODERATE|LOW - `resource_visibility`: PUBLIC|RESTRICTED - +// `status_code` - an RPC status code as defined in +// https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto * +// The operator must be `=` or `!=`. Examples: * `project_id = 12345 AND +// status_code = 1` * `project_id = 12345 AND sensitivity_level = HIGH` * +// `project_id = 12345 AND resource_visibility = PUBLIC` . * 'file_store_path = +// "gs://mybucket" The length of this field should be no more than 500 +// characters. +func (c *ProjectsLocationsFileStoreDataProfilesListCall) Filter(filter string) *ProjectsLocationsFileStoreDataProfilesListCall { c.urlParams_.Set("filter", filter) return c } -// LocationId sets the optional parameter "locationId": Deprecated. This field -// has no effect. -func (c *ProjectsLocationsDlpJobsListCall) LocationId(locationId string) *ProjectsLocationsDlpJobsListCall { - c.urlParams_.Set("locationId", locationId) - return c -} - // OrderBy sets the optional parameter "orderBy": Comma separated list of // fields to order by, followed by `asc` or `desc` postfix. This list is case // insensitive. The default sorting order is ascending. Redundant space -// characters are insignificant. Example: `name asc, end_time asc, create_time -// desc` Supported fields are: - `create_time`: corresponds to the time the job -// was created. - `end_time`: corresponds to the time the job ended. - `name`: -// corresponds to the job's name. - `state`: corresponds to `state` -func (c *ProjectsLocationsDlpJobsListCall) OrderBy(orderBy string) *ProjectsLocationsDlpJobsListCall { +// characters are insignificant. Only one order field at a time is allowed. +// Examples: * `project_id asc` * `name` * `sensitivity_level desc` Supported +// fields are: - `project_id`: The Google Cloud project ID. - +// `sensitivity_level`: How sensitive the data in a table is, at most. - +// `data_risk_level`: How much risk is associated with this data. - +// `profile_last_generated`: When the profile was last updated in epoch +// seconds. - `last_modified`: The last time the resource was modified. - +// `resource_visibility`: Visibility restriction for this resource. - `name`: +// The name of the profile. - `create_time`: The time the file store was first +// created. +func (c *ProjectsLocationsFileStoreDataProfilesListCall) OrderBy(orderBy string) *ProjectsLocationsFileStoreDataProfilesListCall { c.urlParams_.Set("orderBy", orderBy) return c } -// PageSize sets the optional parameter "pageSize": The standard list page -// size. -func (c *ProjectsLocationsDlpJobsListCall) PageSize(pageSize int64) *ProjectsLocationsDlpJobsListCall { +// PageSize sets the optional parameter "pageSize": Size of the page. This +// value can be limited by the server. If zero, server returns a page of max +// size 100. +func (c *ProjectsLocationsFileStoreDataProfilesListCall) PageSize(pageSize int64) *ProjectsLocationsFileStoreDataProfilesListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// PageToken sets the optional parameter "pageToken": The standard list page -// token. -func (c *ProjectsLocationsDlpJobsListCall) PageToken(pageToken string) *ProjectsLocationsDlpJobsListCall { +// PageToken sets the optional parameter "pageToken": Page token to continue +// retrieval. +func (c *ProjectsLocationsFileStoreDataProfilesListCall) PageToken(pageToken string) *ProjectsLocationsFileStoreDataProfilesListCall { c.urlParams_.Set("pageToken", pageToken) return c } -// Type sets the optional parameter "type": The type of job. Defaults to -// `DlpJobType.INSPECT` -// -// Possible values: -// -// "DLP_JOB_TYPE_UNSPECIFIED" - Defaults to INSPECT_JOB. -// "INSPECT_JOB" - The job inspected Google Cloud for sensitive data. -// "RISK_ANALYSIS_JOB" - The job executed a Risk Analysis computation. -func (c *ProjectsLocationsDlpJobsListCall) Type(type_ string) *ProjectsLocationsDlpJobsListCall { - c.urlParams_.Set("type", type_) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsDlpJobsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDlpJobsListCall { +func (c *ProjectsLocationsFileStoreDataProfilesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsFileStoreDataProfilesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -22954,27 +24041,27 @@ func (c *ProjectsLocationsDlpJobsListCall) Fields(s ...googleapi.Field) *Project // IfNoneMatch sets an 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. -func (c *ProjectsLocationsDlpJobsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDlpJobsListCall { +func (c *ProjectsLocationsFileStoreDataProfilesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsFileStoreDataProfilesListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsDlpJobsListCall) Context(ctx context.Context) *ProjectsLocationsDlpJobsListCall { +func (c *ProjectsLocationsFileStoreDataProfilesListCall) Context(ctx context.Context) *ProjectsLocationsFileStoreDataProfilesListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsDlpJobsListCall) Header() http.Header { +func (c *ProjectsLocationsFileStoreDataProfilesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDlpJobsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsFileStoreDataProfilesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -22982,7 +24069,7 @@ func (c *ProjectsLocationsDlpJobsListCall) doRequest(alt string) (*http.Response var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/dlpJobs") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/fileStoreDataProfiles") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -22990,18 +24077,18 @@ func (c *ProjectsLocationsDlpJobsListCall) doRequest(alt string) (*http.Response } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parentid, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "dlp.projects.locations.dlpJobs.list" call. +// Do executes the "dlp.projects.locations.fileStoreDataProfiles.list" call. // Any non-2xx status code is an error. Response headers are in either -// *GooglePrivacyDlpV2ListDlpJobsResponse.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 +// *GooglePrivacyDlpV2ListFileStoreDataProfilesResponse.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 *ProjectsLocationsDlpJobsListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListDlpJobsResponse, error) { +func (c *ProjectsLocationsFileStoreDataProfilesListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListFileStoreDataProfilesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -23020,7 +24107,7 @@ func (c *ProjectsLocationsDlpJobsListCall) Do(opts ...googleapi.CallOption) (*Go if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GooglePrivacyDlpV2ListDlpJobsResponse{ + ret := &GooglePrivacyDlpV2ListFileStoreDataProfilesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -23036,7 +24123,7 @@ func (c *ProjectsLocationsDlpJobsListCall) Do(opts ...googleapi.CallOption) (*Go // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsDlpJobsListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListDlpJobsResponse) error) error { +func (c *ProjectsLocationsFileStoreDataProfilesListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListFileStoreDataProfilesResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { diff --git a/firebaseappdistribution/v1alpha/firebaseappdistribution-api.json b/firebaseappdistribution/v1alpha/firebaseappdistribution-api.json index 2bc38a3c800..ec4a9fdb533 100644 --- a/firebaseappdistribution/v1alpha/firebaseappdistribution-api.json +++ b/firebaseappdistribution/v1alpha/firebaseappdistribution-api.json @@ -585,7 +585,7 @@ } } }, - "revision": "20231221", + "revision": "20240627", "rootUrl": "https://firebaseappdistribution.googleapis.com/", "schemas": { "GoogleFirebaseAppdistroV1Release": { @@ -697,6 +697,39 @@ }, "type": "object" }, + "GoogleFirebaseAppdistroV1alphaAiInstructions": { + "description": "Instructions for AI driven test", + "id": "GoogleFirebaseAppdistroV1alphaAiInstructions", + "properties": { + "appDescription": { + "description": "Optional. Describes the app to give the AI some context", + "type": "string" + }, + "steps": { + "description": "Required. Steps to be accomplished by the AI", + "items": { + "$ref": "GoogleFirebaseAppdistroV1alphaAiInstructionsStep" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleFirebaseAppdistroV1alphaAiInstructionsStep": { + "description": "A step to be accomplished by the AI", + "id": "GoogleFirebaseAppdistroV1alphaAiInstructionsStep", + "properties": { + "assertion": { + "description": "An assertion to be checked by the AI", + "type": "string" + }, + "goal": { + "description": "A goal to be accomplished by the AI", + "type": "string" + } + }, + "type": "object" + }, "GoogleFirebaseAppdistroV1alphaApp": { "id": "GoogleFirebaseAppdistroV1alphaApp", "properties": { @@ -1177,6 +1210,10 @@ "description": "The results of running an automated test on a release.", "id": "GoogleFirebaseAppdistroV1alphaReleaseTest", "properties": { + "aiInstructions": { + "$ref": "GoogleFirebaseAppdistroV1alphaAiInstructions", + "description": "Optional. Input only. Instructions for AI driven test. Input only." + }, "createTime": { "description": "Output only. Timestamp when the test was run.", "format": "google-datetime", @@ -1205,6 +1242,10 @@ "description": "Configuration for Robo crawler", "id": "GoogleFirebaseAppdistroV1alphaRoboCrawler", "properties": { + "aiInstructions": { + "$ref": "GoogleFirebaseAppdistroV1alphaAiInstructions", + "description": "Optional. Instructions for AI driven test" + }, "loginCredential": { "$ref": "GoogleFirebaseAppdistroV1alphaLoginCredential", "description": "Optional. Login credential for automated tests" diff --git a/firebaseappdistribution/v1alpha/firebaseappdistribution-gen.go b/firebaseappdistribution/v1alpha/firebaseappdistribution-gen.go index 1511093ecdb..7dcc77842bf 100644 --- a/firebaseappdistribution/v1alpha/firebaseappdistribution-gen.go +++ b/firebaseappdistribution/v1alpha/firebaseappdistribution-gen.go @@ -413,6 +413,56 @@ func (s *GoogleFirebaseAppdistroV1alphaAabCertificate) MarshalJSON() ([]byte, er return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// GoogleFirebaseAppdistroV1alphaAiInstructions: Instructions for AI driven +// test +type GoogleFirebaseAppdistroV1alphaAiInstructions struct { + // AppDescription: Optional. Describes the app to give the AI some context + AppDescription string `json:"appDescription,omitempty"` + // Steps: Required. Steps to be accomplished by the AI + Steps []*GoogleFirebaseAppdistroV1alphaAiInstructionsStep `json:"steps,omitempty"` + // ForceSendFields is a list of field names (e.g. "AppDescription") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AppDescription") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleFirebaseAppdistroV1alphaAiInstructions) MarshalJSON() ([]byte, error) { + type NoMethod GoogleFirebaseAppdistroV1alphaAiInstructions + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GoogleFirebaseAppdistroV1alphaAiInstructionsStep: A step to be accomplished +// by the AI +type GoogleFirebaseAppdistroV1alphaAiInstructionsStep struct { + // Assertion: An assertion to be checked by the AI + Assertion string `json:"assertion,omitempty"` + // Goal: A goal to be accomplished by the AI + Goal string `json:"goal,omitempty"` + // ForceSendFields is a list of field names (e.g. "Assertion") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Assertion") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleFirebaseAppdistroV1alphaAiInstructionsStep) MarshalJSON() ([]byte, error) { + type NoMethod GoogleFirebaseAppdistroV1alphaAiInstructionsStep + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + type GoogleFirebaseAppdistroV1alphaApp struct { // AabCertificate: App bundle test certificate generated for the app. AabCertificate *GoogleFirebaseAppdistroV1alphaAabCertificate `json:"aabCertificate,omitempty"` @@ -931,6 +981,9 @@ func (s *GoogleFirebaseAppdistroV1alphaReleaseNotes) MarshalJSON() ([]byte, erro // GoogleFirebaseAppdistroV1alphaReleaseTest: The results of running an // automated test on a release. type GoogleFirebaseAppdistroV1alphaReleaseTest struct { + // AiInstructions: Optional. Input only. Instructions for AI driven test. Input + // only. + AiInstructions *GoogleFirebaseAppdistroV1alphaAiInstructions `json:"aiInstructions,omitempty"` // CreateTime: Output only. Timestamp when the test was run. CreateTime string `json:"createTime,omitempty"` // DeviceExecutions: Required. The results of the test on each device. @@ -945,15 +998,15 @@ type GoogleFirebaseAppdistroV1alphaReleaseTest struct { // ServerResponse contains the HTTP response code and headers from the server. googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "CreateTime") to + // ForceSendFields is a list of field names (e.g. "AiInstructions") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CreateTime") to include in API - // requests with the JSON null value. By default, fields with empty values are - // omitted from API requests. See + // NullFields is a list of field names (e.g. "AiInstructions") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` } @@ -965,15 +1018,17 @@ func (s *GoogleFirebaseAppdistroV1alphaReleaseTest) MarshalJSON() ([]byte, error // GoogleFirebaseAppdistroV1alphaRoboCrawler: Configuration for Robo crawler type GoogleFirebaseAppdistroV1alphaRoboCrawler struct { + // AiInstructions: Optional. Instructions for AI driven test + AiInstructions *GoogleFirebaseAppdistroV1alphaAiInstructions `json:"aiInstructions,omitempty"` // LoginCredential: Optional. Login credential for automated tests LoginCredential *GoogleFirebaseAppdistroV1alphaLoginCredential `json:"loginCredential,omitempty"` - // ForceSendFields is a list of field names (e.g. "LoginCredential") to + // ForceSendFields is a list of field names (e.g. "AiInstructions") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "LoginCredential") to include in + // NullFields is a list of field names (e.g. "AiInstructions") to include in // API requests with the JSON null value. By default, fields with empty values // are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. diff --git a/meet/v2/meet-api.json b/meet/v2/meet-api.json index 7a3b4dd4c2b..968af8335d3 100644 --- a/meet/v2/meet-api.json +++ b/meet/v2/meet-api.json @@ -144,7 +144,7 @@ "parameterOrder": [], "parameters": { "filter": { - "description": "Optional. User specified filtering condition in [EBNF format](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form). The following are the filterable fields: * `space.meeting_code` * `space.name` * `start_time` * `end_time` For example, `space.meeting_code = \"abc-mnop-xyz\"`.", + "description": "Optional. User specified filtering condition in [EBNF format](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form). The following are the filterable fields: * `space.meeting_code` * `space.name` * `start_time` * `end_time` For example, consider the following filters: * `space.name = \"spaces/NAME\"` * `space.meeting_code = \"abc-mnop-xyz\"` * `start_time\u003e=\"2024-01-01T00:00:00.000Z\" AND start_time\u003c=\"2024-01-02T00:00:00.000Z\"` * `end_time IS NULL`", "location": "query", "type": "string" }, @@ -633,7 +633,7 @@ } } }, - "revision": "20240617", + "revision": "20240626", "rootUrl": "https://meet.googleapis.com/", "schemas": { "ActiveConference": { diff --git a/meet/v2/meet-gen.go b/meet/v2/meet-gen.go index c42135769cd..3fba38e1e9d 100644 --- a/meet/v2/meet-gen.go +++ b/meet/v2/meet-gen.go @@ -1046,8 +1046,10 @@ func (r *ConferenceRecordsService) List() *ConferenceRecordsListCall { // condition in EBNF format // (https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form). The // following are the filterable fields: * `space.meeting_code` * `space.name` * -// `start_time` * `end_time` For example, `space.meeting_code = -// "abc-mnop-xyz". +// `start_time` * `end_time` For example, consider the following filters: * +// `space.name = "spaces/NAME" * `space.meeting_code = "abc-mnop-xyz" * +// `start_time>="2024-01-01T00:00:00.000Z" AND +// start_time<="2024-01-02T00:00:00.000Z" * `end_time IS NULL` func (c *ConferenceRecordsListCall) Filter(filter string) *ConferenceRecordsListCall { c.urlParams_.Set("filter", filter) return c diff --git a/migrationcenter/v1/migrationcenter-api.json b/migrationcenter/v1/migrationcenter-api.json index 47bb08eaa58..96531cad6de 100644 --- a/migrationcenter/v1/migrationcenter-api.json +++ b/migrationcenter/v1/migrationcenter-api.json @@ -2309,7 +2309,7 @@ } } }, - "revision": "20240516", + "revision": "20240620", "rootUrl": "https://migrationcenter.googleapis.com/", "schemas": { "AddAssetsToGroupRequest": { @@ -4370,7 +4370,7 @@ "description": "Architecture details (vendor, CPU architecture)." }, "coreCount": { - "description": "Number of CPU cores in the machine. Must be non-negative.", + "description": "Number of logical CPU cores in the machine. Must be non-negative.", "format": "int32", "type": "integer" }, diff --git a/migrationcenter/v1/migrationcenter-gen.go b/migrationcenter/v1/migrationcenter-gen.go index b4abd26d0ae..7295a9c16f8 100644 --- a/migrationcenter/v1/migrationcenter-gen.go +++ b/migrationcenter/v1/migrationcenter-gen.go @@ -2777,7 +2777,7 @@ func (s *MachineArchitectureDetails) MarshalJSON() ([]byte, error) { type MachineDetails struct { // Architecture: Architecture details (vendor, CPU architecture). Architecture *MachineArchitectureDetails `json:"architecture,omitempty"` - // CoreCount: Number of CPU cores in the machine. Must be non-negative. + // CoreCount: Number of logical CPU cores in the machine. Must be non-negative. CoreCount int64 `json:"coreCount,omitempty"` // CreateTime: Machine creation time. CreateTime string `json:"createTime,omitempty"` diff --git a/migrationcenter/v1alpha1/migrationcenter-api.json b/migrationcenter/v1alpha1/migrationcenter-api.json index df8e7624600..e4c947de21a 100644 --- a/migrationcenter/v1alpha1/migrationcenter-api.json +++ b/migrationcenter/v1alpha1/migrationcenter-api.json @@ -2473,7 +2473,7 @@ } } }, - "revision": "20240606", + "revision": "20240620", "rootUrl": "https://migrationcenter.googleapis.com/", "schemas": { "AddAssetsToGroupRequest": { @@ -3355,6 +3355,11 @@ "readOnly": true, "type": "integer" }, + "smtEnabled": { + "description": "Output only. Whether simultaneous multithreading is enabled (see https://cloud.google.com/sql/docs/sqlserver/create-instance#smt-create-instance).", + "readOnly": true, + "type": "boolean" + }, "storage": { "$ref": "ComputeStorageDescriptor", "description": "Output only. Predicted storage shape.", @@ -3429,7 +3434,7 @@ "id": "ComputeEnginePreferences", "properties": { "licenseType": { - "description": "If os_pricing_preferences is specified, it overrides this field. License type to consider when calculating costs for virtual machine insights and recommendations. If unspecified, costs are calculated based on the default licensing plan.", + "description": "License type to consider when calculating costs for operating systems. If unspecified, costs are calculated based on the default licensing plan. If os_pricing_preferences is specified, it overrides this field.", "enum": [ "LICENSE_TYPE_UNSPECIFIED", "LICENSE_TYPE_DEFAULT", @@ -3446,6 +3451,22 @@ "$ref": "MachinePreferences", "description": "Preferences concerning the machine types to consider on Compute Engine." }, + "multithreading": { + "description": "Optional. Preferences for multithreading support.", + "enum": [ + "MULTITHREADING_UNSPECIFIED", + "MULTITHREADING_DISABLED", + "MULTITHREADING_ENABLED", + "MULTITHREADING_DISABLED_WITH_COMPENSATION" + ], + "enumDescriptions": [ + "Same as MULTITHREADING_DISABLED_WITH_COMPENSATION.", + "Disable simultaneous multithreading if doing so is advantageous.", + "Always enable simultaneous multithreading.", + "Disable simultaneous multithreading and increase number of VCPUs to compensate, if doing so is advantageous." + ], + "type": "string" + }, "osPricingPreferences": { "$ref": "OperatingSystemPricingPreferences", "description": "Optional. Pricing options for OS images." @@ -3501,6 +3522,11 @@ "readOnly": true, "type": "string" }, + "smtEnabled": { + "description": "Output only. Whether simultaneous multithreading is enabled (see https://cloud.google.com/compute/docs/instances/set-threads-per-core).", + "readOnly": true, + "type": "boolean" + }, "storage": { "description": "Output only. Compute Engine storage. Never empty.", "items": { @@ -4040,12 +4066,14 @@ "enum": [ "MULTITHREADING_UNSPECIFIED", "MULTITHREADING_DISABLED", - "MULTITHREADING_ENABLED" + "MULTITHREADING_ENABLED", + "MULTITHREADING_DISABLED_WITH_COMPENSATION" ], "enumDescriptions": [ "Same as MULTITHREADING_DISABLED_WITH_COMPENSATION.", "Disable simultaneous multithreading if doing so is lower cost.", - "Always enable simultaneous multithreading." + "Always enable simultaneous multithreading.", + "Disable simultaneous multithreading and increase number of VCPUs to compensate, if doing so is lower cost." ], "type": "string" }, @@ -6972,7 +7000,7 @@ }, "monthlyCostDatabaseLicensing": { "$ref": "Money", - "description": "Output only. Database licensing monthly cost for this preference set. For virtual machines denotes the cost of licenses for hosted databases.", + "description": "Output only. Database licensing monthly cost for this preference set. Only present for databases.", "readOnly": true }, "monthlyCostNetworkEgress": { @@ -7931,7 +7959,7 @@ "id": "VirtualMachineDetails", "properties": { "coreCount": { - "description": "Number of CPU cores in the VirtualMachine. Must be non-negative.", + "description": "Number of logical CPU cores in the VirtualMachine. Must be non-negative.", "format": "int32", "type": "integer" }, diff --git a/migrationcenter/v1alpha1/migrationcenter-gen.go b/migrationcenter/v1alpha1/migrationcenter-gen.go index 185642bc0dc..ad31972bb02 100644 --- a/migrationcenter/v1alpha1/migrationcenter-gen.go +++ b/migrationcenter/v1alpha1/migrationcenter-gen.go @@ -1325,6 +1325,9 @@ type CloudSqlForSqlServerShape struct { LogicalCoreCount int64 `json:"logicalCoreCount,omitempty"` // MemoryMb: Output only. Predicted amount of memory in MiB. MemoryMb int64 `json:"memoryMb,omitempty"` + // SmtEnabled: Output only. Whether simultaneous multithreading is enabled (see + // https://cloud.google.com/sql/docs/sqlserver/create-instance#smt-create-instance). + SmtEnabled bool `json:"smtEnabled,omitempty"` // Storage: Output only. Predicted storage shape. Storage *ComputeStorageDescriptor `json:"storage,omitempty"` // Version: Output only. Microsoft SQL Server version to be used on the Cloud @@ -1412,10 +1415,9 @@ func (s *ComputeEngineMigrationTarget) MarshalJSON() ([]byte, error) { // ComputeEnginePreferences: The user preferences relating to Compute Engine // target platform. type ComputeEnginePreferences struct { - // LicenseType: If os_pricing_preferences is specified, it overrides this - // field. License type to consider when calculating costs for virtual machine - // insights and recommendations. If unspecified, costs are calculated based on - // the default licensing plan. + // LicenseType: License type to consider when calculating costs for operating + // systems. If unspecified, costs are calculated based on the default licensing + // plan. If os_pricing_preferences is specified, it overrides this field. // // Possible values: // "LICENSE_TYPE_UNSPECIFIED" - Unspecified (default value). @@ -1427,6 +1429,18 @@ type ComputeEnginePreferences struct { // MachinePreferences: Preferences concerning the machine types to consider on // Compute Engine. MachinePreferences *MachinePreferences `json:"machinePreferences,omitempty"` + // Multithreading: Optional. Preferences for multithreading support. + // + // Possible values: + // "MULTITHREADING_UNSPECIFIED" - Same as + // MULTITHREADING_DISABLED_WITH_COMPENSATION. + // "MULTITHREADING_DISABLED" - Disable simultaneous multithreading if doing + // so is advantageous. + // "MULTITHREADING_ENABLED" - Always enable simultaneous multithreading. + // "MULTITHREADING_DISABLED_WITH_COMPENSATION" - Disable simultaneous + // multithreading and increase number of VCPUs to compensate, if doing so is + // advantageous. + Multithreading string `json:"multithreading,omitempty"` // OsPricingPreferences: Optional. Pricing options for OS images. OsPricingPreferences *OperatingSystemPricingPreferences `json:"osPricingPreferences,omitempty"` // PersistentDiskType: Persistent disk type to use. If unspecified (default), @@ -1470,6 +1484,9 @@ type ComputeEngineShapeDescriptor struct { PhysicalCoreCount int64 `json:"physicalCoreCount,omitempty"` // Series: Output only. Compute Engine machine series. Series string `json:"series,omitempty"` + // SmtEnabled: Output only. Whether simultaneous multithreading is enabled (see + // https://cloud.google.com/compute/docs/instances/set-threads-per-core). + SmtEnabled bool `json:"smtEnabled,omitempty"` // Storage: Output only. Compute Engine storage. Never empty. Storage []*ComputeStorageDescriptor `json:"storage,omitempty"` // ForceSendFields is a list of field names (e.g. "LogicalCoreCount") to @@ -2171,6 +2188,9 @@ type DatabasePreferencesCloudSqlSqlServer struct { // "MULTITHREADING_DISABLED" - Disable simultaneous multithreading if doing // so is lower cost. // "MULTITHREADING_ENABLED" - Always enable simultaneous multithreading. + // "MULTITHREADING_DISABLED_WITH_COMPENSATION" - Disable simultaneous + // multithreading and increase number of VCPUs to compensate, if doing so is + // lower cost. Multithreading string `json:"multithreading,omitempty"` // VersionType: Optional. Edition of Microsoft SQL version that is used on a // Cloud SQL for SQL server instance. @@ -5523,8 +5543,7 @@ type ReportSummaryGroupPreferenceSetFinding struct { // preference set. Only present for databases. MonthlyCostDatabaseBackup *Money `json:"monthlyCostDatabaseBackup,omitempty"` // MonthlyCostDatabaseLicensing: Output only. Database licensing monthly cost - // for this preference set. For virtual machines denotes the cost of licenses - // for hosted databases. + // for this preference set. Only present for databases. MonthlyCostDatabaseLicensing *Money `json:"monthlyCostDatabaseLicensing,omitempty"` // MonthlyCostNetworkEgress: Network Egress monthly cost for this preference // set. Only present for virtual machines. @@ -6722,7 +6741,8 @@ func (s *VirtualMachineArchitectureDetails) MarshalJSON() ([]byte, error) { // VirtualMachineDetails: Details of a VirtualMachine. type VirtualMachineDetails struct { - // CoreCount: Number of CPU cores in the VirtualMachine. Must be non-negative. + // CoreCount: Number of logical CPU cores in the VirtualMachine. Must be + // non-negative. CoreCount int64 `json:"coreCount,omitempty"` // CreateTime: VM creation timestamp. CreateTime string `json:"createTime,omitempty"` diff --git a/servicenetworking/v1/servicenetworking-api.json b/servicenetworking/v1/servicenetworking-api.json index 48f90c298c1..d202dc5e93c 100644 --- a/servicenetworking/v1/servicenetworking-api.json +++ b/servicenetworking/v1/servicenetworking-api.json @@ -1029,7 +1029,7 @@ } } }, - "revision": "20240529", + "revision": "20240626", "rootUrl": "https://servicenetworking.googleapis.com/", "schemas": { "AddDnsRecordSetMetadata": { @@ -1957,7 +1957,7 @@ "type": "object" }, "Documentation": { - "description": "`Documentation` provides the information for describing a service. Example: documentation: summary: \u003e The Google Calendar API gives access to most calendar features. pages: - name: Overview content: (== include google/foo/overview.md ==) - name: Tutorial content: (== include google/foo/tutorial.md ==) subpages: - name: Java content: (== include google/foo/tutorial_java.md ==) rules: - selector: google.calendar.Calendar.Get description: \u003e ... - selector: google.calendar.Calendar.Put description: \u003e ... Documentation is provided in markdown syntax. In addition to standard markdown features, definition lists, tables and fenced code blocks are supported. Section headers can be provided and are interpreted relative to the section nesting of the context where a documentation fragment is embedded. Documentation from the IDL is merged with documentation defined via the config at normalization time, where documentation provided by config rules overrides IDL provided. A number of constructs specific to the API platform are supported in documentation text. In order to reference a proto element, the following notation can be used: [fully.qualified.proto.name][] To override the display text used for the link, this can be used: [display text][fully.qualified.proto.name] Text can be excluded from doc using the following notation: (-- internal comment --) A few directives are available in documentation. Note that directives must appear on a single line to be properly identified. The `include` directive includes a markdown file from an external source: (== include path/to/file ==) The `resource_for` directive marks a message to be the resource of a collection in REST view. If it is not specified, tools attempt to infer the resource from the operations in a collection: (== resource_for v1.shelves.books ==) The directive `suppress_warning` does not directly affect documentation and is documented together with service config validation.", + "description": "`Documentation` provides the information for describing a service. Example: documentation: summary: \u003e The Google Calendar API gives access to most calendar features. pages: - name: Overview content: (== include google/foo/overview.md ==) - name: Tutorial content: (== include google/foo/tutorial.md ==) subpages: - name: Java content: (== include google/foo/tutorial_java.md ==) rules: - selector: google.calendar.Calendar.Get description: \u003e ... - selector: google.calendar.Calendar.Put description: \u003e ... code_snippet_rules: - selector: google.calendar.Calendar.Delete code_snippets: - includes: - github_include: region_tag: calendar_delete code_language: JAVA account: GoogleCloudPlatform project: java-docs-samples file: calendar/delete.java Documentation is provided in markdown syntax. In addition to standard markdown features, definition lists, tables and fenced code blocks are supported. Section headers can be provided and are interpreted relative to the section nesting of the context where a documentation fragment is embedded. Documentation from the IDL is merged with documentation defined via the config at normalization time, where documentation provided by config rules overrides IDL provided. A number of constructs specific to the API platform are supported in documentation text. In order to reference a proto element, the following notation can be used: [fully.qualified.proto.name][] To override the display text used for the link, this can be used: [display text][fully.qualified.proto.name] Text can be excluded from doc using the following notation: (-- internal comment --) A few directives are available in documentation. Note that directives must appear on a single line to be properly identified. The `include` directive includes a markdown file from an external source: (== include path/to/file ==) The `resource_for` directive marks a message to be the resource of a collection in REST view. If it is not specified, tools attempt to infer the resource from the operations in a collection: (== resource_for v1.shelves.books ==) The directive `suppress_warning` does not directly affect documentation and is documented together with service config validation.", "id": "Documentation", "properties": { "documentationRootUrl": { diff --git a/servicenetworking/v1/servicenetworking-gen.go b/servicenetworking/v1/servicenetworking-gen.go index 9075c85c3fe..79eae897df9 100644 --- a/servicenetworking/v1/servicenetworking-gen.go +++ b/servicenetworking/v1/servicenetworking-gen.go @@ -1639,17 +1639,20 @@ func (s *DnsZonePair) MarshalJSON() ([]byte, error) { // google/foo/tutorial.md ==) subpages: - name: Java content: (== include // google/foo/tutorial_java.md ==) rules: - selector: // google.calendar.Calendar.Get description: > ... - selector: -// google.calendar.Calendar.Put description: > ... Documentation is provided in -// markdown syntax. In addition to standard markdown features, definition -// lists, tables and fenced code blocks are supported. Section headers can be -// provided and are interpreted relative to the section nesting of the context -// where a documentation fragment is embedded. Documentation from the IDL is -// merged with documentation defined via the config at normalization time, -// where documentation provided by config rules overrides IDL provided. A -// number of constructs specific to the API platform are supported in -// documentation text. In order to reference a proto element, the following -// notation can be used: [fully.qualified.proto.name][] To override the display -// text used for the link, this can be used: [display +// google.calendar.Calendar.Put description: > ... code_snippet_rules: - +// selector: google.calendar.Calendar.Delete code_snippets: - includes: - +// github_include: region_tag: calendar_delete code_language: JAVA account: +// GoogleCloudPlatform project: java-docs-samples file: calendar/delete.java +// Documentation is provided in markdown syntax. In addition to standard +// markdown features, definition lists, tables and fenced code blocks are +// supported. Section headers can be provided and are interpreted relative to +// the section nesting of the context where a documentation fragment is +// embedded. Documentation from the IDL is merged with documentation defined +// via the config at normalization time, where documentation provided by config +// rules overrides IDL provided. A number of constructs specific to the API +// platform are supported in documentation text. In order to reference a proto +// element, the following notation can be used: [fully.qualified.proto.name][] +// To override the display text used for the link, this can be used: [display // text][fully.qualified.proto.name] Text can be excluded from doc using the // following notation: (-- internal comment --) A few directives are available // in documentation. Note that directives must appear on a single line to be diff --git a/servicenetworking/v1beta/servicenetworking-api.json b/servicenetworking/v1beta/servicenetworking-api.json index 8ebb32a6a11..196095705cd 100644 --- a/servicenetworking/v1beta/servicenetworking-api.json +++ b/servicenetworking/v1beta/servicenetworking-api.json @@ -307,7 +307,7 @@ } } }, - "revision": "20240529", + "revision": "20240626", "rootUrl": "https://servicenetworking.googleapis.com/", "schemas": { "AddDnsRecordSetMetadata": { @@ -1073,7 +1073,7 @@ "type": "object" }, "Documentation": { - "description": "`Documentation` provides the information for describing a service. Example: documentation: summary: \u003e The Google Calendar API gives access to most calendar features. pages: - name: Overview content: (== include google/foo/overview.md ==) - name: Tutorial content: (== include google/foo/tutorial.md ==) subpages: - name: Java content: (== include google/foo/tutorial_java.md ==) rules: - selector: google.calendar.Calendar.Get description: \u003e ... - selector: google.calendar.Calendar.Put description: \u003e ... Documentation is provided in markdown syntax. In addition to standard markdown features, definition lists, tables and fenced code blocks are supported. Section headers can be provided and are interpreted relative to the section nesting of the context where a documentation fragment is embedded. Documentation from the IDL is merged with documentation defined via the config at normalization time, where documentation provided by config rules overrides IDL provided. A number of constructs specific to the API platform are supported in documentation text. In order to reference a proto element, the following notation can be used: [fully.qualified.proto.name][] To override the display text used for the link, this can be used: [display text][fully.qualified.proto.name] Text can be excluded from doc using the following notation: (-- internal comment --) A few directives are available in documentation. Note that directives must appear on a single line to be properly identified. The `include` directive includes a markdown file from an external source: (== include path/to/file ==) The `resource_for` directive marks a message to be the resource of a collection in REST view. If it is not specified, tools attempt to infer the resource from the operations in a collection: (== resource_for v1.shelves.books ==) The directive `suppress_warning` does not directly affect documentation and is documented together with service config validation.", + "description": "`Documentation` provides the information for describing a service. Example: documentation: summary: \u003e The Google Calendar API gives access to most calendar features. pages: - name: Overview content: (== include google/foo/overview.md ==) - name: Tutorial content: (== include google/foo/tutorial.md ==) subpages: - name: Java content: (== include google/foo/tutorial_java.md ==) rules: - selector: google.calendar.Calendar.Get description: \u003e ... - selector: google.calendar.Calendar.Put description: \u003e ... code_snippet_rules: - selector: google.calendar.Calendar.Delete code_snippets: - includes: - github_include: region_tag: calendar_delete code_language: JAVA account: GoogleCloudPlatform project: java-docs-samples file: calendar/delete.java Documentation is provided in markdown syntax. In addition to standard markdown features, definition lists, tables and fenced code blocks are supported. Section headers can be provided and are interpreted relative to the section nesting of the context where a documentation fragment is embedded. Documentation from the IDL is merged with documentation defined via the config at normalization time, where documentation provided by config rules overrides IDL provided. A number of constructs specific to the API platform are supported in documentation text. In order to reference a proto element, the following notation can be used: [fully.qualified.proto.name][] To override the display text used for the link, this can be used: [display text][fully.qualified.proto.name] Text can be excluded from doc using the following notation: (-- internal comment --) A few directives are available in documentation. Note that directives must appear on a single line to be properly identified. The `include` directive includes a markdown file from an external source: (== include path/to/file ==) The `resource_for` directive marks a message to be the resource of a collection in REST view. If it is not specified, tools attempt to infer the resource from the operations in a collection: (== resource_for v1.shelves.books ==) The directive `suppress_warning` does not directly affect documentation and is documented together with service config validation.", "id": "Documentation", "properties": { "documentationRootUrl": { diff --git a/servicenetworking/v1beta/servicenetworking-gen.go b/servicenetworking/v1beta/servicenetworking-gen.go index 1abff8e5527..c8fc59f0125 100644 --- a/servicenetworking/v1beta/servicenetworking-gen.go +++ b/servicenetworking/v1beta/servicenetworking-gen.go @@ -1270,17 +1270,20 @@ func (s *DnsZone) MarshalJSON() ([]byte, error) { // google/foo/tutorial.md ==) subpages: - name: Java content: (== include // google/foo/tutorial_java.md ==) rules: - selector: // google.calendar.Calendar.Get description: > ... - selector: -// google.calendar.Calendar.Put description: > ... Documentation is provided in -// markdown syntax. In addition to standard markdown features, definition -// lists, tables and fenced code blocks are supported. Section headers can be -// provided and are interpreted relative to the section nesting of the context -// where a documentation fragment is embedded. Documentation from the IDL is -// merged with documentation defined via the config at normalization time, -// where documentation provided by config rules overrides IDL provided. A -// number of constructs specific to the API platform are supported in -// documentation text. In order to reference a proto element, the following -// notation can be used: [fully.qualified.proto.name][] To override the display -// text used for the link, this can be used: [display +// google.calendar.Calendar.Put description: > ... code_snippet_rules: - +// selector: google.calendar.Calendar.Delete code_snippets: - includes: - +// github_include: region_tag: calendar_delete code_language: JAVA account: +// GoogleCloudPlatform project: java-docs-samples file: calendar/delete.java +// Documentation is provided in markdown syntax. In addition to standard +// markdown features, definition lists, tables and fenced code blocks are +// supported. Section headers can be provided and are interpreted relative to +// the section nesting of the context where a documentation fragment is +// embedded. Documentation from the IDL is merged with documentation defined +// via the config at normalization time, where documentation provided by config +// rules overrides IDL provided. A number of constructs specific to the API +// platform are supported in documentation text. In order to reference a proto +// element, the following notation can be used: [fully.qualified.proto.name][] +// To override the display text used for the link, this can be used: [display // text][fully.qualified.proto.name] Text can be excluded from doc using the // following notation: (-- internal comment --) A few directives are available // in documentation. Note that directives must appear on a single line to be diff --git a/walletobjects/v1/walletobjects-api.json b/walletobjects/v1/walletobjects-api.json index a889647771f..45311994419 100644 --- a/walletobjects/v1/walletobjects-api.json +++ b/walletobjects/v1/walletobjects-api.json @@ -2681,7 +2681,7 @@ } } }, - "revision": "20240618", + "revision": "20240627", "rootUrl": "https://walletobjects.googleapis.com/", "schemas": { "ActivationOptions": { @@ -8264,7 +8264,7 @@ "type": "string" }, "id": { - "description": "The ID associated with a text module. This field is here to enable ease of management of text modules.", + "description": "The ID associated with a text module. This field is here to enable ease of management of text modules and referencing them in template overrides. The ID should only include alphanumeric characters, '_', or '-'. It can not include dots, as dots are used to separate fields within FieldReference.fieldPaths in template overrides.", "type": "string" }, "localizedBody": { diff --git a/walletobjects/v1/walletobjects-gen.go b/walletobjects/v1/walletobjects-gen.go index bf4786fc1a2..c137b142dd6 100644 --- a/walletobjects/v1/walletobjects-gen.go +++ b/walletobjects/v1/walletobjects-gen.go @@ -6294,7 +6294,10 @@ type TextModuleData struct { // characters to ensure full string is displayed on smaller screens. Header string `json:"header,omitempty"` // Id: The ID associated with a text module. This field is here to enable ease - // of management of text modules. + // of management of text modules and referencing them in template overrides. + // The ID should only include alphanumeric characters, '_', or '-'. It can not + // include dots, as dots are used to separate fields within + // FieldReference.fieldPaths in template overrides. Id string `json:"id,omitempty"` // LocalizedBody: Translated strings for the body. Recommended maximum length // is 500 characters to ensure full string is displayed on smaller screens.