diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto index eb07c0493b6..b23a4232f94 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,11 +16,12 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/api/annotations.proto"; import "google/api/resource.proto"; +import "google/cloud/securitycenter/v1/folder.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; @@ -40,6 +41,8 @@ message Asset { option (google.api.resource) = { type: "securitycenter.googleapis.com/Asset" pattern: "organizations/{organization}/assets/{asset}" + pattern: "folders/{folder}/assets/{asset}" + pattern: "projects/{project}/assets/{asset}" }; // Security Command Center managed properties. These properties are managed by @@ -75,6 +78,11 @@ message Asset { // The user defined display name for the project of this resource. string resource_project_display_name = 8; + + // Contains a Folder message for each folder in the assets ancestry. + // The first folder is the deepest nested folder, and the last folder is the + // folder directly under the Organization. + repeated Folder folders = 10; } // Cloud IAM Policy information associated with the Google Cloud resource @@ -109,8 +117,7 @@ message Asset { // The time at which the asset was created in Security Command Center. google.protobuf.Timestamp create_time = 9; - // The time at which the asset was last updated, added, or deleted in Security - // Command Center. + // The time at which the asset was last updated or added in Cloud SCC. google.protobuf.Timestamp update_time = 10; // Cloud IAM Policy information associated with the Google Cloud resource @@ -118,4 +125,11 @@ message Asset { // and defined by the Google Cloud resource and cannot be modified by the // user. IamPolicy iam_policy = 11; + + // The canonical name of the resource. It's either + // "organizations/{organization_id}/assets/{asset_id}", + // "folders/{folder_id}/assets/{asset_id}" or + // "projects/{project_number}/assets/{asset_id}", depending on the closest CRM + // ancestor of the resource. + string canonical_name = 13; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto index dcc62f8b9c6..84abc862b0b 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,12 +16,12 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/api/annotations.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; @@ -41,6 +41,8 @@ message Finding { option (google.api.resource) = { type: "securitycenter.googleapis.com/Finding" pattern: "organizations/{organization}/sources/{source}/findings/{finding}" + pattern: "folders/{folder}/sources/{source}/findings/{finding}" + pattern: "projects/{project}/sources/{source}/findings/{finding}" }; // The state of the finding. @@ -164,7 +166,8 @@ message Finding { // occurred. For example, if the finding represents an open firewall it would // capture the time the detector believes the firewall became open. The // accuracy is determined by the detector. If the finding were to be resolved - // afterward, this time would reflect when the finding was resolved. + // afterward, this time would reflect when the finding was resolved. Must not + // be set to a value greater than the current timestamp. google.protobuf.Timestamp event_time = 9; // The time at which the finding was created in Security Command Center. @@ -173,4 +176,12 @@ message Finding { // The severity of the finding. This field is managed by the source that // writes the finding. Severity severity = 12; + + // The canonical name of the finding. It's either + // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}", + // "folders/{folder_id}/sources/{source_id}/findings/{finding_id}" or + // "projects/{project_number}/sources/{source_id}/findings/{finding_id}", + // depending on the closest CRM ancestor of the resource associated with the + // finding. + string canonical_name = 14; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/folder.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/folder.proto new file mode 100644 index 00000000000..49c114d4613 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/folder.proto @@ -0,0 +1,38 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "FolderProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Message that contains the resource name and display name of a folder +// resource. +message Folder { + // Full resource name of this folder. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string resource_folder = 1; + + // The user defined display name for this folder. + string resource_folder_display_name = 2; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto index 1a9676d9d67..7f670279a7f 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,9 +16,9 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/api/annotations.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto index 08b6b7c88eb..6a9ce0852cf 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,9 +16,9 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/api/annotations.proto"; import "google/cloud/securitycenter/v1/finding.proto"; import "google/cloud/securitycenter/v1/resource.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto index 66b659bc5f0..1dc77257726 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,8 +16,8 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/api/annotations.proto"; import "google/api/resource.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; @@ -63,6 +63,10 @@ message OrganizationSettings { // The mode to use for filtering asset discovery. InclusionMode inclusion_mode = 2; + + // The folder ids to use for filtering asset discovery. + // It consists of only digits, e.g., 756619654966. + repeated string folder_ids = 3; } // The relative resource name of the settings. See: diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto index 855e697373f..c1c2ad414a7 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,6 +16,8 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; +import "google/api/field_behavior.proto"; +import "google/cloud/securitycenter/v1/folder.proto"; import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; @@ -43,4 +45,9 @@ message Resource { // The human readable name of resource's parent. string parent_display_name = 5; + + // Output only. Contains a Folder message for each folder in the assets ancestry. + // The first folder is the deepest nested folder, and the last folder is the + // folder directly under the Organization. + repeated Folder folders = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto index 4f09d9c0a42..20d084cae0b 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,8 +16,8 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/api/annotations.proto"; import "google/protobuf/duration.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto index 47a4a150be5..f055cd5efcf 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,8 +16,8 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/api/annotations.proto"; import "google/api/resource.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; @@ -35,6 +35,10 @@ message SecurityMarks { type: "securitycenter.googleapis.com/SecurityMarks" pattern: "organizations/{organization}/assets/{asset}/securityMarks" pattern: "organizations/{organization}/sources/{source}/findings/{finding}/securityMarks" + pattern: "folders/{folder}/assets/{asset}/securityMarks" + pattern: "projects/{project}/assets/{asset}/securityMarks" + pattern: "folders/{folder}/sources/{source}/findings/{finding}/securityMarks" + pattern: "projects/{project}/sources/{source}/findings/{finding}/securityMarks" }; // The relative resource name of the SecurityMarks. See: @@ -53,4 +57,14 @@ message SecurityMarks { // * Values have leading and trailing whitespace trimmed, remaining // characters must be between 1 - 4096 characters (inclusive) map marks = 2; + + // The canonical name of the marks. + // Examples: + // "organizations/{organization_id}/assets/{asset_id}/securityMarks" + // "folders/{folder_id}/assets/{asset_id}/securityMarks" + // "projects/{project_number}/assets/{asset_id}/securityMarks" + // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks" + // "folders/{folder_id}/sources/{source_id}/findings/{finding_id}/securityMarks" + // "projects/{project_number}/sources/{source_id}/findings/{finding_id}/securityMarks" + string canonical_name = 3; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index 07f2f99d630..2a23a2439a9 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/securitycenter/v1/asset.proto"; import "google/cloud/securitycenter/v1/finding.proto"; +import "google/cloud/securitycenter/v1/folder.proto"; import "google/cloud/securitycenter/v1/notification_config.proto"; import "google/cloud/securitycenter/v1/organization_settings.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; @@ -124,6 +125,14 @@ service SecurityCenter { option (google.api.http) = { post: "/v1/{parent=organizations/*}/assets:group" body: "*" + additional_bindings { + post: "/v1/{parent=folders/*}/assets:group" + body: "*" + } + additional_bindings { + post: "/v1/{parent=projects/*}/assets:group" + body: "*" + } }; } @@ -131,11 +140,21 @@ service SecurityCenter { // specified properties. // // To group across all sources provide a `-` as the source id. - // Example: /v1/organizations/{organization_id}/sources/-/findings + // Example: /v1/organizations/{organization_id}/sources/-/findings, + // /v1/folders/{folder_id}/sources/-/findings, + // /v1/projects/{project_id}/sources/-/findings rpc GroupFindings(GroupFindingsRequest) returns (GroupFindingsResponse) { option (google.api.http) = { post: "/v1/{parent=organizations/*/sources/*}/findings:group" body: "*" + additional_bindings { + post: "/v1/{parent=folders/*/sources/*}/findings:group" + body: "*" + } + additional_bindings { + post: "/v1/{parent=projects/*/sources/*}/findings:group" + body: "*" + } }; option (google.api.method_signature) = "parent,group_by"; } @@ -144,6 +163,12 @@ service SecurityCenter { rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*}/assets" + additional_bindings { + get: "/v1/{parent=folders/*}/assets" + } + additional_bindings { + get: "/v1/{parent=projects/*}/assets" + } }; } @@ -154,6 +179,12 @@ service SecurityCenter { rpc ListFindings(ListFindingsRequest) returns (ListFindingsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*/sources/*}/findings" + additional_bindings { + get: "/v1/{parent=folders/*/sources/*}/findings" + } + additional_bindings { + get: "/v1/{parent=projects/*/sources/*}/findings" + } }; } @@ -169,6 +200,12 @@ service SecurityCenter { rpc ListSources(ListSourcesRequest) returns (ListSourcesResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*}/sources" + additional_bindings { + get: "/v1/{parent=folders/*}/sources" + } + additional_bindings { + get: "/v1/{parent=projects/*}/sources" + } }; option (google.api.method_signature) = "parent"; } @@ -196,6 +233,14 @@ service SecurityCenter { option (google.api.http) = { post: "/v1/{name=organizations/*/sources/*/findings/*}:setState" body: "*" + additional_bindings { + post: "/v1/{name=folders/*/sources/*/findings/*}:setState" + body: "*" + } + additional_bindings { + post: "/v1/{name=projects/*/sources/*/findings/*}:setState" + body: "*" + } }; option (google.api.method_signature) = "name,state,start_time"; } @@ -224,10 +269,19 @@ service SecurityCenter { option (google.api.http) = { patch: "/v1/{finding.name=organizations/*/sources/*/findings/*}" body: "finding" + additional_bindings { + patch: "/v1/{finding.name=folders/*/sources/*/findings/*}" + body: "finding" + } + additional_bindings { + patch: "/v1/{finding.name=projects/*/sources/*/findings/*}" + body: "finding" + } }; option (google.api.method_signature) = "finding"; } + // // Updates a notification config. The following update // fields are allowed: description, pubsub_topic, streaming_config.filter rpc UpdateNotificationConfig(UpdateNotificationConfigRequest) returns (NotificationConfig) { @@ -262,10 +316,26 @@ service SecurityCenter { option (google.api.http) = { patch: "/v1/{security_marks.name=organizations/*/assets/*/securityMarks}" body: "security_marks" + additional_bindings { + patch: "/v1/{security_marks.name=folders/*/assets/*/securityMarks}" + body: "security_marks" + } + additional_bindings { + patch: "/v1/{security_marks.name=projects/*/assets/*/securityMarks}" + body: "security_marks" + } additional_bindings { patch: "/v1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}" body: "security_marks" } + additional_bindings { + patch: "/v1/{security_marks.name=folders/*/sources/*/findings/*/securityMarks}" + body: "security_marks" + } + additional_bindings { + patch: "/v1/{security_marks.name=projects/*/sources/*/findings/*/securityMarks}" + body: "security_marks" + } }; option (google.api.method_signature) = "security_marks"; } @@ -381,11 +451,12 @@ message GetSourceRequest { // Request message for grouping by assets. message GroupAssetsRequest { // Required. Name of the organization to groupBy. Its format is - // "organizations/[organization_id]". + // "organizations/[organization_id], folders/[folder_id], or + // projects/[project_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Organization" + child_type: "securitycenter.googleapis.com/Asset" } ]; @@ -539,9 +610,12 @@ message GroupAssetsResponse { // Request message for grouping by findings. message GroupFindingsRequest { // Required. Name of the source to groupBy. Its format is - // "organizations/[organization_id]/sources/[source_id]". To groupBy across - // all sources provide a source_id of `-`. For example: - // organizations/{organization_id}/sources/- + // "organizations/[organization_id]/sources/[source_id]", + // folders/[folder_id]/sources/[source_id], or + // projects/[project_id]/sources/[source_id]. To groupBy across all sources + // provide a source_id of `-`. For example: + // organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, + // or projects/{project_id}/sources/- string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -728,12 +802,13 @@ message ListNotificationConfigsResponse { // Request message for listing sources. message ListSourcesRequest { - // Required. Resource name of the parent of sources to list. Its format should - // be "organizations/[organization_id]". + // Required. Resource name of the parent of sources to list. Its format should be + // "organizations/[organization_id], folders/[folder_id], or + // projects/[project_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Organization" + child_type: "securitycenter.googleapis.com/Source" } ]; @@ -760,11 +835,12 @@ message ListSourcesResponse { // Request message for listing assets. message ListAssetsRequest { // Required. Name of the organization assets should belong to. Its format is - // "organizations/[organization_id]". + // "organizations/[organization_id], folders/[folder_id], or + // projects/[project_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Organization" + child_type: "securitycenter.googleapis.com/Asset" } ]; @@ -950,9 +1026,12 @@ message ListAssetsResponse { // Request message for listing findings. message ListFindingsRequest { // Required. Name of the source the findings belong to. Its format is - // "organizations/[organization_id]/sources/[source_id]". To list across all - // sources provide a source_id of `-`. For example: - // organizations/{organization_id}/sources/- + // "organizations/[organization_id]/sources/[source_id], + // folders/[folder_id]/sources/[source_id], or + // projects/[project_id]/sources/[source_id]". To list across all sources + // provide a source_id of `-`. For example: + // organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or + // projects/{projects_id}/sources/- string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1106,6 +1185,11 @@ message ListFindingsResponse { // The human readable name of resource's parent. string parent_display_name = 5; + + // Contains a Folder message for each folder in the assets ancestry. + // The first folder is the deepest nested folder, and the last folder is + // the folder directly under the Organization. + repeated Folder folders = 7; } // The change in state of the finding. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto index e7b1a1835f4..0df844ddede 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,8 +16,8 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/api/annotations.proto"; import "google/api/resource.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; @@ -34,6 +34,8 @@ message Source { option (google.api.resource) = { type: "securitycenter.googleapis.com/Source" pattern: "organizations/{organization}/sources/{source}" + pattern: "folders/{folder}/sources/{source}" + pattern: "projects/{project}/sources/{source}" }; // The relative resource name of this source. See: @@ -57,4 +59,12 @@ message Source { // (XSS), Flash injection, mixed content (HTTP in HTTPS), and // outdated or insecure libraries." string description = 3; + + // The canonical name of the finding. It's either + // "organizations/{organization_id}/sources/{source_id}", + // "folders/{folder_id}/sources/{source_id}" or + // "projects/{project_number}/sources/{source_id}", + // depending on the closest CRM ancestor of the resource associated with the + // finding. + string canonical_name = 14; } diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 6817598cec6..1c66aa3f09c 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -49,6 +49,9 @@ export namespace google { /** Asset iamPolicy */ iamPolicy?: (google.cloud.securitycenter.v1.Asset.IIamPolicy|null); + + /** Asset canonicalName */ + canonicalName?: (string|null); } /** Represents an Asset. */ @@ -81,6 +84,9 @@ export namespace google { /** Asset iamPolicy. */ public iamPolicy?: (google.cloud.securitycenter.v1.Asset.IIamPolicy|null); + /** Asset canonicalName. */ + public canonicalName: string; + /** * Creates a new Asset instance using the specified properties. * @param [properties] Properties to set @@ -180,6 +186,9 @@ export namespace google { /** SecurityCenterProperties resourceProjectDisplayName */ resourceProjectDisplayName?: (string|null); + + /** SecurityCenterProperties folders */ + folders?: (google.cloud.securitycenter.v1.IFolder[]|null); } /** Represents a SecurityCenterProperties. */ @@ -215,6 +224,9 @@ export namespace google { /** SecurityCenterProperties resourceProjectDisplayName. */ public resourceProjectDisplayName: string; + /** SecurityCenterProperties folders. */ + public folders: google.cloud.securitycenter.v1.IFolder[]; + /** * Creates a new SecurityCenterProperties instance using the specified properties. * @param [properties] Properties to set @@ -377,6 +389,102 @@ export namespace google { } } + /** Properties of a Folder. */ + interface IFolder { + + /** Folder resourceFolder */ + resourceFolder?: (string|null); + + /** Folder resourceFolderDisplayName */ + resourceFolderDisplayName?: (string|null); + } + + /** Represents a Folder. */ + class Folder implements IFolder { + + /** + * Constructs a new Folder. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IFolder); + + /** Folder resourceFolder. */ + public resourceFolder: string; + + /** Folder resourceFolderDisplayName. */ + public resourceFolderDisplayName: string; + + /** + * Creates a new Folder instance using the specified properties. + * @param [properties] Properties to set + * @returns Folder instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IFolder): google.cloud.securitycenter.v1.Folder; + + /** + * Encodes the specified Folder message. Does not implicitly {@link google.cloud.securitycenter.v1.Folder.verify|verify} messages. + * @param message Folder message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IFolder, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Folder message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Folder.verify|verify} messages. + * @param message Folder message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IFolder, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Folder message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Folder + * @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.cloud.securitycenter.v1.Folder; + + /** + * Decodes a Folder message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Folder + * @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.cloud.securitycenter.v1.Folder; + + /** + * Verifies a Folder 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 Folder message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Folder + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Folder; + + /** + * Creates a plain object from a Folder message. Also converts values to other types if specified. + * @param message Folder + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Folder, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Folder to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a SecurityMarks. */ interface ISecurityMarks { @@ -385,6 +493,9 @@ export namespace google { /** SecurityMarks marks */ marks?: ({ [k: string]: string }|null); + + /** SecurityMarks canonicalName */ + canonicalName?: (string|null); } /** Represents a SecurityMarks. */ @@ -402,6 +513,9 @@ export namespace google { /** SecurityMarks marks. */ public marks: { [k: string]: string }; + /** SecurityMarks canonicalName. */ + public canonicalName: string; + /** * Creates a new SecurityMarks instance using the specified properties. * @param [properties] Properties to set @@ -508,6 +622,9 @@ export namespace google { /** Finding severity */ severity?: (google.cloud.securitycenter.v1.Finding.Severity|keyof typeof google.cloud.securitycenter.v1.Finding.Severity|null); + + /** Finding canonicalName */ + canonicalName?: (string|null); } /** Represents a Finding. */ @@ -552,6 +669,9 @@ export namespace google { /** Finding severity. */ public severity: (google.cloud.securitycenter.v1.Finding.Severity|keyof typeof google.cloud.securitycenter.v1.Finding.Severity); + /** Finding canonicalName. */ + public canonicalName: string; + /** * Creates a new Finding instance using the specified properties. * @param [properties] Properties to set @@ -974,6 +1094,9 @@ export namespace google { /** Resource parentDisplayName */ parentDisplayName?: (string|null); + + /** Resource folders */ + folders?: (google.cloud.securitycenter.v1.IFolder[]|null); } /** Represents a Resource. */ @@ -1000,6 +1123,9 @@ export namespace google { /** Resource parentDisplayName. */ public parentDisplayName: string; + /** Resource folders. */ + public folders: google.cloud.securitycenter.v1.IFolder[]; + /** * Creates a new Resource instance using the specified properties. * @param [properties] Properties to set @@ -1183,6 +1309,9 @@ export namespace google { /** AssetDiscoveryConfig inclusionMode */ inclusionMode?: (google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|keyof typeof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null); + + /** AssetDiscoveryConfig folderIds */ + folderIds?: (string[]|null); } /** Represents an AssetDiscoveryConfig. */ @@ -1200,6 +1329,9 @@ export namespace google { /** AssetDiscoveryConfig inclusionMode. */ public inclusionMode: (google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|keyof typeof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode); + /** AssetDiscoveryConfig folderIds. */ + public folderIds: string[]; + /** * Creates a new AssetDiscoveryConfig instance using the specified properties. * @param [properties] Properties to set @@ -4229,6 +4361,9 @@ export namespace google { /** Resource parentDisplayName */ parentDisplayName?: (string|null); + + /** Resource folders */ + folders?: (google.cloud.securitycenter.v1.IFolder[]|null); } /** Represents a Resource. */ @@ -4255,6 +4390,9 @@ export namespace google { /** Resource parentDisplayName. */ public parentDisplayName: string; + /** Resource folders. */ + public folders: google.cloud.securitycenter.v1.IFolder[]; + /** * Creates a new Resource instance using the specified properties. * @param [properties] Properties to set @@ -5026,6 +5164,9 @@ export namespace google { /** Source description */ description?: (string|null); + + /** Source canonicalName */ + canonicalName?: (string|null); } /** Represents a Source. */ @@ -5046,6 +5187,9 @@ export namespace google { /** Source description. */ public description: string; + /** Source canonicalName. */ + public canonicalName: string; + /** * Creates a new Source instance using the specified properties. * @param [properties] Properties to set @@ -13976,578 +14120,578 @@ export namespace google { /** Namespace api. */ namespace api { - /** Properties of a Http. */ - interface IHttp { + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); + /** ResourceDescriptor type */ + type?: (string|null); - /** Http fullyDecodeReservedExpansion */ - fullyDecodeReservedExpansion?: (boolean|null); + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); } - /** Represents a Http. */ - class Http implements IHttp { + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { /** - * Constructs a new Http. + * Constructs a new ResourceDescriptor. * @param [properties] Properties to set */ - constructor(properties?: google.api.IHttp); + constructor(properties?: google.api.IResourceDescriptor); - /** Http rules. */ - public rules: google.api.IHttpRule[]; + /** ResourceDescriptor type. */ + public type: string; - /** Http fullyDecodeReservedExpansion. */ - public fullyDecodeReservedExpansion: boolean; + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; /** - * Creates a new Http instance using the specified properties. + * Creates a new ResourceDescriptor instance using the specified properties. * @param [properties] Properties to set - * @returns Http instance + * @returns ResourceDescriptor instance */ - public static create(properties?: google.api.IHttp): google.api.Http; + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Http message from the specified reader or buffer. + * Decodes a ResourceDescriptor message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Http + * @returns ResourceDescriptor * @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.api.Http; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; /** - * Decodes a Http message from the specified reader or buffer, length delimited. + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Http + * @returns ResourceDescriptor * @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.api.Http; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; /** - * Verifies a Http message. + * Verifies a ResourceDescriptor 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 Http message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Http + * @returns ResourceDescriptor */ - public static fromObject(object: { [k: string]: any }): google.api.Http; + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Http to JSON. + * Converts this ResourceDescriptor to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a HttpRule. */ - interface IHttpRule { + namespace ResourceDescriptor { - /** HttpRule selector */ - selector?: (string|null); + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } - /** HttpRule get */ - get?: (string|null); + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } - /** HttpRule put */ - put?: (string|null); + /** Properties of a ResourceReference. */ + interface IResourceReference { - /** HttpRule post */ - post?: (string|null); - - /** HttpRule delete */ - "delete"?: (string|null); - - /** HttpRule patch */ - patch?: (string|null); - - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body */ - body?: (string|null); - - /** HttpRule responseBody */ - responseBody?: (string|null); + /** ResourceReference type */ + type?: (string|null); - /** HttpRule additionalBindings */ - additionalBindings?: (google.api.IHttpRule[]|null); + /** ResourceReference childType */ + childType?: (string|null); } - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { /** - * Constructs a new HttpRule. + * Constructs a new ResourceReference. * @param [properties] Properties to set */ - constructor(properties?: google.api.IHttpRule); - - /** HttpRule selector. */ - public selector: string; - - /** HttpRule get. */ - public get?: (string|null); - - /** HttpRule put. */ - public put?: (string|null); - - /** HttpRule post. */ - public post?: (string|null); - - /** HttpRule delete. */ - public delete?: (string|null); - - /** HttpRule patch. */ - public patch?: (string|null); - - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body. */ - public body: string; - - /** HttpRule responseBody. */ - public responseBody: string; + constructor(properties?: google.api.IResourceReference); - /** HttpRule additionalBindings. */ - public additionalBindings: google.api.IHttpRule[]; + /** ResourceReference type. */ + public type: string; - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + /** ResourceReference childType. */ + public childType: string; /** - * Creates a new HttpRule instance using the specified properties. + * Creates a new ResourceReference instance using the specified properties. * @param [properties] Properties to set - * @returns HttpRule instance + * @returns ResourceReference instance */ - public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a HttpRule message from the specified reader or buffer. + * Decodes a ResourceReference message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns HttpRule + * @returns ResourceReference * @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.api.HttpRule; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns HttpRule + * @returns ResourceReference * @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.api.HttpRule; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; /** - * Verifies a HttpRule message. + * Verifies a ResourceReference 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 HttpRule message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns HttpRule + * @returns ResourceReference */ - public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @param message HttpRule + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this HttpRule to JSON. + * Converts this ResourceReference to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { + /** Properties of a Http. */ + interface IHttp { - /** CustomHttpPattern kind */ - kind?: (string|null); + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); - /** CustomHttpPattern path */ - path?: (string|null); + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); } - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { + /** Represents a Http. */ + class Http implements IHttp { /** - * Constructs a new CustomHttpPattern. + * Constructs a new Http. * @param [properties] Properties to set */ - constructor(properties?: google.api.ICustomHttpPattern); + constructor(properties?: google.api.IHttp); - /** CustomHttpPattern kind. */ - public kind: string; + /** Http rules. */ + public rules: google.api.IHttpRule[]; - /** CustomHttpPattern path. */ - public path: string; + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; /** - * Creates a new CustomHttpPattern instance using the specified properties. + * Creates a new Http instance using the specified properties. * @param [properties] Properties to set - * @returns CustomHttpPattern instance + * @returns Http instance */ - public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + public static create(properties?: google.api.IHttp): google.api.Http; /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. + * Decodes a Http message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CustomHttpPattern + * @returns Http * @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.api.CustomHttpPattern; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * Decodes a Http message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CustomHttpPattern + * @returns Http * @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.api.CustomHttpPattern; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; /** - * Verifies a CustomHttpPattern message. + * Verifies a Http 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 CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * Creates a Http message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CustomHttpPattern + * @returns Http */ - public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + public static fromObject(object: { [k: string]: any }): google.api.Http; /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @param message CustomHttpPattern + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CustomHttpPattern to JSON. + * Converts this Http to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ResourceDescriptor. */ - interface IResourceDescriptor { + /** Properties of a HttpRule. */ + interface IHttpRule { - /** ResourceDescriptor type */ - type?: (string|null); + /** HttpRule selector */ + selector?: (string|null); - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); + /** HttpRule get */ + get?: (string|null); - /** ResourceDescriptor nameField */ - nameField?: (string|null); + /** HttpRule put */ + put?: (string|null); - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + /** HttpRule post */ + post?: (string|null); - /** ResourceDescriptor plural */ - plural?: (string|null); + /** HttpRule delete */ + "delete"?: (string|null); - /** ResourceDescriptor singular */ - singular?: (string|null); + /** HttpRule patch */ + patch?: (string|null); - /** ResourceDescriptor style */ - style?: (google.api.ResourceDescriptor.Style[]|null); + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); } - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { /** - * Constructs a new ResourceDescriptor. + * Constructs a new HttpRule. * @param [properties] Properties to set */ - constructor(properties?: google.api.IResourceDescriptor); + constructor(properties?: google.api.IHttpRule); - /** ResourceDescriptor type. */ - public type: string; + /** HttpRule selector. */ + public selector: string; - /** ResourceDescriptor pattern. */ - public pattern: string[]; + /** HttpRule get. */ + public get?: (string|null); - /** ResourceDescriptor nameField. */ - public nameField: string; + /** HttpRule put. */ + public put?: (string|null); - /** ResourceDescriptor history. */ - public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + /** HttpRule post. */ + public post?: (string|null); - /** ResourceDescriptor plural. */ - public plural: string; + /** HttpRule delete. */ + public delete?: (string|null); - /** ResourceDescriptor singular. */ - public singular: string; + /** HttpRule patch. */ + public patch?: (string|null); - /** ResourceDescriptor style. */ - public style: google.api.ResourceDescriptor.Style[]; + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); /** - * Creates a new ResourceDescriptor instance using the specified properties. + * Creates a new HttpRule instance using the specified properties. * @param [properties] Properties to set - * @returns ResourceDescriptor instance + * @returns HttpRule instance */ - public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. + * Decodes a HttpRule message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ResourceDescriptor + * @returns HttpRule * @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.api.ResourceDescriptor; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * Decodes a HttpRule message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ResourceDescriptor + * @returns HttpRule * @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.api.ResourceDescriptor; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; /** - * Verifies a ResourceDescriptor message. + * Verifies a HttpRule 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 ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ResourceDescriptor + * @returns HttpRule */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @param message ResourceDescriptor + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ResourceDescriptor to JSON. + * Converts this HttpRule to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace ResourceDescriptor { - - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 - } - - /** Style enum. */ - enum Style { - STYLE_UNSPECIFIED = 0, - DECLARATIVE_FRIENDLY = 1 - } - } - - /** Properties of a ResourceReference. */ - interface IResourceReference { + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { - /** ResourceReference type */ - type?: (string|null); + /** CustomHttpPattern kind */ + kind?: (string|null); - /** ResourceReference childType */ - childType?: (string|null); + /** CustomHttpPattern path */ + path?: (string|null); } - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { /** - * Constructs a new ResourceReference. + * Constructs a new CustomHttpPattern. * @param [properties] Properties to set */ - constructor(properties?: google.api.IResourceReference); + constructor(properties?: google.api.ICustomHttpPattern); - /** ResourceReference type. */ - public type: string; + /** CustomHttpPattern kind. */ + public kind: string; - /** ResourceReference childType. */ - public childType: string; + /** CustomHttpPattern path. */ + public path: string; /** - * Creates a new ResourceReference instance using the specified properties. + * Creates a new CustomHttpPattern instance using the specified properties. * @param [properties] Properties to set - * @returns ResourceReference instance + * @returns CustomHttpPattern instance */ - public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ResourceReference message from the specified reader or buffer. + * Decodes a CustomHttpPattern message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ResourceReference + * @returns CustomHttpPattern * @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.api.ResourceReference; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ResourceReference + * @returns CustomHttpPattern * @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.api.ResourceReference; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; /** - * Verifies a ResourceReference message. + * Verifies a CustomHttpPattern 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 ResourceReference message from a plain object. Also converts values to their respective internal types. + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ResourceReference + * @returns CustomHttpPattern */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @param message ResourceReference + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ResourceReference to JSON. + * Converts this CustomHttpPattern to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index c4de7ef4235..89c16f0ef81 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -79,6 +79,7 @@ * @property {google.protobuf.ITimestamp|null} [createTime] Asset createTime * @property {google.protobuf.ITimestamp|null} [updateTime] Asset updateTime * @property {google.cloud.securitycenter.v1.Asset.IIamPolicy|null} [iamPolicy] Asset iamPolicy + * @property {string|null} [canonicalName] Asset canonicalName */ /** @@ -153,6 +154,14 @@ */ Asset.prototype.iamPolicy = null; + /** + * Asset canonicalName. + * @member {string} canonicalName + * @memberof google.cloud.securitycenter.v1.Asset + * @instance + */ + Asset.prototype.canonicalName = ""; + /** * Creates a new Asset instance using the specified properties. * @function create @@ -194,6 +203,8 @@ $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); if (message.iamPolicy != null && Object.hasOwnProperty.call(message, "iamPolicy")) $root.google.cloud.securitycenter.v1.Asset.IamPolicy.encode(message.iamPolicy, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.canonicalName); return writer; }; @@ -268,6 +279,9 @@ case 11: message.iamPolicy = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.decode(reader, reader.uint32()); break; + case 13: + message.canonicalName = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -341,6 +355,9 @@ if (error) return "iamPolicy." + error; } + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + if (!$util.isString(message.canonicalName)) + return "canonicalName: string expected"; return null; }; @@ -393,6 +410,8 @@ throw TypeError(".google.cloud.securitycenter.v1.Asset.iamPolicy: object expected"); message.iamPolicy = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.fromObject(object.iamPolicy); } + if (object.canonicalName != null) + message.canonicalName = String(object.canonicalName); return message; }; @@ -418,6 +437,7 @@ object.createTime = null; object.updateTime = null; object.iamPolicy = null; + object.canonicalName = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -437,6 +457,8 @@ object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) object.iamPolicy = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.toObject(message.iamPolicy, options); + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + object.canonicalName = message.canonicalName; return object; }; @@ -465,6 +487,7 @@ * @property {string|null} [resourceDisplayName] SecurityCenterProperties resourceDisplayName * @property {string|null} [resourceParentDisplayName] SecurityCenterProperties resourceParentDisplayName * @property {string|null} [resourceProjectDisplayName] SecurityCenterProperties resourceProjectDisplayName + * @property {Array.|null} [folders] SecurityCenterProperties folders */ /** @@ -477,6 +500,7 @@ */ function SecurityCenterProperties(properties) { this.resourceOwners = []; + this.folders = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -547,6 +571,14 @@ */ SecurityCenterProperties.prototype.resourceProjectDisplayName = ""; + /** + * SecurityCenterProperties folders. + * @member {Array.} folders + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.folders = $util.emptyArray; + /** * Creates a new SecurityCenterProperties instance using the specified properties. * @function create @@ -588,6 +620,9 @@ writer.uint32(/* id 7, wireType 2 =*/58).string(message.resourceParentDisplayName); if (message.resourceProjectDisplayName != null && Object.hasOwnProperty.call(message, "resourceProjectDisplayName")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.resourceProjectDisplayName); + if (message.folders != null && message.folders.length) + for (var i = 0; i < message.folders.length; ++i) + $root.google.cloud.securitycenter.v1.Folder.encode(message.folders[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; @@ -648,6 +683,11 @@ case 8: message.resourceProjectDisplayName = reader.string(); break; + case 10: + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push($root.google.cloud.securitycenter.v1.Folder.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -711,6 +751,15 @@ if (message.resourceProjectDisplayName != null && message.hasOwnProperty("resourceProjectDisplayName")) if (!$util.isString(message.resourceProjectDisplayName)) return "resourceProjectDisplayName: string expected"; + if (message.folders != null && message.hasOwnProperty("folders")) { + if (!Array.isArray(message.folders)) + return "folders: array expected"; + for (var i = 0; i < message.folders.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Folder.verify(message.folders[i]); + if (error) + return "folders." + error; + } + } return null; }; @@ -747,6 +796,16 @@ message.resourceParentDisplayName = String(object.resourceParentDisplayName); if (object.resourceProjectDisplayName != null) message.resourceProjectDisplayName = String(object.resourceProjectDisplayName); + if (object.folders) { + if (!Array.isArray(object.folders)) + throw TypeError(".google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.folders: array expected"); + message.folders = []; + for (var i = 0; i < object.folders.length; ++i) { + if (typeof object.folders[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.folders: object expected"); + message.folders[i] = $root.google.cloud.securitycenter.v1.Folder.fromObject(object.folders[i]); + } + } return message; }; @@ -763,8 +822,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.resourceOwners = []; + object.folders = []; + } if (options.defaults) { object.resourceName = ""; object.resourceType = ""; @@ -793,6 +854,11 @@ object.resourceParentDisplayName = message.resourceParentDisplayName; if (message.resourceProjectDisplayName != null && message.hasOwnProperty("resourceProjectDisplayName")) object.resourceProjectDisplayName = message.resourceProjectDisplayName; + if (message.folders && message.folders.length) { + object.folders = []; + for (var j = 0; j < message.folders.length; ++j) + object.folders[j] = $root.google.cloud.securitycenter.v1.Folder.toObject(message.folders[j], options); + } return object; }; @@ -1000,6 +1066,216 @@ return Asset; })(); + v1.Folder = (function() { + + /** + * Properties of a Folder. + * @memberof google.cloud.securitycenter.v1 + * @interface IFolder + * @property {string|null} [resourceFolder] Folder resourceFolder + * @property {string|null} [resourceFolderDisplayName] Folder resourceFolderDisplayName + */ + + /** + * Constructs a new Folder. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Folder. + * @implements IFolder + * @constructor + * @param {google.cloud.securitycenter.v1.IFolder=} [properties] Properties to set + */ + function Folder(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]]; + } + + /** + * Folder resourceFolder. + * @member {string} resourceFolder + * @memberof google.cloud.securitycenter.v1.Folder + * @instance + */ + Folder.prototype.resourceFolder = ""; + + /** + * Folder resourceFolderDisplayName. + * @member {string} resourceFolderDisplayName + * @memberof google.cloud.securitycenter.v1.Folder + * @instance + */ + Folder.prototype.resourceFolderDisplayName = ""; + + /** + * Creates a new Folder instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Folder + * @static + * @param {google.cloud.securitycenter.v1.IFolder=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Folder} Folder instance + */ + Folder.create = function create(properties) { + return new Folder(properties); + }; + + /** + * Encodes the specified Folder message. Does not implicitly {@link google.cloud.securitycenter.v1.Folder.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Folder + * @static + * @param {google.cloud.securitycenter.v1.IFolder} message Folder message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Folder.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceFolder != null && Object.hasOwnProperty.call(message, "resourceFolder")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceFolder); + if (message.resourceFolderDisplayName != null && Object.hasOwnProperty.call(message, "resourceFolderDisplayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceFolderDisplayName); + return writer; + }; + + /** + * Encodes the specified Folder message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Folder.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Folder + * @static + * @param {google.cloud.securitycenter.v1.IFolder} message Folder message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Folder.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Folder message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Folder + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Folder} Folder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Folder.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.cloud.securitycenter.v1.Folder(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceFolder = reader.string(); + break; + case 2: + message.resourceFolderDisplayName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Folder message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Folder + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Folder} Folder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Folder.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Folder message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Folder + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Folder.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceFolder != null && message.hasOwnProperty("resourceFolder")) + if (!$util.isString(message.resourceFolder)) + return "resourceFolder: string expected"; + if (message.resourceFolderDisplayName != null && message.hasOwnProperty("resourceFolderDisplayName")) + if (!$util.isString(message.resourceFolderDisplayName)) + return "resourceFolderDisplayName: string expected"; + return null; + }; + + /** + * Creates a Folder message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Folder + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Folder} Folder + */ + Folder.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Folder) + return object; + var message = new $root.google.cloud.securitycenter.v1.Folder(); + if (object.resourceFolder != null) + message.resourceFolder = String(object.resourceFolder); + if (object.resourceFolderDisplayName != null) + message.resourceFolderDisplayName = String(object.resourceFolderDisplayName); + return message; + }; + + /** + * Creates a plain object from a Folder message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Folder + * @static + * @param {google.cloud.securitycenter.v1.Folder} message Folder + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Folder.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resourceFolder = ""; + object.resourceFolderDisplayName = ""; + } + if (message.resourceFolder != null && message.hasOwnProperty("resourceFolder")) + object.resourceFolder = message.resourceFolder; + if (message.resourceFolderDisplayName != null && message.hasOwnProperty("resourceFolderDisplayName")) + object.resourceFolderDisplayName = message.resourceFolderDisplayName; + return object; + }; + + /** + * Converts this Folder to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Folder + * @instance + * @returns {Object.} JSON object + */ + Folder.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Folder; + })(); + v1.SecurityMarks = (function() { /** @@ -1008,6 +1284,7 @@ * @interface ISecurityMarks * @property {string|null} [name] SecurityMarks name * @property {Object.|null} [marks] SecurityMarks marks + * @property {string|null} [canonicalName] SecurityMarks canonicalName */ /** @@ -1042,6 +1319,14 @@ */ SecurityMarks.prototype.marks = $util.emptyObject; + /** + * SecurityMarks canonicalName. + * @member {string} canonicalName + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @instance + */ + SecurityMarks.prototype.canonicalName = ""; + /** * Creates a new SecurityMarks instance using the specified properties. * @function create @@ -1071,6 +1356,8 @@ if (message.marks != null && Object.hasOwnProperty.call(message, "marks")) for (var keys = Object.keys(message.marks), i = 0; i < keys.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.marks[keys[i]]).ldelim(); + if (message.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.canonicalName); return writer; }; @@ -1130,6 +1417,9 @@ } message.marks[key] = value; break; + case 3: + message.canonicalName = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -1176,6 +1466,9 @@ if (!$util.isString(message.marks[key[i]])) return "marks: string{k:string} expected"; } + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + if (!$util.isString(message.canonicalName)) + return "canonicalName: string expected"; return null; }; @@ -1200,6 +1493,8 @@ for (var keys = Object.keys(object.marks), i = 0; i < keys.length; ++i) message.marks[keys[i]] = String(object.marks[keys[i]]); } + if (object.canonicalName != null) + message.canonicalName = String(object.canonicalName); return message; }; @@ -1218,8 +1513,10 @@ var object = {}; if (options.objects || options.defaults) object.marks = {}; - if (options.defaults) + if (options.defaults) { object.name = ""; + object.canonicalName = ""; + } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; var keys2; @@ -1228,6 +1525,8 @@ for (var j = 0; j < keys2.length; ++j) object.marks[keys2[j]] = message.marks[keys2[j]]; } + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + object.canonicalName = message.canonicalName; return object; }; @@ -1262,6 +1561,7 @@ * @property {google.protobuf.ITimestamp|null} [eventTime] Finding eventTime * @property {google.protobuf.ITimestamp|null} [createTime] Finding createTime * @property {google.cloud.securitycenter.v1.Finding.Severity|null} [severity] Finding severity + * @property {string|null} [canonicalName] Finding canonicalName */ /** @@ -1368,6 +1668,14 @@ */ Finding.prototype.severity = 0; + /** + * Finding canonicalName. + * @member {string} canonicalName + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.canonicalName = ""; + /** * Creates a new Finding instance using the specified properties. * @function create @@ -1417,6 +1725,8 @@ $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) writer.uint32(/* id 12, wireType 0 =*/96).int32(message.severity); + if (message.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.canonicalName); return writer; }; @@ -1503,6 +1813,9 @@ case 12: message.severity = reader.int32(); break; + case 14: + message.canonicalName = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -1598,6 +1911,9 @@ case 4: break; } + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + if (!$util.isString(message.canonicalName)) + return "canonicalName: string expected"; return null; }; @@ -1684,6 +2000,8 @@ message.severity = 4; break; } + if (object.canonicalName != null) + message.canonicalName = String(object.canonicalName); return message; }; @@ -1713,6 +2031,7 @@ object.eventTime = null; object.createTime = null; object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; + object.canonicalName = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -1740,6 +2059,8 @@ object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.severity != null && message.hasOwnProperty("severity")) object.severity = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.Severity[message.severity] : message.severity; + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + object.canonicalName = message.canonicalName; return object; }; @@ -2554,6 +2875,7 @@ * @property {string|null} [projectDisplayName] Resource projectDisplayName * @property {string|null} [parent] Resource parent * @property {string|null} [parentDisplayName] Resource parentDisplayName + * @property {Array.|null} [folders] Resource folders */ /** @@ -2565,6 +2887,7 @@ * @param {google.cloud.securitycenter.v1.IResource=} [properties] Properties to set */ function Resource(properties) { + this.folders = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2611,6 +2934,14 @@ */ Resource.prototype.parentDisplayName = ""; + /** + * Resource folders. + * @member {Array.} folders + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.folders = $util.emptyArray; + /** * Creates a new Resource instance using the specified properties. * @function create @@ -2645,6 +2976,9 @@ writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); if (message.parentDisplayName != null && Object.hasOwnProperty.call(message, "parentDisplayName")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.parentDisplayName); + if (message.folders != null && message.folders.length) + for (var i = 0; i < message.folders.length; ++i) + $root.google.cloud.securitycenter.v1.Folder.encode(message.folders[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -2694,6 +3028,11 @@ case 5: message.parentDisplayName = reader.string(); break; + case 7: + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push($root.google.cloud.securitycenter.v1.Folder.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -2744,6 +3083,15 @@ if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) if (!$util.isString(message.parentDisplayName)) return "parentDisplayName: string expected"; + if (message.folders != null && message.hasOwnProperty("folders")) { + if (!Array.isArray(message.folders)) + return "folders: array expected"; + for (var i = 0; i < message.folders.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Folder.verify(message.folders[i]); + if (error) + return "folders." + error; + } + } return null; }; @@ -2769,6 +3117,16 @@ message.parent = String(object.parent); if (object.parentDisplayName != null) message.parentDisplayName = String(object.parentDisplayName); + if (object.folders) { + if (!Array.isArray(object.folders)) + throw TypeError(".google.cloud.securitycenter.v1.Resource.folders: array expected"); + message.folders = []; + for (var i = 0; i < object.folders.length; ++i) { + if (typeof object.folders[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Resource.folders: object expected"); + message.folders[i] = $root.google.cloud.securitycenter.v1.Folder.fromObject(object.folders[i]); + } + } return message; }; @@ -2785,6 +3143,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.folders = []; if (options.defaults) { object.name = ""; object.project = ""; @@ -2802,6 +3162,11 @@ object.parent = message.parent; if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) object.parentDisplayName = message.parentDisplayName; + if (message.folders && message.folders.length) { + object.folders = []; + for (var j = 0; j < message.folders.length; ++j) + object.folders[j] = $root.google.cloud.securitycenter.v1.Folder.toObject(message.folders[j], options); + } return object; }; @@ -3061,6 +3426,7 @@ * @interface IAssetDiscoveryConfig * @property {Array.|null} [projectIds] AssetDiscoveryConfig projectIds * @property {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null} [inclusionMode] AssetDiscoveryConfig inclusionMode + * @property {Array.|null} [folderIds] AssetDiscoveryConfig folderIds */ /** @@ -3073,6 +3439,7 @@ */ function AssetDiscoveryConfig(properties) { this.projectIds = []; + this.folderIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3095,6 +3462,14 @@ */ AssetDiscoveryConfig.prototype.inclusionMode = 0; + /** + * AssetDiscoveryConfig folderIds. + * @member {Array.} folderIds + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @instance + */ + AssetDiscoveryConfig.prototype.folderIds = $util.emptyArray; + /** * Creates a new AssetDiscoveryConfig instance using the specified properties. * @function create @@ -3124,6 +3499,9 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectIds[i]); if (message.inclusionMode != null && Object.hasOwnProperty.call(message, "inclusionMode")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.inclusionMode); + if (message.folderIds != null && message.folderIds.length) + for (var i = 0; i < message.folderIds.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.folderIds[i]); return writer; }; @@ -3166,6 +3544,11 @@ case 2: message.inclusionMode = reader.int32(); break; + case 3: + if (!(message.folderIds && message.folderIds.length)) + message.folderIds = []; + message.folderIds.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -3217,6 +3600,13 @@ case 2: break; } + if (message.folderIds != null && message.hasOwnProperty("folderIds")) { + if (!Array.isArray(message.folderIds)) + return "folderIds: array expected"; + for (var i = 0; i < message.folderIds.length; ++i) + if (!$util.isString(message.folderIds[i])) + return "folderIds: string[] expected"; + } return null; }; @@ -3253,6 +3643,13 @@ message.inclusionMode = 2; break; } + if (object.folderIds) { + if (!Array.isArray(object.folderIds)) + throw TypeError(".google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.folderIds: array expected"); + message.folderIds = []; + for (var i = 0; i < object.folderIds.length; ++i) + message.folderIds[i] = String(object.folderIds[i]); + } return message; }; @@ -3269,8 +3666,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.projectIds = []; + object.folderIds = []; + } if (options.defaults) object.inclusionMode = options.enums === String ? "INCLUSION_MODE_UNSPECIFIED" : 0; if (message.projectIds && message.projectIds.length) { @@ -3280,6 +3679,11 @@ } if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) object.inclusionMode = options.enums === String ? $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] : message.inclusionMode; + if (message.folderIds && message.folderIds.length) { + object.folderIds = []; + for (var j = 0; j < message.folderIds.length; ++j) + object.folderIds[j] = message.folderIds[j]; + } return object; }; @@ -10024,6 +10428,7 @@ * @property {string|null} [projectDisplayName] Resource projectDisplayName * @property {string|null} [parentName] Resource parentName * @property {string|null} [parentDisplayName] Resource parentDisplayName + * @property {Array.|null} [folders] Resource folders */ /** @@ -10035,6 +10440,7 @@ * @param {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource=} [properties] Properties to set */ function Resource(properties) { + this.folders = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10081,6 +10487,14 @@ */ Resource.prototype.parentDisplayName = ""; + /** + * Resource folders. + * @member {Array.} folders + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.folders = $util.emptyArray; + /** * Creates a new Resource instance using the specified properties. * @function create @@ -10115,6 +10529,9 @@ writer.uint32(/* id 4, wireType 2 =*/34).string(message.parentName); if (message.parentDisplayName != null && Object.hasOwnProperty.call(message, "parentDisplayName")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.parentDisplayName); + if (message.folders != null && message.folders.length) + for (var i = 0; i < message.folders.length; ++i) + $root.google.cloud.securitycenter.v1.Folder.encode(message.folders[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -10164,6 +10581,11 @@ case 5: message.parentDisplayName = reader.string(); break; + case 7: + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push($root.google.cloud.securitycenter.v1.Folder.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -10214,6 +10636,15 @@ if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) if (!$util.isString(message.parentDisplayName)) return "parentDisplayName: string expected"; + if (message.folders != null && message.hasOwnProperty("folders")) { + if (!Array.isArray(message.folders)) + return "folders: array expected"; + for (var i = 0; i < message.folders.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Folder.verify(message.folders[i]); + if (error) + return "folders." + error; + } + } return null; }; @@ -10239,6 +10670,16 @@ message.parentName = String(object.parentName); if (object.parentDisplayName != null) message.parentDisplayName = String(object.parentDisplayName); + if (object.folders) { + if (!Array.isArray(object.folders)) + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.folders: array expected"); + message.folders = []; + for (var i = 0; i < object.folders.length; ++i) { + if (typeof object.folders[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.folders: object expected"); + message.folders[i] = $root.google.cloud.securitycenter.v1.Folder.fromObject(object.folders[i]); + } + } return message; }; @@ -10255,6 +10696,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.folders = []; if (options.defaults) { object.name = ""; object.projectName = ""; @@ -10272,6 +10715,11 @@ object.parentName = message.parentName; if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) object.parentDisplayName = message.parentDisplayName; + if (message.folders && message.folders.length) { + object.folders = []; + for (var j = 0; j < message.folders.length; ++j) + object.folders[j] = $root.google.cloud.securitycenter.v1.Folder.toObject(message.folders[j], options); + } return object; }; @@ -11893,6 +12341,7 @@ * @property {string|null} [name] Source name * @property {string|null} [displayName] Source displayName * @property {string|null} [description] Source description + * @property {string|null} [canonicalName] Source canonicalName */ /** @@ -11934,6 +12383,14 @@ */ Source.prototype.description = ""; + /** + * Source canonicalName. + * @member {string} canonicalName + * @memberof google.cloud.securitycenter.v1.Source + * @instance + */ + Source.prototype.canonicalName = ""; + /** * Creates a new Source instance using the specified properties. * @function create @@ -11964,6 +12421,8 @@ writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.canonicalName); return writer; }; @@ -12007,6 +12466,9 @@ case 3: message.description = reader.string(); break; + case 14: + message.canonicalName = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -12051,6 +12513,9 @@ if (message.description != null && message.hasOwnProperty("description")) if (!$util.isString(message.description)) return "description: string expected"; + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + if (!$util.isString(message.canonicalName)) + return "canonicalName: string expected"; return null; }; @@ -12072,6 +12537,8 @@ message.displayName = String(object.displayName); if (object.description != null) message.description = String(object.description); + if (object.canonicalName != null) + message.canonicalName = String(object.canonicalName); return message; }; @@ -12092,6 +12559,7 @@ object.name = ""; object.displayName = ""; object.description = ""; + object.canonicalName = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -12099,6 +12567,8 @@ object.displayName = message.displayName; if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + object.canonicalName = message.canonicalName; return object; }; @@ -33285,26 +33755,32 @@ */ var api = {}; - api.Http = (function() { + api.ResourceDescriptor = (function() { /** - * Properties of a Http. + * Properties of a ResourceDescriptor. * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style */ /** - * Constructs a new Http. + * Constructs a new ResourceDescriptor. * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor * @constructor - * @param {google.api.IHttp=} [properties] Properties to set + * @param {google.api.IResourceDescriptor=} [properties] Properties to set */ - function Http(properties) { - this.rules = []; + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -33312,91 +33788,167 @@ } /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor * @instance */ - Http.prototype.rules = $util.emptyArray; + ResourceDescriptor.prototype.type = ""; /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor * @instance */ - Http.prototype.fullyDecodeReservedExpansion = false; + ResourceDescriptor.prototype.pattern = $util.emptyArray; /** - * Creates a new Http instance using the specified properties. + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. * @function create - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance */ - Http.create = function create(properties) { - return new Http(properties); + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); }; /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encode - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encode = function encode(message, writer) { + ResourceDescriptor.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (var i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } return writer; }; /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encodeDelimited = function encodeDelimited(message, writer) { + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Http message from the specified reader or buffer. + * Decodes a ResourceDescriptor message from the specified reader or buffer. * @function decode - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http + * @returns {google.api.ResourceDescriptor} ResourceDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Http.decode = function decode(reader, length) { + ResourceDescriptor.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.api.Http(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + message.type = reader.string(); break; case 2: - message.fullyDecodeReservedExpansion = reader.bool(); + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + case 3: + message.nameField = reader.string(); + break; + case 4: + message.history = reader.int32(); + break; + case 5: + message.plural = reader.string(); + break; + case 6: + message.singular = reader.string(); + break; + case 10: + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); break; default: reader.skipType(tag & 7); @@ -33407,353 +33959,335 @@ }; /** - * Decodes a Http message from the specified reader or buffer, length delimited. + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http + * @returns {google.api.ResourceDescriptor} ResourceDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Http.decodeDelimited = function decodeDelimited(reader) { + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Http message. + * Verifies a ResourceDescriptor message. * @function verify - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Http.verify = function verify(message) { + ResourceDescriptor.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (var i = 0; i < message.rules.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.rules[i]); - if (error) - return "rules." + error; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; return null; }; /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static * @param {Object.} object Plain object - * @returns {google.api.Http} Http + * @returns {google.api.ResourceDescriptor} ResourceDescriptor */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); return message; }; /** - * Creates a plain object from a Http message. Also converts values to other types if specified. + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.Http} message Http + * @param {google.api.ResourceDescriptor} message ResourceDescriptor * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Http.toObject = function toObject(message, options) { + ResourceDescriptor.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fullyDecodeReservedExpansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; - return object; - }; - - /** - * Converts this Http to JSON. - * @function toJSON - * @memberof google.api.Http - * @instance - * @returns {Object.} JSON object - */ - Http.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Http; - })(); - - api.HttpRule = (function() { - - /** - * Properties of a HttpRule. - * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [responseBody] HttpRule responseBody - * @property {Array.|null} [additionalBindings] HttpRule additionalBindings - */ - - /** - * Constructs a new HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule - * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set - */ - function HttpRule(properties) { - this.additionalBindings = []; - 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]]; - } - - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor * @instance + * @returns {Object.} JSON object */ - HttpRule.prototype.put = null; + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value */ - HttpRule.prototype.post = null; + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value */ - HttpRule.prototype["delete"] = null; + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; + return ResourceDescriptor; + })(); - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; + api.ResourceReference = (function() { /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType */ - HttpRule.prototype.body = ""; /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set */ - HttpRule.prototype.responseBody = ""; + function ResourceReference(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]]; + } /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference * @instance */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ResourceReference.prototype.type = ""; /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference * @instance */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); + ResourceReference.prototype.childType = ""; /** - * Creates a new HttpRule instance using the specified properties. + * Creates a new ResourceReference instance using the specified properties. * @function create - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); }; /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encode - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encode = function encode(message, writer) { + ResourceReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && Object.hasOwnProperty.call(message, "get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && Object.hasOwnProperty.call(message, "put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && Object.hasOwnProperty.call(message, "post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additionalBindings != null && message.additionalBindings.length) - for (var i = 0; i < message.additionalBindings.length; ++i) - $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); return writer; }; /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HttpRule message from the specified reader or buffer. + * Decodes a ResourceReference message from the specified reader or buffer. * @function decode - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule + * @returns {google.api.ResourceReference} ResourceReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HttpRule.decode = function decode(reader, length) { + ResourceReference.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.api.HttpRule(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.selector = reader.string(); + message.type = reader.string(); break; case 2: - message.get = reader.string(); - break; - case 3: - message.put = reader.string(); - break; - case 4: - message.post = reader.string(); - break; - case 5: - message["delete"] = reader.string(); - break; - case 6: - message.patch = reader.string(); - break; - case 8: - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; - case 7: - message.body = reader.string(); - break; - case 12: - message.responseBody = reader.string(); - break; - case 11: - if (!(message.additionalBindings && message.additionalBindings.length)) - message.additionalBindings = []; - message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + message.childType = reader.string(); break; default: reader.skipType(tag & 7); @@ -33764,240 +34298,118 @@ }; /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule + * @returns {google.api.ResourceReference} ResourceReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { + ResourceReference.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HttpRule message. + * Verifies a ResourceReference message. * @function verify - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - HttpRule.verify = function verify(message) { + ResourceReference.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - var error = $root.google.api.CustomHttpPattern.verify(message.custom); - if (error) - return "custom." + error; - } - } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - if (!$util.isString(message.responseBody)) - return "responseBody: string expected"; - if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { - if (!Array.isArray(message.additionalBindings)) - return "additionalBindings: array expected"; - for (var i = 0; i < message.additionalBindings.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); - if (error) - return "additionalBindings." + error; - } - } + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; return null; }; /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule + * @returns {google.api.ResourceReference} ResourceReference */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) return object; - var message = new $root.google.api.HttpRule(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); - } - if (object.body != null) - message.body = String(object.body); - if (object.responseBody != null) - message.responseBody = String(object.responseBody); - if (object.additionalBindings) { - if (!Array.isArray(object.additionalBindings)) - throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); - message.additionalBindings = []; - for (var i = 0; i < object.additionalBindings.length; ++i) { - if (typeof object.additionalBindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); - message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); - } - } + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); return message; }; /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static - * @param {google.api.HttpRule} message HttpRule + * @param {google.api.ResourceReference} message ResourceReference * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HttpRule.toObject = function toObject(message, options) { + ResourceReference.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.additionalBindings = []; if (options.defaults) { - object.selector = ""; - object.body = ""; - object.responseBody = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; - } - if (message.additionalBindings && message.additionalBindings.length) { - object.additionalBindings = []; - for (var j = 0; j < message.additionalBindings.length; ++j) - object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + object.type = ""; + object.childType = ""; } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; return object; }; /** - * Converts this HttpRule to JSON. + * Converts this ResourceReference to JSON. * @function toJSON - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @instance * @returns {Object.} JSON object */ - HttpRule.prototype.toJSON = function toJSON() { + ResourceReference.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HttpRule; + return ResourceReference; })(); - api.CustomHttpPattern = (function() { + api.Http = (function() { /** - * Properties of a CustomHttpPattern. + * Properties of a Http. * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion */ /** - * Constructs a new CustomHttpPattern. + * Constructs a new Http. * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern + * @classdesc Represents a Http. + * @implements IHttp * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @param {google.api.IHttp=} [properties] Properties to set */ - function CustomHttpPattern(properties) { + function Http(properties) { + this.rules = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34005,88 +34417,91 @@ } /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http * @instance */ - CustomHttpPattern.prototype.kind = ""; + Http.prototype.rules = $util.emptyArray; /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http * @instance */ - CustomHttpPattern.prototype.path = ""; + Http.prototype.fullyDecodeReservedExpansion = false; /** - * Creates a new CustomHttpPattern instance using the specified properties. + * Creates a new Http instance using the specified properties. * @function create - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); + Http.create = function create(properties) { + return new Http(properties); }; /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encode - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encode = function encode(message, writer) { + Http.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); return writer; }; /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + Http.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. + * Decodes a Http message from the specified reader or buffer. * @function decode - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.api.Http} Http * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CustomHttpPattern.decode = function decode(reader, length) { + Http.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.api.CustomHttpPattern(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.kind = reader.string(); + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); break; case 2: - message.path = reader.string(); + message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); @@ -34097,124 +34512,143 @@ }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * Decodes a Http message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.api.Http} Http * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + Http.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CustomHttpPattern message. + * Verifies a Http message. * @function verify - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CustomHttpPattern.verify = function verify(message) { + Http.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; return null; }; /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * Creates a Http message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.api.Http} Http */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) return object; - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); return message; }; /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * Creates a plain object from a Http message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {google.api.Http} message Http * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomHttpPattern.toObject = function toObject(message, options) { + Http.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; return object; }; /** - * Converts this CustomHttpPattern to JSON. + * Converts this Http to JSON. * @function toJSON - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @instance * @returns {Object.} JSON object */ - CustomHttpPattern.prototype.toJSON = function toJSON() { + Http.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CustomHttpPattern; + return Http; })(); - api.ResourceDescriptor = (function() { + api.HttpRule = (function() { /** - * Properties of a ResourceDescriptor. + * Properties of a HttpRule. * @memberof google.api - * @interface IResourceDescriptor - * @property {string|null} [type] ResourceDescriptor type - * @property {Array.|null} [pattern] ResourceDescriptor pattern - * @property {string|null} [nameField] ResourceDescriptor nameField - * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history - * @property {string|null} [plural] ResourceDescriptor plural - * @property {string|null} [singular] ResourceDescriptor singular - * @property {Array.|null} [style] ResourceDescriptor style + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings */ /** - * Constructs a new ResourceDescriptor. + * Constructs a new HttpRule. * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor + * @classdesc Represents a HttpRule. + * @implements IHttpRule * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @param {google.api.IHttpRule=} [properties] Properties to set */ - function ResourceDescriptor(properties) { - this.pattern = []; - this.style = []; + function HttpRule(properties) { + this.additionalBindings = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34222,167 +34656,209 @@ } /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.type = ""; + HttpRule.prototype.selector = ""; /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; + HttpRule.prototype.get = null; /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.nameField = ""; + HttpRule.prototype.put = null; /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.history = 0; + HttpRule.prototype.post = null; /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.plural = ""; + HttpRule.prototype["delete"] = null; /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.singular = ""; + HttpRule.prototype.patch = null; /** - * ResourceDescriptor style. - * @member {Array.} style - * @memberof google.api.ResourceDescriptor + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.style = $util.emptyArray; + HttpRule.prototype.custom = null; /** - * Creates a new ResourceDescriptor instance using the specified properties. + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. * @function create - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); + HttpRule.create = function create(properties) { + return new HttpRule(properties); }; /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encode - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encode = function encode(message, writer) { + HttpRule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.pattern != null && message.pattern.length) - for (var i = 0; i < message.pattern.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); - if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && Object.hasOwnProperty.call(message, "history")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); - if (message.style != null && message.style.length) { - writer.uint32(/* id 10, wireType 2 =*/82).fork(); - for (var i = 0; i < message.style.length; ++i) - writer.int32(message.style[i]); - writer.ldelim(); - } + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); return writer; }; /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. + * Decodes a HttpRule message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @returns {google.api.HttpRule} HttpRule * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResourceDescriptor.decode = function decode(reader, length) { + HttpRule.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.api.ResourceDescriptor(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.type = reader.string(); + message.selector = reader.string(); break; case 2: - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); + message.get = reader.string(); break; case 3: - message.nameField = reader.string(); + message.put = reader.string(); break; case 4: - message.history = reader.int32(); + message.post = reader.string(); break; case 5: - message.plural = reader.string(); + message["delete"] = reader.string(); break; case 6: - message.singular = reader.string(); + message.patch = reader.string(); break; - case 10: - if (!(message.style && message.style.length)) - message.style = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.style.push(reader.int32()); - } else - message.style.push(reader.int32()); + case 8: + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + case 7: + message.body = reader.string(); + break; + case 12: + message.responseBody = reader.string(); + break; + case 11: + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -34393,246 +34869,240 @@ }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * Decodes a HttpRule message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @returns {google.api.HttpRule} HttpRule * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + HttpRule.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceDescriptor message. + * Verifies a HttpRule message. * @function verify - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ResourceDescriptor.verify = function verify(message) { + HttpRule.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.pattern != null && message.hasOwnProperty("pattern")) { - if (!Array.isArray(message.pattern)) - return "pattern: array expected"; - for (var i = 0; i < message.pattern.length; ++i) - if (!$util.isString(message.pattern[i])) - return "pattern: string[] expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; } - if (message.nameField != null && message.hasOwnProperty("nameField")) - if (!$util.isString(message.nameField)) - return "nameField: string expected"; - if (message.history != null && message.hasOwnProperty("history")) - switch (message.history) { - default: - return "history: enum value expected"; - case 0: - case 1: - case 2: - break; + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; } - if (message.plural != null && message.hasOwnProperty("plural")) - if (!$util.isString(message.plural)) - return "plural: string expected"; - if (message.singular != null && message.hasOwnProperty("singular")) - if (!$util.isString(message.singular)) - return "singular: string expected"; - if (message.style != null && message.hasOwnProperty("style")) { - if (!Array.isArray(message.style)) - return "style: array expected"; - for (var i = 0; i < message.style.length; ++i) - switch (message.style[i]) { - default: - return "style: enum value[] expected"; - case 0: - case 1: - break; - } } return null; }; /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @returns {google.api.HttpRule} HttpRule */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) return object; - var message = new $root.google.api.ResourceDescriptor(); - if (object.type != null) - message.type = String(object.type); - if (object.pattern) { - if (!Array.isArray(object.pattern)) - throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); - message.pattern = []; - for (var i = 0; i < object.pattern.length; ++i) - message.pattern[i] = String(object.pattern[i]); - } - if (object.nameField != null) - message.nameField = String(object.nameField); - switch (object.history) { - case "HISTORY_UNSPECIFIED": - case 0: - message.history = 0; - break; - case "ORIGINALLY_SINGLE_PATTERN": - case 1: - message.history = 1; - break; - case "FUTURE_MULTI_PATTERN": - case 2: - message.history = 2; - break; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); } - if (object.plural != null) - message.plural = String(object.plural); - if (object.singular != null) - message.singular = String(object.singular); - if (object.style) { - if (!Array.isArray(object.style)) - throw TypeError(".google.api.ResourceDescriptor.style: array expected"); - message.style = []; - for (var i = 0; i < object.style.length; ++i) - switch (object.style[i]) { - default: - case "STYLE_UNSPECIFIED": - case 0: - message.style[i] = 0; - break; - case "DECLARATIVE_FRIENDLY": - case 1: - message.style[i] = 1; - break; - } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } } return message; }; /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {google.api.HttpRule} message HttpRule * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceDescriptor.toObject = function toObject(message, options) { + HttpRule.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.pattern = []; - object.style = []; - } + if (options.arrays || options.defaults) + object.additionalBindings = []; if (options.defaults) { - object.type = ""; - object.nameField = ""; - object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; - object.plural = ""; - object.singular = ""; + object.selector = ""; + object.body = ""; + object.responseBody = ""; } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.pattern && message.pattern.length) { - object.pattern = []; - for (var j = 0; j < message.pattern.length; ++j) - object.pattern[j] = message.pattern[j]; + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; } - if (message.nameField != null && message.hasOwnProperty("nameField")) - object.nameField = message.nameField; - if (message.history != null && message.hasOwnProperty("history")) - object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; - if (message.plural != null && message.hasOwnProperty("plural")) - object.plural = message.plural; - if (message.singular != null && message.hasOwnProperty("singular")) - object.singular = message.singular; - if (message.style && message.style.length) { - object.style = []; - for (var j = 0; j < message.style.length; ++j) - object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; return object; }; /** - * Converts this ResourceDescriptor to JSON. + * Converts this HttpRule to JSON. * @function toJSON - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @instance * @returns {Object.} JSON object */ - ResourceDescriptor.prototype.toJSON = function toJSON() { + HttpRule.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {number} - * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value - * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value - * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value - */ - ResourceDescriptor.History = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; - values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; - return values; - })(); - - /** - * Style enum. - * @name google.api.ResourceDescriptor.Style - * @enum {number} - * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value - * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value - */ - ResourceDescriptor.Style = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; - return values; - })(); - - return ResourceDescriptor; + return HttpRule; })(); - api.ResourceReference = (function() { + api.CustomHttpPattern = (function() { /** - * Properties of a ResourceReference. + * Properties of a CustomHttpPattern. * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path */ /** - * Constructs a new ResourceReference. + * Constructs a new CustomHttpPattern. * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set */ - function ResourceReference(properties) { + function CustomHttpPattern(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34640,88 +35110,88 @@ } /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern * @instance */ - ResourceReference.prototype.type = ""; + CustomHttpPattern.prototype.kind = ""; /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern * @instance */ - ResourceReference.prototype.childType = ""; + CustomHttpPattern.prototype.path = ""; /** - * Creates a new ResourceReference instance using the specified properties. + * Creates a new CustomHttpPattern instance using the specified properties. * @function create - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); }; /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encode - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encode = function encode(message, writer) { + CustomHttpPattern.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); return writer; }; /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceReference message from the specified reader or buffer. + * Decodes a CustomHttpPattern message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceReference} ResourceReference + * @returns {google.api.CustomHttpPattern} CustomHttpPattern * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResourceReference.decode = function decode(reader, length) { + CustomHttpPattern.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.api.ResourceReference(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.type = reader.string(); + message.kind = reader.string(); break; case 2: - message.childType = reader.string(); + message.path = reader.string(); break; default: reader.skipType(tag & 7); @@ -34732,96 +35202,96 @@ }; /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference + * @returns {google.api.CustomHttpPattern} CustomHttpPattern * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceReference message. + * Verifies a CustomHttpPattern message. * @function verify - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ResourceReference.verify = function verify(message) { + CustomHttpPattern.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.childType != null && message.hasOwnProperty("childType")) - if (!$util.isString(message.childType)) - return "childType: string expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; return null; }; /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference + * @returns {google.api.CustomHttpPattern} CustomHttpPattern */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) return object; - var message = new $root.google.api.ResourceReference(); - if (object.type != null) - message.type = String(object.type); - if (object.childType != null) - message.childType = String(object.childType); + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); return message; }; /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.ResourceReference} message ResourceReference + * @param {google.api.CustomHttpPattern} message CustomHttpPattern * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceReference.toObject = function toObject(message, options) { + CustomHttpPattern.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.type = ""; - object.childType = ""; + object.kind = ""; + object.path = ""; } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.childType != null && message.hasOwnProperty("childType")) - object.childType = message.childType; + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; return object; }; /** - * Converts this ResourceReference to JSON. + * Converts this CustomHttpPattern to JSON. * @function toJSON - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @instance * @returns {Object.} JSON object */ - ResourceReference.prototype.toJSON = function toJSON() { + CustomHttpPattern.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ResourceReference; + return CustomHttpPattern; })(); /** diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index 0548749a7a6..a667990855a 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -22,7 +22,7 @@ "Asset": { "options": { "(google.api.resource).type": "securitycenter.googleapis.com/Asset", - "(google.api.resource).pattern": "organizations/{organization}/assets/{asset}" + "(google.api.resource).pattern": "projects/{project}/assets/{asset}" }, "fields": { "name": { @@ -53,6 +53,10 @@ "iamPolicy": { "type": "IamPolicy", "id": 11 + }, + "canonicalName": { + "type": "string", + "id": 13 } }, "nested": { @@ -90,6 +94,11 @@ "resourceProjectDisplayName": { "type": "string", "id": 8 + }, + "folders": { + "rule": "repeated", + "type": "Folder", + "id": 10 } } }, @@ -103,10 +112,22 @@ } } }, + "Folder": { + "fields": { + "resourceFolder": { + "type": "string", + "id": 1 + }, + "resourceFolderDisplayName": { + "type": "string", + "id": 2 + } + } + }, "SecurityMarks": { "options": { "(google.api.resource).type": "securitycenter.googleapis.com/SecurityMarks", - "(google.api.resource).pattern": "organizations/{organization}/sources/{source}/findings/{finding}/securityMarks" + "(google.api.resource).pattern": "projects/{project}/sources/{source}/findings/{finding}/securityMarks" }, "fields": { "name": { @@ -117,13 +138,17 @@ "keyType": "string", "type": "string", "id": 2 + }, + "canonicalName": { + "type": "string", + "id": 3 } } }, "Finding": { "options": { "(google.api.resource).type": "securitycenter.googleapis.com/Finding", - "(google.api.resource).pattern": "organizations/{organization}/sources/{source}/findings/{finding}" + "(google.api.resource).pattern": "projects/{project}/sources/{source}/findings/{finding}" }, "fields": { "name": { @@ -173,6 +198,10 @@ "severity": { "type": "Severity", "id": 12 + }, + "canonicalName": { + "type": "string", + "id": 14 } }, "nested": { @@ -289,6 +318,14 @@ "parentDisplayName": { "type": "string", "id": 5 + }, + "folders": { + "rule": "repeated", + "type": "Folder", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, @@ -322,6 +359,11 @@ "inclusionMode": { "type": "InclusionMode", "id": 2 + }, + "folderIds": { + "rule": "repeated", + "type": "string", + "id": 3 } }, "nested": { @@ -524,13 +566,25 @@ "responseType": "GroupAssetsResponse", "options": { "(google.api.http).post": "/v1/{parent=organizations/*}/assets:group", - "(google.api.http).body": "*" + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*}/assets:group", + "(google.api.http).additional_bindings.body": "*" }, "parsedOptions": [ { "(google.api.http)": { "post": "/v1/{parent=organizations/*}/assets:group", - "body": "*" + "body": "*", + "additional_bindings": [ + { + "post": "/v1/{parent=folders/*}/assets:group", + "body": "*" + }, + { + "post": "/v1/{parent=projects/*}/assets:group", + "body": "*" + } + ] } } ] @@ -541,13 +595,25 @@ "options": { "(google.api.http).post": "/v1/{parent=organizations/*/sources/*}/findings:group", "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/sources/*}/findings:group", + "(google.api.http).additional_bindings.body": "*", "(google.api.method_signature)": "parent,group_by" }, "parsedOptions": [ { "(google.api.http)": { "post": "/v1/{parent=organizations/*/sources/*}/findings:group", - "body": "*" + "body": "*", + "additional_bindings": [ + { + "post": "/v1/{parent=folders/*/sources/*}/findings:group", + "body": "*" + }, + { + "post": "/v1/{parent=projects/*/sources/*}/findings:group", + "body": "*" + } + ] } }, { @@ -559,12 +625,21 @@ "requestType": "ListAssetsRequest", "responseType": "ListAssetsResponse", "options": { - "(google.api.http).get": "/v1/{parent=organizations/*}/assets" + "(google.api.http).get": "/v1/{parent=organizations/*}/assets", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*}/assets" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1/{parent=organizations/*}/assets" + "get": "/v1/{parent=organizations/*}/assets", + "additional_bindings": [ + { + "get": "/v1/{parent=folders/*}/assets" + }, + { + "get": "/v1/{parent=projects/*}/assets" + } + ] } } ] @@ -573,12 +648,21 @@ "requestType": "ListFindingsRequest", "responseType": "ListFindingsResponse", "options": { - "(google.api.http).get": "/v1/{parent=organizations/*/sources/*}/findings" + "(google.api.http).get": "/v1/{parent=organizations/*/sources/*}/findings", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/sources/*}/findings" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1/{parent=organizations/*/sources/*}/findings" + "get": "/v1/{parent=organizations/*/sources/*}/findings", + "additional_bindings": [ + { + "get": "/v1/{parent=folders/*/sources/*}/findings" + }, + { + "get": "/v1/{parent=projects/*/sources/*}/findings" + } + ] } } ] @@ -606,12 +690,21 @@ "responseType": "ListSourcesResponse", "options": { "(google.api.http).get": "/v1/{parent=organizations/*}/sources", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*}/sources", "(google.api.method_signature)": "parent" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1/{parent=organizations/*}/sources" + "get": "/v1/{parent=organizations/*}/sources", + "additional_bindings": [ + { + "get": "/v1/{parent=folders/*}/sources" + }, + { + "get": "/v1/{parent=projects/*}/sources" + } + ] } }, { @@ -653,13 +746,25 @@ "options": { "(google.api.http).post": "/v1/{name=organizations/*/sources/*/findings/*}:setState", "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{name=projects/*/sources/*/findings/*}:setState", + "(google.api.http).additional_bindings.body": "*", "(google.api.method_signature)": "name,state,start_time" }, "parsedOptions": [ { "(google.api.http)": { "post": "/v1/{name=organizations/*/sources/*/findings/*}:setState", - "body": "*" + "body": "*", + "additional_bindings": [ + { + "post": "/v1/{name=folders/*/sources/*/findings/*}:setState", + "body": "*" + }, + { + "post": "/v1/{name=projects/*/sources/*/findings/*}:setState", + "body": "*" + } + ] } }, { @@ -713,13 +818,25 @@ "options": { "(google.api.http).patch": "/v1/{finding.name=organizations/*/sources/*/findings/*}", "(google.api.http).body": "finding", + "(google.api.http).additional_bindings.patch": "/v1/{finding.name=projects/*/sources/*/findings/*}", + "(google.api.http).additional_bindings.body": "finding", "(google.api.method_signature)": "finding" }, "parsedOptions": [ { "(google.api.http)": { "patch": "/v1/{finding.name=organizations/*/sources/*/findings/*}", - "body": "finding" + "body": "finding", + "additional_bindings": [ + { + "patch": "/v1/{finding.name=folders/*/sources/*/findings/*}", + "body": "finding" + }, + { + "patch": "/v1/{finding.name=projects/*/sources/*/findings/*}", + "body": "finding" + } + ] } }, { @@ -796,7 +913,7 @@ "options": { "(google.api.http).patch": "/v1/{security_marks.name=organizations/*/assets/*/securityMarks}", "(google.api.http).body": "security_marks", - "(google.api.http).additional_bindings.patch": "/v1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}", + "(google.api.http).additional_bindings.patch": "/v1/{security_marks.name=projects/*/sources/*/findings/*/securityMarks}", "(google.api.http).additional_bindings.body": "security_marks", "(google.api.method_signature)": "security_marks" }, @@ -805,10 +922,28 @@ "(google.api.http)": { "patch": "/v1/{security_marks.name=organizations/*/assets/*/securityMarks}", "body": "security_marks", - "additional_bindings": { - "patch": "/v1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}", - "body": "security_marks" - } + "additional_bindings": [ + { + "patch": "/v1/{security_marks.name=folders/*/assets/*/securityMarks}", + "body": "security_marks" + }, + { + "patch": "/v1/{security_marks.name=projects/*/assets/*/securityMarks}", + "body": "security_marks" + }, + { + "patch": "/v1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}", + "body": "security_marks" + }, + { + "patch": "/v1/{security_marks.name=folders/*/sources/*/findings/*/securityMarks}", + "body": "security_marks" + }, + { + "patch": "/v1/{security_marks.name=projects/*/sources/*/findings/*/securityMarks}", + "body": "security_marks" + } + ] } }, { @@ -944,7 +1079,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/Asset" } }, "filter": { @@ -1110,7 +1245,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/Source" } }, "pageToken": { @@ -1143,7 +1278,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/Asset" } }, "filter": { @@ -1322,6 +1457,11 @@ "parentDisplayName": { "type": "string", "id": 5 + }, + "folders": { + "rule": "repeated", + "type": "Folder", + "id": 7 } } }, @@ -1458,7 +1598,7 @@ "Source": { "options": { "(google.api.resource).type": "securitycenter.googleapis.com/Source", - "(google.api.resource).pattern": "organizations/{organization}/sources/{source}" + "(google.api.resource).pattern": "projects/{project}/sources/{source}" }, "fields": { "name": { @@ -1472,6 +1612,10 @@ "description": { "type": "string", "id": 3 + }, + "canonicalName": { + "type": "string", + "id": 14 } } } @@ -4201,14 +4345,91 @@ }, "api": { "options": { + "cc_enable_arenas": true, "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", "java_multiple_files": true, "java_outer_classname": "ClientProto", "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true + "objc_class_prefix": "GAPI" }, "nested": { + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, "http": { "type": "HttpRule", "id": 72295728, @@ -4296,83 +4517,6 @@ } } }, - "resourceReference": { - "type": "google.api.ResourceReference", - "id": 1055, - "extend": "google.protobuf.FieldOptions" - }, - "resourceDefinition": { - "rule": "repeated", - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.FileOptions" - }, - "resource": { - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.MessageOptions" - }, - "ResourceDescriptor": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "pattern": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "nameField": { - "type": "string", - "id": 3 - }, - "history": { - "type": "History", - "id": 4 - }, - "plural": { - "type": "string", - "id": 5 - }, - "singular": { - "type": "string", - "id": 6 - }, - "style": { - "rule": "repeated", - "type": "Style", - "id": 10 - } - }, - "nested": { - "History": { - "values": { - "HISTORY_UNSPECIFIED": 0, - "ORIGINALLY_SINGLE_PATTERN": 1, - "FUTURE_MULTI_PATTERN": 2 - } - }, - "Style": { - "values": { - "STYLE_UNSPECIFIED": 0, - "DECLARATIVE_FRIENDLY": 1 - } - } - } - }, - "ResourceReference": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "childType": { - "type": "string", - "id": 2 - } - } - }, "fieldBehavior": { "rule": "repeated", "type": "google.api.FieldBehavior", diff --git a/packages/google-cloud-securitycenter/src/index.ts b/packages/google-cloud-securitycenter/src/index.ts index f0712e1a2de..c05c520cf5f 100644 --- a/packages/google-cloud-securitycenter/src/index.ts +++ b/packages/google-cloud-securitycenter/src/index.ts @@ -16,14 +16,14 @@ // ** https://github.com/googleapis/synthtool ** // ** All changes to this file may be overwritten. ** -import * as v1p1beta1 from './v1p1beta1'; import * as v1beta1 from './v1beta1'; +import * as v1p1beta1 from './v1p1beta1'; import * as v1 from './v1'; const SecurityCenterClient = v1.SecurityCenterClient; type SecurityCenterClient = v1.SecurityCenterClient; -export {v1p1beta1, v1beta1, v1, SecurityCenterClient}; -export default {v1p1beta1, v1beta1, v1, SecurityCenterClient}; +export {v1beta1, v1p1beta1, v1, SecurityCenterClient}; +export default {v1beta1, v1p1beta1, v1, SecurityCenterClient}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index c997ce63a64..69f7c815b9b 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -153,18 +153,31 @@ export class SecurityCenterClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { - assetPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/assets/{asset}' + folderAssetPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/assets/{asset}' ), - findingPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/sources/{source}/findings/{finding}' + folderAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/assets/{asset}/securityMarks' + ), + folderSourcePathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/sources/{source}' ), + folderSourceFindingPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/sources/{source}/findings/{finding}' + ), + folderSourceFindingSecurityMarksPathTemplate: + new this._gaxModule.PathTemplate( + 'folders/{folder}/sources/{source}/findings/{finding}/securityMarks' + ), notificationConfigPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/notificationConfigs/{notification_config}' ), organizationPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}' ), + organizationAssetPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/assets/{asset}' + ), organizationAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/assets/{asset}/securityMarks' @@ -172,13 +185,32 @@ export class SecurityCenterClient { organizationSettingsPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/organizationSettings' ), + organizationSourcePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}' + ), + organizationSourceFindingPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}' + ), organizationSourceFindingSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' ), - sourcePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/sources/{source}' + projectAssetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/assets/{asset}' + ), + projectAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/assets/{asset}/securityMarks' + ), + projectSourcePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/sources/{source}' + ), + projectSourceFindingPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/sources/{source}/findings/{finding}' ), + projectSourceFindingSecurityMarksPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/sources/{source}/findings/{finding}/securityMarks' + ), }; // Some of the methods on this service return "paged" results, @@ -1600,6 +1632,7 @@ export class SecurityCenterClient { > ): void; /** + * * Updates a notification config. The following update * fields are allowed: description, pubsub_topic, streaming_config.filter * @@ -2165,7 +2198,8 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the organization to groupBy. Its format is - * "organizations/[organization_id]". + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". * @param {string} request.filter * Expression that defines the filter to apply across assets. * The expression is a list of zero or more restrictions combined via logical @@ -2351,7 +2385,8 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the organization to groupBy. Its format is - * "organizations/[organization_id]". + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". * @param {string} request.filter * Expression that defines the filter to apply across assets. * The expression is a list of zero or more restrictions combined via logical @@ -2515,7 +2550,8 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the organization to groupBy. Its format is - * "organizations/[organization_id]". + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". * @param {string} request.filter * Expression that defines the filter to apply across assets. * The expression is a list of zero or more restrictions combined via logical @@ -2711,15 +2747,20 @@ export class SecurityCenterClient { * specified properties. * * To group across all sources provide a `-` as the source id. - * Example: /v1/organizations/{organization_id}/sources/-/findings + * Example: /v1/organizations/{organization_id}/sources/-/findings, + * /v1/folders/{folder_id}/sources/-/findings, + * /v1/projects/{project_id}/sources/-/findings * * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. Name of the source to groupBy. Its format is - * "organizations/[organization_id]/sources/[source_id]". To groupBy across - * all sources provide a source_id of `-`. For example: - * organizations/{organization_id}/sources/- + * "organizations/[organization_id]/sources/[source_id]", + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]. To groupBy across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, + * or projects/{project_id}/sources/- * @param {string} request.filter * Expression that defines the filter to apply across findings. * The expression is a list of one or more restrictions combined via logical @@ -2895,9 +2936,12 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the source to groupBy. Its format is - * "organizations/[organization_id]/sources/[source_id]". To groupBy across - * all sources provide a source_id of `-`. For example: - * organizations/{organization_id}/sources/- + * "organizations/[organization_id]/sources/[source_id]", + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]. To groupBy across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, + * or projects/{project_id}/sources/- * @param {string} request.filter * Expression that defines the filter to apply across findings. * The expression is a list of one or more restrictions combined via logical @@ -3051,9 +3095,12 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the source to groupBy. Its format is - * "organizations/[organization_id]/sources/[source_id]". To groupBy across - * all sources provide a source_id of `-`. For example: - * organizations/{organization_id}/sources/- + * "organizations/[organization_id]/sources/[source_id]", + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]. To groupBy across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, + * or projects/{project_id}/sources/- * @param {string} request.filter * Expression that defines the filter to apply across findings. * The expression is a list of one or more restrictions combined via logical @@ -3241,7 +3288,8 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the organization assets should belong to. Its format is - * "organizations/[organization_id]". + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". * @param {string} request.filter * Expression that defines the filter to apply across assets. * The expression is a list of zero or more restrictions combined via logical @@ -3431,7 +3479,8 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the organization assets should belong to. Its format is - * "organizations/[organization_id]". + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". * @param {string} request.filter * Expression that defines the filter to apply across assets. * The expression is a list of zero or more restrictions combined via logical @@ -3599,7 +3648,8 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the organization assets should belong to. Its format is - * "organizations/[organization_id]". + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". * @param {string} request.filter * Expression that defines the filter to apply across assets. * The expression is a list of zero or more restrictions combined via logical @@ -3804,9 +3854,12 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the source the findings belong to. Its format is - * "organizations/[organization_id]/sources/[source_id]". To list across all - * sources provide a source_id of `-`. For example: - * organizations/{organization_id}/sources/- + * "organizations/[organization_id]/sources/[source_id], + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]". To list across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or + * projects/{projects_id}/sources/- * @param {string} request.filter * Expression that defines the filter to apply across findings. * The expression is a list of one or more restrictions combined via logical @@ -3986,9 +4039,12 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the source the findings belong to. Its format is - * "organizations/[organization_id]/sources/[source_id]". To list across all - * sources provide a source_id of `-`. For example: - * organizations/{organization_id}/sources/- + * "organizations/[organization_id]/sources/[source_id], + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]". To list across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or + * projects/{projects_id}/sources/- * @param {string} request.filter * Expression that defines the filter to apply across findings. * The expression is a list of one or more restrictions combined via logical @@ -4146,9 +4202,12 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the source the findings belong to. Its format is - * "organizations/[organization_id]/sources/[source_id]". To list across all - * sources provide a source_id of `-`. For example: - * organizations/{organization_id}/sources/- + * "organizations/[organization_id]/sources/[source_id], + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]". To list across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or + * projects/{projects_id}/sources/- * @param {string} request.filter * Expression that defines the filter to apply across findings. * The expression is a list of one or more restrictions combined via logical @@ -4546,8 +4605,9 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should - * be "organizations/[organization_id]". + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates * that this is a continuation of a prior `ListSources` call, and @@ -4617,8 +4677,9 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should - * be "organizations/[organization_id]". + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates * that this is a continuation of a prior `ListSources` call, and @@ -4666,8 +4727,9 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should - * be "organizations/[organization_id]". + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates * that this is a continuation of a prior `ListSources` call, and @@ -4717,89 +4779,245 @@ export class SecurityCenterClient { // -------------------- /** - * Return a fully-qualified asset resource name string. + * Return a fully-qualified folderAsset resource name string. * - * @param {string} organization + * @param {string} folder * @param {string} asset * @returns {string} Resource name string. */ - assetPath(organization: string, asset: string) { - return this.pathTemplates.assetPathTemplate.render({ - organization: organization, + folderAssetPath(folder: string, asset: string) { + return this.pathTemplates.folderAssetPathTemplate.render({ + folder: folder, asset: asset, }); } /** - * Parse the organization from Asset resource. + * Parse the folder from FolderAsset resource. * - * @param {string} assetName - * A fully-qualified path representing Asset resource. - * @returns {string} A string representing the organization. + * @param {string} folderAssetName + * A fully-qualified path representing folder_asset resource. + * @returns {string} A string representing the folder. */ - matchOrganizationFromAssetName(assetName: string) { - return this.pathTemplates.assetPathTemplate.match(assetName).organization; + matchFolderFromFolderAssetName(folderAssetName: string) { + return this.pathTemplates.folderAssetPathTemplate.match(folderAssetName) + .folder; } /** - * Parse the asset from Asset resource. + * Parse the asset from FolderAsset resource. * - * @param {string} assetName - * A fully-qualified path representing Asset resource. + * @param {string} folderAssetName + * A fully-qualified path representing folder_asset resource. * @returns {string} A string representing the asset. */ - matchAssetFromAssetName(assetName: string) { - return this.pathTemplates.assetPathTemplate.match(assetName).asset; + matchAssetFromFolderAssetName(folderAssetName: string) { + return this.pathTemplates.folderAssetPathTemplate.match(folderAssetName) + .asset; } /** - * Return a fully-qualified finding resource name string. + * Return a fully-qualified folderAssetSecurityMarks resource name string. * - * @param {string} organization + * @param {string} folder + * @param {string} asset + * @returns {string} Resource name string. + */ + folderAssetSecurityMarksPath(folder: string, asset: string) { + return this.pathTemplates.folderAssetSecurityMarksPathTemplate.render({ + folder: folder, + asset: asset, + }); + } + + /** + * Parse the folder from FolderAssetSecurityMarks resource. + * + * @param {string} folderAssetSecurityMarksName + * A fully-qualified path representing folder_asset_securityMarks resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderAssetSecurityMarksName( + folderAssetSecurityMarksName: string + ) { + return this.pathTemplates.folderAssetSecurityMarksPathTemplate.match( + folderAssetSecurityMarksName + ).folder; + } + + /** + * Parse the asset from FolderAssetSecurityMarks resource. + * + * @param {string} folderAssetSecurityMarksName + * A fully-qualified path representing folder_asset_securityMarks resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromFolderAssetSecurityMarksName( + folderAssetSecurityMarksName: string + ) { + return this.pathTemplates.folderAssetSecurityMarksPathTemplate.match( + folderAssetSecurityMarksName + ).asset; + } + + /** + * Return a fully-qualified folderSource resource name string. + * + * @param {string} folder + * @param {string} source + * @returns {string} Resource name string. + */ + folderSourcePath(folder: string, source: string) { + return this.pathTemplates.folderSourcePathTemplate.render({ + folder: folder, + source: source, + }); + } + + /** + * Parse the folder from FolderSource resource. + * + * @param {string} folderSourceName + * A fully-qualified path representing folder_source resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSourceName(folderSourceName: string) { + return this.pathTemplates.folderSourcePathTemplate.match(folderSourceName) + .folder; + } + + /** + * Parse the source from FolderSource resource. + * + * @param {string} folderSourceName + * A fully-qualified path representing folder_source resource. + * @returns {string} A string representing the source. + */ + matchSourceFromFolderSourceName(folderSourceName: string) { + return this.pathTemplates.folderSourcePathTemplate.match(folderSourceName) + .source; + } + + /** + * Return a fully-qualified folderSourceFinding resource name string. + * + * @param {string} folder * @param {string} source * @param {string} finding * @returns {string} Resource name string. */ - findingPath(organization: string, source: string, finding: string) { - return this.pathTemplates.findingPathTemplate.render({ - organization: organization, + folderSourceFindingPath(folder: string, source: string, finding: string) { + return this.pathTemplates.folderSourceFindingPathTemplate.render({ + folder: folder, source: source, finding: finding, }); } /** - * Parse the organization from Finding resource. + * Parse the folder from FolderSourceFinding resource. * - * @param {string} findingName - * A fully-qualified path representing Finding resource. - * @returns {string} A string representing the organization. + * @param {string} folderSourceFindingName + * A fully-qualified path representing folder_source_finding resource. + * @returns {string} A string representing the folder. */ - matchOrganizationFromFindingName(findingName: string) { - return this.pathTemplates.findingPathTemplate.match(findingName) - .organization; + matchFolderFromFolderSourceFindingName(folderSourceFindingName: string) { + return this.pathTemplates.folderSourceFindingPathTemplate.match( + folderSourceFindingName + ).folder; } /** - * Parse the source from Finding resource. + * Parse the source from FolderSourceFinding resource. * - * @param {string} findingName - * A fully-qualified path representing Finding resource. + * @param {string} folderSourceFindingName + * A fully-qualified path representing folder_source_finding resource. * @returns {string} A string representing the source. */ - matchSourceFromFindingName(findingName: string) { - return this.pathTemplates.findingPathTemplate.match(findingName).source; + matchSourceFromFolderSourceFindingName(folderSourceFindingName: string) { + return this.pathTemplates.folderSourceFindingPathTemplate.match( + folderSourceFindingName + ).source; } /** - * Parse the finding from Finding resource. + * Parse the finding from FolderSourceFinding resource. * - * @param {string} findingName - * A fully-qualified path representing Finding resource. + * @param {string} folderSourceFindingName + * A fully-qualified path representing folder_source_finding resource. * @returns {string} A string representing the finding. */ - matchFindingFromFindingName(findingName: string) { - return this.pathTemplates.findingPathTemplate.match(findingName).finding; + matchFindingFromFolderSourceFindingName(folderSourceFindingName: string) { + return this.pathTemplates.folderSourceFindingPathTemplate.match( + folderSourceFindingName + ).finding; + } + + /** + * Return a fully-qualified folderSourceFindingSecurityMarks resource name string. + * + * @param {string} folder + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + folderSourceFindingSecurityMarksPath( + folder: string, + source: string, + finding: string + ) { + return this.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.render( + { + folder: folder, + source: source, + finding: finding, + } + ); + } + + /** + * Parse the folder from FolderSourceFindingSecurityMarks resource. + * + * @param {string} folderSourceFindingSecurityMarksName + * A fully-qualified path representing folder_source_finding_securityMarks resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSourceFindingSecurityMarksName( + folderSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match( + folderSourceFindingSecurityMarksName + ).folder; + } + + /** + * Parse the source from FolderSourceFindingSecurityMarks resource. + * + * @param {string} folderSourceFindingSecurityMarksName + * A fully-qualified path representing folder_source_finding_securityMarks resource. + * @returns {string} A string representing the source. + */ + matchSourceFromFolderSourceFindingSecurityMarksName( + folderSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match( + folderSourceFindingSecurityMarksName + ).source; + } + + /** + * Parse the finding from FolderSourceFindingSecurityMarks resource. + * + * @param {string} folderSourceFindingSecurityMarksName + * A fully-qualified path representing folder_source_finding_securityMarks resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromFolderSourceFindingSecurityMarksName( + folderSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match( + folderSourceFindingSecurityMarksName + ).finding; } /** @@ -4868,6 +5086,46 @@ export class SecurityCenterClient { .organization; } + /** + * Return a fully-qualified organizationAsset resource name string. + * + * @param {string} organization + * @param {string} asset + * @returns {string} Resource name string. + */ + organizationAssetPath(organization: string, asset: string) { + return this.pathTemplates.organizationAssetPathTemplate.render({ + organization: organization, + asset: asset, + }); + } + + /** + * Parse the organization from OrganizationAsset resource. + * + * @param {string} organizationAssetName + * A fully-qualified path representing organization_asset resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationAssetName(organizationAssetName: string) { + return this.pathTemplates.organizationAssetPathTemplate.match( + organizationAssetName + ).organization; + } + + /** + * Parse the asset from OrganizationAsset resource. + * + * @param {string} organizationAssetName + * A fully-qualified path representing organization_asset resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromOrganizationAssetName(organizationAssetName: string) { + return this.pathTemplates.organizationAssetPathTemplate.match( + organizationAssetName + ).asset; + } + /** * Return a fully-qualified organizationAssetSecurityMarks resource name string. * @@ -4941,6 +5199,111 @@ export class SecurityCenterClient { ).organization; } + /** + * Return a fully-qualified organizationSource resource name string. + * + * @param {string} organization + * @param {string} source + * @returns {string} Resource name string. + */ + organizationSourcePath(organization: string, source: string) { + return this.pathTemplates.organizationSourcePathTemplate.render({ + organization: organization, + source: source, + }); + } + + /** + * Parse the organization from OrganizationSource resource. + * + * @param {string} organizationSourceName + * A fully-qualified path representing organization_source resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSourceName(organizationSourceName: string) { + return this.pathTemplates.organizationSourcePathTemplate.match( + organizationSourceName + ).organization; + } + + /** + * Parse the source from OrganizationSource resource. + * + * @param {string} organizationSourceName + * A fully-qualified path representing organization_source resource. + * @returns {string} A string representing the source. + */ + matchSourceFromOrganizationSourceName(organizationSourceName: string) { + return this.pathTemplates.organizationSourcePathTemplate.match( + organizationSourceName + ).source; + } + + /** + * Return a fully-qualified organizationSourceFinding resource name string. + * + * @param {string} organization + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + organizationSourceFindingPath( + organization: string, + source: string, + finding: string + ) { + return this.pathTemplates.organizationSourceFindingPathTemplate.render({ + organization: organization, + source: source, + finding: finding, + }); + } + + /** + * Parse the organization from OrganizationSourceFinding resource. + * + * @param {string} organizationSourceFindingName + * A fully-qualified path representing organization_source_finding resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSourceFindingName( + organizationSourceFindingName: string + ) { + return this.pathTemplates.organizationSourceFindingPathTemplate.match( + organizationSourceFindingName + ).organization; + } + + /** + * Parse the source from OrganizationSourceFinding resource. + * + * @param {string} organizationSourceFindingName + * A fully-qualified path representing organization_source_finding resource. + * @returns {string} A string representing the source. + */ + matchSourceFromOrganizationSourceFindingName( + organizationSourceFindingName: string + ) { + return this.pathTemplates.organizationSourceFindingPathTemplate.match( + organizationSourceFindingName + ).source; + } + + /** + * Parse the finding from OrganizationSourceFinding resource. + * + * @param {string} organizationSourceFindingName + * A fully-qualified path representing organization_source_finding resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromOrganizationSourceFindingName( + organizationSourceFindingName: string + ) { + return this.pathTemplates.organizationSourceFindingPathTemplate.match( + organizationSourceFindingName + ).finding; + } + /** * Return a fully-qualified organizationSourceFindingSecurityMarks resource name string. * @@ -5009,39 +5372,245 @@ export class SecurityCenterClient { } /** - * Return a fully-qualified source resource name string. + * Return a fully-qualified projectAsset resource name string. * - * @param {string} organization + * @param {string} project + * @param {string} asset + * @returns {string} Resource name string. + */ + projectAssetPath(project: string, asset: string) { + return this.pathTemplates.projectAssetPathTemplate.render({ + project: project, + asset: asset, + }); + } + + /** + * Parse the project from ProjectAsset resource. + * + * @param {string} projectAssetName + * A fully-qualified path representing project_asset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAssetName(projectAssetName: string) { + return this.pathTemplates.projectAssetPathTemplate.match(projectAssetName) + .project; + } + + /** + * Parse the asset from ProjectAsset resource. + * + * @param {string} projectAssetName + * A fully-qualified path representing project_asset resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromProjectAssetName(projectAssetName: string) { + return this.pathTemplates.projectAssetPathTemplate.match(projectAssetName) + .asset; + } + + /** + * Return a fully-qualified projectAssetSecurityMarks resource name string. + * + * @param {string} project + * @param {string} asset + * @returns {string} Resource name string. + */ + projectAssetSecurityMarksPath(project: string, asset: string) { + return this.pathTemplates.projectAssetSecurityMarksPathTemplate.render({ + project: project, + asset: asset, + }); + } + + /** + * Parse the project from ProjectAssetSecurityMarks resource. + * + * @param {string} projectAssetSecurityMarksName + * A fully-qualified path representing project_asset_securityMarks resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAssetSecurityMarksName( + projectAssetSecurityMarksName: string + ) { + return this.pathTemplates.projectAssetSecurityMarksPathTemplate.match( + projectAssetSecurityMarksName + ).project; + } + + /** + * Parse the asset from ProjectAssetSecurityMarks resource. + * + * @param {string} projectAssetSecurityMarksName + * A fully-qualified path representing project_asset_securityMarks resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromProjectAssetSecurityMarksName( + projectAssetSecurityMarksName: string + ) { + return this.pathTemplates.projectAssetSecurityMarksPathTemplate.match( + projectAssetSecurityMarksName + ).asset; + } + + /** + * Return a fully-qualified projectSource resource name string. + * + * @param {string} project * @param {string} source * @returns {string} Resource name string. */ - sourcePath(organization: string, source: string) { - return this.pathTemplates.sourcePathTemplate.render({ - organization: organization, + projectSourcePath(project: string, source: string) { + return this.pathTemplates.projectSourcePathTemplate.render({ + project: project, source: source, }); } /** - * Parse the organization from Source resource. + * Parse the project from ProjectSource resource. * - * @param {string} sourceName - * A fully-qualified path representing Source resource. - * @returns {string} A string representing the organization. + * @param {string} projectSourceName + * A fully-qualified path representing project_source resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSourceName(projectSourceName: string) { + return this.pathTemplates.projectSourcePathTemplate.match(projectSourceName) + .project; + } + + /** + * Parse the source from ProjectSource resource. + * + * @param {string} projectSourceName + * A fully-qualified path representing project_source resource. + * @returns {string} A string representing the source. + */ + matchSourceFromProjectSourceName(projectSourceName: string) { + return this.pathTemplates.projectSourcePathTemplate.match(projectSourceName) + .source; + } + + /** + * Return a fully-qualified projectSourceFinding resource name string. + * + * @param {string} project + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + projectSourceFindingPath(project: string, source: string, finding: string) { + return this.pathTemplates.projectSourceFindingPathTemplate.render({ + project: project, + source: source, + finding: finding, + }); + } + + /** + * Parse the project from ProjectSourceFinding resource. + * + * @param {string} projectSourceFindingName + * A fully-qualified path representing project_source_finding resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSourceFindingName(projectSourceFindingName: string) { + return this.pathTemplates.projectSourceFindingPathTemplate.match( + projectSourceFindingName + ).project; + } + + /** + * Parse the source from ProjectSourceFinding resource. + * + * @param {string} projectSourceFindingName + * A fully-qualified path representing project_source_finding resource. + * @returns {string} A string representing the source. */ - matchOrganizationFromSourceName(sourceName: string) { - return this.pathTemplates.sourcePathTemplate.match(sourceName).organization; + matchSourceFromProjectSourceFindingName(projectSourceFindingName: string) { + return this.pathTemplates.projectSourceFindingPathTemplate.match( + projectSourceFindingName + ).source; + } + + /** + * Parse the finding from ProjectSourceFinding resource. + * + * @param {string} projectSourceFindingName + * A fully-qualified path representing project_source_finding resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromProjectSourceFindingName(projectSourceFindingName: string) { + return this.pathTemplates.projectSourceFindingPathTemplate.match( + projectSourceFindingName + ).finding; + } + + /** + * Return a fully-qualified projectSourceFindingSecurityMarks resource name string. + * + * @param {string} project + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + projectSourceFindingSecurityMarksPath( + project: string, + source: string, + finding: string + ) { + return this.pathTemplates.projectSourceFindingSecurityMarksPathTemplate.render( + { + project: project, + source: source, + finding: finding, + } + ); + } + + /** + * Parse the project from ProjectSourceFindingSecurityMarks resource. + * + * @param {string} projectSourceFindingSecurityMarksName + * A fully-qualified path representing project_source_finding_securityMarks resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSourceFindingSecurityMarksName( + projectSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.projectSourceFindingSecurityMarksPathTemplate.match( + projectSourceFindingSecurityMarksName + ).project; } /** - * Parse the source from Source resource. + * Parse the source from ProjectSourceFindingSecurityMarks resource. * - * @param {string} sourceName - * A fully-qualified path representing Source resource. + * @param {string} projectSourceFindingSecurityMarksName + * A fully-qualified path representing project_source_finding_securityMarks resource. * @returns {string} A string representing the source. */ - matchSourceFromSourceName(sourceName: string) { - return this.pathTemplates.sourcePathTemplate.match(sourceName).source; + matchSourceFromProjectSourceFindingSecurityMarksName( + projectSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.projectSourceFindingSecurityMarksPathTemplate.match( + projectSourceFindingSecurityMarksName + ).source; + } + + /** + * Parse the finding from ProjectSourceFindingSecurityMarks resource. + * + * @param {string} projectSourceFindingSecurityMarksName + * A fully-qualified path representing project_source_finding_securityMarks resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromProjectSourceFindingSecurityMarksName( + projectSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.projectSourceFindingSecurityMarksPathTemplate.match( + projectSourceFindingSecurityMarksName + ).finding; } /** diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json index 7c75af0ed9d..dcf14772dfb 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json +++ b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json @@ -1,6 +1,7 @@ [ "../../protos/google/cloud/securitycenter/v1/asset.proto", "../../protos/google/cloud/securitycenter/v1/finding.proto", + "../../protos/google/cloud/securitycenter/v1/folder.proto", "../../protos/google/cloud/securitycenter/v1/notification_config.proto", "../../protos/google/cloud/securitycenter/v1/notification_message.proto", "../../protos/google/cloud/securitycenter/v1/organization_settings.proto", diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts index 73a8a1594ab..0b3e41f46ca 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts @@ -4134,10 +4134,10 @@ describe('v1.SecurityCenterClient', () => { }); describe('Path templates', () => { - describe('asset', () => { - const fakePath = '/rendered/path/asset'; + describe('folderAsset', () => { + const fakePath = '/rendered/path/folderAsset'; const expectedParameters = { - organization: 'organizationValue', + folder: 'folderValue', asset: 'assetValue', }; const client = new securitycenterModule.v1.SecurityCenterClient({ @@ -4145,48 +4145,160 @@ describe('v1.SecurityCenterClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.assetPathTemplate.render = sinon + client.pathTemplates.folderAssetPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.assetPathTemplate.match = sinon + client.pathTemplates.folderAssetPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('assetPath', () => { - const result = client.assetPath('organizationValue', 'assetValue'); + it('folderAssetPath', () => { + const result = client.folderAssetPath('folderValue', 'assetValue'); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.assetPathTemplate.render as SinonStub) + (client.pathTemplates.folderAssetPathTemplate.render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchOrganizationFromAssetName', () => { - const result = client.matchOrganizationFromAssetName(fakePath); - assert.strictEqual(result, 'organizationValue'); + it('matchFolderFromFolderAssetName', () => { + const result = client.matchFolderFromFolderAssetName(fakePath); + assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.assetPathTemplate.match as SinonStub) + (client.pathTemplates.folderAssetPathTemplate.match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchAssetFromAssetName', () => { - const result = client.matchAssetFromAssetName(fakePath); + it('matchAssetFromFolderAssetName', () => { + const result = client.matchAssetFromFolderAssetName(fakePath); assert.strictEqual(result, 'assetValue'); assert( - (client.pathTemplates.assetPathTemplate.match as SinonStub) + (client.pathTemplates.folderAssetPathTemplate.match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); }); - describe('finding', () => { - const fakePath = '/rendered/path/finding'; + describe('folderAssetSecurityMarks', () => { + const fakePath = '/rendered/path/folderAssetSecurityMarks'; const expectedParameters = { - organization: 'organizationValue', + folder: 'folderValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderAssetSecurityMarksPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderAssetSecurityMarksPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderAssetSecurityMarksPath', () => { + const result = client.folderAssetSecurityMarksPath( + 'folderValue', + 'assetValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderAssetSecurityMarksPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderAssetSecurityMarksName', () => { + const result = + client.matchFolderFromFolderAssetSecurityMarksName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderAssetSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromFolderAssetSecurityMarksName', () => { + const result = + client.matchAssetFromFolderAssetSecurityMarksName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + ( + client.pathTemplates.folderAssetSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('folderSource', () => { + const fakePath = '/rendered/path/folderSource'; + const expectedParameters = { + folder: 'folderValue', + source: 'sourceValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderSourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderSourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderSourcePath', () => { + const result = client.folderSourcePath('folderValue', 'sourceValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderSourcePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderSourceName', () => { + const result = client.matchFolderFromFolderSourceName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderSourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromFolderSourceName', () => { + const result = client.matchSourceFromFolderSourceName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + (client.pathTemplates.folderSourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('folderSourceFinding', () => { + const fakePath = '/rendered/path/folderSourceFinding'; + const expectedParameters = { + folder: 'folderValue', source: 'sourceValue', finding: 'findingValue', }; @@ -4195,52 +4307,141 @@ describe('v1.SecurityCenterClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.findingPathTemplate.render = sinon + client.pathTemplates.folderSourceFindingPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.findingPathTemplate.match = sinon + client.pathTemplates.folderSourceFindingPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('findingPath', () => { - const result = client.findingPath( - 'organizationValue', + it('folderSourceFindingPath', () => { + const result = client.folderSourceFindingPath( + 'folderValue', 'sourceValue', 'findingValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.findingPathTemplate.render as SinonStub) + ( + client.pathTemplates.folderSourceFindingPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchOrganizationFromFindingName', () => { - const result = client.matchOrganizationFromFindingName(fakePath); - assert.strictEqual(result, 'organizationValue'); + it('matchFolderFromFolderSourceFindingName', () => { + const result = client.matchFolderFromFolderSourceFindingName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromFolderSourceFindingName', () => { + const result = client.matchSourceFromFolderSourceFindingName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates.folderSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromFolderSourceFindingName', () => { + const result = client.matchFindingFromFolderSourceFindingName(fakePath); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates.folderSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('folderSourceFindingSecurityMarks', () => { + const fakePath = '/rendered/path/folderSourceFindingSecurityMarks'; + const expectedParameters = { + folder: 'folderValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderSourceFindingSecurityMarksPath', () => { + const result = client.folderSourceFindingSecurityMarksPath( + 'folderValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderSourceFindingSecurityMarksName', () => { + const result = + client.matchFolderFromFolderSourceFindingSecurityMarksName(fakePath); + assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.findingPathTemplate.match as SinonStub) + ( + client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); - it('matchSourceFromFindingName', () => { - const result = client.matchSourceFromFindingName(fakePath); + it('matchSourceFromFolderSourceFindingSecurityMarksName', () => { + const result = + client.matchSourceFromFolderSourceFindingSecurityMarksName(fakePath); assert.strictEqual(result, 'sourceValue'); assert( - (client.pathTemplates.findingPathTemplate.match as SinonStub) + ( + client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); - it('matchFindingFromFindingName', () => { - const result = client.matchFindingFromFindingName(fakePath); + it('matchFindingFromFolderSourceFindingSecurityMarksName', () => { + const result = + client.matchFindingFromFolderSourceFindingSecurityMarksName(fakePath); assert.strictEqual(result, 'findingValue'); assert( - (client.pathTemplates.findingPathTemplate.match as SinonStub) + ( + client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -4348,6 +4549,68 @@ describe('v1.SecurityCenterClient', () => { }); }); + describe('organizationAsset', () => { + const fakePath = '/rendered/path/organizationAsset'; + const expectedParameters = { + organization: 'organizationValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationAssetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationAssetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationAssetPath', () => { + const result = client.organizationAssetPath( + 'organizationValue', + 'assetValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationAssetPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationAssetName', () => { + const result = + client.matchOrganizationFromOrganizationAssetName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationAssetPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromOrganizationAssetName', () => { + const result = client.matchAssetFromOrganizationAssetName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + ( + client.pathTemplates.organizationAssetPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('organizationAssetSecurityMarks', () => { const fakePath = '/rendered/path/organizationAssetSecurityMarks'; const expectedParameters = { @@ -4456,34 +4719,33 @@ describe('v1.SecurityCenterClient', () => { }); }); - describe('organizationSourceFindingSecurityMarks', () => { - const fakePath = '/rendered/path/organizationSourceFindingSecurityMarks'; + describe('organizationSource', () => { + const fakePath = '/rendered/path/organizationSource'; const expectedParameters = { organization: 'organizationValue', source: 'sourceValue', - finding: 'findingValue', }; const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match = - sinon.stub().returns(expectedParameters); + client.pathTemplates.organizationSourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationSourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); - it('organizationSourceFindingSecurityMarksPath', () => { - const result = client.organizationSourceFindingSecurityMarksPath( + it('organizationSourcePath', () => { + const result = client.organizationSourcePath( 'organizationValue', - 'sourceValue', - 'findingValue' + 'sourceValue' ); assert.strictEqual(result, fakePath); assert( ( - client.pathTemplates - .organizationSourceFindingSecurityMarksPathTemplate + client.pathTemplates.organizationSourcePathTemplate .render as SinonStub ) .getCall(-1) @@ -4491,16 +4753,13 @@ describe('v1.SecurityCenterClient', () => { ); }); - it('matchOrganizationFromOrganizationSourceFindingSecurityMarksName', () => { + it('matchOrganizationFromOrganizationSourceName', () => { const result = - client.matchOrganizationFromOrganizationSourceFindingSecurityMarksName( - fakePath - ); + client.matchOrganizationFromOrganizationSourceName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( ( - client.pathTemplates - .organizationSourceFindingSecurityMarksPathTemplate + client.pathTemplates.organizationSourcePathTemplate .match as SinonStub ) .getCall(-1) @@ -4508,33 +4767,12 @@ describe('v1.SecurityCenterClient', () => { ); }); - it('matchSourceFromOrganizationSourceFindingSecurityMarksName', () => { - const result = - client.matchSourceFromOrganizationSourceFindingSecurityMarksName( - fakePath - ); + it('matchSourceFromOrganizationSourceName', () => { + const result = client.matchSourceFromOrganizationSourceName(fakePath); assert.strictEqual(result, 'sourceValue'); assert( ( - client.pathTemplates - .organizationSourceFindingSecurityMarksPathTemplate - .match as SinonStub - ) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchFindingFromOrganizationSourceFindingSecurityMarksName', () => { - const result = - client.matchFindingFromOrganizationSourceFindingSecurityMarksName( - fakePath - ); - assert.strictEqual(result, 'findingValue'); - assert( - ( - client.pathTemplates - .organizationSourceFindingSecurityMarksPathTemplate + client.pathTemplates.organizationSourcePathTemplate .match as SinonStub ) .getCall(-1) @@ -4543,49 +4781,486 @@ describe('v1.SecurityCenterClient', () => { }); }); - describe('source', () => { - const fakePath = '/rendered/path/source'; + describe('organizationSourceFinding', () => { + const fakePath = '/rendered/path/organizationSourceFinding'; const expectedParameters = { organization: 'organizationValue', source: 'sourceValue', + finding: 'findingValue', }; const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.sourcePathTemplate.render = sinon + client.pathTemplates.organizationSourceFindingPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.sourcePathTemplate.match = sinon + client.pathTemplates.organizationSourceFindingPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('sourcePath', () => { - const result = client.sourcePath('organizationValue', 'sourceValue'); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.sourcePathTemplate.render as SinonStub) - .getCall(-1) + it('organizationSourceFindingPath', () => { + const result = client.organizationSourceFindingPath( + 'organizationValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationSourceFindingPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationSourceFindingName', () => { + const result = + client.matchOrganizationFromOrganizationSourceFindingName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromOrganizationSourceFindingName', () => { + const result = + client.matchSourceFromOrganizationSourceFindingName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates.organizationSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromOrganizationSourceFindingName', () => { + const result = + client.matchFindingFromOrganizationSourceFindingName(fakePath); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates.organizationSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationSourceFindingSecurityMarks', () => { + const fakePath = '/rendered/path/organizationSourceFindingSecurityMarks'; + const expectedParameters = { + organization: 'organizationValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationSourceFindingSecurityMarksPath', () => { + const result = client.organizationSourceFindingSecurityMarksPath( + 'organizationValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .render as SinonStub + ) + .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchOrganizationFromSourceName', () => { - const result = client.matchOrganizationFromSourceName(fakePath); + it('matchOrganizationFromOrganizationSourceFindingSecurityMarksName', () => { + const result = + client.matchOrganizationFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.sourcePathTemplate.match as SinonStub) + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromOrganizationSourceFindingSecurityMarksName', () => { + const result = + client.matchSourceFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromOrganizationSourceFindingSecurityMarksName', () => { + const result = + client.matchFindingFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAsset', () => { + const fakePath = '/rendered/path/projectAsset'; + const expectedParameters = { + project: 'projectValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAssetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAssetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAssetPath', () => { + const result = client.projectAssetPath('projectValue', 'assetValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAssetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAssetName', () => { + const result = client.matchProjectFromProjectAssetName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAssetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromProjectAssetName', () => { + const result = client.matchAssetFromProjectAssetName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + (client.pathTemplates.projectAssetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAssetSecurityMarks', () => { + const fakePath = '/rendered/path/projectAssetSecurityMarks'; + const expectedParameters = { + project: 'projectValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAssetSecurityMarksPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAssetSecurityMarksPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAssetSecurityMarksPath', () => { + const result = client.projectAssetSecurityMarksPath( + 'projectValue', + 'assetValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectAssetSecurityMarksPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAssetSecurityMarksName', () => { + const result = + client.matchProjectFromProjectAssetSecurityMarksName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectAssetSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromProjectAssetSecurityMarksName', () => { + const result = + client.matchAssetFromProjectAssetSecurityMarksName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + ( + client.pathTemplates.projectAssetSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectSource', () => { + const fakePath = '/rendered/path/projectSource'; + const expectedParameters = { + project: 'projectValue', + source: 'sourceValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectSourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectSourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectSourcePath', () => { + const result = client.projectSourcePath('projectValue', 'sourceValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectSourcePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectSourceName', () => { + const result = client.matchProjectFromProjectSourceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectSourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromProjectSourceName', () => { + const result = client.matchSourceFromProjectSourceName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + (client.pathTemplates.projectSourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectSourceFinding', () => { + const fakePath = '/rendered/path/projectSourceFinding'; + const expectedParameters = { + project: 'projectValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectSourceFindingPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectSourceFindingPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectSourceFindingPath', () => { + const result = client.projectSourceFindingPath( + 'projectValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectSourceFindingPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectSourceFindingName', () => { + const result = + client.matchProjectFromProjectSourceFindingName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromProjectSourceFindingName', () => { + const result = client.matchSourceFromProjectSourceFindingName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates.projectSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromProjectSourceFindingName', () => { + const result = + client.matchFindingFromProjectSourceFindingName(fakePath); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates.projectSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectSourceFindingSecurityMarks', () => { + const fakePath = '/rendered/path/projectSourceFindingSecurityMarks'; + const expectedParameters = { + project: 'projectValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectSourceFindingSecurityMarksPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectSourceFindingSecurityMarksPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectSourceFindingSecurityMarksPath', () => { + const result = client.projectSourceFindingSecurityMarksPath( + 'projectValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectSourceFindingSecurityMarksPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectSourceFindingSecurityMarksName', () => { + const result = + client.matchProjectFromProjectSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); - it('matchSourceFromSourceName', () => { - const result = client.matchSourceFromSourceName(fakePath); + it('matchSourceFromProjectSourceFindingSecurityMarksName', () => { + const result = + client.matchSourceFromProjectSourceFindingSecurityMarksName(fakePath); assert.strictEqual(result, 'sourceValue'); assert( - (client.pathTemplates.sourcePathTemplate.match as SinonStub) + ( + client.pathTemplates.projectSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromProjectSourceFindingSecurityMarksName', () => { + const result = + client.matchFindingFromProjectSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates.projectSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) );