From 5eddc7d6efeb19bdd01eeba13505b8290763a790 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 18 Feb 2022 00:56:46 +0000 Subject: [PATCH] docs(samples): include metadata file, add exclusions for samples to handwritten libraries (#1229) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 429395631 Source-Link: https://github.com/googleapis/googleapis/commit/84594b35af0c38efcd6967e8179d801702ad96ff Source-Link: https://github.com/googleapis/googleapis-gen/commit/ed74f970fd82914874e6b27b04763cfa66bafe9b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWQ3NGY5NzBmZDgyOTE0ODc0ZTZiMjdiMDQ3NjNjZmE2NmJhZmU5YiJ9 feat: Update Logging API with latest changes PiperOrigin-RevId: 429289471 Source-Link: https://github.com/googleapis/googleapis/commit/acd5f89b8addd2ff54f41a7d43ff9b122bb43337 Source-Link: https://github.com/googleapis/googleapis-gen/commit/8a12622536ae2e9a8978198a151e89234b839b20 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOGExMjYyMjUzNmFlMmU5YTg5NzgxOThhMTUxZTg5MjM0YjgzOWIyMCJ9 --- protos/google/logging/v2/log_entry.proto | 50 +- protos/google/logging/v2/logging.proto | 114 +- protos/google/logging/v2/logging_config.proto | 758 +- .../google/logging/v2/logging_metrics.proto | 18 +- protos/protos.d.ts | 4757 +++-- protos/protos.js | 15359 ++++++++++------ protos/protos.json | 527 +- .../v2/config_service_v2.copy_log_entries.js | 69 + .../v2/config_service_v2.create_bucket.js | 19 +- .../v2/config_service_v2.create_exclusion.js | 12 +- .../v2/config_service_v2.create_sink.js | 18 +- .../v2/config_service_v2.create_view.js | 14 +- .../v2/config_service_v2.delete_bucket.js | 12 +- .../v2/config_service_v2.delete_exclusion.js | 11 +- .../v2/config_service_v2.delete_sink.js | 11 +- .../v2/config_service_v2.delete_view.js | 12 +- .../v2/config_service_v2.get_bucket.js | 12 +- .../v2/config_service_v2.get_cmek_settings.js | 18 +- .../v2/config_service_v2.get_exclusion.js | 11 +- .../v2/config_service_v2.get_settings.js | 66 + .../v2/config_service_v2.get_sink.js | 11 +- .../v2/config_service_v2.get_view.js | 12 +- .../v2/config_service_v2.list_buckets.js | 22 +- .../v2/config_service_v2.list_exclusions.js | 8 +- .../v2/config_service_v2.list_sinks.js | 8 +- .../v2/config_service_v2.list_views.js | 16 +- .../v2/config_service_v2.undelete_bucket.js | 12 +- .../v2/config_service_v2.update_bucket.js | 22 +- .../config_service_v2.update_cmek_settings.js | 21 +- .../v2/config_service_v2.update_exclusion.js | 11 +- .../v2/config_service_v2.update_settings.js | 78 + .../v2/config_service_v2.update_sink.js | 19 +- .../v2/config_service_v2.update_view.js | 14 +- .../v2/logging_service_v2.delete_log.js | 18 +- .../v2/logging_service_v2.list_log_entries.js | 34 +- .../v2/logging_service_v2.list_logs.js | 32 +- ..._v2.list_monitored_resource_descriptors.js | 8 +- .../v2/logging_service_v2.tail_log_entries.js | 24 +- .../logging_service_v2.write_log_entries.js | 22 +- .../metrics_service_v2.create_log_metric.js | 8 +- .../metrics_service_v2.delete_log_metric.js | 8 +- .../v2/metrics_service_v2.get_log_metric.js | 8 +- .../v2/metrics_service_v2.list_log_metrics.js | 8 +- .../metrics_service_v2.update_log_metric.js | 8 +- .../snippet_metadata.google.logging.v2.json | 1691 ++ src/v2/config_service_v2_client.ts | 828 +- src/v2/config_service_v2_client_config.json | 12 + src/v2/gapic_metadata.json | 30 + src/v2/logging_service_v2_client.ts | 325 +- src/v2/metrics_service_v2_client.ts | 121 +- test/gapic_config_service_v2_v2.ts | 1073 +- test/gapic_logging_service_v2_v2.ts | 215 +- test/gapic_metrics_service_v2_v2.ts | 249 +- 53 files changed, 18868 insertions(+), 7976 deletions(-) create mode 100644 samples/generated/v2/config_service_v2.copy_log_entries.js create mode 100644 samples/generated/v2/config_service_v2.get_settings.js create mode 100644 samples/generated/v2/config_service_v2.update_settings.js create mode 100644 samples/generated/v2/snippet_metadata.google.logging.v2.json diff --git a/protos/google/logging/v2/log_entry.proto b/protos/google/logging/v2/log_entry.proto index 3ad2cfbb..23c9e3c5 100644 --- a/protos/google/logging/v2/log_entry.proto +++ b/protos/google/logging/v2/log_entry.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2022 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,7 @@ syntax = "proto3"; package google.logging.v2; +import "google/api/annotations.proto"; import "google/api/field_behavior.proto"; import "google/api/monitored_resource.proto"; import "google/api/resource.proto"; @@ -24,8 +25,6 @@ import "google/logging/type/log_severity.proto"; import "google/protobuf/any.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; -import "google/api/annotations.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Logging.V2"; @@ -37,8 +36,6 @@ option php_namespace = "Google\\Cloud\\Logging\\V2"; option ruby_package = "Google::Cloud::Logging::V2"; // An individual entry in a log. -// -// message LogEntry { option (google.api.resource) = { type: "logging.googleapis.com/Log" @@ -62,12 +59,13 @@ message LogEntry { // // `[LOG_ID]` must be URL-encoded within `log_name`. Example: // `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. + // // `[LOG_ID]` must be less than 512 characters long and can only include the // following characters: upper and lower case alphanumeric characters, // forward-slash, underscore, hyphen, and period. // // For backward compatibility, if `log_name` begins with a forward-slash, such - // as `/projects/...`, then the log entry is ingested as usual but the + // as `/projects/...`, then the log entry is ingested as usual, but the // forward-slash is removed. Listing the log entry will not show the leading // slash and filtering for a log name with a leading slash will never return // any results. @@ -126,7 +124,7 @@ message LogEntry { // de-duplication in the export of logs. // // If the `insert_id` is omitted when writing a log entry, the Logging API - // assigns its own unique identifier in this field. + // assigns its own unique identifier in this field. // // In queries, the `insert_id` is also used to order log entries that have // the same `log_name` and `timestamp` values. @@ -136,8 +134,20 @@ message LogEntry { // applicable. google.logging.type.HttpRequest http_request = 7 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A set of user-defined (key, value) data that provides additional - // information about the log entry. + // Optional. A map of key, value pairs that provides additional information about the + // log entry. The labels can be user-defined or system-defined. + // + // User-defined labels are arbitrary key, value pairs that you can use to + // classify logs. + // + // System-defined labels are defined by GCP services for platform logs. + // They have two components - a service namespace component and the + // attribute name. For example: `compute.googleapis.com/resource_name`. + // + // Cloud Logging truncates label keys that exceed 512 B and label + // values that exceed 64 KB upon their associated log entry being + // written. The truncation is indicated by an ellipsis at the + // end of the character string. map labels = 11 [(google.api.field_behavior) = OPTIONAL]; // Optional. Information about an operation associated with the log entry, if @@ -168,6 +178,10 @@ message LogEntry { // Optional. Source code location information associated with the log entry, if any. LogEntrySourceLocation source_location = 23 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Information indicating this LogEntry is part of a sequence of multiple log + // entries split from a single LogEntry. + LogSplit split = 35 [(google.api.field_behavior) = OPTIONAL]; } // Additional information about a potentially long-running operation with which @@ -208,3 +222,21 @@ message LogEntrySourceLocation { // (Python). string function = 3 [(google.api.field_behavior) = OPTIONAL]; } + +// Additional information used to correlate multiple log entries. Used when a +// single LogEntry would exceed the Google Cloud Logging size limit and is +// split across multiple log entries. +message LogSplit { + // A globally unique identifier for all log entries in a sequence of split log + // entries. All log entries with the same |LogSplit.uid| are assumed to be + // part of the same sequence of split log entries. + string uid = 1; + + // The index of this LogEntry in the sequence of split log entries. Log + // entries are given |index| values 0, 1, ..., n-1 for a sequence of n log + // entries. + int32 index = 2; + + // The total number of log entries that the original LogEntry was split into. + int32 total_splits = 3; +} diff --git a/protos/google/logging/v2/logging.proto b/protos/google/logging/v2/logging.proto index f8b01a71..bacc5d08 100644 --- a/protos/google/logging/v2/logging.proto +++ b/protos/google/logging/v2/logging.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2022 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,7 @@ syntax = "proto3"; package google.logging.v2; +import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/monitored_resource.proto"; @@ -27,7 +28,6 @@ import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/status.proto"; -import "google/api/annotations.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Logging.V2"; @@ -48,10 +48,10 @@ service LoggingServiceV2 { "https://www.googleapis.com/auth/logging.read," "https://www.googleapis.com/auth/logging.write"; - // Deletes all the log entries in a log. The log reappears if it receives new - // entries. Log entries written shortly before the delete operation might not - // be deleted. Entries received after the delete operation with a timestamp - // before the operation will be deleted. + // Deletes all the log entries in a log for the _Default Log Bucket. The log + // reappears if it receives new entries. Log entries written shortly before + // the delete operation might not be deleted. Entries received after the + // delete operation with a timestamp before the operation will be deleted. rpc DeleteLog(DeleteLogRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v2/{log_name=projects/*/logs/*}" @@ -140,14 +140,15 @@ service LoggingServiceV2 { message DeleteLogRequest { // Required. The resource name of the log to delete: // - // "projects/[PROJECT_ID]/logs/[LOG_ID]" - // "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" - // "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" - // "folders/[FOLDER_ID]/logs/[LOG_ID]" + // * `projects/[PROJECT_ID]/logs/[LOG_ID]` + // * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` + // * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` + // * `folders/[FOLDER_ID]/logs/[LOG_ID]` // // `[LOG_ID]` must be URL-encoded. For example, // `"projects/my-project-id/logs/syslog"`, - // `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. + // `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`. + // // For more information about log names, see // [LogEntry][google.logging.v2.LogEntry]. string log_name = 1 [ @@ -163,15 +164,15 @@ message WriteLogEntriesRequest { // Optional. A default log resource name that is assigned to all log entries // in `entries` that do not specify a value for `log_name`: // - // "projects/[PROJECT_ID]/logs/[LOG_ID]" - // "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" - // "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" - // "folders/[FOLDER_ID]/logs/[LOG_ID]" + // * `projects/[PROJECT_ID]/logs/[LOG_ID]` + // * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` + // * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` + // * `folders/[FOLDER_ID]/logs/[LOG_ID]` // // `[LOG_ID]` must be URL-encoded. For example: // // "projects/my-project-id/logs/syslog" - // "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity" + // "organizations/123/logs/cloudaudit.googleapis.com%2Factivity" // // The permission `logging.logEntries.create` is needed on each project, // organization, billing account, or folder that is receiving new log @@ -214,14 +215,14 @@ message WriteLogEntriesRequest { // the entries later in the list. See the `entries.list` method. // // Log entries with timestamps that are more than the - // [logs retention period](https://cloud.google.com/logging/quota-policy) in + // [logs retention period](https://cloud.google.com/logging/quotas) in // the past or more than 24 hours in the future will not be available when // calling `entries.list`. However, those log entries can still be [exported // with // LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). // // To improve throughput and to avoid exceeding the - // [quota limit](https://cloud.google.com/logging/quota-policy) for calls to + // [quota limit](https://cloud.google.com/logging/quotas) for calls to // `entries.write`, you should try to include several log entries in this // list, rather than calling this method for each individual log entry. repeated LogEntry entries = 4 [(google.api.field_behavior) = REQUIRED]; @@ -258,16 +259,17 @@ message ListLogEntriesRequest { // Required. Names of one or more parent resources from which to // retrieve log entries: // - // "projects/[PROJECT_ID]" - // "organizations/[ORGANIZATION_ID]" - // "billingAccounts/[BILLING_ACCOUNT_ID]" - // "folders/[FOLDER_ID]" + // * `projects/[PROJECT_ID]` + // * `organizations/[ORGANIZATION_ID]` + // * `billingAccounts/[BILLING_ACCOUNT_ID]` + // * `folders/[FOLDER_ID]` + // + // May alternatively be one or more views: // - // May alternatively be one or more views - // projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] - // organization/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] - // billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] - // folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] + // * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + // * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + // * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + // * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` // // Projects listed in the `project_ids` field are added to this list. repeated string resource_names = 8 [ @@ -294,10 +296,10 @@ message ListLogEntriesRequest { // timestamps are returned in order of their `insert_id` values. string order_by = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The maximum number of results to return from this request. - // Default is 50. If the value is negative or exceeds 1000, - // the request is rejected. The presence of `next_page_token` in the - // response indicates that more results might be available. + // Optional. The maximum number of results to return from this request. Default is 50. + // If the value is negative or exceeds 1000, the request is rejected. The + // presence of `next_page_token` in the response indicates that more results + // might be available. int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; // Optional. If present, then retrieve the next batch of results from the @@ -356,10 +358,10 @@ message ListMonitoredResourceDescriptorsResponse { message ListLogsRequest { // Required. The resource name that owns the logs: // - // "projects/[PROJECT_ID]" - // "organizations/[ORGANIZATION_ID]" - // "billingAccounts/[BILLING_ACCOUNT_ID]" - // "folders/[FOLDER_ID]" + // * `projects/[PROJECT_ID]` + // * `organizations/[ORGANIZATION_ID]` + // * `billingAccounts/[BILLING_ACCOUNT_ID]` + // * `folders/[FOLDER_ID]` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -379,17 +381,24 @@ message ListLogsRequest { string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. The resource name that owns the logs: - // projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] - // organization/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] - // billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] - // folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] + // + // * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + // * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + // * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + // * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` // // To support legacy queries, it could also be: - // "projects/[PROJECT_ID]" - // "organizations/[ORGANIZATION_ID]" - // "billingAccounts/[BILLING_ACCOUNT_ID]" - // "folders/[FOLDER_ID]" - repeated string resource_names = 8 [(google.api.field_behavior) = OPTIONAL]; + // + // * `projects/[PROJECT_ID]` + // * `organizations/[ORGANIZATION_ID]` + // * `billingAccounts/[BILLING_ACCOUNT_ID]` + // * `folders/[FOLDER_ID]` + repeated string resource_names = 8 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + child_type: "logging.googleapis.com/Log" + } + ]; } // Result returned from ListLogs. @@ -409,16 +418,17 @@ message ListLogsResponse { message TailLogEntriesRequest { // Required. Name of a parent resource from which to retrieve log entries: // - // "projects/[PROJECT_ID]" - // "organizations/[ORGANIZATION_ID]" - // "billingAccounts/[BILLING_ACCOUNT_ID]" - // "folders/[FOLDER_ID]" + // * `projects/[PROJECT_ID]` + // * `organizations/[ORGANIZATION_ID]` + // * `billingAccounts/[BILLING_ACCOUNT_ID]` + // * `folders/[FOLDER_ID]` // // May alternatively be one or more views: - // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" - // "organization/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" - // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" - // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" + // + // * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + // * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + // * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + // * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` repeated string resource_names = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. A filter that chooses which log entries to return. See [Advanced diff --git a/protos/google/logging/v2/logging_config.proto b/protos/google/logging/v2/logging_config.proto index 9b10932d..63d604ab 100644 --- a/protos/google/logging/v2/logging_config.proto +++ b/protos/google/logging/v2/logging_config.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2022 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,14 +16,15 @@ syntax = "proto3"; package google.logging.v2; +import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Logging.V2"; @@ -33,6 +34,7 @@ option java_outer_classname = "LoggingConfigProto"; option java_package = "com.google.logging.v2"; option php_namespace = "Google\\Cloud\\Logging\\V2"; option ruby_package = "Google::Cloud::Logging::V2"; + option (google.api.resource_definition) = { type: "logging.googleapis.com/OrganizationLocation" pattern: "organizations/{organization}/locations/{location}" @@ -45,7 +47,6 @@ option (google.api.resource_definition) = { type: "logging.googleapis.com/BillingAccountLocation" pattern: "billingAccounts/{billing_account}/locations/{location}" }; - // Service for configuring sinks used to route log entries. service ConfigServiceV2 { option (google.api.default_host) = "logging.googleapis.com"; @@ -55,7 +56,7 @@ service ConfigServiceV2 { "https://www.googleapis.com/auth/logging.admin," "https://www.googleapis.com/auth/logging.read"; - // Lists buckets. + // Lists log buckets. rpc ListBuckets(ListBucketsRequest) returns (ListBucketsResponse) { option (google.api.http) = { get: "/v2/{parent=*/*/locations/*}/buckets" @@ -75,7 +76,7 @@ service ConfigServiceV2 { option (google.api.method_signature) = "parent"; } - // Gets a bucket. + // Gets a log bucket. rpc GetBucket(GetBucketRequest) returns (LogBucket) { option (google.api.http) = { get: "/v2/{name=*/*/locations/*/buckets/*}" @@ -94,8 +95,8 @@ service ConfigServiceV2 { }; } - // Creates a bucket that can be used to store log entries. Once a bucket has - // been created, the region cannot be changed. + // Creates a log bucket that can be used to store log entries. After a bucket + // has been created, the bucket's location cannot be changed. rpc CreateBucket(CreateBucketRequest) returns (LogBucket) { option (google.api.http) = { post: "/v2/{parent=*/*/locations/*}/buckets" @@ -119,16 +120,16 @@ service ConfigServiceV2 { }; } - // Updates a bucket. This method replaces the following fields in the + // Updates a log bucket. This method replaces the following fields in the // existing bucket with values from the new bucket: `retention_period` // // If the retention period is decreased and the bucket is locked, - // FAILED_PRECONDITION will be returned. + // `FAILED_PRECONDITION` will be returned. // - // If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION - // will be returned. + // If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then + // `FAILED_PRECONDITION` will be returned. // - // A buckets region may not be modified after it is created. + // After a bucket has been created, the bucket's location cannot be changed. rpc UpdateBucket(UpdateBucketRequest) returns (LogBucket) { option (google.api.http) = { patch: "/v2/{name=*/*/locations/*/buckets/*}" @@ -152,10 +153,11 @@ service ConfigServiceV2 { }; } - // Deletes a bucket. - // Moves the bucket to the DELETE_REQUESTED state. After 7 days, the - // bucket will be purged and all logs in the bucket will be permanently - // deleted. + // Deletes a log bucket. + // + // Changes the bucket's `lifecycle_state` to the `DELETE_REQUESTED` state. + // After 7 days, the bucket will be purged and all log entries in the bucket + // will be permanently deleted. rpc DeleteBucket(DeleteBucketRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v2/{name=*/*/locations/*/buckets/*}" @@ -174,8 +176,8 @@ service ConfigServiceV2 { }; } - // Undeletes a bucket. A bucket that has been deleted may be undeleted within - // the grace period of 7 days. + // Undeletes a log bucket. A bucket that has been deleted can be undeleted + // within the grace period of 7 days. rpc UndeleteBucket(UndeleteBucketRequest) returns (google.protobuf.Empty) { option (google.api.http) = { post: "/v2/{name=*/*/locations/*/buckets/*}:undelete" @@ -199,7 +201,7 @@ service ConfigServiceV2 { }; } - // Lists views on a bucket. + // Lists views on a log bucket. rpc ListViews(ListViewsRequest) returns (ListViewsResponse) { option (google.api.http) = { get: "/v2/{parent=*/*/locations/*/buckets/*}/views" @@ -219,7 +221,7 @@ service ConfigServiceV2 { option (google.api.method_signature) = "parent"; } - // Gets a view. + // Gets a view on a log bucket.. rpc GetView(GetViewRequest) returns (LogView) { option (google.api.http) = { get: "/v2/{name=*/*/locations/*/buckets/*/views/*}" @@ -238,8 +240,8 @@ service ConfigServiceV2 { }; } - // Creates a view over logs in a bucket. A bucket may contain a maximum of - // 50 views. + // Creates a view over log entries in a log bucket. A bucket may contain a + // maximum of 30 views. rpc CreateView(CreateViewRequest) returns (LogView) { option (google.api.http) = { post: "/v2/{parent=*/*/locations/*/buckets/*}/views" @@ -263,8 +265,11 @@ service ConfigServiceV2 { }; } - // Updates a view. This method replaces the following fields in the existing - // view with values from the new view: `filter`. + // Updates a view on a log bucket. This method replaces the following fields + // in the existing view with values from the new view: `filter`. + // If an `UNAVAILABLE` error is returned, this indicates that system is not in + // a state where it can update the view. If this occurs, please try again in a + // few minutes. rpc UpdateView(UpdateViewRequest) returns (LogView) { option (google.api.http) = { patch: "/v2/{name=*/*/locations/*/buckets/*/views/*}" @@ -288,7 +293,10 @@ service ConfigServiceV2 { }; } - // Deletes a view from a bucket. + // Deletes a view on a log bucket. + // If an `UNAVAILABLE` error is returned, this indicates that system is not in + // a state where it can delete the view. If this occurs, please try again in a + // few minutes. rpc DeleteView(DeleteViewRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v2/{name=*/*/locations/*/buckets/*/views/*}" @@ -442,7 +450,7 @@ service ConfigServiceV2 { option (google.api.method_signature) = "sink_name"; } - // Lists all the exclusions in a parent resource. + // Lists all the exclusions on the _Default sink in a parent resource. rpc ListExclusions(ListExclusionsRequest) returns (ListExclusionsResponse) { option (google.api.http) = { get: "/v2/{parent=*/*}/exclusions" @@ -462,7 +470,7 @@ service ConfigServiceV2 { option (google.api.method_signature) = "parent"; } - // Gets the description of an exclusion. + // Gets the description of an exclusion in the _Default sink. rpc GetExclusion(GetExclusionRequest) returns (LogExclusion) { option (google.api.http) = { get: "/v2/{name=*/*/exclusions/*}" @@ -482,9 +490,9 @@ service ConfigServiceV2 { option (google.api.method_signature) = "name"; } - // Creates a new exclusion in a specified parent resource. - // Only log entries belonging to that resource can be excluded. - // You can have up to 10 exclusions in a resource. + // Creates a new exclusion in the _Default sink in a specified parent + // resource. Only log entries belonging to that resource can be excluded. You + // can have up to 10 exclusions in a resource. rpc CreateExclusion(CreateExclusionRequest) returns (LogExclusion) { option (google.api.http) = { post: "/v2/{parent=*/*}/exclusions" @@ -509,7 +517,8 @@ service ConfigServiceV2 { option (google.api.method_signature) = "parent,exclusion"; } - // Changes one or more properties of an existing exclusion. + // Changes one or more properties of an existing exclusion in the _Default + // sink. rpc UpdateExclusion(UpdateExclusionRequest) returns (LogExclusion) { option (google.api.http) = { patch: "/v2/{name=*/*/exclusions/*}" @@ -534,7 +543,7 @@ service ConfigServiceV2 { option (google.api.method_signature) = "name,exclusion,update_mask"; } - // Deletes an exclusion. + // Deletes an exclusion in the _Default sink. rpc DeleteExclusion(DeleteExclusionRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v2/{name=*/*/exclusions/*}" @@ -554,29 +563,39 @@ service ConfigServiceV2 { option (google.api.method_signature) = "name"; } - // Gets the Logs Router CMEK settings for the given resource. + // Gets the Logging CMEK settings for the given resource. // - // Note: CMEK for the Logs Router can currently only be configured for GCP - // organizations. Once configured, it applies to all projects and folders in - // the GCP organization. + // Note: CMEK for the Log Router can be configured for Google Cloud projects, + // folders, organizations and billing accounts. Once configured for an + // organization, it applies to all projects and folders in the Google Cloud + // organization. // - // See [Enabling CMEK for Logs + // See [Enabling CMEK for Log // Router](https://cloud.google.com/logging/docs/routing/managed-encryption) // for more information. rpc GetCmekSettings(GetCmekSettingsRequest) returns (CmekSettings) { option (google.api.http) = { get: "/v2/{name=*/*}/cmekSettings" + additional_bindings { + get: "/v2/{name=projects/*}/cmekSettings" + } additional_bindings { get: "/v2/{name=organizations/*}/cmekSettings" } + additional_bindings { + get: "/v2/{name=folders/*}/cmekSettings" + } + additional_bindings { + get: "/v2/{name=billingAccounts/*}/cmekSettings" + } }; } - // Updates the Logs Router CMEK settings for the given resource. + // Updates the Log Router CMEK settings for the given resource. // - // Note: CMEK for the Logs Router can currently only be configured for GCP - // organizations. Once configured, it applies to all projects and folders in - // the GCP organization. + // Note: CMEK for the Log Router can currently only be configured for Google + // Cloud organizations. Once configured, it applies to all projects and + // folders in the Google Cloud organization. // // [UpdateCmekSettings][google.logging.v2.ConfigServiceV2.UpdateCmekSettings] // will fail if 1) `kms_key_name` is invalid, or 2) the associated service @@ -584,7 +603,7 @@ service ConfigServiceV2 { // `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or // 3) access to the key is disabled. // - // See [Enabling CMEK for Logs + // See [Enabling CMEK for Log // Router](https://cloud.google.com/logging/docs/routing/managed-encryption) // for more information. rpc UpdateCmekSettings(UpdateCmekSettingsRequest) returns (CmekSettings) { @@ -597,9 +616,82 @@ service ConfigServiceV2 { } }; } + + // Gets the Log Router settings for the given resource. + // + // Note: Settings for the Log Router can be get for Google Cloud projects, + // folders, organizations and billing accounts. Currently it can only be + // configured for organizations. Once configured for an organization, it + // applies to all projects and folders in the Google Cloud organization. + // + // See [Enabling CMEK for Log + // Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + // for more information. + rpc GetSettings(GetSettingsRequest) returns (Settings) { + option (google.api.http) = { + get: "/v2/{name=*/*}/settings" + additional_bindings { + get: "/v2/{name=projects/*}/settings" + } + additional_bindings { + get: "/v2/{name=organizations/*}/settings" + } + additional_bindings { + get: "/v2/{name=folders/*}/settings" + } + additional_bindings { + get: "/v2/{name=billingAccounts/*}/settings" + } + }; + option (google.api.method_signature) = "name"; + } + + // Updates the Log Router settings for the given resource. + // + // Note: Settings for the Log Router can currently only be configured for + // Google Cloud organizations. Once configured, it applies to all projects and + // folders in the Google Cloud organization. + // + // [UpdateSettings][google.logging.v2.ConfigServiceV2.UpdateSettings] + // will fail if 1) `kms_key_name` is invalid, or 2) the associated service + // account does not have the required + // `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or + // 3) access to the key is disabled. 4) `location_id` is not supported by + // Logging. 5) `location_id` violate OrgPolicy. + // + // See [Enabling CMEK for Log + // Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + // for more information. + rpc UpdateSettings(UpdateSettingsRequest) returns (Settings) { + option (google.api.http) = { + patch: "/v2/{name=*/*}/settings" + body: "settings" + additional_bindings { + patch: "/v2/{name=organizations/*}/settings" + body: "settings" + } + additional_bindings { + patch: "/v2/{name=folders/*}/settings" + body: "settings" + } + }; + option (google.api.method_signature) = "settings,update_mask"; + } + + // Copies a set of log entries from a log bucket to a Cloud Storage bucket. + rpc CopyLogEntries(CopyLogEntriesRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/entries:copy" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "CopyLogEntriesResponse" + metadata_type: "CopyLogEntriesMetadata" + }; + } } -// Describes a repository of logs. +// Describes a repository in which log entries are stored. message LogBucket { option (google.api.resource) = { type: "logging.googleapis.com/LogBucket" @@ -609,16 +701,20 @@ message LogBucket { pattern: "billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}" }; - // The resource name of the bucket. + // Output only. The resource name of the bucket. + // // For example: - // "projects/my-project-id/locations/my-location/buckets/my-bucket-id The - // supported locations are: - // "global" // - // For the location of `global` it is unspecified where logs are actually - // stored. - // Once a bucket has been created, the location can not be changed. - string name = 1; + // `projects/my-project/locations/global/buckets/my-bucket` + // + // For a list of supported locations, see [Supported + // Regions](https://cloud.google.com/logging/docs/region-support) + // + // For the location of `global` it is unspecified where log entries are + // actually stored. + // + // After a bucket has been created, the location cannot be changed. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // Describes this bucket. string description = 3; @@ -631,34 +727,38 @@ message LogBucket { google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; // Logs will be retained by default for this amount of time, after which they - // will automatically be deleted. The minimum retention period is 1 day. - // If this value is set to zero at bucket creation time, the default time of - // 30 days will be used. + // will automatically be deleted. The minimum retention period is 1 day. If + // this value is set to zero at bucket creation time, the default time of 30 + // days will be used. int32 retention_days = 11; - // Whether the bucket has been locked. - // The retention period on a locked bucket may not be changed. - // Locked buckets may only be deleted if they are empty. + // Whether the bucket is locked. + // + // The retention period on a locked bucket cannot be changed. Locked buckets + // may only be deleted if they are empty. bool locked = 9; // Output only. The bucket lifecycle state. LifecycleState lifecycle_state = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; -} -// LogBucket lifecycle states. -enum LifecycleState { - // Unspecified state. This is only used/useful for distinguishing - // unset values. - LIFECYCLE_STATE_UNSPECIFIED = 0; - - // The normal and active state. - ACTIVE = 1; + // Log entry field paths that are denied access in this bucket. + // + // The following fields and their children are eligible: `textPayload`, + // `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`. + // + // Restricting a repeated field will restrict all values. Adding a parent will + // block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`) + repeated string restricted_fields = 15; - // The bucket has been marked for deletion by the user. - DELETE_REQUESTED = 2; + // The CMEK settings of the log bucket. If present, new log entries written to + // this log bucket are encrypted using the CMEK key provided in this + // configuration. If a log bucket has CMEK settings, the CMEK settings cannot + // be disabled later by updating the log bucket. Changing the KMS key is + // allowed. + CmekSettings cmek_settings = 19; } -// Describes a view over logs in a bucket. +// Describes a view over log entries in a bucket. message LogView { option (google.api.resource) = { type: "logging.googleapis.com/LogView" @@ -669,8 +769,10 @@ message LogView { }; // The resource name of the view. - // For example - // "projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view + // + // For example: + // + // `projects/my-project/locations/global/buckets/my-bucket/views/my-view` string name = 1; // Describes this view. @@ -683,21 +785,27 @@ message LogView { google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; // Filter that restricts which log entries in a bucket are visible in this - // view. Filters are restricted to be a logical AND of ==/!= of any of the + // view. + // + // Filters are restricted to be a logical AND of ==/!= of any of the // following: - // originating project/folder/organization/billing account. - // resource type - // log id - // Example: SOURCE("projects/myproject") AND resource.type = "gce_instance" - // AND LOG_ID("stdout") + // + // - originating project/folder/organization/billing account. + // - resource type + // - log id + // + // For example: + // + // SOURCE("projects/myproject") AND resource.type = "gce_instance" + // AND LOG_ID("stdout") string filter = 7; } // Describes a sink used to export log entries to one of the following -// destinations in any project: a Cloud Storage bucket, a BigQuery dataset, or a -// Cloud Pub/Sub topic. A logs filter controls which log entries are exported. -// The sink must be created within a project, organization, billing account, or -// folder. +// destinations in any project: a Cloud Storage bucket, a BigQuery dataset, a +// Pub/Sub topic or a Cloud Logging log bucket. A logs filter controls which log +// entries are exported. The sink must be created within a project, +// organization, billing account, or folder. message LogSink { option (google.api.resource) = { type: "logging.googleapis.com/LogSink" @@ -719,9 +827,10 @@ message LogSink { V1 = 2; } - // Required. The client-assigned sink identifier, unique within the project. Example: - // `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited to 100 - // characters and can include only the following characters: upper and + // Required. The client-assigned sink identifier, unique within the project. + // + // For example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited + // to 100 characters and can include only the following characters: upper and // lower-case alphanumeric characters, underscores, hyphens, and periods. // First character has to be alphanumeric. string name = 1 [(google.api.field_behavior) = REQUIRED]; @@ -732,9 +841,9 @@ message LogSink { // "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]" // "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]" // - // The sink's `writer_identity`, set when the sink is created, must - // have permission to write to the destination or else the log - // entries are not exported. For more information, see + // The sink's `writer_identity`, set when the sink is created, must have + // permission to write to the destination or else the log entries are not + // exported. For more information, see // [Exporting Logs with // Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). string destination = 3 [ @@ -747,20 +856,24 @@ message LogSink { // Optional. An [advanced logs // filter](https://cloud.google.com/logging/docs/view/advanced-queries). The // only exported log entries are those that are in the resource owning the - // sink and that match the filter. For example: + // sink and that match the filter. + // + // For example: // - // logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR + // `logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR` string filter = 5 [(google.api.field_behavior) = OPTIONAL]; // Optional. A description of this sink. + // // The maximum length of the description is 8000 characters. string description = 18 [(google.api.field_behavior) = OPTIONAL]; - // Optional. If set to True, then this sink is disabled and it does not - // export any log entries. + // Optional. If set to true, then this sink is disabled and it does not export any log + // entries. bool disabled = 19 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Log entries that match any of the exclusion filters will not be exported. + // Optional. Log entries that match any of these exclusion filters will not be exported. + // // If a log entry is matched by both `filter` and one of `exclusion_filters` // it will not be exported. repeated LogExclusion exclusions = 16 [(google.api.field_behavior) = OPTIONAL]; @@ -768,33 +881,42 @@ message LogSink { // Deprecated. This field is unused. VersionFormat output_version_format = 6 [deprecated = true]; - // Output only. An IAM identity—a service account or group—under which Logging - // writes the exported log entries to the sink's destination. This field is - // set by [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and + // Output only. An IAM identity—a service account or group—under which Cloud + // Logging writes the exported log entries to the sink's destination. This + // field is set by + // [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and // [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the // value of `unique_writer_identity` in those methods. // // Until you grant this identity write-access to the destination, log entry - // exports from this sink will fail. For more information, - // see [Granting Access for a + // exports from this sink will fail. For more information, see [Granting + // Access for a // Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource). // Consult the destination service's documentation to determine the // appropriate IAM roles to assign to the identity. + // + // Sinks that have a destination that is a log bucket in the same project as + // the sink do not have a writer_identity and no additional permissions are + // required. string writer_identity = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Optional. This field applies only to sinks owned by organizations and - // folders. If the field is false, the default, only the logs owned by the - // sink's parent resource are available for export. If the field is true, then - // logs from all the projects, folders, and billing accounts contained in the + // Optional. This field applies only to sinks owned by organizations and folders. If the + // field is false, the default, only the logs owned by the sink's parent + // resource are available for export. If the field is true, then log entries + // from all the projects, folders, and billing accounts contained in the // sink's parent resource are also available for export. Whether a particular // log entry from the children is exported depends on the sink's filter - // expression. For example, if this field is true, then the filter + // expression. + // + // For example, if this field is true, then the filter // `resource.type=gce_instance` would export all Compute Engine VM instance - // log entries from all projects in the sink's parent. To only export entries - // from certain child projects, filter on the project part of the log name: + // log entries from all projects in the sink's parent. + // + // To only export entries from certain child projects, filter on the project + // part of the log name: // - // logName:("projects/test-project1/" OR "projects/test-project2/") AND - // resource.type=gce_instance + // logName:("projects/test-project1/" OR "projects/test-project2/") AND + // resource.type=gce_instance bool include_children = 9 [(google.api.field_behavior) = OPTIONAL]; // Destination dependent options. @@ -818,16 +940,17 @@ message LogSink { message BigQueryOptions { // Optional. Whether to use [BigQuery's partition // tables](https://cloud.google.com/bigquery/docs/partitioned-tables). By - // default, Logging creates dated tables based on the log entries' timestamps, - // e.g. syslog_20170523. With partitioned tables the date suffix is no longer - // present and [special query + // default, Cloud Logging creates dated tables based on the log entries' + // timestamps, e.g. syslog_20170523. With partitioned tables the date suffix + // is no longer present and [special query // syntax](https://cloud.google.com/bigquery/docs/querying-partitioned-tables) // has to be used instead. In both cases, tables are sharded based on UTC // timezone. bool use_partitioned_tables = 1 [(google.api.field_behavior) = OPTIONAL]; - // Output only. True if new timestamp column based partitioning is in use, - // false if legacy ingestion-time partitioning is in use. + // Output only. True if new timestamp column based partitioning is in use, false if legacy + // ingestion-time partitioning is in use. + // // All new sinks will have this field set true and will use timestamp column // based partitioning. If use_partitioned_tables is false, this value has no // meaning and will be false. Legacy sinks using partitioned tables will have @@ -854,15 +977,15 @@ message ListBucketsRequest { } ]; - // Optional. If present, then retrieve the next batch of results from the - // preceding call to this method. `pageToken` must be the value of - // `nextPageToken` from the previous response. The values of other method - // parameters should be identical to those in the previous call. + // Optional. If present, then retrieve the next batch of results from the preceding call + // to this method. `pageToken` must be the value of `nextPageToken` from the + // previous response. The values of other method parameters should be + // identical to those in the previous call. string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The maximum number of results to return from this request. - // Non-positive values are ignored. The presence of `nextPageToken` in the - // response indicates that more results might be available. + // Optional. The maximum number of results to return from this request. Non-positive + // values are ignored. The presence of `nextPageToken` in the response + // indicates that more results might be available. int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; } @@ -879,11 +1002,13 @@ message ListBucketsResponse { // The parameters to `CreateBucket`. message CreateBucketRequest { - // Required. The resource in which to create the bucket: + // Required. The resource in which to create the log bucket: // // "projects/[PROJECT_ID]/locations/[LOCATION_ID]" // - // Example: `"projects/my-logging-project/locations/global"` + // For example: + // + // `"projects/my-project/locations/global"` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -891,9 +1016,9 @@ message CreateBucketRequest { } ]; - // Required. A client-assigned identifier such as `"my-bucket"`. Identifiers are - // limited to 100 characters and can include only letters, digits, - // underscores, hyphens, and periods. + // Required. A client-assigned identifier such as `"my-bucket"`. Identifiers are limited + // to 100 characters and can include only letters, digits, underscores, + // hyphens, and periods. string bucket_id = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The new bucket. The region specified in the new bucket must be compliant @@ -911,10 +1036,9 @@ message UpdateBucketRequest { // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // - // Example: - // `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`. Also - // requires permission "resourcemanager.projects.updateLiens" to set the - // locked property + // For example: + // + // `"projects/my-project/locations/global/buckets/my-bucket"` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -926,13 +1050,13 @@ message UpdateBucketRequest { LogBucket bucket = 2 [(google.api.field_behavior) = REQUIRED]; // Required. Field mask that specifies the fields in `bucket` that need an update. A - // bucket field will be overwritten if, and only if, it is in the update - // mask. `name` and output only fields cannot be updated. + // bucket field will be overwritten if, and only if, it is in the update mask. + // `name` and output only fields cannot be updated. // - // For a detailed `FieldMask` definition, see + // For a detailed `FieldMask` definition, see: // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask // - // Example: `updateMask=retention_days`. + // For example: `updateMask=retention_days` google.protobuf.FieldMask update_mask = 4 [(google.api.field_behavior) = REQUIRED]; } @@ -945,8 +1069,9 @@ message GetBucketRequest { // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // - // Example: - // `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`. + // For example: + // + // `"projects/my-project/locations/global/buckets/my-bucket"` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -964,8 +1089,9 @@ message DeleteBucketRequest { // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // - // Example: - // `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`. + // For example: + // + // `"projects/my-project/locations/global/buckets/my-bucket"` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -983,8 +1109,9 @@ message UndeleteBucketRequest { // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // - // Example: - // `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`. + // For example: + // + // `"projects/my-project/locations/global/buckets/my-bucket"` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1000,13 +1127,14 @@ message ListViewsRequest { // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" string parent = 1 [(google.api.field_behavior) = REQUIRED]; - // Optional. If present, then retrieve the next batch of results from the - // preceding call to this method. `pageToken` must be the value of - // `nextPageToken` from the previous response. The values of other method - // parameters should be identical to those in the previous call. + // Optional. If present, then retrieve the next batch of results from the preceding call + // to this method. `pageToken` must be the value of `nextPageToken` from the + // previous response. The values of other method parameters should be + // identical to those in the previous call. string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. The maximum number of results to return from this request. + // // Non-positive values are ignored. The presence of `nextPageToken` in the // response indicates that more results might be available. int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; @@ -1027,10 +1155,11 @@ message ListViewsResponse { message CreateViewRequest { // Required. The bucket in which to create the view // - // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"` // - // Example: - // `"projects/my-logging-project/locations/my-location/buckets/my-bucket"` + // For example: + // + // `"projects/my-project/locations/global/buckets/my-bucket"` string parent = 1 [(google.api.field_behavior) = REQUIRED]; // Required. The id to use for this view. @@ -1046,8 +1175,9 @@ message UpdateViewRequest { // // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" // - // Example: - // `"projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id"`. + // For example: + // + // `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` string name = 1 [(google.api.field_behavior) = REQUIRED]; // Required. The updated view. @@ -1060,7 +1190,7 @@ message UpdateViewRequest { // For a detailed `FieldMask` definition, see // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask // - // Example: `updateMask=filter`. + // For example: `updateMask=filter` google.protobuf.FieldMask update_mask = 4 [(google.api.field_behavior) = OPTIONAL]; } @@ -1070,8 +1200,9 @@ message GetViewRequest { // // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" // - // Example: - // `"projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id"`. + // For example: + // + // `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1086,8 +1217,9 @@ message DeleteViewRequest { // // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" // - // Example: - // `"projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id"`. + // For example: + // + // `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1143,7 +1275,9 @@ message GetSinkRequest { // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" // "folders/[FOLDER_ID]/sinks/[SINK_ID]" // - // Example: `"projects/my-project-id/sinks/my-sink-id"`. + // For example: + // + // `"projects/my-project/sinks/my-sink"` string sink_name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1161,7 +1295,10 @@ message CreateSinkRequest { // "billingAccounts/[BILLING_ACCOUNT_ID]" // "folders/[FOLDER_ID]" // - // Examples: `"projects/my-logging-project"`, `"organizations/123456789"`. + // For examples: + // + // `"projects/my-project"` + // `"organizations/123456789"` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1176,9 +1313,9 @@ message CreateSinkRequest { // Optional. Determines the kind of IAM identity returned as `writer_identity` // in the new sink. If this value is omitted or set to false, and if the // sink's parent is a project, then the value returned as `writer_identity` is - // the same group or service account used by Logging before the addition of - // writer identities to this API. The sink's destination must be in the same - // project as the sink itself. + // the same group or service account used by Cloud Logging before the addition + // of writer identities to this API. The sink's destination must be in the + // same project as the sink itself. // // If this field is set to true, or if the sink is owned by a non-project // resource such as an organization, then the value of `writer_identity` will @@ -1197,7 +1334,9 @@ message UpdateSinkRequest { // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" // "folders/[FOLDER_ID]/sinks/[SINK_ID]" // - // Example: `"projects/my-project-id/sinks/my-sink-id"`. + // For example: + // + // `"projects/my-project/sinks/my-sink"` string sink_name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1226,16 +1365,18 @@ message UpdateSinkRequest { // an update. A sink field will be overwritten if, and only if, it is // in the update mask. `name` and output only fields cannot be updated. // - // An empty updateMask is temporarily treated as using the following mask + // An empty `updateMask` is temporarily treated as using the following mask // for backwards compatibility purposes: - // destination,filter,includeChildren + // + // `destination,filter,includeChildren` + // // At some point in the future, behavior will be removed and specifying an - // empty updateMask will be an error. + // empty `updateMask` will be an error. // // For a detailed `FieldMask` definition, see // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask // - // Example: `updateMask=filter`. + // For example: `updateMask=filter` google.protobuf.FieldMask update_mask = 4 [(google.api.field_behavior) = OPTIONAL]; } @@ -1249,7 +1390,9 @@ message DeleteSinkRequest { // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" // "folders/[FOLDER_ID]/sinks/[SINK_ID]" // - // Example: `"projects/my-project-id/sinks/my-sink-id"`. + // For example: + // + // `"projects/my-project/sinks/my-sink"` string sink_name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1258,12 +1401,11 @@ message DeleteSinkRequest { ]; } -// Specifies a set of log entries that are not to be stored in -// Logging. If your GCP resource receives a large volume of logs, you can -// use exclusions to reduce your chargeable logs. Exclusions are -// processed after log sinks, so you can export log entries before they are -// excluded. Note that organization-level and folder-level exclusions don't -// apply to child resources, and that you can't exclude audit log entries. +// Specifies a set of log entries that are filtered out by a sink. If +// your Google Cloud resource receives a large volume of log entries, you can +// use exclusions to reduce your chargeable logs. Note that exclusions on +// organization-level and folder-level sinks don't apply to child resources. +// Note also that you cannot modify the _Required sink or exclude logs from it. message LogExclusion { option (google.api.resource) = { type: "logging.googleapis.com/LogExclusion" @@ -1287,10 +1429,11 @@ message LogExclusion { // matches the log entries to be excluded. By using the [sample // function](https://cloud.google.com/logging/docs/view/advanced-queries#sample), // you can exclude less than 100% of the matching log entries. - // For example, the following query matches 99% of low-severity log - // entries from Google Cloud Storage buckets: // - // `"resource.type=gcs_bucket severity; + + /** + * Calls GetSettings. + * @param request GetSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Settings + */ + public getSettings(request: google.logging.v2.IGetSettingsRequest, callback: google.logging.v2.ConfigServiceV2.GetSettingsCallback): void; + + /** + * Calls GetSettings. + * @param request GetSettingsRequest message or plain object + * @returns Promise + */ + public getSettings(request: google.logging.v2.IGetSettingsRequest): Promise; + + /** + * Calls UpdateSettings. + * @param request UpdateSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Settings + */ + public updateSettings(request: google.logging.v2.IUpdateSettingsRequest, callback: google.logging.v2.ConfigServiceV2.UpdateSettingsCallback): void; + + /** + * Calls UpdateSettings. + * @param request UpdateSettingsRequest message or plain object + * @returns Promise + */ + public updateSettings(request: google.logging.v2.IUpdateSettingsRequest): Promise; + + /** + * Calls CopyLogEntries. + * @param request CopyLogEntriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public copyLogEntries(request: google.logging.v2.ICopyLogEntriesRequest, callback: google.logging.v2.ConfigServiceV2.CopyLogEntriesCallback): void; + + /** + * Calls CopyLogEntries. + * @param request CopyLogEntriesRequest message or plain object + * @returns Promise + */ + public copyLogEntries(request: google.logging.v2.ICopyLogEntriesRequest): Promise; } namespace ConfigServiceV2 { @@ -6459,6 +6612,27 @@ export namespace google { * @param [response] CmekSettings */ type UpdateCmekSettingsCallback = (error: (Error|null), response?: google.logging.v2.CmekSettings) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2#getSettings}. + * @param error Error, if any + * @param [response] Settings + */ + type GetSettingsCallback = (error: (Error|null), response?: google.logging.v2.Settings) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2#updateSettings}. + * @param error Error, if any + * @param [response] Settings + */ + type UpdateSettingsCallback = (error: (Error|null), response?: google.logging.v2.Settings) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2#copyLogEntries}. + * @param error Error, if any + * @param [response] Operation + */ + type CopyLogEntriesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } /** Properties of a LogBucket. */ @@ -6484,6 +6658,12 @@ export namespace google { /** LogBucket lifecycleState */ lifecycleState?: (google.logging.v2.LifecycleState|keyof typeof google.logging.v2.LifecycleState|null); + + /** LogBucket restrictedFields */ + restrictedFields?: (string[]|null); + + /** LogBucket cmekSettings */ + cmekSettings?: (google.logging.v2.ICmekSettings|null); } /** Represents a LogBucket. */ @@ -6516,6 +6696,12 @@ export namespace google { /** LogBucket lifecycleState. */ public lifecycleState: (google.logging.v2.LifecycleState|keyof typeof google.logging.v2.LifecycleState); + /** LogBucket restrictedFields. */ + public restrictedFields: string[]; + + /** LogBucket cmekSettings. */ + public cmekSettings?: (google.logging.v2.ICmekSettings|null); + /** * Creates a new LogBucket instance using the specified properties. * @param [properties] Properties to set @@ -6587,13 +6773,6 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** LifecycleState enum. */ - enum LifecycleState { - LIFECYCLE_STATE_UNSPECIFIED = 0, - ACTIVE = 1, - DELETE_REQUESTED = 2 - } - /** Properties of a LogView. */ interface ILogView { @@ -9805,1186 +9984,1822 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** Represents a MetricsServiceV2 */ - class MetricsServiceV2 extends $protobuf.rpc.Service { + /** Properties of a GetSettingsRequest. */ + interface IGetSettingsRequest { + + /** GetSettingsRequest name */ + name?: (string|null); + } + + /** Represents a GetSettingsRequest. */ + class GetSettingsRequest implements IGetSettingsRequest { /** - * Constructs a new MetricsServiceV2 service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited + * Constructs a new GetSettingsRequest. + * @param [properties] Properties to set */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + constructor(properties?: google.logging.v2.IGetSettingsRequest); + + /** GetSettingsRequest name. */ + public name: string; /** - * Creates new MetricsServiceV2 service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. + * Creates a new GetSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSettingsRequest instance */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): MetricsServiceV2; + public static create(properties?: google.logging.v2.IGetSettingsRequest): google.logging.v2.GetSettingsRequest; /** - * Calls ListLogMetrics. - * @param request ListLogMetricsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListLogMetricsResponse + * Encodes the specified GetSettingsRequest message. Does not implicitly {@link google.logging.v2.GetSettingsRequest.verify|verify} messages. + * @param message GetSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public listLogMetrics(request: google.logging.v2.IListLogMetricsRequest, callback: google.logging.v2.MetricsServiceV2.ListLogMetricsCallback): void; + public static encode(message: google.logging.v2.IGetSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ListLogMetrics. - * @param request ListLogMetricsRequest message or plain object - * @returns Promise + * Encodes the specified GetSettingsRequest message, length delimited. Does not implicitly {@link google.logging.v2.GetSettingsRequest.verify|verify} messages. + * @param message GetSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public listLogMetrics(request: google.logging.v2.IListLogMetricsRequest): Promise; + public static encodeDelimited(message: google.logging.v2.IGetSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls GetLogMetric. - * @param request GetLogMetricRequest message or plain object - * @param callback Node-style callback called with the error, if any, and LogMetric + * Decodes a GetSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public getLogMetric(request: google.logging.v2.IGetLogMetricRequest, callback: google.logging.v2.MetricsServiceV2.GetLogMetricCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.logging.v2.GetSettingsRequest; /** - * Calls GetLogMetric. - * @param request GetLogMetricRequest message or plain object - * @returns Promise + * Decodes a GetSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public getLogMetric(request: google.logging.v2.IGetLogMetricRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.logging.v2.GetSettingsRequest; /** - * Calls CreateLogMetric. - * @param request CreateLogMetricRequest message or plain object - * @param callback Node-style callback called with the error, if any, and LogMetric + * Verifies a GetSettingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public createLogMetric(request: google.logging.v2.ICreateLogMetricRequest, callback: google.logging.v2.MetricsServiceV2.CreateLogMetricCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls CreateLogMetric. - * @param request CreateLogMetricRequest message or plain object - * @returns Promise + * Creates a GetSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSettingsRequest */ - public createLogMetric(request: google.logging.v2.ICreateLogMetricRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.logging.v2.GetSettingsRequest; /** - * Calls UpdateLogMetric. - * @param request UpdateLogMetricRequest message or plain object - * @param callback Node-style callback called with the error, if any, and LogMetric + * Creates a plain object from a GetSettingsRequest message. Also converts values to other types if specified. + * @param message GetSettingsRequest + * @param [options] Conversion options + * @returns Plain object */ - public updateLogMetric(request: google.logging.v2.IUpdateLogMetricRequest, callback: google.logging.v2.MetricsServiceV2.UpdateLogMetricCallback): void; + public static toObject(message: google.logging.v2.GetSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls UpdateLogMetric. - * @param request UpdateLogMetricRequest message or plain object - * @returns Promise + * Converts this GetSettingsRequest to JSON. + * @returns JSON object */ - public updateLogMetric(request: google.logging.v2.IUpdateLogMetricRequest): Promise; + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateSettingsRequest. */ + interface IUpdateSettingsRequest { + + /** UpdateSettingsRequest name */ + name?: (string|null); + + /** UpdateSettingsRequest settings */ + settings?: (google.logging.v2.ISettings|null); + + /** UpdateSettingsRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateSettingsRequest. */ + class UpdateSettingsRequest implements IUpdateSettingsRequest { /** - * Calls DeleteLogMetric. - * @param request DeleteLogMetricRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Constructs a new UpdateSettingsRequest. + * @param [properties] Properties to set */ - public deleteLogMetric(request: google.logging.v2.IDeleteLogMetricRequest, callback: google.logging.v2.MetricsServiceV2.DeleteLogMetricCallback): void; + constructor(properties?: google.logging.v2.IUpdateSettingsRequest); + + /** UpdateSettingsRequest name. */ + public name: string; + + /** UpdateSettingsRequest settings. */ + public settings?: (google.logging.v2.ISettings|null); + + /** UpdateSettingsRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Calls DeleteLogMetric. - * @param request DeleteLogMetricRequest message or plain object - * @returns Promise + * Creates a new UpdateSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSettingsRequest instance */ - public deleteLogMetric(request: google.logging.v2.IDeleteLogMetricRequest): Promise; - } - - namespace MetricsServiceV2 { + public static create(properties?: google.logging.v2.IUpdateSettingsRequest): google.logging.v2.UpdateSettingsRequest; /** - * Callback as used by {@link google.logging.v2.MetricsServiceV2#listLogMetrics}. - * @param error Error, if any - * @param [response] ListLogMetricsResponse + * Encodes the specified UpdateSettingsRequest message. Does not implicitly {@link google.logging.v2.UpdateSettingsRequest.verify|verify} messages. + * @param message UpdateSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type ListLogMetricsCallback = (error: (Error|null), response?: google.logging.v2.ListLogMetricsResponse) => void; + public static encode(message: google.logging.v2.IUpdateSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.logging.v2.MetricsServiceV2#getLogMetric}. - * @param error Error, if any - * @param [response] LogMetric + * Encodes the specified UpdateSettingsRequest message, length delimited. Does not implicitly {@link google.logging.v2.UpdateSettingsRequest.verify|verify} messages. + * @param message UpdateSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type GetLogMetricCallback = (error: (Error|null), response?: google.logging.v2.LogMetric) => void; + public static encodeDelimited(message: google.logging.v2.IUpdateSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.logging.v2.MetricsServiceV2#createLogMetric}. - * @param error Error, if any - * @param [response] LogMetric + * Decodes an UpdateSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type CreateLogMetricCallback = (error: (Error|null), response?: google.logging.v2.LogMetric) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.logging.v2.UpdateSettingsRequest; /** - * Callback as used by {@link google.logging.v2.MetricsServiceV2#updateLogMetric}. - * @param error Error, if any - * @param [response] LogMetric + * Decodes an UpdateSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type UpdateLogMetricCallback = (error: (Error|null), response?: google.logging.v2.LogMetric) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.logging.v2.UpdateSettingsRequest; /** - * Callback as used by {@link google.logging.v2.MetricsServiceV2#deleteLogMetric}. - * @param error Error, if any - * @param [response] Empty + * Verifies an UpdateSettingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type DeleteLogMetricCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - } + public static verify(message: { [k: string]: any }): (string|null); - /** Properties of a LogMetric. */ - interface ILogMetric { + /** + * Creates an UpdateSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.UpdateSettingsRequest; - /** LogMetric name */ - name?: (string|null); + /** + * Creates a plain object from an UpdateSettingsRequest message. Also converts values to other types if specified. + * @param message UpdateSettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.UpdateSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** LogMetric description */ - description?: (string|null); - - /** LogMetric filter */ - filter?: (string|null); - - /** LogMetric metricDescriptor */ - metricDescriptor?: (google.api.IMetricDescriptor|null); - - /** LogMetric valueExtractor */ - valueExtractor?: (string|null); - - /** LogMetric labelExtractors */ - labelExtractors?: ({ [k: string]: string }|null); + /** + * Converts this UpdateSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** LogMetric bucketOptions */ - bucketOptions?: (google.api.Distribution.IBucketOptions|null); + /** Properties of a Settings. */ + interface ISettings { - /** LogMetric createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** Settings name */ + name?: (string|null); - /** LogMetric updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** Settings storageLocation */ + storageLocation?: (string|null); - /** LogMetric version */ - version?: (google.logging.v2.LogMetric.ApiVersion|keyof typeof google.logging.v2.LogMetric.ApiVersion|null); + /** Settings disableDefaultSink */ + disableDefaultSink?: (boolean|null); } - /** Represents a LogMetric. */ - class LogMetric implements ILogMetric { + /** Represents a Settings. */ + class Settings implements ISettings { /** - * Constructs a new LogMetric. + * Constructs a new Settings. * @param [properties] Properties to set */ - constructor(properties?: google.logging.v2.ILogMetric); + constructor(properties?: google.logging.v2.ISettings); - /** LogMetric name. */ + /** Settings name. */ public name: string; - /** LogMetric description. */ - public description: string; - - /** LogMetric filter. */ - public filter: string; - - /** LogMetric metricDescriptor. */ - public metricDescriptor?: (google.api.IMetricDescriptor|null); - - /** LogMetric valueExtractor. */ - public valueExtractor: string; - - /** LogMetric labelExtractors. */ - public labelExtractors: { [k: string]: string }; - - /** LogMetric bucketOptions. */ - public bucketOptions?: (google.api.Distribution.IBucketOptions|null); - - /** LogMetric createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** Settings storageLocation. */ + public storageLocation: string; - /** LogMetric updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** LogMetric version. */ - public version: (google.logging.v2.LogMetric.ApiVersion|keyof typeof google.logging.v2.LogMetric.ApiVersion); + /** Settings disableDefaultSink. */ + public disableDefaultSink: boolean; /** - * Creates a new LogMetric instance using the specified properties. + * Creates a new Settings instance using the specified properties. * @param [properties] Properties to set - * @returns LogMetric instance + * @returns Settings instance */ - public static create(properties?: google.logging.v2.ILogMetric): google.logging.v2.LogMetric; + public static create(properties?: google.logging.v2.ISettings): google.logging.v2.Settings; /** - * Encodes the specified LogMetric message. Does not implicitly {@link google.logging.v2.LogMetric.verify|verify} messages. - * @param message LogMetric message or plain object to encode + * Encodes the specified Settings message. Does not implicitly {@link google.logging.v2.Settings.verify|verify} messages. + * @param message Settings message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.logging.v2.ILogMetric, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.logging.v2.ISettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified LogMetric message, length delimited. Does not implicitly {@link google.logging.v2.LogMetric.verify|verify} messages. - * @param message LogMetric message or plain object to encode + * Encodes the specified Settings message, length delimited. Does not implicitly {@link google.logging.v2.Settings.verify|verify} messages. + * @param message Settings message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.logging.v2.ILogMetric, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.logging.v2.ISettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a LogMetric message from the specified reader or buffer. + * Decodes a Settings message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns LogMetric + * @returns Settings * @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.logging.v2.LogMetric; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.logging.v2.Settings; /** - * Decodes a LogMetric message from the specified reader or buffer, length delimited. + * Decodes a Settings message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns LogMetric + * @returns Settings * @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.logging.v2.LogMetric; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.logging.v2.Settings; /** - * Verifies a LogMetric message. + * Verifies a Settings 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 LogMetric message from a plain object. Also converts values to their respective internal types. + * Creates a Settings message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns LogMetric + * @returns Settings */ - public static fromObject(object: { [k: string]: any }): google.logging.v2.LogMetric; + public static fromObject(object: { [k: string]: any }): google.logging.v2.Settings; /** - * Creates a plain object from a LogMetric message. Also converts values to other types if specified. - * @param message LogMetric + * Creates a plain object from a Settings message. Also converts values to other types if specified. + * @param message Settings * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.logging.v2.LogMetric, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.logging.v2.Settings, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this LogMetric to JSON. + * Converts this Settings to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace LogMetric { - - /** ApiVersion enum. */ - enum ApiVersion { - V2 = 0, - V1 = 1 - } - } + /** Properties of a CopyLogEntriesRequest. */ + interface ICopyLogEntriesRequest { - /** Properties of a ListLogMetricsRequest. */ - interface IListLogMetricsRequest { - - /** ListLogMetricsRequest parent */ - parent?: (string|null); + /** CopyLogEntriesRequest name */ + name?: (string|null); - /** ListLogMetricsRequest pageToken */ - pageToken?: (string|null); + /** CopyLogEntriesRequest filter */ + filter?: (string|null); - /** ListLogMetricsRequest pageSize */ - pageSize?: (number|null); + /** CopyLogEntriesRequest destination */ + destination?: (string|null); } - /** Represents a ListLogMetricsRequest. */ - class ListLogMetricsRequest implements IListLogMetricsRequest { + /** Represents a CopyLogEntriesRequest. */ + class CopyLogEntriesRequest implements ICopyLogEntriesRequest { /** - * Constructs a new ListLogMetricsRequest. + * Constructs a new CopyLogEntriesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.logging.v2.IListLogMetricsRequest); + constructor(properties?: google.logging.v2.ICopyLogEntriesRequest); - /** ListLogMetricsRequest parent. */ - public parent: string; + /** CopyLogEntriesRequest name. */ + public name: string; - /** ListLogMetricsRequest pageToken. */ - public pageToken: string; + /** CopyLogEntriesRequest filter. */ + public filter: string; - /** ListLogMetricsRequest pageSize. */ - public pageSize: number; + /** CopyLogEntriesRequest destination. */ + public destination: string; /** - * Creates a new ListLogMetricsRequest instance using the specified properties. + * Creates a new CopyLogEntriesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListLogMetricsRequest instance + * @returns CopyLogEntriesRequest instance */ - public static create(properties?: google.logging.v2.IListLogMetricsRequest): google.logging.v2.ListLogMetricsRequest; + public static create(properties?: google.logging.v2.ICopyLogEntriesRequest): google.logging.v2.CopyLogEntriesRequest; /** - * Encodes the specified ListLogMetricsRequest message. Does not implicitly {@link google.logging.v2.ListLogMetricsRequest.verify|verify} messages. - * @param message ListLogMetricsRequest message or plain object to encode + * Encodes the specified CopyLogEntriesRequest message. Does not implicitly {@link google.logging.v2.CopyLogEntriesRequest.verify|verify} messages. + * @param message CopyLogEntriesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.logging.v2.IListLogMetricsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.logging.v2.ICopyLogEntriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListLogMetricsRequest message, length delimited. Does not implicitly {@link google.logging.v2.ListLogMetricsRequest.verify|verify} messages. - * @param message ListLogMetricsRequest message or plain object to encode + * Encodes the specified CopyLogEntriesRequest message, length delimited. Does not implicitly {@link google.logging.v2.CopyLogEntriesRequest.verify|verify} messages. + * @param message CopyLogEntriesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.logging.v2.IListLogMetricsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.logging.v2.ICopyLogEntriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListLogMetricsRequest message from the specified reader or buffer. + * Decodes a CopyLogEntriesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListLogMetricsRequest + * @returns CopyLogEntriesRequest * @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.logging.v2.ListLogMetricsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.logging.v2.CopyLogEntriesRequest; /** - * Decodes a ListLogMetricsRequest message from the specified reader or buffer, length delimited. + * Decodes a CopyLogEntriesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListLogMetricsRequest + * @returns CopyLogEntriesRequest * @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.logging.v2.ListLogMetricsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.logging.v2.CopyLogEntriesRequest; /** - * Verifies a ListLogMetricsRequest message. + * Verifies a CopyLogEntriesRequest 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 ListLogMetricsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CopyLogEntriesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListLogMetricsRequest + * @returns CopyLogEntriesRequest */ - public static fromObject(object: { [k: string]: any }): google.logging.v2.ListLogMetricsRequest; + public static fromObject(object: { [k: string]: any }): google.logging.v2.CopyLogEntriesRequest; /** - * Creates a plain object from a ListLogMetricsRequest message. Also converts values to other types if specified. - * @param message ListLogMetricsRequest + * Creates a plain object from a CopyLogEntriesRequest message. Also converts values to other types if specified. + * @param message CopyLogEntriesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.logging.v2.ListLogMetricsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.logging.v2.CopyLogEntriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListLogMetricsRequest to JSON. + * Converts this CopyLogEntriesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListLogMetricsResponse. */ - interface IListLogMetricsResponse { + /** Properties of a CopyLogEntriesMetadata. */ + interface ICopyLogEntriesMetadata { - /** ListLogMetricsResponse metrics */ - metrics?: (google.logging.v2.ILogMetric[]|null); + /** CopyLogEntriesMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); - /** ListLogMetricsResponse nextPageToken */ - nextPageToken?: (string|null); + /** CopyLogEntriesMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** CopyLogEntriesMetadata state */ + state?: (google.logging.v2.OperationState|keyof typeof google.logging.v2.OperationState|null); + + /** CopyLogEntriesMetadata cancellationRequested */ + cancellationRequested?: (boolean|null); + + /** CopyLogEntriesMetadata request */ + request?: (google.logging.v2.ICopyLogEntriesRequest|null); + + /** CopyLogEntriesMetadata progress */ + progress?: (number|null); + + /** CopyLogEntriesMetadata writerIdentity */ + writerIdentity?: (string|null); } - /** Represents a ListLogMetricsResponse. */ - class ListLogMetricsResponse implements IListLogMetricsResponse { + /** Represents a CopyLogEntriesMetadata. */ + class CopyLogEntriesMetadata implements ICopyLogEntriesMetadata { /** - * Constructs a new ListLogMetricsResponse. + * Constructs a new CopyLogEntriesMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.logging.v2.IListLogMetricsResponse); + constructor(properties?: google.logging.v2.ICopyLogEntriesMetadata); - /** ListLogMetricsResponse metrics. */ - public metrics: google.logging.v2.ILogMetric[]; + /** CopyLogEntriesMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); - /** ListLogMetricsResponse nextPageToken. */ - public nextPageToken: string; + /** CopyLogEntriesMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** CopyLogEntriesMetadata state. */ + public state: (google.logging.v2.OperationState|keyof typeof google.logging.v2.OperationState); + + /** CopyLogEntriesMetadata cancellationRequested. */ + public cancellationRequested: boolean; + + /** CopyLogEntriesMetadata request. */ + public request?: (google.logging.v2.ICopyLogEntriesRequest|null); + + /** CopyLogEntriesMetadata progress. */ + public progress: number; + + /** CopyLogEntriesMetadata writerIdentity. */ + public writerIdentity: string; /** - * Creates a new ListLogMetricsResponse instance using the specified properties. + * Creates a new CopyLogEntriesMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns ListLogMetricsResponse instance + * @returns CopyLogEntriesMetadata instance */ - public static create(properties?: google.logging.v2.IListLogMetricsResponse): google.logging.v2.ListLogMetricsResponse; + public static create(properties?: google.logging.v2.ICopyLogEntriesMetadata): google.logging.v2.CopyLogEntriesMetadata; /** - * Encodes the specified ListLogMetricsResponse message. Does not implicitly {@link google.logging.v2.ListLogMetricsResponse.verify|verify} messages. - * @param message ListLogMetricsResponse message or plain object to encode + * Encodes the specified CopyLogEntriesMetadata message. Does not implicitly {@link google.logging.v2.CopyLogEntriesMetadata.verify|verify} messages. + * @param message CopyLogEntriesMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.logging.v2.IListLogMetricsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.logging.v2.ICopyLogEntriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListLogMetricsResponse message, length delimited. Does not implicitly {@link google.logging.v2.ListLogMetricsResponse.verify|verify} messages. - * @param message ListLogMetricsResponse message or plain object to encode + * Encodes the specified CopyLogEntriesMetadata message, length delimited. Does not implicitly {@link google.logging.v2.CopyLogEntriesMetadata.verify|verify} messages. + * @param message CopyLogEntriesMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.logging.v2.IListLogMetricsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.logging.v2.ICopyLogEntriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListLogMetricsResponse message from the specified reader or buffer. + * Decodes a CopyLogEntriesMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListLogMetricsResponse + * @returns CopyLogEntriesMetadata * @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.logging.v2.ListLogMetricsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.logging.v2.CopyLogEntriesMetadata; /** - * Decodes a ListLogMetricsResponse message from the specified reader or buffer, length delimited. + * Decodes a CopyLogEntriesMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListLogMetricsResponse + * @returns CopyLogEntriesMetadata * @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.logging.v2.ListLogMetricsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.logging.v2.CopyLogEntriesMetadata; /** - * Verifies a ListLogMetricsResponse message. + * Verifies a CopyLogEntriesMetadata 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 ListLogMetricsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CopyLogEntriesMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListLogMetricsResponse + * @returns CopyLogEntriesMetadata */ - public static fromObject(object: { [k: string]: any }): google.logging.v2.ListLogMetricsResponse; + public static fromObject(object: { [k: string]: any }): google.logging.v2.CopyLogEntriesMetadata; /** - * Creates a plain object from a ListLogMetricsResponse message. Also converts values to other types if specified. - * @param message ListLogMetricsResponse + * Creates a plain object from a CopyLogEntriesMetadata message. Also converts values to other types if specified. + * @param message CopyLogEntriesMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.logging.v2.ListLogMetricsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.logging.v2.CopyLogEntriesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListLogMetricsResponse to JSON. + * Converts this CopyLogEntriesMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetLogMetricRequest. */ - interface IGetLogMetricRequest { + /** Properties of a CopyLogEntriesResponse. */ + interface ICopyLogEntriesResponse { - /** GetLogMetricRequest metricName */ - metricName?: (string|null); + /** CopyLogEntriesResponse logEntriesCopiedCount */ + logEntriesCopiedCount?: (number|Long|string|null); } - /** Represents a GetLogMetricRequest. */ - class GetLogMetricRequest implements IGetLogMetricRequest { + /** Represents a CopyLogEntriesResponse. */ + class CopyLogEntriesResponse implements ICopyLogEntriesResponse { /** - * Constructs a new GetLogMetricRequest. + * Constructs a new CopyLogEntriesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.logging.v2.IGetLogMetricRequest); + constructor(properties?: google.logging.v2.ICopyLogEntriesResponse); - /** GetLogMetricRequest metricName. */ - public metricName: string; + /** CopyLogEntriesResponse logEntriesCopiedCount. */ + public logEntriesCopiedCount: (number|Long|string); /** - * Creates a new GetLogMetricRequest instance using the specified properties. + * Creates a new CopyLogEntriesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns GetLogMetricRequest instance + * @returns CopyLogEntriesResponse instance */ - public static create(properties?: google.logging.v2.IGetLogMetricRequest): google.logging.v2.GetLogMetricRequest; + public static create(properties?: google.logging.v2.ICopyLogEntriesResponse): google.logging.v2.CopyLogEntriesResponse; /** - * Encodes the specified GetLogMetricRequest message. Does not implicitly {@link google.logging.v2.GetLogMetricRequest.verify|verify} messages. - * @param message GetLogMetricRequest message or plain object to encode + * Encodes the specified CopyLogEntriesResponse message. Does not implicitly {@link google.logging.v2.CopyLogEntriesResponse.verify|verify} messages. + * @param message CopyLogEntriesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.logging.v2.IGetLogMetricRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.logging.v2.ICopyLogEntriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetLogMetricRequest message, length delimited. Does not implicitly {@link google.logging.v2.GetLogMetricRequest.verify|verify} messages. - * @param message GetLogMetricRequest message or plain object to encode + * Encodes the specified CopyLogEntriesResponse message, length delimited. Does not implicitly {@link google.logging.v2.CopyLogEntriesResponse.verify|verify} messages. + * @param message CopyLogEntriesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.logging.v2.IGetLogMetricRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.logging.v2.ICopyLogEntriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetLogMetricRequest message from the specified reader or buffer. + * Decodes a CopyLogEntriesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetLogMetricRequest + * @returns CopyLogEntriesResponse * @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.logging.v2.GetLogMetricRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.logging.v2.CopyLogEntriesResponse; /** - * Decodes a GetLogMetricRequest message from the specified reader or buffer, length delimited. + * Decodes a CopyLogEntriesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetLogMetricRequest + * @returns CopyLogEntriesResponse * @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.logging.v2.GetLogMetricRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.logging.v2.CopyLogEntriesResponse; /** - * Verifies a GetLogMetricRequest message. + * Verifies a CopyLogEntriesResponse 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 GetLogMetricRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CopyLogEntriesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetLogMetricRequest + * @returns CopyLogEntriesResponse */ - public static fromObject(object: { [k: string]: any }): google.logging.v2.GetLogMetricRequest; + public static fromObject(object: { [k: string]: any }): google.logging.v2.CopyLogEntriesResponse; /** - * Creates a plain object from a GetLogMetricRequest message. Also converts values to other types if specified. - * @param message GetLogMetricRequest + * Creates a plain object from a CopyLogEntriesResponse message. Also converts values to other types if specified. + * @param message CopyLogEntriesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.logging.v2.GetLogMetricRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.logging.v2.CopyLogEntriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetLogMetricRequest to JSON. + * Converts this CopyLogEntriesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CreateLogMetricRequest. */ - interface ICreateLogMetricRequest { - - /** CreateLogMetricRequest parent */ - parent?: (string|null); + /** LifecycleState enum. */ + enum LifecycleState { + LIFECYCLE_STATE_UNSPECIFIED = 0, + ACTIVE = 1, + DELETE_REQUESTED = 2 + } - /** CreateLogMetricRequest metric */ - metric?: (google.logging.v2.ILogMetric|null); + /** OperationState enum. */ + enum OperationState { + OPERATION_STATE_UNSPECIFIED = 0, + OPERATION_STATE_SCHEDULED = 1, + OPERATION_STATE_WAITING_FOR_PERMISSIONS = 2, + OPERATION_STATE_RUNNING = 3, + OPERATION_STATE_SUCCEEDED = 4, + OPERATION_STATE_FAILED = 5, + OPERATION_STATE_CANCELLED = 6 } - /** Represents a CreateLogMetricRequest. */ - class CreateLogMetricRequest implements ICreateLogMetricRequest { + /** Represents a MetricsServiceV2 */ + class MetricsServiceV2 extends $protobuf.rpc.Service { /** - * Constructs a new CreateLogMetricRequest. - * @param [properties] Properties to set + * Constructs a new MetricsServiceV2 service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited */ - constructor(properties?: google.logging.v2.ICreateLogMetricRequest); - - /** CreateLogMetricRequest parent. */ - public parent: string; + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - /** CreateLogMetricRequest metric. */ - public metric?: (google.logging.v2.ILogMetric|null); + /** + * Creates new MetricsServiceV2 service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): MetricsServiceV2; /** - * Creates a new CreateLogMetricRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateLogMetricRequest instance + * Calls ListLogMetrics. + * @param request ListLogMetricsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListLogMetricsResponse */ - public static create(properties?: google.logging.v2.ICreateLogMetricRequest): google.logging.v2.CreateLogMetricRequest; + public listLogMetrics(request: google.logging.v2.IListLogMetricsRequest, callback: google.logging.v2.MetricsServiceV2.ListLogMetricsCallback): void; /** - * Encodes the specified CreateLogMetricRequest message. Does not implicitly {@link google.logging.v2.CreateLogMetricRequest.verify|verify} messages. - * @param message CreateLogMetricRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ListLogMetrics. + * @param request ListLogMetricsRequest message or plain object + * @returns Promise */ - public static encode(message: google.logging.v2.ICreateLogMetricRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public listLogMetrics(request: google.logging.v2.IListLogMetricsRequest): Promise; /** - * Encodes the specified CreateLogMetricRequest message, length delimited. Does not implicitly {@link google.logging.v2.CreateLogMetricRequest.verify|verify} messages. - * @param message CreateLogMetricRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls GetLogMetric. + * @param request GetLogMetricRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LogMetric */ - public static encodeDelimited(message: google.logging.v2.ICreateLogMetricRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public getLogMetric(request: google.logging.v2.IGetLogMetricRequest, callback: google.logging.v2.MetricsServiceV2.GetLogMetricCallback): void; /** - * Decodes a CreateLogMetricRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateLogMetricRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetLogMetric. + * @param request GetLogMetricRequest message or plain object + * @returns Promise */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.logging.v2.CreateLogMetricRequest; + public getLogMetric(request: google.logging.v2.IGetLogMetricRequest): Promise; /** - * Decodes a CreateLogMetricRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateLogMetricRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls CreateLogMetric. + * @param request CreateLogMetricRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LogMetric */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.logging.v2.CreateLogMetricRequest; + public createLogMetric(request: google.logging.v2.ICreateLogMetricRequest, callback: google.logging.v2.MetricsServiceV2.CreateLogMetricCallback): void; /** - * Verifies a CreateLogMetricRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls CreateLogMetric. + * @param request CreateLogMetricRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public createLogMetric(request: google.logging.v2.ICreateLogMetricRequest): Promise; /** - * Creates a CreateLogMetricRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateLogMetricRequest + * Calls UpdateLogMetric. + * @param request UpdateLogMetricRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LogMetric */ - public static fromObject(object: { [k: string]: any }): google.logging.v2.CreateLogMetricRequest; + public updateLogMetric(request: google.logging.v2.IUpdateLogMetricRequest, callback: google.logging.v2.MetricsServiceV2.UpdateLogMetricCallback): void; /** - * Creates a plain object from a CreateLogMetricRequest message. Also converts values to other types if specified. - * @param message CreateLogMetricRequest - * @param [options] Conversion options - * @returns Plain object + * Calls UpdateLogMetric. + * @param request UpdateLogMetricRequest message or plain object + * @returns Promise */ - public static toObject(message: google.logging.v2.CreateLogMetricRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public updateLogMetric(request: google.logging.v2.IUpdateLogMetricRequest): Promise; /** - * Converts this CreateLogMetricRequest to JSON. - * @returns JSON object + * Calls DeleteLogMetric. + * @param request DeleteLogMetricRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty */ - public toJSON(): { [k: string]: any }; + public deleteLogMetric(request: google.logging.v2.IDeleteLogMetricRequest, callback: google.logging.v2.MetricsServiceV2.DeleteLogMetricCallback): void; + + /** + * Calls DeleteLogMetric. + * @param request DeleteLogMetricRequest message or plain object + * @returns Promise + */ + public deleteLogMetric(request: google.logging.v2.IDeleteLogMetricRequest): Promise; } - /** Properties of an UpdateLogMetricRequest. */ - interface IUpdateLogMetricRequest { + namespace MetricsServiceV2 { - /** UpdateLogMetricRequest metricName */ - metricName?: (string|null); + /** + * Callback as used by {@link google.logging.v2.MetricsServiceV2#listLogMetrics}. + * @param error Error, if any + * @param [response] ListLogMetricsResponse + */ + type ListLogMetricsCallback = (error: (Error|null), response?: google.logging.v2.ListLogMetricsResponse) => void; - /** UpdateLogMetricRequest metric */ - metric?: (google.logging.v2.ILogMetric|null); + /** + * Callback as used by {@link google.logging.v2.MetricsServiceV2#getLogMetric}. + * @param error Error, if any + * @param [response] LogMetric + */ + type GetLogMetricCallback = (error: (Error|null), response?: google.logging.v2.LogMetric) => void; + + /** + * Callback as used by {@link google.logging.v2.MetricsServiceV2#createLogMetric}. + * @param error Error, if any + * @param [response] LogMetric + */ + type CreateLogMetricCallback = (error: (Error|null), response?: google.logging.v2.LogMetric) => void; + + /** + * Callback as used by {@link google.logging.v2.MetricsServiceV2#updateLogMetric}. + * @param error Error, if any + * @param [response] LogMetric + */ + type UpdateLogMetricCallback = (error: (Error|null), response?: google.logging.v2.LogMetric) => void; + + /** + * Callback as used by {@link google.logging.v2.MetricsServiceV2#deleteLogMetric}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteLogMetricCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; } - /** Represents an UpdateLogMetricRequest. */ - class UpdateLogMetricRequest implements IUpdateLogMetricRequest { + /** Properties of a LogMetric. */ + interface ILogMetric { + + /** LogMetric name */ + name?: (string|null); + + /** LogMetric description */ + description?: (string|null); + + /** LogMetric filter */ + filter?: (string|null); + + /** LogMetric disabled */ + disabled?: (boolean|null); + + /** LogMetric metricDescriptor */ + metricDescriptor?: (google.api.IMetricDescriptor|null); + + /** LogMetric valueExtractor */ + valueExtractor?: (string|null); + + /** LogMetric labelExtractors */ + labelExtractors?: ({ [k: string]: string }|null); + + /** LogMetric bucketOptions */ + bucketOptions?: (google.api.Distribution.IBucketOptions|null); + + /** LogMetric createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** LogMetric updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** LogMetric version */ + version?: (google.logging.v2.LogMetric.ApiVersion|keyof typeof google.logging.v2.LogMetric.ApiVersion|null); + } + + /** Represents a LogMetric. */ + class LogMetric implements ILogMetric { /** - * Constructs a new UpdateLogMetricRequest. + * Constructs a new LogMetric. * @param [properties] Properties to set */ - constructor(properties?: google.logging.v2.IUpdateLogMetricRequest); + constructor(properties?: google.logging.v2.ILogMetric); - /** UpdateLogMetricRequest metricName. */ - public metricName: string; + /** LogMetric name. */ + public name: string; - /** UpdateLogMetricRequest metric. */ - public metric?: (google.logging.v2.ILogMetric|null); + /** LogMetric description. */ + public description: string; + + /** LogMetric filter. */ + public filter: string; + + /** LogMetric disabled. */ + public disabled: boolean; + + /** LogMetric metricDescriptor. */ + public metricDescriptor?: (google.api.IMetricDescriptor|null); + + /** LogMetric valueExtractor. */ + public valueExtractor: string; + + /** LogMetric labelExtractors. */ + public labelExtractors: { [k: string]: string }; + + /** LogMetric bucketOptions. */ + public bucketOptions?: (google.api.Distribution.IBucketOptions|null); + + /** LogMetric createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** LogMetric updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** LogMetric version. */ + public version: (google.logging.v2.LogMetric.ApiVersion|keyof typeof google.logging.v2.LogMetric.ApiVersion); /** - * Creates a new UpdateLogMetricRequest instance using the specified properties. + * Creates a new LogMetric instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateLogMetricRequest instance + * @returns LogMetric instance */ - public static create(properties?: google.logging.v2.IUpdateLogMetricRequest): google.logging.v2.UpdateLogMetricRequest; + public static create(properties?: google.logging.v2.ILogMetric): google.logging.v2.LogMetric; /** - * Encodes the specified UpdateLogMetricRequest message. Does not implicitly {@link google.logging.v2.UpdateLogMetricRequest.verify|verify} messages. - * @param message UpdateLogMetricRequest message or plain object to encode + * Encodes the specified LogMetric message. Does not implicitly {@link google.logging.v2.LogMetric.verify|verify} messages. + * @param message LogMetric message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.logging.v2.IUpdateLogMetricRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.logging.v2.ILogMetric, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateLogMetricRequest message, length delimited. Does not implicitly {@link google.logging.v2.UpdateLogMetricRequest.verify|verify} messages. - * @param message UpdateLogMetricRequest message or plain object to encode + * Encodes the specified LogMetric message, length delimited. Does not implicitly {@link google.logging.v2.LogMetric.verify|verify} messages. + * @param message LogMetric message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.logging.v2.IUpdateLogMetricRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.logging.v2.ILogMetric, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateLogMetricRequest message from the specified reader or buffer. + * Decodes a LogMetric message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateLogMetricRequest + * @returns LogMetric * @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.logging.v2.UpdateLogMetricRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.logging.v2.LogMetric; /** - * Decodes an UpdateLogMetricRequest message from the specified reader or buffer, length delimited. + * Decodes a LogMetric message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateLogMetricRequest + * @returns LogMetric * @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.logging.v2.UpdateLogMetricRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.logging.v2.LogMetric; /** - * Verifies an UpdateLogMetricRequest message. + * Verifies a LogMetric 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 an UpdateLogMetricRequest message from a plain object. Also converts values to their respective internal types. + * Creates a LogMetric message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateLogMetricRequest + * @returns LogMetric */ - public static fromObject(object: { [k: string]: any }): google.logging.v2.UpdateLogMetricRequest; + public static fromObject(object: { [k: string]: any }): google.logging.v2.LogMetric; /** - * Creates a plain object from an UpdateLogMetricRequest message. Also converts values to other types if specified. - * @param message UpdateLogMetricRequest + * Creates a plain object from a LogMetric message. Also converts values to other types if specified. + * @param message LogMetric * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.logging.v2.UpdateLogMetricRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.logging.v2.LogMetric, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateLogMetricRequest to JSON. + * Converts this LogMetric to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteLogMetricRequest. */ - interface IDeleteLogMetricRequest { + namespace LogMetric { - /** DeleteLogMetricRequest metricName */ - metricName?: (string|null); - } + /** ApiVersion enum. */ + enum ApiVersion { + V2 = 0, + V1 = 1 + } + } - /** Represents a DeleteLogMetricRequest. */ - class DeleteLogMetricRequest implements IDeleteLogMetricRequest { + /** Properties of a ListLogMetricsRequest. */ + interface IListLogMetricsRequest { + + /** ListLogMetricsRequest parent */ + parent?: (string|null); + + /** ListLogMetricsRequest pageToken */ + pageToken?: (string|null); + + /** ListLogMetricsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListLogMetricsRequest. */ + class ListLogMetricsRequest implements IListLogMetricsRequest { /** - * Constructs a new DeleteLogMetricRequest. + * Constructs a new ListLogMetricsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.logging.v2.IDeleteLogMetricRequest); + constructor(properties?: google.logging.v2.IListLogMetricsRequest); - /** DeleteLogMetricRequest metricName. */ - public metricName: string; + /** ListLogMetricsRequest parent. */ + public parent: string; + + /** ListLogMetricsRequest pageToken. */ + public pageToken: string; + + /** ListLogMetricsRequest pageSize. */ + public pageSize: number; /** - * Creates a new DeleteLogMetricRequest instance using the specified properties. + * Creates a new ListLogMetricsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteLogMetricRequest instance + * @returns ListLogMetricsRequest instance */ - public static create(properties?: google.logging.v2.IDeleteLogMetricRequest): google.logging.v2.DeleteLogMetricRequest; + public static create(properties?: google.logging.v2.IListLogMetricsRequest): google.logging.v2.ListLogMetricsRequest; /** - * Encodes the specified DeleteLogMetricRequest message. Does not implicitly {@link google.logging.v2.DeleteLogMetricRequest.verify|verify} messages. - * @param message DeleteLogMetricRequest message or plain object to encode + * Encodes the specified ListLogMetricsRequest message. Does not implicitly {@link google.logging.v2.ListLogMetricsRequest.verify|verify} messages. + * @param message ListLogMetricsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.logging.v2.IDeleteLogMetricRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.logging.v2.IListLogMetricsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteLogMetricRequest message, length delimited. Does not implicitly {@link google.logging.v2.DeleteLogMetricRequest.verify|verify} messages. - * @param message DeleteLogMetricRequest message or plain object to encode + * Encodes the specified ListLogMetricsRequest message, length delimited. Does not implicitly {@link google.logging.v2.ListLogMetricsRequest.verify|verify} messages. + * @param message ListLogMetricsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.logging.v2.IDeleteLogMetricRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.logging.v2.IListLogMetricsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteLogMetricRequest message from the specified reader or buffer. + * Decodes a ListLogMetricsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteLogMetricRequest + * @returns ListLogMetricsRequest * @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.logging.v2.DeleteLogMetricRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.logging.v2.ListLogMetricsRequest; /** - * Decodes a DeleteLogMetricRequest message from the specified reader or buffer, length delimited. + * Decodes a ListLogMetricsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteLogMetricRequest + * @returns ListLogMetricsRequest * @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.logging.v2.DeleteLogMetricRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.logging.v2.ListLogMetricsRequest; /** - * Verifies a DeleteLogMetricRequest message. + * Verifies a ListLogMetricsRequest 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 DeleteLogMetricRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListLogMetricsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteLogMetricRequest + * @returns ListLogMetricsRequest */ - public static fromObject(object: { [k: string]: any }): google.logging.v2.DeleteLogMetricRequest; + public static fromObject(object: { [k: string]: any }): google.logging.v2.ListLogMetricsRequest; /** - * Creates a plain object from a DeleteLogMetricRequest message. Also converts values to other types if specified. - * @param message DeleteLogMetricRequest + * Creates a plain object from a ListLogMetricsRequest message. Also converts values to other types if specified. + * @param message ListLogMetricsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.logging.v2.DeleteLogMetricRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.logging.v2.ListLogMetricsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteLogMetricRequest to JSON. + * Converts this ListLogMetricsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - } - } - /** Namespace api. */ - namespace api { + /** Properties of a ListLogMetricsResponse. */ + interface IListLogMetricsResponse { - /** Properties of a Http. */ - interface IHttp { + /** ListLogMetricsResponse metrics */ + metrics?: (google.logging.v2.ILogMetric[]|null); - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); + /** ListLogMetricsResponse nextPageToken */ + nextPageToken?: (string|null); + } - /** Http fullyDecodeReservedExpansion */ - fullyDecodeReservedExpansion?: (boolean|null); - } + /** Represents a ListLogMetricsResponse. */ + class ListLogMetricsResponse implements IListLogMetricsResponse { - /** Represents a Http. */ - class Http implements IHttp { + /** + * Constructs a new ListLogMetricsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IListLogMetricsResponse); - /** - * Constructs a new Http. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttp); + /** ListLogMetricsResponse metrics. */ + public metrics: google.logging.v2.ILogMetric[]; - /** Http rules. */ - public rules: google.api.IHttpRule[]; + /** ListLogMetricsResponse nextPageToken. */ + public nextPageToken: string; - /** Http fullyDecodeReservedExpansion. */ - public fullyDecodeReservedExpansion: boolean; + /** + * Creates a new ListLogMetricsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListLogMetricsResponse instance + */ + public static create(properties?: google.logging.v2.IListLogMetricsResponse): google.logging.v2.ListLogMetricsResponse; - /** - * Creates a new Http instance using the specified properties. - * @param [properties] Properties to set - * @returns Http instance - */ - public static create(properties?: google.api.IHttp): google.api.Http; + /** + * Encodes the specified ListLogMetricsResponse message. Does not implicitly {@link google.logging.v2.ListLogMetricsResponse.verify|verify} messages. + * @param message ListLogMetricsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IListLogMetricsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified ListLogMetricsResponse message, length delimited. Does not implicitly {@link google.logging.v2.ListLogMetricsResponse.verify|verify} messages. + * @param message ListLogMetricsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IListLogMetricsResponse, 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 - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a ListLogMetricsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListLogMetricsResponse + * @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.logging.v2.ListLogMetricsResponse; - /** - * 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 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.Http; + /** + * Decodes a ListLogMetricsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListLogMetricsResponse + * @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.logging.v2.ListLogMetricsResponse; - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @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.Http; + /** + * Verifies a ListLogMetricsResponse 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); - /** - * 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 ListLogMetricsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListLogMetricsResponse + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.ListLogMetricsResponse; - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Http - */ - public static fromObject(object: { [k: string]: any }): google.api.Http; + /** + * Creates a plain object from a ListLogMetricsResponse message. Also converts values to other types if specified. + * @param message ListLogMetricsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.ListLogMetricsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Converts this ListLogMetricsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Converts this Http to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Properties of a GetLogMetricRequest. */ + interface IGetLogMetricRequest { - /** Properties of a HttpRule. */ - interface IHttpRule { + /** GetLogMetricRequest metricName */ + metricName?: (string|null); + } - /** HttpRule selector */ - selector?: (string|null); + /** Represents a GetLogMetricRequest. */ + class GetLogMetricRequest implements IGetLogMetricRequest { - /** HttpRule get */ - get?: (string|null); + /** + * Constructs a new GetLogMetricRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IGetLogMetricRequest); - /** HttpRule put */ - put?: (string|null); + /** GetLogMetricRequest metricName. */ + public metricName: string; - /** HttpRule post */ - post?: (string|null); + /** + * Creates a new GetLogMetricRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetLogMetricRequest instance + */ + public static create(properties?: google.logging.v2.IGetLogMetricRequest): google.logging.v2.GetLogMetricRequest; - /** HttpRule delete */ - "delete"?: (string|null); + /** + * Encodes the specified GetLogMetricRequest message. Does not implicitly {@link google.logging.v2.GetLogMetricRequest.verify|verify} messages. + * @param message GetLogMetricRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IGetLogMetricRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** HttpRule patch */ - patch?: (string|null); + /** + * Encodes the specified GetLogMetricRequest message, length delimited. Does not implicitly {@link google.logging.v2.GetLogMetricRequest.verify|verify} messages. + * @param message GetLogMetricRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IGetLogMetricRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); + /** + * Decodes a GetLogMetricRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetLogMetricRequest + * @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.logging.v2.GetLogMetricRequest; - /** HttpRule body */ - body?: (string|null); + /** + * Decodes a GetLogMetricRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetLogMetricRequest + * @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.logging.v2.GetLogMetricRequest; - /** HttpRule responseBody */ - responseBody?: (string|null); + /** + * Verifies a GetLogMetricRequest 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); - /** HttpRule additionalBindings */ - additionalBindings?: (google.api.IHttpRule[]|null); - } + /** + * Creates a GetLogMetricRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetLogMetricRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.GetLogMetricRequest; - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { + /** + * Creates a plain object from a GetLogMetricRequest message. Also converts values to other types if specified. + * @param message GetLogMetricRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.GetLogMetricRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Constructs a new HttpRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttpRule); + /** + * Converts this GetLogMetricRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** HttpRule selector. */ - public selector: string; + /** Properties of a CreateLogMetricRequest. */ + interface ICreateLogMetricRequest { - /** HttpRule get. */ - public get?: (string|null); + /** CreateLogMetricRequest parent */ + parent?: (string|null); - /** HttpRule put. */ - public put?: (string|null); + /** CreateLogMetricRequest metric */ + metric?: (google.logging.v2.ILogMetric|null); + } - /** HttpRule post. */ - public post?: (string|null); + /** Represents a CreateLogMetricRequest. */ + class CreateLogMetricRequest implements ICreateLogMetricRequest { - /** HttpRule delete. */ - public delete?: (string|null); + /** + * Constructs a new CreateLogMetricRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.ICreateLogMetricRequest); - /** HttpRule patch. */ - public patch?: (string|null); + /** CreateLogMetricRequest parent. */ + public parent: string; - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); + /** CreateLogMetricRequest metric. */ + public metric?: (google.logging.v2.ILogMetric|null); - /** HttpRule body. */ - public body: string; + /** + * Creates a new CreateLogMetricRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateLogMetricRequest instance + */ + public static create(properties?: google.logging.v2.ICreateLogMetricRequest): google.logging.v2.CreateLogMetricRequest; - /** HttpRule responseBody. */ - public responseBody: string; + /** + * Encodes the specified CreateLogMetricRequest message. Does not implicitly {@link google.logging.v2.CreateLogMetricRequest.verify|verify} messages. + * @param message CreateLogMetricRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.ICreateLogMetricRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** HttpRule additionalBindings. */ - public additionalBindings: google.api.IHttpRule[]; + /** + * Encodes the specified CreateLogMetricRequest message, length delimited. Does not implicitly {@link google.logging.v2.CreateLogMetricRequest.verify|verify} messages. + * @param message CreateLogMetricRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.ICreateLogMetricRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + /** + * Decodes a CreateLogMetricRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateLogMetricRequest + * @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.logging.v2.CreateLogMetricRequest; - /** - * Creates a new HttpRule instance using the specified properties. - * @param [properties] Properties to set - * @returns HttpRule instance - */ - public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + /** + * Decodes a CreateLogMetricRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateLogMetricRequest + * @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.logging.v2.CreateLogMetricRequest; - /** - * 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.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a CreateLogMetricRequest 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); - /** - * 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.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a CreateLogMetricRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateLogMetricRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.CreateLogMetricRequest; - /** - * 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 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.HttpRule; + /** + * Creates a plain object from a CreateLogMetricRequest message. Also converts values to other types if specified. + * @param message CreateLogMetricRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.CreateLogMetricRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @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.HttpRule; + /** + * Converts this CreateLogMetricRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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); + /** Properties of an UpdateLogMetricRequest. */ + interface IUpdateLogMetricRequest { - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HttpRule - */ - public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + /** UpdateLogMetricRequest metricName */ + metricName?: (string|null); - /** - * 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.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** UpdateLogMetricRequest metric */ + metric?: (google.logging.v2.ILogMetric|null); + } - /** - * Converts this HttpRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Represents an UpdateLogMetricRequest. */ + class UpdateLogMetricRequest implements IUpdateLogMetricRequest { + + /** + * Constructs a new UpdateLogMetricRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IUpdateLogMetricRequest); + + /** UpdateLogMetricRequest metricName. */ + public metricName: string; + + /** UpdateLogMetricRequest metric. */ + public metric?: (google.logging.v2.ILogMetric|null); + + /** + * Creates a new UpdateLogMetricRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateLogMetricRequest instance + */ + public static create(properties?: google.logging.v2.IUpdateLogMetricRequest): google.logging.v2.UpdateLogMetricRequest; + + /** + * Encodes the specified UpdateLogMetricRequest message. Does not implicitly {@link google.logging.v2.UpdateLogMetricRequest.verify|verify} messages. + * @param message UpdateLogMetricRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IUpdateLogMetricRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateLogMetricRequest message, length delimited. Does not implicitly {@link google.logging.v2.UpdateLogMetricRequest.verify|verify} messages. + * @param message UpdateLogMetricRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IUpdateLogMetricRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateLogMetricRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateLogMetricRequest + * @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.logging.v2.UpdateLogMetricRequest; + + /** + * Decodes an UpdateLogMetricRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateLogMetricRequest + * @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.logging.v2.UpdateLogMetricRequest; + + /** + * Verifies an UpdateLogMetricRequest 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 an UpdateLogMetricRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateLogMetricRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.UpdateLogMetricRequest; + + /** + * Creates a plain object from an UpdateLogMetricRequest message. Also converts values to other types if specified. + * @param message UpdateLogMetricRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.UpdateLogMetricRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateLogMetricRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteLogMetricRequest. */ + interface IDeleteLogMetricRequest { + + /** DeleteLogMetricRequest metricName */ + metricName?: (string|null); + } + + /** Represents a DeleteLogMetricRequest. */ + class DeleteLogMetricRequest implements IDeleteLogMetricRequest { + + /** + * Constructs a new DeleteLogMetricRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IDeleteLogMetricRequest); + + /** DeleteLogMetricRequest metricName. */ + public metricName: string; + + /** + * Creates a new DeleteLogMetricRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteLogMetricRequest instance + */ + public static create(properties?: google.logging.v2.IDeleteLogMetricRequest): google.logging.v2.DeleteLogMetricRequest; + + /** + * Encodes the specified DeleteLogMetricRequest message. Does not implicitly {@link google.logging.v2.DeleteLogMetricRequest.verify|verify} messages. + * @param message DeleteLogMetricRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IDeleteLogMetricRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteLogMetricRequest message, length delimited. Does not implicitly {@link google.logging.v2.DeleteLogMetricRequest.verify|verify} messages. + * @param message DeleteLogMetricRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IDeleteLogMetricRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteLogMetricRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteLogMetricRequest + * @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.logging.v2.DeleteLogMetricRequest; + + /** + * Decodes a DeleteLogMetricRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteLogMetricRequest + * @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.logging.v2.DeleteLogMetricRequest; + + /** + * Verifies a DeleteLogMetricRequest 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 DeleteLogMetricRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteLogMetricRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.DeleteLogMetricRequest; + + /** + * Creates a plain object from a DeleteLogMetricRequest message. Also converts values to other types if specified. + * @param message DeleteLogMetricRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.DeleteLogMetricRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteLogMetricRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } + } - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { + /** Namespace api. */ + namespace api { - /** CustomHttpPattern kind */ - kind?: (string|null); + /** Properties of a Http. */ + interface IHttp { - /** CustomHttpPattern path */ - path?: (string|null); + /** Http rules */ + rules?: (google.api.IHttpRule[]|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 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.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** 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); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @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; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * 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.IHttpRule, 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 + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 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.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.HttpRule; + + /** + * 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 HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * 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.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * 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.ICustomHttpPattern, 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 + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 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.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.CustomHttpPattern; + + /** + * 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 CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; /** * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. @@ -11546,1241 +12361,2157 @@ export namespace google { */ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; - /** - * 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); + /** + * 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 ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * 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.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor 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 { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * 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.IResourceReference, 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 + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 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.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.ResourceReference; + + /** + * 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 ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * 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.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Distribution. */ + interface IDistribution { + + /** Distribution count */ + count?: (number|Long|string|null); + + /** Distribution mean */ + mean?: (number|null); + + /** Distribution sumOfSquaredDeviation */ + sumOfSquaredDeviation?: (number|null); + + /** Distribution range */ + range?: (google.api.Distribution.IRange|null); + + /** Distribution bucketOptions */ + bucketOptions?: (google.api.Distribution.IBucketOptions|null); + + /** Distribution bucketCounts */ + bucketCounts?: ((number|Long|string)[]|null); + + /** Distribution exemplars */ + exemplars?: (google.api.Distribution.IExemplar[]|null); + } + + /** Represents a Distribution. */ + class Distribution implements IDistribution { + + /** + * Constructs a new Distribution. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDistribution); + + /** Distribution count. */ + public count: (number|Long|string); + + /** Distribution mean. */ + public mean: number; + + /** Distribution sumOfSquaredDeviation. */ + public sumOfSquaredDeviation: number; + + /** Distribution range. */ + public range?: (google.api.Distribution.IRange|null); + + /** Distribution bucketOptions. */ + public bucketOptions?: (google.api.Distribution.IBucketOptions|null); + + /** Distribution bucketCounts. */ + public bucketCounts: (number|Long|string)[]; + + /** Distribution exemplars. */ + public exemplars: google.api.Distribution.IExemplar[]; + + /** + * Creates a new Distribution instance using the specified properties. + * @param [properties] Properties to set + * @returns Distribution instance + */ + public static create(properties?: google.api.IDistribution): google.api.Distribution; + + /** + * Encodes the specified Distribution message. Does not implicitly {@link google.api.Distribution.verify|verify} messages. + * @param message Distribution message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDistribution, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Distribution message, length delimited. Does not implicitly {@link google.api.Distribution.verify|verify} messages. + * @param message Distribution message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDistribution, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Distribution message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Distribution + * @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.Distribution; + + /** + * Decodes a Distribution message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Distribution + * @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.Distribution; + + /** + * Verifies a Distribution 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 Distribution message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Distribution + */ + public static fromObject(object: { [k: string]: any }): google.api.Distribution; + + /** + * Creates a plain object from a Distribution message. Also converts values to other types if specified. + * @param message Distribution + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Distribution, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Distribution to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Distribution { + + /** Properties of a Range. */ + interface IRange { + + /** Range min */ + min?: (number|null); + + /** Range max */ + max?: (number|null); + } + + /** Represents a Range. */ + class Range implements IRange { + + /** + * Constructs a new Range. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.Distribution.IRange); + + /** Range min. */ + public min: number; + + /** Range max. */ + public max: number; + + /** + * Creates a new Range instance using the specified properties. + * @param [properties] Properties to set + * @returns Range instance + */ + public static create(properties?: google.api.Distribution.IRange): google.api.Distribution.Range; + + /** + * Encodes the specified Range message. Does not implicitly {@link google.api.Distribution.Range.verify|verify} messages. + * @param message Range message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.Distribution.IRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Range message, length delimited. Does not implicitly {@link google.api.Distribution.Range.verify|verify} messages. + * @param message Range message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.Distribution.IRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Range message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Range + * @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.Distribution.Range; + + /** + * Decodes a Range message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Range + * @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.Distribution.Range; + + /** + * Verifies a Range 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 Range message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Range + */ + public static fromObject(object: { [k: string]: any }): google.api.Distribution.Range; + + /** + * Creates a plain object from a Range message. Also converts values to other types if specified. + * @param message Range + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Distribution.Range, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Range to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BucketOptions. */ + interface IBucketOptions { + + /** BucketOptions linearBuckets */ + linearBuckets?: (google.api.Distribution.BucketOptions.ILinear|null); + + /** BucketOptions exponentialBuckets */ + exponentialBuckets?: (google.api.Distribution.BucketOptions.IExponential|null); + + /** BucketOptions explicitBuckets */ + explicitBuckets?: (google.api.Distribution.BucketOptions.IExplicit|null); + } + + /** Represents a BucketOptions. */ + class BucketOptions implements IBucketOptions { + + /** + * Constructs a new BucketOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.Distribution.IBucketOptions); + + /** BucketOptions linearBuckets. */ + public linearBuckets?: (google.api.Distribution.BucketOptions.ILinear|null); + + /** BucketOptions exponentialBuckets. */ + public exponentialBuckets?: (google.api.Distribution.BucketOptions.IExponential|null); + + /** BucketOptions explicitBuckets. */ + public explicitBuckets?: (google.api.Distribution.BucketOptions.IExplicit|null); + + /** BucketOptions options. */ + public options?: ("linearBuckets"|"exponentialBuckets"|"explicitBuckets"); + + /** + * Creates a new BucketOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns BucketOptions instance + */ + public static create(properties?: google.api.Distribution.IBucketOptions): google.api.Distribution.BucketOptions; + + /** + * Encodes the specified BucketOptions message. Does not implicitly {@link google.api.Distribution.BucketOptions.verify|verify} messages. + * @param message BucketOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.Distribution.IBucketOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BucketOptions message, length delimited. Does not implicitly {@link google.api.Distribution.BucketOptions.verify|verify} messages. + * @param message BucketOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.Distribution.IBucketOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BucketOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BucketOptions + * @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.Distribution.BucketOptions; + + /** + * Decodes a BucketOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BucketOptions + * @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.Distribution.BucketOptions; + + /** + * Verifies a BucketOptions 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 BucketOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BucketOptions + */ + public static fromObject(object: { [k: string]: any }): google.api.Distribution.BucketOptions; + + /** + * Creates a plain object from a BucketOptions message. Also converts values to other types if specified. + * @param message BucketOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Distribution.BucketOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BucketOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace BucketOptions { + + /** Properties of a Linear. */ + interface ILinear { + + /** Linear numFiniteBuckets */ + numFiniteBuckets?: (number|null); + + /** Linear width */ + width?: (number|null); + + /** Linear offset */ + offset?: (number|null); + } + + /** Represents a Linear. */ + class Linear implements ILinear { + + /** + * Constructs a new Linear. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.Distribution.BucketOptions.ILinear); + + /** Linear numFiniteBuckets. */ + public numFiniteBuckets: number; + + /** Linear width. */ + public width: number; + + /** Linear offset. */ + public offset: number; + + /** + * Creates a new Linear instance using the specified properties. + * @param [properties] Properties to set + * @returns Linear instance + */ + public static create(properties?: google.api.Distribution.BucketOptions.ILinear): google.api.Distribution.BucketOptions.Linear; + + /** + * Encodes the specified Linear message. Does not implicitly {@link google.api.Distribution.BucketOptions.Linear.verify|verify} messages. + * @param message Linear message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.Distribution.BucketOptions.ILinear, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Linear message, length delimited. Does not implicitly {@link google.api.Distribution.BucketOptions.Linear.verify|verify} messages. + * @param message Linear message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.Distribution.BucketOptions.ILinear, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Linear message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Linear + * @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.Distribution.BucketOptions.Linear; + + /** + * Decodes a Linear message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Linear + * @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.Distribution.BucketOptions.Linear; + + /** + * Verifies a Linear 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 Linear message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Linear + */ + public static fromObject(object: { [k: string]: any }): google.api.Distribution.BucketOptions.Linear; + + /** + * Creates a plain object from a Linear message. Also converts values to other types if specified. + * @param message Linear + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Distribution.BucketOptions.Linear, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Linear to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Exponential. */ + interface IExponential { + + /** Exponential numFiniteBuckets */ + numFiniteBuckets?: (number|null); + + /** Exponential growthFactor */ + growthFactor?: (number|null); + + /** Exponential scale */ + scale?: (number|null); + } + + /** Represents an Exponential. */ + class Exponential implements IExponential { + + /** + * Constructs a new Exponential. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.Distribution.BucketOptions.IExponential); + + /** Exponential numFiniteBuckets. */ + public numFiniteBuckets: number; + + /** Exponential growthFactor. */ + public growthFactor: number; + + /** Exponential scale. */ + public scale: number; + + /** + * Creates a new Exponential instance using the specified properties. + * @param [properties] Properties to set + * @returns Exponential instance + */ + public static create(properties?: google.api.Distribution.BucketOptions.IExponential): google.api.Distribution.BucketOptions.Exponential; + + /** + * Encodes the specified Exponential message. Does not implicitly {@link google.api.Distribution.BucketOptions.Exponential.verify|verify} messages. + * @param message Exponential message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.Distribution.BucketOptions.IExponential, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Exponential message, length delimited. Does not implicitly {@link google.api.Distribution.BucketOptions.Exponential.verify|verify} messages. + * @param message Exponential message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.Distribution.BucketOptions.IExponential, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Exponential message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Exponential + * @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.Distribution.BucketOptions.Exponential; + + /** + * Decodes an Exponential message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Exponential + * @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.Distribution.BucketOptions.Exponential; + + /** + * Verifies an Exponential 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 an Exponential message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Exponential + */ + public static fromObject(object: { [k: string]: any }): google.api.Distribution.BucketOptions.Exponential; + + /** + * Creates a plain object from an Exponential message. Also converts values to other types if specified. + * @param message Exponential + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Distribution.BucketOptions.Exponential, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Exponential to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Explicit. */ + interface IExplicit { + + /** Explicit bounds */ + bounds?: (number[]|null); + } + + /** Represents an Explicit. */ + class Explicit implements IExplicit { + + /** + * Constructs a new Explicit. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.Distribution.BucketOptions.IExplicit); + + /** Explicit bounds. */ + public bounds: number[]; + + /** + * Creates a new Explicit instance using the specified properties. + * @param [properties] Properties to set + * @returns Explicit instance + */ + public static create(properties?: google.api.Distribution.BucketOptions.IExplicit): google.api.Distribution.BucketOptions.Explicit; + + /** + * Encodes the specified Explicit message. Does not implicitly {@link google.api.Distribution.BucketOptions.Explicit.verify|verify} messages. + * @param message Explicit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.Distribution.BucketOptions.IExplicit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Explicit message, length delimited. Does not implicitly {@link google.api.Distribution.BucketOptions.Explicit.verify|verify} messages. + * @param message Explicit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.Distribution.BucketOptions.IExplicit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Explicit message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Explicit + * @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.Distribution.BucketOptions.Explicit; + + /** + * Decodes an Explicit message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Explicit + * @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.Distribution.BucketOptions.Explicit; + + /** + * Verifies an Explicit 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 an Explicit message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Explicit + */ + public static fromObject(object: { [k: string]: any }): google.api.Distribution.BucketOptions.Explicit; + + /** + * Creates a plain object from an Explicit message. Also converts values to other types if specified. + * @param message Explicit + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Distribution.BucketOptions.Explicit, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceDescriptor - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + /** + * Converts this Explicit to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** - * 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.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Properties of an Exemplar. */ + interface IExemplar { - /** - * Converts this ResourceDescriptor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Exemplar value */ + value?: (number|null); - namespace ResourceDescriptor { + /** Exemplar timestamp */ + timestamp?: (google.protobuf.ITimestamp|null); - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 + /** Exemplar attachments */ + attachments?: (google.protobuf.IAny[]|null); } - /** Style enum. */ - enum Style { - STYLE_UNSPECIFIED = 0, - DECLARATIVE_FRIENDLY = 1 - } - } + /** Represents an Exemplar. */ + class Exemplar implements IExemplar { - /** Properties of a ResourceReference. */ - interface IResourceReference { + /** + * Constructs a new Exemplar. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.Distribution.IExemplar); - /** ResourceReference type */ - type?: (string|null); + /** Exemplar value. */ + public value: number; - /** ResourceReference childType */ - childType?: (string|null); - } + /** Exemplar timestamp. */ + public timestamp?: (google.protobuf.ITimestamp|null); - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { + /** Exemplar attachments. */ + public attachments: google.protobuf.IAny[]; - /** - * Constructs a new ResourceReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceReference); + /** + * Creates a new Exemplar instance using the specified properties. + * @param [properties] Properties to set + * @returns Exemplar instance + */ + public static create(properties?: google.api.Distribution.IExemplar): google.api.Distribution.Exemplar; - /** ResourceReference type. */ - public type: string; + /** + * Encodes the specified Exemplar message. Does not implicitly {@link google.api.Distribution.Exemplar.verify|verify} messages. + * @param message Exemplar message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.Distribution.IExemplar, writer?: $protobuf.Writer): $protobuf.Writer; - /** ResourceReference childType. */ - public childType: string; + /** + * Encodes the specified Exemplar message, length delimited. Does not implicitly {@link google.api.Distribution.Exemplar.verify|verify} messages. + * @param message Exemplar message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.Distribution.IExemplar, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new ResourceReference instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceReference instance - */ - public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + /** + * Decodes an Exemplar message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Exemplar + * @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.Distribution.Exemplar; - /** - * 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.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes an Exemplar message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Exemplar + * @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.Distribution.Exemplar; - /** - * 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.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies an Exemplar 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); - /** - * 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 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.ResourceReference; + /** + * Creates an Exemplar message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Exemplar + */ + public static fromObject(object: { [k: string]: any }): google.api.Distribution.Exemplar; - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @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.ResourceReference; + /** + * Creates a plain object from an Exemplar message. Also converts values to other types if specified. + * @param message Exemplar + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Distribution.Exemplar, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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); + /** + * Converts this Exemplar to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceReference - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + /** Properties of a MetricDescriptor. */ + interface IMetricDescriptor { - /** - * 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.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** MetricDescriptor name */ + name?: (string|null); - /** - * Converts this ResourceReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** MetricDescriptor type */ + type?: (string|null); - /** Properties of a Distribution. */ - interface IDistribution { + /** MetricDescriptor labels */ + labels?: (google.api.ILabelDescriptor[]|null); - /** Distribution count */ - count?: (number|Long|string|null); + /** MetricDescriptor metricKind */ + metricKind?: (google.api.MetricDescriptor.MetricKind|keyof typeof google.api.MetricDescriptor.MetricKind|null); - /** Distribution mean */ - mean?: (number|null); + /** MetricDescriptor valueType */ + valueType?: (google.api.MetricDescriptor.ValueType|keyof typeof google.api.MetricDescriptor.ValueType|null); - /** Distribution sumOfSquaredDeviation */ - sumOfSquaredDeviation?: (number|null); + /** MetricDescriptor unit */ + unit?: (string|null); - /** Distribution range */ - range?: (google.api.Distribution.IRange|null); + /** MetricDescriptor description */ + description?: (string|null); - /** Distribution bucketOptions */ - bucketOptions?: (google.api.Distribution.IBucketOptions|null); + /** MetricDescriptor displayName */ + displayName?: (string|null); - /** Distribution bucketCounts */ - bucketCounts?: ((number|Long|string)[]|null); + /** MetricDescriptor metadata */ + metadata?: (google.api.MetricDescriptor.IMetricDescriptorMetadata|null); - /** Distribution exemplars */ - exemplars?: (google.api.Distribution.IExemplar[]|null); + /** MetricDescriptor launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** MetricDescriptor monitoredResourceTypes */ + monitoredResourceTypes?: (string[]|null); } - /** Represents a Distribution. */ - class Distribution implements IDistribution { + /** Represents a MetricDescriptor. */ + class MetricDescriptor implements IMetricDescriptor { /** - * Constructs a new Distribution. + * Constructs a new MetricDescriptor. * @param [properties] Properties to set */ - constructor(properties?: google.api.IDistribution); + constructor(properties?: google.api.IMetricDescriptor); - /** Distribution count. */ - public count: (number|Long|string); + /** MetricDescriptor name. */ + public name: string; - /** Distribution mean. */ - public mean: number; + /** MetricDescriptor type. */ + public type: string; - /** Distribution sumOfSquaredDeviation. */ - public sumOfSquaredDeviation: number; + /** MetricDescriptor labels. */ + public labels: google.api.ILabelDescriptor[]; - /** Distribution range. */ - public range?: (google.api.Distribution.IRange|null); + /** MetricDescriptor metricKind. */ + public metricKind: (google.api.MetricDescriptor.MetricKind|keyof typeof google.api.MetricDescriptor.MetricKind); - /** Distribution bucketOptions. */ - public bucketOptions?: (google.api.Distribution.IBucketOptions|null); + /** MetricDescriptor valueType. */ + public valueType: (google.api.MetricDescriptor.ValueType|keyof typeof google.api.MetricDescriptor.ValueType); - /** Distribution bucketCounts. */ - public bucketCounts: (number|Long|string)[]; + /** MetricDescriptor unit. */ + public unit: string; - /** Distribution exemplars. */ - public exemplars: google.api.Distribution.IExemplar[]; + /** MetricDescriptor description. */ + public description: string; + + /** MetricDescriptor displayName. */ + public displayName: string; + + /** MetricDescriptor metadata. */ + public metadata?: (google.api.MetricDescriptor.IMetricDescriptorMetadata|null); + + /** MetricDescriptor launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** MetricDescriptor monitoredResourceTypes. */ + public monitoredResourceTypes: string[]; /** - * Creates a new Distribution instance using the specified properties. + * Creates a new MetricDescriptor instance using the specified properties. * @param [properties] Properties to set - * @returns Distribution instance + * @returns MetricDescriptor instance */ - public static create(properties?: google.api.IDistribution): google.api.Distribution; + public static create(properties?: google.api.IMetricDescriptor): google.api.MetricDescriptor; /** - * Encodes the specified Distribution message. Does not implicitly {@link google.api.Distribution.verify|verify} messages. - * @param message Distribution message or plain object to encode + * Encodes the specified MetricDescriptor message. Does not implicitly {@link google.api.MetricDescriptor.verify|verify} messages. + * @param message MetricDescriptor message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.api.IDistribution, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IMetricDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Distribution message, length delimited. Does not implicitly {@link google.api.Distribution.verify|verify} messages. - * @param message Distribution message or plain object to encode + * Encodes the specified MetricDescriptor message, length delimited. Does not implicitly {@link google.api.MetricDescriptor.verify|verify} messages. + * @param message MetricDescriptor message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.api.IDistribution, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IMetricDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Distribution message from the specified reader or buffer. + * Decodes a MetricDescriptor message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Distribution + * @returns MetricDescriptor * @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.Distribution; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MetricDescriptor; /** - * Decodes a Distribution message from the specified reader or buffer, length delimited. + * Decodes a MetricDescriptor message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Distribution + * @returns MetricDescriptor * @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.Distribution; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MetricDescriptor; /** - * Verifies a Distribution message. + * Verifies a MetricDescriptor 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 Distribution message from a plain object. Also converts values to their respective internal types. + * Creates a MetricDescriptor message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Distribution + * @returns MetricDescriptor */ - public static fromObject(object: { [k: string]: any }): google.api.Distribution; + public static fromObject(object: { [k: string]: any }): google.api.MetricDescriptor; /** - * Creates a plain object from a Distribution message. Also converts values to other types if specified. - * @param message Distribution + * Creates a plain object from a MetricDescriptor message. Also converts values to other types if specified. + * @param message MetricDescriptor * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.Distribution, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.MetricDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Distribution to JSON. + * Converts this MetricDescriptor to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace Distribution { - - /** Properties of a Range. */ - interface IRange { - - /** Range min */ - min?: (number|null); - - /** Range max */ - max?: (number|null); - } - - /** Represents a Range. */ - class Range implements IRange { - - /** - * Constructs a new Range. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.Distribution.IRange); - - /** Range min. */ - public min: number; - - /** Range max. */ - public max: number; - - /** - * Creates a new Range instance using the specified properties. - * @param [properties] Properties to set - * @returns Range instance - */ - public static create(properties?: google.api.Distribution.IRange): google.api.Distribution.Range; - - /** - * Encodes the specified Range message. Does not implicitly {@link google.api.Distribution.Range.verify|verify} messages. - * @param message Range message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.Distribution.IRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Range message, length delimited. Does not implicitly {@link google.api.Distribution.Range.verify|verify} messages. - * @param message Range message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.Distribution.IRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Range message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Range - * @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.Distribution.Range; - - /** - * Decodes a Range message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Range - * @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.Distribution.Range; - - /** - * Verifies a Range 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 Range message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Range - */ - public static fromObject(object: { [k: string]: any }): google.api.Distribution.Range; - - /** - * Creates a plain object from a Range message. Also converts values to other types if specified. - * @param message Range - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Distribution.Range, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Range to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + namespace MetricDescriptor { - /** Properties of a BucketOptions. */ - interface IBucketOptions { + /** Properties of a MetricDescriptorMetadata. */ + interface IMetricDescriptorMetadata { - /** BucketOptions linearBuckets */ - linearBuckets?: (google.api.Distribution.BucketOptions.ILinear|null); + /** MetricDescriptorMetadata launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - /** BucketOptions exponentialBuckets */ - exponentialBuckets?: (google.api.Distribution.BucketOptions.IExponential|null); + /** MetricDescriptorMetadata samplePeriod */ + samplePeriod?: (google.protobuf.IDuration|null); - /** BucketOptions explicitBuckets */ - explicitBuckets?: (google.api.Distribution.BucketOptions.IExplicit|null); + /** MetricDescriptorMetadata ingestDelay */ + ingestDelay?: (google.protobuf.IDuration|null); } - /** Represents a BucketOptions. */ - class BucketOptions implements IBucketOptions { + /** Represents a MetricDescriptorMetadata. */ + class MetricDescriptorMetadata implements IMetricDescriptorMetadata { /** - * Constructs a new BucketOptions. + * Constructs a new MetricDescriptorMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.api.Distribution.IBucketOptions); - - /** BucketOptions linearBuckets. */ - public linearBuckets?: (google.api.Distribution.BucketOptions.ILinear|null); + constructor(properties?: google.api.MetricDescriptor.IMetricDescriptorMetadata); - /** BucketOptions exponentialBuckets. */ - public exponentialBuckets?: (google.api.Distribution.BucketOptions.IExponential|null); + /** MetricDescriptorMetadata launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - /** BucketOptions explicitBuckets. */ - public explicitBuckets?: (google.api.Distribution.BucketOptions.IExplicit|null); + /** MetricDescriptorMetadata samplePeriod. */ + public samplePeriod?: (google.protobuf.IDuration|null); - /** BucketOptions options. */ - public options?: ("linearBuckets"|"exponentialBuckets"|"explicitBuckets"); + /** MetricDescriptorMetadata ingestDelay. */ + public ingestDelay?: (google.protobuf.IDuration|null); /** - * Creates a new BucketOptions instance using the specified properties. + * Creates a new MetricDescriptorMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns BucketOptions instance + * @returns MetricDescriptorMetadata instance */ - public static create(properties?: google.api.Distribution.IBucketOptions): google.api.Distribution.BucketOptions; + public static create(properties?: google.api.MetricDescriptor.IMetricDescriptorMetadata): google.api.MetricDescriptor.MetricDescriptorMetadata; /** - * Encodes the specified BucketOptions message. Does not implicitly {@link google.api.Distribution.BucketOptions.verify|verify} messages. - * @param message BucketOptions message or plain object to encode + * Encodes the specified MetricDescriptorMetadata message. Does not implicitly {@link google.api.MetricDescriptor.MetricDescriptorMetadata.verify|verify} messages. + * @param message MetricDescriptorMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.api.Distribution.IBucketOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.MetricDescriptor.IMetricDescriptorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BucketOptions message, length delimited. Does not implicitly {@link google.api.Distribution.BucketOptions.verify|verify} messages. - * @param message BucketOptions message or plain object to encode + * Encodes the specified MetricDescriptorMetadata message, length delimited. Does not implicitly {@link google.api.MetricDescriptor.MetricDescriptorMetadata.verify|verify} messages. + * @param message MetricDescriptorMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.api.Distribution.IBucketOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.MetricDescriptor.IMetricDescriptorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BucketOptions message from the specified reader or buffer. + * Decodes a MetricDescriptorMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BucketOptions + * @returns MetricDescriptorMetadata * @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.Distribution.BucketOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MetricDescriptor.MetricDescriptorMetadata; /** - * Decodes a BucketOptions message from the specified reader or buffer, length delimited. + * Decodes a MetricDescriptorMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BucketOptions + * @returns MetricDescriptorMetadata * @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.Distribution.BucketOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MetricDescriptor.MetricDescriptorMetadata; /** - * Verifies a BucketOptions message. + * Verifies a MetricDescriptorMetadata 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 BucketOptions message from a plain object. Also converts values to their respective internal types. + * Creates a MetricDescriptorMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BucketOptions + * @returns MetricDescriptorMetadata */ - public static fromObject(object: { [k: string]: any }): google.api.Distribution.BucketOptions; + public static fromObject(object: { [k: string]: any }): google.api.MetricDescriptor.MetricDescriptorMetadata; /** - * Creates a plain object from a BucketOptions message. Also converts values to other types if specified. - * @param message BucketOptions + * Creates a plain object from a MetricDescriptorMetadata message. Also converts values to other types if specified. + * @param message MetricDescriptorMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.Distribution.BucketOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.MetricDescriptor.MetricDescriptorMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BucketOptions to JSON. + * Converts this MetricDescriptorMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace BucketOptions { + /** MetricKind enum. */ + enum MetricKind { + METRIC_KIND_UNSPECIFIED = 0, + GAUGE = 1, + DELTA = 2, + CUMULATIVE = 3 + } - /** Properties of a Linear. */ - interface ILinear { + /** ValueType enum. */ + enum ValueType { + VALUE_TYPE_UNSPECIFIED = 0, + BOOL = 1, + INT64 = 2, + DOUBLE = 3, + STRING = 4, + DISTRIBUTION = 5, + MONEY = 6 + } + } - /** Linear numFiniteBuckets */ - numFiniteBuckets?: (number|null); + /** Properties of a Metric. */ + interface IMetric { - /** Linear width */ - width?: (number|null); + /** Metric type */ + type?: (string|null); - /** Linear offset */ - offset?: (number|null); - } + /** Metric labels */ + labels?: ({ [k: string]: string }|null); + } - /** Represents a Linear. */ - class Linear implements ILinear { + /** Represents a Metric. */ + class Metric implements IMetric { - /** - * Constructs a new Linear. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.Distribution.BucketOptions.ILinear); + /** + * Constructs a new Metric. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMetric); - /** Linear numFiniteBuckets. */ - public numFiniteBuckets: number; + /** Metric type. */ + public type: string; - /** Linear width. */ - public width: number; + /** Metric labels. */ + public labels: { [k: string]: string }; - /** Linear offset. */ - public offset: number; + /** + * Creates a new Metric instance using the specified properties. + * @param [properties] Properties to set + * @returns Metric instance + */ + public static create(properties?: google.api.IMetric): google.api.Metric; - /** - * Creates a new Linear instance using the specified properties. - * @param [properties] Properties to set - * @returns Linear instance - */ - public static create(properties?: google.api.Distribution.BucketOptions.ILinear): google.api.Distribution.BucketOptions.Linear; + /** + * Encodes the specified Metric message. Does not implicitly {@link google.api.Metric.verify|verify} messages. + * @param message Metric message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMetric, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified Linear message. Does not implicitly {@link google.api.Distribution.BucketOptions.Linear.verify|verify} messages. - * @param message Linear message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.Distribution.BucketOptions.ILinear, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified Metric message, length delimited. Does not implicitly {@link google.api.Metric.verify|verify} messages. + * @param message Metric message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMetric, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified Linear message, length delimited. Does not implicitly {@link google.api.Distribution.BucketOptions.Linear.verify|verify} messages. - * @param message Linear message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.Distribution.BucketOptions.ILinear, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a Metric message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Metric + * @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.Metric; + + /** + * Decodes a Metric message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Metric + * @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.Metric; + + /** + * Verifies a Metric 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 Metric message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Metric + */ + public static fromObject(object: { [k: string]: any }): google.api.Metric; + + /** + * Creates a plain object from a Metric message. Also converts values to other types if specified. + * @param message Metric + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Metric, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Metric to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations#listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations#getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations#deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations#cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations#waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a Linear message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Linear - * @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.Distribution.BucketOptions.Linear; + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a Linear message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Linear - * @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.Distribution.BucketOptions.Linear; + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @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.longrunning.Operation; - /** - * Verifies a Linear 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); + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @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.longrunning.Operation; - /** - * Creates a Linear message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Linear - */ - public static fromObject(object: { [k: string]: any }): google.api.Distribution.BucketOptions.Linear; + /** + * Verifies an Operation 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 plain object from a Linear message. Also converts values to other types if specified. - * @param message Linear - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Distribution.BucketOptions.Linear, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; - /** - * Converts this Linear to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Properties of an Exponential. */ - interface IExponential { + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Exponential numFiniteBuckets */ - numFiniteBuckets?: (number|null); + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { - /** Exponential growthFactor */ - growthFactor?: (number|null); + /** GetOperationRequest name */ + name?: (string|null); + } - /** Exponential scale */ - scale?: (number|null); - } + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { - /** Represents an Exponential. */ - class Exponential implements IExponential { + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); - /** - * Constructs a new Exponential. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.Distribution.BucketOptions.IExponential); + /** GetOperationRequest name. */ + public name: string; - /** Exponential numFiniteBuckets. */ - public numFiniteBuckets: number; + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; - /** Exponential growthFactor. */ - public growthFactor: number; + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Exponential scale. */ - public scale: number; + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new Exponential instance using the specified properties. - * @param [properties] Properties to set - * @returns Exponential instance - */ - public static create(properties?: google.api.Distribution.BucketOptions.IExponential): google.api.Distribution.BucketOptions.Exponential; + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @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.longrunning.GetOperationRequest; - /** - * Encodes the specified Exponential message. Does not implicitly {@link google.api.Distribution.BucketOptions.Exponential.verify|verify} messages. - * @param message Exponential message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.Distribution.BucketOptions.IExponential, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @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.longrunning.GetOperationRequest; - /** - * Encodes the specified Exponential message, length delimited. Does not implicitly {@link google.api.Distribution.BucketOptions.Exponential.verify|verify} messages. - * @param message Exponential message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.Distribution.BucketOptions.IExponential, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a GetOperationRequest 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); - /** - * Decodes an Exponential message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Exponential - * @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.Distribution.BucketOptions.Exponential; + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; - /** - * Decodes an Exponential message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Exponential - * @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.Distribution.BucketOptions.Exponential; + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Verifies an Exponential 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); + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates an Exponential message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Exponential - */ - public static fromObject(object: { [k: string]: any }): google.api.Distribution.BucketOptions.Exponential; + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { - /** - * Creates a plain object from an Exponential message. Also converts values to other types if specified. - * @param message Exponential - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Distribution.BucketOptions.Exponential, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ListOperationsRequest name */ + name?: (string|null); - /** - * Converts this Exponential to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ListOperationsRequest filter */ + filter?: (string|null); - /** Properties of an Explicit. */ - interface IExplicit { + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); - /** Explicit bounds */ - bounds?: (number[]|null); - } + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } - /** Represents an Explicit. */ - class Explicit implements IExplicit { + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { - /** - * Constructs a new Explicit. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.Distribution.BucketOptions.IExplicit); + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); - /** Explicit bounds. */ - public bounds: number[]; + /** ListOperationsRequest name. */ + public name: string; - /** - * Creates a new Explicit instance using the specified properties. - * @param [properties] Properties to set - * @returns Explicit instance - */ - public static create(properties?: google.api.Distribution.BucketOptions.IExplicit): google.api.Distribution.BucketOptions.Explicit; + /** ListOperationsRequest filter. */ + public filter: string; - /** - * Encodes the specified Explicit message. Does not implicitly {@link google.api.Distribution.BucketOptions.Explicit.verify|verify} messages. - * @param message Explicit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.Distribution.BucketOptions.IExplicit, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListOperationsRequest pageSize. */ + public pageSize: number; - /** - * Encodes the specified Explicit message, length delimited. Does not implicitly {@link google.api.Distribution.BucketOptions.Explicit.verify|verify} messages. - * @param message Explicit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.Distribution.BucketOptions.IExplicit, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListOperationsRequest pageToken. */ + public pageToken: string; - /** - * Decodes an Explicit message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Explicit - * @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.Distribution.BucketOptions.Explicit; + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes an Explicit message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Explicit - * @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.Distribution.BucketOptions.Explicit; + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies an Explicit 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); + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @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.longrunning.ListOperationsRequest; - /** - * Creates an Explicit message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Explicit - */ - public static fromObject(object: { [k: string]: any }): google.api.Distribution.BucketOptions.Explicit; + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @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.longrunning.ListOperationsRequest; - /** - * Creates a plain object from an Explicit message. Also converts values to other types if specified. - * @param message Explicit - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Distribution.BucketOptions.Explicit, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Verifies a ListOperationsRequest 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); - /** - * Converts this Explicit to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; - /** Properties of an Exemplar. */ - interface IExemplar { + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Exemplar value */ - value?: (number|null); + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Exemplar timestamp */ - timestamp?: (google.protobuf.ITimestamp|null); + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { - /** Exemplar attachments */ - attachments?: (google.protobuf.IAny[]|null); - } + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); - /** Represents an Exemplar. */ - class Exemplar implements IExemplar { + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } - /** - * Constructs a new Exemplar. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.Distribution.IExemplar); + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { - /** Exemplar value. */ - public value: number; + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); - /** Exemplar timestamp. */ - public timestamp?: (google.protobuf.ITimestamp|null); + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; - /** Exemplar attachments. */ - public attachments: google.protobuf.IAny[]; + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; - /** - * Creates a new Exemplar instance using the specified properties. - * @param [properties] Properties to set - * @returns Exemplar instance - */ - public static create(properties?: google.api.Distribution.IExemplar): google.api.Distribution.Exemplar; + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; - /** - * Encodes the specified Exemplar message. Does not implicitly {@link google.api.Distribution.Exemplar.verify|verify} messages. - * @param message Exemplar message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.Distribution.IExemplar, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified Exemplar message, length delimited. Does not implicitly {@link google.api.Distribution.Exemplar.verify|verify} messages. - * @param message Exemplar message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.Distribution.IExemplar, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes an Exemplar message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Exemplar - * @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.Distribution.Exemplar; + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @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.longrunning.ListOperationsResponse; - /** - * Decodes an Exemplar message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Exemplar - * @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.Distribution.Exemplar; + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @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.longrunning.ListOperationsResponse; - /** - * Verifies an Exemplar 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); + /** + * Verifies a ListOperationsResponse 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 an Exemplar message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Exemplar - */ - public static fromObject(object: { [k: string]: any }): google.api.Distribution.Exemplar; + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; - /** - * Creates a plain object from an Exemplar message. Also converts values to other types if specified. - * @param message Exemplar - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Distribution.Exemplar, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this Exemplar to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; } - /** Properties of a MetricDescriptor. */ - interface IMetricDescriptor { + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { - /** MetricDescriptor name */ + /** CancelOperationRequest name */ name?: (string|null); + } - /** MetricDescriptor type */ - type?: (string|null); - - /** MetricDescriptor labels */ - labels?: (google.api.ILabelDescriptor[]|null); - - /** MetricDescriptor metricKind */ - metricKind?: (google.api.MetricDescriptor.MetricKind|keyof typeof google.api.MetricDescriptor.MetricKind|null); + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { - /** MetricDescriptor valueType */ - valueType?: (google.api.MetricDescriptor.ValueType|keyof typeof google.api.MetricDescriptor.ValueType|null); + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); - /** MetricDescriptor unit */ - unit?: (string|null); + /** CancelOperationRequest name. */ + public name: string; - /** MetricDescriptor description */ - description?: (string|null); + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; - /** MetricDescriptor displayName */ - displayName?: (string|null); + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** MetricDescriptor metadata */ - metadata?: (google.api.MetricDescriptor.IMetricDescriptorMetadata|null); + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** MetricDescriptor launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @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.longrunning.CancelOperationRequest; - /** MetricDescriptor monitoredResourceTypes */ - monitoredResourceTypes?: (string[]|null); - } + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @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.longrunning.CancelOperationRequest; - /** Represents a MetricDescriptor. */ - class MetricDescriptor implements IMetricDescriptor { + /** + * Verifies a CancelOperationRequest 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); /** - * Constructs a new MetricDescriptor. - * @param [properties] Properties to set + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest */ - constructor(properties?: google.api.IMetricDescriptor); - - /** MetricDescriptor name. */ - public name: string; - - /** MetricDescriptor type. */ - public type: string; - - /** MetricDescriptor labels. */ - public labels: google.api.ILabelDescriptor[]; - - /** MetricDescriptor metricKind. */ - public metricKind: (google.api.MetricDescriptor.MetricKind|keyof typeof google.api.MetricDescriptor.MetricKind); + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; - /** MetricDescriptor valueType. */ - public valueType: (google.api.MetricDescriptor.ValueType|keyof typeof google.api.MetricDescriptor.ValueType); + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** MetricDescriptor unit. */ - public unit: string; + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** MetricDescriptor description. */ - public description: string; + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { - /** MetricDescriptor displayName. */ - public displayName: string; + /** DeleteOperationRequest name */ + name?: (string|null); + } - /** MetricDescriptor metadata. */ - public metadata?: (google.api.MetricDescriptor.IMetricDescriptorMetadata|null); + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { - /** MetricDescriptor launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); - /** MetricDescriptor monitoredResourceTypes. */ - public monitoredResourceTypes: string[]; + /** DeleteOperationRequest name. */ + public name: string; /** - * Creates a new MetricDescriptor instance using the specified properties. + * Creates a new DeleteOperationRequest instance using the specified properties. * @param [properties] Properties to set - * @returns MetricDescriptor instance + * @returns DeleteOperationRequest instance */ - public static create(properties?: google.api.IMetricDescriptor): google.api.MetricDescriptor; + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; /** - * Encodes the specified MetricDescriptor message. Does not implicitly {@link google.api.MetricDescriptor.verify|verify} messages. - * @param message MetricDescriptor message or plain object to encode + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.api.IMetricDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MetricDescriptor message, length delimited. Does not implicitly {@link google.api.MetricDescriptor.verify|verify} messages. - * @param message MetricDescriptor message or plain object to encode + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.api.IMetricDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MetricDescriptor message from the specified reader or buffer. + * Decodes a DeleteOperationRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MetricDescriptor + * @returns DeleteOperationRequest * @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.MetricDescriptor; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; /** - * Decodes a MetricDescriptor message from the specified reader or buffer, length delimited. + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MetricDescriptor + * @returns DeleteOperationRequest * @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.MetricDescriptor; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; /** - * Verifies a MetricDescriptor message. + * Verifies a DeleteOperationRequest 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 MetricDescriptor message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MetricDescriptor + * @returns DeleteOperationRequest */ - public static fromObject(object: { [k: string]: any }): google.api.MetricDescriptor; + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; /** - * Creates a plain object from a MetricDescriptor message. Also converts values to other types if specified. - * @param message MetricDescriptor + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.MetricDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MetricDescriptor to JSON. + * Converts this DeleteOperationRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace MetricDescriptor { - - /** Properties of a MetricDescriptorMetadata. */ - interface IMetricDescriptorMetadata { - - /** MetricDescriptorMetadata launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** MetricDescriptorMetadata samplePeriod */ - samplePeriod?: (google.protobuf.IDuration|null); - - /** MetricDescriptorMetadata ingestDelay */ - ingestDelay?: (google.protobuf.IDuration|null); - } - - /** Represents a MetricDescriptorMetadata. */ - class MetricDescriptorMetadata implements IMetricDescriptorMetadata { + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { - /** - * Constructs a new MetricDescriptorMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.MetricDescriptor.IMetricDescriptorMetadata); + /** WaitOperationRequest name */ + name?: (string|null); - /** MetricDescriptorMetadata launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } - /** MetricDescriptorMetadata samplePeriod. */ - public samplePeriod?: (google.protobuf.IDuration|null); + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { - /** MetricDescriptorMetadata ingestDelay. */ - public ingestDelay?: (google.protobuf.IDuration|null); + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); - /** - * Creates a new MetricDescriptorMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns MetricDescriptorMetadata instance - */ - public static create(properties?: google.api.MetricDescriptor.IMetricDescriptorMetadata): google.api.MetricDescriptor.MetricDescriptorMetadata; + /** WaitOperationRequest name. */ + public name: string; - /** - * Encodes the specified MetricDescriptorMetadata message. Does not implicitly {@link google.api.MetricDescriptor.MetricDescriptorMetadata.verify|verify} messages. - * @param message MetricDescriptorMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.MetricDescriptor.IMetricDescriptorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); - /** - * Encodes the specified MetricDescriptorMetadata message, length delimited. Does not implicitly {@link google.api.MetricDescriptor.MetricDescriptorMetadata.verify|verify} messages. - * @param message MetricDescriptorMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.MetricDescriptor.IMetricDescriptorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; - /** - * Decodes a MetricDescriptorMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MetricDescriptorMetadata - * @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.MetricDescriptor.MetricDescriptorMetadata; + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a MetricDescriptorMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MetricDescriptorMetadata - * @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.MetricDescriptor.MetricDescriptorMetadata; + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies a MetricDescriptorMetadata 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); + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @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.longrunning.WaitOperationRequest; - /** - * Creates a MetricDescriptorMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MetricDescriptorMetadata - */ - public static fromObject(object: { [k: string]: any }): google.api.MetricDescriptor.MetricDescriptorMetadata; + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @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.longrunning.WaitOperationRequest; - /** - * Creates a plain object from a MetricDescriptorMetadata message. Also converts values to other types if specified. - * @param message MetricDescriptorMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MetricDescriptor.MetricDescriptorMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Verifies a WaitOperationRequest 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); - /** - * Converts this MetricDescriptorMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; - /** MetricKind enum. */ - enum MetricKind { - METRIC_KIND_UNSPECIFIED = 0, - GAUGE = 1, - DELTA = 2, - CUMULATIVE = 3 - } + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ValueType enum. */ - enum ValueType { - VALUE_TYPE_UNSPECIFIED = 0, - BOOL = 1, - INT64 = 2, - DOUBLE = 3, - STRING = 4, - DISTRIBUTION = 5, - MONEY = 6 - } + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; } - /** Properties of a Metric. */ - interface IMetric { + /** Properties of an OperationInfo. */ + interface IOperationInfo { - /** Metric type */ - type?: (string|null); + /** OperationInfo responseType */ + responseType?: (string|null); - /** Metric labels */ - labels?: ({ [k: string]: string }|null); + /** OperationInfo metadataType */ + metadataType?: (string|null); } - /** Represents a Metric. */ - class Metric implements IMetric { + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { /** - * Constructs a new Metric. + * Constructs a new OperationInfo. * @param [properties] Properties to set */ - constructor(properties?: google.api.IMetric); + constructor(properties?: google.longrunning.IOperationInfo); - /** Metric type. */ - public type: string; + /** OperationInfo responseType. */ + public responseType: string; - /** Metric labels. */ - public labels: { [k: string]: string }; + /** OperationInfo metadataType. */ + public metadataType: string; /** - * Creates a new Metric instance using the specified properties. + * Creates a new OperationInfo instance using the specified properties. * @param [properties] Properties to set - * @returns Metric instance + * @returns OperationInfo instance */ - public static create(properties?: google.api.IMetric): google.api.Metric; + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; /** - * Encodes the specified Metric message. Does not implicitly {@link google.api.Metric.verify|verify} messages. - * @param message Metric message or plain object to encode + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.api.IMetric, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Metric message, length delimited. Does not implicitly {@link google.api.Metric.verify|verify} messages. - * @param message Metric message or plain object to encode + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.api.IMetric, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Metric message from the specified reader or buffer. + * Decodes an OperationInfo message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Metric + * @returns OperationInfo * @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.Metric; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; /** - * Decodes a Metric message from the specified reader or buffer, length delimited. + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Metric + * @returns OperationInfo * @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.Metric; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; /** - * Verifies a Metric message. + * Verifies an OperationInfo 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 Metric message from a plain object. Also converts values to their respective internal types. + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Metric + * @returns OperationInfo */ - public static fromObject(object: { [k: string]: any }): google.api.Metric; + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; /** - * Creates a plain object from a Metric message. Also converts values to other types if specified. - * @param message Metric + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.Metric, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Metric to JSON. + * Converts this OperationInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; diff --git a/protos/protos.js b/protos/protos.js index efe610db..28cb13e9 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -6988,6 +6988,7 @@ * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo */ /** @@ -7047,6 +7048,14 @@ */ MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + /** * Creates a new MethodOptions instance using the specified properties. * @function create @@ -7078,6 +7087,8 @@ if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); @@ -7136,6 +7147,9 @@ message[".google.api.methodSignature"] = []; message[".google.api.methodSignature"].push(reader.string()); break; + case 1049: + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -7204,6 +7218,11 @@ if (!$util.isString(message[".google.api.methodSignature"][i])) return ".google.api.methodSignature: string[] expected"; } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } return null; }; @@ -7257,6 +7276,11 @@ for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } return message; }; @@ -7280,6 +7304,7 @@ if (options.defaults) { object.deprecated = false; object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.longrunning.operationInfo"] = null; object[".google.api.http"] = null; } if (message.deprecated != null && message.hasOwnProperty("deprecated")) @@ -7291,6 +7316,8 @@ for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { object[".google.api.methodSignature"] = []; for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) @@ -11203,6 +11230,7 @@ * @property {string|null} [spanId] LogEntry spanId * @property {boolean|null} [traceSampled] LogEntry traceSampled * @property {google.logging.v2.ILogEntrySourceLocation|null} [sourceLocation] LogEntry sourceLocation + * @property {google.logging.v2.ILogSplit|null} [split] LogEntry split */ /** @@ -11349,6 +11377,14 @@ */ LogEntry.prototype.sourceLocation = null; + /** + * LogEntry split. + * @member {google.logging.v2.ILogSplit|null|undefined} split + * @memberof google.logging.v2.LogEntry + * @instance + */ + LogEntry.prototype.split = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -11420,6 +11456,8 @@ writer.uint32(/* id 27, wireType 2 =*/218).string(message.spanId); if (message.traceSampled != null && Object.hasOwnProperty.call(message, "traceSampled")) writer.uint32(/* id 30, wireType 0 =*/240).bool(message.traceSampled); + if (message.split != null && Object.hasOwnProperty.call(message, "split")) + $root.google.logging.v2.LogSplit.encode(message.split, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); return writer; }; @@ -11521,6 +11559,9 @@ case 23: message.sourceLocation = $root.google.logging.v2.LogEntrySourceLocation.decode(reader, reader.uint32()); break; + case 35: + message.split = $root.google.logging.v2.LogSplit.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -11650,6 +11691,11 @@ if (error) return "sourceLocation." + error; } + if (message.split != null && message.hasOwnProperty("split")) { + var error = $root.google.logging.v2.LogSplit.verify(message.split); + if (error) + return "split." + error; + } return null; }; @@ -11762,6 +11808,11 @@ throw TypeError(".google.logging.v2.LogEntry.sourceLocation: object expected"); message.sourceLocation = $root.google.logging.v2.LogEntrySourceLocation.fromObject(object.sourceLocation); } + if (object.split != null) { + if (typeof object.split !== "object") + throw TypeError(".google.logging.v2.LogEntry.split: object expected"); + message.split = $root.google.logging.v2.LogSplit.fromObject(object.split); + } return message; }; @@ -11793,6 +11844,7 @@ object.receiveTimestamp = null; object.spanId = ""; object.traceSampled = false; + object.split = null; } if (message.protoPayload != null && message.hasOwnProperty("protoPayload")) { object.protoPayload = $root.google.protobuf.Any.toObject(message.protoPayload, options); @@ -11839,6 +11891,8 @@ object.spanId = message.spanId; if (message.traceSampled != null && message.hasOwnProperty("traceSampled")) object.traceSampled = message.traceSampled; + if (message.split != null && message.hasOwnProperty("split")) + object.split = $root.google.logging.v2.LogSplit.toObject(message.split, options); return object; }; @@ -12356,6 +12410,238 @@ return LogEntrySourceLocation; })(); + v2.LogSplit = (function() { + + /** + * Properties of a LogSplit. + * @memberof google.logging.v2 + * @interface ILogSplit + * @property {string|null} [uid] LogSplit uid + * @property {number|null} [index] LogSplit index + * @property {number|null} [totalSplits] LogSplit totalSplits + */ + + /** + * Constructs a new LogSplit. + * @memberof google.logging.v2 + * @classdesc Represents a LogSplit. + * @implements ILogSplit + * @constructor + * @param {google.logging.v2.ILogSplit=} [properties] Properties to set + */ + function LogSplit(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]]; + } + + /** + * LogSplit uid. + * @member {string} uid + * @memberof google.logging.v2.LogSplit + * @instance + */ + LogSplit.prototype.uid = ""; + + /** + * LogSplit index. + * @member {number} index + * @memberof google.logging.v2.LogSplit + * @instance + */ + LogSplit.prototype.index = 0; + + /** + * LogSplit totalSplits. + * @member {number} totalSplits + * @memberof google.logging.v2.LogSplit + * @instance + */ + LogSplit.prototype.totalSplits = 0; + + /** + * Creates a new LogSplit instance using the specified properties. + * @function create + * @memberof google.logging.v2.LogSplit + * @static + * @param {google.logging.v2.ILogSplit=} [properties] Properties to set + * @returns {google.logging.v2.LogSplit} LogSplit instance + */ + LogSplit.create = function create(properties) { + return new LogSplit(properties); + }; + + /** + * Encodes the specified LogSplit message. Does not implicitly {@link google.logging.v2.LogSplit.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.LogSplit + * @static + * @param {google.logging.v2.ILogSplit} message LogSplit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogSplit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uid); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.index); + if (message.totalSplits != null && Object.hasOwnProperty.call(message, "totalSplits")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSplits); + return writer; + }; + + /** + * Encodes the specified LogSplit message, length delimited. Does not implicitly {@link google.logging.v2.LogSplit.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.LogSplit + * @static + * @param {google.logging.v2.ILogSplit} message LogSplit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogSplit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LogSplit message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.LogSplit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.LogSplit} LogSplit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogSplit.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.logging.v2.LogSplit(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uid = reader.string(); + break; + case 2: + message.index = reader.int32(); + break; + case 3: + message.totalSplits = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LogSplit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.LogSplit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.LogSplit} LogSplit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogSplit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LogSplit message. + * @function verify + * @memberof google.logging.v2.LogSplit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LogSplit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index)) + return "index: integer expected"; + if (message.totalSplits != null && message.hasOwnProperty("totalSplits")) + if (!$util.isInteger(message.totalSplits)) + return "totalSplits: integer expected"; + return null; + }; + + /** + * Creates a LogSplit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.LogSplit + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.LogSplit} LogSplit + */ + LogSplit.fromObject = function fromObject(object) { + if (object instanceof $root.google.logging.v2.LogSplit) + return object; + var message = new $root.google.logging.v2.LogSplit(); + if (object.uid != null) + message.uid = String(object.uid); + if (object.index != null) + message.index = object.index | 0; + if (object.totalSplits != null) + message.totalSplits = object.totalSplits | 0; + return message; + }; + + /** + * Creates a plain object from a LogSplit message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.LogSplit + * @static + * @param {google.logging.v2.LogSplit} message LogSplit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogSplit.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.uid = ""; + object.index = 0; + object.totalSplits = 0; + } + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + if (message.totalSplits != null && message.hasOwnProperty("totalSplits")) + object.totalSplits = message.totalSplits; + return object; + }; + + /** + * Converts this LogSplit to JSON. + * @function toJSON + * @memberof google.logging.v2.LogSplit + * @instance + * @returns {Object.} JSON object + */ + LogSplit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LogSplit; + })(); + v2.LoggingServiceV2 = (function() { /** @@ -16533,6 +16819,105 @@ * @variation 2 */ + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2#getSettings}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef GetSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.Settings} [response] Settings + */ + + /** + * Calls GetSettings. + * @function getSettings + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IGetSettingsRequest} request GetSettingsRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.GetSettingsCallback} callback Node-style callback called with the error, if any, and Settings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.getSettings = function getSettings(request, callback) { + return this.rpcCall(getSettings, $root.google.logging.v2.GetSettingsRequest, $root.google.logging.v2.Settings, request, callback); + }, "name", { value: "GetSettings" }); + + /** + * Calls GetSettings. + * @function getSettings + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IGetSettingsRequest} request GetSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2#updateSettings}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef UpdateSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.Settings} [response] Settings + */ + + /** + * Calls UpdateSettings. + * @function updateSettings + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IUpdateSettingsRequest} request UpdateSettingsRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.UpdateSettingsCallback} callback Node-style callback called with the error, if any, and Settings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.updateSettings = function updateSettings(request, callback) { + return this.rpcCall(updateSettings, $root.google.logging.v2.UpdateSettingsRequest, $root.google.logging.v2.Settings, request, callback); + }, "name", { value: "UpdateSettings" }); + + /** + * Calls UpdateSettings. + * @function updateSettings + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IUpdateSettingsRequest} request UpdateSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2#copyLogEntries}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef CopyLogEntriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CopyLogEntries. + * @function copyLogEntries + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.ICopyLogEntriesRequest} request CopyLogEntriesRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.CopyLogEntriesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.copyLogEntries = function copyLogEntries(request, callback) { + return this.rpcCall(copyLogEntries, $root.google.logging.v2.CopyLogEntriesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CopyLogEntries" }); + + /** + * Calls CopyLogEntries. + * @function copyLogEntries + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.ICopyLogEntriesRequest} request CopyLogEntriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return ConfigServiceV2; })(); @@ -16549,6 +16934,8 @@ * @property {number|null} [retentionDays] LogBucket retentionDays * @property {boolean|null} [locked] LogBucket locked * @property {google.logging.v2.LifecycleState|null} [lifecycleState] LogBucket lifecycleState + * @property {Array.|null} [restrictedFields] LogBucket restrictedFields + * @property {google.logging.v2.ICmekSettings|null} [cmekSettings] LogBucket cmekSettings */ /** @@ -16560,6 +16947,7 @@ * @param {google.logging.v2.ILogBucket=} [properties] Properties to set */ function LogBucket(properties) { + this.restrictedFields = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16622,6 +17010,22 @@ */ LogBucket.prototype.lifecycleState = 0; + /** + * LogBucket restrictedFields. + * @member {Array.} restrictedFields + * @memberof google.logging.v2.LogBucket + * @instance + */ + LogBucket.prototype.restrictedFields = $util.emptyArray; + + /** + * LogBucket cmekSettings. + * @member {google.logging.v2.ICmekSettings|null|undefined} cmekSettings + * @memberof google.logging.v2.LogBucket + * @instance + */ + LogBucket.prototype.cmekSettings = null; + /** * Creates a new LogBucket instance using the specified properties. * @function create @@ -16660,6 +17064,11 @@ writer.uint32(/* id 11, wireType 0 =*/88).int32(message.retentionDays); if (message.lifecycleState != null && Object.hasOwnProperty.call(message, "lifecycleState")) writer.uint32(/* id 12, wireType 0 =*/96).int32(message.lifecycleState); + if (message.restrictedFields != null && message.restrictedFields.length) + for (var i = 0; i < message.restrictedFields.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.restrictedFields[i]); + if (message.cmekSettings != null && Object.hasOwnProperty.call(message, "cmekSettings")) + $root.google.logging.v2.CmekSettings.encode(message.cmekSettings, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); return writer; }; @@ -16715,6 +17124,14 @@ case 12: message.lifecycleState = reader.int32(); break; + case 15: + if (!(message.restrictedFields && message.restrictedFields.length)) + message.restrictedFields = []; + message.restrictedFields.push(reader.string()); + break; + case 19: + message.cmekSettings = $root.google.logging.v2.CmekSettings.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -16781,6 +17198,18 @@ case 2: break; } + if (message.restrictedFields != null && message.hasOwnProperty("restrictedFields")) { + if (!Array.isArray(message.restrictedFields)) + return "restrictedFields: array expected"; + for (var i = 0; i < message.restrictedFields.length; ++i) + if (!$util.isString(message.restrictedFields[i])) + return "restrictedFields: string[] expected"; + } + if (message.cmekSettings != null && message.hasOwnProperty("cmekSettings")) { + var error = $root.google.logging.v2.CmekSettings.verify(message.cmekSettings); + if (error) + return "cmekSettings." + error; + } return null; }; @@ -16828,6 +17257,18 @@ message.lifecycleState = 2; break; } + if (object.restrictedFields) { + if (!Array.isArray(object.restrictedFields)) + throw TypeError(".google.logging.v2.LogBucket.restrictedFields: array expected"); + message.restrictedFields = []; + for (var i = 0; i < object.restrictedFields.length; ++i) + message.restrictedFields[i] = String(object.restrictedFields[i]); + } + if (object.cmekSettings != null) { + if (typeof object.cmekSettings !== "object") + throw TypeError(".google.logging.v2.LogBucket.cmekSettings: object expected"); + message.cmekSettings = $root.google.logging.v2.CmekSettings.fromObject(object.cmekSettings); + } return message; }; @@ -16844,6 +17285,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.restrictedFields = []; if (options.defaults) { object.name = ""; object.description = ""; @@ -16852,6 +17295,7 @@ object.locked = false; object.retentionDays = 0; object.lifecycleState = options.enums === String ? "LIFECYCLE_STATE_UNSPECIFIED" : 0; + object.cmekSettings = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -16867,6 +17311,13 @@ object.retentionDays = message.retentionDays; if (message.lifecycleState != null && message.hasOwnProperty("lifecycleState")) object.lifecycleState = options.enums === String ? $root.google.logging.v2.LifecycleState[message.lifecycleState] : message.lifecycleState; + if (message.restrictedFields && message.restrictedFields.length) { + object.restrictedFields = []; + for (var j = 0; j < message.restrictedFields.length; ++j) + object.restrictedFields[j] = message.restrictedFields[j]; + } + if (message.cmekSettings != null && message.hasOwnProperty("cmekSettings")) + object.cmekSettings = $root.google.logging.v2.CmekSettings.toObject(message.cmekSettings, options); return object; }; @@ -16884,22 +17335,6 @@ return LogBucket; })(); - /** - * LifecycleState enum. - * @name google.logging.v2.LifecycleState - * @enum {number} - * @property {number} LIFECYCLE_STATE_UNSPECIFIED=0 LIFECYCLE_STATE_UNSPECIFIED value - * @property {number} ACTIVE=1 ACTIVE value - * @property {number} DELETE_REQUESTED=2 DELETE_REQUESTED value - */ - v2.LifecycleState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LIFECYCLE_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ACTIVE"] = 1; - values[valuesById[2] = "DELETE_REQUESTED"] = 2; - return values; - })(); - v2.LogView = (function() { /** @@ -24337,450 +24772,560 @@ return CmekSettings; })(); - v2.MetricsServiceV2 = (function() { + v2.GetSettingsRequest = (function() { /** - * Constructs a new MetricsServiceV2 service. + * Properties of a GetSettingsRequest. * @memberof google.logging.v2 - * @classdesc Represents a MetricsServiceV2 - * @extends $protobuf.rpc.Service + * @interface IGetSettingsRequest + * @property {string|null} [name] GetSettingsRequest name + */ + + /** + * Constructs a new GetSettingsRequest. + * @memberof google.logging.v2 + * @classdesc Represents a GetSettingsRequest. + * @implements IGetSettingsRequest * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @param {google.logging.v2.IGetSettingsRequest=} [properties] Properties to set */ - function MetricsServiceV2(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + function GetSettingsRequest(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]]; } - (MetricsServiceV2.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = MetricsServiceV2; + /** + * GetSettingsRequest name. + * @member {string} name + * @memberof google.logging.v2.GetSettingsRequest + * @instance + */ + GetSettingsRequest.prototype.name = ""; /** - * Creates new MetricsServiceV2 service using the specified rpc implementation. + * Creates a new GetSettingsRequest instance using the specified properties. * @function create - * @memberof google.logging.v2.MetricsServiceV2 + * @memberof google.logging.v2.GetSettingsRequest * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {MetricsServiceV2} RPC service. Useful where requests and/or responses are streamed. + * @param {google.logging.v2.IGetSettingsRequest=} [properties] Properties to set + * @returns {google.logging.v2.GetSettingsRequest} GetSettingsRequest instance */ - MetricsServiceV2.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); + GetSettingsRequest.create = function create(properties) { + return new GetSettingsRequest(properties); }; /** - * Callback as used by {@link google.logging.v2.MetricsServiceV2#listLogMetrics}. - * @memberof google.logging.v2.MetricsServiceV2 - * @typedef ListLogMetricsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.logging.v2.ListLogMetricsResponse} [response] ListLogMetricsResponse + * Encodes the specified GetSettingsRequest message. Does not implicitly {@link google.logging.v2.GetSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.GetSettingsRequest + * @static + * @param {google.logging.v2.IGetSettingsRequest} message GetSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + GetSettingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; /** - * Calls ListLogMetrics. - * @function listLogMetrics - * @memberof google.logging.v2.MetricsServiceV2 - * @instance - * @param {google.logging.v2.IListLogMetricsRequest} request ListLogMetricsRequest message or plain object - * @param {google.logging.v2.MetricsServiceV2.ListLogMetricsCallback} callback Node-style callback called with the error, if any, and ListLogMetricsResponse - * @returns {undefined} - * @variation 1 + * Encodes the specified GetSettingsRequest message, length delimited. Does not implicitly {@link google.logging.v2.GetSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.GetSettingsRequest + * @static + * @param {google.logging.v2.IGetSettingsRequest} message GetSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(MetricsServiceV2.prototype.listLogMetrics = function listLogMetrics(request, callback) { - return this.rpcCall(listLogMetrics, $root.google.logging.v2.ListLogMetricsRequest, $root.google.logging.v2.ListLogMetricsResponse, request, callback); - }, "name", { value: "ListLogMetrics" }); + GetSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls ListLogMetrics. - * @function listLogMetrics - * @memberof google.logging.v2.MetricsServiceV2 - * @instance - * @param {google.logging.v2.IListLogMetricsRequest} request ListLogMetricsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a GetSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.GetSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.GetSettingsRequest} GetSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + GetSettingsRequest.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.logging.v2.GetSettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.logging.v2.MetricsServiceV2#getLogMetric}. - * @memberof google.logging.v2.MetricsServiceV2 - * @typedef GetLogMetricCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.logging.v2.LogMetric} [response] LogMetric + * Decodes a GetSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.GetSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.GetSettingsRequest} GetSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + GetSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls GetLogMetric. - * @function getLogMetric - * @memberof google.logging.v2.MetricsServiceV2 - * @instance - * @param {google.logging.v2.IGetLogMetricRequest} request GetLogMetricRequest message or plain object - * @param {google.logging.v2.MetricsServiceV2.GetLogMetricCallback} callback Node-style callback called with the error, if any, and LogMetric - * @returns {undefined} - * @variation 1 + * Verifies a GetSettingsRequest message. + * @function verify + * @memberof google.logging.v2.GetSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(MetricsServiceV2.prototype.getLogMetric = function getLogMetric(request, callback) { - return this.rpcCall(getLogMetric, $root.google.logging.v2.GetLogMetricRequest, $root.google.logging.v2.LogMetric, request, callback); - }, "name", { value: "GetLogMetric" }); + GetSettingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; /** - * Calls GetLogMetric. - * @function getLogMetric - * @memberof google.logging.v2.MetricsServiceV2 - * @instance - * @param {google.logging.v2.IGetLogMetricRequest} request GetLogMetricRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a GetSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.GetSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.GetSettingsRequest} GetSettingsRequest */ + GetSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.logging.v2.GetSettingsRequest) + return object; + var message = new $root.google.logging.v2.GetSettingsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; /** - * Callback as used by {@link google.logging.v2.MetricsServiceV2#createLogMetric}. - * @memberof google.logging.v2.MetricsServiceV2 - * @typedef CreateLogMetricCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.logging.v2.LogMetric} [response] LogMetric + * Creates a plain object from a GetSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.GetSettingsRequest + * @static + * @param {google.logging.v2.GetSettingsRequest} message GetSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + GetSettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; /** - * Calls CreateLogMetric. - * @function createLogMetric - * @memberof google.logging.v2.MetricsServiceV2 + * Converts this GetSettingsRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.GetSettingsRequest * @instance - * @param {google.logging.v2.ICreateLogMetricRequest} request CreateLogMetricRequest message or plain object - * @param {google.logging.v2.MetricsServiceV2.CreateLogMetricCallback} callback Node-style callback called with the error, if any, and LogMetric - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(MetricsServiceV2.prototype.createLogMetric = function createLogMetric(request, callback) { - return this.rpcCall(createLogMetric, $root.google.logging.v2.CreateLogMetricRequest, $root.google.logging.v2.LogMetric, request, callback); - }, "name", { value: "CreateLogMetric" }); + GetSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Calls CreateLogMetric. - * @function createLogMetric - * @memberof google.logging.v2.MetricsServiceV2 - * @instance - * @param {google.logging.v2.ICreateLogMetricRequest} request CreateLogMetricRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + return GetSettingsRequest; + })(); + + v2.UpdateSettingsRequest = (function() { /** - * Callback as used by {@link google.logging.v2.MetricsServiceV2#updateLogMetric}. - * @memberof google.logging.v2.MetricsServiceV2 - * @typedef UpdateLogMetricCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.logging.v2.LogMetric} [response] LogMetric + * Properties of an UpdateSettingsRequest. + * @memberof google.logging.v2 + * @interface IUpdateSettingsRequest + * @property {string|null} [name] UpdateSettingsRequest name + * @property {google.logging.v2.ISettings|null} [settings] UpdateSettingsRequest settings + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSettingsRequest updateMask */ /** - * Calls UpdateLogMetric. - * @function updateLogMetric - * @memberof google.logging.v2.MetricsServiceV2 - * @instance - * @param {google.logging.v2.IUpdateLogMetricRequest} request UpdateLogMetricRequest message or plain object - * @param {google.logging.v2.MetricsServiceV2.UpdateLogMetricCallback} callback Node-style callback called with the error, if any, and LogMetric - * @returns {undefined} - * @variation 1 + * Constructs a new UpdateSettingsRequest. + * @memberof google.logging.v2 + * @classdesc Represents an UpdateSettingsRequest. + * @implements IUpdateSettingsRequest + * @constructor + * @param {google.logging.v2.IUpdateSettingsRequest=} [properties] Properties to set */ - Object.defineProperty(MetricsServiceV2.prototype.updateLogMetric = function updateLogMetric(request, callback) { - return this.rpcCall(updateLogMetric, $root.google.logging.v2.UpdateLogMetricRequest, $root.google.logging.v2.LogMetric, request, callback); - }, "name", { value: "UpdateLogMetric" }); + function UpdateSettingsRequest(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]]; + } /** - * Calls UpdateLogMetric. - * @function updateLogMetric - * @memberof google.logging.v2.MetricsServiceV2 + * UpdateSettingsRequest name. + * @member {string} name + * @memberof google.logging.v2.UpdateSettingsRequest * @instance - * @param {google.logging.v2.IUpdateLogMetricRequest} request UpdateLogMetricRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + UpdateSettingsRequest.prototype.name = ""; /** - * Callback as used by {@link google.logging.v2.MetricsServiceV2#deleteLogMetric}. - * @memberof google.logging.v2.MetricsServiceV2 - * @typedef DeleteLogMetricCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * UpdateSettingsRequest settings. + * @member {google.logging.v2.ISettings|null|undefined} settings + * @memberof google.logging.v2.UpdateSettingsRequest + * @instance */ + UpdateSettingsRequest.prototype.settings = null; /** - * Calls DeleteLogMetric. - * @function deleteLogMetric - * @memberof google.logging.v2.MetricsServiceV2 + * UpdateSettingsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.logging.v2.UpdateSettingsRequest * @instance - * @param {google.logging.v2.IDeleteLogMetricRequest} request DeleteLogMetricRequest message or plain object - * @param {google.logging.v2.MetricsServiceV2.DeleteLogMetricCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(MetricsServiceV2.prototype.deleteLogMetric = function deleteLogMetric(request, callback) { - return this.rpcCall(deleteLogMetric, $root.google.logging.v2.DeleteLogMetricRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteLogMetric" }); + UpdateSettingsRequest.prototype.updateMask = null; /** - * Calls DeleteLogMetric. - * @function deleteLogMetric - * @memberof google.logging.v2.MetricsServiceV2 - * @instance - * @param {google.logging.v2.IDeleteLogMetricRequest} request DeleteLogMetricRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a new UpdateSettingsRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.UpdateSettingsRequest + * @static + * @param {google.logging.v2.IUpdateSettingsRequest=} [properties] Properties to set + * @returns {google.logging.v2.UpdateSettingsRequest} UpdateSettingsRequest instance */ - - return MetricsServiceV2; - })(); - - v2.LogMetric = (function() { + UpdateSettingsRequest.create = function create(properties) { + return new UpdateSettingsRequest(properties); + }; /** - * Properties of a LogMetric. - * @memberof google.logging.v2 - * @interface ILogMetric - * @property {string|null} [name] LogMetric name - * @property {string|null} [description] LogMetric description - * @property {string|null} [filter] LogMetric filter - * @property {google.api.IMetricDescriptor|null} [metricDescriptor] LogMetric metricDescriptor - * @property {string|null} [valueExtractor] LogMetric valueExtractor - * @property {Object.|null} [labelExtractors] LogMetric labelExtractors - * @property {google.api.Distribution.IBucketOptions|null} [bucketOptions] LogMetric bucketOptions - * @property {google.protobuf.ITimestamp|null} [createTime] LogMetric createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] LogMetric updateTime - * @property {google.logging.v2.LogMetric.ApiVersion|null} [version] LogMetric version + * Encodes the specified UpdateSettingsRequest message. Does not implicitly {@link google.logging.v2.UpdateSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.UpdateSettingsRequest + * @static + * @param {google.logging.v2.IUpdateSettingsRequest} message UpdateSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + UpdateSettingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.settings != null && Object.hasOwnProperty.call(message, "settings")) + $root.google.logging.v2.Settings.encode(message.settings, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; /** - * Constructs a new LogMetric. - * @memberof google.logging.v2 - * @classdesc Represents a LogMetric. - * @implements ILogMetric - * @constructor - * @param {google.logging.v2.ILogMetric=} [properties] Properties to set + * Encodes the specified UpdateSettingsRequest message, length delimited. Does not implicitly {@link google.logging.v2.UpdateSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.UpdateSettingsRequest + * @static + * @param {google.logging.v2.IUpdateSettingsRequest} message UpdateSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - function LogMetric(properties) { - this.labelExtractors = {}; - 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]]; - } + UpdateSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * LogMetric name. - * @member {string} name - * @memberof google.logging.v2.LogMetric - * @instance + * Decodes an UpdateSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.UpdateSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.UpdateSettingsRequest} UpdateSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LogMetric.prototype.name = ""; + UpdateSettingsRequest.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.logging.v2.UpdateSettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.settings = $root.google.logging.v2.Settings.decode(reader, reader.uint32()); + break; + case 3: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * LogMetric description. - * @member {string} description - * @memberof google.logging.v2.LogMetric - * @instance + * Decodes an UpdateSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.UpdateSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.UpdateSettingsRequest} UpdateSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LogMetric.prototype.description = ""; + UpdateSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * LogMetric filter. - * @member {string} filter - * @memberof google.logging.v2.LogMetric - * @instance + * Verifies an UpdateSettingsRequest message. + * @function verify + * @memberof google.logging.v2.UpdateSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - LogMetric.prototype.filter = ""; + UpdateSettingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.settings != null && message.hasOwnProperty("settings")) { + var error = $root.google.logging.v2.Settings.verify(message.settings); + if (error) + return "settings." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; /** - * LogMetric metricDescriptor. - * @member {google.api.IMetricDescriptor|null|undefined} metricDescriptor - * @memberof google.logging.v2.LogMetric - * @instance + * Creates an UpdateSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.UpdateSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.UpdateSettingsRequest} UpdateSettingsRequest */ - LogMetric.prototype.metricDescriptor = null; + UpdateSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.logging.v2.UpdateSettingsRequest) + return object; + var message = new $root.google.logging.v2.UpdateSettingsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.settings != null) { + if (typeof object.settings !== "object") + throw TypeError(".google.logging.v2.UpdateSettingsRequest.settings: object expected"); + message.settings = $root.google.logging.v2.Settings.fromObject(object.settings); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.logging.v2.UpdateSettingsRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; /** - * LogMetric valueExtractor. - * @member {string} valueExtractor - * @memberof google.logging.v2.LogMetric - * @instance + * Creates a plain object from an UpdateSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.UpdateSettingsRequest + * @static + * @param {google.logging.v2.UpdateSettingsRequest} message UpdateSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - LogMetric.prototype.valueExtractor = ""; + UpdateSettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.settings = null; + object.updateMask = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.settings != null && message.hasOwnProperty("settings")) + object.settings = $root.google.logging.v2.Settings.toObject(message.settings, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; /** - * LogMetric labelExtractors. - * @member {Object.} labelExtractors - * @memberof google.logging.v2.LogMetric + * Converts this UpdateSettingsRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.UpdateSettingsRequest * @instance + * @returns {Object.} JSON object */ - LogMetric.prototype.labelExtractors = $util.emptyObject; + UpdateSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateSettingsRequest; + })(); + + v2.Settings = (function() { /** - * LogMetric bucketOptions. - * @member {google.api.Distribution.IBucketOptions|null|undefined} bucketOptions - * @memberof google.logging.v2.LogMetric - * @instance + * Properties of a Settings. + * @memberof google.logging.v2 + * @interface ISettings + * @property {string|null} [name] Settings name + * @property {string|null} [storageLocation] Settings storageLocation + * @property {boolean|null} [disableDefaultSink] Settings disableDefaultSink */ - LogMetric.prototype.bucketOptions = null; /** - * LogMetric createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.logging.v2.LogMetric + * Constructs a new Settings. + * @memberof google.logging.v2 + * @classdesc Represents a Settings. + * @implements ISettings + * @constructor + * @param {google.logging.v2.ISettings=} [properties] Properties to set + */ + function Settings(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]]; + } + + /** + * Settings name. + * @member {string} name + * @memberof google.logging.v2.Settings * @instance */ - LogMetric.prototype.createTime = null; + Settings.prototype.name = ""; /** - * LogMetric updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.logging.v2.LogMetric + * Settings storageLocation. + * @member {string} storageLocation + * @memberof google.logging.v2.Settings * @instance */ - LogMetric.prototype.updateTime = null; + Settings.prototype.storageLocation = ""; /** - * LogMetric version. - * @member {google.logging.v2.LogMetric.ApiVersion} version - * @memberof google.logging.v2.LogMetric + * Settings disableDefaultSink. + * @member {boolean} disableDefaultSink + * @memberof google.logging.v2.Settings * @instance */ - LogMetric.prototype.version = 0; + Settings.prototype.disableDefaultSink = false; /** - * Creates a new LogMetric instance using the specified properties. + * Creates a new Settings instance using the specified properties. * @function create - * @memberof google.logging.v2.LogMetric + * @memberof google.logging.v2.Settings * @static - * @param {google.logging.v2.ILogMetric=} [properties] Properties to set - * @returns {google.logging.v2.LogMetric} LogMetric instance + * @param {google.logging.v2.ISettings=} [properties] Properties to set + * @returns {google.logging.v2.Settings} Settings instance */ - LogMetric.create = function create(properties) { - return new LogMetric(properties); + Settings.create = function create(properties) { + return new Settings(properties); }; /** - * Encodes the specified LogMetric message. Does not implicitly {@link google.logging.v2.LogMetric.verify|verify} messages. + * Encodes the specified Settings message. Does not implicitly {@link google.logging.v2.Settings.verify|verify} messages. * @function encode - * @memberof google.logging.v2.LogMetric + * @memberof google.logging.v2.Settings * @static - * @param {google.logging.v2.ILogMetric} message LogMetric message or plain object to encode + * @param {google.logging.v2.ISettings} message Settings message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LogMetric.encode = function encode(message, writer) { + Settings.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.version); - if (message.metricDescriptor != null && Object.hasOwnProperty.call(message, "metricDescriptor")) - $root.google.api.MetricDescriptor.encode(message.metricDescriptor, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.valueExtractor != null && Object.hasOwnProperty.call(message, "valueExtractor")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.valueExtractor); - if (message.labelExtractors != null && Object.hasOwnProperty.call(message, "labelExtractors")) - for (var keys = Object.keys(message.labelExtractors), i = 0; i < keys.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labelExtractors[keys[i]]).ldelim(); - if (message.bucketOptions != null && Object.hasOwnProperty.call(message, "bucketOptions")) - $root.google.api.Distribution.BucketOptions.encode(message.bucketOptions, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.storageLocation != null && Object.hasOwnProperty.call(message, "storageLocation")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.storageLocation); + if (message.disableDefaultSink != null && Object.hasOwnProperty.call(message, "disableDefaultSink")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.disableDefaultSink); return writer; }; /** - * Encodes the specified LogMetric message, length delimited. Does not implicitly {@link google.logging.v2.LogMetric.verify|verify} messages. + * Encodes the specified Settings message, length delimited. Does not implicitly {@link google.logging.v2.Settings.verify|verify} messages. * @function encodeDelimited - * @memberof google.logging.v2.LogMetric + * @memberof google.logging.v2.Settings * @static - * @param {google.logging.v2.ILogMetric} message LogMetric message or plain object to encode + * @param {google.logging.v2.ISettings} message Settings message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LogMetric.encodeDelimited = function encodeDelimited(message, writer) { + Settings.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a LogMetric message from the specified reader or buffer. + * Decodes a Settings message from the specified reader or buffer. * @function decode - * @memberof google.logging.v2.LogMetric + * @memberof google.logging.v2.Settings * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.logging.v2.LogMetric} LogMetric + * @returns {google.logging.v2.Settings} Settings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LogMetric.decode = function decode(reader, length) { + Settings.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.logging.v2.LogMetric(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.Settings(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; - case 2: - message.description = reader.string(); - break; - case 3: - message.filter = reader.string(); + case 4: + message.storageLocation = reader.string(); break; case 5: - message.metricDescriptor = $root.google.api.MetricDescriptor.decode(reader, reader.uint32()); + message.disableDefaultSink = reader.bool(); break; - case 6: - message.valueExtractor = reader.string(); - break; - case 7: - if (message.labelExtractors === $util.emptyObject) - message.labelExtractors = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labelExtractors[key] = value; - break; - case 8: - message.bucketOptions = $root.google.api.Distribution.BucketOptions.decode(reader, reader.uint32()); - break; - case 9: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 10: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 4: - message.version = reader.int32(); - break; - default: - reader.skipType(tag & 7); + default: + reader.skipType(tag & 7); break; } } @@ -24788,244 +25333,126 @@ }; /** - * Decodes a LogMetric message from the specified reader or buffer, length delimited. + * Decodes a Settings message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.logging.v2.LogMetric + * @memberof google.logging.v2.Settings * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.logging.v2.LogMetric} LogMetric + * @returns {google.logging.v2.Settings} Settings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LogMetric.decodeDelimited = function decodeDelimited(reader) { + Settings.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a LogMetric message. + * Verifies a Settings message. * @function verify - * @memberof google.logging.v2.LogMetric + * @memberof google.logging.v2.Settings * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - LogMetric.verify = function verify(message) { + Settings.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.metricDescriptor != null && message.hasOwnProperty("metricDescriptor")) { - var error = $root.google.api.MetricDescriptor.verify(message.metricDescriptor); - if (error) - return "metricDescriptor." + error; - } - if (message.valueExtractor != null && message.hasOwnProperty("valueExtractor")) - if (!$util.isString(message.valueExtractor)) - return "valueExtractor: string expected"; - if (message.labelExtractors != null && message.hasOwnProperty("labelExtractors")) { - if (!$util.isObject(message.labelExtractors)) - return "labelExtractors: object expected"; - var key = Object.keys(message.labelExtractors); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labelExtractors[key[i]])) - return "labelExtractors: string{k:string} expected"; - } - if (message.bucketOptions != null && message.hasOwnProperty("bucketOptions")) { - var error = $root.google.api.Distribution.BucketOptions.verify(message.bucketOptions); - if (error) - return "bucketOptions." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.version != null && message.hasOwnProperty("version")) - switch (message.version) { - default: - return "version: enum value expected"; - case 0: - case 1: - break; - } + if (message.storageLocation != null && message.hasOwnProperty("storageLocation")) + if (!$util.isString(message.storageLocation)) + return "storageLocation: string expected"; + if (message.disableDefaultSink != null && message.hasOwnProperty("disableDefaultSink")) + if (typeof message.disableDefaultSink !== "boolean") + return "disableDefaultSink: boolean expected"; return null; }; /** - * Creates a LogMetric message from a plain object. Also converts values to their respective internal types. + * Creates a Settings message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.logging.v2.LogMetric + * @memberof google.logging.v2.Settings * @static * @param {Object.} object Plain object - * @returns {google.logging.v2.LogMetric} LogMetric + * @returns {google.logging.v2.Settings} Settings */ - LogMetric.fromObject = function fromObject(object) { - if (object instanceof $root.google.logging.v2.LogMetric) + Settings.fromObject = function fromObject(object) { + if (object instanceof $root.google.logging.v2.Settings) return object; - var message = new $root.google.logging.v2.LogMetric(); + var message = new $root.google.logging.v2.Settings(); if (object.name != null) message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.filter != null) - message.filter = String(object.filter); - if (object.metricDescriptor != null) { - if (typeof object.metricDescriptor !== "object") - throw TypeError(".google.logging.v2.LogMetric.metricDescriptor: object expected"); - message.metricDescriptor = $root.google.api.MetricDescriptor.fromObject(object.metricDescriptor); - } - if (object.valueExtractor != null) - message.valueExtractor = String(object.valueExtractor); - if (object.labelExtractors) { - if (typeof object.labelExtractors !== "object") - throw TypeError(".google.logging.v2.LogMetric.labelExtractors: object expected"); - message.labelExtractors = {}; - for (var keys = Object.keys(object.labelExtractors), i = 0; i < keys.length; ++i) - message.labelExtractors[keys[i]] = String(object.labelExtractors[keys[i]]); - } - if (object.bucketOptions != null) { - if (typeof object.bucketOptions !== "object") - throw TypeError(".google.logging.v2.LogMetric.bucketOptions: object expected"); - message.bucketOptions = $root.google.api.Distribution.BucketOptions.fromObject(object.bucketOptions); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.logging.v2.LogMetric.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.logging.v2.LogMetric.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - switch (object.version) { - case "V2": - case 0: - message.version = 0; - break; - case "V1": - case 1: - message.version = 1; - break; - } + if (object.storageLocation != null) + message.storageLocation = String(object.storageLocation); + if (object.disableDefaultSink != null) + message.disableDefaultSink = Boolean(object.disableDefaultSink); return message; }; /** - * Creates a plain object from a LogMetric message. Also converts values to other types if specified. + * Creates a plain object from a Settings message. Also converts values to other types if specified. * @function toObject - * @memberof google.logging.v2.LogMetric + * @memberof google.logging.v2.Settings * @static - * @param {google.logging.v2.LogMetric} message LogMetric + * @param {google.logging.v2.Settings} message Settings * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LogMetric.toObject = function toObject(message, options) { + Settings.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.labelExtractors = {}; if (options.defaults) { object.name = ""; - object.description = ""; - object.filter = ""; - object.version = options.enums === String ? "V2" : 0; - object.metricDescriptor = null; - object.valueExtractor = ""; - object.bucketOptions = null; - object.createTime = null; - object.updateTime = null; + object.storageLocation = ""; + object.disableDefaultSink = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.version != null && message.hasOwnProperty("version")) - object.version = options.enums === String ? $root.google.logging.v2.LogMetric.ApiVersion[message.version] : message.version; - if (message.metricDescriptor != null && message.hasOwnProperty("metricDescriptor")) - object.metricDescriptor = $root.google.api.MetricDescriptor.toObject(message.metricDescriptor, options); - if (message.valueExtractor != null && message.hasOwnProperty("valueExtractor")) - object.valueExtractor = message.valueExtractor; - var keys2; - if (message.labelExtractors && (keys2 = Object.keys(message.labelExtractors)).length) { - object.labelExtractors = {}; - for (var j = 0; j < keys2.length; ++j) - object.labelExtractors[keys2[j]] = message.labelExtractors[keys2[j]]; - } - if (message.bucketOptions != null && message.hasOwnProperty("bucketOptions")) - object.bucketOptions = $root.google.api.Distribution.BucketOptions.toObject(message.bucketOptions, options); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.storageLocation != null && message.hasOwnProperty("storageLocation")) + object.storageLocation = message.storageLocation; + if (message.disableDefaultSink != null && message.hasOwnProperty("disableDefaultSink")) + object.disableDefaultSink = message.disableDefaultSink; return object; }; /** - * Converts this LogMetric to JSON. + * Converts this Settings to JSON. * @function toJSON - * @memberof google.logging.v2.LogMetric + * @memberof google.logging.v2.Settings * @instance * @returns {Object.} JSON object */ - LogMetric.prototype.toJSON = function toJSON() { + Settings.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * ApiVersion enum. - * @name google.logging.v2.LogMetric.ApiVersion - * @enum {number} - * @property {number} V2=0 V2 value - * @property {number} V1=1 V1 value - */ - LogMetric.ApiVersion = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "V2"] = 0; - values[valuesById[1] = "V1"] = 1; - return values; - })(); - - return LogMetric; + return Settings; })(); - v2.ListLogMetricsRequest = (function() { + v2.CopyLogEntriesRequest = (function() { /** - * Properties of a ListLogMetricsRequest. + * Properties of a CopyLogEntriesRequest. * @memberof google.logging.v2 - * @interface IListLogMetricsRequest - * @property {string|null} [parent] ListLogMetricsRequest parent - * @property {string|null} [pageToken] ListLogMetricsRequest pageToken - * @property {number|null} [pageSize] ListLogMetricsRequest pageSize + * @interface ICopyLogEntriesRequest + * @property {string|null} [name] CopyLogEntriesRequest name + * @property {string|null} [filter] CopyLogEntriesRequest filter + * @property {string|null} [destination] CopyLogEntriesRequest destination */ /** - * Constructs a new ListLogMetricsRequest. + * Constructs a new CopyLogEntriesRequest. * @memberof google.logging.v2 - * @classdesc Represents a ListLogMetricsRequest. - * @implements IListLogMetricsRequest + * @classdesc Represents a CopyLogEntriesRequest. + * @implements ICopyLogEntriesRequest * @constructor - * @param {google.logging.v2.IListLogMetricsRequest=} [properties] Properties to set + * @param {google.logging.v2.ICopyLogEntriesRequest=} [properties] Properties to set */ - function ListLogMetricsRequest(properties) { + function CopyLogEntriesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -25033,101 +25460,101 @@ } /** - * ListLogMetricsRequest parent. - * @member {string} parent - * @memberof google.logging.v2.ListLogMetricsRequest + * CopyLogEntriesRequest name. + * @member {string} name + * @memberof google.logging.v2.CopyLogEntriesRequest * @instance */ - ListLogMetricsRequest.prototype.parent = ""; + CopyLogEntriesRequest.prototype.name = ""; /** - * ListLogMetricsRequest pageToken. - * @member {string} pageToken - * @memberof google.logging.v2.ListLogMetricsRequest + * CopyLogEntriesRequest filter. + * @member {string} filter + * @memberof google.logging.v2.CopyLogEntriesRequest * @instance */ - ListLogMetricsRequest.prototype.pageToken = ""; + CopyLogEntriesRequest.prototype.filter = ""; /** - * ListLogMetricsRequest pageSize. - * @member {number} pageSize - * @memberof google.logging.v2.ListLogMetricsRequest + * CopyLogEntriesRequest destination. + * @member {string} destination + * @memberof google.logging.v2.CopyLogEntriesRequest * @instance */ - ListLogMetricsRequest.prototype.pageSize = 0; + CopyLogEntriesRequest.prototype.destination = ""; /** - * Creates a new ListLogMetricsRequest instance using the specified properties. + * Creates a new CopyLogEntriesRequest instance using the specified properties. * @function create - * @memberof google.logging.v2.ListLogMetricsRequest + * @memberof google.logging.v2.CopyLogEntriesRequest * @static - * @param {google.logging.v2.IListLogMetricsRequest=} [properties] Properties to set - * @returns {google.logging.v2.ListLogMetricsRequest} ListLogMetricsRequest instance + * @param {google.logging.v2.ICopyLogEntriesRequest=} [properties] Properties to set + * @returns {google.logging.v2.CopyLogEntriesRequest} CopyLogEntriesRequest instance */ - ListLogMetricsRequest.create = function create(properties) { - return new ListLogMetricsRequest(properties); + CopyLogEntriesRequest.create = function create(properties) { + return new CopyLogEntriesRequest(properties); }; /** - * Encodes the specified ListLogMetricsRequest message. Does not implicitly {@link google.logging.v2.ListLogMetricsRequest.verify|verify} messages. + * Encodes the specified CopyLogEntriesRequest message. Does not implicitly {@link google.logging.v2.CopyLogEntriesRequest.verify|verify} messages. * @function encode - * @memberof google.logging.v2.ListLogMetricsRequest + * @memberof google.logging.v2.CopyLogEntriesRequest * @static - * @param {google.logging.v2.IListLogMetricsRequest} message ListLogMetricsRequest message or plain object to encode + * @param {google.logging.v2.ICopyLogEntriesRequest} message CopyLogEntriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListLogMetricsRequest.encode = function encode(message, writer) { + CopyLogEntriesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.destination); return writer; }; /** - * Encodes the specified ListLogMetricsRequest message, length delimited. Does not implicitly {@link google.logging.v2.ListLogMetricsRequest.verify|verify} messages. + * Encodes the specified CopyLogEntriesRequest message, length delimited. Does not implicitly {@link google.logging.v2.CopyLogEntriesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.logging.v2.ListLogMetricsRequest + * @memberof google.logging.v2.CopyLogEntriesRequest * @static - * @param {google.logging.v2.IListLogMetricsRequest} message ListLogMetricsRequest message or plain object to encode + * @param {google.logging.v2.ICopyLogEntriesRequest} message CopyLogEntriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListLogMetricsRequest.encodeDelimited = function encodeDelimited(message, writer) { + CopyLogEntriesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListLogMetricsRequest message from the specified reader or buffer. + * Decodes a CopyLogEntriesRequest message from the specified reader or buffer. * @function decode - * @memberof google.logging.v2.ListLogMetricsRequest + * @memberof google.logging.v2.CopyLogEntriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.logging.v2.ListLogMetricsRequest} ListLogMetricsRequest + * @returns {google.logging.v2.CopyLogEntriesRequest} CopyLogEntriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListLogMetricsRequest.decode = function decode(reader, length) { + CopyLogEntriesRequest.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.logging.v2.ListLogMetricsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.CopyLogEntriesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); - break; - case 2: - message.pageToken = reader.string(); + message.name = reader.string(); break; case 3: - message.pageSize = reader.int32(); + message.filter = reader.string(); + break; + case 4: + message.destination = reader.string(); break; default: reader.skipType(tag & 7); @@ -25138,126 +25565,130 @@ }; /** - * Decodes a ListLogMetricsRequest message from the specified reader or buffer, length delimited. + * Decodes a CopyLogEntriesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.logging.v2.ListLogMetricsRequest + * @memberof google.logging.v2.CopyLogEntriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.logging.v2.ListLogMetricsRequest} ListLogMetricsRequest + * @returns {google.logging.v2.CopyLogEntriesRequest} CopyLogEntriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListLogMetricsRequest.decodeDelimited = function decodeDelimited(reader) { + CopyLogEntriesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListLogMetricsRequest message. + * Verifies a CopyLogEntriesRequest message. * @function verify - * @memberof google.logging.v2.ListLogMetricsRequest + * @memberof google.logging.v2.CopyLogEntriesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListLogMetricsRequest.verify = function verify(message) { + CopyLogEntriesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.destination != null && message.hasOwnProperty("destination")) + if (!$util.isString(message.destination)) + return "destination: string expected"; return null; }; /** - * Creates a ListLogMetricsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CopyLogEntriesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.logging.v2.ListLogMetricsRequest + * @memberof google.logging.v2.CopyLogEntriesRequest * @static * @param {Object.} object Plain object - * @returns {google.logging.v2.ListLogMetricsRequest} ListLogMetricsRequest + * @returns {google.logging.v2.CopyLogEntriesRequest} CopyLogEntriesRequest */ - ListLogMetricsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.logging.v2.ListLogMetricsRequest) + CopyLogEntriesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.logging.v2.CopyLogEntriesRequest) return object; - var message = new $root.google.logging.v2.ListLogMetricsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; + var message = new $root.google.logging.v2.CopyLogEntriesRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.destination != null) + message.destination = String(object.destination); return message; }; /** - * Creates a plain object from a ListLogMetricsRequest message. Also converts values to other types if specified. + * Creates a plain object from a CopyLogEntriesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.logging.v2.ListLogMetricsRequest + * @memberof google.logging.v2.CopyLogEntriesRequest * @static - * @param {google.logging.v2.ListLogMetricsRequest} message ListLogMetricsRequest + * @param {google.logging.v2.CopyLogEntriesRequest} message CopyLogEntriesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListLogMetricsRequest.toObject = function toObject(message, options) { + CopyLogEntriesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.pageToken = ""; - object.pageSize = 0; + object.name = ""; + object.filter = ""; + object.destination = ""; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.destination != null && message.hasOwnProperty("destination")) + object.destination = message.destination; return object; }; /** - * Converts this ListLogMetricsRequest to JSON. + * Converts this CopyLogEntriesRequest to JSON. * @function toJSON - * @memberof google.logging.v2.ListLogMetricsRequest + * @memberof google.logging.v2.CopyLogEntriesRequest * @instance * @returns {Object.} JSON object */ - ListLogMetricsRequest.prototype.toJSON = function toJSON() { + CopyLogEntriesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListLogMetricsRequest; + return CopyLogEntriesRequest; })(); - v2.ListLogMetricsResponse = (function() { + v2.CopyLogEntriesMetadata = (function() { /** - * Properties of a ListLogMetricsResponse. + * Properties of a CopyLogEntriesMetadata. * @memberof google.logging.v2 - * @interface IListLogMetricsResponse - * @property {Array.|null} [metrics] ListLogMetricsResponse metrics - * @property {string|null} [nextPageToken] ListLogMetricsResponse nextPageToken + * @interface ICopyLogEntriesMetadata + * @property {google.protobuf.ITimestamp|null} [startTime] CopyLogEntriesMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] CopyLogEntriesMetadata endTime + * @property {google.logging.v2.OperationState|null} [state] CopyLogEntriesMetadata state + * @property {boolean|null} [cancellationRequested] CopyLogEntriesMetadata cancellationRequested + * @property {google.logging.v2.ICopyLogEntriesRequest|null} [request] CopyLogEntriesMetadata request + * @property {number|null} [progress] CopyLogEntriesMetadata progress + * @property {string|null} [writerIdentity] CopyLogEntriesMetadata writerIdentity */ /** - * Constructs a new ListLogMetricsResponse. + * Constructs a new CopyLogEntriesMetadata. * @memberof google.logging.v2 - * @classdesc Represents a ListLogMetricsResponse. - * @implements IListLogMetricsResponse + * @classdesc Represents a CopyLogEntriesMetadata. + * @implements ICopyLogEntriesMetadata * @constructor - * @param {google.logging.v2.IListLogMetricsResponse=} [properties] Properties to set + * @param {google.logging.v2.ICopyLogEntriesMetadata=} [properties] Properties to set */ - function ListLogMetricsResponse(properties) { - this.metrics = []; + function CopyLogEntriesMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -25265,91 +25696,153 @@ } /** - * ListLogMetricsResponse metrics. - * @member {Array.} metrics - * @memberof google.logging.v2.ListLogMetricsResponse + * CopyLogEntriesMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.logging.v2.CopyLogEntriesMetadata * @instance */ - ListLogMetricsResponse.prototype.metrics = $util.emptyArray; + CopyLogEntriesMetadata.prototype.startTime = null; /** - * ListLogMetricsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.logging.v2.ListLogMetricsResponse + * CopyLogEntriesMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.logging.v2.CopyLogEntriesMetadata * @instance */ - ListLogMetricsResponse.prototype.nextPageToken = ""; + CopyLogEntriesMetadata.prototype.endTime = null; /** - * Creates a new ListLogMetricsResponse instance using the specified properties. + * CopyLogEntriesMetadata state. + * @member {google.logging.v2.OperationState} state + * @memberof google.logging.v2.CopyLogEntriesMetadata + * @instance + */ + CopyLogEntriesMetadata.prototype.state = 0; + + /** + * CopyLogEntriesMetadata cancellationRequested. + * @member {boolean} cancellationRequested + * @memberof google.logging.v2.CopyLogEntriesMetadata + * @instance + */ + CopyLogEntriesMetadata.prototype.cancellationRequested = false; + + /** + * CopyLogEntriesMetadata request. + * @member {google.logging.v2.ICopyLogEntriesRequest|null|undefined} request + * @memberof google.logging.v2.CopyLogEntriesMetadata + * @instance + */ + CopyLogEntriesMetadata.prototype.request = null; + + /** + * CopyLogEntriesMetadata progress. + * @member {number} progress + * @memberof google.logging.v2.CopyLogEntriesMetadata + * @instance + */ + CopyLogEntriesMetadata.prototype.progress = 0; + + /** + * CopyLogEntriesMetadata writerIdentity. + * @member {string} writerIdentity + * @memberof google.logging.v2.CopyLogEntriesMetadata + * @instance + */ + CopyLogEntriesMetadata.prototype.writerIdentity = ""; + + /** + * Creates a new CopyLogEntriesMetadata instance using the specified properties. * @function create - * @memberof google.logging.v2.ListLogMetricsResponse + * @memberof google.logging.v2.CopyLogEntriesMetadata * @static - * @param {google.logging.v2.IListLogMetricsResponse=} [properties] Properties to set - * @returns {google.logging.v2.ListLogMetricsResponse} ListLogMetricsResponse instance + * @param {google.logging.v2.ICopyLogEntriesMetadata=} [properties] Properties to set + * @returns {google.logging.v2.CopyLogEntriesMetadata} CopyLogEntriesMetadata instance */ - ListLogMetricsResponse.create = function create(properties) { - return new ListLogMetricsResponse(properties); + CopyLogEntriesMetadata.create = function create(properties) { + return new CopyLogEntriesMetadata(properties); }; /** - * Encodes the specified ListLogMetricsResponse message. Does not implicitly {@link google.logging.v2.ListLogMetricsResponse.verify|verify} messages. + * Encodes the specified CopyLogEntriesMetadata message. Does not implicitly {@link google.logging.v2.CopyLogEntriesMetadata.verify|verify} messages. * @function encode - * @memberof google.logging.v2.ListLogMetricsResponse + * @memberof google.logging.v2.CopyLogEntriesMetadata * @static - * @param {google.logging.v2.IListLogMetricsResponse} message ListLogMetricsResponse message or plain object to encode + * @param {google.logging.v2.ICopyLogEntriesMetadata} message CopyLogEntriesMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListLogMetricsResponse.encode = function encode(message, writer) { + CopyLogEntriesMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.metrics != null && message.metrics.length) - for (var i = 0; i < message.metrics.length; ++i) - $root.google.logging.v2.LogMetric.encode(message.metrics[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.cancellationRequested != null && Object.hasOwnProperty.call(message, "cancellationRequested")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.cancellationRequested); + if (message.request != null && Object.hasOwnProperty.call(message, "request")) + $root.google.logging.v2.CopyLogEntriesRequest.encode(message.request, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.progress); + if (message.writerIdentity != null && Object.hasOwnProperty.call(message, "writerIdentity")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.writerIdentity); return writer; }; /** - * Encodes the specified ListLogMetricsResponse message, length delimited. Does not implicitly {@link google.logging.v2.ListLogMetricsResponse.verify|verify} messages. + * Encodes the specified CopyLogEntriesMetadata message, length delimited. Does not implicitly {@link google.logging.v2.CopyLogEntriesMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.logging.v2.ListLogMetricsResponse + * @memberof google.logging.v2.CopyLogEntriesMetadata * @static - * @param {google.logging.v2.IListLogMetricsResponse} message ListLogMetricsResponse message or plain object to encode + * @param {google.logging.v2.ICopyLogEntriesMetadata} message CopyLogEntriesMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListLogMetricsResponse.encodeDelimited = function encodeDelimited(message, writer) { + CopyLogEntriesMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListLogMetricsResponse message from the specified reader or buffer. + * Decodes a CopyLogEntriesMetadata message from the specified reader or buffer. * @function decode - * @memberof google.logging.v2.ListLogMetricsResponse + * @memberof google.logging.v2.CopyLogEntriesMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.logging.v2.ListLogMetricsResponse} ListLogMetricsResponse + * @returns {google.logging.v2.CopyLogEntriesMetadata} CopyLogEntriesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListLogMetricsResponse.decode = function decode(reader, length) { + CopyLogEntriesMetadata.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.logging.v2.ListLogMetricsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.CopyLogEntriesMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.metrics && message.metrics.length)) - message.metrics = []; - message.metrics.push($root.google.logging.v2.LogMetric.decode(reader, reader.uint32())); + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 2: - message.nextPageToken = reader.string(); + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.state = reader.int32(); + break; + case 4: + message.cancellationRequested = reader.bool(); + break; + case 5: + message.request = $root.google.logging.v2.CopyLogEntriesRequest.decode(reader, reader.uint32()); + break; + case 6: + message.progress = reader.int32(); + break; + case 7: + message.writerIdentity = reader.string(); break; default: reader.skipType(tag & 7); @@ -25360,133 +25853,209 @@ }; /** - * Decodes a ListLogMetricsResponse message from the specified reader or buffer, length delimited. + * Decodes a CopyLogEntriesMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.logging.v2.ListLogMetricsResponse + * @memberof google.logging.v2.CopyLogEntriesMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.logging.v2.ListLogMetricsResponse} ListLogMetricsResponse + * @returns {google.logging.v2.CopyLogEntriesMetadata} CopyLogEntriesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListLogMetricsResponse.decodeDelimited = function decodeDelimited(reader) { + CopyLogEntriesMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListLogMetricsResponse message. + * Verifies a CopyLogEntriesMetadata message. * @function verify - * @memberof google.logging.v2.ListLogMetricsResponse + * @memberof google.logging.v2.CopyLogEntriesMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListLogMetricsResponse.verify = function verify(message) { + CopyLogEntriesMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.metrics != null && message.hasOwnProperty("metrics")) { - if (!Array.isArray(message.metrics)) - return "metrics: array expected"; - for (var i = 0; i < message.metrics.length; ++i) { - var error = $root.google.logging.v2.LogMetric.verify(message.metrics[i]); - if (error) - return "metrics." + error; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; } + if (message.cancellationRequested != null && message.hasOwnProperty("cancellationRequested")) + if (typeof message.cancellationRequested !== "boolean") + return "cancellationRequested: boolean expected"; + if (message.request != null && message.hasOwnProperty("request")) { + var error = $root.google.logging.v2.CopyLogEntriesRequest.verify(message.request); + if (error) + return "request." + error; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; + if (message.progress != null && message.hasOwnProperty("progress")) + if (!$util.isInteger(message.progress)) + return "progress: integer expected"; + if (message.writerIdentity != null && message.hasOwnProperty("writerIdentity")) + if (!$util.isString(message.writerIdentity)) + return "writerIdentity: string expected"; return null; }; /** - * Creates a ListLogMetricsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CopyLogEntriesMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.logging.v2.ListLogMetricsResponse + * @memberof google.logging.v2.CopyLogEntriesMetadata * @static * @param {Object.} object Plain object - * @returns {google.logging.v2.ListLogMetricsResponse} ListLogMetricsResponse + * @returns {google.logging.v2.CopyLogEntriesMetadata} CopyLogEntriesMetadata */ - ListLogMetricsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.logging.v2.ListLogMetricsResponse) + CopyLogEntriesMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.logging.v2.CopyLogEntriesMetadata) return object; - var message = new $root.google.logging.v2.ListLogMetricsResponse(); - if (object.metrics) { - if (!Array.isArray(object.metrics)) - throw TypeError(".google.logging.v2.ListLogMetricsResponse.metrics: array expected"); - message.metrics = []; - for (var i = 0; i < object.metrics.length; ++i) { - if (typeof object.metrics[i] !== "object") - throw TypeError(".google.logging.v2.ListLogMetricsResponse.metrics: object expected"); - message.metrics[i] = $root.google.logging.v2.LogMetric.fromObject(object.metrics[i]); - } + var message = new $root.google.logging.v2.CopyLogEntriesMetadata(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.logging.v2.CopyLogEntriesMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.logging.v2.CopyLogEntriesMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + switch (object.state) { + case "OPERATION_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "OPERATION_STATE_SCHEDULED": + case 1: + message.state = 1; + break; + case "OPERATION_STATE_WAITING_FOR_PERMISSIONS": + case 2: + message.state = 2; + break; + case "OPERATION_STATE_RUNNING": + case 3: + message.state = 3; + break; + case "OPERATION_STATE_SUCCEEDED": + case 4: + message.state = 4; + break; + case "OPERATION_STATE_FAILED": + case 5: + message.state = 5; + break; + case "OPERATION_STATE_CANCELLED": + case 6: + message.state = 6; + break; } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); + if (object.cancellationRequested != null) + message.cancellationRequested = Boolean(object.cancellationRequested); + if (object.request != null) { + if (typeof object.request !== "object") + throw TypeError(".google.logging.v2.CopyLogEntriesMetadata.request: object expected"); + message.request = $root.google.logging.v2.CopyLogEntriesRequest.fromObject(object.request); + } + if (object.progress != null) + message.progress = object.progress | 0; + if (object.writerIdentity != null) + message.writerIdentity = String(object.writerIdentity); return message; }; /** - * Creates a plain object from a ListLogMetricsResponse message. Also converts values to other types if specified. + * Creates a plain object from a CopyLogEntriesMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.logging.v2.ListLogMetricsResponse + * @memberof google.logging.v2.CopyLogEntriesMetadata * @static - * @param {google.logging.v2.ListLogMetricsResponse} message ListLogMetricsResponse + * @param {google.logging.v2.CopyLogEntriesMetadata} message CopyLogEntriesMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListLogMetricsResponse.toObject = function toObject(message, options) { + CopyLogEntriesMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.metrics = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.metrics && message.metrics.length) { - object.metrics = []; - for (var j = 0; j < message.metrics.length; ++j) - object.metrics[j] = $root.google.logging.v2.LogMetric.toObject(message.metrics[j], options); + if (options.defaults) { + object.startTime = null; + object.endTime = null; + object.state = options.enums === String ? "OPERATION_STATE_UNSPECIFIED" : 0; + object.cancellationRequested = false; + object.request = null; + object.progress = 0; + object.writerIdentity = ""; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.logging.v2.OperationState[message.state] : message.state; + if (message.cancellationRequested != null && message.hasOwnProperty("cancellationRequested")) + object.cancellationRequested = message.cancellationRequested; + if (message.request != null && message.hasOwnProperty("request")) + object.request = $root.google.logging.v2.CopyLogEntriesRequest.toObject(message.request, options); + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = message.progress; + if (message.writerIdentity != null && message.hasOwnProperty("writerIdentity")) + object.writerIdentity = message.writerIdentity; return object; }; /** - * Converts this ListLogMetricsResponse to JSON. + * Converts this CopyLogEntriesMetadata to JSON. * @function toJSON - * @memberof google.logging.v2.ListLogMetricsResponse + * @memberof google.logging.v2.CopyLogEntriesMetadata * @instance * @returns {Object.} JSON object */ - ListLogMetricsResponse.prototype.toJSON = function toJSON() { + CopyLogEntriesMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListLogMetricsResponse; + return CopyLogEntriesMetadata; })(); - v2.GetLogMetricRequest = (function() { + v2.CopyLogEntriesResponse = (function() { /** - * Properties of a GetLogMetricRequest. + * Properties of a CopyLogEntriesResponse. * @memberof google.logging.v2 - * @interface IGetLogMetricRequest - * @property {string|null} [metricName] GetLogMetricRequest metricName + * @interface ICopyLogEntriesResponse + * @property {number|Long|null} [logEntriesCopiedCount] CopyLogEntriesResponse logEntriesCopiedCount */ /** - * Constructs a new GetLogMetricRequest. + * Constructs a new CopyLogEntriesResponse. * @memberof google.logging.v2 - * @classdesc Represents a GetLogMetricRequest. - * @implements IGetLogMetricRequest + * @classdesc Represents a CopyLogEntriesResponse. + * @implements ICopyLogEntriesResponse * @constructor - * @param {google.logging.v2.IGetLogMetricRequest=} [properties] Properties to set + * @param {google.logging.v2.ICopyLogEntriesResponse=} [properties] Properties to set */ - function GetLogMetricRequest(properties) { + function CopyLogEntriesResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -25494,75 +26063,75 @@ } /** - * GetLogMetricRequest metricName. - * @member {string} metricName - * @memberof google.logging.v2.GetLogMetricRequest + * CopyLogEntriesResponse logEntriesCopiedCount. + * @member {number|Long} logEntriesCopiedCount + * @memberof google.logging.v2.CopyLogEntriesResponse * @instance */ - GetLogMetricRequest.prototype.metricName = ""; + CopyLogEntriesResponse.prototype.logEntriesCopiedCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new GetLogMetricRequest instance using the specified properties. + * Creates a new CopyLogEntriesResponse instance using the specified properties. * @function create - * @memberof google.logging.v2.GetLogMetricRequest + * @memberof google.logging.v2.CopyLogEntriesResponse * @static - * @param {google.logging.v2.IGetLogMetricRequest=} [properties] Properties to set - * @returns {google.logging.v2.GetLogMetricRequest} GetLogMetricRequest instance + * @param {google.logging.v2.ICopyLogEntriesResponse=} [properties] Properties to set + * @returns {google.logging.v2.CopyLogEntriesResponse} CopyLogEntriesResponse instance */ - GetLogMetricRequest.create = function create(properties) { - return new GetLogMetricRequest(properties); + CopyLogEntriesResponse.create = function create(properties) { + return new CopyLogEntriesResponse(properties); }; /** - * Encodes the specified GetLogMetricRequest message. Does not implicitly {@link google.logging.v2.GetLogMetricRequest.verify|verify} messages. + * Encodes the specified CopyLogEntriesResponse message. Does not implicitly {@link google.logging.v2.CopyLogEntriesResponse.verify|verify} messages. * @function encode - * @memberof google.logging.v2.GetLogMetricRequest + * @memberof google.logging.v2.CopyLogEntriesResponse * @static - * @param {google.logging.v2.IGetLogMetricRequest} message GetLogMetricRequest message or plain object to encode + * @param {google.logging.v2.ICopyLogEntriesResponse} message CopyLogEntriesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetLogMetricRequest.encode = function encode(message, writer) { + CopyLogEntriesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.metricName != null && Object.hasOwnProperty.call(message, "metricName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.metricName); + if (message.logEntriesCopiedCount != null && Object.hasOwnProperty.call(message, "logEntriesCopiedCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.logEntriesCopiedCount); return writer; }; /** - * Encodes the specified GetLogMetricRequest message, length delimited. Does not implicitly {@link google.logging.v2.GetLogMetricRequest.verify|verify} messages. + * Encodes the specified CopyLogEntriesResponse message, length delimited. Does not implicitly {@link google.logging.v2.CopyLogEntriesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.logging.v2.GetLogMetricRequest + * @memberof google.logging.v2.CopyLogEntriesResponse * @static - * @param {google.logging.v2.IGetLogMetricRequest} message GetLogMetricRequest message or plain object to encode + * @param {google.logging.v2.ICopyLogEntriesResponse} message CopyLogEntriesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetLogMetricRequest.encodeDelimited = function encodeDelimited(message, writer) { + CopyLogEntriesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetLogMetricRequest message from the specified reader or buffer. + * Decodes a CopyLogEntriesResponse message from the specified reader or buffer. * @function decode - * @memberof google.logging.v2.GetLogMetricRequest + * @memberof google.logging.v2.CopyLogEntriesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.logging.v2.GetLogMetricRequest} GetLogMetricRequest + * @returns {google.logging.v2.CopyLogEntriesResponse} CopyLogEntriesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetLogMetricRequest.decode = function decode(reader, length) { + CopyLogEntriesResponse.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.logging.v2.GetLogMetricRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.CopyLogEntriesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.metricName = reader.string(); + message.logEntriesCopiedCount = reader.int64(); break; default: reader.skipType(tag & 7); @@ -25573,323 +26142,372 @@ }; /** - * Decodes a GetLogMetricRequest message from the specified reader or buffer, length delimited. + * Decodes a CopyLogEntriesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.logging.v2.GetLogMetricRequest + * @memberof google.logging.v2.CopyLogEntriesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.logging.v2.GetLogMetricRequest} GetLogMetricRequest + * @returns {google.logging.v2.CopyLogEntriesResponse} CopyLogEntriesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetLogMetricRequest.decodeDelimited = function decodeDelimited(reader) { + CopyLogEntriesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetLogMetricRequest message. + * Verifies a CopyLogEntriesResponse message. * @function verify - * @memberof google.logging.v2.GetLogMetricRequest + * @memberof google.logging.v2.CopyLogEntriesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetLogMetricRequest.verify = function verify(message) { + CopyLogEntriesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.metricName != null && message.hasOwnProperty("metricName")) - if (!$util.isString(message.metricName)) - return "metricName: string expected"; + if (message.logEntriesCopiedCount != null && message.hasOwnProperty("logEntriesCopiedCount")) + if (!$util.isInteger(message.logEntriesCopiedCount) && !(message.logEntriesCopiedCount && $util.isInteger(message.logEntriesCopiedCount.low) && $util.isInteger(message.logEntriesCopiedCount.high))) + return "logEntriesCopiedCount: integer|Long expected"; return null; }; /** - * Creates a GetLogMetricRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CopyLogEntriesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.logging.v2.GetLogMetricRequest + * @memberof google.logging.v2.CopyLogEntriesResponse * @static * @param {Object.} object Plain object - * @returns {google.logging.v2.GetLogMetricRequest} GetLogMetricRequest + * @returns {google.logging.v2.CopyLogEntriesResponse} CopyLogEntriesResponse */ - GetLogMetricRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.logging.v2.GetLogMetricRequest) + CopyLogEntriesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.logging.v2.CopyLogEntriesResponse) return object; - var message = new $root.google.logging.v2.GetLogMetricRequest(); - if (object.metricName != null) - message.metricName = String(object.metricName); + var message = new $root.google.logging.v2.CopyLogEntriesResponse(); + if (object.logEntriesCopiedCount != null) + if ($util.Long) + (message.logEntriesCopiedCount = $util.Long.fromValue(object.logEntriesCopiedCount)).unsigned = false; + else if (typeof object.logEntriesCopiedCount === "string") + message.logEntriesCopiedCount = parseInt(object.logEntriesCopiedCount, 10); + else if (typeof object.logEntriesCopiedCount === "number") + message.logEntriesCopiedCount = object.logEntriesCopiedCount; + else if (typeof object.logEntriesCopiedCount === "object") + message.logEntriesCopiedCount = new $util.LongBits(object.logEntriesCopiedCount.low >>> 0, object.logEntriesCopiedCount.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a GetLogMetricRequest message. Also converts values to other types if specified. + * Creates a plain object from a CopyLogEntriesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.logging.v2.GetLogMetricRequest + * @memberof google.logging.v2.CopyLogEntriesResponse * @static - * @param {google.logging.v2.GetLogMetricRequest} message GetLogMetricRequest + * @param {google.logging.v2.CopyLogEntriesResponse} message CopyLogEntriesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetLogMetricRequest.toObject = function toObject(message, options) { + CopyLogEntriesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.metricName = ""; - if (message.metricName != null && message.hasOwnProperty("metricName")) - object.metricName = message.metricName; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.logEntriesCopiedCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.logEntriesCopiedCount = options.longs === String ? "0" : 0; + if (message.logEntriesCopiedCount != null && message.hasOwnProperty("logEntriesCopiedCount")) + if (typeof message.logEntriesCopiedCount === "number") + object.logEntriesCopiedCount = options.longs === String ? String(message.logEntriesCopiedCount) : message.logEntriesCopiedCount; + else + object.logEntriesCopiedCount = options.longs === String ? $util.Long.prototype.toString.call(message.logEntriesCopiedCount) : options.longs === Number ? new $util.LongBits(message.logEntriesCopiedCount.low >>> 0, message.logEntriesCopiedCount.high >>> 0).toNumber() : message.logEntriesCopiedCount; return object; }; /** - * Converts this GetLogMetricRequest to JSON. + * Converts this CopyLogEntriesResponse to JSON. * @function toJSON - * @memberof google.logging.v2.GetLogMetricRequest + * @memberof google.logging.v2.CopyLogEntriesResponse * @instance * @returns {Object.} JSON object */ - GetLogMetricRequest.prototype.toJSON = function toJSON() { + CopyLogEntriesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetLogMetricRequest; + return CopyLogEntriesResponse; })(); - v2.CreateLogMetricRequest = (function() { + /** + * LifecycleState enum. + * @name google.logging.v2.LifecycleState + * @enum {number} + * @property {number} LIFECYCLE_STATE_UNSPECIFIED=0 LIFECYCLE_STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} DELETE_REQUESTED=2 DELETE_REQUESTED value + */ + v2.LifecycleState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LIFECYCLE_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "DELETE_REQUESTED"] = 2; + return values; + })(); - /** - * Properties of a CreateLogMetricRequest. - * @memberof google.logging.v2 - * @interface ICreateLogMetricRequest - * @property {string|null} [parent] CreateLogMetricRequest parent - * @property {google.logging.v2.ILogMetric|null} [metric] CreateLogMetricRequest metric - */ + /** + * OperationState enum. + * @name google.logging.v2.OperationState + * @enum {number} + * @property {number} OPERATION_STATE_UNSPECIFIED=0 OPERATION_STATE_UNSPECIFIED value + * @property {number} OPERATION_STATE_SCHEDULED=1 OPERATION_STATE_SCHEDULED value + * @property {number} OPERATION_STATE_WAITING_FOR_PERMISSIONS=2 OPERATION_STATE_WAITING_FOR_PERMISSIONS value + * @property {number} OPERATION_STATE_RUNNING=3 OPERATION_STATE_RUNNING value + * @property {number} OPERATION_STATE_SUCCEEDED=4 OPERATION_STATE_SUCCEEDED value + * @property {number} OPERATION_STATE_FAILED=5 OPERATION_STATE_FAILED value + * @property {number} OPERATION_STATE_CANCELLED=6 OPERATION_STATE_CANCELLED value + */ + v2.OperationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPERATION_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPERATION_STATE_SCHEDULED"] = 1; + values[valuesById[2] = "OPERATION_STATE_WAITING_FOR_PERMISSIONS"] = 2; + values[valuesById[3] = "OPERATION_STATE_RUNNING"] = 3; + values[valuesById[4] = "OPERATION_STATE_SUCCEEDED"] = 4; + values[valuesById[5] = "OPERATION_STATE_FAILED"] = 5; + values[valuesById[6] = "OPERATION_STATE_CANCELLED"] = 6; + return values; + })(); + + v2.MetricsServiceV2 = (function() { /** - * Constructs a new CreateLogMetricRequest. + * Constructs a new MetricsServiceV2 service. * @memberof google.logging.v2 - * @classdesc Represents a CreateLogMetricRequest. - * @implements ICreateLogMetricRequest + * @classdesc Represents a MetricsServiceV2 + * @extends $protobuf.rpc.Service * @constructor - * @param {google.logging.v2.ICreateLogMetricRequest=} [properties] Properties to set + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ - function CreateLogMetricRequest(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]]; + function MetricsServiceV2(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } + (MetricsServiceV2.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = MetricsServiceV2; + /** - * CreateLogMetricRequest parent. - * @member {string} parent - * @memberof google.logging.v2.CreateLogMetricRequest - * @instance + * Creates new MetricsServiceV2 service using the specified rpc implementation. + * @function create + * @memberof google.logging.v2.MetricsServiceV2 + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {MetricsServiceV2} RPC service. Useful where requests and/or responses are streamed. */ - CreateLogMetricRequest.prototype.parent = ""; + MetricsServiceV2.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; /** - * CreateLogMetricRequest metric. - * @member {google.logging.v2.ILogMetric|null|undefined} metric - * @memberof google.logging.v2.CreateLogMetricRequest + * Callback as used by {@link google.logging.v2.MetricsServiceV2#listLogMetrics}. + * @memberof google.logging.v2.MetricsServiceV2 + * @typedef ListLogMetricsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.ListLogMetricsResponse} [response] ListLogMetricsResponse + */ + + /** + * Calls ListLogMetrics. + * @function listLogMetrics + * @memberof google.logging.v2.MetricsServiceV2 * @instance + * @param {google.logging.v2.IListLogMetricsRequest} request ListLogMetricsRequest message or plain object + * @param {google.logging.v2.MetricsServiceV2.ListLogMetricsCallback} callback Node-style callback called with the error, if any, and ListLogMetricsResponse + * @returns {undefined} + * @variation 1 */ - CreateLogMetricRequest.prototype.metric = null; + Object.defineProperty(MetricsServiceV2.prototype.listLogMetrics = function listLogMetrics(request, callback) { + return this.rpcCall(listLogMetrics, $root.google.logging.v2.ListLogMetricsRequest, $root.google.logging.v2.ListLogMetricsResponse, request, callback); + }, "name", { value: "ListLogMetrics" }); /** - * Creates a new CreateLogMetricRequest instance using the specified properties. - * @function create - * @memberof google.logging.v2.CreateLogMetricRequest - * @static - * @param {google.logging.v2.ICreateLogMetricRequest=} [properties] Properties to set - * @returns {google.logging.v2.CreateLogMetricRequest} CreateLogMetricRequest instance + * Calls ListLogMetrics. + * @function listLogMetrics + * @memberof google.logging.v2.MetricsServiceV2 + * @instance + * @param {google.logging.v2.IListLogMetricsRequest} request ListLogMetricsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - CreateLogMetricRequest.create = function create(properties) { - return new CreateLogMetricRequest(properties); - }; /** - * Encodes the specified CreateLogMetricRequest message. Does not implicitly {@link google.logging.v2.CreateLogMetricRequest.verify|verify} messages. - * @function encode - * @memberof google.logging.v2.CreateLogMetricRequest - * @static - * @param {google.logging.v2.ICreateLogMetricRequest} message CreateLogMetricRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Callback as used by {@link google.logging.v2.MetricsServiceV2#getLogMetric}. + * @memberof google.logging.v2.MetricsServiceV2 + * @typedef GetLogMetricCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.LogMetric} [response] LogMetric */ - CreateLogMetricRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.metric != null && Object.hasOwnProperty.call(message, "metric")) - $root.google.logging.v2.LogMetric.encode(message.metric, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; /** - * Encodes the specified CreateLogMetricRequest message, length delimited. Does not implicitly {@link google.logging.v2.CreateLogMetricRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.logging.v2.CreateLogMetricRequest - * @static - * @param {google.logging.v2.ICreateLogMetricRequest} message CreateLogMetricRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls GetLogMetric. + * @function getLogMetric + * @memberof google.logging.v2.MetricsServiceV2 + * @instance + * @param {google.logging.v2.IGetLogMetricRequest} request GetLogMetricRequest message or plain object + * @param {google.logging.v2.MetricsServiceV2.GetLogMetricCallback} callback Node-style callback called with the error, if any, and LogMetric + * @returns {undefined} + * @variation 1 */ - CreateLogMetricRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Object.defineProperty(MetricsServiceV2.prototype.getLogMetric = function getLogMetric(request, callback) { + return this.rpcCall(getLogMetric, $root.google.logging.v2.GetLogMetricRequest, $root.google.logging.v2.LogMetric, request, callback); + }, "name", { value: "GetLogMetric" }); /** - * Decodes a CreateLogMetricRequest message from the specified reader or buffer. - * @function decode - * @memberof google.logging.v2.CreateLogMetricRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.logging.v2.CreateLogMetricRequest} CreateLogMetricRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetLogMetric. + * @function getLogMetric + * @memberof google.logging.v2.MetricsServiceV2 + * @instance + * @param {google.logging.v2.IGetLogMetricRequest} request GetLogMetricRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - CreateLogMetricRequest.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.logging.v2.CreateLogMetricRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.metric = $root.google.logging.v2.LogMetric.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a CreateLogMetricRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.logging.v2.CreateLogMetricRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.logging.v2.CreateLogMetricRequest} CreateLogMetricRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.logging.v2.MetricsServiceV2#createLogMetric}. + * @memberof google.logging.v2.MetricsServiceV2 + * @typedef CreateLogMetricCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.LogMetric} [response] LogMetric */ - CreateLogMetricRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies a CreateLogMetricRequest message. - * @function verify - * @memberof google.logging.v2.CreateLogMetricRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls CreateLogMetric. + * @function createLogMetric + * @memberof google.logging.v2.MetricsServiceV2 + * @instance + * @param {google.logging.v2.ICreateLogMetricRequest} request CreateLogMetricRequest message or plain object + * @param {google.logging.v2.MetricsServiceV2.CreateLogMetricCallback} callback Node-style callback called with the error, if any, and LogMetric + * @returns {undefined} + * @variation 1 */ - CreateLogMetricRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.metric != null && message.hasOwnProperty("metric")) { - var error = $root.google.logging.v2.LogMetric.verify(message.metric); - if (error) - return "metric." + error; - } - return null; - }; + Object.defineProperty(MetricsServiceV2.prototype.createLogMetric = function createLogMetric(request, callback) { + return this.rpcCall(createLogMetric, $root.google.logging.v2.CreateLogMetricRequest, $root.google.logging.v2.LogMetric, request, callback); + }, "name", { value: "CreateLogMetric" }); /** - * Creates a CreateLogMetricRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.logging.v2.CreateLogMetricRequest - * @static - * @param {Object.} object Plain object - * @returns {google.logging.v2.CreateLogMetricRequest} CreateLogMetricRequest + * Calls CreateLogMetric. + * @function createLogMetric + * @memberof google.logging.v2.MetricsServiceV2 + * @instance + * @param {google.logging.v2.ICreateLogMetricRequest} request CreateLogMetricRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - CreateLogMetricRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.logging.v2.CreateLogMetricRequest) - return object; - var message = new $root.google.logging.v2.CreateLogMetricRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.metric != null) { - if (typeof object.metric !== "object") - throw TypeError(".google.logging.v2.CreateLogMetricRequest.metric: object expected"); - message.metric = $root.google.logging.v2.LogMetric.fromObject(object.metric); - } - return message; - }; /** - * Creates a plain object from a CreateLogMetricRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.logging.v2.CreateLogMetricRequest - * @static - * @param {google.logging.v2.CreateLogMetricRequest} message CreateLogMetricRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link google.logging.v2.MetricsServiceV2#updateLogMetric}. + * @memberof google.logging.v2.MetricsServiceV2 + * @typedef UpdateLogMetricCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.LogMetric} [response] LogMetric */ - CreateLogMetricRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.metric = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.metric != null && message.hasOwnProperty("metric")) - object.metric = $root.google.logging.v2.LogMetric.toObject(message.metric, options); - return object; - }; /** - * Converts this CreateLogMetricRequest to JSON. - * @function toJSON - * @memberof google.logging.v2.CreateLogMetricRequest + * Calls UpdateLogMetric. + * @function updateLogMetric + * @memberof google.logging.v2.MetricsServiceV2 * @instance - * @returns {Object.} JSON object + * @param {google.logging.v2.IUpdateLogMetricRequest} request UpdateLogMetricRequest message or plain object + * @param {google.logging.v2.MetricsServiceV2.UpdateLogMetricCallback} callback Node-style callback called with the error, if any, and LogMetric + * @returns {undefined} + * @variation 1 */ - CreateLogMetricRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Object.defineProperty(MetricsServiceV2.prototype.updateLogMetric = function updateLogMetric(request, callback) { + return this.rpcCall(updateLogMetric, $root.google.logging.v2.UpdateLogMetricRequest, $root.google.logging.v2.LogMetric, request, callback); + }, "name", { value: "UpdateLogMetric" }); - return CreateLogMetricRequest; + /** + * Calls UpdateLogMetric. + * @function updateLogMetric + * @memberof google.logging.v2.MetricsServiceV2 + * @instance + * @param {google.logging.v2.IUpdateLogMetricRequest} request UpdateLogMetricRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.MetricsServiceV2#deleteLogMetric}. + * @memberof google.logging.v2.MetricsServiceV2 + * @typedef DeleteLogMetricCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteLogMetric. + * @function deleteLogMetric + * @memberof google.logging.v2.MetricsServiceV2 + * @instance + * @param {google.logging.v2.IDeleteLogMetricRequest} request DeleteLogMetricRequest message or plain object + * @param {google.logging.v2.MetricsServiceV2.DeleteLogMetricCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MetricsServiceV2.prototype.deleteLogMetric = function deleteLogMetric(request, callback) { + return this.rpcCall(deleteLogMetric, $root.google.logging.v2.DeleteLogMetricRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteLogMetric" }); + + /** + * Calls DeleteLogMetric. + * @function deleteLogMetric + * @memberof google.logging.v2.MetricsServiceV2 + * @instance + * @param {google.logging.v2.IDeleteLogMetricRequest} request DeleteLogMetricRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return MetricsServiceV2; })(); - v2.UpdateLogMetricRequest = (function() { + v2.LogMetric = (function() { /** - * Properties of an UpdateLogMetricRequest. + * Properties of a LogMetric. * @memberof google.logging.v2 - * @interface IUpdateLogMetricRequest - * @property {string|null} [metricName] UpdateLogMetricRequest metricName - * @property {google.logging.v2.ILogMetric|null} [metric] UpdateLogMetricRequest metric + * @interface ILogMetric + * @property {string|null} [name] LogMetric name + * @property {string|null} [description] LogMetric description + * @property {string|null} [filter] LogMetric filter + * @property {boolean|null} [disabled] LogMetric disabled + * @property {google.api.IMetricDescriptor|null} [metricDescriptor] LogMetric metricDescriptor + * @property {string|null} [valueExtractor] LogMetric valueExtractor + * @property {Object.|null} [labelExtractors] LogMetric labelExtractors + * @property {google.api.Distribution.IBucketOptions|null} [bucketOptions] LogMetric bucketOptions + * @property {google.protobuf.ITimestamp|null} [createTime] LogMetric createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] LogMetric updateTime + * @property {google.logging.v2.LogMetric.ApiVersion|null} [version] LogMetric version */ /** - * Constructs a new UpdateLogMetricRequest. + * Constructs a new LogMetric. * @memberof google.logging.v2 - * @classdesc Represents an UpdateLogMetricRequest. - * @implements IUpdateLogMetricRequest + * @classdesc Represents a LogMetric. + * @implements ILogMetric * @constructor - * @param {google.logging.v2.IUpdateLogMetricRequest=} [properties] Properties to set + * @param {google.logging.v2.ILogMetric=} [properties] Properties to set */ - function UpdateLogMetricRequest(properties) { + function LogMetric(properties) { + this.labelExtractors = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -25897,289 +26515,225 @@ } /** - * UpdateLogMetricRequest metricName. - * @member {string} metricName - * @memberof google.logging.v2.UpdateLogMetricRequest + * LogMetric name. + * @member {string} name + * @memberof google.logging.v2.LogMetric * @instance */ - UpdateLogMetricRequest.prototype.metricName = ""; + LogMetric.prototype.name = ""; /** - * UpdateLogMetricRequest metric. - * @member {google.logging.v2.ILogMetric|null|undefined} metric - * @memberof google.logging.v2.UpdateLogMetricRequest + * LogMetric description. + * @member {string} description + * @memberof google.logging.v2.LogMetric * @instance */ - UpdateLogMetricRequest.prototype.metric = null; + LogMetric.prototype.description = ""; /** - * Creates a new UpdateLogMetricRequest instance using the specified properties. - * @function create - * @memberof google.logging.v2.UpdateLogMetricRequest - * @static - * @param {google.logging.v2.IUpdateLogMetricRequest=} [properties] Properties to set - * @returns {google.logging.v2.UpdateLogMetricRequest} UpdateLogMetricRequest instance + * LogMetric filter. + * @member {string} filter + * @memberof google.logging.v2.LogMetric + * @instance */ - UpdateLogMetricRequest.create = function create(properties) { - return new UpdateLogMetricRequest(properties); - }; + LogMetric.prototype.filter = ""; /** - * Encodes the specified UpdateLogMetricRequest message. Does not implicitly {@link google.logging.v2.UpdateLogMetricRequest.verify|verify} messages. - * @function encode - * @memberof google.logging.v2.UpdateLogMetricRequest - * @static - * @param {google.logging.v2.IUpdateLogMetricRequest} message UpdateLogMetricRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * LogMetric disabled. + * @member {boolean} disabled + * @memberof google.logging.v2.LogMetric + * @instance */ - UpdateLogMetricRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.metricName != null && Object.hasOwnProperty.call(message, "metricName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.metricName); - if (message.metric != null && Object.hasOwnProperty.call(message, "metric")) - $root.google.logging.v2.LogMetric.encode(message.metric, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + LogMetric.prototype.disabled = false; /** - * Encodes the specified UpdateLogMetricRequest message, length delimited. Does not implicitly {@link google.logging.v2.UpdateLogMetricRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.logging.v2.UpdateLogMetricRequest - * @static - * @param {google.logging.v2.IUpdateLogMetricRequest} message UpdateLogMetricRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * LogMetric metricDescriptor. + * @member {google.api.IMetricDescriptor|null|undefined} metricDescriptor + * @memberof google.logging.v2.LogMetric + * @instance */ - UpdateLogMetricRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + LogMetric.prototype.metricDescriptor = null; /** - * Decodes an UpdateLogMetricRequest message from the specified reader or buffer. - * @function decode - * @memberof google.logging.v2.UpdateLogMetricRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.logging.v2.UpdateLogMetricRequest} UpdateLogMetricRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * LogMetric valueExtractor. + * @member {string} valueExtractor + * @memberof google.logging.v2.LogMetric + * @instance */ - UpdateLogMetricRequest.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.logging.v2.UpdateLogMetricRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.metricName = reader.string(); - break; - case 2: - message.metric = $root.google.logging.v2.LogMetric.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateLogMetricRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.logging.v2.UpdateLogMetricRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.logging.v2.UpdateLogMetricRequest} UpdateLogMetricRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateLogMetricRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateLogMetricRequest message. - * @function verify - * @memberof google.logging.v2.UpdateLogMetricRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateLogMetricRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.metricName != null && message.hasOwnProperty("metricName")) - if (!$util.isString(message.metricName)) - return "metricName: string expected"; - if (message.metric != null && message.hasOwnProperty("metric")) { - var error = $root.google.logging.v2.LogMetric.verify(message.metric); - if (error) - return "metric." + error; - } - return null; - }; - - /** - * Creates an UpdateLogMetricRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.logging.v2.UpdateLogMetricRequest - * @static - * @param {Object.} object Plain object - * @returns {google.logging.v2.UpdateLogMetricRequest} UpdateLogMetricRequest - */ - UpdateLogMetricRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.logging.v2.UpdateLogMetricRequest) - return object; - var message = new $root.google.logging.v2.UpdateLogMetricRequest(); - if (object.metricName != null) - message.metricName = String(object.metricName); - if (object.metric != null) { - if (typeof object.metric !== "object") - throw TypeError(".google.logging.v2.UpdateLogMetricRequest.metric: object expected"); - message.metric = $root.google.logging.v2.LogMetric.fromObject(object.metric); - } - return message; - }; + LogMetric.prototype.valueExtractor = ""; /** - * Creates a plain object from an UpdateLogMetricRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.logging.v2.UpdateLogMetricRequest - * @static - * @param {google.logging.v2.UpdateLogMetricRequest} message UpdateLogMetricRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * LogMetric labelExtractors. + * @member {Object.} labelExtractors + * @memberof google.logging.v2.LogMetric + * @instance */ - UpdateLogMetricRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.metricName = ""; - object.metric = null; - } - if (message.metricName != null && message.hasOwnProperty("metricName")) - object.metricName = message.metricName; - if (message.metric != null && message.hasOwnProperty("metric")) - object.metric = $root.google.logging.v2.LogMetric.toObject(message.metric, options); - return object; - }; + LogMetric.prototype.labelExtractors = $util.emptyObject; /** - * Converts this UpdateLogMetricRequest to JSON. - * @function toJSON - * @memberof google.logging.v2.UpdateLogMetricRequest + * LogMetric bucketOptions. + * @member {google.api.Distribution.IBucketOptions|null|undefined} bucketOptions + * @memberof google.logging.v2.LogMetric * @instance - * @returns {Object.} JSON object */ - UpdateLogMetricRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return UpdateLogMetricRequest; - })(); - - v2.DeleteLogMetricRequest = (function() { + LogMetric.prototype.bucketOptions = null; /** - * Properties of a DeleteLogMetricRequest. - * @memberof google.logging.v2 - * @interface IDeleteLogMetricRequest - * @property {string|null} [metricName] DeleteLogMetricRequest metricName + * LogMetric createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.logging.v2.LogMetric + * @instance */ + LogMetric.prototype.createTime = null; /** - * Constructs a new DeleteLogMetricRequest. - * @memberof google.logging.v2 - * @classdesc Represents a DeleteLogMetricRequest. - * @implements IDeleteLogMetricRequest - * @constructor - * @param {google.logging.v2.IDeleteLogMetricRequest=} [properties] Properties to set + * LogMetric updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.logging.v2.LogMetric + * @instance */ - function DeleteLogMetricRequest(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]]; - } + LogMetric.prototype.updateTime = null; /** - * DeleteLogMetricRequest metricName. - * @member {string} metricName - * @memberof google.logging.v2.DeleteLogMetricRequest + * LogMetric version. + * @member {google.logging.v2.LogMetric.ApiVersion} version + * @memberof google.logging.v2.LogMetric * @instance */ - DeleteLogMetricRequest.prototype.metricName = ""; + LogMetric.prototype.version = 0; /** - * Creates a new DeleteLogMetricRequest instance using the specified properties. + * Creates a new LogMetric instance using the specified properties. * @function create - * @memberof google.logging.v2.DeleteLogMetricRequest + * @memberof google.logging.v2.LogMetric * @static - * @param {google.logging.v2.IDeleteLogMetricRequest=} [properties] Properties to set - * @returns {google.logging.v2.DeleteLogMetricRequest} DeleteLogMetricRequest instance + * @param {google.logging.v2.ILogMetric=} [properties] Properties to set + * @returns {google.logging.v2.LogMetric} LogMetric instance */ - DeleteLogMetricRequest.create = function create(properties) { - return new DeleteLogMetricRequest(properties); + LogMetric.create = function create(properties) { + return new LogMetric(properties); }; /** - * Encodes the specified DeleteLogMetricRequest message. Does not implicitly {@link google.logging.v2.DeleteLogMetricRequest.verify|verify} messages. + * Encodes the specified LogMetric message. Does not implicitly {@link google.logging.v2.LogMetric.verify|verify} messages. * @function encode - * @memberof google.logging.v2.DeleteLogMetricRequest + * @memberof google.logging.v2.LogMetric * @static - * @param {google.logging.v2.IDeleteLogMetricRequest} message DeleteLogMetricRequest message or plain object to encode + * @param {google.logging.v2.ILogMetric} message LogMetric message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteLogMetricRequest.encode = function encode(message, writer) { + LogMetric.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.metricName != null && Object.hasOwnProperty.call(message, "metricName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.metricName); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.version); + if (message.metricDescriptor != null && Object.hasOwnProperty.call(message, "metricDescriptor")) + $root.google.api.MetricDescriptor.encode(message.metricDescriptor, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.valueExtractor != null && Object.hasOwnProperty.call(message, "valueExtractor")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.valueExtractor); + if (message.labelExtractors != null && Object.hasOwnProperty.call(message, "labelExtractors")) + for (var keys = Object.keys(message.labelExtractors), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labelExtractors[keys[i]]).ldelim(); + if (message.bucketOptions != null && Object.hasOwnProperty.call(message, "bucketOptions")) + $root.google.api.Distribution.BucketOptions.encode(message.bucketOptions, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.disabled); return writer; }; /** - * Encodes the specified DeleteLogMetricRequest message, length delimited. Does not implicitly {@link google.logging.v2.DeleteLogMetricRequest.verify|verify} messages. + * Encodes the specified LogMetric message, length delimited. Does not implicitly {@link google.logging.v2.LogMetric.verify|verify} messages. * @function encodeDelimited - * @memberof google.logging.v2.DeleteLogMetricRequest + * @memberof google.logging.v2.LogMetric * @static - * @param {google.logging.v2.IDeleteLogMetricRequest} message DeleteLogMetricRequest message or plain object to encode + * @param {google.logging.v2.ILogMetric} message LogMetric message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteLogMetricRequest.encodeDelimited = function encodeDelimited(message, writer) { + LogMetric.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteLogMetricRequest message from the specified reader or buffer. + * Decodes a LogMetric message from the specified reader or buffer. * @function decode - * @memberof google.logging.v2.DeleteLogMetricRequest + * @memberof google.logging.v2.LogMetric * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.logging.v2.DeleteLogMetricRequest} DeleteLogMetricRequest + * @returns {google.logging.v2.LogMetric} LogMetric * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteLogMetricRequest.decode = function decode(reader, length) { + LogMetric.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.logging.v2.DeleteLogMetricRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.LogMetric(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.metricName = reader.string(); + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.filter = reader.string(); + break; + case 12: + message.disabled = reader.bool(); + break; + case 5: + message.metricDescriptor = $root.google.api.MetricDescriptor.decode(reader, reader.uint32()); + break; + case 6: + message.valueExtractor = reader.string(); + break; + case 7: + if (message.labelExtractors === $util.emptyObject) + message.labelExtractors = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labelExtractors[key] = value; + break; + case 8: + message.bucketOptions = $root.google.api.Distribution.BucketOptions.decode(reader, reader.uint32()); + break; + case 9: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 10: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 4: + message.version = reader.int32(); break; default: reader.skipType(tag & 7); @@ -26190,1526 +26744,1626 @@ }; /** - * Decodes a DeleteLogMetricRequest message from the specified reader or buffer, length delimited. + * Decodes a LogMetric message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.logging.v2.DeleteLogMetricRequest + * @memberof google.logging.v2.LogMetric * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.logging.v2.DeleteLogMetricRequest} DeleteLogMetricRequest + * @returns {google.logging.v2.LogMetric} LogMetric * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteLogMetricRequest.decodeDelimited = function decodeDelimited(reader) { + LogMetric.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteLogMetricRequest message. + * Verifies a LogMetric message. * @function verify - * @memberof google.logging.v2.DeleteLogMetricRequest + * @memberof google.logging.v2.LogMetric * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteLogMetricRequest.verify = function verify(message) { + LogMetric.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.metricName != null && message.hasOwnProperty("metricName")) - if (!$util.isString(message.metricName)) - return "metricName: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.disabled != null && message.hasOwnProperty("disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + if (message.metricDescriptor != null && message.hasOwnProperty("metricDescriptor")) { + var error = $root.google.api.MetricDescriptor.verify(message.metricDescriptor); + if (error) + return "metricDescriptor." + error; + } + if (message.valueExtractor != null && message.hasOwnProperty("valueExtractor")) + if (!$util.isString(message.valueExtractor)) + return "valueExtractor: string expected"; + if (message.labelExtractors != null && message.hasOwnProperty("labelExtractors")) { + if (!$util.isObject(message.labelExtractors)) + return "labelExtractors: object expected"; + var key = Object.keys(message.labelExtractors); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labelExtractors[key[i]])) + return "labelExtractors: string{k:string} expected"; + } + if (message.bucketOptions != null && message.hasOwnProperty("bucketOptions")) { + var error = $root.google.api.Distribution.BucketOptions.verify(message.bucketOptions); + if (error) + return "bucketOptions." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.version != null && message.hasOwnProperty("version")) + switch (message.version) { + default: + return "version: enum value expected"; + case 0: + case 1: + break; + } return null; }; /** - * Creates a DeleteLogMetricRequest message from a plain object. Also converts values to their respective internal types. + * Creates a LogMetric message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.logging.v2.DeleteLogMetricRequest + * @memberof google.logging.v2.LogMetric * @static * @param {Object.} object Plain object - * @returns {google.logging.v2.DeleteLogMetricRequest} DeleteLogMetricRequest + * @returns {google.logging.v2.LogMetric} LogMetric */ - DeleteLogMetricRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.logging.v2.DeleteLogMetricRequest) + LogMetric.fromObject = function fromObject(object) { + if (object instanceof $root.google.logging.v2.LogMetric) return object; - var message = new $root.google.logging.v2.DeleteLogMetricRequest(); - if (object.metricName != null) - message.metricName = String(object.metricName); + var message = new $root.google.logging.v2.LogMetric(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.filter != null) + message.filter = String(object.filter); + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + if (object.metricDescriptor != null) { + if (typeof object.metricDescriptor !== "object") + throw TypeError(".google.logging.v2.LogMetric.metricDescriptor: object expected"); + message.metricDescriptor = $root.google.api.MetricDescriptor.fromObject(object.metricDescriptor); + } + if (object.valueExtractor != null) + message.valueExtractor = String(object.valueExtractor); + if (object.labelExtractors) { + if (typeof object.labelExtractors !== "object") + throw TypeError(".google.logging.v2.LogMetric.labelExtractors: object expected"); + message.labelExtractors = {}; + for (var keys = Object.keys(object.labelExtractors), i = 0; i < keys.length; ++i) + message.labelExtractors[keys[i]] = String(object.labelExtractors[keys[i]]); + } + if (object.bucketOptions != null) { + if (typeof object.bucketOptions !== "object") + throw TypeError(".google.logging.v2.LogMetric.bucketOptions: object expected"); + message.bucketOptions = $root.google.api.Distribution.BucketOptions.fromObject(object.bucketOptions); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.logging.v2.LogMetric.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.logging.v2.LogMetric.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.version) { + case "V2": + case 0: + message.version = 0; + break; + case "V1": + case 1: + message.version = 1; + break; + } return message; }; /** - * Creates a plain object from a DeleteLogMetricRequest message. Also converts values to other types if specified. + * Creates a plain object from a LogMetric message. Also converts values to other types if specified. * @function toObject - * @memberof google.logging.v2.DeleteLogMetricRequest + * @memberof google.logging.v2.LogMetric * @static - * @param {google.logging.v2.DeleteLogMetricRequest} message DeleteLogMetricRequest + * @param {google.logging.v2.LogMetric} message LogMetric * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteLogMetricRequest.toObject = function toObject(message, options) { + LogMetric.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.metricName = ""; - if (message.metricName != null && message.hasOwnProperty("metricName")) - object.metricName = message.metricName; + if (options.objects || options.defaults) + object.labelExtractors = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.filter = ""; + object.version = options.enums === String ? "V2" : 0; + object.metricDescriptor = null; + object.valueExtractor = ""; + object.bucketOptions = null; + object.createTime = null; + object.updateTime = null; + object.disabled = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.version != null && message.hasOwnProperty("version")) + object.version = options.enums === String ? $root.google.logging.v2.LogMetric.ApiVersion[message.version] : message.version; + if (message.metricDescriptor != null && message.hasOwnProperty("metricDescriptor")) + object.metricDescriptor = $root.google.api.MetricDescriptor.toObject(message.metricDescriptor, options); + if (message.valueExtractor != null && message.hasOwnProperty("valueExtractor")) + object.valueExtractor = message.valueExtractor; + var keys2; + if (message.labelExtractors && (keys2 = Object.keys(message.labelExtractors)).length) { + object.labelExtractors = {}; + for (var j = 0; j < keys2.length; ++j) + object.labelExtractors[keys2[j]] = message.labelExtractors[keys2[j]]; + } + if (message.bucketOptions != null && message.hasOwnProperty("bucketOptions")) + object.bucketOptions = $root.google.api.Distribution.BucketOptions.toObject(message.bucketOptions, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.disabled != null && message.hasOwnProperty("disabled")) + object.disabled = message.disabled; return object; }; /** - * Converts this DeleteLogMetricRequest to JSON. + * Converts this LogMetric to JSON. * @function toJSON - * @memberof google.logging.v2.DeleteLogMetricRequest + * @memberof google.logging.v2.LogMetric * @instance * @returns {Object.} JSON object */ - DeleteLogMetricRequest.prototype.toJSON = function toJSON() { + LogMetric.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteLogMetricRequest; - })(); + /** + * ApiVersion enum. + * @name google.logging.v2.LogMetric.ApiVersion + * @enum {number} + * @property {number} V2=0 V2 value + * @property {number} V1=1 V1 value + */ + LogMetric.ApiVersion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "V2"] = 0; + values[valuesById[1] = "V1"] = 1; + return values; + })(); - return v2; - })(); + return LogMetric; + })(); - return logging; - })(); + v2.ListLogMetricsRequest = (function() { - google.api = (function() { + /** + * Properties of a ListLogMetricsRequest. + * @memberof google.logging.v2 + * @interface IListLogMetricsRequest + * @property {string|null} [parent] ListLogMetricsRequest parent + * @property {string|null} [pageToken] ListLogMetricsRequest pageToken + * @property {number|null} [pageSize] ListLogMetricsRequest pageSize + */ - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; + /** + * Constructs a new ListLogMetricsRequest. + * @memberof google.logging.v2 + * @classdesc Represents a ListLogMetricsRequest. + * @implements IListLogMetricsRequest + * @constructor + * @param {google.logging.v2.IListLogMetricsRequest=} [properties] Properties to set + */ + function ListLogMetricsRequest(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]]; + } - api.Http = (function() { + /** + * ListLogMetricsRequest parent. + * @member {string} parent + * @memberof google.logging.v2.ListLogMetricsRequest + * @instance + */ + ListLogMetricsRequest.prototype.parent = ""; - /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion - */ + /** + * ListLogMetricsRequest pageToken. + * @member {string} pageToken + * @memberof google.logging.v2.ListLogMetricsRequest + * @instance + */ + ListLogMetricsRequest.prototype.pageToken = ""; - /** - * Constructs a new Http. - * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp - * @constructor - * @param {google.api.IHttp=} [properties] Properties to set - */ - function Http(properties) { - this.rules = []; - 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]]; - } - - /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http - * @instance - */ - Http.prototype.rules = $util.emptyArray; - - /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http - * @instance - */ - Http.prototype.fullyDecodeReservedExpansion = false; + /** + * ListLogMetricsRequest pageSize. + * @member {number} pageSize + * @memberof google.logging.v2.ListLogMetricsRequest + * @instance + */ + ListLogMetricsRequest.prototype.pageSize = 0; - /** - * Creates a new Http instance using the specified properties. - * @function create - * @memberof google.api.Http - * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance - */ - Http.create = function create(properties) { - return new Http(properties); - }; + /** + * Creates a new ListLogMetricsRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.ListLogMetricsRequest + * @static + * @param {google.logging.v2.IListLogMetricsRequest=} [properties] Properties to set + * @returns {google.logging.v2.ListLogMetricsRequest} ListLogMetricsRequest instance + */ + ListLogMetricsRequest.create = function create(properties) { + return new ListLogMetricsRequest(properties); + }; - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encode - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.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); - return writer; - }; + /** + * Encodes the specified ListLogMetricsRequest message. Does not implicitly {@link google.logging.v2.ListLogMetricsRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.ListLogMetricsRequest + * @static + * @param {google.logging.v2.IListLogMetricsRequest} message ListLogMetricsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLogMetricsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + return writer; + }; - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified ListLogMetricsRequest message, length delimited. Does not implicitly {@link google.logging.v2.ListLogMetricsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.ListLogMetricsRequest + * @static + * @param {google.logging.v2.IListLogMetricsRequest} message ListLogMetricsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLogMetricsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a Http message from the specified reader or buffer. - * @function decode - * @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.Http} Http - * @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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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: - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - case 2: - message.fullyDecodeReservedExpansion = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes a ListLogMetricsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.ListLogMetricsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.ListLogMetricsRequest} ListLogMetricsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLogMetricsRequest.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.logging.v2.ListLogMetricsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageToken = reader.string(); + break; + case 3: + message.pageSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - Http.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return message; + }; - /** - * Verifies a Http message. - * @function verify - * @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 - */ - Http.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.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; - return null; - }; + /** + * Decodes a ListLogMetricsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.ListLogMetricsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.ListLogMetricsRequest} ListLogMetricsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLogMetricsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Http - * @static - * @param {Object.} object Plain object - * @returns {google.api.Http} Http - */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) - 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]); - } - } - 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. - * @function toObject - * @memberof google.api.Http - * @static - * @param {google.api.Http} message Http - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Http.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 (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); - }; + /** + * Verifies a ListLogMetricsRequest message. + * @function verify + * @memberof google.logging.v2.ListLogMetricsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListLogMetricsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; - return Http; - })(); + /** + * Creates a ListLogMetricsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.ListLogMetricsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.ListLogMetricsRequest} ListLogMetricsRequest + */ + ListLogMetricsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.logging.v2.ListLogMetricsRequest) + return object; + var message = new $root.google.logging.v2.ListLogMetricsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; - api.HttpRule = (function() { + /** + * Creates a plain object from a ListLogMetricsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.ListLogMetricsRequest + * @static + * @param {google.logging.v2.ListLogMetricsRequest} message ListLogMetricsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListLogMetricsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; - /** - * 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 - */ + /** + * Converts this ListLogMetricsRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.ListLogMetricsRequest + * @instance + * @returns {Object.} JSON object + */ + ListLogMetricsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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]]; - } + return ListLogMetricsRequest; + })(); - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; + v2.ListLogMetricsResponse = (function() { - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; + /** + * Properties of a ListLogMetricsResponse. + * @memberof google.logging.v2 + * @interface IListLogMetricsResponse + * @property {Array.|null} [metrics] ListLogMetricsResponse metrics + * @property {string|null} [nextPageToken] ListLogMetricsResponse nextPageToken + */ - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; + /** + * Constructs a new ListLogMetricsResponse. + * @memberof google.logging.v2 + * @classdesc Represents a ListLogMetricsResponse. + * @implements IListLogMetricsResponse + * @constructor + * @param {google.logging.v2.IListLogMetricsResponse=} [properties] Properties to set + */ + function ListLogMetricsResponse(properties) { + this.metrics = []; + 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 post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; + /** + * ListLogMetricsResponse metrics. + * @member {Array.} metrics + * @memberof google.logging.v2.ListLogMetricsResponse + * @instance + */ + ListLogMetricsResponse.prototype.metrics = $util.emptyArray; - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; + /** + * ListLogMetricsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.logging.v2.ListLogMetricsResponse + * @instance + */ + ListLogMetricsResponse.prototype.nextPageToken = ""; - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; + /** + * Creates a new ListLogMetricsResponse instance using the specified properties. + * @function create + * @memberof google.logging.v2.ListLogMetricsResponse + * @static + * @param {google.logging.v2.IListLogMetricsResponse=} [properties] Properties to set + * @returns {google.logging.v2.ListLogMetricsResponse} ListLogMetricsResponse instance + */ + ListLogMetricsResponse.create = function create(properties) { + return new ListLogMetricsResponse(properties); + }; - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; + /** + * Encodes the specified ListLogMetricsResponse message. Does not implicitly {@link google.logging.v2.ListLogMetricsResponse.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.ListLogMetricsResponse + * @static + * @param {google.logging.v2.IListLogMetricsResponse} message ListLogMetricsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLogMetricsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metrics != null && message.metrics.length) + for (var i = 0; i < message.metrics.length; ++i) + $root.google.logging.v2.LogMetric.encode(message.metrics[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; + /** + * Encodes the specified ListLogMetricsResponse message, length delimited. Does not implicitly {@link google.logging.v2.ListLogMetricsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.ListLogMetricsResponse + * @static + * @param {google.logging.v2.IListLogMetricsResponse} message ListLogMetricsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLogMetricsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.responseBody = ""; + /** + * Decodes a ListLogMetricsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.ListLogMetricsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.ListLogMetricsResponse} ListLogMetricsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLogMetricsResponse.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.logging.v2.ListLogMetricsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.metrics && message.metrics.length)) + message.metrics = []; + message.metrics.push($root.google.logging.v2.LogMetric.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.additionalBindings = $util.emptyArray; + /** + * Decodes a ListLogMetricsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.ListLogMetricsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.ListLogMetricsResponse} ListLogMetricsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLogMetricsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Verifies a ListLogMetricsResponse message. + * @function verify + * @memberof google.logging.v2.ListLogMetricsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListLogMetricsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metrics != null && message.hasOwnProperty("metrics")) { + if (!Array.isArray(message.metrics)) + return "metrics: array expected"; + for (var i = 0; i < message.metrics.length; ++i) { + var error = $root.google.logging.v2.LogMetric.verify(message.metrics[i]); + if (error) + return "metrics." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; - /** - * 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 ListLogMetricsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.ListLogMetricsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.ListLogMetricsResponse} ListLogMetricsResponse + */ + ListLogMetricsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.logging.v2.ListLogMetricsResponse) + return object; + var message = new $root.google.logging.v2.ListLogMetricsResponse(); + if (object.metrics) { + if (!Array.isArray(object.metrics)) + throw TypeError(".google.logging.v2.ListLogMetricsResponse.metrics: array expected"); + message.metrics = []; + for (var i = 0; i < object.metrics.length; ++i) { + if (typeof object.metrics[i] !== "object") + throw TypeError(".google.logging.v2.ListLogMetricsResponse.metrics: object expected"); + message.metrics[i] = $root.google.logging.v2.LogMetric.fromObject(object.metrics[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; - /** - * Creates a new HttpRule instance using the specified properties. - * @function create - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance - */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); - }; + /** + * Creates a plain object from a ListLogMetricsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.ListLogMetricsResponse + * @static + * @param {google.logging.v2.ListLogMetricsResponse} message ListLogMetricsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListLogMetricsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.metrics = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.metrics && message.metrics.length) { + object.metrics = []; + for (var j = 0; j < message.metrics.length; ++j) + object.metrics[j] = $root.google.logging.v2.LogMetric.toObject(message.metrics[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encode - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.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); - return writer; - }; + /** + * Converts this ListLogMetricsResponse to JSON. + * @function toJSON + * @memberof google.logging.v2.ListLogMetricsResponse + * @instance + * @returns {Object.} JSON object + */ + ListLogMetricsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return ListLogMetricsResponse; + })(); - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @function decode - * @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.HttpRule} HttpRule - * @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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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.selector = 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())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + v2.GetLogMetricRequest = (function() { - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Properties of a GetLogMetricRequest. + * @memberof google.logging.v2 + * @interface IGetLogMetricRequest + * @property {string|null} [metricName] GetLogMetricRequest metricName + */ - /** - * Verifies a HttpRule message. - * @function verify - * @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 - */ - HttpRule.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; - } + /** + * Constructs a new GetLogMetricRequest. + * @memberof google.logging.v2 + * @classdesc Represents a GetLogMetricRequest. + * @implements IGetLogMetricRequest + * @constructor + * @param {google.logging.v2.IGetLogMetricRequest=} [properties] Properties to set + */ + function GetLogMetricRequest(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]]; } - return null; - }; - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.HttpRule - * @static - * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule - */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) - 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]); - } - } - return message; - }; + /** + * GetLogMetricRequest metricName. + * @member {string} metricName + * @memberof google.logging.v2.GetLogMetricRequest + * @instance + */ + GetLogMetricRequest.prototype.metricName = ""; - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.HttpRule - * @static - * @param {google.api.HttpRule} message HttpRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HttpRule.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); - } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; - return object; - }; + /** + * Creates a new GetLogMetricRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.GetLogMetricRequest + * @static + * @param {google.logging.v2.IGetLogMetricRequest=} [properties] Properties to set + * @returns {google.logging.v2.GetLogMetricRequest} GetLogMetricRequest instance + */ + GetLogMetricRequest.create = function create(properties) { + return new GetLogMetricRequest(properties); + }; - /** - * Converts this HttpRule to JSON. - * @function toJSON - * @memberof google.api.HttpRule - * @instance - * @returns {Object.} JSON object - */ - HttpRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Encodes the specified GetLogMetricRequest message. Does not implicitly {@link google.logging.v2.GetLogMetricRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.GetLogMetricRequest + * @static + * @param {google.logging.v2.IGetLogMetricRequest} message GetLogMetricRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetLogMetricRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metricName != null && Object.hasOwnProperty.call(message, "metricName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.metricName); + return writer; + }; - return HttpRule; - })(); + /** + * Encodes the specified GetLogMetricRequest message, length delimited. Does not implicitly {@link google.logging.v2.GetLogMetricRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.GetLogMetricRequest + * @static + * @param {google.logging.v2.IGetLogMetricRequest} message GetLogMetricRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetLogMetricRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - api.CustomHttpPattern = (function() { + /** + * Decodes a GetLogMetricRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.GetLogMetricRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.GetLogMetricRequest} GetLogMetricRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetLogMetricRequest.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.logging.v2.GetLogMetricRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.metricName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path - */ + /** + * Decodes a GetLogMetricRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.GetLogMetricRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.GetLogMetricRequest} GetLogMetricRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetLogMetricRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Constructs a new CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern - * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - */ - function CustomHttpPattern(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]]; - } + /** + * Verifies a GetLogMetricRequest message. + * @function verify + * @memberof google.logging.v2.GetLogMetricRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetLogMetricRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metricName != null && message.hasOwnProperty("metricName")) + if (!$util.isString(message.metricName)) + return "metricName: string expected"; + return null; + }; - /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.kind = ""; + /** + * Creates a GetLogMetricRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.GetLogMetricRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.GetLogMetricRequest} GetLogMetricRequest + */ + GetLogMetricRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.logging.v2.GetLogMetricRequest) + return object; + var message = new $root.google.logging.v2.GetLogMetricRequest(); + if (object.metricName != null) + message.metricName = String(object.metricName); + return message; + }; - /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.path = ""; + /** + * Creates a plain object from a GetLogMetricRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.GetLogMetricRequest + * @static + * @param {google.logging.v2.GetLogMetricRequest} message GetLogMetricRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetLogMetricRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metricName = ""; + if (message.metricName != null && message.hasOwnProperty("metricName")) + object.metricName = message.metricName; + return object; + }; - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @function create - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance - */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); - }; + /** + * Converts this GetLogMetricRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.GetLogMetricRequest + * @instance + * @returns {Object.} JSON object + */ + GetLogMetricRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encode - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.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); - return writer; - }; + return GetLogMetricRequest; + })(); - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @function decode - * @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.CustomHttpPattern} CustomHttpPattern - * @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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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.kind = reader.string(); - break; - case 2: - message.path = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomHttpPattern message. - * @function verify - * @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 - */ - CustomHttpPattern.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"; - return null; - }; + v2.CreateLogMetricRequest = (function() { - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) - 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); - return message; - }; + /** + * Properties of a CreateLogMetricRequest. + * @memberof google.logging.v2 + * @interface ICreateLogMetricRequest + * @property {string|null} [parent] CreateLogMetricRequest parent + * @property {google.logging.v2.ILogMetric|null} [metric] CreateLogMetricRequest metric + */ - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomHttpPattern.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; + /** + * Constructs a new CreateLogMetricRequest. + * @memberof google.logging.v2 + * @classdesc Represents a CreateLogMetricRequest. + * @implements ICreateLogMetricRequest + * @constructor + * @param {google.logging.v2.ICreateLogMetricRequest=} [properties] Properties to set + */ + function CreateLogMetricRequest(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]]; } - 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 CustomHttpPattern to JSON. - * @function toJSON - * @memberof google.api.CustomHttpPattern - * @instance - * @returns {Object.} JSON object - */ - CustomHttpPattern.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * CreateLogMetricRequest parent. + * @member {string} parent + * @memberof google.logging.v2.CreateLogMetricRequest + * @instance + */ + CreateLogMetricRequest.prototype.parent = ""; - return CustomHttpPattern; - })(); + /** + * CreateLogMetricRequest metric. + * @member {google.logging.v2.ILogMetric|null|undefined} metric + * @memberof google.logging.v2.CreateLogMetricRequest + * @instance + */ + CreateLogMetricRequest.prototype.metric = null; - /** - * FieldBehavior enum. - * @name google.api.FieldBehavior - * @enum {number} - * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value - * @property {number} OPTIONAL=1 OPTIONAL value - * @property {number} REQUIRED=2 REQUIRED value - * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value - * @property {number} INPUT_ONLY=4 INPUT_ONLY value - * @property {number} IMMUTABLE=5 IMMUTABLE value - * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value - * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value - */ - api.FieldBehavior = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "OPTIONAL"] = 1; - values[valuesById[2] = "REQUIRED"] = 2; - values[valuesById[3] = "OUTPUT_ONLY"] = 3; - values[valuesById[4] = "INPUT_ONLY"] = 4; - values[valuesById[5] = "IMMUTABLE"] = 5; - values[valuesById[6] = "UNORDERED_LIST"] = 6; - values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; - return values; - })(); + /** + * Creates a new CreateLogMetricRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.CreateLogMetricRequest + * @static + * @param {google.logging.v2.ICreateLogMetricRequest=} [properties] Properties to set + * @returns {google.logging.v2.CreateLogMetricRequest} CreateLogMetricRequest instance + */ + CreateLogMetricRequest.create = function create(properties) { + return new CreateLogMetricRequest(properties); + }; - api.MonitoredResourceDescriptor = (function() { + /** + * Encodes the specified CreateLogMetricRequest message. Does not implicitly {@link google.logging.v2.CreateLogMetricRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.CreateLogMetricRequest + * @static + * @param {google.logging.v2.ICreateLogMetricRequest} message CreateLogMetricRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateLogMetricRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.metric != null && Object.hasOwnProperty.call(message, "metric")) + $root.google.logging.v2.LogMetric.encode(message.metric, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * Properties of a MonitoredResourceDescriptor. - * @memberof google.api - * @interface IMonitoredResourceDescriptor - * @property {string|null} [name] MonitoredResourceDescriptor name - * @property {string|null} [type] MonitoredResourceDescriptor type - * @property {string|null} [displayName] MonitoredResourceDescriptor displayName - * @property {string|null} [description] MonitoredResourceDescriptor description - * @property {Array.|null} [labels] MonitoredResourceDescriptor labels - * @property {google.api.LaunchStage|null} [launchStage] MonitoredResourceDescriptor launchStage - */ + /** + * Encodes the specified CreateLogMetricRequest message, length delimited. Does not implicitly {@link google.logging.v2.CreateLogMetricRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.CreateLogMetricRequest + * @static + * @param {google.logging.v2.ICreateLogMetricRequest} message CreateLogMetricRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateLogMetricRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new MonitoredResourceDescriptor. - * @memberof google.api - * @classdesc Represents a MonitoredResourceDescriptor. - * @implements IMonitoredResourceDescriptor - * @constructor - * @param {google.api.IMonitoredResourceDescriptor=} [properties] Properties to set - */ - function MonitoredResourceDescriptor(properties) { - this.labels = []; - 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]]; - } + /** + * Decodes a CreateLogMetricRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.CreateLogMetricRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.CreateLogMetricRequest} CreateLogMetricRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateLogMetricRequest.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.logging.v2.CreateLogMetricRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.metric = $root.google.logging.v2.LogMetric.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * MonitoredResourceDescriptor name. - * @member {string} name - * @memberof google.api.MonitoredResourceDescriptor - * @instance - */ - MonitoredResourceDescriptor.prototype.name = ""; + /** + * Decodes a CreateLogMetricRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.CreateLogMetricRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.CreateLogMetricRequest} CreateLogMetricRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateLogMetricRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * MonitoredResourceDescriptor type. - * @member {string} type - * @memberof google.api.MonitoredResourceDescriptor - * @instance - */ - MonitoredResourceDescriptor.prototype.type = ""; + /** + * Verifies a CreateLogMetricRequest message. + * @function verify + * @memberof google.logging.v2.CreateLogMetricRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateLogMetricRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.metric != null && message.hasOwnProperty("metric")) { + var error = $root.google.logging.v2.LogMetric.verify(message.metric); + if (error) + return "metric." + error; + } + return null; + }; - /** - * MonitoredResourceDescriptor displayName. - * @member {string} displayName - * @memberof google.api.MonitoredResourceDescriptor - * @instance - */ - MonitoredResourceDescriptor.prototype.displayName = ""; + /** + * Creates a CreateLogMetricRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.CreateLogMetricRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.CreateLogMetricRequest} CreateLogMetricRequest + */ + CreateLogMetricRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.logging.v2.CreateLogMetricRequest) + return object; + var message = new $root.google.logging.v2.CreateLogMetricRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.metric != null) { + if (typeof object.metric !== "object") + throw TypeError(".google.logging.v2.CreateLogMetricRequest.metric: object expected"); + message.metric = $root.google.logging.v2.LogMetric.fromObject(object.metric); + } + return message; + }; - /** - * MonitoredResourceDescriptor description. - * @member {string} description - * @memberof google.api.MonitoredResourceDescriptor - * @instance - */ - MonitoredResourceDescriptor.prototype.description = ""; + /** + * Creates a plain object from a CreateLogMetricRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.CreateLogMetricRequest + * @static + * @param {google.logging.v2.CreateLogMetricRequest} message CreateLogMetricRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateLogMetricRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.metric = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.metric != null && message.hasOwnProperty("metric")) + object.metric = $root.google.logging.v2.LogMetric.toObject(message.metric, options); + return object; + }; - /** - * MonitoredResourceDescriptor labels. - * @member {Array.} labels - * @memberof google.api.MonitoredResourceDescriptor - * @instance - */ - MonitoredResourceDescriptor.prototype.labels = $util.emptyArray; + /** + * Converts this CreateLogMetricRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.CreateLogMetricRequest + * @instance + * @returns {Object.} JSON object + */ + CreateLogMetricRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * MonitoredResourceDescriptor launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.api.MonitoredResourceDescriptor - * @instance - */ - MonitoredResourceDescriptor.prototype.launchStage = 0; + return CreateLogMetricRequest; + })(); - /** - * Creates a new MonitoredResourceDescriptor instance using the specified properties. - * @function create - * @memberof google.api.MonitoredResourceDescriptor - * @static - * @param {google.api.IMonitoredResourceDescriptor=} [properties] Properties to set - * @returns {google.api.MonitoredResourceDescriptor} MonitoredResourceDescriptor instance - */ - MonitoredResourceDescriptor.create = function create(properties) { - return new MonitoredResourceDescriptor(properties); - }; + v2.UpdateLogMetricRequest = (function() { - /** - * Encodes the specified MonitoredResourceDescriptor message. Does not implicitly {@link google.api.MonitoredResourceDescriptor.verify|verify} messages. - * @function encode - * @memberof google.api.MonitoredResourceDescriptor - * @static - * @param {google.api.IMonitoredResourceDescriptor} message MonitoredResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MonitoredResourceDescriptor.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - 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.labels != null && message.labels.length) - for (var i = 0; i < message.labels.length; ++i) - $root.google.api.LabelDescriptor.encode(message.labels[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.name); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.launchStage); - return writer; - }; + /** + * Properties of an UpdateLogMetricRequest. + * @memberof google.logging.v2 + * @interface IUpdateLogMetricRequest + * @property {string|null} [metricName] UpdateLogMetricRequest metricName + * @property {google.logging.v2.ILogMetric|null} [metric] UpdateLogMetricRequest metric + */ - /** - * Encodes the specified MonitoredResourceDescriptor message, length delimited. Does not implicitly {@link google.api.MonitoredResourceDescriptor.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MonitoredResourceDescriptor - * @static - * @param {google.api.IMonitoredResourceDescriptor} message MonitoredResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MonitoredResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Constructs a new UpdateLogMetricRequest. + * @memberof google.logging.v2 + * @classdesc Represents an UpdateLogMetricRequest. + * @implements IUpdateLogMetricRequest + * @constructor + * @param {google.logging.v2.IUpdateLogMetricRequest=} [properties] Properties to set + */ + function UpdateLogMetricRequest(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]]; + } - /** - * Decodes a MonitoredResourceDescriptor message from the specified reader or buffer. - * @function decode - * @memberof google.api.MonitoredResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MonitoredResourceDescriptor} MonitoredResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MonitoredResourceDescriptor.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.MonitoredResourceDescriptor(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 5: - message.name = reader.string(); - break; - case 1: - message.type = reader.string(); - break; - case 2: - message.displayName = reader.string(); - break; - case 3: - message.description = reader.string(); - break; - case 4: - if (!(message.labels && message.labels.length)) - message.labels = []; - message.labels.push($root.google.api.LabelDescriptor.decode(reader, reader.uint32())); - break; - case 7: - message.launchStage = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * UpdateLogMetricRequest metricName. + * @member {string} metricName + * @memberof google.logging.v2.UpdateLogMetricRequest + * @instance + */ + UpdateLogMetricRequest.prototype.metricName = ""; + + /** + * UpdateLogMetricRequest metric. + * @member {google.logging.v2.ILogMetric|null|undefined} metric + * @memberof google.logging.v2.UpdateLogMetricRequest + * @instance + */ + UpdateLogMetricRequest.prototype.metric = null; + + /** + * Creates a new UpdateLogMetricRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.UpdateLogMetricRequest + * @static + * @param {google.logging.v2.IUpdateLogMetricRequest=} [properties] Properties to set + * @returns {google.logging.v2.UpdateLogMetricRequest} UpdateLogMetricRequest instance + */ + UpdateLogMetricRequest.create = function create(properties) { + return new UpdateLogMetricRequest(properties); + }; + + /** + * Encodes the specified UpdateLogMetricRequest message. Does not implicitly {@link google.logging.v2.UpdateLogMetricRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.UpdateLogMetricRequest + * @static + * @param {google.logging.v2.IUpdateLogMetricRequest} message UpdateLogMetricRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateLogMetricRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metricName != null && Object.hasOwnProperty.call(message, "metricName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.metricName); + if (message.metric != null && Object.hasOwnProperty.call(message, "metric")) + $root.google.logging.v2.LogMetric.encode(message.metric, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateLogMetricRequest message, length delimited. Does not implicitly {@link google.logging.v2.UpdateLogMetricRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.UpdateLogMetricRequest + * @static + * @param {google.logging.v2.IUpdateLogMetricRequest} message UpdateLogMetricRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateLogMetricRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateLogMetricRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.UpdateLogMetricRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.UpdateLogMetricRequest} UpdateLogMetricRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateLogMetricRequest.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.logging.v2.UpdateLogMetricRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.metricName = reader.string(); + break; + case 2: + message.metric = $root.google.logging.v2.LogMetric.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes a MonitoredResourceDescriptor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MonitoredResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MonitoredResourceDescriptor} MonitoredResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MonitoredResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes an UpdateLogMetricRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.UpdateLogMetricRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.UpdateLogMetricRequest} UpdateLogMetricRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateLogMetricRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a MonitoredResourceDescriptor message. - * @function verify - * @memberof google.api.MonitoredResourceDescriptor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MonitoredResourceDescriptor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!Array.isArray(message.labels)) - return "labels: array expected"; - for (var i = 0; i < message.labels.length; ++i) { - var error = $root.google.api.LabelDescriptor.verify(message.labels[i]); + /** + * Verifies an UpdateLogMetricRequest message. + * @function verify + * @memberof google.logging.v2.UpdateLogMetricRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateLogMetricRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metricName != null && message.hasOwnProperty("metricName")) + if (!$util.isString(message.metricName)) + return "metricName: string expected"; + if (message.metric != null && message.hasOwnProperty("metric")) { + var error = $root.google.logging.v2.LogMetric.verify(message.metric); if (error) - return "labels." + error; + return "metric." + error; } - } - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - switch (message.launchStage) { - default: - return "launchStage: enum value expected"; - case 0: - case 6: - case 7: - case 1: - case 2: - case 3: - case 4: - case 5: - break; + return null; + }; + + /** + * Creates an UpdateLogMetricRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.UpdateLogMetricRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.UpdateLogMetricRequest} UpdateLogMetricRequest + */ + UpdateLogMetricRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.logging.v2.UpdateLogMetricRequest) + return object; + var message = new $root.google.logging.v2.UpdateLogMetricRequest(); + if (object.metricName != null) + message.metricName = String(object.metricName); + if (object.metric != null) { + if (typeof object.metric !== "object") + throw TypeError(".google.logging.v2.UpdateLogMetricRequest.metric: object expected"); + message.metric = $root.google.logging.v2.LogMetric.fromObject(object.metric); } - return null; - }; + return message; + }; - /** - * Creates a MonitoredResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MonitoredResourceDescriptor - * @static - * @param {Object.} object Plain object - * @returns {google.api.MonitoredResourceDescriptor} MonitoredResourceDescriptor - */ - MonitoredResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MonitoredResourceDescriptor) - return object; - var message = new $root.google.api.MonitoredResourceDescriptor(); - if (object.name != null) - message.name = String(object.name); - if (object.type != null) - message.type = String(object.type); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.labels) { - if (!Array.isArray(object.labels)) - throw TypeError(".google.api.MonitoredResourceDescriptor.labels: array expected"); - message.labels = []; - for (var i = 0; i < object.labels.length; ++i) { - if (typeof object.labels[i] !== "object") - throw TypeError(".google.api.MonitoredResourceDescriptor.labels: object expected"); - message.labels[i] = $root.google.api.LabelDescriptor.fromObject(object.labels[i]); + /** + * Creates a plain object from an UpdateLogMetricRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.UpdateLogMetricRequest + * @static + * @param {google.logging.v2.UpdateLogMetricRequest} message UpdateLogMetricRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateLogMetricRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.metricName = ""; + object.metric = null; } - } - switch (object.launchStage) { - case "LAUNCH_STAGE_UNSPECIFIED": - case 0: - message.launchStage = 0; - break; - case "UNIMPLEMENTED": - case 6: - message.launchStage = 6; - break; - case "PRELAUNCH": - case 7: - message.launchStage = 7; - break; - case "EARLY_ACCESS": - case 1: - message.launchStage = 1; - break; - case "ALPHA": - case 2: - message.launchStage = 2; - break; - case "BETA": - case 3: - message.launchStage = 3; - break; - case "GA": - case 4: - message.launchStage = 4; - break; - case "DEPRECATED": - case 5: - message.launchStage = 5; - break; - } - return message; - }; + if (message.metricName != null && message.hasOwnProperty("metricName")) + object.metricName = message.metricName; + if (message.metric != null && message.hasOwnProperty("metric")) + object.metric = $root.google.logging.v2.LogMetric.toObject(message.metric, options); + return object; + }; - /** - * Creates a plain object from a MonitoredResourceDescriptor message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MonitoredResourceDescriptor - * @static - * @param {google.api.MonitoredResourceDescriptor} message MonitoredResourceDescriptor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MonitoredResourceDescriptor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.labels = []; - if (options.defaults) { - object.type = ""; - object.displayName = ""; - object.description = ""; - object.name = ""; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.labels && message.labels.length) { - object.labels = []; - for (var j = 0; j < message.labels.length; ++j) - object.labels[j] = $root.google.api.LabelDescriptor.toObject(message.labels[j], options); - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] : message.launchStage; - return object; - }; + /** + * Converts this UpdateLogMetricRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.UpdateLogMetricRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateLogMetricRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this MonitoredResourceDescriptor to JSON. - * @function toJSON - * @memberof google.api.MonitoredResourceDescriptor - * @instance - * @returns {Object.} JSON object - */ - MonitoredResourceDescriptor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return UpdateLogMetricRequest; + })(); - return MonitoredResourceDescriptor; - })(); + v2.DeleteLogMetricRequest = (function() { - api.MonitoredResource = (function() { + /** + * Properties of a DeleteLogMetricRequest. + * @memberof google.logging.v2 + * @interface IDeleteLogMetricRequest + * @property {string|null} [metricName] DeleteLogMetricRequest metricName + */ - /** - * Properties of a MonitoredResource. - * @memberof google.api - * @interface IMonitoredResource - * @property {string|null} [type] MonitoredResource type - * @property {Object.|null} [labels] MonitoredResource labels - */ + /** + * Constructs a new DeleteLogMetricRequest. + * @memberof google.logging.v2 + * @classdesc Represents a DeleteLogMetricRequest. + * @implements IDeleteLogMetricRequest + * @constructor + * @param {google.logging.v2.IDeleteLogMetricRequest=} [properties] Properties to set + */ + function DeleteLogMetricRequest(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]]; + } - /** - * Constructs a new MonitoredResource. - * @memberof google.api - * @classdesc Represents a MonitoredResource. - * @implements IMonitoredResource - * @constructor - * @param {google.api.IMonitoredResource=} [properties] Properties to set - */ - function MonitoredResource(properties) { - this.labels = {}; - 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]]; - } + /** + * DeleteLogMetricRequest metricName. + * @member {string} metricName + * @memberof google.logging.v2.DeleteLogMetricRequest + * @instance + */ + DeleteLogMetricRequest.prototype.metricName = ""; - /** - * MonitoredResource type. - * @member {string} type - * @memberof google.api.MonitoredResource - * @instance - */ - MonitoredResource.prototype.type = ""; + /** + * Creates a new DeleteLogMetricRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.DeleteLogMetricRequest + * @static + * @param {google.logging.v2.IDeleteLogMetricRequest=} [properties] Properties to set + * @returns {google.logging.v2.DeleteLogMetricRequest} DeleteLogMetricRequest instance + */ + DeleteLogMetricRequest.create = function create(properties) { + return new DeleteLogMetricRequest(properties); + }; - /** - * MonitoredResource labels. - * @member {Object.} labels - * @memberof google.api.MonitoredResource - * @instance - */ - MonitoredResource.prototype.labels = $util.emptyObject; + /** + * Encodes the specified DeleteLogMetricRequest message. Does not implicitly {@link google.logging.v2.DeleteLogMetricRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.DeleteLogMetricRequest + * @static + * @param {google.logging.v2.IDeleteLogMetricRequest} message DeleteLogMetricRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteLogMetricRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metricName != null && Object.hasOwnProperty.call(message, "metricName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.metricName); + return writer; + }; - /** - * Creates a new MonitoredResource instance using the specified properties. - * @function create - * @memberof google.api.MonitoredResource - * @static - * @param {google.api.IMonitoredResource=} [properties] Properties to set - * @returns {google.api.MonitoredResource} MonitoredResource instance - */ - MonitoredResource.create = function create(properties) { - return new MonitoredResource(properties); - }; + /** + * Encodes the specified DeleteLogMetricRequest message, length delimited. Does not implicitly {@link google.logging.v2.DeleteLogMetricRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.DeleteLogMetricRequest + * @static + * @param {google.logging.v2.IDeleteLogMetricRequest} message DeleteLogMetricRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteLogMetricRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified MonitoredResource message. Does not implicitly {@link google.api.MonitoredResource.verify|verify} messages. - * @function encode - * @memberof google.api.MonitoredResource - * @static - * @param {google.api.IMonitoredResource} message MonitoredResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MonitoredResource.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.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), 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.labels[keys[i]]).ldelim(); + /** + * Decodes a DeleteLogMetricRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.DeleteLogMetricRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.DeleteLogMetricRequest} DeleteLogMetricRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteLogMetricRequest.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.logging.v2.DeleteLogMetricRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.metricName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteLogMetricRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.DeleteLogMetricRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.DeleteLogMetricRequest} DeleteLogMetricRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteLogMetricRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteLogMetricRequest message. + * @function verify + * @memberof google.logging.v2.DeleteLogMetricRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteLogMetricRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metricName != null && message.hasOwnProperty("metricName")) + if (!$util.isString(message.metricName)) + return "metricName: string expected"; + return null; + }; + + /** + * Creates a DeleteLogMetricRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.DeleteLogMetricRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.DeleteLogMetricRequest} DeleteLogMetricRequest + */ + DeleteLogMetricRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.logging.v2.DeleteLogMetricRequest) + return object; + var message = new $root.google.logging.v2.DeleteLogMetricRequest(); + if (object.metricName != null) + message.metricName = String(object.metricName); + return message; + }; + + /** + * Creates a plain object from a DeleteLogMetricRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.DeleteLogMetricRequest + * @static + * @param {google.logging.v2.DeleteLogMetricRequest} message DeleteLogMetricRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteLogMetricRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metricName = ""; + if (message.metricName != null && message.hasOwnProperty("metricName")) + object.metricName = message.metricName; + return object; + }; + + /** + * Converts this DeleteLogMetricRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.DeleteLogMetricRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteLogMetricRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteLogMetricRequest; + })(); + + return v2; + })(); + + return logging; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + 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]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.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); return writer; }; /** - * Encodes the specified MonitoredResource message, length delimited. Does not implicitly {@link google.api.MonitoredResource.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.MonitoredResource + * @memberof google.api.Http * @static - * @param {google.api.IMonitoredResource} message MonitoredResource 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 */ - MonitoredResource.encodeDelimited = function encodeDelimited(message, writer) { + Http.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MonitoredResource message from the specified reader or buffer. + * Decodes a Http message from the specified reader or buffer. * @function decode - * @memberof google.api.MonitoredResource + * @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.MonitoredResource} MonitoredResource + * @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 */ - MonitoredResource.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.MonitoredResource(), key, value; + 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.type = reader.string(); + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); break; case 2: - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; + message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); @@ -27720,132 +28374,143 @@ }; /** - * Decodes a MonitoredResource 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.MonitoredResource + * @memberof google.api.Http * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MonitoredResource} MonitoredResource + * @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 */ - MonitoredResource.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 MonitoredResource message. + * Verifies a Http message. * @function verify - * @memberof google.api.MonitoredResource + * @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 */ - MonitoredResource.verify = function verify(message) { + Http.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.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k: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 MonitoredResource 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.MonitoredResource + * @memberof google.api.Http * @static * @param {Object.} object Plain object - * @returns {google.api.MonitoredResource} MonitoredResource + * @returns {google.api.Http} Http */ - MonitoredResource.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MonitoredResource) + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) return object; - var message = new $root.google.api.MonitoredResource(); - if (object.type != null) - message.type = String(object.type); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.api.MonitoredResource.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); + 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 MonitoredResource 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.MonitoredResource + * @memberof google.api.Http * @static - * @param {google.api.MonitoredResource} message MonitoredResource + * @param {google.api.Http} message Http * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MonitoredResource.toObject = function toObject(message, options) { + Http.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.labels = {}; + if (options.arrays || options.defaults) + object.rules = []; if (options.defaults) - object.type = ""; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; + 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.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; return object; }; /** - * Converts this MonitoredResource to JSON. + * Converts this Http to JSON. * @function toJSON - * @memberof google.api.MonitoredResource + * @memberof google.api.Http * @instance * @returns {Object.} JSON object */ - MonitoredResource.prototype.toJSON = function toJSON() { + Http.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return MonitoredResource; + return Http; })(); - api.MonitoredResourceMetadata = (function() { + api.HttpRule = (function() { /** - * Properties of a MonitoredResourceMetadata. + * Properties of a HttpRule. * @memberof google.api - * @interface IMonitoredResourceMetadata - * @property {google.protobuf.IStruct|null} [systemLabels] MonitoredResourceMetadata systemLabels - * @property {Object.|null} [userLabels] MonitoredResourceMetadata userLabels + * @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 MonitoredResourceMetadata. + * Constructs a new HttpRule. * @memberof google.api - * @classdesc Represents a MonitoredResourceMetadata. - * @implements IMonitoredResourceMetadata + * @classdesc Represents a HttpRule. + * @implements IHttpRule * @constructor - * @param {google.api.IMonitoredResourceMetadata=} [properties] Properties to set + * @param {google.api.IHttpRule=} [properties] Properties to set */ - function MonitoredResourceMetadata(properties) { - this.userLabels = {}; + function HttpRule(properties) { + this.additionalBindings = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -27853,351 +28518,209 @@ } /** - * MonitoredResourceMetadata systemLabels. - * @member {google.protobuf.IStruct|null|undefined} systemLabels - * @memberof google.api.MonitoredResourceMetadata + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule * @instance */ - MonitoredResourceMetadata.prototype.systemLabels = null; + HttpRule.prototype.selector = ""; /** - * MonitoredResourceMetadata userLabels. - * @member {Object.} userLabels - * @memberof google.api.MonitoredResourceMetadata + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule * @instance */ - MonitoredResourceMetadata.prototype.userLabels = $util.emptyObject; + HttpRule.prototype.get = null; /** - * Creates a new MonitoredResourceMetadata instance using the specified properties. - * @function create - * @memberof google.api.MonitoredResourceMetadata - * @static - * @param {google.api.IMonitoredResourceMetadata=} [properties] Properties to set - * @returns {google.api.MonitoredResourceMetadata} MonitoredResourceMetadata instance + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance */ - MonitoredResourceMetadata.create = function create(properties) { - return new MonitoredResourceMetadata(properties); - }; + HttpRule.prototype.put = null; /** - * Encodes the specified MonitoredResourceMetadata message. Does not implicitly {@link google.api.MonitoredResourceMetadata.verify|verify} messages. - * @function encode - * @memberof google.api.MonitoredResourceMetadata - * @static - * @param {google.api.IMonitoredResourceMetadata} message MonitoredResourceMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance */ - MonitoredResourceMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.systemLabels != null && Object.hasOwnProperty.call(message, "systemLabels")) - $root.google.protobuf.Struct.encode(message.systemLabels, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.userLabels != null && Object.hasOwnProperty.call(message, "userLabels")) - for (var keys = Object.keys(message.userLabels), 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.userLabels[keys[i]]).ldelim(); - return writer; - }; + HttpRule.prototype.post = null; /** - * Encodes the specified MonitoredResourceMetadata message, length delimited. Does not implicitly {@link google.api.MonitoredResourceMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MonitoredResourceMetadata - * @static - * @param {google.api.IMonitoredResourceMetadata} message MonitoredResourceMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance */ - MonitoredResourceMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + HttpRule.prototype["delete"] = null; /** - * Decodes a MonitoredResourceMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.api.MonitoredResourceMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MonitoredResourceMetadata} MonitoredResourceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance */ - MonitoredResourceMetadata.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.MonitoredResourceMetadata(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.systemLabels = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - case 2: - if (message.userLabels === $util.emptyObject) - message.userLabels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.userLabels[key] = value; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + HttpRule.prototype.patch = null; /** - * Decodes a MonitoredResourceMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MonitoredResourceMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MonitoredResourceMetadata} MonitoredResourceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance */ - MonitoredResourceMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MonitoredResourceMetadata message. - * @function verify - * @memberof google.api.MonitoredResourceMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MonitoredResourceMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.systemLabels != null && message.hasOwnProperty("systemLabels")) { - var error = $root.google.protobuf.Struct.verify(message.systemLabels); - if (error) - return "systemLabels." + error; - } - if (message.userLabels != null && message.hasOwnProperty("userLabels")) { - if (!$util.isObject(message.userLabels)) - return "userLabels: object expected"; - var key = Object.keys(message.userLabels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.userLabels[key[i]])) - return "userLabels: string{k:string} expected"; - } - return null; - }; - - /** - * Creates a MonitoredResourceMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MonitoredResourceMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.api.MonitoredResourceMetadata} MonitoredResourceMetadata - */ - MonitoredResourceMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MonitoredResourceMetadata) - return object; - var message = new $root.google.api.MonitoredResourceMetadata(); - if (object.systemLabels != null) { - if (typeof object.systemLabels !== "object") - throw TypeError(".google.api.MonitoredResourceMetadata.systemLabels: object expected"); - message.systemLabels = $root.google.protobuf.Struct.fromObject(object.systemLabels); - } - if (object.userLabels) { - if (typeof object.userLabels !== "object") - throw TypeError(".google.api.MonitoredResourceMetadata.userLabels: object expected"); - message.userLabels = {}; - for (var keys = Object.keys(object.userLabels), i = 0; i < keys.length; ++i) - message.userLabels[keys[i]] = String(object.userLabels[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from a MonitoredResourceMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MonitoredResourceMetadata - * @static - * @param {google.api.MonitoredResourceMetadata} message MonitoredResourceMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MonitoredResourceMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.userLabels = {}; - if (options.defaults) - object.systemLabels = null; - if (message.systemLabels != null && message.hasOwnProperty("systemLabels")) - object.systemLabels = $root.google.protobuf.Struct.toObject(message.systemLabels, options); - var keys2; - if (message.userLabels && (keys2 = Object.keys(message.userLabels)).length) { - object.userLabels = {}; - for (var j = 0; j < keys2.length; ++j) - object.userLabels[keys2[j]] = message.userLabels[keys2[j]]; - } - return object; - }; + HttpRule.prototype.custom = null; /** - * Converts this MonitoredResourceMetadata to JSON. - * @function toJSON - * @memberof google.api.MonitoredResourceMetadata + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule * @instance - * @returns {Object.} JSON object - */ - MonitoredResourceMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MonitoredResourceMetadata; - })(); - - api.LabelDescriptor = (function() { - - /** - * Properties of a LabelDescriptor. - * @memberof google.api - * @interface ILabelDescriptor - * @property {string|null} [key] LabelDescriptor key - * @property {google.api.LabelDescriptor.ValueType|null} [valueType] LabelDescriptor valueType - * @property {string|null} [description] LabelDescriptor description - */ - - /** - * Constructs a new LabelDescriptor. - * @memberof google.api - * @classdesc Represents a LabelDescriptor. - * @implements ILabelDescriptor - * @constructor - * @param {google.api.ILabelDescriptor=} [properties] Properties to set */ - function LabelDescriptor(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.prototype.body = ""; /** - * LabelDescriptor key. - * @member {string} key - * @memberof google.api.LabelDescriptor + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule * @instance */ - LabelDescriptor.prototype.key = ""; + HttpRule.prototype.responseBody = ""; /** - * LabelDescriptor valueType. - * @member {google.api.LabelDescriptor.ValueType} valueType - * @memberof google.api.LabelDescriptor + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule * @instance */ - LabelDescriptor.prototype.valueType = 0; + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * LabelDescriptor description. - * @member {string} description - * @memberof google.api.LabelDescriptor + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule * @instance */ - LabelDescriptor.prototype.description = ""; + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new LabelDescriptor instance using the specified properties. + * Creates a new HttpRule instance using the specified properties. * @function create - * @memberof google.api.LabelDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.ILabelDescriptor=} [properties] Properties to set - * @returns {google.api.LabelDescriptor} LabelDescriptor instance + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance */ - LabelDescriptor.create = function create(properties) { - return new LabelDescriptor(properties); + HttpRule.create = function create(properties) { + return new HttpRule(properties); }; /** - * Encodes the specified LabelDescriptor message. Does not implicitly {@link google.api.LabelDescriptor.verify|verify} messages. + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encode - * @memberof google.api.LabelDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.ILabelDescriptor} message LabelDescriptor 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 */ - LabelDescriptor.encode = function encode(message, writer) { + HttpRule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); - if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.valueType); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + 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 LabelDescriptor message, length delimited. Does not implicitly {@link google.api.LabelDescriptor.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.LabelDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.ILabelDescriptor} message LabelDescriptor 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 */ - LabelDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a LabelDescriptor message from the specified reader or buffer. + * Decodes a HttpRule message from the specified reader or buffer. * @function decode - * @memberof google.api.LabelDescriptor + * @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.LabelDescriptor} LabelDescriptor + * @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 */ - LabelDescriptor.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.LabelDescriptor(); + 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.key = reader.string(); + message.selector = reader.string(); break; case 2: - message.valueType = reader.int32(); + message.get = reader.string(); break; case 3: - message.description = reader.string(); + 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())); break; default: reader.skipType(tag & 7); @@ -28208,192 +28731,240 @@ }; /** - * Decodes a LabelDescriptor 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.LabelDescriptor + * @memberof google.api.HttpRule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.LabelDescriptor} LabelDescriptor + * @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 */ - LabelDescriptor.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 LabelDescriptor message. + * Verifies a HttpRule message. * @function verify - * @memberof google.api.LabelDescriptor + * @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 */ - LabelDescriptor.verify = function verify(message) { + HttpRule.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!$util.isString(message.key)) - return "key: string expected"; - if (message.valueType != null && message.hasOwnProperty("valueType")) - switch (message.valueType) { - default: - return "valueType: enum value expected"; - case 0: - case 1: - case 2: - break; + 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.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; + } + 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; + } + } return null; }; /** - * Creates a LabelDescriptor 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.LabelDescriptor + * @memberof google.api.HttpRule * @static * @param {Object.} object Plain object - * @returns {google.api.LabelDescriptor} LabelDescriptor + * @returns {google.api.HttpRule} HttpRule */ - LabelDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.LabelDescriptor) + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) return object; - var message = new $root.google.api.LabelDescriptor(); - if (object.key != null) - message.key = String(object.key); - switch (object.valueType) { - case "STRING": - case 0: - message.valueType = 0; - break; - case "BOOL": - case 1: - message.valueType = 1; - break; - case "INT64": - case 2: - message.valueType = 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.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]); + } } - if (object.description != null) - message.description = String(object.description); return message; }; /** - * Creates a plain object from a LabelDescriptor 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.LabelDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.LabelDescriptor} message LabelDescriptor + * @param {google.api.HttpRule} message HttpRule * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LabelDescriptor.toObject = function toObject(message, options) { + HttpRule.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; if (options.defaults) { - object.key = ""; - object.valueType = options.enums === String ? "STRING" : 0; - object.description = ""; + object.selector = ""; + object.body = ""; + object.responseBody = ""; } - if (message.key != null && message.hasOwnProperty("key")) - object.key = message.key; - if (message.valueType != null && message.hasOwnProperty("valueType")) - object.valueType = options.enums === String ? $root.google.api.LabelDescriptor.ValueType[message.valueType] : message.valueType; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; + 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); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; return object; }; /** - * Converts this LabelDescriptor to JSON. + * Converts this HttpRule to JSON. * @function toJSON - * @memberof google.api.LabelDescriptor + * @memberof google.api.HttpRule * @instance * @returns {Object.} JSON object */ - LabelDescriptor.prototype.toJSON = function toJSON() { + HttpRule.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * ValueType enum. - * @name google.api.LabelDescriptor.ValueType - * @enum {number} - * @property {number} STRING=0 STRING value - * @property {number} BOOL=1 BOOL value - * @property {number} INT64=2 INT64 value - */ - LabelDescriptor.ValueType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = 0; - values[valuesById[1] = "BOOL"] = 1; - values[valuesById[2] = "INT64"] = 2; - return values; - })(); - - return LabelDescriptor; - })(); - - /** - * LaunchStage enum. - * @name google.api.LaunchStage - * @enum {number} - * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value - * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value - * @property {number} PRELAUNCH=7 PRELAUNCH value - * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value - * @property {number} ALPHA=2 ALPHA value - * @property {number} BETA=3 BETA value - * @property {number} GA=4 GA value - * @property {number} DEPRECATED=5 DEPRECATED value - */ - api.LaunchStage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; - values[valuesById[6] = "UNIMPLEMENTED"] = 6; - values[valuesById[7] = "PRELAUNCH"] = 7; - values[valuesById[1] = "EARLY_ACCESS"] = 1; - values[valuesById[2] = "ALPHA"] = 2; - values[valuesById[3] = "BETA"] = 3; - values[valuesById[4] = "GA"] = 4; - values[valuesById[5] = "DEPRECATED"] = 5; - return values; + return HttpRule; })(); - api.ResourceDescriptor = (function() { + api.CustomHttpPattern = (function() { /** - * Properties of a ResourceDescriptor. + * Properties of a CustomHttpPattern. * @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 ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path */ /** - * Constructs a new ResourceDescriptor. + * Constructs a new CustomHttpPattern. * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set */ - function ResourceDescriptor(properties) { - this.pattern = []; - this.style = []; + function CustomHttpPattern(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -28401,167 +28972,88 @@ } /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.type = ""; - - /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; - - /** - * 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 + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern * @instance */ - ResourceDescriptor.prototype.singular = ""; + CustomHttpPattern.prototype.kind = ""; /** - * ResourceDescriptor style. - * @member {Array.} style - * @memberof google.api.ResourceDescriptor + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern * @instance */ - ResourceDescriptor.prototype.style = $util.emptyArray; + CustomHttpPattern.prototype.path = ""; /** - * Creates a new ResourceDescriptor instance using the specified properties. + * Creates a new CustomHttpPattern instance using the specified properties. * @function create - * @memberof google.api.ResourceDescriptor + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); }; /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encode - * @memberof google.api.ResourceDescriptor + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor 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 */ - ResourceDescriptor.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.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.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 ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.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.ResourceDescriptor + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor 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 */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. + * Decodes a CustomHttpPattern message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceDescriptor + * @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.ResourceDescriptor} ResourceDescriptor + * @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 */ - ResourceDescriptor.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.ResourceDescriptor(); + 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: - 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()); + message.path = reader.string(); break; default: reader.skipType(tag & 7); @@ -28572,463 +29064,3763 @@ }; /** - * Decodes a ResourceDescriptor 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.ResourceDescriptor + * @memberof google.api.CustomHttpPattern * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @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 */ - ResourceDescriptor.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 ResourceDescriptor message. + * Verifies a CustomHttpPattern message. * @function verify - * @memberof google.api.ResourceDescriptor + * @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 */ - ResourceDescriptor.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.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.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 CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + 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); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; } - 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"; + 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 CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CustomHttpPattern; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + return values; + })(); + + api.MonitoredResourceDescriptor = (function() { + + /** + * Properties of a MonitoredResourceDescriptor. + * @memberof google.api + * @interface IMonitoredResourceDescriptor + * @property {string|null} [name] MonitoredResourceDescriptor name + * @property {string|null} [type] MonitoredResourceDescriptor type + * @property {string|null} [displayName] MonitoredResourceDescriptor displayName + * @property {string|null} [description] MonitoredResourceDescriptor description + * @property {Array.|null} [labels] MonitoredResourceDescriptor labels + * @property {google.api.LaunchStage|null} [launchStage] MonitoredResourceDescriptor launchStage + */ + + /** + * Constructs a new MonitoredResourceDescriptor. + * @memberof google.api + * @classdesc Represents a MonitoredResourceDescriptor. + * @implements IMonitoredResourceDescriptor + * @constructor + * @param {google.api.IMonitoredResourceDescriptor=} [properties] Properties to set + */ + function MonitoredResourceDescriptor(properties) { + this.labels = []; + 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]]; + } + + /** + * MonitoredResourceDescriptor name. + * @member {string} name + * @memberof google.api.MonitoredResourceDescriptor + * @instance + */ + MonitoredResourceDescriptor.prototype.name = ""; + + /** + * MonitoredResourceDescriptor type. + * @member {string} type + * @memberof google.api.MonitoredResourceDescriptor + * @instance + */ + MonitoredResourceDescriptor.prototype.type = ""; + + /** + * MonitoredResourceDescriptor displayName. + * @member {string} displayName + * @memberof google.api.MonitoredResourceDescriptor + * @instance + */ + MonitoredResourceDescriptor.prototype.displayName = ""; + + /** + * MonitoredResourceDescriptor description. + * @member {string} description + * @memberof google.api.MonitoredResourceDescriptor + * @instance + */ + MonitoredResourceDescriptor.prototype.description = ""; + + /** + * MonitoredResourceDescriptor labels. + * @member {Array.} labels + * @memberof google.api.MonitoredResourceDescriptor + * @instance + */ + MonitoredResourceDescriptor.prototype.labels = $util.emptyArray; + + /** + * MonitoredResourceDescriptor launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.MonitoredResourceDescriptor + * @instance + */ + MonitoredResourceDescriptor.prototype.launchStage = 0; + + /** + * Creates a new MonitoredResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.MonitoredResourceDescriptor + * @static + * @param {google.api.IMonitoredResourceDescriptor=} [properties] Properties to set + * @returns {google.api.MonitoredResourceDescriptor} MonitoredResourceDescriptor instance + */ + MonitoredResourceDescriptor.create = function create(properties) { + return new MonitoredResourceDescriptor(properties); + }; + + /** + * Encodes the specified MonitoredResourceDescriptor message. Does not implicitly {@link google.api.MonitoredResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.MonitoredResourceDescriptor + * @static + * @param {google.api.IMonitoredResourceDescriptor} message MonitoredResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MonitoredResourceDescriptor.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + 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.labels != null && message.labels.length) + for (var i = 0; i < message.labels.length; ++i) + $root.google.api.LabelDescriptor.encode(message.labels[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.name); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.launchStage); + return writer; + }; + + /** + * Encodes the specified MonitoredResourceDescriptor message, length delimited. Does not implicitly {@link google.api.MonitoredResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MonitoredResourceDescriptor + * @static + * @param {google.api.IMonitoredResourceDescriptor} message MonitoredResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MonitoredResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MonitoredResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.MonitoredResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MonitoredResourceDescriptor} MonitoredResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MonitoredResourceDescriptor.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.MonitoredResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 5: + message.name = reader.string(); + break; + case 1: + message.type = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + if (!(message.labels && message.labels.length)) + message.labels = []; + message.labels.push($root.google.api.LabelDescriptor.decode(reader, reader.uint32())); + break; + case 7: + message.launchStage = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MonitoredResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MonitoredResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MonitoredResourceDescriptor} MonitoredResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MonitoredResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MonitoredResourceDescriptor message. + * @function verify + * @memberof google.api.MonitoredResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MonitoredResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!Array.isArray(message.labels)) + return "labels: array expected"; + for (var i = 0; i < message.labels.length; ++i) { + var error = $root.google.api.LabelDescriptor.verify(message.labels[i]); + if (error) + return "labels." + error; + } + } + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a MonitoredResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MonitoredResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.MonitoredResourceDescriptor} MonitoredResourceDescriptor + */ + MonitoredResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MonitoredResourceDescriptor) + return object; + var message = new $root.google.api.MonitoredResourceDescriptor(); + if (object.name != null) + message.name = String(object.name); + if (object.type != null) + message.type = String(object.type); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.labels) { + if (!Array.isArray(object.labels)) + throw TypeError(".google.api.MonitoredResourceDescriptor.labels: array expected"); + message.labels = []; + for (var i = 0; i < object.labels.length; ++i) { + if (typeof object.labels[i] !== "object") + throw TypeError(".google.api.MonitoredResourceDescriptor.labels: object expected"); + message.labels[i] = $root.google.api.LabelDescriptor.fromObject(object.labels[i]); + } + } + switch (object.launchStage) { + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a MonitoredResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MonitoredResourceDescriptor + * @static + * @param {google.api.MonitoredResourceDescriptor} message MonitoredResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MonitoredResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.labels = []; + if (options.defaults) { + object.type = ""; + object.displayName = ""; + object.description = ""; + object.name = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.labels && message.labels.length) { + object.labels = []; + for (var j = 0; j < message.labels.length; ++j) + object.labels[j] = $root.google.api.LabelDescriptor.toObject(message.labels[j], options); + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + return object; + }; + + /** + * Converts this MonitoredResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.MonitoredResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + MonitoredResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MonitoredResourceDescriptor; + })(); + + api.MonitoredResource = (function() { + + /** + * Properties of a MonitoredResource. + * @memberof google.api + * @interface IMonitoredResource + * @property {string|null} [type] MonitoredResource type + * @property {Object.|null} [labels] MonitoredResource labels + */ + + /** + * Constructs a new MonitoredResource. + * @memberof google.api + * @classdesc Represents a MonitoredResource. + * @implements IMonitoredResource + * @constructor + * @param {google.api.IMonitoredResource=} [properties] Properties to set + */ + function MonitoredResource(properties) { + this.labels = {}; + 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]]; + } + + /** + * MonitoredResource type. + * @member {string} type + * @memberof google.api.MonitoredResource + * @instance + */ + MonitoredResource.prototype.type = ""; + + /** + * MonitoredResource labels. + * @member {Object.} labels + * @memberof google.api.MonitoredResource + * @instance + */ + MonitoredResource.prototype.labels = $util.emptyObject; + + /** + * Creates a new MonitoredResource instance using the specified properties. + * @function create + * @memberof google.api.MonitoredResource + * @static + * @param {google.api.IMonitoredResource=} [properties] Properties to set + * @returns {google.api.MonitoredResource} MonitoredResource instance + */ + MonitoredResource.create = function create(properties) { + return new MonitoredResource(properties); + }; + + /** + * Encodes the specified MonitoredResource message. Does not implicitly {@link google.api.MonitoredResource.verify|verify} messages. + * @function encode + * @memberof google.api.MonitoredResource + * @static + * @param {google.api.IMonitoredResource} message MonitoredResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MonitoredResource.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.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), 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.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified MonitoredResource message, length delimited. Does not implicitly {@link google.api.MonitoredResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MonitoredResource + * @static + * @param {google.api.IMonitoredResource} message MonitoredResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MonitoredResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MonitoredResource message from the specified reader or buffer. + * @function decode + * @memberof google.api.MonitoredResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MonitoredResource} MonitoredResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MonitoredResource.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.MonitoredResource(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MonitoredResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MonitoredResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MonitoredResource} MonitoredResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MonitoredResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MonitoredResource message. + * @function verify + * @memberof google.api.MonitoredResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MonitoredResource.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.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a MonitoredResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MonitoredResource + * @static + * @param {Object.} object Plain object + * @returns {google.api.MonitoredResource} MonitoredResource + */ + MonitoredResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MonitoredResource) + return object; + var message = new $root.google.api.MonitoredResource(); + if (object.type != null) + message.type = String(object.type); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.api.MonitoredResource.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a MonitoredResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MonitoredResource + * @static + * @param {google.api.MonitoredResource} message MonitoredResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MonitoredResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) + object.type = ""; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this MonitoredResource to JSON. + * @function toJSON + * @memberof google.api.MonitoredResource + * @instance + * @returns {Object.} JSON object + */ + MonitoredResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MonitoredResource; + })(); + + api.MonitoredResourceMetadata = (function() { + + /** + * Properties of a MonitoredResourceMetadata. + * @memberof google.api + * @interface IMonitoredResourceMetadata + * @property {google.protobuf.IStruct|null} [systemLabels] MonitoredResourceMetadata systemLabels + * @property {Object.|null} [userLabels] MonitoredResourceMetadata userLabels + */ + + /** + * Constructs a new MonitoredResourceMetadata. + * @memberof google.api + * @classdesc Represents a MonitoredResourceMetadata. + * @implements IMonitoredResourceMetadata + * @constructor + * @param {google.api.IMonitoredResourceMetadata=} [properties] Properties to set + */ + function MonitoredResourceMetadata(properties) { + this.userLabels = {}; + 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]]; + } + + /** + * MonitoredResourceMetadata systemLabels. + * @member {google.protobuf.IStruct|null|undefined} systemLabels + * @memberof google.api.MonitoredResourceMetadata + * @instance + */ + MonitoredResourceMetadata.prototype.systemLabels = null; + + /** + * MonitoredResourceMetadata userLabels. + * @member {Object.} userLabels + * @memberof google.api.MonitoredResourceMetadata + * @instance + */ + MonitoredResourceMetadata.prototype.userLabels = $util.emptyObject; + + /** + * Creates a new MonitoredResourceMetadata instance using the specified properties. + * @function create + * @memberof google.api.MonitoredResourceMetadata + * @static + * @param {google.api.IMonitoredResourceMetadata=} [properties] Properties to set + * @returns {google.api.MonitoredResourceMetadata} MonitoredResourceMetadata instance + */ + MonitoredResourceMetadata.create = function create(properties) { + return new MonitoredResourceMetadata(properties); + }; + + /** + * Encodes the specified MonitoredResourceMetadata message. Does not implicitly {@link google.api.MonitoredResourceMetadata.verify|verify} messages. + * @function encode + * @memberof google.api.MonitoredResourceMetadata + * @static + * @param {google.api.IMonitoredResourceMetadata} message MonitoredResourceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MonitoredResourceMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.systemLabels != null && Object.hasOwnProperty.call(message, "systemLabels")) + $root.google.protobuf.Struct.encode(message.systemLabels, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.userLabels != null && Object.hasOwnProperty.call(message, "userLabels")) + for (var keys = Object.keys(message.userLabels), 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.userLabels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified MonitoredResourceMetadata message, length delimited. Does not implicitly {@link google.api.MonitoredResourceMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MonitoredResourceMetadata + * @static + * @param {google.api.IMonitoredResourceMetadata} message MonitoredResourceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MonitoredResourceMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MonitoredResourceMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.api.MonitoredResourceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MonitoredResourceMetadata} MonitoredResourceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MonitoredResourceMetadata.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.MonitoredResourceMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.systemLabels = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + case 2: + if (message.userLabels === $util.emptyObject) + message.userLabels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.userLabels[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MonitoredResourceMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MonitoredResourceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MonitoredResourceMetadata} MonitoredResourceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MonitoredResourceMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MonitoredResourceMetadata message. + * @function verify + * @memberof google.api.MonitoredResourceMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MonitoredResourceMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.systemLabels != null && message.hasOwnProperty("systemLabels")) { + var error = $root.google.protobuf.Struct.verify(message.systemLabels); + if (error) + return "systemLabels." + error; + } + if (message.userLabels != null && message.hasOwnProperty("userLabels")) { + if (!$util.isObject(message.userLabels)) + return "userLabels: object expected"; + var key = Object.keys(message.userLabels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.userLabels[key[i]])) + return "userLabels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a MonitoredResourceMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MonitoredResourceMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.api.MonitoredResourceMetadata} MonitoredResourceMetadata + */ + MonitoredResourceMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MonitoredResourceMetadata) + return object; + var message = new $root.google.api.MonitoredResourceMetadata(); + if (object.systemLabels != null) { + if (typeof object.systemLabels !== "object") + throw TypeError(".google.api.MonitoredResourceMetadata.systemLabels: object expected"); + message.systemLabels = $root.google.protobuf.Struct.fromObject(object.systemLabels); + } + if (object.userLabels) { + if (typeof object.userLabels !== "object") + throw TypeError(".google.api.MonitoredResourceMetadata.userLabels: object expected"); + message.userLabels = {}; + for (var keys = Object.keys(object.userLabels), i = 0; i < keys.length; ++i) + message.userLabels[keys[i]] = String(object.userLabels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a MonitoredResourceMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MonitoredResourceMetadata + * @static + * @param {google.api.MonitoredResourceMetadata} message MonitoredResourceMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MonitoredResourceMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.userLabels = {}; + if (options.defaults) + object.systemLabels = null; + if (message.systemLabels != null && message.hasOwnProperty("systemLabels")) + object.systemLabels = $root.google.protobuf.Struct.toObject(message.systemLabels, options); + var keys2; + if (message.userLabels && (keys2 = Object.keys(message.userLabels)).length) { + object.userLabels = {}; + for (var j = 0; j < keys2.length; ++j) + object.userLabels[keys2[j]] = message.userLabels[keys2[j]]; + } + return object; + }; + + /** + * Converts this MonitoredResourceMetadata to JSON. + * @function toJSON + * @memberof google.api.MonitoredResourceMetadata + * @instance + * @returns {Object.} JSON object + */ + MonitoredResourceMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MonitoredResourceMetadata; + })(); + + api.LabelDescriptor = (function() { + + /** + * Properties of a LabelDescriptor. + * @memberof google.api + * @interface ILabelDescriptor + * @property {string|null} [key] LabelDescriptor key + * @property {google.api.LabelDescriptor.ValueType|null} [valueType] LabelDescriptor valueType + * @property {string|null} [description] LabelDescriptor description + */ + + /** + * Constructs a new LabelDescriptor. + * @memberof google.api + * @classdesc Represents a LabelDescriptor. + * @implements ILabelDescriptor + * @constructor + * @param {google.api.ILabelDescriptor=} [properties] Properties to set + */ + function LabelDescriptor(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]]; + } + + /** + * LabelDescriptor key. + * @member {string} key + * @memberof google.api.LabelDescriptor + * @instance + */ + LabelDescriptor.prototype.key = ""; + + /** + * LabelDescriptor valueType. + * @member {google.api.LabelDescriptor.ValueType} valueType + * @memberof google.api.LabelDescriptor + * @instance + */ + LabelDescriptor.prototype.valueType = 0; + + /** + * LabelDescriptor description. + * @member {string} description + * @memberof google.api.LabelDescriptor + * @instance + */ + LabelDescriptor.prototype.description = ""; + + /** + * Creates a new LabelDescriptor instance using the specified properties. + * @function create + * @memberof google.api.LabelDescriptor + * @static + * @param {google.api.ILabelDescriptor=} [properties] Properties to set + * @returns {google.api.LabelDescriptor} LabelDescriptor instance + */ + LabelDescriptor.create = function create(properties) { + return new LabelDescriptor(properties); + }; + + /** + * Encodes the specified LabelDescriptor message. Does not implicitly {@link google.api.LabelDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.LabelDescriptor + * @static + * @param {google.api.ILabelDescriptor} message LabelDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.valueType); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + return writer; + }; + + /** + * Encodes the specified LabelDescriptor message, length delimited. Does not implicitly {@link google.api.LabelDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.LabelDescriptor + * @static + * @param {google.api.ILabelDescriptor} message LabelDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.LabelDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.LabelDescriptor} LabelDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelDescriptor.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.LabelDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.valueType = reader.int32(); + break; + case 3: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.LabelDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.LabelDescriptor} LabelDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelDescriptor message. + * @function verify + * @memberof google.api.LabelDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.valueType != null && message.hasOwnProperty("valueType")) + switch (message.valueType) { + default: + return "valueType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a LabelDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.LabelDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.LabelDescriptor} LabelDescriptor + */ + LabelDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.LabelDescriptor) + return object; + var message = new $root.google.api.LabelDescriptor(); + if (object.key != null) + message.key = String(object.key); + switch (object.valueType) { + case "STRING": + case 0: + message.valueType = 0; + break; + case "BOOL": + case 1: + message.valueType = 1; + break; + case "INT64": + case 2: + message.valueType = 2; + break; + } + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a LabelDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.LabelDescriptor + * @static + * @param {google.api.LabelDescriptor} message LabelDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.key = ""; + object.valueType = options.enums === String ? "STRING" : 0; + object.description = ""; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.valueType != null && message.hasOwnProperty("valueType")) + object.valueType = options.enums === String ? $root.google.api.LabelDescriptor.ValueType[message.valueType] : message.valueType; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this LabelDescriptor to JSON. + * @function toJSON + * @memberof google.api.LabelDescriptor + * @instance + * @returns {Object.} JSON object + */ + LabelDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * ValueType enum. + * @name google.api.LabelDescriptor.ValueType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} BOOL=1 BOOL value + * @property {number} INT64=2 INT64 value + */ + LabelDescriptor.ValueType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "BOOL"] = 1; + values[valuesById[2] = "INT64"] = 2; + return values; + })(); + + return LabelDescriptor; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @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 + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + 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) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * 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.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.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(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @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.ResourceDescriptor} ResourceDescriptor + * @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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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: + message.type = reader.string(); + break; + case 2: + 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); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @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 + */ + ResourceDescriptor.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"; + } + 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: + 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. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + 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; + } + 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; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + 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; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.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; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + 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]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.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); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @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.ResourceReference} ResourceReference + * @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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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.type = reader.string(); + break; + case 2: + message.childType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @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 + */ + ResourceReference.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"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + 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); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + 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 ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourceReference; + })(); + + api.Distribution = (function() { + + /** + * Properties of a Distribution. + * @memberof google.api + * @interface IDistribution + * @property {number|Long|null} [count] Distribution count + * @property {number|null} [mean] Distribution mean + * @property {number|null} [sumOfSquaredDeviation] Distribution sumOfSquaredDeviation + * @property {google.api.Distribution.IRange|null} [range] Distribution range + * @property {google.api.Distribution.IBucketOptions|null} [bucketOptions] Distribution bucketOptions + * @property {Array.|null} [bucketCounts] Distribution bucketCounts + * @property {Array.|null} [exemplars] Distribution exemplars + */ + + /** + * Constructs a new Distribution. + * @memberof google.api + * @classdesc Represents a Distribution. + * @implements IDistribution + * @constructor + * @param {google.api.IDistribution=} [properties] Properties to set + */ + function Distribution(properties) { + this.bucketCounts = []; + this.exemplars = []; + 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]]; + } + + /** + * Distribution count. + * @member {number|Long} count + * @memberof google.api.Distribution + * @instance + */ + Distribution.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Distribution mean. + * @member {number} mean + * @memberof google.api.Distribution + * @instance + */ + Distribution.prototype.mean = 0; + + /** + * Distribution sumOfSquaredDeviation. + * @member {number} sumOfSquaredDeviation + * @memberof google.api.Distribution + * @instance + */ + Distribution.prototype.sumOfSquaredDeviation = 0; + + /** + * Distribution range. + * @member {google.api.Distribution.IRange|null|undefined} range + * @memberof google.api.Distribution + * @instance + */ + Distribution.prototype.range = null; + + /** + * Distribution bucketOptions. + * @member {google.api.Distribution.IBucketOptions|null|undefined} bucketOptions + * @memberof google.api.Distribution + * @instance + */ + Distribution.prototype.bucketOptions = null; + + /** + * Distribution bucketCounts. + * @member {Array.} bucketCounts + * @memberof google.api.Distribution + * @instance + */ + Distribution.prototype.bucketCounts = $util.emptyArray; + + /** + * Distribution exemplars. + * @member {Array.} exemplars + * @memberof google.api.Distribution + * @instance + */ + Distribution.prototype.exemplars = $util.emptyArray; + + /** + * Creates a new Distribution instance using the specified properties. + * @function create + * @memberof google.api.Distribution + * @static + * @param {google.api.IDistribution=} [properties] Properties to set + * @returns {google.api.Distribution} Distribution instance + */ + Distribution.create = function create(properties) { + return new Distribution(properties); + }; + + /** + * Encodes the specified Distribution message. Does not implicitly {@link google.api.Distribution.verify|verify} messages. + * @function encode + * @memberof google.api.Distribution + * @static + * @param {google.api.IDistribution} message Distribution message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Distribution.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.count); + if (message.mean != null && Object.hasOwnProperty.call(message, "mean")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.mean); + if (message.sumOfSquaredDeviation != null && Object.hasOwnProperty.call(message, "sumOfSquaredDeviation")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.sumOfSquaredDeviation); + if (message.range != null && Object.hasOwnProperty.call(message, "range")) + $root.google.api.Distribution.Range.encode(message.range, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.bucketOptions != null && Object.hasOwnProperty.call(message, "bucketOptions")) + $root.google.api.Distribution.BucketOptions.encode(message.bucketOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.bucketCounts != null && message.bucketCounts.length) { + writer.uint32(/* id 7, wireType 2 =*/58).fork(); + for (var i = 0; i < message.bucketCounts.length; ++i) + writer.int64(message.bucketCounts[i]); + writer.ldelim(); + } + if (message.exemplars != null && message.exemplars.length) + for (var i = 0; i < message.exemplars.length; ++i) + $root.google.api.Distribution.Exemplar.encode(message.exemplars[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Distribution message, length delimited. Does not implicitly {@link google.api.Distribution.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Distribution + * @static + * @param {google.api.IDistribution} message Distribution message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Distribution.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Distribution message from the specified reader or buffer. + * @function decode + * @memberof google.api.Distribution + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Distribution} Distribution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Distribution.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.Distribution(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.count = reader.int64(); + break; + case 2: + message.mean = reader.double(); + break; + case 3: + message.sumOfSquaredDeviation = reader.double(); + break; + case 4: + message.range = $root.google.api.Distribution.Range.decode(reader, reader.uint32()); + break; + case 6: + message.bucketOptions = $root.google.api.Distribution.BucketOptions.decode(reader, reader.uint32()); + break; + case 7: + if (!(message.bucketCounts && message.bucketCounts.length)) + message.bucketCounts = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.bucketCounts.push(reader.int64()); + } else + message.bucketCounts.push(reader.int64()); + break; + case 10: + if (!(message.exemplars && message.exemplars.length)) + message.exemplars = []; + message.exemplars.push($root.google.api.Distribution.Exemplar.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Distribution message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Distribution + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Distribution} Distribution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Distribution.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Distribution message. + * @function verify + * @memberof google.api.Distribution + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Distribution.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + if (message.mean != null && message.hasOwnProperty("mean")) + if (typeof message.mean !== "number") + return "mean: number expected"; + if (message.sumOfSquaredDeviation != null && message.hasOwnProperty("sumOfSquaredDeviation")) + if (typeof message.sumOfSquaredDeviation !== "number") + return "sumOfSquaredDeviation: number expected"; + if (message.range != null && message.hasOwnProperty("range")) { + var error = $root.google.api.Distribution.Range.verify(message.range); + if (error) + return "range." + error; + } + if (message.bucketOptions != null && message.hasOwnProperty("bucketOptions")) { + var error = $root.google.api.Distribution.BucketOptions.verify(message.bucketOptions); + if (error) + return "bucketOptions." + error; + } + if (message.bucketCounts != null && message.hasOwnProperty("bucketCounts")) { + if (!Array.isArray(message.bucketCounts)) + return "bucketCounts: array expected"; + for (var i = 0; i < message.bucketCounts.length; ++i) + if (!$util.isInteger(message.bucketCounts[i]) && !(message.bucketCounts[i] && $util.isInteger(message.bucketCounts[i].low) && $util.isInteger(message.bucketCounts[i].high))) + return "bucketCounts: integer|Long[] expected"; + } + if (message.exemplars != null && message.hasOwnProperty("exemplars")) { + if (!Array.isArray(message.exemplars)) + return "exemplars: array expected"; + for (var i = 0; i < message.exemplars.length; ++i) { + var error = $root.google.api.Distribution.Exemplar.verify(message.exemplars[i]); + if (error) + return "exemplars." + error; + } + } + return null; + }; + + /** + * Creates a Distribution message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Distribution + * @static + * @param {Object.} object Plain object + * @returns {google.api.Distribution} Distribution + */ + Distribution.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Distribution) + return object; + var message = new $root.google.api.Distribution(); + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + if (object.mean != null) + message.mean = Number(object.mean); + if (object.sumOfSquaredDeviation != null) + message.sumOfSquaredDeviation = Number(object.sumOfSquaredDeviation); + if (object.range != null) { + if (typeof object.range !== "object") + throw TypeError(".google.api.Distribution.range: object expected"); + message.range = $root.google.api.Distribution.Range.fromObject(object.range); + } + if (object.bucketOptions != null) { + if (typeof object.bucketOptions !== "object") + throw TypeError(".google.api.Distribution.bucketOptions: object expected"); + message.bucketOptions = $root.google.api.Distribution.BucketOptions.fromObject(object.bucketOptions); + } + if (object.bucketCounts) { + if (!Array.isArray(object.bucketCounts)) + throw TypeError(".google.api.Distribution.bucketCounts: array expected"); + message.bucketCounts = []; + for (var i = 0; i < object.bucketCounts.length; ++i) + if ($util.Long) + (message.bucketCounts[i] = $util.Long.fromValue(object.bucketCounts[i])).unsigned = false; + else if (typeof object.bucketCounts[i] === "string") + message.bucketCounts[i] = parseInt(object.bucketCounts[i], 10); + else if (typeof object.bucketCounts[i] === "number") + message.bucketCounts[i] = object.bucketCounts[i]; + else if (typeof object.bucketCounts[i] === "object") + message.bucketCounts[i] = new $util.LongBits(object.bucketCounts[i].low >>> 0, object.bucketCounts[i].high >>> 0).toNumber(); + } + if (object.exemplars) { + if (!Array.isArray(object.exemplars)) + throw TypeError(".google.api.Distribution.exemplars: array expected"); + message.exemplars = []; + for (var i = 0; i < object.exemplars.length; ++i) { + if (typeof object.exemplars[i] !== "object") + throw TypeError(".google.api.Distribution.exemplars: object expected"); + message.exemplars[i] = $root.google.api.Distribution.Exemplar.fromObject(object.exemplars[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Distribution message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Distribution + * @static + * @param {google.api.Distribution} message Distribution + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Distribution.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bucketCounts = []; + object.exemplars = []; + } + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + object.mean = 0; + object.sumOfSquaredDeviation = 0; + object.range = null; + object.bucketOptions = null; + } + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + if (message.mean != null && message.hasOwnProperty("mean")) + object.mean = options.json && !isFinite(message.mean) ? String(message.mean) : message.mean; + if (message.sumOfSquaredDeviation != null && message.hasOwnProperty("sumOfSquaredDeviation")) + object.sumOfSquaredDeviation = options.json && !isFinite(message.sumOfSquaredDeviation) ? String(message.sumOfSquaredDeviation) : message.sumOfSquaredDeviation; + if (message.range != null && message.hasOwnProperty("range")) + object.range = $root.google.api.Distribution.Range.toObject(message.range, options); + if (message.bucketOptions != null && message.hasOwnProperty("bucketOptions")) + object.bucketOptions = $root.google.api.Distribution.BucketOptions.toObject(message.bucketOptions, options); + if (message.bucketCounts && message.bucketCounts.length) { + object.bucketCounts = []; + for (var j = 0; j < message.bucketCounts.length; ++j) + if (typeof message.bucketCounts[j] === "number") + object.bucketCounts[j] = options.longs === String ? String(message.bucketCounts[j]) : message.bucketCounts[j]; + else + object.bucketCounts[j] = options.longs === String ? $util.Long.prototype.toString.call(message.bucketCounts[j]) : options.longs === Number ? new $util.LongBits(message.bucketCounts[j].low >>> 0, message.bucketCounts[j].high >>> 0).toNumber() : message.bucketCounts[j]; + } + if (message.exemplars && message.exemplars.length) { + object.exemplars = []; + for (var j = 0; j < message.exemplars.length; ++j) + object.exemplars[j] = $root.google.api.Distribution.Exemplar.toObject(message.exemplars[j], options); + } + return object; + }; + + /** + * Converts this Distribution to JSON. + * @function toJSON + * @memberof google.api.Distribution + * @instance + * @returns {Object.} JSON object + */ + Distribution.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Distribution.Range = (function() { + + /** + * Properties of a Range. + * @memberof google.api.Distribution + * @interface IRange + * @property {number|null} [min] Range min + * @property {number|null} [max] Range max + */ + + /** + * Constructs a new Range. + * @memberof google.api.Distribution + * @classdesc Represents a Range. + * @implements IRange + * @constructor + * @param {google.api.Distribution.IRange=} [properties] Properties to set + */ + function Range(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]]; + } + + /** + * Range min. + * @member {number} min + * @memberof google.api.Distribution.Range + * @instance + */ + Range.prototype.min = 0; + + /** + * Range max. + * @member {number} max + * @memberof google.api.Distribution.Range + * @instance + */ + Range.prototype.max = 0; + + /** + * Creates a new Range instance using the specified properties. + * @function create + * @memberof google.api.Distribution.Range + * @static + * @param {google.api.Distribution.IRange=} [properties] Properties to set + * @returns {google.api.Distribution.Range} Range instance + */ + Range.create = function create(properties) { + return new Range(properties); + }; + + /** + * Encodes the specified Range message. Does not implicitly {@link google.api.Distribution.Range.verify|verify} messages. + * @function encode + * @memberof google.api.Distribution.Range + * @static + * @param {google.api.Distribution.IRange} message Range message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Range.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.min != null && Object.hasOwnProperty.call(message, "min")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.min); + if (message.max != null && Object.hasOwnProperty.call(message, "max")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.max); + return writer; + }; + + /** + * Encodes the specified Range message, length delimited. Does not implicitly {@link google.api.Distribution.Range.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Distribution.Range + * @static + * @param {google.api.Distribution.IRange} message Range message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Range.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Range message from the specified reader or buffer. + * @function decode + * @memberof google.api.Distribution.Range + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Distribution.Range} Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Range.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.Distribution.Range(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.min = reader.double(); + break; + case 2: + message.max = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Range message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Distribution.Range + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Distribution.Range} Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Range.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Range message. + * @function verify + * @memberof google.api.Distribution.Range + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Range.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.min != null && message.hasOwnProperty("min")) + if (typeof message.min !== "number") + return "min: number expected"; + if (message.max != null && message.hasOwnProperty("max")) + if (typeof message.max !== "number") + return "max: number expected"; + return null; + }; + + /** + * Creates a Range message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Distribution.Range + * @static + * @param {Object.} object Plain object + * @returns {google.api.Distribution.Range} Range + */ + Range.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Distribution.Range) + return object; + var message = new $root.google.api.Distribution.Range(); + if (object.min != null) + message.min = Number(object.min); + if (object.max != null) + message.max = Number(object.max); + return message; + }; + + /** + * Creates a plain object from a Range message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Distribution.Range + * @static + * @param {google.api.Distribution.Range} message Range + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Range.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.min = 0; + object.max = 0; + } + if (message.min != null && message.hasOwnProperty("min")) + object.min = options.json && !isFinite(message.min) ? String(message.min) : message.min; + if (message.max != null && message.hasOwnProperty("max")) + object.max = options.json && !isFinite(message.max) ? String(message.max) : message.max; + return object; + }; + + /** + * Converts this Range to JSON. + * @function toJSON + * @memberof google.api.Distribution.Range + * @instance + * @returns {Object.} JSON object + */ + Range.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Range; + })(); + + Distribution.BucketOptions = (function() { + + /** + * Properties of a BucketOptions. + * @memberof google.api.Distribution + * @interface IBucketOptions + * @property {google.api.Distribution.BucketOptions.ILinear|null} [linearBuckets] BucketOptions linearBuckets + * @property {google.api.Distribution.BucketOptions.IExponential|null} [exponentialBuckets] BucketOptions exponentialBuckets + * @property {google.api.Distribution.BucketOptions.IExplicit|null} [explicitBuckets] BucketOptions explicitBuckets + */ + + /** + * Constructs a new BucketOptions. + * @memberof google.api.Distribution + * @classdesc Represents a BucketOptions. + * @implements IBucketOptions + * @constructor + * @param {google.api.Distribution.IBucketOptions=} [properties] Properties to set + */ + function BucketOptions(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]]; + } + + /** + * BucketOptions linearBuckets. + * @member {google.api.Distribution.BucketOptions.ILinear|null|undefined} linearBuckets + * @memberof google.api.Distribution.BucketOptions + * @instance + */ + BucketOptions.prototype.linearBuckets = null; + + /** + * BucketOptions exponentialBuckets. + * @member {google.api.Distribution.BucketOptions.IExponential|null|undefined} exponentialBuckets + * @memberof google.api.Distribution.BucketOptions + * @instance + */ + BucketOptions.prototype.exponentialBuckets = null; + + /** + * BucketOptions explicitBuckets. + * @member {google.api.Distribution.BucketOptions.IExplicit|null|undefined} explicitBuckets + * @memberof google.api.Distribution.BucketOptions + * @instance + */ + BucketOptions.prototype.explicitBuckets = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BucketOptions options. + * @member {"linearBuckets"|"exponentialBuckets"|"explicitBuckets"|undefined} options + * @memberof google.api.Distribution.BucketOptions + * @instance + */ + Object.defineProperty(BucketOptions.prototype, "options", { + get: $util.oneOfGetter($oneOfFields = ["linearBuckets", "exponentialBuckets", "explicitBuckets"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BucketOptions instance using the specified properties. + * @function create + * @memberof google.api.Distribution.BucketOptions + * @static + * @param {google.api.Distribution.IBucketOptions=} [properties] Properties to set + * @returns {google.api.Distribution.BucketOptions} BucketOptions instance + */ + BucketOptions.create = function create(properties) { + return new BucketOptions(properties); + }; + + /** + * Encodes the specified BucketOptions message. Does not implicitly {@link google.api.Distribution.BucketOptions.verify|verify} messages. + * @function encode + * @memberof google.api.Distribution.BucketOptions + * @static + * @param {google.api.Distribution.IBucketOptions} message BucketOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BucketOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.linearBuckets != null && Object.hasOwnProperty.call(message, "linearBuckets")) + $root.google.api.Distribution.BucketOptions.Linear.encode(message.linearBuckets, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.exponentialBuckets != null && Object.hasOwnProperty.call(message, "exponentialBuckets")) + $root.google.api.Distribution.BucketOptions.Exponential.encode(message.exponentialBuckets, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.explicitBuckets != null && Object.hasOwnProperty.call(message, "explicitBuckets")) + $root.google.api.Distribution.BucketOptions.Explicit.encode(message.explicitBuckets, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BucketOptions message, length delimited. Does not implicitly {@link google.api.Distribution.BucketOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Distribution.BucketOptions + * @static + * @param {google.api.Distribution.IBucketOptions} message BucketOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BucketOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BucketOptions message from the specified reader or buffer. + * @function decode + * @memberof google.api.Distribution.BucketOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Distribution.BucketOptions} BucketOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BucketOptions.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.Distribution.BucketOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.linearBuckets = $root.google.api.Distribution.BucketOptions.Linear.decode(reader, reader.uint32()); + break; + case 2: + message.exponentialBuckets = $root.google.api.Distribution.BucketOptions.Exponential.decode(reader, reader.uint32()); + break; + case 3: + message.explicitBuckets = $root.google.api.Distribution.BucketOptions.Explicit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); break; } - } - return null; - }; + } + return message; + }; + + /** + * Decodes a BucketOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Distribution.BucketOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Distribution.BucketOptions} BucketOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BucketOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BucketOptions message. + * @function verify + * @memberof google.api.Distribution.BucketOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BucketOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.linearBuckets != null && message.hasOwnProperty("linearBuckets")) { + properties.options = 1; + { + var error = $root.google.api.Distribution.BucketOptions.Linear.verify(message.linearBuckets); + if (error) + return "linearBuckets." + error; + } + } + if (message.exponentialBuckets != null && message.hasOwnProperty("exponentialBuckets")) { + if (properties.options === 1) + return "options: multiple values"; + properties.options = 1; + { + var error = $root.google.api.Distribution.BucketOptions.Exponential.verify(message.exponentialBuckets); + if (error) + return "exponentialBuckets." + error; + } + } + if (message.explicitBuckets != null && message.hasOwnProperty("explicitBuckets")) { + if (properties.options === 1) + return "options: multiple values"; + properties.options = 1; + { + var error = $root.google.api.Distribution.BucketOptions.Explicit.verify(message.explicitBuckets); + if (error) + return "explicitBuckets." + error; + } + } + return null; + }; + + /** + * Creates a BucketOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Distribution.BucketOptions + * @static + * @param {Object.} object Plain object + * @returns {google.api.Distribution.BucketOptions} BucketOptions + */ + BucketOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Distribution.BucketOptions) + return object; + var message = new $root.google.api.Distribution.BucketOptions(); + if (object.linearBuckets != null) { + if (typeof object.linearBuckets !== "object") + throw TypeError(".google.api.Distribution.BucketOptions.linearBuckets: object expected"); + message.linearBuckets = $root.google.api.Distribution.BucketOptions.Linear.fromObject(object.linearBuckets); + } + if (object.exponentialBuckets != null) { + if (typeof object.exponentialBuckets !== "object") + throw TypeError(".google.api.Distribution.BucketOptions.exponentialBuckets: object expected"); + message.exponentialBuckets = $root.google.api.Distribution.BucketOptions.Exponential.fromObject(object.exponentialBuckets); + } + if (object.explicitBuckets != null) { + if (typeof object.explicitBuckets !== "object") + throw TypeError(".google.api.Distribution.BucketOptions.explicitBuckets: object expected"); + message.explicitBuckets = $root.google.api.Distribution.BucketOptions.Explicit.fromObject(object.explicitBuckets); + } + return message; + }; + + /** + * Creates a plain object from a BucketOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Distribution.BucketOptions + * @static + * @param {google.api.Distribution.BucketOptions} message BucketOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BucketOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.linearBuckets != null && message.hasOwnProperty("linearBuckets")) { + object.linearBuckets = $root.google.api.Distribution.BucketOptions.Linear.toObject(message.linearBuckets, options); + if (options.oneofs) + object.options = "linearBuckets"; + } + if (message.exponentialBuckets != null && message.hasOwnProperty("exponentialBuckets")) { + object.exponentialBuckets = $root.google.api.Distribution.BucketOptions.Exponential.toObject(message.exponentialBuckets, options); + if (options.oneofs) + object.options = "exponentialBuckets"; + } + if (message.explicitBuckets != null && message.hasOwnProperty("explicitBuckets")) { + object.explicitBuckets = $root.google.api.Distribution.BucketOptions.Explicit.toObject(message.explicitBuckets, options); + if (options.oneofs) + object.options = "explicitBuckets"; + } + return object; + }; + + /** + * Converts this BucketOptions to JSON. + * @function toJSON + * @memberof google.api.Distribution.BucketOptions + * @instance + * @returns {Object.} JSON object + */ + BucketOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + BucketOptions.Linear = (function() { + + /** + * Properties of a Linear. + * @memberof google.api.Distribution.BucketOptions + * @interface ILinear + * @property {number|null} [numFiniteBuckets] Linear numFiniteBuckets + * @property {number|null} [width] Linear width + * @property {number|null} [offset] Linear offset + */ + + /** + * Constructs a new Linear. + * @memberof google.api.Distribution.BucketOptions + * @classdesc Represents a Linear. + * @implements ILinear + * @constructor + * @param {google.api.Distribution.BucketOptions.ILinear=} [properties] Properties to set + */ + function Linear(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]]; + } + + /** + * Linear numFiniteBuckets. + * @member {number} numFiniteBuckets + * @memberof google.api.Distribution.BucketOptions.Linear + * @instance + */ + Linear.prototype.numFiniteBuckets = 0; + + /** + * Linear width. + * @member {number} width + * @memberof google.api.Distribution.BucketOptions.Linear + * @instance + */ + Linear.prototype.width = 0; + + /** + * Linear offset. + * @member {number} offset + * @memberof google.api.Distribution.BucketOptions.Linear + * @instance + */ + Linear.prototype.offset = 0; + + /** + * Creates a new Linear instance using the specified properties. + * @function create + * @memberof google.api.Distribution.BucketOptions.Linear + * @static + * @param {google.api.Distribution.BucketOptions.ILinear=} [properties] Properties to set + * @returns {google.api.Distribution.BucketOptions.Linear} Linear instance + */ + Linear.create = function create(properties) { + return new Linear(properties); + }; + + /** + * Encodes the specified Linear message. Does not implicitly {@link google.api.Distribution.BucketOptions.Linear.verify|verify} messages. + * @function encode + * @memberof google.api.Distribution.BucketOptions.Linear + * @static + * @param {google.api.Distribution.BucketOptions.ILinear} message Linear message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Linear.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.numFiniteBuckets != null && Object.hasOwnProperty.call(message, "numFiniteBuckets")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.numFiniteBuckets); + if (message.width != null && Object.hasOwnProperty.call(message, "width")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.width); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.offset); + return writer; + }; + + /** + * Encodes the specified Linear message, length delimited. Does not implicitly {@link google.api.Distribution.BucketOptions.Linear.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Distribution.BucketOptions.Linear + * @static + * @param {google.api.Distribution.BucketOptions.ILinear} message Linear message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Linear.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Linear message from the specified reader or buffer. + * @function decode + * @memberof google.api.Distribution.BucketOptions.Linear + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Distribution.BucketOptions.Linear} Linear + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Linear.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.Distribution.BucketOptions.Linear(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.numFiniteBuckets = reader.int32(); + break; + case 2: + message.width = reader.double(); + break; + case 3: + message.offset = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Linear message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Distribution.BucketOptions.Linear + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Distribution.BucketOptions.Linear} Linear + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Linear.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Linear message. + * @function verify + * @memberof google.api.Distribution.BucketOptions.Linear + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Linear.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.numFiniteBuckets != null && message.hasOwnProperty("numFiniteBuckets")) + if (!$util.isInteger(message.numFiniteBuckets)) + return "numFiniteBuckets: integer expected"; + if (message.width != null && message.hasOwnProperty("width")) + if (typeof message.width !== "number") + return "width: number expected"; + if (message.offset != null && message.hasOwnProperty("offset")) + if (typeof message.offset !== "number") + return "offset: number expected"; + return null; + }; + + /** + * Creates a Linear message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Distribution.BucketOptions.Linear + * @static + * @param {Object.} object Plain object + * @returns {google.api.Distribution.BucketOptions.Linear} Linear + */ + Linear.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Distribution.BucketOptions.Linear) + return object; + var message = new $root.google.api.Distribution.BucketOptions.Linear(); + if (object.numFiniteBuckets != null) + message.numFiniteBuckets = object.numFiniteBuckets | 0; + if (object.width != null) + message.width = Number(object.width); + if (object.offset != null) + message.offset = Number(object.offset); + return message; + }; + + /** + * Creates a plain object from a Linear message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Distribution.BucketOptions.Linear + * @static + * @param {google.api.Distribution.BucketOptions.Linear} message Linear + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Linear.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.numFiniteBuckets = 0; + object.width = 0; + object.offset = 0; + } + if (message.numFiniteBuckets != null && message.hasOwnProperty("numFiniteBuckets")) + object.numFiniteBuckets = message.numFiniteBuckets; + if (message.width != null && message.hasOwnProperty("width")) + object.width = options.json && !isFinite(message.width) ? String(message.width) : message.width; + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = options.json && !isFinite(message.offset) ? String(message.offset) : message.offset; + return object; + }; + + /** + * Converts this Linear to JSON. + * @function toJSON + * @memberof google.api.Distribution.BucketOptions.Linear + * @instance + * @returns {Object.} JSON object + */ + Linear.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Linear; + })(); + + BucketOptions.Exponential = (function() { + + /** + * Properties of an Exponential. + * @memberof google.api.Distribution.BucketOptions + * @interface IExponential + * @property {number|null} [numFiniteBuckets] Exponential numFiniteBuckets + * @property {number|null} [growthFactor] Exponential growthFactor + * @property {number|null} [scale] Exponential scale + */ + + /** + * Constructs a new Exponential. + * @memberof google.api.Distribution.BucketOptions + * @classdesc Represents an Exponential. + * @implements IExponential + * @constructor + * @param {google.api.Distribution.BucketOptions.IExponential=} [properties] Properties to set + */ + function Exponential(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]]; + } + + /** + * Exponential numFiniteBuckets. + * @member {number} numFiniteBuckets + * @memberof google.api.Distribution.BucketOptions.Exponential + * @instance + */ + Exponential.prototype.numFiniteBuckets = 0; + + /** + * Exponential growthFactor. + * @member {number} growthFactor + * @memberof google.api.Distribution.BucketOptions.Exponential + * @instance + */ + Exponential.prototype.growthFactor = 0; + + /** + * Exponential scale. + * @member {number} scale + * @memberof google.api.Distribution.BucketOptions.Exponential + * @instance + */ + Exponential.prototype.scale = 0; + + /** + * Creates a new Exponential instance using the specified properties. + * @function create + * @memberof google.api.Distribution.BucketOptions.Exponential + * @static + * @param {google.api.Distribution.BucketOptions.IExponential=} [properties] Properties to set + * @returns {google.api.Distribution.BucketOptions.Exponential} Exponential instance + */ + Exponential.create = function create(properties) { + return new Exponential(properties); + }; + + /** + * Encodes the specified Exponential message. Does not implicitly {@link google.api.Distribution.BucketOptions.Exponential.verify|verify} messages. + * @function encode + * @memberof google.api.Distribution.BucketOptions.Exponential + * @static + * @param {google.api.Distribution.BucketOptions.IExponential} message Exponential message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Exponential.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.numFiniteBuckets != null && Object.hasOwnProperty.call(message, "numFiniteBuckets")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.numFiniteBuckets); + if (message.growthFactor != null && Object.hasOwnProperty.call(message, "growthFactor")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.growthFactor); + if (message.scale != null && Object.hasOwnProperty.call(message, "scale")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.scale); + return writer; + }; + + /** + * Encodes the specified Exponential message, length delimited. Does not implicitly {@link google.api.Distribution.BucketOptions.Exponential.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Distribution.BucketOptions.Exponential + * @static + * @param {google.api.Distribution.BucketOptions.IExponential} message Exponential message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Exponential.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Exponential message from the specified reader or buffer. + * @function decode + * @memberof google.api.Distribution.BucketOptions.Exponential + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Distribution.BucketOptions.Exponential} Exponential + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Exponential.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.Distribution.BucketOptions.Exponential(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.numFiniteBuckets = reader.int32(); + break; + case 2: + message.growthFactor = reader.double(); + break; + case 3: + message.scale = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Exponential message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Distribution.BucketOptions.Exponential + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Distribution.BucketOptions.Exponential} Exponential + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Exponential.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Exponential message. + * @function verify + * @memberof google.api.Distribution.BucketOptions.Exponential + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Exponential.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.numFiniteBuckets != null && message.hasOwnProperty("numFiniteBuckets")) + if (!$util.isInteger(message.numFiniteBuckets)) + return "numFiniteBuckets: integer expected"; + if (message.growthFactor != null && message.hasOwnProperty("growthFactor")) + if (typeof message.growthFactor !== "number") + return "growthFactor: number expected"; + if (message.scale != null && message.hasOwnProperty("scale")) + if (typeof message.scale !== "number") + return "scale: number expected"; + return null; + }; + + /** + * Creates an Exponential message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Distribution.BucketOptions.Exponential + * @static + * @param {Object.} object Plain object + * @returns {google.api.Distribution.BucketOptions.Exponential} Exponential + */ + Exponential.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Distribution.BucketOptions.Exponential) + return object; + var message = new $root.google.api.Distribution.BucketOptions.Exponential(); + if (object.numFiniteBuckets != null) + message.numFiniteBuckets = object.numFiniteBuckets | 0; + if (object.growthFactor != null) + message.growthFactor = Number(object.growthFactor); + if (object.scale != null) + message.scale = Number(object.scale); + return message; + }; + + /** + * Creates a plain object from an Exponential message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Distribution.BucketOptions.Exponential + * @static + * @param {google.api.Distribution.BucketOptions.Exponential} message Exponential + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Exponential.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.numFiniteBuckets = 0; + object.growthFactor = 0; + object.scale = 0; + } + if (message.numFiniteBuckets != null && message.hasOwnProperty("numFiniteBuckets")) + object.numFiniteBuckets = message.numFiniteBuckets; + if (message.growthFactor != null && message.hasOwnProperty("growthFactor")) + object.growthFactor = options.json && !isFinite(message.growthFactor) ? String(message.growthFactor) : message.growthFactor; + if (message.scale != null && message.hasOwnProperty("scale")) + object.scale = options.json && !isFinite(message.scale) ? String(message.scale) : message.scale; + return object; + }; + + /** + * Converts this Exponential to JSON. + * @function toJSON + * @memberof google.api.Distribution.BucketOptions.Exponential + * @instance + * @returns {Object.} JSON object + */ + Exponential.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Exponential; + })(); + + BucketOptions.Explicit = (function() { + + /** + * Properties of an Explicit. + * @memberof google.api.Distribution.BucketOptions + * @interface IExplicit + * @property {Array.|null} [bounds] Explicit bounds + */ + + /** + * Constructs a new Explicit. + * @memberof google.api.Distribution.BucketOptions + * @classdesc Represents an Explicit. + * @implements IExplicit + * @constructor + * @param {google.api.Distribution.BucketOptions.IExplicit=} [properties] Properties to set + */ + function Explicit(properties) { + this.bounds = []; + 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]]; + } + + /** + * Explicit bounds. + * @member {Array.} bounds + * @memberof google.api.Distribution.BucketOptions.Explicit + * @instance + */ + Explicit.prototype.bounds = $util.emptyArray; + + /** + * Creates a new Explicit instance using the specified properties. + * @function create + * @memberof google.api.Distribution.BucketOptions.Explicit + * @static + * @param {google.api.Distribution.BucketOptions.IExplicit=} [properties] Properties to set + * @returns {google.api.Distribution.BucketOptions.Explicit} Explicit instance + */ + Explicit.create = function create(properties) { + return new Explicit(properties); + }; + + /** + * Encodes the specified Explicit message. Does not implicitly {@link google.api.Distribution.BucketOptions.Explicit.verify|verify} messages. + * @function encode + * @memberof google.api.Distribution.BucketOptions.Explicit + * @static + * @param {google.api.Distribution.BucketOptions.IExplicit} message Explicit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Explicit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bounds != null && message.bounds.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.bounds.length; ++i) + writer.double(message.bounds[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Explicit message, length delimited. Does not implicitly {@link google.api.Distribution.BucketOptions.Explicit.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Distribution.BucketOptions.Explicit + * @static + * @param {google.api.Distribution.BucketOptions.IExplicit} message Explicit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Explicit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Explicit message from the specified reader or buffer. + * @function decode + * @memberof google.api.Distribution.BucketOptions.Explicit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Distribution.BucketOptions.Explicit} Explicit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Explicit.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.Distribution.BucketOptions.Explicit(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.bounds && message.bounds.length)) + message.bounds = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.bounds.push(reader.double()); + } else + message.bounds.push(reader.double()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Explicit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Distribution.BucketOptions.Explicit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Distribution.BucketOptions.Explicit} Explicit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Explicit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Explicit message. + * @function verify + * @memberof google.api.Distribution.BucketOptions.Explicit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Explicit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bounds != null && message.hasOwnProperty("bounds")) { + if (!Array.isArray(message.bounds)) + return "bounds: array expected"; + for (var i = 0; i < message.bounds.length; ++i) + if (typeof message.bounds[i] !== "number") + return "bounds: number[] expected"; + } + return null; + }; + + /** + * Creates an Explicit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Distribution.BucketOptions.Explicit + * @static + * @param {Object.} object Plain object + * @returns {google.api.Distribution.BucketOptions.Explicit} Explicit + */ + Explicit.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Distribution.BucketOptions.Explicit) + return object; + var message = new $root.google.api.Distribution.BucketOptions.Explicit(); + if (object.bounds) { + if (!Array.isArray(object.bounds)) + throw TypeError(".google.api.Distribution.BucketOptions.Explicit.bounds: array expected"); + message.bounds = []; + for (var i = 0; i < object.bounds.length; ++i) + message.bounds[i] = Number(object.bounds[i]); + } + return message; + }; - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) - 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; - } - 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; + /** + * Creates a plain object from an Explicit message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Distribution.BucketOptions.Explicit + * @static + * @param {google.api.Distribution.BucketOptions.Explicit} message Explicit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Explicit.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.bounds = []; + if (message.bounds && message.bounds.length) { + object.bounds = []; + for (var j = 0; j < message.bounds.length; ++j) + object.bounds[j] = options.json && !isFinite(message.bounds[j]) ? String(message.bounds[j]) : message.bounds[j]; } - } - return message; - }; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceDescriptor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.pattern = []; - object.style = []; - } - 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; - }; + return object; + }; - /** - * Converts this ResourceDescriptor to JSON. - * @function toJSON - * @memberof google.api.ResourceDescriptor - * @instance - * @returns {Object.} JSON object - */ - ResourceDescriptor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this Explicit to JSON. + * @function toJSON + * @memberof google.api.Distribution.BucketOptions.Explicit + * @instance + * @returns {Object.} JSON object + */ + Explicit.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; - })(); + return Explicit; + })(); - /** - * 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 BucketOptions; })(); - return ResourceDescriptor; - })(); + Distribution.Exemplar = (function() { - api.ResourceReference = (function() { + /** + * Properties of an Exemplar. + * @memberof google.api.Distribution + * @interface IExemplar + * @property {number|null} [value] Exemplar value + * @property {google.protobuf.ITimestamp|null} [timestamp] Exemplar timestamp + * @property {Array.|null} [attachments] Exemplar attachments + */ - /** - * Properties of a ResourceReference. - * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType - */ + /** + * Constructs a new Exemplar. + * @memberof google.api.Distribution + * @classdesc Represents an Exemplar. + * @implements IExemplar + * @constructor + * @param {google.api.Distribution.IExemplar=} [properties] Properties to set + */ + function Exemplar(properties) { + this.attachments = []; + 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]]; + } - /** - * Constructs a new ResourceReference. - * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference - * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set - */ - 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]]; - } + /** + * Exemplar value. + * @member {number} value + * @memberof google.api.Distribution.Exemplar + * @instance + */ + Exemplar.prototype.value = 0; - /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.type = ""; + /** + * Exemplar timestamp. + * @member {google.protobuf.ITimestamp|null|undefined} timestamp + * @memberof google.api.Distribution.Exemplar + * @instance + */ + Exemplar.prototype.timestamp = null; - /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.childType = ""; + /** + * Exemplar attachments. + * @member {Array.} attachments + * @memberof google.api.Distribution.Exemplar + * @instance + */ + Exemplar.prototype.attachments = $util.emptyArray; - /** - * Creates a new ResourceReference instance using the specified properties. - * @function create - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance - */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); - }; + /** + * Creates a new Exemplar instance using the specified properties. + * @function create + * @memberof google.api.Distribution.Exemplar + * @static + * @param {google.api.Distribution.IExemplar=} [properties] Properties to set + * @returns {google.api.Distribution.Exemplar} Exemplar instance + */ + Exemplar.create = function create(properties) { + return new Exemplar(properties); + }; - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.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); - return writer; - }; + /** + * Encodes the specified Exemplar message. Does not implicitly {@link google.api.Distribution.Exemplar.verify|verify} messages. + * @function encode + * @memberof google.api.Distribution.Exemplar + * @static + * @param {google.api.Distribution.IExemplar} message Exemplar message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Exemplar.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.attachments != null && message.attachments.length) + for (var i = 0; i < message.attachments.length; ++i) + $root.google.protobuf.Any.encode(message.attachments[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified Exemplar message, length delimited. Does not implicitly {@link google.api.Distribution.Exemplar.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Distribution.Exemplar + * @static + * @param {google.api.Distribution.IExemplar} message Exemplar message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Exemplar.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @function decode - * @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.ResourceReference} ResourceReference - * @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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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.type = reader.string(); - break; - case 2: - message.childType = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes an Exemplar message from the specified reader or buffer. + * @function decode + * @memberof google.api.Distribution.Exemplar + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Distribution.Exemplar} Exemplar + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Exemplar.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.Distribution.Exemplar(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.double(); + break; + case 2: + message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.attachments && message.attachments.length)) + message.attachments = []; + message.attachments.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes an Exemplar message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Distribution.Exemplar + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Distribution.Exemplar} Exemplar + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Exemplar.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a ResourceReference message. - * @function verify - * @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 - */ - ResourceReference.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"; - return null; - }; + /** + * Verifies an Exemplar message. + * @function verify + * @memberof google.api.Distribution.Exemplar + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Exemplar.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.timestamp); + if (error) + return "timestamp." + error; + } + if (message.attachments != null && message.hasOwnProperty("attachments")) { + if (!Array.isArray(message.attachments)) + return "attachments: array expected"; + for (var i = 0; i < message.attachments.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.attachments[i]); + if (error) + return "attachments." + error; + } + } + return null; + }; + + /** + * Creates an Exemplar message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Distribution.Exemplar + * @static + * @param {Object.} object Plain object + * @returns {google.api.Distribution.Exemplar} Exemplar + */ + Exemplar.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Distribution.Exemplar) + return object; + var message = new $root.google.api.Distribution.Exemplar(); + if (object.value != null) + message.value = Number(object.value); + if (object.timestamp != null) { + if (typeof object.timestamp !== "object") + throw TypeError(".google.api.Distribution.Exemplar.timestamp: object expected"); + message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); + } + if (object.attachments) { + if (!Array.isArray(object.attachments)) + throw TypeError(".google.api.Distribution.Exemplar.attachments: array expected"); + message.attachments = []; + for (var i = 0; i < object.attachments.length; ++i) { + if (typeof object.attachments[i] !== "object") + throw TypeError(".google.api.Distribution.Exemplar.attachments: object expected"); + message.attachments[i] = $root.google.protobuf.Any.fromObject(object.attachments[i]); + } + } + return message; + }; - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceReference - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference - */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) + /** + * Creates a plain object from an Exemplar message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Distribution.Exemplar + * @static + * @param {google.api.Distribution.Exemplar} message Exemplar + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Exemplar.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.attachments = []; + if (options.defaults) { + object.value = 0; + object.timestamp = null; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); + if (message.attachments && message.attachments.length) { + object.attachments = []; + for (var j = 0; j < message.attachments.length; ++j) + object.attachments[j] = $root.google.protobuf.Any.toObject(message.attachments[j], options); + } 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); - return message; - }; + }; - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceReference - * @static - * @param {google.api.ResourceReference} message ResourceReference - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceReference.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - object.childType = ""; - } - 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 Exemplar to JSON. + * @function toJSON + * @memberof google.api.Distribution.Exemplar + * @instance + * @returns {Object.} JSON object + */ + Exemplar.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this ResourceReference to JSON. - * @function toJSON - * @memberof google.api.ResourceReference - * @instance - * @returns {Object.} JSON object - */ - ResourceReference.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return Exemplar; + })(); - return ResourceReference; + return Distribution; })(); - api.Distribution = (function() { + api.MetricDescriptor = (function() { /** - * Properties of a Distribution. + * Properties of a MetricDescriptor. * @memberof google.api - * @interface IDistribution - * @property {number|Long|null} [count] Distribution count - * @property {number|null} [mean] Distribution mean - * @property {number|null} [sumOfSquaredDeviation] Distribution sumOfSquaredDeviation - * @property {google.api.Distribution.IRange|null} [range] Distribution range - * @property {google.api.Distribution.IBucketOptions|null} [bucketOptions] Distribution bucketOptions - * @property {Array.|null} [bucketCounts] Distribution bucketCounts - * @property {Array.|null} [exemplars] Distribution exemplars + * @interface IMetricDescriptor + * @property {string|null} [name] MetricDescriptor name + * @property {string|null} [type] MetricDescriptor type + * @property {Array.|null} [labels] MetricDescriptor labels + * @property {google.api.MetricDescriptor.MetricKind|null} [metricKind] MetricDescriptor metricKind + * @property {google.api.MetricDescriptor.ValueType|null} [valueType] MetricDescriptor valueType + * @property {string|null} [unit] MetricDescriptor unit + * @property {string|null} [description] MetricDescriptor description + * @property {string|null} [displayName] MetricDescriptor displayName + * @property {google.api.MetricDescriptor.IMetricDescriptorMetadata|null} [metadata] MetricDescriptor metadata + * @property {google.api.LaunchStage|null} [launchStage] MetricDescriptor launchStage + * @property {Array.|null} [monitoredResourceTypes] MetricDescriptor monitoredResourceTypes */ /** - * Constructs a new Distribution. + * Constructs a new MetricDescriptor. * @memberof google.api - * @classdesc Represents a Distribution. - * @implements IDistribution + * @classdesc Represents a MetricDescriptor. + * @implements IMetricDescriptor * @constructor - * @param {google.api.IDistribution=} [properties] Properties to set + * @param {google.api.IMetricDescriptor=} [properties] Properties to set */ - function Distribution(properties) { - this.bucketCounts = []; - this.exemplars = []; + function MetricDescriptor(properties) { + this.labels = []; + this.monitoredResourceTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -29036,167 +32828,211 @@ } /** - * Distribution count. - * @member {number|Long} count - * @memberof google.api.Distribution + * MetricDescriptor name. + * @member {string} name + * @memberof google.api.MetricDescriptor * @instance */ - Distribution.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + MetricDescriptor.prototype.name = ""; /** - * Distribution mean. - * @member {number} mean - * @memberof google.api.Distribution + * MetricDescriptor type. + * @member {string} type + * @memberof google.api.MetricDescriptor * @instance */ - Distribution.prototype.mean = 0; + MetricDescriptor.prototype.type = ""; /** - * Distribution sumOfSquaredDeviation. - * @member {number} sumOfSquaredDeviation - * @memberof google.api.Distribution + * MetricDescriptor labels. + * @member {Array.} labels + * @memberof google.api.MetricDescriptor * @instance */ - Distribution.prototype.sumOfSquaredDeviation = 0; + MetricDescriptor.prototype.labels = $util.emptyArray; /** - * Distribution range. - * @member {google.api.Distribution.IRange|null|undefined} range - * @memberof google.api.Distribution + * MetricDescriptor metricKind. + * @member {google.api.MetricDescriptor.MetricKind} metricKind + * @memberof google.api.MetricDescriptor * @instance */ - Distribution.prototype.range = null; + MetricDescriptor.prototype.metricKind = 0; /** - * Distribution bucketOptions. - * @member {google.api.Distribution.IBucketOptions|null|undefined} bucketOptions - * @memberof google.api.Distribution + * MetricDescriptor valueType. + * @member {google.api.MetricDescriptor.ValueType} valueType + * @memberof google.api.MetricDescriptor * @instance */ - Distribution.prototype.bucketOptions = null; + MetricDescriptor.prototype.valueType = 0; /** - * Distribution bucketCounts. - * @member {Array.} bucketCounts - * @memberof google.api.Distribution + * MetricDescriptor unit. + * @member {string} unit + * @memberof google.api.MetricDescriptor * @instance */ - Distribution.prototype.bucketCounts = $util.emptyArray; + MetricDescriptor.prototype.unit = ""; /** - * Distribution exemplars. - * @member {Array.} exemplars - * @memberof google.api.Distribution + * MetricDescriptor description. + * @member {string} description + * @memberof google.api.MetricDescriptor * @instance */ - Distribution.prototype.exemplars = $util.emptyArray; + MetricDescriptor.prototype.description = ""; /** - * Creates a new Distribution instance using the specified properties. + * MetricDescriptor displayName. + * @member {string} displayName + * @memberof google.api.MetricDescriptor + * @instance + */ + MetricDescriptor.prototype.displayName = ""; + + /** + * MetricDescriptor metadata. + * @member {google.api.MetricDescriptor.IMetricDescriptorMetadata|null|undefined} metadata + * @memberof google.api.MetricDescriptor + * @instance + */ + MetricDescriptor.prototype.metadata = null; + + /** + * MetricDescriptor launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.MetricDescriptor + * @instance + */ + MetricDescriptor.prototype.launchStage = 0; + + /** + * MetricDescriptor monitoredResourceTypes. + * @member {Array.} monitoredResourceTypes + * @memberof google.api.MetricDescriptor + * @instance + */ + MetricDescriptor.prototype.monitoredResourceTypes = $util.emptyArray; + + /** + * Creates a new MetricDescriptor instance using the specified properties. * @function create - * @memberof google.api.Distribution + * @memberof google.api.MetricDescriptor * @static - * @param {google.api.IDistribution=} [properties] Properties to set - * @returns {google.api.Distribution} Distribution instance + * @param {google.api.IMetricDescriptor=} [properties] Properties to set + * @returns {google.api.MetricDescriptor} MetricDescriptor instance */ - Distribution.create = function create(properties) { - return new Distribution(properties); + MetricDescriptor.create = function create(properties) { + return new MetricDescriptor(properties); }; /** - * Encodes the specified Distribution message. Does not implicitly {@link google.api.Distribution.verify|verify} messages. + * Encodes the specified MetricDescriptor message. Does not implicitly {@link google.api.MetricDescriptor.verify|verify} messages. * @function encode - * @memberof google.api.Distribution + * @memberof google.api.MetricDescriptor * @static - * @param {google.api.IDistribution} message Distribution message or plain object to encode + * @param {google.api.IMetricDescriptor} message MetricDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Distribution.encode = function encode(message, writer) { + MetricDescriptor.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.count); - if (message.mean != null && Object.hasOwnProperty.call(message, "mean")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.mean); - if (message.sumOfSquaredDeviation != null && Object.hasOwnProperty.call(message, "sumOfSquaredDeviation")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.sumOfSquaredDeviation); - if (message.range != null && Object.hasOwnProperty.call(message, "range")) - $root.google.api.Distribution.Range.encode(message.range, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.bucketOptions != null && Object.hasOwnProperty.call(message, "bucketOptions")) - $root.google.api.Distribution.BucketOptions.encode(message.bucketOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.bucketCounts != null && message.bucketCounts.length) { - writer.uint32(/* id 7, wireType 2 =*/58).fork(); - for (var i = 0; i < message.bucketCounts.length; ++i) - writer.int64(message.bucketCounts[i]); - writer.ldelim(); - } - if (message.exemplars != null && message.exemplars.length) - for (var i = 0; i < message.exemplars.length; ++i) - $root.google.api.Distribution.Exemplar.encode(message.exemplars[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.labels != null && message.labels.length) + for (var i = 0; i < message.labels.length; ++i) + $root.google.api.LabelDescriptor.encode(message.labels[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metricKind != null && Object.hasOwnProperty.call(message, "metricKind")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.metricKind); + if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.valueType); + if (message.unit != null && Object.hasOwnProperty.call(message, "unit")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.unit); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.displayName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.type); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.api.MetricDescriptor.MetricDescriptorMetadata.encode(message.metadata, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.launchStage); + if (message.monitoredResourceTypes != null && message.monitoredResourceTypes.length) + for (var i = 0; i < message.monitoredResourceTypes.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.monitoredResourceTypes[i]); return writer; }; /** - * Encodes the specified Distribution message, length delimited. Does not implicitly {@link google.api.Distribution.verify|verify} messages. + * Encodes the specified MetricDescriptor message, length delimited. Does not implicitly {@link google.api.MetricDescriptor.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.Distribution + * @memberof google.api.MetricDescriptor * @static - * @param {google.api.IDistribution} message Distribution message or plain object to encode + * @param {google.api.IMetricDescriptor} message MetricDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Distribution.encodeDelimited = function encodeDelimited(message, writer) { + MetricDescriptor.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Distribution message from the specified reader or buffer. + * Decodes a MetricDescriptor message from the specified reader or buffer. * @function decode - * @memberof google.api.Distribution + * @memberof google.api.MetricDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.Distribution} Distribution + * @returns {google.api.MetricDescriptor} MetricDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Distribution.decode = function decode(reader, length) { + MetricDescriptor.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.Distribution(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MetricDescriptor(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.count = reader.int64(); + message.name = reader.string(); + break; + case 8: + message.type = reader.string(); break; case 2: - message.mean = reader.double(); + if (!(message.labels && message.labels.length)) + message.labels = []; + message.labels.push($root.google.api.LabelDescriptor.decode(reader, reader.uint32())); break; case 3: - message.sumOfSquaredDeviation = reader.double(); + message.metricKind = reader.int32(); break; case 4: - message.range = $root.google.api.Distribution.Range.decode(reader, reader.uint32()); + message.valueType = reader.int32(); + break; + case 5: + message.unit = reader.string(); break; case 6: - message.bucketOptions = $root.google.api.Distribution.BucketOptions.decode(reader, reader.uint32()); + message.description = reader.string(); break; case 7: - if (!(message.bucketCounts && message.bucketCounts.length)) - message.bucketCounts = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.bucketCounts.push(reader.int64()); - } else - message.bucketCounts.push(reader.int64()); + message.displayName = reader.string(); break; case 10: - if (!(message.exemplars && message.exemplars.length)) - message.exemplars = []; - message.exemplars.push($root.google.api.Distribution.Exemplar.decode(reader, reader.uint32())); + message.metadata = $root.google.api.MetricDescriptor.MetricDescriptorMetadata.decode(reader, reader.uint32()); + break; + case 12: + message.launchStage = reader.int32(); + break; + case 13: + if (!(message.monitoredResourceTypes && message.monitoredResourceTypes.length)) + message.monitoredResourceTypes = []; + message.monitoredResourceTypes.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -29207,219 +33043,327 @@ }; /** - * Decodes a Distribution message from the specified reader or buffer, length delimited. + * Decodes a MetricDescriptor message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.Distribution + * @memberof google.api.MetricDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Distribution} Distribution + * @returns {google.api.MetricDescriptor} MetricDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Distribution.decodeDelimited = function decodeDelimited(reader) { + MetricDescriptor.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Distribution message. + * Verifies a MetricDescriptor message. * @function verify - * @memberof google.api.Distribution + * @memberof google.api.MetricDescriptor * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Distribution.verify = function verify(message) { + MetricDescriptor.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) - return "count: integer|Long expected"; - if (message.mean != null && message.hasOwnProperty("mean")) - if (typeof message.mean !== "number") - return "mean: number expected"; - if (message.sumOfSquaredDeviation != null && message.hasOwnProperty("sumOfSquaredDeviation")) - if (typeof message.sumOfSquaredDeviation !== "number") - return "sumOfSquaredDeviation: number expected"; - if (message.range != null && message.hasOwnProperty("range")) { - var error = $root.google.api.Distribution.Range.verify(message.range); - if (error) - return "range." + error; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!Array.isArray(message.labels)) + return "labels: array expected"; + for (var i = 0; i < message.labels.length; ++i) { + var error = $root.google.api.LabelDescriptor.verify(message.labels[i]); + if (error) + return "labels." + error; + } } - if (message.bucketOptions != null && message.hasOwnProperty("bucketOptions")) { - var error = $root.google.api.Distribution.BucketOptions.verify(message.bucketOptions); + if (message.metricKind != null && message.hasOwnProperty("metricKind")) + switch (message.metricKind) { + default: + return "metricKind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.valueType != null && message.hasOwnProperty("valueType")) + switch (message.valueType) { + default: + return "valueType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.unit != null && message.hasOwnProperty("unit")) + if (!$util.isString(message.unit)) + return "unit: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.api.MetricDescriptor.MetricDescriptorMetadata.verify(message.metadata); if (error) - return "bucketOptions." + error; - } - if (message.bucketCounts != null && message.hasOwnProperty("bucketCounts")) { - if (!Array.isArray(message.bucketCounts)) - return "bucketCounts: array expected"; - for (var i = 0; i < message.bucketCounts.length; ++i) - if (!$util.isInteger(message.bucketCounts[i]) && !(message.bucketCounts[i] && $util.isInteger(message.bucketCounts[i].low) && $util.isInteger(message.bucketCounts[i].high))) - return "bucketCounts: integer|Long[] expected"; + return "metadata." + error; } - if (message.exemplars != null && message.hasOwnProperty("exemplars")) { - if (!Array.isArray(message.exemplars)) - return "exemplars: array expected"; - for (var i = 0; i < message.exemplars.length; ++i) { - var error = $root.google.api.Distribution.Exemplar.verify(message.exemplars[i]); - if (error) - return "exemplars." + error; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; } + if (message.monitoredResourceTypes != null && message.hasOwnProperty("monitoredResourceTypes")) { + if (!Array.isArray(message.monitoredResourceTypes)) + return "monitoredResourceTypes: array expected"; + for (var i = 0; i < message.monitoredResourceTypes.length; ++i) + if (!$util.isString(message.monitoredResourceTypes[i])) + return "monitoredResourceTypes: string[] expected"; } return null; }; /** - * Creates a Distribution message from a plain object. Also converts values to their respective internal types. + * Creates a MetricDescriptor message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.Distribution + * @memberof google.api.MetricDescriptor * @static * @param {Object.} object Plain object - * @returns {google.api.Distribution} Distribution + * @returns {google.api.MetricDescriptor} MetricDescriptor */ - Distribution.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Distribution) + MetricDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MetricDescriptor) return object; - var message = new $root.google.api.Distribution(); - if (object.count != null) - if ($util.Long) - (message.count = $util.Long.fromValue(object.count)).unsigned = false; - else if (typeof object.count === "string") - message.count = parseInt(object.count, 10); - else if (typeof object.count === "number") - message.count = object.count; - else if (typeof object.count === "object") - message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); - if (object.mean != null) - message.mean = Number(object.mean); - if (object.sumOfSquaredDeviation != null) - message.sumOfSquaredDeviation = Number(object.sumOfSquaredDeviation); - if (object.range != null) { - if (typeof object.range !== "object") - throw TypeError(".google.api.Distribution.range: object expected"); - message.range = $root.google.api.Distribution.Range.fromObject(object.range); + var message = new $root.google.api.MetricDescriptor(); + if (object.name != null) + message.name = String(object.name); + if (object.type != null) + message.type = String(object.type); + if (object.labels) { + if (!Array.isArray(object.labels)) + throw TypeError(".google.api.MetricDescriptor.labels: array expected"); + message.labels = []; + for (var i = 0; i < object.labels.length; ++i) { + if (typeof object.labels[i] !== "object") + throw TypeError(".google.api.MetricDescriptor.labels: object expected"); + message.labels[i] = $root.google.api.LabelDescriptor.fromObject(object.labels[i]); + } } - if (object.bucketOptions != null) { - if (typeof object.bucketOptions !== "object") - throw TypeError(".google.api.Distribution.bucketOptions: object expected"); - message.bucketOptions = $root.google.api.Distribution.BucketOptions.fromObject(object.bucketOptions); + switch (object.metricKind) { + case "METRIC_KIND_UNSPECIFIED": + case 0: + message.metricKind = 0; + break; + case "GAUGE": + case 1: + message.metricKind = 1; + break; + case "DELTA": + case 2: + message.metricKind = 2; + break; + case "CUMULATIVE": + case 3: + message.metricKind = 3; + break; } - if (object.bucketCounts) { - if (!Array.isArray(object.bucketCounts)) - throw TypeError(".google.api.Distribution.bucketCounts: array expected"); - message.bucketCounts = []; - for (var i = 0; i < object.bucketCounts.length; ++i) - if ($util.Long) - (message.bucketCounts[i] = $util.Long.fromValue(object.bucketCounts[i])).unsigned = false; - else if (typeof object.bucketCounts[i] === "string") - message.bucketCounts[i] = parseInt(object.bucketCounts[i], 10); - else if (typeof object.bucketCounts[i] === "number") - message.bucketCounts[i] = object.bucketCounts[i]; - else if (typeof object.bucketCounts[i] === "object") - message.bucketCounts[i] = new $util.LongBits(object.bucketCounts[i].low >>> 0, object.bucketCounts[i].high >>> 0).toNumber(); + switch (object.valueType) { + case "VALUE_TYPE_UNSPECIFIED": + case 0: + message.valueType = 0; + break; + case "BOOL": + case 1: + message.valueType = 1; + break; + case "INT64": + case 2: + message.valueType = 2; + break; + case "DOUBLE": + case 3: + message.valueType = 3; + break; + case "STRING": + case 4: + message.valueType = 4; + break; + case "DISTRIBUTION": + case 5: + message.valueType = 5; + break; + case "MONEY": + case 6: + message.valueType = 6; + break; } - if (object.exemplars) { - if (!Array.isArray(object.exemplars)) - throw TypeError(".google.api.Distribution.exemplars: array expected"); - message.exemplars = []; - for (var i = 0; i < object.exemplars.length; ++i) { - if (typeof object.exemplars[i] !== "object") - throw TypeError(".google.api.Distribution.exemplars: object expected"); - message.exemplars[i] = $root.google.api.Distribution.Exemplar.fromObject(object.exemplars[i]); - } + if (object.unit != null) + message.unit = String(object.unit); + if (object.description != null) + message.description = String(object.description); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.api.MetricDescriptor.metadata: object expected"); + message.metadata = $root.google.api.MetricDescriptor.MetricDescriptorMetadata.fromObject(object.metadata); + } + switch (object.launchStage) { + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.monitoredResourceTypes) { + if (!Array.isArray(object.monitoredResourceTypes)) + throw TypeError(".google.api.MetricDescriptor.monitoredResourceTypes: array expected"); + message.monitoredResourceTypes = []; + for (var i = 0; i < object.monitoredResourceTypes.length; ++i) + message.monitoredResourceTypes[i] = String(object.monitoredResourceTypes[i]); } return message; }; /** - * Creates a plain object from a Distribution message. Also converts values to other types if specified. + * Creates a plain object from a MetricDescriptor message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.Distribution + * @memberof google.api.MetricDescriptor * @static - * @param {google.api.Distribution} message Distribution + * @param {google.api.MetricDescriptor} message MetricDescriptor * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Distribution.toObject = function toObject(message, options) { + MetricDescriptor.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { - object.bucketCounts = []; - object.exemplars = []; + object.labels = []; + object.monitoredResourceTypes = []; } if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.count = options.longs === String ? "0" : 0; - object.mean = 0; - object.sumOfSquaredDeviation = 0; - object.range = null; - object.bucketOptions = null; + object.name = ""; + object.metricKind = options.enums === String ? "METRIC_KIND_UNSPECIFIED" : 0; + object.valueType = options.enums === String ? "VALUE_TYPE_UNSPECIFIED" : 0; + object.unit = ""; + object.description = ""; + object.displayName = ""; + object.type = ""; + object.metadata = null; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; } - if (message.count != null && message.hasOwnProperty("count")) - if (typeof message.count === "number") - object.count = options.longs === String ? String(message.count) : message.count; - else - object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; - if (message.mean != null && message.hasOwnProperty("mean")) - object.mean = options.json && !isFinite(message.mean) ? String(message.mean) : message.mean; - if (message.sumOfSquaredDeviation != null && message.hasOwnProperty("sumOfSquaredDeviation")) - object.sumOfSquaredDeviation = options.json && !isFinite(message.sumOfSquaredDeviation) ? String(message.sumOfSquaredDeviation) : message.sumOfSquaredDeviation; - if (message.range != null && message.hasOwnProperty("range")) - object.range = $root.google.api.Distribution.Range.toObject(message.range, options); - if (message.bucketOptions != null && message.hasOwnProperty("bucketOptions")) - object.bucketOptions = $root.google.api.Distribution.BucketOptions.toObject(message.bucketOptions, options); - if (message.bucketCounts && message.bucketCounts.length) { - object.bucketCounts = []; - for (var j = 0; j < message.bucketCounts.length; ++j) - if (typeof message.bucketCounts[j] === "number") - object.bucketCounts[j] = options.longs === String ? String(message.bucketCounts[j]) : message.bucketCounts[j]; - else - object.bucketCounts[j] = options.longs === String ? $util.Long.prototype.toString.call(message.bucketCounts[j]) : options.longs === Number ? new $util.LongBits(message.bucketCounts[j].low >>> 0, message.bucketCounts[j].high >>> 0).toNumber() : message.bucketCounts[j]; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.labels && message.labels.length) { + object.labels = []; + for (var j = 0; j < message.labels.length; ++j) + object.labels[j] = $root.google.api.LabelDescriptor.toObject(message.labels[j], options); } - if (message.exemplars && message.exemplars.length) { - object.exemplars = []; - for (var j = 0; j < message.exemplars.length; ++j) - object.exemplars[j] = $root.google.api.Distribution.Exemplar.toObject(message.exemplars[j], options); + if (message.metricKind != null && message.hasOwnProperty("metricKind")) + object.metricKind = options.enums === String ? $root.google.api.MetricDescriptor.MetricKind[message.metricKind] : message.metricKind; + if (message.valueType != null && message.hasOwnProperty("valueType")) + object.valueType = options.enums === String ? $root.google.api.MetricDescriptor.ValueType[message.valueType] : message.valueType; + if (message.unit != null && message.hasOwnProperty("unit")) + object.unit = message.unit; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.api.MetricDescriptor.MetricDescriptorMetadata.toObject(message.metadata, options); + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.monitoredResourceTypes && message.monitoredResourceTypes.length) { + object.monitoredResourceTypes = []; + for (var j = 0; j < message.monitoredResourceTypes.length; ++j) + object.monitoredResourceTypes[j] = message.monitoredResourceTypes[j]; } return object; }; /** - * Converts this Distribution to JSON. + * Converts this MetricDescriptor to JSON. * @function toJSON - * @memberof google.api.Distribution + * @memberof google.api.MetricDescriptor * @instance * @returns {Object.} JSON object */ - Distribution.prototype.toJSON = function toJSON() { + MetricDescriptor.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - Distribution.Range = (function() { + MetricDescriptor.MetricDescriptorMetadata = (function() { /** - * Properties of a Range. - * @memberof google.api.Distribution - * @interface IRange - * @property {number|null} [min] Range min - * @property {number|null} [max] Range max + * Properties of a MetricDescriptorMetadata. + * @memberof google.api.MetricDescriptor + * @interface IMetricDescriptorMetadata + * @property {google.api.LaunchStage|null} [launchStage] MetricDescriptorMetadata launchStage + * @property {google.protobuf.IDuration|null} [samplePeriod] MetricDescriptorMetadata samplePeriod + * @property {google.protobuf.IDuration|null} [ingestDelay] MetricDescriptorMetadata ingestDelay */ /** - * Constructs a new Range. - * @memberof google.api.Distribution - * @classdesc Represents a Range. - * @implements IRange + * Constructs a new MetricDescriptorMetadata. + * @memberof google.api.MetricDescriptor + * @classdesc Represents a MetricDescriptorMetadata. + * @implements IMetricDescriptorMetadata * @constructor - * @param {google.api.Distribution.IRange=} [properties] Properties to set + * @param {google.api.MetricDescriptor.IMetricDescriptorMetadata=} [properties] Properties to set */ - function Range(properties) { + function MetricDescriptorMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -29427,88 +33371,101 @@ } /** - * Range min. - * @member {number} min - * @memberof google.api.Distribution.Range + * MetricDescriptorMetadata launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata * @instance */ - Range.prototype.min = 0; + MetricDescriptorMetadata.prototype.launchStage = 0; /** - * Range max. - * @member {number} max - * @memberof google.api.Distribution.Range + * MetricDescriptorMetadata samplePeriod. + * @member {google.protobuf.IDuration|null|undefined} samplePeriod + * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata + * @instance + */ + MetricDescriptorMetadata.prototype.samplePeriod = null; + + /** + * MetricDescriptorMetadata ingestDelay. + * @member {google.protobuf.IDuration|null|undefined} ingestDelay + * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata * @instance */ - Range.prototype.max = 0; + MetricDescriptorMetadata.prototype.ingestDelay = null; /** - * Creates a new Range instance using the specified properties. + * Creates a new MetricDescriptorMetadata instance using the specified properties. * @function create - * @memberof google.api.Distribution.Range + * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata * @static - * @param {google.api.Distribution.IRange=} [properties] Properties to set - * @returns {google.api.Distribution.Range} Range instance + * @param {google.api.MetricDescriptor.IMetricDescriptorMetadata=} [properties] Properties to set + * @returns {google.api.MetricDescriptor.MetricDescriptorMetadata} MetricDescriptorMetadata instance */ - Range.create = function create(properties) { - return new Range(properties); + MetricDescriptorMetadata.create = function create(properties) { + return new MetricDescriptorMetadata(properties); }; /** - * Encodes the specified Range message. Does not implicitly {@link google.api.Distribution.Range.verify|verify} messages. + * Encodes the specified MetricDescriptorMetadata message. Does not implicitly {@link google.api.MetricDescriptor.MetricDescriptorMetadata.verify|verify} messages. * @function encode - * @memberof google.api.Distribution.Range + * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata * @static - * @param {google.api.Distribution.IRange} message Range message or plain object to encode + * @param {google.api.MetricDescriptor.IMetricDescriptorMetadata} message MetricDescriptorMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Range.encode = function encode(message, writer) { + MetricDescriptorMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.min != null && Object.hasOwnProperty.call(message, "min")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.min); - if (message.max != null && Object.hasOwnProperty.call(message, "max")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.max); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.launchStage); + if (message.samplePeriod != null && Object.hasOwnProperty.call(message, "samplePeriod")) + $root.google.protobuf.Duration.encode(message.samplePeriod, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.ingestDelay != null && Object.hasOwnProperty.call(message, "ingestDelay")) + $root.google.protobuf.Duration.encode(message.ingestDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified Range message, length delimited. Does not implicitly {@link google.api.Distribution.Range.verify|verify} messages. + * Encodes the specified MetricDescriptorMetadata message, length delimited. Does not implicitly {@link google.api.MetricDescriptor.MetricDescriptorMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.Distribution.Range + * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata * @static - * @param {google.api.Distribution.IRange} message Range message or plain object to encode + * @param {google.api.MetricDescriptor.IMetricDescriptorMetadata} message MetricDescriptorMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Range.encodeDelimited = function encodeDelimited(message, writer) { + MetricDescriptorMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Range message from the specified reader or buffer. + * Decodes a MetricDescriptorMetadata message from the specified reader or buffer. * @function decode - * @memberof google.api.Distribution.Range + * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.Distribution.Range} Range + * @returns {google.api.MetricDescriptor.MetricDescriptorMetadata} MetricDescriptorMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Range.decode = function decode(reader, length) { + MetricDescriptorMetadata.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.Distribution.Range(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MetricDescriptor.MetricDescriptorMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.min = reader.double(); + message.launchStage = reader.int32(); break; case 2: - message.max = reader.double(); + message.samplePeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 3: + message.ingestDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -29519,1344 +33476,1440 @@ }; /** - * Decodes a Range message from the specified reader or buffer, length delimited. + * Decodes a MetricDescriptorMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.Distribution.Range + * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Distribution.Range} Range + * @returns {google.api.MetricDescriptor.MetricDescriptorMetadata} MetricDescriptorMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Range.decodeDelimited = function decodeDelimited(reader) { + MetricDescriptorMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Range message. + * Verifies a MetricDescriptorMetadata message. * @function verify - * @memberof google.api.Distribution.Range + * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Range.verify = function verify(message) { + MetricDescriptorMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.min != null && message.hasOwnProperty("min")) - if (typeof message.min !== "number") - return "min: number expected"; - if (message.max != null && message.hasOwnProperty("max")) - if (typeof message.max !== "number") - return "max: number expected"; - return null; - }; - - /** - * Creates a Range message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Distribution.Range - * @static - * @param {Object.} object Plain object - * @returns {google.api.Distribution.Range} Range - */ - Range.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Distribution.Range) - return object; - var message = new $root.google.api.Distribution.Range(); - if (object.min != null) - message.min = Number(object.min); - if (object.max != null) - message.max = Number(object.max); - return message; - }; - - /** - * Creates a plain object from a Range message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Distribution.Range - * @static - * @param {google.api.Distribution.Range} message Range - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Range.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.min = 0; - object.max = 0; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.samplePeriod != null && message.hasOwnProperty("samplePeriod")) { + var error = $root.google.protobuf.Duration.verify(message.samplePeriod); + if (error) + return "samplePeriod." + error; } - if (message.min != null && message.hasOwnProperty("min")) - object.min = options.json && !isFinite(message.min) ? String(message.min) : message.min; - if (message.max != null && message.hasOwnProperty("max")) - object.max = options.json && !isFinite(message.max) ? String(message.max) : message.max; - return object; - }; - - /** - * Converts this Range to JSON. - * @function toJSON - * @memberof google.api.Distribution.Range - * @instance - * @returns {Object.} JSON object - */ - Range.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Range; - })(); - - Distribution.BucketOptions = (function() { - - /** - * Properties of a BucketOptions. - * @memberof google.api.Distribution - * @interface IBucketOptions - * @property {google.api.Distribution.BucketOptions.ILinear|null} [linearBuckets] BucketOptions linearBuckets - * @property {google.api.Distribution.BucketOptions.IExponential|null} [exponentialBuckets] BucketOptions exponentialBuckets - * @property {google.api.Distribution.BucketOptions.IExplicit|null} [explicitBuckets] BucketOptions explicitBuckets - */ - - /** - * Constructs a new BucketOptions. - * @memberof google.api.Distribution - * @classdesc Represents a BucketOptions. - * @implements IBucketOptions - * @constructor - * @param {google.api.Distribution.IBucketOptions=} [properties] Properties to set - */ - function BucketOptions(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]]; - } - - /** - * BucketOptions linearBuckets. - * @member {google.api.Distribution.BucketOptions.ILinear|null|undefined} linearBuckets - * @memberof google.api.Distribution.BucketOptions - * @instance - */ - BucketOptions.prototype.linearBuckets = null; - - /** - * BucketOptions exponentialBuckets. - * @member {google.api.Distribution.BucketOptions.IExponential|null|undefined} exponentialBuckets - * @memberof google.api.Distribution.BucketOptions - * @instance - */ - BucketOptions.prototype.exponentialBuckets = null; - - /** - * BucketOptions explicitBuckets. - * @member {google.api.Distribution.BucketOptions.IExplicit|null|undefined} explicitBuckets - * @memberof google.api.Distribution.BucketOptions - * @instance - */ - BucketOptions.prototype.explicitBuckets = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * BucketOptions options. - * @member {"linearBuckets"|"exponentialBuckets"|"explicitBuckets"|undefined} options - * @memberof google.api.Distribution.BucketOptions - * @instance - */ - Object.defineProperty(BucketOptions.prototype, "options", { - get: $util.oneOfGetter($oneOfFields = ["linearBuckets", "exponentialBuckets", "explicitBuckets"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new BucketOptions instance using the specified properties. - * @function create - * @memberof google.api.Distribution.BucketOptions - * @static - * @param {google.api.Distribution.IBucketOptions=} [properties] Properties to set - * @returns {google.api.Distribution.BucketOptions} BucketOptions instance - */ - BucketOptions.create = function create(properties) { - return new BucketOptions(properties); - }; - - /** - * Encodes the specified BucketOptions message. Does not implicitly {@link google.api.Distribution.BucketOptions.verify|verify} messages. - * @function encode - * @memberof google.api.Distribution.BucketOptions - * @static - * @param {google.api.Distribution.IBucketOptions} message BucketOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BucketOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.linearBuckets != null && Object.hasOwnProperty.call(message, "linearBuckets")) - $root.google.api.Distribution.BucketOptions.Linear.encode(message.linearBuckets, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.exponentialBuckets != null && Object.hasOwnProperty.call(message, "exponentialBuckets")) - $root.google.api.Distribution.BucketOptions.Exponential.encode(message.exponentialBuckets, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.explicitBuckets != null && Object.hasOwnProperty.call(message, "explicitBuckets")) - $root.google.api.Distribution.BucketOptions.Explicit.encode(message.explicitBuckets, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; + if (message.ingestDelay != null && message.hasOwnProperty("ingestDelay")) { + var error = $root.google.protobuf.Duration.verify(message.ingestDelay); + if (error) + return "ingestDelay." + error; + } + return null; }; /** - * Encodes the specified BucketOptions message, length delimited. Does not implicitly {@link google.api.Distribution.BucketOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Distribution.BucketOptions + * Creates a MetricDescriptorMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata * @static - * @param {google.api.Distribution.IBucketOptions} message BucketOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * @param {Object.} object Plain object + * @returns {google.api.MetricDescriptor.MetricDescriptorMetadata} MetricDescriptorMetadata */ - BucketOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + MetricDescriptorMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MetricDescriptor.MetricDescriptorMetadata) + return object; + var message = new $root.google.api.MetricDescriptor.MetricDescriptorMetadata(); + switch (object.launchStage) { + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.samplePeriod != null) { + if (typeof object.samplePeriod !== "object") + throw TypeError(".google.api.MetricDescriptor.MetricDescriptorMetadata.samplePeriod: object expected"); + message.samplePeriod = $root.google.protobuf.Duration.fromObject(object.samplePeriod); + } + if (object.ingestDelay != null) { + if (typeof object.ingestDelay !== "object") + throw TypeError(".google.api.MetricDescriptor.MetricDescriptorMetadata.ingestDelay: object expected"); + message.ingestDelay = $root.google.protobuf.Duration.fromObject(object.ingestDelay); + } + return message; }; /** - * Decodes a BucketOptions message from the specified reader or buffer. - * @function decode - * @memberof google.api.Distribution.BucketOptions + * Creates a plain object from a MetricDescriptorMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Distribution.BucketOptions} BucketOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * @param {google.api.MetricDescriptor.MetricDescriptorMetadata} message MetricDescriptorMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - BucketOptions.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.Distribution.BucketOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.linearBuckets = $root.google.api.Distribution.BucketOptions.Linear.decode(reader, reader.uint32()); - break; - case 2: - message.exponentialBuckets = $root.google.api.Distribution.BucketOptions.Exponential.decode(reader, reader.uint32()); - break; - case 3: - message.explicitBuckets = $root.google.api.Distribution.BucketOptions.Explicit.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } + MetricDescriptorMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.samplePeriod = null; + object.ingestDelay = null; } - return message; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.samplePeriod != null && message.hasOwnProperty("samplePeriod")) + object.samplePeriod = $root.google.protobuf.Duration.toObject(message.samplePeriod, options); + if (message.ingestDelay != null && message.hasOwnProperty("ingestDelay")) + object.ingestDelay = $root.google.protobuf.Duration.toObject(message.ingestDelay, options); + return object; }; /** - * Decodes a BucketOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Distribution.BucketOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Distribution.BucketOptions} BucketOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Converts this MetricDescriptorMetadata to JSON. + * @function toJSON + * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata + * @instance + * @returns {Object.} JSON object */ - BucketOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); + MetricDescriptorMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * Verifies a BucketOptions message. - * @function verify - * @memberof google.api.Distribution.BucketOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BucketOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.linearBuckets != null && message.hasOwnProperty("linearBuckets")) { - properties.options = 1; - { - var error = $root.google.api.Distribution.BucketOptions.Linear.verify(message.linearBuckets); - if (error) - return "linearBuckets." + error; - } - } - if (message.exponentialBuckets != null && message.hasOwnProperty("exponentialBuckets")) { - if (properties.options === 1) - return "options: multiple values"; - properties.options = 1; - { - var error = $root.google.api.Distribution.BucketOptions.Exponential.verify(message.exponentialBuckets); - if (error) - return "exponentialBuckets." + error; - } - } - if (message.explicitBuckets != null && message.hasOwnProperty("explicitBuckets")) { - if (properties.options === 1) - return "options: multiple values"; - properties.options = 1; - { - var error = $root.google.api.Distribution.BucketOptions.Explicit.verify(message.explicitBuckets); - if (error) - return "explicitBuckets." + error; + return MetricDescriptorMetadata; + })(); + + /** + * MetricKind enum. + * @name google.api.MetricDescriptor.MetricKind + * @enum {number} + * @property {number} METRIC_KIND_UNSPECIFIED=0 METRIC_KIND_UNSPECIFIED value + * @property {number} GAUGE=1 GAUGE value + * @property {number} DELTA=2 DELTA value + * @property {number} CUMULATIVE=3 CUMULATIVE value + */ + MetricDescriptor.MetricKind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "METRIC_KIND_UNSPECIFIED"] = 0; + values[valuesById[1] = "GAUGE"] = 1; + values[valuesById[2] = "DELTA"] = 2; + values[valuesById[3] = "CUMULATIVE"] = 3; + return values; + })(); + + /** + * ValueType enum. + * @name google.api.MetricDescriptor.ValueType + * @enum {number} + * @property {number} VALUE_TYPE_UNSPECIFIED=0 VALUE_TYPE_UNSPECIFIED value + * @property {number} BOOL=1 BOOL value + * @property {number} INT64=2 INT64 value + * @property {number} DOUBLE=3 DOUBLE value + * @property {number} STRING=4 STRING value + * @property {number} DISTRIBUTION=5 DISTRIBUTION value + * @property {number} MONEY=6 MONEY value + */ + MetricDescriptor.ValueType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VALUE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BOOL"] = 1; + values[valuesById[2] = "INT64"] = 2; + values[valuesById[3] = "DOUBLE"] = 3; + values[valuesById[4] = "STRING"] = 4; + values[valuesById[5] = "DISTRIBUTION"] = 5; + values[valuesById[6] = "MONEY"] = 6; + return values; + })(); + + return MetricDescriptor; + })(); + + api.Metric = (function() { + + /** + * Properties of a Metric. + * @memberof google.api + * @interface IMetric + * @property {string|null} [type] Metric type + * @property {Object.|null} [labels] Metric labels + */ + + /** + * Constructs a new Metric. + * @memberof google.api + * @classdesc Represents a Metric. + * @implements IMetric + * @constructor + * @param {google.api.IMetric=} [properties] Properties to set + */ + function Metric(properties) { + this.labels = {}; + 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]]; + } + + /** + * Metric type. + * @member {string} type + * @memberof google.api.Metric + * @instance + */ + Metric.prototype.type = ""; + + /** + * Metric labels. + * @member {Object.} labels + * @memberof google.api.Metric + * @instance + */ + Metric.prototype.labels = $util.emptyObject; + + /** + * Creates a new Metric instance using the specified properties. + * @function create + * @memberof google.api.Metric + * @static + * @param {google.api.IMetric=} [properties] Properties to set + * @returns {google.api.Metric} Metric instance + */ + Metric.create = function create(properties) { + return new Metric(properties); + }; + + /** + * Encodes the specified Metric message. Does not implicitly {@link google.api.Metric.verify|verify} messages. + * @function encode + * @memberof google.api.Metric + * @static + * @param {google.api.IMetric} message Metric message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metric.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), 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.labels[keys[i]]).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + return writer; + }; + + /** + * Encodes the specified Metric message, length delimited. Does not implicitly {@link google.api.Metric.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Metric + * @static + * @param {google.api.IMetric} message Metric message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metric.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Metric message from the specified reader or buffer. + * @function decode + * @memberof google.api.Metric + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Metric} Metric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metric.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.Metric(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.type = reader.string(); + break; + case 2: + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.labels[key] = value; + break; + default: + reader.skipType(tag & 7); + break; } - return null; - }; + } + return message; + }; - /** - * Creates a BucketOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Distribution.BucketOptions - * @static - * @param {Object.} object Plain object - * @returns {google.api.Distribution.BucketOptions} BucketOptions - */ - BucketOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Distribution.BucketOptions) - return object; - var message = new $root.google.api.Distribution.BucketOptions(); - if (object.linearBuckets != null) { - if (typeof object.linearBuckets !== "object") - throw TypeError(".google.api.Distribution.BucketOptions.linearBuckets: object expected"); - message.linearBuckets = $root.google.api.Distribution.BucketOptions.Linear.fromObject(object.linearBuckets); - } - if (object.exponentialBuckets != null) { - if (typeof object.exponentialBuckets !== "object") - throw TypeError(".google.api.Distribution.BucketOptions.exponentialBuckets: object expected"); - message.exponentialBuckets = $root.google.api.Distribution.BucketOptions.Exponential.fromObject(object.exponentialBuckets); - } - if (object.explicitBuckets != null) { - if (typeof object.explicitBuckets !== "object") - throw TypeError(".google.api.Distribution.BucketOptions.explicitBuckets: object expected"); - message.explicitBuckets = $root.google.api.Distribution.BucketOptions.Explicit.fromObject(object.explicitBuckets); - } - return message; - }; + /** + * Decodes a Metric message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Metric + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Metric} Metric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metric.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a plain object from a BucketOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Distribution.BucketOptions - * @static - * @param {google.api.Distribution.BucketOptions} message BucketOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BucketOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.linearBuckets != null && message.hasOwnProperty("linearBuckets")) { - object.linearBuckets = $root.google.api.Distribution.BucketOptions.Linear.toObject(message.linearBuckets, options); - if (options.oneofs) - object.options = "linearBuckets"; - } - if (message.exponentialBuckets != null && message.hasOwnProperty("exponentialBuckets")) { - object.exponentialBuckets = $root.google.api.Distribution.BucketOptions.Exponential.toObject(message.exponentialBuckets, options); - if (options.oneofs) - object.options = "exponentialBuckets"; - } - if (message.explicitBuckets != null && message.hasOwnProperty("explicitBuckets")) { - object.explicitBuckets = $root.google.api.Distribution.BucketOptions.Explicit.toObject(message.explicitBuckets, options); - if (options.oneofs) - object.options = "explicitBuckets"; - } - return object; - }; + /** + * Verifies a Metric message. + * @function verify + * @memberof google.api.Metric + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metric.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.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; - /** - * Converts this BucketOptions to JSON. - * @function toJSON - * @memberof google.api.Distribution.BucketOptions - * @instance - * @returns {Object.} JSON object - */ - BucketOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a Metric message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Metric + * @static + * @param {Object.} object Plain object + * @returns {google.api.Metric} Metric + */ + Metric.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Metric) + return object; + var message = new $root.google.api.Metric(); + if (object.type != null) + message.type = String(object.type); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.api.Metric.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; - BucketOptions.Linear = (function() { + /** + * Creates a plain object from a Metric message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Metric + * @static + * @param {google.api.Metric} message Metric + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Metric.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) + object.type = ""; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + return object; + }; - /** - * Properties of a Linear. - * @memberof google.api.Distribution.BucketOptions - * @interface ILinear - * @property {number|null} [numFiniteBuckets] Linear numFiniteBuckets - * @property {number|null} [width] Linear width - * @property {number|null} [offset] Linear offset - */ + /** + * Converts this Metric to JSON. + * @function toJSON + * @memberof google.api.Metric + * @instance + * @returns {Object.} JSON object + */ + Metric.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Constructs a new Linear. - * @memberof google.api.Distribution.BucketOptions - * @classdesc Represents a Linear. - * @implements ILinear - * @constructor - * @param {google.api.Distribution.BucketOptions.ILinear=} [properties] Properties to set - */ - function Linear(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]]; - } + return Metric; + })(); - /** - * Linear numFiniteBuckets. - * @member {number} numFiniteBuckets - * @memberof google.api.Distribution.BucketOptions.Linear - * @instance - */ - Linear.prototype.numFiniteBuckets = 0; + return api; + })(); - /** - * Linear width. - * @member {number} width - * @memberof google.api.Distribution.BucketOptions.Linear - * @instance - */ - Linear.prototype.width = 0; + google.longrunning = (function() { - /** - * Linear offset. - * @member {number} offset - * @memberof google.api.Distribution.BucketOptions.Linear - * @instance - */ - Linear.prototype.offset = 0; + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; - /** - * Creates a new Linear instance using the specified properties. - * @function create - * @memberof google.api.Distribution.BucketOptions.Linear - * @static - * @param {google.api.Distribution.BucketOptions.ILinear=} [properties] Properties to set - * @returns {google.api.Distribution.BucketOptions.Linear} Linear instance - */ - Linear.create = function create(properties) { - return new Linear(properties); - }; + longrunning.Operations = (function() { - /** - * Encodes the specified Linear message. Does not implicitly {@link google.api.Distribution.BucketOptions.Linear.verify|verify} messages. - * @function encode - * @memberof google.api.Distribution.BucketOptions.Linear - * @static - * @param {google.api.Distribution.BucketOptions.ILinear} message Linear message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Linear.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.numFiniteBuckets != null && Object.hasOwnProperty.call(message, "numFiniteBuckets")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.numFiniteBuckets); - if (message.width != null && Object.hasOwnProperty.call(message, "width")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.width); - if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.offset); - return writer; - }; + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } - /** - * Encodes the specified Linear message, length delimited. Does not implicitly {@link google.api.Distribution.BucketOptions.Linear.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Distribution.BucketOptions.Linear - * @static - * @param {google.api.Distribution.BucketOptions.ILinear} message Linear message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Linear.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; - /** - * Decodes a Linear message from the specified reader or buffer. - * @function decode - * @memberof google.api.Distribution.BucketOptions.Linear - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Distribution.BucketOptions.Linear} Linear - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Linear.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.Distribution.BucketOptions.Linear(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.numFiniteBuckets = reader.int32(); - break; - case 2: - message.width = reader.double(); - break; - case 3: - message.offset = reader.double(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; - /** - * Decodes a Linear message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Distribution.BucketOptions.Linear - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Distribution.BucketOptions.Linear} Linear - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Linear.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Callback as used by {@link google.longrunning.Operations#listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ - /** - * Verifies a Linear message. - * @function verify - * @memberof google.api.Distribution.BucketOptions.Linear - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Linear.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.numFiniteBuckets != null && message.hasOwnProperty("numFiniteBuckets")) - if (!$util.isInteger(message.numFiniteBuckets)) - return "numFiniteBuckets: integer expected"; - if (message.width != null && message.hasOwnProperty("width")) - if (typeof message.width !== "number") - return "width: number expected"; - if (message.offset != null && message.hasOwnProperty("offset")) - if (typeof message.offset !== "number") - return "offset: number expected"; - return null; - }; + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); - /** - * Creates a Linear message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Distribution.BucketOptions.Linear - * @static - * @param {Object.} object Plain object - * @returns {google.api.Distribution.BucketOptions.Linear} Linear - */ - Linear.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Distribution.BucketOptions.Linear) - return object; - var message = new $root.google.api.Distribution.BucketOptions.Linear(); - if (object.numFiniteBuckets != null) - message.numFiniteBuckets = object.numFiniteBuckets | 0; - if (object.width != null) - message.width = Number(object.width); - if (object.offset != null) - message.offset = Number(object.offset); - return message; - }; + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Creates a plain object from a Linear message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Distribution.BucketOptions.Linear - * @static - * @param {google.api.Distribution.BucketOptions.Linear} message Linear - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Linear.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.numFiniteBuckets = 0; - object.width = 0; - object.offset = 0; - } - if (message.numFiniteBuckets != null && message.hasOwnProperty("numFiniteBuckets")) - object.numFiniteBuckets = message.numFiniteBuckets; - if (message.width != null && message.hasOwnProperty("width")) - object.width = options.json && !isFinite(message.width) ? String(message.width) : message.width; - if (message.offset != null && message.hasOwnProperty("offset")) - object.offset = options.json && !isFinite(message.offset) ? String(message.offset) : message.offset; - return object; - }; + /** + * Callback as used by {@link google.longrunning.Operations#getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - /** - * Converts this Linear to JSON. - * @function toJSON - * @memberof google.api.Distribution.BucketOptions.Linear - * @instance - * @returns {Object.} JSON object - */ - Linear.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); - return Linear; - })(); + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - BucketOptions.Exponential = (function() { + /** + * Callback as used by {@link google.longrunning.Operations#deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ - /** - * Properties of an Exponential. - * @memberof google.api.Distribution.BucketOptions - * @interface IExponential - * @property {number|null} [numFiniteBuckets] Exponential numFiniteBuckets - * @property {number|null} [growthFactor] Exponential growthFactor - * @property {number|null} [scale] Exponential scale - */ + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); - /** - * Constructs a new Exponential. - * @memberof google.api.Distribution.BucketOptions - * @classdesc Represents an Exponential. - * @implements IExponential - * @constructor - * @param {google.api.Distribution.BucketOptions.IExponential=} [properties] Properties to set - */ - function Exponential(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]]; - } + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Exponential numFiniteBuckets. - * @member {number} numFiniteBuckets - * @memberof google.api.Distribution.BucketOptions.Exponential - * @instance - */ - Exponential.prototype.numFiniteBuckets = 0; + /** + * Callback as used by {@link google.longrunning.Operations#cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ - /** - * Exponential growthFactor. - * @member {number} growthFactor - * @memberof google.api.Distribution.BucketOptions.Exponential - * @instance - */ - Exponential.prototype.growthFactor = 0; + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); - /** - * Exponential scale. - * @member {number} scale - * @memberof google.api.Distribution.BucketOptions.Exponential - * @instance - */ - Exponential.prototype.scale = 0; + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Creates a new Exponential instance using the specified properties. - * @function create - * @memberof google.api.Distribution.BucketOptions.Exponential - * @static - * @param {google.api.Distribution.BucketOptions.IExponential=} [properties] Properties to set - * @returns {google.api.Distribution.BucketOptions.Exponential} Exponential instance - */ - Exponential.create = function create(properties) { - return new Exponential(properties); - }; + /** + * Callback as used by {@link google.longrunning.Operations#waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - /** - * Encodes the specified Exponential message. Does not implicitly {@link google.api.Distribution.BucketOptions.Exponential.verify|verify} messages. - * @function encode - * @memberof google.api.Distribution.BucketOptions.Exponential - * @static - * @param {google.api.Distribution.BucketOptions.IExponential} message Exponential message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Exponential.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.numFiniteBuckets != null && Object.hasOwnProperty.call(message, "numFiniteBuckets")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.numFiniteBuckets); - if (message.growthFactor != null && Object.hasOwnProperty.call(message, "growthFactor")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.growthFactor); - if (message.scale != null && Object.hasOwnProperty.call(message, "scale")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.scale); - return writer; - }; + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); - /** - * Encodes the specified Exponential message, length delimited. Does not implicitly {@link google.api.Distribution.BucketOptions.Exponential.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Distribution.BucketOptions.Exponential - * @static - * @param {google.api.Distribution.BucketOptions.IExponential} message Exponential message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Exponential.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Decodes an Exponential message from the specified reader or buffer. - * @function decode - * @memberof google.api.Distribution.BucketOptions.Exponential - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Distribution.BucketOptions.Exponential} Exponential - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Exponential.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.Distribution.BucketOptions.Exponential(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.numFiniteBuckets = reader.int32(); - break; - case 2: - message.growthFactor = reader.double(); - break; - case 3: - message.scale = reader.double(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return Operations; + })(); - /** - * Decodes an Exponential message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Distribution.BucketOptions.Exponential - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Distribution.BucketOptions.Exponential} Exponential - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Exponential.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + longrunning.Operation = (function() { - /** - * Verifies an Exponential message. - * @function verify - * @memberof google.api.Distribution.BucketOptions.Exponential - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Exponential.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.numFiniteBuckets != null && message.hasOwnProperty("numFiniteBuckets")) - if (!$util.isInteger(message.numFiniteBuckets)) - return "numFiniteBuckets: integer expected"; - if (message.growthFactor != null && message.hasOwnProperty("growthFactor")) - if (typeof message.growthFactor !== "number") - return "growthFactor: number expected"; - if (message.scale != null && message.hasOwnProperty("scale")) - if (typeof message.scale !== "number") - return "scale: number expected"; - return null; - }; + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ - /** - * Creates an Exponential message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Distribution.BucketOptions.Exponential - * @static - * @param {Object.} object Plain object - * @returns {google.api.Distribution.BucketOptions.Exponential} Exponential - */ - Exponential.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Distribution.BucketOptions.Exponential) - return object; - var message = new $root.google.api.Distribution.BucketOptions.Exponential(); - if (object.numFiniteBuckets != null) - message.numFiniteBuckets = object.numFiniteBuckets | 0; - if (object.growthFactor != null) - message.growthFactor = Number(object.growthFactor); - if (object.scale != null) - message.scale = Number(object.scale); - return message; - }; + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(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]]; + } - /** - * Creates a plain object from an Exponential message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Distribution.BucketOptions.Exponential - * @static - * @param {google.api.Distribution.BucketOptions.Exponential} message Exponential - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Exponential.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.numFiniteBuckets = 0; - object.growthFactor = 0; - object.scale = 0; - } - if (message.numFiniteBuckets != null && message.hasOwnProperty("numFiniteBuckets")) - object.numFiniteBuckets = message.numFiniteBuckets; - if (message.growthFactor != null && message.hasOwnProperty("growthFactor")) - object.growthFactor = options.json && !isFinite(message.growthFactor) ? String(message.growthFactor) : message.growthFactor; - if (message.scale != null && message.hasOwnProperty("scale")) - object.scale = options.json && !isFinite(message.scale) ? String(message.scale) : message.scale; - return object; - }; + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; - /** - * Converts this Exponential to JSON. - * @function toJSON - * @memberof google.api.Distribution.BucketOptions.Exponential - * @instance - * @returns {Object.} JSON object - */ - Exponential.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; - return Exponential; - })(); + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; - BucketOptions.Explicit = (function() { + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Properties of an Explicit. - * @memberof google.api.Distribution.BucketOptions - * @interface IExplicit - * @property {Array.|null} [bounds] Explicit bounds - */ + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Constructs a new Explicit. - * @memberof google.api.Distribution.BucketOptions - * @classdesc Represents an Explicit. - * @implements IExplicit - * @constructor - * @param {google.api.Distribution.BucketOptions.IExplicit=} [properties] Properties to set - */ - function Explicit(properties) { - this.bounds = []; - 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]]; - } + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; - /** - * Explicit bounds. - * @member {Array.} bounds - * @memberof google.api.Distribution.BucketOptions.Explicit - * @instance - */ - Explicit.prototype.bounds = $util.emptyArray; + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; - /** - * Creates a new Explicit instance using the specified properties. - * @function create - * @memberof google.api.Distribution.BucketOptions.Explicit - * @static - * @param {google.api.Distribution.BucketOptions.IExplicit=} [properties] Properties to set - * @returns {google.api.Distribution.BucketOptions.Explicit} Explicit instance - */ - Explicit.create = function create(properties) { - return new Explicit(properties); - }; + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified Explicit message. Does not implicitly {@link google.api.Distribution.BucketOptions.Explicit.verify|verify} messages. - * @function encode - * @memberof google.api.Distribution.BucketOptions.Explicit - * @static - * @param {google.api.Distribution.BucketOptions.IExplicit} message Explicit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Explicit.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bounds != null && message.bounds.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.bounds.length; ++i) - writer.double(message.bounds[i]); - writer.ldelim(); - } - return writer; - }; + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.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.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 3: + message.done = reader.bool(); + break; + case 4: + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + case 5: + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified Explicit message, length delimited. Does not implicitly {@link google.api.Distribution.BucketOptions.Explicit.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Distribution.BucketOptions.Explicit - * @static - * @param {google.api.Distribution.BucketOptions.IExplicit} message Explicit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Explicit.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes an Explicit message from the specified reader or buffer. - * @function decode - * @memberof google.api.Distribution.BucketOptions.Explicit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Distribution.BucketOptions.Explicit} Explicit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Explicit.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.Distribution.BucketOptions.Explicit(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.bounds && message.bounds.length)) - message.bounds = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.bounds.push(reader.double()); - } else - message.bounds.push(reader.double()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; - /** - * Decodes an Explicit message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Distribution.BucketOptions.Explicit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Distribution.BucketOptions.Explicit} Explicit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Explicit.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Verifies an Explicit message. - * @function verify - * @memberof google.api.Distribution.BucketOptions.Explicit - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Explicit.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.bounds != null && message.hasOwnProperty("bounds")) { - if (!Array.isArray(message.bounds)) - return "bounds: array expected"; - for (var i = 0; i < message.bounds.length; ++i) - if (typeof message.bounds[i] !== "number") - return "bounds: number[] expected"; - } - return null; - }; + return Operation; + })(); - /** - * Creates an Explicit message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Distribution.BucketOptions.Explicit - * @static - * @param {Object.} object Plain object - * @returns {google.api.Distribution.BucketOptions.Explicit} Explicit - */ - Explicit.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Distribution.BucketOptions.Explicit) - return object; - var message = new $root.google.api.Distribution.BucketOptions.Explicit(); - if (object.bounds) { - if (!Array.isArray(object.bounds)) - throw TypeError(".google.api.Distribution.BucketOptions.Explicit.bounds: array expected"); - message.bounds = []; - for (var i = 0; i < object.bounds.length; ++i) - message.bounds[i] = Number(object.bounds[i]); - } - return message; - }; + longrunning.GetOperationRequest = (function() { - /** - * Creates a plain object from an Explicit message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Distribution.BucketOptions.Explicit - * @static - * @param {google.api.Distribution.BucketOptions.Explicit} message Explicit - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Explicit.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.bounds = []; - if (message.bounds && message.bounds.length) { - object.bounds = []; - for (var j = 0; j < message.bounds.length; ++j) - object.bounds[j] = options.json && !isFinite(message.bounds[j]) ? String(message.bounds[j]) : message.bounds[j]; - } - return object; - }; + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ - /** - * Converts this Explicit to JSON. - * @function toJSON - * @memberof google.api.Distribution.BucketOptions.Explicit - * @instance - * @returns {Object.} JSON object - */ - Explicit.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(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]]; + } - return Explicit; - })(); + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; - return BucketOptions; - })(); + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; - Distribution.Exemplar = (function() { + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; - /** - * Properties of an Exemplar. - * @memberof google.api.Distribution - * @interface IExemplar - * @property {number|null} [value] Exemplar value - * @property {google.protobuf.ITimestamp|null} [timestamp] Exemplar timestamp - * @property {Array.|null} [attachments] Exemplar attachments - */ + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new Exemplar. - * @memberof google.api.Distribution - * @classdesc Represents an Exemplar. - * @implements IExemplar - * @constructor - * @param {google.api.Distribution.IExemplar=} [properties] Properties to set - */ - function Exemplar(properties) { - this.attachments = []; - 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]]; + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.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.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetOperationRequest; + })(); - /** - * Exemplar value. - * @member {number} value - * @memberof google.api.Distribution.Exemplar - * @instance - */ - Exemplar.prototype.value = 0; + longrunning.ListOperationsRequest = (function() { - /** - * Exemplar timestamp. - * @member {google.protobuf.ITimestamp|null|undefined} timestamp - * @memberof google.api.Distribution.Exemplar - * @instance - */ - Exemplar.prototype.timestamp = null; + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ - /** - * Exemplar attachments. - * @member {Array.} attachments - * @memberof google.api.Distribution.Exemplar - * @instance - */ - Exemplar.prototype.attachments = $util.emptyArray; + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(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]]; + } - /** - * Creates a new Exemplar instance using the specified properties. - * @function create - * @memberof google.api.Distribution.Exemplar - * @static - * @param {google.api.Distribution.IExemplar=} [properties] Properties to set - * @returns {google.api.Distribution.Exemplar} Exemplar instance - */ - Exemplar.create = function create(properties) { - return new Exemplar(properties); - }; + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; - /** - * Encodes the specified Exemplar message. Does not implicitly {@link google.api.Distribution.Exemplar.verify|verify} messages. - * @function encode - * @memberof google.api.Distribution.Exemplar - * @static - * @param {google.api.Distribution.IExemplar} message Exemplar message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Exemplar.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.attachments != null && message.attachments.length) - for (var i = 0; i < message.attachments.length; ++i) - $root.google.protobuf.Any.encode(message.attachments[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; - /** - * Encodes the specified Exemplar message, length delimited. Does not implicitly {@link google.api.Distribution.Exemplar.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Distribution.Exemplar - * @static - * @param {google.api.Distribution.IExemplar} message Exemplar message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Exemplar.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; - /** - * Decodes an Exemplar message from the specified reader or buffer. - * @function decode - * @memberof google.api.Distribution.Exemplar - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Distribution.Exemplar} Exemplar - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Exemplar.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.Distribution.Exemplar(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.double(); - break; - case 2: - message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - if (!(message.attachments && message.attachments.length)) - message.attachments = []; - message.attachments.push($root.google.protobuf.Any.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; - /** - * Decodes an Exemplar message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Distribution.Exemplar - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Distribution.Exemplar} Exemplar - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Exemplar.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; - /** - * Verifies an Exemplar message. - * @function verify - * @memberof google.api.Distribution.Exemplar - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Exemplar.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) { - var error = $root.google.protobuf.Timestamp.verify(message.timestamp); - if (error) - return "timestamp." + error; - } - if (message.attachments != null && message.hasOwnProperty("attachments")) { - if (!Array.isArray(message.attachments)) - return "attachments: array expected"; - for (var i = 0; i < message.attachments.length; ++i) { - var error = $root.google.protobuf.Any.verify(message.attachments[i]); - if (error) - return "attachments." + error; - } - } - return null; - }; + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; - /** - * Creates an Exemplar message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Distribution.Exemplar - * @static - * @param {Object.} object Plain object - * @returns {google.api.Distribution.Exemplar} Exemplar - */ - Exemplar.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Distribution.Exemplar) - return object; - var message = new $root.google.api.Distribution.Exemplar(); - if (object.value != null) - message.value = Number(object.value); - if (object.timestamp != null) { - if (typeof object.timestamp !== "object") - throw TypeError(".google.api.Distribution.Exemplar.timestamp: object expected"); - message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); - } - if (object.attachments) { - if (!Array.isArray(object.attachments)) - throw TypeError(".google.api.Distribution.Exemplar.attachments: array expected"); - message.attachments = []; - for (var i = 0; i < object.attachments.length; ++i) { - if (typeof object.attachments[i] !== "object") - throw TypeError(".google.api.Distribution.Exemplar.attachments: object expected"); - message.attachments[i] = $root.google.protobuf.Any.fromObject(object.attachments[i]); - } - } - return message; - }; + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a plain object from an Exemplar message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Distribution.Exemplar - * @static - * @param {google.api.Distribution.Exemplar} message Exemplar - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Exemplar.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.attachments = []; - if (options.defaults) { - object.value = 0; - object.timestamp = null; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); - if (message.attachments && message.attachments.length) { - object.attachments = []; - for (var j = 0; j < message.attachments.length; ++j) - object.attachments[j] = $root.google.protobuf.Any.toObject(message.attachments[j], options); + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.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.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.name = reader.string(); + break; + case 1: + message.filter = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) return object; - }; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; - /** - * Converts this Exemplar to JSON. - * @function toJSON - * @memberof google.api.Distribution.Exemplar - * @instance - * @returns {Object.} JSON object - */ - Exemplar.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; - return Exemplar; - })(); + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return Distribution; + return ListOperationsRequest; })(); - api.MetricDescriptor = (function() { + longrunning.ListOperationsResponse = (function() { /** - * Properties of a MetricDescriptor. - * @memberof google.api - * @interface IMetricDescriptor - * @property {string|null} [name] MetricDescriptor name - * @property {string|null} [type] MetricDescriptor type - * @property {Array.|null} [labels] MetricDescriptor labels - * @property {google.api.MetricDescriptor.MetricKind|null} [metricKind] MetricDescriptor metricKind - * @property {google.api.MetricDescriptor.ValueType|null} [valueType] MetricDescriptor valueType - * @property {string|null} [unit] MetricDescriptor unit - * @property {string|null} [description] MetricDescriptor description - * @property {string|null} [displayName] MetricDescriptor displayName - * @property {google.api.MetricDescriptor.IMetricDescriptorMetadata|null} [metadata] MetricDescriptor metadata - * @property {google.api.LaunchStage|null} [launchStage] MetricDescriptor launchStage - * @property {Array.|null} [monitoredResourceTypes] MetricDescriptor monitoredResourceTypes + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken */ /** - * Constructs a new MetricDescriptor. - * @memberof google.api - * @classdesc Represents a MetricDescriptor. - * @implements IMetricDescriptor + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse * @constructor - * @param {google.api.IMetricDescriptor=} [properties] Properties to set + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set */ - function MetricDescriptor(properties) { - this.labels = []; - this.monitoredResourceTypes = []; + function ListOperationsResponse(properties) { + this.operations = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -30864,212 +34917,305 @@ } /** - * MetricDescriptor name. - * @member {string} name - * @memberof google.api.MetricDescriptor + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse * @instance */ - MetricDescriptor.prototype.name = ""; + ListOperationsResponse.prototype.operations = $util.emptyArray; /** - * MetricDescriptor type. - * @member {string} type - * @memberof google.api.MetricDescriptor + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse * @instance */ - MetricDescriptor.prototype.type = ""; + ListOperationsResponse.prototype.nextPageToken = ""; /** - * MetricDescriptor labels. - * @member {Array.} labels - * @memberof google.api.MetricDescriptor - * @instance + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance */ - MetricDescriptor.prototype.labels = $util.emptyArray; + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; /** - * MetricDescriptor metricKind. - * @member {google.api.MetricDescriptor.MetricKind} metricKind - * @memberof google.api.MetricDescriptor - * @instance + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - MetricDescriptor.prototype.metricKind = 0; + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; /** - * MetricDescriptor valueType. - * @member {google.api.MetricDescriptor.ValueType} valueType - * @memberof google.api.MetricDescriptor - * @instance + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - MetricDescriptor.prototype.valueType = 0; + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * MetricDescriptor unit. - * @member {string} unit - * @memberof google.api.MetricDescriptor - * @instance + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MetricDescriptor.prototype.unit = ""; + ListOperationsResponse.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.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * MetricDescriptor description. - * @member {string} description - * @memberof google.api.MetricDescriptor - * @instance + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MetricDescriptor.prototype.description = ""; + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * MetricDescriptor displayName. - * @member {string} displayName - * @memberof google.api.MetricDescriptor - * @instance + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MetricDescriptor.prototype.displayName = ""; + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; /** - * MetricDescriptor metadata. - * @member {google.api.MetricDescriptor.IMetricDescriptorMetadata|null|undefined} metadata - * @memberof google.api.MetricDescriptor - * @instance + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse */ - MetricDescriptor.prototype.metadata = null; + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; /** - * MetricDescriptor launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.api.MetricDescriptor + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set */ - MetricDescriptor.prototype.launchStage = 0; + function CancelOperationRequest(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]]; + } /** - * MetricDescriptor monitoredResourceTypes. - * @member {Array.} monitoredResourceTypes - * @memberof google.api.MetricDescriptor + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest * @instance */ - MetricDescriptor.prototype.monitoredResourceTypes = $util.emptyArray; + CancelOperationRequest.prototype.name = ""; /** - * Creates a new MetricDescriptor instance using the specified properties. + * Creates a new CancelOperationRequest instance using the specified properties. * @function create - * @memberof google.api.MetricDescriptor + * @memberof google.longrunning.CancelOperationRequest * @static - * @param {google.api.IMetricDescriptor=} [properties] Properties to set - * @returns {google.api.MetricDescriptor} MetricDescriptor instance + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance */ - MetricDescriptor.create = function create(properties) { - return new MetricDescriptor(properties); + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); }; /** - * Encodes the specified MetricDescriptor message. Does not implicitly {@link google.api.MetricDescriptor.verify|verify} messages. + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. * @function encode - * @memberof google.api.MetricDescriptor + * @memberof google.longrunning.CancelOperationRequest * @static - * @param {google.api.IMetricDescriptor} message MetricDescriptor message or plain object to encode + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MetricDescriptor.encode = function encode(message, writer) { + CancelOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.labels != null && message.labels.length) - for (var i = 0; i < message.labels.length; ++i) - $root.google.api.LabelDescriptor.encode(message.labels[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metricKind != null && Object.hasOwnProperty.call(message, "metricKind")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.metricKind); - if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.valueType); - if (message.unit != null && Object.hasOwnProperty.call(message, "unit")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.unit); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.displayName); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.type); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.api.MetricDescriptor.MetricDescriptorMetadata.encode(message.metadata, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 12, wireType 0 =*/96).int32(message.launchStage); - if (message.monitoredResourceTypes != null && message.monitoredResourceTypes.length) - for (var i = 0; i < message.monitoredResourceTypes.length; ++i) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.monitoredResourceTypes[i]); return writer; }; /** - * Encodes the specified MetricDescriptor message, length delimited. Does not implicitly {@link google.api.MetricDescriptor.verify|verify} messages. + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.MetricDescriptor + * @memberof google.longrunning.CancelOperationRequest * @static - * @param {google.api.IMetricDescriptor} message MetricDescriptor message or plain object to encode + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MetricDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MetricDescriptor message from the specified reader or buffer. + * Decodes a CancelOperationRequest message from the specified reader or buffer. * @function decode - * @memberof google.api.MetricDescriptor + * @memberof google.longrunning.CancelOperationRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.MetricDescriptor} MetricDescriptor + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MetricDescriptor.decode = function decode(reader, length) { + CancelOperationRequest.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.MetricDescriptor(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; - case 8: - message.type = reader.string(); - break; - case 2: - if (!(message.labels && message.labels.length)) - message.labels = []; - message.labels.push($root.google.api.LabelDescriptor.decode(reader, reader.uint32())); - break; - case 3: - message.metricKind = reader.int32(); - break; - case 4: - message.valueType = reader.int32(); - break; - case 5: - message.unit = reader.string(); - break; - case 6: - message.description = reader.string(); - break; - case 7: - message.displayName = reader.string(); - break; - case 10: - message.metadata = $root.google.api.MetricDescriptor.MetricDescriptorMetadata.decode(reader, reader.uint32()); - break; - case 12: - message.launchStage = reader.int32(); - break; - case 13: - if (!(message.monitoredResourceTypes && message.monitoredResourceTypes.length)) - message.monitoredResourceTypes = []; - message.monitoredResourceTypes.push(reader.string()); - break; default: reader.skipType(tag & 7); break; @@ -31079,657 +35225,510 @@ }; /** - * Decodes a MetricDescriptor message from the specified reader or buffer, length delimited. + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.MetricDescriptor + * @memberof google.longrunning.CancelOperationRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MetricDescriptor} MetricDescriptor + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MetricDescriptor.decodeDelimited = function decodeDelimited(reader) { + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MetricDescriptor message. + * Verifies a CancelOperationRequest message. * @function verify - * @memberof google.api.MetricDescriptor + * @memberof google.longrunning.CancelOperationRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MetricDescriptor.verify = function verify(message) { + CancelOperationRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!Array.isArray(message.labels)) - return "labels: array expected"; - for (var i = 0; i < message.labels.length; ++i) { - var error = $root.google.api.LabelDescriptor.verify(message.labels[i]); - if (error) - return "labels." + error; - } - } - if (message.metricKind != null && message.hasOwnProperty("metricKind")) - switch (message.metricKind) { - default: - return "metricKind: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.valueType != null && message.hasOwnProperty("valueType")) - switch (message.valueType) { - default: - return "valueType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.unit != null && message.hasOwnProperty("unit")) - if (!$util.isString(message.unit)) - return "unit: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.api.MetricDescriptor.MetricDescriptorMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - switch (message.launchStage) { - default: - return "launchStage: enum value expected"; - case 0: - case 6: - case 7: - case 1: - case 2: - case 3: - case 4: - case 5: + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(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]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.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.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); break; } - if (message.monitoredResourceTypes != null && message.hasOwnProperty("monitoredResourceTypes")) { - if (!Array.isArray(message.monitoredResourceTypes)) - return "monitoredResourceTypes: array expected"; - for (var i = 0; i < message.monitoredResourceTypes.length; ++i) - if (!$util.isString(message.monitoredResourceTypes[i])) - return "monitoredResourceTypes: string[] expected"; } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a MetricDescriptor message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.MetricDescriptor + * @memberof google.longrunning.DeleteOperationRequest * @static * @param {Object.} object Plain object - * @returns {google.api.MetricDescriptor} MetricDescriptor + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest */ - MetricDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MetricDescriptor) + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) return object; - var message = new $root.google.api.MetricDescriptor(); + var message = new $root.google.longrunning.DeleteOperationRequest(); if (object.name != null) message.name = String(object.name); - if (object.type != null) - message.type = String(object.type); - if (object.labels) { - if (!Array.isArray(object.labels)) - throw TypeError(".google.api.MetricDescriptor.labels: array expected"); - message.labels = []; - for (var i = 0; i < object.labels.length; ++i) { - if (typeof object.labels[i] !== "object") - throw TypeError(".google.api.MetricDescriptor.labels: object expected"); - message.labels[i] = $root.google.api.LabelDescriptor.fromObject(object.labels[i]); - } - } - switch (object.metricKind) { - case "METRIC_KIND_UNSPECIFIED": - case 0: - message.metricKind = 0; - break; - case "GAUGE": - case 1: - message.metricKind = 1; - break; - case "DELTA": - case 2: - message.metricKind = 2; - break; - case "CUMULATIVE": - case 3: - message.metricKind = 3; - break; - } - switch (object.valueType) { - case "VALUE_TYPE_UNSPECIFIED": - case 0: - message.valueType = 0; - break; - case "BOOL": - case 1: - message.valueType = 1; - break; - case "INT64": - case 2: - message.valueType = 2; - break; - case "DOUBLE": - case 3: - message.valueType = 3; - break; - case "STRING": - case 4: - message.valueType = 4; - break; - case "DISTRIBUTION": - case 5: - message.valueType = 5; - break; - case "MONEY": - case 6: - message.valueType = 6; - break; - } - if (object.unit != null) - message.unit = String(object.unit); - if (object.description != null) - message.description = String(object.description); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.api.MetricDescriptor.metadata: object expected"); - message.metadata = $root.google.api.MetricDescriptor.MetricDescriptorMetadata.fromObject(object.metadata); - } - switch (object.launchStage) { - case "LAUNCH_STAGE_UNSPECIFIED": - case 0: - message.launchStage = 0; - break; - case "UNIMPLEMENTED": - case 6: - message.launchStage = 6; - break; - case "PRELAUNCH": - case 7: - message.launchStage = 7; - break; - case "EARLY_ACCESS": - case 1: - message.launchStage = 1; - break; - case "ALPHA": - case 2: - message.launchStage = 2; - break; - case "BETA": - case 3: - message.launchStage = 3; - break; - case "GA": - case 4: - message.launchStage = 4; - break; - case "DEPRECATED": - case 5: - message.launchStage = 5; - break; - } - if (object.monitoredResourceTypes) { - if (!Array.isArray(object.monitoredResourceTypes)) - throw TypeError(".google.api.MetricDescriptor.monitoredResourceTypes: array expected"); - message.monitoredResourceTypes = []; - for (var i = 0; i < object.monitoredResourceTypes.length; ++i) - message.monitoredResourceTypes[i] = String(object.monitoredResourceTypes[i]); - } return message; }; /** - * Creates a plain object from a MetricDescriptor message. Also converts values to other types if specified. + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.MetricDescriptor + * @memberof google.longrunning.DeleteOperationRequest * @static - * @param {google.api.MetricDescriptor} message MetricDescriptor + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MetricDescriptor.toObject = function toObject(message, options) { + DeleteOperationRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.labels = []; - object.monitoredResourceTypes = []; - } - if (options.defaults) { + if (options.defaults) object.name = ""; - object.metricKind = options.enums === String ? "METRIC_KIND_UNSPECIFIED" : 0; - object.valueType = options.enums === String ? "VALUE_TYPE_UNSPECIFIED" : 0; - object.unit = ""; - object.description = ""; - object.displayName = ""; - object.type = ""; - object.metadata = null; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.labels && message.labels.length) { - object.labels = []; - for (var j = 0; j < message.labels.length; ++j) - object.labels[j] = $root.google.api.LabelDescriptor.toObject(message.labels[j], options); - } - if (message.metricKind != null && message.hasOwnProperty("metricKind")) - object.metricKind = options.enums === String ? $root.google.api.MetricDescriptor.MetricKind[message.metricKind] : message.metricKind; - if (message.valueType != null && message.hasOwnProperty("valueType")) - object.valueType = options.enums === String ? $root.google.api.MetricDescriptor.ValueType[message.valueType] : message.valueType; - if (message.unit != null && message.hasOwnProperty("unit")) - object.unit = message.unit; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.api.MetricDescriptor.MetricDescriptorMetadata.toObject(message.metadata, options); - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] : message.launchStage; - if (message.monitoredResourceTypes && message.monitoredResourceTypes.length) { - object.monitoredResourceTypes = []; - for (var j = 0; j < message.monitoredResourceTypes.length; ++j) - object.monitoredResourceTypes[j] = message.monitoredResourceTypes[j]; - } return object; }; /** - * Converts this MetricDescriptor to JSON. + * Converts this DeleteOperationRequest to JSON. * @function toJSON - * @memberof google.api.MetricDescriptor + * @memberof google.longrunning.DeleteOperationRequest * @instance * @returns {Object.} JSON object - */ - MetricDescriptor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - MetricDescriptor.MetricDescriptorMetadata = (function() { - - /** - * Properties of a MetricDescriptorMetadata. - * @memberof google.api.MetricDescriptor - * @interface IMetricDescriptorMetadata - * @property {google.api.LaunchStage|null} [launchStage] MetricDescriptorMetadata launchStage - * @property {google.protobuf.IDuration|null} [samplePeriod] MetricDescriptorMetadata samplePeriod - * @property {google.protobuf.IDuration|null} [ingestDelay] MetricDescriptorMetadata ingestDelay - */ - - /** - * Constructs a new MetricDescriptorMetadata. - * @memberof google.api.MetricDescriptor - * @classdesc Represents a MetricDescriptorMetadata. - * @implements IMetricDescriptorMetadata - * @constructor - * @param {google.api.MetricDescriptor.IMetricDescriptorMetadata=} [properties] Properties to set - */ - function MetricDescriptorMetadata(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]]; - } - - /** - * MetricDescriptorMetadata launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata - * @instance - */ - MetricDescriptorMetadata.prototype.launchStage = 0; - - /** - * MetricDescriptorMetadata samplePeriod. - * @member {google.protobuf.IDuration|null|undefined} samplePeriod - * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata - * @instance - */ - MetricDescriptorMetadata.prototype.samplePeriod = null; - - /** - * MetricDescriptorMetadata ingestDelay. - * @member {google.protobuf.IDuration|null|undefined} ingestDelay - * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata - * @instance - */ - MetricDescriptorMetadata.prototype.ingestDelay = null; + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a new MetricDescriptorMetadata instance using the specified properties. - * @function create - * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata - * @static - * @param {google.api.MetricDescriptor.IMetricDescriptorMetadata=} [properties] Properties to set - * @returns {google.api.MetricDescriptor.MetricDescriptorMetadata} MetricDescriptorMetadata instance - */ - MetricDescriptorMetadata.create = function create(properties) { - return new MetricDescriptorMetadata(properties); - }; + return DeleteOperationRequest; + })(); - /** - * Encodes the specified MetricDescriptorMetadata message. Does not implicitly {@link google.api.MetricDescriptor.MetricDescriptorMetadata.verify|verify} messages. - * @function encode - * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata - * @static - * @param {google.api.MetricDescriptor.IMetricDescriptorMetadata} message MetricDescriptorMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MetricDescriptorMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.launchStage); - if (message.samplePeriod != null && Object.hasOwnProperty.call(message, "samplePeriod")) - $root.google.protobuf.Duration.encode(message.samplePeriod, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.ingestDelay != null && Object.hasOwnProperty.call(message, "ingestDelay")) - $root.google.protobuf.Duration.encode(message.ingestDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + longrunning.WaitOperationRequest = (function() { - /** - * Encodes the specified MetricDescriptorMetadata message, length delimited. Does not implicitly {@link google.api.MetricDescriptor.MetricDescriptorMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata - * @static - * @param {google.api.MetricDescriptor.IMetricDescriptorMetadata} message MetricDescriptorMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MetricDescriptorMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ - /** - * Decodes a MetricDescriptorMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MetricDescriptor.MetricDescriptorMetadata} MetricDescriptorMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MetricDescriptorMetadata.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.MetricDescriptor.MetricDescriptorMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.launchStage = reader.int32(); - break; - case 2: - message.samplePeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 3: - message.ingestDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(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]]; + } - /** - * Decodes a MetricDescriptorMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MetricDescriptor.MetricDescriptorMetadata} MetricDescriptorMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MetricDescriptorMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; - /** - * Verifies a MetricDescriptorMetadata message. - * @function verify - * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MetricDescriptorMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - switch (message.launchStage) { - default: - return "launchStage: enum value expected"; - case 0: - case 6: - case 7: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.samplePeriod != null && message.hasOwnProperty("samplePeriod")) { - var error = $root.google.protobuf.Duration.verify(message.samplePeriod); - if (error) - return "samplePeriod." + error; - } - if (message.ingestDelay != null && message.hasOwnProperty("ingestDelay")) { - var error = $root.google.protobuf.Duration.verify(message.ingestDelay); - if (error) - return "ingestDelay." + error; - } - return null; - }; + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; - /** - * Creates a MetricDescriptorMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.api.MetricDescriptor.MetricDescriptorMetadata} MetricDescriptorMetadata - */ - MetricDescriptorMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MetricDescriptor.MetricDescriptorMetadata) - return object; - var message = new $root.google.api.MetricDescriptor.MetricDescriptorMetadata(); - switch (object.launchStage) { - case "LAUNCH_STAGE_UNSPECIFIED": - case 0: - message.launchStage = 0; - break; - case "UNIMPLEMENTED": - case 6: - message.launchStage = 6; - break; - case "PRELAUNCH": - case 7: - message.launchStage = 7; - break; - case "EARLY_ACCESS": - case 1: - message.launchStage = 1; - break; - case "ALPHA": - case 2: - message.launchStage = 2; - break; - case "BETA": - case 3: - message.launchStage = 3; - break; - case "GA": - case 4: - message.launchStage = 4; - break; - case "DEPRECATED": - case 5: - message.launchStage = 5; - break; - } - if (object.samplePeriod != null) { - if (typeof object.samplePeriod !== "object") - throw TypeError(".google.api.MetricDescriptor.MetricDescriptorMetadata.samplePeriod: object expected"); - message.samplePeriod = $root.google.protobuf.Duration.fromObject(object.samplePeriod); - } - if (object.ingestDelay != null) { - if (typeof object.ingestDelay !== "object") - throw TypeError(".google.api.MetricDescriptor.MetricDescriptorMetadata.ingestDelay: object expected"); - message.ingestDelay = $root.google.protobuf.Duration.fromObject(object.ingestDelay); - } - return message; - }; + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; - /** - * Creates a plain object from a MetricDescriptorMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata - * @static - * @param {google.api.MetricDescriptor.MetricDescriptorMetadata} message MetricDescriptorMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MetricDescriptorMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.samplePeriod = null; - object.ingestDelay = null; + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.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.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; } - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] : message.launchStage; - if (message.samplePeriod != null && message.hasOwnProperty("samplePeriod")) - object.samplePeriod = $root.google.protobuf.Duration.toObject(message.samplePeriod, options); - if (message.ingestDelay != null && message.hasOwnProperty("ingestDelay")) - object.ingestDelay = $root.google.protobuf.Duration.toObject(message.ingestDelay, options); - return object; - }; + } + return message; + }; - /** - * Converts this MetricDescriptorMetadata to JSON. - * @function toJSON - * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata - * @instance - * @returns {Object.} JSON object - */ - MetricDescriptorMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - return MetricDescriptorMetadata; - })(); + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; /** - * MetricKind enum. - * @name google.api.MetricDescriptor.MetricKind - * @enum {number} - * @property {number} METRIC_KIND_UNSPECIFIED=0 METRIC_KIND_UNSPECIFIED value - * @property {number} GAUGE=1 GAUGE value - * @property {number} DELTA=2 DELTA value - * @property {number} CUMULATIVE=3 CUMULATIVE value + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest */ - MetricDescriptor.MetricKind = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "METRIC_KIND_UNSPECIFIED"] = 0; - values[valuesById[1] = "GAUGE"] = 1; - values[valuesById[2] = "DELTA"] = 2; - values[valuesById[3] = "CUMULATIVE"] = 3; - return values; - })(); + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; /** - * ValueType enum. - * @name google.api.MetricDescriptor.ValueType - * @enum {number} - * @property {number} VALUE_TYPE_UNSPECIFIED=0 VALUE_TYPE_UNSPECIFIED value - * @property {number} BOOL=1 BOOL value - * @property {number} INT64=2 INT64 value - * @property {number} DOUBLE=3 DOUBLE value - * @property {number} STRING=4 STRING value - * @property {number} DISTRIBUTION=5 DISTRIBUTION value - * @property {number} MONEY=6 MONEY value + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - MetricDescriptor.ValueType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "VALUE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "BOOL"] = 1; - values[valuesById[2] = "INT64"] = 2; - values[valuesById[3] = "DOUBLE"] = 3; - values[valuesById[4] = "STRING"] = 4; - values[valuesById[5] = "DISTRIBUTION"] = 5; - values[valuesById[6] = "MONEY"] = 6; - return values; - })(); + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; - return MetricDescriptor; + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WaitOperationRequest; })(); - api.Metric = (function() { + longrunning.OperationInfo = (function() { /** - * Properties of a Metric. - * @memberof google.api - * @interface IMetric - * @property {string|null} [type] Metric type - * @property {Object.|null} [labels] Metric labels + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType */ /** - * Constructs a new Metric. - * @memberof google.api - * @classdesc Represents a Metric. - * @implements IMetric + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo * @constructor - * @param {google.api.IMetric=} [properties] Properties to set + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set */ - function Metric(properties) { - this.labels = {}; + function OperationInfo(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -31737,108 +35736,88 @@ } /** - * Metric type. - * @member {string} type - * @memberof google.api.Metric + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo * @instance */ - Metric.prototype.type = ""; + OperationInfo.prototype.responseType = ""; /** - * Metric labels. - * @member {Object.} labels - * @memberof google.api.Metric + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo * @instance */ - Metric.prototype.labels = $util.emptyObject; + OperationInfo.prototype.metadataType = ""; /** - * Creates a new Metric instance using the specified properties. + * Creates a new OperationInfo instance using the specified properties. * @function create - * @memberof google.api.Metric + * @memberof google.longrunning.OperationInfo * @static - * @param {google.api.IMetric=} [properties] Properties to set - * @returns {google.api.Metric} Metric instance + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance */ - Metric.create = function create(properties) { - return new Metric(properties); + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); }; /** - * Encodes the specified Metric message. Does not implicitly {@link google.api.Metric.verify|verify} messages. + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. * @function encode - * @memberof google.api.Metric + * @memberof google.longrunning.OperationInfo * @static - * @param {google.api.IMetric} message Metric message or plain object to encode + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Metric.encode = function encode(message, writer) { + OperationInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), 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.labels[keys[i]]).ldelim(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); return writer; }; /** - * Encodes the specified Metric message, length delimited. Does not implicitly {@link google.api.Metric.verify|verify} messages. + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.Metric + * @memberof google.longrunning.OperationInfo * @static - * @param {google.api.IMetric} message Metric message or plain object to encode + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Metric.encodeDelimited = function encodeDelimited(message, writer) { + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Metric message from the specified reader or buffer. + * Decodes an OperationInfo message from the specified reader or buffer. * @function decode - * @memberof google.api.Metric + * @memberof google.longrunning.OperationInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.Metric} Metric + * @returns {google.longrunning.OperationInfo} OperationInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Metric.decode = function decode(reader, length) { + OperationInfo.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.Metric(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 3: - message.type = reader.string(); + case 1: + message.responseType = reader.string(); break; case 2: - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; + message.metadataType = reader.string(); break; default: reader.skipType(tag & 7); @@ -31849,113 +35828,99 @@ }; /** - * Decodes a Metric message from the specified reader or buffer, length delimited. + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.Metric + * @memberof google.longrunning.OperationInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Metric} Metric + * @returns {google.longrunning.OperationInfo} OperationInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Metric.decodeDelimited = function decodeDelimited(reader) { + OperationInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Metric message. + * Verifies an OperationInfo message. * @function verify - * @memberof google.api.Metric + * @memberof google.longrunning.OperationInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Metric.verify = function verify(message) { + OperationInfo.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.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; return null; }; /** - * Creates a Metric message from a plain object. Also converts values to their respective internal types. + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.Metric + * @memberof google.longrunning.OperationInfo * @static * @param {Object.} object Plain object - * @returns {google.api.Metric} Metric + * @returns {google.longrunning.OperationInfo} OperationInfo */ - Metric.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Metric) + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) return object; - var message = new $root.google.api.Metric(); - if (object.type != null) - message.type = String(object.type); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.api.Metric.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); return message; }; /** - * Creates a plain object from a Metric message. Also converts values to other types if specified. + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.Metric + * @memberof google.longrunning.OperationInfo * @static - * @param {google.api.Metric} message Metric + * @param {google.longrunning.OperationInfo} message OperationInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Metric.toObject = function toObject(message, options) { + OperationInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) - object.type = ""; - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; return object; }; /** - * Converts this Metric to JSON. + * Converts this OperationInfo to JSON. * @function toJSON - * @memberof google.api.Metric + * @memberof google.longrunning.OperationInfo * @instance * @returns {Object.} JSON object */ - Metric.prototype.toJSON = function toJSON() { + OperationInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Metric; + return OperationInfo; })(); - return api; + return longrunning; })(); google.rpc = (function() { diff --git a/protos/protos.json b/protos/protos.json index 5c2673a8..f014786f 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -1246,6 +1246,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "split": { + "type": "LogSplit", + "id": 35, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -1306,6 +1313,22 @@ } } }, + "LogSplit": { + "fields": { + "uid": { + "type": "string", + "id": 1 + }, + "index": { + "type": "int32", + "id": 2 + }, + "totalSplits": { + "type": "int32", + "id": 3 + } + } + }, "LoggingServiceV2": { "options": { "(google.api.default_host)": "logging.googleapis.com", @@ -1639,7 +1662,8 @@ "type": "string", "id": 8, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).child_type": "logging.googleapis.com/Log" } } } @@ -2471,15 +2495,26 @@ "responseType": "CmekSettings", "options": { "(google.api.http).get": "/v2/{name=*/*}/cmekSettings", - "(google.api.http).additional_bindings.get": "/v2/{name=organizations/*}/cmekSettings" + "(google.api.http).additional_bindings.get": "/v2/{name=billingAccounts/*}/cmekSettings" }, "parsedOptions": [ { "(google.api.http)": { "get": "/v2/{name=*/*}/cmekSettings", - "additional_bindings": { - "get": "/v2/{name=organizations/*}/cmekSettings" - } + "additional_bindings": [ + { + "get": "/v2/{name=projects/*}/cmekSettings" + }, + { + "get": "/v2/{name=organizations/*}/cmekSettings" + }, + { + "get": "/v2/{name=folders/*}/cmekSettings" + }, + { + "get": "/v2/{name=billingAccounts/*}/cmekSettings" + } + ] } } ] @@ -2505,6 +2540,95 @@ } } ] + }, + "GetSettings": { + "requestType": "GetSettingsRequest", + "responseType": "Settings", + "options": { + "(google.api.http).get": "/v2/{name=*/*}/settings", + "(google.api.http).additional_bindings.get": "/v2/{name=billingAccounts/*}/settings", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=*/*}/settings", + "additional_bindings": [ + { + "get": "/v2/{name=projects/*}/settings" + }, + { + "get": "/v2/{name=organizations/*}/settings" + }, + { + "get": "/v2/{name=folders/*}/settings" + }, + { + "get": "/v2/{name=billingAccounts/*}/settings" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateSettings": { + "requestType": "UpdateSettingsRequest", + "responseType": "Settings", + "options": { + "(google.api.http).patch": "/v2/{name=*/*}/settings", + "(google.api.http).body": "settings", + "(google.api.http).additional_bindings.patch": "/v2/{name=folders/*}/settings", + "(google.api.http).additional_bindings.body": "settings", + "(google.api.method_signature)": "settings,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{name=*/*}/settings", + "body": "settings", + "additional_bindings": [ + { + "patch": "/v2/{name=organizations/*}/settings", + "body": "settings" + }, + { + "patch": "/v2/{name=folders/*}/settings", + "body": "settings" + } + ] + } + }, + { + "(google.api.method_signature)": "settings,update_mask" + } + ] + }, + "CopyLogEntries": { + "requestType": "CopyLogEntriesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/entries:copy", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "CopyLogEntriesResponse", + "(google.longrunning.operation_info).metadata_type": "CopyLogEntriesMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/entries:copy", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CopyLogEntriesResponse", + "metadata_type": "CopyLogEntriesMetadata" + } + } + ] } } }, @@ -2516,7 +2640,10 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, "description": { "type": "string", @@ -2550,16 +2677,18 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "restrictedFields": { + "rule": "repeated", + "type": "string", + "id": 15 + }, + "cmekSettings": { + "type": "CmekSettings", + "id": 19 } } }, - "LifecycleState": { - "values": { - "LIFECYCLE_STATE_UNSPECIFIED": 0, - "ACTIVE": 1, - "DELETE_REQUESTED": 2 - } - }, "LogView": { "options": { "(google.api.resource).type": "logging.googleapis.com/LogView", @@ -3304,6 +3433,155 @@ } } }, + "GetSettingsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "logging.googleapis.com/Settings" + } + } + } + }, + "UpdateSettingsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "settings": { + "type": "Settings", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Settings": { + "options": { + "(google.api.resource).type": "logging.googleapis.com/Settings", + "(google.api.resource).pattern": "billingAccounts/{billing_account}/settings" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "storageLocation": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disableDefaultSink": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CopyLogEntriesRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "filter": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "destination": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CopyLogEntriesMetadata": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "state": { + "type": "OperationState", + "id": 3 + }, + "cancellationRequested": { + "type": "bool", + "id": 4 + }, + "request": { + "type": "CopyLogEntriesRequest", + "id": 5 + }, + "progress": { + "type": "int32", + "id": 6 + }, + "writerIdentity": { + "type": "string", + "id": 7 + } + } + }, + "CopyLogEntriesResponse": { + "fields": { + "logEntriesCopiedCount": { + "type": "int64", + "id": 1 + } + } + }, + "LifecycleState": { + "values": { + "LIFECYCLE_STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "DELETE_REQUESTED": 2 + } + }, + "OperationState": { + "values": { + "OPERATION_STATE_UNSPECIFIED": 0, + "OPERATION_STATE_SCHEDULED": 1, + "OPERATION_STATE_WAITING_FOR_PERMISSIONS": 2, + "OPERATION_STATE_RUNNING": 3, + "OPERATION_STATE_SUCCEEDED": 4, + "OPERATION_STATE_FAILED": 5, + "OPERATION_STATE_CANCELLED": 6 + } + }, "MetricsServiceV2": { "options": { "(google.api.default_host)": "logging.googleapis.com", @@ -3433,6 +3711,13 @@ "(google.api.field_behavior)": "REQUIRED" } }, + "disabled": { + "type": "bool", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "metricDescriptor": { "type": "google.api.MetricDescriptor", "id": 5, @@ -4136,6 +4421,222 @@ } } }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, "rpc": { "options": { "cc_enable_arenas": true, diff --git a/samples/generated/v2/config_service_v2.copy_log_entries.js b/samples/generated/v2/config_service_v2.copy_log_entries.js new file mode 100644 index 00000000..b942f56e --- /dev/null +++ b/samples/generated/v2/config_service_v2.copy_log_entries.js @@ -0,0 +1,69 @@ +// Copyright 2022 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +function main(name, destination) { + // [START logging_v2_generated_ConfigServiceV2_CopyLogEntries_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Log bucket from which to copy log entries. + * For example: + * `"projects/my-project/locations/global/buckets/my-source-bucket"` + */ + // const name = 'abc123' + /** + * Optional. A filter specifying which log entries to copy. The filter must be no more + * than 20k characters. An empty filter matches all log entries. + */ + // const filter = 'abc123' + /** + * Required. Destination to which to copy log entries. + */ + // const destination = 'abc123' + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callCopyLogEntries() { + // Construct request + const request = { + name, + destination, + }; + + // Run request + const [operation] = await loggingClient.copyLogEntries(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCopyLogEntries(); + // [END logging_v2_generated_ConfigServiceV2_CopyLogEntries_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v2/config_service_v2.create_bucket.js b/samples/generated/v2/config_service_v2.create_bucket.js index d3e20591..329b6140 100644 --- a/samples/generated/v2/config_service_v2.create_bucket.js +++ b/samples/generated/v2/config_service_v2.create_bucket.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; @@ -20,15 +24,16 @@ function main(parent, bucketId, bucket) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The resource in which to create the bucket: + * Required. The resource in which to create the log bucket: * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" - * Example: `"projects/my-logging-project/locations/global"` + * For example: + * `"projects/my-project/locations/global"` */ // const parent = 'abc123' /** - * Required. A client-assigned identifier such as `"my-bucket"`. Identifiers are - * limited to 100 characters and can include only letters, digits, - * underscores, hyphens, and periods. + * Required. A client-assigned identifier such as `"my-bucket"`. Identifiers are limited + * to 100 characters and can include only letters, digits, underscores, + * hyphens, and periods. */ // const bucketId = 'abc123' /** diff --git a/samples/generated/v2/config_service_v2.create_exclusion.js b/samples/generated/v2/config_service_v2.create_exclusion.js index d7e5f718..45d26b63 100644 --- a/samples/generated/v2/config_service_v2.create_exclusion.js +++ b/samples/generated/v2/config_service_v2.create_exclusion.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; @@ -25,7 +29,9 @@ function main(parent, exclusion) { * "organizations/[ORGANIZATION_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]" * "folders/[FOLDER_ID]" - * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`. + * For examples: + * `"projects/my-logging-project"` + * `"organizations/123456789"` */ // const parent = 'abc123' /** diff --git a/samples/generated/v2/config_service_v2.create_sink.js b/samples/generated/v2/config_service_v2.create_sink.js index ac1501a0..34ddc52c 100644 --- a/samples/generated/v2/config_service_v2.create_sink.js +++ b/samples/generated/v2/config_service_v2.create_sink.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; @@ -25,7 +29,9 @@ function main(parent, sink) { * "organizations/[ORGANIZATION_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]" * "folders/[FOLDER_ID]" - * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`. + * For examples: + * `"projects/my-project"` + * `"organizations/123456789"` */ // const parent = 'abc123' /** @@ -37,9 +43,9 @@ function main(parent, sink) { * Optional. Determines the kind of IAM identity returned as `writer_identity` * in the new sink. If this value is omitted or set to false, and if the * sink's parent is a project, then the value returned as `writer_identity` is - * the same group or service account used by Logging before the addition of - * writer identities to this API. The sink's destination must be in the same - * project as the sink itself. + * the same group or service account used by Cloud Logging before the addition + * of writer identities to this API. The sink's destination must be in the + * same project as the sink itself. * If this field is set to true, or if the sink is owned by a non-project * resource such as an organization, then the value of `writer_identity` will * be a unique service account used only for exports from the new sink. For diff --git a/samples/generated/v2/config_service_v2.create_view.js b/samples/generated/v2/config_service_v2.create_view.js index 035db83a..3cbb9e67 100644 --- a/samples/generated/v2/config_service_v2.create_view.js +++ b/samples/generated/v2/config_service_v2.create_view.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; @@ -21,9 +25,9 @@ function main(parent, viewId, view) { */ /** * Required. The bucket in which to create the view - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * Example: - * `"projects/my-logging-project/locations/my-location/buckets/my-bucket"` + * `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"` + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` */ // const parent = 'abc123' /** diff --git a/samples/generated/v2/config_service_v2.delete_bucket.js b/samples/generated/v2/config_service_v2.delete_bucket.js index d98c67e4..1fbb4654 100644 --- a/samples/generated/v2/config_service_v2.delete_bucket.js +++ b/samples/generated/v2/config_service_v2.delete_bucket.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; @@ -25,8 +29,8 @@ function main(name) { * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * Example: - * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`. + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` */ // const name = 'abc123' diff --git a/samples/generated/v2/config_service_v2.delete_exclusion.js b/samples/generated/v2/config_service_v2.delete_exclusion.js index c1a93601..ccfcfb2f 100644 --- a/samples/generated/v2/config_service_v2.delete_exclusion.js +++ b/samples/generated/v2/config_service_v2.delete_exclusion.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; @@ -25,7 +29,8 @@ function main(name) { * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`. + * For example: + * `"projects/my-project/exclusions/my-exclusion"` */ // const name = 'abc123' diff --git a/samples/generated/v2/config_service_v2.delete_sink.js b/samples/generated/v2/config_service_v2.delete_sink.js index 6aa54f7b..553c9f6f 100644 --- a/samples/generated/v2/config_service_v2.delete_sink.js +++ b/samples/generated/v2/config_service_v2.delete_sink.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; @@ -26,7 +30,8 @@ function main(sinkName) { * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" * "folders/[FOLDER_ID]/sinks/[SINK_ID]" - * Example: `"projects/my-project-id/sinks/my-sink-id"`. + * For example: + * `"projects/my-project/sinks/my-sink"` */ // const sinkName = 'abc123' diff --git a/samples/generated/v2/config_service_v2.delete_view.js b/samples/generated/v2/config_service_v2.delete_view.js index 8c3c62ee..ccd8288b 100644 --- a/samples/generated/v2/config_service_v2.delete_view.js +++ b/samples/generated/v2/config_service_v2.delete_view.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; @@ -22,8 +26,8 @@ function main(name) { /** * Required. The full resource name of the view to delete: * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" - * Example: - * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id"`. + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` */ // const name = 'abc123' diff --git a/samples/generated/v2/config_service_v2.get_bucket.js b/samples/generated/v2/config_service_v2.get_bucket.js index 756fbc9a..8c72bce8 100644 --- a/samples/generated/v2/config_service_v2.get_bucket.js +++ b/samples/generated/v2/config_service_v2.get_bucket.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; @@ -25,8 +29,8 @@ function main(name) { * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * Example: - * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`. + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` */ // const name = 'abc123' diff --git a/samples/generated/v2/config_service_v2.get_cmek_settings.js b/samples/generated/v2/config_service_v2.get_cmek_settings.js index 9294716e..adc9542b 100644 --- a/samples/generated/v2/config_service_v2.get_cmek_settings.js +++ b/samples/generated/v2/config_service_v2.get_cmek_settings.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; @@ -25,10 +29,12 @@ function main(name) { * "organizations/[ORGANIZATION_ID]/cmekSettings" * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" * "folders/[FOLDER_ID]/cmekSettings" - * Example: `"organizations/12345/cmekSettings"`. - * Note: CMEK for the Logs Router can currently only be configured for GCP - * organizations. Once configured, it applies to all projects and folders in - * the GCP organization. + * For example: + * `"organizations/12345/cmekSettings"` + * Note: CMEK for the Log Router can be configured for Google Cloud projects, + * folders, organizations and billing accounts. Once configured for an + * organization, it applies to all projects and folders in the Google Cloud + * organization. */ // const name = 'abc123' diff --git a/samples/generated/v2/config_service_v2.get_exclusion.js b/samples/generated/v2/config_service_v2.get_exclusion.js index b64d55d1..180245ca 100644 --- a/samples/generated/v2/config_service_v2.get_exclusion.js +++ b/samples/generated/v2/config_service_v2.get_exclusion.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; @@ -25,7 +29,8 @@ function main(name) { * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`. + * For example: + * `"projects/my-project/exclusions/my-exclusion"` */ // const name = 'abc123' diff --git a/samples/generated/v2/config_service_v2.get_settings.js b/samples/generated/v2/config_service_v2.get_settings.js new file mode 100644 index 00000000..184aeb49 --- /dev/null +++ b/samples/generated/v2/config_service_v2.get_settings.js @@ -0,0 +1,66 @@ +// Copyright 2022 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +function main(name) { + // [START logging_v2_generated_ConfigServiceV2_GetSettings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource for which to retrieve settings. + * "projects/[PROJECT_ID]/settings" + * "organizations/[ORGANIZATION_ID]/settings" + * "billingAccounts/[BILLING_ACCOUNT_ID]/settings" + * "folders/[FOLDER_ID]/settings" + * For example: + * `"organizations/12345/settings"` + * Note: Settings for the Log Router can be get for Google Cloud projects, + * folders, organizations and billing accounts. Currently it can only be + * configured for organizations. Once configured for an organization, it + * applies to all projects and folders in the Google Cloud organization. + */ + // const name = 'abc123' + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callGetSettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await loggingClient.getSettings(request); + console.log(response); + } + + callGetSettings(); + // [END logging_v2_generated_ConfigServiceV2_GetSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v2/config_service_v2.get_sink.js b/samples/generated/v2/config_service_v2.get_sink.js index 6505a60b..9f9a0d3d 100644 --- a/samples/generated/v2/config_service_v2.get_sink.js +++ b/samples/generated/v2/config_service_v2.get_sink.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; @@ -25,7 +29,8 @@ function main(sinkName) { * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" * "folders/[FOLDER_ID]/sinks/[SINK_ID]" - * Example: `"projects/my-project-id/sinks/my-sink-id"`. + * For example: + * `"projects/my-project/sinks/my-sink"` */ // const sinkName = 'abc123' diff --git a/samples/generated/v2/config_service_v2.get_view.js b/samples/generated/v2/config_service_v2.get_view.js index adc3a741..4ad0fc4a 100644 --- a/samples/generated/v2/config_service_v2.get_view.js +++ b/samples/generated/v2/config_service_v2.get_view.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; @@ -22,8 +26,8 @@ function main(name) { /** * Required. The resource name of the policy: * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" - * Example: - * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id"`. + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` */ // const name = 'abc123' diff --git a/samples/generated/v2/config_service_v2.list_buckets.js b/samples/generated/v2/config_service_v2.list_buckets.js index 6252d2d3..8a7a7390 100644 --- a/samples/generated/v2/config_service_v2.list_buckets.js +++ b/samples/generated/v2/config_service_v2.list_buckets.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; @@ -31,16 +35,16 @@ function main(parent) { */ // const parent = 'abc123' /** - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. + * Optional. If present, then retrieve the next batch of results from the preceding call + * to this method. `pageToken` must be the value of `nextPageToken` from the + * previous response. The values of other method parameters should be + * identical to those in the previous call. */ // const pageToken = 'abc123' /** - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. + * Optional. The maximum number of results to return from this request. Non-positive + * values are ignored. The presence of `nextPageToken` in the response + * indicates that more results might be available. */ // const pageSize = 1234 diff --git a/samples/generated/v2/config_service_v2.list_exclusions.js b/samples/generated/v2/config_service_v2.list_exclusions.js index 2d1ad40c..939385d7 100644 --- a/samples/generated/v2/config_service_v2.list_exclusions.js +++ b/samples/generated/v2/config_service_v2.list_exclusions.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; diff --git a/samples/generated/v2/config_service_v2.list_sinks.js b/samples/generated/v2/config_service_v2.list_sinks.js index 96d319fb..25424f3e 100644 --- a/samples/generated/v2/config_service_v2.list_sinks.js +++ b/samples/generated/v2/config_service_v2.list_sinks.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; diff --git a/samples/generated/v2/config_service_v2.list_views.js b/samples/generated/v2/config_service_v2.list_views.js index 38da9c64..3fa4f9ce 100644 --- a/samples/generated/v2/config_service_v2.list_views.js +++ b/samples/generated/v2/config_service_v2.list_views.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; @@ -25,10 +29,10 @@ function main(parent) { */ // const parent = 'abc123' /** - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. + * Optional. If present, then retrieve the next batch of results from the preceding call + * to this method. `pageToken` must be the value of `nextPageToken` from the + * previous response. The values of other method parameters should be + * identical to those in the previous call. */ // const pageToken = 'abc123' /** diff --git a/samples/generated/v2/config_service_v2.undelete_bucket.js b/samples/generated/v2/config_service_v2.undelete_bucket.js index 52caf7ad..30a6935c 100644 --- a/samples/generated/v2/config_service_v2.undelete_bucket.js +++ b/samples/generated/v2/config_service_v2.undelete_bucket.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; @@ -25,8 +29,8 @@ function main(name) { * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * Example: - * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`. + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` */ // const name = 'abc123' diff --git a/samples/generated/v2/config_service_v2.update_bucket.js b/samples/generated/v2/config_service_v2.update_bucket.js index 73d6f79b..31222974 100644 --- a/samples/generated/v2/config_service_v2.update_bucket.js +++ b/samples/generated/v2/config_service_v2.update_bucket.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; @@ -25,10 +29,8 @@ function main(name, bucket, updateMask) { * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * Example: - * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`. Also - * requires permission "resourcemanager.projects.updateLiens" to set the - * locked property + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` */ // const name = 'abc123' /** @@ -37,11 +39,11 @@ function main(name, bucket, updateMask) { // const bucket = {} /** * Required. Field mask that specifies the fields in `bucket` that need an update. A - * bucket field will be overwritten if, and only if, it is in the update - * mask. `name` and output only fields cannot be updated. - * For a detailed `FieldMask` definition, see + * bucket field will be overwritten if, and only if, it is in the update mask. + * `name` and output only fields cannot be updated. + * For a detailed `FieldMask` definition, see: * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask - * Example: `updateMask=retention_days`. + * For example: `updateMask=retention_days` */ // const updateMask = {} diff --git a/samples/generated/v2/config_service_v2.update_cmek_settings.js b/samples/generated/v2/config_service_v2.update_cmek_settings.js index 2580cd32..a2fb3356 100644 --- a/samples/generated/v2/config_service_v2.update_cmek_settings.js +++ b/samples/generated/v2/config_service_v2.update_cmek_settings.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; @@ -25,15 +29,16 @@ function main(name, cmekSettings) { * "organizations/[ORGANIZATION_ID]/cmekSettings" * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" * "folders/[FOLDER_ID]/cmekSettings" - * Example: `"organizations/12345/cmekSettings"`. - * Note: CMEK for the Logs Router can currently only be configured for GCP - * organizations. Once configured, it applies to all projects and folders in - * the GCP organization. + * For example: + * `"organizations/12345/cmekSettings"` + * Note: CMEK for the Log Router can currently only be configured for Google + * Cloud organizations. Once configured, it applies to all projects and + * folders in the Google Cloud organization. */ // const name = 'abc123' /** * Required. The CMEK settings to update. - * See Enabling CMEK for Logs + * See Enabling CMEK for Log * Router (https://cloud.google.com/logging/docs/routing/managed-encryption) * for more information. */ @@ -43,7 +48,7 @@ function main(name, cmekSettings) { * be updated. A field will be overwritten if and only if it is in the update * mask. Output only fields cannot be updated. * See FieldMask google.protobuf.FieldMask for more information. - * Example: `"updateMask=kmsKeyName"` + * For example: `"updateMask=kmsKeyName"` */ // const updateMask = {} diff --git a/samples/generated/v2/config_service_v2.update_exclusion.js b/samples/generated/v2/config_service_v2.update_exclusion.js index 33866c42..0bef0516 100644 --- a/samples/generated/v2/config_service_v2.update_exclusion.js +++ b/samples/generated/v2/config_service_v2.update_exclusion.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; @@ -25,7 +29,8 @@ function main(name, exclusion, updateMask) { * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`. + * For example: + * `"projects/my-project/exclusions/my-exclusion"` */ // const name = 'abc123' /** diff --git a/samples/generated/v2/config_service_v2.update_settings.js b/samples/generated/v2/config_service_v2.update_settings.js new file mode 100644 index 00000000..cfbdb18e --- /dev/null +++ b/samples/generated/v2/config_service_v2.update_settings.js @@ -0,0 +1,78 @@ +// Copyright 2022 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +function main(name, settings) { + // [START logging_v2_generated_ConfigServiceV2_UpdateSettings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name for the settings to update. + * "organizations/[ORGANIZATION_ID]/settings" + * For example: + * `"organizations/12345/settings"` + * Note: Settings for the Log Router can currently only be configured for + * Google Cloud organizations. Once configured, it applies to all projects and + * folders in the Google Cloud organization. + */ + // const name = 'abc123' + /** + * Required. The settings to update. + * See Enabling CMEK for Log + * Router (https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + */ + // const settings = {} + /** + * Optional. Field mask identifying which fields from `settings` should + * be updated. A field will be overwritten if and only if it is in the update + * mask. Output only fields cannot be updated. + * See FieldMask google.protobuf.FieldMask for more information. + * For example: `"updateMask=kmsKeyName"` + */ + // const updateMask = {} + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callUpdateSettings() { + // Construct request + const request = { + name, + settings, + }; + + // Run request + const response = await loggingClient.updateSettings(request); + console.log(response); + } + + callUpdateSettings(); + // [END logging_v2_generated_ConfigServiceV2_UpdateSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v2/config_service_v2.update_sink.js b/samples/generated/v2/config_service_v2.update_sink.js index 5e6403f9..9132584d 100644 --- a/samples/generated/v2/config_service_v2.update_sink.js +++ b/samples/generated/v2/config_service_v2.update_sink.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; @@ -26,7 +30,8 @@ function main(sinkName, sink) { * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" * "folders/[FOLDER_ID]/sinks/[SINK_ID]" - * Example: `"projects/my-project-id/sinks/my-sink-id"`. + * For example: + * `"projects/my-project/sinks/my-sink"` */ // const sinkName = 'abc123' /** @@ -51,14 +56,14 @@ function main(sinkName, sink) { * Optional. Field mask that specifies the fields in `sink` that need * an update. A sink field will be overwritten if, and only if, it is * in the update mask. `name` and output only fields cannot be updated. - * An empty updateMask is temporarily treated as using the following mask + * An empty `updateMask` is temporarily treated as using the following mask * for backwards compatibility purposes: - * destination,filter,includeChildren + * `destination,filter,includeChildren` * At some point in the future, behavior will be removed and specifying an - * empty updateMask will be an error. + * empty `updateMask` will be an error. * For a detailed `FieldMask` definition, see * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask - * Example: `updateMask=filter`. + * For example: `updateMask=filter` */ // const updateMask = {} diff --git a/samples/generated/v2/config_service_v2.update_view.js b/samples/generated/v2/config_service_v2.update_view.js index ecab90c5..2f98c824 100644 --- a/samples/generated/v2/config_service_v2.update_view.js +++ b/samples/generated/v2/config_service_v2.update_view.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; @@ -22,8 +26,8 @@ function main(name, view) { /** * Required. The full resource name of the view to update * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" - * Example: - * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id"`. + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` */ // const name = 'abc123' /** @@ -36,7 +40,7 @@ function main(name, view) { * in the update mask. `name` and output only fields cannot be updated. * For a detailed `FieldMask` definition, see * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask - * Example: `updateMask=filter`. + * For example: `updateMask=filter` */ // const updateMask = {} diff --git a/samples/generated/v2/logging_service_v2.delete_log.js b/samples/generated/v2/logging_service_v2.delete_log.js index 85531050..99bc7875 100644 --- a/samples/generated/v2/logging_service_v2.delete_log.js +++ b/samples/generated/v2/logging_service_v2.delete_log.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; @@ -21,13 +25,13 @@ function main(logName) { */ /** * Required. The resource name of the log to delete: - * "projects/[PROJECT_ID]/logs/[LOG_ID]" - * "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" - * "folders/[FOLDER_ID]/logs/[LOG_ID]" + * * `projects/[PROJECT_ID]/logs/[LOG_ID]` + * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` + * * `folders/[FOLDER_ID]/logs/[LOG_ID]` * `[LOG_ID]` must be URL-encoded. For example, * `"projects/my-project-id/logs/syslog"`, - * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. + * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`. * For more information about log names, see * LogEntry google.logging.v2.LogEntry. */ diff --git a/samples/generated/v2/logging_service_v2.list_log_entries.js b/samples/generated/v2/logging_service_v2.list_log_entries.js index 1ac1cb7a..f0992952 100644 --- a/samples/generated/v2/logging_service_v2.list_log_entries.js +++ b/samples/generated/v2/logging_service_v2.list_log_entries.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; @@ -22,15 +26,15 @@ function main(resourceNames) { /** * Required. Names of one or more parent resources from which to * retrieve log entries: - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" - * May alternatively be one or more views - * projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] - * organization/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] - * billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] - * folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` + * May alternatively be one or more views: + * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` * Projects listed in the `project_ids` field are added to this list. */ // const resourceNames = 'abc123' @@ -54,10 +58,10 @@ function main(resourceNames) { */ // const orderBy = 'abc123' /** - * Optional. The maximum number of results to return from this request. - * Default is 50. If the value is negative or exceeds 1000, - * the request is rejected. The presence of `next_page_token` in the - * response indicates that more results might be available. + * Optional. The maximum number of results to return from this request. Default is 50. + * If the value is negative or exceeds 1000, the request is rejected. The + * presence of `next_page_token` in the response indicates that more results + * might be available. */ // const pageSize = 1234 /** diff --git a/samples/generated/v2/logging_service_v2.list_logs.js b/samples/generated/v2/logging_service_v2.list_logs.js index a9ee584e..ed0d28a1 100644 --- a/samples/generated/v2/logging_service_v2.list_logs.js +++ b/samples/generated/v2/logging_service_v2.list_logs.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; @@ -21,10 +25,10 @@ function main(parent) { */ /** * Required. The resource name that owns the logs: - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` */ // const parent = 'abc123' /** @@ -42,15 +46,15 @@ function main(parent) { // const pageToken = 'abc123' /** * Optional. The resource name that owns the logs: - * projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] - * organization/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] - * billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] - * folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] + * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` * To support legacy queries, it could also be: - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` */ // const resourceNames = 'abc123' diff --git a/samples/generated/v2/logging_service_v2.list_monitored_resource_descriptors.js b/samples/generated/v2/logging_service_v2.list_monitored_resource_descriptors.js index 21599320..71e2931b 100644 --- a/samples/generated/v2/logging_service_v2.list_monitored_resource_descriptors.js +++ b/samples/generated/v2/logging_service_v2.list_monitored_resource_descriptors.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; diff --git a/samples/generated/v2/logging_service_v2.tail_log_entries.js b/samples/generated/v2/logging_service_v2.tail_log_entries.js index ceebfc21..6f0146e4 100644 --- a/samples/generated/v2/logging_service_v2.tail_log_entries.js +++ b/samples/generated/v2/logging_service_v2.tail_log_entries.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; @@ -21,15 +25,15 @@ function main(resourceNames) { */ /** * Required. Name of a parent resource from which to retrieve log entries: - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` * May alternatively be one or more views: - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" - * "organization/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" + * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` */ // const resourceNames = 'abc123' /** diff --git a/samples/generated/v2/logging_service_v2.write_log_entries.js b/samples/generated/v2/logging_service_v2.write_log_entries.js index c55d5dec..b3e7e59c 100644 --- a/samples/generated/v2/logging_service_v2.write_log_entries.js +++ b/samples/generated/v2/logging_service_v2.write_log_entries.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; @@ -22,13 +26,13 @@ function main(entries) { /** * Optional. A default log resource name that is assigned to all log entries * in `entries` that do not specify a value for `log_name`: - * "projects/[PROJECT_ID]/logs/[LOG_ID]" - * "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" - * "folders/[FOLDER_ID]/logs/[LOG_ID]" + * * `projects/[PROJECT_ID]/logs/[LOG_ID]` + * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` + * * `folders/[FOLDER_ID]/logs/[LOG_ID]` * `[LOG_ID]` must be URL-encoded. For example: * "projects/my-project-id/logs/syslog" - * "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity" + * "organizations/123/logs/cloudaudit.googleapis.com%2Factivity" * The permission `logging.logEntries.create` is needed on each project, * organization, billing account, or folder that is receiving new log * entries, whether the resource is specified in `logName` or in an @@ -64,13 +68,13 @@ function main(entries) { * supply their own values, the entries earlier in the list will sort before * the entries later in the list. See the `entries.list` method. * Log entries with timestamps that are more than the - * logs retention period (https://cloud.google.com/logging/quota-policy) in + * logs retention period (https://cloud.google.com/logging/quotas) in * the past or more than 24 hours in the future will not be available when * calling `entries.list`. However, those log entries can still be exported * with * LogSinks (https://cloud.google.com/logging/docs/api/tasks/exporting-logs). * To improve throughput and to avoid exceeding the - * quota limit (https://cloud.google.com/logging/quota-policy) for calls to + * quota limit (https://cloud.google.com/logging/quotas) for calls to * `entries.write`, you should try to include several log entries in this * list, rather than calling this method for each individual log entry. */ diff --git a/samples/generated/v2/metrics_service_v2.create_log_metric.js b/samples/generated/v2/metrics_service_v2.create_log_metric.js index 71c3e9cb..32a4f35f 100644 --- a/samples/generated/v2/metrics_service_v2.create_log_metric.js +++ b/samples/generated/v2/metrics_service_v2.create_log_metric.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; diff --git a/samples/generated/v2/metrics_service_v2.delete_log_metric.js b/samples/generated/v2/metrics_service_v2.delete_log_metric.js index 91255f11..db0c2667 100644 --- a/samples/generated/v2/metrics_service_v2.delete_log_metric.js +++ b/samples/generated/v2/metrics_service_v2.delete_log_metric.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; diff --git a/samples/generated/v2/metrics_service_v2.get_log_metric.js b/samples/generated/v2/metrics_service_v2.get_log_metric.js index 4111c918..fddd8493 100644 --- a/samples/generated/v2/metrics_service_v2.get_log_metric.js +++ b/samples/generated/v2/metrics_service_v2.get_log_metric.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; diff --git a/samples/generated/v2/metrics_service_v2.list_log_metrics.js b/samples/generated/v2/metrics_service_v2.list_log_metrics.js index 3b1893f6..cab64828 100644 --- a/samples/generated/v2/metrics_service_v2.list_log_metrics.js +++ b/samples/generated/v2/metrics_service_v2.list_log_metrics.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; diff --git a/samples/generated/v2/metrics_service_v2.update_log_metric.js b/samples/generated/v2/metrics_service_v2.update_log_metric.js index 0a930deb..89362b9f 100644 --- a/samples/generated/v2/metrics_service_v2.update_log_metric.js +++ b/samples/generated/v2/metrics_service_v2.update_log_metric.js @@ -1,16 +1,20 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; diff --git a/samples/generated/v2/snippet_metadata.google.logging.v2.json b/samples/generated/v2/snippet_metadata.google.logging.v2.json new file mode 100644 index 00000000..b22f80d2 --- /dev/null +++ b/samples/generated/v2/snippet_metadata.google.logging.v2.json @@ -0,0 +1,1691 @@ +{ + "clientLibrary": { + "name": "nodejs-logging", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.logging.v2", + "version": "v2" + } + ] + }, + "snippets": [ + { + "regionTag": "logging_v2_generated_ConfigServiceV2_ListBuckets_async", + "title": "logging listBuckets Sample", + "origin": "API_DEFINITION", + "description": " Lists log buckets.", + "canonical": true, + "file": "config_service_v2.list_buckets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBuckets", + "fullName": "google.logging.v2.ConfigServiceV2.ListBuckets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.logging.v2.ListBucketsResponse", + "client": { + "shortName": "ConfigServiceV2Client", + "fullName": "google.logging.v2.ConfigServiceV2Client" + }, + "method": { + "shortName": "ListBuckets", + "fullName": "google.logging.v2.ConfigServiceV2.ListBuckets", + "service": { + "shortName": "ConfigServiceV2", + "fullName": "google.logging.v2.ConfigServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_ConfigServiceV2_GetBucket_async", + "title": "logging getBucket Sample", + "origin": "API_DEFINITION", + "description": " Gets a log bucket.", + "canonical": true, + "file": "config_service_v2.get_bucket.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBucket", + "fullName": "google.logging.v2.ConfigServiceV2.GetBucket", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.logging.v2.LogBucket", + "client": { + "shortName": "ConfigServiceV2Client", + "fullName": "google.logging.v2.ConfigServiceV2Client" + }, + "method": { + "shortName": "GetBucket", + "fullName": "google.logging.v2.ConfigServiceV2.GetBucket", + "service": { + "shortName": "ConfigServiceV2", + "fullName": "google.logging.v2.ConfigServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_ConfigServiceV2_CreateBucket_async", + "title": "logging createBucket Sample", + "origin": "API_DEFINITION", + "description": " Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.", + "canonical": true, + "file": "config_service_v2.create_bucket.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBucket", + "fullName": "google.logging.v2.ConfigServiceV2.CreateBucket", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "bucket_id", + "type": "TYPE_STRING" + }, + { + "name": "bucket", + "type": ".google.logging.v2.LogBucket" + } + ], + "resultType": ".google.logging.v2.LogBucket", + "client": { + "shortName": "ConfigServiceV2Client", + "fullName": "google.logging.v2.ConfigServiceV2Client" + }, + "method": { + "shortName": "CreateBucket", + "fullName": "google.logging.v2.ConfigServiceV2.CreateBucket", + "service": { + "shortName": "ConfigServiceV2", + "fullName": "google.logging.v2.ConfigServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_ConfigServiceV2_UpdateBucket_async", + "title": "logging updateBucket Sample", + "origin": "API_DEFINITION", + "description": " Updates a log bucket. This method replaces the following fields in the existing bucket with values from the new bucket: `retention_period` If the retention period is decreased and the bucket is locked, `FAILED_PRECONDITION` will be returned. If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then `FAILED_PRECONDITION` will be returned. After a bucket has been created, the bucket's location cannot be changed.", + "canonical": true, + "file": "config_service_v2.update_bucket.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBucket", + "fullName": "google.logging.v2.ConfigServiceV2.UpdateBucket", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "bucket", + "type": ".google.logging.v2.LogBucket" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.logging.v2.LogBucket", + "client": { + "shortName": "ConfigServiceV2Client", + "fullName": "google.logging.v2.ConfigServiceV2Client" + }, + "method": { + "shortName": "UpdateBucket", + "fullName": "google.logging.v2.ConfigServiceV2.UpdateBucket", + "service": { + "shortName": "ConfigServiceV2", + "fullName": "google.logging.v2.ConfigServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_ConfigServiceV2_DeleteBucket_async", + "title": "logging deleteBucket Sample", + "origin": "API_DEFINITION", + "description": " Deletes a log bucket. Changes the bucket's `lifecycle_state` to the `DELETE_REQUESTED` state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.", + "canonical": true, + "file": "config_service_v2.delete_bucket.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBucket", + "fullName": "google.logging.v2.ConfigServiceV2.DeleteBucket", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ConfigServiceV2Client", + "fullName": "google.logging.v2.ConfigServiceV2Client" + }, + "method": { + "shortName": "DeleteBucket", + "fullName": "google.logging.v2.ConfigServiceV2.DeleteBucket", + "service": { + "shortName": "ConfigServiceV2", + "fullName": "google.logging.v2.ConfigServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_ConfigServiceV2_UndeleteBucket_async", + "title": "logging undeleteBucket Sample", + "origin": "API_DEFINITION", + "description": " Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days.", + "canonical": true, + "file": "config_service_v2.undelete_bucket.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UndeleteBucket", + "fullName": "google.logging.v2.ConfigServiceV2.UndeleteBucket", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ConfigServiceV2Client", + "fullName": "google.logging.v2.ConfigServiceV2Client" + }, + "method": { + "shortName": "UndeleteBucket", + "fullName": "google.logging.v2.ConfigServiceV2.UndeleteBucket", + "service": { + "shortName": "ConfigServiceV2", + "fullName": "google.logging.v2.ConfigServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_ConfigServiceV2_ListViews_async", + "title": "logging listViews Sample", + "origin": "API_DEFINITION", + "description": " Lists views on a log bucket.", + "canonical": true, + "file": "config_service_v2.list_views.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListViews", + "fullName": "google.logging.v2.ConfigServiceV2.ListViews", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.logging.v2.ListViewsResponse", + "client": { + "shortName": "ConfigServiceV2Client", + "fullName": "google.logging.v2.ConfigServiceV2Client" + }, + "method": { + "shortName": "ListViews", + "fullName": "google.logging.v2.ConfigServiceV2.ListViews", + "service": { + "shortName": "ConfigServiceV2", + "fullName": "google.logging.v2.ConfigServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_ConfigServiceV2_GetView_async", + "title": "logging getView Sample", + "origin": "API_DEFINITION", + "description": " Gets a view on a log bucket..", + "canonical": true, + "file": "config_service_v2.get_view.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetView", + "fullName": "google.logging.v2.ConfigServiceV2.GetView", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.logging.v2.LogView", + "client": { + "shortName": "ConfigServiceV2Client", + "fullName": "google.logging.v2.ConfigServiceV2Client" + }, + "method": { + "shortName": "GetView", + "fullName": "google.logging.v2.ConfigServiceV2.GetView", + "service": { + "shortName": "ConfigServiceV2", + "fullName": "google.logging.v2.ConfigServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_ConfigServiceV2_CreateView_async", + "title": "logging createView Sample", + "origin": "API_DEFINITION", + "description": " Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.", + "canonical": true, + "file": "config_service_v2.create_view.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateView", + "fullName": "google.logging.v2.ConfigServiceV2.CreateView", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "view_id", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.logging.v2.LogView" + } + ], + "resultType": ".google.logging.v2.LogView", + "client": { + "shortName": "ConfigServiceV2Client", + "fullName": "google.logging.v2.ConfigServiceV2Client" + }, + "method": { + "shortName": "CreateView", + "fullName": "google.logging.v2.ConfigServiceV2.CreateView", + "service": { + "shortName": "ConfigServiceV2", + "fullName": "google.logging.v2.ConfigServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_ConfigServiceV2_UpdateView_async", + "title": "logging updateView Sample", + "origin": "API_DEFINITION", + "description": " Updates a view on a log bucket. This method replaces the following fields in the existing view with values from the new view: `filter`. If an `UNAVAILABLE` error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.", + "canonical": true, + "file": "config_service_v2.update_view.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateView", + "fullName": "google.logging.v2.ConfigServiceV2.UpdateView", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.logging.v2.LogView" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.logging.v2.LogView", + "client": { + "shortName": "ConfigServiceV2Client", + "fullName": "google.logging.v2.ConfigServiceV2Client" + }, + "method": { + "shortName": "UpdateView", + "fullName": "google.logging.v2.ConfigServiceV2.UpdateView", + "service": { + "shortName": "ConfigServiceV2", + "fullName": "google.logging.v2.ConfigServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_ConfigServiceV2_DeleteView_async", + "title": "logging deleteView Sample", + "origin": "API_DEFINITION", + "description": " Deletes a view on a log bucket. If an `UNAVAILABLE` error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.", + "canonical": true, + "file": "config_service_v2.delete_view.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteView", + "fullName": "google.logging.v2.ConfigServiceV2.DeleteView", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ConfigServiceV2Client", + "fullName": "google.logging.v2.ConfigServiceV2Client" + }, + "method": { + "shortName": "DeleteView", + "fullName": "google.logging.v2.ConfigServiceV2.DeleteView", + "service": { + "shortName": "ConfigServiceV2", + "fullName": "google.logging.v2.ConfigServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_ConfigServiceV2_ListSinks_async", + "title": "logging listSinks Sample", + "origin": "API_DEFINITION", + "description": " Lists sinks.", + "canonical": true, + "file": "config_service_v2.list_sinks.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSinks", + "fullName": "google.logging.v2.ConfigServiceV2.ListSinks", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.logging.v2.ListSinksResponse", + "client": { + "shortName": "ConfigServiceV2Client", + "fullName": "google.logging.v2.ConfigServiceV2Client" + }, + "method": { + "shortName": "ListSinks", + "fullName": "google.logging.v2.ConfigServiceV2.ListSinks", + "service": { + "shortName": "ConfigServiceV2", + "fullName": "google.logging.v2.ConfigServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_ConfigServiceV2_GetSink_async", + "title": "logging getSink Sample", + "origin": "API_DEFINITION", + "description": " Gets a sink.", + "canonical": true, + "file": "config_service_v2.get_sink.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSink", + "fullName": "google.logging.v2.ConfigServiceV2.GetSink", + "async": true, + "parameters": [ + { + "name": "sink_name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.logging.v2.LogSink", + "client": { + "shortName": "ConfigServiceV2Client", + "fullName": "google.logging.v2.ConfigServiceV2Client" + }, + "method": { + "shortName": "GetSink", + "fullName": "google.logging.v2.ConfigServiceV2.GetSink", + "service": { + "shortName": "ConfigServiceV2", + "fullName": "google.logging.v2.ConfigServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_ConfigServiceV2_CreateSink_async", + "title": "logging createSink Sample", + "origin": "API_DEFINITION", + "description": " Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's `writer_identity` is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.", + "canonical": true, + "file": "config_service_v2.create_sink.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSink", + "fullName": "google.logging.v2.ConfigServiceV2.CreateSink", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "sink", + "type": ".google.logging.v2.LogSink" + }, + { + "name": "unique_writer_identity", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.logging.v2.LogSink", + "client": { + "shortName": "ConfigServiceV2Client", + "fullName": "google.logging.v2.ConfigServiceV2Client" + }, + "method": { + "shortName": "CreateSink", + "fullName": "google.logging.v2.ConfigServiceV2.CreateSink", + "service": { + "shortName": "ConfigServiceV2", + "fullName": "google.logging.v2.ConfigServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_ConfigServiceV2_UpdateSink_async", + "title": "logging updateSink Sample", + "origin": "API_DEFINITION", + "description": " Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: `destination`, and `filter`. The updated sink might also have a new `writer_identity`; see the `unique_writer_identity` field.", + "canonical": true, + "file": "config_service_v2.update_sink.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 90, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSink", + "fullName": "google.logging.v2.ConfigServiceV2.UpdateSink", + "async": true, + "parameters": [ + { + "name": "sink_name", + "type": "TYPE_STRING" + }, + { + "name": "sink", + "type": ".google.logging.v2.LogSink" + }, + { + "name": "unique_writer_identity", + "type": "TYPE_BOOL" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.logging.v2.LogSink", + "client": { + "shortName": "ConfigServiceV2Client", + "fullName": "google.logging.v2.ConfigServiceV2Client" + }, + "method": { + "shortName": "UpdateSink", + "fullName": "google.logging.v2.ConfigServiceV2.UpdateSink", + "service": { + "shortName": "ConfigServiceV2", + "fullName": "google.logging.v2.ConfigServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_ConfigServiceV2_DeleteSink_async", + "title": "logging deleteSink Sample", + "origin": "API_DEFINITION", + "description": " Deletes a sink. If the sink has a unique `writer_identity`, then that service account is also deleted.", + "canonical": true, + "file": "config_service_v2.delete_sink.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteSink", + "fullName": "google.logging.v2.ConfigServiceV2.DeleteSink", + "async": true, + "parameters": [ + { + "name": "sink_name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ConfigServiceV2Client", + "fullName": "google.logging.v2.ConfigServiceV2Client" + }, + "method": { + "shortName": "DeleteSink", + "fullName": "google.logging.v2.ConfigServiceV2.DeleteSink", + "service": { + "shortName": "ConfigServiceV2", + "fullName": "google.logging.v2.ConfigServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_ConfigServiceV2_ListExclusions_async", + "title": "logging listExclusions Sample", + "origin": "API_DEFINITION", + "description": " Lists all the exclusions on the _Default sink in a parent resource.", + "canonical": true, + "file": "config_service_v2.list_exclusions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListExclusions", + "fullName": "google.logging.v2.ConfigServiceV2.ListExclusions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.logging.v2.ListExclusionsResponse", + "client": { + "shortName": "ConfigServiceV2Client", + "fullName": "google.logging.v2.ConfigServiceV2Client" + }, + "method": { + "shortName": "ListExclusions", + "fullName": "google.logging.v2.ConfigServiceV2.ListExclusions", + "service": { + "shortName": "ConfigServiceV2", + "fullName": "google.logging.v2.ConfigServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_ConfigServiceV2_GetExclusion_async", + "title": "logging getExclusion Sample", + "origin": "API_DEFINITION", + "description": " Gets the description of an exclusion in the _Default sink.", + "canonical": true, + "file": "config_service_v2.get_exclusion.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetExclusion", + "fullName": "google.logging.v2.ConfigServiceV2.GetExclusion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.logging.v2.LogExclusion", + "client": { + "shortName": "ConfigServiceV2Client", + "fullName": "google.logging.v2.ConfigServiceV2Client" + }, + "method": { + "shortName": "GetExclusion", + "fullName": "google.logging.v2.ConfigServiceV2.GetExclusion", + "service": { + "shortName": "ConfigServiceV2", + "fullName": "google.logging.v2.ConfigServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_ConfigServiceV2_CreateExclusion_async", + "title": "logging createExclusion Sample", + "origin": "API_DEFINITION", + "description": " Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.", + "canonical": true, + "file": "config_service_v2.create_exclusion.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateExclusion", + "fullName": "google.logging.v2.ConfigServiceV2.CreateExclusion", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "exclusion", + "type": ".google.logging.v2.LogExclusion" + } + ], + "resultType": ".google.logging.v2.LogExclusion", + "client": { + "shortName": "ConfigServiceV2Client", + "fullName": "google.logging.v2.ConfigServiceV2Client" + }, + "method": { + "shortName": "CreateExclusion", + "fullName": "google.logging.v2.ConfigServiceV2.CreateExclusion", + "service": { + "shortName": "ConfigServiceV2", + "fullName": "google.logging.v2.ConfigServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_ConfigServiceV2_UpdateExclusion_async", + "title": "logging updateExclusion Sample", + "origin": "API_DEFINITION", + "description": " Changes one or more properties of an existing exclusion in the _Default sink.", + "canonical": true, + "file": "config_service_v2.update_exclusion.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateExclusion", + "fullName": "google.logging.v2.ConfigServiceV2.UpdateExclusion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "exclusion", + "type": ".google.logging.v2.LogExclusion" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.logging.v2.LogExclusion", + "client": { + "shortName": "ConfigServiceV2Client", + "fullName": "google.logging.v2.ConfigServiceV2Client" + }, + "method": { + "shortName": "UpdateExclusion", + "fullName": "google.logging.v2.ConfigServiceV2.UpdateExclusion", + "service": { + "shortName": "ConfigServiceV2", + "fullName": "google.logging.v2.ConfigServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_ConfigServiceV2_DeleteExclusion_async", + "title": "logging deleteExclusion Sample", + "origin": "API_DEFINITION", + "description": " Deletes an exclusion in the _Default sink.", + "canonical": true, + "file": "config_service_v2.delete_exclusion.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteExclusion", + "fullName": "google.logging.v2.ConfigServiceV2.DeleteExclusion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ConfigServiceV2Client", + "fullName": "google.logging.v2.ConfigServiceV2Client" + }, + "method": { + "shortName": "DeleteExclusion", + "fullName": "google.logging.v2.ConfigServiceV2.DeleteExclusion", + "service": { + "shortName": "ConfigServiceV2", + "fullName": "google.logging.v2.ConfigServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_ConfigServiceV2_GetCmekSettings_async", + "title": "logging getCmekSettings Sample", + "origin": "API_DEFINITION", + "description": " Gets the Logging CMEK settings for the given resource. Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization. See [Enabling CMEK for Log Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", + "canonical": true, + "file": "config_service_v2.get_cmek_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCmekSettings", + "fullName": "google.logging.v2.ConfigServiceV2.GetCmekSettings", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.logging.v2.CmekSettings", + "client": { + "shortName": "ConfigServiceV2Client", + "fullName": "google.logging.v2.ConfigServiceV2Client" + }, + "method": { + "shortName": "GetCmekSettings", + "fullName": "google.logging.v2.ConfigServiceV2.GetCmekSettings", + "service": { + "shortName": "ConfigServiceV2", + "fullName": "google.logging.v2.ConfigServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_ConfigServiceV2_UpdateCmekSettings_async", + "title": "logging updateCmekSettings Sample", + "origin": "API_DEFINITION", + "description": " Updates the Log Router CMEK settings for the given resource. Note: CMEK for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization. [UpdateCmekSettings][google.logging.v2.ConfigServiceV2.UpdateCmekSettings] will fail if 1) `kms_key_name` is invalid, or 2) the associated service account does not have the required `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or 3) access to the key is disabled. See [Enabling CMEK for Log Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", + "canonical": true, + "file": "config_service_v2.update_cmek_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCmekSettings", + "fullName": "google.logging.v2.ConfigServiceV2.UpdateCmekSettings", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "cmek_settings", + "type": ".google.logging.v2.CmekSettings" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.logging.v2.CmekSettings", + "client": { + "shortName": "ConfigServiceV2Client", + "fullName": "google.logging.v2.ConfigServiceV2Client" + }, + "method": { + "shortName": "UpdateCmekSettings", + "fullName": "google.logging.v2.ConfigServiceV2.UpdateCmekSettings", + "service": { + "shortName": "ConfigServiceV2", + "fullName": "google.logging.v2.ConfigServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_ConfigServiceV2_GetSettings_async", + "title": "logging getSettings Sample", + "origin": "API_DEFINITION", + "description": " Gets the Log Router settings for the given resource. Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization. See [Enabling CMEK for Log Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", + "canonical": true, + "file": "config_service_v2.get_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSettings", + "fullName": "google.logging.v2.ConfigServiceV2.GetSettings", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.logging.v2.Settings", + "client": { + "shortName": "ConfigServiceV2Client", + "fullName": "google.logging.v2.ConfigServiceV2Client" + }, + "method": { + "shortName": "GetSettings", + "fullName": "google.logging.v2.ConfigServiceV2.GetSettings", + "service": { + "shortName": "ConfigServiceV2", + "fullName": "google.logging.v2.ConfigServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_ConfigServiceV2_UpdateSettings_async", + "title": "logging updateSettings Sample", + "origin": "API_DEFINITION", + "description": " Updates the Log Router settings for the given resource. Note: Settings for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization. [UpdateSettings][google.logging.v2.ConfigServiceV2.UpdateSettings] will fail if 1) `kms_key_name` is invalid, or 2) the associated service account does not have the required `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or 3) access to the key is disabled. 4) `location_id` is not supported by Logging. 5) `location_id` violate OrgPolicy. See [Enabling CMEK for Log Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", + "canonical": true, + "file": "config_service_v2.update_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSettings", + "fullName": "google.logging.v2.ConfigServiceV2.UpdateSettings", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "settings", + "type": ".google.logging.v2.Settings" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.logging.v2.Settings", + "client": { + "shortName": "ConfigServiceV2Client", + "fullName": "google.logging.v2.ConfigServiceV2Client" + }, + "method": { + "shortName": "UpdateSettings", + "fullName": "google.logging.v2.ConfigServiceV2.UpdateSettings", + "service": { + "shortName": "ConfigServiceV2", + "fullName": "google.logging.v2.ConfigServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_ConfigServiceV2_CopyLogEntries_async", + "title": "logging copyLogEntries Sample", + "origin": "API_DEFINITION", + "description": " Copies a set of log entries from a log bucket to a Cloud Storage bucket.", + "canonical": true, + "file": "config_service_v2.copy_log_entries.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CopyLogEntries", + "fullName": "google.logging.v2.ConfigServiceV2.CopyLogEntries", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "destination", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ConfigServiceV2Client", + "fullName": "google.logging.v2.ConfigServiceV2Client" + }, + "method": { + "shortName": "CopyLogEntries", + "fullName": "google.logging.v2.ConfigServiceV2.CopyLogEntries", + "service": { + "shortName": "ConfigServiceV2", + "fullName": "google.logging.v2.ConfigServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_LoggingServiceV2_DeleteLog_async", + "title": "logging deleteLog Sample", + "origin": "API_DEFINITION", + "description": " Deletes all the log entries in a log for the _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted.", + "canonical": true, + "file": "logging_service_v2.delete_log.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteLog", + "fullName": "google.logging.v2.LoggingServiceV2.DeleteLog", + "async": true, + "parameters": [ + { + "name": "log_name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "LoggingServiceV2Client", + "fullName": "google.logging.v2.LoggingServiceV2Client" + }, + "method": { + "shortName": "DeleteLog", + "fullName": "google.logging.v2.LoggingServiceV2.DeleteLog", + "service": { + "shortName": "LoggingServiceV2", + "fullName": "google.logging.v2.LoggingServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_LoggingServiceV2_WriteLogEntries_async", + "title": "logging writeLogEntries Sample", + "origin": "API_DEFINITION", + "description": " Writes log entries to Logging. This API method is the only way to send log entries to Logging. This method is used, directly or indirectly, by the Logging agent (fluentd) and all logging libraries configured to use Logging. A single request may contain log entries for a maximum of 1000 different resources (projects, organizations, billing accounts or folders)", + "canonical": true, + "file": "logging_service_v2.write_log_entries.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 116, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "WriteLogEntries", + "fullName": "google.logging.v2.LoggingServiceV2.WriteLogEntries", + "async": true, + "parameters": [ + { + "name": "log_name", + "type": "TYPE_STRING" + }, + { + "name": "resource", + "type": ".google.api.MonitoredResource" + }, + { + "name": "labels", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "entries", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "partial_success", + "type": "TYPE_BOOL" + }, + { + "name": "dry_run", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.logging.v2.WriteLogEntriesResponse", + "client": { + "shortName": "LoggingServiceV2Client", + "fullName": "google.logging.v2.LoggingServiceV2Client" + }, + "method": { + "shortName": "WriteLogEntries", + "fullName": "google.logging.v2.LoggingServiceV2.WriteLogEntries", + "service": { + "shortName": "LoggingServiceV2", + "fullName": "google.logging.v2.LoggingServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_LoggingServiceV2_ListLogEntries_async", + "title": "logging listLogEntries Sample", + "origin": "API_DEFINITION", + "description": " Lists log entries. Use this method to retrieve log entries that originated from a project/folder/organization/billing account. For ways to export log entries, see [Exporting Logs](https://cloud.google.com/logging/docs/export).", + "canonical": true, + "file": "logging_service_v2.list_log_entries.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 96, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListLogEntries", + "fullName": "google.logging.v2.LoggingServiceV2.ListLogEntries", + "async": true, + "parameters": [ + { + "name": "resource_names", + "type": "TYPE_STRING[]" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.logging.v2.ListLogEntriesResponse", + "client": { + "shortName": "LoggingServiceV2Client", + "fullName": "google.logging.v2.LoggingServiceV2Client" + }, + "method": { + "shortName": "ListLogEntries", + "fullName": "google.logging.v2.LoggingServiceV2.ListLogEntries", + "service": { + "shortName": "LoggingServiceV2", + "fullName": "google.logging.v2.LoggingServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_LoggingServiceV2_ListMonitoredResourceDescriptors_async", + "title": "logging listMonitoredResourceDescriptors Sample", + "origin": "API_DEFINITION", + "description": " Lists the descriptors for monitored resource types used by Logging.", + "canonical": true, + "file": "logging_service_v2.list_monitored_resource_descriptors.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListMonitoredResourceDescriptors", + "fullName": "google.logging.v2.LoggingServiceV2.ListMonitoredResourceDescriptors", + "async": true, + "parameters": [ + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.logging.v2.ListMonitoredResourceDescriptorsResponse", + "client": { + "shortName": "LoggingServiceV2Client", + "fullName": "google.logging.v2.LoggingServiceV2Client" + }, + "method": { + "shortName": "ListMonitoredResourceDescriptors", + "fullName": "google.logging.v2.LoggingServiceV2.ListMonitoredResourceDescriptors", + "service": { + "shortName": "LoggingServiceV2", + "fullName": "google.logging.v2.LoggingServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_LoggingServiceV2_ListLogs_async", + "title": "logging listLogs Sample", + "origin": "API_DEFINITION", + "description": " Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", + "canonical": true, + "file": "logging_service_v2.list_logs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListLogs", + "fullName": "google.logging.v2.LoggingServiceV2.ListLogs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "resource_names", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.logging.v2.ListLogsResponse", + "client": { + "shortName": "LoggingServiceV2Client", + "fullName": "google.logging.v2.LoggingServiceV2Client" + }, + "method": { + "shortName": "ListLogs", + "fullName": "google.logging.v2.LoggingServiceV2.ListLogs", + "service": { + "shortName": "LoggingServiceV2", + "fullName": "google.logging.v2.LoggingServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_LoggingServiceV2_TailLogEntries_async", + "title": "logging tailLogEntries Sample", + "origin": "API_DEFINITION", + "description": " Streaming read of log entries as they are ingested. Until the stream is terminated, it will continue reading logs.", + "canonical": true, + "file": "logging_service_v2.tail_log_entries.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TailLogEntries", + "fullName": "google.logging.v2.LoggingServiceV2.TailLogEntries", + "async": true, + "parameters": [ + { + "name": "resource_names", + "type": "TYPE_STRING[]" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "buffer_window", + "type": ".google.protobuf.Duration" + } + ], + "resultType": ".google.logging.v2.TailLogEntriesResponse", + "client": { + "shortName": "LoggingServiceV2Client", + "fullName": "google.logging.v2.LoggingServiceV2Client" + }, + "method": { + "shortName": "TailLogEntries", + "fullName": "google.logging.v2.LoggingServiceV2.TailLogEntries", + "service": { + "shortName": "LoggingServiceV2", + "fullName": "google.logging.v2.LoggingServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_MetricsServiceV2_ListLogMetrics_async", + "title": "logging listLogMetrics Sample", + "origin": "API_DEFINITION", + "description": " Lists logs-based metrics.", + "canonical": true, + "file": "metrics_service_v2.list_log_metrics.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListLogMetrics", + "fullName": "google.logging.v2.MetricsServiceV2.ListLogMetrics", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.logging.v2.ListLogMetricsResponse", + "client": { + "shortName": "MetricsServiceV2Client", + "fullName": "google.logging.v2.MetricsServiceV2Client" + }, + "method": { + "shortName": "ListLogMetrics", + "fullName": "google.logging.v2.MetricsServiceV2.ListLogMetrics", + "service": { + "shortName": "MetricsServiceV2", + "fullName": "google.logging.v2.MetricsServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_MetricsServiceV2_GetLogMetric_async", + "title": "logging getLogMetric Sample", + "origin": "API_DEFINITION", + "description": " Gets a logs-based metric.", + "canonical": true, + "file": "metrics_service_v2.get_log_metric.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetLogMetric", + "fullName": "google.logging.v2.MetricsServiceV2.GetLogMetric", + "async": true, + "parameters": [ + { + "name": "metric_name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.logging.v2.LogMetric", + "client": { + "shortName": "MetricsServiceV2Client", + "fullName": "google.logging.v2.MetricsServiceV2Client" + }, + "method": { + "shortName": "GetLogMetric", + "fullName": "google.logging.v2.MetricsServiceV2.GetLogMetric", + "service": { + "shortName": "MetricsServiceV2", + "fullName": "google.logging.v2.MetricsServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_MetricsServiceV2_CreateLogMetric_async", + "title": "logging createLogMetric Sample", + "origin": "API_DEFINITION", + "description": " Creates a logs-based metric.", + "canonical": true, + "file": "metrics_service_v2.create_log_metric.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateLogMetric", + "fullName": "google.logging.v2.MetricsServiceV2.CreateLogMetric", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "metric", + "type": ".google.logging.v2.LogMetric" + } + ], + "resultType": ".google.logging.v2.LogMetric", + "client": { + "shortName": "MetricsServiceV2Client", + "fullName": "google.logging.v2.MetricsServiceV2Client" + }, + "method": { + "shortName": "CreateLogMetric", + "fullName": "google.logging.v2.MetricsServiceV2.CreateLogMetric", + "service": { + "shortName": "MetricsServiceV2", + "fullName": "google.logging.v2.MetricsServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_MetricsServiceV2_UpdateLogMetric_async", + "title": "logging updateLogMetric Sample", + "origin": "API_DEFINITION", + "description": " Creates or updates a logs-based metric.", + "canonical": true, + "file": "metrics_service_v2.update_log_metric.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateLogMetric", + "fullName": "google.logging.v2.MetricsServiceV2.UpdateLogMetric", + "async": true, + "parameters": [ + { + "name": "metric_name", + "type": "TYPE_STRING" + }, + { + "name": "metric", + "type": ".google.logging.v2.LogMetric" + } + ], + "resultType": ".google.logging.v2.LogMetric", + "client": { + "shortName": "MetricsServiceV2Client", + "fullName": "google.logging.v2.MetricsServiceV2Client" + }, + "method": { + "shortName": "UpdateLogMetric", + "fullName": "google.logging.v2.MetricsServiceV2.UpdateLogMetric", + "service": { + "shortName": "MetricsServiceV2", + "fullName": "google.logging.v2.MetricsServiceV2" + } + } + } + }, + { + "regionTag": "logging_v2_generated_MetricsServiceV2_DeleteLogMetric_async", + "title": "logging deleteLogMetric Sample", + "origin": "API_DEFINITION", + "description": " Deletes a logs-based metric.", + "canonical": true, + "file": "metrics_service_v2.delete_log_metric.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteLogMetric", + "fullName": "google.logging.v2.MetricsServiceV2.DeleteLogMetric", + "async": true, + "parameters": [ + { + "name": "metric_name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "MetricsServiceV2Client", + "fullName": "google.logging.v2.MetricsServiceV2Client" + }, + "method": { + "shortName": "DeleteLogMetric", + "fullName": "google.logging.v2.MetricsServiceV2.DeleteLogMetric", + "service": { + "shortName": "MetricsServiceV2", + "fullName": "google.logging.v2.MetricsServiceV2" + } + } + } + } + ] +} diff --git a/src/v2/config_service_v2_client.ts b/src/v2/config_service_v2_client.ts index d7fdc2a4..a9a55db3 100644 --- a/src/v2/config_service_v2_client.ts +++ b/src/v2/config_service_v2_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -37,7 +38,7 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './config_service_v2_client_config.json'; - +import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -63,6 +64,7 @@ export class ConfigServiceV2Client { warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; configServiceV2Stub?: Promise<{[name: string]: Function}>; /** @@ -181,6 +183,9 @@ export class ConfigServiceV2Client { billingAccountLogPathTemplate: new this._gaxModule.PathTemplate( 'billingAccounts/{billing_account}/logs/{log}' ), + billingAccountSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'billingAccounts/{billing_account}/settings' + ), billingAccountSinkPathTemplate: new this._gaxModule.PathTemplate( 'billingAccounts/{billing_account}/sinks/{sink}' ), @@ -199,6 +204,9 @@ export class ConfigServiceV2Client { folderLogPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/logs/{log}' ), + folderSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/settings' + ), folderSinkPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/sinks/{sink}' ), @@ -224,6 +232,9 @@ export class ConfigServiceV2Client { organizationLogPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/logs/{log}' ), + organizationSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/settings' + ), organizationSinkPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/sinks/{sink}' ), @@ -245,6 +256,9 @@ export class ConfigServiceV2Client { projectLogPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/logs/{log}' ), + projectSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/settings' + ), projectSinkPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/sinks/{sink}' ), @@ -276,6 +290,33 @@ export class ConfigServiceV2Client { ), }; + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + + this.operationsClient = this._gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }) + .operationsClient(opts); + const copyLogEntriesResponse = protoFilesRoot.lookup( + '.google.logging.v2.CopyLogEntriesResponse' + ) as gax.protobuf.Type; + const copyLogEntriesMetadata = protoFilesRoot.lookup( + '.google.logging.v2.CopyLogEntriesMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + copyLogEntries: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + copyLogEntriesResponse.decode.bind(copyLogEntriesResponse), + copyLogEntriesMetadata.decode.bind(copyLogEntriesMetadata) + ), + }; + // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( 'google.logging.v2.ConfigServiceV2', @@ -349,6 +390,9 @@ export class ConfigServiceV2Client { 'deleteExclusion', 'getCmekSettings', 'updateCmekSettings', + 'getSettings', + 'updateSettings', + 'copyLogEntries', ]; for (const methodName of configServiceV2StubMethods) { const callPromise = this.configServiceV2Stub.then( @@ -365,7 +409,10 @@ export class ConfigServiceV2Client { } ); - const descriptor = this.descriptors.page[methodName] || undefined; + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], @@ -437,7 +484,7 @@ export class ConfigServiceV2Client { // -- Service calls -- // ------------------- /** - * Gets a bucket. + * Gets a log bucket. * * @param {Object} request * The request object that will be sent. @@ -449,8 +496,9 @@ export class ConfigServiceV2Client { * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" * - * Example: - * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`. + * For example: + * + * `"projects/my-project/locations/global/buckets/my-bucket"` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -528,21 +576,23 @@ export class ConfigServiceV2Client { return this.innerApiCalls.getBucket(request, options, callback); } /** - * Creates a bucket that can be used to store log entries. Once a bucket has - * been created, the region cannot be changed. + * Creates a log bucket that can be used to store log entries. After a bucket + * has been created, the bucket's location cannot be changed. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The resource in which to create the bucket: + * Required. The resource in which to create the log bucket: * * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" * - * Example: `"projects/my-logging-project/locations/global"` + * For example: + * + * `"projects/my-project/locations/global"` * @param {string} request.bucketId - * Required. A client-assigned identifier such as `"my-bucket"`. Identifiers are - * limited to 100 characters and can include only letters, digits, - * underscores, hyphens, and periods. + * Required. A client-assigned identifier such as `"my-bucket"`. Identifiers are limited + * to 100 characters and can include only letters, digits, underscores, + * hyphens, and periods. * @param {google.logging.v2.LogBucket} request.bucket * Required. The new bucket. The region specified in the new bucket must be compliant * with any Location Restriction Org Policy. The name field in the bucket is @@ -624,16 +674,16 @@ export class ConfigServiceV2Client { return this.innerApiCalls.createBucket(request, options, callback); } /** - * Updates a bucket. This method replaces the following fields in the + * Updates a log bucket. This method replaces the following fields in the * existing bucket with values from the new bucket: `retention_period` * * If the retention period is decreased and the bucket is locked, - * FAILED_PRECONDITION will be returned. + * `FAILED_PRECONDITION` will be returned. * - * If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION - * will be returned. + * If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then + * `FAILED_PRECONDITION` will be returned. * - * A buckets region may not be modified after it is created. + * After a bucket has been created, the bucket's location cannot be changed. * * @param {Object} request * The request object that will be sent. @@ -645,21 +695,20 @@ export class ConfigServiceV2Client { * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" * - * Example: - * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`. Also - * requires permission "resourcemanager.projects.updateLiens" to set the - * locked property + * For example: + * + * `"projects/my-project/locations/global/buckets/my-bucket"` * @param {google.logging.v2.LogBucket} request.bucket * Required. The updated bucket. * @param {google.protobuf.FieldMask} request.updateMask * Required. Field mask that specifies the fields in `bucket` that need an update. A - * bucket field will be overwritten if, and only if, it is in the update - * mask. `name` and output only fields cannot be updated. + * bucket field will be overwritten if, and only if, it is in the update mask. + * `name` and output only fields cannot be updated. * - * For a detailed `FieldMask` definition, see + * For a detailed `FieldMask` definition, see: * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask * - * Example: `updateMask=retention_days`. + * For example: `updateMask=retention_days` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -737,10 +786,11 @@ export class ConfigServiceV2Client { return this.innerApiCalls.updateBucket(request, options, callback); } /** - * Deletes a bucket. - * Moves the bucket to the DELETE_REQUESTED state. After 7 days, the - * bucket will be purged and all logs in the bucket will be permanently - * deleted. + * Deletes a log bucket. + * + * Changes the bucket's `lifecycle_state` to the `DELETE_REQUESTED` state. + * After 7 days, the bucket will be purged and all log entries in the bucket + * will be permanently deleted. * * @param {Object} request * The request object that will be sent. @@ -752,8 +802,9 @@ export class ConfigServiceV2Client { * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" * - * Example: - * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`. + * For example: + * + * `"projects/my-project/locations/global/buckets/my-bucket"` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -831,8 +882,8 @@ export class ConfigServiceV2Client { return this.innerApiCalls.deleteBucket(request, options, callback); } /** - * Undeletes a bucket. A bucket that has been deleted may be undeleted within - * the grace period of 7 days. + * Undeletes a log bucket. A bucket that has been deleted can be undeleted + * within the grace period of 7 days. * * @param {Object} request * The request object that will be sent. @@ -844,8 +895,9 @@ export class ConfigServiceV2Client { * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" * - * Example: - * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`. + * For example: + * + * `"projects/my-project/locations/global/buckets/my-bucket"` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -923,7 +975,7 @@ export class ConfigServiceV2Client { return this.innerApiCalls.undeleteBucket(request, options, callback); } /** - * Gets a view. + * Gets a view on a log bucket.. * * @param {Object} request * The request object that will be sent. @@ -932,8 +984,9 @@ export class ConfigServiceV2Client { * * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" * - * Example: - * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id"`. + * For example: + * + * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1011,18 +1064,19 @@ export class ConfigServiceV2Client { return this.innerApiCalls.getView(request, options, callback); } /** - * Creates a view over logs in a bucket. A bucket may contain a maximum of - * 50 views. + * Creates a view over log entries in a log bucket. A bucket may contain a + * maximum of 30 views. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The bucket in which to create the view * - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"` * - * Example: - * `"projects/my-logging-project/locations/my-location/buckets/my-bucket"` + * For example: + * + * `"projects/my-project/locations/global/buckets/my-bucket"` * @param {string} request.viewId * Required. The id to use for this view. * @param {google.logging.v2.LogView} request.view @@ -1104,8 +1158,11 @@ export class ConfigServiceV2Client { return this.innerApiCalls.createView(request, options, callback); } /** - * Updates a view. This method replaces the following fields in the existing - * view with values from the new view: `filter`. + * Updates a view on a log bucket. This method replaces the following fields + * in the existing view with values from the new view: `filter`. + * If an `UNAVAILABLE` error is returned, this indicates that system is not in + * a state where it can update the view. If this occurs, please try again in a + * few minutes. * * @param {Object} request * The request object that will be sent. @@ -1114,8 +1171,9 @@ export class ConfigServiceV2Client { * * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" * - * Example: - * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id"`. + * For example: + * + * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` * @param {google.logging.v2.LogView} request.view * Required. The updated view. * @param {google.protobuf.FieldMask} [request.updateMask] @@ -1126,7 +1184,7 @@ export class ConfigServiceV2Client { * For a detailed `FieldMask` definition, see * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask * - * Example: `updateMask=filter`. + * For example: `updateMask=filter` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1204,7 +1262,10 @@ export class ConfigServiceV2Client { return this.innerApiCalls.updateView(request, options, callback); } /** - * Deletes a view from a bucket. + * Deletes a view on a log bucket. + * If an `UNAVAILABLE` error is returned, this indicates that system is not in + * a state where it can delete the view. If this occurs, please try again in a + * few minutes. * * @param {Object} request * The request object that will be sent. @@ -1213,8 +1274,9 @@ export class ConfigServiceV2Client { * * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" * - * Example: - * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id"`. + * For example: + * + * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1304,7 +1366,9 @@ export class ConfigServiceV2Client { * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" * "folders/[FOLDER_ID]/sinks/[SINK_ID]" * - * Example: `"projects/my-project-id/sinks/my-sink-id"`. + * For example: + * + * `"projects/my-project/sinks/my-sink"` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1397,7 +1461,10 @@ export class ConfigServiceV2Client { * "billingAccounts/[BILLING_ACCOUNT_ID]" * "folders/[FOLDER_ID]" * - * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`. + * For examples: + * + * `"projects/my-project"` + * `"organizations/123456789"` * @param {google.logging.v2.LogSink} request.sink * Required. The new sink, whose `name` parameter is a sink identifier that * is not already in use. @@ -1405,9 +1472,9 @@ export class ConfigServiceV2Client { * Optional. Determines the kind of IAM identity returned as `writer_identity` * in the new sink. If this value is omitted or set to false, and if the * sink's parent is a project, then the value returned as `writer_identity` is - * the same group or service account used by Logging before the addition of - * writer identities to this API. The sink's destination must be in the same - * project as the sink itself. + * the same group or service account used by Cloud Logging before the addition + * of writer identities to this API. The sink's destination must be in the + * same project as the sink itself. * * If this field is set to true, or if the sink is owned by a non-project * resource such as an organization, then the value of `writer_identity` will @@ -1507,7 +1574,9 @@ export class ConfigServiceV2Client { * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" * "folders/[FOLDER_ID]/sinks/[SINK_ID]" * - * Example: `"projects/my-project-id/sinks/my-sink-id"`. + * For example: + * + * `"projects/my-project/sinks/my-sink"` * @param {google.logging.v2.LogSink} request.sink * Required. The updated sink, whose name is the same identifier that appears as part * of `sink_name`. @@ -1528,16 +1597,18 @@ export class ConfigServiceV2Client { * an update. A sink field will be overwritten if, and only if, it is * in the update mask. `name` and output only fields cannot be updated. * - * An empty updateMask is temporarily treated as using the following mask + * An empty `updateMask` is temporarily treated as using the following mask * for backwards compatibility purposes: - * destination,filter,includeChildren + * + * `destination,filter,includeChildren` + * * At some point in the future, behavior will be removed and specifying an - * empty updateMask will be an error. + * empty `updateMask` will be an error. * * For a detailed `FieldMask` definition, see * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask * - * Example: `updateMask=filter`. + * For example: `updateMask=filter` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1629,7 +1700,9 @@ export class ConfigServiceV2Client { * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" * "folders/[FOLDER_ID]/sinks/[SINK_ID]" * - * Example: `"projects/my-project-id/sinks/my-sink-id"`. + * For example: + * + * `"projects/my-project/sinks/my-sink"` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1707,7 +1780,7 @@ export class ConfigServiceV2Client { return this.innerApiCalls.deleteSink(request, options, callback); } /** - * Gets the description of an exclusion. + * Gets the description of an exclusion in the _Default sink. * * @param {Object} request * The request object that will be sent. @@ -1719,7 +1792,9 @@ export class ConfigServiceV2Client { * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" * - * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`. + * For example: + * + * `"projects/my-project/exclusions/my-exclusion"` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1797,9 +1872,9 @@ export class ConfigServiceV2Client { return this.innerApiCalls.getExclusion(request, options, callback); } /** - * Creates a new exclusion in a specified parent resource. - * Only log entries belonging to that resource can be excluded. - * You can have up to 10 exclusions in a resource. + * Creates a new exclusion in the _Default sink in a specified parent + * resource. Only log entries belonging to that resource can be excluded. You + * can have up to 10 exclusions in a resource. * * @param {Object} request * The request object that will be sent. @@ -1811,7 +1886,10 @@ export class ConfigServiceV2Client { * "billingAccounts/[BILLING_ACCOUNT_ID]" * "folders/[FOLDER_ID]" * - * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`. + * For examples: + * + * `"projects/my-logging-project"` + * `"organizations/123456789"` * @param {google.logging.v2.LogExclusion} request.exclusion * Required. The new exclusion, whose `name` parameter is an exclusion name * that is not already used in the parent resource. @@ -1892,7 +1970,8 @@ export class ConfigServiceV2Client { return this.innerApiCalls.createExclusion(request, options, callback); } /** - * Changes one or more properties of an existing exclusion. + * Changes one or more properties of an existing exclusion in the _Default + * sink. * * @param {Object} request * The request object that will be sent. @@ -1904,7 +1983,9 @@ export class ConfigServiceV2Client { * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" * - * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`. + * For example: + * + * `"projects/my-project/exclusions/my-exclusion"` * @param {google.logging.v2.LogExclusion} request.exclusion * Required. New values for the existing exclusion. Only the fields specified in * `update_mask` are relevant. @@ -1993,7 +2074,7 @@ export class ConfigServiceV2Client { return this.innerApiCalls.updateExclusion(request, options, callback); } /** - * Deletes an exclusion. + * Deletes an exclusion in the _Default sink. * * @param {Object} request * The request object that will be sent. @@ -2005,7 +2086,9 @@ export class ConfigServiceV2Client { * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" * - * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`. + * For example: + * + * `"projects/my-project/exclusions/my-exclusion"` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -2083,13 +2166,14 @@ export class ConfigServiceV2Client { return this.innerApiCalls.deleteExclusion(request, options, callback); } /** - * Gets the Logs Router CMEK settings for the given resource. + * Gets the Logging CMEK settings for the given resource. * - * Note: CMEK for the Logs Router can currently only be configured for GCP - * organizations. Once configured, it applies to all projects and folders in - * the GCP organization. + * Note: CMEK for the Log Router can be configured for Google Cloud projects, + * folders, organizations and billing accounts. Once configured for an + * organization, it applies to all projects and folders in the Google Cloud + * organization. * - * See [Enabling CMEK for Logs + * See [Enabling CMEK for Log * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) * for more information. * @@ -2103,11 +2187,14 @@ export class ConfigServiceV2Client { * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" * "folders/[FOLDER_ID]/cmekSettings" * - * Example: `"organizations/12345/cmekSettings"`. + * For example: + * + * `"organizations/12345/cmekSettings"` * - * Note: CMEK for the Logs Router can currently only be configured for GCP - * organizations. Once configured, it applies to all projects and folders in - * the GCP organization. + * Note: CMEK for the Log Router can be configured for Google Cloud projects, + * folders, organizations and billing accounts. Once configured for an + * organization, it applies to all projects and folders in the Google Cloud + * organization. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -2185,11 +2272,11 @@ export class ConfigServiceV2Client { return this.innerApiCalls.getCmekSettings(request, options, callback); } /** - * Updates the Logs Router CMEK settings for the given resource. + * Updates the Log Router CMEK settings for the given resource. * - * Note: CMEK for the Logs Router can currently only be configured for GCP - * organizations. Once configured, it applies to all projects and folders in - * the GCP organization. + * Note: CMEK for the Log Router can currently only be configured for Google + * Cloud organizations. Once configured, it applies to all projects and + * folders in the Google Cloud organization. * * {@link google.logging.v2.ConfigServiceV2.UpdateCmekSettings|UpdateCmekSettings} * will fail if 1) `kms_key_name` is invalid, or 2) the associated service @@ -2197,7 +2284,7 @@ export class ConfigServiceV2Client { * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or * 3) access to the key is disabled. * - * See [Enabling CMEK for Logs + * See [Enabling CMEK for Log * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) * for more information. * @@ -2211,15 +2298,17 @@ export class ConfigServiceV2Client { * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" * "folders/[FOLDER_ID]/cmekSettings" * - * Example: `"organizations/12345/cmekSettings"`. + * For example: * - * Note: CMEK for the Logs Router can currently only be configured for GCP - * organizations. Once configured, it applies to all projects and folders in - * the GCP organization. + * `"organizations/12345/cmekSettings"` + * + * Note: CMEK for the Log Router can currently only be configured for Google + * Cloud organizations. Once configured, it applies to all projects and + * folders in the Google Cloud organization. * @param {google.logging.v2.CmekSettings} request.cmekSettings * Required. The CMEK settings to update. * - * See [Enabling CMEK for Logs + * See [Enabling CMEK for Log * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) * for more information. * @param {google.protobuf.FieldMask} [request.updateMask] @@ -2229,7 +2318,7 @@ export class ConfigServiceV2Client { * * See {@link google.protobuf.FieldMask|FieldMask} for more information. * - * Example: `"updateMask=kmsKeyName"` + * For example: `"updateMask=kmsKeyName"` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -2308,9 +2397,379 @@ export class ConfigServiceV2Client { this.initialize(); return this.innerApiCalls.updateCmekSettings(request, options, callback); } + /** + * Gets the Log Router settings for the given resource. + * + * Note: Settings for the Log Router can be get for Google Cloud projects, + * folders, organizations and billing accounts. Currently it can only be + * configured for organizations. Once configured for an organization, it + * applies to all projects and folders in the Google Cloud organization. + * + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource for which to retrieve settings. + * + * "projects/[PROJECT_ID]/settings" + * "organizations/[ORGANIZATION_ID]/settings" + * "billingAccounts/[BILLING_ACCOUNT_ID]/settings" + * "folders/[FOLDER_ID]/settings" + * + * For example: + * + * `"organizations/12345/settings"` + * + * Note: Settings for the Log Router can be get for Google Cloud projects, + * folders, organizations and billing accounts. Currently it can only be + * configured for organizations. Once configured for an organization, it + * applies to all projects and folders in the Google Cloud organization. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Settings]{@link google.logging.v2.Settings}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.get_settings.js + * region_tag:logging_v2_generated_ConfigServiceV2_GetSettings_async + */ + getSettings( + request?: protos.google.logging.v2.IGetSettingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.logging.v2.ISettings, + protos.google.logging.v2.IGetSettingsRequest | undefined, + {} | undefined + ] + >; + getSettings( + request: protos.google.logging.v2.IGetSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.logging.v2.ISettings, + protos.google.logging.v2.IGetSettingsRequest | null | undefined, + {} | null | undefined + > + ): void; + getSettings( + request: protos.google.logging.v2.IGetSettingsRequest, + callback: Callback< + protos.google.logging.v2.ISettings, + protos.google.logging.v2.IGetSettingsRequest | null | undefined, + {} | null | undefined + > + ): void; + getSettings( + request?: protos.google.logging.v2.IGetSettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.logging.v2.ISettings, + protos.google.logging.v2.IGetSettingsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.logging.v2.ISettings, + protos.google.logging.v2.IGetSettingsRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.logging.v2.ISettings, + protos.google.logging.v2.IGetSettingsRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getSettings(request, options, callback); + } + /** + * Updates the Log Router settings for the given resource. + * + * Note: Settings for the Log Router can currently only be configured for + * Google Cloud organizations. Once configured, it applies to all projects and + * folders in the Google Cloud organization. + * + * {@link google.logging.v2.ConfigServiceV2.UpdateSettings|UpdateSettings} + * will fail if 1) `kms_key_name` is invalid, or 2) the associated service + * account does not have the required + * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or + * 3) access to the key is disabled. 4) `location_id` is not supported by + * Logging. 5) `location_id` violate OrgPolicy. + * + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name for the settings to update. + * + * "organizations/[ORGANIZATION_ID]/settings" + * + * For example: + * + * `"organizations/12345/settings"` + * + * Note: Settings for the Log Router can currently only be configured for + * Google Cloud organizations. Once configured, it applies to all projects and + * folders in the Google Cloud organization. + * @param {google.logging.v2.Settings} request.settings + * Required. The settings to update. + * + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask identifying which fields from `settings` should + * be updated. A field will be overwritten if and only if it is in the update + * mask. Output only fields cannot be updated. + * + * See {@link google.protobuf.FieldMask|FieldMask} for more information. + * + * For example: `"updateMask=kmsKeyName"` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Settings]{@link google.logging.v2.Settings}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.update_settings.js + * region_tag:logging_v2_generated_ConfigServiceV2_UpdateSettings_async + */ + updateSettings( + request?: protos.google.logging.v2.IUpdateSettingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.logging.v2.ISettings, + protos.google.logging.v2.IUpdateSettingsRequest | undefined, + {} | undefined + ] + >; + updateSettings( + request: protos.google.logging.v2.IUpdateSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.logging.v2.ISettings, + protos.google.logging.v2.IUpdateSettingsRequest | null | undefined, + {} | null | undefined + > + ): void; + updateSettings( + request: protos.google.logging.v2.IUpdateSettingsRequest, + callback: Callback< + protos.google.logging.v2.ISettings, + protos.google.logging.v2.IUpdateSettingsRequest | null | undefined, + {} | null | undefined + > + ): void; + updateSettings( + request?: protos.google.logging.v2.IUpdateSettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.logging.v2.ISettings, + protos.google.logging.v2.IUpdateSettingsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.logging.v2.ISettings, + protos.google.logging.v2.IUpdateSettingsRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.logging.v2.ISettings, + protos.google.logging.v2.IUpdateSettingsRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateSettings(request, options, callback); + } /** - * Lists buckets. + * Copies a set of log entries from a log bucket to a Cloud Storage bucket. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Log bucket from which to copy log entries. + * + * For example: + * + * `"projects/my-project/locations/global/buckets/my-source-bucket"` + * @param {string} [request.filter] + * Optional. A filter specifying which log entries to copy. The filter must be no more + * than 20k characters. An empty filter matches all log entries. + * @param {string} request.destination + * Required. Destination to which to copy log entries. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.copy_log_entries.js + * region_tag:logging_v2_generated_ConfigServiceV2_CopyLogEntries_async + */ + copyLogEntries( + request?: protos.google.logging.v2.ICopyLogEntriesRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.logging.v2.ICopyLogEntriesResponse, + protos.google.logging.v2.ICopyLogEntriesMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + copyLogEntries( + request: protos.google.logging.v2.ICopyLogEntriesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.logging.v2.ICopyLogEntriesResponse, + protos.google.logging.v2.ICopyLogEntriesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + copyLogEntries( + request: protos.google.logging.v2.ICopyLogEntriesRequest, + callback: Callback< + LROperation< + protos.google.logging.v2.ICopyLogEntriesResponse, + protos.google.logging.v2.ICopyLogEntriesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + copyLogEntries( + request?: protos.google.logging.v2.ICopyLogEntriesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.logging.v2.ICopyLogEntriesResponse, + protos.google.logging.v2.ICopyLogEntriesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.logging.v2.ICopyLogEntriesResponse, + protos.google.logging.v2.ICopyLogEntriesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.logging.v2.ICopyLogEntriesResponse, + protos.google.logging.v2.ICopyLogEntriesMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize(); + return this.innerApiCalls.copyLogEntries(request, options, callback); + } + /** + * Check the status of the long running operation returned by `copyLogEntries()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.copy_log_entries.js + * region_tag:logging_v2_generated_ConfigServiceV2_CopyLogEntries_async + */ + async checkCopyLogEntriesProgress( + name: string + ): Promise< + LROperation< + protos.google.logging.v2.CopyLogEntriesResponse, + protos.google.logging.v2.CopyLogEntriesMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.copyLogEntries, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.logging.v2.CopyLogEntriesResponse, + protos.google.logging.v2.CopyLogEntriesMetadata + >; + } + /** + * Lists log buckets. * * @param {Object} request * The request object that will be sent. @@ -2326,14 +2785,14 @@ export class ConfigServiceV2Client { * supplying the character `-` in place of [LOCATION_ID] will return all * buckets. * @param {string} [request.pageToken] - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. + * Optional. If present, then retrieve the next batch of results from the preceding call + * to this method. `pageToken` must be the value of `nextPageToken` from the + * previous response. The values of other method parameters should be + * identical to those in the previous call. * @param {number} [request.pageSize] - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. + * Optional. The maximum number of results to return from this request. Non-positive + * values are ignored. The presence of `nextPageToken` in the response + * indicates that more results might be available. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -2430,14 +2889,14 @@ export class ConfigServiceV2Client { * supplying the character `-` in place of [LOCATION_ID] will return all * buckets. * @param {string} [request.pageToken] - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. + * Optional. If present, then retrieve the next batch of results from the preceding call + * to this method. `pageToken` must be the value of `nextPageToken` from the + * previous response. The values of other method parameters should be + * identical to those in the previous call. * @param {number} [request.pageSize] - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. + * Optional. The maximum number of results to return from this request. Non-positive + * values are ignored. The presence of `nextPageToken` in the response + * indicates that more results might be available. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -2490,14 +2949,14 @@ export class ConfigServiceV2Client { * supplying the character `-` in place of [LOCATION_ID] will return all * buckets. * @param {string} [request.pageToken] - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. + * Optional. If present, then retrieve the next batch of results from the preceding call + * to this method. `pageToken` must be the value of `nextPageToken` from the + * previous response. The values of other method parameters should be + * identical to those in the previous call. * @param {number} [request.pageSize] - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. + * Optional. The maximum number of results to return from this request. Non-positive + * values are ignored. The presence of `nextPageToken` in the response + * indicates that more results might be available. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} @@ -2533,7 +2992,7 @@ export class ConfigServiceV2Client { ) as AsyncIterable; } /** - * Lists views on a bucket. + * Lists views on a log bucket. * * @param {Object} request * The request object that will be sent. @@ -2542,12 +3001,13 @@ export class ConfigServiceV2Client { * * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" * @param {string} [request.pageToken] - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. + * Optional. If present, then retrieve the next batch of results from the preceding call + * to this method. `pageToken` must be the value of `nextPageToken` from the + * previous response. The values of other method parameters should be + * identical to those in the previous call. * @param {number} [request.pageSize] * Optional. The maximum number of results to return from this request. + * * Non-positive values are ignored. The presence of `nextPageToken` in the * response indicates that more results might be available. * @param {object} [options] @@ -2639,12 +3099,13 @@ export class ConfigServiceV2Client { * * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" * @param {string} [request.pageToken] - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. + * Optional. If present, then retrieve the next batch of results from the preceding call + * to this method. `pageToken` must be the value of `nextPageToken` from the + * previous response. The values of other method parameters should be + * identical to those in the previous call. * @param {number} [request.pageSize] * Optional. The maximum number of results to return from this request. + * * Non-positive values are ignored. The presence of `nextPageToken` in the * response indicates that more results might be available. * @param {object} [options] @@ -2692,12 +3153,13 @@ export class ConfigServiceV2Client { * * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" * @param {string} [request.pageToken] - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. + * Optional. If present, then retrieve the next batch of results from the preceding call + * to this method. `pageToken` must be the value of `nextPageToken` from the + * previous response. The values of other method parameters should be + * identical to those in the previous call. * @param {number} [request.pageSize] * Optional. The maximum number of results to return from this request. + * * Non-positive values are ignored. The presence of `nextPageToken` in the * response indicates that more results might be available. * @param {object} [options] @@ -2946,7 +3408,7 @@ export class ConfigServiceV2Client { ) as AsyncIterable; } /** - * Lists all the exclusions in a parent resource. + * Lists all the exclusions on the _Default sink in a parent resource. * * @param {Object} request * The request object that will be sent. @@ -3421,6 +3883,33 @@ export class ConfigServiceV2Client { ).log; } + /** + * Return a fully-qualified billingAccountSettings resource name string. + * + * @param {string} billing_account + * @returns {string} Resource name string. + */ + billingAccountSettingsPath(billingAccount: string) { + return this.pathTemplates.billingAccountSettingsPathTemplate.render({ + billing_account: billingAccount, + }); + } + + /** + * Parse the billing_account from BillingAccountSettings resource. + * + * @param {string} billingAccountSettingsName + * A fully-qualified path representing billing_account_settings resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountSettingsName( + billingAccountSettingsName: string + ) { + return this.pathTemplates.billingAccountSettingsPathTemplate.match( + billingAccountSettingsName + ).billing_account; + } + /** * Return a fully-qualified billingAccountSink resource name string. * @@ -3702,6 +4191,31 @@ export class ConfigServiceV2Client { return this.pathTemplates.folderLogPathTemplate.match(folderLogName).log; } + /** + * Return a fully-qualified folderSettings resource name string. + * + * @param {string} folder + * @returns {string} Resource name string. + */ + folderSettingsPath(folder: string) { + return this.pathTemplates.folderSettingsPathTemplate.render({ + folder: folder, + }); + } + + /** + * Parse the folder from FolderSettings resource. + * + * @param {string} folderSettingsName + * A fully-qualified path representing folder_settings resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSettingsName(folderSettingsName: string) { + return this.pathTemplates.folderSettingsPathTemplate.match( + folderSettingsName + ).folder; + } + /** * Return a fully-qualified folderSink resource name string. * @@ -4073,6 +4587,33 @@ export class ConfigServiceV2Client { ).log; } + /** + * Return a fully-qualified organizationSettings resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationSettingsPath(organization: string) { + return this.pathTemplates.organizationSettingsPathTemplate.render({ + organization: organization, + }); + } + + /** + * Parse the organization from OrganizationSettings resource. + * + * @param {string} organizationSettingsName + * A fully-qualified path representing organization_settings resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSettingsName( + organizationSettingsName: string + ) { + return this.pathTemplates.organizationSettingsPathTemplate.match( + organizationSettingsName + ).organization; + } + /** * Return a fully-qualified organizationSink resource name string. * @@ -4378,6 +4919,31 @@ export class ConfigServiceV2Client { return this.pathTemplates.projectLogPathTemplate.match(projectLogName).log; } + /** + * Return a fully-qualified projectSettings resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectSettingsPath(project: string) { + return this.pathTemplates.projectSettingsPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from ProjectSettings resource. + * + * @param {string} projectSettingsName + * A fully-qualified path representing project_settings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSettingsName(projectSettingsName: string) { + return this.pathTemplates.projectSettingsPathTemplate.match( + projectSettingsName + ).project; + } + /** * Return a fully-qualified projectSink resource name string. * @@ -4423,11 +4989,11 @@ export class ConfigServiceV2Client { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.configServiceV2Stub!.then(stub => { + if (this.configServiceV2Stub && !this._terminated) { + return this.configServiceV2Stub.then(stub => { this._terminated = true; stub.close(); + this.operationsClient.close(); }); } return Promise.resolve(); diff --git a/src/v2/config_service_v2_client_config.json b/src/v2/config_service_v2_client_config.json index ca024e51..5ae5608c 100644 --- a/src/v2/config_service_v2_client_config.json +++ b/src/v2/config_service_v2_client_config.json @@ -126,6 +126,18 @@ "UpdateCmekSettings": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "GetSettings": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSettings": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CopyLogEntries": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/src/v2/gapic_metadata.json b/src/v2/gapic_metadata.json index cc8c175a..6a98ee8b 100644 --- a/src/v2/gapic_metadata.json +++ b/src/v2/gapic_metadata.json @@ -105,6 +105,21 @@ "updateCmekSettings" ] }, + "GetSettings": { + "methods": [ + "getSettings" + ] + }, + "UpdateSettings": { + "methods": [ + "updateSettings" + ] + }, + "CopyLogEntries": { + "methods": [ + "copyLogEntries" + ] + }, "ListBuckets": { "methods": [ "listBuckets", @@ -233,6 +248,21 @@ "updateCmekSettings" ] }, + "GetSettings": { + "methods": [ + "getSettings" + ] + }, + "UpdateSettings": { + "methods": [ + "updateSettings" + ] + }, + "CopyLogEntries": { + "methods": [ + "copyLogEntries" + ] + }, "ListBuckets": { "methods": [ "listBuckets", diff --git a/src/v2/logging_service_v2_client.ts b/src/v2/logging_service_v2_client.ts index 2d4f9314..c3d839d7 100644 --- a/src/v2/logging_service_v2_client.ts +++ b/src/v2/logging_service_v2_client.ts @@ -25,10 +25,12 @@ import { ClientOptions, PaginationCallback, GaxCall, + GoogleError, } from 'google-gax'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; +import {PassThrough} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -181,6 +183,9 @@ export class LoggingServiceV2Client { billingAccountLogPathTemplate: new this._gaxModule.PathTemplate( 'billingAccounts/{billing_account}/logs/{log}' ), + billingAccountSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'billingAccounts/{billing_account}/settings' + ), billingAccountSinkPathTemplate: new this._gaxModule.PathTemplate( 'billingAccounts/{billing_account}/sinks/{sink}' ), @@ -199,6 +204,9 @@ export class LoggingServiceV2Client { folderLogPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/logs/{log}' ), + folderSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/settings' + ), folderSinkPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/sinks/{sink}' ), @@ -221,6 +229,9 @@ export class LoggingServiceV2Client { organizationLogPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/logs/{log}' ), + organizationSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/settings' + ), organizationSinkPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/sinks/{sink}' ), @@ -242,6 +253,9 @@ export class LoggingServiceV2Client { projectLogPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/logs/{log}' ), + projectSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/settings' + ), projectSinkPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/sinks/{sink}' ), @@ -355,6 +369,16 @@ export class LoggingServiceV2Client { stub => (...args: Array<{}>) => { if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough(); + setImmediate(() => { + stream.emit( + 'error', + new GoogleError('The client has already been closed.') + ); + }); + return stream; + } return Promise.reject('The client has already been closed.'); } const func = stub[methodName]; @@ -442,24 +466,25 @@ export class LoggingServiceV2Client { // -- Service calls -- // ------------------- /** - * Deletes all the log entries in a log. The log reappears if it receives new - * entries. Log entries written shortly before the delete operation might not - * be deleted. Entries received after the delete operation with a timestamp - * before the operation will be deleted. + * Deletes all the log entries in a log for the _Default Log Bucket. The log + * reappears if it receives new entries. Log entries written shortly before + * the delete operation might not be deleted. Entries received after the + * delete operation with a timestamp before the operation will be deleted. * * @param {Object} request * The request object that will be sent. * @param {string} request.logName * Required. The resource name of the log to delete: * - * "projects/[PROJECT_ID]/logs/[LOG_ID]" - * "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" - * "folders/[FOLDER_ID]/logs/[LOG_ID]" + * * `projects/[PROJECT_ID]/logs/[LOG_ID]` + * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` + * * `folders/[FOLDER_ID]/logs/[LOG_ID]` * * `[LOG_ID]` must be URL-encoded. For example, * `"projects/my-project-id/logs/syslog"`, - * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. + * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`. + * * For more information about log names, see * {@link google.logging.v2.LogEntry|LogEntry}. * @param {object} [options] @@ -553,15 +578,15 @@ export class LoggingServiceV2Client { * Optional. A default log resource name that is assigned to all log entries * in `entries` that do not specify a value for `log_name`: * - * "projects/[PROJECT_ID]/logs/[LOG_ID]" - * "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" - * "folders/[FOLDER_ID]/logs/[LOG_ID]" + * * `projects/[PROJECT_ID]/logs/[LOG_ID]` + * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` + * * `folders/[FOLDER_ID]/logs/[LOG_ID]` * * `[LOG_ID]` must be URL-encoded. For example: * * "projects/my-project-id/logs/syslog" - * "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity" + * "organizations/123/logs/cloudaudit.googleapis.com%2Factivity" * * The permission `logging.logEntries.create` is needed on each project, * organization, billing account, or folder that is receiving new log @@ -596,14 +621,14 @@ export class LoggingServiceV2Client { * the entries later in the list. See the `entries.list` method. * * Log entries with timestamps that are more than the - * [logs retention period](https://cloud.google.com/logging/quota-policy) in + * [logs retention period](https://cloud.google.com/logging/quotas) in * the past or more than 24 hours in the future will not be available when * calling `entries.list`. However, those log entries can still be [exported * with * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). * * To improve throughput and to avoid exceeding the - * [quota limit](https://cloud.google.com/logging/quota-policy) for calls to + * [quota limit](https://cloud.google.com/logging/quotas) for calls to * `entries.write`, you should try to include several log entries in this * list, rather than calling this method for each individual log entry. * @param {boolean} [request.partialSuccess] @@ -722,16 +747,17 @@ export class LoggingServiceV2Client { * Required. Names of one or more parent resources from which to * retrieve log entries: * - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` + * + * May alternatively be one or more views: * - * May alternatively be one or more views - * projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] - * organization/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] - * billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] - * folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] + * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` * * Projects listed in the `project_ids` field are added to this list. * @param {string} [request.filter] @@ -750,10 +776,10 @@ export class LoggingServiceV2Client { * in order of decreasing timestamps (newest first). Entries with equal * timestamps are returned in order of their `insert_id` values. * @param {number} [request.pageSize] - * Optional. The maximum number of results to return from this request. - * Default is 50. If the value is negative or exceeds 1000, - * the request is rejected. The presence of `next_page_token` in the - * response indicates that more results might be available. + * Optional. The maximum number of results to return from this request. Default is 50. + * If the value is negative or exceeds 1000, the request is rejected. The + * presence of `next_page_token` in the response indicates that more results + * might be available. * @param {string} [request.pageToken] * Optional. If present, then retrieve the next batch of results from the * preceding call to this method. `page_token` must be the value of @@ -843,16 +869,17 @@ export class LoggingServiceV2Client { * Required. Names of one or more parent resources from which to * retrieve log entries: * - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` + * + * May alternatively be one or more views: * - * May alternatively be one or more views - * projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] - * organization/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] - * billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] - * folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] + * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` * * Projects listed in the `project_ids` field are added to this list. * @param {string} [request.filter] @@ -871,10 +898,10 @@ export class LoggingServiceV2Client { * in order of decreasing timestamps (newest first). Entries with equal * timestamps are returned in order of their `insert_id` values. * @param {number} [request.pageSize] - * Optional. The maximum number of results to return from this request. - * Default is 50. If the value is negative or exceeds 1000, - * the request is rejected. The presence of `next_page_token` in the - * response indicates that more results might be available. + * Optional. The maximum number of results to return from this request. Default is 50. + * If the value is negative or exceeds 1000, the request is rejected. The + * presence of `next_page_token` in the response indicates that more results + * might be available. * @param {string} [request.pageToken] * Optional. If present, then retrieve the next batch of results from the * preceding call to this method. `page_token` must be the value of @@ -920,16 +947,17 @@ export class LoggingServiceV2Client { * Required. Names of one or more parent resources from which to * retrieve log entries: * - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` * - * May alternatively be one or more views - * projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] - * organization/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] - * billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] - * folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] + * May alternatively be one or more views: + * + * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` * * Projects listed in the `project_ids` field are added to this list. * @param {string} [request.filter] @@ -948,10 +976,10 @@ export class LoggingServiceV2Client { * in order of decreasing timestamps (newest first). Entries with equal * timestamps are returned in order of their `insert_id` values. * @param {number} [request.pageSize] - * Optional. The maximum number of results to return from this request. - * Default is 50. If the value is negative or exceeds 1000, - * the request is rejected. The presence of `next_page_token` in the - * response indicates that more results might be available. + * Optional. The maximum number of results to return from this request. Default is 50. + * If the value is negative or exceeds 1000, the request is rejected. The + * presence of `next_page_token` in the response indicates that more results + * might be available. * @param {string} [request.pageToken] * Optional. If present, then retrieve the next batch of results from the * preceding call to this method. `page_token` must be the value of @@ -1188,10 +1216,10 @@ export class LoggingServiceV2Client { * @param {string} request.parent * Required. The resource name that owns the logs: * - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` * @param {number} [request.pageSize] * Optional. The maximum number of results to return from this request. * Non-positive values are ignored. The presence of `nextPageToken` in the @@ -1203,16 +1231,18 @@ export class LoggingServiceV2Client { * parameters should be identical to those in the previous call. * @param {string[]} [request.resourceNames] * Optional. The resource name that owns the logs: - * projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] - * organization/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] - * billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] - * folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] + * + * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` * * To support legacy queries, it could also be: - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" + * + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1300,10 +1330,10 @@ export class LoggingServiceV2Client { * @param {string} request.parent * Required. The resource name that owns the logs: * - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` * @param {number} [request.pageSize] * Optional. The maximum number of results to return from this request. * Non-positive values are ignored. The presence of `nextPageToken` in the @@ -1315,16 +1345,18 @@ export class LoggingServiceV2Client { * parameters should be identical to those in the previous call. * @param {string[]} [request.resourceNames] * Optional. The resource name that owns the logs: - * projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] - * organization/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] - * billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] - * folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] + * + * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` * * To support legacy queries, it could also be: - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" + * + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -1368,10 +1400,10 @@ export class LoggingServiceV2Client { * @param {string} request.parent * Required. The resource name that owns the logs: * - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` * @param {number} [request.pageSize] * Optional. The maximum number of results to return from this request. * Non-positive values are ignored. The presence of `nextPageToken` in the @@ -1383,16 +1415,18 @@ export class LoggingServiceV2Client { * parameters should be identical to those in the previous call. * @param {string[]} [request.resourceNames] * Optional. The resource name that owns the logs: - * projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] - * organization/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] - * billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] - * folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] + * + * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` * * To support legacy queries, it could also be: - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" + * + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} @@ -1692,6 +1726,33 @@ export class LoggingServiceV2Client { ).log; } + /** + * Return a fully-qualified billingAccountSettings resource name string. + * + * @param {string} billing_account + * @returns {string} Resource name string. + */ + billingAccountSettingsPath(billingAccount: string) { + return this.pathTemplates.billingAccountSettingsPathTemplate.render({ + billing_account: billingAccount, + }); + } + + /** + * Parse the billing_account from BillingAccountSettings resource. + * + * @param {string} billingAccountSettingsName + * A fully-qualified path representing billing_account_settings resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountSettingsName( + billingAccountSettingsName: string + ) { + return this.pathTemplates.billingAccountSettingsPathTemplate.match( + billingAccountSettingsName + ).billing_account; + } + /** * Return a fully-qualified billingAccountSink resource name string. * @@ -1973,6 +2034,31 @@ export class LoggingServiceV2Client { return this.pathTemplates.folderLogPathTemplate.match(folderLogName).log; } + /** + * Return a fully-qualified folderSettings resource name string. + * + * @param {string} folder + * @returns {string} Resource name string. + */ + folderSettingsPath(folder: string) { + return this.pathTemplates.folderSettingsPathTemplate.render({ + folder: folder, + }); + } + + /** + * Parse the folder from FolderSettings resource. + * + * @param {string} folderSettingsName + * A fully-qualified path representing folder_settings resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSettingsName(folderSettingsName: string) { + return this.pathTemplates.folderSettingsPathTemplate.match( + folderSettingsName + ).folder; + } + /** * Return a fully-qualified folderSink resource name string. * @@ -2308,6 +2394,33 @@ export class LoggingServiceV2Client { ).log; } + /** + * Return a fully-qualified organizationSettings resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationSettingsPath(organization: string) { + return this.pathTemplates.organizationSettingsPathTemplate.render({ + organization: organization, + }); + } + + /** + * Parse the organization from OrganizationSettings resource. + * + * @param {string} organizationSettingsName + * A fully-qualified path representing organization_settings resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSettingsName( + organizationSettingsName: string + ) { + return this.pathTemplates.organizationSettingsPathTemplate.match( + organizationSettingsName + ).organization; + } + /** * Return a fully-qualified organizationSink resource name string. * @@ -2613,6 +2726,31 @@ export class LoggingServiceV2Client { return this.pathTemplates.projectLogPathTemplate.match(projectLogName).log; } + /** + * Return a fully-qualified projectSettings resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectSettingsPath(project: string) { + return this.pathTemplates.projectSettingsPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from ProjectSettings resource. + * + * @param {string} projectSettingsName + * A fully-qualified path representing project_settings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSettingsName(projectSettingsName: string) { + return this.pathTemplates.projectSettingsPathTemplate.match( + projectSettingsName + ).project; + } + /** * Return a fully-qualified projectSink resource name string. * @@ -2658,9 +2796,8 @@ export class LoggingServiceV2Client { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.loggingServiceV2Stub!.then(stub => { + if (this.loggingServiceV2Stub && !this._terminated) { + return this.loggingServiceV2Stub.then(stub => { this._terminated = true; stub.close(); }); diff --git a/src/v2/metrics_service_v2_client.ts b/src/v2/metrics_service_v2_client.ts index 49d9eaf7..53055f9a 100644 --- a/src/v2/metrics_service_v2_client.ts +++ b/src/v2/metrics_service_v2_client.ts @@ -181,6 +181,9 @@ export class MetricsServiceV2Client { billingAccountLogPathTemplate: new this._gaxModule.PathTemplate( 'billingAccounts/{billing_account}/logs/{log}' ), + billingAccountSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'billingAccounts/{billing_account}/settings' + ), billingAccountSinkPathTemplate: new this._gaxModule.PathTemplate( 'billingAccounts/{billing_account}/sinks/{sink}' ), @@ -199,6 +202,9 @@ export class MetricsServiceV2Client { folderLogPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/logs/{log}' ), + folderSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/settings' + ), folderSinkPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/sinks/{sink}' ), @@ -221,6 +227,9 @@ export class MetricsServiceV2Client { organizationLogPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/logs/{log}' ), + organizationSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/settings' + ), organizationSinkPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/sinks/{sink}' ), @@ -242,6 +251,9 @@ export class MetricsServiceV2Client { projectLogPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/logs/{log}' ), + projectSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/settings' + ), projectSinkPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/sinks/{sink}' ), @@ -1220,6 +1232,33 @@ export class MetricsServiceV2Client { ).log; } + /** + * Return a fully-qualified billingAccountSettings resource name string. + * + * @param {string} billing_account + * @returns {string} Resource name string. + */ + billingAccountSettingsPath(billingAccount: string) { + return this.pathTemplates.billingAccountSettingsPathTemplate.render({ + billing_account: billingAccount, + }); + } + + /** + * Parse the billing_account from BillingAccountSettings resource. + * + * @param {string} billingAccountSettingsName + * A fully-qualified path representing billing_account_settings resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountSettingsName( + billingAccountSettingsName: string + ) { + return this.pathTemplates.billingAccountSettingsPathTemplate.match( + billingAccountSettingsName + ).billing_account; + } + /** * Return a fully-qualified billingAccountSink resource name string. * @@ -1501,6 +1540,31 @@ export class MetricsServiceV2Client { return this.pathTemplates.folderLogPathTemplate.match(folderLogName).log; } + /** + * Return a fully-qualified folderSettings resource name string. + * + * @param {string} folder + * @returns {string} Resource name string. + */ + folderSettingsPath(folder: string) { + return this.pathTemplates.folderSettingsPathTemplate.render({ + folder: folder, + }); + } + + /** + * Parse the folder from FolderSettings resource. + * + * @param {string} folderSettingsName + * A fully-qualified path representing folder_settings resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSettingsName(folderSettingsName: string) { + return this.pathTemplates.folderSettingsPathTemplate.match( + folderSettingsName + ).folder; + } + /** * Return a fully-qualified folderSink resource name string. * @@ -1836,6 +1900,33 @@ export class MetricsServiceV2Client { ).log; } + /** + * Return a fully-qualified organizationSettings resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationSettingsPath(organization: string) { + return this.pathTemplates.organizationSettingsPathTemplate.render({ + organization: organization, + }); + } + + /** + * Parse the organization from OrganizationSettings resource. + * + * @param {string} organizationSettingsName + * A fully-qualified path representing organization_settings resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSettingsName( + organizationSettingsName: string + ) { + return this.pathTemplates.organizationSettingsPathTemplate.match( + organizationSettingsName + ).organization; + } + /** * Return a fully-qualified organizationSink resource name string. * @@ -2141,6 +2232,31 @@ export class MetricsServiceV2Client { return this.pathTemplates.projectLogPathTemplate.match(projectLogName).log; } + /** + * Return a fully-qualified projectSettings resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectSettingsPath(project: string) { + return this.pathTemplates.projectSettingsPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from ProjectSettings resource. + * + * @param {string} projectSettingsName + * A fully-qualified path representing project_settings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSettingsName(projectSettingsName: string) { + return this.pathTemplates.projectSettingsPathTemplate.match( + projectSettingsName + ).project; + } + /** * Return a fully-qualified projectSink resource name string. * @@ -2186,9 +2302,8 @@ export class MetricsServiceV2Client { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.metricsServiceV2Stub!.then(stub => { + if (this.metricsServiceV2Stub && !this._terminated) { + return this.metricsServiceV2Stub.then(stub => { this._terminated = true; stub.close(); }); diff --git a/test/gapic_config_service_v2_v2.ts b/test/gapic_config_service_v2_v2.ts index 5c29dd67..46fada99 100644 --- a/test/gapic_config_service_v2_v2.ts +++ b/test/gapic_config_service_v2_v2.ts @@ -25,7 +25,7 @@ import * as configservicev2Module from '../src'; import {PassThrough} from 'stream'; -import {protobuf} from 'google-gax'; +import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { const filledObject = ( @@ -51,6 +51,38 @@ function stubSimpleCallWithCallback( : sinon.stub().callsArgWith(2, null, response); } +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + function stubPageStreamingCall( responses?: ResponseType[], error?: Error @@ -153,12 +185,27 @@ describe('v2.ConfigServiceV2Client', () => { assert(client.configServiceV2Stub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.configServiceV2Stub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { const client = new configservicev2Module.v2.ConfigServiceV2Client({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + assert.strictEqual(client.configServiceV2Stub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -301,6 +348,22 @@ describe('v2.ConfigServiceV2Client', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getBucket with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetBucketRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getBucket(request), expectedError); + }); }); describe('createBucket', () => { @@ -412,6 +475,22 @@ describe('v2.ConfigServiceV2Client', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes createBucket with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateBucketRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createBucket(request), expectedError); + }); }); describe('updateBucket', () => { @@ -523,6 +602,22 @@ describe('v2.ConfigServiceV2Client', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateBucket with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateBucketRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateBucket(request), expectedError); + }); }); describe('deleteBucket', () => { @@ -634,6 +729,22 @@ describe('v2.ConfigServiceV2Client', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes deleteBucket with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteBucketRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteBucket(request), expectedError); + }); }); describe('undeleteBucket', () => { @@ -745,6 +856,22 @@ describe('v2.ConfigServiceV2Client', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes undeleteBucket with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UndeleteBucketRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.undeleteBucket(request), expectedError); + }); }); describe('getView', () => { @@ -853,6 +980,22 @@ describe('v2.ConfigServiceV2Client', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getView with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetViewRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getView(request), expectedError); + }); }); describe('createView', () => { @@ -964,6 +1107,22 @@ describe('v2.ConfigServiceV2Client', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes createView with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateViewRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createView(request), expectedError); + }); }); describe('updateView', () => { @@ -1075,6 +1234,22 @@ describe('v2.ConfigServiceV2Client', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateView with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateViewRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateView(request), expectedError); + }); }); describe('deleteView', () => { @@ -1186,6 +1361,22 @@ describe('v2.ConfigServiceV2Client', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes deleteView with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteViewRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteView(request), expectedError); + }); }); describe('getSink', () => { @@ -1294,6 +1485,22 @@ describe('v2.ConfigServiceV2Client', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getSink with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetSinkRequest() + ); + request.sinkName = ''; + const expectedHeaderRequestParams = 'sink_name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSink(request), expectedError); + }); }); describe('createSink', () => { @@ -1405,6 +1612,22 @@ describe('v2.ConfigServiceV2Client', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes createSink with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateSinkRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createSink(request), expectedError); + }); }); describe('updateSink', () => { @@ -1516,6 +1739,22 @@ describe('v2.ConfigServiceV2Client', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateSink with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateSinkRequest() + ); + request.sinkName = ''; + const expectedHeaderRequestParams = 'sink_name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateSink(request), expectedError); + }); }); describe('deleteSink', () => { @@ -1627,6 +1866,22 @@ describe('v2.ConfigServiceV2Client', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes deleteSink with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteSinkRequest() + ); + request.sinkName = ''; + const expectedHeaderRequestParams = 'sink_name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteSink(request), expectedError); + }); }); describe('getExclusion', () => { @@ -1738,6 +1993,22 @@ describe('v2.ConfigServiceV2Client', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getExclusion with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetExclusionRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getExclusion(request), expectedError); + }); }); describe('createExclusion', () => { @@ -1849,6 +2120,22 @@ describe('v2.ConfigServiceV2Client', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes createExclusion with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateExclusionRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createExclusion(request), expectedError); + }); }); describe('updateExclusion', () => { @@ -1960,6 +2247,22 @@ describe('v2.ConfigServiceV2Client', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateExclusion with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateExclusionRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateExclusion(request), expectedError); + }); }); describe('deleteExclusion', () => { @@ -2071,17 +2374,415 @@ describe('v2.ConfigServiceV2Client', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes deleteExclusion with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteExclusionRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteExclusion(request), expectedError); + }); + }); + + describe('getCmekSettings', () => { + it('invokes getCmekSettings without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetCmekSettingsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.CmekSettings() + ); + client.innerApiCalls.getCmekSettings = stubSimpleCall(expectedResponse); + const [response] = await client.getCmekSettings(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getCmekSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getCmekSettings without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetCmekSettingsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.CmekSettings() + ); + client.innerApiCalls.getCmekSettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCmekSettings( + request, + ( + err?: Error | null, + result?: protos.google.logging.v2.ICmekSettings | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getCmekSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getCmekSettings with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetCmekSettingsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getCmekSettings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getCmekSettings(request), expectedError); + assert( + (client.innerApiCalls.getCmekSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getCmekSettings with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetCmekSettingsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getCmekSettings(request), expectedError); + }); + }); + + describe('updateCmekSettings', () => { + it('invokes updateCmekSettings without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateCmekSettingsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.CmekSettings() + ); + client.innerApiCalls.updateCmekSettings = + stubSimpleCall(expectedResponse); + const [response] = await client.updateCmekSettings(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateCmekSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateCmekSettings without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateCmekSettingsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.CmekSettings() + ); + client.innerApiCalls.updateCmekSettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCmekSettings( + request, + ( + err?: Error | null, + result?: protos.google.logging.v2.ICmekSettings | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateCmekSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateCmekSettings with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateCmekSettingsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCmekSettings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateCmekSettings(request), expectedError); + assert( + (client.innerApiCalls.updateCmekSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateCmekSettings with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateCmekSettingsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateCmekSettings(request), expectedError); + }); + }); + + describe('getSettings', () => { + it('invokes getSettings without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetSettingsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.Settings() + ); + client.innerApiCalls.getSettings = stubSimpleCall(expectedResponse); + const [response] = await client.getSettings(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getSettings without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetSettingsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.Settings() + ); + client.innerApiCalls.getSettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSettings( + request, + ( + err?: Error | null, + result?: protos.google.logging.v2.ISettings | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getSettings with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetSettingsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getSettings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getSettings(request), expectedError); + assert( + (client.innerApiCalls.getSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getSettings with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetSettingsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSettings(request), expectedError); + }); }); - describe('getCmekSettings', () => { - it('invokes getCmekSettings without error', async () => { + describe('updateSettings', () => { + it('invokes updateSettings without error', async () => { const client = new configservicev2Module.v2.ConfigServiceV2Client({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.logging.v2.GetCmekSettingsRequest() + new protos.google.logging.v2.UpdateSettingsRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -2093,26 +2794,26 @@ describe('v2.ConfigServiceV2Client', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.logging.v2.CmekSettings() + new protos.google.logging.v2.Settings() ); - client.innerApiCalls.getCmekSettings = stubSimpleCall(expectedResponse); - const [response] = await client.getCmekSettings(request); + client.innerApiCalls.updateSettings = stubSimpleCall(expectedResponse); + const [response] = await client.updateSettings(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.getCmekSettings as SinonStub) + (client.innerApiCalls.updateSettings as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes getCmekSettings without error using callback', async () => { + it('invokes updateSettings without error using callback', async () => { const client = new configservicev2Module.v2.ConfigServiceV2Client({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.logging.v2.GetCmekSettingsRequest() + new protos.google.logging.v2.UpdateSettingsRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -2124,16 +2825,16 @@ describe('v2.ConfigServiceV2Client', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.logging.v2.CmekSettings() + new protos.google.logging.v2.Settings() ); - client.innerApiCalls.getCmekSettings = + client.innerApiCalls.updateSettings = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.getCmekSettings( + client.updateSettings( request, ( err?: Error | null, - result?: protos.google.logging.v2.ICmekSettings | null + result?: protos.google.logging.v2.ISettings | null ) => { if (err) { reject(err); @@ -2146,20 +2847,20 @@ describe('v2.ConfigServiceV2Client', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.getCmekSettings as SinonStub) + (client.innerApiCalls.updateSettings as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes getCmekSettings with error', async () => { + it('invokes updateSettings with error', async () => { const client = new configservicev2Module.v2.ConfigServiceV2Client({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.logging.v2.GetCmekSettingsRequest() + new protos.google.logging.v2.UpdateSettingsRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -2171,81 +2872,85 @@ describe('v2.ConfigServiceV2Client', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.getCmekSettings = stubSimpleCall( + client.innerApiCalls.updateSettings = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.getCmekSettings(request), expectedError); + await assert.rejects(client.updateSettings(request), expectedError); assert( - (client.innerApiCalls.getCmekSettings as SinonStub) + (client.innerApiCalls.updateSettings as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - }); - describe('updateCmekSettings', () => { - it('invokes updateCmekSettings without error', async () => { + it('invokes updateSettings with closed client', async () => { const client = new configservicev2Module.v2.ConfigServiceV2Client({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.logging.v2.UpdateCmekSettingsRequest() + new protos.google.logging.v2.UpdateSettingsRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateSettings(request), expectedError); + }); + }); + + describe('copyLogEntries', () => { + it('invokes copyLogEntries without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CopyLogEntriesRequest() + ); + const expectedOptions = {otherArgs: {headers: {}}}; const expectedResponse = generateSampleMessage( - new protos.google.logging.v2.CmekSettings() + new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateCmekSettings = - stubSimpleCall(expectedResponse); - const [response] = await client.updateCmekSettings(request); + client.innerApiCalls.copyLogEntries = + stubLongRunningCall(expectedResponse); + const [operation] = await client.copyLogEntries(request); + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.updateCmekSettings as SinonStub) + (client.innerApiCalls.copyLogEntries as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes updateCmekSettings without error using callback', async () => { + it('invokes copyLogEntries without error using callback', async () => { const client = new configservicev2Module.v2.ConfigServiceV2Client({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.logging.v2.UpdateCmekSettingsRequest() + new protos.google.logging.v2.CopyLogEntriesRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const expectedOptions = {otherArgs: {headers: {}}}; const expectedResponse = generateSampleMessage( - new protos.google.logging.v2.CmekSettings() + new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateCmekSettings = - stubSimpleCallWithCallback(expectedResponse); + client.innerApiCalls.copyLogEntries = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateCmekSettings( + client.copyLogEntries( request, ( err?: Error | null, - result?: protos.google.logging.v2.ICmekSettings | null + result?: LROperation< + protos.google.logging.v2.ICopyLogEntriesResponse, + protos.google.logging.v2.ICopyLogEntriesMetadata + > | null ) => { if (err) { reject(err); @@ -2255,45 +2960,107 @@ describe('v2.ConfigServiceV2Client', () => { } ); }); - const response = await promise; + const operation = (await promise) as LROperation< + protos.google.logging.v2.ICopyLogEntriesResponse, + protos.google.logging.v2.ICopyLogEntriesMetadata + >; + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.updateCmekSettings as SinonStub) + (client.innerApiCalls.copyLogEntries as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes updateCmekSettings with error', async () => { + it('invokes copyLogEntries with call error', async () => { const client = new configservicev2Module.v2.ConfigServiceV2Client({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.logging.v2.UpdateCmekSettingsRequest() + new protos.google.logging.v2.CopyLogEntriesRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const expectedOptions = {otherArgs: {headers: {}}}; const expectedError = new Error('expected'); - client.innerApiCalls.updateCmekSettings = stubSimpleCall( + client.innerApiCalls.copyLogEntries = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.updateCmekSettings(request), expectedError); + await assert.rejects(client.copyLogEntries(request), expectedError); assert( - (client.innerApiCalls.updateCmekSettings as SinonStub) + (client.innerApiCalls.copyLogEntries as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes copyLogEntries with LRO error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CopyLogEntriesRequest() + ); + const expectedOptions = {otherArgs: {headers: {}}}; + const expectedError = new Error('expected'); + client.innerApiCalls.copyLogEntries = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.copyLogEntries(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.copyLogEntries as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes checkCopyLogEntriesProgress without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCopyLogEntriesProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCopyLogEntriesProgress with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCopyLogEntriesProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); }); describe('listBuckets', () => { @@ -3741,6 +4508,51 @@ describe('v2.ConfigServiceV2Client', () => { }); }); + describe('billingAccountSettings', () => { + const fakePath = '/rendered/path/billingAccountSettings'; + const expectedParameters = { + billing_account: 'billingAccountValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.billingAccountSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.billingAccountSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('billingAccountSettingsPath', () => { + const result = client.billingAccountSettingsPath('billingAccountValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.billingAccountSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchBillingAccountFromBillingAccountSettingsName', () => { + const result = + client.matchBillingAccountFromBillingAccountSettingsName(fakePath); + assert.strictEqual(result, 'billingAccountValue'); + assert( + ( + client.pathTemplates.billingAccountSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('billingAccountSink', () => { const fakePath = '/rendered/path/billingAccountSink'; const expectedParameters = { @@ -4120,6 +4932,44 @@ describe('v2.ConfigServiceV2Client', () => { }); }); + describe('folderSettings', () => { + const fakePath = '/rendered/path/folderSettings'; + const expectedParameters = { + folder: 'folderValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderSettingsPath', () => { + const result = client.folderSettingsPath('folderValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderSettingsPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderSettingsName', () => { + const result = client.matchFolderFromFolderSettingsName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderSettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('folderSink', () => { const fakePath = '/rendered/path/folderSink'; const expectedParameters = { @@ -4602,6 +5452,51 @@ describe('v2.ConfigServiceV2Client', () => { }); }); + describe('organizationSettings', () => { + const fakePath = '/rendered/path/organizationSettings'; + const expectedParameters = { + organization: 'organizationValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationSettingsPath', () => { + const result = client.organizationSettingsPath('organizationValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationSettingsName', () => { + const result = + client.matchOrganizationFromOrganizationSettingsName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('organizationSink', () => { const fakePath = '/rendered/path/organizationSink'; const expectedParameters = { @@ -5018,6 +5913,44 @@ describe('v2.ConfigServiceV2Client', () => { }); }); + describe('projectSettings', () => { + const fakePath = '/rendered/path/projectSettings'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectSettingsPath', () => { + const result = client.projectSettingsPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectSettingsPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectSettingsName', () => { + const result = client.matchProjectFromProjectSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectSettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('projectSink', () => { const fakePath = '/rendered/path/projectSink'; const expectedParameters = { diff --git a/test/gapic_logging_service_v2_v2.ts b/test/gapic_logging_service_v2_v2.ts index dd1b37cb..3d1025fd 100644 --- a/test/gapic_logging_service_v2_v2.ts +++ b/test/gapic_logging_service_v2_v2.ts @@ -167,12 +167,27 @@ describe('v2.LoggingServiceV2Client', () => { assert(client.loggingServiceV2Stub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.loggingServiceV2Stub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.loggingServiceV2Stub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -315,6 +330,22 @@ describe('v2.LoggingServiceV2Client', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes deleteLog with closed client', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteLogRequest() + ); + request.logName = ''; + const expectedHeaderRequestParams = 'log_name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteLog(request), expectedError); + }); }); describe('writeLogEntries', () => { @@ -402,6 +433,20 @@ describe('v2.LoggingServiceV2Client', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes writeLogEntries with closed client', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.WriteLogEntriesRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.writeLogEntries(request), expectedError); + }); }); describe('tailLogEntries', () => { @@ -1577,6 +1622,51 @@ describe('v2.LoggingServiceV2Client', () => { }); }); + describe('billingAccountSettings', () => { + const fakePath = '/rendered/path/billingAccountSettings'; + const expectedParameters = { + billing_account: 'billingAccountValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.billingAccountSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.billingAccountSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('billingAccountSettingsPath', () => { + const result = client.billingAccountSettingsPath('billingAccountValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.billingAccountSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchBillingAccountFromBillingAccountSettingsName', () => { + const result = + client.matchBillingAccountFromBillingAccountSettingsName(fakePath); + assert.strictEqual(result, 'billingAccountValue'); + assert( + ( + client.pathTemplates.billingAccountSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('billingAccountSink', () => { const fakePath = '/rendered/path/billingAccountSink'; const expectedParameters = { @@ -1956,6 +2046,44 @@ describe('v2.LoggingServiceV2Client', () => { }); }); + describe('folderSettings', () => { + const fakePath = '/rendered/path/folderSettings'; + const expectedParameters = { + folder: 'folderValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderSettingsPath', () => { + const result = client.folderSettingsPath('folderValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderSettingsPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderSettingsName', () => { + const result = client.matchFolderFromFolderSettingsName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderSettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('folderSink', () => { const fakePath = '/rendered/path/folderSink'; const expectedParameters = { @@ -2389,6 +2517,51 @@ describe('v2.LoggingServiceV2Client', () => { }); }); + describe('organizationSettings', () => { + const fakePath = '/rendered/path/organizationSettings'; + const expectedParameters = { + organization: 'organizationValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationSettingsPath', () => { + const result = client.organizationSettingsPath('organizationValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationSettingsName', () => { + const result = + client.matchOrganizationFromOrganizationSettingsName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('organizationSink', () => { const fakePath = '/rendered/path/organizationSink'; const expectedParameters = { @@ -2805,6 +2978,44 @@ describe('v2.LoggingServiceV2Client', () => { }); }); + describe('projectSettings', () => { + const fakePath = '/rendered/path/projectSettings'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectSettingsPath', () => { + const result = client.projectSettingsPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectSettingsPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectSettingsName', () => { + const result = client.matchProjectFromProjectSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectSettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('projectSink', () => { const fakePath = '/rendered/path/projectSink'; const expectedParameters = { diff --git a/test/gapic_metrics_service_v2_v2.ts b/test/gapic_metrics_service_v2_v2.ts index 3bf3b917..b7b0c027 100644 --- a/test/gapic_metrics_service_v2_v2.ts +++ b/test/gapic_metrics_service_v2_v2.ts @@ -153,12 +153,27 @@ describe('v2.MetricsServiceV2Client', () => { assert(client.metricsServiceV2Stub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.metricsServiceV2Stub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.metricsServiceV2Stub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -304,6 +319,22 @@ describe('v2.MetricsServiceV2Client', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getLogMetric with closed client', async () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetLogMetricRequest() + ); + request.metricName = ''; + const expectedHeaderRequestParams = 'metric_name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getLogMetric(request), expectedError); + }); }); describe('createLogMetric', () => { @@ -415,6 +446,22 @@ describe('v2.MetricsServiceV2Client', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes createLogMetric with closed client', async () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateLogMetricRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createLogMetric(request), expectedError); + }); }); describe('updateLogMetric', () => { @@ -526,6 +573,22 @@ describe('v2.MetricsServiceV2Client', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateLogMetric with closed client', async () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateLogMetricRequest() + ); + request.metricName = ''; + const expectedHeaderRequestParams = 'metric_name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateLogMetric(request), expectedError); + }); }); describe('deleteLogMetric', () => { @@ -637,6 +700,22 @@ describe('v2.MetricsServiceV2Client', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes deleteLogMetric with closed client', async () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteLogMetricRequest() + ); + request.metricName = ''; + const expectedHeaderRequestParams = 'metric_name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteLogMetric(request), expectedError); + }); }); describe('listLogMetrics', () => { @@ -1265,6 +1344,51 @@ describe('v2.MetricsServiceV2Client', () => { }); }); + describe('billingAccountSettings', () => { + const fakePath = '/rendered/path/billingAccountSettings'; + const expectedParameters = { + billing_account: 'billingAccountValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.billingAccountSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.billingAccountSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('billingAccountSettingsPath', () => { + const result = client.billingAccountSettingsPath('billingAccountValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.billingAccountSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchBillingAccountFromBillingAccountSettingsName', () => { + const result = + client.matchBillingAccountFromBillingAccountSettingsName(fakePath); + assert.strictEqual(result, 'billingAccountValue'); + assert( + ( + client.pathTemplates.billingAccountSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('billingAccountSink', () => { const fakePath = '/rendered/path/billingAccountSink'; const expectedParameters = { @@ -1644,6 +1768,44 @@ describe('v2.MetricsServiceV2Client', () => { }); }); + describe('folderSettings', () => { + const fakePath = '/rendered/path/folderSettings'; + const expectedParameters = { + folder: 'folderValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderSettingsPath', () => { + const result = client.folderSettingsPath('folderValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderSettingsPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderSettingsName', () => { + const result = client.matchFolderFromFolderSettingsName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderSettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('folderSink', () => { const fakePath = '/rendered/path/folderSink'; const expectedParameters = { @@ -2077,6 +2239,51 @@ describe('v2.MetricsServiceV2Client', () => { }); }); + describe('organizationSettings', () => { + const fakePath = '/rendered/path/organizationSettings'; + const expectedParameters = { + organization: 'organizationValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationSettingsPath', () => { + const result = client.organizationSettingsPath('organizationValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationSettingsName', () => { + const result = + client.matchOrganizationFromOrganizationSettingsName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('organizationSink', () => { const fakePath = '/rendered/path/organizationSink'; const expectedParameters = { @@ -2493,6 +2700,44 @@ describe('v2.MetricsServiceV2Client', () => { }); }); + describe('projectSettings', () => { + const fakePath = '/rendered/path/projectSettings'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectSettingsPath', () => { + const result = client.projectSettingsPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectSettingsPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectSettingsName', () => { + const result = client.matchProjectFromProjectSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectSettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('projectSink', () => { const fakePath = '/rendered/path/projectSink'; const expectedParameters = {