From 91df9a74e2f3573a3620f6641b51112ed6f3f394 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 8 Aug 2024 13:09:53 -0700 Subject: [PATCH] feat: [dlp] add the TagResources API (#5588) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: org-level connection bindings feat: gRPC config for get, list, and delete FileStoreDataProfiles feat: add refresh frequency for data profiling docs: small improvements PiperOrigin-RevId: 657319510 Source-Link: https://github.com/googleapis/googleapis/commit/e1d378cf603018b361ffe00e1aaab1e3176a77a3 Source-Link: https://github.com/googleapis/googleapis-gen/commit/21ec656b840558f9154129a85bd412f8557c9e6e Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLXByaXZhY3ktZGxwLy5Pd2xCb3QueWFtbCIsImgiOiIyMWVjNjU2Yjg0MDU1OGY5MTU0MTI5YTg1YmQ0MTJmODU1N2M5ZTZlIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * docs: replace HTML tags with CommonMark notation PiperOrigin-RevId: 657655346 Source-Link: https://github.com/googleapis/googleapis/commit/aa6fe3bc9544eda519fb9d6b5449009f137715b8 Source-Link: https://github.com/googleapis/googleapis-gen/commit/118ba2b02273d7a38606958163420aa4b68328e7 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLXByaXZhY3ktZGxwLy5Pd2xCb3QueWFtbCIsImgiOiIxMThiYTJiMDIyNzNkN2EzODYwNjk1ODE2MzQyMGFhNGI2ODMyOGU3In0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore(dlp): fix ordering of Connection resource patterns PiperOrigin-RevId: 657674261 Source-Link: https://github.com/googleapis/googleapis/commit/29bff4c417af823d06f793b89b97848cd0a4b35f Source-Link: https://github.com/googleapis/googleapis-gen/commit/5c2e8865e43d4c682fad11b8e5848e44538424a2 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLXByaXZhY3ktZGxwLy5Pd2xCb3QueWFtbCIsImgiOiI1YzJlODg2NWU0M2Q0YzY4MmZhZDExYjhlNTg0OGU0NDUzODQyNGEyIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add the TagResources API PiperOrigin-RevId: 659709816 Source-Link: https://github.com/googleapis/googleapis/commit/7314e20f5e3b2550b2e10a8c53f58ae57c511773 Source-Link: https://github.com/googleapis/googleapis-gen/commit/7c795b5d8eb8354c58d5acd18c620b197ac338a4 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLXByaXZhY3ktZGxwLy5Pd2xCb3QueWFtbCIsImgiOiI3Yzc5NWI1ZDhlYjgzNTRjNThkNWFjZDE4YzYyMGIxOTdhYzMzOGE0In0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- .../protos/google/privacy/dlp/v2/dlp.proto | 226 +++- .../google/privacy/dlp/v2/storage.proto | 12 +- .../google-privacy-dlp/protos/protos.d.ts | 339 ++++- packages/google-privacy-dlp/protos/protos.js | 1188 +++++++++++++++-- .../google-privacy-dlp/protos/protos.json | 148 +- .../v2/dlp_service.create_connection.js | 9 +- .../dlp_service.create_deidentify_template.js | 8 +- .../v2/dlp_service.create_discovery_config.js | 4 +- .../v2/dlp_service.create_dlp_job.js | 4 +- .../v2/dlp_service.create_inspect_template.js | 8 +- .../v2/dlp_service.create_job_trigger.js | 4 +- .../v2/dlp_service.create_stored_info_type.js | 8 +- .../v2/dlp_service.deidentify_content.js | 4 +- .../v2/dlp_service.inspect_content.js | 4 +- .../v2/dlp_service.list_connections.js | 5 +- .../dlp_service.list_deidentify_templates.js | 8 +- .../v2/dlp_service.list_discovery_configs.js | 2 +- .../generated/v2/dlp_service.list_dlp_jobs.js | 4 +- .../v2/dlp_service.list_info_types.js | 2 +- .../v2/dlp_service.list_inspect_templates.js | 8 +- .../v2/dlp_service.list_job_triggers.js | 4 +- .../v2/dlp_service.list_stored_info_types.js | 4 +- .../generated/v2/dlp_service.redact_image.js | 4 +- .../v2/dlp_service.reidentify_content.js | 4 +- .../v2/dlp_service.search_connections.js | 5 +- ...nippet_metadata_google.privacy.dlp.v2.json | 8 +- .../src/v2/dlp_service_client.ts | 382 ++++-- .../src/v2/dlp_service_client_config.json | 9 +- .../test/gapic_dlp_service_v2.ts | 224 +++- 29 files changed, 2136 insertions(+), 503 deletions(-) diff --git a/packages/google-privacy-dlp/protos/google/privacy/dlp/v2/dlp.proto b/packages/google-privacy-dlp/protos/google/privacy/dlp/v2/dlp.proto index b8710b11caf..20b818f582b 100644 --- a/packages/google-privacy-dlp/protos/google/privacy/dlp/v2/dlp.proto +++ b/packages/google-privacy-dlp/protos/google/privacy/dlp/v2/dlp.proto @@ -160,7 +160,7 @@ service DlpService { rpc CreateInspectTemplate(CreateInspectTemplateRequest) returns (InspectTemplate) { option (google.api.http) = { - post: "/v2/{parent=organizations/*}/inspectTemplates" + post: "/v2/{parent=projects/*/locations/*}/inspectTemplates" body: "*" additional_bindings { post: "/v2/{parent=organizations/*/locations/*}/inspectTemplates" @@ -171,7 +171,7 @@ service DlpService { body: "*" } additional_bindings { - post: "/v2/{parent=projects/*/locations/*}/inspectTemplates" + post: "/v2/{parent=organizations/*}/inspectTemplates" body: "*" } }; @@ -185,7 +185,7 @@ service DlpService { rpc UpdateInspectTemplate(UpdateInspectTemplateRequest) returns (InspectTemplate) { option (google.api.http) = { - patch: "/v2/{name=organizations/*/inspectTemplates/*}" + patch: "/v2/{name=projects/*/locations/*/inspectTemplates/*}" body: "*" additional_bindings { patch: "/v2/{name=organizations/*/locations/*/inspectTemplates/*}" @@ -196,7 +196,7 @@ service DlpService { body: "*" } additional_bindings { - patch: "/v2/{name=projects/*/locations/*/inspectTemplates/*}" + patch: "/v2/{name=organizations/*/inspectTemplates/*}" body: "*" } }; @@ -209,13 +209,13 @@ service DlpService { // to learn more. rpc GetInspectTemplate(GetInspectTemplateRequest) returns (InspectTemplate) { option (google.api.http) = { - get: "/v2/{name=organizations/*/inspectTemplates/*}" + get: "/v2/{name=projects/*/locations/*/inspectTemplates/*}" additional_bindings { get: "/v2/{name=organizations/*/locations/*/inspectTemplates/*}" } additional_bindings { get: "/v2/{name=projects/*/inspectTemplates/*}" } additional_bindings { - get: "/v2/{name=projects/*/locations/*/inspectTemplates/*}" + get: "/v2/{name=organizations/*/inspectTemplates/*}" } }; option (google.api.method_signature) = "name"; @@ -228,13 +228,13 @@ service DlpService { rpc ListInspectTemplates(ListInspectTemplatesRequest) returns (ListInspectTemplatesResponse) { option (google.api.http) = { - get: "/v2/{parent=organizations/*}/inspectTemplates" + get: "/v2/{parent=projects/*/locations/*}/inspectTemplates" additional_bindings { get: "/v2/{parent=organizations/*/locations/*}/inspectTemplates" } additional_bindings { get: "/v2/{parent=projects/*}/inspectTemplates" } additional_bindings { - get: "/v2/{parent=projects/*/locations/*}/inspectTemplates" + get: "/v2/{parent=organizations/*}/inspectTemplates" } }; option (google.api.method_signature) = "parent"; @@ -247,13 +247,13 @@ service DlpService { rpc DeleteInspectTemplate(DeleteInspectTemplateRequest) returns (google.protobuf.Empty) { option (google.api.http) = { - delete: "/v2/{name=organizations/*/inspectTemplates/*}" + delete: "/v2/{name=projects/*/locations/*/inspectTemplates/*}" additional_bindings { delete: "/v2/{name=organizations/*/locations/*/inspectTemplates/*}" } additional_bindings { delete: "/v2/{name=projects/*/inspectTemplates/*}" } additional_bindings { - delete: "/v2/{name=projects/*/locations/*/inspectTemplates/*}" + delete: "/v2/{name=organizations/*/inspectTemplates/*}" } }; option (google.api.method_signature) = "name"; @@ -898,6 +898,10 @@ service DlpService { option (google.api.http) = { post: "/v2/{parent=projects/*/locations/*}/connections" body: "*" + additional_bindings { + post: "/v2/{parent=organizations/*/locations/*}/connections" + body: "*" + } }; option (google.api.method_signature) = "parent, connection"; } @@ -906,15 +910,22 @@ service DlpService { rpc GetConnection(GetConnectionRequest) returns (Connection) { option (google.api.http) = { get: "/v2/{name=projects/*/locations/*/connections/*}" + additional_bindings { + get: "/v2/{name=organizations/*/locations/*/connections/*}" + } }; option (google.api.method_signature) = "name"; } - // Lists Connections in a parent. + // Lists Connections in a parent. Use SearchConnections to see all connections + // within an organization. rpc ListConnections(ListConnectionsRequest) returns (ListConnectionsResponse) { option (google.api.http) = { get: "/v2/{parent=projects/*/locations/*}/connections" + additional_bindings { + get: "/v2/{parent=organizations/*/locations/*}/connections" + } }; option (google.api.method_signature) = "parent"; } @@ -936,6 +947,9 @@ service DlpService { returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v2/{name=projects/*/locations/*/connections/*}" + additional_bindings { + delete: "/v2/{name=organizations/*/locations/*/connections/*}" + } }; option (google.api.method_signature) = "name"; } @@ -945,6 +959,10 @@ service DlpService { option (google.api.http) = { patch: "/v2/{name=projects/*/locations/*/connections/*}" body: "*" + additional_bindings { + patch: "/v2/{name=organizations/*/locations/*/connections/*}" + body: "*" + } }; option (google.api.method_signature) = "name"; } @@ -1567,9 +1585,9 @@ message RedactImageRequest { // location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): // // + Projects scope, location specified: - // `projects/`PROJECT_ID`/locations/`LOCATION_ID + // `projects/{project_id}/locations/{location_id}` // + Projects scope, no location specified (defaults to global): - // `projects/`PROJECT_ID + // `projects/{project_id}` // // The following example `parent` string specifies a parent project with the // identifier `example-project`, and specifies the `europe-west3` location @@ -1632,9 +1650,9 @@ message DeidentifyContentRequest { // location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): // // + Projects scope, location specified: - // `projects/`PROJECT_ID`/locations/`LOCATION_ID + // `projects/{project_id}/locations/{location_id}` // + Projects scope, no location specified (defaults to global): - // `projects/`PROJECT_ID + // `projects/{project_id}` // // The following example `parent` string specifies a parent project with the // identifier `example-project`, and specifies the `europe-west3` location @@ -1701,9 +1719,9 @@ message ReidentifyContentRequest { // location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): // // + Projects scope, location specified: - // `projects/`PROJECT_ID`/locations/`LOCATION_ID + // `projects/{project_id}/locations/{location_id}` // + Projects scope, no location specified (defaults to global): - // `projects/`PROJECT_ID + // `projects/{project_id}` // // The following example `parent` string specifies a parent project with the // identifier `example-project`, and specifies the `europe-west3` location @@ -1773,9 +1791,9 @@ message InspectContentRequest { // location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): // // + Projects scope, location specified: - // `projects/`PROJECT_ID`/locations/`LOCATION_ID + // `projects/{project_id}/locations/{location_id}` // + Projects scope, no location specified (defaults to global): - // `projects/`PROJECT_ID + // `projects/{project_id}` // // The following example `parent` string specifies a parent project with the // identifier `example-project`, and specifies the `europe-west3` location @@ -2258,7 +2276,7 @@ message ListInfoTypesRequest { // // The format of this value is as follows: // - // locations/LOCATION_ID + // `locations/{location_id}` string parent = 4; // BCP-47 language code for localized infoType friendly @@ -3357,8 +3375,7 @@ message CryptoReplaceFfxFpeConfig { // This must be encoded as ASCII. // The order of characters does not matter. // The full list of allowed characters is: - // 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz - // ~`!@#$%^&*()_-+={[}]|\:;"'<,>.?/ + // ``0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz~`!@#$%^&*()_-+={[}]|\:;"'<,>.?/`` string custom_alphabet = 5; // The native way to select the alphabet. Must be in the range [2, 95]. @@ -4281,13 +4298,13 @@ message CreateInspectTemplateRequest { // location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): // // + Projects scope, location specified: - // `projects/`PROJECT_ID`/locations/`LOCATION_ID + // `projects/{project_id}/locations/{location_id}` // + Projects scope, no location specified (defaults to global): - // `projects/`PROJECT_ID + // `projects/{project_id}` // + Organizations scope, location specified: - // `organizations/`ORG_ID`/locations/`LOCATION_ID + // `organizations/{org_id}/locations/{location_id}` // + Organizations scope, no location specified (defaults to global): - // `organizations/`ORG_ID + // `organizations/{org_id}` // // The following example `parent` string specifies a parent project with the // identifier `example-project`, and specifies the `europe-west3` location @@ -4355,13 +4372,13 @@ message ListInspectTemplatesRequest { // location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): // // + Projects scope, location specified: - // `projects/`PROJECT_ID`/locations/`LOCATION_ID + // `projects/{project_id}/locations/{location_id}` // + Projects scope, no location specified (defaults to global): - // `projects/`PROJECT_ID + // `projects/{project_id}` // + Organizations scope, location specified: - // `organizations/`ORG_ID`/locations/`LOCATION_ID + // `organizations/{org_id}/locations/{location_id}` // + Organizations scope, no location specified (defaults to global): - // `organizations/`ORG_ID + // `organizations/{org_id}` // // The following example `parent` string specifies a parent project with the // identifier `example-project`, and specifies the `europe-west3` location @@ -4434,9 +4451,9 @@ message CreateJobTriggerRequest { // location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): // // + Projects scope, location specified: - // `projects/`PROJECT_ID`/locations/`LOCATION_ID + // `projects/{project_id}/locations/{location_id}` // + Projects scope, no location specified (defaults to global): - // `projects/`PROJECT_ID + // `projects/{project_id}` // // The following example `parent` string specifies a parent project with the // identifier `example-project`, and specifies the `europe-west3` location @@ -4507,9 +4524,9 @@ message CreateDiscoveryConfigRequest { // (project or organization): // // + Projects scope: - // `projects/`PROJECT_ID`/locations/`LOCATION_ID + // `projects/{project_id}/locations/{location_id}` // + Organizations scope: - // `organizations/`ORG_ID`/locations/`LOCATION_ID + // `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 @@ -4568,7 +4585,7 @@ message ListDiscoveryConfigsRequest { // Required. Parent resource name. // // The format of this value is as follows: - // `projects/`PROJECT_ID`/locations/`LOCATION_ID + // `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 @@ -4638,9 +4655,9 @@ message CreateDlpJobRequest { // location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): // // + Projects scope, location specified: - // `projects/`PROJECT_ID`/locations/`LOCATION_ID + // `projects/{project_id}/locations/{location_id}` // + Projects scope, no location specified (defaults to global): - // `projects/`PROJECT_ID + // `projects/{project_id}` // // The following example `parent` string specifies a parent project with the // identifier `example-project`, and specifies the `europe-west3` location @@ -4683,9 +4700,9 @@ message ListJobTriggersRequest { // location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): // // + Projects scope, location specified: - // `projects/`PROJECT_ID`/locations/`LOCATION_ID + // `projects/{project_id}/locations/{location_id}` // + Projects scope, no location specified (defaults to global): - // `projects/`PROJECT_ID + // `projects/{project_id}` // // The following example `parent` string specifies a parent project with the // identifier `example-project`, and specifies the `europe-west3` location @@ -4794,6 +4811,18 @@ message InspectJobConfig { repeated Action actions = 4; } +// Whether a profile being created is the first generation or an update. +enum ProfileGeneration { + // Unused. + PROFILE_GENERATION_UNSPECIFIED = 0; + + // The profile is the first profile for the resource. + PROFILE_GENERATION_NEW = 1; + + // The profile is an update to a previous profile. + PROFILE_GENERATION_UPDATE = 2; +} + // A task to execute when a data profile has been generated. message DataProfileAction { // If set, the detailed data profiles will be persisted to the location @@ -4868,6 +4897,60 @@ message DataProfileAction { ERROR_CHANGED = 4; } + // If set, attaches the [tags] + // (https://cloud.google.com/resource-manager/docs/tags/tags-overview) + // provided to profiled resources. Tags support [access + // control](https://cloud.google.com/iam/docs/tags-access-control). You can + // conditionally grant or deny access to a resource based on whether the + // resource has a specific tag. + message TagResources { + // The tag to attach to profiles matching the condition. At most one + // `TagCondition` can be specified per sensitivity level. + message TagCondition { + // The tag value to attach to resources. + TagValue tag = 1; + + // The type of condition on which attaching the tag will be predicated. + oneof type { + // Conditions attaching the tag to a resource on its profile having this + // sensitivity score. + SensitivityScore sensitivity_score = 2; + } + } + + // A value of a tag. + message TagValue { + // The format of the tag value. + oneof format { + // The namespaced name for the tag value to attach to resources. Must be + // in the format `{parent_id}/{tag_key_short_name}/{short_name}`, for + // example, "123456/environment/prod". + string namespaced_value = 1; + } + } + + // The tags to associate with different conditions. + repeated TagCondition tag_conditions = 1; + + // The profile generations for which the tag should be attached to + // resources. If you attach a tag to only new profiles, then if the + // sensitivity score of a profile subsequently changes, its tag doesn't + // change. By default, this field includes only new profiles. To include + // both new and updated profiles for tagging, this field should explicitly + // include both `PROFILE_GENERATION_NEW` and `PROFILE_GENERATION_UPDATE`. + repeated ProfileGeneration profile_generations_to_tag = 2; + + // Whether applying a tag to a resource should lower the risk of the profile + // for that resource. For example, in conjunction with an [IAM deny + // policy](https://cloud.google.com/iam/docs/deny-overview), you can deny + // all principals a permission if a tag value is present, mitigating the + // risk of the resource. This also lowers the data risk of resources at the + // lower levels of the resource hierarchy. For example, reducing the data + // risk of a table data profile also reduces the data risk of the + // constituent column data profiles. + bool lower_data_risk_to_low = 3; + } + // Type of action to execute when a profile is generated. oneof action { // Export data profiles into a provided location. @@ -4875,6 +4958,9 @@ message DataProfileAction { // Publish a message into the Pub/Sub topic. PubSubNotification pub_sub_notification = 2; + + // Tags the profiled resources with the specified tag values. + TagResources tag_resources = 8; } } @@ -5246,6 +5332,10 @@ message DiscoveryGenerationCadence { // defined by the `InspectTemplate` change. // If not set, changing the template will not cause a data profile to update. DiscoveryInspectTemplateModifiedCadence inspect_template_modified_cadence = 3; + + // Frequency at which profiles should be updated, regardless of whether the + // underlying resource has changed. Defaults to never. + DataProfileUpdateFrequency refresh_frequency = 4; } // The cadence at which to update data profiles when a table is modified. @@ -5734,7 +5824,7 @@ message DiscoveryStartingLocation { // The ID of an organization to scan. int64 organization_id = 1; - // The ID of the folder within an organization to scan. + // The ID of the folder within an organization to be scanned. int64 folder_id = 2; } } @@ -5837,9 +5927,9 @@ message ListDlpJobsRequest { // location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): // // + Projects scope, location specified: - // `projects/`PROJECT_ID`/locations/`LOCATION_ID + // `projects/{project_id}/locations/{location_id}` // + Projects scope, no location specified (defaults to global): - // `projects/`PROJECT_ID + // `projects/{project_id}` // // The following example `parent` string specifies a parent project with the // identifier `example-project`, and specifies the `europe-west3` location @@ -5956,13 +6046,13 @@ message CreateDeidentifyTemplateRequest { // location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): // // + Projects scope, location specified: - // `projects/`PROJECT_ID`/locations/`LOCATION_ID + // `projects/{project_id}/locations/{location_id}` // + Projects scope, no location specified (defaults to global): - // `projects/`PROJECT_ID + // `projects/{project_id}` // + Organizations scope, location specified: - // `organizations/`ORG_ID`/locations/`LOCATION_ID + // `organizations/{org_id}/locations/{location_id}` // + Organizations scope, no location specified (defaults to global): - // `organizations/`ORG_ID + // `organizations/{org_id}` // // The following example `parent` string specifies a parent project with the // identifier `example-project`, and specifies the `europe-west3` location @@ -6032,13 +6122,13 @@ message ListDeidentifyTemplatesRequest { // location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): // // + Projects scope, location specified: - // `projects/`PROJECT_ID`/locations/`LOCATION_ID + // `projects/{project_id}/locations/{location_id}` // + Projects scope, no location specified (defaults to global): - // `projects/`PROJECT_ID + // `projects/{project_id}` // + Organizations scope, location specified: - // `organizations/`ORG_ID`/locations/`LOCATION_ID + // `organizations/{org_id}/locations/{location_id}` // + Organizations scope, no location specified (defaults to global): - // `organizations/`ORG_ID + // `organizations/{org_id}` // // The following example `parent` string specifies a parent project with the // identifier `example-project`, and specifies the `europe-west3` location @@ -6229,13 +6319,13 @@ message CreateStoredInfoTypeRequest { // location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): // // + Projects scope, location specified: - // `projects/`PROJECT_ID`/locations/`LOCATION_ID + // `projects/{project_id}/locations/{location_id}` // + Projects scope, no location specified (defaults to global): - // `projects/`PROJECT_ID + // `projects/{project_id}` // + Organizations scope, location specified: - // `organizations/`ORG_ID`/locations/`LOCATION_ID + // `organizations/{org_id}/locations/{location_id}` // + Organizations scope, no location specified (defaults to global): - // `organizations/`ORG_ID + // `organizations/{org_id}` // // The following example `parent` string specifies a parent project with the // identifier `example-project`, and specifies the `europe-west3` location @@ -6305,9 +6395,9 @@ message ListStoredInfoTypesRequest { // location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): // // + Projects scope, location specified: - // `projects/`PROJECT_ID`/locations/`LOCATION_ID + // `projects/{project_id}/locations/{location_id}` // + Projects scope, no location specified (defaults to global): - // `projects/`PROJECT_ID + // `projects/{project_id}` // // The following example `parent` string specifies a parent project with the // identifier `example-project`, and specifies the `europe-west3` location @@ -7637,8 +7727,15 @@ message DataProfilePubSubMessage { // Request message for CreateConnection. message CreateConnectionRequest { - // Required. Parent resource name in the format: - // `projects/{project}/locations/{location}`. + // Required. 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}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -7662,8 +7759,9 @@ message GetConnectionRequest { // Request message for ListConnections. message ListConnectionsRequest { - // Required. Parent name, for example: - // `projects/project-id/locations/global`. + // Required. Resource name of the organization or project, for + // example, `organizations/433245324/locations/europe` or + // `projects/project-id/locations/asia`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -7684,8 +7782,9 @@ message ListConnectionsRequest { // Request message for SearchConnections. message SearchConnectionsRequest { - // Required. Parent name, typically an organization, without location. - // For example: `organizations/12345678`. + // Required. Resource name of the organization or project with a wildcard + // location, for example, `organizations/433245324/locations/-` or + // `projects/project-id/locations/-`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -7759,6 +7858,7 @@ message Connection { option (google.api.resource) = { type: "dlp.googleapis.com/Connection" pattern: "projects/{project}/locations/{location}/connections/{connection}" + pattern: "organizations/{organization}/locations/{location}/connections/{connection}" }; // Output only. Name of the connection: @@ -7891,7 +7991,7 @@ message DataSourceType { // Message used to identify file cluster type being profiled. message FileClusterType { // Cluster type. Each cluster corresponds to a set of file types. - // Over time new types may be added. + // Over time, new types may be added and files may move between clusters. enum Cluster { // Unused. CLUSTER_UNSPECIFIED = 0; diff --git a/packages/google-privacy-dlp/protos/google/privacy/dlp/v2/storage.proto b/packages/google-privacy-dlp/protos/google/privacy/dlp/v2/storage.proto index 2f3763d63a6..db3dad755b3 100644 --- a/packages/google-privacy-dlp/protos/google/privacy/dlp/v2/storage.proto +++ b/packages/google-privacy-dlp/protos/google/privacy/dlp/v2/storage.proto @@ -653,7 +653,7 @@ message StorageConfig { // Specification of the field containing the timestamp of scanned items. // Used for data sources like Datastore and BigQuery. // - // For BigQuery + // **For BigQuery** // // If this value is not specified and the table was modified between the // given start and end times, the entire table will be scanned. If this @@ -668,13 +668,11 @@ message StorageConfig { // you can use any of the following pseudo-columns as your timestamp field. // When used with Cloud DLP, these pseudo-column names are case sensitive. // - // + // - `_PARTITIONTIME` + // - `_PARTITIONDATE` + // - `_PARTITION_LOAD_TIME` // - // For Datastore + // **For Datastore** // // If this value is specified, then entities are filtered based on the given // start and end times. If an entity does not contain the provided timestamp diff --git a/packages/google-privacy-dlp/protos/protos.d.ts b/packages/google-privacy-dlp/protos/protos.d.ts index 2dae866f81f..181c1956091 100644 --- a/packages/google-privacy-dlp/protos/protos.d.ts +++ b/packages/google-privacy-dlp/protos/protos.d.ts @@ -20095,6 +20095,13 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** ProfileGeneration enum. */ + enum ProfileGeneration { + PROFILE_GENERATION_UNSPECIFIED = 0, + PROFILE_GENERATION_NEW = 1, + PROFILE_GENERATION_UPDATE = 2 + } + /** Properties of a DataProfileAction. */ interface IDataProfileAction { @@ -20103,6 +20110,9 @@ export namespace google { /** DataProfileAction pubSubNotification */ pubSubNotification?: (google.privacy.dlp.v2.DataProfileAction.IPubSubNotification|null); + + /** DataProfileAction tagResources */ + tagResources?: (google.privacy.dlp.v2.DataProfileAction.ITagResources|null); } /** Represents a DataProfileAction. */ @@ -20120,8 +20130,11 @@ export namespace google { /** DataProfileAction pubSubNotification. */ public pubSubNotification?: (google.privacy.dlp.v2.DataProfileAction.IPubSubNotification|null); + /** DataProfileAction tagResources. */ + public tagResources?: (google.privacy.dlp.v2.DataProfileAction.ITagResources|null); + /** DataProfileAction action. */ - public action?: ("exportData"|"pubSubNotification"); + public action?: ("exportData"|"pubSubNotification"|"tagResources"); /** * Creates a new DataProfileAction instance using the specified properties. @@ -20434,6 +20447,324 @@ export namespace google { SCORE_INCREASED = 3, ERROR_CHANGED = 4 } + + /** Properties of a TagResources. */ + interface ITagResources { + + /** TagResources tagConditions */ + tagConditions?: (google.privacy.dlp.v2.DataProfileAction.TagResources.ITagCondition[]|null); + + /** TagResources profileGenerationsToTag */ + profileGenerationsToTag?: (google.privacy.dlp.v2.ProfileGeneration[]|null); + + /** TagResources lowerDataRiskToLow */ + lowerDataRiskToLow?: (boolean|null); + } + + /** Represents a TagResources. */ + class TagResources implements ITagResources { + + /** + * Constructs a new TagResources. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.DataProfileAction.ITagResources); + + /** TagResources tagConditions. */ + public tagConditions: google.privacy.dlp.v2.DataProfileAction.TagResources.ITagCondition[]; + + /** TagResources profileGenerationsToTag. */ + public profileGenerationsToTag: google.privacy.dlp.v2.ProfileGeneration[]; + + /** TagResources lowerDataRiskToLow. */ + public lowerDataRiskToLow: boolean; + + /** + * Creates a new TagResources instance using the specified properties. + * @param [properties] Properties to set + * @returns TagResources instance + */ + public static create(properties?: google.privacy.dlp.v2.DataProfileAction.ITagResources): google.privacy.dlp.v2.DataProfileAction.TagResources; + + /** + * Encodes the specified TagResources message. Does not implicitly {@link google.privacy.dlp.v2.DataProfileAction.TagResources.verify|verify} messages. + * @param message TagResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.DataProfileAction.ITagResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TagResources message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DataProfileAction.TagResources.verify|verify} messages. + * @param message TagResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.DataProfileAction.ITagResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TagResources message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TagResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.privacy.dlp.v2.DataProfileAction.TagResources; + + /** + * Decodes a TagResources message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TagResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.privacy.dlp.v2.DataProfileAction.TagResources; + + /** + * Verifies a TagResources message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TagResources message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TagResources + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.DataProfileAction.TagResources; + + /** + * Creates a plain object from a TagResources message. Also converts values to other types if specified. + * @param message TagResources + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.DataProfileAction.TagResources, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TagResources to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TagResources + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TagResources { + + /** Properties of a TagCondition. */ + interface ITagCondition { + + /** TagCondition tag */ + tag?: (google.privacy.dlp.v2.DataProfileAction.TagResources.ITagValue|null); + + /** TagCondition sensitivityScore */ + sensitivityScore?: (google.privacy.dlp.v2.ISensitivityScore|null); + } + + /** Represents a TagCondition. */ + class TagCondition implements ITagCondition { + + /** + * Constructs a new TagCondition. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.DataProfileAction.TagResources.ITagCondition); + + /** TagCondition tag. */ + public tag?: (google.privacy.dlp.v2.DataProfileAction.TagResources.ITagValue|null); + + /** TagCondition sensitivityScore. */ + public sensitivityScore?: (google.privacy.dlp.v2.ISensitivityScore|null); + + /** TagCondition type. */ + public type?: "sensitivityScore"; + + /** + * Creates a new TagCondition instance using the specified properties. + * @param [properties] Properties to set + * @returns TagCondition instance + */ + public static create(properties?: google.privacy.dlp.v2.DataProfileAction.TagResources.ITagCondition): google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition; + + /** + * Encodes the specified TagCondition message. Does not implicitly {@link google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition.verify|verify} messages. + * @param message TagCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.DataProfileAction.TagResources.ITagCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TagCondition message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition.verify|verify} messages. + * @param message TagCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.DataProfileAction.TagResources.ITagCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TagCondition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TagCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition; + + /** + * Decodes a TagCondition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TagCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition; + + /** + * Verifies a TagCondition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TagCondition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TagCondition + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition; + + /** + * Creates a plain object from a TagCondition message. Also converts values to other types if specified. + * @param message TagCondition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TagCondition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TagCondition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TagValue. */ + interface ITagValue { + + /** TagValue namespacedValue */ + namespacedValue?: (string|null); + } + + /** Represents a TagValue. */ + class TagValue implements ITagValue { + + /** + * Constructs a new TagValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.DataProfileAction.TagResources.ITagValue); + + /** TagValue namespacedValue. */ + public namespacedValue?: (string|null); + + /** TagValue format. */ + public format?: "namespacedValue"; + + /** + * Creates a new TagValue instance using the specified properties. + * @param [properties] Properties to set + * @returns TagValue instance + */ + public static create(properties?: google.privacy.dlp.v2.DataProfileAction.TagResources.ITagValue): google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue; + + /** + * Encodes the specified TagValue message. Does not implicitly {@link google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue.verify|verify} messages. + * @param message TagValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.DataProfileAction.TagResources.ITagValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TagValue message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue.verify|verify} messages. + * @param message TagValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.DataProfileAction.TagResources.ITagValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TagValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TagValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue; + + /** + * Decodes a TagValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TagValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue; + + /** + * Verifies a TagValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TagValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TagValue + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue; + + /** + * Creates a plain object from a TagValue message. Also converts values to other types if specified. + * @param message TagValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TagValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TagValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } } /** Properties of a DataProfileJobConfig. */ @@ -22120,6 +22451,9 @@ export namespace google { /** DiscoveryGenerationCadence inspectTemplateModifiedCadence */ inspectTemplateModifiedCadence?: (google.privacy.dlp.v2.IDiscoveryInspectTemplateModifiedCadence|null); + + /** DiscoveryGenerationCadence refreshFrequency */ + refreshFrequency?: (google.privacy.dlp.v2.DataProfileUpdateFrequency|keyof typeof google.privacy.dlp.v2.DataProfileUpdateFrequency|null); } /** Represents a DiscoveryGenerationCadence. */ @@ -22140,6 +22474,9 @@ export namespace google { /** DiscoveryGenerationCadence inspectTemplateModifiedCadence. */ public inspectTemplateModifiedCadence?: (google.privacy.dlp.v2.IDiscoveryInspectTemplateModifiedCadence|null); + /** DiscoveryGenerationCadence refreshFrequency. */ + public refreshFrequency: (google.privacy.dlp.v2.DataProfileUpdateFrequency|keyof typeof google.privacy.dlp.v2.DataProfileUpdateFrequency); + /** * Creates a new DiscoveryGenerationCadence instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-privacy-dlp/protos/protos.js b/packages/google-privacy-dlp/protos/protos.js index 6ba5c038b02..638cb3cb6c7 100644 --- a/packages/google-privacy-dlp/protos/protos.js +++ b/packages/google-privacy-dlp/protos/protos.js @@ -49944,6 +49944,22 @@ return InspectJobConfig; })(); + /** + * ProfileGeneration enum. + * @name google.privacy.dlp.v2.ProfileGeneration + * @enum {number} + * @property {number} PROFILE_GENERATION_UNSPECIFIED=0 PROFILE_GENERATION_UNSPECIFIED value + * @property {number} PROFILE_GENERATION_NEW=1 PROFILE_GENERATION_NEW value + * @property {number} PROFILE_GENERATION_UPDATE=2 PROFILE_GENERATION_UPDATE value + */ + v2.ProfileGeneration = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROFILE_GENERATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROFILE_GENERATION_NEW"] = 1; + values[valuesById[2] = "PROFILE_GENERATION_UPDATE"] = 2; + return values; + })(); + v2.DataProfileAction = (function() { /** @@ -49952,6 +49968,7 @@ * @interface IDataProfileAction * @property {google.privacy.dlp.v2.DataProfileAction.IExport|null} [exportData] DataProfileAction exportData * @property {google.privacy.dlp.v2.DataProfileAction.IPubSubNotification|null} [pubSubNotification] DataProfileAction pubSubNotification + * @property {google.privacy.dlp.v2.DataProfileAction.ITagResources|null} [tagResources] DataProfileAction tagResources */ /** @@ -49985,17 +50002,25 @@ */ DataProfileAction.prototype.pubSubNotification = null; + /** + * DataProfileAction tagResources. + * @member {google.privacy.dlp.v2.DataProfileAction.ITagResources|null|undefined} tagResources + * @memberof google.privacy.dlp.v2.DataProfileAction + * @instance + */ + DataProfileAction.prototype.tagResources = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * DataProfileAction action. - * @member {"exportData"|"pubSubNotification"|undefined} action + * @member {"exportData"|"pubSubNotification"|"tagResources"|undefined} action * @memberof google.privacy.dlp.v2.DataProfileAction * @instance */ Object.defineProperty(DataProfileAction.prototype, "action", { - get: $util.oneOfGetter($oneOfFields = ["exportData", "pubSubNotification"]), + get: $util.oneOfGetter($oneOfFields = ["exportData", "pubSubNotification", "tagResources"]), set: $util.oneOfSetter($oneOfFields) }); @@ -50027,6 +50052,8 @@ $root.google.privacy.dlp.v2.DataProfileAction.Export.encode(message.exportData, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.pubSubNotification != null && Object.hasOwnProperty.call(message, "pubSubNotification")) $root.google.privacy.dlp.v2.DataProfileAction.PubSubNotification.encode(message.pubSubNotification, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.tagResources != null && Object.hasOwnProperty.call(message, "tagResources")) + $root.google.privacy.dlp.v2.DataProfileAction.TagResources.encode(message.tagResources, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; @@ -50069,6 +50096,10 @@ message.pubSubNotification = $root.google.privacy.dlp.v2.DataProfileAction.PubSubNotification.decode(reader, reader.uint32()); break; } + case 8: { + message.tagResources = $root.google.privacy.dlp.v2.DataProfileAction.TagResources.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -50123,6 +50154,16 @@ return "pubSubNotification." + error; } } + if (message.tagResources != null && message.hasOwnProperty("tagResources")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.privacy.dlp.v2.DataProfileAction.TagResources.verify(message.tagResources); + if (error) + return "tagResources." + error; + } + } return null; }; @@ -50148,6 +50189,11 @@ throw TypeError(".google.privacy.dlp.v2.DataProfileAction.pubSubNotification: object expected"); message.pubSubNotification = $root.google.privacy.dlp.v2.DataProfileAction.PubSubNotification.fromObject(object.pubSubNotification); } + if (object.tagResources != null) { + if (typeof object.tagResources !== "object") + throw TypeError(".google.privacy.dlp.v2.DataProfileAction.tagResources: object expected"); + message.tagResources = $root.google.privacy.dlp.v2.DataProfileAction.TagResources.fromObject(object.tagResources); + } return message; }; @@ -50174,6 +50220,11 @@ if (options.oneofs) object.action = "pubSubNotification"; } + if (message.tagResources != null && message.hasOwnProperty("tagResources")) { + object.tagResources = $root.google.privacy.dlp.v2.DataProfileAction.TagResources.toObject(message.tagResources, options); + if (options.oneofs) + object.action = "tagResources"; + } return object; }; @@ -50639,155 +50690,952 @@ message.event = object.event; break; } - break; - case "EVENT_TYPE_UNSPECIFIED": - case 0: - message.event = 0; - break; - case "NEW_PROFILE": - case 1: - message.event = 1; - break; - case "CHANGED_PROFILE": - case 2: - message.event = 2; - break; - case "SCORE_INCREASED": - case 3: - message.event = 3; - break; - case "ERROR_CHANGED": - case 4: - message.event = 4; - break; - } - if (object.pubsubCondition != null) { - if (typeof object.pubsubCondition !== "object") - throw TypeError(".google.privacy.dlp.v2.DataProfileAction.PubSubNotification.pubsubCondition: object expected"); - message.pubsubCondition = $root.google.privacy.dlp.v2.DataProfilePubSubCondition.fromObject(object.pubsubCondition); - } - switch (object.detailOfMessage) { - default: - if (typeof object.detailOfMessage === "number") { - message.detailOfMessage = object.detailOfMessage; - break; + break; + case "EVENT_TYPE_UNSPECIFIED": + case 0: + message.event = 0; + break; + case "NEW_PROFILE": + case 1: + message.event = 1; + break; + case "CHANGED_PROFILE": + case 2: + message.event = 2; + break; + case "SCORE_INCREASED": + case 3: + message.event = 3; + break; + case "ERROR_CHANGED": + case 4: + message.event = 4; + break; + } + if (object.pubsubCondition != null) { + if (typeof object.pubsubCondition !== "object") + throw TypeError(".google.privacy.dlp.v2.DataProfileAction.PubSubNotification.pubsubCondition: object expected"); + message.pubsubCondition = $root.google.privacy.dlp.v2.DataProfilePubSubCondition.fromObject(object.pubsubCondition); + } + switch (object.detailOfMessage) { + default: + if (typeof object.detailOfMessage === "number") { + message.detailOfMessage = object.detailOfMessage; + break; + } + break; + case "DETAIL_LEVEL_UNSPECIFIED": + case 0: + message.detailOfMessage = 0; + break; + case "TABLE_PROFILE": + case 1: + message.detailOfMessage = 1; + break; + case "RESOURCE_NAME": + case 2: + message.detailOfMessage = 2; + break; + case "FILE_STORE_PROFILE": + case 3: + message.detailOfMessage = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a PubSubNotification message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.DataProfileAction.PubSubNotification + * @static + * @param {google.privacy.dlp.v2.DataProfileAction.PubSubNotification} message PubSubNotification + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PubSubNotification.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.topic = ""; + object.event = options.enums === String ? "EVENT_TYPE_UNSPECIFIED" : 0; + object.pubsubCondition = null; + object.detailOfMessage = options.enums === String ? "DETAIL_LEVEL_UNSPECIFIED" : 0; + } + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + if (message.event != null && message.hasOwnProperty("event")) + object.event = options.enums === String ? $root.google.privacy.dlp.v2.DataProfileAction.EventType[message.event] === undefined ? message.event : $root.google.privacy.dlp.v2.DataProfileAction.EventType[message.event] : message.event; + if (message.pubsubCondition != null && message.hasOwnProperty("pubsubCondition")) + object.pubsubCondition = $root.google.privacy.dlp.v2.DataProfilePubSubCondition.toObject(message.pubsubCondition, options); + if (message.detailOfMessage != null && message.hasOwnProperty("detailOfMessage")) + object.detailOfMessage = options.enums === String ? $root.google.privacy.dlp.v2.DataProfileAction.PubSubNotification.DetailLevel[message.detailOfMessage] === undefined ? message.detailOfMessage : $root.google.privacy.dlp.v2.DataProfileAction.PubSubNotification.DetailLevel[message.detailOfMessage] : message.detailOfMessage; + return object; + }; + + /** + * Converts this PubSubNotification to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.DataProfileAction.PubSubNotification + * @instance + * @returns {Object.} JSON object + */ + PubSubNotification.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PubSubNotification + * @function getTypeUrl + * @memberof google.privacy.dlp.v2.DataProfileAction.PubSubNotification + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PubSubNotification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.privacy.dlp.v2.DataProfileAction.PubSubNotification"; + }; + + /** + * DetailLevel enum. + * @name google.privacy.dlp.v2.DataProfileAction.PubSubNotification.DetailLevel + * @enum {number} + * @property {number} DETAIL_LEVEL_UNSPECIFIED=0 DETAIL_LEVEL_UNSPECIFIED value + * @property {number} TABLE_PROFILE=1 TABLE_PROFILE value + * @property {number} RESOURCE_NAME=2 RESOURCE_NAME value + * @property {number} FILE_STORE_PROFILE=3 FILE_STORE_PROFILE value + */ + PubSubNotification.DetailLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DETAIL_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "TABLE_PROFILE"] = 1; + values[valuesById[2] = "RESOURCE_NAME"] = 2; + values[valuesById[3] = "FILE_STORE_PROFILE"] = 3; + return values; + })(); + + return PubSubNotification; + })(); + + /** + * EventType enum. + * @name google.privacy.dlp.v2.DataProfileAction.EventType + * @enum {number} + * @property {number} EVENT_TYPE_UNSPECIFIED=0 EVENT_TYPE_UNSPECIFIED value + * @property {number} NEW_PROFILE=1 NEW_PROFILE value + * @property {number} CHANGED_PROFILE=2 CHANGED_PROFILE value + * @property {number} SCORE_INCREASED=3 SCORE_INCREASED value + * @property {number} ERROR_CHANGED=4 ERROR_CHANGED value + */ + DataProfileAction.EventType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EVENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NEW_PROFILE"] = 1; + values[valuesById[2] = "CHANGED_PROFILE"] = 2; + values[valuesById[3] = "SCORE_INCREASED"] = 3; + values[valuesById[4] = "ERROR_CHANGED"] = 4; + return values; + })(); + + DataProfileAction.TagResources = (function() { + + /** + * Properties of a TagResources. + * @memberof google.privacy.dlp.v2.DataProfileAction + * @interface ITagResources + * @property {Array.|null} [tagConditions] TagResources tagConditions + * @property {Array.|null} [profileGenerationsToTag] TagResources profileGenerationsToTag + * @property {boolean|null} [lowerDataRiskToLow] TagResources lowerDataRiskToLow + */ + + /** + * Constructs a new TagResources. + * @memberof google.privacy.dlp.v2.DataProfileAction + * @classdesc Represents a TagResources. + * @implements ITagResources + * @constructor + * @param {google.privacy.dlp.v2.DataProfileAction.ITagResources=} [properties] Properties to set + */ + function TagResources(properties) { + this.tagConditions = []; + this.profileGenerationsToTag = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TagResources tagConditions. + * @member {Array.} tagConditions + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources + * @instance + */ + TagResources.prototype.tagConditions = $util.emptyArray; + + /** + * TagResources profileGenerationsToTag. + * @member {Array.} profileGenerationsToTag + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources + * @instance + */ + TagResources.prototype.profileGenerationsToTag = $util.emptyArray; + + /** + * TagResources lowerDataRiskToLow. + * @member {boolean} lowerDataRiskToLow + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources + * @instance + */ + TagResources.prototype.lowerDataRiskToLow = false; + + /** + * Creates a new TagResources instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources + * @static + * @param {google.privacy.dlp.v2.DataProfileAction.ITagResources=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.DataProfileAction.TagResources} TagResources instance + */ + TagResources.create = function create(properties) { + return new TagResources(properties); + }; + + /** + * Encodes the specified TagResources message. Does not implicitly {@link google.privacy.dlp.v2.DataProfileAction.TagResources.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources + * @static + * @param {google.privacy.dlp.v2.DataProfileAction.ITagResources} message TagResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TagResources.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tagConditions != null && message.tagConditions.length) + for (var i = 0; i < message.tagConditions.length; ++i) + $root.google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition.encode(message.tagConditions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.profileGenerationsToTag != null && message.profileGenerationsToTag.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.profileGenerationsToTag.length; ++i) + writer.int32(message.profileGenerationsToTag[i]); + writer.ldelim(); + } + if (message.lowerDataRiskToLow != null && Object.hasOwnProperty.call(message, "lowerDataRiskToLow")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.lowerDataRiskToLow); + return writer; + }; + + /** + * Encodes the specified TagResources message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DataProfileAction.TagResources.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources + * @static + * @param {google.privacy.dlp.v2.DataProfileAction.ITagResources} message TagResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TagResources.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TagResources message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.DataProfileAction.TagResources} TagResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TagResources.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.privacy.dlp.v2.DataProfileAction.TagResources(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.tagConditions && message.tagConditions.length)) + message.tagConditions = []; + message.tagConditions.push($root.google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.profileGenerationsToTag && message.profileGenerationsToTag.length)) + message.profileGenerationsToTag = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.profileGenerationsToTag.push(reader.int32()); + } else + message.profileGenerationsToTag.push(reader.int32()); + break; + } + case 3: { + message.lowerDataRiskToLow = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TagResources message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.DataProfileAction.TagResources} TagResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TagResources.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TagResources message. + * @function verify + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TagResources.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tagConditions != null && message.hasOwnProperty("tagConditions")) { + if (!Array.isArray(message.tagConditions)) + return "tagConditions: array expected"; + for (var i = 0; i < message.tagConditions.length; ++i) { + var error = $root.google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition.verify(message.tagConditions[i]); + if (error) + return "tagConditions." + error; + } + } + if (message.profileGenerationsToTag != null && message.hasOwnProperty("profileGenerationsToTag")) { + if (!Array.isArray(message.profileGenerationsToTag)) + return "profileGenerationsToTag: array expected"; + for (var i = 0; i < message.profileGenerationsToTag.length; ++i) + switch (message.profileGenerationsToTag[i]) { + default: + return "profileGenerationsToTag: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.lowerDataRiskToLow != null && message.hasOwnProperty("lowerDataRiskToLow")) + if (typeof message.lowerDataRiskToLow !== "boolean") + return "lowerDataRiskToLow: boolean expected"; + return null; + }; + + /** + * Creates a TagResources message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.DataProfileAction.TagResources} TagResources + */ + TagResources.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.DataProfileAction.TagResources) + return object; + var message = new $root.google.privacy.dlp.v2.DataProfileAction.TagResources(); + if (object.tagConditions) { + if (!Array.isArray(object.tagConditions)) + throw TypeError(".google.privacy.dlp.v2.DataProfileAction.TagResources.tagConditions: array expected"); + message.tagConditions = []; + for (var i = 0; i < object.tagConditions.length; ++i) { + if (typeof object.tagConditions[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.DataProfileAction.TagResources.tagConditions: object expected"); + message.tagConditions[i] = $root.google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition.fromObject(object.tagConditions[i]); + } + } + if (object.profileGenerationsToTag) { + if (!Array.isArray(object.profileGenerationsToTag)) + throw TypeError(".google.privacy.dlp.v2.DataProfileAction.TagResources.profileGenerationsToTag: array expected"); + message.profileGenerationsToTag = []; + for (var i = 0; i < object.profileGenerationsToTag.length; ++i) + switch (object.profileGenerationsToTag[i]) { + default: + if (typeof object.profileGenerationsToTag[i] === "number") { + message.profileGenerationsToTag[i] = object.profileGenerationsToTag[i]; + break; + } + case "PROFILE_GENERATION_UNSPECIFIED": + case 0: + message.profileGenerationsToTag[i] = 0; + break; + case "PROFILE_GENERATION_NEW": + case 1: + message.profileGenerationsToTag[i] = 1; + break; + case "PROFILE_GENERATION_UPDATE": + case 2: + message.profileGenerationsToTag[i] = 2; + break; + } + } + if (object.lowerDataRiskToLow != null) + message.lowerDataRiskToLow = Boolean(object.lowerDataRiskToLow); + return message; + }; + + /** + * Creates a plain object from a TagResources message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources + * @static + * @param {google.privacy.dlp.v2.DataProfileAction.TagResources} message TagResources + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TagResources.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.tagConditions = []; + object.profileGenerationsToTag = []; + } + if (options.defaults) + object.lowerDataRiskToLow = false; + if (message.tagConditions && message.tagConditions.length) { + object.tagConditions = []; + for (var j = 0; j < message.tagConditions.length; ++j) + object.tagConditions[j] = $root.google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition.toObject(message.tagConditions[j], options); + } + if (message.profileGenerationsToTag && message.profileGenerationsToTag.length) { + object.profileGenerationsToTag = []; + for (var j = 0; j < message.profileGenerationsToTag.length; ++j) + object.profileGenerationsToTag[j] = options.enums === String ? $root.google.privacy.dlp.v2.ProfileGeneration[message.profileGenerationsToTag[j]] === undefined ? message.profileGenerationsToTag[j] : $root.google.privacy.dlp.v2.ProfileGeneration[message.profileGenerationsToTag[j]] : message.profileGenerationsToTag[j]; + } + if (message.lowerDataRiskToLow != null && message.hasOwnProperty("lowerDataRiskToLow")) + object.lowerDataRiskToLow = message.lowerDataRiskToLow; + return object; + }; + + /** + * Converts this TagResources to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources + * @instance + * @returns {Object.} JSON object + */ + TagResources.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TagResources + * @function getTypeUrl + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TagResources.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.privacy.dlp.v2.DataProfileAction.TagResources"; + }; + + TagResources.TagCondition = (function() { + + /** + * Properties of a TagCondition. + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources + * @interface ITagCondition + * @property {google.privacy.dlp.v2.DataProfileAction.TagResources.ITagValue|null} [tag] TagCondition tag + * @property {google.privacy.dlp.v2.ISensitivityScore|null} [sensitivityScore] TagCondition sensitivityScore + */ + + /** + * Constructs a new TagCondition. + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources + * @classdesc Represents a TagCondition. + * @implements ITagCondition + * @constructor + * @param {google.privacy.dlp.v2.DataProfileAction.TagResources.ITagCondition=} [properties] Properties to set + */ + function TagCondition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TagCondition tag. + * @member {google.privacy.dlp.v2.DataProfileAction.TagResources.ITagValue|null|undefined} tag + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition + * @instance + */ + TagCondition.prototype.tag = null; + + /** + * TagCondition sensitivityScore. + * @member {google.privacy.dlp.v2.ISensitivityScore|null|undefined} sensitivityScore + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition + * @instance + */ + TagCondition.prototype.sensitivityScore = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TagCondition type. + * @member {"sensitivityScore"|undefined} type + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition + * @instance + */ + Object.defineProperty(TagCondition.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["sensitivityScore"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TagCondition instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition + * @static + * @param {google.privacy.dlp.v2.DataProfileAction.TagResources.ITagCondition=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition} TagCondition instance + */ + TagCondition.create = function create(properties) { + return new TagCondition(properties); + }; + + /** + * Encodes the specified TagCondition message. Does not implicitly {@link google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition + * @static + * @param {google.privacy.dlp.v2.DataProfileAction.TagResources.ITagCondition} message TagCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TagCondition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) + $root.google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue.encode(message.tag, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.sensitivityScore != null && Object.hasOwnProperty.call(message, "sensitivityScore")) + $root.google.privacy.dlp.v2.SensitivityScore.encode(message.sensitivityScore, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TagCondition message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition + * @static + * @param {google.privacy.dlp.v2.DataProfileAction.TagResources.ITagCondition} message TagCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TagCondition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TagCondition message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition} TagCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TagCondition.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tag = $root.google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue.decode(reader, reader.uint32()); + break; + } + case 2: { + message.sensitivityScore = $root.google.privacy.dlp.v2.SensitivityScore.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TagCondition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition} TagCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TagCondition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TagCondition message. + * @function verify + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TagCondition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tag != null && message.hasOwnProperty("tag")) { + var error = $root.google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue.verify(message.tag); + if (error) + return "tag." + error; + } + if (message.sensitivityScore != null && message.hasOwnProperty("sensitivityScore")) { + properties.type = 1; + { + var error = $root.google.privacy.dlp.v2.SensitivityScore.verify(message.sensitivityScore); + if (error) + return "sensitivityScore." + error; + } + } + return null; + }; + + /** + * Creates a TagCondition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition} TagCondition + */ + TagCondition.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition) + return object; + var message = new $root.google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition(); + if (object.tag != null) { + if (typeof object.tag !== "object") + throw TypeError(".google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition.tag: object expected"); + message.tag = $root.google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue.fromObject(object.tag); + } + if (object.sensitivityScore != null) { + if (typeof object.sensitivityScore !== "object") + throw TypeError(".google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition.sensitivityScore: object expected"); + message.sensitivityScore = $root.google.privacy.dlp.v2.SensitivityScore.fromObject(object.sensitivityScore); + } + return message; + }; + + /** + * Creates a plain object from a TagCondition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition + * @static + * @param {google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition} message TagCondition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TagCondition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.tag = null; + if (message.tag != null && message.hasOwnProperty("tag")) + object.tag = $root.google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue.toObject(message.tag, options); + if (message.sensitivityScore != null && message.hasOwnProperty("sensitivityScore")) { + object.sensitivityScore = $root.google.privacy.dlp.v2.SensitivityScore.toObject(message.sensitivityScore, options); + if (options.oneofs) + object.type = "sensitivityScore"; + } + return object; + }; + + /** + * Converts this TagCondition to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition + * @instance + * @returns {Object.} JSON object + */ + TagCondition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TagCondition + * @function getTypeUrl + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TagCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.privacy.dlp.v2.DataProfileAction.TagResources.TagCondition"; + }; + + return TagCondition; + })(); + + TagResources.TagValue = (function() { + + /** + * Properties of a TagValue. + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources + * @interface ITagValue + * @property {string|null} [namespacedValue] TagValue namespacedValue + */ + + /** + * Constructs a new TagValue. + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources + * @classdesc Represents a TagValue. + * @implements ITagValue + * @constructor + * @param {google.privacy.dlp.v2.DataProfileAction.TagResources.ITagValue=} [properties] Properties to set + */ + function TagValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TagValue namespacedValue. + * @member {string|null|undefined} namespacedValue + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue + * @instance + */ + TagValue.prototype.namespacedValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TagValue format. + * @member {"namespacedValue"|undefined} format + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue + * @instance + */ + Object.defineProperty(TagValue.prototype, "format", { + get: $util.oneOfGetter($oneOfFields = ["namespacedValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TagValue instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue + * @static + * @param {google.privacy.dlp.v2.DataProfileAction.TagResources.ITagValue=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue} TagValue instance + */ + TagValue.create = function create(properties) { + return new TagValue(properties); + }; + + /** + * Encodes the specified TagValue message. Does not implicitly {@link google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue + * @static + * @param {google.privacy.dlp.v2.DataProfileAction.TagResources.ITagValue} message TagValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TagValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.namespacedValue != null && Object.hasOwnProperty.call(message, "namespacedValue")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namespacedValue); + return writer; + }; + + /** + * Encodes the specified TagValue message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue + * @static + * @param {google.privacy.dlp.v2.DataProfileAction.TagResources.ITagValue} message TagValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TagValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TagValue message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue} TagValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TagValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namespacedValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TagValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue} TagValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TagValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TagValue message. + * @function verify + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TagValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.namespacedValue != null && message.hasOwnProperty("namespacedValue")) { + properties.format = 1; + if (!$util.isString(message.namespacedValue)) + return "namespacedValue: string expected"; } - break; - case "DETAIL_LEVEL_UNSPECIFIED": - case 0: - message.detailOfMessage = 0; - break; - case "TABLE_PROFILE": - case 1: - message.detailOfMessage = 1; - break; - case "RESOURCE_NAME": - case 2: - message.detailOfMessage = 2; - break; - case "FILE_STORE_PROFILE": - case 3: - message.detailOfMessage = 3; - break; - } - return message; - }; + return null; + }; - /** - * Creates a plain object from a PubSubNotification message. Also converts values to other types if specified. - * @function toObject - * @memberof google.privacy.dlp.v2.DataProfileAction.PubSubNotification - * @static - * @param {google.privacy.dlp.v2.DataProfileAction.PubSubNotification} message PubSubNotification - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PubSubNotification.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.topic = ""; - object.event = options.enums === String ? "EVENT_TYPE_UNSPECIFIED" : 0; - object.pubsubCondition = null; - object.detailOfMessage = options.enums === String ? "DETAIL_LEVEL_UNSPECIFIED" : 0; - } - if (message.topic != null && message.hasOwnProperty("topic")) - object.topic = message.topic; - if (message.event != null && message.hasOwnProperty("event")) - object.event = options.enums === String ? $root.google.privacy.dlp.v2.DataProfileAction.EventType[message.event] === undefined ? message.event : $root.google.privacy.dlp.v2.DataProfileAction.EventType[message.event] : message.event; - if (message.pubsubCondition != null && message.hasOwnProperty("pubsubCondition")) - object.pubsubCondition = $root.google.privacy.dlp.v2.DataProfilePubSubCondition.toObject(message.pubsubCondition, options); - if (message.detailOfMessage != null && message.hasOwnProperty("detailOfMessage")) - object.detailOfMessage = options.enums === String ? $root.google.privacy.dlp.v2.DataProfileAction.PubSubNotification.DetailLevel[message.detailOfMessage] === undefined ? message.detailOfMessage : $root.google.privacy.dlp.v2.DataProfileAction.PubSubNotification.DetailLevel[message.detailOfMessage] : message.detailOfMessage; - return object; - }; + /** + * Creates a TagValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue} TagValue + */ + TagValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue) + return object; + var message = new $root.google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue(); + if (object.namespacedValue != null) + message.namespacedValue = String(object.namespacedValue); + return message; + }; - /** - * Converts this PubSubNotification to JSON. - * @function toJSON - * @memberof google.privacy.dlp.v2.DataProfileAction.PubSubNotification - * @instance - * @returns {Object.} JSON object - */ - PubSubNotification.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a TagValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue + * @static + * @param {google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue} message TagValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TagValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.namespacedValue != null && message.hasOwnProperty("namespacedValue")) { + object.namespacedValue = message.namespacedValue; + if (options.oneofs) + object.format = "namespacedValue"; + } + return object; + }; - /** - * Gets the default type url for PubSubNotification - * @function getTypeUrl - * @memberof google.privacy.dlp.v2.DataProfileAction.PubSubNotification - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PubSubNotification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.privacy.dlp.v2.DataProfileAction.PubSubNotification"; - }; + /** + * Converts this TagValue to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue + * @instance + * @returns {Object.} JSON object + */ + TagValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * DetailLevel enum. - * @name google.privacy.dlp.v2.DataProfileAction.PubSubNotification.DetailLevel - * @enum {number} - * @property {number} DETAIL_LEVEL_UNSPECIFIED=0 DETAIL_LEVEL_UNSPECIFIED value - * @property {number} TABLE_PROFILE=1 TABLE_PROFILE value - * @property {number} RESOURCE_NAME=2 RESOURCE_NAME value - * @property {number} FILE_STORE_PROFILE=3 FILE_STORE_PROFILE value - */ - PubSubNotification.DetailLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DETAIL_LEVEL_UNSPECIFIED"] = 0; - values[valuesById[1] = "TABLE_PROFILE"] = 1; - values[valuesById[2] = "RESOURCE_NAME"] = 2; - values[valuesById[3] = "FILE_STORE_PROFILE"] = 3; - return values; - })(); + /** + * Gets the default type url for TagValue + * @function getTypeUrl + * @memberof google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TagValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.privacy.dlp.v2.DataProfileAction.TagResources.TagValue"; + }; - return PubSubNotification; - })(); + return TagValue; + })(); - /** - * EventType enum. - * @name google.privacy.dlp.v2.DataProfileAction.EventType - * @enum {number} - * @property {number} EVENT_TYPE_UNSPECIFIED=0 EVENT_TYPE_UNSPECIFIED value - * @property {number} NEW_PROFILE=1 NEW_PROFILE value - * @property {number} CHANGED_PROFILE=2 CHANGED_PROFILE value - * @property {number} SCORE_INCREASED=3 SCORE_INCREASED value - * @property {number} ERROR_CHANGED=4 ERROR_CHANGED value - */ - DataProfileAction.EventType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EVENT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "NEW_PROFILE"] = 1; - values[valuesById[2] = "CHANGED_PROFILE"] = 2; - values[valuesById[3] = "SCORE_INCREASED"] = 3; - values[valuesById[4] = "ERROR_CHANGED"] = 4; - return values; + return TagResources; })(); return DataProfileAction; @@ -55067,6 +55915,7 @@ * @property {google.privacy.dlp.v2.IDiscoverySchemaModifiedCadence|null} [schemaModifiedCadence] DiscoveryGenerationCadence schemaModifiedCadence * @property {google.privacy.dlp.v2.IDiscoveryTableModifiedCadence|null} [tableModifiedCadence] DiscoveryGenerationCadence tableModifiedCadence * @property {google.privacy.dlp.v2.IDiscoveryInspectTemplateModifiedCadence|null} [inspectTemplateModifiedCadence] DiscoveryGenerationCadence inspectTemplateModifiedCadence + * @property {google.privacy.dlp.v2.DataProfileUpdateFrequency|null} [refreshFrequency] DiscoveryGenerationCadence refreshFrequency */ /** @@ -55108,6 +55957,14 @@ */ DiscoveryGenerationCadence.prototype.inspectTemplateModifiedCadence = null; + /** + * DiscoveryGenerationCadence refreshFrequency. + * @member {google.privacy.dlp.v2.DataProfileUpdateFrequency} refreshFrequency + * @memberof google.privacy.dlp.v2.DiscoveryGenerationCadence + * @instance + */ + DiscoveryGenerationCadence.prototype.refreshFrequency = 0; + /** * Creates a new DiscoveryGenerationCadence instance using the specified properties. * @function create @@ -55138,6 +55995,8 @@ $root.google.privacy.dlp.v2.DiscoveryTableModifiedCadence.encode(message.tableModifiedCadence, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.inspectTemplateModifiedCadence != null && Object.hasOwnProperty.call(message, "inspectTemplateModifiedCadence")) $root.google.privacy.dlp.v2.DiscoveryInspectTemplateModifiedCadence.encode(message.inspectTemplateModifiedCadence, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.refreshFrequency != null && Object.hasOwnProperty.call(message, "refreshFrequency")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.refreshFrequency); return writer; }; @@ -55184,6 +56043,10 @@ message.inspectTemplateModifiedCadence = $root.google.privacy.dlp.v2.DiscoveryInspectTemplateModifiedCadence.decode(reader, reader.uint32()); break; } + case 4: { + message.refreshFrequency = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -55234,6 +56097,16 @@ if (error) return "inspectTemplateModifiedCadence." + error; } + if (message.refreshFrequency != null && message.hasOwnProperty("refreshFrequency")) + switch (message.refreshFrequency) { + default: + return "refreshFrequency: enum value expected"; + case 0: + case 1: + case 2: + case 4: + break; + } return null; }; @@ -55264,6 +56137,30 @@ throw TypeError(".google.privacy.dlp.v2.DiscoveryGenerationCadence.inspectTemplateModifiedCadence: object expected"); message.inspectTemplateModifiedCadence = $root.google.privacy.dlp.v2.DiscoveryInspectTemplateModifiedCadence.fromObject(object.inspectTemplateModifiedCadence); } + switch (object.refreshFrequency) { + default: + if (typeof object.refreshFrequency === "number") { + message.refreshFrequency = object.refreshFrequency; + break; + } + break; + case "UPDATE_FREQUENCY_UNSPECIFIED": + case 0: + message.refreshFrequency = 0; + break; + case "UPDATE_FREQUENCY_NEVER": + case 1: + message.refreshFrequency = 1; + break; + case "UPDATE_FREQUENCY_DAILY": + case 2: + message.refreshFrequency = 2; + break; + case "UPDATE_FREQUENCY_MONTHLY": + case 4: + message.refreshFrequency = 4; + break; + } return message; }; @@ -55284,6 +56181,7 @@ object.schemaModifiedCadence = null; object.tableModifiedCadence = null; object.inspectTemplateModifiedCadence = null; + object.refreshFrequency = options.enums === String ? "UPDATE_FREQUENCY_UNSPECIFIED" : 0; } if (message.schemaModifiedCadence != null && message.hasOwnProperty("schemaModifiedCadence")) object.schemaModifiedCadence = $root.google.privacy.dlp.v2.DiscoverySchemaModifiedCadence.toObject(message.schemaModifiedCadence, options); @@ -55291,6 +56189,8 @@ object.tableModifiedCadence = $root.google.privacy.dlp.v2.DiscoveryTableModifiedCadence.toObject(message.tableModifiedCadence, options); if (message.inspectTemplateModifiedCadence != null && message.hasOwnProperty("inspectTemplateModifiedCadence")) object.inspectTemplateModifiedCadence = $root.google.privacy.dlp.v2.DiscoveryInspectTemplateModifiedCadence.toObject(message.inspectTemplateModifiedCadence, options); + if (message.refreshFrequency != null && message.hasOwnProperty("refreshFrequency")) + object.refreshFrequency = options.enums === String ? $root.google.privacy.dlp.v2.DataProfileUpdateFrequency[message.refreshFrequency] === undefined ? message.refreshFrequency : $root.google.privacy.dlp.v2.DataProfileUpdateFrequency[message.refreshFrequency] : message.refreshFrequency; return object; }; diff --git a/packages/google-privacy-dlp/protos/protos.json b/packages/google-privacy-dlp/protos/protos.json index 4c5cfabbfc2..706b2b19d10 100644 --- a/packages/google-privacy-dlp/protos/protos.json +++ b/packages/google-privacy-dlp/protos/protos.json @@ -139,16 +139,16 @@ "requestType": "CreateInspectTemplateRequest", "responseType": "InspectTemplate", "options": { - "(google.api.http).post": "/v2/{parent=organizations/*}/inspectTemplates", + "(google.api.http).post": "/v2/{parent=projects/*/locations/*}/inspectTemplates", "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/locations/*}/inspectTemplates", + "(google.api.http).additional_bindings.post": "/v2/{parent=organizations/*}/inspectTemplates", "(google.api.http).additional_bindings.body": "*", "(google.api.method_signature)": "parent,inspect_template" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v2/{parent=organizations/*}/inspectTemplates", + "post": "/v2/{parent=projects/*/locations/*}/inspectTemplates", "body": "*", "additional_bindings": [ { @@ -160,7 +160,7 @@ "body": "*" }, { - "post": "/v2/{parent=projects/*/locations/*}/inspectTemplates", + "post": "/v2/{parent=organizations/*}/inspectTemplates", "body": "*" } ] @@ -175,16 +175,16 @@ "requestType": "UpdateInspectTemplateRequest", "responseType": "InspectTemplate", "options": { - "(google.api.http).patch": "/v2/{name=organizations/*/inspectTemplates/*}", + "(google.api.http).patch": "/v2/{name=projects/*/locations/*/inspectTemplates/*}", "(google.api.http).body": "*", - "(google.api.http).additional_bindings.patch": "/v2/{name=projects/*/locations/*/inspectTemplates/*}", + "(google.api.http).additional_bindings.patch": "/v2/{name=organizations/*/inspectTemplates/*}", "(google.api.http).additional_bindings.body": "*", "(google.api.method_signature)": "name,inspect_template,update_mask" }, "parsedOptions": [ { "(google.api.http)": { - "patch": "/v2/{name=organizations/*/inspectTemplates/*}", + "patch": "/v2/{name=projects/*/locations/*/inspectTemplates/*}", "body": "*", "additional_bindings": [ { @@ -196,7 +196,7 @@ "body": "*" }, { - "patch": "/v2/{name=projects/*/locations/*/inspectTemplates/*}", + "patch": "/v2/{name=organizations/*/inspectTemplates/*}", "body": "*" } ] @@ -211,14 +211,14 @@ "requestType": "GetInspectTemplateRequest", "responseType": "InspectTemplate", "options": { - "(google.api.http).get": "/v2/{name=organizations/*/inspectTemplates/*}", - "(google.api.http).additional_bindings.get": "/v2/{name=projects/*/locations/*/inspectTemplates/*}", + "(google.api.http).get": "/v2/{name=projects/*/locations/*/inspectTemplates/*}", + "(google.api.http).additional_bindings.get": "/v2/{name=organizations/*/inspectTemplates/*}", "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v2/{name=organizations/*/inspectTemplates/*}", + "get": "/v2/{name=projects/*/locations/*/inspectTemplates/*}", "additional_bindings": [ { "get": "/v2/{name=organizations/*/locations/*/inspectTemplates/*}" @@ -227,7 +227,7 @@ "get": "/v2/{name=projects/*/inspectTemplates/*}" }, { - "get": "/v2/{name=projects/*/locations/*/inspectTemplates/*}" + "get": "/v2/{name=organizations/*/inspectTemplates/*}" } ] } @@ -241,14 +241,14 @@ "requestType": "ListInspectTemplatesRequest", "responseType": "ListInspectTemplatesResponse", "options": { - "(google.api.http).get": "/v2/{parent=organizations/*}/inspectTemplates", - "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/locations/*}/inspectTemplates", + "(google.api.http).get": "/v2/{parent=projects/*/locations/*}/inspectTemplates", + "(google.api.http).additional_bindings.get": "/v2/{parent=organizations/*}/inspectTemplates", "(google.api.method_signature)": "parent" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v2/{parent=organizations/*}/inspectTemplates", + "get": "/v2/{parent=projects/*/locations/*}/inspectTemplates", "additional_bindings": [ { "get": "/v2/{parent=organizations/*/locations/*}/inspectTemplates" @@ -257,7 +257,7 @@ "get": "/v2/{parent=projects/*}/inspectTemplates" }, { - "get": "/v2/{parent=projects/*/locations/*}/inspectTemplates" + "get": "/v2/{parent=organizations/*}/inspectTemplates" } ] } @@ -271,14 +271,14 @@ "requestType": "DeleteInspectTemplateRequest", "responseType": "google.protobuf.Empty", "options": { - "(google.api.http).delete": "/v2/{name=organizations/*/inspectTemplates/*}", - "(google.api.http).additional_bindings.delete": "/v2/{name=projects/*/locations/*/inspectTemplates/*}", + "(google.api.http).delete": "/v2/{name=projects/*/locations/*/inspectTemplates/*}", + "(google.api.http).additional_bindings.delete": "/v2/{name=organizations/*/inspectTemplates/*}", "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "delete": "/v2/{name=organizations/*/inspectTemplates/*}", + "delete": "/v2/{name=projects/*/locations/*/inspectTemplates/*}", "additional_bindings": [ { "delete": "/v2/{name=organizations/*/locations/*/inspectTemplates/*}" @@ -287,7 +287,7 @@ "delete": "/v2/{name=projects/*/inspectTemplates/*}" }, { - "delete": "/v2/{name=projects/*/locations/*/inspectTemplates/*}" + "delete": "/v2/{name=organizations/*/inspectTemplates/*}" } ] } @@ -1310,13 +1310,19 @@ "options": { "(google.api.http).post": "/v2/{parent=projects/*/locations/*}/connections", "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{parent=organizations/*/locations/*}/connections", + "(google.api.http).additional_bindings.body": "*", "(google.api.method_signature)": "parent, connection" }, "parsedOptions": [ { "(google.api.http)": { "post": "/v2/{parent=projects/*/locations/*}/connections", - "body": "*" + "body": "*", + "additional_bindings": { + "post": "/v2/{parent=organizations/*/locations/*}/connections", + "body": "*" + } } }, { @@ -1329,12 +1335,16 @@ "responseType": "Connection", "options": { "(google.api.http).get": "/v2/{name=projects/*/locations/*/connections/*}", + "(google.api.http).additional_bindings.get": "/v2/{name=organizations/*/locations/*/connections/*}", "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v2/{name=projects/*/locations/*/connections/*}" + "get": "/v2/{name=projects/*/locations/*/connections/*}", + "additional_bindings": { + "get": "/v2/{name=organizations/*/locations/*/connections/*}" + } } }, { @@ -1347,12 +1357,16 @@ "responseType": "ListConnectionsResponse", "options": { "(google.api.http).get": "/v2/{parent=projects/*/locations/*}/connections", + "(google.api.http).additional_bindings.get": "/v2/{parent=organizations/*/locations/*}/connections", "(google.api.method_signature)": "parent" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v2/{parent=projects/*/locations/*}/connections" + "get": "/v2/{parent=projects/*/locations/*}/connections", + "additional_bindings": { + "get": "/v2/{parent=organizations/*/locations/*}/connections" + } } }, { @@ -1387,12 +1401,16 @@ "responseType": "google.protobuf.Empty", "options": { "(google.api.http).delete": "/v2/{name=projects/*/locations/*/connections/*}", + "(google.api.http).additional_bindings.delete": "/v2/{name=organizations/*/locations/*/connections/*}", "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "delete": "/v2/{name=projects/*/locations/*/connections/*}" + "delete": "/v2/{name=projects/*/locations/*/connections/*}", + "additional_bindings": { + "delete": "/v2/{name=organizations/*/locations/*/connections/*}" + } } }, { @@ -1406,13 +1424,19 @@ "options": { "(google.api.http).patch": "/v2/{name=projects/*/locations/*/connections/*}", "(google.api.http).body": "*", + "(google.api.http).additional_bindings.patch": "/v2/{name=organizations/*/locations/*/connections/*}", + "(google.api.http).additional_bindings.body": "*", "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { "patch": "/v2/{name=projects/*/locations/*/connections/*}", - "body": "*" + "body": "*", + "additional_bindings": { + "patch": "/v2/{name=organizations/*/locations/*/connections/*}", + "body": "*" + } } }, { @@ -4926,12 +4950,20 @@ } } }, + "ProfileGeneration": { + "values": { + "PROFILE_GENERATION_UNSPECIFIED": 0, + "PROFILE_GENERATION_NEW": 1, + "PROFILE_GENERATION_UPDATE": 2 + } + }, "DataProfileAction": { "oneofs": { "action": { "oneof": [ "exportData", - "pubSubNotification" + "pubSubNotification", + "tagResources" ] } }, @@ -4943,6 +4975,10 @@ "pubSubNotification": { "type": "PubSubNotification", "id": 2 + }, + "tagResources": { + "type": "TagResources", + "id": 8 } }, "nested": { @@ -4992,6 +5028,60 @@ "SCORE_INCREASED": 3, "ERROR_CHANGED": 4 } + }, + "TagResources": { + "fields": { + "tagConditions": { + "rule": "repeated", + "type": "TagCondition", + "id": 1 + }, + "profileGenerationsToTag": { + "rule": "repeated", + "type": "ProfileGeneration", + "id": 2 + }, + "lowerDataRiskToLow": { + "type": "bool", + "id": 3 + } + }, + "nested": { + "TagCondition": { + "oneofs": { + "type": { + "oneof": [ + "sensitivityScore" + ] + } + }, + "fields": { + "tag": { + "type": "TagValue", + "id": 1 + }, + "sensitivityScore": { + "type": "SensitivityScore", + "id": 2 + } + } + }, + "TagValue": { + "oneofs": { + "format": { + "oneof": [ + "namespacedValue" + ] + } + }, + "fields": { + "namespacedValue": { + "type": "string", + "id": 1 + } + } + } + } } } }, @@ -5349,6 +5439,10 @@ "inspectTemplateModifiedCadence": { "type": "DiscoveryInspectTemplateModifiedCadence", "id": 3 + }, + "refreshFrequency": { + "type": "DataProfileUpdateFrequency", + "id": 4 } } }, @@ -7592,7 +7686,7 @@ "Connection": { "options": { "(google.api.resource).type": "dlp.googleapis.com/Connection", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/connections/{connection}" + "(google.api.resource).pattern": "organizations/{organization}/locations/{location}/connections/{connection}" }, "oneofs": { "properties": { diff --git a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_connection.js b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_connection.js index 385af79e65c..f310980c2b9 100644 --- a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_connection.js +++ b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_connection.js @@ -29,8 +29,13 @@ function main(parent, connection) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Parent resource name in the format: - * `projects/{project}/locations/{location}`. + * Required. 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}` */ // const parent = 'abc123' /** diff --git a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_deidentify_template.js b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_deidentify_template.js index 27b7a05436c..862de3ecdc0 100644 --- a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_deidentify_template.js +++ b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_deidentify_template.js @@ -34,13 +34,13 @@ function main(parent, deidentifyTemplate) { * (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/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `projects/{project_id}` * + Organizations scope, location specified: - * `organizations/`ORG_ID`/locations/`LOCATION_ID + * `organizations/{org_id}/locations/{location_id}` * + Organizations scope, no location specified (defaults to global): - * `organizations/`ORG_ID + * `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: diff --git a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_discovery_config.js b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_discovery_config.js index 780933e8e9e..83355c208cc 100644 --- a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_discovery_config.js +++ b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_discovery_config.js @@ -33,9 +33,9 @@ function main(parent, discoveryConfig) { * The format of this value varies depending on the scope of the request * (project or organization): * + Projects scope: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Organizations scope: - * `organizations/`ORG_ID`/locations/`LOCATION_ID + * `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: diff --git a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_dlp_job.js b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_dlp_job.js index 5baed7e3f34..79881758255 100644 --- a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_dlp_job.js +++ b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_dlp_job.js @@ -34,9 +34,9 @@ function main(parent) { * processing * location (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `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: diff --git a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_inspect_template.js b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_inspect_template.js index e3f243a283e..a16b2e9d73f 100644 --- a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_inspect_template.js +++ b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_inspect_template.js @@ -34,13 +34,13 @@ function main(parent, inspectTemplate) { * (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/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `projects/{project_id}` * + Organizations scope, location specified: - * `organizations/`ORG_ID`/locations/`LOCATION_ID + * `organizations/{org_id}/locations/{location_id}` * + Organizations scope, no location specified (defaults to global): - * `organizations/`ORG_ID + * `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: diff --git a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_job_trigger.js b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_job_trigger.js index e836102085d..c0038eb1bb3 100644 --- a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_job_trigger.js +++ b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_job_trigger.js @@ -34,9 +34,9 @@ function main(parent, jobTrigger) { * processing * location (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `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: diff --git a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_stored_info_type.js b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_stored_info_type.js index 9927f960a1f..65ccb207faf 100644 --- a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_stored_info_type.js +++ b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_stored_info_type.js @@ -34,13 +34,13 @@ function main(parent, config) { * (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/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `projects/{project_id}` * + Organizations scope, location specified: - * `organizations/`ORG_ID`/locations/`LOCATION_ID + * `organizations/{org_id}/locations/{location_id}` * + Organizations scope, no location specified (defaults to global): - * `organizations/`ORG_ID + * `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: diff --git a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.deidentify_content.js b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.deidentify_content.js index ed45494d9e0..42748ee859a 100644 --- a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.deidentify_content.js +++ b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.deidentify_content.js @@ -34,9 +34,9 @@ function main() { * processing * location (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `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: diff --git a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.inspect_content.js b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.inspect_content.js index 91d47bf09ab..a1a0f0ea3fa 100644 --- a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.inspect_content.js +++ b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.inspect_content.js @@ -34,9 +34,9 @@ function main() { * processing * location (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `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: diff --git a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_connections.js b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_connections.js index 6a976f1cad7..5a4076fe56a 100644 --- a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_connections.js +++ b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_connections.js @@ -29,8 +29,9 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Parent name, for example: - * `projects/project-id/locations/global`. + * Required. Resource name of the organization or project, for + * example, `organizations/433245324/locations/europe` or + * `projects/project-id/locations/asia`. */ // const parent = 'abc123' /** diff --git a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_deidentify_templates.js b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_deidentify_templates.js index 216cb0a90e7..f8fc0663b0b 100644 --- a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_deidentify_templates.js +++ b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_deidentify_templates.js @@ -34,13 +34,13 @@ function main(parent) { * (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/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `projects/{project_id}` * + Organizations scope, location specified: - * `organizations/`ORG_ID`/locations/`LOCATION_ID + * `organizations/{org_id}/locations/{location_id}` * + Organizations scope, no location specified (defaults to global): - * `organizations/`ORG_ID + * `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: diff --git a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_discovery_configs.js b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_discovery_configs.js index 0a848df434f..ad289269b26 100644 --- a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_discovery_configs.js +++ b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_discovery_configs.js @@ -31,7 +31,7 @@ function main(parent) { /** * Required. Parent resource name. * The format of this value is as follows: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `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: diff --git a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_dlp_jobs.js b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_dlp_jobs.js index 00ea5640a83..764352bd661 100644 --- a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_dlp_jobs.js +++ b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_dlp_jobs.js @@ -34,9 +34,9 @@ function main(parent) { * processing * location (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `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: diff --git a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_info_types.js b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_info_types.js index e07d44f9cf0..0d4a433edde 100644 --- a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_info_types.js +++ b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_info_types.js @@ -31,7 +31,7 @@ function main() { /** * The parent resource name. * The format of this value is as follows: - * locations/LOCATION_ID + * `locations/{location_id}` */ // const parent = 'abc123' /** diff --git a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_inspect_templates.js b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_inspect_templates.js index ee9e9b3fedc..b9ece9b72a7 100644 --- a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_inspect_templates.js +++ b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_inspect_templates.js @@ -34,13 +34,13 @@ function main(parent) { * (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/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `projects/{project_id}` * + Organizations scope, location specified: - * `organizations/`ORG_ID`/locations/`LOCATION_ID + * `organizations/{org_id}/locations/{location_id}` * + Organizations scope, no location specified (defaults to global): - * `organizations/`ORG_ID + * `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: diff --git a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_job_triggers.js b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_job_triggers.js index c616016265b..e4d93844b6d 100644 --- a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_job_triggers.js +++ b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_job_triggers.js @@ -34,9 +34,9 @@ function main(parent) { * processing * location (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `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: diff --git a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_stored_info_types.js b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_stored_info_types.js index bea0b5e706e..61b57d50840 100644 --- a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_stored_info_types.js +++ b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_stored_info_types.js @@ -34,9 +34,9 @@ function main(parent) { * (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/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `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: diff --git a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.redact_image.js b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.redact_image.js index 8c25d5dacbb..858b82e282d 100644 --- a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.redact_image.js +++ b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.redact_image.js @@ -34,9 +34,9 @@ function main() { * processing * location (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `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: diff --git a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.reidentify_content.js b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.reidentify_content.js index 57a4595540c..70db4851533 100644 --- a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.reidentify_content.js +++ b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.reidentify_content.js @@ -34,9 +34,9 @@ function main(parent) { * processing * location (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `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: diff --git a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.search_connections.js b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.search_connections.js index d92c7394879..bf891e7c3ea 100644 --- a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.search_connections.js +++ b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.search_connections.js @@ -29,8 +29,9 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Parent name, typically an organization, without location. - * For example: `organizations/12345678`. + * Required. Resource name of the organization or project with a wildcard + * location, for example, `organizations/433245324/locations/-` or + * `projects/project-id/locations/-`. */ // const parent = 'abc123' /** diff --git a/packages/google-privacy-dlp/samples/generated/v2/snippet_metadata_google.privacy.dlp.v2.json b/packages/google-privacy-dlp/samples/generated/v2/snippet_metadata_google.privacy.dlp.v2.json index 85c6d537f30..a5634753903 100644 --- a/packages/google-privacy-dlp/samples/generated/v2/snippet_metadata_google.privacy.dlp.v2.json +++ b/packages/google-privacy-dlp/samples/generated/v2/snippet_metadata_google.privacy.dlp.v2.json @@ -2370,7 +2370,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 64, "type": "FULL" } ], @@ -2447,14 +2447,14 @@ "regionTag": "dlp_v2_generated_DlpService_ListConnections_async", "title": "DlpService listConnections Sample", "origin": "API_DEFINITION", - "description": " Lists Connections in a parent.", + "description": " Lists Connections in a parent. Use SearchConnections to see all connections within an organization.", "canonical": true, "file": "dlp_service.list_connections.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 69, + "end": 70, "type": "FULL" } ], @@ -2506,7 +2506,7 @@ "segments": [ { "start": 25, - "end": 69, + "end": 70, "type": "FULL" } ], diff --git a/packages/google-privacy-dlp/src/v2/dlp_service_client.ts b/packages/google-privacy-dlp/src/v2/dlp_service_client.ts index 2c2c4ab7eb8..5f3c1290960 100644 --- a/packages/google-privacy-dlp/src/v2/dlp_service_client.ts +++ b/packages/google-privacy-dlp/src/v2/dlp_service_client.ts @@ -214,9 +214,6 @@ export class DlpServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { - connectionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/connections/{connection}' - ), discoveryConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/discoveryConfigs/{discovery_config}' ), @@ -243,6 +240,10 @@ export class DlpServiceClient { new this._gaxModule.PathTemplate( 'organizations/{organization}/locations/{location}/columnDataProfiles/{column_data_profile}' ), + organizationLocationConnectionPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/connections/{connection}' + ), organizationLocationDeidentifyTemplatePathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/locations/{location}/deidentifyTemplates/{deidentify_template}' @@ -292,6 +293,9 @@ export class DlpServiceClient { new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/columnDataProfiles/{column_data_profile}' ), + projectLocationConnectionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/connections/{connection}' + ), projectLocationDeidentifyTemplatePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}' @@ -635,9 +639,9 @@ export class DlpServiceClient { * location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `projects/{project_id}` * * The following example `parent` string specifies a parent project with the * identifier `example-project`, and specifies the `europe-west3` location @@ -755,9 +759,9 @@ export class DlpServiceClient { * location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `projects/{project_id}` * * The following example `parent` string specifies a parent project with the * identifier `example-project`, and specifies the `europe-west3` location @@ -871,9 +875,9 @@ export class DlpServiceClient { * location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `projects/{project_id}` * * The following example `parent` string specifies a parent project with the * identifier `example-project`, and specifies the `europe-west3` location @@ -1004,9 +1008,9 @@ export class DlpServiceClient { * location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `projects/{project_id}` * * The following example `parent` string specifies a parent project with the * identifier `example-project`, and specifies the `europe-west3` location @@ -1134,7 +1138,7 @@ export class DlpServiceClient { * * The format of this value is as follows: * - * locations/LOCATION_ID + * `locations/{location_id}` * @param {string} request.languageCode * BCP-47 language code for localized infoType friendly * names. If omitted, or if localized strings are not available, @@ -1236,13 +1240,13 @@ export class DlpServiceClient { * location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `projects/{project_id}` * + Organizations scope, location specified: - * `organizations/`ORG_ID`/locations/`LOCATION_ID + * `organizations/{org_id}/locations/{location_id}` * + Organizations scope, no location specified (defaults to global): - * `organizations/`ORG_ID + * `organizations/{org_id}` * * The following example `parent` string specifies a parent project with the * identifier `example-project`, and specifies the `europe-west3` location @@ -1647,13 +1651,13 @@ export class DlpServiceClient { * location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `projects/{project_id}` * + Organizations scope, location specified: - * `organizations/`ORG_ID`/locations/`LOCATION_ID + * `organizations/{org_id}/locations/{location_id}` * + Organizations scope, no location specified (defaults to global): - * `organizations/`ORG_ID + * `organizations/{org_id}` * * The following example `parent` string specifies a parent project with the * identifier `example-project`, and specifies the `europe-west3` location @@ -2072,9 +2076,9 @@ export class DlpServiceClient { * location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `projects/{project_id}` * * The following example `parent` string specifies a parent project with the * identifier `example-project`, and specifies the `europe-west3` location @@ -2636,9 +2640,9 @@ export class DlpServiceClient { * (project or organization): * * + Projects scope: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Organizations scope: - * `organizations/`ORG_ID`/locations/`LOCATION_ID + * `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 @@ -3034,9 +3038,9 @@ export class DlpServiceClient { * location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `projects/{project_id}` * * The following example `parent` string specifies a parent project with the * identifier `example-project`, and specifies the `europe-west3` location @@ -3411,13 +3415,13 @@ export class DlpServiceClient { * location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `projects/{project_id}` * + Organizations scope, location specified: - * `organizations/`ORG_ID`/locations/`LOCATION_ID + * `organizations/{org_id}/locations/{location_id}` * + Organizations scope, no location specified (defaults to global): - * `organizations/`ORG_ID + * `organizations/{org_id}` * * The following example `parent` string specifies a parent project with the * identifier `example-project`, and specifies the `europe-west3` location @@ -4550,8 +4554,15 @@ export class DlpServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Parent resource name in the format: - * `projects/{project}/locations/{location}`. + * Required. 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}` * @param {google.privacy.dlp.v2.Connection} request.connection * Required. The connection resource. * @param {object} [options] @@ -4905,13 +4916,13 @@ export class DlpServiceClient { * location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `projects/{project_id}` * + Organizations scope, location specified: - * `organizations/`ORG_ID`/locations/`LOCATION_ID + * `organizations/{org_id}/locations/{location_id}` * + Organizations scope, no location specified (defaults to global): - * `organizations/`ORG_ID + * `organizations/{org_id}` * * The following example `parent` string specifies a parent project with the * identifier `example-project`, and specifies the `europe-west3` location @@ -5039,13 +5050,13 @@ export class DlpServiceClient { * location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `projects/{project_id}` * + Organizations scope, location specified: - * `organizations/`ORG_ID`/locations/`LOCATION_ID + * `organizations/{org_id}/locations/{location_id}` * + Organizations scope, no location specified (defaults to global): - * `organizations/`ORG_ID + * `organizations/{org_id}` * * The following example `parent` string specifies a parent project with the * identifier `example-project`, and specifies the `europe-west3` location @@ -5121,13 +5132,13 @@ export class DlpServiceClient { * location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `projects/{project_id}` * + Organizations scope, location specified: - * `organizations/`ORG_ID`/locations/`LOCATION_ID + * `organizations/{org_id}/locations/{location_id}` * + Organizations scope, no location specified (defaults to global): - * `organizations/`ORG_ID + * `organizations/{org_id}` * * The following example `parent` string specifies a parent project with the * identifier `example-project`, and specifies the `europe-west3` location @@ -5205,13 +5216,13 @@ export class DlpServiceClient { * location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `projects/{project_id}` * + Organizations scope, location specified: - * `organizations/`ORG_ID`/locations/`LOCATION_ID + * `organizations/{org_id}/locations/{location_id}` * + Organizations scope, no location specified (defaults to global): - * `organizations/`ORG_ID + * `organizations/{org_id}` * * The following example `parent` string specifies a parent project with the * identifier `example-project`, and specifies the `europe-west3` location @@ -5343,13 +5354,13 @@ export class DlpServiceClient { * location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `projects/{project_id}` * + Organizations scope, location specified: - * `organizations/`ORG_ID`/locations/`LOCATION_ID + * `organizations/{org_id}/locations/{location_id}` * + Organizations scope, no location specified (defaults to global): - * `organizations/`ORG_ID + * `organizations/{org_id}` * * The following example `parent` string specifies a parent project with the * identifier `example-project`, and specifies the `europe-west3` location @@ -5425,13 +5436,13 @@ export class DlpServiceClient { * location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `projects/{project_id}` * + Organizations scope, location specified: - * `organizations/`ORG_ID`/locations/`LOCATION_ID + * `organizations/{org_id}/locations/{location_id}` * + Organizations scope, no location specified (defaults to global): - * `organizations/`ORG_ID + * `organizations/{org_id}` * * The following example `parent` string specifies a parent project with the * identifier `example-project`, and specifies the `europe-west3` location @@ -5509,9 +5520,9 @@ export class DlpServiceClient { * location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `projects/{project_id}` * * The following example `parent` string specifies a parent project with the * identifier `example-project`, and specifies the `europe-west3` location @@ -5662,9 +5673,9 @@ export class DlpServiceClient { * location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `projects/{project_id}` * * The following example `parent` string specifies a parent project with the * identifier `example-project`, and specifies the `europe-west3` location @@ -5769,9 +5780,9 @@ export class DlpServiceClient { * location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `projects/{project_id}` * * The following example `parent` string specifies a parent project with the * identifier `example-project`, and specifies the `europe-west3` location @@ -5871,7 +5882,7 @@ export class DlpServiceClient { * Required. Parent resource name. * * The format of this value is as follows: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `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 @@ -5992,7 +6003,7 @@ export class DlpServiceClient { * Required. Parent resource name. * * The format of this value is as follows: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `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 @@ -6061,7 +6072,7 @@ export class DlpServiceClient { * Required. Parent resource name. * * The format of this value is as follows: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `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 @@ -6138,9 +6149,9 @@ export class DlpServiceClient { * location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `projects/{project_id}` * * The following example `parent` string specifies a parent project with the * identifier `example-project`, and specifies the `europe-west3` location @@ -6289,9 +6300,9 @@ export class DlpServiceClient { * location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `projects/{project_id}` * * The following example `parent` string specifies a parent project with the * identifier `example-project`, and specifies the `europe-west3` location @@ -6396,9 +6407,9 @@ export class DlpServiceClient { * location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `projects/{project_id}` * * The following example `parent` string specifies a parent project with the * identifier `example-project`, and specifies the `europe-west3` location @@ -6505,9 +6516,9 @@ export class DlpServiceClient { * location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `projects/{project_id}` * * The following example `parent` string specifies a parent project with the * identifier `example-project`, and specifies the `europe-west3` location @@ -6636,9 +6647,9 @@ export class DlpServiceClient { * location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `projects/{project_id}` * * The following example `parent` string specifies a parent project with the * identifier `example-project`, and specifies the `europe-west3` location @@ -6715,9 +6726,9 @@ export class DlpServiceClient { * location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): * * + Projects scope, location specified: - * `projects/`PROJECT_ID`/locations/`LOCATION_ID + * `projects/{project_id}/locations/{location_id}` * + Projects scope, no location specified (defaults to global): - * `projects/`PROJECT_ID + * `projects/{project_id}` * * The following example `parent` string specifies a parent project with the * identifier `example-project`, and specifies the `europe-west3` location @@ -8140,13 +8151,15 @@ export class DlpServiceClient { ) as AsyncIterable; } /** - * Lists Connections in a parent. + * Lists Connections in a parent. Use SearchConnections to see all connections + * within an organization. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Parent name, for example: - * `projects/project-id/locations/global`. + * Required. Resource name of the organization or project, for + * example, `organizations/433245324/locations/europe` or + * `projects/project-id/locations/asia`. * @param {number} [request.pageSize] * Optional. Number of results per page, max 1000. * @param {string} [request.pageToken] @@ -8240,8 +8253,9 @@ export class DlpServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Parent name, for example: - * `projects/project-id/locations/global`. + * Required. Resource name of the organization or project, for + * example, `organizations/433245324/locations/europe` or + * `projects/project-id/locations/asia`. * @param {number} [request.pageSize] * Optional. Number of results per page, max 1000. * @param {string} [request.pageToken] @@ -8289,8 +8303,9 @@ export class DlpServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Parent name, for example: - * `projects/project-id/locations/global`. + * Required. Resource name of the organization or project, for + * example, `organizations/433245324/locations/europe` or + * `projects/project-id/locations/asia`. * @param {number} [request.pageSize] * Optional. Number of results per page, max 1000. * @param {string} [request.pageToken] @@ -8337,8 +8352,9 @@ export class DlpServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Parent name, typically an organization, without location. - * For example: `organizations/12345678`. + * Required. Resource name of the organization or project with a wildcard + * location, for example, `organizations/433245324/locations/-` or + * `projects/project-id/locations/-`. * @param {number} [request.pageSize] * Optional. Number of results per page, max 1000. * @param {string} [request.pageToken] @@ -8438,8 +8454,9 @@ export class DlpServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Parent name, typically an organization, without location. - * For example: `organizations/12345678`. + * Required. Resource name of the organization or project with a wildcard + * location, for example, `organizations/433245324/locations/-` or + * `projects/project-id/locations/-`. * @param {number} [request.pageSize] * Optional. Number of results per page, max 1000. * @param {string} [request.pageToken] @@ -8487,8 +8504,9 @@ export class DlpServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Parent name, typically an organization, without location. - * For example: `organizations/12345678`. + * Required. Resource name of the organization or project with a wildcard + * location, for example, `organizations/433245324/locations/-` or + * `projects/project-id/locations/-`. * @param {number} [request.pageSize] * Optional. Number of results per page, max 1000. * @param {string} [request.pageToken] @@ -8611,58 +8629,6 @@ export class DlpServiceClient { // -- Path templates -- // -------------------- - /** - * Return a fully-qualified connection resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} connection - * @returns {string} Resource name string. - */ - connectionPath(project: string, location: string, connection: string) { - return this.pathTemplates.connectionPathTemplate.render({ - project: project, - location: location, - connection: connection, - }); - } - - /** - * Parse the project from Connection resource. - * - * @param {string} connectionName - * A fully-qualified path representing Connection resource. - * @returns {string} A string representing the project. - */ - matchProjectFromConnectionName(connectionName: string) { - return this.pathTemplates.connectionPathTemplate.match(connectionName) - .project; - } - - /** - * Parse the location from Connection resource. - * - * @param {string} connectionName - * A fully-qualified path representing Connection resource. - * @returns {string} A string representing the location. - */ - matchLocationFromConnectionName(connectionName: string) { - return this.pathTemplates.connectionPathTemplate.match(connectionName) - .location; - } - - /** - * Parse the connection from Connection resource. - * - * @param {string} connectionName - * A fully-qualified path representing Connection resource. - * @returns {string} A string representing the connection. - */ - matchConnectionFromConnectionName(connectionName: string) { - return this.pathTemplates.connectionPathTemplate.match(connectionName) - .connection; - } - /** * Return a fully-qualified discoveryConfig resource name string. * @@ -9036,6 +9002,73 @@ export class DlpServiceClient { ).column_data_profile; } + /** + * Return a fully-qualified organizationLocationConnection resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} connection + * @returns {string} Resource name string. + */ + organizationLocationConnectionPath( + organization: string, + location: string, + connection: string + ) { + return this.pathTemplates.organizationLocationConnectionPathTemplate.render( + { + organization: organization, + location: location, + connection: connection, + } + ); + } + + /** + * Parse the organization from OrganizationLocationConnection resource. + * + * @param {string} organizationLocationConnectionName + * A fully-qualified path representing organization_location_connection resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationConnectionName( + organizationLocationConnectionName: string + ) { + return this.pathTemplates.organizationLocationConnectionPathTemplate.match( + organizationLocationConnectionName + ).organization; + } + + /** + * Parse the location from OrganizationLocationConnection resource. + * + * @param {string} organizationLocationConnectionName + * A fully-qualified path representing organization_location_connection resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationConnectionName( + organizationLocationConnectionName: string + ) { + return this.pathTemplates.organizationLocationConnectionPathTemplate.match( + organizationLocationConnectionName + ).location; + } + + /** + * Parse the connection from OrganizationLocationConnection resource. + * + * @param {string} organizationLocationConnectionName + * A fully-qualified path representing organization_location_connection resource. + * @returns {string} A string representing the connection. + */ + matchConnectionFromOrganizationLocationConnectionName( + organizationLocationConnectionName: string + ) { + return this.pathTemplates.organizationLocationConnectionPathTemplate.match( + organizationLocationConnectionName + ).connection; + } + /** * Return a fully-qualified organizationLocationDeidentifyTemplate resource name string. * @@ -9763,6 +9796,71 @@ export class DlpServiceClient { ).column_data_profile; } + /** + * Return a fully-qualified projectLocationConnection resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} connection + * @returns {string} Resource name string. + */ + projectLocationConnectionPath( + project: string, + location: string, + connection: string + ) { + return this.pathTemplates.projectLocationConnectionPathTemplate.render({ + project: project, + location: location, + connection: connection, + }); + } + + /** + * Parse the project from ProjectLocationConnection resource. + * + * @param {string} projectLocationConnectionName + * A fully-qualified path representing project_location_connection resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConnectionName( + projectLocationConnectionName: string + ) { + return this.pathTemplates.projectLocationConnectionPathTemplate.match( + projectLocationConnectionName + ).project; + } + + /** + * Parse the location from ProjectLocationConnection resource. + * + * @param {string} projectLocationConnectionName + * A fully-qualified path representing project_location_connection resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConnectionName( + projectLocationConnectionName: string + ) { + return this.pathTemplates.projectLocationConnectionPathTemplate.match( + projectLocationConnectionName + ).location; + } + + /** + * Parse the connection from ProjectLocationConnection resource. + * + * @param {string} projectLocationConnectionName + * A fully-qualified path representing project_location_connection resource. + * @returns {string} A string representing the connection. + */ + matchConnectionFromProjectLocationConnectionName( + projectLocationConnectionName: string + ) { + return this.pathTemplates.projectLocationConnectionPathTemplate.match( + projectLocationConnectionName + ).connection; + } + /** * Return a fully-qualified projectLocationDeidentifyTemplate resource name string. * diff --git a/packages/google-privacy-dlp/src/v2/dlp_service_client_config.json b/packages/google-privacy-dlp/src/v2/dlp_service_client_config.json index 22f062d7dfa..6796693ed23 100644 --- a/packages/google-privacy-dlp/src/v2/dlp_service_client_config.json +++ b/packages/google-privacy-dlp/src/v2/dlp_service_client_config.json @@ -226,15 +226,18 @@ "retry_params_name": "default" }, "ListFileStoreDataProfiles": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 300000, + "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetFileStoreDataProfile": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 300000, + "retry_codes_name": "idempotent", "retry_params_name": "default" }, "DeleteFileStoreDataProfile": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 300000, + "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetTableDataProfile": { diff --git a/packages/google-privacy-dlp/test/gapic_dlp_service_v2.ts b/packages/google-privacy-dlp/test/gapic_dlp_service_v2.ts index 8158d3a2b34..66c0ecced39 100644 --- a/packages/google-privacy-dlp/test/gapic_dlp_service_v2.ts +++ b/packages/google-privacy-dlp/test/gapic_dlp_service_v2.ts @@ -10134,70 +10134,6 @@ describe('v2.DlpServiceClient', () => { }); describe('Path templates', () => { - describe('connection', () => { - const fakePath = '/rendered/path/connection'; - const expectedParameters = { - project: 'projectValue', - location: 'locationValue', - connection: 'connectionValue', - }; - const client = new dlpserviceModule.v2.DlpServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.connectionPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.connectionPathTemplate.match = sinon - .stub() - .returns(expectedParameters); - - it('connectionPath', () => { - const result = client.connectionPath( - 'projectValue', - 'locationValue', - 'connectionValue' - ); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.connectionPathTemplate.render as SinonStub) - .getCall(-1) - .calledWith(expectedParameters) - ); - }); - - it('matchProjectFromConnectionName', () => { - const result = client.matchProjectFromConnectionName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - (client.pathTemplates.connectionPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchLocationFromConnectionName', () => { - const result = client.matchLocationFromConnectionName(fakePath); - assert.strictEqual(result, 'locationValue'); - assert( - (client.pathTemplates.connectionPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchConnectionFromConnectionName', () => { - const result = client.matchConnectionFromConnectionName(fakePath); - assert.strictEqual(result, 'connectionValue'); - assert( - (client.pathTemplates.connectionPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - }); - describe('discoveryConfig', () => { const fakePath = '/rendered/path/discoveryConfig'; const expectedParameters = { @@ -10693,6 +10629,87 @@ describe('v2.DlpServiceClient', () => { }); }); + describe('organizationLocationConnection', () => { + const fakePath = '/rendered/path/organizationLocationConnection'; + const expectedParameters = { + organization: 'organizationValue', + location: 'locationValue', + connection: 'connectionValue', + }; + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationLocationConnectionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationConnectionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationConnectionPath', () => { + const result = client.organizationLocationConnectionPath( + 'organizationValue', + 'locationValue', + 'connectionValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationLocationConnectionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationLocationConnectionName', () => { + const result = + client.matchOrganizationFromOrganizationLocationConnectionName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationLocationConnectionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromOrganizationLocationConnectionName', () => { + const result = + client.matchLocationFromOrganizationLocationConnectionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.organizationLocationConnectionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConnectionFromOrganizationLocationConnectionName', () => { + const result = + client.matchConnectionFromOrganizationLocationConnectionName( + fakePath + ); + assert.strictEqual(result, 'connectionValue'); + assert( + ( + client.pathTemplates.organizationLocationConnectionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('organizationLocationDeidentifyTemplate', () => { const fakePath = '/rendered/path/organizationLocationDeidentifyTemplate'; const expectedParameters = { @@ -11675,6 +11692,85 @@ describe('v2.DlpServiceClient', () => { }); }); + describe('projectLocationConnection', () => { + const fakePath = '/rendered/path/projectLocationConnection'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + connection: 'connectionValue', + }; + const client = new dlpserviceModule.v2.DlpServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConnectionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConnectionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConnectionPath', () => { + const result = client.projectLocationConnectionPath( + 'projectValue', + 'locationValue', + 'connectionValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationConnectionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConnectionName', () => { + const result = + client.matchProjectFromProjectLocationConnectionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationConnectionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConnectionName', () => { + const result = + client.matchLocationFromProjectLocationConnectionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationConnectionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConnectionFromProjectLocationConnectionName', () => { + const result = + client.matchConnectionFromProjectLocationConnectionName(fakePath); + assert.strictEqual(result, 'connectionValue'); + assert( + ( + client.pathTemplates.projectLocationConnectionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('projectLocationDeidentifyTemplate', () => { const fakePath = '/rendered/path/projectLocationDeidentifyTemplate'; const expectedParameters = {